Re: [PATCH v2] target: add usb gadget fabric module

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

 



On 01/18/2012 06:20 PM, Alan Stern wrote:
On Wed, 18 Jan 2012, Sebastian Andrzej Siewior wrote:

Okay. So embedding the direction flag into the cdb handling is a
possible way.

The best approach would be something like what Nicholas said.  The
target layer should provide an API for getting the expected length and
direction of a command.
Okay.

The host side sets residue via

     sdb->resid = sdb->length - urb->actual_length;

once the data urb completes which is before the status urb (end)
arrives.

Why does the host's data URB complete?  Does the device always
terminate the transfer with a short packet if the amount of data it
sends is smaller than the host expects to receive?  How does the device
know how much the host expects?

The spec does not say anything about termination of packets. So device
sends a multiple of maxpacketsize bytes then we stuck.

What if you want to receive too little data?

Don't get it. But you send a smaller URB then.

But then you'll send a status URB response at a time when the host is
still trying to send data.  What will the host do if its status URB
completes before its data URB?

If a read or write does not complete before the status URB arrives then
the host goes boom. Sarah is looking into error handling :)


Alan Stern

Sebastian
--
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