Gadget Zero patch for ZLP

"Pandita, Vikram" <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
While sending the string descriptor, Gadget Zero does not send a ZLP in
case the packet size is maxpacket size, resulting in a USBCV failure. 

The Ethernet Gadget has the following code which is missing from Gadget
Zero. Should this be added to the Gadget Zero also?

I have tested this change on OMAP2430 using MUSBHDRC HS USB controller.
Usbtest control and bulk tests continue to pass after this change.

Regards,
Vikram


Signed-off-by: Vikram Pandita <[email protected]>
---
diff -purN a/drivers/usb/gadget/zero.c b/drivers/usb/gadget/zero.c
--- a/drivers/usb/gadget/zero.c	2007-02-02 18:33:34.000000000 +0530
+++ b/drivers/usb/gadget/zero.c	2007-02-07 17:28:47.000000000 +0530
@@ -1072,7 +1072,8 @@ unknown:
 	/* respond with data transfer before status phase? */
 	if (value >= 0) {
 		req->length = value;
-		req->zero = value < w_length;
+		req->zero = value < w_length &&
+				(value % gadget->ep0->maxpacket) == 0;
 		value = usb_ep_queue (gadget->ep0, req, GFP_ATOMIC);
 		if (value < 0) {
 			DBG (dev, "ep_queue --> %d\n", value);


-------------------------------------------------------------------------
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.