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 <[EMAIL PROTECTED]>

 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_id=6595&alloc_id=14396&op=click
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to