summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2014-12-18 05:17:18 +0000
committeradrian <adrian@FreeBSD.org>2014-12-18 05:17:18 +0000
commitbefcdd660f271babed582714f57d94b131da4af5 (patch)
tree8d1d536fc938365b8083b5d2355dd19f531bfe2e
parent06231125f019a24f487820bacef77591f2697c99 (diff)
downloadFreeBSD-src-befcdd660f271babed582714f57d94b131da4af5.zip
FreeBSD-src-befcdd660f271babed582714f57d94b131da4af5.tar.gz
Fix the scan handling for 11b->11g upgrades in a world where, well,
it's not just 11b/11g. The following was happening, and it's quite .. annoyingly grr-y. * create vap, setup wpa_supplicant with no bgscanning, etc - there's no call to ieee80211_media_change, so vap->iv_des_mode is IEEE80211_MODE_AUTO; * do ifconfig wlan0 scan - same thing, media_change doesn't get called, iv_des_mode stays as auto. * But then, run wpa_cli and do 'scan' - it'll do a media change. * if you're on 11ng, vap->iv_des_mode gets changed to IEEE80211_MODE_11NG * Then makescanlist() is called. There's a block of code that gets called if iv_des_mode != IEEE80211_MODE_AUTO, and it does this: if (vap->iv_des_mode != IEEE80211_MODE_11G || mode != IEEE80211_MODE_11B) continue; mode = IEEE80211_MODE_11G; /* upgrade */ * .. now, iv_des_mode is not IEEE80211_MODE_11G, so it always runs 'continue' * .. and thus the scan list stays empty and no further channel scans occur. Ever.(1) If you then disassociate and try associating to something, your scan table has likely been purged / aged out and you'll never see anything in the scan list. (1) You need to do 'ifconfig wlan0 mode auto' or just destroy/re-create the VAP to get working wireless again. Tested: * iwn(4) - intel 5300 wifi; STA mode; using wpa_supplicant; bgscan enabled -and- wpa_supplicant scanning. Thanks to: * Everyone who kept poking me about this and wondering why the hell their wifi would eventually stop seeing scan lists. Grr. I eventually snapped this evening and dug back into this code.
-rw-r--r--sys/net80211/ieee80211_scan_sta.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/net80211/ieee80211_scan_sta.c b/sys/net80211/ieee80211_scan_sta.c
index 6da06fd..1e87e35 100644
--- a/sys/net80211/ieee80211_scan_sta.c
+++ b/sys/net80211/ieee80211_scan_sta.c
@@ -600,10 +600,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 {
/*
OpenPOWER on IntegriCloud