Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Feb 2010 12:09:43 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r203522 - stable/8/sys/dev/ata/chipsets
Message-ID:  <201002051209.o15C9hjH032812@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Fri Feb  5 12:09:43 2010
New Revision: 203522
URL: http://svn.freebsd.org/changeset/base/203522

Log:
  MFC r203034:
  Restore SATA speed reporting, broken by ATA_CAM changes.

Modified:
  stable/8/sys/dev/ata/chipsets/ata-promise.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/ata/chipsets/ata-promise.c
==============================================================================
--- stable/8/sys/dev/ata/chipsets/ata-promise.c	Fri Feb  5 12:07:53 2010	(r203521)
+++ stable/8/sys/dev/ata/chipsets/ata-promise.c	Fri Feb  5 12:09:43 2010	(r203522)
@@ -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)
 {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201002051209.o15C9hjH032812>