From e10cc0fc380588468d5ac5a8b384d5347904e8bc Mon Sep 17 00:00:00 2001 From: Hariharan Basuthkar Date: Mon, 16 Mar 2020 10:55:24 +0530 Subject: [PATCH] qcacmn: Remove opmode check for WIN in vdev_mgr_start_param_update When staDFSEn option is enabled in the UCI, radar detection fails on a STA VAP. In the function vdev_mgr_start_param_update,since there is a condition check for QDF_SAP_MODE and QDF_P2P_GO_MODE, the tgt_dfs_set_current_channel_for_freq function does not get calledin case of STA opmode. As a result, DFS flag does not get set for the dfs->dfs_curchan, and DFS_RADAR_EN flag does not get set for dfs->dfs_proc_phyerr. Therefore, within the function dfs_process_phyerr, the function returns without processing the radar pulses. To fix this issue, add a new function vdev_mgr_check_opmode_and_des_chan_freq under a macro QCA_MCL_DFS_SUPPORT. If QCA_MCL_DFS_SUPPORT is defined, check the opmode of the vdev, and frequency band of des_chan_freq. If QCA_MCL_DFS_SUPPORT is not defined, return true. Change-Id: I66fe3d4ccc0b75b70652b04f9bf93b199268f1fa CRs-Fixed: 2640208 --- umac/mlme/vdev_mgr/core/src/vdev_mgr_ops.c | 30 +++++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/umac/mlme/vdev_mgr/core/src/vdev_mgr_ops.c b/umac/mlme/vdev_mgr/core/src/vdev_mgr_ops.c index 58957961400d..24387987e06f 100644 --- a/umac/mlme/vdev_mgr/core/src/vdev_mgr_ops.c +++ b/umac/mlme/vdev_mgr/core/src/vdev_mgr_ops.c @@ -90,6 +90,30 @@ QDF_STATUS vdev_mgr_create_send(struct vdev_mlme_obj *mlme_obj) return status; } +#ifdef QCA_MCL_DFS_SUPPORT +static bool vdev_mgr_is_opmode_sap_or_p2p_go(enum QDF_OPMODE op_mode) +{ + return (op_mode == QDF_SAP_MODE || op_mode == QDF_P2P_GO_MODE); +} + +static bool vdev_mgr_is_49G_5G_6G_chan_freq(uint16_t chan_freq) +{ + return WLAN_REG_IS_5GHZ_CH_FREQ(chan_freq) || + WLAN_REG_IS_49GHZ_FREQ(chan_freq) || + WLAN_REG_IS_6GHZ_CHAN_FREQ(chan_freq); +} +#else +static inline bool vdev_mgr_is_opmode_sap_or_p2p_go(enum QDF_OPMODE op_mode) +{ + return true; +} + +static inline bool vdev_mgr_is_49G_5G_6G_chan_freq(uint16_t chan_freq) +{ + return true; +} +#endif + static QDF_STATUS vdev_mgr_start_param_update( struct vdev_mlme_obj *mlme_obj, struct vdev_start_params *param) @@ -123,10 +147,8 @@ static QDF_STATUS vdev_mgr_start_param_update( param->vdev_id = wlan_vdev_get_id(vdev); op_mode = wlan_vdev_mlme_get_opmode(vdev); - if ((op_mode == QDF_SAP_MODE || op_mode == QDF_P2P_GO_MODE) && - (WLAN_REG_IS_5GHZ_CH_FREQ(des_chan->ch_freq) || - WLAN_REG_IS_49GHZ_FREQ(des_chan->ch_freq) || - WLAN_REG_IS_6GHZ_CHAN_FREQ(des_chan->ch_freq))) + if (vdev_mgr_is_opmode_sap_or_p2p_go(op_mode) && + vdev_mgr_is_49G_5G_6G_chan_freq(des_chan->ch_freq)) tgt_dfs_set_current_channel_for_freq(pdev, des_chan->ch_freq, des_chan->ch_flags, des_chan->ch_flagext,