summaryrefslogtreecommitdiff
path: root/sys/dev/isa/if_ef_isapnp.c
diff options
context:
space:
mode:
authorKenjiro Cho <kjc@cvs.openbsd.org>2001-06-27 06:34:54 +0000
committerKenjiro Cho <kjc@cvs.openbsd.org>2001-06-27 06:34:54 +0000
commit17cc5dbba19bbbbeb9361149e56ee11dbc22da68 (patch)
tree8a51ae8b2bde0887aa6650a31196833183a5b94f /sys/dev/isa/if_ef_isapnp.c
parent30721c7f5299136d216635afefc517f47511b9f3 (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/isa/if_ef_isapnp.c')
-rw-r--r--sys/dev/isa/if_ef_isapnp.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/dev/isa/if_ef_isapnp.c b/sys/dev/isa/if_ef_isapnp.c
index cf9e28652c8..b0d3e74a82d 100644
--- a/sys/dev/isa/if_ef_isapnp.c
+++ b/sys/dev/isa/if_ef_isapnp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ef_isapnp.c,v 1.12 2001/06/25 04:44:28 fgsch Exp $ */
+/* $OpenBSD: if_ef_isapnp.c,v 1.13 2001/06/27 06:34:45 kjc Exp $ */
/*
* Copyright (c) 1999 Jason L. Wright (jason@thought.net)
@@ -214,6 +214,7 @@ ef_isapnp_attach(parent, self, aux)
ifp->if_watchdog = efwatchdog;
ifp->if_flags =
IFF_BROADCAST | IFF_SIMPLEX | IFF_NOTRAILERS | IFF_MULTICAST;
+ IFQ_SET_READY(&ifp->if_snd);
sc->sc_mii.mii_ifp = ifp;
sc->sc_mii.mii_readreg = ef_miibus_readreg;
@@ -253,7 +254,7 @@ efstart(ifp)
return;
startagain:
- m0 = ifp->if_snd.ifq_head;
+ IFQ_POLL(&ifp->if_snd, m0);
if (m0 == NULL)
return;
@@ -264,7 +265,7 @@ startagain:
if (len + pad > ETHER_MAX_LEN) {
ifp->if_oerrors++;
- IF_DEQUEUE(&ifp->if_snd, m0);
+ IFQ_DEQUEUE(&ifp->if_snd, m0);
m_freem(m0);
goto startagain;
}
@@ -287,7 +288,7 @@ startagain:
bpf_mtap(ifp->if_bpf, m0);
#endif
- IF_DEQUEUE(&ifp->if_snd, m0);
+ IFQ_DEQUEUE(&ifp->if_snd, m0);
if (m0 == NULL) /* XXX not needed */
return;