From owner-svn-src-all@FreeBSD.ORG Thu Dec 22 18:24:42 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2A221065675; Thu, 22 Dec 2011 18:24:42 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 85E068FC19; Thu, 22 Dec 2011 18:24:41 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id UAA20092; Thu, 22 Dec 2011 20:24:39 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1RdnJn-00009J-Di; Thu, 22 Dec 2011 20:24:39 +0200 Message-ID: <4EF375E5.2010809@FreeBSD.org> Date: Thu, 22 Dec 2011 20:24:37 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:8.0) Gecko/20111206 Thunderbird/8.0 MIME-Version: 1.0 To: Alexander Motin References: <201112221640.pBMGeZod025237@svn.freebsd.org> In-Reply-To: <201112221640.pBMGeZod025237@svn.freebsd.org> X-Enigmail-Version: undefined Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r228808 - head/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Dec 2011 18:24:42 -0000 on 22/12/2011 18:40 Alexander Motin said the following: > Author: mav > Date: Thu Dec 22 16:40:35 2011 > New Revision: 228808 > URL: http://svn.freebsd.org/changeset/base/228808 > > Log: > Make cd driver to handle Audio CDs, reporting their 2352 bytes sectors to > GEOM and using READ CD command for reading data, same as acd driver does. > Audio CDs identified by checking respective bit of the control field of > the first track in TOC. > > This fixes bunch of error messages during boot (GEOM taste) with Audio CD > inserted and allows to grab Audio CD image using just dd. Thank you! What about CDs with mixed audio and data tracks? I don't ask for any support, just curious if our users could run into any troubles with those. > MFC after: 1 month > > Modified: > head/sys/cam/scsi/scsi_all.h > head/sys/cam/scsi/scsi_cd.c > > Modified: head/sys/cam/scsi/scsi_all.h > ============================================================================== > --- head/sys/cam/scsi/scsi_all.h Thu Dec 22 16:36:08 2011 (r228807) > +++ head/sys/cam/scsi/scsi_all.h Thu Dec 22 16:40:35 2011 (r228808) > @@ -932,6 +932,7 @@ struct ata_pass_16 { > #define WRITE_12 0xAA > #define WRITE_VERIFY_12 0xAE > #define READ_ELEMENT_STATUS 0xB8 > +#define READ_CD 0xBE > > /* Maintenance In Service Action Codes */ > #define REPORT_IDENTIFYING_INFRMATION 0x05 > > Modified: head/sys/cam/scsi/scsi_cd.c > ============================================================================== > --- head/sys/cam/scsi/scsi_cd.c Thu Dec 22 16:36:08 2011 (r228807) > +++ head/sys/cam/scsi/scsi_cd.c Thu Dec 22 16:40:35 2011 (r228808) > @@ -1483,6 +1483,11 @@ cdstart(struct cam_periph *periph, union > /* dxfer_len */ bp->bio_bcount, > /* sense_len */ SSD_FULL_SIZE, > /* timeout */ 30000); > + /* Use READ CD command for audio tracks. */ > + if (softc->params.blksize == 2352) { > + start_ccb->csio.cdb_io.cdb_bytes[0] = READ_CD; > + start_ccb->csio.cdb_io.cdb_bytes[9] = 0xf8; > + } > start_ccb->ccb_h.ccb_state = CD_CCB_BUFFER_IO; > > > @@ -2880,6 +2885,13 @@ cdcheckmedia(struct cam_periph *periph) > > softc->flags |= CD_FLAG_VALID_TOC; > > + /* If the first track is audio, correct sector size. */ > + if ((softc->toc.entries[0].control & 4) == 0) { > + softc->disk->d_sectorsize = softc->params.blksize = 2352; > + softc->disk->d_mediasize = > + (off_t)softc->params.blksize * softc->params.disksize; > + } > + > bailout: > > /* -- Andriy Gapon