]> git.karo-electronics.de Git - karo-tx-linux.git/commit
usbtest: Add interrupt EP testcases
authorAmit Virdi <amit.virdi@st.com>
Fri, 22 Aug 2014 09:06:37 +0000 (14:36 +0530)
committerFelipe Balbi <balbi@ti.com>
Fri, 29 Aug 2014 20:51:11 +0000 (15:51 -0500)
commit457a0955e152ac3b0de46ecbe7a8b434856fda67
treee0f91f22bd735cb0a921824b42a86f9cd5664abd
parentef11982dd7a657512c362242508bb4021e0d67b6
usbtest: Add interrupt EP testcases

Two simple test cases for interrupt endpoints are added to the usbtest.c file.
These are simple non-queued interrupt IN and interrupt OUT transfers. Currently,
only gadget zero is capable of executing the interrupt EP test cases. However,
extending the same to other gadgets is extremely simple and can be done
on-demand.

The two new tests added are
  - Test 25: To verify Interrupt OUT transfer
  - Test 26: To verify Interrupt IN transfer

Since the default value of wMaxPacketSize is set as 1024, so interrupt
IN transfers must be specified with the size parameter = multiple of
1024. Otherwise the default value (512) in the usbtest application fails
the transfer. See [RUN 4] for sample logs

The application logs (usbtest) and corresponding kernel logs are as
following:

[Run 1]
./testusb -a -c 10 -s 2048 -t 26 -v 511
usbtest 7-1:3.0: TEST 26: read 2048 bytes 10 times

[Run 2]
./testusb -a -c 10 -s 1024 -t 25 -v 511
usbtest 7-1:3.0: TEST 25: write 1024 bytes 10 times

[Run 3]
./testusb -a -c 10 -s 1098 -t 25 -v 511
usbtest 7-1:3.0: TEST 25: write 1098 bytes 10 times

[Run 4 - Failure case scenario]
./testusb -a  -t 26
unknown speed   /dev/bus/usb/007/004    0
/dev/bus/usb/007/004 test 26 --> 75 (Value too large for defined data type)

usbtest 7-1:3.0: TEST 26: read 512 bytes 1000 times
usb 7-1: test26 failed, iterations left 999, status -75 (not 0)

Signed-off-by: Amit Virdi <amit.virdi@st.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/misc/usbtest.c