Skip to contentSkip to conversation

Question about bcdDevice_(lo|hi)

DISCUSSION Marcus Harnisch 2 participants 3 messages Jan 9, 2002 – Jan 12, 2002

lore
Share & tools
lore
#0 lore raw

Hi List,

I just started to use linux hotplug (2001_09_19). When I tried to find the reason why no map-entry for my camcorder matches, I came across something I really don't understand.

usb.agent matches the bcdDevice columns in a map file using the following statements:

: bcdDevice range $bcdDevice_hi $bcdDevice_lo actual $usb_bcdDevice if [ $USB_MATCH_DEV_LO -eq $(( $match_flags & $USB_MATCH_DEV_LO )) ] &&
[ $usb_bcdDevice -lt $bcdDevice_lo ]; then
continue
fi

# bcdDevice_lo <= bcdDevice < bcdDevice_hi
if [ $USB_MATCH_DEV_HI -eq $(( $match_flags & $USB_MATCH_DEV_HI )) ] &&
[ $usb_bcdDevice -ge $bcdDevice_hi ]; then
continue
fi

The according entries in the map-files for all devices are a 4-digit hexnumber for bcdDevice_lo and a 2-digit hexnumber for bcdDevice_hi. With *very* few exceptions if bcdDevice that is greater or equal to bcdDevice_lo (first condition) it is also greater than bcdDevice_hi. This causes no match to be found in the vast majority of cases (Þvices).

In my particular case, bcdDevice is 0x0300. So for test purposes I set up an entry in usb.usermap with bcdDevice_lo to 0x0300. Which 2-digit hexnumber would match the second condition? When I set bcdDevice_hi to any number (well, I didn't try all of 'em :) above 0x02ff, everything worked fine.

I really can't believe that this is a bug that nobody has seen before. Can somebody explain that to me?

Best regards,
Marcus

_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#1 lore raw
Quoted 3 lines

The according entries in the map-files for all devices are a 4-digit hexnumber for bcdDevice_lo and a 2-digit hexnumber for bcdDevice_hi.

Not on my system -- they're all four digits. Is it possible you have the wrong version of "modutils"? So far as I know, this syntax has not changed since modutils 2.4.1 ... previous versions don't work correctly with 2.4.x kernels.

- Dave

_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#2 lore raw
In reply to Marcus Harnisch

Hi David,

Meanwhile I noticed that these numbers in the map files have indeed four digits. I don't know what exactly happened here. Maybe I was off by one column. The titles in the file usb.handmap that comes with hotplug are (mis)aligned so that the title bcdDevice_hi' is above the column of bDeviceClass' which has only two digits.

I got it to work anyway, so never mind.

Best regards,
Marcus

_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel