> > The Ethernet Gadget has the following code which is missing from
Gadget
> > Zero. Should this be added to the Gadget Zero also?
> 
> It isn't needed in either driver, although it doesn't hurt.  The
device
> controller driver will always check for (value %
gadget->ep0->maxpacket)
> == 0 before sending the ZLP, so the gadget driver doesn't need to
check.

You are right, however I will correct my analysis about the issue.
For IN transfers, the Gadget Zero driver is setting the ZLP flag
(req->zero) even if the packet size is a short packet. Is that right?

Example: 66 byte packet size sent out from gadget zero, sets the
req->zero flag, which is not correct.

The same issue has been corrected in Ethernet gadget by placing the
following check. 

In this case the gadget driver 

> > --- 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);
> 
> Alan Stern

-------------------------------------------------------------------------
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
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to