On Thu, 29 Dec 2005, David Brownell wrote:

> > I mean why don't file_storage.c call the function fsg_set_halt itself and 
> > let the controller driver  handling this.
> 
> The common idiom is that the gadget driver notices right away that
> it can't handle a given setup() request, and returns a negative
> error number to trigger the consequent protocol stall ... no point in
> having all the gadget drivers duplicate code to cause that stall,
> when the controller driver already has that code in the same path
> to handle the errors in the few control requests it's handling.
> 
> The _uncommon_ idiom is what might be called a "deferred response"
> mode.  The file storage gadget uses that for SET_CONFIGURATION,
> but gadgetfs uses it for quite a lot more.  That's where the setup()
> upcall neither queues a response (success return) nor returns a
> negative number (fault return) ... but instead hands the request
> off to some other context to finish later.  Like, after a task
> gets scheduled and rescheduled a few times.

Actually the file storage gadget uses the common idiom to report an 
invalid configuration number, and it uses the uncommon idiom to report 
all other types of Set-Configuration errors.

Alan Stern



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&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