linux-stable/tools
Faizel K B 02ac2b3b9b usb: testusb: Fix for showing the connection speed
[ Upstream commit f81c08f897 ]

testusb' application which uses 'usbtest' driver reports 'unknown speed'
from the function 'find_testdev'. The variable 'entry->speed' was not
updated from  the application. The IOCTL mentioned in the FIXME comment can
only report whether the connection is low speed or not. Speed is read using
the IOCTL USBDEVFS_GET_SPEED which reports the proper speed grade.  The
call is implemented in the function 'handle_testdev' where the file
descriptor was availble locally. Sample output is given below where 'high
speed' is printed as the connected speed.

sudo ./testusb -a
high speed      /dev/bus/usb/001/011    0
/dev/bus/usb/001/011 test 0,    0.000015 secs
/dev/bus/usb/001/011 test 1,    0.194208 secs
/dev/bus/usb/001/011 test 2,    0.077289 secs
/dev/bus/usb/001/011 test 3,    0.170604 secs
/dev/bus/usb/001/011 test 4,    0.108335 secs
/dev/bus/usb/001/011 test 5,    2.788076 secs
/dev/bus/usb/001/011 test 6,    2.594610 secs
/dev/bus/usb/001/011 test 7,    2.905459 secs
/dev/bus/usb/001/011 test 8,    2.795193 secs
/dev/bus/usb/001/011 test 9,    8.372651 secs
/dev/bus/usb/001/011 test 10,    6.919731 secs
/dev/bus/usb/001/011 test 11,   16.372687 secs
/dev/bus/usb/001/011 test 12,   16.375233 secs
/dev/bus/usb/001/011 test 13,    2.977457 secs
/dev/bus/usb/001/011 test 14 --> 22 (Invalid argument)
/dev/bus/usb/001/011 test 17,    0.148826 secs
/dev/bus/usb/001/011 test 18,    0.068718 secs
/dev/bus/usb/001/011 test 19,    0.125992 secs
/dev/bus/usb/001/011 test 20,    0.127477 secs
/dev/bus/usb/001/011 test 21 --> 22 (Invalid argument)
/dev/bus/usb/001/011 test 24,    4.133763 secs
/dev/bus/usb/001/011 test 27,    2.140066 secs
/dev/bus/usb/001/011 test 28,    2.120713 secs
/dev/bus/usb/001/011 test 29,    0.507762 secs

Signed-off-by: Faizel K B <faizel.kb@dicortech.com>
Link: https://lore.kernel.org/r/20210902114444.15106-1-faizel.kb@dicortech.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-10-09 14:09:46 +02:00
..
accounting tools/accounting/getdelays.c: fix netlink attribute length 2020-04-13 10:34:33 +02:00
arch ia64: tools: remove duplicate definition of ia64_mf() on ia64 2021-04-28 12:08:43 +02:00
build tools build feature: Check if pthread_barrier_t is available 2021-03-24 11:05:00 +01:00
cgroup tools: fix cross-compile var clobbering 2019-01-13 10:01:02 +01:00
firewire
gpio tools: gpio-hammer: Avoid potential overflow in main 2020-10-01 13:12:39 +02:00
hv Tools: hv: kvp: eliminate 'may be used uninitialized' warning 2019-09-10 10:32:17 +01:00
iio iio: iio-utils: Fix possible incorrect mask calculation 2019-07-31 07:28:53 +02:00
include perf tools: Correct SNOOPX field offset 2020-09-09 19:03:09 +02:00
kvm/kvm_stat tweewide: Fix most Shebang lines 2021-06-03 08:36:11 +02:00
laptop tools: fix cross-compile var clobbering 2019-01-13 10:01:02 +01:00
leds tools: fix cross-compile var clobbering 2019-01-13 10:01:02 +01:00
lib libbpf: Fix INSTALL flag order 2021-03-30 14:40:10 +02:00
net bpf: fix uninitialized variable in bpf tools 2018-06-21 04:02:49 +09:00
nfsd
objtool objtool: Support Clang non-section symbols in ORC generation 2021-02-10 09:12:08 +01:00
pci tools: PCI: Fix broken pcitest compilation 2019-11-24 08:23:34 +01:00
pcmcia
perf Revert "perf map: Fix dso->nsinfo refcounting" 2021-08-04 12:22:17 +02:00
power tweewide: Fix most Shebang lines 2021-06-03 08:36:11 +02:00
scripts tools: Let O= makes handle a relative path with -C option 2020-04-02 16:34:30 +02:00
spi tools: fix cross-compile var clobbering 2019-01-13 10:01:02 +01:00
testing selftests/bpf: Enlarge select() timeout for test_maps 2021-09-22 11:45:31 +02:00
thermal/tmon tools/thermal: tmon: fix for segfault 2018-05-30 07:52:28 +02:00
time
usb usb: testusb: Fix for showing the connection speed 2021-10-09 14:09:46 +02:00
virtio virtio: fix test build after uio.h change 2019-01-13 10:01:01 +01:00
vm tools/vm: fix cross-compile build 2020-05-02 17:24:22 +02:00
Makefile