This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: AT91 USB driver sending empty packet


Hi Frank,

Just a couple of comments (see below)...

Frank Pagliughi wrote:

>    When a bulk IRP involves more data than can fit in one maximum-sized
>    data payload, all data payloads are required to be maximum size
>    except for the last data payload, which will
>    contain the remaining data. A bulk transfer is complete when the
>    endpoint does one of the following:
>    • Has transferred exactly the amount of data expected

I think that this is the catch - comms style class drivers which have to
deal with variable length packets tend to assume that the amount of data
expected is undefined (ie, infinite) and therefore fall through to the
following termination condition.

>    • Transfers a packet with a payload size less than wMaxPacketSize or
>    transfers a zero-length packet

However, if you have a block device where the amount of data expected is
well defined, the zero length packet would not be required.

> So, technically, a higher level piece of code /could/ decide that all
> data was transferred, but it's usually difficult for a low-level driver
> to have this knowledge. 

Exactly.  For my sins I'm busy writing a Windows USB driver at the
moment, where it is the responsibility of the class driver code to
specify whether a given USB pipe should use zero length packet
termination or not.  Linux is similarly configurable on a per-pipe
basis.  However, I think that this is probably overkill for the low
level eCos device drivers, since in most cases I can think of you'd want
all bulk endpoints to have the same behaviour.

Chris.

-- 
Christopher J. Holgate

Thinking Of The Future @ Zynaptic Limited (www.zynaptic.com)

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]