summaryrefslogtreecommitdiff
path: root/tools/usb/testusb.c
AgeCommit message (Collapse)Author
2021-10-09usb: testusb: Fix for showing the connection speedFaizel K B
[ Upstream commit f81c08f897adafd2ed43f86f00207ff929f0b2eb ] 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>
2015-09-27tools: usb: testusb: change the default value for length from 512 to 1024Peter Chen
For ctrl out test, it needs length > vary, so in order to run it with default parameters, we do this change. Acked-by: Michal Nazarewicz <mina86@mina86.com> Cc: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-09-27tools: usb: testusb: change the help textPeter Chen
The 'length' is the transfer length, not the packet size, so change the help text. Acked-by: Michal Nazarewicz <mina86@mina86.com> Cc: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-02-08testusb: remove all mentions of 'usbfs'Sergei Shtylyov
Commit 8a424bf40d772fedacc91862ecc86f10541fabb3 (tools/usb: remove last USBFS user) removed 'usbfs' files from the source but retained mentions of 'usbfs' all over the place, most importantly in the misleading error messages printed in case USB device files are not there. Remove all the mentions of 'usbfs' for good now! Signed-off-by: Sergei Shtylyov <sshtylyov@dev.rtsoft.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-11tools/usb: remove unneeded 'continue' and simplify conditionSasha Levin
Basically remove unneeded code. Since that 'continue' is at the end of the for() there's no need for it. Signed-off-by: Sasha Levin <sasha.levin@oracle.com> Acked-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-10tools/usb: remove last USBFS userSebastian Andrzej Siewior
In commit fb28d58b ("USB: remove CONFIG_USB_DEVICEFS") USBFS got removed. Since it is gone we can stop using it in testusb and try udev nodes right away. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-13testusb: expose looping forever option "l" to userDu, ChangbinX
The testusb.c tool has support for looping forever implemented, which may be useful for stress test, yet it is not exposed to the user, so even though the code is there, it cannot be used. This commit adds "l" to the set of options handled by the application which enables the feature. Also, I collate help information for each command line option to make it easier to use for novice. Signed-off-by: Du Changbin <changbinx.du@intel.com> Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-15USB: testusb: add path /dev/bus/usb to default search paths for usbfsDu, ChangbinX
As real device-nodes managed by udev whose nodes lived in /dev/bus/usb are mostly used today, let testusb tool use that directory as one default path make tool be more convenient to use. Signed-off-by: Du Changbin <changbinx.du@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-01-24usb: gadget: update Michal Nazarewicz's email addressMichal Nazarewicz
The m.nazarewicz@samsung.com email address is no longer valid, so this commit replaces it with mina86@mina86.com which is employer-agnostic and thus should be valid for foreseeable feature. Signed-off-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2010-05-20USB: testusb: testusb compatibility with FunctionFS gadgetMichal Nazarewicz
The FunctionFS gadget may provide the source/sink interface not as the first interface (with id == 0) but some different interface hence a code to find the interface number is required. (Note that you will still configure the gadget to report idProduct == 0xa4a4 (an "echo 0xa4a4 >/sys/module/g_ffs/parameters/usb_product" should suffice) or configure host to handle 0x0525:0xa4ac devices using the usbtest driver.) Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com> Cc: Kyungmin Park <kyungmin.park@samsung.com> Cc: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: testusb: an USB testing applicationDavid Brownell
The testusb program just issues ioctls to perform the tests implemented by the kernel driver. It can generate a variety of transfer patterns; you should make sure to test both regular streaming and mixes of transfer sizes (including short transfers). For more information on how this can be used and on USB testing refer to <URL:http://www.linux-usb.org/usbtest/>. Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com> Cc: Kyungmin Park <kyungmin.park@samsung.com> Cc: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>