summaryrefslogtreecommitdiff
path: root/utils/hwstub/hwstub_protocol.h
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2013-07-13 17:38:34 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2013-07-13 17:47:01 +0200
commitf617da0552c95202807c5e41c70bc78a3189378e (patch)
treebcb5c16a82515465661430d90eede48000918700 /utils/hwstub/hwstub_protocol.h
parent140783ef66eef379feedcfef5403c5729d38936a (diff)
downloadrockbox-f617da0552c95202807c5e41c70bc78a3189378e.tar.gz
rockbox-f617da0552c95202807c5e41c70bc78a3189378e.zip
hwstub: enhance protocol with more functions
Change-Id: I7944249c2f7ea3e180e7b79ee8ae402d1d0742d3
Diffstat (limited to 'utils/hwstub/hwstub_protocol.h')
-rw-r--r--utils/hwstub/hwstub_protocol.h41
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
61struct usb_resp_info_version_t 62struct 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
95struct usb_resp_info_features_t 96struct 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
104struct 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__ */