Re: /dev/input/mice doesn't work in test9?

From: Andrey Borzenkov (arvidjaar_at_mail.ru)
Date: 11/02/03

  • Next message: Mike Fedyk: "Re: Modular ipv4 inquiries..."
    To: DervishD <raul@pleyades.net>
    Date:	Sun, 2 Nov 2003 20:45:41 +0300
    
    

    On Sunday 02 November 2003 15:08, DervishD wrote:
    [...]
    >
    > > You have input built-in which means there is no reason for kernel
    > > to try autoload driver for char-13 as it is already available.
    >
    > But not char-major-13-32, for example.
    >

    for kernel device == major. It is assumed that complete major is handled by
    single driver. In exception cases when there are different drivers either you
    have one acting like dispatcher (input case) or one that simply requests more
    specific driver (misc case). But again, mousedev is using range of minors and
    there is currently no established way to construct aliases for that. Short of
    defining

    alias char-major-13-32 mousedev
    alias char-major-13-33 mousedev
    ...
    alias char-major-13-63 mousedev

    looks rather weird.

    > > You may add explicit per-minor autoloading to input.c, see
    > > drivers/input/input.c:input_open_file()
    >
    > But that code works with the 'input_table', and the
    > input_handlers. The handlers are registered by the modules when they
    > are already loaded. Do you mean that I should modify input_open_file
    > in order to autoload the appropriate module in the case of the
    > handler not being present?

    yes with the caveats above.

    [...]
    >
    > > If you are using hotplug, both should be loaded by hotplug. IMHO it is
    > > also the right way to go.
    >
    > The problem is that hotplug doesn't work for me in this case. I
    > mean, with hotplug in *this particular case*, since the mouse is
    > always connected, the modules will be loaded on bootup and unloaded
    > on shutdown, not when the mouse device is opened and closed,
    > respectively.
    >

    that is what coldplug is for. Hotplug comes with initscript that (if enabled)
    looks for devices already connected and emulates "connect" event for them. I
    use it between other things to load mousedev for PS/2 mouse that is always
    connected ... but I am running 2.6 in the first place (it won't work on 2.4)
    and modified hotplug package that supports input handlers. So when it finds
    any driver for input devices it automatically loads input handler for events
    generated by those devices.

    > I've tested with hotplug (well, I don't have hotplug utilities
    > installed, just a shell script that tells me if someone is calling
    > /sbin/hotplug and logs the parameters), and /sbin/hotplug is not
    > called when I try to open /dev/mouse (c 13 32).
    >

    of course not. It works differently. When you plug in USB mouse (or when
    hotplug initscript emulates plugging in USB mouse) hotplug calls USB agent.
    USB agent checks USB device ID and finds which modules to load. It is
    possible that it finds several modules. One of them is hardcoded - it is
    mousedev. Another one is hid that declares itself as driver for USB mouse.
    That simple.

    [...]
    >
    > Yes, I'm going to build in hid, but, should I do the same with
    > mousedev (or event, joystick, etc...) or will it work with hid loaded
    > when doing 'cat /dev/mouse'?
    >

    yes you should build it in. Or ensure it is loaded together with hid.

    -andrey

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Mike Fedyk: "Re: Modular ipv4 inquiries..."

    Relevant Pages

    • Latest HotPlug upgrade.
      ... USB NEWS FLASH! ... The latest hotplug upgrade from SID now installs uhci-hcd without its being ... drivers/usb/core/usb.c: registered new driver usbfs ... USB Serial support registered for IR Dongle ...
      (Debian-User)
    • Re: USB driver for digital camera?
      ... > saying that USB has detected the new device, but that there is no active ... > driver for it. ... Do you have 'hotplug' package installed? ... hotplug will automatically load usb-storage and you'll see ...
      (Debian-User)
    • Re: [RFC/PATCH 0/22] W1: sysfs, lifetime and other fixes
      ... It is not hotplug, and your changes broke it completely. ... > - separate master registering and allocation so drivers can setup proper ... > Drop custom-made hotplug over netlink notification from w1 core. ... > - get rid of separate refcount, rely on driver model to enforce ...
      (Linux-Kernel)
    • [PATCH] driver core: replace "hotplug" by "uevent"
      ... Leave the overloaded "hotplug" word to susbsystems which are handling ... This last call causes the device driver for the card to be stopped, ... extern struct kobj_type ktype_part; ... static struct kset acpi_namespace_kset = { ...
      (Linux-Kernel)
    • [PATCH 4/4, v5] ACPI, PCI: ACPI PCI slot detection driver
      ... Detect all physical PCI slots as described by ACPI, ... Not all physical slots are hotpluggable, and the acpiphp module ... our system, without caring about hotplug. ... Return -EBUSY if an hp driver attempts to register a slot ...
      (Linux-Kernel)