Browse Source

qcacld-3.0: Move BSS scoring logic to connection manager

Move bss scoring logic to connection manager.

Change-Id: Ie7639853dec303133705c3394bf0577670000c21
CRs-Fixed: 2707108
gaurank kathpalia 4 years ago
parent
commit
67b87cbde5

+ 4 - 3
Kbuild

@@ -878,7 +878,6 @@ UMAC_TARGET_SCAN_INC := -I$(WLAN_COMMON_INC)/target_if/scan/inc
 UMAC_SCAN_INC := -I$(WLAN_COMMON_INC)/$(UMAC_SCAN_DISP_INC_DIR)
 UMAC_SCAN_OBJS := $(UMAC_SCAN_CORE_DIR)/wlan_scan_cache_db.o \
 		$(UMAC_SCAN_CORE_DIR)/wlan_scan_11d.o \
-		$(UMAC_SCAN_CORE_DIR)/wlan_scan_bss_score.o \
 		$(UMAC_SCAN_CORE_DIR)/wlan_scan_filter.o \
 		$(UMAC_SCAN_CORE_DIR)/wlan_scan_main.o \
 		$(UMAC_SCAN_CORE_DIR)/wlan_scan_manager.o \
@@ -1165,7 +1164,8 @@ UMAC_MLME_INC := -I$(WLAN_COMMON_INC)/umac/mlme \
 		-I$(WLAN_COMMON_INC)/umac/mlme/mlme_objmgr/dispatcher/inc \
 		-I$(WLAN_COMMON_INC)/umac/mlme/vdev_mgr/dispatcher/inc \
 		-I$(WLAN_COMMON_INC)/umac/mlme/pdev_mgr/dispatcher/inc \
-		-I$(WLAN_COMMON_INC)/umac/mlme/psoc_mgr/dispatcher/inc
+		-I$(WLAN_COMMON_INC)/umac/mlme/psoc_mgr/dispatcher/inc \
+		-I$(WLAN_COMMON_INC)/umac/mlme/connection_mgr/dispatcher/inc
 
 UMAC_MLME_OBJS := $(WLAN_COMMON_ROOT)/umac/mlme/mlme_objmgr/dispatcher/src/wlan_vdev_mlme_main.o \
 		$(WLAN_COMMON_ROOT)/umac/mlme/vdev_mgr/core/src/vdev_mlme_sm.o \
@@ -1179,7 +1179,8 @@ UMAC_MLME_OBJS := $(WLAN_COMMON_ROOT)/umac/mlme/mlme_objmgr/dispatcher/src/wlan_
 		$(WLAN_COMMON_ROOT)/umac/mlme/mlme_objmgr/dispatcher/src/wlan_pdev_mlme_main.o \
 		$(WLAN_COMMON_ROOT)/umac/mlme/pdev_mgr/dispatcher/src/wlan_pdev_mlme_api.o \
 		$(WLAN_COMMON_ROOT)/umac/mlme/mlme_objmgr/dispatcher/src/wlan_psoc_mlme_main.o \
-		$(WLAN_COMMON_ROOT)/umac/mlme/psoc_mgr/dispatcher/src/wlan_psoc_mlme_api.o
+		$(WLAN_COMMON_ROOT)/umac/mlme/psoc_mgr/dispatcher/src/wlan_psoc_mlme_api.o \
+		$(WLAN_COMMON_ROOT)/umac/mlme/connection_mgr/core/src/wlan_cm_bss_scoring.o
 
 ######## MLME ##############
 MLME_DIR := components/mlme

+ 3 - 150
components/mlme/core/src/wlan_mlme_main.c

@@ -1696,21 +1696,6 @@ static void mlme_init_lfr_cfg(struct wlan_objmgr_psoc *psoc,
 	mlme_init_subnet_detection(psoc, lfr);
 }
 
