5 static const u8 tpm_ppi_uuid[] = {
6 0xA6, 0xFA, 0xDD, 0x3D,
10 0x8D, 0x10, 0x08, 0x9D, 0x16, 0x53
12 static char *tpm_device_name =
"TPM";
14 #define TPM_PPI_REVISION_ID 1
15 #define TPM_PPI_FN_VERSION 1
16 #define TPM_PPI_FN_SUBREQ 2
17 #define TPM_PPI_FN_GETREQ 3
18 #define TPM_PPI_FN_GETACT 4
19 #define TPM_PPI_FN_GETRSP 5
20 #define TPM_PPI_FN_SUBREQ2 7
21 #define TPM_PPI_FN_GETOPR 8
22 #define PPI_TPM_REQ_MAX 22
23 #define PPI_VS_REQ_START 128
24 #define PPI_VS_REQ_END 255
25 #define PPI_VERSION_LEN 3
45 params[0].
buffer.length =
sizeof(tpm_ppi_uuid);
46 params[0].
buffer.pointer = (
char *)tpm_ppi_uuid;
71 tpm_device_name, &handle);
100 tpm_device_name, &handle);
136 const char *buf,
size_t count)
153 tpm_device_name, &handle);
172 if (
strcmp(version,
"1.1") == -1)
182 if (
strcmp(version,
"1.2") == -1) {
186 params[3].buffer.pointer = (
char *)&req;
188 params[3].package.count = 1;
191 params[3].package.elements = &obj;
209 static ssize_t tpm_show_ppi_transition_action(
struct device *dev,
224 "OS Vendor-specific",
232 tpm_device_name, &handle);
248 if (
strcmp(version,
"1.2") == -1) {
250 params[3].buffer.length = 0;
288 tpm_device_name, &handle);
324 if (ret_obj->
integer.value == 0)
327 else if (ret_obj->
integer.value == 0xFFFFFFF0)
329 "0xFFFFFFF0: User Abort");
330 else if (ret_obj->
integer.value == 0xFFFFFFF1)
332 "0xFFFFFFF1: BIOS Failure");
333 else if (ret_obj->
integer.value >= 1 &&
334 ret_obj->
integer.value <= 0x00000FFF)
337 "Corresponding TPM error");
344 ret_obj->
integer.value,
"No Recent Request");
366 "Blocked for OS by BIOS",
375 tpm_device_name, &handle);
390 if (
strcmp(version,
"1.2") == -1)
394 params[3].package.count = 1;
396 params[3].package.elements = &obj;
397 for (i = start; i <=
end; i++) {
415 static ssize_t tpm_show_ppi_tcg_operations(
struct device *dev,
422 static ssize_t tpm_show_ppi_vs_operations(
struct device *dev,
431 tpm_show_ppi_request, tpm_store_ppi_request);
433 tpm_show_ppi_transition_action,
NULL);
439 &dev_attr_version.attr,
440 &dev_attr_request.attr,
441 &dev_attr_transition_action.attr,
442 &dev_attr_response.attr,
443 &dev_attr_tcg_operations.attr,
444 &dev_attr_vs_operations.attr,
NULL,