Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 283231
b: refs/heads/master
c: d97c6ad
h: refs/heads/master
i:
  283229: e1b962e
  283227: 9128762
  283223: 2ad227f
  283215: 392abce
  283199: 1b88774
v: v3
  • Loading branch information
Stefan Berger authored and Rajiv Andrade committed Nov 16, 2011
1 parent 9b86397 commit a148569
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2b30a90f6c358714b9d6e628ac92e514917f93a1
refs/heads/master: d97c6ade5926afb6d52df36c33a3491d62cd0dc0
30 changes: 23 additions & 7 deletions trunk/drivers/char/tpm/tpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -611,15 +611,31 @@ int tpm_get_timeouts(struct tpm_chip *chip)
}
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

static struct tpm_input_header continue_selftest_header = {
.tag = TPM_TAG_RQU_COMMAND,
.length = cpu_to_be32(10),
.ordinal = cpu_to_be32(TPM_ORD_CONTINUE_SELFTEST),
};

/**
* 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)
{
u8 data[] = {
0, 193, /* TPM_TAG_RQU_COMMAND */
0, 0, 0, 10, /* length */
0, 0, 0, 83, /* TPM_ORD_ContinueSelfTest */
};
int rc;
struct tpm_cmd_t cmd;

tpm_transmit(chip, data, sizeof(data));
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);

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/char/tpm/tpm.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ ssize_t tpm_getcap(struct device *, __be32, cap_t *, const char *);

extern int tpm_get_timeouts(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 struct tpm_chip* tpm_register_hardware(struct device *,
const struct tpm_vendor_specific *);
Expand Down

0 comments on commit a148569

Please sign in to comment.