From ba7131dd8c023baa2e0ae4cddaa6a53a1aeb778a Mon Sep 17 00:00:00 2001 From: Abhinav Kumar Date: Wed, 6 May 2020 16:13:05 +0530 Subject: [PATCH] qcacld-3.0: Disable BTM offload to fw if peer support MBO/OCE If DUT connected to a non-PMF AP in MBO/OCE enabled network, STA should not initiate roaming due to BTM trigger. Fix is to enable BTM offload to firmware only if a peer support pmf in case of MBO/OCE connection. Change-Id: Ifee077fed2630242e7dc93e6d1a3915e592d4285 CRs-Fixed: 2678005 --- core/mac/inc/sir_api.h | 1 + core/sme/src/csr/csr_api_roam.c | 45 +++++++++++++++++++++------------ core/sme/src/csr/csr_api_scan.c | 3 +++ 3 files changed, 33 insertions(+), 16 deletions(-) diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index 147b74833c92c..daaa7f0b37a68 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -711,6 +711,7 @@ struct bss_description { #endif uint32_t assoc_disallowed; uint32_t adaptive_11r_ap; + uint32_t mbo_oce_enabled_ap; #if defined(WLAN_SAE_SINGLE_PMK) && defined(WLAN_FEATURE_ROAM_OFFLOAD) uint32_t is_single_pmk; #endif diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 0d166e5860c72..a174f6d05631e 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -18130,22 +18130,38 @@ void csr_rso_command_fill_11w_params(struct mac_context *mac_ctx, #endif /** - * csr_get_peer_pmf_status() - Get the PMF capability of peer + * csr_update_btm_offload_config() - Update btm config param to fw * @mac_ctx: Global mac ctx + * @command: Roam offload command + * @req_buf: roam offload scan request * @session: roam session * - * Return: True if PMF is enabled, false otherwise. + * Return: None */ -static bool csr_get_peer_pmf_status(struct mac_context *mac_ctx, - struct csr_roam_session *session) +static void csr_update_btm_offload_config(struct mac_context *mac_ctx, + uint8_t command, + struct roam_offload_scan_req *req_buf, + struct csr_roam_session *session) { struct wlan_objmgr_peer *peer; bool is_pmf_enabled; + req_buf->btm_offload_config = + mac_ctx->mlme_cfg->btm.btm_offload_config; + + /* Return if INI is disabled */ + if (!req_buf->btm_offload_config) + return; + + /* For RSO Stop Disable BTM offload to firmware */ + if (command == ROAM_SCAN_OFFLOAD_STOP) { + req_buf->btm_offload_config = 0; + return; + } if (!session->pConnectBssDesc) { sme_err("Connected Bss Desc is NULL"); - return false; + return; } peer = wlan_objmgr_get_peer(mac_ctx->psoc, @@ -18155,7 +18171,7 @@ static bool csr_get_peer_pmf_status(struct mac_context *mac_ctx, if (!peer) { sme_debug("Peer of peer_mac %pM not found", session->pConnectBssDesc->bssId); - return false; + return; } is_pmf_enabled = mlme_get_peer_pmf_status(peer); @@ -18163,7 +18179,12 @@ static bool csr_get_peer_pmf_status(struct mac_context *mac_ctx, sme_debug("get is_pmf_enabled %d for %pM", is_pmf_enabled, session->pConnectBssDesc->bssId); - return is_pmf_enabled; + /* If peer does not support PMF in case of OCE/MBO + * Connection, Disable BTM offload to firmware. + */ + if (session->pConnectBssDesc->mbo_oce_enabled_ap && + !is_pmf_enabled) + req_buf->btm_offload_config = 0; } /** @@ -18437,15 +18458,7 @@ csr_create_roam_scan_offload_request(struct mac_context *mac_ctx, req_buf->lca_config_params.num_disallowed_aps = mac_ctx->mlme_cfg->lfr.lfr3_num_disallowed_aps; - /* For RSO Stop or if peer does not support PMF, Disable BTM offload - * to firmware. - */ - if (command == ROAM_SCAN_OFFLOAD_STOP || - !csr_get_peer_pmf_status(mac_ctx, session)) - req_buf->btm_offload_config = 0; - else - req_buf->btm_offload_config = - mac_ctx->mlme_cfg->btm.btm_offload_config; + csr_update_btm_offload_config(mac_ctx, command, req_buf, session); req_buf->btm_solicited_timeout = mac_ctx->mlme_cfg->btm.btm_solicited_timeout; diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c index 74bd2a87ae490..99c92cfec3ca4 100644 --- a/core/sme/src/csr/csr_api_scan.c +++ b/core/sme/src/csr/csr_api_scan.c @@ -2394,6 +2394,9 @@ static QDF_STATUS csr_fill_bss_from_scan_entry(struct mac_context *mac_ctx, scan_entry); bss_desc->adaptive_11r_ap = scan_entry->adaptive_11r_ap; + bss_desc->mbo_oce_enabled_ap = + util_scan_entry_mbo_oce(scan_entry) ? true : false; + csr_fill_single_pmk_ap_cap_from_scan_entry(bss_desc, scan_entry); qdf_mem_copy(&bss_desc->mbssid_info, &scan_entry->mbssid_info,