From owner-svn-src-head@freebsd.org Wed Jul 26 05:26:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 152A4DB1BC8; Wed, 26 Jul 2017 05:26:03 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 E616C759DD; Wed, 26 Jul 2017 05:26:02 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6Q5Q2QM094323; Wed, 26 Jul 2017 05:26:02 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6Q5Q2FP094322; Wed, 26 Jul 2017 05:26:02 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201707260526.v6Q5Q2FP094322@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 26 Jul 2017 05:26:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321507 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 321507 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jul 2017 05:26:03 -0000 Author: adrian Date: Wed Jul 26 05:26:01 2017 New Revision: 321507 URL: https://svnweb.freebsd.org/changeset/base/321507 Log: [iwm] if_iwm - Use chan list from ieee80211_scan_state for scan, not ic_channels. * Limiting the channel list with "ifconfig wlan0 chanlist ..." now will actually set the list of channels scanned by iwm. Tested: * Intel 7260, STA mode, setting chanlist to 1-14 and 36-254, and indeed it does what it should! Modified: head/sys/dev/iwm/if_iwm_scan.c Modified: head/sys/dev/iwm/if_iwm_scan.c ============================================================================== --- head/sys/dev/iwm/if_iwm_scan.c Wed Jul 26 05:01:46 2017 (r321506) +++ head/sys/dev/iwm/if_iwm_scan.c Wed Jul 26 05:26:01 2017 (r321507) @@ -307,15 +307,13 @@ iwm_mvm_lmac_scan_fill_channels(struct iwm_softc *sc, int j; for (nchan = j = 0; - j < ic->ic_nchans && nchan < sc->ucode_capa.n_scan_channels; j++) { - c = &ic->ic_channels[j]; - /* For 2GHz, only populate 11b channels */ - /* For 5GHz, only populate 11a channels */ + j < ss->ss_last && nchan < sc->ucode_capa.n_scan_channels; j++) { + c = ss->ss_chans[j]; /* * Catch other channels, in case we have 900MHz channels or * something in the chanlist. */ - if (iwm_mvm_scan_skip_channel(c)) { + if (!IEEE80211_IS_CHAN_2GHZ(c) && !IEEE80211_IS_CHAN_5GHZ(c)) { IWM_DPRINTF(sc, IWM_DEBUG_RESET | IWM_DEBUG_EEPROM, "%s: skipping channel (freq=%d, ieee=%d, flags=0x%08x)\n", __func__, c->ic_freq, c->ic_ieee, c->ic_flags); @@ -346,20 +344,19 @@ iwm_mvm_umac_scan_fill_channels(struct iwm_softc *sc, struct iwm_scan_channel_cfg_umac *chan, int n_ssids) { struct ieee80211com *ic = &sc->sc_ic; + struct ieee80211_scan_state *ss = ic->ic_scan; struct ieee80211_channel *c; uint8_t nchan; int j; for (nchan = j = 0; - j < ic->ic_nchans && nchan < sc->ucode_capa.n_scan_channels; j++) { - c = &ic->ic_channels[j]; - /* For 2GHz, only populate 11b channels */ - /* For 5GHz, only populate 11a channels */ + j < ss->ss_last && nchan < sc->ucode_capa.n_scan_channels; j++) { + c = ss->ss_chans[j]; /* * Catch other channels, in case we have 900MHz channels or * something in the chanlist. */ - if (iwm_mvm_scan_skip_channel(c)) { + if (!IEEE80211_IS_CHAN_2GHZ(c) && !IEEE80211_IS_CHAN_5GHZ(c)) { IWM_DPRINTF(sc, IWM_DEBUG_RESET | IWM_DEBUG_EEPROM, "%s: skipping channel (freq=%d, ieee=%d, flags=0x%08x)\n", __func__, c->ic_freq, c->ic_ieee, c->ic_flags); @@ -726,7 +723,7 @@ iwm_mvm_lmac_scan(struct iwm_softc *sc) if (iwm_mvm_rrm_scan_needed(sc)) req->scan_flags |= htole32(IWM_MVM_LMAC_SCAN_FLAGS_RRM_ENABLED); - req->flags = iwm_mvm_scan_rxon_flags(&sc->sc_ic.ic_channels[0]); + req->flags = iwm_mvm_scan_rxon_flags(sc->sc_ic.ic_scan->ss_chans[0]); req->filter_flags = htole32(IWM_MAC_FILTER_ACCEPT_GRP | IWM_MAC_FILTER_IN_BEACON);