Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Feb 2019 03:12:27 +0000 (UTC)
From:      Andriy Voskoboinyk <avos@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r344223 - stable/11/sys/net80211
Message-ID:  <201902170312.x1H3CRHx020898@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avos
Date: Sun Feb 17 03:12:27 2019
New Revision: 344223
URL: https://svnweb.freebsd.org/changeset/base/344223

Log:
  MFC r343696:
  net80211: 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.

Modified:
  stable/11/sys/net80211/ieee80211_scan.c
  stable/11/sys/net80211/ieee80211_scan_sta.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/net80211/ieee80211_scan.c
==============================================================================
--- stable/11/sys/net80211/ieee80211_scan.c	Sun Feb 17 03:11:42 2019	(r344222)
+++ stable/11/sys/net80211/ieee80211_scan.c	Sun Feb 17 03:12:27 2019	(r344223)
@@ -122,13 +122,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: stable/11/sys/net80211/ieee80211_scan_sta.c
==============================================================================
--- stable/11/sys/net80211/ieee80211_scan_sta.c	Sun Feb 17 03:11:42 2019	(r344222)
+++ stable/11/sys/net80211/ieee80211_scan_sta.c	Sun Feb 17 03:12:27 2019	(r344223)
@@ -1324,6 +1324,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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201902170312.x1H3CRHx020898>