summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_sis.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2005-01-04 22:39:35 +0000
committerphk <phk@FreeBSD.org>2005-01-04 22:39:35 +0000
commitf7c28f490d990c97e90328434aee93cb93fad59f (patch)
tree114f1f10724dbaf22dfad47a3e50f35382653cc3 /sys/pci/if_sis.c
parent718589faa8e89df4f7cfa83c1d530a72a13cddcc (diff)
downloadFreeBSD-src-f7c28f490d990c97e90328434aee93cb93fad59f.zip
FreeBSD-src-f7c28f490d990c97e90328434aee93cb93fad59f.tar.gz
Instead of keeping track of the index into the receive ring use the already
implemented "sis_nextdesc" pointer to keep a pointer instead.
Diffstat (limited to 'sys/pci/if_sis.c')
-rw-r--r--sys/pci/if_sis.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/sys/pci/if_sis.c b/sys/pci/if_sis.c
index de13f6f..aab5ca8 100644
--- a/sys/pci/if_sis.c
+++ b/sys/pci/if_sis.c
@@ -1502,7 +1502,7 @@ sis_list_rx_init(sc)
bus_dmamap_sync(sc->sis_rx_tag,
sc->sis_rx_dmamap, BUS_DMASYNC_PREWRITE);
- sc->sis_rx_prod = 0;
+ sc->sis_rx_pdsc = &sc->sis_rx_list[0];
return(0);
}
@@ -1550,15 +1550,15 @@ sis_rxeof(sc)
struct mbuf *m;
struct ifnet *ifp;
struct sis_desc *cur_rx;
- int i, total_len = 0;
+ int total_len = 0;
u_int32_t rxstat;
SIS_LOCK_ASSERT(sc);
ifp = &sc->arpcom.ac_if;
- i = sc->sis_rx_prod;
- while(SIS_OWNDESC(&sc->sis_rx_list[i])) {
+ for(cur_rx = sc->sis_rx_pdsc; SIS_OWNDESC(cur_rx);
+ cur_rx = cur_rx->sis_nextdesc) {
#ifdef DEVICE_POLLING
if (ifp->if_flags & IFF_POLLING) {
@@ -1567,7 +1567,6 @@ sis_rxeof(sc)
sc->rxcycles--;
}
#endif /* DEVICE_POLLING */
- cur_rx = &sc->sis_rx_list[i];
rxstat = cur_rx->sis_rxstat;
bus_dmamap_sync(sc->sis_tag,
cur_rx->sis_map, BUS_DMASYNC_POSTWRITE);
@@ -1576,7 +1575,6 @@ sis_rxeof(sc)
m = cur_rx->sis_mbuf;
cur_rx->sis_mbuf = NULL;
total_len = SIS_RXBYTES(cur_rx);
- SIS_INC(i, SIS_RX_LIST_CNT);
/*
* If an error occurs, update stats, clear the
@@ -1627,7 +1625,7 @@ sis_rxeof(sc)
SIS_LOCK(sc);
}
- sc->sis_rx_prod = i;
+ sc->sis_rx_pdsc = cur_rx;
return;
}
OpenPOWER on IntegriCloud