Comtrol eCos User Manual

Page 721

Advertising
background image

Testing

endpoint will not be listed. When usbhost first contacts the usbtarget program running on the target platform, it
obtains this information and makes it available to test scripts via Tcl variables:

bulk_in_endpoints

This is a simple list of the endpoints which can support bulk IN transfers. For example if the target-side

hardware supports these transfers on endpoints 3 and 5 then the value would be

"3 5"

Typical test scripts

would iterate over the list using something like:

if { 0 != [llength $usbtest::bulk_in_endpoints] } {

puts"Bulk IN endpoints: $usbtest::bulk_in_endpoints"

foreach endpoint $usbtest:bulk_in_endpoints {

...

}

}

bulk_in()

This array holds additional information about each bulk IN endpoint. The array is indexed by two fields, the

endpoint number and one of

min_size

,

max_size

,

max_in_padding

and

devtab

:

min_size

This field specifies a lower bound on the size of bulk transfers, and will typically will have a value of 1.

Note: The typical minimum transfer size of a single byte is not strictly speaking correct, since un-
der some circumstances it can make sense to have a transfer size of zero bytes. However current
target-side device drivers interpret a request to transfer zero bytes as a way for higher-level code to
determine whether or not an endpoint is stalled, so it is not actually possible to perform zero-byte
transfers. This issue will be addressed at some future point.

max_size

This field specifies an upper bound on the size of bulk transfers. Some target-side drivers may be limited

to transfers of say 0x0FFFF bytes because of hardware limitations. In practice the transfer size is likely to
be limited primarily to limit memory consumption of the test code on the target hardware, and to ensure
that tests complete reasonably quickly. At the time of writing transfers are limited to 4K.

max_in_padding

On some hardware it may be necessary for the target-side device driver to send more data than is

actually intended. For example the SA11x0 USB hardware cannot perform bulk transfers that are an
exact multiple of 64 bytes, instead it must pad such transfers with an extra byte and the host must be
ready to accept and discard this byte. The

max_in_padding

field indicates the amount of padding that

is required. The low-level code inside usbhost will use this field automatically, and there is no need for
test scripts to adjust packet sizes for padding. The field is provided for informational purposes only.

617

Advertising