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/hifn7751.c | |
parent | f8eb256c65fe796edfbbb90ae32c5502ca585795 (diff) |
Add a simplistic table driven lookup routine and use it where appropriate.
Diffstat (limited to 'sys/dev/pci/hifn7751.c')
-rw-r--r-- | sys/dev/pci/hifn7751.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/sys/dev/pci/hifn7751.c b/sys/dev/pci/hifn7751.c index f7ba7580adf..5be93e94619 100644 --- a/sys/dev/pci/hifn7751.c +++ b/sys/dev/pci/hifn7751.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hifn7751.c,v 1.132 2002/08/01 18:29:59 jason Exp $ */ +/* $OpenBSD: hifn7751.c,v 1.133 2002/11/19 18:40:17 jason Exp $ */ /* * Invertex AEON / Hifn 7751 driver @@ -116,26 +116,22 @@ u_int32_t hifn_read_4(struct hifn_softc *, int, bus_size_t); struct hifn_stats hifnstats; +const struct pci_matchid hifn_devices[] = { + { PCI_VENDOR_INVERTEX, PCI_PRODUCT_INVERTEX_AEON }, + { PCI_VENDOR_HIFN, PCI_PRODUCT_HIFN_7751 }, + { PCI_VENDOR_HIFN, PCI_PRODUCT_HIFN_7811 }, + { PCI_VENDOR_HIFN, PCI_PRODUCT_HIFN_7951 }, + { PCI_VENDOR_NETSEC, PCI_PRODUCT_NETSEC_7751 }, +}; + int hifn_probe(parent, match, aux) struct device *parent; void *match; void *aux; { - struct pci_attach_args *pa = (struct pci_attach_args *) aux; - - if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_INVERTEX && - PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_INVERTEX_AEON) - return (1); - if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_HIFN && - (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_HIFN_7751 || - PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_HIFN_7951 || - PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_HIFN_7811)) - return (1); - if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_NETSEC && - PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_NETSEC_7751) - return (1); - return (0); + return (pci_matchbyid((struct pci_attach_args *)aux, hifn_devices, + sizeof(hifn_devices)/sizeof(hifn_devices[0]))); } void |