On Mon, 20 Mar 2006, Franck Bui-Huu wrote:

> I'm wondering who is supposed to release/disable the endpoints which
> have been enabled while the usb driver was running. I took a look to 2
> different drivers, zero and file_storage drivers, and they both make a
> different assumption. The former is relying on the udc to release its
> previously allocated endpoints whereas the futher call
> udc->ep_disable, except for ep0...
> What's the rigth thing to do here ? BTW why file_storage driver do not
> disable ep0 ?

When a gadget driver unregisters, the UDC driver must disable any
endpoints that were left enabled.  So a gadget driver has a choice: It can
disable endpoints when it unregisters or not; either way is okay.  On the
other hand, when the gadget driver handles a Set-Config request there is
no choice: It must disable all currently enabled endpoints.

file_storage.c doesn't disable ep0 because it never enables ep0 in the 
first place.  ep0 needs to be enabled always; the UDC driver is 
responsible for managing it.

> Same question for usb->pullup. Who is supposed to call this method ?

It should be called automatically by the UDC driver when a gadget driver 
registers (to turn the pullup on) and unregisters (to turn the pullup 
off).  Apart from that it should be called only by the gadget driver,
through the use of usb_gadget_connect() and usb_gadget_disconnect().

Alan Stern



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&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