diff options
author | 2005-07-22 03:10:17 +0000 | |
---|---|---|
committer | 2005-07-22 03:10:17 +0000 | |
commit | 1277a05fdb908cc1e615fc9fa9e8c0655e8a4bf6 (patch) | |
tree | 707d48b237c607f1d73ae668426fff234673c1ad | |
parent | document KERN_CPTIME2, and update description of KERN_CPTIME; ok jmc (diff) | |
download | wireguard-openbsd-1277a05fdb908cc1e615fc9fa9e8c0655e8a4bf6.tar.xz wireguard-openbsd-1277a05fdb908cc1e615fc9fa9e8c0655e8a4bf6.zip |
also take the PCI subsystem id into consideration when trying to probe
for Linksys EG1032 cards, that way we do not try and attach to newer
rev 3 cards that use the RealTek 8169S chipset.
-rw-r--r-- | sys/dev/pci/if_sk.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/sys/dev/pci/if_sk.c b/sys/dev/pci/if_sk.c index 95312f335a1..c524c9d37ea 100644 --- a/sys/dev/pci/if_sk.c +++ b/sys/dev/pci/if_sk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sk.c,v 1.73 2005/07/21 15:23:27 brad Exp $ */ +/* $OpenBSD: if_sk.c,v 1.74 2005/07/22 03:10:17 brad Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -221,7 +221,6 @@ const struct pci_matchid skc_devices[] = { { PCI_VENDOR_DLINK, PCI_PRODUCT_DLINK_DGE530T }, { PCI_VENDOR_DLINK, PCI_PRODUCT_DLINK_DGE560T }, { PCI_VENDOR_DLINK, PCI_PRODUCT_DLINK_DGE560T_2 }, - { PCI_VENDOR_LINKSYS, PCI_PRODUCT_LINKSYS_EG1032 }, { PCI_VENDOR_LINKSYS, PCI_PRODUCT_LINKSYS_EG1064 }, { PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_SK_V2 }, { PCI_VENDOR_MARVELL, PCI_PRODUCT_MARVELL_SK_V2_BELKIN }, @@ -244,6 +243,8 @@ const struct pci_matchid skc_devices[] = { { PCI_VENDOR_SCHNEIDERKOCH, PCI_PRODUCT_SCHNEIDERKOCH_SK9Exx }, }; +#define SK_LINKSYS_EG1032_SUBID 0x00151737 + static inline u_int32_t sk_win_read_4(struct sk_softc *sc, u_int32_t reg) { @@ -1098,6 +1099,17 @@ sk_ioctl(struct ifnet *ifp, u_long command, caddr_t data) int skc_probe(struct device *parent, void *match, void *aux) { + struct pci_attach_args *pa = aux; + pci_chipset_tag_t pc = pa->pa_pc; + pcireg_t subid; + + subid = pci_conf_read(pc, pa->pa_tag, PCI_SUBSYS_ID_REG); + + if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_LINKSYS && + PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_LINKSYS_EG1032 && + subid == SK_LINKSYS_EG1032_SUBID) + return (1); + return (pci_matchbyid((struct pci_attach_args *)aux, skc_devices, sizeof(skc_devices)/sizeof(skc_devices[0]))); } |