From: marcandre.lureau@redhat.com
To: edk2-devel@lists.01.org, devel@edk2.groups.io
Cc: stefanb@linux.ibm.com, lersek@redhat.com,
simon.hardy@itdev.co.uk,
"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: [PATCH v2 2/3] SecurityPkg: export Tpm12GetPtpInterfaceType()
Date: Thu, 13 Feb 2020 14:12:21 +0100 [thread overview]
Message-ID: <20200213131222.157700-3-marcandre.lureau@redhat.com> (raw)
In-Reply-To: <20200213131222.157700-1-marcandre.lureau@redhat.com>
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
SecurityPkg/Include/Library/Tpm12DeviceLib.h | 13 +++++++++++++
.../Library/Tpm12DeviceLibDTpm/Tpm12Tis.c | 17 ++++++++++-------
2 files changed, 23 insertions(+), 7 deletions(-)
diff --git a/SecurityPkg/Include/Library/Tpm12DeviceLib.h b/SecurityPkg/Include/Library/Tpm12DeviceLib.h
index eac7885ca3d8..bcdfbdac76b5 100644
--- a/SecurityPkg/Include/Library/Tpm12DeviceLib.h
+++ b/SecurityPkg/Include/Library/Tpm12DeviceLib.h
@@ -11,6 +11,13 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <IndustryStandard/Tpm12.h>
+typedef enum {
+ PtpInterfaceTis,
+ PtpInterfaceFifo,
+ PtpInterfaceCrb,
+ PtpInterfaceMax,
+} PTP_INTERFACE_TYPE;
+
/**
This service enables the sending of commands to the TPM12.
@@ -45,4 +52,10 @@ Tpm12RequestUseTpm (
VOID
);
+EFIAPI
+PTP_INTERFACE_TYPE
+Tpm12GetPtpInterfaceType (
+ VOID
+ );
+
#endif
diff --git a/SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12Tis.c b/SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12Tis.c
index 1caa076203ba..381915130b7f 100644
--- a/SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12Tis.c
+++ b/SecurityPkg/Library/Tpm12DeviceLibDTpm/Tpm12Tis.c
@@ -15,18 +15,12 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Library/TimerLib.h>
#include <Library/DebugLib.h>
#include <Library/Tpm12CommandLib.h>
+#include <Library/Tpm12DeviceLib.h>
#include <Library/PcdLib.h>
#include <IndustryStandard/TpmPtp.h>
#include <IndustryStandard/TpmTis.h>
-typedef enum {
- PtpInterfaceTis,
- PtpInterfaceFifo,
- PtpInterfaceCrb,
- PtpInterfaceMax,
-} PTP_INTERFACE_TYPE;
-
//
// Max TPM command/reponse length
//
@@ -542,3 +536,12 @@ Tpm12RequestUseTpm (
return EFI_NOT_FOUND;
}
}
+
+EFIAPI
+PTP_INTERFACE_TYPE
+Tpm12GetPtpInterfaceType (
+ VOID
+ )
+{
+ return Tpm12GetPtpInterface ((VOID *) (UINTN) PcdGet64 (PcdTpmBaseAddress));
+}
--
2.25.0.rc2.1.g09a9a1a997
next prev parent reply other threads:[~2020-02-13 13:12 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-13 13:12 [PATCH v2 0/3] Ovmf: enable TPM 1.2 marcandre.lureau
2020-02-13 13:12 ` [PATCH v2 1/3] Ovmf: rename TPM2 config prefix to TPM marcandre.lureau
2020-02-14 18:20 ` [edk2-devel] " Laszlo Ersek
2020-02-13 13:12 ` marcandre.lureau [this message]
2020-02-13 13:12 ` [PATCH v2 3/3] Ovmf: enable TPM 1.2 support marcandre.lureau
2020-02-14 19:47 ` [edk2-devel] " Laszlo Ersek
2020-02-13 13:50 ` [edk2-devel] [PATCH v2 0/3] Ovmf: enable TPM 1.2 Yao, Jiewen
2020-02-15 11:33 ` mlureau
2020-02-15 12:09 ` Yao, Jiewen
2020-02-16 18:54 ` Stefan Berger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200213131222.157700-3-marcandre.lureau@redhat.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox