aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/core/hub.c36
-rw-r--r--drivers/usb/host/xhci-hub.c2
-rw-r--r--include/linux/usb/ch11.h1
3 files changed, 8 insertions, 31 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 825d803720b3..13aafd1b45e5 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -155,14 +155,14 @@ EXPORT_SYMBOL_GPL(ehci_cf_port_reset_rwsem);
155 155
156static int usb_reset_and_verify_device(struct usb_device *udev); 156static int usb_reset_and_verify_device(struct usb_device *udev);
157 157
158static inline char *portspeed(int portstatus) 158static inline char *portspeed(struct usb_hub *hub, int portstatus)
159{ 159{
160 if (hub_is_superspeed(hub->hdev))
161 return "5.0 Gb/s";
160 if (portstatus & USB_PORT_STAT_HIGH_SPEED) 162 if (portstatus & USB_PORT_STAT_HIGH_SPEED)
161 return "480 Mb/s"; 163 return "480 Mb/s";
162 else if (portstatus & USB_PORT_STAT_LOW_SPEED) 164 else if (portstatus & USB_PORT_STAT_LOW_SPEED)
163 return "1.5 Mb/s"; 165 return "1.5 Mb/s";
164 else if (portstatus & USB_PORT_STAT_SUPER_SPEED)
165 return "5.0 Gb/s";
166 else 166 else
167 return "12 Mb/s"; 167 return "12 Mb/s";
168} 168}
@@ -385,9 +385,6 @@ static int hub_port_status(struct usb_hub *hub, int port1,
385 u16 tmp = *status & USB_SS_PORT_STAT_MASK; 385 u16 tmp = *status & USB_SS_PORT_STAT_MASK;
386 if (*status & USB_SS_PORT_STAT_POWER) 386 if (*status & USB_SS_PORT_STAT_POWER)
387 tmp |= USB_PORT_STAT_POWER; 387 tmp |= USB_PORT_STAT_POWER;
388 if ((*status & USB_SS_PORT_STAT_SPEED) ==
389 USB_PORT_STAT_SPEED_5GBPS)
390 tmp |= USB_PORT_STAT_SUPER_SPEED;
391 *status = tmp; 388 *status = tmp;
392 } 389 }
393 390
@@ -795,12 +792,8 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type)
795 * USB3 protocol ports will automatically transition 792 * USB3 protocol ports will automatically transition
796 * to Enabled state when detect an USB3.0 device attach. 793 * to Enabled state when detect an USB3.0 device attach.
797 * Do not disable USB3 protocol ports. 794 * Do not disable USB3 protocol ports.
798 * FIXME: USB3 root hub and external hubs are treated
799 * differently here.
800 */ 795 */
801 if (hdev->descriptor.bDeviceProtocol != 3 || 796 if (!hub_is_superspeed(hdev)) {
802 (!hdev->parent &&
803 !(portstatus & USB_PORT_STAT_SUPER_SPEED))) {
804 clear_port_feature(hdev, port1, 797 clear_port_feature(hdev, port1,
805 USB_PORT_FEAT_ENABLE); 798 USB_PORT_FEAT_ENABLE);
806 portstatus &= ~USB_PORT_STAT_ENABLE; 799 portstatus &= ~USB_PORT_STAT_ENABLE;
@@ -2067,14 +2060,12 @@ static int hub_port_wait_reset(struct usb_hub *hub, int port1,
2067 (portstatus & USB_PORT_STAT_ENABLE)) { 2060 (portstatus & USB_PORT_STAT_ENABLE)) {
2068 if (hub_is_wusb(hub)) 2061 if (hub_is_wusb(hub))
2069 udev->speed = USB_SPEED_WIRELESS; 2062 udev->speed = USB_SPEED_WIRELESS;
2070 else if (portstatus & USB_PORT_STAT_SUPER_SPEED) 2063 else if (hub_is_superspeed(hub->hdev))
2071 udev->speed = USB_SPEED_SUPER; 2064 udev->speed = USB_SPEED_SUPER;
2072 else if (portstatus & USB_PORT_STAT_HIGH_SPEED) 2065 else if (portstatus & USB_PORT_STAT_HIGH_SPEED)
2073 udev->speed = USB_SPEED_HIGH; 2066 udev->speed = USB_SPEED_HIGH;
2074 else if (portstatus & USB_PORT_STAT_LOW_SPEED) 2067 else if (portstatus & USB_PORT_STAT_LOW_SPEED)
2075 udev->speed = USB_SPEED_LOW; 2068 udev->speed = USB_SPEED_LOW;
2076 else if (portstatus & USB_PORT_STAT_SUPER_SPEED)
2077 udev->speed = USB_SPEED_SUPER;
2078 else 2069 else
2079 udev->speed = USB_SPEED_FULL; 2070 udev->speed = USB_SPEED_FULL;
2080 return 0; 2071 return 0;
@@ -3067,7 +3058,7 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1,
3067 3058
3068 dev_dbg (hub_dev, 3059 dev_dbg (hub_dev,
3069 "port %d, status %04x, change %04x, %s\n", 3060 "port %d, status %04x, change %04x, %s\n",
3070 port1, portstatus, portchange, portspeed (portstatus)); 3061 port1, portstatus, portchange, portspeed(hub, portstatus));
3071 3062
3072 if (hub->has_indicators) { 3063 if (hub->has_indicators) {
3073 set_port_led(hub, port1, HUB_LED_AUTO); 3064 set_port_led(hub, port1, HUB_LED_AUTO);
@@ -3168,19 +3159,8 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1,
3168 udev->level = hdev->level + 1; 3159 udev->level = hdev->level + 1;
3169 udev->wusb = hub_is_wusb(hub); 3160 udev->wusb = hub_is_wusb(hub);
3170 3161
3171 /* 3162 /* Only USB 3.0 devices are connected to SuperSpeed hubs. */
3172 * USB 3.0 devices are reset automatically before the connect 3163 if (hub_is_superspeed(hub->hdev))
3173 * port status change appears, and the root hub port status
3174 * shows the correct speed. We also get port change
3175 * notifications for USB 3.0 devices from the USB 3.0 portion of
3176 * an external USB 3.0 hub, but this isn't handled correctly yet
3177 * FIXME.
3178 */
3179
3180 if (!(hcd->driver->flags & HCD_USB3))
3181 udev->speed = USB_SPEED_UNKNOWN;
3182 else if ((hdev->parent == NULL) &&
3183 (portstatus & USB_PORT_STAT_SUPER_SPEED))
3184 udev->speed = USB_SPEED_SUPER; 3164 udev->speed = USB_SPEED_SUPER;
3185 else 3165 else
3186 udev->speed = USB_SPEED_UNKNOWN; 3166 udev->speed = USB_SPEED_UNKNOWN;
diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
index 770f84cb7327..a78f2ebd11b7 100644
--- a/drivers/usb/host/xhci-hub.c
+++ b/drivers/usb/host/xhci-hub.c
@@ -155,8 +155,6 @@ static unsigned int xhci_port_speed(unsigned int port_status)
155 return USB_PORT_STAT_LOW_SPEED; 155 return USB_PORT_STAT_LOW_SPEED;
156 if (DEV_HIGHSPEED(port_status)) 156 if (DEV_HIGHSPEED(port_status))
157 return USB_PORT_STAT_HIGH_SPEED; 157 return USB_PORT_STAT_HIGH_SPEED;
158 if (DEV_SUPERSPEED(port_status))
159 return USB_PORT_STAT_SUPER_SPEED;
160 /* 158 /*
161 * FIXME: Yes, we should check for full speed, but the core uses that as 159 * FIXME: Yes, we should check for full speed, but the core uses that as
162 * a default in portspeed() in usb/core/hub.c (which is the only place 160 * a default in portspeed() in usb/core/hub.c (which is the only place
diff --git a/include/linux/usb/ch11.h b/include/linux/usb/ch11.h
index 22afcd37bc3f..4ebaf0824179 100644
--- a/include/linux/usb/ch11.h
+++ b/include/linux/usb/ch11.h
@@ -109,7 +109,6 @@ struct usb_port_status {
109#define USB_PORT_STAT_TEST 0x0800 109#define USB_PORT_STAT_TEST 0x0800
110#define USB_PORT_STAT_INDICATOR 0x1000 110#define USB_PORT_STAT_INDICATOR 0x1000
111/* bits 13 to 15 are reserved */ 111/* bits 13 to 15 are reserved */
112#define USB_PORT_STAT_SUPER_SPEED 0x8000 /* Linux-internal */
113 112
114/* 113/*
115 * Additions to wPortStatus bit field from USB 3.0 114 * Additions to wPortStatus bit field from USB 3.0