summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2006-05-16 02:32:40 +0000
committerBrad Smith <brad@cvs.openbsd.org>2006-05-16 02:32:40 +0000
commit542f7ab7b64733538f37871970357591e9d71e67 (patch)
tree8652cd2da0442b3909e96e1c1813c4973e5a6bf3 /sys/dev
parent2a8096874920510930324b7db691abc979203c67 (diff)
attach 8139's capable of C+ mode to the re(4) driver, instead of the rl(4)
driver.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/if_re_pci.c14
-rw-r--r--sys/dev/pci/if_rl_pci.c10
2 files changed, 20 insertions, 4 deletions
diff --git a/sys/dev/pci/if_re_pci.c b/sys/dev/pci/if_re_pci.c
index 2f59fec308e..a6b1f77f47f 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.6 2006/03/27 17:43:25 brad Exp $ */
+/* $OpenBSD: if_re_pci.c,v 1.7 2006/05/16 02:32:39 brad Exp $ */
/*
* Copyright (c) 2005 Peter Valchev <pvalchev@openbsd.org>
@@ -97,6 +97,12 @@ re_pci_probe(struct device *parent, void *match, void *aux)
subid = pci_conf_read(pc, pa->pa_tag, PCI_SUBSYS_ID_REG);
+ /* C+ mode 8139's */
+ if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_REALTEK &&
+ PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_REALTEK_RT8139 &&
+ PCI_REVISION(pa->pa_class) == 0x20)
+ return (1);
+
if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_LINKSYS &&
PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_LINKSYS_EG1032 &&
subid == RE_LINKSYS_EG1032_SUBID)
@@ -189,7 +195,11 @@ re_pci_attach(struct device *parent, struct device *self, void *aux)
sc->sc_dmat = pa->pa_dmat;
sc->sc_flags |= RL_ENABLED;
- sc->rl_type = RL_8169;
+
+ if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_REALTEK_RT8139)
+ sc->rl_type = RL_8139;
+ else
+ sc->rl_type = RL_8169;
/* Call bus-independent attach routine */
re_attach_common(sc);
diff --git a/sys/dev/pci/if_rl_pci.c b/sys/dev/pci/if_rl_pci.c
index 59a8b7ef875..32c82485fb5 100644
--- a/sys/dev/pci/if_rl_pci.c
+++ b/sys/dev/pci/if_rl_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_rl_pci.c,v 1.12 2006/02/24 00:26:16 brad Exp $ */
+/* $OpenBSD: if_rl_pci.c,v 1.13 2006/05/16 02:32:39 brad Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -96,7 +96,6 @@ const struct pci_matchid rl_pci_devices[] = {
{ PCI_VENDOR_DLINK, PCI_PRODUCT_DLINK_530TXPLUS },
{ PCI_VENDOR_NORTEL, PCI_PRODUCT_NORTEL_BS21 },
{ PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8129 },
- { PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8139 },
{ PCI_VENDOR_TTTECH, PCI_PRODUCT_TTTECH_MC322 }
};
@@ -106,6 +105,13 @@ rl_pci_match(parent, match, aux)
void *match;
void *aux;
{
+ struct pci_attach_args *pa = aux;
+
+ if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_REALTEK &&
+ PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_REALTEK_RT8139 &&
+ PCI_REVISION(pa->pa_class) == 0x10)
+ return (1);
+
return (pci_matchbyid((struct pci_attach_args *)aux, rl_pci_devices,
sizeof(rl_pci_devices)/sizeof(rl_pci_devices[0])));
}