This message is from the T13 list server.
> "Mcgrath, Jim" <[EMAIL PROTECTED]> 12/06/01 05:52PM
> Do We Get Odd byte Transfers?
The nearer you are to stuff that ships new from an OEM of a Win95 PC, the less often
you see odd byte transfers. Win95B Pio choked over odd byte transfers, so Wintel
people then worked them to make them rare.
I hear Win98 fixed this, so since then Wintel has not been discouraging odd byte
transfers. I'm not clear why Win98 fixed this.
I'm slow to assert Microsoft must know of odd byte transfers that were common then:
surely it could be that someone at Microsoft just discovered they were out of spec and
fixed their AtapiPio code on principle?
In bus traces, the bug looked small: looked like some code thought
( R + 1 ) / 2 == R / 2
but of course in fatc this holds for integral division only if R is even.
> Do We Get [non-whole-block residue]?
Who is We? Maybe the issue here is not so much accurate byte counts on a Wintel
platform as it is trying to keep byte counts accurate even as we plug 'n play ...
... out beyond just the latest Windows,
... out into the installed base of Windows,
... out even into the world beyond Windows.
> Do We Get [non-whole-block residue]?
Yes.
Maybe your experience agrees with mine to say the x12 0 0 0 FF 0 form of Inquiry
up-to-xFF-bytes is common? Any device whose Inquiry data happens to be N will respond
with byte count N, for whatever N is, provided N <= xFF. (Interestingly enough, xFF
is odd.)
> who is sending these commands
> for 5 bytes of returned INQUIRY data?
Who exactly now? I don't exactly know.
Last bus trace I saw specifically of an odd-byte Inquiry causing a plug 'm play
failure was summer 2001 with an Apple host, but I was never informed precisely which
layer of software written by whom in Apple composed the x 12 0 0 0 05 0 cb in question.
Maybe all OS X generic UsbMass traffic includes such a command? I dunno. I've heard,
less clearly, that Linux likes this form of Inquiry also. I dunno.
> who is sending these commands
> for 5 bytes of returned INQUIRY data?
Who in general?
People who compose Scsi commands who dislike tolerating nonzero residue more than they
dislike stuttering commands to eliminate it.
> dislike tolerating nonzero residue
Scsi has a number of commands that move arbitrary counts of data in by first moving in
a well-known header that ends with an "additional length".
Any time the length of this data is constant, a host can move it in without tolerating
positive residue:
1. The host fetches first just the well-known header of well-known length.
2: The host examines the "additional length".
3: The host calculates the total length.
4: The host then reissues the command changed just to request the total length.
The design tradeoff here is KeepItSimpleStupid vs. don't assume byte counts are
correct. To stutter a command to avoid positive residue is common, but not ubiquitous.
I know of a device that shipped in the millions with its additional-byte-length
off-by-one for the optional Scsi command op x5A ModeSense(10). Hosts that had to talk
without tolerating positive residue had to instead use the standard Scsi command op
x1A ModeSense(10).
> To stutter a command to avoid positive residue
Stuttering the command works ONLY if the data length is constant or growing. I've
seen connections choke over positive residue in x37 ReadDefect when an apparent defect
unexpectedly looks ok on second glance.
> To stutter a command to avoid positive residue
Stuttering the command works ONLY if the data is persistent.
If you're moving op x03 RequestSense data, all of which clears when you read some or
all of it, you cannot avoid positive residue unless you're willing to move less than
all of the data.
Less people appreciate this than understand much of Scsi: most folk work above an
"auto sensing" layer that constructs their op x03 RequestSense commands for them.
> Since 1993 with SCSI-2,
> the standard INQUIRY data length has been 36 bytes.
Aye. Wintel favours 36 = x24.
The word "since" is key here. Rather than tracking down which length got introduced
into which standard when, some programmers choose to ask first for nothing but the
header up to and including the additional length field.
> To stutter a command to avoid positive residue
Issuing any op x12 Inquiry command other than x 12 0 0 0 24 0 or any op x03
RequestSense command other than x 03 0 0 0 12 0 is "rude", in the sent that Wintel
hosts commonly don't and so the command is unlikely to have been tested much.
Pat LaVarre
Subscribe/Unsubscribe instructions can be found at www.t13.org.