An ack to IN request with 0 byte.

As we know , Host hopes to receive data from device by sending IN request. and device will NAK it if no data is sent .
My question is what will happen to Host if device ACKes to it with 0 byte data.

Sorry, but I flunked Mind reading 101 in college.

You REALLY don’t provide an awful lot of information. Is this USB? The criticality of number of bytes in an ACK/NAK sequence depends a lot on what your device is and what protocol that device is using. If your asking a USB question then maybe IN will clue a USB developer to provide some kind of answer, but I suspect you will still need to provide more information.

Gary Little
H (952) 223-1349
C (952) 454-4629
xxxxx@comcast.net

On Mar 20, 2012, at 8:40 AM, xiedong_sl@126.com wrote:

As we know , Host hopes to receive data from device by sending IN request. and device will NAK it if no data is sent .
My question is what will happen to Host if device ACKes to it with 0 byte data.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

When a device returns a short packet (including zero length), the current request in the host controller completes.

xiedong_sl@126.com wrote:

As we know , Host hopes to receive data from device by sending IN request. and device will NAK it if no data is sent.
My question is what will happen to Host if device ACKes to it with 0 byte data.

It is a successful response. The request will be completed, and the
IoStatus.Information field set to 0. It’s up to the client driver to
decide what to do with that.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Thanks.

That’s saying , NAK to IN request has little difference with ACK with 0 bytes except the subsequent behaviours of Client drivers.

Actually, you don’t need to be a mind reader. The answer is simple:
whatever your driver is supposed to do when it sees an ACK with zero
bytes! You write the code to do whatever you want it to do! You are even
free to treat it the same way you would treat a NAK. (repeat this mantra:
It’s just code).
joe

Sorry, but I flunked Mind reading 101 in college.

You REALLY don’t provide an awful lot of information. Is this USB? The
criticality of number of bytes in an ACK/NAK sequence depends a lot on
what your device is and what protocol that device is using. If your asking
a USB question then maybe IN will clue a USB developer to provide some
kind of answer, but I suspect you will still need to provide more
information.

Gary Little
H (952) 223-1349
C (952) 454-4629
xxxxx@comcast.net

On Mar 20, 2012, at 8:40 AM, xiedong_sl@126.com wrote:

> As we know , Host hopes to receive data from device by sending IN
> request. and device will NAK it if no data is sent .
> My question is what will happen to Host if device ACKes to it with 0
> byte data.
>
>
>
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

See my earlier reply: whatever the driver writer wants it to do! It can
make perfect sense to ACK with zero bytes; many existing devices not only
do exactly this, but the ReadFile completes successfully with zero bytes
(which could be confused with EOF, which is why many libraries do not
support general devices in streams).
joe

As we know , Host hopes to receive data from device by sending IN request.
and device will NAK it if no data is sent .
My question is what will happen to Host if device ACKes to it with 0 byte
data.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

> make perfect sense to ACK with zero bytes; many existing devices not only

do exactly this, but the ReadFile completes successfully with zero bytes

IIRC zero-length or short USB packet leads to immediate completion of a pending read IRP, even if its buffer is not fully filled.

This is like TCP’s PSH flag.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com