summaryrefslogtreecommitdiff
path: root/sys/dev/aac
diff options
context:
space:
mode:
authorScott Long <scottl@FreeBSD.org>2003-04-08 13:22:08 +0000
committerScott Long <scottl@FreeBSD.org>2003-04-08 13:22:08 +0000
commitad15c55bc95cae270f0e64560c142e152091809c (patch)
treed65580dad5633d289f07439aeb081f38646ca66d /sys/dev/aac
parentd327329b86ded25cf1806ee043908f799affc66a (diff)
Notes
Diffstat (limited to 'sys/dev/aac')
-rw-r--r--sys/dev/aac/aac.c187
-rw-r--r--sys/dev/aac/aac_cam.c9
-rw-r--r--sys/dev/aac/aac_pci.c81
-rw-r--r--sys/dev/aac/aacreg.h8
-rw-r--r--sys/dev/aac/aacvar.h23
5 files changed, 182 insertions, 126 deletions
diff --git a/sys/dev/aac/aac.c b/sys/dev/aac/aac.c
index 21f04ffd31fd..1e87aee8c2c3 100644
--- a/sys/dev/aac/aac.c
+++ b/sys/dev/aac/aac.c
@@ -115,7 +115,7 @@ 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_mailboxstatus(struct aac_softc *sc);
+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 = {
@@ -124,7 +124,7 @@ struct aac_interface aac_fa_interface = {
aac_fa_get_istatus,
aac_fa_clear_istatus,
aac_fa_set_mailbox,
- aac_fa_get_mailboxstatus,
+ aac_fa_get_mailbox,
aac_fa_set_interrupts
};
@@ -136,7 +136,7 @@ static void aac_sa_clear_istatus(struct aac_softc *sc, int mask);
static void aac_sa_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_sa_get_mailboxstatus(struct aac_softc *sc);
+static int aac_sa_get_mailbox(struct aac_softc *sc, int mb);
static void aac_sa_set_interrupts(struct aac_softc *sc, int enable);
struct aac_interface aac_sa_interface = {
@@ -145,7 +145,7 @@ struct aac_interface aac_sa_interface = {
aac_sa_get_istatus,
aac_sa_clear_istatus,
aac_sa_set_mailbox,
- aac_sa_get_mailboxstatus,
+ aac_sa_get_mailbox,
aac_sa_set_interrupts
};
@@ -157,7 +157,7 @@ static void aac_rx_clear_istatus(struct aac_softc *sc, int mask);
static void aac_rx_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_rx_get_mailboxstatus(struct aac_softc *sc);
+static int aac_rx_get_mailbox(struct aac_softc *sc, int mb);
static void aac_rx_set_interrupts(struct aac_softc *sc, int enable);
struct aac_interface aac_rx_interface = {
@@ -166,7 +166,7 @@ struct aac_interface aac_rx_interface = {
aac_rx_get_istatus,
aac_rx_clear_istatus,
aac_rx_set_mailbox,
- aac_rx_get_mailboxstatus,
+ aac_rx_get_mailbox,
aac_rx_set_interrupts
};
@@ -256,13 +256,6 @@ aac_attach(struct aac_softc *sc)
if ((error = aac_check_firmware(sc)) != 0)
return(error);
- /*
- * Allocate command structures. This must be done before aac_init()
- * in order to work around a 2120/2200 bug.
- */
- if ((error = aac_alloc_commands(sc)) != 0)
- return(error);
-
/* Init the sync fib lock */
AAC_LOCK_INIT(&sc->aac_sync_lock, "AAC sync FIB lock");
@@ -324,7 +317,7 @@ aac_attach(struct aac_softc *sc)
device_printf(sc->aac_dev, "shutdown event registration failed\n");
/* Register with CAM for the non-DASD devices */
- if (!(sc->quirks & AAC_QUIRK_NOCAM))
+ if ((sc->flags & AAC_FLAGS_ENABLE_CAM) != 0)
aac_get_bus_info(sc);
return(0);
@@ -1214,21 +1207,10 @@ aac_alloc_commands(struct aac_softc *sc)
return(ENOMEM);
}
- /*
- * Work around a bug in the 2120 and 2200 that cannot DMA commands
- * below address 8192 in physical memory.
- * XXX If the padding is not needed, can it be put to use instead
- * of ignored?
- */
bus_dmamap_load(sc->aac_fib_dmat, sc->aac_fibmap, sc->aac_fibs,
- 8192 + AAC_FIB_COUNT * sizeof(struct aac_fib),
+ AAC_FIB_COUNT * sizeof(struct aac_fib),
aac_map_command_helper, sc, 0);
- if (sc->aac_fibphys < 8192) {
- sc->aac_fibs += (8192 / sizeof(struct aac_fib));
- sc->aac_fibphys += 8192;
- }
-
/* initialise constant fields in the command structure */
bzero(sc->aac_fibs, AAC_FIB_COUNT * sizeof(struct aac_fib));
for (i = 0; i < AAC_FIB_COUNT; i++) {
@@ -1371,18 +1353,18 @@ aac_common_map(void *arg, bus_dma_segment_t *segs, int nseg, int error)
sc->aac_common_busaddr = segs[0].ds_addr;
}
-/*
- * Retrieve the firmware version numbers. Dell PERC2/QC cards with
- * firmware version 1.x are not compatible with this driver.
- */
static int
aac_check_firmware(struct aac_softc *sc)
{
- u_int32_t major, minor;
+ u_int32_t major, minor, options;
debug_called(1);
- if (sc->quirks & AAC_QUIRK_PERC2QC) {
+ /*
+ * Retrieve the firmware version numbers. Dell PERC2/QC cards with
+ * firmware version 1.x are not compatible with this driver.
+ */
+ if (sc->flags & AAC_FLAGS_PERC2QC) {
if (aac_sync_command(sc, AAC_MONKER_GETKERNVER, 0, 0, 0, 0,
NULL)) {
device_printf(sc->aac_dev,
@@ -1391,8 +1373,8 @@ aac_check_firmware(struct aac_softc *sc)
}
/* These numbers are stored as ASCII! */
- major = (AAC_GETREG4(sc, AAC_SA_MAILBOX + 4) & 0xff) - 0x30;
- minor = (AAC_GETREG4(sc, AAC_SA_MAILBOX + 8) & 0xff) - 0x30;
+ major = (AAC_GET_MAILBOX(sc, 1) & 0xff) - 0x30;
+ minor = (AAC_GET_MAILBOX(sc, 2) & 0xff) - 0x30;
if (major == 1) {
device_printf(sc->aac_dev,
"Firmware version %d.%d is not supported.\n",
@@ -1401,6 +1383,23 @@ aac_check_firmware(struct aac_softc *sc)
}
}
+ /*
+ * Retrieve the capabilities/supported options word so we know what
+ * work-arounds to enable.
+ */
+ if (aac_sync_command(sc, AAC_MONKER_GETINFO, 0, 0, 0, 0, NULL)) {
+ device_printf(sc->aac_dev, "RequestAdapterInfo failed\n");
+ return (EIO);
+ }
+ options = AAC_GET_MAILBOX(sc, 1);
+ sc->supported_options = options;
+
+ if ((options & AAC_SUPPORTED_4GB_WINDOW) != 0 &&
+ (sc->flags & AAC_FLAGS_NO4GB) == 0)
+ sc->flags |= AAC_FLAGS_4GB_WINDOW;
+ if (options & AAC_SUPPORTED_NONDASD)
+ sc->flags |= AAC_FLAGS_ENABLE_CAM;
+
return (0);
}
@@ -1411,6 +1410,7 @@ aac_init(struct aac_softc *sc)
time_t then;
u_int32_t code;
u_int8_t *qaddr;
+ int error;
debug_called(1);
@@ -1437,33 +1437,89 @@ aac_init(struct aac_softc *sc)
}
} while (!(code & AAC_UP_AND_RUNNING));
+ error = ENOMEM;
+ /*
+ * Create DMA tag for mapping buffers into controller-addressable space.
+ */
+ if (bus_dma_tag_create(sc->aac_parent_dmat, /* parent */
+ 1, 0, /* algnmnt, boundary */
+ BUS_SPACE_MAXADDR_32BIT, /* lowaddr */
+ BUS_SPACE_MAXADDR, /* highaddr */
+ NULL, NULL, /* filter, filterarg */
+ MAXBSIZE, /* maxsize */
+ AAC_MAXSGENTRIES, /* nsegments */
+ MAXBSIZE, /* maxsegsize */
+ BUS_DMA_ALLOCNOW, /* flags */
+ &sc->aac_buffer_dmat)) {
+ device_printf(sc->aac_dev, "can't allocate buffer DMA tag\n");
+ goto out;
+ }
+
+ /*
+ * Create DMA tag for mapping FIBs into controller-addressable space..
+ */
+ if (bus_dma_tag_create(sc->aac_parent_dmat, /* parent */
+ 1, 0, /* algnmnt, boundary */
+ (sc->flags & AAC_FLAGS_4GB_WINDOW) ?
+ BUS_SPACE_MAXADDR_32BIT :
+ 0x7fffffff, /* lowaddr */
+ BUS_SPACE_MAXADDR, /* highaddr */
+ NULL, NULL, /* filter, filterarg */
+ AAC_FIB_COUNT *
+ sizeof(struct aac_fib), /* maxsize */
+ 1, /* nsegments */
+ AAC_FIB_COUNT *
+ sizeof(struct aac_fib), /* maxsegsize */
+ BUS_DMA_ALLOCNOW, /* flags */
+ &sc->aac_fib_dmat)) {
+ device_printf(sc->aac_dev, "can't allocate FIB DMA tag\n");;
+ goto out;
+ }
+
/*
* Create DMA tag for the common structure and allocate it.
*/
if (bus_dma_tag_create(sc->aac_parent_dmat, /* parent */
1, 0, /* algnmnt, boundary */
- BUS_SPACE_MAXADDR_32BIT, /* lowaddr */
+ (sc->flags & AAC_FLAGS_4GB_WINDOW) ?
+ BUS_SPACE_MAXADDR_32BIT :
+ 0x7fffffff, /* lowaddr */
BUS_SPACE_MAXADDR, /* highaddr */
NULL, NULL, /* filter, filterarg */
- sizeof(struct aac_common), /* maxsize */
+ 8192 + sizeof(struct aac_common), /* maxsize */
1, /* nsegments */
BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */
- 0, /* flags */
+ BUS_DMA_ALLOCNOW, /* flags */
&sc->aac_common_dmat)) {
device_printf(sc->aac_dev,
"can't allocate common structure DMA tag\n");
- return(ENOMEM);
+ goto out;
}
if (bus_dmamem_alloc(sc->aac_common_dmat, (void **)&sc->aac_common,
BUS_DMA_NOWAIT, &sc->aac_common_dmamap)) {
device_printf(sc->aac_dev, "can't allocate common structure\n");
- return(ENOMEM);
+ goto out;
}
+ /*
+ * Work around a bug in the 2120 and 2200 that cannot DMA commands
+ * below address 8192 in physical memory.
+ * XXX If the padding is not needed, can it be put to use instead
+ * of ignored?
+ */
bus_dmamap_load(sc->aac_common_dmat, sc->aac_common_dmamap,
- sc->aac_common, sizeof(*sc->aac_common), aac_common_map,
- sc, 0);
+ sc->aac_common, 8192 + sizeof(*sc->aac_common),
+ aac_common_map, sc, 0);
+
+ if (sc->aac_common_busaddr < 8192) {
+ (uint8_t *)sc->aac_common += 8192;
+ sc->aac_common_busaddr += 8192;
+ }
bzero(sc->aac_common, sizeof(*sc->aac_common));
-
+
+ /* Allocate some FIBs and associated command structs */
+ if (aac_alloc_commands(sc) != 0)
+ goto out;
+
/*
* Fill in the init structure. This tells the adapter about the
* physical location of various important shared data structures.
@@ -1577,10 +1633,13 @@ aac_init(struct aac_softc *sc)
NULL)) {
device_printf(sc->aac_dev,
"error establishing init structure\n");
- return(EIO);
+ error = EIO;
+ goto out;
}
- return(0);
+ error = 0;
+out:
+ return(error);
}
/*
@@ -1609,7 +1668,7 @@ aac_sync_command(struct aac_softc *sc, u_int32_t command,
then = time_second;
do {
if (time_second > (then + AAC_IMMEDIATE_TIMEOUT)) {
- debug(2, "timed out");
+ debug(1, "timed out");
return(EIO);
}
} while (!(AAC_GET_ISTATUS(sc) & AAC_DB_SYNC_COMMAND));
@@ -1618,7 +1677,7 @@ aac_sync_command(struct aac_softc *sc, u_int32_t command,
AAC_CLEAR_ISTATUS(sc, AAC_DB_SYNC_COMMAND);
/* get the command status */
- status = AAC_GET_MAILBOXSTATUS(sc);
+ status = AAC_GET_MAILBOX(sc, 0);
if (sp != NULL)
*sp = status;
return(0);
@@ -2110,29 +2169,29 @@ aac_fa_set_mailbox(struct aac_softc *sc, u_int32_t command,
* Fetch the immediate command status word
*/
static int
-aac_sa_get_mailboxstatus(struct aac_softc *sc)
+aac_sa_get_mailbox(struct aac_softc *sc, int mb)
{
debug_called(4);
- return(AAC_GETREG4(sc, AAC_SA_MAILBOX));
+ return(AAC_GETREG4(sc, AAC_SA_MAILBOX + (mb * 4)));
}
static int
-aac_rx_get_mailboxstatus(struct aac_softc *sc)
+aac_rx_get_mailbox(struct aac_softc *sc, int mb)
{
debug_called(4);
- return(AAC_GETREG4(sc, AAC_RX_MAILBOX));
+ return(AAC_GETREG4(sc, AAC_RX_MAILBOX + (mb * 4)));
}
static int
-aac_fa_get_mailboxstatus(struct aac_softc *sc)
+aac_fa_get_mailbox(struct aac_softc *sc, int mb)
{
int val;
debug_called(4);
- val = AAC_GETREG4(sc, AAC_FA_MAILBOX);
+ val = AAC_GETREG4(sc, AAC_FA_MAILBOX + (mb * 4));
return (val);
}
@@ -2200,7 +2259,7 @@ aac_describe_controller(struct aac_softc *sc)
aac_release_sync_fib(sc);
return;
}
- info = (struct aac_adapter_info *)&fib->data[0];
+ info = (struct aac_adapter_info *)&fib->data[0];
device_printf(sc->aac_dev, "%s %dMHz, %dMB cache memory, %s\n",
aac_describe_code(aac_cpu_variant, info->CpuVariant),
@@ -2218,6 +2277,25 @@ aac_describe_controller(struct aac_softc *sc)
(u_int32_t)(info->SerialNumber & 0xffffff));
aac_release_sync_fib(sc);
+
+ if (1 || bootverbose) {
+ device_printf(sc->aac_dev, "Supported Options=%b\n",
+ sc->supported_options,
+ "\20"
+ "\1SNAPSHOT"
+ "\2CLUSTERS"
+ "\3WCACHE"
+ "\4DATA64"
+ "\5HOSTTIME"
+ "\6RAID50"
+ "\7WINDOW4GB"
+ "\10SCSIUPGD"
+ "\11SOFTERR"
+ "\12NORECOND"
+ "\13SGMAP64"
+ "\14ALARM"
+ "\15NONDASD");
+ }
}
/*
@@ -2832,8 +2910,7 @@ aac_get_bus_info(struct aac_softc *sc)
vmi_resp = (struct aac_vmi_businf_resp *)&fib->data[0];
if (vmi_resp->Status != ST_OK) {
- device_printf(sc->aac_dev, "VM_Ioctl returned %d\n",
- vmi_resp->Status);
+ debug(1, "VM_Ioctl returned %d\n", vmi_resp->Status);
aac_release_sync_fib(sc);
return;
}
diff --git a/sys/dev/aac/aac_cam.c b/sys/dev/aac/aac_cam.c
index 1125008a9e56..0dcae9d4cf37 100644
--- a/sys/dev/aac/aac_cam.c
+++ b/sys/dev/aac/aac_cam.c
@@ -252,7 +252,7 @@ aac_cam_action(struct cam_sim *sim, union ccb *ccb)
xpt_done(ccb);
return;
case XPT_RESET_BUS:
- if (!(sc->quirks & AAC_QUIRK_CAM_NORESET)) {
+ if (!(sc->flags & AAC_FLAGS_CAM_NORESET)) {
ccb->ccb_h.status = aac_cam_reset_bus(sim, ccb);
} else {
ccb->ccb_h.status = CAM_REQ_CMP;
@@ -357,7 +357,7 @@ aac_cam_action(struct cam_sim *sim, union ccb *ccb)
break;
}
case XPT_RESET_DEV:
- if (!(sc->quirks & AAC_QUIRK_CAM_NORESET)) {
+ if (!(sc->flags & AAC_FLAGS_CAM_NORESET)) {
srb->function = AAC_SRB_FUNC_RESET_DEVICE;
break;
} else {
@@ -465,7 +465,7 @@ aac_cam_complete(struct aac_command *cm)
*/
if ((device == T_DIRECT) ||
(device == T_PROCESSOR) ||
- (sc->quirks & AAC_QUIRK_CAM_PASSONLY))
+ (sc->flags & AAC_FLAGS_CAM_PASSONLY))
ccb->csio.data_ptr[0] =
((device & 0xe0) | T_NODEVICE);
}
@@ -565,8 +565,7 @@ aac_cam_get_tran_settings(struct aac_softc *sc, struct ccb_trans_settings *cts,
vmi_resp = (struct aac_vmi_devinfo_resp *)&fib->data[0];
if (vmi_resp->Status != ST_OK) {
- device_printf(sc->aac_dev, "VM_Ioctl returned %d\n",
- vmi_resp->Status);
+ debug(1, "VM_Ioctl returned %d\n", vmi_resp->Status);
aac_release_sync_fib(sc);
return (CAM_REQ_CMP_ERR);
}
diff --git a/sys/dev/aac/aac_pci.c b/sys/dev/aac/aac_pci.c
index d058291d60c0..bd0780d138ef 100644
--- a/sys/dev/aac/aac_pci.c
+++ b/sys/dev/aac/aac_pci.c
@@ -93,40 +93,40 @@ struct aac_ident
int quirks;
char *desc;
} aac_identifiers[] = {
- {0x1028, 0x0001, 0x1028, 0x0001, AAC_HWIF_I960RX, AAC_QUIRK_NOCAM,
+ {0x1028, 0x0001, 0x1028, 0x0001, AAC_HWIF_I960RX, 0,
"Dell PERC 2/Si"},
- {0x1028, 0x0002, 0x1028, 0x0002, AAC_HWIF_I960RX, AAC_QUIRK_NOCAM,
+ {0x1028, 0x0002, 0x1028, 0x0002, AAC_HWIF_I960RX, 0,
"Dell PERC 3/Di"},
- {0x1028, 0x0003, 0x1028, 0x0003, AAC_HWIF_I960RX, AAC_QUIRK_NOCAM,
+ {0x1028, 0x0003, 0x1028, 0x0003, AAC_HWIF_I960RX, 0,
"Dell PERC 3/Si"},
- {0x1028, 0x0004, 0x1028, 0x00d0, AAC_HWIF_I960RX, AAC_QUIRK_NOCAM,
+ {0x1028, 0x0004, 0x1028, 0x00d0, AAC_HWIF_I960RX, 0,
"Dell PERC 3/Si"},
- {0x1028, 0x0002, 0x1028, 0x00d1, AAC_HWIF_I960RX, AAC_QUIRK_NOCAM,
+ {0x1028, 0x0002, 0x1028, 0x00d1, AAC_HWIF_I960RX, 0,
"Dell PERC 3/Di"},
- {0x1028, 0x0002, 0x1028, 0x00d9, AAC_HWIF_I960RX, AAC_QUIRK_NOCAM,
+ {0x1028, 0x0002, 0x1028, 0x00d9, AAC_HWIF_I960RX, 0,
"Dell PERC 3/Di"},
- {0x1028, 0x0008, 0x1028, 0x00cf, AAC_HWIF_I960RX, AAC_QUIRK_NOCAM,
+ {0x1028, 0x0008, 0x1028, 0x00cf, AAC_HWIF_I960RX, 0,
"Dell PERC 3/Di"},
- {0x1028, 0x000a, 0x1028, 0x0106, AAC_HWIF_I960RX, AAC_QUIRK_NOCAM,
+ {0x1028, 0x000a, 0x1028, 0x0106, AAC_HWIF_I960RX, 0,
"Dell PERC 3/Di"},
- {0x1028, 0x000a, 0x1028, 0x011b, AAC_HWIF_I960RX, AAC_QUIRK_NOCAM,
+ {0x1028, 0x000a, 0x1028, 0x011b, AAC_HWIF_I960RX, 0,
"Dell PERC 3/Di"},
- {0x1028, 0x000a, 0x1028, 0x0121, AAC_HWIF_I960RX, AAC_QUIRK_NOCAM,
+ {0x1028, 0x000a, 0x1028, 0x0121, AAC_HWIF_I960RX, 0,
"Dell PERC 3/Di"},
- {0x1011, 0x0046, 0x9005, 0x0364, AAC_HWIF_STRONGARM, AAC_QUIRK_NOCAM,
+ {0x1011, 0x0046, 0x9005, 0x0364, AAC_HWIF_STRONGARM, 0,
"Adaptec AAC-364"},
- {0x1011, 0x0046, 0x9005, 0x0365, AAC_HWIF_STRONGARM, AAC_QUIRK_NOCAM,
+ {0x1011, 0x0046, 0x9005, 0x0365, AAC_HWIF_STRONGARM, 0,
"Adaptec SCSI RAID 5400S"},
- {0x1011, 0x0046, 0x9005, 0x1364, AAC_HWIF_STRONGARM, AAC_QUIRK_NOCAM |
- AAC_QUIRK_PERC2QC, "Dell PERC 2/QC"},
- {0x1011, 0x0046, 0x103c, 0x10c2, AAC_HWIF_STRONGARM, AAC_QUIRK_NOCAM,
+ {0x1011, 0x0046, 0x9005, 0x1364, AAC_HWIF_STRONGARM, AAC_FLAGS_PERC2QC,
+ "Dell PERC 2/QC"},
+ {0x1011, 0x0046, 0x103c, 0x10c2, AAC_HWIF_STRONGARM, 0,
"HP NetRaid-4M"},
- {0x9005, 0x0285, 0x9005, 0x0285, AAC_HWIF_I960RX, 0,
- "Adaptec SCSI RAID 2200S"},
- {0x9005, 0x0285, 0x1028, 0x0287, AAC_HWIF_I960RX, 0,
- "Dell PERC 320/DC"},
- {0x9005, 0x0285, 0x9005, 0x0286, AAC_HWIF_I960RX, 0,
- "Adaptec SCSI RAID 2120S"},
+ {0x9005, 0x0285, 0x9005, 0x0285, AAC_HWIF_I960RX, AAC_FLAGS_NO4GB,
+ "Adaptec SCSI RAID 2200S"},
+ {0x9005, 0x0285, 0x1028, 0x0287, AAC_HWIF_I960RX, AAC_FLAGS_NO4GB,
+ "Dell PERC 320/DC"},
+ {0x9005, 0x0285, 0x9005, 0x0286, AAC_HWIF_I960RX, AAC_FLAGS_NO4GB,
+ "Adaptec SCSI RAID 2120S"},
{0, 0, 0, 0, 0, 0, 0}
};
@@ -242,48 +242,15 @@ aac_pci_attach(device_t dev)
BUS_SPACE_MAXADDR_32BIT, /* lowaddr */
BUS_SPACE_MAXADDR, /* highaddr */
NULL, NULL, /* filter, filterarg */
- MAXBSIZE, /* maxsize */
+ BUS_SPACE_MAXSIZE_32BIT, /* maxsize */
AAC_MAXSGENTRIES, /* nsegments */
BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */
- BUS_DMA_ALLOCNOW, /* flags */
+ 0, /* flags */
&sc->aac_parent_dmat)) {
device_printf(sc->aac_dev, "can't allocate parent DMA tag\n");
goto out;
}
- /*
- * Create DMA tag for mapping buffers into controller-addressable space.
- */
- if (bus_dma_tag_create(sc->aac_parent_dmat, /* parent */
- 1, 0, /* algnmnt, boundary */
- BUS_SPACE_MAXADDR, /* lowaddr */
- BUS_SPACE_MAXADDR, /* highaddr */
- NULL, NULL, /* filter, filterarg */
- MAXBSIZE, AAC_MAXSGENTRIES, /* maxsize, nsegments */
- BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */
- 0, /* flags */
- &sc->aac_buffer_dmat)) {
- device_printf(sc->aac_dev, "can't allocate buffer DMA tag\n");
- goto out;
- }
-
- /*
- * Create DMA tag for mapping FIBs into controller-addressable space..
- */
- if (bus_dma_tag_create(sc->aac_parent_dmat, /* parent */
- 1, 0, /* algnmnt, boundary */
- BUS_SPACE_MAXADDR, /* lowaddr */
- BUS_SPACE_MAXADDR, /* highaddr */
- NULL, NULL, /* filter, filterarg */
- 8192 + AAC_FIB_COUNT * /* XXX dma hack */
- sizeof(struct aac_fib), 1, /* maxsize, nsegments */
- BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */
- 0, /* flags */
- &sc->aac_fib_dmat)) {
- device_printf(sc->aac_dev, "can't allocate FIB DMA tag\n");;
- goto out;
- }
-
/*
* Detect the hardware interface version, set up the bus interface
* indirection.
@@ -312,7 +279,7 @@ aac_pci_attach(device_t dev)
}
/* Set up quirks */
- sc->quirks = aac_identifiers[i].quirks;
+ sc->flags = aac_identifiers[i].quirks;
break;
}
diff --git a/sys/dev/aac/aacreg.h b/sys/dev/aac/aacreg.h
index 1b22732b205d..ec44386536aa 100644
--- a/sys/dev/aac/aacreg.h
+++ b/sys/dev/aac/aacreg.h
@@ -488,6 +488,13 @@ typedef enum
#define AAC_SUPPORTED_64BIT_DATA 0x08
#define AAC_SUPPORTED_HOST_TIME_FIB 0x10
#define AAC_SUPPORTED_RAID50 0x20
+#define AAC_SUPPORTED_4GB_WINDOW 0x40
+#define AAC_SUPPORTED_SCSI_UPGRADEABLE 0x80
+#define AAC_SUPPORTED_SOFT_ERR_REPORT 0x100
+#define AAC_SUPPORTED_NOT_RECONDITION 0x200
+#define AAC_SUPPORTED_SGMAP_HOST64 0x400
+#define AAC_SUPPORTED_ALARM 0x800
+#define AAC_SUPPORTED_NONDASD 0x1000
/*
* Structure used to respond to a RequestAdapterInfo fib.
@@ -526,6 +533,7 @@ struct aac_adapter_info {
#define AAC_MONKER_INITSTRUCT 0x05
#define AAC_MONKER_SYNCFIB 0x0c
#define AAC_MONKER_GETKERNVER 0x11
+#define AAC_MONKER_GETINFO 0x19
/*
* Adapter Status Register
diff --git a/sys/dev/aac/aacvar.h b/sys/dev/aac/aacvar.h
index b799eafd3a39..35a0c34d32fa 100644
--- a/sys/dev/aac/aacvar.h
+++ b/sys/dev/aac/aacvar.h
@@ -212,7 +212,7 @@ struct aac_interface
void (*aif_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);
- int (*aif_get_mailboxstatus)(struct aac_softc *sc);
+ int (*aif_get_mailbox)(struct aac_softc *sc, int mb);
void (*aif_set_interrupts)(struct aac_softc *sc, int enable);
};
extern struct aac_interface aac_rx_interface;
@@ -227,8 +227,8 @@ extern struct aac_interface aac_fa_interface;
#define AAC_SET_MAILBOX(sc, command, arg0, arg1, arg2, arg3) \
((sc)->aac_if.aif_set_mailbox((sc), (command), (arg0), (arg1), (arg2), \
(arg3)))
-#define AAC_GET_MAILBOXSTATUS(sc) ((sc)->aac_if.aif_get_mailboxstatus( \
- (sc)))
+#define AAC_GET_MAILBOX(sc, mb) ((sc)->aac_if.aif_get_mailbox((sc), \
+ (mb)))
#define AAC_MASK_INTERRUPTS(sc) ((sc)->aac_if.aif_set_interrupts((sc), \
0))
#define AAC_UNMASK_INTERRUPTS(sc) ((sc)->aac_if.aif_set_interrupts((sc), \
@@ -360,12 +360,17 @@ struct aac_softc
#define AAC_AIFFLAGS_PENDING (1 << 1)
#define AAC_AIFFLAGS_EXIT (1 << 2)
#define AAC_AIFFLAGS_EXITED (1 << 3)
- u_int32_t quirks;
-#define AAC_QUIRK_PERC2QC (1 << 0)
-#define AAC_QUIRK_NOCAM (1 << 1) /* No SCSI passthrough */
-#define AAC_QUIRK_CAM_NORESET (1 << 2) /* Fake SCSI resets */
-#define AAC_QUIRK_CAM_PASSONLY (1 << 3) /* Only create pass devices */
-
+ u_int32_t flags;
+#define AAC_FLAGS_PERC2QC (1 << 0)
+#define AAC_FLAGS_ENABLE_CAM (1 << 1) /* No SCSI passthrough */
+#define AAC_FLAGS_CAM_NORESET (1 << 2) /* Fake SCSI resets */
+#define AAC_FLAGS_CAM_PASSONLY (1 << 3) /* Only create pass devices */
+#define AAC_FLAGS_4GB_WINDOW (1 << 5) /* Device can access host mem
+ * 2GB-4GB range */
+#define AAC_FLAGS_NO4GB (1 << 6) /* Can't access host mem >2GB */
+#define AAC_FLAGS_256FIBS (1 << 7) /* Can only do 256 commands */
+
+ u_int32_t supported_options;
u_int32_t scsi_method_id;
};