mirror of
https://github.com/torvalds/linux.git
synced 2024-12-11 13:41:55 +00:00
tpm: Cleanup tpm_continue_selftest
Cleanup the tpm_continue_selftest function. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
This commit is contained in:
parent
2b30a90f6c
commit
d97c6ade59
@ -611,15 +611,31 @@ duration:
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(tpm_get_timeouts);
|
EXPORT_SYMBOL_GPL(tpm_get_timeouts);
|
||||||
|
|
||||||
void tpm_continue_selftest(struct tpm_chip *chip)
|
#define TPM_ORD_CONTINUE_SELFTEST 83
|
||||||
{
|
#define CONTINUE_SELFTEST_RESULT_SIZE 10
|
||||||
u8 data[] = {
|
|
||||||
0, 193, /* TPM_TAG_RQU_COMMAND */
|
static struct tpm_input_header continue_selftest_header = {
|
||||||
0, 0, 0, 10, /* length */
|
.tag = TPM_TAG_RQU_COMMAND,
|
||||||
0, 0, 0, 83, /* TPM_ORD_ContinueSelfTest */
|
.length = cpu_to_be32(10),
|
||||||
|
.ordinal = cpu_to_be32(TPM_ORD_CONTINUE_SELFTEST),
|
||||||
};
|
};
|
||||||
|
|
||||||
tpm_transmit(chip, data, sizeof(data));
|
/**
|
||||||
|
* tpm_continue_selftest -- run TPM's selftest
|
||||||
|
* @chip: TPM chip to use
|
||||||
|
*
|
||||||
|
* Returns 0 on success, < 0 in case of fatal error or a value > 0 representing
|
||||||
|
* a TPM error code.
|
||||||
|
*/
|
||||||
|
int tpm_continue_selftest(struct tpm_chip *chip)
|
||||||
|
{
|
||||||
|
int rc;
|
||||||
|
struct tpm_cmd_t cmd;
|
||||||
|
|
||||||
|
cmd.header.in = continue_selftest_header;
|
||||||
|
rc = transmit_cmd(chip, &cmd, CONTINUE_SELFTEST_RESULT_SIZE,
|
||||||
|
"continue selftest");
|
||||||
|
return rc;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(tpm_continue_selftest);
|
EXPORT_SYMBOL_GPL(tpm_continue_selftest);
|
||||||
|
|
||||||
|
@ -281,7 +281,7 @@ ssize_t tpm_getcap(struct device *, __be32, cap_t *, const char *);
|
|||||||
|
|
||||||
extern int tpm_get_timeouts(struct tpm_chip *);
|
extern int tpm_get_timeouts(struct tpm_chip *);
|
||||||
extern void tpm_gen_interrupt(struct tpm_chip *);
|
extern void tpm_gen_interrupt(struct tpm_chip *);
|
||||||
extern void tpm_continue_selftest(struct tpm_chip *);
|
extern int tpm_continue_selftest(struct tpm_chip *);
|
||||||
extern unsigned long tpm_calc_ordinal_duration(struct tpm_chip *, u32);
|
extern unsigned long tpm_calc_ordinal_duration(struct tpm_chip *, u32);
|
||||||
extern struct tpm_chip* tpm_register_hardware(struct device *,
|
extern struct tpm_chip* tpm_register_hardware(struct device *,
|
||||||
const struct tpm_vendor_specific *);
|
const struct tpm_vendor_specific *);
|
||||||
|
Loading…
Reference in New Issue
Block a user