diff options
-rw-r--r-- | drivers/usb/core/hub.c | 4 | ||||
-rw-r--r-- | drivers/usb/host/xhci.c | 2 | ||||
-rw-r--r-- | include/linux/usb.h | 2 |
3 files changed, 7 insertions, 1 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 572e8c26a129..82cc3766cb23 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -873,7 +873,7 @@ int usb_hub_clear_tt_buffer(struct urb *urb) | |||
873 | /* info that CLEAR_TT_BUFFER needs */ | 873 | /* info that CLEAR_TT_BUFFER needs */ |
874 | clear->tt = tt->multi ? udev->ttport : 1; | 874 | clear->tt = tt->multi ? udev->ttport : 1; |
875 | clear->devinfo = usb_pipeendpoint (pipe); | 875 | clear->devinfo = usb_pipeendpoint (pipe); |
876 | clear->devinfo |= udev->devnum << 4; | 876 | clear->devinfo |= ((u16)udev->devaddr) << 4; |
877 | clear->devinfo |= usb_pipecontrol(pipe) | 877 | clear->devinfo |= usb_pipecontrol(pipe) |
878 | ? (USB_ENDPOINT_XFER_CONTROL << 11) | 878 | ? (USB_ENDPOINT_XFER_CONTROL << 11) |
879 | : (USB_ENDPOINT_XFER_BULK << 11); | 879 | : (USB_ENDPOINT_XFER_BULK << 11); |
@@ -2125,6 +2125,8 @@ static void update_devnum(struct usb_device *udev, int devnum) | |||
2125 | /* The address for a WUSB device is managed by wusbcore. */ | 2125 | /* The address for a WUSB device is managed by wusbcore. */ |
2126 | if (!udev->wusb) | 2126 | if (!udev->wusb) |
2127 | udev->devnum = devnum; | 2127 | udev->devnum = devnum; |
2128 | if (!udev->devaddr) | ||
2129 | udev->devaddr = (u8)devnum; | ||
2128 | } | 2130 | } |
2129 | 2131 | ||
2130 | static void hub_free_dev(struct usb_device *udev) | 2132 | static void hub_free_dev(struct usb_device *udev) |
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 20db378a6012..4f92643e3a4c 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
@@ -4125,6 +4125,8 @@ static int xhci_setup_device(struct usb_hcd *hcd, struct usb_device *udev, | |||
4125 | /* Zero the input context control for later use */ | 4125 | /* Zero the input context control for later use */ |
4126 | ctrl_ctx->add_flags = 0; | 4126 | ctrl_ctx->add_flags = 0; |
4127 | ctrl_ctx->drop_flags = 0; | 4127 | ctrl_ctx->drop_flags = 0; |
4128 | slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->out_ctx); | ||
4129 | udev->devaddr = (u8)(le32_to_cpu(slot_ctx->dev_state) & DEV_ADDR_MASK); | ||
4128 | 4130 | ||
4129 | xhci_dbg_trace(xhci, trace_xhci_dbg_address, | 4131 | xhci_dbg_trace(xhci, trace_xhci_dbg_address, |
4130 | "Internal device address = %d", | 4132 | "Internal device address = %d", |
diff --git a/include/linux/usb.h b/include/linux/usb.h index ae82d9d1112b..83d35d993e8c 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -578,6 +578,7 @@ struct usb3_lpm_parameters { | |||
578 | * @bus_mA: Current available from the bus | 578 | * @bus_mA: Current available from the bus |
579 | * @portnum: parent port number (origin 1) | 579 | * @portnum: parent port number (origin 1) |
580 | * @level: number of USB hub ancestors | 580 | * @level: number of USB hub ancestors |
581 | * @devaddr: device address, XHCI: assigned by HW, others: same as devnum | ||
581 | * @can_submit: URBs may be submitted | 582 | * @can_submit: URBs may be submitted |
582 | * @persist_enabled: USB_PERSIST enabled for this device | 583 | * @persist_enabled: USB_PERSIST enabled for this device |
583 | * @have_langid: whether string_langid is valid | 584 | * @have_langid: whether string_langid is valid |
@@ -661,6 +662,7 @@ struct usb_device { | |||
661 | unsigned short bus_mA; | 662 | unsigned short bus_mA; |
662 | u8 portnum; | 663 | u8 portnum; |
663 | u8 level; | 664 | u8 level; |
665 | u8 devaddr; | ||
664 | 666 | ||
665 | unsigned can_submit:1; | 667 | unsigned can_submit:1; |
666 | unsigned persist_enabled:1; | 668 | unsigned persist_enabled:1; |