Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 227786
b: refs/heads/master
c: c749ba9
h: refs/heads/master
v: v3
  • Loading branch information
Mimi Zohar authored and James Morris committed Nov 28, 2010
1 parent 9ed7a8b commit ae7f1c6
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a0e39349d80d8b5deeb264fb190bd064f7063252
refs/heads/master: c749ba912e87ccebd674ae24b97462176c63732e
16 changes: 16 additions & 0 deletions trunk/drivers/char/tpm/tpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,22 @@ int tpm_pcr_extend(u32 chip_num, int pcr_idx, const u8 *hash)
}
EXPORT_SYMBOL_GPL(tpm_pcr_extend);

int tpm_send(u32 chip_num, void *cmd, size_t buflen)
{
struct tpm_chip *chip;
int rc;

chip = tpm_chip_find_get(chip_num);
if (chip == NULL)
return -ENODEV;

rc = transmit_cmd(chip, cmd, buflen, "attempting tpm_cmd");

tpm_chip_put(chip);
return rc;
}
EXPORT_SYMBOL_GPL(tpm_send);

ssize_t tpm_show_pcrs(struct device *dev, struct device_attribute *attr,
char *buf)
{
Expand Down
4 changes: 4 additions & 0 deletions trunk/include/linux/tpm.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,16 @@

extern int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf);
extern int tpm_pcr_extend(u32 chip_num, int pcr_idx, const u8 *hash);
extern int tpm_send(u32 chip_num, void *cmd, size_t buflen);
#else
static inline int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf) {
return -ENODEV;
}
static inline int tpm_pcr_extend(u32 chip_num, int pcr_idx, const u8 *hash) {
return -ENODEV;
}
static inline int tpm_send(u32 chip_num, void *cmd, size_t buflen) {
return -ENODEV;
}
#endif
#endif

0 comments on commit ae7f1c6

Please sign in to comment.