aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath6kl
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2014-01-24 04:53:53 -0500
committerJohannes Berg <johannes.berg@intel.com>2014-02-04 15:58:12 -0500
commitea73cbce4e1fd93113301532ad98041b119bc85a (patch)
tree40f4fc8b5966ab5b15dfe38ad154ce4b9267685b /drivers/net/wireless/ath/ath6kl
parent9fa37a3d6604fcdd1372bc0d2d724c3371ecb7f9 (diff)
nl80211: fix scheduled scan RSSI matchset attribute confusion
The scheduled scan matchsets were intended to be a list of filters, with the found BSS having to pass at least one of them to be passed to the host. When the RSSI attribute was added, however, this was broken and currently wpa_supplicant adds that attribute in its own matchset; however, it doesn't intend that to mean that anything that passes the RSSI filter should be passed to the host, instead it wants it to mean that everything needs to also have higher RSSI. This is semantically problematic because we have a list of filters like [ SSID1, SSID2, SSID3, RSSI ] with no real indication which one should be OR'ed and which one AND'ed. To fix this, move the RSSI filter attribute into each matchset. As we need to stay backward compatible, treat a matchset with only the RSSI attribute as a "default RSSI filter" for all other matchsets, but only if there are other matchsets (an RSSI-only matchset by itself is still desirable.) To make driver implementation easier, keep a global min_rssi_thold for the entire request as well. The only affected driver is ath6kl. I found this when I looked into the code after Raja Mani submitted a patch fixing the n_match_sets calculation to disregard the RSSI, but that patch didn't address the semantic issue. Reported-by: Raja Mani <rmani@qti.qualcomm.com> Acked-by: Luciano Coelho <luciano.coelho@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath6kl')
-rw-r--r--drivers/net/wireless/ath/ath6kl/cfg80211.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index fd4c89df67e1..eba32f56850a 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -3256,6 +3256,15 @@ static int ath6kl_cfg80211_sscan_start(struct wiphy *wiphy,
3256 struct ath6kl_vif *vif = netdev_priv(dev); 3256 struct ath6kl_vif *vif = netdev_priv(dev);
3257 u16 interval; 3257 u16 interval;
3258 int ret, rssi_thold; 3258 int ret, rssi_thold;
3259 int n_match_sets = request->n_match_sets;
3260
3261 /*
3262 * If there's a matchset w/o an SSID, then assume it's just for
3263 * the RSSI (nothing else is currently supported) and ignore it.
3264 * The device only supports a global RSSI filter that we set below.
3265 */
3266 if (n_match_sets == 1 && !request->match_sets[0].ssid.ssid_len)
3267 n_match_sets = 0;
3259 3268
3260 if (ar->state != ATH6KL_STATE_ON) 3269 if (ar->state != ATH6KL_STATE_ON)
3261 return -EIO; 3270 return -EIO;
@@ -3268,11 +3277,11 @@ static int ath6kl_cfg80211_sscan_start(struct wiphy *wiphy,
3268 ret = ath6kl_set_probed_ssids(ar, vif, request->ssids, 3277 ret = ath6kl_set_probed_ssids(ar, vif, request->ssids,
3269 request->n_ssids, 3278 request->n_ssids,
3270 request->match_sets, 3279 request->match_sets,
3271 request->n_match_sets); 3280 n_match_sets);
3272 if (ret < 0) 3281 if (ret < 0)
3273 return ret; 3282 return ret;
3274 3283
3275 if (!request->n_match_sets) { 3284 if (!n_match_sets) {
3276 ret = ath6kl_wmi_bssfilter_cmd(ar->wmi, vif->fw_vif_idx, 3285 ret = ath6kl_wmi_bssfilter_cmd(ar->wmi, vif->fw_vif_idx,
3277 ALL_BSS_FILTER, 0); 3286 ALL_BSS_FILTER, 0);
3278 if (ret < 0) 3287 if (ret < 0)
@@ -3286,12 +3295,12 @@ static int ath6kl_cfg80211_sscan_start(struct wiphy *wiphy,
3286 3295
3287 if (test_bit(ATH6KL_FW_CAPABILITY_RSSI_SCAN_THOLD, 3296 if (test_bit(ATH6KL_FW_CAPABILITY_RSSI_SCAN_THOLD,
3288 ar->fw_capabilities)) { 3297 ar->fw_capabilities)) {
3289 if (request->rssi_thold <= NL80211_SCAN_RSSI_THOLD_OFF) 3298 if (request->min_rssi_thold <= NL80211_SCAN_RSSI_THOLD_OFF)
3290 rssi_thold = 0; 3299 rssi_thold = 0;
3291 else if (request->rssi_thold < -127) 3300 else if (request->min_rssi_thold < -127)
3292 rssi_thold = -127; 3301 rssi_thold = -127;
3293 else 3302 else
3294 rssi_thold = request->rssi_thold; 3303 rssi_thold = request->min_rssi_thold;
3295 3304
3296 ret = ath6kl_wmi_set_rssi_filter_cmd(ar->wmi, vif->fw_vif_idx, 3305 ret = ath6kl_wmi_set_rssi_filter_cmd(ar->wmi, vif->fw_vif_idx,
3297 rssi_thold); 3306 rssi_thold);