Re: [PATCH] USB: musb: respect usb_request->zero in control requests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 10, 2009 at 01:45:44PM -0500, Alan Stern wrote:
> I don't understand the code, but your description is wrong.  The 
> response to a control-IN request should _not_ be followed by a ZLP even 
> if the amount transferred is an exact multiple of the maxpacket size 
> and the "zero" flag is set, provided the length is equal to the wLength 
> value in the setup packet.
> 
> ZLP's are used only to delimit _short_ transfers.  If the length is the 
> same as what the host asked for, then it isn't short.

Drivers set the zero flag only on short transfers, usually like this:

	request->zero = (length < wLength);

See for example composite.c:composite_setup() right before usb_ep_queue
or file_storage.c:fsg_setup() right before ep0_queue.

  Daniel


-- 
Dipl.-Math. Daniel Glöckner, emlix GmbH, http://www.emlix.com
Fon +49 551 30664-0, Fax -11, Bahnhofsallee 1b, 37081 Göttingen, Germany
Sitz der Gesellschaft: Göttingen, Amtsgericht Göttingen HR B 3160
Geschäftsführung: Dr. Uwe Kracke, Ust-IdNr.: DE 205 198 055

emlix - your embedded linux partner
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux