summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2007-12-07 18:05:41 +0000
committeremaste <emaste@FreeBSD.org>2007-12-07 18:05:41 +0000
commit54fed38dbc7812cca7816359b3fdde5159dd733d (patch)
tree58f3083882d83c01b3a5d186d3b8837e62b45eaa
parent2cccff443ff96b4a98fa8d9e0e28049d977a1a78 (diff)
downloadFreeBSD-src-54fed38dbc7812cca7816359b3fdde5159dd733d.zip
FreeBSD-src-54fed38dbc7812cca7816359b3fdde5159dd733d.tar.gz
Add family support to allow the driver to attach to new devices that
share the same interface. Submitted by: Achim Leubner at Adaptec
-rw-r--r--sys/dev/aac/aac.c22
-rw-r--r--sys/dev/aac/aac_pci.c28
-rw-r--r--sys/dev/aac/aacreg.h52
3 files changed, 92 insertions, 10 deletions
diff --git a/sys/dev/aac/aac.c b/sys/dev/aac/aac.c
index cbb5963..27949c8 100644
--- a/sys/dev/aac/aac.c
+++ b/sys/dev/aac/aac.c
@@ -2728,12 +2728,29 @@ aac_describe_controller(struct aac_softc *sc)
{
struct aac_fib *fib;
struct aac_adapter_info *info;
+ char *adapter_type = "Adaptec RAID controller";
debug_called(2);
mtx_lock(&sc->aac_io_lock);
aac_alloc_sync_fib(sc, &fib);
+ if (sc->supported_options & AAC_SUPPORTED_SUPPLEMENT_ADAPTER_INFO) {
+ fib->data[0] = 0;
+ if (aac_sync_fib(sc, RequestSupplementAdapterInfo, 0, fib, 1))
+ device_printf(sc->aac_dev,
+ "RequestSupplementAdapterInfo failed\n");
+ else
+ adapter_type = ((struct aac_supplement_adapter_info *)
+ &fib->data[0])->AdapterTypeText;
+ }
+ 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);
+
fib->data[0] = 0;
if (aac_sync_fib(sc, RequestAdapterInfo, 0, fib, 1)) {
device_printf(sc->aac_dev, "RequestAdapterInfo failed\n");
@@ -2746,11 +2763,6 @@ aac_describe_controller(struct aac_softc *sc)
info = (struct aac_adapter_info *)&fib->data[0];
sc->aac_revision = info->KernelRevision;
- device_printf(sc->aac_dev, "Adaptec Raid Controller %d.%d.%d-%d\n",
- AAC_DRIVER_VERSION >> 24,
- (AAC_DRIVER_VERSION >> 16) & 0xFF,
- AAC_DRIVER_VERSION & 0xFF,
- AAC_DRIVER_BUILD);
if (bootverbose) {
device_printf(sc->aac_dev, "%s %dMHz, %dMB memory "
diff --git a/sys/dev/aac/aac_pci.c b/sys/dev/aac/aac_pci.c
index a16917f..9fdad54 100644
--- a/sys/dev/aac/aac_pci.c
+++ b/sys/dev/aac/aac_pci.c
@@ -272,18 +272,36 @@ struct aac_ident
"AOC-USAS-S8iR-LP"},
{0, 0, 0, 0, 0, 0, 0}
};
+struct aac_ident
+aac_family_identifiers[] = {
+ {0x9005, 0x0285, 0, 0, AAC_HWIF_I960RX, 0,
+ "Adaptec RAID Controller"},
+ {0x9005, 0x0286, 0, 0, AAC_HWIF_RKT, 0,
+ "Adaptec RAID Controller"},
+ {0, 0, 0, 0, 0, 0, 0}
+};
static struct aac_ident *
aac_find_ident(device_t dev)
{
struct aac_ident *m;
+ u_int16_t vendid, devid, sub_vendid, sub_devid;
+
+ vendid = pci_get_vendor(dev);
+ devid = pci_get_device(dev);
+ sub_vendid = pci_get_subvendor(dev);
+ sub_devid = pci_get_subdevice(dev);
for (m = aac_identifiers; m->vendor != 0; m++) {
- if ((m->vendor == pci_get_vendor(dev)) &&
- (m->device == pci_get_device(dev)) &&
- (m->subvendor == pci_get_subvendor(dev)) &&
- (m->subdevice == pci_get_subdevice(dev)))
- return (m);
+ if ((m->vendor == vendid) && (m->device == devid) &&
+ (m->subvendor == sub_vendid) &&
+ (m->subdevice == sub_devid))
+ return (m);
+ }
+
+ for (m = aac_family_identifiers; m->vendor != 0; m++) {
+ if ((m->vendor == vendid) && (m->device == devid))
+ return (m);
}
return (NULL);
diff --git a/sys/dev/aac/aacreg.h b/sys/dev/aac/aacreg.h
index dacdead..dae21a4 100644
--- a/sys/dev/aac/aacreg.h
+++ b/sys/dev/aac/aacreg.h
@@ -604,6 +604,58 @@ struct aac_adapter_info {
AAC_OemFlavor OemVariant;
} __packed;
+/*
+ * Structure used to respond to a RequestSupplementAdapterInfo fib.
+ */
+struct vpd_info {
+ u_int8_t AssemblyPn[8];
+ u_int8_t FruPn[8];
+ u_int8_t BatteryFruPn[8];
+ u_int8_t EcVersionString[8];
+ u_int8_t Tsid[12];
+} __packed;
+
+#define MFG_PCBA_SERIAL_NUMBER_WIDTH 12
+#define MFG_WWN_WIDTH 8
+
+struct aac_supplement_adapter_info {
+ /* The assigned Adapter Type Text, extra byte for null termination */
+ int8_t AdapterTypeText[17+1];
+ /* Pad for the text above */
+ int8_t Pad[2];
+ /* Size in bytes of the memory that is flashed */
+ u_int32_t FlashMemoryByteSize;
+ /* The assigned IMAGEID_xxx for this adapter */
+ u_int32_t FlashImageId;
+ /*
+ * The maximum number of Phys available on a SATA/SAS
+ * Controller, 0 otherwise
+ */
+ u_int32_t MaxNumberPorts;
+ /* Version of expansion area */
+ u_int32_t Version;
+ u_int32_t FeatureBits;
+ u_int8_t SlotNumber;
+ u_int8_t ReservedPad0[3];
+ u_int8_t BuildDate[12];
+ /* The current number of Ports on a SAS controller, 0 otherwise */
+ u_int32_t CurrentNumberPorts;
+
+ struct vpd_info VpdInfo;
+
+ /* Firmware Revision (Vmaj.min-dash.) */
+ struct FsaRevision FlashFirmwareRevision;
+ u_int32_t RaidTypeMorphOptions;
+ /* Firmware's boot code Revision (Vmaj.min-dash.) */
+ struct FsaRevision FlashFirmwareBootRevision;
+ /* PCBA serial no. from th MFG sector */
+ u_int8_t MfgPcbaSerialNo[MFG_PCBA_SERIAL_NUMBER_WIDTH];
+ /* WWN from the MFG sector */
+ u_int8_t MfgWWNName[MFG_WWN_WIDTH];
+ /* Growth Area for future expansion ((7*4) - 12 - 8)/4 = 2 words */
+ u_int32_t ReservedGrowth[2];
+} __packed;
+
/*
* Monitor/Kernel interface.
*/
OpenPOWER on IntegriCloud