diff options
-rw-r--r-- | drivers/char/tpm/tpm.c | 56 | ||||
-rw-r--r-- | drivers/char/tpm/tpm.h | 2 | ||||
-rw-r--r-- | drivers/char/tpm/tpm_i2c_infineon.c | 2 | ||||
-rw-r--r-- | drivers/char/tpm/tpm_i2c_stm_st33.c | 2 | ||||
-rw-r--r-- | drivers/char/tpm/tpm_ibmvtpm.c | 2 | ||||
-rw-r--r-- | drivers/char/tpm/tpm_tis.c | 2 |
6 files changed, 27 insertions, 39 deletions
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c index c3ab508222af..72f0c68d466e 100644 --- a/drivers/char/tpm/tpm.c +++ b/drivers/char/tpm/tpm.c | |||
@@ -1020,43 +1020,33 @@ ssize_t tpm_show_caps(struct device *dev, struct device_attribute *attr, | |||
1020 | str += sprintf(str, "Manufacturer: 0x%x\n", | 1020 | str += sprintf(str, "Manufacturer: 0x%x\n", |
1021 | be32_to_cpu(cap.manufacturer_id)); | 1021 | be32_to_cpu(cap.manufacturer_id)); |
1022 | 1022 | ||
1023 | rc = tpm_getcap(dev, CAP_VERSION_1_1, &cap, | 1023 | /* Try to get a TPM version 1.2 TPM_CAP_VERSION_INFO */ |
1024 | "attempting to determine the 1.1 version"); | ||
1025 | if (rc) | ||
1026 | return 0; | ||
1027 | str += sprintf(str, | ||
1028 | "TCG version: %d.%d\nFirmware version: %d.%d\n", | ||
1029 | cap.tpm_version.Major, cap.tpm_version.Minor, | ||
1030 | cap.tpm_version.revMajor, cap.tpm_version.revMinor); | ||
1031 | return str - buf; | ||
1032 | } | ||
1033 | EXPORT_SYMBOL_GPL(tpm_show_caps); | ||
1034 | |||
1035 | ssize_t tpm_show_caps_1_2(struct device * dev, | ||
1036 | struct device_attribute * attr, char *buf) | ||
1037 | { | ||
1038 | cap_t cap; | ||
1039 | ssize_t rc; | ||
1040 | char *str = buf; | ||
1041 | |||
1042 | rc = tpm_getcap(dev, TPM_CAP_PROP_MANUFACTURER, &cap, | ||
1043 | "attempting to determine the manufacturer"); | ||
1044 | if (rc) | ||
1045 | return 0; | ||
1046 | str += sprintf(str, "Manufacturer: 0x%x\n", | ||
1047 | be32_to_cpu(cap.manufacturer_id)); | ||
1048 | rc = tpm_getcap(dev, CAP_VERSION_1_2, &cap, | 1024 | rc = tpm_getcap(dev, CAP_VERSION_1_2, &cap, |
1049 | "attempting to determine the 1.2 version"); | 1025 | "attempting to determine the 1.2 version"); |
1050 | if (rc) | 1026 | if (!rc) { |
1051 | return 0; | 1027 | str += sprintf(str, |
1052 | str += sprintf(str, | 1028 | "TCG version: %d.%d\nFirmware version: %d.%d\n", |
1053 | "TCG version: %d.%d\nFirmware version: %d.%d\n", | 1029 | cap.tpm_version_1_2.Major, |
1054 | cap.tpm_version_1_2.Major, cap.tpm_version_1_2.Minor, | 1030 | cap.tpm_version_1_2.Minor, |
1055 | cap.tpm_version_1_2.revMajor, | 1031 | cap.tpm_version_1_2.revMajor, |
1056 | cap.tpm_version_1_2.revMinor); | 1032 | cap.tpm_version_1_2.revMinor); |
1033 | } else { | ||
1034 | /* Otherwise just use TPM_STRUCT_VER */ | ||
1035 | rc = tpm_getcap(dev, CAP_VERSION_1_1, &cap, | ||
1036 | "attempting to determine the 1.1 version"); | ||
1037 | if (rc) | ||
1038 | return 0; | ||
1039 | str += sprintf(str, | ||
1040 | "TCG version: %d.%d\nFirmware version: %d.%d\n", | ||
1041 | cap.tpm_version.Major, | ||
1042 | cap.tpm_version.Minor, | ||
1043 | cap.tpm_version.revMajor, | ||
1044 | cap.tpm_version.revMinor); | ||
1045 | } | ||
1046 | |||
1057 | return str - buf; | 1047 | return str - buf; |
1058 | } | 1048 | } |
1059 | EXPORT_SYMBOL_GPL(tpm_show_caps_1_2); | 1049 | EXPORT_SYMBOL_GPL(tpm_show_caps); |
1060 | 1050 | ||
1061 | ssize_t tpm_show_durations(struct device *dev, struct device_attribute *attr, | 1051 | ssize_t tpm_show_durations(struct device *dev, struct device_attribute *attr, |
1062 | char *buf) | 1052 | char *buf) |
diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h index 0df18b56b2c5..f32847872193 100644 --- a/drivers/char/tpm/tpm.h +++ b/drivers/char/tpm/tpm.h | |||
@@ -59,8 +59,6 @@ extern ssize_t tpm_show_pcrs(struct device *, struct device_attribute *attr, | |||
59 | char *); | 59 | char *); |
60 | extern ssize_t tpm_show_caps(struct device *, struct device_attribute *attr, | 60 | extern ssize_t tpm_show_caps(struct device *, struct device_attribute *attr, |
61 | char *); | 61 | char *); |
62 | extern ssize_t tpm_show_caps_1_2(struct device *, struct device_attribute *attr, | ||
63 | char *); | ||
64 | extern ssize_t tpm_store_cancel(struct device *, struct device_attribute *attr, | 62 | extern ssize_t tpm_store_cancel(struct device *, struct device_attribute *attr, |
65 | const char *, size_t); | 63 | const char *, size_t); |
66 | extern ssize_t tpm_show_enabled(struct device *, struct device_attribute *attr, | 64 | extern ssize_t tpm_show_enabled(struct device *, struct device_attribute *attr, |
diff --git a/drivers/char/tpm/tpm_i2c_infineon.c b/drivers/char/tpm/tpm_i2c_infineon.c index e33d8e551eff..fefd2aa5c81e 100644 --- a/drivers/char/tpm/tpm_i2c_infineon.c +++ b/drivers/char/tpm/tpm_i2c_infineon.c | |||
@@ -581,7 +581,7 @@ static DEVICE_ATTR(enabled, S_IRUGO, tpm_show_enabled, NULL); | |||
581 | static DEVICE_ATTR(active, S_IRUGO, tpm_show_active, NULL); | 581 | static DEVICE_ATTR(active, S_IRUGO, tpm_show_active, NULL); |
582 | static DEVICE_ATTR(owned, S_IRUGO, tpm_show_owned, NULL); | 582 | static DEVICE_ATTR(owned, S_IRUGO, tpm_show_owned, NULL); |
583 | static DEVICE_ATTR(temp_deactivated, S_IRUGO, tpm_show_temp_deactivated, NULL); | 583 | static DEVICE_ATTR(temp_deactivated, S_IRUGO, tpm_show_temp_deactivated, NULL); |
584 | static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps_1_2, NULL); | 584 | static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps, NULL); |
585 | static DEVICE_ATTR(cancel, S_IWUSR | S_IWGRP, NULL, tpm_store_cancel); | 585 | static DEVICE_ATTR(cancel, S_IWUSR | S_IWGRP, NULL, tpm_store_cancel); |
586 | static DEVICE_ATTR(durations, S_IRUGO, tpm_show_durations, NULL); | 586 | static DEVICE_ATTR(durations, S_IRUGO, tpm_show_durations, NULL); |
587 | static DEVICE_ATTR(timeouts, S_IRUGO, tpm_show_timeouts, NULL); | 587 | static DEVICE_ATTR(timeouts, S_IRUGO, tpm_show_timeouts, NULL); |
diff --git a/drivers/char/tpm/tpm_i2c_stm_st33.c b/drivers/char/tpm/tpm_i2c_stm_st33.c index b2390b6173e7..a0d6ceb5d005 100644 --- a/drivers/char/tpm/tpm_i2c_stm_st33.c +++ b/drivers/char/tpm/tpm_i2c_stm_st33.c | |||
@@ -584,7 +584,7 @@ static DEVICE_ATTR(enabled, S_IRUGO, tpm_show_enabled, NULL); | |||
584 | static DEVICE_ATTR(active, S_IRUGO, tpm_show_active, NULL); | 584 | static DEVICE_ATTR(active, S_IRUGO, tpm_show_active, NULL); |
585 | static DEVICE_ATTR(owned, S_IRUGO, tpm_show_owned, NULL); | 585 | static DEVICE_ATTR(owned, S_IRUGO, tpm_show_owned, NULL); |
586 | static DEVICE_ATTR(temp_deactivated, S_IRUGO, tpm_show_temp_deactivated, NULL); | 586 | static DEVICE_ATTR(temp_deactivated, S_IRUGO, tpm_show_temp_deactivated, NULL); |
587 | static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps_1_2, NULL); | 587 | static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps, NULL); |
588 | static DEVICE_ATTR(cancel, S_IWUSR | S_IWGRP, NULL, tpm_store_cancel); | 588 | static DEVICE_ATTR(cancel, S_IWUSR | S_IWGRP, NULL, tpm_store_cancel); |
589 | 589 | ||
590 | static struct attribute *stm_tpm_attrs[] = { | 590 | static struct attribute *stm_tpm_attrs[] = { |
diff --git a/drivers/char/tpm/tpm_ibmvtpm.c b/drivers/char/tpm/tpm_ibmvtpm.c index 838f04314814..2783a42aa732 100644 --- a/drivers/char/tpm/tpm_ibmvtpm.c +++ b/drivers/char/tpm/tpm_ibmvtpm.c | |||
@@ -419,7 +419,7 @@ static DEVICE_ATTR(active, S_IRUGO, tpm_show_active, NULL); | |||
419 | static DEVICE_ATTR(owned, S_IRUGO, tpm_show_owned, NULL); | 419 | static DEVICE_ATTR(owned, S_IRUGO, tpm_show_owned, NULL); |
420 | static DEVICE_ATTR(temp_deactivated, S_IRUGO, tpm_show_temp_deactivated, | 420 | static DEVICE_ATTR(temp_deactivated, S_IRUGO, tpm_show_temp_deactivated, |
421 | NULL); | 421 | NULL); |
422 | static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps_1_2, NULL); | 422 | static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps, NULL); |
423 | static DEVICE_ATTR(cancel, S_IWUSR | S_IWGRP, NULL, tpm_store_cancel); | 423 | static DEVICE_ATTR(cancel, S_IWUSR | S_IWGRP, NULL, tpm_store_cancel); |
424 | static DEVICE_ATTR(durations, S_IRUGO, tpm_show_durations, NULL); | 424 | static DEVICE_ATTR(durations, S_IRUGO, tpm_show_durations, NULL); |
425 | static DEVICE_ATTR(timeouts, S_IRUGO, tpm_show_timeouts, NULL); | 425 | static DEVICE_ATTR(timeouts, S_IRUGO, tpm_show_timeouts, NULL); |
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c index 5796d0157ce0..1b74459c0723 100644 --- a/drivers/char/tpm/tpm_tis.c +++ b/drivers/char/tpm/tpm_tis.c | |||
@@ -448,7 +448,7 @@ static DEVICE_ATTR(active, S_IRUGO, tpm_show_active, NULL); | |||
448 | static DEVICE_ATTR(owned, S_IRUGO, tpm_show_owned, NULL); | 448 | static DEVICE_ATTR(owned, S_IRUGO, tpm_show_owned, NULL); |
449 | static DEVICE_ATTR(temp_deactivated, S_IRUGO, tpm_show_temp_deactivated, | 449 | static DEVICE_ATTR(temp_deactivated, S_IRUGO, tpm_show_temp_deactivated, |
450 | NULL); | 450 | NULL); |
451 | static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps_1_2, NULL); | 451 | static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps, NULL); |
452 | static DEVICE_ATTR(cancel, S_IWUSR | S_IWGRP, NULL, tpm_store_cancel); | 452 | static DEVICE_ATTR(cancel, S_IWUSR | S_IWGRP, NULL, tpm_store_cancel); |
453 | static DEVICE_ATTR(durations, S_IRUGO, tpm_show_durations, NULL); | 453 | static DEVICE_ATTR(durations, S_IRUGO, tpm_show_durations, NULL); |
454 | static DEVICE_ATTR(timeouts, S_IRUGO, tpm_show_timeouts, NULL); | 454 | static DEVICE_ATTR(timeouts, S_IRUGO, tpm_show_timeouts, NULL); |