This message is from the T13 list server.
Hale L: > Hale Landis ... > The host MUST ... Hale, I wish you would feel heard when you say MUST and I reply SHOULD ... ... at least until and unless you can offer a competing interpretation of that OLD actual T13 specification I've quoted repeatedly to no reply that flatly _requires_ an AtapiPio device to help the host check for agreement over direction and to count pad bytes: )) Revision 18 )) 19 August 1998 )) ... )) Ata/Atapi 4 ... )) 8.21 PACKET ... A0h ... )) 8.21.5 Normal outputs ... )) 8.21.5.2 Data transmission ... )) ... )) 5) if the byte count is odd, the last valid byte transferred is )) on DD[7:0] and the data on DD[15:8] is a pad byte of )) undefined vaue; )) 6) if the last transfer of a command has a pad byte, the byte )) count shall be odd. )) ... )) I/O - Shall be cleared to zero if the transfer is to the device. )) Shall be set to one if the transfer is to the host. > > > Jim McGrath ... > > > ... the host software must crack the CDB > > > ... You contend that the host software can avoid that. > > > Yes and no. > > Pat LaVarre ... > > When the host & the device do agree > > over how many bytes to copy which way, > > life is delightfully simple. > Hale Landis ... > > OK, I'll say YES, even though this really > has nothing to do with the ATA interface. > > Yes, the thing we call the ATA "host" > MUST understand what its command is about to do > because the command is the only information > the device gets from that host. This is bad logic? This says what is must be sufficient. Not so. What is is, yes of course, but it may or may not be sufficient for a particular purpose. > Does this mean the host must "crack" the CDB? > Yes, No, Maybe, because we all know > that inside the host software and hardware > there can be many ways to communicate > what operation the CDB intends to perform. Yes. The whole command is not merely the Cdb, but also includes how many bytes the host asks to copy which way. > The host MUST ... Can we agree: The device decides, from the Cdb alone, how many bytes of Data to ask to copy which way. What's missing from the Cdb is any plain indication of how many bytes of Data the host has asked to copy which way. Scsi-over-Ide (aka Atapi) sends the device only the Cdb. Scsi-over-1394 and Scsi-over-Usb are both here significantly less secretive: both of those tell the device how many bytes the host asked to copy which way as soon as they tell the device what the Cdb is. > The host MUST understand what the device > will want to do: which direction > the data transfer is if there is data transfer, Not in AtapiPio. In AtapiPio, the host waits for an INTRQ after CommandOut no matter whether it is planning to copy data or not. Maybe the next INTRQ will report BSY DRQ C/D 0 1 d, maybe it will report BSY DRQ C/D I/O = 0 0 c i, either way the host waits for INTRQ. If indeed BSY DRQ C/D = 0 1 d, then the host can look also at I/O to see which way the device is asking to copy data. T13, in the portion of the spec quoted above, flatly requires every AtapiPio device to support this. > The host MUST understand what the device > will want to do: ... and exactly > how much data might be transferred. Not in AtapiPio. In AtapiPio, the host can copy as much data as fits, and then quit. If by then the device has reached the BSY DRQ C/D I/O = 0 0 c i state, then fine, the host can copy StatusIn and calculate the residue of bytes that would have fit but weren't copied. If not, then we have a "phase error" - commonly hosts timeout, reset, and retry. T13, in the portion of the spec quoted above, flatly requires every AtapiPio device to support this. > ... Why can we not agree that any host too rude to bother to crack the Cdb like the device may provoke a nonzero residue as large as X * 2 + 1. This fact is not in dispute? We just keep digressing into the silly claim that few such hosts exist. Can we not give AtapiDma devices a standard option for supporting such a rude host as robustly as we require AtapiPio devices to support such hosts, without losing time in arguing over how many or how few hosts actually are rude in this way? > how many or how few hosts I am saying in real life Microsoft actually does work this way. If that plain fact is in dispute, let's say that too. As needed, to develop T13 support to define an option to report bus residue accurate to the byte, I can invest further time & effort into making it more plain to more people that Microsoft does indeed work this way. That way all of us will know we're talking about making actual hosts work as well with AtapiDma devices as they work already with AtapiPio devices - a result which benefits all of us. > Microsoft I know Apple & Linux, like Microsoft pass down whole commands: not only the Cdb, but also a plain indication of how many bytes of Data the host has asked to copy which way. I'm working on gathering more persuasive evidence of how robustly they cope with nonzero residue and the rest of the thirteen cases. Pat LaVarre
