On Mon, 18 Mar 2002 08:49, David Brownell wrote: > > Unfortunately, your problem cannot be solved right now. There is > > currently no way to register the device info with a USB device, so that > > it appears somewhere in /proc/bus/usb. There are all sorts of problems > > with this (driver having multiple configurations, multiple devices per > > USB device, devices that don't have a /dev entry (network interfaces!)), > > etcetera, etcetera. > > It can be solved for any particular driver just by adding usb(dev)fs ioctl > support to that driver. Define a structure, say FOO, that encapsulates the > relevant device ID info ... for /dev files, major/minor and whether it's > character or block; for network devices, something else. > > Then USBDEVFS_IOCTL can be used to pass an ioctl request for FOO > to that driver (current configuration, one of N functions). And the driver > can fill it out, so the user level code can find the "higher level" device > IDs. > > It'd be useful to have a generic definition of "FOO", since there's no > good reason each driver should re-invent that (and the ioctl to pass > through USBDEVFS_IOCTL). Then drivers could just implement that > ioctl, to provide that information in a usefully standard form. As an example of this, look at the way in which the ethtool support works for network drivers. We can currently tell which ethernet device corresponds to which PCI or USB device, with a fair degree of confidence (it is subject to races, but they are unlikely, and under control of the user). However the mapping is only from ethX to /proc/bus/usb/YYY/ZZZ, not in the reverse direction (without exhaustive search).
The contents of struct FOO depend on what we are trying to accomplish. What things do user space tool writers want to see (and why)? Is the need USB specific (eg for a webcam, do we want to deal only with USB webcams, or do parallel port and ieee1394 cams matter too)? Brad _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel