diff options
-rw-r--r-- | drivers/usb/core/hcd.h | 5 | ||||
-rw-r--r-- | drivers/usb/core/hub.c | 14 | ||||
-rw-r--r-- | drivers/usb/host/xhci-pci.c | 1 |
3 files changed, 20 insertions, 0 deletions
diff --git a/drivers/usb/core/hcd.h b/drivers/usb/core/hcd.h index ec5c67ea07b..79782a1c43f 100644 --- a/drivers/usb/core/hcd.h +++ b/drivers/usb/core/hcd.h | |||
@@ -267,6 +267,11 @@ struct hc_driver { | |||
267 | void (*reset_bandwidth)(struct usb_hcd *, struct usb_device *); | 267 | void (*reset_bandwidth)(struct usb_hcd *, struct usb_device *); |
268 | /* Returns the hardware-chosen device address */ | 268 | /* Returns the hardware-chosen device address */ |
269 | int (*address_device)(struct usb_hcd *, struct usb_device *udev); | 269 | int (*address_device)(struct usb_hcd *, struct usb_device *udev); |
270 | /* Notifies the HCD after a hub descriptor is fetched. | ||
271 | * Will block. | ||
272 | */ | ||
273 | int (*update_hub_device)(struct usb_hcd *, struct usb_device *hdev, | ||
274 | struct usb_tt *tt, gfp_t mem_flags); | ||
270 | }; | 275 | }; |
271 | 276 | ||
272 | extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb); | 277 | extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb); |
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index a880516020f..5ce839137ad 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -860,6 +860,7 @@ static int hub_post_reset(struct usb_interface *intf) | |||
860 | static int hub_configure(struct usb_hub *hub, | 860 | static int hub_configure(struct usb_hub *hub, |
861 | struct usb_endpoint_descriptor *endpoint) | 861 | struct usb_endpoint_descriptor *endpoint) |
862 | { | 862 | { |
863 | struct usb_hcd *hcd; | ||
863 | struct usb_device *hdev = hub->hdev; | 864 | struct usb_device *hdev = hub->hdev; |
864 | struct device *hub_dev = hub->intfdev; | 865 | struct device *hub_dev = hub->intfdev; |
865 | u16 hubstatus, hubchange; | 866 | u16 hubstatus, hubchange; |
@@ -1061,6 +1062,19 @@ static int hub_configure(struct usb_hub *hub, | |||
1061 | dev_dbg(hub_dev, "%umA bus power budget for each child\n", | 1062 | dev_dbg(hub_dev, "%umA bus power budget for each child\n", |
1062 | hub->mA_per_port); | 1063 | hub->mA_per_port); |
1063 | 1064 | ||
1065 | /* Update the HCD's internal representation of this hub before khubd | ||
1066 | * starts getting port status changes for devices under the hub. | ||
1067 | */ | ||
1068 | hcd = bus_to_hcd(hdev->bus); | ||
1069 | if (hcd->driver->update_hub_device) { | ||
1070 | ret = hcd->driver->update_hub_device(hcd, hdev, | ||
1071 | &hub->tt, GFP_KERNEL); | ||
1072 | if (ret < 0) { | ||
1073 | message = "can't update HCD hub info"; | ||
1074 | goto fail; | ||
1075 | } | ||
1076 | } | ||
1077 | |||
1064 | ret = hub_hub_status(hub, &hubstatus, &hubchange); | 1078 | ret = hub_hub_status(hub, &hubstatus, &hubchange); |
1065 | if (ret < 0) { | 1079 | if (ret < 0) { |
1066 | message = "can't get hub status"; | 1080 | message = "can't get hub status"; |
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c index b7712f22a9f..06595ec27bb 100644 --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c | |||
@@ -136,6 +136,7 @@ static const struct hc_driver xhci_pci_hc_driver = { | |||
136 | .check_bandwidth = xhci_check_bandwidth, | 136 | .check_bandwidth = xhci_check_bandwidth, |
137 | .reset_bandwidth = xhci_reset_bandwidth, | 137 | .reset_bandwidth = xhci_reset_bandwidth, |
138 | .address_device = xhci_address_device, | 138 | .address_device = xhci_address_device, |
139 | .update_hub_device = xhci_update_hub_device, | ||
139 | 140 | ||
140 | /* | 141 | /* |
141 | * scheduling support | 142 | * scheduling support |