diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2007-08-21 07:41:08 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-08-22 17:28:02 -0400 |
commit | d65cc1b45e7d3a24c25fd3d730042e407d6d64ce (patch) | |
tree | 947a427a107aa0a7dddf76a7bf51edd639e70ecd | |
parent | 83fc8a151beda2d63e196a7ab2e12316c37a1e91 (diff) |
usb: add PRODUCT, TYPE to usb-interface events
This fixes a regression for userspace programs that were relying on these events.
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Cc: Andreas Jellinghaus <aj@ciphirelabs.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/usb/core/message.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index 5498506e9c5e..d8f7b089a8f0 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c | |||
@@ -1358,6 +1358,30 @@ static int usb_if_uevent(struct device *dev, char **envp, int num_envp, | |||
1358 | usb_dev = interface_to_usbdev(intf); | 1358 | usb_dev = interface_to_usbdev(intf); |
1359 | alt = intf->cur_altsetting; | 1359 | alt = intf->cur_altsetting; |
1360 | 1360 | ||
1361 | #ifdef CONFIG_USB_DEVICEFS | ||
1362 | if (add_uevent_var(envp, num_envp, &i, | ||
1363 | buffer, buffer_size, &length, | ||
1364 | "DEVICE=/proc/bus/usb/%03d/%03d", | ||
1365 | usb_dev->bus->busnum, usb_dev->devnum)) | ||
1366 | return -ENOMEM; | ||
1367 | #endif | ||
1368 | |||
1369 | if (add_uevent_var(envp, num_envp, &i, | ||
1370 | buffer, buffer_size, &length, | ||
1371 | "PRODUCT=%x/%x/%x", | ||
1372 | le16_to_cpu(usb_dev->descriptor.idVendor), | ||
1373 | le16_to_cpu(usb_dev->descriptor.idProduct), | ||
1374 | le16_to_cpu(usb_dev->descriptor.bcdDevice))) | ||
1375 | return -ENOMEM; | ||
1376 | |||
1377 | if (add_uevent_var(envp, num_envp, &i, | ||
1378 | buffer, buffer_size, &length, | ||
1379 | "TYPE=%d/%d/%d", | ||
1380 | usb_dev->descriptor.bDeviceClass, | ||
1381 | usb_dev->descriptor.bDeviceSubClass, | ||
1382 | usb_dev->descriptor.bDeviceProtocol)) | ||
1383 | return -ENOMEM; | ||
1384 | |||
1361 | if (add_uevent_var(envp, num_envp, &i, | 1385 | if (add_uevent_var(envp, num_envp, &i, |
1362 | buffer, buffer_size, &length, | 1386 | buffer, buffer_size, &length, |
1363 | "INTERFACE=%d/%d/%d", | 1387 | "INTERFACE=%d/%d/%d", |