From a4e27271d97d3d706f29ef46d57ea5b3d238a690 Mon Sep 17 00:00:00 2001 From: bings Date: Wed, 23 Oct 2019 16:50:36 +0800 Subject: [PATCH] qcacld-3.0: Disable dfs phyerr offload when no sap/go in DFS channel As FW required, send WMI_PDEV_DFS_PHYERR_OFFLOAD_DISABLE_CMDID when there is no beaconing session in DFS channel for FW which supports dfs offload. Change-Id: Ib3c24758b81d6218d2504729d44cdbfb122933ee CRs-Fixed: 2544846 --- .../policy_mgr/inc/wlan_policy_mgr_api.h | 16 ++++++++ .../src/wlan_policy_mgr_get_set_utils.c | 38 +++++++++++++++++++ core/mac/src/pe/lim/lim_utils.c | 10 ++++- core/wma/src/wma_dev_if.c | 2 +- 4 files changed, 63 insertions(+), 3 deletions(-) diff --git a/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h b/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h index 88677edee8f5..e0161d1a78af 100644 --- a/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h +++ b/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h @@ -682,6 +682,22 @@ bool policy_mgr_is_any_nondfs_chnl_present(struct wlan_objmgr_psoc *psoc, uint32_t policy_mgr_get_dfs_beaconing_session_id( struct wlan_objmgr_psoc *psoc); +/** + * policy_mgr_is_dfs_beaconing_present_except_vdev() - to find + * if any DFS session except the given vdev id + * @psoc: PSOC object information + * @ch_freq: pointer to channel frequency that needs to filled + * @vdev_id: vdev id + * + * If any beaconing session except given vdev id such as SAP or GO present and + * it is on DFS channel then this function will return true + * + * Return: true if session is on DFS or false if session is on non-dfs channel + */ +bool policy_mgr_is_dfs_beaconing_present_except_vdev( + struct wlan_objmgr_psoc *psoc, uint32_t *ch_freq, + uint8_t vdev_id); + /** * policy_mgr_is_any_dfs_beaconing_session_present() - to find * if any DFS session diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c index b71771901445..a79ac5c724dd 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c @@ -3015,6 +3015,44 @@ uint32_t policy_mgr_get_dfs_beaconing_session_id( return session_id; } +bool policy_mgr_is_dfs_beaconing_present_except_vdev( + struct wlan_objmgr_psoc *psoc, uint32_t *ch_freq, + uint8_t vdev_id) +{ + struct policy_mgr_conc_connection_info *conn_info; + bool status = false; + uint32_t conn_index = 0; + struct policy_mgr_psoc_priv_obj *pm_ctx; + struct policy_mgr_conc_connection_info info; + uint8_t num_cxn_del; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return false; + } + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + policy_mgr_store_and_del_conn_info_by_vdev_id( + psoc, vdev_id, &info, &num_cxn_del); + + for (conn_index = 0; conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS; + conn_index++) { + conn_info = &pm_conc_connection_list[conn_index]; + if (conn_info->in_use && + wlan_reg_is_dfs_for_freq(pm_ctx->pdev, conn_info->freq) && + (conn_info->mode == PM_SAP_MODE || + conn_info->mode == PM_P2P_GO_MODE)) { + *ch_freq = pm_conc_connection_list[conn_index].freq; + status = true; + } + } + if (num_cxn_del) + policy_mgr_restore_deleted_conn_info(psoc, &info, num_cxn_del); + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + + return status; +} + bool policy_mgr_is_any_dfs_beaconing_session_present( struct wlan_objmgr_psoc *psoc, uint32_t *ch_freq) { diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c index d475587e5988..d73567df6424 100644 --- a/core/mac/src/pe/lim/lim_utils.c +++ b/core/mac/src/pe/lim/lim_utils.c @@ -8068,6 +8068,7 @@ QDF_STATUS lim_ap_mlme_vdev_stop_send(struct vdev_mlme_obj *vdev_mlme, { struct pe_session *session = (struct pe_session *)data; QDF_STATUS status = QDF_STATUS_SUCCESS; + uint32_t ap_dfs_ch_freq; if (!data) { pe_err("data is NULL"); @@ -8075,10 +8076,15 @@ QDF_STATUS lim_ap_mlme_vdev_stop_send(struct vdev_mlme_obj *vdev_mlme, } if (LIM_IS_IBSS_ROLE(session) && - session->mac_ctx->lim.gLimIbssCoalescingHappened) + session->mac_ctx->lim.gLimIbssCoalescingHappened) { ibss_bss_delete(session->mac_ctx, session); - else + } else { + if (!policy_mgr_is_dfs_beaconing_present_except_vdev( + session->mac_ctx->psoc, &ap_dfs_ch_freq, session->vdev_id)) + tgt_dfs_radar_enable( + session->mac_ctx->pdev, 0, 0, false); status = lim_send_vdev_stop(session); + } return status; } diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c index 748ab7f0fb5a..ac15f6e97dca 100644 --- a/core/wma/src/wma_dev_if.c +++ b/core/wma/src/wma_dev_if.c @@ -1245,7 +1245,7 @@ QDF_STATUS wma_vdev_start_resp_handler(struct vdev_mlme_obj *vdev_mlme, } if (wma_is_vdev_in_ap_mode(wma, rsp->vdev_id)) - tgt_dfs_radar_enable(wma->pdev, 0, 0); + tgt_dfs_radar_enable(wma->pdev, 0, 0, true); if (rsp->status == QDF_STATUS_SUCCESS) { wma->interfaces[rsp->vdev_id].tx_streams =