diff --git a/components/mlme/core/src/wlan_mlme_main.c b/components/mlme/core/src/wlan_mlme_main.c index d36bf0ceb6c2..de4244dbebc6 100644 --- a/components/mlme/core/src/wlan_mlme_main.c +++ b/components/mlme/core/src/wlan_mlme_main.c @@ -1890,14 +1890,21 @@ static void mlme_init_wps_params_cfg(struct wlan_objmgr_psoc *psoc, static void mlme_init_btm_cfg(struct wlan_objmgr_psoc *psoc, struct wlan_mlme_btm *btm) { - btm->btm_offload_config = cfg_default(CFG_BTM_ENABLE); + btm->btm_offload_config = cfg_get(psoc, CFG_BTM_ENABLE); btm->prefer_btm_query = cfg_get(psoc, CFG_PREFER_BTM_QUERY); if (btm->prefer_btm_query) MLME_SET_BIT(btm->btm_offload_config, BTM_OFFLOAD_CONFIG_BIT_8); + btm->abridge_flag = cfg_get(psoc, CFG_ENABLE_BTM_ABRIDGE); + if (btm->abridge_flag) + MLME_SET_BIT(btm->btm_offload_config, BTM_OFFLOAD_CONFIG_BIT_7); + btm->btm_solicited_timeout = cfg_default(CFG_BTM_SOLICITED_TIMEOUT); btm->btm_max_attempt_cnt = cfg_default(CFG_BTM_MAX_ATTEMPT_CNT); btm->btm_sticky_time = cfg_default(CFG_BTM_STICKY_TIME); + btm->rct_validity_timer = cfg_get(psoc, CFG_BTM_VALIDITY_TIMER); + btm->disassoc_timer_threshold = + cfg_get(psoc, CFG_BTM_DISASSOC_TIMER_THRESHOLD); } /** diff --git a/components/mlme/dispatcher/inc/cfg_mlme_btm.h b/components/mlme/dispatcher/inc/cfg_mlme_btm.h index 9d7ded6adb6d..668e96eddc61 100644 --- a/components/mlme/dispatcher/inc/cfg_mlme_btm.h +++ b/components/mlme/dispatcher/inc/cfg_mlme_btm.h @@ -44,6 +44,29 @@ 1, \ "prefer btm query over 11k neighbor report") +/* + * + * prefer_roam_score_for_candidate_selection - choose to sort the candidates on + * roam score or preferred AP + * @Min: 0 + * @Max: 1 + * @Default: 1 + * + * This ini is used to enable the the firmware to sort the candidates + * based on the roam score rather than selecting APs as per the order + * of the APs sent by the connected AP. + * + * Supported Feature: Roaming + * + * Usage: External + * + * + */ +#define CFG_ENABLE_BTM_ABRIDGE CFG_INI_BOOL( \ + "prefer_roam_score_for_candidate_selection", \ + 1, \ + "sort candidate based on roam score") + /* * * btm_offload_config - Configure BTM @@ -159,11 +182,68 @@ CFG_VALUE_OR_DEFAULT, \ "configure Stick time after roaming to new AP by BTM") +/* + * + * roam_candidate_validity_timer - roam cache entries validity timer + * @Min: 0 + * @Max: 0xffffffff + * @Default: 0xffffffff + * + * This value is the timeout values for the cached roam candidate + * entries in firmware. If this value is 0, then that entry is not + * valid + * + * Supported Feature: Roaming + * + * Usage: External + * + * + */ +#define CFG_BTM_VALIDITY_TIMER CFG_INI_UINT( \ + "roam_candidate_validity_timer", \ + 0, \ + 0xffffffff, \ + 0xffffffff, \ + CFG_VALUE_OR_DEFAULT, \ + "BTM validity timer") + +/* + * + * btm_disassoc_timer_threshold - Disassociation timer threshold to wait + * after which the full scan for roaming can be started after the AP has sent + * the disassoc imminent + * @Min: 0 + * @Max: 0xffffffff + * @Default: 0 + * + * When AP sends, BTM request with disassoc imminent bit set, the STA should + * roam to a new AP within the disassc timeout provided by the ap. If the Roam + * scan period is less than the disassoc timeout value, then instead of + * triggering the roam scan immediately, STA can wait for this + * btm_disassoc_timer_threshold and then start roaming. + * + * Supported Feature: Roaming + * + * Usage: External + * + * + */ +#define CFG_BTM_DISASSOC_TIMER_THRESHOLD CFG_INI_UINT( \ + "btm_disassoc_timer_threshold", \ + 0, \ + 0xffffffff, \ + 0, \ + CFG_VALUE_OR_DEFAULT, \ + "BTM disassociation timer threshold") + #define CFG_BTM_ALL \ CFG(CFG_PREFER_BTM_QUERY) \ + CFG(CFG_ENABLE_BTM_ABRIDGE) \ CFG(CFG_BTM_ENABLE) \ CFG(CFG_BTM_SOLICITED_TIMEOUT) \ CFG(CFG_BTM_MAX_ATTEMPT_CNT) \ - CFG(CFG_BTM_STICKY_TIME) + CFG(CFG_BTM_STICKY_TIME) \ + CFG(CFG_BTM_VALIDITY_TIMER) \ + CFG(CFG_BTM_DISASSOC_TIMER_THRESHOLD) #endif /* CFG_MLME_BTM_H_ */ diff --git a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h index d6b6384557fd..5e8860ee4470 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h @@ -1752,17 +1752,25 @@ struct wlan_mlme_wifi_pos_cfg { /* * struct wlan_mlme_btm - BTM related configs * @prefer_btm_query: flag to prefer btm query over 11k + * @abridge_flag: set this flag to enable firmware to sort candidates based on + * roam score rather than selecting preferred APs. * @btm_offload_config: configure btm offload * @btm_solicited_timeout: configure timeout value for waiting BTM request * @btm_max_attempt_cnt: configure maximum attempt for sending BTM query to ESS * @btm_sticky_time: configure Stick time after roaming to new AP by BTM + * @rct_validity_timer: Timeout values for roam cache table entries + * @disassoc_timer_threshold: Disassociation timeout till which roam scan need + * not be triggered */ struct wlan_mlme_btm { bool prefer_btm_query; + bool abridge_flag; uint32_t btm_offload_config; uint32_t btm_solicited_timeout; uint32_t btm_max_attempt_cnt; uint32_t btm_sticky_time; + uint32_t rct_validity_timer; + uint32_t disassoc_timer_threshold; }; /** diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index 8f6772781158..7ce3dc82a137 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -587,7 +587,8 @@ enum hdd_dot11_mode { * WMI_ROAM_TRIGGER_REASON_FORCED - 9 * WMI_ROAM_TRIGGER_REASON_BTM - 10 * WMI_ROAM_TRIGGER_REASON_UNIT_TEST - 11 - * WMI_ROAM_TRIGGER_REASON_MAX - 12 + * WMI_ROAM_TRIGGER_REASON_BSS_LOAD - 12 + * WMI_ROAM_TRIGGER_REASON_MAX - 13 * * For Ex: 0xDA (PER, LOW_RSSI, HIGH_RSSI, MAWC, DENSE) * @@ -602,7 +603,7 @@ enum hdd_dot11_mode { #define CFG_ROAM_SCAN_TRIGGER_REASON_BITMASK_NAME "roam_trigger_reason_bitmask" #define CFG_ROAM_SCAN_TRIGGER_REASON_BITMASK_MIN (0) #define CFG_ROAM_SCAN_TRIGGER_REASON_BITMASK_MAX (0xFFFFFFFF) -#define CFG_ROAM_SCAN_TRIGGER_REASON_BITMASK_DEFAULT (0xDA) +#define CFG_ROAM_SCAN_TRIGGER_REASON_BITMASK_DEFAULT (0x10DA) /* * diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index 0d47abd00540..9130f6632666 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -2399,6 +2399,8 @@ typedef struct sSirRoamOffloadScanReq { uint32_t btm_solicited_timeout; uint32_t btm_max_attempt_cnt; uint32_t btm_sticky_time; + uint32_t rct_validity_timer; + uint32_t disassoc_timer_threshold; struct wmi_11k_offload_params offload_11k_params; uint32_t ho_delay_for_rx; uint32_t roam_preauth_retry_count; diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 6c3e37f029b3..5bd581a47e35 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -17787,6 +17787,9 @@ csr_create_roam_scan_offload_request(struct mac_context *mac_ctx, mac_ctx->mlme_cfg->btm.btm_max_attempt_cnt; req_buf->btm_sticky_time = mac_ctx->mlme_cfg->btm.btm_sticky_time; + req_buf->rct_validity_timer = mac_ctx->mlme_cfg->btm.rct_validity_timer; + req_buf->disassoc_timer_threshold = + mac_ctx->mlme_cfg->btm.disassoc_timer_threshold; #ifdef WLAN_FEATURE_ROAM_OFFLOAD QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG, diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c index 80495811d895..faa0b3bffffb 100644 --- a/core/wma/src/wma_scan_roam.c +++ b/core/wma/src/wma_scan_roam.c @@ -341,6 +341,7 @@ static void wma_roam_scan_offload_set_params( ¶ms->roam_offload_params, roam_req); params->fw_okc = roam_req->pmkid_modes.fw_okc; params->fw_pmksa_cache = roam_req->pmkid_modes.fw_pmksa_cache; + params->rct_validity_timer = roam_req->rct_validity_timer; WMA_LOGD(FL("qos_caps: %d, qos_enabled: %d, ho_delay_for_rx: %d, roam_scan_mode: %d"), params->roam_offload_params.qos_caps, params->roam_offload_params.qos_enabled, @@ -1400,6 +1401,7 @@ static QDF_STATUS wma_roam_scan_btm_offload(tp_wma_handle wma_handle, params->btm_solicited_timeout = roam_req->btm_solicited_timeout; params->btm_max_attempt_cnt = roam_req->btm_max_attempt_cnt; params->btm_sticky_time = roam_req->btm_sticky_time; + params->disassoc_timer_threshold = roam_req->disassoc_timer_threshold; WMA_LOGD("%s: Sending BTM offload to FW for vdev %u btm_offload_config %u", __func__, params->vdev_id, params->btm_offload_config);