Skip to contentSkip to conversation

Cleware Linux Info

DISCUSSION Jochen Friedrich 1 participant 1 message Oct 13, 2002 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

Hi,

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

Quoted 3 lines

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