summaryrefslogtreecommitdiffstats
path: root/sys/dev/ep
diff options
context:
space:
mode:
authormdodd <mdodd@FreeBSD.org>2000-01-12 06:42:49 +0000
committermdodd <mdodd@FreeBSD.org>2000-01-12 06:42:49 +0000
commit2ef1bf84237e02ed89219bd01b051b13f3d493bc (patch)
tree7d20ab65c001c02758862a909e5060b277884775 /sys/dev/ep
parentce45af054b56462d8a4f194a3600ef0038ac6a31 (diff)
downloadFreeBSD-src-2ef1bf84237e02ed89219bd01b051b13f3d493bc.zip
FreeBSD-src-2ef1bf84237e02ed89219bd01b051b13f3d493bc.tar.gz
Speedup if_start routine a little. TX threshold logic needs some more
kicking but these changes get me around 1000 KB/sec.
Diffstat (limited to 'sys/dev/ep')
-rw-r--r--sys/dev/ep/if_ep.c27
-rw-r--r--sys/dev/ep/if_epreg.h9
2 files changed, 26 insertions, 10 deletions
diff --git a/sys/dev/ep/if_ep.c b/sys/dev/ep/if_ep.c
index 5a31f22..03f5068 100644
--- a/sys/dev/ep/if_ep.c
+++ b/sys/dev/ep/if_ep.c
@@ -436,9 +436,9 @@ static void
ep_if_start(ifp)
struct ifnet *ifp;
{
- register struct ep_softc *sc = ifp->if_softc;
- register u_int len;
- register struct mbuf *m;
+ struct ep_softc *sc = ifp->if_softc;
+ u_int len;
+ struct mbuf *m;
struct mbuf *top;
int s, pad;
@@ -446,17 +446,15 @@ ep_if_start(ifp)
return;
}
- s = splimp();
while (inw(BASE + EP_STATUS) & S_COMMAND_IN_PROGRESS);
if (ifp->if_flags & IFF_OACTIVE) {
- splx(s);
return;
}
+
startagain:
/* Sneak a peek at the next packet */
m = ifp->if_snd.ifq_head;
if (m == 0) {
- splx(s);
return;
}
for (len = 0, top = m; m; m = m->m_next)
@@ -485,30 +483,40 @@ startagain:
splx(s);
return;
}
+ } else {
+ outw(BASE + EP_COMMAND, SET_TX_AVAIL_THRESH | EP_THRESH_DISABLE);
}
+
IF_DEQUEUE(&ifp->if_snd, m);
+ s = splhigh();
+
outw(BASE + EP_W1_TX_PIO_WR_1, len);
outw(BASE + EP_W1_TX_PIO_WR_1, 0x0); /* Second dword meaningless */
- for (top = m; m != 0; m = m->m_next)
- if (EP_FTST(sc, F_ACCESS_32_BITS)) {
+ if (EP_FTST(sc, F_ACCESS_32_BITS)) {
+ for (top = m; m != 0; m = m->m_next) {
outsl(BASE + EP_W1_TX_PIO_WR_1, mtod(m, caddr_t),
m->m_len / 4);
if (m->m_len & 3)
outsb(BASE + EP_W1_TX_PIO_WR_1,
mtod(m, caddr_t) + (m->m_len & (~3)),
m->m_len & 3);
- } else {
+ }
+ } else {
+ for (top = m; m != 0; m = m->m_next) {
outsw(BASE + EP_W1_TX_PIO_WR_1, mtod(m, caddr_t), m->m_len / 2);
if (m->m_len & 1)
outb(BASE + EP_W1_TX_PIO_WR_1,
*(mtod(m, caddr_t) + m->m_len - 1));
}
+ }
while (pad--)
outb(BASE + EP_W1_TX_PIO_WR_1, 0); /* Padding */
+ splx(s);
+
if (ifp->if_bpf) {
bpf_mtap(ifp, top);
}
@@ -530,7 +538,6 @@ readcheck:
if (ifp->if_snd.ifq_head) {
outw(BASE + EP_COMMAND, SET_TX_AVAIL_THRESH | 8);
}
- splx(s);
return;
}
goto startagain;
diff --git a/sys/dev/ep/if_epreg.h b/sys/dev/ep/if_epreg.h
index aec663c..5fa60aa 100644
--- a/sys/dev/ep/if_epreg.h
+++ b/sys/dev/ep/if_epreg.h
@@ -231,6 +231,15 @@
*
****************************************/
+/*
+ * Command parameter that disables threshold interrupts
+ * PIO (3c509) cards use 2044. The fifo word-oriented and 2044--2047 work.
+ * "busmastering" cards need 8188.
+ * The implicit two-bit upshift done by busmastering cards means
+ * a value of 2047 disables threshold interrupts on both.
+ */
+#define EP_THRESH_DISABLE 2047
+
/*
* Command register. All windows.
*
OpenPOWER on IntegriCloud