From mboxrd@z Thu Jan 1 00:00:00 1970 From: Norbert Preining Date: Mon, 08 Jan 2001 16:55:28 +0000 Subject: hotplugging with current modutils and usbd cvs MIME-Version: 1 Content-Type: multipart/mixed; boundary="98e8jtXdkpgskNou" Message-Id: List-Id: To: linux-hotplug@vger.kernel.org --98e8jtXdkpgskNou Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi there! Here my experiences with hotplugging with modutils-2.4.1, linux-2.4.0 with the hotplug patch applied. My devices plug well AFTER I add the matchflag to the read statement in the hotplug script. But for mousedev/joydev hotplugging I had to patch in the input-hotplug patch. usb-storage and joydev does NOT hotplug, but I still use my local-usbmap approach to do this. I attach the folowing files: hotplug-local.patch Patch for new modules.usbmap format and for local map support usb-map.local My local usbmap for usb-storage (sddr-31) and joydev for Logitech Wingman Digital Extreme input.patch The patch for automagically hotpluging of mousedev (and joydev?) From David Brownell I hope that helps and we see improved usbd cvs scripts soon ;-) Best wishes Norbert -- ciao norb +-------------------------------------------------------------------+ | Norbert Preining http://www.logic.at/people/preining | | University of Technology Vienna, Austria preining@logic.at | | DSA: 0x09C5B094 (RSA: 0xCF1FA165) mail subject: get [DSA|RSA]-key | +-------------------------------------------------------------------+ --98e8jtXdkpgskNou Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="hotplug-local.patch" --- hotplug.orig Mon Jan 8 08:58:20 2001 +++ hotplug Mon Jan 8 17:43:24 2001 @@ -132,6 +132,8 @@ PCI_MAP=$MODDIR/modules.pcimap USB_MAP=$MODDIR/modules.usbmap +USB_LOCAL_MAP=/etc/usb/usb-map.local + DRIVERS= #################################################################### @@ -207,7 +209,7 @@ # NOTE: this match algorithm is just a filter; some drivers need # to look at the device for reasons other than paranoia - while read module idVendor idProduct bcdDevice_lo bcdDevice_hi bDeviceClass bDeviceSubClass bDeviceProtocol bInterfaceClass bInterfaceSubClass bInterfaceProtocol ignored + while read module matchflag idVendor idProduct bcdDevice_lo bcdDevice_hi bDeviceClass bDeviceSubClass bDeviceProtocol bInterfaceClass bInterfaceSubClass bInterfaceProtocol ignored do : checkmatch $module @@ -362,6 +364,11 @@ if [ -f $2 ]; then $1_convert_vars $1_map_modules < $2 + if [ "$1" = "usb" ] ; then + if [ -f "$USB_LOCAL_MAP" ] ; then + usb_map_modules < $USB_LOCAL_MAP + fi + fi else mesg "$2 missing" exit 1 --98e8jtXdkpgskNou Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="usb-map.local" # usb module match_flag idVendor idProduct bcdDevice_lo bcdDevice_hi bDeviceClass bDeviceSubClass bDeviceProtocol bInterfaceClass bInterfaceSubClass bInterfaceProtocol driver_info joydev 0x0 0x046d 0xc207 0x0000 0x0000 0x00 0x00 0x00 0x03 0x00 0x00 0x00000000 usb-storage 0x0 0x0781 0x0002 0x0000 0x0000 0x00 0x00 0x00 0x08 0x06 0x50 0x00000000 --98e8jtXdkpgskNou Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="input.patch" --- test12-pre3b/drivers/input-pre3/joydev.c Thu Nov 30 12:02:31 2000 +++ linux/drivers/input/joydev.c Mon Dec 11 10:07:42 2000 @@ -86,6 +86,21 @@ MODULE_DESCRIPTION("Joystick device driver"); MODULE_SUPPORTED_DEVICE("input/js"); + +#ifdef CONFIG_HOTPLUG +#if defined(CONFIG_USB_HID) || defined(CONFIG_USB_HID_MODULE) +#include + +static const struct usb_device_id usb_table [] = { + /* hid class, joystick protocol */ + { bInterfaceClass: 3, bInterfaceSubClass: 1, bInterfaceProtocol: 4}, + { } /* Terminating entry */ +}; +MODULE_DEVICE_TABLE (usb, usb_table); +#endif /* USB HID */ +#endif /* HOTPLUG */ + + static int joydev_correct(int value, struct js_corr *corr) { switch (corr->type) { --- test12-pre3b/drivers/input-pre3/keybdev.c Thu Nov 30 12:02:31 2000 +++ linux/drivers/input/keybdev.c Mon Dec 11 10:07:11 2000 @@ -36,6 +36,19 @@ #include #include +#ifdef CONFIG_HOTPLUG +#if defined(CONFIG_USB_HID) || defined(CONFIG_USB_HID_MODULE) +#include + +static const struct usb_device_id usb_table [] = { + /* hid class, keyboard protocol */ + { bInterfaceClass: 3, bInterfaceSubClass: 1, bInterfaceProtocol: 1}, + { } /* Terminating entry */ +}; +MODULE_DEVICE_TABLE (usb, usb_table); +#endif /* USB HID */ +#endif /* HOTPLUG */ + #if defined(CONFIG_X86) || defined(CONFIG_IA64) || defined(__alpha__) || defined(__mips__) static int x86_sysrq_alt = 0; --- test12-pre3b/drivers/input-pre3/mousedev.c Thu Nov 30 12:02:31 2000 +++ linux/drivers/input/mousedev.c Mon Dec 11 10:06:52 2000 @@ -48,6 +48,19 @@ #define CONFIG_INPUT_MOUSEDEV_SCREEN_Y 768 #endif +#ifdef CONFIG_HOTPLUG +#if defined(CONFIG_USB_HID) || defined(CONFIG_USB_HID_MODULE) +#include + +static const struct usb_device_id usb_table [] = { + /* hid class, mouse protocol */ + { bInterfaceClass: 3, bInterfaceSubClass: 1, bInterfaceProtocol: 2}, + { } /* Terminating entry */ +}; +MODULE_DEVICE_TABLE (usb, usb_table); +#endif /* USB HID */ +#endif /* HOTPLUG */ + struct mousedev { int exist; int open; --98e8jtXdkpgskNou-- _______________________________________________ Linux-hotplug-devel mailing list Linux-hotplug-devel@lists.sourceforge.net http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel