simtrace on Mac OSX

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/simtrace@lists.osmocom.org/.

Peter Stuge peter at stuge.se
Tue Oct 4 18:33:31 UTC 2011


Holger Hans Peter Freyther wrote:
> So 8.5.3.2 demands that if data.length is an exact multiple of
> wMaxPacketSize we need to send the ZPL.

It seems that this refers to control pipes other than the one
involving endpoint 0, which is often refered to as the default
control pipe. (It is mandatory by spec and endpoint 0 does not have
an endpoint descriptor, so there is no wMaxPacketSize for endpoint 0.
(See 9.6.6)

For endpoint 0 this is instead stored in bMaxPacketSize0 in the
device descriptor.

Also, is data.length the length of the requested data, or is it the
length that was requested? Note the difference. The requested data is
e.g. the device descriptor. A device descriptor is always 18 bytes.
(See 9.6.1)


> And 9.4.3
> The wLength field specifies the number of bytes to return. If the
> descriptor is longer than the wLength field, only the initial bytes
> of the descriptor are returned.

This is the case we hit on Mac OS. Since the requested data is longer
(18) than the requested length (8) we must send no ZLP, only the
first 8 bytes.

Mac OS should follow up with another request for more data.


> If the descriptor is shorter than the wLength field, the device
> indicates the end of the control transfer by sending a short packet
> when further data is requested.

This case is what we hit on Windows, where 64 bytes are requested.


> A short packet is defined as a packet shorter than the maximum
> payload size or a zero length data packet (refer to Chapter 5).

So for Windows we must also not send ZLP, because 18 bytes is already
shorter than 64. Returning 18 bytes is sufficient to say that no more
data is coming.


> How to put this together? I will try to tomorrow.

> So as Peter points out we should not send a ZPL if we sent wLength
> byte but it also happens to be a multiple of wMaxPacketSize?

Compare length of the descriptor with requested number of bytes. Only
when more bytes are requested than the descriptor is long *and* when
the descriptor is a multiple of the max packet size (bMaxPacketSize0
for ep0, wMaxPacketSize for the ep in the ep descriptor) then send ZLP.


//Peter




More information about the simtrace mailing list