Author: avos Date: Sun Feb 3 01:32:02 2019 New Revision: 343696 URL: https://svnweb.freebsd.org/changeset/base/343696
Log: net80211(4): do not setup roaming parameters for unsupported modes. ifconfig(8) prints per-mode parameters if they are non-zero; since we have 13 possible modes with 3...5 typically supported this change should greatly reduce amount of information for 'ifconfig <wlan> list roam' command. While here ensure that sta_roam_check() will not use roaming parameters for unsupported modes (it should not). This change effectively reverts r188776. MFC after: 2 weeks Modified: head/sys/net80211/ieee80211_scan.c head/sys/net80211/ieee80211_scan_sta.c Modified: head/sys/net80211/ieee80211_scan.c ============================================================================== --- head/sys/net80211/ieee80211_scan.c Sun Feb 3 00:45:52 2019 (r343695) +++ head/sys/net80211/ieee80211_scan.c Sun Feb 3 01:32:02 2019 (r343696) @@ -130,13 +130,21 @@ void ieee80211_scan_vattach(struct ieee80211vap *vap) { struct ieee80211com *ic = vap->iv_ic; + int m; vap->iv_bgscanidle = (IEEE80211_BGSCAN_IDLE_DEFAULT*1000)/hz; vap->iv_bgscanintvl = IEEE80211_BGSCAN_INTVAL_DEFAULT*hz; vap->iv_scanvalid = IEEE80211_SCAN_VALID_DEFAULT*hz; vap->iv_roaming = IEEE80211_ROAMING_AUTO; - memcpy(vap->iv_roamparms, defroam, sizeof(defroam)); + + memset(vap->iv_roamparms, 0, sizeof(vap->iv_roamparms)); + for (m = IEEE80211_MODE_AUTO + 1; m < IEEE80211_MODE_MAX; m++) { + if (isclr(ic->ic_modecaps, m)) + continue; + + memcpy(&vap->iv_roamparms[m], &defroam[m], sizeof(defroam[m])); + } ic->ic_scan_methods->sc_vattach(vap); } Modified: head/sys/net80211/ieee80211_scan_sta.c ============================================================================== --- head/sys/net80211/ieee80211_scan_sta.c Sun Feb 3 00:45:52 2019 (r343695) +++ head/sys/net80211/ieee80211_scan_sta.c Sun Feb 3 01:32:02 2019 (r343696) @@ -1354,6 +1354,9 @@ sta_roam_check(struct ieee80211_scan_state *ss, struct mode = ieee80211_chan2mode(ic->ic_bsschan); roamRate = vap->iv_roamparms[mode].rate; roamRssi = vap->iv_roamparms[mode].rssi; + KASSERT(roamRate != 0 && roamRssi != 0, ("iv_roamparms are not" + "initialized for %s mode!", ieee80211_phymode_name[mode])); + ucastRate = vap->iv_txparms[mode].ucastrate; /* NB: the most up to date rssi is in the node, not the scan cache */ curRssi = ic->ic_node_getrssi(ni); _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"