Daisuke Nojiri | efb5cde | 2014-07-02 08:37:23 -0700 | [diff] [blame] | 1 | /* This file is automatically generated */ |
| 2 | |
| 3 | const struct s_tpm_extend_cmd{ |
Lee Leahy | e20a319 | 2017-03-09 16:21:34 -0800 | [diff] [blame] | 4 | uint8_t buffer[34]; |
| 5 | uint16_t pcrNum; |
| 6 | uint16_t inDigest; |
Daisuke Nojiri | efb5cde | 2014-07-02 08:37:23 -0700 | [diff] [blame] | 7 | } tpm_extend_cmd = {{0x0, 0xc1, 0x0, 0x0, 0x0, 0x22, 0x0, 0x0, 0x0, 0x14, }, |
| 8 | 10, 14, }; |
| 9 | |
| 10 | const struct s_tpm_get_random_cmd{ |
Lee Leahy | e20a319 | 2017-03-09 16:21:34 -0800 | [diff] [blame] | 11 | uint8_t buffer[14]; |
| 12 | uint16_t bytesRequested; |
Daisuke Nojiri | efb5cde | 2014-07-02 08:37:23 -0700 | [diff] [blame] | 13 | } tpm_get_random_cmd = {{0x0, 0xc1, 0x0, 0x0, 0x0, 0xe, 0x0, 0x0, 0x0, 0x46, }, |
| 14 | 10, }; |
| 15 | |
| 16 | const struct s_tpm_getownership_cmd{ |
Lee Leahy | e20a319 | 2017-03-09 16:21:34 -0800 | [diff] [blame] | 17 | uint8_t buffer[22]; |
Lee Leahy | 7340217 | 2017-03-10 15:23:24 -0800 | [diff] [blame] | 18 | } tpm_getownership_cmd = { |
| 19 | {0x0, 0xc1, 0x0, 0x0, 0x0, 0x16, 0x0, 0x0, 0x0, 0x65, |
| 20 | 0x0, 0x0, 0x0, 0x5, 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, 0x1, 0x11, }, |
Daisuke Nojiri | efb5cde | 2014-07-02 08:37:23 -0700 | [diff] [blame] | 21 | }; |
| 22 | |
| 23 | const struct s_tpm_getpermissions_cmd{ |
Lee Leahy | e20a319 | 2017-03-09 16:21:34 -0800 | [diff] [blame] | 24 | uint8_t buffer[22]; |
| 25 | uint16_t index; |
Lee Leahy | 7340217 | 2017-03-10 15:23:24 -0800 | [diff] [blame] | 26 | } tpm_getpermissions_cmd = { |
| 27 | {0x0, 0xc1, 0x0, 0x0, 0x0, 0x16, 0x0, 0x0, 0x0, 0x65, |
| 28 | 0x0, 0x0, 0x0, 0x11, 0x0, 0x0, 0x0, 0x4, }, |
Daisuke Nojiri | efb5cde | 2014-07-02 08:37:23 -0700 | [diff] [blame] | 29 | 18, }; |
| 30 | |
| 31 | const struct s_tpm_getstclearflags_cmd{ |
Lee Leahy | e20a319 | 2017-03-09 16:21:34 -0800 | [diff] [blame] | 32 | uint8_t buffer[22]; |
Lee Leahy | 7340217 | 2017-03-10 15:23:24 -0800 | [diff] [blame] | 33 | } tpm_getstclearflags_cmd = { |
| 34 | {0x0, 0xc1, 0x0, 0x0, 0x0, 0x16, 0x0, 0x0, 0x0, 0x65, |
| 35 | 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, 0x1, 0x9, }, |
Daisuke Nojiri | efb5cde | 2014-07-02 08:37:23 -0700 | [diff] [blame] | 36 | }; |
| 37 | |
| 38 | const struct s_tpm_getflags_cmd{ |
Lee Leahy | e20a319 | 2017-03-09 16:21:34 -0800 | [diff] [blame] | 39 | uint8_t buffer[22]; |
Lee Leahy | 7340217 | 2017-03-10 15:23:24 -0800 | [diff] [blame] | 40 | } tpm_getflags_cmd = { |
| 41 | {0x0, 0xc1, 0x0, 0x0, 0x0, 0x16, 0x0, 0x0, 0x0, 0x65, |
| 42 | 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, 0x1, 0x8, }, |
Daisuke Nojiri | efb5cde | 2014-07-02 08:37:23 -0700 | [diff] [blame] | 43 | }; |
| 44 | |
| 45 | const struct s_tpm_physicalsetdeactivated_cmd{ |
Lee Leahy | e20a319 | 2017-03-09 16:21:34 -0800 | [diff] [blame] | 46 | uint8_t buffer[11]; |
| 47 | uint16_t deactivated; |
Lee Leahy | 7340217 | 2017-03-10 15:23:24 -0800 | [diff] [blame] | 48 | } tpm_physicalsetdeactivated_cmd = { |
| 49 | {0x0, 0xc1, 0x0, 0x0, 0x0, 0xb, 0x0, 0x0, 0x0, 0x72, }, |
Daisuke Nojiri | efb5cde | 2014-07-02 08:37:23 -0700 | [diff] [blame] | 50 | 10, }; |
| 51 | |
| 52 | const struct s_tpm_physicalenable_cmd{ |
Lee Leahy | e20a319 | 2017-03-09 16:21:34 -0800 | [diff] [blame] | 53 | uint8_t buffer[10]; |
Lee Leahy | 7340217 | 2017-03-10 15:23:24 -0800 | [diff] [blame] | 54 | } tpm_physicalenable_cmd = { |
| 55 | {0x0, 0xc1, 0x0, 0x0, 0x0, 0xa, 0x0, 0x0, 0x0, 0x6f, }, |
Daisuke Nojiri | efb5cde | 2014-07-02 08:37:23 -0700 | [diff] [blame] | 56 | }; |
| 57 | |
| 58 | const struct s_tpm_physicaldisable_cmd{ |
Lee Leahy | e20a319 | 2017-03-09 16:21:34 -0800 | [diff] [blame] | 59 | uint8_t buffer[10]; |
Lee Leahy | 7340217 | 2017-03-10 15:23:24 -0800 | [diff] [blame] | 60 | } tpm_physicaldisable_cmd = { |
| 61 | {0x0, 0xc1, 0x0, 0x0, 0x0, 0xa, 0x0, 0x0, 0x0, 0x70, }, |
Daisuke Nojiri | efb5cde | 2014-07-02 08:37:23 -0700 | [diff] [blame] | 62 | }; |
| 63 | |
| 64 | const struct s_tpm_forceclear_cmd{ |
Lee Leahy | e20a319 | 2017-03-09 16:21:34 -0800 | [diff] [blame] | 65 | uint8_t buffer[10]; |
Daisuke Nojiri | efb5cde | 2014-07-02 08:37:23 -0700 | [diff] [blame] | 66 | } tpm_forceclear_cmd = {{0x0, 0xc1, 0x0, 0x0, 0x0, 0xa, 0x0, 0x0, 0x0, 0x5d, }, |
| 67 | }; |
| 68 | |
| 69 | const struct s_tpm_readpubek_cmd{ |
Lee Leahy | e20a319 | 2017-03-09 16:21:34 -0800 | [diff] [blame] | 70 | uint8_t buffer[30]; |
Daisuke Nojiri | efb5cde | 2014-07-02 08:37:23 -0700 | [diff] [blame] | 71 | } tpm_readpubek_cmd = {{0x0, 0xc1, 0x0, 0x0, 0x0, 0x1e, 0x0, 0x0, 0x0, 0x7c, }, |
| 72 | }; |
| 73 | |
| 74 | const struct s_tpm_continueselftest_cmd{ |
Lee Leahy | e20a319 | 2017-03-09 16:21:34 -0800 | [diff] [blame] | 75 | uint8_t buffer[10]; |
Lee Leahy | 7340217 | 2017-03-10 15:23:24 -0800 | [diff] [blame] | 76 | } tpm_continueselftest_cmd = { |
| 77 | {0x0, 0xc1, 0x0, 0x0, 0x0, 0xa, 0x0, 0x0, 0x0, 0x53, }, |
Daisuke Nojiri | efb5cde | 2014-07-02 08:37:23 -0700 | [diff] [blame] | 78 | }; |
| 79 | |
| 80 | const struct s_tpm_selftestfull_cmd{ |
Lee Leahy | e20a319 | 2017-03-09 16:21:34 -0800 | [diff] [blame] | 81 | uint8_t buffer[10]; |
Lee Leahy | 7340217 | 2017-03-10 15:23:24 -0800 | [diff] [blame] | 82 | } tpm_selftestfull_cmd = { |
| 83 | {0x0, 0xc1, 0x0, 0x0, 0x0, 0xa, 0x0, 0x0, 0x0, 0x50, }, |
Daisuke Nojiri | efb5cde | 2014-07-02 08:37:23 -0700 | [diff] [blame] | 84 | }; |
| 85 | |
| 86 | const struct s_tpm_resume_cmd{ |
Lee Leahy | e20a319 | 2017-03-09 16:21:34 -0800 | [diff] [blame] | 87 | uint8_t buffer[12]; |
Lee Leahy | 7340217 | 2017-03-10 15:23:24 -0800 | [diff] [blame] | 88 | } tpm_resume_cmd = { |
| 89 | {0x0, 0xc1, 0x0, 0x0, 0x0, 0xc, 0x0, 0x0, 0x0, 0x99, 0x0, 0x2, }, |
Daisuke Nojiri | efb5cde | 2014-07-02 08:37:23 -0700 | [diff] [blame] | 90 | }; |
| 91 | |
| 92 | const struct s_tpm_savestate_cmd{ |
Lee Leahy | e20a319 | 2017-03-09 16:21:34 -0800 | [diff] [blame] | 93 | uint8_t buffer[10]; |
Daisuke Nojiri | efb5cde | 2014-07-02 08:37:23 -0700 | [diff] [blame] | 94 | } tpm_savestate_cmd = {{0x0, 0xc1, 0x0, 0x0, 0x0, 0xa, 0x0, 0x0, 0x0, 0x98, }, |
| 95 | }; |
| 96 | |
| 97 | const struct s_tpm_startup_cmd{ |
Lee Leahy | e20a319 | 2017-03-09 16:21:34 -0800 | [diff] [blame] | 98 | uint8_t buffer[12]; |
Lee Leahy | 7340217 | 2017-03-10 15:23:24 -0800 | [diff] [blame] | 99 | } tpm_startup_cmd = { |
| 100 | {0x0, 0xc1, 0x0, 0x0, 0x0, 0xc, 0x0, 0x0, 0x0, 0x99, 0x0, 0x1, }, |
Daisuke Nojiri | efb5cde | 2014-07-02 08:37:23 -0700 | [diff] [blame] | 101 | }; |
| 102 | |
| 103 | const struct s_tpm_finalizepp_cmd{ |
Lee Leahy | e20a319 | 2017-03-09 16:21:34 -0800 | [diff] [blame] | 104 | uint8_t buffer[12]; |
Lee Leahy | 7340217 | 2017-03-10 15:23:24 -0800 | [diff] [blame] | 105 | } tpm_finalizepp_cmd = { |
| 106 | {0x0, 0xc1, 0x0, 0x0, 0x0, 0xc, 0x40, 0x0, 0x0, 0xa, 0x2, 0xa0, }, |
Daisuke Nojiri | efb5cde | 2014-07-02 08:37:23 -0700 | [diff] [blame] | 107 | }; |
| 108 | |
| 109 | const struct s_tpm_pplock_cmd{ |
Lee Leahy | e20a319 | 2017-03-09 16:21:34 -0800 | [diff] [blame] | 110 | uint8_t buffer[12]; |
Lee Leahy | 7340217 | 2017-03-10 15:23:24 -0800 | [diff] [blame] | 111 | } tpm_pplock_cmd = { |
| 112 | {0x0, 0xc1, 0x0, 0x0, 0x0, 0xc, 0x40, 0x0, 0x0, 0xa, 0x0, 0x4, }, |
Daisuke Nojiri | efb5cde | 2014-07-02 08:37:23 -0700 | [diff] [blame] | 113 | }; |
| 114 | |
| 115 | const struct s_tpm_ppenable_cmd{ |
Lee Leahy | e20a319 | 2017-03-09 16:21:34 -0800 | [diff] [blame] | 116 | uint8_t buffer[12]; |
Lee Leahy | 7340217 | 2017-03-10 15:23:24 -0800 | [diff] [blame] | 117 | } tpm_ppenable_cmd = { |
| 118 | {0x0, 0xc1, 0x0, 0x0, 0x0, 0xc, 0x40, 0x0, 0x0, 0xa, 0x0, 0x20, }, |
Daisuke Nojiri | efb5cde | 2014-07-02 08:37:23 -0700 | [diff] [blame] | 119 | }; |
| 120 | |
| 121 | const struct s_tpm_ppassert_cmd{ |
Lee Leahy | e20a319 | 2017-03-09 16:21:34 -0800 | [diff] [blame] | 122 | uint8_t buffer[12]; |
Lee Leahy | 7340217 | 2017-03-10 15:23:24 -0800 | [diff] [blame] | 123 | } tpm_ppassert_cmd = { |
| 124 | {0x0, 0xc1, 0x0, 0x0, 0x0, 0xc, 0x40, 0x0, 0x0, 0xa, 0x0, 0x8, }, |
Daisuke Nojiri | efb5cde | 2014-07-02 08:37:23 -0700 | [diff] [blame] | 125 | }; |
| 126 | |
| 127 | const struct s_tpm_pcr_read_cmd{ |
Lee Leahy | e20a319 | 2017-03-09 16:21:34 -0800 | [diff] [blame] | 128 | uint8_t buffer[14]; |
| 129 | uint16_t pcrNum; |
Daisuke Nojiri | efb5cde | 2014-07-02 08:37:23 -0700 | [diff] [blame] | 130 | } tpm_pcr_read_cmd = {{0x0, 0xc1, 0x0, 0x0, 0x0, 0xe, 0x0, 0x0, 0x0, 0x15, }, |
| 131 | 10, }; |
| 132 | |
| 133 | const struct s_tpm_nv_read_cmd{ |
Lee Leahy | e20a319 | 2017-03-09 16:21:34 -0800 | [diff] [blame] | 134 | uint8_t buffer[22]; |
| 135 | uint16_t index; |
| 136 | uint16_t length; |
Daisuke Nojiri | efb5cde | 2014-07-02 08:37:23 -0700 | [diff] [blame] | 137 | } tpm_nv_read_cmd = {{0x0, 0xc1, 0x0, 0x0, 0x0, 0x16, 0x0, 0x0, 0x0, 0xcf, }, |
| 138 | 10, 18, }; |
| 139 | |
| 140 | const struct s_tpm_nv_write_cmd{ |
Lee Leahy | e20a319 | 2017-03-09 16:21:34 -0800 | [diff] [blame] | 141 | uint8_t buffer[256]; |
| 142 | uint16_t index; |
| 143 | uint16_t length; |
| 144 | uint16_t data; |
Daisuke Nojiri | efb5cde | 2014-07-02 08:37:23 -0700 | [diff] [blame] | 145 | } tpm_nv_write_cmd = {{0x0, 0xc1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xcd, }, |
| 146 | 10, 18, 22, }; |
| 147 | |
| 148 | const struct s_tpm_nv_definespace_cmd{ |
Lee Leahy | e20a319 | 2017-03-09 16:21:34 -0800 | [diff] [blame] | 149 | uint8_t buffer[101]; |
| 150 | uint16_t index; |
| 151 | uint16_t perm; |
| 152 | uint16_t size; |
Lee Leahy | 7340217 | 2017-03-10 15:23:24 -0800 | [diff] [blame] | 153 | } tpm_nv_definespace_cmd = { |
| 154 | {0x0, 0xc1, 0x0, 0x0, 0x0, 0x65, 0x0, 0x0, 0x0, 0xcc, |
| 155 | 0x0, 0x18, 0, 0, 0, 0, 0x0, 0x3, 0, 0, 0, 0x1f, 0, 0, |
| 156 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 157 | 0x0, 0x3, 0, 0, 0, 0x1f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 158 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x0, 0x17, |
| 159 | }, |
| 160 | 12, 70, 77, |
| 161 | }; |
Daisuke Nojiri | efb5cde | 2014-07-02 08:37:23 -0700 | [diff] [blame] | 162 | |
| 163 | const int kWriteInfoLength = 12; |
| 164 | const int kNvDataPublicPermissionsOffset = 60; |