diff --git a/components/mlme/core/src/wlan_mlme_main.c b/components/mlme/core/src/wlan_mlme_main.c
index 311eda6c0a..3ad1a83ce1 100644
--- a/components/mlme/core/src/wlan_mlme_main.c
+++ b/components/mlme/core/src/wlan_mlme_main.c
@@ -1696,6 +1696,7 @@ static void mlme_init_lfr_cfg(struct wlan_objmgr_psoc *psoc,
lfr->roam_preauth_retry_count =
cfg_get(psoc, CFG_LFR3_ROAM_PREAUTH_RETRY_COUNT);
lfr->roam_rssi_diff = cfg_get(psoc, CFG_LFR_ROAM_RSSI_DIFF);
+ lfr->bg_rssi_threshold = cfg_get(psoc, CFG_LFR_ROAM_BG_RSSI_TH);
lfr->roam_scan_offload_enabled =
cfg_get(psoc, CFG_LFR_ROAM_SCAN_OFFLOAD_ENABLED);
lfr->neighbor_scan_timer_period =
diff --git a/components/mlme/dispatcher/inc/cfg_mlme_lfr.h b/components/mlme/dispatcher/inc/cfg_mlme_lfr.h
index b7e868130e..7ad0bf1d65 100644
--- a/components/mlme/dispatcher/inc/cfg_mlme_lfr.h
+++ b/components/mlme/dispatcher/inc/cfg_mlme_lfr.h
@@ -1250,6 +1250,34 @@
CFG_VALUE_OR_DEFAULT, \
"Enable roam based on rssi")
+/*
+ *
+ * bg_rssi_threshold - To set RSSI Threshold for BG scan roaming
+ * @Min: 0
+ * @Max: 100
+ * @Default: 5
+ *
+ * This INI is used to set the value of rssi threshold to trigger roaming
+ * after background scan. To trigger roam after bg scan, value of rssi of
+ * candidate AP should be higher by this threshold than the rssi of the
+ * currrently associated AP.
+ *
+ * Related: RoamRssiDiff
+ *
+ * Supported Feature: Roaming
+ *
+ * Usage: External
+ *
+ *
+ */
+#define CFG_LFR_ROAM_BG_RSSI_TH CFG_INI_UINT( \
+ "bg_rssi_threshold", \
+ 0, \
+ 100, \
+ 5, \
+ CFG_VALUE_OR_DEFAULT, \
+ "Enable roam based on rssi after BG scan")
+
/*
*
* gWESModeEnabled - Enable WES mode
@@ -2893,6 +2921,7 @@
CFG(CFG_LFR_MAWC_FEATURE_ENABLED) \
CFG(CFG_LFR_FAST_TRANSITION_ENABLED) \
CFG(CFG_LFR_ROAM_RSSI_DIFF) \
+ CFG(CFG_LFR_ROAM_BG_RSSI_TH) \
CFG(CFG_LFR_ENABLE_WES_MODE) \
CFG(CFG_LFR_ROAM_SCAN_OFFLOAD_ENABLED) \
CFG(CFG_LFR_NEIGHBOR_SCAN_CHANNEL_LIST) \
diff --git a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h
index 148a7d33ae..897e688951 100644
--- a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h
+++ b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h
@@ -1724,6 +1724,7 @@ struct wlan_mlme_lfr_cfg {
uint32_t roam_preauth_retry_count;
uint32_t roam_preauth_no_ack_timeout;
uint8_t roam_rssi_diff;
+ uint8_t bg_rssi_threshold;
bool roam_scan_offload_enabled;
uint32_t neighbor_scan_timer_period;
uint32_t neighbor_scan_min_timer_period;
diff --git a/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_public_struct.h b/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_public_struct.h
index a7a9a3e6de..7b3238846a 100644
--- a/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_public_struct.h
+++ b/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_public_struct.h
@@ -186,6 +186,8 @@ struct wlan_roam_triggers {
* absolute RSSI threshold. Zero means no absolute minimum
* RSSI is required. units are the offset from the noise
* floor in dB
+ * @bg_rssi_threshold: Value of rssi threshold to trigger roaming
+ * after background scan.
*/
struct ap_profile {
uint32_t flags;
@@ -196,6 +198,7 @@ struct ap_profile {
uint32_t rsn_mcastcipherset;
uint32_t rsn_mcastmgmtcipherset;
uint32_t rssi_abs_thresh;
+ uint8_t bg_rssi_threshold;
};
/**
diff --git a/components/wmi/src/wmi_unified_roam_tlv.c b/components/wmi/src/wmi_unified_roam_tlv.c
index 73fa38c2bf..444fe924df 100644
--- a/components/wmi/src/wmi_unified_roam_tlv.c
+++ b/components/wmi/src/wmi_unified_roam_tlv.c
@@ -2967,6 +2967,7 @@ send_roam_scan_offload_ap_profile_cmd_tlv(wmi_unified_t wmi_handle,
WMITLV_GET_STRUCT_TLVLEN(wmi_ap_profile));
profile->flags = ap_profile->profile.flags;
profile->rssi_threshold = ap_profile->profile.rssi_threshold;
+ profile->bg_rssi_threshold = ap_profile->profile.bg_rssi_threshold;
profile->ssid.ssid_len = ap_profile->profile.ssid.length;
qdf_mem_copy(profile->ssid.ssid, ap_profile->profile.ssid.ssid,
profile->ssid.ssid_len);
@@ -2977,8 +2978,9 @@ send_roam_scan_offload_ap_profile_cmd_tlv(wmi_unified_t wmi_handle,
ap_profile->profile.rsn_mcastmgmtcipherset;
profile->rssi_abs_thresh = ap_profile->profile.rssi_abs_thresh;
- WMI_LOGD("AP PROFILE: flags %x rssi_thres:%d ssid:%.*s authmode %d uc cipher %d mc cipher %d mc mgmt cipher %d rssi abs thresh %d",
+ WMI_LOGD("AP PROFILE: flags %x rssi_thres:%d bg_rssi_thres:%d ssid:%.*s authmode %d uc cipher %d mc cipher %d mc mgmt cipher %d rssi abs thresh %d",
profile->flags, profile->rssi_threshold,
+ profile->bg_rssi_threshold,
profile->ssid.ssid_len, ap_profile->profile.ssid.ssid,
profile->rsn_authmode, profile->rsn_ucastcipherset,
profile->rsn_mcastcipherset, profile->rsn_mcastmgmtcipherset,
diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h
index 11e1474e3f..be376ec188 100644
--- a/core/mac/inc/sir_api.h
+++ b/core/mac/inc/sir_api.h
@@ -2262,6 +2262,7 @@ struct roam_offload_scan_req {
uint8_t OpportunisticScanThresholdDiff;
uint8_t RoamRescanRssiDiff;
uint8_t RoamRssiDiff;
+ uint8_t bg_rssi_threshold;
struct rsn_caps rsn_caps;
int32_t rssi_abs_thresh;
uint8_t ChannelCacheType;
diff --git a/core/sme/inc/csr_neighbor_roam.h b/core/sme/inc/csr_neighbor_roam.h
index ffea5c96ff..f0342c8ef2 100644
--- a/core/sme/inc/csr_neighbor_roam.h
+++ b/core/sme/inc/csr_neighbor_roam.h
@@ -68,6 +68,7 @@ typedef struct sCsrNeighborRoamCfgParams {
uint32_t full_roam_scan_period;
bool enable_scoring_for_roam;
uint8_t roam_rssi_diff;
+ uint8_t bg_rssi_threshold;
uint16_t roam_scan_home_away_time;
uint8_t roam_scan_n_probes;
uint32_t roam_scan_inactivity_time;
diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c
index 5d0a57a21b..199c9921ef 100644
--- a/core/sme/src/common/sme_api.c
+++ b/core/sme/src/common/sme_api.c
@@ -7002,6 +7002,9 @@ sme_restore_default_roaming_params(struct mac_context *mac,
mac->mlme_cfg->lfr.neighbor_lookup_rssi_threshold;
roam_info->cfgParams.roam_rssi_diff =
mac->mlme_cfg->lfr.roam_rssi_diff;
+ roam_info->cfgParams.bg_rssi_threshold =
+ mac->mlme_cfg->lfr.bg_rssi_threshold;
+
roam_info->cfgParams.maxChannelScanTime =
mac->mlme_cfg->lfr.neighbor_scan_max_chan_time;
roam_info->cfgParams.roam_scan_home_away_time =
diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c
index 8575daf83c..9afed9d310 100644
--- a/core/sme/src/csr/csr_api_roam.c
+++ b/core/sme/src/csr/csr_api_roam.c
@@ -17663,6 +17663,7 @@ csr_create_roam_scan_offload_request(struct mac_context *mac_ctx,
req_buf->RoamRescanRssiDiff =
roam_info->cfgParams.nRoamRescanRssiDiff;
req_buf->RoamRssiDiff = roam_info->cfgParams.roam_rssi_diff;
+ req_buf->bg_rssi_threshold = roam_info->cfgParams.bg_rssi_threshold;
req_buf->rssi_abs_thresh =
mac_ctx->mlme_cfg->lfr.roam_rssi_abs_threshold;
req_buf->reason = reason;
@@ -19945,6 +19946,8 @@ csr_cm_roam_scan_offload_ap_profile(struct mac_context *mac_ctx,
/* Group management cipher suite */
profile->rssi_threshold = roam_info->cfgParams.roam_rssi_diff;
+ profile->bg_rssi_threshold =
+ roam_info->cfgParams.bg_rssi_threshold;
/*
* rssi_diff which is updated via framework is equivalent to the
* INI RoamRssiDiff parameter and hence should be updated.
diff --git a/core/sme/src/csr/csr_neighbor_roam.c b/core/sme/src/csr/csr_neighbor_roam.c
index e83fd52db8..a788f616fc 100644
--- a/core/sme/src/csr/csr_neighbor_roam.c
+++ b/core/sme/src/csr/csr_neighbor_roam.c
@@ -1140,6 +1140,8 @@ QDF_STATUS csr_neighbor_roam_init(struct mac_context *mac, uint8_t sessionId)
mac->mlme_cfg->lfr.roam_scan_hi_rssi_ub;
pNeighborRoamInfo->cfgParams.roam_rssi_diff =
mac->mlme_cfg->lfr.roam_rssi_diff;
+ pNeighborRoamInfo->cfgParams.bg_rssi_threshold =
+ mac->mlme_cfg->lfr.bg_rssi_threshold;
qdf_zero_macaddr(&pNeighborRoamInfo->currAPbssid);
pNeighborRoamInfo->currentNeighborLookupThreshold =
diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c
index a8778fe73b..91a1569c58 100644
--- a/core/wma/src/wma_scan_roam.c
+++ b/core/wma/src/wma_scan_roam.c
@@ -1065,6 +1065,7 @@ wma_roam_scan_fill_ap_profile(struct roam_offload_scan_req *roam_req,
profile->rsn_mcastcipherset = WMI_CIPHER_NONE;
profile->rsn_mcastmgmtcipherset = WMI_CIPHER_NONE;
profile->rssi_threshold = WMA_ROAM_RSSI_DIFF_DEFAULT;
+ profile->bg_rssi_threshold = WMA_ROAM_RSSI_DIFF_DEFAULT;
return;
}
@@ -1100,6 +1101,7 @@ wma_roam_scan_fill_ap_profile(struct roam_offload_scan_req *roam_req,
roam_req->ConnectedNetwork.gp_mgmt_cipher_suite);
profile->rssi_threshold = roam_req->RoamRssiDiff;
+ profile->bg_rssi_threshold = roam_req->bg_rssi_threshold;
if (roam_req->rssi_abs_thresh)
profile->rssi_abs_thresh = roam_req->rssi_abs_thresh;
#ifdef WLAN_FEATURE_11W