aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/tpm/tpm_tis.c
diff options
context:
space:
mode:
authorStefan Berger <stefanb@linux.vnet.ibm.com>2011-01-11 14:37:29 -0500
committerRajiv Andrade <srajiv@linux.vnet.ibm.com>2011-02-10 22:30:50 -0500
commit9b29050f8f75916f974a2d231ae5d3cd59792296 (patch)
treee556ea7e22297756159a1c564ed576671c419fb8 /drivers/char/tpm/tpm_tis.c
parentd3d373e0e3f51f335d8c722dd1340ab812fdf94b (diff)
tpm_tis: Use timeouts returned from TPM
The current TPM TIS driver in git discards the timeout values returned from the TPM. The check of the response packet needs to consider that the return_code field is 0 on success and the size of the expected packet is equivalent to the header size + u32 length indicator for the TPM_GetCapability() result + 3 timeout indicators of type u32. I am also adding a sysfs entry 'timeouts' showing the timeouts that are being used. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Tested-by: Guillaume Chazarain <guichaz@gmail.com> Signed-off-by: Rajiv Andrade <srajiv@linux.vnet.ibm.com>
Diffstat (limited to 'drivers/char/tpm/tpm_tis.c')
-rw-r--r--drivers/char/tpm/tpm_tis.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
index dd21df55689d..0d1d38e5f266 100644
--- a/drivers/char/tpm/tpm_tis.c
+++ b/drivers/char/tpm/tpm_tis.c
@@ -376,6 +376,7 @@ static DEVICE_ATTR(temp_deactivated, S_IRUGO, tpm_show_temp_deactivated,
376 NULL); 376 NULL);
377static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps_1_2, NULL); 377static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps_1_2, NULL);
378static DEVICE_ATTR(cancel, S_IWUSR | S_IWGRP, NULL, tpm_store_cancel); 378static DEVICE_ATTR(cancel, S_IWUSR | S_IWGRP, NULL, tpm_store_cancel);
379static DEVICE_ATTR(timeouts, S_IRUGO, tpm_show_timeouts, NULL);
379 380
380static struct attribute *tis_attrs[] = { 381static struct attribute *tis_attrs[] = {
381 &dev_attr_pubek.attr, 382 &dev_attr_pubek.attr,
@@ -385,7 +386,8 @@ static struct attribute *tis_attrs[] = {
385 &dev_attr_owned.attr, 386 &dev_attr_owned.attr,
386 &dev_attr_temp_deactivated.attr, 387 &dev_attr_temp_deactivated.attr,
387 &dev_attr_caps.attr, 388 &dev_attr_caps.attr,
388 &dev_attr_cancel.attr, NULL, 389 &dev_attr_cancel.attr,
390 &dev_attr_timeouts.attr, NULL,
389}; 391};
390 392
391static struct attribute_group tis_attr_grp = { 393static struct attribute_group tis_attr_grp = {