aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2005-01-04 22:39:35 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2005-01-04 22:39:35 +0000
commitdc010b7380e1a09853f5ee549afae28073bc540a (patch)
tree114f1f10724dbaf22dfad47a3e50f35382653cc3 /sys
parent32a300364d9510b79db07157760b9c4407e6b1bd (diff)
downloadsrc-dc010b7380e1a09853f5ee549afae28073bc540a.tar.gz
src-dc010b7380e1a09853f5ee549afae28073bc540a.zip
Instead of keeping track of the index into the receive ring use the already
implemented "sis_nextdesc" pointer to keep a pointer instead.
Notes
Notes: svn path=/head/; revision=139691
Diffstat (limited to 'sys')
-rw-r--r--sys/pci/if_sis.c12
-rw-r--r--sys/pci/if_sisreg.h2
2 files changed, 6 insertions, 8 deletions
diff --git a/sys/pci/if_sis.c b/sys/pci/if_sis.c
index de13f6fff9bd..aab5ca8f1890 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;
}
diff --git a/sys/pci/if_sisreg.h b/sys/pci/if_sisreg.h
index 58634e0bf5b0..774a13e0cd67 100644
--- a/sys/pci/if_sisreg.h
+++ b/sys/pci/if_sisreg.h
@@ -450,7 +450,7 @@ struct sis_softc {
bus_dmamap_t sis_tx_dmamap;
bus_dma_tag_t sis_parent_tag;
bus_dma_tag_t sis_tag;
- int sis_rx_prod;
+ struct sis_desc *sis_rx_pdsc;
int sis_tx_prod;
int sis_tx_cons;
int sis_tx_cnt;