1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-11-30 07:34:41 +02:00
ben-wpan/atusb/fw2/usb/patches/support-vendor-requests.patch
Werner Almesberger ec21e4ba47 atusb/fw2: support device -> host side of the ATUSB EP0 protocol
- ep0.c: the ATUSB EP0 protocol engine
- Makefile (OBJS): added ep0.o
- atusb.c (main): initialize the EP0 protocol
- spi.h: whitespace cleanup

usb/patches/support-vendor-requests.patch:

- usb/ctrl.c (ctrl_handler): also pass vendor-specific requests to the
  class handler
- class/CDC/cdc.c (cdc_req_handler): reject vendor requests
2011-02-08 23:53:25 -03:00

38 lines
978 B
Diff

Index: fw4/class/CDC/cdc.c
===================================================================
--- fw4.orig/class/CDC/cdc.c 2011-02-08 17:11:11.000000000 -0300
+++ fw4/class/CDC/cdc.c 2011-02-08 17:12:30.000000000 -0300
@@ -76,7 +76,10 @@
{
U8 i;
usb_pcb_t *pcb = usb_pcb_get();
-
+
+ if (req->type & TYPE_CLASS)
+ goto reject;
+
switch (req->req)
{
case GET_LINE_CODING:
@@ -127,6 +130,7 @@
break;
default:
+ reject:
ep_set_stall(EP_CTRL);
break;
}
Index: fw4/usb/ctrl.c
===================================================================
--- fw4.orig/usb/ctrl.c 2011-02-08 17:09:02.000000000 -0300
+++ fw4/usb/ctrl.c 2011-02-08 17:12:51.000000000 -0300
@@ -277,7 +277,7 @@
reqp = (req_t *)req;
// decode the standard request
- if (!(reqp->type & TYPE_CLASS))
+ if (!(reqp->type & (TYPE_CLASS | TYPE_VENDOR)))
{
// this is a standard request
switch (reqp->req)