-static uint32_t
-mlme_limit_max_per_index_score(uint32_t per_index_score)
-{
-	uint8_t i, score;
-
-	for (i = 0; i < MAX_INDEX_PER_INI; i++) {
-		score = WLAN_GET_SCORE_PERCENTAGE(per_index_score, i);
-		if (score > MAX_PCT_SCORE)
-			WLAN_SET_SCORE_PERCENTAGE(per_index_score,
-				MAX_PCT_SCORE, i);
-	}
-
-	return per_index_score;
-}
-
 static void mlme_init_power_cfg(struct wlan_objmgr_psoc *psoc,
 				struct wlan_mlme_power *power)
 {
@@ -1739,145 +1724,13 @@ static void mlme_init_power_cfg(struct wlan_objmgr_psoc *psoc,
 			(uint8_t)cfg_default(CFG_LOCAL_POWER_CONSTRAINT);
 }
 
-static void mlme_init_scoring_cfg(struct wlan_objmgr_psoc *psoc,
-				  struct wlan_mlme_scoring_cfg *scoring_cfg)
+static void mlme_init_roam_scoring_cfg(struct wlan_objmgr_psoc *psoc,
+				struct wlan_mlme_roam_scoring_cfg *scoring_cfg)
 {
-	uint32_t total_weight;
-
 	scoring_cfg->vendor_roam_score_algorithm =
 		cfg_get(psoc, CFG_VENDOR_ROAM_SCORE_ALGORITHM);
 	scoring_cfg->enable_scoring_for_roam =
 		cfg_get(psoc, CFG_ENABLE_SCORING_FOR_ROAM);
-	scoring_cfg->weight_cfg.rssi_weightage =
-		cfg_get(psoc, CFG_SCORING_RSSI_WEIGHTAGE);
-	scoring_cfg->weight_cfg.ht_caps_weightage =
-		cfg_get(psoc, CFG_SCORING_HT_CAPS_WEIGHTAGE);
-	scoring_cfg->weight_cfg.vht_caps_weightage =
-		cfg_get(psoc, CFG_SCORING_VHT_CAPS_WEIGHTAGE);
-	scoring_cfg->weight_cfg.he_caps_weightage =
-		cfg_get(psoc, CFG_SCORING_HE_CAPS_WEIGHTAGE);
-	scoring_cfg->weight_cfg.chan_width_weightage =
-		cfg_get(psoc, CFG_SCORING_CHAN_WIDTH_WEIGHTAGE);
-	scoring_cfg->weight_cfg.chan_band_weightage =
-		cfg_get(psoc, CFG_SCORING_CHAN_BAND_WEIGHTAGE);
-	scoring_cfg->weight_cfg.nss_weightage =
-		cfg_get(psoc, CFG_SCORING_NSS_WEIGHTAGE);
-	scoring_cfg->weight_cfg.beamforming_cap_weightage =
-		cfg_get(psoc, CFG_SCORING_BEAMFORM_CAP_WEIGHTAGE);
-	scoring_cfg->weight_cfg.pcl_weightage =
-		cfg_get(psoc, CFG_SCORING_PCL_WEIGHTAGE);
-	scoring_cfg->weight_cfg.channel_congestion_weightage =
-		cfg_get(psoc, CFG_SCORING_CHAN_CONGESTION_WEIGHTAGE);
-	scoring_cfg->weight_cfg.oce_wan_weightage =
-		cfg_get(psoc, CFG_SCORING_OCE_WAN_WEIGHTAGE);
-	scoring_cfg->weight_cfg.oce_ap_tx_pwr_weightage =
-				cfg_get(psoc, CFG_OCE_AP_TX_PWR_WEIGHTAGE);
-	scoring_cfg->weight_cfg.oce_subnet_id_weightage =
-				cfg_get(psoc, CFG_OCE_SUBNET_ID_WEIGHTAGE);
-
-	total_weight =  scoring_cfg->weight_cfg.rssi_weightage +
-			scoring_cfg->weight_cfg.ht_caps_weightage +
-			scoring_cfg->weight_cfg.vht_caps_weightage +
-			scoring_cfg->weight_cfg.he_caps_weightage +
-			scoring_cfg->weight_cfg.chan_width_weightage +
-			scoring_cfg->weight_cfg.chan_band_weightage +
-			scoring_cfg->weight_cfg.nss_weightage +
-			scoring_cfg->weight_cfg.beamforming_cap_weightage +
-			scoring_cfg->weight_cfg.pcl_weightage +
-			scoring_cfg->weight_cfg.channel_congestion_weightage +
-			scoring_cfg->weight_cfg.oce_wan_weightage +
-			scoring_cfg->weight_cfg.oce_ap_tx_pwr_weightage +
-			scoring_cfg->weight_cfg.oce_subnet_id_weightage;
-
-	/*
-	 * If configured weights are greater than max weight,
-	 * fallback to default weights
-	 */
-	if (total_weight > BEST_CANDIDATE_MAX_WEIGHT) {
-		mlme_legacy_err("Total weight greater than %d, using default weights",
-				BEST_CANDIDATE_MAX_WEIGHT);
-		scoring_cfg->weight_cfg.rssi_weightage = RSSI_WEIGHTAGE;
-		scoring_cfg->weight_cfg.ht_caps_weightage =
-						HT_CAPABILITY_WEIGHTAGE;
-		scoring_cfg->weight_cfg.vht_caps_weightage =
-						VHT_CAP_WEIGHTAGE;
-		scoring_cfg->weight_cfg.he_caps_weightage = HE_CAP_WEIGHTAGE;
-		scoring_cfg->weight_cfg.chan_width_weightage =
-						CHAN_WIDTH_WEIGHTAGE;
-		scoring_cfg->weight_cfg.chan_band_weightage =
-						CHAN_BAND_WEIGHTAGE;
-		scoring_cfg->weight_cfg.nss_weightage = NSS_WEIGHTAGE;
-		scoring_cfg->weight_cfg.beamforming_cap_weightage =
-						BEAMFORMING_CAP_WEIGHTAGE;
-		scoring_cfg->weight_cfg.pcl_weightage = PCL_WEIGHT;
-		scoring_cfg->weight_cfg.channel_congestion_weightage =
-						CHANNEL_CONGESTION_WEIGHTAGE;
-		scoring_cfg->weight_cfg.oce_wan_weightage = OCE_WAN_WEIGHTAGE;
-		scoring_cfg->weight_cfg.oce_ap_tx_pwr_weightage =
-			OCE_AP_TX_POWER_WEIGHTAGE;
-		scoring_cfg->weight_cfg.oce_subnet_id_weightage =
-			OCE_SUBNET_ID_WEIGHTAGE;
-	}
-
-	scoring_cfg->rssi_score.best_rssi_threshold =
-		cfg_get(psoc, CFG_SCORING_BEST_RSSI_THRESHOLD);
-	scoring_cfg->rssi_score.good_rssi_threshold =
-		cfg_get(psoc, CFG_SCORING_GOOD_RSSI_THRESHOLD);
-	scoring_cfg->rssi_score.bad_rssi_threshold =
-		cfg_get(psoc, CFG_SCORING_BAD_RSSI_THRESHOLD);
-
-	scoring_cfg->rssi_score.good_rssi_pcnt =
-		cfg_get(psoc, CFG_SCORING_GOOD_RSSI_PERCENT);
-	scoring_cfg->rssi_score.bad_rssi_pcnt =
-		cfg_get(psoc, CFG_SCORING_BAD_RSSI_PERCENT);
-
-	scoring_cfg->rssi_score.good_rssi_bucket_size =
-		cfg_get(psoc, CFG_SCORING_GOOD_RSSI_BUCKET_SIZE);
-	scoring_cfg->rssi_score.bad_rssi_bucket_size =
-		cfg_get(psoc, CFG_SCORING_BAD_RSSI_BUCKET_SIZE);
-
-	scoring_cfg->rssi_score.rssi_pref_5g_rssi_thresh =
-		cfg_get(psoc, CFG_SCORING_RSSI_PREF_5G_THRESHOLD);
-
-	scoring_cfg->bandwidth_weight_per_index =
-		mlme_limit_max_per_index_score(
-			cfg_get(psoc, CFG_SCORING_BW_WEIGHT_PER_IDX));
-	scoring_cfg->nss_weight_per_index =
-		mlme_limit_max_per_index_score(
-			cfg_get(psoc, CFG_SCORING_NSS_WEIGHT_PER_IDX));
-	scoring_cfg->band_weight_per_index =
-		mlme_limit_max_per_index_score(
-			cfg_get(psoc, CFG_SCORING_BAND_WEIGHT_PER_IDX));
-
-	scoring_cfg->esp_qbss_scoring.num_slot =
-		cfg_get(psoc, CFG_SCORING_NUM_ESP_QBSS_SLOTS);
-	scoring_cfg->esp_qbss_scoring.score_pcnt3_to_0 =
-		mlme_limit_max_per_index_score(
-			cfg_get(psoc, CFG_SCORING_ESP_QBSS_SCORE_IDX_3_TO_0));
-	scoring_cfg->esp_qbss_scoring.score_pcnt7_to_4 =
-		mlme_limit_max_per_index_score(
-			cfg_get(psoc, CFG_SCORING_ESP_QBSS_SCORE_IDX_7_TO_4));
-	scoring_cfg->esp_qbss_scoring.score_pcnt11_to_8 =
-		mlme_limit_max_per_index_score(
-			cfg_get(psoc, CFG_SCORING_ESP_QBSS_SCORE_IDX_11_TO_8));
-	scoring_cfg->esp_qbss_scoring.score_pcnt15_to_12 =
-		mlme_limit_max_per_index_score(
-			cfg_get(psoc, CFG_SCORING_ESP_QBSS_SCORE_IDX_15_TO_12));
-
-	scoring_cfg->oce_wan_scoring.num_slot =
-		cfg_get(psoc, CFG_SCORING_NUM_OCE_WAN_SLOTS);
-	scoring_cfg->oce_wan_scoring.score_pcnt3_to_0 =
-		mlme_limit_max_per_index_score(
-			cfg_get(psoc, CFG_SCORING_OCE_WAN_SCORE_IDX_3_TO_0));
-	scoring_cfg->oce_wan_scoring.score_pcnt7_to_4 =
-		mlme_limit_max_per_index_score(
-			cfg_get(psoc, CFG_SCORING_OCE_WAN_SCORE_IDX_7_TO_4));
-	scoring_cfg->oce_wan_scoring.score_pcnt11_to_8 =
-		mlme_limit_max_per_index_score(
-			cfg_get(psoc, CFG_SCORING_OCE_WAN_SCORE_IDX_11_TO_8));
-	scoring_cfg->oce_wan_scoring.score_pcnt15_to_12 =
-		mlme_limit_max_per_index_score(
-			cfg_get(psoc, CFG_SCORING_OCE_WAN_SCORE_IDX_15_TO_12));
 	scoring_cfg->roam_trigger_bitmap =
 			cfg_get(psoc, CFG_ROAM_SCORE_DELTA_TRIGGER_BITMAP);
 	scoring_cfg->roam_score_delta = cfg_get(psoc, CFG_ROAM_SCORE_DELTA);
@@ -2379,7 +2232,7 @@ QDF_STATUS mlme_cfg_on_psoc_enable(struct wlan_objmgr_psoc *psoc)
 	mlme_init_twt_cfg(psoc, &mlme_cfg->twt_cfg);
 	mlme_init_lfr_cfg(psoc, &mlme_cfg->lfr);
 	mlme_init_feature_flag_in_cfg(psoc, &mlme_cfg->feature_flags);
-	mlme_init_scoring_cfg(psoc, &mlme_cfg->scoring);
+	mlme_init_roam_scoring_cfg(psoc, &mlme_cfg->roam_scoring);
 	mlme_init_dot11_mode_cfg(&mlme_cfg->dot11_mode);
 	mlme_init_threshold_cfg(psoc, &mlme_cfg->threshold);
 	mlme_init_acs_cfg(psoc, &mlme_cfg->acs);

+ 2 - 2
components/mlme/dispatcher/inc/cfg_mlme.h

@@ -48,7 +48,7 @@
 #include "cfg_mlme_sap.h"
 #include "cfg_mlme_stats.h"
 #include "cfg_mlme_twt.h"
-#include "cfg_mlme_scoring.h"
+#include "cfg_mlme_roam_scoring.h"
 #include "cfg_mlme_oce.h"
 #include "cfg_mlme_threshold.h"
 #include "cfg_mlme_feature_flag.h"
@@ -88,7 +88,7 @@
 	CFG_REG_ALL \
 	CFG_SAP_ALL \
 	CFG_SAP_PROTECTION_ALL \
-	CFG_SCORING_ALL \
+	CFG_ROAM_SCORING_ALL \
 	CFG_STA_ALL \
 	CFG_STATS_ALL \
 	CFG_THRESHOLD_ALL \

+ 330 - 0
components/mlme/dispatcher/inc/cfg_mlme_roam_scoring.h

@@ -0,0 +1,330 @@
+/*
+ * Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/**
+ * DOC: This file contains roam specific SCORING related CFG/INI Items.
+ */
+
+#ifndef __CFG_MLME_ROAM_SCORING_H
+#define __CFG_MLME_ROAM_SCORING_H
+
+/*
+ * <ini>
+ * roam_score_delta_bitmap - bitmap to enable roam triggers on
+ * which roam score delta is to be applied during roam candidate
+ * selection
+ * @Min: 0
+ * @Max: 0xffffffff
+ * @Default: 0xffffffff
+ *
+ * Bitmap value of the following roam triggers:
+ * ROAM_TRIGGER_REASON_NONE       - B0,
+ * ROAM_TRIGGER_REASON_PER        - B1,
+ * ROAM_TRIGGER_REASON_BMISS      - B2,
+ * ROAM_TRIGGER_REASON_LOW_RSSI   - B3,
+ * ROAM_TRIGGER_REASON_HIGH_RSSI  - B4,
+ * ROAM_TRIGGER_REASON_PERIODIC   - B5,
+ * ROAM_TRIGGER_REASON_MAWC       - B6,
+ * ROAM_TRIGGER_REASON_DENSE      - B7,
+ * ROAM_TRIGGER_REASON_BACKGROUND - B8,
+ * ROAM_TRIGGER_REASON_FORCED     - B9,
+ * ROAM_TRIGGER_REASON_BTM        - B10,
+ * ROAM_TRIGGER_REASON_UNIT_TEST  - B11,
+ * ROAM_TRIGGER_REASON_BSS_LOAD   - B12
+ * ROAM_TRIGGER_REASON_DISASSOC   - B13
+ * ROAM_TRIGGER_REASON_IDLE_ROAM  - B14
+ *
+ * When the bit corresponding to a particular roam trigger reason
+ * is set, the value of "roam_score_delta" is expected over the
+ * roam score of the current connected AP, for that triggered roam
+ *
+ * Related: None
+ *
+ * Supported Feature: Roaming
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
+#define CFG_ROAM_SCORE_DELTA_TRIGGER_BITMAP CFG_INI_UINT( \
+			"roam_score_delta_bitmap", \
+			0, \
+			0xFFFFFFFF, \
+			0xFFFFFFFF, \
+			CFG_VALUE_OR_DEFAULT, \
+			"Bitmap for various roam triggers")
+
+/*
+ * <ini>
+ * roam_score_delta - Percentage increment in roam score value
+ * that is expected from a roaming candidate AP.
+ * @Min: 0
+ * @Max: 100
+ * @Default: 0
+ *
+ * This ini is used to provide the percentage increment value over roam
+ * score for the candidate APs so that they can be preferred over current
+ * AP for roaming.
+ *
+ * Related: None
+ *
+ * Supported Feature: Roaming
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
+#define CFG_ROAM_SCORE_DELTA CFG_INI_UINT( \
+			"roam_score_delta", \
+			0, \
+			100, \
+			0, \
+			CFG_VALUE_OR_DEFAULT, \
+			"candidate AP's percentage roam score delta")
+
+/*
+ * <ini>
+ * min_roam_score_delta - Difference of roam score values between connected
+ * AP and roam candidate AP.
+ * @Min: 0
+ * @Max: 10000
+ * @Default: 0
+ *
+ * This ini is used during CU and low rssi based roam triggers, consider
+ * AP as roam candidate only if its roam score is better than connected
+ * AP score by at least min_roam_score_delta.
+ * If user configured "roam_score_delta" and "min_roam_score_delta" both,
+ * then firmware selects roam candidate AP by considering values of both
+ * INIs.
+ * Example: If DUT is connected with AP1 and roam candidate AP2 has roam
+ * score greater than roam_score_delta and min_roam_score_delta then only
+ * firmware will trigger roaming to AP2.
+ *
+ * Related: roam_score_delta
+ *
+ * Supported Feature: Roaming
+ *
+ * Usage: Internal
+ *
+ * </ini>
+ */
+#define CFG_CAND_MIN_ROAM_SCORE_DELTA CFG_INI_UINT( \
+			"min_roam_score_delta", \
+			0, \
+			10000, \
+			0, \
+			CFG_VALUE_OR_DEFAULT, \
+			"Diff between connected AP's and candidate AP's roam score")
+
+/*
+ * <ini>
+ * enable_scoring_for_roam - enable/disable scoring logic in FW for candidate
+ * selection during roaming
+ *
+ * @Min: 0
+ * @Max: 1
+ * @Default: 1
+ *
+ * This ini is used to enable/disable scoring logic in FW for candidate
+ * selection during roaming.
+ *
+ * Supported Feature: STA Candidate selection by FW during roaming based on
+ * scoring logic.
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
+#define CFG_ENABLE_SCORING_FOR_ROAM CFG_INI_BOOL( \
+		"enable_scoring_for_roam", \
+		1, \
+		"Enable Scoring for Roam")
+
+/*
+ * <cfg>
+ * apsd_enabled - Enable automatic power save delivery
+ * @Min: 0
+ * @Max: 1
+ * @Default: 0
+ *
+ * Supported Feature: Power save
+ *
+ * Usage: Internal
+ *
+ * </cfg>
+ */
+#define CFG_APSD_ENABLED CFG_BOOL( \
+		"apsd_enabled", \
+		0, \
+		"Enable APSD")
+
+/*
+ * <ini>
+ * candidate_min_rssi_for_disconnect - Candidate AP minimum RSSI in
+ * idle roam trigger(in dBm).
+ * @Min: -120
+ * @Max: 0
+ * @Default: -70
+ *
+ * Minimum RSSI value of the candidate AP to consider it as candidate for
+ * roaming when roam trigger is Deauthentication/Disconnection from current
+ * AP. This value will be sent to firmware over the WMI_ROAM_AP_PROFILE
+ * wmi command in the roam_min_rssi_param_list tlv.
+ *
+ * Related: enable_idle_roam.
+ *
+ * Supported Feature: Roaming
+ *
+ * Usage: Internal/External
+ *
+ * </ini>
+ */
+#define CFG_DISCONNECT_ROAM_TRIGGER_MIN_RSSI CFG_INI_INT( \
+		"candidate_min_rssi_for_disconnect", \
+		-120, \
+		0, \
+		-70, \
+		CFG_VALUE_OR_DEFAULT, \
+		"Minimum RSSI of candidate AP for Disconnect roam trigger")
+
+/*
+ * <ini>
+ * candidate_min_rssi_for_beacon_miss - Candidate AP minimum RSSI for beacon
+ * miss roam trigger (in dBm)
+ * @Min: -120
+ * @Max: 0
+ * @Default: -70
+ *
+ * Minimum RSSI value of the candidate AP to consider it as candidate for
+ * roaming when roam trigger is disconnection from current AP due to beacon
+ * miss. This value will be sent to firmware over the WMI_ROAM_AP_PROFILE
+ * wmi command in the roam_min_rssi_param_list tlv.
+ *
+ * Related: None
+ *
+ * Supported Feature: Roaming
+ *
+ * Usage: Internal/External
+ *
+ * </ini>
+ */
+#define CFG_BMISS_ROAM_MIN_RSSI CFG_INI_INT( \
+	"candidate_min_rssi_for_beacon_miss", \
+	-120, \
+	0, \
+	-70, \
+	CFG_VALUE_OR_DEFAULT, \
+	"Minimum RSSI of candidate AP for Bmiss roam trigger")
+
+/*
+ * <ini>
+ * idle_roam_score_delta - Roam score delta value in percentage for idle roam.
+ * @Min: 0
+ * @Max: 100
+ * @Default: 0
+ *
+ * This ini is used to configure the minimum change in roam score
+ * value of the AP to consider it as candidate for
+ * roaming when roam trigger is due to idle state of sta.
+ * This value will be sent to firmware over the WMI_ROAM_AP_PROFILE wmi
+ * command in the roam_score_delta_param_list tlv.
+ * Related: None
+ *
+ * Supported Feature: Roaming
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
+#define CFG_IDLE_ROAM_SCORE_DELTA CFG_INI_UINT( \
+		"idle_roam_score_delta", \
+		0, \
+		100, \
+		0, \
+		CFG_VALUE_OR_DEFAULT, \
+		"Roam score delta for Idle roam trigger")
+
+/*
+ * <ini>
+ * btm_roam_score_delta - Roam score delta value in percentage for BTM triggered
+ * roaming.
+ * @Min: 0
+ * @Max: 100
+ * @Default: 0
+ *
+ * This ini is used to configure the minimum change in roam score
+ * value of the AP to consider it as candidate when the sta is disconnected
+ * from the current AP due to BTM kickout.
+ * This value will be sent to firmware over the WMI_ROAM_AP_PROFILE wmi
+ * command in the roam_score_delta_param_list tlv.
+ *
+ * Related: None
+ *
+ * Supported Feature: Roaming
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
+#define CFG_BTM_ROAM_SCORE_DELTA CFG_INI_UINT( \
+	"btm_roam_score_delta", \
+	0, \
+	100, \
+	0, \
+	CFG_VALUE_OR_DEFAULT, \
+	"Roam score delta for BTM roam trigger")
+
+/*
+ * <ini>
+ * vendor_roam_score_algorithm - Algorithm to calculate AP score
+ * @Min: 0
+ * @Max: 1
+ * @Default: 0
+ *
+ * By default the value is 0 and default roam algorithm will be used.
+ * When the value is 1, the V2 roaming algorithm will be used:
+ * For this V2 algo, AP score calculation is based on below equation:
+ * AP Score = (RSSIfactor * rssiweight(0.65)) + (CUfactor *cuweight(0.35))
+ *
+ * Related: None
+ *
+ * Supported Feature: roam score algorithm
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
+#define CFG_VENDOR_ROAM_SCORE_ALGORITHM CFG_INI_UINT( \
+	"vendor_roam_score_algorithm", \
+	0, \
+	1, \
+	0, \
+	CFG_VALUE_OR_DEFAULT, \
+	"Roam candidate selection score algorithm")
+
+#define CFG_ROAM_SCORING_ALL \
+	CFG(CFG_ROAM_SCORE_DELTA_TRIGGER_BITMAP) \
+	CFG(CFG_ROAM_SCORE_DELTA) \
+	CFG(CFG_CAND_MIN_ROAM_SCORE_DELTA) \
+	CFG(CFG_ENABLE_SCORING_FOR_ROAM) \
+	CFG(CFG_APSD_ENABLED) \
+	CFG(CFG_DISCONNECT_ROAM_TRIGGER_MIN_RSSI) \
+	CFG(CFG_BMISS_ROAM_MIN_RSSI) \
+	CFG(CFG_IDLE_ROAM_SCORE_DELTA) \
+	CFG(CFG_BTM_ROAM_SCORE_DELTA) \
+	CFG(CFG_VENDOR_ROAM_SCORE_ALGORITHM)
+
+#endif /* __CFG_MLME_ROAM_SCORING_H */

+ 0 - 1370
components/mlme/dispatcher/inc/cfg_mlme_scoring.h

