summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2006-01-16 01:47:40 +0000
committerBrad Smith <brad@cvs.openbsd.org>2006-01-16 01:47:40 +0000
commitb06d3f536887af2ffd3275bc3989d188568d9d80 (patch)
tree2d159f748eff00406ace3aab8b258b926e12a502 /sys
parent1178f8d0b737507e2d2a5bf71f042ab5d0710d5a (diff)
Cache the TX producer index instead of reading it every time ti_start is
called. From FreeBSD
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/if_ti.c8
-rw-r--r--sys/dev/pci/if_tireg.h3
2 files changed, 7 insertions, 4 deletions
diff --git a/sys/dev/pci/if_ti.c b/sys/dev/pci/if_ti.c
index e4531cf2daa..815eb3221e1 100644
--- a/sys/dev/pci/if_ti.c
+++ b/sys/dev/pci/if_ti.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ti.c,v 1.73 2005/10/10 20:54:23 brad Exp $ */
+/* $OpenBSD: if_ti.c,v 1.74 2006/01/16 01:47:39 brad Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -1052,6 +1052,7 @@ ti_init_tx_ring(struct ti_softc *sc)
sc->ti_txcnt = 0;
sc->ti_tx_saved_considx = 0;
+ sc->ti_tx_saved_prodidx = 0;
CSR_WRITE_4(sc, TI_MB_SENDPROD_IDX, 0);
SLIST_INIT(&sc->ti_tx_map_listhead);
@@ -2178,12 +2179,12 @@ ti_start(struct ifnet *ifp)
{
struct ti_softc *sc;
struct mbuf *m_head = NULL;
- u_int32_t prodidx = 0;
+ u_int32_t prodidx;
int pkts = 0, error;
sc = ifp->if_softc;
- prodidx = CSR_READ_4(sc, TI_MB_SENDPROD_IDX);
+ prodidx = sc->ti_tx_saved_prodidx;
while(sc->ti_cdata.ti_tx_chain[prodidx] == NULL) {
IFQ_POLL(&ifp->if_snd, m_head);
@@ -2222,6 +2223,7 @@ ti_start(struct ifnet *ifp)
return;
/* Transmit */
+ sc->ti_tx_saved_prodidx = prodidx;
CSR_WRITE_4(sc, TI_MB_SENDPROD_IDX, prodidx);
/*
diff --git a/sys/dev/pci/if_tireg.h b/sys/dev/pci/if_tireg.h
index 12ccbc3c7be..e22182e2405 100644
--- a/sys/dev/pci/if_tireg.h
+++ b/sys/dev/pci/if_tireg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_tireg.h,v 1.20 2005/10/09 20:07:32 brad Exp $ */
+/* $OpenBSD: if_tireg.h,v 1.21 2006/01/16 01:47:39 brad Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -1117,6 +1117,7 @@ struct ti_softc {
#define ti_tx_considx ti_rdata->ti_tx_considx_r
struct ti_tx_desc *ti_tx_ring_nic;/* pointer to shared mem */
bus_dmamap_t ti_ring_map;
+ u_int16_t ti_tx_saved_prodidx;
u_int16_t ti_tx_saved_considx;
u_int16_t ti_rx_saved_considx;
u_int16_t ti_ev_saved_considx;