Question about pipes and ugen

Julian Elischer julian at elischer.org
Fri Dec 3 14:08:33 PST 2004



M. Warner Losh wrote:

>In message: <41B0DD18.9080300 at elischer.org>
>            Julian Elischer <julian at elischer.org> writes:
>: 
>: 
>: M. Warner Losh wrote:
>: 
>: >In message: <41B0C118.8070001 at elischer.org>
>: >            Julian Elischer <julian at elischer.org> writes:
>: >: I didn't say stack.. I said libusb (excepty I spelled it usblib)
>: >
>: >OK.  I got confused...
>: >
>: >: it recovers on several machines where FreeBSD looses communications with 
>: >: the target after an error.
>: >
>: >Hmmmm.  Actually, FreeBSD does do the ClearFeature(Halt) on opening of
>: >pipes by the driver (which ugen does each time the pipe subdevice is
>: >opened).  ClearFeature(Stall) was unfortunately typed from memory
>: >rather than looking at the standard (section 9.4.5).  What were you
>: >thinking about changing in this area?
>: >
>: 
>: BTW it does the halt too late.. by that time it has already tried to do 
>: other opertations that
>: have probably timed out (at least on the stupid device I have) so it's 
>: aborted before it ever gets
>: to the ClearFeature(Halt).
>
>It does this as soon as the driver opens the pipe.  Nothing can have
>happened on the pipe before that.  I don't understand what you are
>saying here.  It might also do it other times, but it definitely does
>it on open...
>

when we open the ugen device the first thing that happens is that the 
device fetches some descriptors..

some of these requests fail ..
I'm still investigating however.  it would be good thuogh if a timeout 
woudl result in the clearing
of the halt state if it exists as well as an open..
we may not want to have to close the device.. (as I said.. openning it 
again fails :-/)
The reason I'm still investigating is because it's almost 100% that this 
is because of the incredibally
broken device so I don't want to do anything that is detrimental to well 
behaved devices..

I hope to have more info next week.
When the device times out on endpoint 3, Linux (thorugh libusb) issues a 
ClearFeature(Halt)
which seems to get everything going again. FreeBSD doesn't, so we  have 
to power teh device
down and re-power it (!yuk!).

There must be other devices that need this or Linux wouldn't do it.

I'm looking whether the kernel couldn't  take care of this or whether we 
shoudl implement
it in libusb like Linux does.





>
>Warner
>  
>



More information about the freebsd-usb mailing list