diff options
author | jlemon <jlemon@FreeBSD.org> | 2000-10-13 23:34:47 +0000 |
---|---|---|
committer | jlemon <jlemon@FreeBSD.org> | 2000-10-13 23:34:47 +0000 |
commit | b894914ffdbc444483eedb55517a0fbb53981c3e (patch) | |
tree | d336c291ccccabe381a26af9256e2397c7bf0e3a /sys/dev/ida | |
parent | ee3d68a0ce9b2d73c22e3fa577945d24c169cc08 (diff) | |
download | FreeBSD-src-b894914ffdbc444483eedb55517a0fbb53981c3e.zip FreeBSD-src-b894914ffdbc444483eedb55517a0fbb53981c3e.tar.gz |
Look at both the vendor and subvendor information when determining
whether this is a Smart Array. This fixes a problem where the driver
would incorrectly match a Dell RAID device.
Reviewed by: msmith
Diffstat (limited to 'sys/dev/ida')
-rw-r--r-- | sys/dev/ida/ida_pci.c | 57 |
1 files changed, 25 insertions, 32 deletions
diff --git a/sys/dev/ida/ida_pci.c b/sys/dev/ida/ida_pci.c index 6244470a..c95db70 100644 --- a/sys/dev/ida/ida_pci.c +++ b/sys/dev/ida/ida_pci.c @@ -140,21 +140,16 @@ static struct ida_access ida_v4_access = { }; static struct ida_board board_id[] = { - { 0x4030, "Compaq SMART-2/P array controller", &ida_v3_access }, - { 0x4031, "Compaq SMART-2SL array controller", &ida_v3_access }, - { 0x4032, "Compaq Smart Array 3200 controller", &ida_v3_access }, - { 0x4033, "Compaq Smart Array 3100ES controller", &ida_v3_access }, - { 0x4034, "Compaq Smart Array 221 controller", &ida_v3_access }, - - { 0x4040, "Compaq Integrated Array controller", &ida_v4_access }, - { 0x4050, "Compaq Smart Array 4200 controller", &ida_v4_access }, - { 0x4051, "Compaq Smart Array 4250ES controller", &ida_v4_access }, - { 0x4058, "Compaq Smart Array 431 controller", &ida_v4_access }, - - { IDA_DEVICEID_DEC_SMART, - "DEC/Compaq Smart Array 4200 controller", &ida_v4_access }, - { IDA_DEVICEID_NCR_53C1510, - "NCR/Compaq Integrated Array controller", &ida_v4_access }, + { 0x40300E11, "Compaq SMART-2/P array controller", &ida_v3_access }, + { 0x40310E11, "Compaq SMART-2SL array controller", &ida_v3_access }, + { 0x40320E11, "Compaq Smart Array 3200 controller", &ida_v3_access }, + { 0x40330E11, "Compaq Smart Array 3100ES controller", &ida_v3_access }, + { 0x40340E11, "Compaq Smart Array 221 controller", &ida_v3_access }, + + { 0x40400E11, "Compaq Integrated Array controller", &ida_v4_access }, + { 0x40500E11, "Compaq Smart Array 4200 controller", &ida_v4_access }, + { 0x40510E11, "Compaq Smart Array 4250ES controller", &ida_v4_access }, + { 0x40580E11, "Compaq Smart Array 431 controller", &ida_v4_access }, { 0, "", 0 }, }; @@ -181,27 +176,29 @@ static driver_t ida_pci_driver = { static devclass_t ida_devclass; static struct ida_board * -ida_pci_match(u_int32_t id) +ida_pci_match(device_t dev) { int i; + u_int32_t id, sub_id; + + id = pci_get_devid(dev); + sub_id = pci_get_subdevice(dev) << 16 | pci_get_subvendor(dev); - for (i = 0; board_id[i].board; i++) - if (board_id[i].board == id) - return (&board_id[i]); + if (id == IDA_DEVICEID_SMART || + id == IDA_DEVICEID_DEC_SMART || + id == IDA_DEVICEID_NCR_53C1510) { + for (i = 0; board_id[i].board; i++) + if (board_id[i].board == sub_id) + return (&board_id[i]); + } return (NULL); } static int ida_pci_probe(device_t dev) { - struct ida_board *board = NULL; - u_int32_t id = pci_get_devid(dev); - - if (id == IDA_DEVICEID_SMART) - board = ida_pci_match(pci_get_subdevice(dev)); - if (id == IDA_DEVICEID_DEC_SMART || - id == IDA_DEVICEID_NCR_53C1510) - board = ida_pci_match(id); + struct ida_board *board = ida_pci_match(dev); + if (board != NULL) { device_set_desc(dev, board->desc); return (0); @@ -212,7 +209,7 @@ ida_pci_probe(device_t dev) static int ida_pci_attach(device_t dev) { - struct ida_board *board; + struct ida_board *board = ida_pci_match(dev); struct ida_softc *ida; u_int command; int error, rid; @@ -229,10 +226,6 @@ ida_pci_attach(device_t dev) ida = (struct ida_softc *)device_get_softc(dev); ida->dev = dev; - - board = ida_pci_match(pci_get_devid(dev)); - if (board == NULL) - board = ida_pci_match(pci_get_subdevice(dev)); ida->cmd = *board->accessor; ida->regs_res_type = SYS_RES_MEMORY; |