Browse Source

qcacld-3.0: Add ini for roam score algorithm selection

CFG_VENDOR_ROAM_SCORE_ALGORITHM is added to specify the
preferred roam score algorithm.
With value 1, the new V2 roam score algorithm will be used.
With this roam score Algorithm, AP score will be calculated
based on below equation:
AP Score = (RSSIfactor * rssiweight(0.65)) +
		(CUfactor * cuweight(0.35))

This algorithm value will be sent to firmware over the
WMI_AP_PROFILE command.

Change-Id: I5e7857108a9623fdf3e698cb842dbc22c21f61a1
CRs-Fixed: 2513571
sheenam monga 5 years ago
parent
commit
fd39482ecb

+ 2 - 0
components/mlme/core/src/wlan_mlme_main.c

@@ -1738,6 +1738,8 @@ static void mlme_init_scoring_cfg(struct wlan_objmgr_psoc *psoc,
 {
 	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 =

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

@@ -1193,6 +1193,34 @@
 	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 QCOM 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_SCORING_ALL \
 	CFG(CFG_SCORING_RSSI_WEIGHTAGE) \
 	CFG(CFG_SCORING_HT_CAPS_WEIGHTAGE) \
@@ -1234,5 +1262,6 @@
 	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_SCORING_H */

+ 2 - 0
components/mlme/dispatcher/inc/wlan_mlme_public_struct.h

@@ -1823,6 +1823,7 @@ struct wlan_mlme_per_slot_scoring {
  * @roam_trigger_bitmap: bitmap for various roam triggers
  * @roam_score_delta: percentage delta in roam score
  * @apsd_enabled: Enable automatic power save delivery
+ * @vendor_roam_score_algorithm: Preferred vendor roam score algorithm
  */
 struct wlan_mlme_scoring_cfg {
 	bool enable_scoring_for_roam;
@@ -1836,6 +1837,7 @@ struct wlan_mlme_scoring_cfg {
 	uint32_t roam_trigger_bitmap;
 	uint32_t roam_score_delta;
 	bool apsd_enabled;
+	uint32_t vendor_roam_score_algorithm;
 };
 
 /* struct wlan_mlme_threshold - Threshold related config items

+ 3 - 0
core/sme/src/csr/csr_api_roam.c

@@ -19152,6 +19152,9 @@ static void csr_update_score_params(struct mac_context *mac_ctx,
 	req_score_params->nss_index_score =
 		bss_score_params->nss_weight_per_index;
 
+	req_score_params->vendor_roam_score_algorithm =
+			bss_score_params->vendor_roam_score_algorithm;
+
 	req_score_params->roam_score_delta = bss_score_params->roam_score_delta;
 	req_score_params->roam_trigger_bitmap =
 				bss_score_params->roam_trigger_bitmap;