summaryrefslogtreecommitdiffstats
path: root/sys/dev/aac/aac_pci.c
diff options
context:
space:
mode:
authormsmith <msmith@FreeBSD.org>2000-12-27 13:14:56 +0000
committermsmith <msmith@FreeBSD.org>2000-12-27 13:14:56 +0000
commit7a963983ca75554cbd1b41ff45750211d765d5d2 (patch)
tree7a6c271549ef883f5519eb0f5ed94d46f87d2b1f /sys/dev/aac/aac_pci.c
parent798d2297a8b3e7fe2dec06b988b0a28f5ff483c6 (diff)
downloadFreeBSD-src-7a963983ca75554cbd1b41ff45750211d765d5d2.zip
FreeBSD-src-7a963983ca75554cbd1b41ff45750211d765d5d2.tar.gz
Major bugfix and minor update. This should resolve the current issues
with the driver locking up under load. - Restructure so that we use a static pool of commands/FIBs, rather than allocating them in clusters. The cluster allocation just made things more complicated, and allowed us to waste more memory in peak load situations. - Make queueing macros more like my other drivers. This adds queue stats for free. Add some debugging to take advantage of this. - Reimplement the periodic timeout scan. Kick the interrupt handler and the start routine every scan as well, just to be safe. Track busy commands properly. - Bring resource cleanup into line with resource allocation. We should now clean up correctly after a failed probe/unload/etc. - Try to start new commands when old ones are completed. We weren't doing this before, which could lead to deadlock when the controller was full. - Don't try to build a new command if we have found a deferred command. This could cause us to lose the deferred command. - Use diskerr() to report I/O errors. - Don't bail if the AdapterInfo structure is the wrong size. Some variation seems to be normal. We need to improve our handing of 2.x firmware sets. - Improve some comments in an attempt to try to make things clearer. - Restructure to avoid some warnings.
Diffstat (limited to 'sys/dev/aac/aac_pci.c')
-rw-r--r--sys/dev/aac/aac_pci.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/dev/aac/aac_pci.c b/sys/dev/aac/aac_pci.c
index 654954b..654e075 100644
--- a/sys/dev/aac/aac_pci.c
+++ b/sys/dev/aac/aac_pci.c
@@ -50,6 +50,7 @@
#include <pci/pcivar.h>
#include <dev/aac/aacreg.h>
+#include <dev/aac/aac_ioctl.h>
#include <dev/aac/aacvar.h>
static int aac_pci_probe(device_t dev);
@@ -230,7 +231,7 @@ aac_pci_attach(device_t dev)
BUS_SPACE_MAXADDR, /* lowaddr */
BUS_SPACE_MAXADDR, /* highaddr */
NULL, NULL, /* filter, filterarg */
- AAC_CLUSTER_COUNT * sizeof(struct aac_fib), 1,/* maxsize, nsegments */
+ AAC_FIB_COUNT * sizeof(struct aac_fib), 1, /* maxsize, nsegments */
BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */
0, /* flags */
&sc->aac_fib_dmat)) {
@@ -241,6 +242,7 @@ aac_pci_attach(device_t dev)
/*
* Detect the hardware interface version, set up the bus interface indirection.
*/
+ sc->aac_hwif = AAC_HWIF_UNKNOWN;
for (i = 0; aac_identifiers[i].vendor != 0; i++) {
if ((aac_identifiers[i].vendor == pci_get_vendor(dev)) &&
(aac_identifiers[i].device == pci_get_device(dev))) {
@@ -259,6 +261,11 @@ aac_pci_attach(device_t dev)
break;
}
}
+ if (sc->aac_hwif == AAC_HWIF_UNKNOWN) {
+ device_printf(sc->aac_dev, "unknown hardware type\n");
+ error = ENXIO;
+ goto out;
+ }
/*
* Do bus-independent initialisation.
OpenPOWER on IntegriCloud