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/dp8390.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/dp8390.c')
-rw-r--r-- | sys/dev/ic/dp8390.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/ic/dp8390.c b/sys/dev/ic/dp8390.c index f8e79d7bb7e..24e3feaff70 100644 --- a/sys/dev/ic/dp8390.c +++ b/sys/dev/ic/dp8390.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dp8390.c,v 1.14 2001/06/23 22:57:13 fgsch Exp $ */ +/* $OpenBSD: dp8390.c,v 1.15 2001/06/27 06:34:41 kjc Exp $ */ /* $NetBSD: dp8390.c,v 1.13 1998/07/05 06:49:11 jonathan Exp $ */ /* @@ -130,7 +130,7 @@ dp8390_config(sc) ifp->if_watchdog = dp8390_watchdog; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_NOTRAILERS | IFF_MULTICAST; - ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); /* Print additional info when attached. */ printf("%s: address %s\n", sc->sc_dev.dv_xname, @@ -178,6 +178,7 @@ dp8390_mediastatus(ifp, ifmr) ifmr->ifm_status = 0; return; } + IFQ_SET_READY(&ifp->if_snd); if (sc->sc_mediastatus) (*sc->sc_mediastatus)(sc, ifmr); @@ -445,7 +446,7 @@ outloop: ifp->if_flags |= IFF_OACTIVE; return; } - IF_DEQUEUE(&ifp->if_snd, m0); + IFQ_DEQUEUE(&ifp->if_snd, m0); if (m0 == 0) return; |