diff options
author | Frank Gevaerts <frank@gevaerts.be> | 2009-11-15 21:58:25 +0000 |
---|---|---|
committer | Frank Gevaerts <frank@gevaerts.be> | 2009-11-15 21:58:25 +0000 |
commit | 724e4fe5e413355f2bab9ac63ad8e92be37b3f32 (patch) | |
tree | 837d7b944673e66e5e877b0ed672ba3a5a15ce0f | |
parent | ec0f4b40442fc9b150ea06f11c94638e4c76acb7 (diff) | |
download | rockbox-724e4fe5e413355f2bab9ac63ad8e92be37b3f32.tar.gz rockbox-724e4fe5e413355f2bab9ac63ad8e92be37b3f32.zip |
Don't use the same completion_event for both directions. This could cause problems on USB controllers that have IN and OUT endpoints with the same endpoint number (such as the arc controller)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23639 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/usbstack/usb_core.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/firmware/usbstack/usb_core.c b/firmware/usbstack/usb_core.c index 7fd6f52249..be49df0e48 100644 --- a/firmware/usbstack/usb_core.c +++ b/firmware/usbstack/usb_core.c | |||
@@ -174,7 +174,7 @@ static struct | |||
174 | { | 174 | { |
175 | completion_handler_t completion_handler[2]; | 175 | completion_handler_t completion_handler[2]; |
176 | control_handler_t control_handler[2]; | 176 | control_handler_t control_handler[2]; |
177 | struct usb_transfer_completion_event_data completion_event; | 177 | struct usb_transfer_completion_event_data completion_event[2]; |
178 | } ep_data[USB_NUM_ENDPOINTS]; | 178 | } ep_data[USB_NUM_ENDPOINTS]; |
179 | 179 | ||
180 | static struct usb_class_driver drivers[USB_NUM_DRIVERS] = | 180 | static struct usb_class_driver drivers[USB_NUM_DRIVERS] = |
@@ -821,7 +821,7 @@ void usb_core_transfer_complete(int endpoint,int dir,int status,int length) | |||
821 | break; | 821 | break; |
822 | 822 | ||
823 | default: | 823 | default: |
824 | completion_event=&ep_data[endpoint].completion_event; | 824 | completion_event=&ep_data[endpoint].completion_event[dir!=0]; |
825 | 825 | ||
826 | completion_event->endpoint=endpoint; | 826 | completion_event->endpoint=endpoint; |
827 | completion_event->dir=dir; | 827 | completion_event->dir=dir; |
@@ -838,7 +838,7 @@ void usb_core_transfer_complete(int endpoint,int dir,int status,int length) | |||
838 | void usb_core_control_request(struct usb_ctrlrequest* req) | 838 | void usb_core_control_request(struct usb_ctrlrequest* req) |
839 | { | 839 | { |
840 | struct usb_transfer_completion_event_data* completion_event = | 840 | struct usb_transfer_completion_event_data* completion_event = |
841 | &ep_data[EP_CONTROL].completion_event; | 841 | &ep_data[EP_CONTROL].completion_event[1]; |
842 | 842 | ||
843 | completion_event->endpoint=EP_CONTROL; | 843 | completion_event->endpoint=EP_CONTROL; |
844 | completion_event->dir=0; | 844 | completion_event->dir=0; |