summaryrefslogtreecommitdiff
path: root/sys/dev/pcmcia/if_ray.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/pcmcia/if_ray.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/pcmcia/if_ray.c')
-rw-r--r--sys/dev/pcmcia/if_ray.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/pcmcia/if_ray.c b/sys/dev/pcmcia/if_ray.c
index e5d677dae07..a6bf096274c 100644
--- a/sys/dev/pcmcia/if_ray.c
+++ b/sys/dev/pcmcia/if_ray.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ray.c,v 1.15 2001/06/25 04:05:51 fgsch Exp $ */
+/* $OpenBSD: if_ray.c,v 1.16 2001/06/27 06:34:52 kjc Exp $ */
/* $NetBSD: if_ray.c,v 1.21 2000/07/05 02:35:54 onoe Exp $ */
/*
@@ -649,6 +649,7 @@ ray_attach(parent, self, aux)
ifp->if_ioctl = ray_ioctl;
ifp->if_mtu = ETHERMTU;
ifp->if_flags = IFF_BROADCAST|IFF_SIMPLEX|IFF_MULTICAST;
+ IFQ_SET_READY(&ifp->if_snd);
if_attach(ifp);
memcpy(&sc->sc_ec.ac_enaddr, ep->e_station_addr, ETHER_ADDR_LEN);
ether_ifattach(ifp);
@@ -1227,7 +1228,7 @@ ray_intr_start(sc)
return;
}
- if (ifp->if_snd.ifq_len == 0) {
+ if (IFQ_IS_EMPTY(&ifp->if_snd)) {
RAY_DPRINTF(("%s: nothing to send.\n",ifp->if_xname));
return;
}
@@ -1260,7 +1261,7 @@ ray_intr_start(sc)
}
}
- IF_DEQUEUE(&ifp->if_snd, m0);
+ IFQ_DEQUEUE(&ifp->if_snd, m0);
if (!m0) {
RAY_DPRINTF(("%s: dry queue.\n", ifp->if_xname));
break;