Re: EHCI v OHCI for bulk OUT on transfer size boundary

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

 



On Sat, 9 May 2009, Richard Andrews wrote:

> > > The flag URB_ZERO_PACKET adds a ZLP if required, but
> > > the EHCI spec says that it will always do that anyway. I presume this
> > > is different to OHCI and UHCI (I don't have those specs).
> > 
> > It isn't different; you are somehow misinterpreting the EHCI spec.  
> > Where do you think it says that a ZLP will always be added?
> 
> EHCI v1.0 section 4.10.3 (Intel ehci-r10.pdf) [1]
> 
> "
> Note that the Total Bytes To Transfer field may be zero when all the
> other criteria for executing a transaction are met. When this occurs,
> the host controller will execute a zero-length transaction to the
> endpoint. If the PID_Code field indicates an IN transaction and the
> device delivers data, the host controller will detect a packet babble
> condition, set the babble and halted bits in the Status field, set the
> Active bit to a zero, write back the results to the source qTD, then
> exit this state.
> "
> 
> 
> To me the above indicates that a ZLP will be automatically sent by the
> hardware for a transaction ending on a boundary.

No; that's not what it means.  It means that the hardware will send a 
ZLP if the driver builds a qTD with a zero transfer length.

However if a transfer has nonzero length and is a multiple of the 
maxpacket length, then when the Total Bytes To Transfer field is
zero the other criteria for executing a transaction will _not_ be met.  
In particular, the Active bit in the QH won't be set.

This is because when the prior transfer completes (i.e., the transfer
which decreased the Total Bytes to Transfer down to zero), the hardware
clears the Active bit.  See, a little lower on the same page, the third
event on the list of things that will cause the host controller to
clear the Active bit in the queue head's overlay status field.

Since the Active bit is not set, the controller will avoid the Execute 
Transaction state and go directly to the Advance Queue state (referring 
to the diagram in Figure 4-14).

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux