On Sat, 17 Apr 2004, Duncan Sands wrote: > On Saturday 17 April 2004 20:31, Duncan Sands wrote: > > Alan, do you have a suggestion for how best to go from > > a struct usb_interface to an index?
The only way is by searching the interface list. That was part of the reason I left findintfif() alone rather than replacing it with a call to usb_ifnum_to_if(). > (though probably usbfs shouldn't use indices at all, > just interface numbers and struct usb_interface). It's true that code is generally cleaner using numbers rather than indices, and that's how I've been modifying the USB drivers when they need it. In general I would expect an interface number to be not much larger than the index (i.e., normally not many numbers will be skipped), so the bitmask size should be adequate in either case. We probably don't have to worry about trying to support devices with a single interface numbered 77 -- but if you wanted to then you'd have to use the index. Alan Stern ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
