Commit 288ead45 authored by Alan Stern's avatar Alan Stern Committed by Greg Kroah-Hartman

USB: remove bogus USB_PORT_FEAT_*_SPEED symbols

This patch (as1348) removes the bogus
USB_PORT_FEAT_{HIGHSPEED,SUPERSPEED} symbols from ch11.h.  No such
features are defined by the USB spec.  (There is a PORT_LOWSPEED
feature, but the spec doesn't mention it except to say that host
software should never use it.)  The speed indicators are port
statuses, not port features.

As a temporary workaround for the xhci-hcd driver, a fictional
USB_PORT_STAT_SUPER_SPEED symbol is added.
Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
CC: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 45f30e0b
...@@ -153,11 +153,11 @@ static int usb_reset_and_verify_device(struct usb_device *udev); ...@@ -153,11 +153,11 @@ static int usb_reset_and_verify_device(struct usb_device *udev);
static inline char *portspeed(int portstatus) static inline char *portspeed(int portstatus)
{ {
if (portstatus & (1 << USB_PORT_FEAT_HIGHSPEED)) if (portstatus & USB_PORT_STAT_HIGH_SPEED)
return "480 Mb/s"; return "480 Mb/s";
else if (portstatus & (1 << USB_PORT_FEAT_LOWSPEED)) else if (portstatus & USB_PORT_STAT_LOW_SPEED)
return "1.5 Mb/s"; return "1.5 Mb/s";
else if (portstatus & (1 << USB_PORT_FEAT_SUPERSPEED)) else if (portstatus & USB_PORT_STAT_SUPER_SPEED)
return "5.0 Gb/s"; return "5.0 Gb/s";
else else
return "12 Mb/s"; return "12 Mb/s";
...@@ -3075,7 +3075,7 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1, ...@@ -3075,7 +3075,7 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1,
if (!(hcd->driver->flags & HCD_USB3)) if (!(hcd->driver->flags & HCD_USB3))
udev->speed = USB_SPEED_UNKNOWN; udev->speed = USB_SPEED_UNKNOWN;
else if ((hdev->parent == NULL) && else if ((hdev->parent == NULL) &&
(portstatus & (1 << USB_PORT_FEAT_SUPERSPEED))) (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;
......
...@@ -556,20 +556,20 @@ ehci_port_speed(struct ehci_hcd *ehci, unsigned int portsc) ...@@ -556,20 +556,20 @@ ehci_port_speed(struct ehci_hcd *ehci, unsigned int portsc)
case 0: case 0:
return 0; return 0;
case 1: case 1:
return (1<<USB_PORT_FEAT_LOWSPEED); return USB_PORT_STAT_LOW_SPEED;
case 2: case 2:
default: default:
return (1<<USB_PORT_FEAT_HIGHSPEED); return USB_PORT_STAT_HIGH_SPEED;
} }
} }
return (1<<USB_PORT_FEAT_HIGHSPEED); return USB_PORT_STAT_HIGH_SPEED;
} }
#else #else
#define ehci_is_TDI(e) (0) #define ehci_is_TDI(e) (0)
#define ehci_port_speed(ehci, portsc) (1<<USB_PORT_FEAT_HIGHSPEED) #define ehci_port_speed(ehci, portsc) USB_PORT_STAT_HIGH_SPEED
#endif #endif
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
......
...@@ -111,7 +111,7 @@ struct isp1760_qh { ...@@ -111,7 +111,7 @@ struct isp1760_qh {
u32 ping; u32 ping;
}; };
#define ehci_port_speed(priv, portsc) (1 << USB_PORT_FEAT_HIGHSPEED) #define ehci_port_speed(priv, portsc) USB_PORT_STAT_HIGH_SPEED
static unsigned int isp1760_readl(__u32 __iomem *regs) static unsigned int isp1760_readl(__u32 __iomem *regs)
{ {
......
...@@ -3153,10 +3153,10 @@ static inline unsigned int oxu_port_speed(struct oxu_hcd *oxu, ...@@ -3153,10 +3153,10 @@ static inline unsigned int oxu_port_speed(struct oxu_hcd *oxu,
case 0: case 0:
return 0; return 0;
case 1: case 1:
return 1 << USB_PORT_FEAT_LOWSPEED; return USB_PORT_STAT_LOW_SPEED;
case 2: case 2:
default: default:
return 1 << USB_PORT_FEAT_HIGHSPEED; return USB_PORT_STAT_HIGH_SPEED;
} }
} }
......
...@@ -1059,12 +1059,11 @@ static void r8a66597_usb_connect(struct r8a66597 *r8a66597, int port) ...@@ -1059,12 +1059,11 @@ static void r8a66597_usb_connect(struct r8a66597 *r8a66597, int port)
u16 speed = get_rh_usb_speed(r8a66597, port); u16 speed = get_rh_usb_speed(r8a66597, port);
struct r8a66597_root_hub *rh = &r8a66597->root_hub[port]; struct r8a66597_root_hub *rh = &r8a66597->root_hub[port];
rh->port &= ~((1 << USB_PORT_FEAT_HIGHSPEED) | rh->port &= ~(USB_PORT_STAT_HIGH_SPEED | USB_PORT_STAT_LOW_SPEED);
(1 << USB_PORT_FEAT_LOWSPEED));
if (speed == HSMODE) if (speed == HSMODE)
rh->port |= (1 << USB_PORT_FEAT_HIGHSPEED); rh->port |= USB_PORT_STAT_HIGH_SPEED;
else if (speed == LSMODE) else if (speed == LSMODE)
rh->port |= (1 << USB_PORT_FEAT_LOWSPEED); rh->port |= USB_PORT_STAT_LOW_SPEED;
rh->port &= ~(1 << USB_PORT_FEAT_RESET); rh->port &= ~(1 << USB_PORT_FEAT_RESET);
rh->port |= 1 << USB_PORT_FEAT_ENABLE; rh->port |= 1 << USB_PORT_FEAT_ENABLE;
......
...@@ -1121,7 +1121,7 @@ sl811h_timer(unsigned long _sl811) ...@@ -1121,7 +1121,7 @@ sl811h_timer(unsigned long _sl811)
u8 signaling = sl811->ctrl1 & SL11H_CTL1MASK_FORCE; u8 signaling = sl811->ctrl1 & SL11H_CTL1MASK_FORCE;
const u32 mask = (1 << USB_PORT_FEAT_CONNECTION) const u32 mask = (1 << USB_PORT_FEAT_CONNECTION)
| (1 << USB_PORT_FEAT_ENABLE) | (1 << USB_PORT_FEAT_ENABLE)
| (1 << USB_PORT_FEAT_LOWSPEED); | USB_PORT_STAT_LOW_SPEED;
spin_lock_irqsave(&sl811->lock, flags); spin_lock_irqsave(&sl811->lock, flags);
...@@ -1162,7 +1162,7 @@ sl811h_timer(unsigned long _sl811) ...@@ -1162,7 +1162,7 @@ sl811h_timer(unsigned long _sl811)
} else { } else {
sl811->port1 |= mask; sl811->port1 |= mask;
if (irqstat & SL11H_INTMASK_DP) if (irqstat & SL11H_INTMASK_DP)
sl811->port1 &= ~(1 << USB_PORT_FEAT_LOWSPEED); sl811->port1 &= ~USB_PORT_STAT_LOW_SPEED;
sl811->irq_enable = SL11H_INTMASK_INSRMV | SL11H_INTMASK_RD; sl811->irq_enable = SL11H_INTMASK_INSRMV | SL11H_INTMASK_RD;
} }
...@@ -1173,7 +1173,7 @@ sl811h_timer(unsigned long _sl811) ...@@ -1173,7 +1173,7 @@ sl811h_timer(unsigned long _sl811)
#ifdef USE_B #ifdef USE_B
sl811->irq_enable |= SL11H_INTMASK_DONE_B; sl811->irq_enable |= SL11H_INTMASK_DONE_B;
#endif #endif
if (sl811->port1 & (1 << USB_PORT_FEAT_LOWSPEED)) { if (sl811->port1 & USB_PORT_STAT_LOW_SPEED) {
sl811->ctrl1 |= SL11H_CTL1MASK_LSPD; sl811->ctrl1 |= SL11H_CTL1MASK_LSPD;
ctrl2 |= SL811HS_CTL2MASK_DSWAP; ctrl2 |= SL811HS_CTL2MASK_DSWAP;
} }
......
...@@ -64,15 +64,15 @@ static void xhci_hub_descriptor(struct xhci_hcd *xhci, ...@@ -64,15 +64,15 @@ static void xhci_hub_descriptor(struct xhci_hcd *xhci,
static unsigned int xhci_port_speed(unsigned int port_status) static unsigned int xhci_port_speed(unsigned int port_status)
{ {
if (DEV_LOWSPEED(port_status)) if (DEV_LOWSPEED(port_status))
return 1 << USB_PORT_FEAT_LOWSPEED; return USB_PORT_STAT_LOW_SPEED;
if (DEV_HIGHSPEED(port_status)) if (DEV_HIGHSPEED(port_status))
return 1 << USB_PORT_FEAT_HIGHSPEED; return USB_PORT_STAT_HIGH_SPEED;
if (DEV_SUPERSPEED(port_status)) if (DEV_SUPERSPEED(port_status))
return 1 << USB_PORT_FEAT_SUPERSPEED; 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
* USB_PORT_FEAT_*SPEED is used). * USB_PORT_STAT_*_SPEED is used).
*/ */
return 0; return 0;
} }
......
...@@ -47,11 +47,7 @@ ...@@ -47,11 +47,7 @@
#define USB_PORT_FEAT_RESET 4 #define USB_PORT_FEAT_RESET 4
#define USB_PORT_FEAT_L1 5 /* L1 suspend */ #define USB_PORT_FEAT_L1 5 /* L1 suspend */
#define USB_PORT_FEAT_POWER 8 #define USB_PORT_FEAT_POWER 8
#define USB_PORT_FEAT_LOWSPEED 9 #define USB_PORT_FEAT_LOWSPEED 9 /* Should never be used */
/* This value was never in Table 11-17 */
#define USB_PORT_FEAT_HIGHSPEED 10
/* This value is also fake */
#define USB_PORT_FEAT_SUPERSPEED 11
#define USB_PORT_FEAT_C_CONNECTION 16 #define USB_PORT_FEAT_C_CONNECTION 16
#define USB_PORT_FEAT_C_ENABLE 17 #define USB_PORT_FEAT_C_ENABLE 17
#define USB_PORT_FEAT_C_SUSPEND 18 #define USB_PORT_FEAT_C_SUSPEND 18
...@@ -87,6 +83,7 @@ struct usb_port_status { ...@@ -87,6 +83,7 @@ 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 */
/* /*
* wPortChange bit field * wPortChange bit field
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment