From owner-freebsd-current@FreeBSD.ORG Tue Apr 29 17:40:31 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 18BC137B404; Tue, 29 Apr 2003 17:40:31 -0700 (PDT) Received: from panzer.kdm.org (panzer.kdm.org [216.160.178.169]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0C7DF43FB1; Tue, 29 Apr 2003 17:40:30 -0700 (PDT) (envelope-from ken@panzer.kdm.org) Received: from panzer.kdm.org (localhost [127.0.0.1]) by panzer.kdm.org (8.12.9/8.12.5) with ESMTP id h3U0eTPM099465; Tue, 29 Apr 2003 18:40:29 -0600 (MDT) (envelope-from ken@panzer.kdm.org) Received: (from ken@localhost) by panzer.kdm.org (8.12.9/8.12.5/Submit) id h3U0eT6M099464; Tue, 29 Apr 2003 18:40:29 -0600 (MDT) (envelope-from ken) Date: Tue, 29 Apr 2003 18:40:29 -0600 From: "Kenneth D. Merry" To: scsi@FreeBSD.org Message-ID: <20030429184028.A99420@panzer.kdm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i cc: current@FreeBSD.org Subject: HEADS UP: CAM API change, 2TB device support X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2003 00:40:31 -0000 I have checked in the patches I sent out on Sunday. We now have (untested) support for devices larger than 2TB in CAM. There should be no effect on devices smaller than 2TB. There are some API changes that went along with this change, so you'll need to recompile any applications that talk to pass(4) or xpt(4). (camcontrol, cdrecord, xmcd, cdda2wav, etc.) Let me know if you run into any problems with this change. If you've got an array that is larger than 2TB, please try these changes out and let me know how they work. Ken ----- Forwarded message from "Kenneth D. Merry" ----- From: "Kenneth D. Merry" Date: Tue, 29 Apr 2003 17:35:22 -0700 (PDT) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/cam cam_ccb.h src/sys/cam/scsi scsi_all.c scsi_all.h scsi_da.c ken 2003/04/29 17:35:22 PDT FreeBSD src repository Modified files: sys/cam cam_ccb.h sys/cam/scsi scsi_all.c scsi_all.h scsi_da.c Log: Add support to CAM for devices with more than 2^32 blocks. (2TB if you're using 512 byte blocks). cam_ccb.h: Bump up volume_size and cylinders in ccb_calc_geometry to 64 bits and 32 bits respectively, so we can hold larger device sizes. cylinders would overflow at about 500GB. Bump CAM_VERSION for this change. Note that this will require a recompile of all applications that talk to the pass(4) driver. scsi_all.c: Add descriptions for READ/WRITE(16), update READ/WRITE(12) descriptions, add descriptions for SERVICE ACTION IN/OUT. Add a new function, scsi_read_capacity_16(), that issues the read capacity service action. (Necessary for arrays larger than 2^32 sectors.) Update scsi_read_write() to use a 64 bit LBA and issue READ(16) or WRITE(16) if necessary. NOTE the API change. This should be largely transparnet to most userland applications at compile time, but will break binary compatibility. The CAM_VERSION bump, above, also serves the purpose of forcing a recompile for any applications that talk to CAM. scsi_all.h: Add 16 byte READ/WRITE structures, structures for 16 byte READ CAPACITY/SERVICE ACTION IN. Add scsi_u64to8b() and scsi_8btou64. scsi_da.c: The da(4) driver probe now has two stages for devices larger than 2TB. If a standard READ CAPACITY(10) returns 0xffffffff, we issue the 16 byte version of read capacity to determine the true array capacity. We also do the same thing in daopen() -- use the 16 byte read capacity if the device is large enough. The sysctl/loader code has also been updated to accept 16 bytes as a minimum command size. Revision Changes Path 1.24 +3 -3 src/sys/cam/cam_ccb.h 1.40 +68 -14 src/sys/cam/scsi/scsi_all.c 1.23 +82 -6 src/sys/cam/scsi/scsi_all.h 1.139 +194 -65 src/sys/cam/scsi/scsi_da.c ----- End forwarded message ----- -- Kenneth Merry ken@kdm.org