All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers/usb/core/usb.c: add MODNAME env var to hotplug
@ 2005-03-04 10:01 Roman Kagan
  2005-03-24 22:34 ` Greg KH
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Roman Kagan @ 2005-03-04 10:01 UTC (permalink / raw)
  To: linux-hotplug

  Hi,

The patch below adds MODNAME environment variable to usb hotplug
callout, allowing for its straightforward use with modprobe.

The patch expects a matching change in scripts/mod/file2alias.c I sent
to linux-hotplug-devel list a few days ago (i.e. puts
bcdDevice in MODNAME as dXXXX, rather that dlXXXXdhXXXX).

Please consider applying.

Roman.

Signed-off-by: Roman Kagan <rkagan@mail.ru>

 drivers/usb/core/usb.c |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+)


--- linux-2.6.11/drivers/usb/core/usb.c.modname	2005-03-02 10:38:09.000000000 +0300
+++ linux-2.6.11/drivers/usb/core/usb.c	2005-03-04 12:43:21.000000000 +0300
@@ -615,7 +615,32 @@
 					alt->desc.bInterfaceSubClass,
 					alt->desc.bInterfaceProtocol))
 			return -ENOMEM;
+
+		if (add_hotplug_env_var(envp, num_envp, &i,
+					buffer, buffer_size, &length,
+					"MODNAME=usb:v%04Xp%04Xd%04Xdc%02Xdsc%02Xdp%02Xic%02Xisc%02Xip%02X",
+					le16_to_cpu(usb_dev->descriptor.idVendor),
+					le16_to_cpu(usb_dev->descriptor.idProduct),
+					le16_to_cpu(usb_dev->descriptor.bcdDevice),
+					usb_dev->descriptor.bDeviceClass,
+					usb_dev->descriptor.bDeviceSubClass,
+					usb_dev->descriptor.bDeviceProtocol,
+					alt->desc.bInterfaceClass,
+					alt->desc.bInterfaceSubClass,
+					alt->desc.bInterfaceProtocol))
+			return -ENOMEM;
 	}
+	else
+		if (add_hotplug_env_var(envp, num_envp, &i,
+					buffer, buffer_size, &length,
+					"MODNAME=usb:v%04Xp%04Xd%04Xdc%02Xdsc%02Xdp%02Xic*isc*ip*",
+					le16_to_cpu(usb_dev->descriptor.idVendor),
+					le16_to_cpu(usb_dev->descriptor.idProduct),
+					le16_to_cpu(usb_dev->descriptor.bcdDevice),
+					usb_dev->descriptor.bDeviceClass,
+					usb_dev->descriptor.bDeviceSubClass,
+					usb_dev->descriptor.bDeviceProtocol))
+			return -ENOMEM;
 
 	envp[i] = NULL;
 


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id\x14396&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

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

end of thread, other threads:[~2005-03-27 20:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-04 10:01 [PATCH] drivers/usb/core/usb.c: add MODNAME env var to hotplug Roman Kagan
2005-03-24 22:34 ` Greg KH
2005-03-25  7:43 ` Roman Kagan
2005-03-25 17:40 ` Greg KH
2005-03-26 19:54 ` [linux-usb-devel] Re: [PATCH] drivers/usb/core/usb.c: add MODNAME Michael Tokarev
2005-03-27 20:36 ` [linux-usb-devel] Re: [PATCH] drivers/usb/core/usb.c: add MODNAME env var to hotplug Roman Kagan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.