diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2015-11-04 12:12:01 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2015-11-04 12:12:01 +0000 |
commit | b7e59297cb5c784067ee40d96174076043140730 (patch) | |
tree | d84b71ad4933efb3509a88da5af2222affd8438a /sys/net80211/ieee80211_input.c | |
parent | 47528c666a66b5f625fb95953f94dd2d78bd169b (diff) |
replace the ifqueues in net80211 with mbuf_queues.
the specific queues are ic_mgtq, ic_pwrsaveq, and ni_savedq. rtw
had its own queue for beacons.
tested by mpi@ and jmc@
ok mpi@
Diffstat (limited to 'sys/net80211/ieee80211_input.c')
-rw-r--r-- | sys/net80211/ieee80211_input.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c index 84421e85e92..f0acbe2ddf5 100644 --- a/sys/net80211/ieee80211_input.c +++ b/sys/net80211/ieee80211_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_input.c,v 1.137 2015/07/15 22:16:42 deraadt Exp $ */ +/* $OpenBSD: ieee80211_input.c,v 1.138 2015/11/04 12:12:00 dlg Exp $ */ /*- * Copyright (c) 2001 Atsushi Onoe @@ -316,6 +316,8 @@ ieee80211_input(struct ifnet *ifp, struct mbuf *m, struct ieee80211_node *ni, ether_sprintf(wh->i_addr2), ic->ic_pssta)); } } else if (ni->ni_pwrsave == IEEE80211_PS_DOZE) { + struct mbuf *m; + /* turn off PS mode */ ni->ni_pwrsave = IEEE80211_PS_AWAKE; ic->ic_pssta--; @@ -325,10 +327,8 @@ ieee80211_input(struct ifnet *ifp, struct mbuf *m, struct ieee80211_node *ni, (*ic->ic_set_tim)(ic, ni->ni_associd, 0); /* dequeue buffered unicast frames */ - while (!IF_IS_EMPTY(&ni->ni_savedq)) { - struct mbuf *m; - IF_DEQUEUE(&ni->ni_savedq, m); - IF_ENQUEUE(&ic->ic_pwrsaveq, m); + while ((m = mq_dequeue(&ni->ni_savedq)) != NULL) { + mq_enqueue(&ic->ic_pwrsaveq, m); (*ifp->if_start)(ifp); } } @@ -2799,10 +2799,10 @@ ieee80211_recv_pspoll(struct ieee80211com *ic, struct mbuf *m, } /* take the first queued frame and put it out.. */ - IF_DEQUEUE(&ni->ni_savedq, m); + m = mq_dequeue(&ni->ni_savedq); if (m == NULL) return; - if (IF_IS_EMPTY(&ni->ni_savedq)) { + if (mq_empty(&ni->ni_savedq)) { /* last queued frame, turn off the TIM bit */ (*ic->ic_set_tim)(ic, ni->ni_associd, 0); } else { @@ -2810,7 +2810,7 @@ ieee80211_recv_pspoll(struct ieee80211com *ic, struct mbuf *m, wh = mtod(m, struct ieee80211_frame *); wh->i_fc[1] |= IEEE80211_FC1_MORE_DATA; } - IF_ENQUEUE(&ic->ic_pwrsaveq, m); + mq_enqueue(&ic->ic_pwrsaveq, m); (*ifp->if_start)(ifp); } #endif /* IEEE80211_STA_ONLY */ |