All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] tools: usb: testusb: Fix reported gadget speeds
@ 2022-07-08 11:58 Bryan O'Donoghue
  2022-07-08 11:58 ` [PATCH 1/3] tools: usb: testusb: Add wireless speed reporting Bryan O'Donoghue
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Bryan O'Donoghue @ 2022-07-08 11:58 UTC (permalink / raw)
  To: linux-usb, gregkh; +Cc: faizel.kb, baihaowen, bryan.odonoghue

Using the testusb utility on a qcom platform which supports
super-speed-plus I found that "??" was being reported instead of
super speed or super-plus speed.

This is easily solved by aligning the test tool speeds with
include/uapi/linux/usb/ch9.h::enum usb_device_speed{}

Before:
sudo ./testusb -a -t 0
?? speed	/dev/bus/usb/004/027	0
/dev/bus/usb/004/027 test 0,    0.000004 secs

After:
sudo ./testusb -a -t 0
super-plus speed	/dev/bus/usb/004/027	0
/dev/bus/usb/004/027 test 0,    0.000004 secs

Bryan O'Donoghue (3):
  tools: usb: testusb: Add wireless speed reporting
  tools: usb: testusb: Add super speed reporting
  tools: usb: testusb: Add super-plus speed reporting

 tools/usb/testusb.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

-- 
2.36.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/3] tools: usb: testusb: Add wireless speed reporting
  2022-07-08 11:58 [PATCH 0/3] tools: usb: testusb: Fix reported gadget speeds Bryan O'Donoghue
@ 2022-07-08 11:58 ` Bryan O'Donoghue
  2022-07-08 11:58 ` [PATCH 2/3] tools: usb: testusb: Add super " Bryan O'Donoghue
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Bryan O'Donoghue @ 2022-07-08 11:58 UTC (permalink / raw)
  To: linux-usb, gregkh; +Cc: faizel.kb, baihaowen, bryan.odonoghue

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>
---
 tools/usb/testusb.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/tools/usb/testusb.c b/tools/usb/testusb.c
index 474bae868b353..6f428f9253844 100644
--- a/tools/usb/testusb.c
+++ b/tools/usb/testusb.c
@@ -96,7 +96,8 @@ struct usb_interface_descriptor {
 enum usb_device_speed {
 	USB_SPEED_UNKNOWN = 0,			/* enumerating */
 	USB_SPEED_LOW, USB_SPEED_FULL,		/* usb 1.1 */
-	USB_SPEED_HIGH				/* usb 2.0 */
+	USB_SPEED_HIGH,				/* usb 2.0 */
+	USB_SPEED_WIRELESS,			/* wireless (usb 2.5) */
 };
 
 /*-------------------------------------------------------------------------*/
@@ -104,11 +105,12 @@ enum usb_device_speed {
 static char *speed (enum usb_device_speed s)
 {
 	switch (s) {
-	case USB_SPEED_UNKNOWN:	return "unknown";
-	case USB_SPEED_LOW:	return "low";
-	case USB_SPEED_FULL:	return "full";
-	case USB_SPEED_HIGH:	return "high";
-	default:		return "??";
+	case USB_SPEED_UNKNOWN:		return "unknown";
+	case USB_SPEED_LOW:		return "low";
+	case USB_SPEED_FULL:		return "full";
+	case USB_SPEED_HIGH:		return "high";
+	case USB_SPEED_WIRELESS:	return "wireless";
+	default:			return "??";
 	}
 }
 
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] tools: usb: testusb: Add super speed reporting
  2022-07-08 11:58 [PATCH 0/3] tools: usb: testusb: Fix reported gadget speeds Bryan O'Donoghue
  2022-07-08 11:58 ` [PATCH 1/3] tools: usb: testusb: Add wireless speed reporting Bryan O'Donoghue
