aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorJonathan Lemon <jlemon@FreeBSD.org>2000-10-13 23:34:47 +0000
committerJonathan Lemon <jlemon@FreeBSD.org>2000-10-13 23:34:47 +0000
commit834801e8afa800e414bdea2977a25154fb4508c7 (patch)
tree42a7f486e510a6f3cf539ccd74afdcde9e7de66d /sys/dev
parentb4145b0bfaddb6e775d2d2c4fdc8e1f6357a95f4 (diff)
Notes
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ida/ida_pci.c53
1 files changed, 23 insertions, 30 deletions
diff --git a/sys/dev/ida/ida_pci.c b/sys/dev/ida/ida_pci.c
index 6244470aeac1..c95db703108c 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 },
+ { 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 },
- { 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 },
+ { 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);
+ struct ida_board *board = ida_pci_match(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);
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;