Przeglądaj źródła

USB: fix formatting of SuperSpeed endpoints in /proc/bus/usb/devices

Isochronous and interrupt SuperSpeed endpoints use the same mechanisms
for decoding bInterval values as HighSpeed ones so adjust the code
accordingly.

Also bandwidth reservation for SuperSpeed matches highspeed, not
low/full speed.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Dmitry Torokhov 14 lat temu
rodzic
commit
2868a2b1ba
1 zmienionych plików z 6 dodań i 4 usunięć
  1. 6 4
      drivers/usb/core/devices.c

+ 6 - 4
drivers/usb/core/devices.c

@@ -221,7 +221,7 @@ static char *usb_dump_endpoint_descriptor(int speed, char *start, char *end,
 		break;
 		break;
 	case USB_ENDPOINT_XFER_INT:
 	case USB_ENDPOINT_XFER_INT:
 		type = "Int.";
 		type = "Int.";
-		if (speed == USB_SPEED_HIGH)
+		if (speed == USB_SPEED_HIGH || speed == USB_SPEED_SUPER)
 			interval = 1 << (desc->bInterval - 1);
 			interval = 1 << (desc->bInterval - 1);
 		else
 		else
 			interval = desc->bInterval;
 			interval = desc->bInterval;
@@ -229,7 +229,8 @@ static char *usb_dump_endpoint_descriptor(int speed, char *start, char *end,
 	default:	/* "can't happen" */
 	default:	/* "can't happen" */
 		return start;
 		return start;
 	}
 	}
-	interval *= (speed == USB_SPEED_HIGH) ? 125 : 1000;
+	interval *= (speed == USB_SPEED_HIGH ||
+		     speed == USB_SPEED_SUPER) ? 125 : 1000;
 	if (interval % 1000)
 	if (interval % 1000)
 		unit = 'u';
 		unit = 'u';
 	else {
 	else {
@@ -542,8 +543,9 @@ static ssize_t usb_device_dump(char __user **buffer, size_t *nbytes,
 	if (level == 0) {
 	if (level == 0) {
 		int	max;
 		int	max;
 
 
-		/* high speed reserves 80%, full/low reserves 90% */
-		if (usbdev->speed == USB_SPEED_HIGH)
+		/* super/high speed reserves 80%, full/low reserves 90% */
+		if (usbdev->speed == USB_SPEED_HIGH ||
+		    usbdev->speed == USB_SPEED_SUPER)
 			max = 800;
 			max = 800;
 		else
 		else
 			max = FRAME_TIME_MAX_USECS_ALLOC;
 			max = FRAME_TIME_MAX_USECS_ALLOC;