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

> Hi Alan
> 
> 2006/3/20, Alan Stern <[EMAIL PROTECTED]>:
> > 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
> 
> so why not always delegating the job to the UDC drivers ?

You mean, why doesn't file_storage.c always delegate the job to the UDC
driver when it unregisters?  It does.  You can see this by looking through
the fsg_unbind() routine.  It doesn't call usb_ep_disable() anywhere.

There are other times when the UDC driver might not disable endpoints,
however.  For example, when the cable is unplugged (a disconnect event).  
The gadget API doesn't specify whether endpoints are automatically
disabled by the UDC driver when a disconnect occurs, so file_storage.c
disables them by hand.  The same thing happens when a Set-Configuration or
Set-Interface request is received.

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