From owner-svn-src-head@FreeBSD.ORG Mon Feb 22 10:45:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D26C1065670; Mon, 22 Feb 2010 10:45:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5BF808FC1C; Mon, 22 Feb 2010 10:45:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o1MAjfrM020479; Mon, 22 Feb 2010 10:45:41 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1MAjfTf020472; Mon, 22 Feb 2010 10:45:41 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201002221045.o1MAjfTf020472@svn.freebsd.org> From: Alexander Motin Date: Mon, 22 Feb 2010 10:45:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204195 - in head: sbin/atacontrol sbin/camcontrol sys/cam sys/dev/ata X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2010 10:45:41 -0000 Author: mav Date: Mon Feb 22 10:45:40 2010 New Revision: 204195 URL: http://svn.freebsd.org/changeset/base/204195 Log: Improve output for controllers that doesn't report SATA speed. Modified: head/sbin/atacontrol/atacontrol.c head/sbin/camcontrol/camcontrol.c head/sys/cam/cam_xpt.c head/sys/dev/ata/ata-all.c head/sys/dev/ata/ata-pci.c head/sys/dev/ata/ata-sata.c Modified: head/sbin/atacontrol/atacontrol.c ============================================================================== --- head/sbin/atacontrol/atacontrol.c Mon Feb 22 07:50:17 2010 (r204194) +++ head/sbin/atacontrol/atacontrol.c Mon Feb 22 10:45:40 2010 (r204195) @@ -72,6 +72,7 @@ satarev2str(int mode) case 1: return "SATA 1.5Gb/s"; case 2: return "SATA 3Gb/s"; case 3: return "SATA 6Gb/s"; + case 0xff: return "SATA"; default: return "???"; } } Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Mon Feb 22 07:50:17 2010 (r204194) +++ head/sbin/camcontrol/camcontrol.c Mon Feb 22 10:45:40 2010 (r204195) @@ -1022,6 +1022,8 @@ camxferrate(struct cam_device *device) printf(" ("); if (sata->valid & CTS_SATA_VALID_REVISION) printf("SATA %d.x, ", sata->revision); + else + printf("SATA, "); if (sata->valid & CTS_SATA_VALID_MODE) printf("%s, ", ata_mode2string(sata->mode)); if ((sata->valid & CTS_SATA_VALID_ATAPI) && sata->atapi != 0) Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Mon Feb 22 07:50:17 2010 (r204194) +++ head/sys/cam/cam_xpt.c Mon Feb 22 10:45:40 2010 (r204195) @@ -1219,6 +1219,8 @@ xpt_announce_periph(struct cam_periph *p printf(" ("); if (sata->valid & CTS_SATA_VALID_REVISION) printf("SATA %d.x, ", sata->revision); + else + printf("SATA, "); if (sata->valid & CTS_SATA_VALID_MODE) printf("%s, ", ata_mode2string(sata->mode)); if ((sata->valid & CTS_ATA_VALID_ATAPI) && sata->atapi != 0) Modified: head/sys/dev/ata/ata-all.c ============================================================================== --- head/sys/dev/ata/ata-all.c Mon Feb 22 07:50:17 2010 (r204194) +++ head/sys/dev/ata/ata-all.c Mon Feb 22 10:45:40 2010 (r204195) @@ -1160,6 +1160,7 @@ ata_satarev2str(int rev) case 1: return "SATA 1.5Gb/s"; case 2: return "SATA 3Gb/s"; case 3: return "SATA 6Gb/s"; + case 0xff: return "SATA"; default: return "???"; } } @@ -1536,6 +1537,7 @@ ataaction(struct cam_sim *sim, union ccb if (ch->flags & ATA_SATA) { cts->transport = XPORT_SATA; cts->transport_version = XPORT_VERSION_UNSPECIFIED; + cts->xport_specific.sata.valid = 0; cts->xport_specific.sata.mode = d->mode; cts->xport_specific.sata.valid |= CTS_SATA_VALID_MODE; cts->xport_specific.sata.bytecount = d->bytecount; @@ -1543,14 +1545,20 @@ ataaction(struct cam_sim *sim, union ccb if (cts->type == CTS_TYPE_CURRENT_SETTINGS) { cts->xport_specific.sata.revision = ATA_GETREV(dev, ccb->ccb_h.target_id); - } else + if (cts->xport_specific.sata.revision != 0xff) { + cts->xport_specific.sata.valid |= + CTS_SATA_VALID_REVISION; + } + } else { cts->xport_specific.sata.revision = d->revision; - cts->xport_specific.sata.valid |= CTS_SATA_VALID_REVISION; + cts->xport_specific.sata.valid |= CTS_SATA_VALID_REVISION; + } cts->xport_specific.sata.atapi = d->atapi; cts->xport_specific.sata.valid |= CTS_SATA_VALID_ATAPI; } else { cts->transport = XPORT_ATA; cts->transport_version = XPORT_VERSION_UNSPECIFIED; + cts->xport_specific.ata.valid = 0; cts->xport_specific.ata.mode = d->mode; cts->xport_specific.ata.valid |= CTS_ATA_VALID_MODE; cts->xport_specific.ata.bytecount = d->bytecount; Modified: head/sys/dev/ata/ata-pci.c ============================================================================== --- head/sys/dev/ata/ata-pci.c Mon Feb 22 07:50:17 2010 (r204194) +++ head/sys/dev/ata/ata-pci.c Mon Feb 22 10:45:40 2010 (r204195) @@ -714,10 +714,14 @@ static int ata_pcichannel_getrev(device_t dev, int target) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); + struct ata_channel *ch = device_get_softc(dev); - if (ctlr->getrev) - return (ctlr->getrev(dev, target)); - else + if (ch->flags & ATA_SATA) { + if (ctlr->getrev) + return (ctlr->getrev(dev, target)); + else + return (0xff); + } else return (0); } Modified: head/sys/dev/ata/ata-sata.c ============================================================================== --- head/sys/dev/ata/ata-sata.c Mon Feb 22 07:50:17 2010 (r204194) +++ head/sys/dev/ata/ata-sata.c Mon Feb 22 10:45:40 2010 (r204195) @@ -223,7 +223,7 @@ ata_sata_getrev(device_t dev, int target if (ch->r_io[ATA_SSTATUS].res) return ((ATA_IDX_INL(ch, ATA_SSTATUS) & 0x0f0) >> 4); - return (0); + return (0xff); } int