summaryrefslogtreecommitdiffstats
path: root/sys/pci
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
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')
-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 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;
}
diff --git a/sys/pci/if_sisreg.h b/sys/pci/if_sisreg.h
index 58634e0..774a13e 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;
OpenPOWER on IntegriCloud