Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 151408
b: refs/heads/master
c: 7206b00
h: refs/heads/master
v: v3
  • Loading branch information
Sarah Sharp authored and Greg Kroah-Hartman committed Jun 16, 2009
1 parent 619e49d commit 76a613d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e7b7717247f61e2cf18ec47f91999065c59d1607
refs/heads/master: 7206b00164a1c3ca533e01db285955617e1019f8
10 changes: 8 additions & 2 deletions trunk/drivers/usb/core/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,18 +375,24 @@ struct usb_device *usb_alloc_dev(struct usb_device *parent,
*/
if (unlikely(!parent)) {
dev->devpath[0] = '0';
dev->route = 0;

dev->dev.parent = bus->controller;
dev_set_name(&dev->dev, "usb%d", bus->busnum);
root_hub = 1;
} else {
/* match any labeling on the hubs; it's one-based */
if (parent->devpath[0] == '0')
if (parent->devpath[0] == '0') {
snprintf(dev->devpath, sizeof dev->devpath,
"%d", port1);
else
/* Root ports are not counted in route string */
dev->route = 0;
} else {
snprintf(dev->devpath, sizeof dev->devpath,
"%s.%d", parent->devpath, port1);
dev->route = parent->route +
(port1 << ((parent->level - 1)*4));
}

dev->dev.parent = &parent->dev;
dev_set_name(&dev->dev, "%d-%s", bus->busnum, dev->devpath);
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ struct usb_tt;
* struct usb_device - kernel's representation of a USB device
* @devnum: device number; address on a USB bus
* @devpath: device ID string for use in messages (e.g., /port/...)
* @route: tree topology hex string for use with xHCI
* @state: device state: configured, not attached, etc.
* @speed: device speed: high/full/low (or error)
* @tt: Transaction Translator info; used with low/full speed dev, highspeed hub
Expand Down Expand Up @@ -427,6 +428,7 @@ struct usb_tt;
struct usb_device {
int devnum;
char devpath [16];
u32 route;
enum usb_device_state state;
enum usb_device_speed speed;

Expand Down

0 comments on commit 76a613d

Please sign in to comment.