Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/ic Some of the Tulip clone chips (like the Winbond a...
details: https://anonhg.NetBSD.org/src/rev/49cf1ebc6bf5
branches: trunk
changeset: 475971:49cf1ebc6bf5
user: thorpej <thorpej%NetBSD.org@localhost>
date: Wed Sep 01 05:07:03 1999 +0000
description:
Some of the Tulip clone chips (like the Winbond and ASIX) want the
IC bit set in the *first* descriptor of the outgoing packet. Appease
them.
diffstat:
sys/dev/ic/tulip.c | 30 ++++++++++++++++++++++++++++--
sys/dev/ic/tulipvar.h | 3 ++-
2 files changed, 30 insertions(+), 3 deletions(-)
diffs (82 lines):
diff -r e7bf1c12e937 -r 49cf1ebc6bf5 sys/dev/ic/tulip.c
--- a/sys/dev/ic/tulip.c Wed Sep 01 05:03:41 1999 +0000
+++ b/sys/dev/ic/tulip.c Wed Sep 01 05:07:03 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tulip.c,v 1.1 1999/09/01 00:32:41 thorpej Exp $ */
+/* $NetBSD: tulip.c,v 1.2 1999/09/01 05:07:03 thorpej Exp $ */
/*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -202,6 +202,18 @@
break;
}
+ /*
+ * Set up various chip-specific quirks.
+ */
+ switch (sc->sc_chip) {
+ case TULIP_CHIP_WB89C840F:
+ sc->sc_flags |= TULIPF_IC_FS;
+ break;
+
+ default:
+ /* Nothing. */
+ }
+
SIMPLEQ_INIT(&sc->sc_txfreeq);
SIMPLEQ_INIT(&sc->sc_txdirtyq);
@@ -363,7 +375,7 @@
{
struct tulip_softc *sc = ifp->if_softc;
struct mbuf *m0, *m;
- struct tulip_txsoft *txs;
+ struct tulip_txsoft *txs, *last_txs;
bus_dmamap_t dmamap;
int error, firsttx, nexttx, lasttx, ofree, seg;
@@ -538,6 +550,8 @@
SIMPLEQ_REMOVE_HEAD(&sc->sc_txfreeq, txs, txs_q);
SIMPLEQ_INSERT_TAIL(&sc->sc_txdirtyq, txs, txs_q);
+ last_txs = txs;
+
#if NBPFILTER > 0
/*
* Pass the packet to any BPF listeners.
@@ -564,6 +578,18 @@
BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE);
/*
+ * Some clone chips want IC on the *first* segment in
+ * the packet. Appease them.
+ */
+ if ((sc->sc_flags & TULIPF_IC_FS) != 0 &&
+ last_txs->txs_firstdesc != lasttx) {
+ sc->sc_txdescs[last_txs->txs_firstdesc].td_ctl |=
+ TDCTL_Tx_IC;
+ TULIP_CDTXSYNC(sc, last_txs->txs_firstdesc, 1,
+ BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE);
+ }
+
+ /*
* The entire packet chain is set up. Give the
* first descriptor to the chip now.
*/
diff -r e7bf1c12e937 -r 49cf1ebc6bf5 sys/dev/ic/tulipvar.h
--- a/sys/dev/ic/tulipvar.h Wed Sep 01 05:03:41 1999 +0000
+++ b/sys/dev/ic/tulipvar.h Wed Sep 01 05:07:03 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tulipvar.h,v 1.1 1999/09/01 00:32:42 thorpej Exp $ */
+/* $NetBSD: tulipvar.h,v 1.2 1999/09/01 05:07:04 thorpej Exp $ */
/*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -251,6 +251,7 @@
/* sc_flags */
#define TULIPF_WANT_SETUP 0x00000001 /* want filter setup */
#define TULIPF_HAS_MII 0x00000002 /* has media on MII */
+#define TULIPF_IC_FS 0x00000004 /* IC bit on first tx seg */
#define TULIP_CDTXADDR(sc, x) ((sc)->sc_cddma + TULIP_CDTXOFF((x)))
#define TULIP_CDRXADDR(sc, x) ((sc)->sc_cddma + TULIP_CDRXOFF((x)))
Home |
Main Index |
Thread Index |
Old Index