diff options
author | Jason Wright <jason@cvs.openbsd.org> | 2002-11-19 18:40:18 +0000 |
---|---|---|
committer | Jason Wright <jason@cvs.openbsd.org> | 2002-11-19 18:40:18 +0000 |
commit | 6de774d6cba7e3cd5ab65ca8bd33d4e854d185ac (patch) | |
tree | e947e412c38cb1b45d34a5c858acb00564f371df /sys/dev/pci/bha_pci.c | |
parent | f8eb256c65fe796edfbbb90ae32c5502ca585795 (diff) |
Add a simplistic table driven lookup routine and use it where appropriate.
Diffstat (limited to 'sys/dev/pci/bha_pci.c')
-rw-r--r-- | sys/dev/pci/bha_pci.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/dev/pci/bha_pci.c b/sys/dev/pci/bha_pci.c index 1c498f7be95..06a44c5169f 100644 --- a/sys/dev/pci/bha_pci.c +++ b/sys/dev/pci/bha_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bha_pci.c,v 1.2 2002/03/14 01:26:58 millert Exp $ */ +/* $OpenBSD: bha_pci.c,v 1.3 2002/11/19 18:40:17 jason Exp $ */ /* $NetBSD: bha_pci.c,v 1.16 1998/08/15 10:10:53 mycroft Exp $ */ /*- @@ -63,6 +63,11 @@ struct cfattach bha_pci_ca = { sizeof(struct bha_softc), bha_pci_match, bha_pci_attach }; +const struct pci_matchid bha_pci_devices[] = { + { PCI_VENDOR_BUSLOGIC, PCI_PRODUCT_BUSLOGIC_MULTIMASTER_NC }, + { PCI_VENDOR_BUSLOGIC, PCI_PRODUCT_BUSLOGIC_MULTIMASTER }, +}; + /* * Check the slots looking for a board we recognise * If we find one, note it's address (slot) and call @@ -79,11 +84,8 @@ bha_pci_match(parent, match, aux) bus_size_t iosize; int rv; - if (PCI_VENDOR(pa->pa_id) != PCI_VENDOR_BUSLOGIC) - return (0); - - if (PCI_PRODUCT(pa->pa_id) != PCI_PRODUCT_BUSLOGIC_MULTIMASTER_NC && - PCI_PRODUCT(pa->pa_id) != PCI_PRODUCT_BUSLOGIC_MULTIMASTER) + if (pci_matchbyid((struct pci_attach_args *)aux, bha_pci_devices, + sizeof(bha_pci_devices)/sizeof(bha_pci_devices[0])) == 0) return (0); if (pci_mapreg_map(pa, PCI_CBIO, PCI_MAPREG_TYPE_IO, 0, &iot, &ioh, |