summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_stge.c
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2005-06-28 03:48:32 +0000
committerBrad Smith <brad@cvs.openbsd.org>2005-06-28 03:48:32 +0000
commit39e78527f4301c67699e6a9529af31a7550896d6 (patch)
tree8c1de23e5c95e281e098023007042c41a87ef4cb /sys/dev/pci/if_stge.c
parent6720da1840d27ed9dc7259c956fad3452092008f (diff)
rev 1.28
Write the station address using 8-bits writes instead of 16-bits. This is what the linux driver does, and makes the DGE-550T work. Set bit 0x0020 in STGE_DebugCtrl too, the linux driver does it (the comments note this as a workaround, without more details. This doesn't seem to make things worse). Also initialize STGE_RxDMABurstThresh and STGE_RxDMAUrgentThresh, using values from the linux driver. From NetBSD
Diffstat (limited to 'sys/dev/pci/if_stge.c')
-rw-r--r--sys/dev/pci/if_stge.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/sys/dev/pci/if_stge.c b/sys/dev/pci/if_stge.c
index 69801b5244d..78084f58809 100644
--- a/sys/dev/pci/if_stge.c
+++ b/sys/dev/pci/if_stge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_stge.c,v 1.14 2005/05/24 06:14:26 brad Exp $ */
+/* $OpenBSD: if_stge.c,v 1.15 2005/06/28 03:48:31 brad Exp $ */
/* $NetBSD: if_stge.c,v 1.27 2005/05/16 21:35:32 bouyer Exp $ */
/*-
@@ -876,9 +876,9 @@ stge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
break;
case SIOCSIFMTU:
- if (ifr->ifr_mtu < ETHERMIN || ifr->ifr_mtu > ETHERMTU)
+ if (ifr->ifr_mtu < ETHERMIN || ifr->ifr_mtu > ETHERMTU) {
error = EINVAL;
- else if (ifp->if_mtu != ifr->ifr_mtu) {
+ } else if (ifp->if_mtu != ifr->ifr_mtu) {
ifp->if_mtu = ifr->ifr_mtu;
stge_init(ifp);
}
@@ -1393,12 +1393,9 @@ stge_init(struct ifnet *ifp)
STGE_RXCHAIN_RESET(sc);
/* Set the station address. */
- bus_space_write_2(st, sh, STGE_StationAddress0,
- sc->sc_arpcom.ac_enaddr[0] | sc->sc_arpcom.ac_enaddr[1] << 8);
- bus_space_write_2(st, sh, STGE_StationAddress1,
- sc->sc_arpcom.ac_enaddr[2] | sc->sc_arpcom.ac_enaddr[3] << 8);
- bus_space_write_2(st, sh, STGE_StationAddress2,
- sc->sc_arpcom.ac_enaddr[4] | sc->sc_arpcom.ac_enaddr[5] << 8);
+ for (i = 0; i < 6; i++)
+ bus_space_write_1(st, sh, STGE_StationAddress0 + i,
+ sc->sc_arpcom.ac_enaddr[i]);
/*
* Set the statistics masks. Disable all the RMON stats,
@@ -1438,6 +1435,10 @@ stge_init(struct ifnet *ifp)
/* Initialize the Tx start threshold. */
bus_space_write_2(st, sh, STGE_TxStartThresh, sc->sc_txthresh);
+ /* RX DMA thresholds, from linux */
+ bus_space_write_1(st, sh, STGE_RxDMABurstThresh, 0x30);
+ bus_space_write_1(st, sh, STGE_RxDMAUrgentThresh, 0x30);
+
/*
* Initialize the Rx DMA interrupt control register. We
* request an interrupt after every incoming packet, but
@@ -1497,6 +1498,9 @@ stge_init(struct ifnet *ifp)
/* Tx Poll Now bug work-around. */
bus_space_write_2(st, sh, STGE_DebugCtrl,
bus_space_read_2(st, sh, STGE_DebugCtrl) | 0x0010);
+ /* XXX ? from linux */
+ bus_space_write_2(st, sh, STGE_DebugCtrl,
+ bus_space_read_2(st, sh, STGE_DebugCtrl) | 0x0020);
}
/*