On Saturday 07 May 2005 2:42 pm, Alan Stern wrote: > On Sat, 7 May 2005, David Brownell wrote: > > > > Also i found that there is a bcddevice no in all gadget drivers. Do > > > i need to register officially? > > > > That is, to fit into blocks of code like: > > > > } else if (gadget_is_omap (gadget)) { > > device_desc.bcdDevice = __constant_cpu_to_le16 (0x0208); > > } else if (gadget_is_lh7a40x(gadget)) { > > device_desc.bcdDevice = __constant_cpu_to_le16 (0x0209); > > ... > > } else if (gadget_is_at91(gadget)) { > > device_desc.bcdDevice = __constant_cpu_to_le16 (0x0213); > > This section of code strikes me as an excellent candidate for a library > routine, since it's reused practically verbatim in a number of gadget > drivers.
Yes and no. There'd still need to be code like that to detect cases like controllers that can't handle particular protocol features ... for example, altsettings and multiple interfaces, without both of which CDC Ethernet can't be supported. (All CDC devices, including ACM, need at least multiple interfaces. Unless you prefer to ignore the standards, like Belcarra.) The Ethernet driver also refuses to run with drivers it doesn't recognize, to prevent using the CDC subset with controllers that are functional enough to support CDC Ethernet. That logic isn't wholly amenable to a library function; but for now, it's the only gadget driver with that sort of issue. But in general I agree: it'd make sense to have something simple, even an inline in "gadget.h", return the 0..99 number that our current convention associates with a given controller. - Dave ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel