atapicam and residual byte counts

Dan Strick strick at covad.net
Mon Dec 15 13:12:48 PST 2003


While hacking on an ATAPI CD-drive via atapicam, I noticed that the
returned data transfer counts for all data input operations (e.g.
mode sense) were too high.  In fact, they were all equal to the
input buffer sizes.  A little hacking revealed that the residual
byte counts in the CAM CCB for scsi i/o operations were always coming
back zero.  I did a little test by placing known data in the back
end of the input buffer before the input operation and observed that
it wasn't being overwritten even though the CAM system claimed the
entire buffer was being filled.

Then I repeated the tests on a real SCSI drive on a real SCSI host
adapter and observed that the residual byte counts in the CAM CCBs
were coming back nonzero when this was appropriate.

Not knowing the actual transfer length for a data transfer presents
a little bit of a challenge.  Is atapicam broken?  I am running
FreeBSD 4.9-Release.

Dan Strick
strick at covad.net


More information about the freebsd-hackers mailing list