From ac02f1b7c9f102499e9a6ac577d8250acc3c72ef Mon Sep 17 00:00:00 2001 From: Aman Deep Date: Tue, 22 Nov 2011 19:33:36 +0530 Subject: [PATCH] --- yaml --- r: 280783 b: refs/heads/master c: c8421147926fcacf53081a36438a0bed394da9f5 h: refs/heads/master i: 280781: 7e32b8a0785e9b2a24646ff1e546724a1fd546b6 280779: c1dd406833a4c59d28810ead7fa577d311fb4579 280775: 5cde7c8730226d2f8d9a33502989b02d9548c820 280767: 6fa1d3f48c41052060004a7ab40d1678286ca317 v: v3 --- [refs] | 2 +- trunk/drivers/usb/host/xhci-hub.c | 18 ++++++++---------- trunk/include/linux/usb/ch11.h | 19 ++++++++++++++----- 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/[refs] b/[refs] index d95ff86f26f9..b88e62cd2518 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ceb2560348d52c5fa21515e6c1c7d0245c7dd015 +refs/heads/master: c8421147926fcacf53081a36438a0bed394da9f5 diff --git a/trunk/drivers/usb/host/xhci-hub.c b/trunk/drivers/usb/host/xhci-hub.c index 430e88fd3f6c..35e257f79c7b 100644 --- a/trunk/drivers/usb/host/xhci-hub.c +++ b/trunk/drivers/usb/host/xhci-hub.c @@ -57,17 +57,15 @@ static void xhci_common_hub_descriptor(struct xhci_hcd *xhci, desc->bHubContrCurrent = 0; desc->bNbrPorts = ports; - /* Ugh, these should be #defines, FIXME */ - /* Using table 11-13 in USB 2.0 spec. */ temp = 0; - /* Bits 1:0 - support port power switching, or power always on */ + /* Bits 1:0 - support per-port power switching, or power always on */ if (HCC_PPC(xhci->hcc_params)) - temp |= 0x0001; + temp |= HUB_CHAR_INDV_PORT_LPSM; else - temp |= 0x0002; + temp |= HUB_CHAR_NO_LPSM; /* Bit 2 - root hubs are not part of a compound device */ /* Bits 4:3 - individual port over current protection */ - temp |= 0x0008; + temp |= HUB_CHAR_INDV_PORT_OCPM; /* Bits 6:5 - no TTs in root ports */ /* Bit 7 - no port indicators */ desc->wHubCharacteristics = cpu_to_le16(temp); @@ -86,9 +84,9 @@ static void xhci_usb2_hub_descriptor(struct usb_hcd *hcd, struct xhci_hcd *xhci, ports = xhci->num_usb2_ports; xhci_common_hub_descriptor(xhci, desc, ports); - desc->bDescriptorType = 0x29; + desc->bDescriptorType = USB_DT_HUB; temp = 1 + (ports / 8); - desc->bDescLength = 7 + 2 * temp; + desc->bDescLength = USB_DT_HUB_NONVAR_SIZE + 2 * temp; /* The Device Removable bits are reported on a byte granularity. * If the port doesn't exist within that byte, the bit is set to 0. @@ -137,8 +135,8 @@ static void xhci_usb3_hub_descriptor(struct usb_hcd *hcd, struct xhci_hcd *xhci, ports = xhci->num_usb3_ports; xhci_common_hub_descriptor(xhci, desc, ports); - desc->bDescriptorType = 0x2a; - desc->bDescLength = 12; + desc->bDescriptorType = USB_DT_SS_HUB; + desc->bDescLength = USB_DT_SS_HUB_SIZE; /* header decode latency should be zero for roothubs, * see section 4.23.5.2. diff --git a/trunk/include/linux/usb/ch11.h b/trunk/include/linux/usb/ch11.h index 4ebaf0824179..55e7325926c1 100644 --- a/trunk/include/linux/usb/ch11.h +++ b/trunk/include/linux/usb/ch11.h @@ -165,11 +165,20 @@ struct usb_port_status { * wHubCharacteristics (masks) * See USB 2.0 spec Table 11-13, offset 3 */ -#define HUB_CHAR_LPSM 0x0003 /* D1 .. D0 */ -#define HUB_CHAR_COMPOUND 0x0004 /* D2 */ -#define HUB_CHAR_OCPM 0x0018 /* D4 .. D3 */ -#define HUB_CHAR_TTTT 0x0060 /* D6 .. D5 */ -#define HUB_CHAR_PORTIND 0x0080 /* D7 */ +#define HUB_CHAR_LPSM 0x0003 /* Logical Power Switching Mode mask */ +#define HUB_CHAR_COMMON_LPSM 0x0000 /* All ports power control at once */ +#define HUB_CHAR_INDV_PORT_LPSM 0x0001 /* per-port power control */ +#define HUB_CHAR_NO_LPSM 0x0002 /* no power switching */ + +#define HUB_CHAR_COMPOUND 0x0004 /* hub is part of a compound device */ + +#define HUB_CHAR_OCPM 0x0018 /* Over-Current Protection Mode mask */ +#define HUB_CHAR_COMMON_OCPM 0x0000 /* All ports Over-Current reporting */ +#define HUB_CHAR_INDV_PORT_OCPM 0x0008 /* per-port Over-current reporting */ +#define HUB_CHAR_NO_OCPM 0x0010 /* No Over-current Protection support */ + +#define HUB_CHAR_TTTT 0x0060 /* TT Think Time mask */ +#define HUB_CHAR_PORTIND 0x0080 /* per-port indicators (LEDs) */ struct usb_hub_status { __le16 wHubStatus;