ChangeSet 1.2181.4.57, 2005/03/24 14:34:40-08:00, [EMAIL PROTECTED]

        [PATCH] drivers/usb/core/usb.c: add MODALIAS env var to hotplug
        
        The patch below adds MODALIAS environment variable to usb hotplug
        callout, allowing for its straightforward use with modprobe.
        
        Signed-off-by: Roman Kagan <[EMAIL PROTECTED]>
        Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>



 usb.c |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+)


diff -Nru a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
--- a/drivers/usb/core/usb.c    2005-03-30 15:16:14 -08:00
+++ b/drivers/usb/core/usb.c    2005-03-30 15:16:14 -08:00
@@ -615,6 +615,33 @@
                                        alt->desc.bInterfaceSubClass,
                                        alt->desc.bInterfaceProtocol))
                        return -ENOMEM;
+
+               if (add_hotplug_env_var(envp, num_envp, &i,
+                                       buffer, buffer_size, &length,
+                                       
"MODALIAS=usb:v%04Xp%04Xdl%04Xdh%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),
+                                       
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,
+                                       
"MODALIAS=usb:v%04Xp%04Xdl%04Xdh%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),
+                                       
le16_to_cpu(usb_dev->descriptor.bcdDevice),
+                                       usb_dev->descriptor.bDeviceClass,
+                                       usb_dev->descriptor.bDeviceSubClass,
+                                       usb_dev->descriptor.bDeviceProtocol))
+                       return -ENOMEM;
        }
 
        envp[i] = NULL;
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to