On Thu, 10 Feb 2005, Oliver Neukum wrote:

> For simply net devices all outstanding packets are canceled. But are you
> really sure that no interface at all needs selective unlinking?

Have I checked all the in-kernel drivers to see if that's true?  No.  The 
statement was made from a theoretical point of view.

>  This broad
> sweeping statement about "naturalness" makes me nervous, especially
> as unlinking what you submitted seems more natural to me than
> a mass unlink.

In the phrase "what you submitted", if "you" refers to the overall driver
then there's no problem.  _Everything_ sent to an endpoint (other than
ep0) comes from a single driver.  But if "you" refers to a single
subroutine, or single subroutine invocation, then a mass unlink could well
affect URBs submitted by someone else.  As for "naturalness", see below.

> > How does the design of the USB network class fit in with the notion that a
> > bulk pipe transmits a single, reliable, logical stream of data?  Networks
> > aren't like that; they transmit unreliably many independent packets.
> 
> Neither is USB. There is the rule about short and zero packets in the spec.
> USB is clearly packetized, not a streaming protocol.

You're using the wrong term.  Yes, USB is packetized, but the
packetization is hidden from drivers (after all, it varies depending on
the speed of the connection).  The term you want is "message-oriented".

USB and network protocols are both message-oriented.  But unlike the
lowest-level network protocols, USB (non-iso) transfers are (reliable and)
sequenced.  The sequencing in particular is important here; normally it
makes no sense at all to take one message out of the middle of a sequence.  
It's an "unnatural" thing to do.  What happens instead is that you find
out something went wrong and then you want to abort the entire sequence.

Perhaps there might be a situation where the messages are supposed to be 
independent, each with its own timeout, so that you do want to cancel one 
while leaving the others.  Such a situation would be a bad match to the 
semantics of USB.  But I'm open to the possibility that it does exist 
somewhere.

In fact, I'd be happy to hear from anyone who knows of an example where a
driver wants to unlink an URB while leaving other URBs queued for the same
endpoint.

Alan Stern




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to