qcacmn: Add score based on EHT mode of operation
Previously, the Host driver assigned a minimum score of 1 to any candidate, if the BSSID was in the deny list. This commit introduces a change to prioritize candidates based on their link type. The new scoring system adds more weight to MLO over SLO and Legacy links. The priority order is as follows: MLO 3-link > MLO 2-link > SLO > Legacy. Change-Id: I1bb8247d7a2ae88967c0949c0a51e32a3d8a44da CRs-Fixed: 3855155
This commit is contained in:

zatwierdzone przez
Ravindra Konda

rodzic
c6727cbd55
commit
77a9279a4b
@@ -113,7 +113,8 @@
|
|||||||
#define CM_SECURITY_INDEX_WEIGHTAGE 0x00643219
|
#define CM_SECURITY_INDEX_WEIGHTAGE 0x00643219
|
||||||
|
|
||||||
#define CM_BEST_CANDIDATE_MAX_BSS_SCORE (CM_BEST_CANDIDATE_MAX_WEIGHT * 100)
|
#define CM_BEST_CANDIDATE_MAX_BSS_SCORE (CM_BEST_CANDIDATE_MAX_WEIGHT * 100)
|
||||||
#define CM_AVOID_CANDIDATE_MIN_SCORE 1
|
#define CM_AVOID_CANDIDATE_NON_ML_MIN_SCORE 1
|
||||||
|
#define CM_AVOID_CANDIDATE_ML_MIN_SCORE 2
|
||||||
|
|
||||||
#define CM_GET_SCORE_PERCENTAGE(value32, bw_index) \
|
#define CM_GET_SCORE_PERCENTAGE(value32, bw_index) \
|
||||||
QDF_GET_BITS(value32, (8 * (bw_index)), 8)
|
QDF_GET_BITS(value32, (8 * (bw_index)), 8)
|
||||||
@@ -596,6 +597,22 @@ static uint32_t cm_get_sta_nss(struct wlan_objmgr_psoc *psoc,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef WLAN_FEATURE_11BE_MLO_ADV_FEATURE
|
||||||
|
static uint32_t wlan_cm_get_min_score(struct scan_cache_entry *entry)
|
||||||
|
{
|
||||||
|
if (!entry->ie_list.multi_link_bv)
|
||||||
|
return CM_AVOID_CANDIDATE_NON_ML_MIN_SCORE;
|
||||||
|
/* Add more weigh for candidate with partner link */
|
||||||
|
return CM_AVOID_CANDIDATE_ML_MIN_SCORE +
|
||||||
|
(CM_AVOID_CANDIDATE_ML_MIN_SCORE * entry->ml_info.num_links);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
static uint32_t wlan_cm_get_min_score(struct scan_cache_entry *entry)
|
||||||
|
{
|
||||||
|
return CM_AVOID_CANDIDATE_NON_ML_MIN_SCORE;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef CONN_MGR_ADV_FEATURE
|
#ifdef CONN_MGR_ADV_FEATURE
|
||||||
static bool
|
static bool
|
||||||
cm_get_pcl_weight_of_channel(uint32_t chan_freq,
|
cm_get_pcl_weight_of_channel(uint32_t chan_freq,
|
||||||
@@ -1182,10 +1199,12 @@ cm_calculate_etp(struct wlan_objmgr_psoc *psoc,
|
|||||||
uint32_t ppdu_payload_dur_us = 0, mpdu_per_ampdu, mpdu_per_ppdu;
|
uint32_t ppdu_payload_dur_us = 0, mpdu_per_ampdu, mpdu_per_ppdu;
|
||||||
uint32_t single_ppdu_dur_us, estimated_throughput_mbps, data_rate_kbps;
|
uint32_t single_ppdu_dur_us, estimated_throughput_mbps, data_rate_kbps;
|
||||||
struct htcap_cmn_ie *htcap;
|
struct htcap_cmn_ie *htcap;
|
||||||
|
uint32_t min_score = wlan_cm_get_min_score(entry);
|
||||||
|
|
||||||
htcap = (struct htcap_cmn_ie *)util_scan_entry_htcap(entry);
|
htcap = (struct htcap_cmn_ie *)util_scan_entry_htcap(entry);
|
||||||
|
|
||||||
if (ch_width > CH_WIDTH_160MHZ)
|
if (ch_width > CH_WIDTH_160MHZ)
|
||||||
return CM_AVOID_CANDIDATE_MIN_SCORE;
|
return min_score;
|
||||||
|
|
||||||
if (is_he)
|
if (is_he)
|
||||||
ntone = cm_get_etp_he_ntone(ch_width);
|
ntone = cm_get_etp_he_ntone(ch_width);
|
||||||
@@ -1197,7 +1216,7 @@ cm_calculate_etp(struct wlan_objmgr_psoc *psoc,
|
|||||||
cm_get_etp_max_bits_per_sc_1000x_for_nss(psoc, entry,
|
cm_get_etp_max_bits_per_sc_1000x_for_nss(psoc, entry,
|
||||||
max_nss, phy_config);
|
max_nss, phy_config);
|
||||||
if (rssi < WLAN_NOISE_FLOOR_DBM_DEFAULT)
|
if (rssi < WLAN_NOISE_FLOOR_DBM_DEFAULT)
|
||||||
return CM_AVOID_CANDIDATE_MIN_SCORE;
|
return min_score;
|
||||||
|
|
||||||
log_2_snr_tone_1000x = calculate_bit_per_tone(rssi, ch_width);
|
log_2_snr_tone_1000x = calculate_bit_per_tone(rssi, ch_width);
|
||||||
|
|
||||||
@@ -1216,8 +1235,8 @@ cm_calculate_etp(struct wlan_objmgr_psoc *psoc,
|
|||||||
IS_ASSOC_LINK(ml_flag) ? "Candidate" : "Partner",
|
IS_ASSOC_LINK(ml_flag) ? "Candidate" : "Partner",
|
||||||
QDF_MAC_ADDR_REF(entry->bssid.bytes),
|
QDF_MAC_ADDR_REF(entry->bssid.bytes),
|
||||||
entry->channel.chan_freq, data_rate_kbps,
|
entry->channel.chan_freq, data_rate_kbps,
|
||||||
CM_AVOID_CANDIDATE_MIN_SCORE);
|
min_score);
|
||||||
return CM_AVOID_CANDIDATE_MIN_SCORE;
|
return min_score;
|
||||||
}
|
}
|
||||||
/* compute MPDU_p_PPDU */
|
/* compute MPDU_p_PPDU */
|
||||||
if (is_ht) {
|
if (is_ht) {
|
||||||
@@ -1253,8 +1272,8 @@ cm_calculate_etp(struct wlan_objmgr_psoc *psoc,
|
|||||||
etp_param->airtime_fraction) /
|
etp_param->airtime_fraction) /
|
||||||
CM_MAX_ESTIMATED_AIR_TIME_FRACTION;
|
CM_MAX_ESTIMATED_AIR_TIME_FRACTION;
|
||||||
|
|
||||||
if (estimated_throughput_mbps < CM_AVOID_CANDIDATE_MIN_SCORE)
|
if (estimated_throughput_mbps < min_score)
|
||||||
estimated_throughput_mbps = CM_AVOID_CANDIDATE_MIN_SCORE;
|
estimated_throughput_mbps = min_score;
|
||||||
if (estimated_throughput_mbps > CM_BEST_CANDIDATE_MAX_BSS_SCORE)
|
if (estimated_throughput_mbps > CM_BEST_CANDIDATE_MAX_BSS_SCORE)
|
||||||
estimated_throughput_mbps = CM_BEST_CANDIDATE_MAX_BSS_SCORE;
|
estimated_throughput_mbps = CM_BEST_CANDIDATE_MAX_BSS_SCORE;
|
||||||
|
|
||||||
@@ -3285,7 +3304,7 @@ void wlan_cm_calculate_bss_score(struct wlan_objmgr_pdev *pdev,
|
|||||||
} else if (denylist_action == CM_DLM_AVOID) {
|
} else if (denylist_action == CM_DLM_AVOID) {
|
||||||
/* add min score so that it is added back in the end */
|
/* add min score so that it is added back in the end */
|
||||||
scan_entry->entry->bss_score =
|
scan_entry->entry->bss_score =
|
||||||
CM_AVOID_CANDIDATE_MIN_SCORE;
|
wlan_cm_get_min_score(scan_entry->entry);
|
||||||
mlme_nofl_debug("Candidate("QDF_MAC_ADDR_FMT" freq %d): rssi %d, is in Avoidlist, give min score %d",
|
mlme_nofl_debug("Candidate("QDF_MAC_ADDR_FMT" freq %d): rssi %d, is in Avoidlist, give min score %d",
|
||||||
QDF_MAC_ADDR_REF(scan_entry->entry->bssid.bytes),
|
QDF_MAC_ADDR_REF(scan_entry->entry->bssid.bytes),
|
||||||
scan_entry->entry->channel.chan_freq,
|
scan_entry->entry->channel.chan_freq,
|
||||||
|
Reference in New Issue
Block a user