summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2007-04-25 09:55:48 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2007-04-25 09:55:48 +0000
commit89e3bb2bc1eb62e2bffd1dad039206ae980550b8 (patch)
treecf053a663284e1bf2b58cb22f59924c3cc9825c1 /sys/dev
parent4fe6d44d93197d3c35391da5b3558b35831df1a3 (diff)
enable tx completion interrupts and provide handling for them.
unfortunately theres a bug somehwere. i had this working 6 hours ago, but after scrubbing that diff it no longer completes packets. so annoying.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/if_tht.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/sys/dev/pci/if_tht.c b/sys/dev/pci/if_tht.c
index baf9f385fa5..ad931ff2e24 100644
--- a/sys/dev/pci/if_tht.c
+++ b/sys/dev/pci/if_tht.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_tht.c,v 1.71 2007/04/25 09:52:45 dlg Exp $ */
+/* $OpenBSD: if_tht.c,v 1.72 2007/04/25 09:55:47 dlg Exp $ */
/*
* Copyright (c) 2007 David Gwynne <dlg@openbsd.org>
@@ -259,7 +259,8 @@ int thtdebug = THT_D_FIFO | THT_D_TX | THT_D_RX | THT_D_INTR;
#define THT_FIFO_DESC_LEN 208 /* a descriptor cant be bigger than this */
#define THT_IMR_DOWN(_p) (THT_REG_IMR_LINKCHG(_p))
-#define THT_IMR_UP(_p) (THT_REG_IMR_LINKCHG(_p))
+#define THT_IMR_UP(_p) (THT_REG_IMR_LINKCHG(_p) | \
+ THT_REG_IMR_TXF(0))
/* hardware structures (we're using the 64 bit variants) */
@@ -808,6 +809,7 @@ int
tht_intr(void *arg)
{
struct tht_softc *sc = arg;
+ struct ifnet *ifp;
u_int32_t isr;
isr = tht_read(sc, THT_REG_ISR);
@@ -821,6 +823,14 @@ tht_intr(void *arg)
if (ISSET(isr, THT_REG_ISR_LINKCHG(0) | THT_REG_ISR_LINKCHG(1)))
tht_link_state(sc);
+ ifp = &sc->sc_ac.ac_if;
+ if (ifp->if_flags & IFF_RUNNING) {
+ if (ISSET(isr, THT_REG_ISR_TXF(0)))
+ tht_txf(sc);
+
+ tht_start(ifp);
+ }
+
tht_write(sc, THT_REG_IMR, sc->sc_imr);
return (1);
}
@@ -989,6 +999,9 @@ tht_down(struct tht_softc *sc)
tht_pkt_free(sc, &sc->sc_rx_list);
tht_pkt_free(sc, &sc->sc_tx_list);
+
+ sc->sc_imr = THT_IMR_DOWN(sc->sc_port);
+ tht_write(sc, THT_REG_IMR, sc->sc_imr);
}
void