From 954abc7aa99265900a3932484ca717b189f4f325 Mon Sep 17 00:00:00 2001 From: gaurank kathpalia Date: Thu, 26 Mar 2020 22:14:15 +0530 Subject: [PATCH] qcacld-3.0: Add ini to enable/disable self roaming Currently the driver allows roaming to the BSSID which it is already connected, which can lead to many unexpected behaviour, for eg. if the SAP to which the DUT is connected turns off, then the DUT would try to roam to other BSSID of the same SSID, and in case the SAP turns on back in time, then the DUT would re-associate to the same BSSID. Now if the subnet may change, and since the DHCP does not happen again in roaming, it would then lead to NUD failure. Fix is to introduce an ini to allow/disallow roaming to the same BSSID. Change-Id: Ibd04fcd7384c0987db5bb6dae1a26ee077456290 CRs-Fixed: 2634860 --- components/mlme/core/src/wlan_mlme_main.c | 1 + components/mlme/dispatcher/inc/cfg_mlme_lfr.h | 23 +++++++++++++++++++ .../dispatcher/inc/wlan_mlme_public_struct.h | 2 ++ core/mac/inc/sir_api.h | 1 + core/sme/src/csr/csr_api_roam.c | 2 ++ core/wma/src/wma_scan_roam.c | 2 ++ 6 files changed, 31 insertions(+) diff --git a/components/mlme/core/src/wlan_mlme_main.c b/components/mlme/core/src/wlan_mlme_main.c index 21c14950095e..2e9b565f592e 100644 --- a/components/mlme/core/src/wlan_mlme_main.c +++ b/components/mlme/core/src/wlan_mlme_main.c @@ -1470,6 +1470,7 @@ 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_self_bss_roam = cfg_get(psoc, CFG_LFR3_ENABLE_SELF_BSS_ROAM); lfr->enable_roam_reason_vsie = cfg_get(psoc, CFG_ENABLE_ROAM_REASON_VSIE); lfr->enable_disconnect_roam_offload = diff --git a/components/mlme/dispatcher/inc/cfg_mlme_lfr.h b/components/mlme/dispatcher/inc/cfg_mlme_lfr.h index 2299c7daf875..fbf30d2ad318 100644 --- a/components/mlme/dispatcher/inc/cfg_mlme_lfr.h +++ b/components/mlme/dispatcher/inc/cfg_mlme_lfr.h @@ -2148,6 +2148,28 @@ 1, \ "enable roam offload") +/* + * + * enable_self_bss_roam - enable/disable roaming to self bss + * @Min: 0 + * @Max: 1 + * @Default: 1 + * + * This INI is used to enable/disable roaming to already connected BSSID + * + * Related: None + * + * Supported Feature: Roaming + * + * Usage: Internal + * + * + */ +#define CFG_LFR3_ENABLE_SELF_BSS_ROAM CFG_INI_BOOL( \ + "enable_self_bss_roam", \ + 0, \ + "enable self bss roam") + /* * * enable_disconnect_roam_offload - Enable/Disable emergency roaming during @@ -2414,6 +2436,7 @@ #define ROAM_OFFLOAD_ALL \ CFG(CFG_LFR3_ROAMING_OFFLOAD) \ + CFG(CFG_LFR3_ENABLE_SELF_BSS_ROAM) \ CFG(CFG_LFR_ENABLE_DISCONNECT_ROAM) \ CFG(CFG_LFR_ENABLE_IDLE_ROAM) \ CFG(CFG_LFR_IDLE_ROAM_RSSI_DELTA) \ diff --git a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h index afb73cc59d84..dbb225a45d97 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h @@ -1439,6 +1439,7 @@ 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_self_bss_roam: enable roaming to connected BSSID * @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 @@ -1548,6 +1549,7 @@ struct wlan_mlme_lfr_cfg { bool enable_fast_roam_in_concurrency; #ifdef WLAN_FEATURE_ROAM_OFFLOAD bool lfr3_roaming_offload; + bool enable_self_bss_roam; bool enable_disconnect_roam_offload; bool enable_idle_roam; uint32_t idle_roam_rssi_delta; diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index 7ecc26cacf45..85d2690716a5 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -2229,6 +2229,7 @@ struct roam_offload_scan_req { eSirDFSRoamScanMode allowDFSChannelRoam; #ifdef WLAN_FEATURE_ROAM_OFFLOAD uint8_t roam_offload_enabled; + bool enable_self_bss_roam; uint8_t PSK_PMK[SIR_ROAM_SCAN_PSK_SIZE]; uint32_t pmk_len; uint8_t Prefer5GHz; diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index bcb8205f20fb..e70663cbac05 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -17473,6 +17473,8 @@ csr_update_roam_scan_offload_request(struct mac_context *mac_ctx, if (!req_buf->roam_offload_enabled) return; + req_buf->enable_self_bss_roam = + mac_ctx->mlme_cfg->lfr.enable_self_bss_roam; req_buf->roam_triggers.vdev_id = session->vdev_id; req_buf->roam_triggers.trigger_bitmap = mlme_get_roam_trigger_bitmap(mac_ctx->psoc, session->vdev_id); diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c index 83e2e6abdf57..f59ff1cf8d4d 100644 --- a/core/wma/src/wma_scan_roam.c +++ b/core/wma/src/wma_scan_roam.c @@ -336,6 +336,8 @@ static void wma_roam_scan_offload_set_params( (roam_req->ConnectedNetwork.authentication, roam_req->ConnectedNetwork.encryption); + params->disable_self_roam = + !roam_req->enable_self_bss_roam; params->roam_offload_enabled = roam_req->roam_offload_enabled; params->roam_offload_params.ho_delay_for_rx = roam_req->ho_delay_for_rx;