10 #ifndef __PACKET_USB_H__
11 #define __PACKET_USB_H__
22 #define USB_ADDR_LEN (sizeof(usb_address_t))
27 #define INTERFACE_PORT 0x80000000
44 USB_HEADER_LINUX_48_BYTES,
45 USB_HEADER_LINUX_64_BYTES,
50 USB_HEADER_PSEUDO_URB,
53 #define USB_HEADER_IS_LINUX(type) \
54 ((type) == USB_HEADER_LINUX_48_BYTES || (type) == USB_HEADER_LINUX_64_BYTES)
59 guint8 device_address;
70 usb_header_t header_type;
102 enum usb_conv_class_data_type {
103 USB_CONV_UNKNOWN = 0,
107 USB_CONV_MASS_STORAGE_BOT,
108 USB_CONV_MASS_STORAGE_UASP,
116 guint16 device_address;
119 guint8 transfer_type;
120 guint8 descriptor_transfer_type;
121 guint16 max_packet_size;
122 guint32 device_protocol;
125 guint8 setup_requesttype;
128 guint16 interfaceClass;
129 guint16 interfaceSubclass;
130 guint16 interfaceProtocol;
133 guint16 deviceVendor;
134 guint32 deviceProduct;
135 guint16 deviceVersion;
136 guint8 iSerialNumber;
141 enum usb_conv_class_data_type class_data_type;
149 guint8 transfer_type;
156 #define NO_ENDPOINT 0xffffffff
159 #define NO_ENDPOINT8 ((guint8)(NO_ENDPOINT& G_MAXUINT8))
168 #define URB_SUBMIT 'S'
169 #define URB_COMPLETE 'C'
170 #define URB_ERROR 'E'
175 #define URB_ISOCHRONOUS 0x0
176 #define URB_INTERRUPT 0x1
177 #define URB_CONTROL 0x2
179 #define URB_UNKNOWN 0xFF
181 #define URB_TRANSFER_IN 0x80
185 #define IF_CLASS_DEVICE 0x00
186 #define IF_CLASS_AUDIO 0x01
187 #define IF_CLASS_COMMUNICATIONS 0x02
188 #define IF_CLASS_HID 0x03
189 #define IF_CLASS_PHYSICAL 0x05
190 #define IF_CLASS_IMAGE 0x06
191 #define IF_CLASS_PRINTER 0x07
192 #define IF_CLASS_MASS_STORAGE 0x08
193 #define IF_CLASS_HUB 0x09
194 #define IF_CLASS_CDC_DATA 0x0a
195 #define IF_CLASS_SMART_CARD 0x0b
196 #define IF_CLASS_CONTENT_SECURITY 0x0d
197 #define IF_CLASS_VIDEO 0x0e
198 #define IF_CLASS_PERSONAL_HEALTHCARE 0x0f
199 #define IF_CLASS_AUDIO_VIDEO 0x10
200 #define IF_CLASS_DIAGNOSTIC_DEVICE 0xdc
201 #define IF_CLASS_WIRELESS_CONTROLLER 0xe0
202 #define IF_CLASS_MISCELLANEOUS 0xef
203 #define IF_CLASS_APPLICATION_SPECIFIC 0xfe
204 #define IF_CLASS_VENDOR_SPECIFIC 0xff
206 #define IF_CLASS_UNKNOWN 0xffff
207 #define IF_SUBCLASS_UNKNOWN 0xffff
208 #define IF_PROTOCOL_UNKNOWN 0xffff
209 #define DEV_VENDOR_UNKNOWN 0x0000
210 #define DEV_PRODUCT_UNKNOWN 0xfffffff
211 #define DEV_VERSION_UNKNOWN 0xffff
213 #define IF_SUBCLASS_MISC_U3V 0x05
215 #define IF_SUBCLASS_APP_DFU 0x01
217 #define IF_PROTOCOL_DFU_RUNTIME 0x01
218 #define IF_PROTOCOL_DFU_MODE 0x02
227 #define USB_PROTOCOL_KEY(class, subclass, protocol) \
228 (1u << 31 | (class & 0xff) << 16 | (subclass & 0xff) << 8 | (protocol & 0xff))
231 #define USB_DIR_OUT 0
232 #define USB_DIR_IN 0x80
234 #define USB_TYPE_MASK (0x03 << 5)
235 #define USB_TYPE(type) (((type) & USB_TYPE_MASK) >> 5)
236 #define RQT_SETUP_TYPE_STANDARD 0
237 #define RQT_SETUP_TYPE_CLASS 1
238 #define RQT_SETUP_TYPE_VENDOR 2
240 #define USB_RECIPIENT_MASK 0x1F
241 #define USB_RECIPIENT(type) ((type) & USB_RECIPIENT_MASK)
242 #define RQT_SETUP_RECIPIENT_DEVICE 0
243 #define RQT_SETUP_RECIPIENT_INTERFACE 1
244 #define RQT_SETUP_RECIPIENT_ENDPOINT 2
245 #define RQT_SETUP_RECIPIENT_OTHER 3
248 #define ENDPOINT_TYPE(ep_attrib) ((ep_attrib) & 0x03)
249 #define ENDPOINT_TYPE_CONTROL 0
250 #define ENDPOINT_TYPE_ISOCHRONOUS 1
251 #define ENDPOINT_TYPE_BULK 2
252 #define ENDPOINT_TYPE_INTERRUPT 3
253 #define ENDPOINT_TYPE_NOT_SET 255
256 #define USB_SETUP_GET_STATUS 0
257 #define USB_SETUP_CLEAR_FEATURE 1
258 #define USB_SETUP_SET_FEATURE 3
259 #define USB_SETUP_SET_ADDRESS 5
260 #define USB_SETUP_GET_DESCRIPTOR 6
261 #define USB_SETUP_SET_DESCRIPTOR 7
262 #define USB_SETUP_GET_CONFIGURATION 8
263 #define USB_SETUP_SET_CONFIGURATION 9
264 #define USB_SETUP_GET_INTERFACE 10
265 #define USB_SETUP_SET_INTERFACE 11
266 #define USB_SETUP_SYNCH_FRAME 12
267 #define USB_SETUP_SET_SEL 48
268 #define USB_SETUP_SET_ISOCH_DELAY 49
271 #define URB_SHORT_NOT_OK 0x0001
272 #define URB_ISO_ASAP 0x0002
274 #define URB_NO_TRANSFER_DMA_MAP 0x0004
275 #define URB_NO_FSBR 0x0020
276 #define URB_ZERO_PACKET 0x0040
277 #define URB_NO_INTERRUPT 0x0080
279 #define URB_FREE_BUFFER 0x0100
282 #define URB_DIR_IN 0x0200
283 #define URB_DIR_OUT 0
284 #define URB_DIR_MASK URB_DIR_IN
286 #define URB_DMA_MAP_SINGLE 0x00010000
287 #define URB_DMA_MAP_PAGE 0x00020000
288 #define URB_DMA_MAP_SG 0x00040000
289 #define URB_MAP_LOCAL 0x00080000
290 #define URB_SETUP_MAP_SINGLE 0x00100000
291 #define URB_SETUP_MAP_LOCAL 0x00200000
292 #define URB_DMA_SG_COMBINED 0x00400000
293 #define URB_ALIGNED_TEMP_BUFFER 0x00800000
303 guint16 device_address,
int endpoint);
312 sanitize_usb_max_packet_size(guint8 ep_type, usb_speed_t speed,
313 unsigned int max_packet_size);
319 guint8 *out_ep_type, usb_speed_t speed);
327 dissect_urb_transfer_flags(
tvbuff_t *tvb,
int offset,
proto_tree* tree,
int hf,
int endian);
333 usb_header_t header_type,
void *extra_data);
335 void usb_lpm_besl_str(gchar *buf, guint32 value);
Definition: packet_info.h:44
Definition: packet-usb.h:17
Definition: packet-usb.h:114
Definition: packet-usb.h:56
Definition: packet-usb.h:147
Definition: packet-usb.h:73
Definition: packet-usb.h:66
Definition: value_string.h:170
Definition: wmem_array.c:27
Definition: wmem_tree-int.h:48
Definition: tvbuff-int.h:35