@@ -1,1370 +0,0 @@
-/*
- * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
- *
- * Permission to use, copy, modify, and/or distribute this software for
- * any purpose with or without fee is hereby granted, provided that the
- * above copyright notice and this permission notice appear in all
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-/**
- * DOC: This file contains MLME SCORING related CFG/INI Items.
- */
-
-#ifndef __CFG_MLME_SCORING_H
-#define __CFG_MLME_SCORING_H
-
-/*
- * <ini>
- * rssi_weightage - RSSI Weightage to calculate best candidate
- * @Min: 0
- * @Max: 100
- * @Default: 20
- *
- * This ini is used to increase/decrease RSSI weightage in best candidate
- * selection. AP with better RSSI will get more weightage.
- *
- * Related: None
- *
- * Supported Feature: STA Candidate selection
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_SCORING_RSSI_WEIGHTAGE CFG_INI_UINT( \
-	"rssi_weightage", \
-	0, \
-	100, \
-	20, \
-	CFG_VALUE_OR_DEFAULT, \
-	"RSSI Weightage")
-
-/*
- * <ini>
- * ht_caps_weightage - HT caps weightage to calculate best candidate
- * @Min: 0
- * @Max: 100
- * @Default: 2
- *
- * This ini is used to increase/decrease HT caps weightage in best candidate
- * selection. If AP supports HT caps, AP will get additional Weightage with
- * this param. Weightage will be given only if dot11mode is HT capable.
- *
- * Related: None
- *
- * Supported Feature: STA Candidate selection
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_SCORING_HT_CAPS_WEIGHTAGE CFG_INI_UINT( \
-	"ht_caps_weightage", \
-	0, \
-	100, \
-	2, \
-	CFG_VALUE_OR_DEFAULT, \
-	"HT Caps Weightage")
-
-/*
- * <ini>
- * vht_caps_weightage - VHT caps Weightage to calculate best candidate
- * @Min: 0
- * @Max: 100
- * @Default: 1
- *
- * This ini is used to increase/decrease VHT caps weightage in best candidate
- * selection. If AP supports VHT caps, AP will get additional weightage with
- * this param. Weightage will be given only if dot11mode is VHT capable.
- *
- * Related: None
- *
- * Supported Feature: STA Candidate selection
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_SCORING_VHT_CAPS_WEIGHTAGE CFG_INI_UINT( \
-	"vht_caps_weightage", \
-	0, \
-	100, \
-	1, \
-	CFG_VALUE_OR_DEFAULT, \
-	"HT Caps Weightage")
-
-/*
- * <ini>
- * he_caps_weightage - HE caps Weightage to calculate best candidate
- * @Min: 0
- * @Max: 100
- * @Default: 2
- *
- * This ini is used to increase/decrease HE caps weightage in best candidate
- * selection. If AP supports HE caps, AP will get additional weightage with
- * this param. Weightage will be given only if dot11mode is HE capable.
- *
- * Related: None
- *
- * Supported Feature: STA Candidate selection
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_SCORING_HE_CAPS_WEIGHTAGE CFG_INI_UINT( \
-	"he_caps_weightage", \
-	0, \
-	100, \
-	2, \
-	CFG_VALUE_OR_DEFAULT, \
-	"HE Caps Weightage")
-
-/*
- * <ini>
- * chan_width_weightage - Channel Width Weightage to calculate best candidate
- * @Min: 0
- * @Max: 100
- * @Default: 12
- *
- * This ini is used to increase/decrease Channel Width weightage in best
- * candidate selection. AP with Higher channel width will get higher weightage
- *
- * Related: bandwidth_weight_per_index
- *
- * Supported Feature: STA Candidate selection
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_SCORING_CHAN_WIDTH_WEIGHTAGE CFG_INI_UINT( \
-	"chan_width_weightage", \
-	0, \
-	100, \
-	12, \
-	CFG_VALUE_OR_DEFAULT, \
-	"Channel width weightage")
-
-/*
- * <ini>
- * chan_band_weightage - Channel Band perferance to 5GHZ to
- * calculate best candidate
- * @Min: 0
- * @Max: 100
- * @Default: 2
- *
- * This ini is used to increase/decrease Channel Band Preference weightage
- * in best candidate selection. 5GHZ AP get this additional boost compare to
- * 2GHZ AP before   rssi_pref_5g_rssi_thresh and 2.4Ghz get weightage after
- * rssi_pref_5g_rssi_thresh.
- *
- * Related: rssi_pref_5g_rssi_thresh, band_weight_per_index
- *
- * Supported Feature: STA Candidate selection
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_SCORING_CHAN_BAND_WEIGHTAGE CFG_INI_UINT( \
-	"chan_band_weightage", \
-	0, \
-	100, \
-	2, \
-	CFG_VALUE_OR_DEFAULT, \
-	"Channel Band Weightage")
-
-/*
- * <ini>
- * nss_weightage - NSS Weightage to calculate best candidate
- * @Min: 0
- * @Max: 100
- * @Default: 16
- *
- * This ini is used to increase/decrease NSS weightage in best candidate
- * selection. If there are two AP, one AP supports 2x2 and another one supports
- * 1x1 and station supports 2X2, first A will get this additional weightage
- * depending on self-capability.
- *
- * Related: nss_weight_per_index
- *
- * Supported Feature: STA Candidate selection
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_SCORING_NSS_WEIGHTAGE CFG_INI_UINT( \
-	"nss_weightage", \
-	0, \
-	100, \
-	16, \
-	CFG_VALUE_OR_DEFAULT, \
-	"NSS Weightage")
-/*
- * <ini>
- * beamforming_cap_weightage - Beam Forming Weightage to
- *			       calculate best candidate
- * @Min: 0
- * @Max: 100
- * @Default: 2
- *
- * This ini is used to increase/decrease Beam forming Weightage if some AP
- * support Beam forming or not. If AP supports Beam forming, that AP will get
- * additional boost of this weightage.
- *
- * Related: None
- *
- * Supported Feature: STA Candidate selection
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_SCORING_BEAMFORM_CAP_WEIGHTAGE CFG_INI_UINT( \
-	"beamforming_cap_weightage", \
-	0, \
-	100, \
-	2, \
-	CFG_VALUE_OR_DEFAULT, \
-	"Beamforming Cap Weightage")
-
-/*
- * <ini>
- * pcl_weightage - PCL Weightage to calculate best candidate
- * @Min: 0
- * @Max: 100
- * @Default: 10
- *
- * This ini is used to increase/decrease PCL weightage in best candidate
- * selection. If some APs are in PCL list, those AP will get addition
- * weightage.
- *
- * Related: None
- *
- * Supported Feature: STA Candidate selection
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_SCORING_PCL_WEIGHTAGE CFG_INI_UINT( \
-	"pcl_weightage", \
-	0, \
-	100, \
-	10, \
-	CFG_VALUE_OR_DEFAULT, \
-	"PCL Weightage")
-
-/*
- * <ini>
- * channel_congestion_weightage - channel Congestion Weightage to
- * calculate best candidate
- * @Min: 0
- * @Max: 100
- * @Default: 25
- *
- * This ini is used to increase/decrease channel congestion weightage in
- * candidate selection. Congestion is measured with the help of ESP/QBSS load.
- *
- * Related: num_esp_qbss_slots
- *
- * Supported Feature: STA Candidate selection
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_SCORING_CHAN_CONGESTION_WEIGHTAGE CFG_INI_UINT( \
-	"channel_congestion_weightage", \
-	0, \
-	100, \
-	25, \
-	CFG_VALUE_OR_DEFAULT, \
-	"Channel Congestion Weightage")
-
-/*
- * <ini>
- * oce_wan_weightage - OCE WAN DL capacity Weightage to calculate best candidate
- * @Min: 0
- * @Max: 100
- * @Default: 2
- *
- * This ini is used to increase/decrease OCE WAN caps weightage in best
- * candidate selection. If AP have OCE WAN information, give weightage depending
- * on the downaload available capacity.
- *
- * Related: num_oce_wan_slots
- *
- * Supported Feature: STA Candidate selection
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_SCORING_OCE_WAN_WEIGHTAGE CFG_INI_UINT( \
-	"oce_wan_weightage", \
-	0, \
-	100, \
-	2, \
-	CFG_VALUE_OR_DEFAULT, \
-	"OCE WAN Weightage")
-
-/*
- * <ini>
- * best_rssi_threshold - Best Rssi for score calculation
- * @Min: 0
- * @Max: 96
- * @Default: 55
- *
- * This ini tells limit for best RSSI. RSSI better than this limit are
- * considered as best RSSI. The best RSSI is given full rssi_weightage.
- *
- * Related: rssi_weightage
- *
- * Supported Feature: STA Candidate selection
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_SCORING_BEST_RSSI_THRESHOLD CFG_INI_UINT( \
-	"best_rssi_threshold", \
-	0, \
-	96, \
-	55, \
-	CFG_VALUE_OR_DEFAULT, \
-	"Best RSSI threshold")
-
-/*
- * <ini>
- * good_rssi_threshold - Good Rssi for score calculation
- * @Min: 0
- * @Max: 96
- * @Default: 70
- *
- * This ini tells limit for good RSSI. RSSI better than this limit and less
- * than best_rssi_threshold is considered as good RSSI.
- *
- * Related: rssi_weightage, best_rssi_threshold
- *
- * Supported Feature: STA Candidate selection
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_SCORING_GOOD_RSSI_THRESHOLD CFG_INI_UINT( \
-	"good_rssi_threshold", \
-	0, \
-	96, \
-	70, \
-	CFG_VALUE_OR_DEFAULT, \
-	"Good RSSI threshold")
-
-/*
- * <ini>
- * bad_rssi_threshold - Bad Rssi for score calculation
- * @Min: 0
- * @Max: 96
- * @Default: 80
- *
- * This ini tells limit for Bad RSSI. RSSI greater then bad_rssi_threshold
- * is considered as bad RSSI.
- *
- * Related: rssi_weightage, good_rssi_threshold
- *
- * Supported Feature: STA Candidate selection
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_SCORING_BAD_RSSI_THRESHOLD CFG_INI_UINT( \
-	"bad_rssi_threshold", \
-	0, \
-	96, \
-	80, \
-	CFG_VALUE_OR_DEFAULT, \
-	"Bad RSSI threshold")
-
-/*
- * <ini>
- * good_rssi_pcnt - Percent Score to Good RSSI out of total RSSI score.
- * @Min: 0
- * @Max: 100
- * @Default: 80
- *
- * This ini tells about how much percent should be given to good RSSI(RSSI
- * between best_rssi_threshold and good_rssi_threshold) out of RSSI weightage.
- *
- * Related: rssi_weightage, best_rssi_threshold, good_rssi_threshold
- *
- * Supported Feature: STA Candidate selection
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_SCORING_GOOD_RSSI_PERCENT CFG_INI_UINT( \
-	"good_rssi_pcnt", \
-	0, \
-	100, \
-	80, \
-	CFG_VALUE_OR_DEFAULT, \
-	"Good RSSI Percent")
-
-/*
- * <ini>
- * bad_rssi_pcnt - Percent Score to BAD RSSI out of total RSSI score.
- * @Min: 0
- * @Max: 100
- * @Default: 25
- *
- * This ini tells about how much percent should be given to bad RSSI (RSSI
- * between good_rssi_threshold and bad_rssi_threshold) out of RSSI weightage.
- *
- * Related: rssi_weightage, good_rssi_threshold, bad_rssi_threshold
- *
- * Supported Feature: STA Candidate selection
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_SCORING_BAD_RSSI_PERCENT CFG_INI_UINT( \
-	"bad_rssi_pcnt", \
-	0, \
-	100, \
-	25, \
-	CFG_VALUE_OR_DEFAULT, \
-	"Bad RSSI Percent")
-
-/*
- * <ini>
- * good_rssi_bucket_size - Bucket size between best and good RSSI to score.
- * @Min: 1
- * @Max: 10
- * @Default: 5
- *
- * This ini tells about bucket size for scoring between best and good RSSI.
- * Below Best RSSI, 100% score will be given. Between best and good RSSI, RSSI
- * is divided in buckets and score will be assigned bucket wise starting from
- * good_rssi_pcnt.
- *
- * Related: rssi_weightage, good_rssi_pcnt
- *
- * Supported Feature: STA Candidate selection
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_SCORING_GOOD_RSSI_BUCKET_SIZE CFG_INI_UINT( \
-	"good_rssi_bucket_size", \
-	1, \
-	10, \
-	5, \
-	CFG_VALUE_OR_DEFAULT, \
-	"Good RSSI Bucket Size")
-
-/*
- * <ini>
- * bad_rssi_bucket_size - Bucket size between good and bad RSSI to score.
- * @Min: 1
- * @Max: 10
- * @Default: 5
- *
- * This ini tells about bucket size for scoring between good and bad RSSI.
- * Between good and bad RSSI, RSSI is divided in buckets and score will be
- * assigned bucket wise starting from bad_rssi_pcnt.
- *
- * Related: rssi_weightage, bad_rssi_pcnt
- *
- * Supported Feature: STA Candidate selection
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_SCORING_BAD_RSSI_BUCKET_SIZE CFG_INI_UINT( \
-	"bad_rssi_bucket_size", \
-	1, \
-	10, \
-	5, \
-	CFG_VALUE_OR_DEFAULT, \
-	"Bad RSSI Bucket Size")
-
-/*
- * <ini>
- * rssi_pref_5g_rssi_thresh - A RSSI threshold above which 5 GHz is not favored
- * @Min: 0
- * @Max: 96
- * @Default: 76
- *
- * 5G AP are given chan_band_weightage. This ini tells about RSSI threshold
- * above which 5GHZ is not favored.
- *
- * Related: chan_band_weightage
- *
- * Supported Feature: STA Candidate selection
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_SCORING_RSSI_PREF_5G_THRESHOLD CFG_INI_UINT( \
-	"rssi_pref_5g_rssi_thresh", \
-	0, \
-	96, \
-	76, \
-	CFG_VALUE_OR_DEFAULT, \
-	"RSSI Pref 5G Threshold")
-
-/*
- * <ini>
- * bandwidth_weight_per_index - percentage as per bandwidth
- * @Min: 0x00000000
- * @Max: 0x64646464
- * @Default: 0x6432190C
- *
- * This INI give percentage value of chan_width_weightage to be used as per
- * peer bandwidth. Self BW is also considered while calculating score. Eg if
- * self BW is 20 MHZ 10% will be given for all AP irrespective of the AP
- * capability.
- *
- * Indexes are defined in this way.
- *     0 Index (BITS 0-7): 20 MHz - Def 12%
- *     1 Index (BITS 8-15): 40 MHz - Def 25%
- *     2 Index (BITS 16-23): 80 MHz - Def 50%
- *     3 Index (BITS 24-31): 160 MHz - Def 100%
- * These percentage values are stored in HEX. For any index max value, can be 64
- *
- * Related: chan_width_weightage
- *
- * Supported Feature: STA Candidate selection
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_SCORING_BW_WEIGHT_PER_IDX CFG_INI_UINT( \
-	"bandwidth_weight_per_index", \
-	0x00000000, \
-	0x64646464, \
-	0x6432190C, \
-	CFG_VALUE_OR_DEFAULT, \
-	"Bandwidth weight per index")
-
-/*
- * <ini>
- * nss_weight_per_index - percentage as per NSS
- * @Min: 0x00000000
- * @Max: 0x64646464
- * @Default: 0x6432190C
- *
- * This INI give percentage value of nss_weightage to be used as per peer NSS.
- * Self NSS capability is also considered. Eg if self NSS is 1x1 10% will be
- * given for all AP irrespective of the AP capability.
- *
- * Indexes are defined in this way.
- *     0 Index (BITS 0-7): 1X1- Def 12%
- *     1 Index (BITS 8-15): 2X2- Def 25%
- *     2 Index (BITS 16-23): 3X3- Def 50%
- *     3 Index (BITS 24-31): 4X4- Def 100%
- * These percentage values are stored in HEX. For any index max value, can be 64
- *
- * Related: nss_weightage
- *
- * Supported Feature: STA Candidate selection
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_SCORING_NSS_WEIGHT_PER_IDX CFG_INI_UINT( \
-	"nss_weight_per_index", \
-	0x00000000, \
-	0x64646464, \
-	0x6432190C, \
-	CFG_VALUE_OR_DEFAULT, \
-	"NSS weight per index")
-
-/*
- * <ini>
- * band_weight_per_index - percentage as per band
- * @Min: 0x00000000
- * @Max: 0x64646464
- * @Default: 0x0000644B
- *
- * This INI give percentage value of chan_band_weightage to be used as per band.
- * If RSSI is greater than rssi_pref_5g_rssi_thresh preference is given for 5Ghz
- * else, it's given for 2.4Ghz.
- *
- * Indexes are defined in this way.
- *     0 Index (BITS 0-7): 2.4GHz - Def 10%
- *     1 Index (BITS 8-15): 5GHz - Def 20%
- *     2 Index (BITS 16-23): 6Ghz - Def - 100%
- *     3 Index (BITS 24-31): Reserved
- * These percentage values are stored in HEX. For any index max value, can be 64
- *
- * Related: chan_band_weightage, rssi_pref_5g_rssi_thresh
- *
- * Supported Feature: STA Candidate selection
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_SCORING_BAND_WEIGHT_PER_IDX CFG_INI_UINT( \
-	"band_weight_per_index", \
-	0x00000000, \
-	0x64646464, \
-	0x00644B32, \
-	CFG_VALUE_OR_DEFAULT, \
-	"Band weight per index")
-
-/*
- * <ini>
- * num_esp_qbss_slots - number of slots in which the esp/qbss load will
- * be divided
- *
- * @Min: 1
- * @Max: 15
- * @Default: 8
- *
- * Number of slots in which the esp/qbss load will be divided. Max 15. index 0
- * is used for 'not_present. Num_slot will equally divide 100. e.g, if
- * num_slot = 4 slot 1 = 0-25% load, slot 2 = 26-50% load, slot 3 = 51-75% load,
- * slot 4 = 76-100% load. Remaining unused index can be 0.
- * Following is load percentage, score percentage and score of num_slot = 8,
- * weight=25.
- * 0-12% 13-25% 26-38% 39-50% 51-63 %64-75% 76-88% 87-100% Not Present
- * 100%  90%    80%    70%    50%   25%     10%    5%      50%
- * 2500  2250   2000   1750   1250  625     250    125     1250
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_SCORING_NUM_ESP_QBSS_SLOTS CFG_INI_UINT( \
-	"num_esp_qbss_slots", \
-	1, \
-	15, \
-	8, \
-	CFG_VALUE_OR_DEFAULT, \
-	"Num ESP QPSS Slots")
-
-/*
- * <ini>
- * esp_qbss_score_idx3_to_0 - percentage for  esp/qbss load for slots 0-3
- * @Min: 0x00000000
- * @Max: 0x64646464
- * @Default: 0x505A6432
- *
- * This INI give percentage value of channel_congestion_weightage to be used as
- * index in which the load value falls. Index 0 is for percentage when ESP/QBSS
- * is not present.
- *
- * Indexes are defined in this way.
- *     0 Index (BITS 0-7): when ESP/QBSS is not present
- *     1 Index (BITS 8-15): SLOT_1
- *     2 Index (BITS 16-23): SLOT_2
- *     3 Index (BITS 24-31): SLOT_3
- * These percentage values are stored in HEX. For any index max value, can be 64
- *
- * Related: channel_congestion_weightage, num_esp_qbss_slots
- *
- * Supported Feature: STA Candidate selection
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_SCORING_ESP_QBSS_SCORE_IDX_3_TO_0 CFG_INI_UINT( \
-	"esp_qbss_score_idx3_to_0", \
-	0x00000000, \
-	0x64646464, \
-	0x505A6432, \
-	CFG_VALUE_OR_DEFAULT, \
-	"ESP QPSS Score Index 3 to 0")
-
-/*
- * <ini>
- * esp_qbss_score_idx7_to_4 - percentage for  esp/qbss load for slots 4-7
- * @Min: 0x00000000
- * @Max: 0x64646464
- * @Default: 0x0A193246
- *
- * This INI give percentage value of channel_congestion_weightage to be used as
- * index in which the load value falls. Used only if num_esp_qbss_slots is
- * greater than 3.
- *
- * Indexes are defined in this way.
- *     0 Index (BITS 0-7): SLOT_4
- *     1 Index (BITS 8-15): SLOT_5
- *     2 Index (BITS 16-23): SLOT_6
- *     3 Index (BITS 24-31): SLOT_7
- * These percentage values are stored in HEX. For any index max value, can be 64
- *
- * Related: channel_congestion_weightage, num_esp_qbss_slots
- *
- * Supported Feature: STA Candidate selection
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_SCORING_ESP_QBSS_SCORE_IDX_7_TO_4 CFG_INI_UINT( \
-	"esp_qbss_score_idx7_to_4", \
-	0x00000000, \
-	0x64646464, \
-	0x0A193246, \
-	CFG_VALUE_OR_DEFAULT, \
-	"ESP QPSS Score Index 7 to 4")
-
-/*
- * <ini>
- * esp_qbss_score_idx11_to_8 - percentage for  esp/qbss load for slots 8-11
- * @Min: 0x00000000
- * @Max: 0x64646464
- * @Default: 0x00000005
- *
- * This INI give percentage value of channel_congestion_weightage to be used as
- * index in which the load value falls. Used only if num_esp_qbss_slots is
- * greater than 7.
- *
- * Indexes are defined in this way.
- *     0 Index (BITS 0-7): SLOT_8
- *     1 Index (BITS 8-15): SLOT_9
- *     2 Index (BITS 16-23): SLOT_10
- *     3 Index (BITS 24-31): SLOT_11
- * These percentage values are stored in HEX. For any index max value, can be 64
- *
- * Related: channel_congestion_weightage, num_esp_qbss_slots
- *
- * Supported Feature: STA Candidate selection
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_SCORING_ESP_QBSS_SCORE_IDX_11_TO_8 CFG_INI_UINT( \
-	"esp_qbss_score_idx11_to_8", \
-	0x00000000, \
-	0x64646464, \
-	0x00000005, \
-	CFG_VALUE_OR_DEFAULT, \
-	"ESP QPSS Score Index 11 to 8")
-
-/*
- * <ini>
- * esp_qbss_score_idx15_to_12 - percentage for	esp/qbss load for slots 12-15
- * @Min: 0x00000000
- * @Max: 0x64646464
- * @Default: 0x00000000
- *
- * This INI give percentage value of channel_congestion_weightage to be used as
- * index in which the load value falls. Used only if num_esp_qbss_slots is
- * greater than 11.
- *
- * Indexes are defined in this way.
- *     0 Index (BITS 0-7): SLOT_12
- *     1 Index (BITS 8-15): SLOT_13
- *     2 Index (BITS 16-23): SLOT_14
- *     3 Index (BITS 24-31): SLOT_15
- * These percentage values are stored in HEX. For any index max value, can be 64
- *
- * Related: channel_congestion_weightage, num_esp_qbss_slots
- *
- * Supported Feature: STA Candidate selection
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_SCORING_ESP_QBSS_SCORE_IDX_15_TO_12 CFG_INI_UINT( \
-	"esp_qbss_score_idx15_to_12", \
-	0x00000000, \
-	0x64646464, \
-	0x00000000, \
-	CFG_VALUE_OR_DEFAULT, \
-	"ESP QPSS Score Index 15 to 12")
-
-/*
- * <ini>
- * num_oce_wan_slots - number of slots in which the oce wan metrics will
- * be divided
- *
- * @Min: 1
- * @Max: 15
- * @Default: 8
- *
- * Number of slots in which the oce wan metrics will be divided. Max 15. index 0
- * is used for not_present. Num_slot will equally divide 100. e.g, if
- * num_slot = 4 slot 1 = 0-3 DL CAP, slot 2 = 4-7 DL CAP, slot 3 = 8-11 DL CAP,
- * slot 4 = 12-15 DL CAP. Remaining unused index can be 0.
- *
- * Related: oce_wan_weightage
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_SCORING_NUM_OCE_WAN_SLOTS CFG_INI_UINT( \
-	"num_oce_wan_slots", \
-	1, \
-	15, \
-	15, \
-	CFG_VALUE_OR_DEFAULT, \
-	"Num OCE WAN Slots")
-
-/*
- * <ini>
- * oce_wan_score_idx3_to_0 - percentage for OCE WAN metrics score for slots 0-3
- * @Min: 0x00000000
- * @Max: 0x64646464
- * @Default: 0x00000032
- *
- * This INI give percentage value of OCE WAN metrics DL CAP, to be used as
- * index in which the DL CAP value falls. Index 0 is for percentage when
- * OCE WAN metrics DL CAP is not present.
- *
- * Indexes are defined in this way.
- *     0 Index (BITS 0-7): when OCE WAN metrics DL CAP is not present
- *     1 Index (BITS 8-15): SLOT_1
- *     2 Index (BITS 16-23): SLOT_2
- *     3 Index (BITS 24-31): SLOT_3
- * These percentage values are stored in HEX. For any index max value, can be 64
- *
- * Related: num_oce_wan_slots, oce_wan_weightage
- *
- * Supported Feature: STA Candidate selection
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_SCORING_OCE_WAN_SCORE_IDX_3_TO_0 CFG_INI_UINT( \
-	"oce_wan_score_idx3_to_0", \
-	0x00000000, \
-	0x64646464, \
-	0x00000032, \
-	CFG_VALUE_OR_DEFAULT, \
-	"OCE WAN Score Index 3 to 0")
-
-/*
- * <ini>
- * oce_wan_score_idx7_to_4 - percentage for OCE WAN metrics score for slots 4-7
- * @Min: 0x00000000
- * @Max: 0x64646464
- * @Default: 0x00000000
- *
- * This INI give percentage value of OCE WAN metrics DL CAP, to be used as
- * index in which the DL CAP value falls. Used only if num_oce_wan_slots is
- * greater than 3.
- *
- * Indexes are defined in this way.
- *     0 Index (BITS 0-7): SLOT_4
- *     1 Index (BITS 8-15): SLOT_5
- *     2 Index (BITS 16-23): SLOT_6
- *     3 Index (BITS 24-31): SLOT_7
- * These percentage values are stored in HEX. For any index max value, can be 64
- *
- * Related: num_oce_wan_slots, oce_wan_weightage
- *
- * Supported Feature: STA Candidate selection
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_SCORING_OCE_WAN_SCORE_IDX_7_TO_4 CFG_INI_UINT( \
-	"oce_wan_score_idx7_to_4", \
-	0x00000000, \
-	0x64646464, \
-	0x00000000, \
-	CFG_VALUE_OR_DEFAULT, \
-	"OCE WAN Score Index 7 to 4")
-
-/*
- * <ini>
- * oce_wan_score_idx11_to_8 - percentage for OCE WAN metrics score for slot 8-11
- * @Min: 0x00000000
- * @Max: 0x64646464
- * @Default: 0x06030000
- *
- * This INI give percentage value of OCE WAN metrics DL CAP, to be used as
- * index in which the DL CAP value falls. Used only if num_oce_wan_slots is
- * greater than 7.
- *
- * Indexes are defined in this way.
- *     0 Index (BITS 0-7): SLOT_8
- *     1 Index (BITS 8-15): SLOT_9
- *     2 Index (BITS 16-23): SLOT_10
- *     3 Index (BITS 24-31): SLOT_11
- * These percentage values are stored in HEX. For any index max value, can be 64
- *
- * Related: num_oce_wan_slots, oce_wan_weightage
- *
- * Supported Feature: STA Candidate selection
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_SCORING_OCE_WAN_SCORE_IDX_11_TO_8 CFG_INI_UINT( \
-	"oce_wan_score_idx11_to_8", \
-	0x00000000, \
-	0x64646464, \
-	0x06030000, \
-	CFG_VALUE_OR_DEFAULT, \
-	"OCE WAN Score Index 11 to 8")
-
-/*
- * <ini>
- * oce_wan_score_idx15_to_12 - % for OCE WAN metrics score for slot 12-15
- * @Min: 0x00000000
- * @Max: 0x64646464
- * @Default: 0x6432190C
- *
- * This INI give percentage value of OCE WAN metrics DL CAP, to be used as
- * index in which the DL CAP value falls. Used only if num_oce_wan_slots is
- * greater than 11.
- *
- * Indexes are defined in this way.
- *     0 Index (BITS 0-7): SLOT_12
- *     1 Index (BITS 8-15): SLOT_13
- *     2 Index (BITS 16-23): SLOT_14
- *     3 Index (BITS 24-31): SLOT_15
- * These percentage values are stored in HEX. For any index max value, can be 64
- *
- * Related: num_oce_wan_slots, oce_wan_weightage
- *
- * Supported Feature: STA Candidate selection
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_SCORING_OCE_WAN_SCORE_IDX_15_TO_12 CFG_INI_UINT( \
-	"oce_wan_score_idx15_to_12", \
-	0x00000000, \
-	0x64646464, \
-	0x6432190C, \
-	CFG_VALUE_OR_DEFAULT, \
-	"OCE WAN Score Index 15 to 12")
-
-/*
- * <ini>
- * roam_score_delta_bitmap - bitmap to enable roam triggers on
- * which roam score delta is to be applied during roam candidate
- * selection
- * @Min: 0
- * @Max: 0xffffffff
- * @Default: 0xffffffff
- *
- * Bitmap value of the following roam triggers:
- * ROAM_TRIGGER_REASON_NONE       - B0,
- * ROAM_TRIGGER_REASON_PER        - B1,
- * ROAM_TRIGGER_REASON_BMISS      - B2,
- * ROAM_TRIGGER_REASON_LOW_RSSI   - B3,
- * ROAM_TRIGGER_REASON_HIGH_RSSI  - B4,
- * ROAM_TRIGGER_REASON_PERIODIC   - B5,
- * ROAM_TRIGGER_REASON_MAWC       - B6,
- * ROAM_TRIGGER_REASON_DENSE      - B7,
- * ROAM_TRIGGER_REASON_BACKGROUND - B8,
- * ROAM_TRIGGER_REASON_FORCED     - B9,
- * ROAM_TRIGGER_REASON_BTM        - B10,
- * ROAM_TRIGGER_REASON_UNIT_TEST  - B11,
- * ROAM_TRIGGER_REASON_BSS_LOAD   - B12
- * ROAM_TRIGGER_REASON_DISASSOC   - B13
- * ROAM_TRIGGER_REASON_IDLE_ROAM  - B14
- *
- * When the bit corresponding to a particular roam trigger reason
- * is set, the value of "roam_score_delta" is expected over the
- * roam score of the current connected AP, for that triggered roam
- *
- * Related: None
- *
- * Supported Feature: Roaming
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_ROAM_SCORE_DELTA_TRIGGER_BITMAP CFG_INI_UINT( \
-			"roam_score_delta_bitmap", \
-			0, \
-			0xFFFFFFFF, \
-			0xFFFFFFFF, \
-			CFG_VALUE_OR_DEFAULT, \
-			"Bitmap for various roam triggers")
-
-/*
- * <ini>
- * roam_score_delta - Percentage increment in roam score value
- * that is expected from a roaming candidate AP.
- * @Min: 0
- * @Max: 100
- * @Default: 0
- *
- * This ini is used to provide the percentage increment value over roam
- * score for the candidate APs so that they can be preferred over current
- * AP for roaming.
- *
- * Related: None
- *
- * Supported Feature: Roaming
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_ROAM_SCORE_DELTA CFG_INI_UINT( \
-			"roam_score_delta", \
-			0, \
-			100, \
-			0, \
-			CFG_VALUE_OR_DEFAULT, \
-			"candidate AP's percentage roam score delta")
-
-/*
- * <ini>
- * min_roam_score_delta - Difference of roam score values between connected
- * AP and roam candidate AP.
- * @Min: 0
- * @Max: 10000
- * @Default: 0
- *
- * This ini is used during CU and low rssi based roam triggers, consider
- * AP as roam candidate only if its roam score is better than connected
- * AP score by at least min_roam_score_delta.
- * If user configured "roam_score_delta" and "min_roam_score_delta" both,
- * then firmware selects roam candidate AP by considering values of both
- * INIs.
- * Example: If DUT is connected with AP1 and roam candidate AP2 has roam
- * score greater than roam_score_delta and min_roam_score_delta then only
- * firmware will trigger roaming to AP2.
- *
- * Related: roam_score_delta
- *
- * Supported Feature: Roaming
- *
- * Usage: Internal
- *
- * </ini>
- */
-#define CFG_CAND_MIN_ROAM_SCORE_DELTA CFG_INI_UINT( \
-			"min_roam_score_delta", \
-			0, \
-			10000, \
-			0, \
-			CFG_VALUE_OR_DEFAULT, \
-			"Diff between connected AP's and candidate AP's roam score")
-
-/*
- * <ini>
- * enable_scoring_for_roam - enable/disable scoring logic in FW for candidate
- * selection during roaming
- *
- * @Min: 0
- * @Max: 1
- * @Default: 1
- *
- * This ini is used to enable/disable scoring logic in FW for candidate
- * selection during roaming.
- *
- * Supported Feature: STA Candidate selection by FW during roaming based on
- * scoring logic.
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_ENABLE_SCORING_FOR_ROAM CFG_INI_BOOL( \
-		"enable_scoring_for_roam", \
-		1, \
-		"Enable Scoring for Roam")
-
-/*
- * <cfg>
- * apsd_enabled - Enable automatic power save delivery
- * @Min: 0
- * @Max: 1
- * @Default: 0
- *
- * Supported Feature: Power save
- *
- * Usage: Internal
- *
- * </cfg>
- */
-#define CFG_APSD_ENABLED CFG_BOOL( \
-		"apsd_enabled", \
-		0, \
-		"Enable APSD")
-
-/*
- * <ini>
- * candidate_min_rssi_for_disconnect - Candidate AP minimum RSSI in
- * idle roam trigger(in dBm).
- * @Min: -120
- * @Max: 0
- * @Default: -70
- *
- * Minimum RSSI value of the candidate AP to consider it as candidate for
- * roaming when roam trigger is Deauthentication/Disconnection from current
- * AP. This value will be sent to firmware over the WMI_ROAM_AP_PROFILE
- * wmi command in the roam_min_rssi_param_list tlv.
- *
- * Related: enable_idle_roam.
- *
- * Supported Feature: Roaming
- *
- * Usage: Internal/External
- *
- * </ini>
- */
-#define CFG_DISCONNECT_ROAM_TRIGGER_MIN_RSSI CFG_INI_INT( \
-		"candidate_min_rssi_for_disconnect", \
-		-120, \
-		0, \
-		-70, \
-		CFG_VALUE_OR_DEFAULT, \
-		"Minimum RSSI of candidate AP for Disconnect roam trigger")
-
-/*
- * <ini>
- * candidate_min_rssi_for_beacon_miss - Candidate AP minimum RSSI for beacon
- * miss roam trigger (in dBm)
- * @Min: -120
- * @Max: 0
- * @Default: -70
- *
- * Minimum RSSI value of the candidate AP to consider it as candidate for
- * roaming when roam trigger is disconnection from current AP due to beacon
- * miss. This value will be sent to firmware over the WMI_ROAM_AP_PROFILE
- * wmi command in the roam_min_rssi_param_list tlv.
- *
- * Related: None
- *
- * Supported Feature: Roaming
- *
- * Usage: Internal/External
- *
- * </ini>
- */
-#define CFG_BMISS_ROAM_MIN_RSSI CFG_INI_INT( \
-	"candidate_min_rssi_for_beacon_miss", \
-	-120, \
-	0, \
-	-70, \
-	CFG_VALUE_OR_DEFAULT, \
-	"Minimum RSSI of candidate AP for Bmiss roam trigger")
-
-/*
- * <ini>
- * idle_roam_score_delta - Roam score delta value in percentage for idle roam.
- * @Min: 0
- * @Max: 100
- * @Default: 0
- *
- * This ini is used to configure the minimum change in roam score
- * value of the AP to consider it as candidate for
- * roaming when roam trigger is due to idle state of sta.
- * This value will be sent to firmware over the WMI_ROAM_AP_PROFILE wmi
- * command in the roam_score_delta_param_list tlv.
- * Related: None
- *
- * Supported Feature: Roaming
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_IDLE_ROAM_SCORE_DELTA CFG_INI_UINT( \
-		"idle_roam_score_delta", \
-		0, \
-		100, \
-		0, \
-		CFG_VALUE_OR_DEFAULT, \
-		"Roam score delta for Idle roam trigger")
-
-/*
- * <ini>
- * btm_roam_score_delta - Roam score delta value in percentage for BTM triggered
- * roaming.
- * @Min: 0
- * @Max: 100
- * @Default: 0
- *
- * This ini is used to configure the minimum change in roam score
- * value of the AP to consider it as candidate when the sta is disconnected
- * from the current AP due to BTM kickout.
- * This value will be sent to firmware over the WMI_ROAM_AP_PROFILE wmi
- * command in the roam_score_delta_param_list tlv.
- *
- * Related: None
- *
- * Supported Feature: Roaming
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_BTM_ROAM_SCORE_DELTA CFG_INI_UINT( \
-	"btm_roam_score_delta", \
-	0, \
-	100, \
-	0, \
-	CFG_VALUE_OR_DEFAULT, \
-	"Roam score delta for BTM roam trigger")
-
-/*
- * <ini>
- * vendor_roam_score_algorithm - Algorithm to calculate AP score
- * @Min: 0
- * @Max: 1
- * @Default: 0
- *
- * By default the value is 0 and default roam algorithm will be used.
- * When the value is 1, the V2 roaming algorithm will be used:
- * For this V2 algo, AP score calculation is based on below equation:
- * AP Score = (RSSIfactor * rssiweight(0.65)) + (CUfactor *cuweight(0.35))
- *
- * Related: None
- *
- * Supported Feature: roam score algorithm
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_VENDOR_ROAM_SCORE_ALGORITHM CFG_INI_UINT( \
-	"vendor_roam_score_algorithm", \
-	0, \
-	1, \
-	0, \
-	CFG_VALUE_OR_DEFAULT, \
-	"Roam candidate selection score algorithm")
-
-/*
- * <ini>
- * oce_ap_tx_pwr_weightage - update scoring param based on ap tx power
- * @Min: 0
- * @Max: 10
- * @Default: 5
- *
- * This ini is used to store calculate weightage based on ap tx power.
- *
- * Related: None
- *
- * Supported Feature: STA
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_OCE_AP_TX_PWR_WEIGHTAGE CFG_INI_UINT( \
-		"oce_ap_tx_pwr_weightage", \
-		0, \
-		10, \
-		5, \
-		CFG_VALUE_OR_DEFAULT,\
-		"AP weigtage for OCE ap tx power")
-
-/*
- * <ini>
- * oce_subnet_id_weightage - update scoring param based on subnet id
- * @Min: 0
- * @Max: 10
- * @Default: 3
- *
- * This ini is used to calculate subnet id weightage in roam score.
- * If the MBO-OCE ie has "IP subnet indication attribute", then host
- * considers 50% of the "oce_subnet_id_weightage" value to calculate
- * roam score for the initial connection and 100% of the
- * "oce_subnet_id_weightage" value to calculate roam score for roaming
- * case.
- * "oce_ap_tx_pwr_weightage" adds a small amount of percentage advantage
- * in roam score while selection of an AP candidate within the same subnet
- * ID. If "oce_ap_tx_pwr_weightage" value is 0(min), roam score doesn't
- * include percentage weightage for subnet id and if "oce_ap_tx_pwr_weightage"
- * value is 10(max), then the weightage given because of same subnet ID is
- * more in roam score. This ini is also used for WFA certification.
- *
- * Related: None
- *
- * Supported Feature: STA
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_OCE_SUBNET_ID_WEIGHTAGE CFG_INI_UINT( \
-		"oce_subnet_id_weightage", \
-		0, \
-		10, \
-		3, \
-		CFG_VALUE_OR_DEFAULT,\
-		"AP weigtage for OCE subnet id")
-
-#define CFG_SCORING_ALL \
-	CFG(CFG_SCORING_RSSI_WEIGHTAGE) \
-	CFG(CFG_SCORING_HT_CAPS_WEIGHTAGE) \
-	CFG(CFG_SCORING_VHT_CAPS_WEIGHTAGE) \
-	CFG(CFG_SCORING_HE_CAPS_WEIGHTAGE) \
-	CFG(CFG_SCORING_CHAN_WIDTH_WEIGHTAGE) \
-	CFG(CFG_SCORING_CHAN_BAND_WEIGHTAGE) \
-	CFG(CFG_SCORING_NSS_WEIGHTAGE) \
-	CFG(CFG_SCORING_BEAMFORM_CAP_WEIGHTAGE) \
-	CFG(CFG_SCORING_PCL_WEIGHTAGE) \
-	CFG(CFG_SCORING_CHAN_CONGESTION_WEIGHTAGE) \
-	CFG(CFG_SCORING_OCE_WAN_WEIGHTAGE) \
-	CFG(CFG_SCORING_BEST_RSSI_THRESHOLD) \
-	CFG(CFG_SCORING_GOOD_RSSI_THRESHOLD) \
-	CFG(CFG_SCORING_BAD_RSSI_THRESHOLD) \
-	CFG(CFG_SCORING_GOOD_RSSI_PERCENT) \
-	CFG(CFG_SCORING_BAD_RSSI_PERCENT) \
-	CFG(CFG_SCORING_GOOD_RSSI_BUCKET_SIZE) \
-	CFG(CFG_SCORING_BAD_RSSI_BUCKET_SIZE) \
-	CFG(CFG_SCORING_RSSI_PREF_5G_THRESHOLD) \
-	CFG(CFG_SCORING_BW_WEIGHT_PER_IDX) \
-	CFG(CFG_SCORING_NSS_WEIGHT_PER_IDX) \
-	CFG(CFG_SCORING_BAND_WEIGHT_PER_IDX) \
-	CFG(CFG_SCORING_NUM_ESP_QBSS_SLOTS) \
-	CFG(CFG_SCORING_ESP_QBSS_SCORE_IDX_3_TO_0) \
-	CFG(CFG_SCORING_ESP_QBSS_SCORE_IDX_7_TO_4) \
-	CFG(CFG_SCORING_ESP_QBSS_SCORE_IDX_11_TO_8) \
-	CFG(CFG_SCORING_ESP_QBSS_SCORE_IDX_15_TO_12) \
-	CFG(CFG_SCORING_NUM_OCE_WAN_SLOTS) \
-	CFG(CFG_SCORING_OCE_WAN_SCORE_IDX_3_TO_0) \
-	CFG(CFG_SCORING_OCE_WAN_SCORE_IDX_7_TO_4) \
-	CFG(CFG_SCORING_OCE_WAN_SCORE_IDX_11_TO_8) \
-	CFG(CFG_SCORING_OCE_WAN_SCORE_IDX_15_TO_12) \
-	CFG(CFG_ROAM_SCORE_DELTA_TRIGGER_BITMAP) \
-	CFG(CFG_ROAM_SCORE_DELTA) \
-	CFG(CFG_CAND_MIN_ROAM_SCORE_DELTA) \
-	CFG(CFG_ENABLE_SCORING_FOR_ROAM) \
-	CFG(CFG_APSD_ENABLED) \
-	CFG(CFG_DISCONNECT_ROAM_TRIGGER_MIN_RSSI) \
-	CFG(CFG_BMISS_ROAM_MIN_RSSI) \
-	CFG(CFG_IDLE_ROAM_SCORE_DELTA) \
-	CFG(CFG_BTM_ROAM_SCORE_DELTA) \
-	CFG(CFG_VENDOR_ROAM_SCORE_ALGORITHM) \
-	CFG(CFG_OCE_AP_TX_PWR_WEIGHTAGE) \
-	CFG(CFG_OCE_SUBNET_ID_WEIGHTAGE) \
-
-#endif /* __CFG_MLME_SCORING_H */

