From 90da096ee46b682011b7d549e52b81cf9742e60b Mon Sep 17 00:00:00 2001 From: Balaji Rao Date: Thu, 22 Nov 2007 01:58:14 +0530 Subject: 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 Signed-off-by: Alan Stern Signed-off-by: Greg Kroah-Hartman --- drivers/usb/core/hcd.h | 3 +++ drivers/usb/core/hub.c | 3 +++ 2 files changed, 6 insertions(+) (limited to 'drivers/usb/core') 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 { int (*start_port_reset)(struct usb_hcd *, unsigned port_num); void (*hub_irq_enable)(struct usb_hcd *); /* Needed only if port-change IRQs are level-triggered */ + + /* force handover of high-speed port to full-speed companion */ + void (*relinquish_port)(struct usb_hcd *, int); }; 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, { struct usb_device *hdev = hub->hdev; struct device *hub_dev = hub->intfdev; + struct usb_hcd *hcd = bus_to_hcd(hdev->bus); u16 wHubCharacteristics = le16_to_cpu(hub->descriptor->wHubCharacteristics); int status, i; @@ -2645,6 +2646,8 @@ loop: done: hub_port_disable(hub, port1, 1); + if (hcd->driver->relinquish_port && !hub->hdev->parent) + hcd->driver->relinquish_port(hcd, port1); } static void hub_events(void) -- cgit v1.2.3