public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Patch: linux-2.4.0-test10-pre7/drivers/usb/usb.c driver matching bug
@ 2000-11-01  3:42 Adam J. Richter
  2000-11-01 17:35 ` [linux-usb-devel] " David Brownell
  0 siblings, 1 reply; 3+ messages in thread
From: Adam J. Richter @ 2000-11-01  3:42 UTC (permalink / raw)
  To: linux-kernel, linux-usb-devel, torvalds

	linux-2.4.0-test10-pre7/drivers/usb/usb.c introduced a really
cool feature, where USB drivers can declare a data structure that
describes the various ID bytes of the USB devices that they are
relevant to.  Updated versions of depmod and hotplug are then
used so that the appropriate USB drivers can then be loaded
automatically as soon as you plug in a device, without any
need to create additional system configuration files.

	Anyhow, the USB implementation of this has a tiny bug,
where it does an apples-and-oranges comparison.  The patch is
attached below.

	Since the USB device table support is in
linux-2.4.0-test10-pre7 and not in the HEAD branch of the
linux-usb CVS tree on sourceforge.net, and since the bug fix
is very clear and small, I am sending this patch to Linus and 
linux-kernel in addition to linux-usb-devel.  If there is some
better way that I should submit a patch in this sort of situation,
please let me know.  I don't mean to step on anyone's toes.

	By the way, I was able to test this all the way to the
point of plugging in a USB printer and watching the module
automatically load and bind to the printer interface.  (I
will submit the usb/printer.c device table support patch to
linux-usb-devel momentarily.)

Adam J. Richter     __     ______________   4880 Stevens Creek Blvd, Suite 104
adam@yggdrasil.com     \ /                  San Jose, California 95129-1034
+1 408 261-6630         | g g d r a s i l   United States of America
fax +1 408 261-6631      "Free Software For The Rest Of Us."

--- linux-2.4.0-test10-pre7/drivers/usb/usb.c	Tue Oct 31 02:42:50 2000
+++ linux/drivers/usb/usb.c	Tue Oct 31 19:26:14 2000
@@ -540,7 +540,7 @@
 			    if (id->bInterfaceClass
 				    && id->bInterfaceClass == intf->bInterfaceClass) {
 				if (id->bInterfaceSubClass && id->bInterfaceSubClass
-					!= intf->bInterfaceClass)
+					!= intf->bInterfaceSubClass)
 				    continue;
 				if (id->bInterfaceProtocol && id->bInterfaceProtocol
 					!= intf->bInterfaceProtocol)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [linux-usb-devel] Patch: linux-2.4.0-test10-pre7/drivers/usb/usb.c driver matching bug
  2000-11-01  3:42 Patch: linux-2.4.0-test10-pre7/drivers/usb/usb.c driver matching bug Adam J. Richter
@ 2000-11-01 17:35 ` David Brownell
  2000-11-01 18:46   ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: David Brownell @ 2000-11-01 17:35 UTC (permalink / raw)
  To: linux-usb-devel, linux-kernel, torvalds

> linux-2.4.0-test10-pre7/drivers/usb/usb.c introduced a really
> cool feature, where USB drivers can declare a data structure that
> describes the various ID bytes of the USB devices that they are
> relevant to. 

It's the same tool architecture used with PCI:  modules.pcimap
(and now modules.isapnpmap) also come from MODULE_DEVICE_TABLE
entries.  Modutils 2.3.19+ required.


>     Updated versions of depmod and hotplug are then
> used so that the appropriate USB drivers can then be loaded
> automatically as soon as you plug in a device, without any
> need to create additional system configuration files.

The "no additional config files" is what's new in test10.

Before, handcrafted /etc/usb/drivers/* scripts were used;
great as proof-of-concept, lousy to maintain as the primary
way to handle driver hotplugging.


> Anyhow, the USB implementation of this has a tiny bug,
> where it does an apples-and-oranges comparison.  The patch is
> attached below.

My bad ... thanks for that one-liner, and the driver updates
to make more USB drivers use this new "modutils" support!


> By the way, I was able to test this all the way to the
> point of plugging in a USB printer and watching the module
> automatically load and bind to the printer interface.  (I
> will submit the usb/printer.c device table support patch to
> linux-usb-devel momentarily.)

For the benefit of LKML readers who don't read Linux-USB-devel,
see http://www.linux-usb.org/policy.html for an overview (not
updated yet to reflect 2.4.0-test10).  Scripts are in CVS:

http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/usbd/etc/?cvsroot=linux-usb

You can make this work with just "hotplug" (called by kernel)
and "policy" (handling USB-specific driver selection).  That
"hotplug" script should eventually handle other types of bus.

The USB "policy" script uses "modules.usbmap", but will fall back
to /etc/usb/drivers scripts, which you should NOT have if you're
trying to test "modules.usbmap" support in a driver.  (If you
just want to use this not debug it, you want those scripts.)

With the USB driver updates I've already seen, it looks like an
upcoming 2.4 kernel may no longer need those driver scripts; not
sure about the 2.2 backports though.

- Dave



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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [linux-usb-devel] Patch: linux-2.4.0-test10-pre7/drivers/usb/usb.c driver matching bug
  2000-11-01 17:35 ` [linux-usb-devel] " David Brownell
@ 2000-11-01 18:46   ` Greg KH
  0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2000-11-01 18:46 UTC (permalink / raw)
  To: David Brownell; +Cc: linux-usb-devel, linux-kernel

On Wed, Nov 01, 2000 at 09:35:18AM -0800, David Brownell wrote:
> With the USB driver updates I've already seen, it looks like an
> upcoming 2.4 kernel may no longer need those driver scripts; not
> sure about the 2.2 backports though.

I think one of the "rules" is that the 2.2.x kernel shouldn't require an
upgrade of userspace tools, such as modutils in this case.

So 2.2 would still require the driver scripts if you want to support
dynamic module loading on USB device insertion, but this makes yet
another good reason to move to 2.4 when it is available :)

greg k-h

-- 
greg@(kroah|wirex).com
http://immunix.org/~greg
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2000-11-01 18:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-11-01  3:42 Patch: linux-2.4.0-test10-pre7/drivers/usb/usb.c driver matching bug Adam J. Richter
2000-11-01 17:35 ` [linux-usb-devel] " David Brownell
2000-11-01 18:46   ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox