summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci/if_re_pci.c
diff options
context:
space:
mode:
authorbrad <brad@openbsd.org>2006-05-23 00:41:50 +0000
committerbrad <brad@openbsd.org>2006-05-23 00:41:50 +0000
commit182c2be4e2448e340c10e515583eebc9ac6bbf3f (patch)
tree6c2f4d7bcad086175009422897becaf51f0dc9dc /sys/dev/pci/if_re_pci.c
parentCheck for NULL cookies before calling hook_disestablish(). Just in case (diff)
downloadwireguard-openbsd-182c2be4e2448e340c10e515583eebc9ac6bbf3f.tar.xz
wireguard-openbsd-182c2be4e2448e340c10e515583eebc9ac6bbf3f.zip
according to the Linux 8139cp driver the TTTech MC322 adapter uses
the 8139C+ chipset, so attach with re(4) instead of rl(4). ok dlg@
Diffstat (limited to 'sys/dev/pci/if_re_pci.c')
-rw-r--r--sys/dev/pci/if_re_pci.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/dev/pci/if_re_pci.c b/sys/dev/pci/if_re_pci.c
index a6b1f77f47f..abe7eb22107 100644
--- a/sys/dev/pci/if_re_pci.c
+++ b/sys/dev/pci/if_re_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_re_pci.c,v 1.7 2006/05/16 02:32:39 brad Exp $ */
+/* $OpenBSD: if_re_pci.c,v 1.8 2006/05/23 00:41:50 brad Exp $ */
/*
* Copyright (c) 2005 Peter Valchev <pvalchev@openbsd.org>
@@ -67,7 +67,8 @@ const struct pci_matchid re_pci_devices[] = {
{ PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8169 },
{ PCI_VENDOR_COREGA, PCI_PRODUCT_COREGA_CGLAPCIGT },
{ PCI_VENDOR_DLINK, PCI_PRODUCT_DLINK_DGE528T },
- { PCI_VENDOR_USR2, PCI_PRODUCT_USR2_USR997902 }
+ { PCI_VENDOR_USR2, PCI_PRODUCT_USR2_USR997902 },
+ { PCI_VENDOR_TTTECH, PCI_PRODUCT_TTTECH_MC322 }
};
#define RE_LINKSYS_EG1032_SUBID 0x00241737
@@ -196,7 +197,13 @@ re_pci_attach(struct device *parent, struct device *self, void *aux)
sc->sc_dmat = pa->pa_dmat;
sc->sc_flags |= RL_ENABLED;
- if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_REALTEK_RT8139)
+ if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_REALTEK) {
+ if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_REALTEK_RT8139)
+ sc->rl_type = RL_8139;
+ else
+ sc->rl_type = RL_8169;
+ } else if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_TTTECH &&
+ PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_TTTECH_MC322)
sc->rl_type = RL_8139;
else
sc->rl_type = RL_8169;