summaryrefslogtreecommitdiffstats
path: root/sys/net80211/ieee80211_scan_sta.c
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2015-08-17 13:55:50 -0300
committerRenato Botelho <renato@netgate.com>2015-08-17 13:55:50 -0300
commit6ee75bdd7bf7c20359dd6e38c243586cb062edea (patch)
tree2a1f5febde659ebdcabbb46159fce1457b3dc98a /sys/net80211/ieee80211_scan_sta.c
parent924a927559577e9cea5abf4a725e679acad834bf (diff)
downloadFreeBSD-src-6ee75bdd7bf7c20359dd6e38c243586cb062edea.zip
FreeBSD-src-6ee75bdd7bf7c20359dd6e38c243586cb062edea.tar.gz
Importing pfSense patches net80211HEAD.tgz and conf.file.ieee80211.diff
Diffstat (limited to 'sys/net80211/ieee80211_scan_sta.c')
-rw-r--r--sys/net80211/ieee80211_scan_sta.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/sys/net80211/ieee80211_scan_sta.c b/sys/net80211/ieee80211_scan_sta.c
index c791ea1..1fb45b0 100644
--- a/sys/net80211/ieee80211_scan_sta.c
+++ b/sys/net80211/ieee80211_scan_sta.c
@@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$");
#include <sys/socket.h>
#include <net/if.h>
+#include <net/if_var.h>
#include <net/if_media.h>
#include <net/ethernet.h>
@@ -227,6 +228,7 @@ sta_flush_table(struct sta_table *st)
*/
static int
sta_add(struct ieee80211_scan_state *ss,
+ struct ieee80211_channel *curchan,
const struct ieee80211_scanparams *sp,
const struct ieee80211_frame *wh,
int subtype, int rssi, int noise)
@@ -309,15 +311,15 @@ found:
* IEEE80211_BPARSE_OFFCHAN.
*/
c = ieee80211_find_channel_byieee(ic, sp->chan,
- ic->ic_curchan->ic_flags);
+ curchan->ic_flags);
if (c != NULL) {
ise->se_chan = c;
} else if (ise->se_chan == NULL) {
/* should not happen, pick something */
- ise->se_chan = ic->ic_curchan;
+ ise->se_chan = curchan;
}
} else
- ise->se_chan = ic->ic_curchan;
+ ise->se_chan = curchan;
if (IEEE80211_IS_CHAN_HT(ise->se_chan) && sp->htcap == NULL) {
/* Demote legacy networks to a non-HT channel. */
c = ieee80211_find_channel(ic, ise->se_chan->ic_freq,
@@ -599,10 +601,12 @@ makescanlist(struct ieee80211_scan_state *ss, struct ieee80211vap *vap,
* so if the desired mode is 11g, then use
* the 11b channel list but upgrade the mode.
*/
- if (vap->iv_des_mode != IEEE80211_MODE_11G ||
- mode != IEEE80211_MODE_11B)
- continue;
- mode = IEEE80211_MODE_11G; /* upgrade */
+ if (vap->iv_des_mode == IEEE80211_MODE_11G) {
+ if (mode == IEEE80211_MODE_11G) /* Skip the G check */
+ continue;
+ else if (mode == IEEE80211_MODE_11B)
+ mode = IEEE80211_MODE_11G; /* upgrade */
+ }
}
} else {
/*
@@ -732,7 +736,7 @@ sta_cancel(struct ieee80211_scan_state *ss, struct ieee80211vap *vap)
return 0;
}
-/* unalligned little endian access */
+/* unaligned little endian access */
#define LE_READ_2(p) \
((uint16_t) \
((((const uint8_t *)(p))[0] ) | \
OpenPOWER on IntegriCloud