usb: Add devaddr in struct usb_device
authorJim Lin <jilin@nvidia.com>
Mon, 3 Jun 2019 10:53:43 +0000 (18:53 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Jun 2019 09:54:38 +0000 (11:54 +0200)
commit4998f1efd1904dd21697aeeead270e3eb97691dd
treec099adeec7515e42f6cbdecdbd0074328fc8da80
parent32adeab3e3b5bc01ebb7746600e7c734482230d7
usb: Add devaddr in struct usb_device

The Clear_TT_Buffer request sent to the hub includes the address of
the LS/FS child device in wValue field. usb_hub_clear_tt_buffer()
uses udev->devnum to set the address wValue. This won't work for
devices connected to xHC.

For other host controllers udev->devnum is the same as the address of
the usb device, chosen and set by usb core. With xHC the controller
hardware assigns the address, and won't be the same as devnum.

Here we add devaddr in "struct usb_device" for
usb_hub_clear_tt_buffer() to use.

Signed-off-by: Jim Lin <jilin@nvidia.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/core/hub.c
drivers/usb/host/xhci.c
include/linux/usb.h