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 without the
STGE_CU_BUG hack. So remove the STGE_CU_BUG hack.
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.

Approved by Jason Thorpe.
This commit is contained in:
bouyer 2005-06-25 21:43:38 +00:00
parent 71901faf8f
commit 61f82d5486
1 changed files with 12 additions and 18 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_stge.c,v 1.27 2005/05/16 21:35:32 bouyer Exp $ */
/* $NetBSD: if_stge.c,v 1.28 2005/06/25 21:43:38 bouyer Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_stge.c,v 1.27 2005/05/16 21:35:32 bouyer Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_stge.c,v 1.28 2005/06/25 21:43:38 bouyer Exp $");
#include "bpfilter.h"
@ -1541,12 +1541,9 @@ stge_init(struct ifnet *ifp)
STGE_RXCHAIN_RESET(sc);
/* Set the station address. */
bus_space_write_2(st, sh, STGE_StationAddress0,
LLADDR(ifp->if_sadl)[0] | (LLADDR(ifp->if_sadl)[1] << 8));
bus_space_write_2(st, sh, STGE_StationAddress1,
LLADDR(ifp->if_sadl)[2] | (LLADDR(ifp->if_sadl)[3] << 8));
bus_space_write_2(st, sh, STGE_StationAddress2,
LLADDR(ifp->if_sadl)[4] | (LLADDR(ifp->if_sadl)[5] << 8));
for (i = 0; i < 6; i++)
bus_space_write_1(st, sh, STGE_StationAddress0 + i,
LLADDR(ifp->if_sadl)[i]);
/*
* Set the statistics masks. Disable all the RMON stats,
@ -1586,6 +1583,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
@ -1649,6 +1650,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);
}
/*
@ -1859,16 +1863,6 @@ stge_set_filter(struct stge_softc *sc)
if (ifp->if_flags & IFF_BROADCAST)
sc->sc_ReceiveMode |= RM_ReceiveBroadcast;
#ifdef STGE_CU_BUG
/*
* Some cards (Sundance TI, copper) only seem to work
* right now if we put them into promiscuous mode. It
* probably is the Marvell PHY stuff that isn't quite
* right.
*/
ifp->if_flags |= IFF_PROMISC;
#endif
if (ifp->if_flags & IFF_PROMISC) {
sc->sc_ReceiveMode |= RM_ReceiveAllFrames;
goto allmulti;