qcacld-3.0: Move BSS scoring logic to connection manager

Move bss scoring logic to connection manager.

Change-Id: Ie7639853dec303133705c3394bf0577670000c21
CRs-Fixed: 2707108
This commit is contained in:
gaurank kathpalia
2020-05-29 03:27:47 +05:30
committed by nshrivas
parent f2aed55e40
commit 67b87cbde5
20 changed files with 545 additions and 1887 deletions

View File

@@ -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 \

View File

@@ -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 */

File diff suppressed because it is too large Load Diff

View File

@@ -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;