linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Norbert Preining <preining@logic.at>
To: linux-hotplug@vger.kernel.org
Subject: hotplugging with current modutils and usbd cvs
Date: Mon, 08 Jan 2001 16:55:28 +0000	[thread overview]
Message-ID: <marc-linux-hotplug-97897293703057@msgid-missing> (raw)

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

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 |
+-------------------------------------------------------------------+

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

--- 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

[-- Attachment #3: usb-map.local --]
[-- Type: text/plain, Size: 536 bytes --]

# 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

[-- Attachment #4: input.patch --]
[-- Type: text/plain, Size: 2088 bytes --]

--- 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 <linux/usb.h>
+
+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 <linux/module.h>
 #include <linux/kbd_kern.h>
 
+#ifdef	CONFIG_HOTPLUG
+#if	defined(CONFIG_USB_HID) || defined(CONFIG_USB_HID_MODULE)
+#include <linux/usb.h>
+
+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 <linux/usb.h>
+
+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;

             reply	other threads:[~2001-01-08 16:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-08 16:55 Norbert Preining [this message]
2001-01-08 21:46 ` hotplugging with current modutils and usbd cvs David Brownell

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=marc-linux-hotplug-97897293703057@msgid-missing \
    --to=preining@logic.at \
    --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).