diff options
Diffstat (limited to 'utils/hwstub/hwstub_protocol.h')
-rw-r--r-- | utils/hwstub/hwstub_protocol.h | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/utils/hwstub/hwstub_protocol.h b/utils/hwstub/hwstub_protocol.h index f47ce3b5db..99131aa70c 100644 --- a/utils/hwstub/hwstub_protocol.h +++ b/utils/hwstub/hwstub_protocol.h | |||
@@ -27,7 +27,7 @@ | |||
27 | 27 | ||
28 | #define HWSTUB_VERSION_MAJOR 2 | 28 | #define HWSTUB_VERSION_MAJOR 2 |
29 | #define HWSTUB_VERSION_MINOR 11 | 29 | #define HWSTUB_VERSION_MINOR 11 |
30 | #define HWSTUB_VERSION_REV 1 | 30 | #define HWSTUB_VERSION_REV 2 |
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,7 +46,8 @@ | |||
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_STOP 5 /* optional */ | 49 | #define HWSTUB_EXIT 5 /* optional */ |
50 | #define HWSTUB_ATEXIT 6 /* optional */ | ||
50 | 51 | ||
51 | /** | 52 | /** |
52 | * HWSTUB_GET_INFO: get some information about an aspect of the device. | 53 | * HWSTUB_GET_INFO: get some information about an aspect of the device. |
@@ -91,7 +92,7 @@ struct usb_resp_info_stmp_t | |||
91 | #define HWSTUB_FEATURE_MEM (1 << 1) | 92 | #define HWSTUB_FEATURE_MEM (1 << 1) |
92 | #define HWSTUB_FEATURE_CALL (1 << 2) | 93 | #define HWSTUB_FEATURE_CALL (1 << 2) |
93 | #define HWSTUB_FEATURE_JUMP (1 << 3) | 94 | #define HWSTUB_FEATURE_JUMP (1 << 3) |
94 | #define HWSTUB_FEATURE_STOP (1 << 4) | 95 | #define HWSTUB_FEATURE_EXIT (1 << 4) |
95 | 96 | ||
96 | struct usb_resp_info_features_t | 97 | struct usb_resp_info_features_t |
97 | { | 98 | { |
@@ -129,12 +130,23 @@ struct usb_resp_info_target_t | |||
129 | * the transfer is either a read or a write. */ | 130 | * the transfer is either a read or a write. */ |
130 | 131 | ||
131 | /** | 132 | /** |
132 | * HWSTUB_STOP: only if has HWSTUB_FEATURE_STOP. | 133 | * HWSTUB_EXIT: only if has HWSTUB_FEATURE_EXIT. |
133 | * Stop hwstub. Several methods can be employed (not all may be supported). | 134 | * Stop hwstub now, performing the atexit action. Default exit action |
134 | * The method is stored in wValue and interpreted as follows: | 135 | * is target dependent. */ |
135 | * - reboot: immediately reboot the device | 136 | |
136 | * - off: wait for USB disconnection and power off */ | 137 | /** |
137 | #define HWSTUB_STOP_REBOOT 0 | 138 | * HWSTUB_ATEXIT: only if has HWSTUB_FEATURE_EXIT. |
138 | #define HWSTUB_STOP_OFF 1 | 139 | * Sets the action to perform at exit. Exit happens by sending HWSTUB_EXIT |
140 | * or on USB disconnection. The following actions are available: | ||
141 | * - nop: don't do anything, wait for next connection | ||
142 | * - reboot: reboot the device | ||
143 | * - off: power off | ||
144 | * NOTE the power off action might have to wait for USB disconnection as some | ||
145 | * targets cannot power off while plugged. | ||
146 | * NOTE appart from nop which is mandatory, all other methods can be | ||
147 | * unavailable and thus the atexit command can fail. */ | ||
148 | #define HWSTUB_ATEXIT_REBOOT 0 | ||
149 | #define HWSTUB_ATEXIT_OFF 1 | ||
150 | #define HWSTUB_ATEXIT_NOP 2 | ||
139 | 151 | ||
140 | #endif /* __HWSTUB_PROTOCOL__ */ | 152 | #endif /* __HWSTUB_PROTOCOL__ */ |