svn commit: r205815 - stable/8/sys/dev/aac

Ed Maste emaste at FreeBSD.org
Mon Mar 29 00:30:45 UTC 2010


Author: emaste
Date: Mon Mar 29 00:30:44 2010
New Revision: 205815
URL: http://svn.freebsd.org/changeset/base/205815

Log:
  MFC aac(4) driver changes
  
  r204019:
  
    Include command type in COMMAND TIMEOUT messages to aid in debugging.
  
  r203885:
  
    Diff reduction with Adaptec's vendor driver.
  
    Driver version 2.1.9 chosen as that Adaptec version roughly corresponds
    with the current feature set merged to the in-tree driver.
  
  r203801:
  
    Garbage collect Falcon/PPC support that has not been used in released
    products, based on discussion with Adaptec.
  
  r198617:
  
    Rename aac_srb32 to aac_srb, to match Adaptec's vendor driver.

Modified:
  stable/8/sys/dev/aac/aac.c
  stable/8/sys/dev/aac/aac_cam.c
  stable/8/sys/dev/aac/aac_pci.c
  stable/8/sys/dev/aac/aacreg.h
  stable/8/sys/dev/aac/aacvar.h
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/aac/aac.c
==============================================================================
--- stable/8/sys/dev/aac/aac.c	Mon Mar 29 00:23:46 2010	(r205814)
+++ stable/8/sys/dev/aac/aac.c	Mon Mar 29 00:30:44 2010	(r205815)
@@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$");
 /*
  * Driver for the Adaptec 'FSA' family of PCI/SCSI RAID adapters.
  */
-#define AAC_DRIVER_VERSION		0x02000000
 #define AAC_DRIVERNAME			"aac"
 
 #include "opt_aac.h"
@@ -107,28 +106,6 @@ static int	aac_dequeue_fib(struct aac_so
 static int	aac_enqueue_response(struct aac_softc *sc, int queue,
 				     struct aac_fib *fib);
 
-/* Falcon/PPC interface */
-static int	aac_fa_get_fwstatus(struct aac_softc *sc);
-static void	aac_fa_qnotify(struct aac_softc *sc, int qbit);
-static int	aac_fa_get_istatus(struct aac_softc *sc);
-static void	aac_fa_clear_istatus(struct aac_softc *sc, int mask);
-static void	aac_fa_set_mailbox(struct aac_softc *sc, u_int32_t command,
-				   u_int32_t arg0, u_int32_t arg1,
-				   u_int32_t arg2, u_int32_t arg3);
-static int	aac_fa_get_mailbox(struct aac_softc *sc, int mb);
-static void	aac_fa_set_interrupts(struct aac_softc *sc, int enable);
-
-struct aac_interface aac_fa_interface = {
-	aac_fa_get_fwstatus,
-	aac_fa_qnotify,
-	aac_fa_get_istatus,
-	aac_fa_clear_istatus,
-	aac_fa_set_mailbox,
-	aac_fa_get_mailbox,
-	aac_fa_set_interrupts,
-	NULL, NULL, NULL
-};
-
 /* StrongARM interface */
 static int	aac_sa_get_fwstatus(struct aac_softc *sc);
 static void	aac_sa_qnotify(struct aac_softc *sc, int qbit);
@@ -2374,8 +2351,9 @@ aac_timeout(struct aac_softc *sc)
 			/* && !(cm->cm_flags & AAC_CMD_TIMEDOUT) */) {
 			cm->cm_flags |= AAC_CMD_TIMEDOUT;
 			device_printf(sc->aac_dev,
-				      "COMMAND %p TIMEOUT AFTER %d SECONDS\n",
-				      cm, (int)(time_uptime-cm->cm_timestamp));
+			    "COMMAND %p (TYPE %d) TIMEOUT AFTER %d SECONDS\n",
+			    cm, cm->cm_fib->Header.Command,
+			    (int)(time_uptime-cm->cm_timestamp));
 			AAC_PRINT_FIB(sc, cm->cm_fib);
 			timedout++;
 		}
@@ -2416,17 +2394,6 @@ aac_rx_get_fwstatus(struct aac_softc *sc
 }
 
 static int
-aac_fa_get_fwstatus(struct aac_softc *sc)
-{
-	int val;
-
-	fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "");
-
-	val = AAC_MEM0_GETREG4(sc, AAC_FA_FWSTATUS);
-	return (val);
-}
-
-static int
 aac_rkt_get_fwstatus(struct aac_softc *sc)
 {
 	fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "");
