Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -153,11 +153,11 @@ static int usb_reset_and_verify_device(struct usb_device *udev);

static inline char *portspeed(int portstatus)
{
	if (portstatus & (1 << USB_PORT_FEAT_HIGHSPEED))
	if (portstatus & USB_PORT_STAT_HIGH_SPEED)
    		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";
	else if (portstatus & (1 << USB_PORT_FEAT_SUPERSPEED))
	else if (portstatus & USB_PORT_STAT_SUPER_SPEED)
		return "5.0 Gb/s";
	else
		return "12 Mb/s";
@@ -3075,7 +3075,7 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1,
		if (!(hcd->driver->flags & HCD_USB3))
			udev->speed = USB_SPEED_UNKNOWN;
		else if ((hdev->parent == NULL) &&
				(portstatus & (1 << USB_PORT_FEAT_SUPERSPEED)))
				(portstatus & USB_PORT_STAT_SUPER_SPEED))
			udev->speed = USB_SPEED_SUPER;
		else
			udev->speed = USB_SPEED_UNKNOWN;
+4 −4
Original line number Diff line number Diff line
@@ -556,20 +556,20 @@ ehci_port_speed(struct ehci_hcd *ehci, unsigned int portsc)
		case 0:
			return 0;
		case 1:
			return (1<<USB_PORT_FEAT_LOWSPEED);
			return USB_PORT_STAT_LOW_SPEED;
		case 2:
		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

#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

/*-------------------------------------------------------------------------*/
+1 −1
Original line number Diff line number Diff line
@@ -111,7 +111,7 @@ struct isp1760_qh {
	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)
{
+2 −2
Original line number Diff line number Diff line
@@ -3153,10 +3153,10 @@ static inline unsigned int oxu_port_speed(struct oxu_hcd *oxu,
	case 0:
		return 0;
	case 1:
		return 1 << USB_PORT_FEAT_LOWSPEED;
		return USB_PORT_STAT_LOW_SPEED;
	case 2:
	default:
		return 1 << USB_PORT_FEAT_HIGHSPEED;
		return USB_PORT_STAT_HIGH_SPEED;
	}
}

+3 −4
Original line number Diff line number Diff line
@@ -1059,12 +1059,11 @@ static void r8a66597_usb_connect(struct r8a66597 *r8a66597, int port)
	u16 speed = get_rh_usb_speed(r8a66597, port);
	struct r8a66597_root_hub *rh = &r8a66597->root_hub[port];

	rh->port &= ~((1 << USB_PORT_FEAT_HIGHSPEED) |
		      (1 << USB_PORT_FEAT_LOWSPEED));
	rh->port &= ~(USB_PORT_STAT_HIGH_SPEED | USB_PORT_STAT_LOW_SPEED);
	if (speed == HSMODE)
		rh->port |= (1 << USB_PORT_FEAT_HIGHSPEED);
		rh->port |= USB_PORT_STAT_HIGH_SPEED;
	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_ENABLE;
Loading