From owner-freebsd-hackers@FreeBSD.ORG Mon Dec 15 13:12:48 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0EEAE16A4CE for ; Mon, 15 Dec 2003 13:12:48 -0800 (PST) Received: from smtp.covadmail.net (mx05.covadmail.net [63.65.120.65]) by mx1.FreeBSD.org (Postfix) with SMTP id 7D4D943D55 for ; Mon, 15 Dec 2003 13:12:45 -0800 (PST) (envelope-from strick@covad.net) Received: (covad.net 11021 invoked from network); 15 Dec 2003 21:12:40 -0000 Received: from unknown (HELO mist.nodomain) (67.101.100.52) by sun-qmail08 with SMTP; 15 Dec 2003 21:12:39 -0000 Received: from mist.nodomain (localhost [127.0.0.1]) by mist.nodomain (8.12.9p2/8.12.9) with ESMTP id hBFLCKlM000350; Mon, 15 Dec 2003 13:12:20 -0800 (PST) (envelope-from dan@mist.nodomain) Received: (from dan@localhost) by mist.nodomain (8.12.9p2/8.12.9/Submit) id hBFLCJN0000349; Mon, 15 Dec 2003 13:12:19 -0800 (PST) (envelope-from dan) Date: Mon, 15 Dec 2003 13:12:19 -0800 (PST) From: Dan Strick Message-Id: <200312152112.hBFLCJN0000349@mist.nodomain> To: freebsd-hackers@freebsd.org cc: dan@mist.nodomain Subject: atapicam and residual byte counts X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2003 21:12:48 -0000 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@covad.net