Google
  Web www.spinics.net

usbtest and pattern=1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Hi,

I am trying to use usbtest and g_zero to do some device driver test 
(http://www.linux-usb.org/usbtest/).

I have some question about usbtest and g_zero with pattern=1.


pattern=1 imply mod63 test and the buffer received. This allow to catch 
case were we lose packet.

* But when the test start, on the host set_altsetting will be called. 
This will on the device call zero_set_config which will do a :
- zero_reset_config (do usb_ep_disable)
- set_source_sink_config (do usb_ep_enable & usb_ep_queue)

But most gadget drivers flush their fifo on usb_ep_enable or when there 
is nothing in the queue.
So if on the host we send data on the bulk endpoint after the 
set_altsetting but the device isn't fast enough, the usb_ep_enable & 
usb_ep_queue won't be done and we can lose packet due to the flush.

How the sync between host and device is supposed to work ?
Is ok for device driver to do flush on usb_ep_enable ?



* Also with pattern mode there need to be a sync between host and device 
and sending several packets [1]. So this mean in this mode we should 
either make sure there is short packet or either choose a correct buflen 
for g_zero ?


* Is there some tests that use loopback mode of g_zero ?


Thanks,

Matthieu CASTET

[1]
         /* mod63 stays in sync with short-terminated transfers,
          * or otherwise when host and gadget agree on how large
          * each usb transfer request should be.  resync is done
          * with set_interface or set_config.
          */

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
linux-usb-devel@xxxxxxxxxxxxxxxxxxxxx
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

[Home]     [Video for Linux]     [Photo]     [Yosemite Forum]     [Yosemite Photos]    [Video Projectors]     [PDAs]     [Hacking TiVo]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Devices]     [Big List of Linux Books]     [Free Dating]

  Powered by Linux