@@ -2456,15 +2423,6 @@ aac_rx_qnotify(struct aac_softc *sc, int
 }
 
 static void
-aac_fa_qnotify(struct aac_softc *sc, int qbit)
-{
-	fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "");
-
-	AAC_MEM0_SETREG2(sc, AAC_FA_DOORBELL1, qbit);
-	AAC_FA_HACK(sc);
-}
-
-static void
 aac_rkt_qnotify(struct aac_softc *sc, int qbit)
 {
 	fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "");
@@ -2492,17 +2450,6 @@ aac_rx_get_istatus(struct aac_softc *sc)
 }
 
 static int
-aac_fa_get_istatus(struct aac_softc *sc)
-{
-	int val;
-
-	fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "");
-
-	val = AAC_MEM0_GETREG2(sc, AAC_FA_DOORBELL0);
-	return (val);
-}
-
-static int
 aac_rkt_get_istatus(struct aac_softc *sc)
 {
 	fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "");
@@ -2530,15 +2477,6 @@ aac_rx_clear_istatus(struct aac_softc *s
 }
 
 static void
-aac_fa_clear_istatus(struct aac_softc *sc, int mask)
-{
-	fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "");
-
-	AAC_MEM0_SETREG2(sc, AAC_FA_DOORBELL0_CLEAR, mask);
-	AAC_FA_HACK(sc);
-}
-
-static void
 aac_rkt_clear_istatus(struct aac_softc *sc, int mask)
 {
 	fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "");
@@ -2576,24 +2514,6 @@ aac_rx_set_mailbox(struct aac_softc *sc,
 }
 
 static void
-aac_fa_set_mailbox(struct aac_softc *sc, u_int32_t command,
-		u_int32_t arg0, u_int32_t arg1, u_int32_t arg2, u_int32_t arg3)
-{
-	fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "");
-
-	AAC_MEM1_SETREG4(sc, AAC_FA_MAILBOX, command);
-	AAC_FA_HACK(sc);
-	AAC_MEM1_SETREG4(sc, AAC_FA_MAILBOX + 4, arg0);
-	AAC_FA_HACK(sc);
-	AAC_MEM1_SETREG4(sc, AAC_FA_MAILBOX + 8, arg1);
-	AAC_FA_HACK(sc);
-	AAC_MEM1_SETREG4(sc, AAC_FA_MAILBOX + 12, arg2);
-	AAC_FA_HACK(sc);
-	AAC_MEM1_SETREG4(sc, AAC_FA_MAILBOX + 16, arg3);
-	AAC_FA_HACK(sc);
-}
-
-static void
 aac_rkt_set_mailbox(struct aac_softc *sc, u_int32_t command, u_int32_t arg0,
 		    u_int32_t arg1, u_int32_t arg2, u_int32_t arg3)
 {
@@ -2626,17 +2546,6 @@ aac_rx_get_mailbox(struct aac_softc *sc,
 }
 
 static int
-aac_fa_get_mailbox(struct aac_softc *sc, int mb)
-{
-	int val;
-
-	fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "");
-
-	val = AAC_MEM1_GETREG4(sc, AAC_FA_MAILBOX + (mb * 4));
-	return (val);
-}
-
-static int
 aac_rkt_get_mailbox(struct aac_softc *sc, int mb)
 {
 	fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "");
@@ -2675,20 +2584,6 @@ aac_rx_set_interrupts(struct aac_softc *
 }
 
 static void
-aac_fa_set_interrupts(struct aac_softc *sc, int enable)
-{
-	fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "%sable interrupts", enable ? "en" : "dis");
-
-	if (enable) {
-		AAC_MEM0_SETREG2((sc), AAC_FA_MASK0_CLEAR, AAC_DB_INTERRUPTS);
-		AAC_FA_HACK(sc);
-	} else {
-		AAC_MEM0_SETREG2((sc), AAC_FA_MASK0, ~0);
-		AAC_FA_HACK(sc);
-	}
-}
-
-static void
 aac_rkt_set_interrupts(struct aac_softc *sc, int enable)
 {
 	fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "%sable interrupts", enable ? "en" : "dis");
@@ -2871,10 +2766,8 @@ aac_describe_controller(struct aac_softc
 	}
 	device_printf(sc->aac_dev, "%s, aac driver %d.%d.%d-%d\n",
 		adapter_type,
-		AAC_DRIVER_VERSION >> 24,
-		(AAC_DRIVER_VERSION >> 16) & 0xFF,
-		AAC_DRIVER_VERSION & 0xFF,
-		AAC_DRIVER_BUILD);
+		AAC_DRIVER_MAJOR_VERSION, AAC_DRIVER_MINOR_VERSION,
+		AAC_DRIVER_BUGFIX_LEVEL, AAC_DRIVER_BUILD);
 
 	aac_release_sync_fib(sc);
 	mtx_unlock(&sc->aac_io_lock);
