[package] update radvd to 1.6
[openwrt/svn-archive/archive.git] / utils / gadgetfs-test / patches / 001-linux_usb_org_2007_11_29.patch
1 diff -Nur gadgetfs-test.orig/usb.c gadgetfs-test.2007-11-29/usb.c
2 --- gadgetfs-test.orig/usb.c 2007-06-21 16:36:32.000000000 +0200
3 +++ gadgetfs-test.2007-11-29/usb.c 2007-09-25 09:01:48.000000000 +0200
4 @@ -34,8 +34,8 @@
5 #include <asm/byteorder.h>
6
7 #include <linux/types.h>
8 -#include <linux/usb_gadgetfs.h>
9 -#include <linux/usb_ch9.h>
10 +#include <linux/usb/gadgetfs.h>
11 +#include <linux/usb/ch9.h>
12
13 #ifdef AIO
14 /* this aio code works with libaio-0.3.106 */
15 @@ -402,6 +402,26 @@
16 fs_status_desc.bEndpointAddress = USB_DIR_IN | 3;
17 EP_STATUS_NAME = "ep3in-int";
18
19 + /* Atmel AT32AP700x processors, high/full speed */
20 + } else if (stat (DEVNAME = "atmel_usba_udc", &statb) == 0) {
21 + HIGHSPEED = 1;
22 + device_desc.bcdDevice = __constant_cpu_to_le16 (0x0108);
23 +
24 + fs_source_desc.bEndpointAddress
25 + = hs_source_desc.bEndpointAddress
26 + = USB_DIR_IN | 1;
27 + EP_IN_NAME = "ep1in-bulk";
28 + fs_sink_desc.bEndpointAddress
29 + = hs_sink_desc.bEndpointAddress
30 + = USB_DIR_OUT | 2;
31 + EP_OUT_NAME = "ep2out-bulk";
32 +
33 + source_sink_intf.bNumEndpoints = 3;
34 + fs_status_desc.bEndpointAddress
35 + = hs_status_desc.bEndpointAddress
36 + = USB_DIR_IN | 3;
37 + EP_STATUS_NAME = "ep3in-int";
38 +
39 } else {
40 DEVNAME = 0;
41 return -ENODEV;
42 @@ -597,18 +617,58 @@
43 fs_status_desc.bEndpointAddress = USB_DIR_IN | 3;
44 EP_STATUS_NAME = "ep3-int";
45
46 + /* Atmel AT32AP700x processors, high/full speed */
47 + } else if (stat (DEVNAME = "atmel_usba_udc", &statb) == 0){
48 + HIGHSPEED = 1;
49 +
50 + device_desc.bcdDevice = __constant_cpu_to_le16 (0x0105);
51 +
52 + fs_source_desc.bEndpointAddress
53 + = hs_source_desc.bEndpointAddress
54 + = USB_DIR_IN | 5;
55 + fs_source_desc.bmAttributes
56 + = hs_source_desc.bmAttributes
57 + = USB_ENDPOINT_XFER_ISOC;
58 + fs_source_desc.wMaxPacketSize
59 + = hs_source_desc.wMaxPacketSize
60 + = __cpu_to_le16(min (bufsize, 1024));
61 + fs_source_desc.bInterval
62 + = hs_source_desc.bInterval
63 + = interval;
64 + EP_IN_NAME = "ep5in-iso";
65 +
66 + fs_sink_desc.bEndpointAddress
67 + = hs_sink_desc.bEndpointAddress
68 + = USB_DIR_OUT | 6;
69 + fs_sink_desc.bmAttributes
70 + = hs_sink_desc.bmAttributes
71 + = USB_ENDPOINT_XFER_ISOC;
72 + fs_sink_desc.wMaxPacketSize
73 + = hs_sink_desc.wMaxPacketSize
74 + = __cpu_to_le16(min (bufsize, 1024));
75 + fs_sink_desc.bInterval
76 + = hs_sink_desc.bInterval
77 + = interval;
78 + EP_OUT_NAME = "ep6out-iso";
79 +
80 + source_sink_intf.bNumEndpoints = 3;
81 + fs_status_desc.bEndpointAddress
82 + = hs_status_desc.bEndpointAddress
83 + = USB_DIR_IN | 3;
84 + EP_STATUS_NAME = "ep3in-int";
85 +
86 } else {
87 DEVNAME = 0;
88 return -ENODEV;
89 }
90 if (verbose) {
91 fprintf (stderr, "iso fs wMaxPacket %04x bInterval %02x\n",
92 - fs_sink_desc.wMaxPacketSize,
93 + __le16_to_cpu(fs_sink_desc.wMaxPacketSize),
94 fs_sink_desc.bInterval);
95 if (HIGHSPEED)
96 fprintf (stderr,
97 "iso hs wMaxPacket %04x bInterval %02x\n",
98 - hs_sink_desc.wMaxPacketSize,
99 + __le16_to_cpu(hs_sink_desc.wMaxPacketSize),
100 hs_sink_desc.bInterval);
101 }
102 return 0;
103 @@ -1285,13 +1345,17 @@
104 {
105 int status, tmp;
106 __u8 buf [256];
107 + __u16 value, index, length;
108 +
109 + value = __le16_to_cpu(setup->wValue);
110 + index = __le16_to_cpu(setup->wIndex);
111 + length = __le16_to_cpu(setup->wLength);
112
113 if (verbose)
114 fprintf (stderr, "SETUP %02x.%02x "
115 "v%04x i%04x %d\n",
116 setup->bRequestType, setup->bRequest,
117 - setup->wValue, setup->wIndex,
118 - setup->wLength);
119 + value, index, length);
120
121 /*
122 if ((setup->bRequestType & USB_TYPE_MASK) != USB_TYPE_STANDARD)
123 @@ -1302,21 +1366,21 @@
124 case USB_REQ_GET_DESCRIPTOR:
125 if (setup->bRequestType != USB_DIR_IN)
126 goto stall;
127 - switch (setup->wValue >> 8) {
128 + switch (value >> 8) {
129 case USB_DT_STRING:
130 - tmp = setup->wValue & 0x0ff;
131 + tmp = value & 0x0ff;
132 if (verbose > 1)
133 fprintf (stderr,
134 "... get string %d lang %04x\n",
135 - tmp, setup->wIndex);
136 - if (tmp != 0 && setup->wIndex != strings.language)
137 + tmp, index);
138 + if (tmp != 0 && index != strings.language)
139 goto stall;
140 status = usb_gadget_get_string (&strings, tmp, buf);
141 if (status < 0)
142 goto stall;
143 tmp = status;
144 - if (setup->wLength < tmp)
145 - tmp = setup->wLength;
146 + if (length < tmp)
147 + tmp = length;
148 status = write (fd, buf, tmp);
149 if (status < 0) {
150 if (errno == EIDRM)
151 @@ -1336,7 +1400,7 @@
152 if (setup->bRequestType != USB_DIR_OUT)
153 goto stall;
154 if (verbose)
155 - fprintf (stderr, "CONFIG #%d\n", setup->wValue);
156 + fprintf (stderr, "CONFIG #%d\n", value);
157
158 /* Kernel is normally waiting for us to finish reconfiguring
159 * the device.
160 @@ -1349,7 +1413,7 @@
161 * the endpoints always active and don't rely on seeing any
162 * config change events, either this or SET_INTERFACE.
163 */
164 - switch (setup->wValue) {
165 + switch (value) {
166 case CONFIG_VALUE:
167 start_io ();
168 break;
169 @@ -1369,27 +1433,27 @@
170 return;
171 case USB_REQ_GET_INTERFACE:
172 if (setup->bRequestType != (USB_DIR_IN|USB_RECIP_INTERFACE)
173 - || setup->wIndex != 0
174 - || setup->wLength > 1)
175 + || index != 0
176 + || length > 1)
177 goto stall;
178
179 /* only one altsetting in this driver */
180 buf [0] = 0;
181 - status = write (fd, buf, setup->wLength);
182 + status = write (fd, buf, length);
183 if (status < 0) {
184 if (errno == EIDRM)
185 fprintf (stderr, "GET_INTERFACE timeout\n");
186 else
187 perror ("write GET_INTERFACE data");
188 - } else if (status != setup->wLength) {
189 + } else if (status != length) {
190 fprintf (stderr, "short GET_INTERFACE write, %d\n",
191 status);
192 }
193 return;
194 case USB_REQ_SET_INTERFACE:
195 if (setup->bRequestType != USB_RECIP_INTERFACE
196 - || setup->wIndex != 0
197 - || setup->wValue != 0)
198 + || index != 0
199 + || value != 0)
200 goto stall;
201
202 /* just reset toggle/halt for the interface's endpoints */
203 diff -Nur gadgetfs-test.orig/usbstring.c gadgetfs-test.2007-11-29/usbstring.c
204 --- gadgetfs-test.orig/usbstring.c 2007-06-21 16:36:32.000000000 +0200
205 +++ gadgetfs-test.2007-11-29/usbstring.c 2007-09-25 09:01:48.000000000 +0200
206 @@ -11,7 +11,7 @@
207 #include <string.h>
208
209 #include <linux/types.h>
210 -#include <linux/usb_ch9.h>
211 +#include <linux/usb/ch9.h>
212
213 #include "usbstring.h"
214