+ 3 - 53
components/mlme/dispatcher/inc/wlan_mlme_public_struct.h

@@ -1873,52 +1873,9 @@ struct wlan_mlme_rssi_cfg_score  {
 	uint32_t rssi_pref_5g_rssi_thresh;
 };
 
-/**
- * struct wlan_mlme_per_slot_scoring - define % score for differents slots
- *				for a scoring param.
- * num_slot: number of slots in which the param will be divided.
- *           Max 15. index 0 is used for 'not_present. Num_slot will
- *           equally divide 100. e.g, if num_slot = 4 slot 0 = 0-25%, slot
- *           1 = 26-50% slot 2 = 51-75%, slot 3 = 76-100%
- * score_pcnt3_to_0: Conatins score percentage for slot 0-3
- *             BITS 0-7   :- the scoring pcnt when not present
- *             BITS 8-15  :- SLOT_1
- *             BITS 16-23 :- SLOT_2
- *             BITS 24-31 :- SLOT_3
- * score_pcnt7_to_4: Conatins score percentage for slot 4-7
- *             BITS 0-7   :- SLOT_4
- *             BITS 8-15  :- SLOT_5
- *             BITS 16-23 :- SLOT_6
- *             BITS 24-31 :- SLOT_7
- * score_pcnt11_to_8: Conatins score percentage for slot 8-11
- *             BITS 0-7   :- SLOT_8
- *             BITS 8-15  :- SLOT_9
- *             BITS 16-23 :- SLOT_10
- *             BITS 24-31 :- SLOT_11
- * score_pcnt15_to_12: Conatins score percentage for slot 12-15
- *             BITS 0-7   :- SLOT_12
- *             BITS 8-15  :- SLOT_13
- *             BITS 16-23 :- SLOT_14
- *             BITS 24-31 :- SLOT_15
- */
-struct wlan_mlme_per_slot_scoring {
-	uint32_t num_slot;
-	uint32_t score_pcnt3_to_0;
-	uint32_t score_pcnt7_to_4;
-	uint32_t score_pcnt11_to_8;
-	uint32_t score_pcnt15_to_12;
-};
-
 /*
- * struct wlan_mlme_score_config - MLME BSS Scoring related config
+ * struct wlan_mlme_roam_scoring_cfg - MLME roam related scoring config
  * @enable_scoring_for_roam: Enable/disable BSS Scoring for Roaming
- * @weight_cfg: Various Weight related Scoring Configs
- * @rssi_score: RSSI Scoring related thresholds/percentages config
- * @esp_qbss_scoring: ESP QBSS Scoring configs
- * @oce_wan_scoring: OCE WAN Scoring Configs
- * @bandwidth_weight_per_index: Bandwidth weight per index for scoring logic
- * @nss_weight_per_index: NSS weight per index for scoring logic
- * @band_weight_per_index: Band weight per index for scoring logic
  * @roam_trigger_bitmap: bitmap for various roam triggers
  * @roam_score_delta: percentage delta in roam score
  * @apsd_enabled: Enable automatic power save delivery
@@ -1926,15 +1883,8 @@ struct wlan_mlme_per_slot_scoring {
  * @min_roam_score_delta: Minimum difference between connected AP's and
  *			candidate AP's roam score to start roaming.
  */
