hotplug, usbmouse and hid modules with an USB mouse
[Please CC me for the answers as I am not subscribed to the list. Thanks!]
Hi all!
Somebody reported me a problem about hotplug when used with an USB mouse. An USB mouse is supported by the kernel by two different modules, usbmouse or hid. The usbmouse module is a very simplified one which don't have all the functionalities of the hid module. However it is smaller and may be the only solution for some mouses.
hotplug uses usbmodules to know the modules to load for a specific device. For such a mouse, it returns both usbmouse and hid, which is true as both of them support the device. However, the order of the two modules depends on the devices and more precisely on its descriptors.
With some devices the usbmouse is loaded before the hid one, resulting in some functions not available. I don't thing the problem comes from usbmodules, as its purpose is to list all the modules supported by a device, not to choose the best one! I think it is the job of hotplug.
I have attached a patch to the current version (2004_03_29), to make hotplug load the hid module instead of the usbmouse module if the device supports both. BTW, it also do the same for the usbkbd module.
Could you please give me some comments about that, and if you think it is the right solution to fix the problem?
Cheers,
Aurelien
Signature · 4 lines
.''`. Aurelien Jarno GPG: 1024D/F1BCDB73 : :' : Debian GNU/Linux developer | Electrical Engineering Student `. `' [email protected] | [email protected] `- people.debian.org/~aurel32 | www.aurel32.net
etc/hotplug/hotplug.functions +6 -0
@@ -119,6 +119,12 @@ return fi + # The hid module replaces the usbmouse and usbkbd modules that have + # less possibilities. + if echo "$DRIVERS" | grep -q "hid" > /dev/null ; then + DRIVERS=`echo $DRIVERS | sed -e 's/usbkbd//g;s/usbmouse//g'` + fi + # Note that DRIVERS aren't all going to be modules. # For USB, some user-mode drivers or setup scripts may be listed. debug_mesg Setup $DRIVERS for $DESCRIPTION