ieee80211_hostap.c (184210) | ieee80211_hostap.c (184288) |
---|---|
1/*- 2 * Copyright (c) 2007-2008 Sam Leffler, Errno Consulting 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 */ 25 26#include <sys/cdefs.h> 27#ifdef __FreeBSD__ | 1/*- 2 * Copyright (c) 2007-2008 Sam Leffler, Errno Consulting 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 */ 25 26#include <sys/cdefs.h> 27#ifdef __FreeBSD__ |
28__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_hostap.c 184210 2008-10-23 19:57:13Z des $"); | 28__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_hostap.c 184288 2008-10-26 01:04:46Z sam $"); |
29#endif 30 31/* 32 * IEEE 802.11 HOSTAP mode support. 33 */ 34#include "opt_inet.h" 35#include "opt_wlan.h" 36 --- 2129 unchanged lines hidden (view full) --- 2166/* 2167 * Process a received ps-poll frame. 2168 */ 2169static void 2170hostap_recv_pspoll(struct ieee80211_node *ni, struct mbuf *m0) 2171{ 2172 struct ieee80211vap *vap = ni->ni_vap; 2173 struct ieee80211_frame_min *wh; | 29#endif 30 31/* 32 * IEEE 802.11 HOSTAP mode support. 33 */ 34#include "opt_inet.h" 35#include "opt_wlan.h" 36 --- 2129 unchanged lines hidden (view full) --- 2166/* 2167 * Process a received ps-poll frame. 2168 */ 2169static void 2170hostap_recv_pspoll(struct ieee80211_node *ni, struct mbuf *m0) 2171{ 2172 struct ieee80211vap *vap = ni->ni_vap; 2173 struct ieee80211_frame_min *wh; |
2174 struct ifnet *ifp = vap->iv_ifp; | 2174 struct ifnet *ifp; |
2175 struct mbuf *m; 2176 uint16_t aid; 2177 int qlen; 2178 2179 wh = mtod(m0, struct ieee80211_frame_min *); 2180 if (ni->ni_associd == 0) { 2181 IEEE80211_DISCARD(vap, 2182 IEEE80211_MSG_POWER | IEEE80211_MSG_DEBUG, --- 20 unchanged lines hidden (view full) --- 2203 * Being more lenient here seems ok as we already check 2204 * the station is associated and we only return frames 2205 * queued for the station (i.e. we don't use the AID). 2206 */ 2207 return; 2208 } 2209 2210 /* Okay, take the first queued packet and put it out... */ | 2175 struct mbuf *m; 2176 uint16_t aid; 2177 int qlen; 2178 2179 wh = mtod(m0, struct ieee80211_frame_min *); 2180 if (ni->ni_associd == 0) { 2181 IEEE80211_DISCARD(vap, 2182 IEEE80211_MSG_POWER | IEEE80211_MSG_DEBUG, --- 20 unchanged lines hidden (view full) --- 2203 * Being more lenient here seems ok as we already check 2204 * the station is associated and we only return frames 2205 * queued for the station (i.e. we don't use the AID). 2206 */ 2207 return; 2208 } 2209 2210 /* Okay, take the first queued packet and put it out... */ |
2211 IEEE80211_NODE_SAVEQ_DEQUEUE(ni, m, qlen); | 2211 m = ieee80211_node_psq_dequeue(ni, &qlen); |
2212 if (m == NULL) { 2213 IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_POWER, wh->i_addr2, 2214 "%s", "recv ps-poll, but queue empty"); 2215 ieee80211_send_nulldata(ieee80211_ref_node(ni)); 2216 vap->iv_stats.is_ps_qempty++; /* XXX node stat */ 2217 if (vap->iv_set_tim != NULL) 2218 vap->iv_set_tim(ni, 0); /* just in case */ 2219 return; --- 9 unchanged lines hidden (view full) --- 2229 m->m_flags |= M_MORE_DATA; 2230 } else { 2231 IEEE80211_NOTE(vap, IEEE80211_MSG_POWER, ni, 2232 "%s", "recv ps-poll, send packet, queue empty"); 2233 if (vap->iv_set_tim != NULL) 2234 vap->iv_set_tim(ni, 0); 2235 } 2236 m->m_flags |= M_PWR_SAV; /* bypass PS handling */ | 2212 if (m == NULL) { 2213 IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_POWER, wh->i_addr2, 2214 "%s", "recv ps-poll, but queue empty"); 2215 ieee80211_send_nulldata(ieee80211_ref_node(ni)); 2216 vap->iv_stats.is_ps_qempty++; /* XXX node stat */ 2217 if (vap->iv_set_tim != NULL) 2218 vap->iv_set_tim(ni, 0); /* just in case */ 2219 return; --- 9 unchanged lines hidden (view full) --- 2229 m->m_flags |= M_MORE_DATA; 2230 } else { 2231 IEEE80211_NOTE(vap, IEEE80211_MSG_POWER, ni, 2232 "%s", "recv ps-poll, send packet, queue empty"); 2233 if (vap->iv_set_tim != NULL) 2234 vap->iv_set_tim(ni, 0); 2235 } 2236 m->m_flags |= M_PWR_SAV; /* bypass PS handling */ |
2237 2238 if (m->m_flags & M_ENCAP) 2239 ifp = vap->iv_ic->ic_ifp; 2240 else 2241 ifp = vap->iv_ifp; |
|
2237 IF_ENQUEUE(&ifp->if_snd, m); 2238 if_start(ifp); 2239} | 2242 IF_ENQUEUE(&ifp->if_snd, m); 2243 if_start(ifp); 2244} |