qcacmn: Move scoring logic to connection manager

Move bss scoring logic to connection manager.

Change-Id: If8484ec2fa8b3e2d153ae4a6caed76f3354b8965
CRs-Fixed: 2707106
This commit is contained in:
gaurank kathpalia
2020-05-29 03:28:42 +05:30
کامیت شده توسط nshrivas
والد e85e67ce9b
کامیت 506f49a0ff
18فایلهای تغییر یافته به همراه2612 افزوده شده و 1262 حذف شده

مشاهده پرونده

@@ -210,4 +210,17 @@ wlan_scan_process_bcn_probe_rx_sync(struct wlan_objmgr_psoc *psoc,
*/
qdf_time_t wlan_scan_get_aging_time(struct wlan_objmgr_psoc *psoc);
/**
* wlan_scan_purge_results() - purge the scan list
* @scan_list: scan list to be purged
*
* This function purge the temp scan list
*
* Return: QDF_STATUS
*/
static inline QDF_STATUS wlan_scan_purge_results(qdf_list_t *scan_list)
{
return scm_purge_scan_results(scan_list);
}
#endif

مشاهده پرونده

@@ -336,31 +336,6 @@ enum scan_mode_6ghz {
true, \
"honour NL80211 scan policy flags")
/*
* <ini>
* is_bssid_hint_priority - Set priority for connection with bssid_hint
* BSSID.
* @Min: 0
* @Max: 1
* @Default: 1
*
* This ini is used to give priority to BSS for connection which comes
* as part of bssid_hint
*
* Related: None
*
* Supported Feature: STA
*
* Usage: External
*
* </ini>
*/
#define CFG_IS_BSSID_HINT_PRIORITY CFG_INI_UINT(\
"is_bssid_hint_priority",\
0, 1, 0,\
CFG_VALUE_OR_DEFAULT, \
"Set priority for connection with bssid_hint")
#ifdef FEATURE_WLAN_SCAN_PNO
/*
* <ini>
@@ -1245,7 +1220,6 @@ enum scan_mode_6ghz {
CFG(CFG_ADAPTIVE_SCAN_DWELL_MODE) \
CFG(CFG_ADAPTIVE_SCAN_DWELL_MODE_NC) \
CFG(CFG_HONOUR_NL_SCAN_POLICY_FLAGS) \
CFG(CFG_IS_BSSID_HINT_PRIORITY) \
CFG(CFG_PASSIVE_MAX_CHANNEL_TIME_CONC) \
CFG(CFG_ACTIVE_MAX_CHANNEL_TIME_CONC) \
CFG(CFG_MAX_REST_TIME_CONC) \

مشاهده پرونده

@@ -58,36 +58,6 @@ typedef uint32_t wlan_scan_id;
#define PROBE_REQ_BITMAP_LEN 8
#define MAX_PROBE_REQ_OUIS 16
#define RSSI_WEIGHTAGE 20
#define HT_CAPABILITY_WEIGHTAGE 2
#define VHT_CAP_WEIGHTAGE 1
#define HE_CAP_WEIGHTAGE 2
#define CHAN_WIDTH_WEIGHTAGE 12
#define CHAN_BAND_WEIGHTAGE 2
#define NSS_WEIGHTAGE 16
#define BEAMFORMING_CAP_WEIGHTAGE 2
#define PCL_WEIGHT 10
#define CHANNEL_CONGESTION_WEIGHTAGE 5
#define OCE_WAN_WEIGHTAGE 2
#define OCE_AP_TX_POWER_WEIGHTAGE 5
#define OCE_SUBNET_ID_WEIGHTAGE 3
#define BEST_CANDIDATE_MAX_WEIGHT 200
#define MAX_PCT_SCORE 100
#define MAX_INDEX_PER_INI 4
#define WLAN_GET_BITS(_val, _index, _num_bits) \
(((_val) >> (_index)) & ((1 << (_num_bits)) - 1))
#define WLAN_SET_BITS(_var, _index, _num_bits, _val) do { \
(_var) &= ~(((1 << (_num_bits)) - 1) << (_index)); \
(_var) |= (((_val) & ((1 << (_num_bits)) - 1)) << (_index)); \
} while (0)
#define WLAN_GET_SCORE_PERCENTAGE(value32, bw_index) \
WLAN_GET_BITS(value32, (8 * (bw_index)), 8)
#define WLAN_SET_SCORE_PERCENTAGE(value32, score_pcnt, bw_index) \
WLAN_SET_BITS(value32, (8 * (bw_index)), 8, score_pcnt)
/* forward declaration */
struct wlan_objmgr_vdev;
struct wlan_objmgr_pdev;
@@ -468,133 +438,6 @@ struct scan_cache_entry {
#define MAX_FAVORED_BSSID 16
#define MAX_ALLOWED_SSID_LIST 4
/**
* struct weight_config - weight params to calculate best candidate
* @rssi_weightage: RSSI weightage
* @ht_caps_weightage: HT caps weightage
* @vht_caps_weightage: VHT caps weightage
* @he_caps_weightage: HE caps weightage
* @chan_width_weightage: Channel width weightage
* @chan_band_weightage: Channel band weightage
* @nss_weightage: NSS weightage
* @beamforming_cap_weightage: Beamforming caps weightage
* @pcl_weightage: PCL weightage
* @channel_congestion_weightage: channel congestion weightage
* @oce_wan_weightage: OCE WAN metrics weightage
* @oce_ap_tx_pwr_weightage: OCE AP tx power weigtage
* @oce_subnet_id_weightage: OCE subnet id weigtage
*/
struct weight_config {
uint8_t rssi_weightage;
uint8_t ht_caps_weightage;
uint8_t vht_caps_weightage;
uint8_t he_caps_weightage;
uint8_t chan_width_weightage;
uint8_t chan_band_weightage;
uint8_t nss_weightage;
uint8_t beamforming_cap_weightage;
uint8_t pcl_weightage;
uint8_t channel_congestion_weightage;
uint8_t oce_wan_weightage;
uint8_t oce_ap_tx_pwr_weightage;
uint8_t oce_subnet_id_weightage;
};
/**
* struct rssi_cfg_score - rssi related params for scoring logic
* @best_rssi_threshold: RSSI weightage
* @good_rssi_threshold: HT caps weightage
* @bad_rssi_threshold: VHT caps weightage
* @good_rssi_pcnt: HE caps weightage
* @bad_rssi_pcnt: Channel width weightage
* @good_rssi_bucket_size: Channel band weightage
* @bad_rssi_bucket_size: NSS weightage
* @rssi_pref_5g_rssi_thresh: Beamforming caps weightage
*/
struct rssi_cfg_score {
uint32_t best_rssi_threshold;
uint32_t good_rssi_threshold;
uint32_t bad_rssi_threshold;
uint32_t good_rssi_pcnt;
uint32_t bad_rssi_pcnt;
uint32_t good_rssi_bucket_size;
uint32_t bad_rssi_bucket_size;
uint32_t rssi_pref_5g_rssi_thresh;
};
/**
* struct 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 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 scoring_config - Scoring related configuration
* @weight_cfg: weigtage config for config
* @rssi_score: Rssi related config for scoring config
* @esp_qbss_scoring: esp and qbss related scoring config
* @oce_wan_scoring: oce related scoring config
* @bandwidth_weight_per_index: BW wight per index
* @nss_weight_per_index: nss weight per index
* @band_weight_per_index: band weight per index
* @cb_mode_24G: cb mode supprted for 2.4Ghz
* @cb_mode_5G: cb mode supprted for 5Ghz
* @nss: Number of NSS the device support
* @ht_cap: If dev is configured as HT capable
* @vht_cap:If dev is configured as VHT capable
* @he_cap: If dev is configured as HE capable
* @vht_24G_cap:If dev is configured as VHT capable for 2.4Ghz
* @beamformee_cap:If dev is configured as BF capable
*/
struct scoring_config {
struct weight_config weight_cfg;
struct rssi_cfg_score rssi_score;
struct per_slot_scoring esp_qbss_scoring;
struct per_slot_scoring oce_wan_scoring;
uint32_t bandwidth_weight_per_index;
uint32_t nss_weight_per_index;
uint32_t band_weight_per_index;
uint8_t cb_mode_24G;
uint8_t cb_mode_5G;
uint8_t vdev_nss_24g;
uint8_t vdev_nss_5g;
uint8_t ht_cap:1,
vht_cap:1,
he_cap:1,
vht_24G_cap:1,
beamformee_cap:1;
};
#define WLAN_SCAN_FILTER_NUM_SSID 5
#define WLAN_SCAN_FILTER_NUM_BSSID 5
@@ -615,7 +458,7 @@ struct fils_filter_info {
};
/**
* @bss_scoring_required :- flag to bypass scoring filtered results
* struct scan_filter: scan filter
* @enable_adaptive_11r: flag to check if adaptive 11r ini is enabled
* @age_threshold: If set return entry which are newer than the age_threshold
* @p2p_results: If only p2p entries is required
@@ -629,7 +472,6 @@ struct fils_filter_info {
* @num_of_mc_enc_type: number of multicast enc type
* @pmf_cap: Pmf capability
* @ignore_pmf_cap: Ignore pmf capability match
* @num_of_pcl_channels: number of pcl channels
* @bss_type: bss type BSS/IBSS etc
* @dot11_mode: operating modes 0 mean any
* 11a , 11g, 11n , 11ac , 11b etc
@@ -647,13 +489,10 @@ struct fils_filter_info {
* @auth_type: auth type list
* @enc_type: unicast enc type list
* @mc_enc_type: multicast cast enc type list
* @pcl_freq_list: PCL channel frequency list, frequency unit: MHz
* @fils_scan_filter: FILS info
* @pcl_weight_list: PCL Weight list
* @bssid_hint: Mac address of bssid_hint
*/
struct scan_filter {
bool bss_scoring_required;
bool enable_adaptive_11r;
qdf_time_t age_threshold;
uint32_t p2p_results;
@@ -666,7 +505,6 @@ struct scan_filter {
uint32_t num_of_mc_enc_type;
enum wlan_pmf_cap pmf_cap;
bool ignore_pmf_cap;
uint32_t num_of_pcl_channels;
enum wlan_bss_type bss_type;
enum wlan_phymode dot11_mode;
enum wlan_band band;
@@ -682,9 +520,7 @@ struct scan_filter {
enum wlan_auth_type auth_type[WLAN_NUM_OF_SUPPORT_AUTH_TYPE];
enum wlan_enc_type enc_type[WLAN_NUM_OF_ENCRYPT_TYPE];
enum wlan_enc_type mc_enc_type[WLAN_NUM_OF_ENCRYPT_TYPE];
uint32_t pcl_freq_list[NUM_CHANNELS];
struct fils_filter_info fils_scan_filter;
uint8_t pcl_weight_list[NUM_CHANNELS];
struct qdf_mac_addr bssid_hint;
};
@@ -1399,12 +1235,10 @@ struct pno_scan_req_params {
* struct scan_user_cfg - user configuration required for for scan
* @ie_whitelist: probe req IE whitelist attrs
* @sta_miracast_mcc_rest_time: sta miracast mcc rest time
* @score_config: scoring logic configuration
*/
struct scan_user_cfg {
struct probe_req_whitelist_attr ie_whitelist;
uint32_t sta_miracast_mcc_rest_time;
struct scoring_config score_config;
};
/**