Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tools: usb: testusb: Add wireless speed reporting

Add the ability to detect and print the USB speed as "wireless" if/when the
kernel reports that speed.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Link: https://lore.kernel.org/r/20220708115859.2095714-2-bryan.odonoghue@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Bryan O'Donoghue and committed by
Greg Kroah-Hartman
b067fc28 3a6bf4a0

+8 -6
+8 -6
tools/usb/testusb.c
··· 96 96 enum usb_device_speed { 97 97 USB_SPEED_UNKNOWN = 0, /* enumerating */ 98 98 USB_SPEED_LOW, USB_SPEED_FULL, /* usb 1.1 */ 99 - USB_SPEED_HIGH /* usb 2.0 */ 99 + USB_SPEED_HIGH, /* usb 2.0 */ 100 + USB_SPEED_WIRELESS, /* wireless (usb 2.5) */ 100 101 }; 101 102 102 103 /*-------------------------------------------------------------------------*/ ··· 105 104 static char *speed (enum usb_device_speed s) 106 105 { 107 106 switch (s) { 108 - case USB_SPEED_UNKNOWN: return "unknown"; 109 - case USB_SPEED_LOW: return "low"; 110 - case USB_SPEED_FULL: return "full"; 111 - case USB_SPEED_HIGH: return "high"; 112 - default: return "??"; 107 + case USB_SPEED_UNKNOWN: return "unknown"; 108 + case USB_SPEED_LOW: return "low"; 109 + case USB_SPEED_FULL: return "full"; 110 + case USB_SPEED_HIGH: return "high"; 111 + case USB_SPEED_WIRELESS: return "wireless"; 112 + default: return "??"; 113 113 } 114 114 } 115 115