Re: About zero-length packet design for EHCI

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

 



On Wed, Jul 1, 2015 at 11:00 PM, Peter Chen <peter.chen@xxxxxxxxxxxxx> wrote:
> If "one" is "multiple"?
> The wLength at setup packet is 64 bytes, Maximum Packet Length at
> dQH is 64 bytes, and the Total Bytes at dTD is 64 bytes too, does device
> must prepare a zero-length packet?
>
> I would like to double confirm it since the iPhone (As host after HNP)
> can't work well with it if I have a zero-length packet after 64 bytes packet
> which I describe above, if without zero-length packet, the iPhone works well.
>
>> The host hardware will recognize when this happens, because the HCD
>> will set the appropriate bits in the data-stage qTD.  For example, with
>> EHCI the HCD will set the Alternate Next qTD Pointer.  Or with UHCI,
>> the HCD will set the SPD (Short Packet Detect) bit.
>>
>
> I see it in the code, but it is a null pointer (EHCI_LIST_END), does it
> mean one qTD (with valid Next qTD Pointer) can handle one 64 byte packet
> with or without zero-length packet well both?
>
> Any reasons why iPhone can't handle zero-length packet well?
>
>> But the HCD should never prepare a zero-length qTD for an IN transfer.
>> Zero-length packets are the responsibility of the _sender_, and for IN
>> transfers the sender is the peripheral, not the host.

I can't speak about the details of the ehci driver. But for this issue
we can speak about sender and receiver, Host and gadget both send and
receive during transfers.

If the protocol does not specify a transfer length, then the sender
MUST send a zlt if the transfer is less than expected and a multiple
(1*, 2*, 3*....) of maxpacketsize.

If the protocol does specify a transfer length, then exactly that
length should be sent and received with NO ZLT. For example USB mass
storage sends multiples of maxpacketsize but does not send ZLTs.

If you do an analyzer trace between windows and your gadget, then you
can see what those guys think the rules for your protocol are.


Regards, Steve
--
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