From owner-svn-src-all@FreeBSD.ORG Tue Jan 26 16:18:45 2010 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 BB53D1065672; Tue, 26 Jan 2010 16:18:45 +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 925518FC16; Tue, 26 Jan 2010 16:18:45 +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 o0QGIjm1039849; Tue, 26 Jan 2010 16:18:45 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0QGIjAR039847; Tue, 26 Jan 2010 16:18:45 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201001261618.o0QGIjAR039847@svn.freebsd.org> From: Alexander Motin Date: Tue, 26 Jan 2010 16:18:45 +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: r203034 - head/sys/dev/ata/chipsets 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: Tue, 26 Jan 2010 16:18:45 -0000 Author: mav Date: Tue Jan 26 16:18:45 2010 New Revision: 203034 URL: http://svn.freebsd.org/changeset/base/203034 Log: Restore SATA speed reporting, broken by ATA_CAM changes. Modified: head/sys/dev/ata/chipsets/ata-promise.c Modified: head/sys/dev/ata/chipsets/ata-promise.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-promise.c Tue Jan 26 16:05:49 2010 (r203033) +++ head/sys/dev/ata/chipsets/ata-promise.c Tue Jan 26 16:18:45 2010 (r203034) @@ -73,6 +73,7 @@ static u_int32_t ata_promise_mio_softres static void ata_promise_mio_dmainit(device_t dev); static void ata_promise_mio_setprd(void *xsc, bus_dma_segment_t *segs, int nsegs, int error); static int ata_promise_mio_setmode(device_t dev, int target, int mode); +static int ata_promise_mio_getrev(device_t dev, int target); static void ata_promise_sx4_intr(void *data); static int ata_promise_sx4_command(struct ata_request *request); static int ata_promise_apkt(u_int8_t *bytep, struct ata_request *request); @@ -341,6 +342,7 @@ sataii: ctlr->ch_detach = ata_promise_mio_ch_detach; ctlr->reset = ata_promise_mio_reset; ctlr->setmode = ata_promise_mio_setmode; + ctlr->getrev = ata_promise_mio_getrev; return 0; } @@ -999,7 +1001,7 @@ ata_promise_mio_setmode(device_t dev, in if ( (ctlr->chip->cfg2 == PR_SATA) || ((ctlr->chip->cfg2 == PR_CMBO) && (ch->unit < 2)) || - (ctlr->chip->cfg2 == PR_SATA2) || + (ctlr->chip->cfg2 == PR_SATA2) || ((ctlr->chip->cfg2 == PR_CMBO2) && (ch->unit < 2))) mode = ata_sata_setmode(dev, target, mode); else @@ -1007,6 +1009,21 @@ ata_promise_mio_setmode(device_t dev, in return (mode); } +static int +ata_promise_mio_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->chip->cfg2 == PR_SATA) || + ((ctlr->chip->cfg2 == PR_CMBO) && (ch->unit < 2)) || + (ctlr->chip->cfg2 == PR_SATA2) || + ((ctlr->chip->cfg2 == PR_CMBO2) && (ch->unit < 2))) + return (ata_sata_getrev(dev, target)); + else + return (0); +} + static void ata_promise_sx4_intr(void *data) {