summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_ste.c
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2002-11-19 18:40:18 +0000
committerJason Wright <jason@cvs.openbsd.org>2002-11-19 18:40:18 +0000
commit6de774d6cba7e3cd5ab65ca8bd33d4e854d185ac (patch)
treee947e412c38cb1b45d34a5c858acb00564f371df /sys/dev/pci/if_ste.c
parentf8eb256c65fe796edfbbb90ae32c5502ca585795 (diff)
Add a simplistic table driven lookup routine and use it where appropriate.
Diffstat (limited to 'sys/dev/pci/if_ste.c')
-rw-r--r--sys/dev/pci/if_ste.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/sys/dev/pci/if_ste.c b/sys/dev/pci/if_ste.c
index 5ac41f28971..7ceb645127d 100644
--- a/sys/dev/pci/if_ste.c
+++ b/sys/dev/pci/if_ste.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ste.c,v 1.16 2002/03/14 01:26:59 millert Exp $ */
+/* $OpenBSD: if_ste.c,v 1.17 2002/11/19 18:40:17 jason Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
* Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
@@ -827,6 +827,10 @@ void ste_stats_update(xsc)
return;
}
+const struct pci_matchid ste_devices[] = {
+ { PCI_VENDOR_SUNDANCE, PCI_PRODUCT_SUNDANCE_ST201 },
+ { PCI_VENDOR_DLINK, PCI_PRODUCT_DLINK_550TX },
+};
/*
* Probe for a Sundance ST201 chip. Check the PCI vendor and device
@@ -836,17 +840,8 @@ int ste_probe(parent, match, aux)
struct device *parent;
void *match, *aux;
{
- struct pci_attach_args *pa = (struct pci_attach_args *)aux;
-
- if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_SUNDANCE &&
- PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_SUNDANCE_ST201)
- return(1);
-
- if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_DLINK &&
- PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_DLINK_550TX)
- return(1);
-
- return(0);
+ return (pci_matchbyid((struct pci_attach_args *)aux, ste_devices,
+ sizeof(ste_devices)/sizeof(ste_devices[0])));
}
/*