<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/usb/misc/usbtest.c, branch v4.5</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.5</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.5'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2015-12-01T22:52:58Z</updated>
<entry>
<title>usb: misc: usbtest: Remove timeval usage</title>
<updated>2015-12-01T22:52:58Z</updated>
<author>
<name>Deepa Dinamani</name>
<email>deepa.kernel@gmail.com</email>
</author>
<published>2015-11-04T23:29:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=18fc4ebdc7057478497682047db5acfb25b35c49'/>
<id>urn:sha1:18fc4ebdc7057478497682047db5acfb25b35c49</id>
<content type='text'>
timeval is deprecated and not y2038 safe.  Its size also changes according
to 32 bit/ 64 bit compilation.  Replace it with 32 and 64 bit versions of
its individual fields, giving two ioctls with different code values.
The two ioctls are necessary to maintain the 32 bit and 64 bit userspace
compatibility with a 64/32 bit kernel.

Change unsigned to __u32 types for a definitive userspace interface.
This is in accordance with the psABI that the unsigned type is always
32 bits.

Also use motonic timer instead of real time to ensure positive delta
values.

Refactor usbtest_ioctl for readability to isolate the handling of the
testing timing measurement.

The official testusb userspace tool can be changed in a separate patch
to reflect the __u32 changes as well. It can use the usbtest_param_32
struct, since 32 bit seconds is long enough for test durations.

Signed-off-by: Deepa Dinamani &lt;deepa.kernel@gmail.com&gt;
Reviewed-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: misc: usbtest: improve the description for error message</title>
<updated>2015-12-01T22:36:29Z</updated>
<author>
<name>Peter Chen</name>
<email>peter.chen@freescale.com</email>
</author>
<published>2015-11-18T09:40:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c7c7806700e15ca9c48d880f8c65071f041cd890'/>
<id>urn:sha1:c7c7806700e15ca9c48d880f8c65071f041cd890</id>
<content type='text'>
Now the function of complicated_callback is not only used for iso
transfer, improve the error message to reflect it.

Signed-off-by: Peter Chen &lt;peter.chen@freescale.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: misc: usbtest: add bulk queue test</title>
<updated>2015-10-13T18:19:49Z</updated>
<author>
<name>Peter Chen</name>
<email>peter.chen@freescale.com</email>
</author>
<published>2015-10-13T07:18:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=145f48c518edb945ea5b689a1d21052597f9d64b'/>
<id>urn:sha1:145f48c518edb945ea5b689a1d21052597f9d64b</id>
<content type='text'>
The bulk queue tests are used to show 'best performance' for bulk
transfer, we are often asked this question by users. The implementation
is the same with iso test, that is queue request at interrupt completion,
so we reuse the iso structures, and rename them as common one.

It's result should be very close to IC simulation, in order
to get that, the device side should also need to prepare enough
queue.

We have got the 'best performance' (IN: 41MB, OUT: 39MB) at i.mx platform
(USB2, ARM Cortex A9, stream mode need to enable) with below command:

Host side:
modprobe usbtest
./testusb -a -t 27 -g 64 -s 16384
./testusb -a -t 28 -g 64 -s 16384
Gadget side:
modprobe g_zero loopdefault=1 qlen=64 buflen=16384

Signed-off-by: Peter Chen &lt;peter.chen@freescale.com&gt;
Cc: Greg KH &lt;gregkh@linuxfoundation.org&gt;
Cc: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
<entry>
<title>usb: misc: usbtest: format the data pattern according to max packet size</title>
<updated>2015-09-27T15:54:31Z</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2015-09-01T01:48:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b9a6e8e1001e28fecbd74c073f5503dac2790563'/>
<id>urn:sha1:b9a6e8e1001e28fecbd74c073f5503dac2790563</id>
<content type='text'>
With this change, the host and gadget doesn't need to agree with transfer
length for comparing the data, since they doesn't know each other's
transfer size, but know max packet size.

Signed-off-by: Peter Chen &lt;peter.chen@freescale.com&gt;
Acked-by: Michal Nazarewicz &lt;mina86@mina86.com&gt;
(Fixed the 'line over 80 characters warning' by Peter Chen)
Tested-by: Peter Chen &lt;peter.chen@freescale.com&gt;
Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
<entry>
<title>usb: misc: usbtest: using the same data format among write/compare/output</title>
<updated>2015-09-27T15:54:31Z</updated>
<author>
<name>Peter Chen</name>
<email>peter.chen@freescale.com</email>
</author>
<published>2015-09-01T01:48:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=169900f96792c11a5435773dd379046bc8036704'/>
<id>urn:sha1:169900f96792c11a5435773dd379046bc8036704</id>
<content type='text'>
Using the same data format "buf[j] = (u8)(i + j)" among
write, compare buf, and console output stage.

