3 usb.h.in | 118 ++++++++++++++++++++++++++++++++-------------------------------
4 1 file changed, 60 insertions(+), 58 deletions(-)
15 +#include <sys/param.h>
21 /* All standard descriptors have these 2 fields in common */
22 struct usb_descriptor_header {
24 - u_int8_t bDescriptorType;
26 + uint8_t bDescriptorType;
27 } __attribute__ ((packed));
29 /* String descriptor */
30 struct usb_string_descriptor {
32 - u_int8_t bDescriptorType;
35 + uint8_t bDescriptorType;
37 } __attribute__ ((packed));
40 struct usb_hid_descriptor {
42 - u_int8_t bDescriptorType;
44 - u_int8_t bCountryCode;
45 - u_int8_t bNumDescriptors;
46 - /* u_int8_t bReportDescriptorType; */
47 - /* u_int16_t wDescriptorLength; */
49 + uint8_t bDescriptorType;
51 + uint8_t bCountryCode;
52 + uint8_t bNumDescriptors;
53 + /* uint8_t bReportDescriptorType; */
54 + /* uint16_t wDescriptorLength; */
56 } __attribute__ ((packed));
58 /* Endpoint descriptor */
59 #define USB_MAXENDPOINTS 32
60 struct usb_endpoint_descriptor {
62 - u_int8_t bDescriptorType;
63 - u_int8_t bEndpointAddress;
64 - u_int8_t bmAttributes;
65 - u_int16_t wMaxPacketSize;
68 - u_int8_t bSynchAddress;
70 + uint8_t bDescriptorType;
71 + uint8_t bEndpointAddress;
72 + uint8_t bmAttributes;
73 + uint16_t wMaxPacketSize;
76 + uint8_t bSynchAddress;
78 unsigned char *extra; /* Extra descriptors */
81 /* Interface descriptor */
82 #define USB_MAXINTERFACES 32
83 struct usb_interface_descriptor {
85 - u_int8_t bDescriptorType;
86 - u_int8_t bInterfaceNumber;
87 - u_int8_t bAlternateSetting;
88 - u_int8_t bNumEndpoints;
89 - u_int8_t bInterfaceClass;
90 - u_int8_t bInterfaceSubClass;
91 - u_int8_t bInterfaceProtocol;
92 - u_int8_t iInterface;
94 + uint8_t bDescriptorType;
95 + uint8_t bInterfaceNumber;
96 + uint8_t bAlternateSetting;
97 + uint8_t bNumEndpoints;
98 + uint8_t bInterfaceClass;
99 + uint8_t bInterfaceSubClass;
100 + uint8_t bInterfaceProtocol;
101 + uint8_t iInterface;
103 struct usb_endpoint_descriptor *endpoint;
105 @@ -141,14 +143,14 @@
106 /* Configuration descriptor information.. */
107 #define USB_MAXCONFIG 8
108 struct usb_config_descriptor {
110 - u_int8_t bDescriptorType;
111 - u_int16_t wTotalLength;
112 - u_int8_t bNumInterfaces;
113 - u_int8_t bConfigurationValue;
114 - u_int8_t iConfiguration;
115 - u_int8_t bmAttributes;
118 + uint8_t bDescriptorType;
119 + uint16_t wTotalLength;
120 + uint8_t bNumInterfaces;
121 + uint8_t bConfigurationValue;
122 + uint8_t iConfiguration;
123 + uint8_t bmAttributes;
126 struct usb_interface *interface;
128 @@ -158,28 +160,28 @@
130 /* Device descriptor */
131 struct usb_device_descriptor {
133 - u_int8_t bDescriptorType;
135 - u_int8_t bDeviceClass;
136 - u_int8_t bDeviceSubClass;
137 - u_int8_t bDeviceProtocol;
138 - u_int8_t bMaxPacketSize0;
139 - u_int16_t idVendor;
140 - u_int16_t idProduct;
141 - u_int16_t bcdDevice;
142 - u_int8_t iManufacturer;
144 - u_int8_t iSerialNumber;
145 - u_int8_t bNumConfigurations;
147 + uint8_t bDescriptorType;
149 + uint8_t bDeviceClass;
150 + uint8_t bDeviceSubClass;
151 + uint8_t bDeviceProtocol;
152 + uint8_t bMaxPacketSize0;
154 + uint16_t idProduct;
155 + uint16_t bcdDevice;
156 + uint8_t iManufacturer;
158 + uint8_t iSerialNumber;
159 + uint8_t bNumConfigurations;
160 } __attribute__ ((packed));
162 struct usb_ctrl_setup {
163 - u_int8_t bRequestType;
168 + uint8_t bRequestType;
173 } __attribute__ ((packed));
178 void *dev; /* Darwin support */
183 unsigned char num_children;
184 struct usb_device **children;
186 char dirname[PATH_MAX + 1];
188 struct usb_device *devices;
189 - u_int32_t location;
192 struct usb_device *root_dev;