diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2013-03-07 01:03:58 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2013-03-07 01:03:58 +0000 |
commit | d2ba37c4fe6ec9ad1859293d84a64ca54bdf6976 (patch) | |
tree | b7e7f523366815912df9009939fb5366ffdf6577 /sys/dev | |
parent | 5b43cb86e84c801ada139b6d3dd2241b4ad7c9d6 (diff) |
Fix and simplify determining whether we're using a 8129 or 8139 chipset. Only
the 8129 PCI id is a 8129, everything else is a 8139.
Allows the D-Link DFE-520TX board to work and would ensure proper determination
of the chipset for at least the 8138 based boards (PCI/CardBus).
Tested by kirby@
Ok kirby@ sthen@ chris@
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/cardbus/if_rl_cardbus.c | 3 | ||||
-rw-r--r-- | sys/dev/ic/rtl81x9.c | 16 | ||||
-rw-r--r-- | sys/dev/pci/if_rl_pci.c | 7 |
3 files changed, 9 insertions, 17 deletions
diff --git a/sys/dev/cardbus/if_rl_cardbus.c b/sys/dev/cardbus/if_rl_cardbus.c index 38012b8d79b..175d5fd4c50 100644 --- a/sys/dev/cardbus/if_rl_cardbus.c +++ b/sys/dev/cardbus/if_rl_cardbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_rl_cardbus.c,v 1.22 2011/04/02 17:47:04 jasper Exp $ */ +/* $OpenBSD: if_rl_cardbus.c,v 1.23 2013/03/07 01:03:57 brad Exp $ */ /* $NetBSD: if_rl_cardbus.c,v 1.3.8.3 2001/11/14 19:14:02 nathanw Exp $ */ /* @@ -203,7 +203,6 @@ rl_cardbus_attach(struct device *parent, struct device *self, void *aux) } printf(": irq %d", csc->sc_intrline); - /* XXX - hardcode this, for now */ sc->rl_type = RL_8139; rl_attach(sc); diff --git a/sys/dev/ic/rtl81x9.c b/sys/dev/ic/rtl81x9.c index 4e06696367e..c1187c728a3 100644 --- a/sys/dev/ic/rtl81x9.c +++ b/sys/dev/ic/rtl81x9.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtl81x9.c,v 1.76 2012/11/29 21:10:32 brad Exp $ */ +/* $OpenBSD: rtl81x9.c,v 1.77 2013/03/07 01:03:57 brad Exp $ */ /* * Copyright (c) 1997, 1998 @@ -1125,7 +1125,7 @@ rl_attach(struct rl_softc *sc) { struct ifnet *ifp = &sc->sc_arpcom.ac_if; int rseg, i; - u_int16_t rl_id, rl_did; + u_int16_t rl_id; caddr_t kva; int addr_len; @@ -1148,18 +1148,6 @@ rl_attach(struct rl_softc *sc) printf(", address %s\n", ether_sprintf(sc->sc_arpcom.ac_enaddr)); - rl_read_eeprom(sc, (caddr_t)&rl_did, RL_EE_PCI_DID, addr_len, 1, 0); - - if (rl_did == RT_DEVICEID_8139 || rl_did == ACCTON_DEVICEID_5030 || - rl_did == DELTA_DEVICEID_8139 || rl_did == ADDTRON_DEVICEID_8139 || - rl_did == DLINK_DEVICEID_8139 || rl_did == DLINK_DEVICEID_8139_2 || - rl_did == ABOCOM_DEVICEID_8139) - sc->rl_type = RL_8139; - else if (rl_did == RT_DEVICEID_8129) - sc->rl_type = RL_8129; - else - sc->rl_type = RL_UNKNOWN; /* could be 8138 or other */ - if (bus_dmamem_alloc(sc->sc_dmat, RL_RXBUFLEN + 32, PAGE_SIZE, 0, &sc->sc_rx_seg, 1, &rseg, BUS_DMA_NOWAIT | BUS_DMA_ZERO)) { printf("\n%s: can't alloc rx buffers\n", sc->sc_dev.dv_xname); diff --git a/sys/dev/pci/if_rl_pci.c b/sys/dev/pci/if_rl_pci.c index d7063a9bc8b..01488d7c81a 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.25 2013/02/08 08:00:34 jasper Exp $ */ +/* $OpenBSD: if_rl_pci.c,v 1.26 2013/03/07 01:03:57 brad Exp $ */ /* * Copyright (c) 1997, 1998 @@ -183,6 +183,11 @@ rl_pci_attach(struct device *parent, struct device *self, void *aux) sc->sc_dmat = pa->pa_dmat; + if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_REALTEK_RT8129) + sc->rl_type = RL_8129; + else + sc->rl_type = RL_8139; + rl_attach(sc); } |