[Bug 193826] New: iwn does not scan channels
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Mon Sep 22 04:13:28 UTC 2014
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=193826
Bug ID: 193826
Summary: iwn does not scan channels
Product: Base System
Version: 11.0-CURRENT
Hardware: amd64
OS: Any
Status: Needs Triage
Severity: Affects Some People
Priority: ---
Component: wireless
Assignee: freebsd-wireless at FreeBSD.org
Reporter: henry.hu.sh at gmail.com
I'm trying to use DTrace to trace a problem I'm seeing from time to time.
After some time, iwn can't get any scan result. ifconfig says:
wlan0: flags=8c43<UP,BROADCAST,RUNNING,OACTIVE,SIMPLEX,MULTICAST> metric 0 mtu
1500
ether c4:85:08:82:da:5c
inet 0.0.0.0 netmask 0xff000000 broadcast 255.255.255.255
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
media: IEEE 802.11 Wireless Ethernet MCS mode 11ng (autoselect)
status: no carrier
ssid "" channel 1 (2412 MHz 11g ht/20)
country US authmode WPA1+WPA2/802.11i privacy MIXED deftxkey UNDEF
txpower 11 bmiss 10 scanvalid 60 protmode CTS ht20 ampdulimit 8k
-amsdutx amsdurx shortgi wme roaming MANUAL
and ifconfig wlan0 scan returns no results, neither do wpa_cli scan_results
With wlandebug +scan, I see these messages:
Sep 21 00:40:52 pepsi kernel: wlan0: ieee80211_scanreq: flags 0x20052 duration
0x7fffffff mindwell 0 maxdwell 0 nssid 1
Sep 21 00:40:52 pepsi kernel: wlan0: ieee80211_check_scan: active scan, append,
nojoin, once
Sep 21 00:40:52 pepsi kernel: wlan0: start_scan_locked: active scan, duration
2147483647 mindwell 0 maxdwell 0, desired mode 11ng, append, nojoin, once
Sep 21 00:40:52 pepsi kernel: wlan0: scan set dwell min 20ms max 200ms
Sep 21 00:40:52 pepsi kernel: wlan0: scan_task: no channels to scan
Sep 21 00:40:52 pepsi kernel: wlan0: notify scan done
it seems like that the channel list to scan is empty.
By using dtrace to print some information in makescanlist() in
ieee80211_scan_sta.c, I find that:
vap->iv_des_mode = 9 (IEEE80211_MODE_11NG)
everything in table[] has mode = 1 or 2 (IEEE80211_MODE_11A / 11B)
According to logic in makescanlist,
if (vap->iv_des_mode != IEEE80211_MODE_AUTO) {
/*
* If a desired mode was specified, scan only
* channels that satisfy that constraint.
*/
if (vap->iv_des_mode != mode) {
/*
* The scan table marks 2.4Ghz channels as b
* 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;
This would skip all the channels.
Later it calls sweepchannels(). In this function, we have these channels in
ieee80211com.ic_channels:
freq / flags / ieee number / state / ht ext channel
chan: 2412 a0 1 0 0
chan: 2412 480 1 0 0
chan: 2412 10480 1 0 0
chan: 2412 20480 1 0 5
chan: 2417 a0 2 0 0
chan: 2417 480 2 0 0
chan: 2417 10480 2 0 0
chan: 2417 20480 2 0 6
....
so for each freq, we have
CCK | 2G = a0
DYN | 2G = 480
HT20 | DYN | 2G = 10480
HT40 | DYN | 2G = 20480
In sweepchannels(), it says
for (i = 0; i < ic->ic_nchans; i++) {
if (ss->ss_last >= IEEE80211_SCAN_MAX)
break;
c = &ic->ic_channels[i];
/*
* Ignore dynamic turbo channels; we scan them
* in normal mode (i.e. not boosted). Likewise
* for HT channels, they get scanned using
* legacy rates.
*/
if (IEEE80211_IS_CHAN_DTURBO(c) || IEEE80211_IS_CHAN_HT(c))
continue;
// here, HT20 and HT40 channels are filtered out
/*
* If a desired mode was specified, scan only
* channels that satisfy that constraint.
*/
if (vap->iv_des_mode != IEEE80211_MODE_AUTO &&
vap->iv_des_mode != ieee80211_chan2mode(c))
continue;
// iv_des_mode = 11NG, chan2mode(DYN | 2G) = 11G, chan2mode(CCK | 2G) = 11B, so
other channels are filtered out
as a result, no channels are prepared for scan.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-wireless
mailing list