Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci Sync the Tx descriptors pre- and post- on the Ti...



details:   https://anonhg.NetBSD.org/src/rev/44d6d543d7e9
branches:  trunk
changeset: 511942:44d6d543d7e9
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sat Jun 30 17:02:54 2001 +0000

description:
Sync the Tx descriptors pre- and post- on the Tigon 2.

diffstat:

 sys/dev/pci/if_ti.c |  16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diffs (70 lines):

diff -r 0e5fff3f4942 -r 44d6d543d7e9 sys/dev/pci/if_ti.c
--- a/sys/dev/pci/if_ti.c       Sat Jun 30 16:55:03 2001 +0000
+++ b/sys/dev/pci/if_ti.c       Sat Jun 30 17:02:54 2001 +0000
@@ -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 @@
        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 @@
         * 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 @@
                        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 @@
        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 @@
                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 @@
        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;



Home | Main Index | Thread Index | Old Index