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

Commit 8a1b2725 authored by Mathias Nyman's avatar Mathias Nyman Committed by Greg Kroah-Hartman
Browse files

usb: define USB_SPEED_SUPER_PLUS speed for SuperSpeedPlus USB3.1 devices



Add a new USB_SPEED_SUPER_PLUS device speed, and make sure usb core can
handle the new speed.
In most cases the behaviour is the same as with USB_SPEED_SUPER SuperSpeed
devices. In a few places we add a "Plus" string to inform the user of the
new speed.

Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 73a02d32
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ static const char *const speed_names[] = {
	[USB_SPEED_HIGH] = "high-speed",
	[USB_SPEED_WIRELESS] = "wireless",
	[USB_SPEED_SUPER] = "super-speed",
	[USB_SPEED_SUPER_PLUS] = "super-speed-plus",
};

const char *usb_speed_string(enum usb_device_speed speed)
+2 −1
Original line number Diff line number Diff line
@@ -191,6 +191,7 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno, int inum,
	if (usb_endpoint_xfer_int(d)) {
		i = 1;
		switch (to_usb_device(ddev)->speed) {
		case USB_SPEED_SUPER_PLUS:
		case USB_SPEED_SUPER:
		case USB_SPEED_HIGH:
			/* Many device manufacturers are using full-speed
@@ -274,7 +275,7 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno, int inum,
	}

	/* Parse a possible SuperSpeed endpoint companion descriptor */
	if (to_usb_device(ddev)->speed == USB_SPEED_SUPER)
	if (to_usb_device(ddev)->speed >= USB_SPEED_SUPER)
		usb_parse_ss_endpoint_companion(ddev, cfgno,
				inum, asnum, endpoint, buffer, size);

+6 −4
Original line number Diff line number Diff line
@@ -221,7 +221,7 @@ static char *usb_dump_endpoint_descriptor(int speed, char *start, char *end,
		break;
	case USB_ENDPOINT_XFER_INT:
		type = "Int.";
		if (speed == USB_SPEED_HIGH || speed == USB_SPEED_SUPER)
		if (speed == USB_SPEED_HIGH || speed >= USB_SPEED_SUPER)
			interval = 1 << (desc->bInterval - 1);
		else
			interval = desc->bInterval;
@@ -230,7 +230,7 @@ static char *usb_dump_endpoint_descriptor(int speed, char *start, char *end,
		return start;
	}
	interval *= (speed == USB_SPEED_HIGH ||
		     speed == USB_SPEED_SUPER) ? 125 : 1000;
		     speed >= USB_SPEED_SUPER) ? 125 : 1000;
	if (interval % 1000)
		unit = 'u';
	else {
@@ -322,7 +322,7 @@ static char *usb_dump_config_descriptor(char *start, char *end,

	if (start > end)
		return start;
	if (speed == USB_SPEED_SUPER)
	if (speed >= USB_SPEED_SUPER)
		mul = 8;
	else
		mul = 2;
@@ -534,6 +534,8 @@ static ssize_t usb_device_dump(char __user **buffer, size_t *nbytes,
		speed = "480"; break;
	case USB_SPEED_SUPER:
		speed = "5000"; break;
	case USB_SPEED_SUPER_PLUS:
		speed = "10000"; break;
	default:
		speed = "??";
	}
@@ -553,7 +555,7 @@ static ssize_t usb_device_dump(char __user **buffer, size_t *nbytes,

		/* super/high speed reserves 80%, full/low reserves 90% */
		if (usbdev->speed == USB_SPEED_HIGH ||
		    usbdev->speed == USB_SPEED_SUPER)
		    usbdev->speed >= USB_SPEED_SUPER)
			max = 800;
		else
			max = FRAME_TIME_MAX_USECS_ALLOC;
+1 −1
Original line number Diff line number Diff line
@@ -197,7 +197,7 @@ int usb_hcd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
	 * The xHCI driver has its own irq management
	 * make sure irq setup is not touched for xhci in generic hcd code
	 */
	if ((driver->flags & HCD_MASK) != HCD_USB3) {
	if ((driver->flags & HCD_MASK) < HCD_USB3) {
		if (!dev->irq) {
			dev_err(&dev->dev,
			"Found HC with no IRQ. Check BIOS/PCI %s setup!\n",
+3 −3
Original line number Diff line number Diff line
@@ -1078,7 +1078,7 @@ static int register_root_hub(struct usb_hcd *hcd)
		retval = usb_get_bos_descriptor(usb_dev);
		if (!retval) {
			usb_dev->lpm_capable = usb_device_supports_lpm(usb_dev);
		} else if (usb_dev->speed == USB_SPEED_SUPER) {
		} else if (usb_dev->speed >= USB_SPEED_SUPER) {
			mutex_unlock(&usb_bus_list_lock);
			dev_dbg(parent_dev, "can't read %s bos descriptor %d\n",
					dev_name(&usb_dev->dev), retval);
@@ -2112,7 +2112,7 @@ int usb_alloc_streams(struct usb_interface *interface,
	hcd = bus_to_hcd(dev->bus);
	if (!hcd->driver->alloc_streams || !hcd->driver->free_streams)
		return -EINVAL;
	if (dev->speed != USB_SPEED_SUPER)
	if (dev->speed < USB_SPEED_SUPER)
		return -EINVAL;
	if (dev->state < USB_STATE_CONFIGURED)
		return -ENODEV;
@@ -2160,7 +2160,7 @@ int usb_free_streams(struct usb_interface *interface,

	dev = interface_to_usbdev(interface);
	hcd = bus_to_hcd(dev->bus);
	if (dev->speed != USB_SPEED_SUPER)
	if (dev->speed < USB_SPEED_SUPER)
		return -EINVAL;

	/* Double-free is not allowed */
Loading