diff --git a/components/mlme/core/src/wlan_mlme_main.c b/components/mlme/core/src/wlan_mlme_main.c index d0dc108f18..459d01fd46 100644 --- a/components/mlme/core/src/wlan_mlme_main.c +++ b/components/mlme/core/src/wlan_mlme_main.c @@ -2103,6 +2103,10 @@ static void mlme_init_lfr_cfg(struct wlan_objmgr_psoc *psoc, mlme_init_adaptive_11r_cfg(psoc, lfr); mlme_init_subnet_detection(psoc, lfr); lfr->rso_user_config.cat_rssi_offset = DEFAULT_RSSI_DB_GAP; + lfr->beaconloss_timeout_onwakeup = + cfg_get(psoc, CFG_LFR_BEACONLOSS_TIMEOUT_ON_WAKEUP); + lfr->beaconloss_timeout_onsleep = + cfg_get(psoc, CFG_LFR_BEACONLOSS_TIMEOUT_ON_SLEEP); } static void mlme_init_power_cfg(struct wlan_objmgr_psoc *psoc, diff --git a/components/mlme/dispatcher/inc/cfg_mlme_lfr.h b/components/mlme/dispatcher/inc/cfg_mlme_lfr.h index 99d1e1b9c5..0fa36ecbf5 100644 --- a/components/mlme/dispatcher/inc/cfg_mlme_lfr.h +++ b/components/mlme/dispatcher/inc/cfg_mlme_lfr.h @@ -1696,6 +1696,59 @@ CFG_VALUE_OR_DEFAULT, \ "Final beacon miss count") +/* + * + * BeaconLoss_TimeoutOnWakeUp - Consecutive Beaconloss timeout on wakeup to + * trigger timeout + * @Min: 0 + * @Max: 20 + * @Default: 6 + * + * This ini is used to control the beacon miss timeout when the system is awake. + * On the timeout, BMISS event will be triggered by FW. + * The units of this timeout is in seconds. + * + * Related: None + * + * Usage: External + * + * + */ +#define CFG_LFR_BEACONLOSS_TIMEOUT_ON_WAKEUP CFG_INI_UINT( \ + "ConBeaconLoss_TimeoutOnWakeUp", \ + 0, \ + 20, \ + 6, \ + CFG_VALUE_OR_DEFAULT, \ + "ConBeaconloss timeout on wakeup") + +/* + * + * BeaconLoss_TimeoutOnSleep - Consecutive Beaconloss timeout on sleep to + * trigger timeout + * @Min: 0 + * @Max: 20 + * @Default: 10 + * + * This ini is used to control the beacon miss timeout + * when the system is in sleep. + * On the timeout, BMISS event will be triggered by FW. + * The units of this timeout is in seconds. + * + * Related: None + * + * Usage: External + * + * + */ +#define CFG_LFR_BEACONLOSS_TIMEOUT_ON_SLEEP CFG_INI_UINT( \ + "ConBeaconLoss_TimeoutOnSleep", \ + 0, \ + 20, \ + 10, \ + CFG_VALUE_OR_DEFAULT, \ + "ConBeaconloss timeout on sleep") + /* * * gAllowDFSChannelRoam - Allow dfs channel in roam @@ -3105,6 +3158,8 @@ LFR_ESE_ALL \ LFR_SUBNET_DETECTION_ALL \ SAE_SINGLE_PMK_ALL \ - ROAM_REASON_VSIE_ALL + ROAM_REASON_VSIE_ALL \ + CFG(CFG_LFR_BEACONLOSS_TIMEOUT_ON_WAKEUP) \ + CFG(CFG_LFR_BEACONLOSS_TIMEOUT_ON_SLEEP) #endif /* CFG_MLME_LFR_H__ */ diff --git a/components/mlme/dispatcher/inc/wlan_mlme_api.h b/components/mlme/dispatcher/inc/wlan_mlme_api.h index d8de699c06..142a83dca9 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_api.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_api.h @@ -3120,6 +3120,28 @@ QDF_STATUS wlan_mlme_get_roam_bmiss_first_bcnt(struct wlan_objmgr_psoc *psoc, uint8_t *val); +/** + * wlan_mlme_get_bmiss_timeout_on_wakeup() - Get bmiss timeout + * @psoc: pointer to psoc object + * @val: Pointer to the value which will be filled for the caller + * + * Return: QDF Status + */ +QDF_STATUS +wlan_mlme_get_bmiss_timeout_on_wakeup(struct wlan_objmgr_psoc *psoc, + uint8_t *val); + +/** + * wlan_mlme_get_bmiss_timeout_on_sleep() - Get roam conbmiss timeout + * @psoc: pointer to psoc object + * @val: Pointer to the value which will be filled for the caller + * + * Return: QDF Status + */ +QDF_STATUS +wlan_mlme_get_bmiss_timeout_on_sleep(struct wlan_objmgr_psoc *psoc, + uint8_t *val); + /** * wlan_mlme_adaptive_11r_enabled() - check if adaptive 11r feature is enaled * or not diff --git a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h index 37d126c755..c24fa60bfa 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h @@ -1872,6 +1872,10 @@ struct fw_scan_channels { * @sae_single_pmk_feature_enabled: Contains value of ini * sae_single_pmk_feature_enabled * @rso_user_config: RSO user config + * @beaconloss_timeout_onwakeup: time in sec to configure FW BMISS event + * during wakeup. + * @beaconloss_timeout_onsleep: time in sec to configure FW BMISS event + * during sleep. */ struct wlan_mlme_lfr_cfg { bool mawc_roam_enabled; @@ -1991,6 +1995,8 @@ struct wlan_mlme_lfr_cfg { #endif struct rso_config_params rso_user_config; bool enable_ft_over_ds; + uint8_t beaconloss_timeout_onwakeup; + uint8_t beaconloss_timeout_onsleep; }; /** diff --git a/components/mlme/dispatcher/src/wlan_mlme_api.c b/components/mlme/dispatcher/src/wlan_mlme_api.c index 760e705e3e..28809ed6e6 100644 --- a/components/mlme/dispatcher/src/wlan_mlme_api.c +++ b/components/mlme/dispatcher/src/wlan_mlme_api.c @@ -4876,6 +4876,40 @@ wlan_mlme_get_roam_bmiss_final_bcnt(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_SUCCESS; } +QDF_STATUS +wlan_mlme_get_bmiss_timeout_on_wakeup(struct wlan_objmgr_psoc *psoc, + uint8_t *val) +{ + struct wlan_mlme_psoc_ext_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_ext_obj(psoc); + if (!mlme_obj) { + *val = cfg_default(CFG_LFR_BEACONLOSS_TIMEOUT_ON_WAKEUP); + return QDF_STATUS_E_INVAL; + } + + *val = mlme_obj->cfg.lfr.beaconloss_timeout_onwakeup; + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS +wlan_mlme_get_bmiss_timeout_on_sleep(struct wlan_objmgr_psoc *psoc, + uint8_t *val) +{ + struct wlan_mlme_psoc_ext_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_ext_obj(psoc); + if (!mlme_obj) { + *val = cfg_default(CFG_LFR_BEACONLOSS_TIMEOUT_ON_SLEEP); + return QDF_STATUS_E_INVAL; + } + + *val = mlme_obj->cfg.lfr.beaconloss_timeout_onsleep; + + return QDF_STATUS_SUCCESS; +} + QDF_STATUS wlan_mlme_get_roam_bmiss_first_bcnt(struct wlan_objmgr_psoc *psoc, uint8_t *val) diff --git a/components/target_if/connection_mgr/src/target_if_cm_roam_offload.c b/components/target_if/connection_mgr/src/target_if_cm_roam_offload.c index 31ee27cb6b..cdcaa81fc6 100644 --- a/components/target_if/connection_mgr/src/target_if_cm_roam_offload.c +++ b/components/target_if/connection_mgr/src/target_if_cm_roam_offload.c @@ -286,6 +286,42 @@ target_if_cm_roam_scan_bmiss_cnt(wmi_unified_t wmi_handle, return status; } +/** + * target_if_cm_roam_scan_bmiss_timeout() - set conbmiss timeout to fw + * @wmi_handle: wmi handle + * @req: bmiss timeout parameters + * + * Set bmiss timeout to fw. + * + * Return: QDF status + */ +static QDF_STATUS +target_if_cm_roam_scan_bmiss_timeout(wmi_unified_t wmi_handle, + struct wlan_roam_bmiss_timeout *req) +{ + QDF_STATUS status; + uint32_t vdev_id; + uint8_t bmiss_timeout_onwakeup; + uint8_t bmiss_timeout_onsleep; + + vdev_id = req->vdev_id; + bmiss_timeout_onwakeup = req->bmiss_timeout_onwakeup; + bmiss_timeout_onsleep = req->bmiss_timeout_onsleep; + + target_if_debug("vdev_id %d bmiss_timeout_onwakeup: %dsec, bmiss_timeout_onsleep: %dsec", vdev_id, + bmiss_timeout_onwakeup, bmiss_timeout_onsleep); + + status = target_if_vdev_set_param(wmi_handle, vdev_id, + WMI_VDEV_PARAM_FINAL_BMISS_TIME_SEC, + bmiss_timeout_onwakeup); + + status = target_if_vdev_set_param(wmi_handle, vdev_id, + WMI_VDEV_PARAM_FINAL_BMISS_TIME_WOW_SEC, + bmiss_timeout_onsleep); + + return status; +} + #ifdef WLAN_FEATURE_ROAM_OFFLOAD /* target_if_cm_roam_reason_vsie(): set vdev param * WMI_VDEV_PARAM_ENABLE_DISABLE_ROAM_REASON_VSIE @@ -986,6 +1022,12 @@ target_if_cm_roam_send_start(struct wlan_objmgr_vdev *vdev, target_if_err("vdev set bmiss bcnt param failed"); goto end; } + status = target_if_cm_roam_scan_bmiss_timeout(wmi_handle, + &req->bmiss_timeout); + if (QDF_IS_STATUS_ERROR(status)) { + target_if_err("vdev set bmiss timeout param failed"); + goto end; + } target_if_cm_roam_reason_vsie(wmi_handle, &req->reason_vsie_enable); @@ -1381,6 +1423,13 @@ target_if_cm_roam_send_update_config(struct wlan_objmgr_vdev *vdev, goto end; } + status = target_if_cm_roam_scan_bmiss_timeout(wmi_handle, + &req->bmiss_timeout); + if (QDF_IS_STATUS_ERROR(status)) { + target_if_err("vdev set bmiss timeout param failed"); + goto end; + } + status = target_if_cm_roam_scan_filter(wmi_handle, ROAM_SCAN_OFFLOAD_UPDATE_CFG, &req->scan_filter_params); diff --git a/components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload.c b/components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload.c index 2cf241d800..910c1ed609 100644 --- a/components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload.c +++ b/components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload.c @@ -88,6 +88,31 @@ cm_roam_scan_bmiss_cnt(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, params->roam_bmiss_final_bcnt = beacon_miss_count; } +/** + * cm_roam_scan_bmiss_timeout() - set connection bmiss timeout + * @psoc: psoc pointer + * @vdev_id: vdev id + * @params: roam bmiss timeout parameters + * + * This function is used to set roam conbmiss timeout parameters + * + * Return: None + */ +static void +cm_roam_scan_bmiss_timeout(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, + struct wlan_roam_bmiss_timeout *params) +{ + uint8_t bmiss_timeout; + + params->vdev_id = vdev_id; + + wlan_mlme_get_bmiss_timeout_on_wakeup(psoc, &bmiss_timeout); + params->bmiss_timeout_onwakeup = bmiss_timeout; + + wlan_mlme_get_bmiss_timeout_on_sleep(psoc, &bmiss_timeout); + params->bmiss_timeout_onsleep = bmiss_timeout; +} + QDF_STATUS cm_roam_fill_rssi_change_params(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, struct wlan_roam_rssi_change_params *params) @@ -2787,6 +2812,7 @@ cm_roam_start_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, cm_roam_set_roam_reason_better_ap(psoc, vdev_id, false); /* fill from mlme directly */ cm_roam_scan_bmiss_cnt(psoc, vdev_id, &start_req->beacon_miss_cnt); + cm_roam_scan_bmiss_timeout(psoc, vdev_id, &start_req->bmiss_timeout); cm_roam_reason_vsie(psoc, vdev_id, &start_req->reason_vsie_enable); cm_roam_triggers(psoc, vdev_id, &start_req->roam_triggers); cm_roam_fill_rssi_change_params(psoc, vdev_id, @@ -2873,6 +2899,7 @@ cm_roam_update_config_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, /* fill from mlme directly */ cm_roam_scan_bmiss_cnt(psoc, vdev_id, &update_req->beacon_miss_cnt); + cm_roam_scan_bmiss_timeout(psoc, vdev_id, &update_req->bmiss_timeout); cm_roam_fill_rssi_change_params(psoc, vdev_id, &update_req->rssi_change_params); if (MLME_IS_ROAM_STATE_RSO_ENABLED(psoc, vdev_id)) { 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 98a1451553..b33ee0494a 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 @@ -1602,6 +1602,18 @@ struct wlan_roam_beacon_miss_cnt { uint8_t roam_bmiss_final_bcnt; }; +/** + * struct wlan_roam_bmiss_timeout - roam beacon miss timeout + * @vdev_id: vdev id + * @bmiss_timeout_onwakeup : timeout on wakeup in seconds + * @bmiss_timeout_onsleep : timeout on sleep in seconds + */ +struct wlan_roam_bmiss_timeout { + uint32_t vdev_id; + uint8_t bmiss_timeout_onwakeup; + uint8_t bmiss_timeout_onsleep; +}; + /** * struct wlan_roam_reason_vsie_enable - roam reason vsie enable parameters * @vdev_id: vdev id @@ -1696,6 +1708,7 @@ enum roam_rt_stats_params { * roam start config * @rssi_params: roam scan rssi threshold parameters * @beacon_miss_cnt: roam beacon miss count parameters + * @bmiss_timeout: roam consecutive beaconloss timeout parameters * @reason_vsie_enable: roam reason vsie enable parameters * @roam_triggers: roam triggers parameters * @scan_period_params: roam scan period parameters @@ -1714,6 +1727,7 @@ enum roam_rt_stats_params { struct wlan_roam_start_config { struct wlan_roam_offload_scan_rssi_params rssi_params; struct wlan_roam_beacon_miss_cnt beacon_miss_cnt; + struct wlan_roam_bmiss_timeout bmiss_timeout; struct wlan_roam_reason_vsie_enable reason_vsie_enable; struct wlan_roam_triggers roam_triggers; struct wlan_roam_scan_period_params scan_period_params; @@ -1767,6 +1781,7 @@ struct wlan_roam_stop_config { * struct wlan_roam_update_config - structure containing parameters for * roam update config * @beacon_miss_cnt: roam beacon miss count parameters + * @bmiss_timeout: roam scan bmiss timeout parameters * @scan_filter_params: roam scan filter parameters * @scan_period_params: roam scan period parameters * @rssi_change_params: roam scan rssi change parameters @@ -1781,6 +1796,7 @@ struct wlan_roam_stop_config { */ struct wlan_roam_update_config { struct wlan_roam_beacon_miss_cnt beacon_miss_cnt; + struct wlan_roam_bmiss_timeout bmiss_timeout; struct wlan_roam_scan_filter_params scan_filter_params; struct wlan_roam_scan_period_params scan_period_params; struct wlan_roam_rssi_change_params rssi_change_params;