Fix number 1: During network selection (for 'ifconfig join'), give APs which support 11n and 11ac a higher score. VHT implies HT, so 11ac networks receive 2 additional points while 11n-only networks receive one additional point.
Fix number 2: During AP selection within a given network, we would like to prefer 5GHz APs. However, this check was incorrectly implemented for drivers which report RSSI as a percentage, such as iwm(4) or iwx(4). Fix this such that APs with at least 50% rssi level will be preferred, as was intended. We can use an already existing function which performs this check correctly instead of hand-rolling the check. ok? diff 15b71cdf8530b1f64fb85d50873b1ff1fad3f0e8 /usr/src blob - 229636579d3554154733676cc8deb0004f8ce173 file + sys/net80211/ieee80211_node.c --- sys/net80211/ieee80211_node.c +++ sys/net80211/ieee80211_node.c @@ -480,6 +480,12 @@ ieee80211_ess_calculate_score(struct ieee80211com *ic, ni->ni_rssi > min_5ghz_rssi) score += 2; + /* HT/VHT available */ + if (ieee80211_node_supports_ht(ni)) + score++; + if (ieee80211_node_supports_vht(ni)) + score++; + /* Boost this AP if it had no auth/assoc failures in the past. */ if (ni->ni_fails == 0) score += 21; @@ -493,6 +499,7 @@ ieee80211_ess_calculate_score(struct ieee80211com *ic, * * crypto: wpa2 > wpa1 > wep > open * band: 5 GHz > 2 GHz provided 5 GHz rssi is above threshold + * supported standard revisions: 11ac > 11n > 11a/b/g * rssi: rssi1 > rssi2 as a numeric comparison with a slight * disadvantage for 2 GHz APs * @@ -1413,7 +1420,7 @@ ieee80211_node_choose_bss(struct ieee80211com *ic, int * (as long as it meets the minimum RSSI threshold) since the 5Ghz band * is usually less saturated. */ - if (selbs5 && selbs5->ni_rssi > min_5ghz_rssi) + if (selbs5 && (*ic->ic_node_checkrssi)(ic, selbs5)) selbs = selbs5; else if (selbs5 && selbs2) selbs = (selbs5->ni_rssi >= selbs2->ni_rssi ? selbs5 : selbs2);