[package] add two debian patches against libusb, thanks neomilium
[openwrt/svn-archive/archive.git] / libs / libusb / patches / 001-debian_ansi_types.patch
1
2 ---
3 usb.h.in | 118 ++++++++++++++++++++++++++++++++-------------------------------
4 1 file changed, 60 insertions(+), 58 deletions(-)
5
6 --- a/usb.h.in
7 +++ b/usb.h.in
8 @@ -13,8 +13,10 @@
9
10 #include <unistd.h>
11 #include <stdlib.h>
12 +#include <stdint.h>
13 #include <limits.h>
14
15 +#include <sys/param.h>
16 #include <dirent.h>
17
18 /*
19 @@ -64,40 +66,40 @@
20
21 /* All standard descriptors have these 2 fields in common */
22 struct usb_descriptor_header {
23 - u_int8_t bLength;
24 - u_int8_t bDescriptorType;
25 + uint8_t bLength;
26 + uint8_t bDescriptorType;
27 } __attribute__ ((packed));
28
29 /* String descriptor */
30 struct usb_string_descriptor {
31 - u_int8_t bLength;
32 - u_int8_t bDescriptorType;
33 - u_int16_t wData[1];
34 + uint8_t bLength;
35 + uint8_t bDescriptorType;
36 + uint16_t wData[1];
37 } __attribute__ ((packed));
38
39 /* HID descriptor */
40 struct usb_hid_descriptor {
41 - u_int8_t bLength;
42 - u_int8_t bDescriptorType;
43 - u_int16_t bcdHID;
44 - u_int8_t bCountryCode;
45 - u_int8_t bNumDescriptors;
46 - /* u_int8_t bReportDescriptorType; */
47 - /* u_int16_t wDescriptorLength; */
48 + uint8_t bLength;
49 + uint8_t bDescriptorType;
50 + uint16_t bcdHID;
51 + uint8_t bCountryCode;
52 + uint8_t bNumDescriptors;
53 + /* uint8_t bReportDescriptorType; */
54 + /* uint16_t wDescriptorLength; */
55 /* ... */
56 } __attribute__ ((packed));
57
58 /* Endpoint descriptor */
59 #define USB_MAXENDPOINTS 32
60 struct usb_endpoint_descriptor {
61 - u_int8_t bLength;
62 - u_int8_t bDescriptorType;
63 - u_int8_t bEndpointAddress;
64 - u_int8_t bmAttributes;
65 - u_int16_t wMaxPacketSize;
66 - u_int8_t bInterval;
67 - u_int8_t bRefresh;
68 - u_int8_t bSynchAddress;
69 + uint8_t bLength;
70 + uint8_t bDescriptorType;
71 + uint8_t bEndpointAddress;
72 + uint8_t bmAttributes;
73 + uint16_t wMaxPacketSize;
74 + uint8_t bInterval;
75 + uint8_t bRefresh;
76 + uint8_t bSynchAddress;
77
78 unsigned char *extra; /* Extra descriptors */
79 int extralen;
80 @@ -115,15 +117,15 @@
81 /* Interface descriptor */
82 #define USB_MAXINTERFACES 32
83 struct usb_interface_descriptor {
84 - u_int8_t bLength;
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;
93 + uint8_t bLength;
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;
102
103 struct usb_endpoint_descriptor *endpoint;
104
105 @@ -141,14 +143,14 @@
106 /* Configuration descriptor information.. */
107 #define USB_MAXCONFIG 8
108 struct usb_config_descriptor {
109 - u_int8_t bLength;
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;
116 - u_int8_t MaxPower;
117 + uint8_t bLength;
118 + uint8_t bDescriptorType;
119 + uint16_t wTotalLength;
120 + uint8_t bNumInterfaces;
121 + uint8_t bConfigurationValue;
122 + uint8_t iConfiguration;
123 + uint8_t bmAttributes;
124 + uint8_t MaxPower;
125
126 struct usb_interface *interface;
127
128 @@ -158,28 +160,28 @@
129
130 /* Device descriptor */
131 struct usb_device_descriptor {
132 - u_int8_t bLength;
133 - u_int8_t bDescriptorType;
134 - u_int16_t bcdUSB;
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;
143 - u_int8_t iProduct;
144 - u_int8_t iSerialNumber;
145 - u_int8_t bNumConfigurations;
146 + uint8_t bLength;
147 + uint8_t bDescriptorType;
148 + uint16_t bcdUSB;
149 + uint8_t bDeviceClass;
150 + uint8_t bDeviceSubClass;
151 + uint8_t bDeviceProtocol;
152 + uint8_t bMaxPacketSize0;
153 + uint16_t idVendor;
154 + uint16_t idProduct;
155 + uint16_t bcdDevice;
156 + uint8_t iManufacturer;
157 + uint8_t iProduct;
158 + uint8_t iSerialNumber;
159 + uint8_t bNumConfigurations;
160 } __attribute__ ((packed));
161
162 struct usb_ctrl_setup {
163 - u_int8_t bRequestType;
164 - u_int8_t bRequest;
165 - u_int16_t wValue;
166 - u_int16_t wIndex;
167 - u_int16_t wLength;
168 + uint8_t bRequestType;
169 + uint8_t bRequest;
170 + uint16_t wValue;
171 + uint16_t wIndex;
172 + uint16_t wLength;
173 } __attribute__ ((packed));
174
175 /*
176 @@ -250,7 +252,7 @@
177
178 void *dev; /* Darwin support */
179
180 - u_int8_t devnum;
181 + uint8_t devnum;
182
183 unsigned char num_children;
184 struct usb_device **children;
185 @@ -262,7 +264,7 @@
186 char dirname[PATH_MAX + 1];
187
188 struct usb_device *devices;
189 - u_int32_t location;
190 + uint32_t location;
191
192 struct usb_device *root_dev;
193 };
194