aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2008-04-03 18:02:56 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-04-25 00:16:48 -0400
commit7329e211b987a493cbcfca0e98c60eb108ab42df (patch)
tree20be11f1264b32f53231d62564fee04e406da033 /drivers/usb
parent6fc88f53aaa4ff8ee621353ac27269b4a656d721 (diff)
USB: root hubs don't lie about their number of TTs
Currently EHCI root hubs enumerate with a bDeviceProtocol code indicating that they possess a Transaction Translator. However the vast majority of controllers do not; they rely on a companion controller to handle full- and low-speed communications. This patch (as1064) changes the root-hub device descriptor to match the actual situation. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/core/hcd.c14
-rw-r--r--drivers/usb/core/hcd.h1
-rw-r--r--drivers/usb/host/ehci-pci.c1
3 files changed, 14 insertions, 2 deletions
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index f936de75f44e..e68fef5361d2 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -129,7 +129,7 @@ static const u8 usb2_rh_dev_descriptor [18] = {
129 129
130 0x09, /* __u8 bDeviceClass; HUB_CLASSCODE */ 130 0x09, /* __u8 bDeviceClass; HUB_CLASSCODE */
131 0x00, /* __u8 bDeviceSubClass; */ 131 0x00, /* __u8 bDeviceSubClass; */
132 0x01, /* __u8 bDeviceProtocol; [ usb 2.0 single TT ]*/ 132 0x00, /* __u8 bDeviceProtocol; [ usb 2.0 no TT ] */
133 0x40, /* __u8 bMaxPacketSize0; 64 Bytes */ 133 0x40, /* __u8 bMaxPacketSize0; 64 Bytes */
134 134
135 0x6b, 0x1d, /* __le16 idVendor; Linux Foundation */ 135 0x6b, 0x1d, /* __le16 idVendor; Linux Foundation */
@@ -354,9 +354,10 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb)
354 __attribute__((aligned(4))); 354 __attribute__((aligned(4)));
355 const u8 *bufp = tbuf; 355 const u8 *bufp = tbuf;
356 int len = 0; 356 int len = 0;
357 int patch_wakeup = 0;
358 int status; 357 int status;
359 int n; 358 int n;
359 u8 patch_wakeup = 0;
360 u8 patch_protocol = 0;
360 361
361 might_sleep(); 362 might_sleep();
362 363
@@ -433,6 +434,8 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb)
433 else 434 else
434 goto error; 435 goto error;
435 len = 18; 436 len = 18;
437 if (hcd->has_tt)
438 patch_protocol = 1;
436 break; 439 break;
437 case USB_DT_CONFIG << 8: 440 case USB_DT_CONFIG << 8:
438 if (hcd->driver->flags & HCD_USB2) { 441 if (hcd->driver->flags & HCD_USB2) {
@@ -527,6 +530,13 @@ error:
527 bmAttributes)) 530 bmAttributes))
528 ((struct usb_config_descriptor *)ubuf)->bmAttributes 531 ((struct usb_config_descriptor *)ubuf)->bmAttributes
529 |= USB_CONFIG_ATT_WAKEUP; 532 |= USB_CONFIG_ATT_WAKEUP;
533
534 /* report whether RH hardware has an integrated TT */
535 if (patch_protocol &&
536 len > offsetof(struct usb_device_descriptor,
537 bDeviceProtocol))
538 ((struct usb_device_descriptor *) ubuf)->
539 bDeviceProtocol = 1;
530 } 540 }
531 541
532 /* any errors get returned through the urb completion */ 542 /* any errors get returned through the urb completion */
diff --git a/drivers/usb/core/hcd.h b/drivers/usb/core/hcd.h
index 2c086b8460b1..e0e99471c3fc 100644
--- a/drivers/usb/core/hcd.h
+++ b/drivers/usb/core/hcd.h
@@ -99,6 +99,7 @@ struct usb_hcd {
99 unsigned poll_pending:1; /* status has changed? */ 99 unsigned poll_pending:1; /* status has changed? */
100 unsigned wireless:1; /* Wireless USB HCD */ 100 unsigned wireless:1; /* Wireless USB HCD */
101 unsigned authorized_default:1; 101 unsigned authorized_default:1;
102 unsigned has_tt:1; /* Integrated TT in root hub */
102 103
103 int irq; /* irq allocated */ 104 int irq; /* irq allocated */
104 void __iomem *regs; /* device memory/io */ 105 void __iomem *regs; /* device memory/io */
diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
index 040bd8632eb3..7c8a2ccf78f1 100644
--- a/drivers/usb/host/ehci-pci.c
+++ b/drivers/usb/host/ehci-pci.c
@@ -130,6 +130,7 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
130 case PCI_VENDOR_ID_TDI: 130 case PCI_VENDOR_ID_TDI:
131 if (pdev->device == PCI_DEVICE_ID_TDI_EHCI) { 131 if (pdev->device == PCI_DEVICE_ID_TDI_EHCI) {
132 ehci->is_tdi_rh_tt = 1; 132 ehci->is_tdi_rh_tt = 1;
133 hcd->has_tt = 1;
133 tdi_reset(ehci); 134 tdi_reset(ehci);
134 } 135 }
135 break; 136 break;