From fd39482ecb0249defb27de633d47f4828be8db0f Mon Sep 17 00:00:00 2001 From: sheenam monga Date: Mon, 26 Aug 2019 19:05:59 +0530 Subject: [PATCH] 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 --- components/mlme/core/src/wlan_mlme_main.c | 2 ++ .../mlme/dispatcher/inc/cfg_mlme_scoring.h | 29 +++++++++++++++++++ .../dispatcher/inc/wlan_mlme_public_struct.h | 2 ++ core/sme/src/csr/csr_api_roam.c | 3 ++ 4 files changed, 36 insertions(+) diff --git a/components/mlme/core/src/wlan_mlme_main.c b/components/mlme/core/src/wlan_mlme_main.c index 45ffc0990421..7ee226470f1a 100644 --- a/components/mlme/core/src/wlan_mlme_main.c +++ b/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 = diff --git a/components/mlme/dispatcher/inc/cfg_mlme_scoring.h b/components/mlme/dispatcher/inc/cfg_mlme_scoring.h index 4594d746a062..c18a331bf02d 100644 --- a/components/mlme/dispatcher/inc/cfg_mlme_scoring.h +++ b/components/mlme/dispatcher/inc/cfg_mlme_scoring.h @@ -1193,6 +1193,34 @@ CFG_VALUE_OR_DEFAULT, \ "Roam score delta for BTM roam trigger") +/* + * + * 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 + * + * + */ +#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 */ diff --git a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h index 96f9925108f9..258678629e61 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h +++ b/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 diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index f2d98917b895..8a0c7d855f8a 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/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;