Hi, On Sun, Feb 03, 2002 at 04:10:42PM +0000, Major A wrote: > Would it be possible to extend sanei_config_attach_matching_devices() > to detect USB devices? Under linux at least, usbdevfs in /proc gives > direct information about all attached devices, so it should not be too > hard.
See sanei_usb_attach_matching_devices (in sanei_usb.h and sanei_usb.c). We once hat the test for "usb * *" in sanei_config_attach_matching_devices() but in this case we must link every backend (even the SCSI backends) to sanei_usb.o and every USB backend to sanei_scsi. This should be avoided. The current test scans the known USB devices like /dev/usb/scanner0 and uses the Linux kernel ioctls to ask them about manufacturer and product numbers. If you know how to access a certain USB device via /proc/bus/usb please write a patch to add this support. However, this should only be an addition to the current solution, because not everybody uses usbdevfs. Most of the people who ask me about Mustek USB scanners don't have installed it. We had a discussion about usbdevfs when I first wrote sanei_usb. The problem was that there is no correlation between the devices entries and the /dev/usb/scanner files. If you find a different approach, patches are welcome. Bye, Henning
