diff options
Diffstat (limited to 'utils/hwstub/hwstub_protocol.h')
-rw-r--r-- | utils/hwstub/hwstub_protocol.h | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/utils/hwstub/hwstub_protocol.h b/utils/hwstub/hwstub_protocol.h index 41be3957e8..f47ce3b5db 100644 --- a/utils/hwstub/hwstub_protocol.h +++ b/utils/hwstub/hwstub_protocol.h | |||
@@ -26,8 +26,8 @@ | |||
26 | #define HWSTUB_PROTOCOL 0x1d | 26 | #define HWSTUB_PROTOCOL 0x1d |
27 | 27 | ||
28 | #define HWSTUB_VERSION_MAJOR 2 | 28 | #define HWSTUB_VERSION_MAJOR 2 |
29 | #define HWSTUB_VERSION_MINOR 9 | 29 | #define HWSTUB_VERSION_MINOR 11 |
30 | #define HWSTUB_VERSION_REV 2 | 30 | #define HWSTUB_VERSION_REV 1 |
31 | 31 | ||
32 | #define HWSTUB_USB_VID 0xfee1 | 32 | #define HWSTUB_USB_VID 0xfee1 |
33 | #define HWSTUB_USB_PID 0xdead | 33 | #define HWSTUB_USB_PID 0xdead |
@@ -46,17 +46,18 @@ | |||
46 | #define HWSTUB_RW_MEM 2 /* optional */ | 46 | #define HWSTUB_RW_MEM 2 /* optional */ |
47 | #define HWSTUB_CALL 3 /* optional */ | 47 | #define HWSTUB_CALL 3 /* optional */ |
48 | #define HWSTUB_JUMP 4 /* optional */ | 48 | #define HWSTUB_JUMP 4 /* optional */ |
49 | #define HWSTUB_AES_OTP 5 /* optional */ | 49 | #define HWSTUB_STOP 5 /* optional */ |
50 | 50 | ||
51 | /** | 51 | /** |
52 | * HWSTUB_GET_INFO: get some information about an aspect of the device. | 52 | * HWSTUB_GET_INFO: get some information about an aspect of the device. |
53 | * The wIndex field of the SETUP specifies which information to get. */ | 53 | * The wIndex field of the SETUP specifies which information to get. */ |
54 | 54 | ||
55 | /* list of possible information */ | 55 | /* list of possible information */ |
56 | #define HWSTUB_INFO_VERSION 0 | 56 | #define HWSTUB_INFO_VERSION 0 /* mandatory */ |
57 | #define HWSTUB_INFO_LAYOUT 1 | 57 | #define HWSTUB_INFO_LAYOUT 1 /* mandatory */ |
58 | #define HWSTUB_INFO_STMP 2 | 58 | #define HWSTUB_INFO_STMP 2 /* optional */ |
59 | #define HWSTUB_INFO_FEATURES 3 | 59 | #define HWSTUB_INFO_FEATURES 3 /* mandatory */ |
60 | #define HWSTUB_INFO_TARGET 4 /* mandatory */ | ||
60 | 61 | ||
61 | struct usb_resp_info_version_t | 62 | struct usb_resp_info_version_t |
62 | { | 63 | { |
@@ -89,14 +90,23 @@ struct usb_resp_info_stmp_t | |||
89 | #define HWSTUB_FEATURE_LOG (1 << 0) | 90 | #define HWSTUB_FEATURE_LOG (1 << 0) |
90 | #define HWSTUB_FEATURE_MEM (1 << 1) | 91 | #define HWSTUB_FEATURE_MEM (1 << 1) |
91 | #define HWSTUB_FEATURE_CALL (1 << 2) | 92 | #define HWSTUB_FEATURE_CALL (1 << 2) |
92 | #define HWSTUB_FEATURE_JUMP (1 << 2) | 93 | #define HWSTUB_FEATURE_JUMP (1 << 3) |
93 | #define HWSTUB_FEATURE_AES_OTP (1 << 3) | 94 | #define HWSTUB_FEATURE_STOP (1 << 4) |
94 | 95 | ||
95 | struct usb_resp_info_features_t | 96 | struct usb_resp_info_features_t |
96 | { | 97 | { |
97 | uint32_t feature_mask; | 98 | uint32_t feature_mask; |
98 | }; | 99 | }; |
99 | 100 | ||
101 | #define HWSTUB_TARGET_UNK ('U' | 'N' << 8 | 'K' << 16 | ' ' << 24) | ||
102 | #define HWSTUB_TARGET_STMP ('S' | 'T' << 8 | 'M' << 16 | 'P' << 24) | ||
103 | |||
104 | struct usb_resp_info_target_t | ||
105 | { | ||
106 | uint32_t id; | ||
107 | char name[60]; | ||
108 | }; | ||
109 | |||
100 | /** | 110 | /** |
101 | * HWSTUB_GET_LOG: only if has HWSTUB_FEATURE_LOG. | 111 | * HWSTUB_GET_LOG: only if has HWSTUB_FEATURE_LOG. |
102 | * The log is returned as part of the control transfer. | 112 | * The log is returned as part of the control transfer. |
@@ -119,11 +129,12 @@ struct usb_resp_info_features_t | |||
119 | * the transfer is either a read or a write. */ | 129 | * the transfer is either a read or a write. */ |
120 | 130 | ||
121 | /** | 131 | /** |
122 | * HWSTUB_AES_OTP: only if has HWSTUB_FEATURE_AES_OTP. | 132 | * HWSTUB_STOP: only if has HWSTUB_FEATURE_STOP. |
123 | * The control transfer contains the data to be en/decrypted and the data | 133 | * Stop hwstub. Several methods can be employed (not all may be supported). |
124 | * is sent back on the interrupt endpoint. The first 16-bytes of the data | 134 | * The method is stored in wValue and interpreted as follows: |
125 | * are interpreted as the IV. The output format is the same. | 135 | * - reboot: immediately reboot the device |
126 | * The wValue field contains the parameters of the process. */ | 136 | * - off: wait for USB disconnection and power off */ |
127 | #define HWSTUB_AES_OTP_ENCRYPT (1 << 0) | 137 | #define HWSTUB_STOP_REBOOT 0 |
138 | #define HWSTUB_STOP_OFF 1 | ||
128 | 139 | ||
129 | #endif /* __HWSTUB_PROTOCOL__ */ | 140 | #endif /* __HWSTUB_PROTOCOL__ */ |