Make tpm_startup() available for others to call.

Signed-off-by: Stefan Berger <[email protected]>
---
 drivers/char/tpm/tpm-interface.c | 8 +++-----
 drivers/char/tpm/tpm.h           | 7 +++++++
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c
index 792731e..cda8ef6 100644
--- a/drivers/char/tpm/tpm-interface.c
+++ b/drivers/char/tpm/tpm-interface.c
@@ -474,24 +474,22 @@ void tpm_gen_interrupt(struct tpm_chip *chip)
 EXPORT_SYMBOL_GPL(tpm_gen_interrupt);
 
 #define TPM_ORD_STARTUP cpu_to_be32(153)
-#define TPM_ST_CLEAR cpu_to_be16(1)
-#define TPM_ST_STATE cpu_to_be16(2)
-#define TPM_ST_DEACTIVATED cpu_to_be16(3)
 static const struct tpm_input_header tpm_startup_header = {
        .tag = TPM_TAG_RQU_COMMAND,
        .length = cpu_to_be32(12),
        .ordinal = TPM_ORD_STARTUP
 };
 
-static int tpm_startup(struct tpm_chip *chip, __be16 startup_type)
+int tpm_startup(struct tpm_chip *chip, u16 startup_type)
 {
        struct tpm_cmd_t start_cmd;
        start_cmd.header.in = tpm_startup_header;
 
-       start_cmd.params.startup_in.startup_type = startup_type;
+       start_cmd.params.startup_in.startup_type = cpu_to_be16(startup_type);
        return tpm_transmit_cmd(chip, &start_cmd, TPM_INTERNAL_RESULT_SIZE,
                                "attempting to start the TPM");
 }
+EXPORT_SYMBOL_GPL(tpm_startup);
 
 int tpm_get_timeouts(struct tpm_chip *chip)
 {
diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
index 2fb59f8..68510d8 100644
--- a/drivers/char/tpm/tpm.h
+++ b/drivers/char/tpm/tpm.h
@@ -383,6 +383,12 @@ struct tpm_startup_in {
        __be16  startup_type;
 } __packed;
 
+enum tpm_startup_types {
+       TPM_ST_CLEAR            = 0x0001,
+       TPM_ST_STATE            = 0x0002,
+       TPM_ST_DEACTIVATED      = 0x0003,
+};
+
 typedef union {
        struct  tpm_getcap_params_out getcap_out;
        struct  tpm_readpubek_params_out readpubek_out;
@@ -505,6 +511,7 @@ ssize_t tpm_transmit(struct tpm_chip *chip, const char *buf,
                     size_t bufsiz);
 ssize_t tpm_transmit_cmd(struct tpm_chip *chip, void *cmd, int len,
                         const char *desc);
+extern int tpm_startup(struct tpm_chip *, u16 startup_type);
 extern int tpm_get_timeouts(struct tpm_chip *);
 extern void tpm_gen_interrupt(struct tpm_chip *);
 extern int tpm_do_selftest(struct tpm_chip *);
-- 
2.4.3


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
tpmdd-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tpmdd-devel

Reply via email to