Acked-by: Michal Nazarewicz &lt;mina86@mina86.com&gt;
Signed-off-by: Peter Chen &lt;peter.chen@freescale.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
<entry>
<title>usb: misc: usbtest: delete useless memset for urbs array</title>
<updated>2015-09-27T15:54:31Z</updated>
<author>
<name>Peter Chen</name>
<email>peter.chen@freescale.com</email>
</author>
<published>2015-09-01T01:47:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a724ddfb17e0519d2c2b6e09a96b1b94eff6b801'/>
<id>urn:sha1:a724ddfb17e0519d2c2b6e09a96b1b94eff6b801</id>
<content type='text'>
The element of urbs array will be initialized at below code
at once.

	for (i = 0; i &lt; param-&gt;sglen; i++) {
		urbs[i] = iso_alloc_urb(udev, pipe, desc,
					param-&gt;length, offset);

Acked-by: Michal Nazarewicz &lt;mina86@mina86.com&gt;
Signed-off-by: Peter Chen &lt;peter.chen@freescale.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
<entry>
<title>usb: misc: usbtest: allocate size of urb array according to user parameter</title>
<updated>2015-09-27T15:54:31Z</updated>
<author>
<name>Peter Chen</name>
<email>peter.chen@freescale.com</email>
</author>
<published>2015-09-01T01:47:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=41d3c0b84d6e084865c429b1b6825256c0169319'/>
<id>urn:sha1:41d3c0b84d6e084865c429b1b6825256c0169319</id>
<content type='text'>
Allocate the size of urb pointer array according to testusb's
parameter sglen, and limits the length of sglen as MAX_SGLEN
(128 currently).

Acked-by: Michal Nazarewicz &lt;mina86@mina86.com&gt;
Signed-off-by: Peter Chen &lt;peter.chen@freescale.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
<entry>
<title>usb: misc: usbtest: format max packet size for iso transfer</title>
<updated>2015-08-18T17:05:23Z</updated>
<author>
<name>Peter Chen</name>
<email>peter.chen@freescale.com</email>
</author>
<published>2015-08-17T08:36:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a0c9d0defcdadd31ab111b1616f60cf919c6a020'/>
<id>urn:sha1:a0c9d0defcdadd31ab111b1616f60cf919c6a020</id>
<content type='text'>
The current code prints all wMaxPacketSize content at endpoint
descriptor, if there is a high speed, high bandwidth endpoint,
it may confuse the users, eg, if there are 3 transactions during
microframe, it will print "wMaxPacket 1400" for packet content.
This commit splits wMaxpacketSize and transaction numbers for
output messages.

Signed-off-by: Peter Chen &lt;peter.chen@freescale.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: hub: rename khubd to hub_wq in documentation and comments</title>
<updated>2014-09-24T05:33:19Z</updated>
<author>
<name>Petr Mladek</name>
<email>pmladek@suse.cz</email>
</author>
<published>2014-09-19T15:32:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=37ebb54915dc42944f6ae92fe53b9531c3903801'/>
<id>urn:sha1:37ebb54915dc42944f6ae92fe53b9531c3903801</id>
<content type='text'>
USB hub has started to use a workqueue instead of kthread. Let's update
the documentation and comments here and there.

This patch mostly just replaces "khubd" with "hub_wq". There are only few
exceptions where the whole sentence was updated. These more complicated
changes can be found in the following files:

	   Documentation/usb/hotplug.txt
	   drivers/net/usb/usbnet.c
	   drivers/usb/core/hcd.c
	   drivers/usb/host/ohci-hcd.c
	   drivers/usb/host/xhci.c

Signed-off-by: Petr Mladek &lt;pmladek@suse.cz&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usbtest: Add interrupt EP testcases</title>
<updated>2014-08-29T20:51:11Z</updated>
<author>
<name>Amit Virdi</name>
<email>amit.virdi@st.com</email>
</author>
<published>2014-08-22T09:06:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=457a0955e152ac3b0de46ecbe7a8b434856fda67'/>
<id>urn:sha1:457a0955e152ac3b0de46ecbe7a8b434856fda67</id>
<content type='text'>
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 --&gt; 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 &lt;amit.virdi@st.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
</entry>
</feed>
