aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core
diff options
context:
space:
mode:
authorSarah Sharp <sarah.a.sharp@linux.intel.com>2010-12-07 00:00:19 -0500
committerSarah Sharp <sarah.a.sharp@linux.intel.com>2011-03-13 21:23:50 -0400
commit131dec344d5e41f01e4791aa4c80eb4bdb1e5274 (patch)
tree5ec2e11acfa9f21a4aeb4137721786b2ea67cd83 /drivers/usb/core
parentc6cc27c782e3a64cced0fcf1d6f492c8d8881c76 (diff)
USB: Remove bogus USB_PORT_STAT_SUPER_SPEED symbol.
USB_PORT_STAT_SUPER_SPEED is a made up symbol that the USB core used to track whether USB ports had a SuperSpeed device attached. This is a linux-internal symbol that was used when SuperSpeed and non-SuperSpeed devices would show up under the same xHCI roothub. This particular port status is never returned by external USB 3.0 hubs. (Instead they have a USB_PORT_STAT_SPEED_5GBPS that uses a completely different speed mask.) Now that the xHCI driver registers two roothubs, USB 3.0 devices will only show up under USB 3.0 hubs. Rip out USB_PORT_STAT_SUPER_SPEED and replace it with calls to hub_is_superspeed(). Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Diffstat (limited to 'drivers/usb/core')
-rw-r--r--drivers/usb/core/hub.c36
1 files changed, 8 insertions, 28 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;