提交 131dec34 编写于 作者: S Sarah Sharp

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: NSarah Sharp <sarah.a.sharp@linux.intel.com>
上级 c6cc27c7
...@@ -155,14 +155,14 @@ EXPORT_SYMBOL_GPL(ehci_cf_port_reset_rwsem); ...@@ -155,14 +155,14 @@ EXPORT_SYMBOL_GPL(ehci_cf_port_reset_rwsem);
static int usb_reset_and_verify_device(struct usb_device *udev); static int usb_reset_and_verify_device(struct usb_device *udev);
static inline char *portspeed(int portstatus) static inline char *portspeed(struct usb_hub *hub, int portstatus)
{ {
if (hub_is_superspeed(hub->hdev))
return "5.0 Gb/s";
if (portstatus & USB_PORT_STAT_HIGH_SPEED) if (portstatus & USB_PORT_STAT_HIGH_SPEED)
return "480 Mb/s"; return "480 Mb/s";
else if (portstatus & USB_PORT_STAT_LOW_SPEED) else if (portstatus & USB_PORT_STAT_LOW_SPEED)
return "1.5 Mb/s"; return "1.5 Mb/s";
else if (portstatus & USB_PORT_STAT_SUPER_SPEED)
return "5.0 Gb/s";
else else
return "12 Mb/s"; return "12 Mb/s";
} }
...@@ -385,9 +385,6 @@ static int hub_port_status(struct usb_hub *hub, int port1, ...@@ -385,9 +385,6 @@ static int hub_port_status(struct usb_hub *hub, int port1,
u16 tmp = *status & USB_SS_PORT_STAT_MASK; u16 tmp = *status & USB_SS_PORT_STAT_MASK;
if (*status & USB_SS_PORT_STAT_POWER) if (*status & USB_SS_PORT_STAT_POWER)
tmp |= USB_PORT_STAT_POWER; tmp |= USB_PORT_STAT_POWER;
if ((*status & USB_SS_PORT_STAT_SPEED) ==
USB_PORT_STAT_SPEED_5GBPS)
tmp |= USB_PORT_STAT_SUPER_SPEED;
*status = tmp; *status = tmp;
} }
...@@ -795,12 +792,8 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type) ...@@ -795,12 +792,8 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type)
* USB3 protocol ports will automatically transition * USB3 protocol ports will automatically transition
* to Enabled state when detect an USB3.0 device attach. * to Enabled state when detect an USB3.0 device attach.
* Do not disable USB3 protocol ports. * Do not disable USB3 protocol ports.
* FIXME: USB3 root hub and external hubs are treated
* differently here.
*/ */
if (hdev->descriptor.bDeviceProtocol != 3 || if (!hub_is_superspeed(hdev)) {
(!hdev->parent &&
!(portstatus & USB_PORT_STAT_SUPER_SPEED))) {
clear_port_feature(hdev, port1, clear_port_feature(hdev, port1,
USB_PORT_FEAT_ENABLE); USB_PORT_FEAT_ENABLE);
portstatus &= ~USB_PORT_STAT_ENABLE; portstatus &= ~USB_PORT_STAT_ENABLE;
...@@ -2067,14 +2060,12 @@ static int hub_port_wait_reset(struct usb_hub *hub, int port1, ...@@ -2067,14 +2060,12 @@ static int hub_port_wait_reset(struct usb_hub *hub, int port1,
(portstatus & USB_PORT_STAT_ENABLE)) { (portstatus & USB_PORT_STAT_ENABLE)) {
if (hub_is_wusb(hub)) if (hub_is_wusb(hub))
udev->speed = USB_SPEED_WIRELESS; udev->speed = USB_SPEED_WIRELESS;
else if (portstatus & USB_PORT_STAT_SUPER_SPEED) else if (hub_is_superspeed(hub->hdev))
udev->speed = USB_SPEED_SUPER; udev->speed = USB_SPEED_SUPER;
else if (portstatus & USB_PORT_STAT_HIGH_SPEED) else if (portstatus & USB_PORT_STAT_HIGH_SPEED)
udev->speed = USB_SPEED_HIGH; udev->speed = USB_SPEED_HIGH;
else if (portstatus & USB_PORT_STAT_LOW_SPEED) else if (portstatus & USB_PORT_STAT_LOW_SPEED)
udev->speed = USB_SPEED_LOW; udev->speed = USB_SPEED_LOW;
else if (portstatus & USB_PORT_STAT_SUPER_SPEED)
udev->speed = USB_SPEED_SUPER;
else else
udev->speed = USB_SPEED_FULL; udev->speed = USB_SPEED_FULL;
return 0; return 0;
...@@ -3067,7 +3058,7 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1, ...@@ -3067,7 +3058,7 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1,
dev_dbg (hub_dev, dev_dbg (hub_dev,
"port %d, status %04x, change %04x, %s\n", "port %d, status %04x, change %04x, %s\n",
port1, portstatus, portchange, portspeed (portstatus)); port1, portstatus, portchange, portspeed(hub, portstatus));
if (hub->has_indicators) { if (hub->has_indicators) {
set_port_led(hub, port1, HUB_LED_AUTO); 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,19 +3159,8 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1,
udev->level = hdev->level + 1; udev->level = hdev->level + 1;
udev->wusb = hub_is_wusb(hub); udev->wusb = hub_is_wusb(hub);
/* /* Only USB 3.0 devices are connected to SuperSpeed hubs. */
* USB 3.0 devices are reset automatically before the connect if (hub_is_superspeed(hub->hdev))
* port status change appears, and the root hub port status
* shows the correct speed. We also get port change
* notifications for USB 3.0 devices from the USB 3.0 portion of
* an external USB 3.0 hub, but this isn't handled correctly yet
* FIXME.
*/
if (!(hcd->driver->flags & HCD_USB3))
udev->speed = USB_SPEED_UNKNOWN;
else if ((hdev->parent == NULL) &&
(portstatus & USB_PORT_STAT_SUPER_SPEED))
udev->speed = USB_SPEED_SUPER; udev->speed = USB_SPEED_SUPER;
else else
udev->speed = USB_SPEED_UNKNOWN; udev->speed = USB_SPEED_UNKNOWN;
......
...@@ -155,8 +155,6 @@ static unsigned int xhci_port_speed(unsigned int port_status) ...@@ -155,8 +155,6 @@ static unsigned int xhci_port_speed(unsigned int port_status)
return USB_PORT_STAT_LOW_SPEED; return USB_PORT_STAT_LOW_SPEED;
if (DEV_HIGHSPEED(port_status)) if (DEV_HIGHSPEED(port_status))
return USB_PORT_STAT_HIGH_SPEED; return USB_PORT_STAT_HIGH_SPEED;
if (DEV_SUPERSPEED(port_status))
return USB_PORT_STAT_SUPER_SPEED;
/* /*
* FIXME: Yes, we should check for full speed, but the core uses that as * FIXME: Yes, we should check for full speed, but the core uses that as
* a default in portspeed() in usb/core/hub.c (which is the only place * a default in portspeed() in usb/core/hub.c (which is the only place
......
...@@ -109,7 +109,6 @@ struct usb_port_status { ...@@ -109,7 +109,6 @@ struct usb_port_status {
#define USB_PORT_STAT_TEST 0x0800 #define USB_PORT_STAT_TEST 0x0800
#define USB_PORT_STAT_INDICATOR 0x1000 #define USB_PORT_STAT_INDICATOR 0x1000
/* bits 13 to 15 are reserved */ /* bits 13 to 15 are reserved */
#define USB_PORT_STAT_SUPER_SPEED 0x8000 /* Linux-internal */
/* /*
* Additions to wPortStatus bit field from USB 3.0 * Additions to wPortStatus bit field from USB 3.0
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册