From 41f8b208f40f4f60d399355cb69d9fba172f787e Mon Sep 17 00:00:00 2001 From: Pragaspathi Thilagaraj Date: Fri, 21 May 2021 20:25:07 +0530 Subject: [PATCH] qcacld-3.0: Add support for candidate AP RSSI in different bands Currently in WTC mode the candidate AP RSSI threshold configuration is applied for candidates on all band. Add support to configure the candidate AP RSSI threshold for different bands. Change-Id: I94442c0f1bd3ea20dc2f5ebe893a9ead7fb8d890 CRs-Fixed: 2951610 --- .../inc/wlan_cm_roam_public_struct.h | 12 ++++++--- components/wmi/src/wmi_unified_roam_tlv.c | 14 +++++++++- core/hdd/src/wlan_hdd_cfg80211.c | 26 ++++++++++++++++++- 3 files changed, 47 insertions(+), 5 deletions(-) diff --git a/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_public_struct.h b/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_public_struct.h index fe969a97360e..ed6d65bea6a4 100644 --- a/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_public_struct.h +++ b/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_public_struct.h @@ -158,15 +158,21 @@ struct wlan_roam_offload_init_params { * qca_roam_scan_freq_scheme * @connected_rssi_threshold: RSSI threshold of the current * connected AP - * @candidate_rssi_threshold: RSSI threshold of the - * candidate AP + * @candidate_rssi_threshold_2g: RSSI threshold of the + * candidate AP in 2.4Ghz band + * @candidate_rssi_threshold_5g: RSSI threshold of the candidate AP in 5Ghz + * band + * @candidate_rssi_threshold_6g: RSSI threshold of the candidate AP in 6Ghz + * band * @user_roam_reason: Roam triggered reason code, value zero is for enable * and non zero value is disable */ struct wlan_cm_roam_vendor_btm_params { uint32_t scan_freq_scheme; uint32_t connected_rssi_threshold; - uint32_t candidate_rssi_threshold; + uint32_t candidate_rssi_threshold_2g; + uint32_t candidate_rssi_threshold_5g; + uint32_t candidate_rssi_threshold_6g; uint32_t user_roam_reason; }; diff --git a/components/wmi/src/wmi_unified_roam_tlv.c b/components/wmi/src/wmi_unified_roam_tlv.c index dd4d8fb2b595..4bfc3838efb3 100644 --- a/components/wmi/src/wmi_unified_roam_tlv.c +++ b/components/wmi/src/wmi_unified_roam_tlv.c @@ -1216,6 +1216,10 @@ static void wmi_fill_default_roam_trigger_parameters( ROAM_MAX_CFG_VALUE; roam_trigger_params->cand_ap_min_rssi_threshold = ROAM_MAX_CFG_VALUE; + roam_trigger_params->cand_ap_min_rssi_threshold_5g = + ROAM_MAX_CFG_VALUE; + roam_trigger_params->cand_ap_min_rssi_threshold_6g = + ROAM_MAX_CFG_VALUE; roam_trigger_params->roam_score_delta_percentage = ROAM_MAX_CFG_VALUE; roam_trigger_params->reason_code = ROAM_MAX_CFG_VALUE; @@ -1262,6 +1266,10 @@ static void wmi_fill_min_rssi_params( convert_roam_trigger_reason(trig_reason)); roam_trigger_params->cand_ap_min_rssi_threshold = triggers->min_rssi_params[trig_index].min_rssi; + roam_trigger_params->cand_ap_min_rssi_threshold_5g = + triggers->min_rssi_params[trig_index].min_rssi; + roam_trigger_params->cand_ap_min_rssi_threshold_6g = + triggers->min_rssi_params[trig_index].min_rssi; wmi_debug("RSO_CFG: Min rssi thresh: %d converted trig_reason: %d", roam_trigger_params->cand_ap_min_rssi_threshold, @@ -1361,7 +1369,11 @@ static QDF_STATUS send_set_roam_trigger_cmd_tlv(wmi_unified_t wmi_handle, roam_trigger_parameters->trigger_rssi_threshold = triggers->vendor_btm_param.connected_rssi_threshold; roam_trigger_parameters->cand_ap_min_rssi_threshold = - triggers->vendor_btm_param.candidate_rssi_threshold; + triggers->vendor_btm_param.candidate_rssi_threshold_2g; + roam_trigger_parameters->cand_ap_min_rssi_threshold_5g = + triggers->vendor_btm_param.candidate_rssi_threshold_5g; + roam_trigger_parameters->cand_ap_min_rssi_threshold_6g = + triggers->vendor_btm_param.candidate_rssi_threshold_6g; roam_trigger_parameters->roam_score_delta_percentage = triggers->roam_score_delta; roam_trigger_parameters->reason_code = diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index ded24bb9c2a7..bc7f8174b367 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -4606,6 +4606,12 @@ roam_control_policy[QCA_ATTR_ROAM_CONTROL_MAX + 1] = { [QCA_ATTR_ROAM_CONTROL_SCAN_SCHEME] = {.type = NLA_U32}, [QCA_ATTR_ROAM_CONTROL_CONNECTED_RSSI_THRESHOLD] = {.type = NLA_U32}, [QCA_ATTR_ROAM_CONTROL_CANDIDATE_RSSI_THRESHOLD] = {.type = NLA_U32}, + [QCA_ATTR_ROAM_CONTROL_CANDIDATE_RSSI_THRESHOLD_2P4GHZ] = { + .type = NLA_U32}, + [QCA_ATTR_ROAM_CONTROL_CANDIDATE_RSSI_THRESHOLD_5GHZ] = { + .type = NLA_U32}, + [QCA_ATTR_ROAM_CONTROL_CANDIDATE_RSSI_THRESHOLD_6GHZ] = { + .type = NLA_U32}, [QCA_ATTR_ROAM_CONTROL_USER_REASON] = {.type = NLA_U32}, [QCA_ATTR_ROAM_CONTROL_SCAN_SCHEME_TRIGGERS] = {.type = NLA_U32}, }; @@ -5143,7 +5149,25 @@ hdd_set_roam_with_control_config(struct hdd_context *hdd_ctx, attr = tb2[QCA_ATTR_ROAM_CONTROL_CANDIDATE_RSSI_THRESHOLD]; if (attr) - param.candidate_rssi_threshold = nla_get_u32(attr); + param.candidate_rssi_threshold_2g = nla_get_u32(attr); + + attr = tb2[QCA_ATTR_ROAM_CONTROL_CANDIDATE_RSSI_THRESHOLD_2P4GHZ]; + if (attr) + param.candidate_rssi_threshold_2g = nla_get_u32(attr); + + attr = tb2[QCA_ATTR_ROAM_CONTROL_CANDIDATE_RSSI_THRESHOLD_5GHZ]; + if (attr) + param.candidate_rssi_threshold_5g = nla_get_u32(attr); + else + param.candidate_rssi_threshold_5g = + param.candidate_rssi_threshold_2g; + + attr = tb2[QCA_ATTR_ROAM_CONTROL_CANDIDATE_RSSI_THRESHOLD_6GHZ]; + if (attr) + param.candidate_rssi_threshold_6g = nla_get_u32(attr); + else + param.candidate_rssi_threshold_6g = + param.candidate_rssi_threshold_2g; attr = tb2[QCA_ATTR_ROAM_CONTROL_USER_REASON]; if (attr)