Root/atusb/fw2/usb/patches/support-vendor-requests.patch

Source at commit ec21e4ba4756379934fc24635438040f66d2ab7c created 8 years 9 months ago.
By Werner Almesberger, atusb/fw2: support device -> host side of the ATUSB EP0 protocol
1Index: fw4/class/CDC/cdc.c
2===================================================================
3--- fw4.orig/class/CDC/cdc.c 2011-02-08 17:11:11.000000000 -0300
4+++ fw4/class/CDC/cdc.c 2011-02-08 17:12:30.000000000 -0300
5@@ -76,7 +76,10 @@
6 {
7     U8 i;
8     usb_pcb_t *pcb = usb_pcb_get();
9-
10+
11+ if (req->type & TYPE_CLASS)
12+ goto reject;
13+
14     switch (req->req)
15     {
16     case GET_LINE_CODING:
17@@ -127,6 +130,7 @@
18         break;
19 
20     default:
21+ reject:
22         ep_set_stall(EP_CTRL);
23         break;
24     }
25Index: fw4/usb/ctrl.c
26===================================================================
27--- fw4.orig/usb/ctrl.c 2011-02-08 17:09:02.000000000 -0300
28+++ fw4/usb/ctrl.c 2011-02-08 17:12:51.000000000 -0300
29@@ -277,7 +277,7 @@
30     reqp = (req_t *)req;
31 
32     // decode the standard request
33- if (!(reqp->type & TYPE_CLASS))
34+ if (!(reqp->type & (TYPE_CLASS | TYPE_VENDOR)))
35     {
36         // this is a standard request
37         switch (reqp->req)
38

Archive Download this file



interactive