From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roman Kagan Date: Fri, 04 Mar 2005 10:01:58 +0000 Subject: [PATCH] drivers/usb/core/usb.c: add MODNAME env var to hotplug Message-Id: <20050304100158.GB2219@katya> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org 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 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_id396&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