diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 2001-07-07 11:24:10 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 2001-07-07 11:24:10 +0000 |
commit | 84a69334720680463ea235b8c0f325c093152eb8 (patch) | |
tree | 108e0ea443de6585409eaf89a0d40fbc9f50e0ac /sys/dev | |
parent | 04b9568ca7fde359e9ed35018cd92aeac40c1712 (diff) |
Correct PCI identifier matching. Match more devices too.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/aac_pci.c | 92 |
1 files changed, 66 insertions, 26 deletions
diff --git a/sys/dev/pci/aac_pci.c b/sys/dev/pci/aac_pci.c index 9cdf83a130f..50928969006 100644 --- a/sys/dev/pci/aac_pci.c +++ b/sys/dev/pci/aac_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aac_pci.c,v 1.2 2001/06/12 15:40:29 niklas Exp $ */ +/* $OpenBSD: aac_pci.c,v 1.3 2001/07/07 11:24:09 niklas Exp $ */ /*- * Copyright (c) 2000 Michael Smith @@ -65,18 +65,46 @@ void aac_pci_attach __P((struct device *, struct device *, void *)); struct aac_ident { u_int16_t vendor; u_int16_t device; + u_int16_t subvendor; + u_int16_t subdevice; int hwif; } aac_identifiers[] = { - { PCI_VENDOR_DELL, PCI_PRODUCT_DELL_PERC_2SI, AAC_HWIF_I960RX }, - { PCI_VENDOR_DELL, PCI_PRODUCT_DELL_PERC_3DI, AAC_HWIF_I960RX }, - { PCI_VENDOR_DELL, PCI_PRODUCT_DELL_PERC_3SI, AAC_HWIF_I960RX }, - { PCI_VENDOR_ADP2, PCI_PRODUCT_ADP2_AAC2622, AAC_HWIF_I960RX }, - { PCI_VENDOR_ADP2, PCI_PRODUCT_ADP2_AAC364, AAC_HWIF_STRONGARM }, - { PCI_VENDOR_ADP2, PCI_PRODUCT_ADP2_AAC3642, AAC_HWIF_STRONGARM }, - { PCI_VENDOR_ADP2, PCI_PRODUCT_ADP2_PERC_2QC, AAC_HWIF_STRONGARM }, - { PCI_VENDOR_ADP2, PCI_PRODUCT_ADP2_PERC_3QC, AAC_HWIF_STRONGARM }, - { PCI_VENDOR_HP, PCI_PRODUCT_HP_NETRAID_4M, AAC_HWIF_STRONGARM }, - { 0, 0, 0 } + /* Dell PERC 2/Si models */ + { PCI_VENDOR_DELL, PCI_PRODUCT_DELL_PERC_2SI, PCI_VENDOR_DELL, + PCI_PRODUCT_DELL_PERC_2SI, AAC_HWIF_I960RX }, + /* Dell PERC 3/Di models */ + { PCI_VENDOR_DELL, PCI_PRODUCT_DELL_PERC_3DI, PCI_VENDOR_DELL, + PCI_PRODUCT_DELL_PERC_3DI, AAC_HWIF_I960RX }, + { PCI_VENDOR_DELL, PCI_PRODUCT_DELL_PERC_3DI, PCI_VENDOR_DELL, + PCI_PRODUCT_DELL_PERC_3DI_SUB2, AAC_HWIF_I960RX }, + { PCI_VENDOR_DELL, PCI_PRODUCT_DELL_PERC_3DI, PCI_VENDOR_DELL, + PCI_PRODUCT_DELL_PERC_3DI_SUB3, AAC_HWIF_I960RX }, + { PCI_VENDOR_DELL, PCI_PRODUCT_DELL_PERC_3DI_2, PCI_VENDOR_DELL, + PCI_PRODUCT_DELL_PERC_3DI_2_SUB, AAC_HWIF_I960RX }, + /* Dell PERC 3/Si models */ + { PCI_VENDOR_DELL, PCI_PRODUCT_DELL_PERC_3SI, PCI_VENDOR_DELL, + PCI_PRODUCT_DELL_PERC_3SI, AAC_HWIF_I960RX }, + { PCI_VENDOR_DELL, PCI_PRODUCT_DELL_PERC_3SI_2, PCI_VENDOR_DELL, + PCI_PRODUCT_DELL_PERC_3SI_2_SUB, AAC_HWIF_I960RX }, + /* Adaptec ADP-2622 */ + { PCI_VENDOR_ADP2, PCI_PRODUCT_ADP2_AAC2622, PCI_VENDOR_ADP2, + PCI_PRODUCT_ADP2_AAC2622, AAC_HWIF_I960RX }, + /* Adaptec ADP-364 */ + { PCI_VENDOR_DEC, PCI_PRODUCT_DEC_CPQ42XX, PCI_VENDOR_ADP2, + PCI_PRODUCT_ADP2_AAC364, AAC_HWIF_STRONGARM }, + /* Adaptec ADP-3642 */ + { PCI_VENDOR_DEC, PCI_PRODUCT_DEC_CPQ42XX, PCI_VENDOR_ADP2, + PCI_PRODUCT_ADP2_AAC3642, AAC_HWIF_STRONGARM }, + /* Dell PERC 2/QC */ + { PCI_VENDOR_DEC, PCI_PRODUCT_DEC_CPQ42XX, PCI_VENDOR_ADP2, + PCI_PRODUCT_ADP2_PERC_2QC, AAC_HWIF_STRONGARM }, + /* Dell PERC 3/QC */ + { PCI_VENDOR_DEC, PCI_PRODUCT_DEC_CPQ42XX, PCI_VENDOR_ADP2, + PCI_PRODUCT_ADP2_PERC_3QC, AAC_HWIF_STRONGARM }, + /* HP NetRAID-4M */ + { PCI_VENDOR_DEC, PCI_PRODUCT_DEC_CPQ42XX, PCI_VENDOR_HP, + PCI_PRODUCT_HP_NETRAID_4M, AAC_HWIF_STRONGARM }, + { 0, 0, 0, 0 } }; struct cfattach aac_pci_ca = { @@ -94,11 +122,17 @@ aac_pci_probe(parent, match, aux) { struct pci_attach_args *pa = aux; struct aac_ident *m; + u_int32_t subsysid; for (m = aac_identifiers; m->vendor != 0; m++) if (m->vendor == PCI_VENDOR(pa->pa_id) && - m->device == PCI_PRODUCT(pa->pa_id)) - return (1); + m->device == PCI_PRODUCT(pa->pa_id)) { + subsysid = letoh32(pci_conf_read(pa->pa_pc, pa->pa_tag, + PCI_SUBSYS_ID_REG)); + if (m->subvendor == PCI_VENDOR(subsysid) && + m->subdevice == PCI_PRODUCT(subsysid)) + return (1); + } return (0); } @@ -117,6 +151,7 @@ aac_pci_attach(parent, self, aux) const char *intrstr; int state = 0; struct aac_ident *m; + u_int32_t subsysid; printf(": "); @@ -172,21 +207,26 @@ aac_pci_attach(parent, self, aux) for (m = aac_identifiers; m->vendor != 0; m++) if (m->vendor == PCI_VENDOR(pa->pa_id) && m->device == PCI_PRODUCT(pa->pa_id)) { - sc->sc_hwif = m->hwif; - switch(sc->sc_hwif) { - case AAC_HWIF_I960RX: - AAC_DPRINTF(AAC_D_MISC, - ("set hardware up for i960Rx")); - sc->sc_if = aac_rx_interface; - break; - - case AAC_HWIF_STRONGARM: - AAC_DPRINTF(AAC_D_MISC, - ("set hardware up for StrongARM")); - sc->sc_if = aac_sa_interface; + subsysid = letoh32(pci_conf_read(pa->pa_pc, pa->pa_tag, + PCI_SUBSYS_ID_REG)); + if (m->subvendor == PCI_VENDOR(subsysid) && + m->subdevice == PCI_PRODUCT(subsysid)) { + sc->sc_hwif = m->hwif; + switch(sc->sc_hwif) { + case AAC_HWIF_I960RX: + AAC_DPRINTF(AAC_D_MISC, + ("set hardware up for i960Rx")); + sc->sc_if = aac_rx_interface; + break; + + case AAC_HWIF_STRONGARM: + AAC_DPRINTF(AAC_D_MISC, + ("set hardware up for StrongARM")); + sc->sc_if = aac_sa_interface; + break; + } break; } - break; } if (aac_attach(sc)) |