1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef DEVICE_USB_USB_DESCRIPTORS_H_
6 #define DEVICE_USB_USB_DESCRIPTORS_H_
13 enum UsbTransferType
{
14 USB_TRANSFER_CONTROL
= 0,
15 USB_TRANSFER_ISOCHRONOUS
,
17 USB_TRANSFER_INTERRUPT
,
20 enum UsbEndpointDirection
{
21 USB_DIRECTION_INBOUND
= 0,
22 USB_DIRECTION_OUTBOUND
,
25 enum UsbSynchronizationType
{
26 USB_SYNCHRONIZATION_NONE
= 0,
27 USB_SYNCHRONIZATION_ASYNCHRONOUS
,
28 USB_SYNCHRONIZATION_ADAPTIVE
,
29 USB_SYNCHRONIZATION_SYNCHRONOUS
,
35 USB_USAGE_EXPLICIT_FEEDBACK
38 struct UsbEndpointDescriptor
{
39 UsbEndpointDescriptor();
40 ~UsbEndpointDescriptor();
43 UsbEndpointDirection direction
;
44 uint16_t maximum_packet_size
;
45 UsbSynchronizationType synchronization_type
;
46 UsbTransferType transfer_type
;
47 UsbUsageType usage_type
;
48 uint16_t polling_interval
;
49 std::vector
<uint8_t> extra_data
;
52 struct UsbInterfaceDescriptor
{
53 UsbInterfaceDescriptor();
54 ~UsbInterfaceDescriptor();
56 uint8_t interface_number
;
57 uint8_t alternate_setting
;
58 uint8_t interface_class
;
59 uint8_t interface_subclass
;
60 uint8_t interface_protocol
;
61 std::vector
<UsbEndpointDescriptor
> endpoints
;
62 std::vector
<uint8_t> extra_data
;
65 struct UsbConfigDescriptor
{
66 UsbConfigDescriptor();
67 ~UsbConfigDescriptor();
69 uint8_t configuration_value
;
72 uint16_t maximum_power
;
73 std::vector
<UsbInterfaceDescriptor
> interfaces
;
74 std::vector
<uint8_t> extra_data
;
79 #endif // DEVICE_USB_USB_DESCRIPTORS_H_