linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Aurelien Jarno <aurelien@aurel32.net>
To: linux-hotplug@vger.kernel.org
Subject: hotplug, usbmouse and hid modules with an USB mouse
Date: Tue, 20 Apr 2004 01:14:16 +0000	[thread overview]
Message-ID: <20040420011416.GA6288@pc.aurel32.private> (raw)

[-- Attachment #1: Type: text/plain, Size: 1568 bytes --]

[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

[-- Attachment #2: hotplug.hid_usbmouse.patch --]
[-- Type: text/plain, Size: 751 bytes --]

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

             reply	other threads:[~2004-04-20  1:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-20  1:14 Aurelien Jarno [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-05-20 17:57 hotplug, usbmouse and hid modules with an USB mouse Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040420011416.GA6288@pc.aurel32.private \
    --to=aurelien@aurel32.net \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).