diff options
author | Kenjiro Cho <kjc@cvs.openbsd.org> | 2001-06-27 06:34:54 +0000 |
---|---|---|
committer | Kenjiro Cho <kjc@cvs.openbsd.org> | 2001-06-27 06:34:54 +0000 |
commit | 17cc5dbba19bbbbeb9361149e56ee11dbc22da68 (patch) | |
tree | 8a51ae8b2bde0887aa6650a31196833183a5b94f /sys/dev/ic/tropic.c | |
parent | 30721c7f5299136d216635afefc517f47511b9f3 (diff) |
ALTQ'ify network drivers.
- use the new queue macros.
- use IFQ_POLL() to peek at the next packet.
- use IFQ_IS_EMPTY() for empty check.
- drivers should always check if (m == NULL) after IFQ_DEQUEUE(),
since it could return NULL even when IFQ_IS_EMPTY() is FALSE
under rate-limiting.
- drivers are supposed to call if_start from tx complete interrupts
(in order to trigger the next dequeue under rate-limiting).
Diffstat (limited to 'sys/dev/ic/tropic.c')
-rw-r--r-- | sys/dev/ic/tropic.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/dev/ic/tropic.c b/sys/dev/ic/tropic.c index 32c7e72e0ab..2bd28140f2b 100644 --- a/sys/dev/ic/tropic.c +++ b/sys/dev/ic/tropic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tropic.c,v 1.1 1999/12/27 21:51:35 fgsch Exp $ */ +/* $OpenBSD: tropic.c,v 1.2 2001/06/27 06:34:43 kjc Exp $ */ /* $NetBSD: tropic.c,v 1.6 1999/12/17 08:26:31 fvdl Exp $ */ /* @@ -352,6 +352,9 @@ tr_attach(sc) ifp->if_start = tr_oldstart; ifp->if_flags = IFF_BROADCAST | IFF_NOTRAILERS; ifp->if_watchdog = tr_watchdog; +#ifdef notyet /* if_tokensubr.c hasn't been converted yet */ + IFQ_SET_READY(&ifp->if_snd); +#endif switch (MM_INB(sc, TR_MEDIAS_OFFSET)) { case 0xF: @@ -736,7 +739,7 @@ next: return; /* if data in queue, copy mbuf chain to fast path buffers */ - IF_DEQUEUE(&ifp->if_snd, m0); + IFQ_DEQUEUE(&ifp->if_snd, m0); if (m0 == 0) return; @@ -802,9 +805,6 @@ next: #endif } - -#define IF_EMPTYQUEUE(queue) ((queue).ifq_head == 0) - /* * tr_intr - interrupt handler. Find the cause of the interrupt and * service it. @@ -1043,7 +1043,7 @@ tr_intr(arg) sc->sc_dev.dv_xname); ifp->if_flags &= ~IFF_RUNNING; ifp->if_flags &= ~IFF_UP; - if_qflush(&ifp->if_snd); + IFQ_PURGE(&ifp->if_snd); timeout(tr_reinit, sc ,hz*30); } else { @@ -1117,7 +1117,7 @@ tr_intr(arg) * XXX should this be done here ? */ /* if data on send queue */ - if (!IF_EMPTYQUEUE(ifp->if_snd)) + if (!IFQ_IS_EMPTY(&ifp->if_snd)) tr_oldstart(ifp); break; @@ -1351,7 +1351,7 @@ struct tr_softc *sc; * XXX what's command here ? command = 0x0d (always ?) */ /* if data in queue, copy mbuf chain to DHB */ - IF_DEQUEUE(&ifp->if_snd, m0); + IFQ_DEQUEUE(&ifp->if_snd, m0); if (m0 != 0) { #if NBPFILTER > 0 if (ifp->if_bpf) |