Re: Cleware Linux Info

From: Jochen Friedrich (jochen@scram.de)
Date: Sun Oct 13 2002 - 05:14:13 EST


Hi,

i assume you try to search for a particular HID device by its serial
number.

> 1. The struct hiddev_devinfo lacks the serial number. In the usb
> structure, the
> index of the string is available, but not the number itself.

I don't think it's the right way to scan through all devices and query for
the serial number (even if it were available). This would be a very
expensive operation on systems with devfs as modprobe would be called on
each try to open an unavailable device (I know some ALSA utils
occasionally do the same, but it's still a bad thing).

IMHO, the right way would be to scan /proc/bus/usb/devices for the device
with the desired serial number and then open the corresponding
hiddev device.

However, it looks like the information about the corresponding
hiddev device is not included in /proc/bus/usb/devices (at least on
2.4.19). Is there a way to get the device name without scanning through
all hiddev devices and scan for the USB dev num instead (would be as bad
as scanning for the serial number in the first place).

--jochen

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Oct 15 2002 - 22:00:46 EST