From owner-freebsd-wireless@FreeBSD.ORG Mon Sep 22 04:13:28 2014 Return-Path: Delivered-To: freebsd-wireless@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B6EE3257 for ; Mon, 22 Sep 2014 04:13:28 +0000 (UTC) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9DBF03E0 for ; Mon, 22 Sep 2014 04:13:28 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id s8M4DSEm046891 for ; Mon, 22 Sep 2014 04:13:28 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-wireless@FreeBSD.org Subject: [Bug 193826] New: iwn does not scan channels Date: Mon, 22 Sep 2014 04:13:28 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: wireless X-Bugzilla-Version: 11.0-CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: henry.hu.sh@gmail.com X-Bugzilla-Status: Needs Triage X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-wireless@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 04:13:28 -0000 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@FreeBSD.org Reporter: henry.hu.sh@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 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 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.