From 52fe8ec124fb08f07dd77e9e41fea4c15afef0e8 Mon Sep 17 00:00:00 2001 From: Abhinav Kumar Date: Fri, 17 Apr 2020 10:14:34 +0530 Subject: [PATCH] qcacld-3.0: Disable BTM offload to fw if a peer doesn't support PMF If DUT connected to a non-PMF MBO/OCE enabled network, STA should not initiate roaming due to BTM trigger. If HOST disables BTM in firmware then firmware forwards frame to host and host forward it to supplicant. Supplicant ignores the BTM frame rather than send connect request to the driver. Fix is to disable BTM offload if a peer doesn't support PMF. Change-Id: I6455258c61bd3c2be7ec6c629b44d1aa08978740 CRs-Fixed: 2664896 --- core/sme/src/csr/csr_api_roam.c | 44 +++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 77b376b89b56..10b751675d81 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -18159,6 +18159,43 @@ void csr_rso_command_fill_11w_params(struct mac_context *mac_ctx, {} #endif +/** + * csr_get_peer_pmf_status() - Get the PMF capability of peer + * @mac_ctx: Global mac ctx + * @session: roam session + * + * Return: True if PMF is enabled, false otherwise. + */ +static bool csr_get_peer_pmf_status(struct mac_context *mac_ctx, + struct csr_roam_session *session) +{ + struct wlan_objmgr_peer *peer; + bool is_pmf_enabled; + + + if (!session->pConnectBssDesc) { + sme_err("Connected Bss Desc is NULL"); + return false; + } + + peer = wlan_objmgr_get_peer(mac_ctx->psoc, + wlan_objmgr_pdev_get_pdev_id(mac_ctx->pdev), + session->pConnectBssDesc->bssId, + WLAN_LEGACY_SME_ID); + if (!peer) { + sme_debug("Peer of peer_mac %pM not found", + session->pConnectBssDesc->bssId); + return false; + } + + is_pmf_enabled = mlme_get_peer_pmf_status(peer); + wlan_objmgr_peer_release_ref(peer, WLAN_LEGACY_SME_ID); + sme_debug("get is_pmf_enabled %d for %pM", is_pmf_enabled, + session->pConnectBssDesc->bssId); + + return is_pmf_enabled; +} + /** * csr_create_roam_scan_offload_request() - init roam offload scan request * @@ -18430,8 +18467,11 @@ 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, we need to notify FW to deinit BTM */ - if (command == ROAM_SCAN_OFFLOAD_STOP) + /* 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 =