summaryrefslogtreecommitdiff
path: root/sys/dev/sbus/qe.c
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2002-03-07 02:03:59 +0000
committerJason Wright <jason@cvs.openbsd.org>2002-03-07 02:03:59 +0000
commitdac2f5e952646f548a15a505091e099e6c494dab (patch)
treea6eda21dc011a66862ff4f2a9890ad7d16070cc8 /sys/dev/sbus/qe.c
parent2eb93271777a7caef9573b6881aa6ff4a5aacbc4 (diff)
From watching source-changes@netbsd.org: rb_dmabase needs to be initialized
-after- the call to bus_dmamem_map()
Diffstat (limited to 'sys/dev/sbus/qe.c')
-rw-r--r--sys/dev/sbus/qe.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/sys/dev/sbus/qe.c b/sys/dev/sbus/qe.c
index 572696f6c3a..b027f64d9b8 100644
--- a/sys/dev/sbus/qe.c
+++ b/sys/dev/sbus/qe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: qe.c,v 1.7 2002/01/01 22:11:18 jason Exp $ */
+/* $OpenBSD: qe.c,v 1.8 2002/03/07 02:03:58 jason Exp $ */
/* $NetBSD: qe.c,v 1.16 2001/03/30 17:30:18 christos Exp $ */
/*-
@@ -284,7 +284,6 @@ qeattach(parent, self, aux)
self->dv_xname, error);
return;
}
- sc->sc_rb.rb_dmabase = sc->sc_dmamap->dm_segs[0].ds_addr;
/* Map DMA buffer in CPU addressable space */
if ((error = bus_dmamem_map(dmatag, &seg, rseg, size,
@@ -305,6 +304,7 @@ qeattach(parent, self, aux)
bus_dmamem_free(dmatag, &seg, rseg);
return;
}
+ sc->sc_rb.rb_dmabase = sc->sc_dmamap->dm_segs[0].ds_addr;
/* Initialize media properties */
ifmedia_init(&sc->sc_ifmedia, 0, qe_ifmedia_upd, qe_ifmedia_sts);
@@ -485,10 +485,12 @@ qestart(ifp)
bix = sc->sc_rb.rb_tdhead;
for (;;) {
- IFQ_DEQUEUE(&ifp->if_snd, m);
- if (m == 0)
+ IFQ_POLL(&ifp->if_snd, m);
+ if (m == NULL)
break;
+ IFQ_DEQUEUE(&ifp->if_snd, m);
+
#if NBPFILTER > 0
/*
* If BPF is listening on this interface, let it see the
@@ -646,7 +648,7 @@ qeintr(arg)
if (qestat & QE_CR_STAT_RXIRQ)
r |= qe_rint(sc);
- return (r);
+ return (1);
}
/*
@@ -679,13 +681,17 @@ qe_tint(sc)
--sc->sc_rb.rb_td_nbusy;
}
- sc->sc_rb.rb_tdtail = bix;
-
- qestart(ifp);
-
if (sc->sc_rb.rb_td_nbusy == 0)
ifp->if_timer = 0;
+ if (sc->sc_rb.rb_tdtail != bix) {
+ sc->sc_rb.rb_tdtail = bix;
+ if (ifp->if_flags & IFF_OACTIVE) {
+ ifp->if_flags &= ~IFF_OACTIVE;
+ qestart(ifp);
+ }
+ }
+
return (1);
}