From 3aae7a3cc09300975b76003c5f969d96dc375705 Mon Sep 17 00:00:00 2001 From: gaurank kathpalia Date: Thu, 9 Apr 2020 08:58:15 +0530 Subject: [PATCH] qcacld-3.0: Ignore CAC if STA already present Currently the driver sets the CAC required for SAP if it changes it channel to DFS, it issues a broadcast deauth to all clients, which leads to unwanted disconnection, which can be avoided if any STA if already connected to an AP on that channel. This is because there is already active TX going on that channel, so the SAP need not wait for CAC time to sense the medium. Fix is to check whether any STA vdev operating frequency matches with the target frequency of the SAP, and if it is true, then do not set the CAC required to true in SAP's vdev. Change-Id: I09dbecc1a4625cb51e6095f7579479413e525a74 CRs-Fixed: 2643790 --- core/sap/src/sap_module.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c index e01175ac453b..dd8f96defe8c 100644 --- a/core/sap/src/sap_module.c +++ b/core/sap/src/sap_module.c @@ -1683,6 +1683,9 @@ wlansap_set_cac_required_for_chan(struct mac_context *mac_ctx, bool is_ch_dfs = false; bool cac_required; uint32_t channel; + uint8_t vdev_id_list[MAX_NUMBER_OF_CONC_CONNECTIONS]; + uint32_t freq_list[MAX_NUMBER_OF_CONC_CONNECTIONS]; + uint8_t sta_cnt, i; channel = wlan_reg_freq_to_chan(mac_ctx->pdev, sap_ctx->chan_freq); @@ -1712,6 +1715,22 @@ wlansap_set_cac_required_for_chan(struct mac_context *mac_ctx, else cac_required = true; + if (cac_required) { + sta_cnt = + policy_mgr_get_mode_specific_conn_info(mac_ctx->psoc, + freq_list, + vdev_id_list, + PM_STA_MODE); + + for (i = 0; i < sta_cnt; i++) { + if (sap_ctx->chan_freq == freq_list[i]) { + sap_debug("STA vdev id %d exists, ignore CAC", + vdev_id_list[i]); + cac_required = false; + } + } + } + mlme_set_cac_required(sap_ctx->vdev, cac_required); }