From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aurelien Jarno Date: Tue, 20 Apr 2004 01:14:16 +0000 Subject: hotplug, usbmouse and hid modules with an USB mouse Message-Id: <20040420011416.GA6288@pc.aurel32.private> MIME-Version: 1 Content-Type: multipart/mixed; boundary="9amGYk9869ThD9tj" List-Id: To: linux-hotplug@vger.kernel.org --9amGYk9869ThD9tj Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline [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 -- .''`. Aurelien Jarno GPG: 1024D/F1BCDB73 : :' : Debian GNU/Linux developer | Electrical Engineering Student `. `' aurel32@debian.org | aurelien@aurel32.net `- people.debian.org/~aurel32 | www.aurel32.net --9amGYk9869ThD9tj Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: attachment; filename="hotplug.hid_usbmouse.patch" diff -urN hotplug-2004_03_29.orig/etc/hotplug/hotplug.functions hotplug-2004_03_29/etc/hotplug/hotplug.functions --- hotplug-2004_03_29.orig/etc/hotplug/hotplug.functions 2004-03-29 21:25:59.000000000 +0200 +++ hotplug-2004_03_29/etc/hotplug/hotplug.functions 2004-04-20 02:56:27.000000000 +0200 @@ -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 --9amGYk9869ThD9tj-- ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel