linux-hotplug.vger.kernel.org archive mirror
 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

* Re: [PATCH] drivers/usb/core/usb.c: add MODNAME env var to hotplug
  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
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2005-03-24 22:34 UTC (permalink / raw)
  To: linux-hotplug

On Fri, Mar 04, 2005 at 01:01:58PM +0300, Roman Kagan wrote:
>   Hi,
> 
> The patch below adds MODNAME environment variable to usb hotplug
> callout, allowing for its straightforward use with modprobe.

Sorry for the delay, but I've now added this.  I changed the variable
name to MODALIAS to make it match up with what it really is referring
to.

> 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).

I changed this back, as this change doesn't seem to have gone anywhere.

thanks,

greg k-h


-------------------------------------------------------
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

* Re: [PATCH] drivers/usb/core/usb.c: add MODNAME env var to hotplug
  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
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Roman Kagan @ 2005-03-25  7:43 UTC (permalink / raw)
  To: linux-hotplug

On Thu, Mar 24, 2005 at 02:34:59PM -0800, Greg KH wrote:
> On Fri, Mar 04, 2005 at 01:01:58PM +0300, Roman Kagan wrote:
> > The patch below adds MODNAME environment variable to usb hotplug
> > callout, allowing for its straightforward use with modprobe.
> 
> Sorry for the delay, but I've now added this.  I changed the variable
> name to MODALIAS to make it match up with what it really is referring
> to.

OK.

> > 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).
> 
> I changed this back, as this change doesn't seem to have gone anywhere.

It was sent to linux-hotplug-devel and cc to you on Feb. 26, as I
thought it was up to you to include it.  Has it got lost and should I
resend it, or should I better send it to another list?  I think it's
worth merging as the current scheme bites everybody with nontrivial
bcdDevice range.

Roman.


-------------------------------------------------------
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

* Re: [PATCH] drivers/usb/core/usb.c: add MODNAME env var to hotplug
  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
  4 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2005-03-25 17:40 UTC (permalink / raw)
  To: linux-hotplug

On Fri, Mar 25, 2005 at 10:43:01AM +0300, Roman Kagan wrote:
> > > 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).
> > 
> > I changed this back, as this change doesn't seem to have gone anywhere.
> 
> It was sent to linux-hotplug-devel and cc to you on Feb. 26, as I
> thought it was up to you to include it.  Has it got lost and should I
> resend it, or should I better send it to another list?  I think it's
> worth merging as the current scheme bites everybody with nontrivial
> bcdDevice range.

Ok, care to resend it?  I saw a lot of different patches floating
around, and didn't know which one was the decided apon best fix.

thanks,

greg k-h


-------------------------------------------------------
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

* Re: [linux-usb-devel] Re: [PATCH] drivers/usb/core/usb.c: add MODNAME
  2005-03-04 10:01 [PATCH] drivers/usb/core/usb.c: add MODNAME env var to hotplug Roman Kagan
                   ` (2 preceding siblings ...)
  2005-03-25 17:40 ` Greg KH
@ 2005-03-26 19:54 ` 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
  4 siblings, 0 replies; 6+ messages in thread
From: Michael Tokarev @ 2005-03-26 19:54 UTC (permalink / raw)
  To: linux-hotplug

Greg KH wrote:
> On Fri, Mar 25, 2005 at 10:43:01AM +0300, Roman Kagan wrote:
> 
>>>>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).

Speaking of breaking modules.alias compatibility
(as current hotplug scripts will not work anymore)...

Why not change PCI IDs from %08X to %04X ?

/mjt


-------------------------------------------------------
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

* Re: [linux-usb-devel] Re: [PATCH] drivers/usb/core/usb.c: add MODNAME env var to hotplug
  2005-03-04 10:01 [PATCH] drivers/usb/core/usb.c: add MODNAME env var to hotplug Roman Kagan
                   ` (3 preceding siblings ...)
  2005-03-26 19:54 ` [linux-usb-devel] Re: [PATCH] drivers/usb/core/usb.c: add MODNAME Michael Tokarev
@ 2005-03-27 20:36 ` Roman Kagan
  4 siblings, 0 replies; 6+ messages in thread
From: Roman Kagan @ 2005-03-27 20:36 UTC (permalink / raw)
  To: linux-hotplug

On Sat, Mar 26, 2005 at 10:54:59PM +0300, Michael Tokarev wrote:
> Greg KH wrote:
> >On Fri, Mar 25, 2005 at 10:43:01AM +0300, Roman Kagan wrote:
> >
> >>>>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).
> 
> Speaking of breaking modules.alias compatibility
> (as current hotplug scripts will not work anymore)...

Mind explaining how they did?  I cooked up this patch exactly because I
couldn't think of a way to make hotplug scripts work with module aliases
for a non-trivial bcdDevice range.  Moreover, for the most common
trivial one of no bcdDevice matching, the name constructed to match
against the old pattern dl*dh* will match against the new one d*.

So I think that it is not exactly similar to

> Why not change PCI IDs from %08X to %04X ?

which is going to break the setups which did work.

Cheers,
  Roman.


-------------------------------------------------------
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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).