summaryrefslogtreecommitdiff
path: root/sys/dev/aac
diff options
context:
space:
mode:
authorMarius Strobl <marius@FreeBSD.org>2013-08-06 18:55:59 +0000
committerMarius Strobl <marius@FreeBSD.org>2013-08-06 18:55:59 +0000
commit21e5a2223c70047269d7e13ec60332d82f6524dc (patch)
treed8460929ba35b4eaa818016e2164c35ef2b3446f /sys/dev/aac
parent54a6317360e189febbc15091e5220d75607d7251 (diff)
Notes
Diffstat (limited to 'sys/dev/aac')
-rw-r--r--sys/dev/aac/aac_pci.c73
-rw-r--r--sys/dev/aac/aacvar.h8
2 files changed, 41 insertions, 40 deletions
diff --git a/sys/dev/aac/aac_pci.c b/sys/dev/aac/aac_pci.c
index f768c8b2fd60..b7383835fc57 100644
--- a/sys/dev/aac/aac_pci.c
+++ b/sys/dev/aac/aac_pci.c
@@ -139,7 +139,7 @@ static const struct aac_ident
"Adaptec SATA RAID 21610SA"},
{0x9005, 0x0285, 0x103c, 0x3227, AAC_HWIF_I960RX, AAC_FLAGS_NO4GB,
"HP ML110 G2 (Adaptec 2610SA)"},
- {0x9005, 0x0286, 0x9005, 0x028c, AAC_HWIF_RKT, 0,
+ {0x9005, 0x0286, 0x9005, 0x028c, AAC_HWIF_RKT, AAC_FLAGS_NOMSI,
"Adaptec SCSI RAID 2230S"},
{0x9005, 0x0286, 0x9005, 0x028d, AAC_HWIF_RKT, 0,
"Adaptec SCSI RAID 2130S"},
@@ -157,7 +157,7 @@ static const struct aac_ident
"Adaptec SCSI RAID 2020ZCR"},
{0x9005, 0x0285, 0x9005, 0x028b, AAC_HWIF_I960RX, 0,
"Adaptec SCSI RAID 2025ZCR"},
- {0x9005, 0x0286, 0x9005, 0x029b, AAC_HWIF_RKT, 0,
+ {0x9005, 0x0286, 0x9005, 0x029b, AAC_HWIF_RKT, AAC_FLAGS_NOMSI,
"Adaptec SATA RAID 2820SA"},
{0x9005, 0x0286, 0x9005, 0x029c, AAC_HWIF_RKT, 0,
"Adaptec SATA RAID 2620SA"},
@@ -311,7 +311,6 @@ aac_find_ident(device_t dev)
if ((m->vendor == vendid) && (m->device == devid))
return (m);
}
-
return (NULL);
}
@@ -340,7 +339,7 @@ aac_pci_attach(device_t dev)
{
struct aac_softc *sc;
const struct aac_ident *id;
- int count, error, reg, rid;
+ int count, error, rid;
fwprintf(NULL, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "");
@@ -363,6 +362,38 @@ aac_pci_attach(device_t dev)
}
/*
+ * Detect the hardware interface version, set up the bus interface
+ * indirection.
+ */
+ id = aac_find_ident(dev);
+ sc->aac_hwif = id->hwif;
+ switch(sc->aac_hwif) {
+ case AAC_HWIF_I960RX:
+ case AAC_HWIF_NARK:
+ fwprintf(sc, HBA_FLAGS_DBG_INIT_B,
+ "set hardware up for i960Rx/NARK");
+ sc->aac_if = &aac_rx_interface;
+ break;
+ case AAC_HWIF_STRONGARM:
+ fwprintf(sc, HBA_FLAGS_DBG_INIT_B,
+ "set hardware up for StrongARM");
+ sc->aac_if = &aac_sa_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;
+ break;
+ default:
+ sc->aac_hwif = AAC_HWIF_UNKNOWN;
+ device_printf(dev, "unknown hardware type\n");
+ goto out;
+ }
+
+ /* Set up quirks */
+ sc->flags = id->quirks;
+
+ /*
* Allocate the PCI register window(s).
*/
rid = PCIR_BAR(0);
@@ -395,8 +426,8 @@ aac_pci_attach(device_t dev)
*/
rid = 0;
count = 0;
- if (aac_enable_msi != 0 && pci_find_cap(dev, PCIY_MSI, &reg) == 0) {
- count = pci_msi_count(dev);
+ if (aac_enable_msi != 0 && (sc->flags & AAC_FLAGS_NOMSI) == 0 &&
+ (count = pci_msi_count(dev)) != 0) {
if (count > 1)
count = 1;
else
@@ -431,36 +462,6 @@ aac_pci_attach(device_t dev)
}
/*
- * Detect the hardware interface version, set up the bus interface
- * indirection.
- */
- id = aac_find_ident(dev);
- sc->aac_hwif = id->hwif;
- switch(sc->aac_hwif) {
- case AAC_HWIF_I960RX:
- case AAC_HWIF_NARK:
- fwprintf(sc, HBA_FLAGS_DBG_INIT_B, "set hardware up for i960Rx/NARK");
- sc->aac_if = &aac_rx_interface;
- break;
- case AAC_HWIF_STRONGARM:
- fwprintf(sc, HBA_FLAGS_DBG_INIT_B, "set hardware up for StrongARM");
- sc->aac_if = &aac_sa_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;
- break;
- default:
- sc->aac_hwif = AAC_HWIF_UNKNOWN;
- device_printf(dev, "unknown hardware type\n");
- error = ENXIO;
- goto out;
- }
-
- /* Set up quirks */
- sc->flags = id->quirks;
-
- /*
* Do bus-independent initialisation.
*/
error = aac_attach(sc);
diff --git a/sys/dev/aac/aacvar.h b/sys/dev/aac/aacvar.h
index 18ae0b21f4d1..0950a2f6a7f8 100644
--- a/sys/dev/aac/aacvar.h
+++ b/sys/dev/aac/aacvar.h
@@ -62,7 +62,7 @@ SYSCTL_DECL(_hw_aac);
* The firmware interface allows for a 16-bit s/g list length. We limit
* ourselves to a reasonable maximum and ensure alignment.
*/
-#define AAC_MAXSGENTRIES 64 /* max S/G entries, limit 65535 */
+#define AAC_MAXSGENTRIES 64 /* max S/G entries, limit 65535 */
/*
* We allocate a small set of FIBs for the adapter to use to send us messages.
@@ -224,7 +224,7 @@ struct aac_common {
/* buffer for text messages from the controller */
char ac_printf[AAC_PRINTF_BUFSIZE];
-
+
/* fib for synchronous commands */
struct aac_fib ac_sync_fib;
};
@@ -406,12 +406,13 @@ struct aac_softc
#define AAC_FLAGS_NO4GB (1 << 6) /* Can't access host mem >2GB */
#define AAC_FLAGS_256FIBS (1 << 7) /* Can only do 256 commands */
#define AAC_FLAGS_BROKEN_MEMMAP (1 << 8) /* Broken HostPhysMemPages */
-#define AAC_FLAGS_SLAVE (1 << 9)
+#define AAC_FLAGS_SLAVE (1 << 9)
#define AAC_FLAGS_MASTER (1 << 10)
#define AAC_FLAGS_NEW_COMM (1 << 11) /* New comm. interface supported */
#define AAC_FLAGS_RAW_IO (1 << 12) /* Raw I/O interface */
#define AAC_FLAGS_ARRAY_64BIT (1 << 13) /* 64-bit array size */
#define AAC_FLAGS_LBA_64BIT (1 << 14) /* 64-bit LBA support */
+#define AAC_FLAGS_NOMSI (1 << 31) /* Broken MSI */
u_int32_t supported_options;
u_int32_t scsi_method_id;
@@ -527,7 +528,6 @@ struct aac_code_lookup {
sc->aac_qstat[qname].q_max = 0; \
} while (0)
-
#define AACQ_COMMAND_QUEUE(name, index) \
static __inline void \
aac_initq_ ## name (struct aac_softc *sc) \