diff --git a/components/mlme/core/src/wlan_mlme_main.c b/components/mlme/core/src/wlan_mlme_main.c index c14ac20d84b4..99887aaa8a5d 100644 --- a/components/mlme/core/src/wlan_mlme_main.c +++ b/components/mlme/core/src/wlan_mlme_main.c @@ -1458,6 +1458,19 @@ static void mlme_init_roam_offload_cfg(struct wlan_objmgr_psoc *psoc, { lfr->lfr3_roaming_offload = cfg_get(psoc, CFG_LFR3_ROAMING_OFFLOAD); + + lfr->enable_disconnect_roam_offload = + cfg_get(psoc, CFG_LFR_ENABLE_DISCONNECT_ROAM); + lfr->enable_idle_roam = + cfg_get(psoc, CFG_LFR_ENABLE_IDLE_ROAM); + lfr->idle_roam_rssi_delta = + cfg_get(psoc, CFG_LFR_IDLE_ROAM_RSSI_DELTA); + lfr->idle_roam_inactive_time = + cfg_get(psoc, CFG_LFR_IDLE_ROAM_INACTIVE_TIME); + lfr->idle_data_packet_count = + cfg_get(psoc, CFG_LFR_IDLE_ROAM_PACKET_COUNT); + lfr->idle_roam_min_rssi = cfg_get(psoc, CFG_LFR_IDLE_ROAM_MIN_RSSI); + lfr->idle_roam_band = cfg_get(psoc, CFG_LFR_IDLE_ROAM_BAND); } #else diff --git a/components/mlme/dispatcher/inc/cfg_mlme_lfr.h b/components/mlme/dispatcher/inc/cfg_mlme_lfr.h index 4b967fc76bf8..0273168c1af4 100644 --- a/components/mlme/dispatcher/inc/cfg_mlme_lfr.h +++ b/components/mlme/dispatcher/inc/cfg_mlme_lfr.h @@ -1971,7 +1971,9 @@ * WMI_ROAM_TRIGGER_REASON_BTM - 10 * WMI_ROAM_TRIGGER_REASON_UNIT_TEST - 11 * WMI_ROAM_TRIGGER_REASON_BSS_LOAD - 12 - * WMI_ROAM_TRIGGER_REASON_MAX - 13 + * WMI_ROAM_TRIGGER_REASON_DEAUTH - 13 + * WMI_ROAM_TRIGGER_REASON_IDLE - 14 + * WMI_ROAM_TRIGGER_REASON_MAX - 15 * * For Ex: 0xDA (PER, LOW_RSSI, HIGH_RSSI, MAWC, DENSE) * @@ -2061,7 +2063,208 @@ 1, \ "enable roam offload") -#define ROAM_OFFLOAD_ALL CFG(CFG_LFR3_ROAMING_OFFLOAD) +/* + * + * enable_disconnect_roam_offload - Enable/Disable emergency roaming during + * deauth/disassoc + * @Min: 0 - Disabled + * @Max: 1 - Enabled + * @Default: 1 + * + * When this ini is enabled firmware will trigger roam scan and roam to a new ap + * if candidate is found and it will not send the deauth/disassoc frame to + * the host driver. + * If roaming fails after this deauth, then firmware will send + * WMI_ROAM_REASON_DEAUTH event to the host. If roaming is successful, driver + * follows the normal roam synch event path. + * + * Supported Feature: Roaming + * + * Usage: Internal/External + * + * + */ +#define CFG_LFR_ENABLE_DISCONNECT_ROAM CFG_INI_BOOL( \ + "enable_disconnect_roam_offload", \ + true, \ + "Enable/Disable roaming on deauth/disassoc from AP") + +/* + * + * enable_idle_roam - Enable/Disable idle roaming + * @Min: 0 - Disabled + * @Max: 1 - Enabled + * @Default: 0 + * + * When this ini is enabled firmware will trigger roam scan and roam to a new + * ap if current connected AP rssi falls below the threshold. To consider the + * connection as idle, the following conditions should be met if this ini + * "enable_idle_roam" is enabled: + * 1. User space sends "SET SUSPENDMODE" command with value 0. + * 2. No TX/RX data for idle time configured via ini "idle_roam_inactive_time". + * 3. Connected AP rssi change doesn't exceed a specific delta value. + * (configured via ini idle_roam_rssi_delta) + * 4. Connected AP rssi falls below minimum rssi (configured via ini + * "idle_roam_min_rssi"). + * + * Supported Feature: Roaming + * + * Usage: Internal/External + * + * + */ +#define CFG_LFR_ENABLE_IDLE_ROAM CFG_INI_BOOL( \ + "enable_idle_roam", \ + false, \ + "Enable/Disable idle roam") + +/* + * + * idle_roam_rssi_delta - This threshold is the criteria to decide whether DUT + * is idle or moving. If rssi delta is more than configured thresold then its + * considered as not idle. RSSI delta is entered in dBm. Idle roaming can be + * triggered if the connected AP rssi change exceeds or falls below the + * rssi delta and if other criteria of ini "enable_idle_roam" is met + * @Min: 0 + * @Max: 50 + * @Default: 5 + * + * Related: enable_idle_roam + * + * Supported Feature: Roaming + * + * Usage: Internal/External + * + * + */ +#define CFG_LFR_IDLE_ROAM_RSSI_DELTA CFG_INI_UINT( \ + "idle_roam_rssi_delta", \ + 0, \ + 50, \ + 5, \ + CFG_VALUE_OR_DEFAULT, \ + "Configure RSSI delta to start idle roam") + +/* + * + * idle_roam_inactive_time - Time duration in millseconds for which the + * connection is idle. + * @Min: 0 + * @Max: 0xFFFFFFFF + * @Default: 10000 + * + * This ini is used to configure the time in seconds for which the connection + * candidate is idle and after which idle roam scan can be triggered if + * other criteria of ini "enable_idle_roam" is met. + * + * Related: enable_idle_roam + * + * Supported Feature: Roaming + * + * Usage: Internal/External + * + * + */ +#define CFG_LFR_IDLE_ROAM_INACTIVE_TIME CFG_INI_UINT( \ + "idle_roam_inactive_time", \ + 0, \ + 0xFFFFFFFF, \ + 10000, \ + CFG_VALUE_OR_DEFAULT, \ + "Configure RSSI delta to start idle roam") + +/* + * + * idle_data_packet_count - No of tx/rx packets above which the connection is + * not idle. + * @Min: 0 + * @Max: 0xFFFFFFFF + * @Default: 10 + * + * This ini is used to configure the acceptable number of tx/rx packets below + * which the connection is idle. Ex: If idle_data_packet_count is 10 + * and if the tx/rx packet count is less than 10, the connection is + * idle. If there are more than 10 packets, the connection is active one. + * + * Related: enable_idle_roam + * + * Supported Feature: Roaming + * + * Usage: Internal/External + * + * + */ +#define CFG_LFR_IDLE_ROAM_PACKET_COUNT CFG_INI_UINT( \ + "idle_data_packet_count", \ + 0, \ + 0xFFFFFFFF, \ + 10, \ + CFG_VALUE_OR_DEFAULT, \ + "Configure idle packet count") + +/* + * + * idle_roam_min_rssi - Minimum RSSI of connected AP, below which + * idle roam scan can be triggered if other criteria of ini "enable_idle_roam" + * is met. + * @Min: -96 + * @Max: 0 + * @Default: -65 + * + * Related: enable_idle_roam + * + * Supported Feature: Roaming + * + * Usage: Internal/External + * + * + */ +#define CFG_LFR_IDLE_ROAM_MIN_RSSI CFG_INI_INT( \ + "idle_roam_min_rssi", \ + -96, \ + 0, \ + -65, \ + CFG_VALUE_OR_DEFAULT, \ + "Configure idle roam minimum RSSI") + +/* + * + * idle_roam_band - Band on which idle roam scan will be + * enabled + * @Min: 0 + * @Max: 2 + * @Default: 0 + * + * Value 0 - Allow idle roam on both bands + * Value 1 - Allow idle roam only on 2G band + * Value 2 - Allow idle roam only on 5G band + * + * Related: enable_idle_roam + * + * Supported Feature: Roaming + * + * Usage: Internal/External + * + * + */ +#define CFG_LFR_IDLE_ROAM_BAND CFG_INI_UINT( \ + "idle_roam_band", \ + 0, \ + 2, \ + 0, \ + CFG_VALUE_OR_DEFAULT, \ + "Band on which idle roam needs to be enabled") + +#define ROAM_OFFLOAD_ALL \ + CFG(CFG_LFR3_ROAMING_OFFLOAD) \ + CFG(CFG_LFR_ENABLE_DISCONNECT_ROAM) \ + CFG(CFG_LFR_ENABLE_IDLE_ROAM) \ + CFG(CFG_LFR_IDLE_ROAM_RSSI_DELTA) \ + CFG(CFG_LFR_IDLE_ROAM_INACTIVE_TIME) \ + CFG(CFG_LFR_IDLE_ROAM_PACKET_COUNT) \ + CFG(CFG_LFR_IDLE_ROAM_MIN_RSSI) \ + CFG(CFG_LFR_IDLE_ROAM_BAND) \ + #else #define ROAM_OFFLOAD_ALL #endif diff --git a/components/mlme/dispatcher/inc/cfg_mlme_scoring.h b/components/mlme/dispatcher/inc/cfg_mlme_scoring.h index b7e436fcdece..bac6cba6db6d 100644 --- a/components/mlme/dispatcher/inc/cfg_mlme_scoring.h +++ b/components/mlme/dispatcher/inc/cfg_mlme_scoring.h @@ -984,6 +984,8 @@ * ROAM_TRIGGER_REASON_BTM - B10, * ROAM_TRIGGER_REASON_UNIT_TEST - B11, * ROAM_TRIGGER_REASON_BSS_LOAD - B12 + * ROAM_TRIGGER_REASON_DISASSOC - B13 + * ROAM_TRIGGER_REASON_IDLE_ROAM - B14 * * When the bit corresponding to a particular roam trigger reason * is set, the value of "roam_score_delta" is expected over the diff --git a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h index 166520755b6c..3f4508990719 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h @@ -1259,6 +1259,16 @@ struct bss_load_trigger { * @mawc_roam_enabled: Enable/Disable MAWC during roaming * @enable_fast_roam_in_concurrency:Enable LFR roaming on STA during concurrency * @lfr3_roaming_offload: Enable/disable roam offload feature + * @enable_disconnect_roam_offload: enable disassoc/deauth roam scan. + * @enable_idle_roam: flag to enable/disable idle roam in fw + * @idle_roam_rssi_delta: rssi delta of connected ap which is used to + * identify if the AP is idle or in motion + * @idle_roam_inactive_time: Timeout value in seconds, above which the + * connection is idle + * @idle_data_packet_count: data packet count measured during inactive time, + * below which the connection is idle. + * @idle_roam_min_rssi: Minimum rssi of connected AP to be considered for + * idle roam trigger. * @early_stop_scan_enable: Set early stop scan * @enable_5g_band_pref: Enable preference for 5G from INI * @ese_enabled: Enable ESE feature @@ -1340,6 +1350,13 @@ struct wlan_mlme_lfr_cfg { bool enable_fast_roam_in_concurrency; #ifdef WLAN_FEATURE_ROAM_OFFLOAD bool lfr3_roaming_offload; + bool enable_disconnect_roam_offload; + bool enable_idle_roam; + uint32_t idle_roam_rssi_delta; + uint32_t idle_roam_inactive_time; + uint32_t idle_data_packet_count; + uint32_t idle_roam_band; + int32_t idle_roam_min_rssi; #endif bool early_stop_scan_enable; bool enable_5g_band_pref;