1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-16 10:20:30 +00:00

Add family support to allow the driver to attach to new devices that

share the same interface.

Submitted by:	Achim Leubner at Adaptec
This commit is contained in:
Ed Maste 2007-12-07 18:05:41 +00:00
parent 9596916c4d
commit 7ea2d5586c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=174412
3 changed files with 92 additions and 10 deletions

View File

@ -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 "

View File

@ -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);

View File

@ -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.
*/