@@ -3359,10 +3252,16 @@ aac_rev_check(struct aac_softc *sc, cadd
 	 * Doctor up the response struct.
 	 */
 	rev_check_resp.possiblyCompatible = 1;
-	rev_check_resp.adapterSWRevision.external.ul =
-	    sc->aac_revision.external.ul;
+	rev_check_resp.adapterSWRevision.external.comp.major =
+	    AAC_DRIVER_MAJOR_VERSION;
+	rev_check_resp.adapterSWRevision.external.comp.minor =
+	    AAC_DRIVER_MINOR_VERSION;
+	rev_check_resp.adapterSWRevision.external.comp.type =
+	    AAC_DRIVER_TYPE;
+	rev_check_resp.adapterSWRevision.external.comp.dash =
+	    AAC_DRIVER_BUGFIX_LEVEL;
 	rev_check_resp.adapterSWRevision.buildNumber =
-	    sc->aac_revision.buildNumber;
+	    AAC_DRIVER_BUILD;
 
 	return(copyout((caddr_t)&rev_check_resp, udata,
 			sizeof(struct aac_rev_check_resp)));

Modified: stable/8/sys/dev/aac/aac_cam.c
==============================================================================
--- stable/8/sys/dev/aac/aac_cam.c	Mon Mar 29 00:23:46 2010	(r205814)
+++ stable/8/sys/dev/aac/aac_cam.c	Mon Mar 29 00:30:44 2010	(r205815)
@@ -211,7 +211,7 @@ aac_cam_action(struct cam_sim *sim, unio
 {
 	struct	aac_cam *camsc;
 	struct	aac_softc *sc;
-	struct	aac_srb32 *srb;
+	struct	aac_srb *srb;
 	struct	aac_fib *fib;
 	struct	aac_command *cm;
 
@@ -354,7 +354,7 @@ aac_cam_action(struct cam_sim *sim, unio
 	}
 
 	fib = cm->cm_fib;
-	srb = (struct aac_srb32 *)&fib->data[0];
+	srb = (struct aac_srb *)&fib->data[0];
 	cm->cm_datalen = 0;
 
 	switch (ccb->ccb_h.flags & CAM_DIR_MASK) {
@@ -405,10 +405,10 @@ aac_cam_action(struct cam_sim *sim, unio
 				if (ccb->ccb_h.flags & CAM_DATA_PHYS) {
 					/* Send a 32bit command */
 					fib->Header.Command = ScsiPortCommand;
-					srb->sg_map32.SgCount = 1;
-					srb->sg_map32.SgEntry[0].SgAddress =
+					srb->sg_map.SgCount = 1;
+					srb->sg_map.SgEntry[0].SgAddress =
 					    (uint32_t)(uintptr_t)csio->data_ptr;
-					srb->sg_map32.SgEntry[0].SgByteCount =
+					srb->sg_map.SgEntry[0].SgByteCount =
 					    csio->dxfer_len;
 				} else {
 					/*
@@ -417,15 +417,15 @@ aac_cam_action(struct cam_sim *sim, unio
 					 */
 					cm->cm_data = (void *)csio->data_ptr;
 					cm->cm_datalen = csio->dxfer_len;
-					cm->cm_sgtable = &srb->sg_map32;
+					cm->cm_sgtable = &srb->sg_map;
 				}
 			} else {
 				/* XXX Need to handle multiple s/g elements */
 				panic("aac_cam: multiple s/g elements");
 			}
 		} else {
-			srb->sg_map32.SgCount = 0;
-			srb->sg_map32.SgEntry[0].SgByteCount = 0;
+			srb->sg_map.SgCount = 0;
+			srb->sg_map.SgEntry[0].SgByteCount = 0;
 			srb->data_len = 0;
 		}
 
@@ -461,7 +461,7 @@ aac_cam_action(struct cam_sim *sim, unio
 	    AAC_FIBSTATE_REXPECTED	|
 	    AAC_FIBSTATE_NORM;
 	fib->Header.Size = sizeof(struct aac_fib_header) +
-	    sizeof(struct aac_srb32);
+	    sizeof(struct aac_srb);
 
 	aac_enqueue_ready(cm);
 	aac_startio(cm->cm_sc);

Modified: stable/8/sys/dev/aac/aac_pci.c
==============================================================================
--- stable/8/sys/dev/aac/aac_pci.c	Mon Mar 29 00:23:46 2010	(r205814)
+++ stable/8/sys/dev/aac/aac_pci.c	Mon Mar 29 00:30:44 2010	(r205815)
@@ -435,10 +435,6 @@ aac_pci_attach(device_t dev)
 		fwprintf(sc, HBA_FLAGS_DBG_INIT_B, "set hardware up for StrongARM");
 		sc->aac_if = aac_sa_interface;
 		break;
-	case AAC_HWIF_FALCON:
-		fwprintf(sc, HBA_FLAGS_DBG_INIT_B, "set hardware up for Falcon/PPC");
-		sc->aac_if = aac_fa_interface;
-		break;
 	case AAC_HWIF_RKT:
 		fwprintf(sc, HBA_FLAGS_DBG_INIT_B, "set hardware up for Rocket/MIPS");
 		sc->aac_if = aac_rkt_interface;

Modified: stable/8/sys/dev/aac/aacreg.h
==============================================================================
--- stable/8/sys/dev/aac/aacreg.h	Mon Mar 29 00:23:46 2010	(r205814)
+++ stable/8/sys/dev/aac/aacreg.h	Mon Mar 29 00:30:44 2010	(r205815)
@@ -1363,7 +1363,7 @@ struct aac_close_command {
 /*
  * SCSI Passthrough structures
  */
-struct aac_srb32 {
+struct aac_srb {
 	u_int32_t		function;
 	u_int32_t		bus;
 	u_int32_t		target;
@@ -1374,7 +1374,7 @@ struct aac_srb32 {
 	u_int32_t		retry_limit;
 	u_int32_t		cdb_len;
 	u_int8_t		cdb[16];
-	struct aac_sg_table	sg_map32;
+	struct aac_sg_table	sg_map;
 };
 
 enum {
@@ -1453,24 +1453,6 @@ enum {
 };
 
 /*
- * Register set for adapters based on the Falcon bridge and PPC core
- */
-
-#define AAC_FA_DOORBELL0_CLEAR		0x00
-#define AAC_FA_DOORBELL1_CLEAR		0x02
-#define AAC_FA_DOORBELL0		0x04
-#define AAC_FA_DOORBELL1		0x06
-#define AAC_FA_MASK0_CLEAR		0x08
-#define AAC_FA_MASK1_CLEAR		0x0a
-#define	AAC_FA_MASK0			0x0c
-#define AAC_FA_MASK1			0x0e
-#define AAC_FA_MAILBOX			0x10
-#define	AAC_FA_FWSTATUS			0x2c	/* Mailbox 7 */
-#define	AAC_FA_INTSRC			0x900
-
-#define AAC_FA_HACK(sc)	(void)AAC_MEM0_GETREG4(sc, AAC_FA_INTSRC)
-
-/*
  * Register definitions for the Adaptec AAC-364 'Jalapeno I/II' adapters, based
  * on the SA110 'StrongArm'.
  */

Modified: stable/8/sys/dev/aac/aacvar.h
==============================================================================
--- stable/8/sys/dev/aac/aacvar.h	Mon Mar 29 00:23:46 2010	(r205814)
+++ stable/8/sys/dev/aac/aacvar.h	Mon Mar 29 00:30:44 2010	(r205815)
@@ -37,6 +37,16 @@
 #include <sys/selinfo.h>
 #include <geom/geom_disk.h>
 
+#define	AAC_TYPE_DEVO			1
+#define	AAC_TYPE_ALPHA			2
+#define	AAC_TYPE_BETA			3
+#define	AAC_TYPE_RELEASE		4
+
+#define	AAC_DRIVER_MAJOR_VERSION	2
+#define	AAC_DRIVER_MINOR_VERSION	1
+#define	AAC_DRIVER_BUGFIX_LEVEL		9
+#define	AAC_DRIVER_TYPE			AAC_TYPE_RELEASE
+
 #ifndef AAC_DRIVER_BUILD
 # define AAC_DRIVER_BUILD 1
 #endif
@@ -319,7 +329,6 @@ struct aac_softc 
 	int			aac_hwif;
 #define AAC_HWIF_I960RX		0
 #define AAC_HWIF_STRONGARM	1
-#define AAC_HWIF_FALCON		2
 #define AAC_HWIF_RKT		3
 #define	AAC_HWIF_NARK		4
 #define AAC_HWIF_UNKNOWN	-1


More information about the svn-src-all mailing list