On Thursday 22 July 2004 07:04, Alan Stern wrote: > On Thu, 22 Jul 2004, [ks_c_5601-1987] ¹عب£»َ wrote: > > > In file_storage.c from /driver/usb/gadget, there are two parts handling > > Standard Request and Class-Specific Request. However, in my opinion, there > > is one part handling Requests in net2280.c, that is... > > tmp = dev->driver->setup (&dev->gadget, &u.r); > > If so, how file_storage.c distinguishes two Requests? > > "distinguish" means that one case, it calls 'class_setup_req' function and > > another case, it calls 'standard_setup_req'. > > Use the source. In fsg_setup() you'll see: > > if ((ctrl->bRequestType & USB_TYPE_MASK) == USB_TYPE_CLASS) > rc = class_setup_req(fsg, ctrl); > else > rc = standard_setup_req(fsg, ctrl); > > That's how it distinguishes standard requests and class-specific requests.
Or just do it the way g_ether does it: switch on the request code, then sanity check the request type. I perhaps mind a big switch statement less than Alan. - Dave ------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_idG21&alloc_id040&op=click _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel