diff options
author | Balaji Rao <balajirrao@gmail.com> | 2007-11-21 15:28:14 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-02-01 17:34:52 -0500 |
commit | 90da096ee46b682011b7d549e52b81cf9742e60b (patch) | |
tree | f70838f277b69e82cb30525d96cad3728cc8b30b /drivers/usb/core | |
parent | eb0be47dbbdca133b1b94adc564297f25176b3ab (diff) |
USB: force handover port to companion when hub_port_connect_change fails
This patch hands over the port to the companion when the
hub_port_connect_change fails.
Signed-off-by: Balaji Rao <balajirrao@gmail.com>
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/core')
-rw-r--r-- | drivers/usb/core/hcd.h | 3 | ||||
-rw-r--r-- | drivers/usb/core/hub.c | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/drivers/usb/core/hcd.h b/drivers/usb/core/hcd.h index 98e24194a4ab..080298ad5990 100644 --- a/drivers/usb/core/hcd.h +++ b/drivers/usb/core/hcd.h | |||
@@ -210,6 +210,9 @@ struct hc_driver { | |||
210 | int (*start_port_reset)(struct usb_hcd *, unsigned port_num); | 210 | int (*start_port_reset)(struct usb_hcd *, unsigned port_num); |
211 | void (*hub_irq_enable)(struct usb_hcd *); | 211 | void (*hub_irq_enable)(struct usb_hcd *); |
212 | /* Needed only if port-change IRQs are level-triggered */ | 212 | /* Needed only if port-change IRQs are level-triggered */ |
213 | |||
214 | /* force handover of high-speed port to full-speed companion */ | ||
215 | void (*relinquish_port)(struct usb_hcd *, int); | ||
213 | }; | 216 | }; |
214 | 217 | ||
215 | extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb); | 218 | 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 1b17f636f49c..24c411697d1e 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -2482,6 +2482,7 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1, | |||
2482 | { | 2482 | { |
2483 | struct usb_device *hdev = hub->hdev; | 2483 | struct usb_device *hdev = hub->hdev; |
2484 | struct device *hub_dev = hub->intfdev; | 2484 | struct device *hub_dev = hub->intfdev; |
2485 | struct usb_hcd *hcd = bus_to_hcd(hdev->bus); | ||
2485 | u16 wHubCharacteristics = le16_to_cpu(hub->descriptor->wHubCharacteristics); | 2486 | u16 wHubCharacteristics = le16_to_cpu(hub->descriptor->wHubCharacteristics); |
2486 | int status, i; | 2487 | int status, i; |
2487 | 2488 | ||
@@ -2645,6 +2646,8 @@ loop: | |||
2645 | 2646 | ||
2646 | done: | 2647 | done: |
2647 | hub_port_disable(hub, port1, 1); | 2648 | hub_port_disable(hub, port1, 1); |
2649 | if (hcd->driver->relinquish_port && !hub->hdev->parent) | ||
2650 | hcd->driver->relinquish_port(hcd, port1); | ||
2648 | } | 2651 | } |
2649 | 2652 | ||
2650 | static void hub_events(void) | 2653 | static void hub_events(void) |