@ 2022-07-08 11:58 ` Bryan O'Donoghue
  2022-07-08 11:58 ` [PATCH 3/3] tools: usb: testusb: Add super-plus " Bryan O'Donoghue
  2022-07-08 12:55 ` [PATCH 0/3] tools: usb: testusb: Fix reported gadget speeds Greg KH
  3 siblings, 0 replies; 5+ messages in thread
From: Bryan O'Donoghue @ 2022-07-08 11:58 UTC (permalink / raw)
  To: linux-usb, gregkh; +Cc: faizel.kb, baihaowen, bryan.odonoghue

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

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 tools/usb/testusb.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/usb/testusb.c b/tools/usb/testusb.c
index 6f428f9253844..d996a3819322e 100644
--- a/tools/usb/testusb.c
+++ b/tools/usb/testusb.c
@@ -98,6 +98,7 @@ enum usb_device_speed {
 	USB_SPEED_LOW, USB_SPEED_FULL,		/* usb 1.1 */
 	USB_SPEED_HIGH,				/* usb 2.0 */
 	USB_SPEED_WIRELESS,			/* wireless (usb 2.5) */
+	USB_SPEED_SUPER,			/* usb 3.0 */
 };
 
 /*-------------------------------------------------------------------------*/
@@ -110,6 +111,7 @@ static char *speed (enum usb_device_speed s)
 	case USB_SPEED_FULL:		return "full";
 	case USB_SPEED_HIGH:		return "high";
 	case USB_SPEED_WIRELESS:	return "wireless";
+	case USB_SPEED_SUPER:		return "super";
 	default:			return "??";
 	}
 }
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/3] tools: usb: testusb: Add super-plus speed reporting
  2022-07-08 11:58 [PATCH 0/3] tools: usb: testusb: Fix reported gadget speeds Bryan O'Donoghue
  2022-07-08 11:58 ` [PATCH 1/3] tools: usb: testusb: Add wireless speed reporting Bryan O'Donoghue
  2022-07-08 11:58 ` [PATCH 2/3] tools: usb: testusb: Add super " Bryan O'Donoghue
@ 2022-07-08 11:58 ` Bryan O'Donoghue
  2022-07-08 12:55 ` [PATCH 0/3] tools: usb: testusb: Fix reported gadget speeds Greg KH
  3 siblings, 0 replies; 5+ messages in thread
From: Bryan O'Donoghue @ 2022-07-08 11:58 UTC (permalink / raw)
  To: linux-usb, gregkh; +Cc: faizel.kb, baihaowen, bryan.odonoghue

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

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 tools/usb/testusb.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/usb/testusb.c b/tools/usb/testusb.c
index d996a3819322e..cbaa1b9fdeacb 100644
--- a/tools/usb/testusb.c
+++ b/tools/usb/testusb.c
@@ -99,6 +99,7 @@ enum usb_device_speed {
 	USB_SPEED_HIGH,				/* usb 2.0 */
 	USB_SPEED_WIRELESS,			/* wireless (usb 2.5) */
 	USB_SPEED_SUPER,			/* usb 3.0 */
+	USB_SPEED_SUPER_PLUS,			/* usb 3.1 */
 };
 
 /*-------------------------------------------------------------------------*/
@@ -112,6 +113,7 @@ static char *speed (enum usb_device_speed s)
 	case USB_SPEED_HIGH:		return "high";
 	case USB_SPEED_WIRELESS:	return "wireless";
 	case USB_SPEED_SUPER:		return "super";
+	case USB_SPEED_SUPER_PLUS:	return "super-plus";
 	default:			return "??";
 	}
 }
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/3] tools: usb: testusb: Fix reported gadget speeds
  2022-07-08 11:58 [PATCH 0/3] tools: usb: testusb: Fix reported gadget speeds Bryan O'Donoghue
                   ` (2 preceding siblings ...)
  2022-07-08 11:58 ` [PATCH 3/3] tools: usb: testusb: Add super-plus " Bryan O'Donoghue
@ 2022-07-08 12:55 ` Greg KH
  3 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2022-07-08 12:55 UTC (permalink / raw)
  To: Bryan O'Donoghue; +Cc: linux-usb, faizel.kb, baihaowen

On Fri, Jul 08, 2022 at 12:58:56PM +0100, Bryan O'Donoghue wrote:
> Using the testusb utility on a qcom platform which supports
> super-speed-plus I found that "??" was being reported instead of
> super speed or super-plus speed.
> 
> This is easily solved by aligning the test tool speeds with
> include/uapi/linux/usb/ch9.h::enum usb_device_speed{}
> 
> Before:
> sudo ./testusb -a -t 0
> ?? speed	/dev/bus/usb/004/027	0
> /dev/bus/usb/004/027 test 0,    0.000004 secs
> 
> After:
> sudo ./testusb -a -t 0
> super-plus speed	/dev/bus/usb/004/027	0
> /dev/bus/usb/004/027 test 0,    0.000004 secs

Nice, thanks for fixing these, all now queued up.

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-07-08 12:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-08 11:58 [PATCH 0/3] tools: usb: testusb: Fix reported gadget speeds Bryan O'Donoghue
2022-07-08 11:58 ` [PATCH 1/3] tools: usb: testusb: Add wireless speed reporting Bryan O'Donoghue
2022-07-08 11:58 ` [PATCH 2/3] tools: usb: testusb: Add super " Bryan O'Donoghue
2022-07-08 11:58 ` [PATCH 3/3] tools: usb: testusb: Add super-plus " Bryan O'Donoghue
2022-07-08 12:55 ` [PATCH 0/3] tools: usb: testusb: Fix reported gadget speeds Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.