diff options
| author | thorpej <thorpej@NetBSD.org> | 2001-06-30 17:02:54 +0000 |
|---|---|---|
| committer | thorpej <thorpej@NetBSD.org> | 2001-06-30 17:02:54 +0000 |
| commit | 4e30120ef02b133d055ec24127eb55d5eedcf6be (patch) | |
| tree | 2d1c4b841af3953e8dc6b55f1fedfdbc2a582226 /sys | |
| parent | dd90796b3decf1e88f1ebe8643192c87db75eb50 (diff) | |
Sync the Tx descriptors pre- and post- on the Tigon 2.
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/dev/pci/if_ti.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/sys/dev/pci/if_ti.c b/sys/dev/pci/if_ti.c index 2a20717c534..dfd43850bb6 100644 --- a/sys/dev/pci/if_ti.c +++ b/sys/dev/pci/if_ti.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_ti.c,v 1.34 2001/06/30 16:34:59 thorpej Exp $ */ +/* $NetBSD: if_ti.c,v 1.35 2001/06/30 17:02:54 thorpej Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -2159,6 +2159,7 @@ static void ti_txeof_tigon2(sc) struct ti_tx_desc *cur_tx = NULL; struct ifnet *ifp; struct txdmamap_pool_entry *dma; + int firstidx, cnt; ifp = &sc->ethercom.ec_if; @@ -2166,6 +2167,8 @@ static void ti_txeof_tigon2(sc) * Go through our tx ring and free mbufs for those * frames that have been sent. */ + firstidx = sc->ti_tx_saved_considx; + cnt = 0; while (sc->ti_tx_saved_considx != sc->ti_tx_considx.ti_idx) { u_int32_t idx = 0; @@ -2186,11 +2189,15 @@ static void ti_txeof_tigon2(sc) SIMPLEQ_INSERT_HEAD(&sc->txdma_list, dma, link); sc->txdma[idx] = NULL; } + cnt++; sc->ti_txcnt--; TI_INC(sc->ti_tx_saved_considx, TI_TX_RING_CNT); ifp->if_timer = 0; } + if (cnt != 0) + TI_CDTXSYNC(sc, firstidx, cnt, BUS_DMASYNC_POSTWRITE); + if (cur_tx != NULL) ifp->if_flags &= ~IFF_OACTIVE; @@ -2371,7 +2378,7 @@ static int ti_encap_tigon2(sc, m_head, txidx) u_int32_t *txidx; { struct ti_tx_desc *f = NULL; - u_int32_t frag, cur, cnt = 0; + u_int32_t frag, firstfrag, cur, cnt = 0; struct txdmamap_pool_entry *dma; bus_dmamap_t dmamap; int error, i; @@ -2395,7 +2402,7 @@ static int ti_encap_tigon2(sc, m_head, txidx) return (ENOMEM); } - cur = frag = *txidx; + cur = firstfrag = frag = *txidx; if (m_head->m_pkthdr.csum_flags & M_CSUM_IPv4) { /* IP header checksum field must be 0! */ @@ -2448,6 +2455,9 @@ static int ti_encap_tigon2(sc, m_head, txidx) bus_dmamap_sync(sc->sc_dmat, dmamap, 0, dmamap->dm_mapsize, BUS_DMASYNC_PREWRITE); + /* Sync the descriptors we are using. */ + TI_CDTXSYNC(sc, firstfrag, cnt, BUS_DMASYNC_PREWRITE); + sc->ti_cdata.ti_tx_chain[cur] = m_head; SIMPLEQ_REMOVE_HEAD(&sc->txdma_list, dma, link); sc->txdma[cur] = dma; |
