1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright (c) 2015 Google, Inc
6 #ifndef __tpm_internal_h
7 #define __tpm_internal_h
10 TPM_MAX_ORDINAL = 243,
11 TPM_MAX_PROTECTED_ORDINAL = 12,
12 TPM_PROTECTED_ORDINAL_MASK = 0xff,
13 TPM_CMD_COUNT_BYTE = 2,
14 TPM_CMD_ORDINAL_BYTE = 6,
18 * Array with one entry per ordinal defining the maximum amount
19 * of time the chip could take to return the result. The ordinal
20 * designation of short, medium or long is defined in a table in
21 * TCG Specification TPM Main Part 2 TPM Structures Section 17. The
22 * values of the SHORT, MEDIUM, and LONG durations are retrieved
23 * from the chip during initialization with a call to tpm_get_timeouts.
25 static const u8 tpm_protected_ordinal_duration[TPM_MAX_PROTECTED_ORDINAL] = {
26 TPM_UNDEFINED, /* 0 */
31 TPM_UNDEFINED, /* 5 */
40 static const u8 tpm_ordinal_duration[TPM_MAX_ORDINAL] = {
41 TPM_UNDEFINED, /* 0 */
46 TPM_UNDEFINED, /* 5 */
96 TPM_UNDEFINED, /* 55 */
116 TPM_UNDEFINED, /* 75 */
126 TPM_UNDEFINED, /* 85 */
136 TPM_UNDEFINED, /* 95 */
141 TPM_MEDIUM, /* 100 */
146 TPM_UNDEFINED, /* 105 */
176 TPM_UNDEFINED, /* 135 */
186 TPM_UNDEFINED, /* 145 */
196 TPM_UNDEFINED, /* 155 */
206 TPM_UNDEFINED, /* 165 */
216 TPM_UNDEFINED, /* 175 */
221 TPM_MEDIUM, /* 180 */
226 TPM_MEDIUM, /* 185 */
231 TPM_UNDEFINED, /* 190 */
236 TPM_UNDEFINED, /* 195 */
251 TPM_MEDIUM, /* 210 */
256 TPM_UNDEFINED, /* 215 */
266 TPM_UNDEFINED, /* 225 */
276 TPM_UNDEFINED, /* 235 */