diff options
author | 2006-03-12 17:44:07 +0000 | |
---|---|---|
committer | 2006-03-12 17:44:07 +0000 | |
commit | 1d96d0243be9827fa31cebe9c0e93113cb8da05d (patch) | |
tree | 7fd0cc2d0ecc78745d5b8602a4c44ee5c5d61aa0 /sys | |
parent | with pcn(4) now in place remove or replace the references to PCI le(4) (diff) | |
download | wireguard-openbsd-1d96d0243be9827fa31cebe9c0e93113cb8da05d.tar.xz wireguard-openbsd-1d96d0243be9827fa31cebe9c0e93113cb8da05d.zip |
Make use of pci_matchbyid().
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/if_pcn.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/sys/dev/pci/if_pcn.c b/sys/dev/pci/if_pcn.c index 1094047196f..e1b03d47ac5 100644 --- a/sys/dev/pci/if_pcn.c +++ b/sys/dev/pci/if_pcn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pcn.c,v 1.7 2006/03/12 17:29:48 martin Exp $ */ +/* $OpenBSD: if_pcn.c,v 1.8 2006/03/12 17:44:07 brad Exp $ */ /* $NetBSD: if_pcn.c,v 1.26 2005/05/07 09:15:44 is Exp $ */ /* @@ -446,6 +446,11 @@ struct cfattach pcn_ca = { sizeof(struct pcn_softc), pcn_match, pcn_attach, }; +const struct pci_matchid pcn_devices[] = { + { PCI_VENDOR_AMD, PCI_PRODUCT_AMD_PCNET_PCI }, + { PCI_VENDOR_AMD, PCI_PRODUCT_AMD_PCHOME_PCI } +}; + struct cfdriver pcn_cd = { 0, "pcn", DV_IFNET }; @@ -519,15 +524,8 @@ pcn_match(struct device *parent, void *match, void *aux) PCI_CLASS(pa->pa_class) == PCI_CLASS_NETWORK) return(1); - if (PCI_VENDOR(pa->pa_id) != PCI_VENDOR_AMD) - return (0); - - switch (PCI_PRODUCT(pa->pa_id)) { - case PCI_PRODUCT_AMD_PCNET_PCI: - return (1); - } - - return (0); + return (pci_matchbyid((struct pci_attach_args *)aux, pcn_devices, + sizeof(pcn_devices)/sizeof(pcn_devices[0]))); } void |