This patch fixes ep_config to return correct value. Without patch
ep_config returns submitted lenght minus 4 on succes. With this
patch applied, whole submitted lenght is returned.
ep_config parses submitted data and if buffer starts with (int) 1
it is parsed, otherwise error is reported. Problem is that ep_config
returns size of buffer minus 4 on success. I think that size of buffer
should be returned instead, because there were no problems and
all data were processed.
Patch is against 2.6.17.
Signed-off-by: Milan Svoboda <[EMAIL PROTECTED]>
---
diff -uprN -X orig.bak.never.touch/Documentation/dontdiff
orig.bak.never.touch/drivers/usb/gadget/inode.c
new_gadget/drivers/usb/gadget/inode.c
--- orig.bak.never.touch/drivers/usb/gadget/inode.c 2006-06-19
14:48:25.000000000 +0000
+++ new_gadget/drivers/usb/gadget/inode.c 2006-06-23 15:03:31.000000000
+0000
@@ -742,7 +743,7 @@ ep_config (struct file *fd, const char _
struct ep_data *data = fd->private_data;
struct usb_ep *ep;
u32 tag;
- int value;
+ int value, length = len;
if ((value = down_interruptible (&data->lock)) < 0)
return value;
@@ -793,7 +794,6 @@ ep_config (struct file *fd, const char _
goto fail0;
}
}
- value = len;
spin_lock_irq (&data->dev->lock);
if (data->dev->state == STATE_DEV_UNBOUND) {
@@ -823,8 +823,10 @@ ep_config (struct file *fd, const char _
data->name);
data->state = STATE_EP_DEFER_ENABLE;
}
- if (value == 0)
+ if (value == 0) {
fd->f_op = &ep_io_operations;
+ value = length;
+ }
gone:
spin_unlock_irq (&data->dev->lock);
if (value < 0) {
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel