ieee80211_scan_sta.c (219601) | ieee80211_scan_sta.c (224717) |
---|---|
1/*- 2 * Copyright (c) 2002-2009 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 --- 10 unchanged lines hidden (view full) --- 19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 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> | 1/*- 2 * Copyright (c) 2002-2009 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 --- 10 unchanged lines hidden (view full) --- 19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 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__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_scan_sta.c 219601 2011-03-13 11:58:40Z bschmidt $"); | 27__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_scan_sta.c 224717 2011-08-08 16:29:07Z bschmidt $"); |
28 29/* 30 * IEEE 802.11 station scanning support. 31 */ 32#include "opt_wlan.h" 33 34#include <sys/param.h> 35#include <sys/systm.h> --- 197 unchanged lines hidden (view full) --- 233#define ISPROBE(_st) ((_st) == IEEE80211_FC0_SUBTYPE_PROBE_RESP) 234#define PICK1ST(_ss) \ 235 ((ss->ss_flags & (IEEE80211_SCAN_PICK1ST | IEEE80211_SCAN_GOTPICK)) == \ 236 IEEE80211_SCAN_PICK1ST) 237 struct sta_table *st = ss->ss_priv; 238 const uint8_t *macaddr = wh->i_addr2; 239 struct ieee80211vap *vap = ss->ss_vap; 240 struct ieee80211com *ic = vap->iv_ic; | 28 29/* 30 * IEEE 802.11 station scanning support. 31 */ 32#include "opt_wlan.h" 33 34#include <sys/param.h> 35#include <sys/systm.h> --- 197 unchanged lines hidden (view full) --- 233#define ISPROBE(_st) ((_st) == IEEE80211_FC0_SUBTYPE_PROBE_RESP) 234#define PICK1ST(_ss) \ 235 ((ss->ss_flags & (IEEE80211_SCAN_PICK1ST | IEEE80211_SCAN_GOTPICK)) == \ 236 IEEE80211_SCAN_PICK1ST) 237 struct sta_table *st = ss->ss_priv; 238 const uint8_t *macaddr = wh->i_addr2; 239 struct ieee80211vap *vap = ss->ss_vap; 240 struct ieee80211com *ic = vap->iv_ic; |
241 struct ieee80211_channel *c; |
|
241 struct sta_entry *se; 242 struct ieee80211_scan_entry *ise; 243 int hash; 244 245 hash = STA_HASH(macaddr); 246 247 IEEE80211_SCAN_TABLE_LOCK(st); 248 LIST_FOREACH(se, &st->st_hash[hash], se_hash) --- 46 unchanged lines hidden (view full) --- 295 memcpy(ise->se_meshid, sp->meshid, 2+sp->meshid[1]); 296#endif 297 /* 298 * Beware of overriding se_chan for frames seen 299 * off-channel; this can cause us to attempt an 300 * association on the wrong channel. 301 */ 302 if (sp->status & IEEE80211_BPARSE_OFFCHAN) { | 242 struct sta_entry *se; 243 struct ieee80211_scan_entry *ise; 244 int hash; 245 246 hash = STA_HASH(macaddr); 247 248 IEEE80211_SCAN_TABLE_LOCK(st); 249 LIST_FOREACH(se, &st->st_hash[hash], se_hash) --- 46 unchanged lines hidden (view full) --- 296 memcpy(ise->se_meshid, sp->meshid, 2+sp->meshid[1]); 297#endif 298 /* 299 * Beware of overriding se_chan for frames seen 300 * off-channel; this can cause us to attempt an 301 * association on the wrong channel. 302 */ 303 if (sp->status & IEEE80211_BPARSE_OFFCHAN) { |
303 struct ieee80211_channel *c; | |
304 /* 305 * Off-channel, locate the home/bss channel for the sta 306 * using the value broadcast in the DSPARMS ie. We know 307 * sp->chan has this value because it's used to calculate 308 * IEEE80211_BPARSE_OFFCHAN. 309 */ 310 c = ieee80211_find_channel_byieee(ic, sp->chan, 311 ic->ic_curchan->ic_flags); 312 if (c != NULL) { 313 ise->se_chan = c; 314 } else if (ise->se_chan == NULL) { 315 /* should not happen, pick something */ 316 ise->se_chan = ic->ic_curchan; 317 } 318 } else 319 ise->se_chan = ic->ic_curchan; | 304 /* 305 * Off-channel, locate the home/bss channel for the sta 306 * using the value broadcast in the DSPARMS ie. We know 307 * sp->chan has this value because it's used to calculate 308 * IEEE80211_BPARSE_OFFCHAN. 309 */ 310 c = ieee80211_find_channel_byieee(ic, sp->chan, 311 ic->ic_curchan->ic_flags); 312 if (c != NULL) { 313 ise->se_chan = c; 314 } else if (ise->se_chan == NULL) { 315 /* should not happen, pick something */ 316 ise->se_chan = ic->ic_curchan; 317 } 318 } else 319 ise->se_chan = ic->ic_curchan; |
320 if (IEEE80211_IS_CHAN_HT(ise->se_chan) && sp->htcap == NULL) { 321 /* Demote legacy networks to a non-HT channel. */ 322 c = ieee80211_find_channel(ic, ise->se_chan->ic_freq, 323 ise->se_chan->ic_flags & ~IEEE80211_CHAN_HT); 324 KASSERT(c != NULL, 325 ("no legacy channel %u", ise->se_chan->ic_ieee)); 326 ise->se_chan = c; 327 } |
|
320 ise->se_fhdwell = sp->fhdwell; 321 ise->se_fhindex = sp->fhindex; 322 ise->se_erp = sp->erp; 323 ise->se_timoff = sp->timoff; 324 if (sp->tim != NULL) { 325 const struct ieee80211_tim_ie *tim = 326 (const struct ieee80211_tim_ie *) sp->tim; 327 ise->se_dtimperiod = tim->tim_period; --- 1611 unchanged lines hidden --- | 328 ise->se_fhdwell = sp->fhdwell; 329 ise->se_fhindex = sp->fhindex; 330 ise->se_erp = sp->erp; 331 ise->se_timoff = sp->timoff; 332 if (sp->tim != NULL) { 333 const struct ieee80211_tim_ie *tim = 334 (const struct ieee80211_tim_ie *) sp->tim; 335 ise->se_dtimperiod = tim->tim_period; --- 1611 unchanged lines hidden --- |