From 91262aa0920eb862faf6091be0067ab759d387b2 Mon Sep 17 00:00:00 2001 From: Pragaspathi Thilagaraj Date: Thu, 27 May 2021 23:17:57 +0530 Subject: [PATCH] qcacld-3.0: Update WTC params only if the WTC attribute is present Currently driver updates the WTC global parameters irrespective of the WTC attributes present in the vendor command. This causes the WTC parameters to be reset and WTC roam trigger doesn't happen. For example, with below sequence of commands: wpa_cli DRIVER setwtcmode 0 1 -40 -95 -90 -85 wpa_cli DRIVER ADDROAMSCANFREQUENCIES_LEGACY 19 2412 2417 2422 The WTC parameters TLV is not included in the RSO update command. Update the WTC params only if the WTC attribute is present. Change-Id: I53e5d934368169069dbf059335859936d320aa4e CRs-Fixed: 2954458 --- core/hdd/src/wlan_hdd_cfg80211.c | 44 ++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index bc7f8174b367..5c1aef598b5c 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -5023,6 +5023,7 @@ hdd_set_roam_with_control_config(struct hdd_context *hdd_ctx, struct nlattr *tb2[QCA_ATTR_ROAM_CONTROL_MAX + 1], *attr; uint32_t value; struct wlan_cm_roam_vendor_btm_params param = {0}; + bool is_wtc_param_updated = false; hdd_enter(); /* The command must carry PARAM_ROAM_CONTROL_CONFIG */ @@ -5140,44 +5141,61 @@ hdd_set_roam_with_control_config(struct hdd_context *hdd_ctx, } attr = tb2[QCA_ATTR_ROAM_CONTROL_SCAN_SCHEME]; - if (attr) + if (attr) { param.scan_freq_scheme = nla_get_u32(attr); + is_wtc_param_updated = true; + } attr = tb2[QCA_ATTR_ROAM_CONTROL_CONNECTED_RSSI_THRESHOLD]; - if (attr) + if (attr) { param.connected_rssi_threshold = nla_get_u32(attr); + is_wtc_param_updated = true; + } attr = tb2[QCA_ATTR_ROAM_CONTROL_CANDIDATE_RSSI_THRESHOLD]; - if (attr) + if (attr) { param.candidate_rssi_threshold_2g = nla_get_u32(attr); + is_wtc_param_updated = true; + } attr = tb2[QCA_ATTR_ROAM_CONTROL_CANDIDATE_RSSI_THRESHOLD_2P4GHZ]; - if (attr) + if (attr) { param.candidate_rssi_threshold_2g = nla_get_u32(attr); + is_wtc_param_updated = true; + } attr = tb2[QCA_ATTR_ROAM_CONTROL_CANDIDATE_RSSI_THRESHOLD_5GHZ]; - if (attr) + if (attr) { param.candidate_rssi_threshold_5g = nla_get_u32(attr); - else + is_wtc_param_updated = true; + } else { param.candidate_rssi_threshold_5g = param.candidate_rssi_threshold_2g; + } attr = tb2[QCA_ATTR_ROAM_CONTROL_CANDIDATE_RSSI_THRESHOLD_6GHZ]; - if (attr) + if (attr) { param.candidate_rssi_threshold_6g = nla_get_u32(attr); - else + is_wtc_param_updated = true; + } else { param.candidate_rssi_threshold_6g = param.candidate_rssi_threshold_2g; + } attr = tb2[QCA_ATTR_ROAM_CONTROL_USER_REASON]; - if (attr) + if (attr) { param.user_roam_reason = nla_get_u32(attr); - else + is_wtc_param_updated = true; + } else { param.user_roam_reason = DISABLE_VENDOR_BTM_CONFIG; + } - wlan_cm_roam_set_vendor_btm_params(hdd_ctx->psoc, vdev_id, ¶m); - /* Sends RSO update */ - sme_send_vendor_btm_params(hdd_ctx->mac_handle, vdev_id); + if (is_wtc_param_updated) { + wlan_cm_roam_set_vendor_btm_params(hdd_ctx->psoc, vdev_id, + ¶m); + /* Sends RSO update */ + sme_send_vendor_btm_params(hdd_ctx->mac_handle, vdev_id); + } return qdf_status_to_os_return(status); }