diff options
author | Andiry Xu <andiry.xu@amd.com> | 2010-10-14 10:22:51 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-10-22 13:22:12 -0400 |
commit | c8d4af8e2af12cd4835ba5c4b54bdafe9deda71a (patch) | |
tree | e89c7c700bfe5022eaba3508a818a51717bbd12d /drivers/usb/host/xhci.c | |
parent | f0615c45ce5feb141c1172480c5198d4b8d25436 (diff) |
USB: core: use kernel assigned address for devices under xHCI
xHCI driver uses hardware assigned device address. This may cause device
address conflict in certain cases.
Use kernel assigned address for devices under xHCI. Store the xHC assigned
address locally in xHCI driver.
Signed-off-by: Andiry Xu <andiry.xu@amd.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Diffstat (limited to 'drivers/usb/host/xhci.c')
-rw-r--r-- | drivers/usb/host/xhci.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 7928af5c91cb..caccecb7368e 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
@@ -2287,15 +2287,15 @@ int xhci_address_device(struct usb_hcd *hcd, struct usb_device *udev) | |||
2287 | * address given back to us by the HC. | 2287 | * address given back to us by the HC. |
2288 | */ | 2288 | */ |
2289 | slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->out_ctx); | 2289 | slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->out_ctx); |
2290 | udev->devnum = (slot_ctx->dev_state & DEV_ADDR_MASK) + 1; | 2290 | /* Use kernel assigned address for devices; store xHC assigned |
2291 | * address locally. */ | ||
2292 | virt_dev->address = (slot_ctx->dev_state & DEV_ADDR_MASK) + 1; | ||
2291 | /* Zero the input context control for later use */ | 2293 | /* Zero the input context control for later use */ |
2292 | ctrl_ctx = xhci_get_input_control_ctx(xhci, virt_dev->in_ctx); | 2294 | ctrl_ctx = xhci_get_input_control_ctx(xhci, virt_dev->in_ctx); |
2293 | ctrl_ctx->add_flags = 0; | 2295 | ctrl_ctx->add_flags = 0; |
2294 | ctrl_ctx->drop_flags = 0; | 2296 | ctrl_ctx->drop_flags = 0; |
2295 | 2297 | ||
2296 | xhci_dbg(xhci, "Device address = %d\n", udev->devnum); | 2298 | xhci_dbg(xhci, "Internal device address = %d\n", virt_dev->address); |
2297 | /* XXX Meh, not sure if anyone else but choose_address uses this. */ | ||
2298 | set_bit(udev->devnum, udev->bus->devmap.devicemap); | ||
2299 | 2299 | ||
2300 | return 0; | 2300 | return 0; |
2301 | } | 2301 | } |