-struct wlan_mlme_scoring_cfg {
+struct wlan_mlme_roam_scoring_cfg {
 	bool enable_scoring_for_roam;
-	struct wlan_mlme_weight_config weight_cfg;
-	struct wlan_mlme_rssi_cfg_score rssi_score;
-	struct wlan_mlme_per_slot_scoring esp_qbss_scoring;
-	struct wlan_mlme_per_slot_scoring oce_wan_scoring;
-	uint32_t bandwidth_weight_per_index;
-	uint32_t nss_weight_per_index;
-	uint32_t band_weight_per_index;
 	uint32_t roam_trigger_bitmap;
 	uint32_t roam_score_delta;
 	bool apsd_enabled;
@@ -2297,7 +2247,7 @@ struct wlan_mlme_cfg {
 	struct wlan_mlme_nss_chains nss_chains_ini_cfg;
 	struct wlan_mlme_sta_cfg sta;
 	struct wlan_mlme_stats_cfg stats;
-	struct wlan_mlme_scoring_cfg scoring;
+	struct wlan_mlme_roam_scoring_cfg roam_scoring;
 	struct wlan_mlme_oce oce;
 	struct wlan_mlme_threshold threshold;
 	struct wlan_mlme_timeout timeouts;

+ 4 - 66
components/wmi/inc/wmi_unified_roam_param.h

@@ -24,6 +24,7 @@
 #define _WMI_UNIFIED_ROAM_PARAM_H_
 
 #include <wlan_blm_public_struct.h>
+#include <wlan_cm_bss_score_param.h>
 
 /**
  * struct gateway_update_req_param - gateway parameter update request
@@ -296,69 +297,6 @@ struct ap_profile {
 	uint32_t rssi_abs_thresh;
 };
 
-/**
- * struct rssi_scoring - rssi scoring param to sortlist selected AP
- * @best_rssi_threshold: Roamable AP RSSI equal or better than this threshold,
- *                      full rssi score 100. Units in dBm.
- * @good_rssi_threshold: Below threshold, scoring linear percentage between
- *                      rssi_good_pnt and 100. Units in dBm.
- * @bad_rssi_threshold: Between good and bad rssi threshold, scoring linear
- *                      % between rssi_bad_pcnt and rssi_good_pct in dBm.
- * @good_rssi_pcnt: Used to assigned scoring percentage of each slot between
- *                 best to good rssi threshold. Units in percentage.
- * @bad_rssi_pcnt: Used to assigned scoring percentage of each slot between good
- *                to bad rssi threshold. Unites in percentage.
- * @good_bucket_size : bucket size of slot in good zone
- * @bad_bucket_size : bucket size of slot in bad zone
- * @rssi_pref_5g_rssi_thresh: Below rssi threshold, 5G AP have given preference
- *                           of band percentage. Units in dBm.
- */
-struct rssi_scoring {
-	int32_t best_rssi_threshold;
-	int32_t good_rssi_threshold;
-	int32_t  bad_rssi_threshold;
-	uint32_t good_rssi_pcnt;
-	uint32_t bad_rssi_pcnt;
-	uint32_t good_bucket_size;
-	uint32_t bad_bucket_size;
-	int32_t  rssi_pref_5g_rssi_thresh;
-};
-
-/**
- * struct param_slot_scoring - define % score for differents slots for a
- *                             scoring param.
- * @num_slot: number of slots in which the param will be divided.
- *           Max 15. index 0 is used for 'not_present. Num_slot will
- *           equally divide 100. e.g, if num_slot = 4 slot 0 = 0-25%, slot
- *           1 = 26-50% slot 2 = 51-75%, slot 3 = 76-100%
- * @score_pcnt3_to_0: Conatins score percentage for slot 0-3
- *             BITS 0-7   :- the scoring pcnt when not present
- *             BITS 8-15  :- SLOT_1
- *             BITS 16-23 :- SLOT_2
- *             BITS 24-31 :- SLOT_3
- * @score_pcnt7_to_4: Conatins score percentage for slot 4-7
- *             BITS 0-7   :- SLOT_4
- *             BITS 8-15  :- SLOT_5
- *             BITS 16-23 :- SLOT_6
- *             BITS 24-31 :- SLOT_7
- * @score_pcnt11_to_8: Conatins score percentage for slot 8-11
- *             BITS 0-7   :- SLOT_8
- *             BITS 8-15  :- SLOT_9
- *             BITS 16-23 :- SLOT_10
- *             BITS 24-31 :- SLOT_11
- * @score_pcnt15_to_12: Conatins score percentage for slot 12-15
- *             BITS 0-7   :- SLOT_12
- *             BITS 8-15  :- SLOT_13
- *             BITS 16-23 :- SLOT_14
- *             BITS 24-31 :- SLOT_15
- */
-struct param_slot_scoring {
-	uint32_t num_slot;
-	uint32_t score_pcnt3_to_0;
-	uint32_t score_pcnt7_to_4;
-	uint32_t score_pcnt11_to_8;
-	uint32_t score_pcnt15_to_12;
-};
 
 /**
  * struct scoring_param - scoring param to sortlist selected AP
@@ -427,9 +365,9 @@ struct scoring_param {
 	uint32_t roam_trigger_bitmap;
 	uint32_t vendor_roam_score_algorithm;
 	uint32_t cand_min_roam_score_delta;
-	struct rssi_scoring rssi_scoring;
-	struct param_slot_scoring esp_qbss_scoring;
-	struct param_slot_scoring oce_wan_scoring;
+	struct rssi_config_score rssi_scoring;
+	struct per_slot_score esp_qbss_scoring;
+	struct per_slot_score oce_wan_scoring;
 };
 
 /*

+ 2 - 2
components/wmi/src/wmi_unified_roam_tlv.c

@@ -1654,9 +1654,9 @@ send_roam_scan_offload_ap_profile_cmd_tlv(wmi_unified_t wmi_handle,
 	score_param->rssi_scoring.bad_rssi_pcnt =
 		ap_profile->param.rssi_scoring.bad_rssi_pcnt;
 	score_param->rssi_scoring.good_bucket_size =
-		ap_profile->param.rssi_scoring.good_bucket_size;
+		ap_profile->param.rssi_scoring.good_rssi_bucket_size;
 	score_param->rssi_scoring.bad_bucket_size =
-		ap_profile->param.rssi_scoring.bad_bucket_size;
+		ap_profile->param.rssi_scoring.bad_rssi_bucket_size;
 	score_param->rssi_scoring.rssi_pref_5g_rssi_thresh =
 		(-1) * ap_profile->param.rssi_scoring.rssi_pref_5g_rssi_thresh;
 

+ 2 - 4
core/hdd/inc/wlan_hdd_main.h

@@ -3892,13 +3892,11 @@ void hdd_set_rx_mode_rps(bool enable);
 /**
  * hdd_update_score_config - API to update candidate scoring related params
  * configuration parameters
- * @score_config: score config to update
- * @cfg: config params
+ * @hdd_ctx: hdd context
  *
  * Return: QDF_STATUS
  */
-QDF_STATUS hdd_update_score_config(
-	struct scoring_config *score_config, struct hdd_context *hdd_ctx);
+QDF_STATUS hdd_update_score_config(struct hdd_context *hdd_ctx);
 
 /**
  * hdd_get_stainfo() - get stainfo for the specified peer

+ 7 - 57
core/hdd/src/wlan_hdd_main.c

@@ -2469,6 +2469,9 @@ int hdd_update_tgt_cfg(hdd_handle_t hdd_handle, struct wma_tgt_cfg *cfg)
 	else
 		hdd_debug("bcast twt is disable in ini, fw cap %d",
 			  cfg->bcast_twt_support);
+
+	hdd_update_score_config(hdd_ctx);
+
 	return 0;
 
 dispatcher_close:
@@ -16577,60 +16580,13 @@ void hdd_update_ie_whitelist_attr(struct probe_req_whitelist_attr *ie_whitelist,
 		ie_whitelist->voui[i] = whitelist.probe_req_voui[i];
 }
 
-QDF_STATUS hdd_update_score_config(
-	struct scoring_config *score_config, struct hdd_context *hdd_ctx)
+QDF_STATUS hdd_update_score_config(struct hdd_context *hdd_ctx)
 {
 	struct hdd_config *cfg = hdd_ctx->config;
-	QDF_STATUS status;
-	struct wlan_mlme_nss_chains vdev_ini_cfg;
-	bool bval = false;
-	uint32_t channel_bonding_mode;
+	eCsrPhyMode phy_mode = hdd_cfg_xlate_to_csr_phy_mode(cfg->dot11Mode);
 
-	qdf_mem_zero(&vdev_ini_cfg, sizeof(struct wlan_mlme_nss_chains));
-	/* Populate the nss chain params from ini for this vdev type */
-	sme_populate_nss_chain_params(hdd_ctx->mac_handle, &vdev_ini_cfg,
-				      QDF_STA_MODE,
-				      hdd_ctx->num_rf_chains);
-
-	score_config->vdev_nss_24g = vdev_ini_cfg.rx_nss[NSS_CHAINS_BAND_2GHZ];
-	score_config->vdev_nss_5g = vdev_ini_cfg.rx_nss[NSS_CHAINS_BAND_5GHZ];
-
-	sme_update_score_config(hdd_ctx->mac_handle, score_config);
-
-	ucfg_mlme_get_channel_bonding_24ghz(hdd_ctx->psoc,
-					    &channel_bonding_mode);
-	score_config->cb_mode_24G = channel_bonding_mode;
-	ucfg_mlme_get_channel_bonding_5ghz(hdd_ctx->psoc,
-					   &channel_bonding_mode);
-	score_config->cb_mode_5G = channel_bonding_mode;
-
-	if (cfg->dot11Mode == eHDD_DOT11_MODE_AUTO ||
-	    cfg->dot11Mode == eHDD_DOT11_MODE_11ax ||
-	    cfg->dot11Mode == eHDD_DOT11_MODE_11ax_ONLY)
-		score_config->he_cap = 1;
-
-	if (score_config->he_cap ||
-	    cfg->dot11Mode == eHDD_DOT11_MODE_11ac ||
-	    cfg->dot11Mode == eHDD_DOT11_MODE_11ac_ONLY)
-		score_config->vht_cap = 1;
-
-	if (score_config->vht_cap || cfg->dot11Mode == eHDD_DOT11_MODE_11n ||
-	    cfg->dot11Mode == eHDD_DOT11_MODE_11n_ONLY)
-		score_config->ht_cap = 1;
-
-	status = ucfg_mlme_get_vht_for_24ghz(hdd_ctx->psoc, &bval);
-	if (!QDF_IS_STATUS_SUCCESS(status))
-		hdd_err("Failed to get vht_for_24ghz");
-	if (score_config->vht_cap && bval)
-		score_config->vht_24G_cap = 1;
-
-	status = ucfg_mlme_get_vht_enable_tx_bf(hdd_ctx->psoc,
-					&bval);
-	if (!QDF_IS_STATUS_SUCCESS(status))
-		hdd_err("unable to get vht_enable_tx_bf");
-
-	if (bval)
-		score_config->beamformee_cap = 1;
+	sme_update_score_config(hdd_ctx->mac_handle, phy_mode,
+				hdd_ctx->num_rf_chains);
 
 	return QDF_STATUS_SUCCESS;
 }
@@ -16681,12 +16637,6 @@ static int hdd_update_scan_config(struct hdd_context *hdd_ctx)
 	scan_cfg.sta_miracast_mcc_rest_time = mcast_mcc_rest_time;
 	hdd_update_ie_whitelist_attr(&scan_cfg.ie_whitelist, hdd_ctx);
 
-	status = hdd_update_score_config(&scan_cfg.score_config, hdd_ctx);
-	if (QDF_IS_STATUS_ERROR(status)) {
-		hdd_err("Failed to update scoring config");
-		return -EINVAL;
-	}
-
 	status = ucfg_scan_update_user_config(psoc, &scan_cfg);
 	if (status != QDF_STATUS_SUCCESS) {
 		hdd_err("failed pmo psoc configuration");

+ 1 - 3
core/mac/src/pe/lim/lim_utils.c

@@ -69,8 +69,6 @@
 #include <wlan_blm_api.h>
 #include <lim_assoc_utils.h>
 
-#define ASCII_SPACE_CHARACTER 0x20
-
 /** -------------------------------------------------------------
    \fn lim_delete_dialogue_token_list
    \brief deletes the complete lim dialogue token linked list.
@@ -8332,7 +8330,7 @@ QDF_STATUS lim_get_capability_info(struct mac_context *mac, uint16_t *pcap,
 		pcap_info->qos = 1;
 
 	/* APSD bit */
-	if (mac->mlme_cfg->scoring.apsd_enabled)
+	if (mac->mlme_cfg->roam_scoring.apsd_enabled)
 		pcap_info->apsd = 1;
 
 	pcap_info->rrm = mac->rrm.rrmConfig.rrm_enabled;

+ 1 - 1
core/mac/src/sys/legacy/src/utils/src/parser_api.c

@@ -5980,7 +5980,7 @@ populate_dot11f_timing_advert_frame(struct mac_context *mac_ctx,
 	if (mac_ctx->mlme_cfg->wmm_params.qos_enabled)
 		frame->Capabilities.qos = 1;
 
-	if (mac_ctx->mlme_cfg->scoring.apsd_enabled)
+	if (mac_ctx->mlme_cfg->roam_scoring.apsd_enabled)
 		frame->Capabilities.apsd = 1;
 
 	val = mac_ctx->mlme_cfg->feature_flags.enable_block_ack;

+ 4 - 3
core/sme/inc/sme_api.h

@@ -3699,12 +3699,13 @@ sme_get_roam_scan_stats(mac_handle_t mac_handle, roam_scan_stats_cb cb,
 /**
  * sme_update_score_config() - Update the Scoring Config from MLME
  * @mac_handle: Mac Handle
- * @score_config: Pointer to the scoring config structure to be populated
+ * @phy_mode: Phymode to be used
+ * @num_rf_chains: num of RF chains supported by HW
  *
  * Return: None
  */
-void sme_update_score_config(mac_handle_t mac_handle,
-			     struct scoring_config *score_config);
+void sme_update_score_config(mac_handle_t mac_handle, eCsrPhyMode phy_mode,
+			     uint8_t num_rf_chains);
 
 /**
  * sme_enable_fw_module_log_level() - enable fw module log level

+ 66 - 83
core/sme/src/common/sme_api.c

@@ -62,6 +62,7 @@
 #include <wlan_coex_ucfg_api.h>
 #include "wlan_crypto_global_api.h"
 #include "wlan_mlme_ucfg_api.h"
+#include "wlan_psoc_mlme_api.h"
 
 static QDF_STATUS init_sme_cmd_list(struct mac_context *mac);
 
@@ -2542,7 +2543,7 @@ QDF_STATUS sme_scan_get_result(mac_handle_t mac_handle, uint8_t vdev_id,
 			 0));
 	status = sme_acquire_global_lock(&mac->sme);
 	if (QDF_IS_STATUS_SUCCESS(status)) {
-		status = csr_scan_get_result(mac, filter, phResult);
+		status = csr_scan_get_result(mac, filter, phResult, false);
 		sme_release_global_lock(&mac->sme);
 	}
 
@@ -2632,7 +2633,7 @@ QDF_STATUS sme_get_ap_channel_from_scan_cache(
 	status = sme_acquire_global_lock(&mac_ctx->sme);
 	if (QDF_STATUS_SUCCESS == status) {
 		status = csr_scan_get_result(mac_ctx, scan_filter,
-					  &filtered_scan_result);
+					  &filtered_scan_result, false);
 		if (QDF_STATUS_SUCCESS == status) {
 			csr_get_bssdescr_from_scan_handle(filtered_scan_result,
 					&first_ap_profile);
@@ -6804,7 +6805,7 @@ sme_restore_default_roaming_params(struct mac_context *mac,
 				   tCsrNeighborRoamControlInfo *roam_info)
 {
 	roam_info->cfgParams.enable_scoring_for_roam =
-			mac->mlme_cfg->scoring.enable_scoring_for_roam;
+			mac->mlme_cfg->roam_scoring.enable_scoring_for_roam;
 	roam_info->cfgParams.emptyScanRefreshPeriod =
 			mac->mlme_cfg->lfr.empty_scan_refresh_period;
 	roam_info->cfgParams.full_roam_scan_period =
@@ -13740,7 +13741,8 @@ QDF_STATUS sme_get_rssi_snr_by_bssid(mac_handle_t mac_handle,
 	qdf_mem_copy(scan_filter->bssid_list[0].bytes,
 		     bssid, sizeof(struct qdf_mac_addr));
 
-	status = csr_scan_get_result(mac_ctx, scan_filter, &result_handle);
+	status = csr_scan_get_result(mac_ctx, scan_filter, &result_handle,
+				     false);
 	qdf_mem_free(scan_filter);
 	if (QDF_STATUS_SUCCESS != status) {
 		sme_debug("parse_scan_result failed");
@@ -13804,7 +13806,8 @@ QDF_STATUS sme_get_beacon_frm(mac_handle_t mac_handle,
 	qdf_mem_copy(scan_filter->bssid_list[0].bytes,
 		     bssid, sizeof(struct qdf_mac_addr));
 
-	status = csr_scan_get_result(mac_ctx, scan_filter, &result_handle);
+	status = csr_scan_get_result(mac_ctx, scan_filter, &result_handle,
+				     false);
 	qdf_mem_free(scan_filter);
 	if (QDF_STATUS_SUCCESS != status) {
 		sme_err("parse_scan_result failed");
@@ -15217,86 +15220,66 @@ sme_get_roam_scan_stats(mac_handle_t mac_handle,
 	return status;
 }
 
-void sme_update_score_config(mac_handle_t mac_handle,
-			     struct scoring_config *score_config)
+void sme_update_score_config(mac_handle_t mac_handle, eCsrPhyMode phy_mode,
+			     uint8_t num_rf_chains)
 {
 	struct mac_context *mac_ctx = MAC_CONTEXT(mac_handle);
-	struct wlan_mlme_scoring_cfg *mlme_scoring_cfg;
-
-	mlme_scoring_cfg = &mac_ctx->mlme_cfg->scoring;
-
-	score_config->weight_cfg.rssi_weightage =
-		mlme_scoring_cfg->weight_cfg.rssi_weightage;
-	score_config->weight_cfg.ht_caps_weightage =
-		mlme_scoring_cfg->weight_cfg.ht_caps_weightage;
-	score_config->weight_cfg.vht_caps_weightage =
-		mlme_scoring_cfg->weight_cfg.vht_caps_weightage;
-	score_config->weight_cfg.he_caps_weightage =
-		mlme_scoring_cfg->weight_cfg.he_caps_weightage;
-	score_config->weight_cfg.chan_width_weightage =
-		mlme_scoring_cfg->weight_cfg.chan_width_weightage;
-	score_config->weight_cfg.chan_band_weightage =
-		mlme_scoring_cfg->weight_cfg.chan_band_weightage;
-	score_config->weight_cfg.nss_weightage =
-		mlme_scoring_cfg->weight_cfg.nss_weightage;
-	score_config->weight_cfg.beamforming_cap_weightage =
-		mlme_scoring_cfg->weight_cfg.beamforming_cap_weightage;
-	score_config->weight_cfg.pcl_weightage =
-		mlme_scoring_cfg->weight_cfg.pcl_weightage;
-	score_config->weight_cfg.channel_congestion_weightage =
-		mlme_scoring_cfg->weight_cfg.channel_congestion_weightage;
-	score_config->weight_cfg.oce_wan_weightage =
-		mlme_scoring_cfg->weight_cfg.oce_wan_weightage;
-	score_config->weight_cfg.oce_ap_tx_pwr_weightage =
-		mlme_scoring_cfg->weight_cfg.oce_ap_tx_pwr_weightage;
-	score_config->weight_cfg.oce_subnet_id_weightage =
-		mlme_scoring_cfg->weight_cfg.oce_subnet_id_weightage;
-
-	score_config->bandwidth_weight_per_index =
-		mlme_scoring_cfg->bandwidth_weight_per_index;
-	score_config->nss_weight_per_index =
-		mlme_scoring_cfg->nss_weight_per_index;
-	score_config->band_weight_per_index =
-		mlme_scoring_cfg->band_weight_per_index;
-
-	score_config->rssi_score.best_rssi_threshold =
-		mlme_scoring_cfg->rssi_score.best_rssi_threshold;
-	score_config->rssi_score.good_rssi_threshold =
-		mlme_scoring_cfg->rssi_score.good_rssi_threshold;
-	score_config->rssi_score.bad_rssi_threshold =
-		mlme_scoring_cfg->rssi_score.bad_rssi_threshold;
-	score_config->rssi_score.good_rssi_pcnt =
-		mlme_scoring_cfg->rssi_score.good_rssi_pcnt;
-	score_config->rssi_score.bad_rssi_pcnt =
-		mlme_scoring_cfg->rssi_score.bad_rssi_pcnt;
-	score_config->rssi_score.good_rssi_bucket_size =
-		mlme_scoring_cfg->rssi_score.good_rssi_bucket_size;
-	score_config->rssi_score.bad_rssi_bucket_size =
-		mlme_scoring_cfg->rssi_score.bad_rssi_bucket_size;
-	score_config->rssi_score.rssi_pref_5g_rssi_thresh =
-		mlme_scoring_cfg->rssi_score.rssi_pref_5g_rssi_thresh;
-
-	score_config->esp_qbss_scoring.num_slot =
-		mlme_scoring_cfg->esp_qbss_scoring.num_slot;
-	score_config->esp_qbss_scoring.score_pcnt3_to_0 =
-		mlme_scoring_cfg->esp_qbss_scoring.score_pcnt3_to_0;
-	score_config->esp_qbss_scoring.score_pcnt7_to_4 =
-		mlme_scoring_cfg->esp_qbss_scoring.score_pcnt7_to_4;
-	score_config->esp_qbss_scoring.score_pcnt11_to_8 =
-		mlme_scoring_cfg->esp_qbss_scoring.score_pcnt11_to_8;
-	score_config->esp_qbss_scoring.score_pcnt15_to_12 =
-		mlme_scoring_cfg->esp_qbss_scoring.score_pcnt15_to_12;
-
-	score_config->oce_wan_scoring.num_slot =
-		mlme_scoring_cfg->oce_wan_scoring.num_slot;
-	score_config->oce_wan_scoring.score_pcnt3_to_0 =
-		mlme_scoring_cfg->oce_wan_scoring.score_pcnt3_to_0;
-	score_config->oce_wan_scoring.score_pcnt7_to_4 =
-		mlme_scoring_cfg->oce_wan_scoring.score_pcnt7_to_4;
-	score_config->oce_wan_scoring.score_pcnt11_to_8 =
-		mlme_scoring_cfg->oce_wan_scoring.score_pcnt11_to_8;
-	score_config->oce_wan_scoring.score_pcnt15_to_12 =
-		mlme_scoring_cfg->oce_wan_scoring.score_pcnt15_to_12;
+	struct wlan_mlme_nss_chains vdev_ini_cfg;
+	bool bval = false;
+	uint32_t channel_bonding_mode;
+	QDF_STATUS status;
+	struct psoc_phy_config config;
+
+	qdf_mem_zero(&vdev_ini_cfg, sizeof(struct wlan_mlme_nss_chains));
+	/* Populate the nss chain params from ini for this vdev type */
+	sme_populate_nss_chain_params(mac_handle, &vdev_ini_cfg,
+				      QDF_STA_MODE, num_rf_chains);
+
+	config.vdev_nss_24g = vdev_ini_cfg.rx_nss[NSS_CHAINS_BAND_2GHZ];
+	config.vdev_nss_5g = vdev_ini_cfg.rx_nss[NSS_CHAINS_BAND_5GHZ];
+
+	if (phy_mode == eCSR_DOT11_MODE_AUTO ||
+	    phy_mode == eCSR_DOT11_MODE_11ax ||
+	    phy_mode == eCSR_DOT11_MODE_11ax_ONLY)
+		config.he_cap = 1;
+
+	if (config.he_cap ||
+	    phy_mode == eCSR_DOT11_MODE_11ac ||
+	    phy_mode == eCSR_DOT11_MODE_11ac_ONLY)
+		config.vht_cap = 1;
+
+	if (config.vht_cap || phy_mode == eCSR_DOT11_MODE_11n ||
+	    phy_mode == eCSR_DOT11_MODE_11n_ONLY)
+		config.ht_cap = 1;
+
+	if (!IS_FEATURE_SUPPORTED_BY_FW(DOT11AX))
+		config.he_cap = 0;
+
+	if (!IS_FEATURE_SUPPORTED_BY_FW(DOT11AC))
+		config.vht_cap = 0;
+
+	status = wlan_mlme_get_vht_for_24ghz(mac_ctx->psoc, &bval);
+	if (!QDF_IS_STATUS_SUCCESS(status))
+		sme_err("Failed to get vht_for_24ghz");
+	if (config.vht_cap && bval)
+		config.vht_24G_cap = 1;
+
+	status = wlan_mlme_get_vht_enable_tx_bf(mac_ctx->psoc,
+						&bval);
+	if (!QDF_IS_STATUS_SUCCESS(status))
+		sme_err("unable to get vht_enable_tx_bf");
+
+	if (bval)
+		config.beamformee_cap = 1;
+
+	ucfg_mlme_get_channel_bonding_24ghz(mac_ctx->psoc,
+					    &channel_bonding_mode);
+	config.bw_above_20_24ghz = channel_bonding_mode;
+	ucfg_mlme_get_channel_bonding_5ghz(mac_ctx->psoc,
+					   &channel_bonding_mode);
+	config.bw_above_20_5ghz = channel_bonding_mode;
+
+	wlan_psoc_set_phy_config(mac_ctx->psoc, &config);
 }
 
 void sme_enable_fw_module_log_level(mac_handle_t mac_handle, int vdev_id)

+ 44 - 77
core/sme/src/csr/csr_api_roam.c

@@ -25,6 +25,7 @@
 #include "wma_types.h"
 #include "wma_if.h"          /* for STA_INVALID_IDX. */
 #include "csr_inside_api.h"
+#include <include/wlan_psoc_mlme.h>
 #include "sme_trace.h"
 #include "sme_qos_internal.h"
 #include "sme_inside.h"
@@ -70,6 +71,7 @@
 
 #include <ol_defines.h>
 #include "wlan_pkt_capture_ucfg_api.h"
+#include "wlan_psoc_mlme_api.h"
 
 #define RSN_AUTH_KEY_MGMT_SAE           WLAN_RSN_SEL(WLAN_AKM_SAE)
 #define MAX_PWR_FCC_CHAN_12 8
@@ -8346,7 +8348,8 @@ QDF_STATUS csr_roam_connect(struct mac_context *mac, uint32_t sessionId,
 		qdf_mem_free(filter);
 		goto error;
 	}
-	status = csr_scan_get_result(mac, filter, &hBSSList);
+	status = csr_scan_get_result(mac, filter, &hBSSList,
+				     opmode == QDF_STA_MODE ? true : false);
 	qdf_mem_free(filter);
 	csr_roam_print_candidate_aps(hBSSList);
 	if (QDF_IS_STATUS_SUCCESS(status)) {
@@ -9766,7 +9769,7 @@ csr_check_profile_in_scan_cache(struct mac_context *mac_ctx,
 		qdf_mem_free(scan_filter);
 		return false;
 	}
-	status = csr_scan_get_result(mac_ctx, scan_filter, hBSSList);
+	status = csr_scan_get_result(mac_ctx, scan_filter, hBSSList, true);
 	qdf_mem_free(scan_filter);
 	if (!QDF_IS_STATUS_SUCCESS(status)) {
 		sme_err(
@@ -10653,53 +10656,6 @@ static void csr_copy_ssids_from_profile(tCsrSSIDs *ssid_list,
 			       &ssid_list->SSIDList[i].SSID);
 }
 
-#ifdef WLAN_ADAPTIVE_11R
-static void
-csr_update_adaptive_11r_scan_filter(struct mac_context *mac_ctx,
-				    struct scan_filter *filter)
-{
-	filter->enable_adaptive_11r =
-		   mac_ctx->mlme_cfg->lfr.enable_adaptive_11r;
-}
-#else
-static inline void
-csr_update_adaptive_11r_scan_filter(struct mac_context *mac_ctx,
-				    struct scan_filter *filter)
-{
-	filter->enable_adaptive_11r = false;
-}
-#endif
-
-void csr_update_connect_n_roam_cmn_filter(struct mac_context *mac_ctx,
-					  struct scan_filter *filter,
-					  enum QDF_OPMODE opmode)
-{
-	enum policy_mgr_con_mode pm_mode;
-	uint32_t num_entries = 0, pcl_freq_list[NUM_CHANNELS] = {0};
-	QDF_STATUS status;
-
-	/* enable bss scoring for only STA mode */
-	if (opmode == QDF_STA_MODE)
-		filter->bss_scoring_required = true;
-
-	csr_update_adaptive_11r_scan_filter(mac_ctx, filter);
-
-	if (filter->num_of_bssid)
-		return;
-
-	if (policy_mgr_map_concurrency_mode(&opmode, &pm_mode)) {
-		status = policy_mgr_get_pcl(mac_ctx->psoc, pm_mode,
-					    pcl_freq_list, &num_entries,
-					    filter->pcl_weight_list,
-					    NUM_CHANNELS);
-		if (QDF_IS_STATUS_ERROR(status))
-			return;
-		qdf_mem_copy(filter->pcl_freq_list, pcl_freq_list,
-			     num_entries * sizeof(pcl_freq_list[0]));
-		filter->num_of_pcl_channels = num_entries;
-	}
-}
-
 #ifdef FEATURE_WLAN_WAPI
 /**
  * csr_update_phy_mode: Updates phy mode for wapi
@@ -10933,8 +10889,7 @@ csr_roam_get_scan_filter_from_profile(struct mac_context *mac_ctx,
 
 	csr_update_fils_scan_filter(filter, profile);
 
-	csr_update_connect_n_roam_cmn_filter(mac_ctx, filter,
-					     profile->csrPersona);
+	csr_update_adaptive_11r_scan_filter(mac_ctx, filter);
 
 	return QDF_STATUS_SUCCESS;
 }
@@ -18307,17 +18262,27 @@ static void csr_update_score_params(struct mac_context *mac_ctx,
 				    tpCsrNeighborRoamControlInfo roam_info)
 {
 	struct scoring_param *req_score_params;
-	struct rssi_scoring *req_rssi_score;
-	struct wlan_mlme_scoring_cfg *bss_score_params;
-	struct wlan_mlme_weight_config *weight_config;
-	struct wlan_mlme_rssi_cfg_score *rssi_score;
+	struct rssi_config_score *req_rssi_score;
+	struct wlan_mlme_roam_scoring_cfg *roam_score_params;
+	struct weight_cfg *weight_config;
+	struct rssi_config_score *rssi_score;
+	struct psoc_mlme_obj *mlme_psoc_obj;
+	struct per_slot_score *esp_qbss_scoring;
+	struct per_slot_score *oce_wan_scoring;
+
+	mlme_psoc_obj = wlan_psoc_mlme_get_cmpt_obj(mac_ctx->psoc);
+
+	if (!mlme_psoc_obj)
+		return;
 
 	req_score_params = &req_buffer->score_params;
 	req_rssi_score = &req_score_params->rssi_scoring;
 
-	bss_score_params = &mac_ctx->mlme_cfg->scoring;
-	weight_config = &bss_score_params->weight_cfg;
-	rssi_score = &bss_score_params->rssi_score;
+	roam_score_params = &mac_ctx->mlme_cfg->roam_scoring;
+	weight_config = &mlme_psoc_obj->score_config.weight_config;
+	rssi_score = &mlme_psoc_obj->score_config.rssi_score;
+	esp_qbss_scoring = &mlme_psoc_obj->score_config.esp_qbss_scoring;
+	oce_wan_scoring = &mlme_psoc_obj->score_config.oce_wan_scoring;
 
 	if (!roam_info->cfgParams.enable_scoring_for_roam)
 		req_score_params->disable_bitmap =
@@ -18343,52 +18308,54 @@ static void csr_update_score_params(struct mac_context *mac_ctx,
 		weight_config->oce_subnet_id_weightage;
 
 	req_score_params->bw_index_score =
-		bss_score_params->bandwidth_weight_per_index;
+		mlme_psoc_obj->score_config.bandwidth_weight_per_index;
 	req_score_params->band_index_score =
-		bss_score_params->band_weight_per_index;
+		mlme_psoc_obj->score_config.band_weight_per_index;
 	req_score_params->nss_index_score =
-		bss_score_params->nss_weight_per_index;
+		mlme_psoc_obj->score_config.nss_weight_per_index;
 
 	req_score_params->vendor_roam_score_algorithm =
-			bss_score_params->vendor_roam_score_algorithm;
+			roam_score_params->vendor_roam_score_algorithm;
 
-	req_score_params->roam_score_delta = bss_score_params->roam_score_delta;
+	req_score_params->roam_score_delta =
+				roam_score_params->roam_score_delta;
 	req_score_params->roam_trigger_bitmap =
-				bss_score_params->roam_trigger_bitmap;
+				roam_score_params->roam_trigger_bitmap;
 
 	req_rssi_score->best_rssi_threshold = rssi_score->best_rssi_threshold;
 	req_rssi_score->good_rssi_threshold = rssi_score->good_rssi_threshold;
 	req_rssi_score->bad_rssi_threshold = rssi_score->bad_rssi_threshold;
 	req_rssi_score->good_rssi_pcnt = rssi_score->good_rssi_pcnt;
 	req_rssi_score->bad_rssi_pcnt = rssi_score->bad_rssi_pcnt;
-	req_rssi_score->good_bucket_size = rssi_score->good_rssi_bucket_size;
-	req_rssi_score->bad_bucket_size = rssi_score->bad_rssi_bucket_size;
+	req_rssi_score->good_rssi_bucket_size =
+				rssi_score->good_rssi_bucket_size;
+	req_rssi_score->bad_rssi_bucket_size = rssi_score->bad_rssi_bucket_size;
 	req_rssi_score->rssi_pref_5g_rssi_thresh =
 			rssi_score->rssi_pref_5g_rssi_thresh;
 
 	req_score_params->esp_qbss_scoring.num_slot =
-		bss_score_params->esp_qbss_scoring.num_slot;
+					esp_qbss_scoring->num_slot;
 	req_score_params->esp_qbss_scoring.score_pcnt3_to_0 =
-		bss_score_params->esp_qbss_scoring.score_pcnt3_to_0;
+					esp_qbss_scoring->score_pcnt3_to_0;
 	req_score_params->esp_qbss_scoring.score_pcnt7_to_4 =
-		bss_score_params->esp_qbss_scoring.score_pcnt7_to_4;
+					esp_qbss_scoring->score_pcnt7_to_4;
 	req_score_params->esp_qbss_scoring.score_pcnt11_to_8 =
-		bss_score_params->esp_qbss_scoring.score_pcnt11_to_8;
+					esp_qbss_scoring->score_pcnt11_to_8;
 	req_score_params->esp_qbss_scoring.score_pcnt15_to_12 =
-		bss_score_params->esp_qbss_scoring.score_pcnt15_to_12;
+					esp_qbss_scoring->score_pcnt15_to_12;
 
 	req_score_params->oce_wan_scoring.num_slot =
-		bss_score_params->oce_wan_scoring.num_slot;
+					oce_wan_scoring->num_slot;
 	req_score_params->oce_wan_scoring.score_pcnt3_to_0 =
-		bss_score_params->oce_wan_scoring.score_pcnt3_to_0;
+					oce_wan_scoring->score_pcnt3_to_0;
 	req_score_params->oce_wan_scoring.score_pcnt7_to_4 =
-		bss_score_params->oce_wan_scoring.score_pcnt7_to_4;
+					oce_wan_scoring->score_pcnt7_to_4;
 	req_score_params->oce_wan_scoring.score_pcnt11_to_8 =
-		bss_score_params->oce_wan_scoring.score_pcnt11_to_8;
+					oce_wan_scoring->score_pcnt11_to_8;
 	req_score_params->oce_wan_scoring.score_pcnt15_to_12 =
-		bss_score_params->oce_wan_scoring.score_pcnt15_to_12;
+					oce_wan_scoring->score_pcnt15_to_12;
 	req_score_params->cand_min_roam_score_delta =
-		bss_score_params->min_roam_score_delta;
+					roam_score_params->min_roam_score_delta;
 }
 
 uint8_t csr_get_roam_enabled_sta_sessionid(struct mac_context *mac_ctx)

+ 52 - 6
core/sme/src/csr/csr_api_scan.c

@@ -53,6 +53,7 @@
 #include "qdf_crypto.h"
 #include <wlan_crypto_global_api.h>
 #include "wlan_reg_ucfg_api.h"
+#include "wlan_cm_bss_score_param.h"
 
 static void csr_set_cfg_valid_channel_list(struct mac_context *mac,
 					   uint32_t *pchan_freq_list,
@@ -163,7 +164,7 @@ QDF_STATUS csr_scan_handle_search_for_ssid(struct mac_context *mac_ctx,
 			qdf_mem_free(filter);
 			break;
 		}
-		status = csr_scan_get_result(mac_ctx, filter, &hBSSList);
+		status = csr_scan_get_result(mac_ctx, filter, &hBSSList, true);
 		qdf_mem_free(filter);
 		if (!QDF_IS_STATUS_SUCCESS(status))
 			break;
@@ -2423,9 +2424,52 @@ static void csr_remove_ap_with_assoc_disallowed(struct mac_context *mac_ctx,
 	}
 }
 
+static void csr_get_pcl_chan_weigtage_for_sta(struct mac_context *mac_ctx,
+					struct pcl_freq_weight_list *pcl_lst)
+{
+	enum QDF_OPMODE opmode = QDF_STA_MODE;
+	enum policy_mgr_con_mode pm_mode;
+	uint32_t num_entries = 0;
+	QDF_STATUS status;
+
+	if (!pcl_lst)
+		return;
+
+	if (policy_mgr_map_concurrency_mode(&opmode, &pm_mode)) {
+		status = policy_mgr_get_pcl(mac_ctx->psoc, pm_mode,
+					    pcl_lst->pcl_freq_list,
+					    &num_entries,
+					    pcl_lst->pcl_weight_list,
+					    NUM_CHANNELS);
+		if (QDF_IS_STATUS_ERROR(status))
+			return;
+		pcl_lst->num_of_pcl_channels = num_entries;
+	}
+}
+
+static void csr_calculate_scores(struct mac_context *mac_ctx,
+				 struct scan_filter *filter, qdf_list_t *list)
+{
+	struct pcl_freq_weight_list *pcl_lst = NULL;
+
+	if (!filter->num_of_bssid) {
+		pcl_lst = qdf_mem_malloc(sizeof(*pcl_lst));
+		csr_get_pcl_chan_weigtage_for_sta(mac_ctx, pcl_lst);
+		if (pcl_lst && !pcl_lst->num_of_pcl_channels) {
+			qdf_mem_free(pcl_lst);
+			pcl_lst = NULL;
+		}
+	}
+	wlan_cm_calculate_bss_score(mac_ctx->psoc, pcl_lst, list,
+				    &filter->bssid_hint);
+	if (pcl_lst)
+		qdf_mem_free(pcl_lst);
+}
+
 QDF_STATUS csr_scan_get_result(struct mac_context *mac_ctx,
 			       struct scan_filter *filter,
-			       tScanResultHandle *results)
+			       tScanResultHandle *results,
+			       bool scoring_required)
 {
 	QDF_STATUS status;
 	struct scan_result_list *ret_list = NULL;
@@ -2449,9 +2493,11 @@ QDF_STATUS csr_scan_get_result(struct mac_context *mac_ctx,
 		sme_debug("num_entries %d", num_bss);
 	}
 
-	/* Filter the scan list with the blacklist, rssi reject, avoided APs */
-	if (filter && filter->bss_scoring_required)
+	if (num_bss && filter && scoring_required) {
+		csr_calculate_scores(mac_ctx, filter, list);
+		/* Filter the blacklisted APs and avoided APs */
 		wlan_blm_filter_bssid(pdev, list);
+	}
 
 	if (!list || (list && !qdf_list_size(list))) {
 		sme_debug("scan list empty");
@@ -2475,7 +2521,7 @@ QDF_STATUS csr_scan_get_result(struct mac_context *mac_ctx,
 		/* Fail or No one wants the result. */
 		csr_scan_result_purge(mac_ctx, (tScanResultHandle) ret_list);
 	else {
-		if (filter && filter->bss_scoring_required)
+		if (scoring_required)
 			csr_remove_ap_with_assoc_disallowed(mac_ctx, ret_list);
 
 		if (!csr_ll_count(&ret_list->List)) {
@@ -2529,7 +2575,7 @@ QDF_STATUS csr_scan_get_result_for_bssid(struct mac_context *mac_ctx,
 		     QDF_MAC_ADDR_SIZE);
 
 	status = csr_scan_get_result(mac_ctx, scan_filter,
-				&filtered_scan_result);
+				&filtered_scan_result, false);
 
 	if (!QDF_IS_STATUS_SUCCESS(status)) {
 		sme_err("Failed to get scan result");

+ 1 - 1
core/sme/src/csr/csr_host_scan_roam.c

@@ -377,7 +377,7 @@ QDF_STATUS csr_neighbor_roam_process_scan_complete(struct mac_context *mac,
 		qdf_mem_free(filter);
 		return QDF_STATUS_E_FAILURE;
 	}
-	hstatus = csr_scan_get_result(mac, filter, &scanResult);
+	hstatus = csr_scan_get_result(mac, filter, &scanResult, true);
 	qdf_mem_free(filter);
 	if (hstatus != QDF_STATUS_SUCCESS)
 		sme_err("Get Scan Result status code %d", hstatus);

+ 21 - 7
core/sme/src/csr/csr_inside_api.h

@@ -394,17 +394,29 @@ enum csr_cfgdot11mode csr_find_best_phy_mode(struct mac_context *mac,
 void csr_copy_ssids_from_roam_params(struct roam_ext_params *roam_params,
 				     struct scan_filter *filter);
 
+#ifdef WLAN_ADAPTIVE_11R
 /*
- * csr_update_connect_n_roam_cmn_filter() - update common scan filter
- * @mac_ctx: pointer to mac context
+ * csr_update_adaptive_11r_scan_filter() - fill adaptive 11r support in filter
+ * @mac_ctx: mac ctx
  * @filter: scan filter
- * @opmode: opmode
  *
  * Return void
  */
-void csr_update_connect_n_roam_cmn_filter(struct mac_context *mac_ctx,
-					  struct scan_filter *filter,
-					  enum QDF_OPMODE opmode);
+static inline void
+csr_update_adaptive_11r_scan_filter(struct mac_context *mac_ctx,
+				    struct scan_filter *filter)
+{
+	filter->enable_adaptive_11r =
+		   mac_ctx->mlme_cfg->lfr.enable_adaptive_11r;
+}
+#else
+static inline void
+csr_update_adaptive_11r_scan_filter(struct mac_context *mac_ctx,
+				    struct scan_filter *filter)
+{
+	filter->enable_adaptive_11r = false;
+}
+#endif
 
 /*
  * csr_covert_enc_type_new() - convert csr enc type to wlan enc type
@@ -462,12 +474,14 @@ csr_neighbor_roam_get_scan_filter_from_profile(struct mac_context *mac,
  * @mac: Pointer to Global MAC structure
  * @filter: If pFilter is NULL, all cached results are returned
  * @phResult: an object for the result.
+ * @scoring_required: if scoding is required for AP
  *
  * Return QDF_STATUS
  */
 QDF_STATUS csr_scan_get_result(struct mac_context *mac,
 			       struct scan_filter *filter,
-			       tScanResultHandle *phResult);
+			       tScanResultHandle *phResult,
+			       bool scoring_required);
 
 /**
  * csr_scan_get_result_for_bssid - gets the scan result from scan cache for the

+ 3 - 4
core/sme/src/csr/csr_neighbor_roam.c

@@ -350,7 +350,6 @@ csr_neighbor_roam_get_scan_filter_from_profile(struct mac_context *mac,
 	struct roam_ext_params *roam_params;
 	tCsrChannelInfo *chan_info;
 	uint8_t num_ch = 0;
-	enum QDF_OPMODE opmode = QDF_STA_MODE;
 
 	if (!filter)
 		return QDF_STATUS_E_FAILURE;
@@ -425,7 +424,7 @@ csr_neighbor_roam_get_scan_filter_from_profile(struct mac_context *mac,
 
 	csr_update_pmf_cap_from_connected_profile(profile, filter);
 
-	csr_update_connect_n_roam_cmn_filter(mac, filter, opmode);
+	csr_update_adaptive_11r_scan_filter(mac, filter);
 
 	return QDF_STATUS_SUCCESS;
 }
@@ -1080,7 +1079,7 @@ QDF_STATUS csr_neighbor_roam_init(struct mac_context *mac, uint8_t sessionId)
 	pNeighborRoamInfo->cfgParams.full_roam_scan_period =
 		mac->mlme_cfg->lfr.roam_full_scan_period;
 	pNeighborRoamInfo->cfgParams.enable_scoring_for_roam =
-		mac->mlme_cfg->scoring.enable_scoring_for_roam;
+		mac->mlme_cfg->roam_scoring.enable_scoring_for_roam;
 	pNeighborRoamInfo->cfgParams.roam_scan_n_probes =
 		mac->mlme_cfg->lfr.roam_scan_n_probes;
 	pNeighborRoamInfo->cfgParams.roam_scan_home_away_time =
@@ -1365,7 +1364,7 @@ static QDF_STATUS csr_neighbor_roam_process_handoff_req(
 								session_id);
 		sme_debug("Filter creation status: %d", status);
 		status = csr_scan_get_result(mac_ctx, scan_filter,
-					     &scan_result);
+					     &scan_result, true);
 		qdf_mem_free(scan_filter);
 		csr_neighbor_roam_process_scan_results(mac_ctx, session_id,
 							&scan_result);

+ 1 - 1
core/wma/src/wma_scan_roam.c

@@ -3953,7 +3953,7 @@ QDF_STATUS wma_roam_scan_fill_self_caps(tp_wma_handle wma_handle,
 	if (mac->mlme_cfg->wmm_params.qos_enabled)
 		selfCaps.qos = 1;
 
-	if (mac->mlme_cfg->scoring.apsd_enabled)
+	if (mac->mlme_cfg->roam_scoring.apsd_enabled)
 		selfCaps.apsd = 1;
 
 	selfCaps.rrm = mac->rrm.rrmConfig.rrm_enabled;