Selaa lähdekoodia

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
Pragaspathi Thilagaraj 3 vuotta sitten
vanhempi
sitoutus
73b225f611

+ 9 - 3
components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_public_struct.h

@@ -539,15 +539,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;
 };
 

+ 13 - 1
components/wmi/src/wmi_unified_roam_tlv.c

@@ -1215,6 +1215,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;
@@ -1261,6 +1265,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,
@@ -1360,7 +1368,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 =

+ 25 - 1
core/hdd/src/wlan_hdd_cfg80211.c

@@ -4641,6 +4641,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},
 };
@@ -5178,7 +5184,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)