From 6b309b7dbe5e31ffcadd437c29dda627bd5a9558 Mon Sep 17 00:00:00 2001 From: Ananya Barat Date: Tue, 22 Dec 2020 14:54:34 +0530 Subject: [PATCH] qcacmn: Enable STA DFS in F/W If STA DFS is enabled before vdev creation through etc/config/wireless then VDEV START is sent to F/W as a part of the normal flow to bring the VAP up. However, if STA DFS is enabled/disabled on the fly for a running VAP then do a VDEV STOP, followed by a VDEV START of the STA VAP and set/unset WMI_CHAN_FLAG_STA_DFS flag in VDEV start. Change-Id: I032ffa53d89eaafcb43c648670af3b3f2134561f CRs-Fixed: 2843248 --- umac/dfs/dispatcher/src/wlan_dfs_tgt_api.c | 4 +++- umac/mlme/vdev_mgr/core/src/vdev_mgr_ops.c | 4 +++- .../vdev_mgr/dispatcher/inc/wlan_vdev_mgr_tgt_if_tx_defs.h | 6 ++++-- wmi/src/wmi_unified_tlv.c | 3 +++ 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/umac/dfs/dispatcher/src/wlan_dfs_tgt_api.c b/umac/dfs/dispatcher/src/wlan_dfs_tgt_api.c index 0cca39620e..1f9af4f826 100644 --- a/umac/dfs/dispatcher/src/wlan_dfs_tgt_api.c +++ b/umac/dfs/dispatcher/src/wlan_dfs_tgt_api.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved. * * * Permission to use, copy, modify, and/or distribute this software for @@ -51,6 +51,8 @@ wlan_psoc_get_dfs_txops(struct wlan_objmgr_psoc *psoc) return &tx_ops->dfs_tx_ops; } +qdf_export_symbol(wlan_psoc_get_dfs_txops); + bool tgt_dfs_is_pdev_5ghz(struct wlan_objmgr_pdev *pdev) { struct wlan_lmac_if_dfs_tx_ops *dfs_tx_ops; 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 32a1e3676c..7ed68e2d05 100644 --- a/umac/mlme/vdev_mgr/core/src/vdev_mgr_ops.c +++ b/umac/mlme/vdev_mgr/core/src/vdev_mgr_ops.c @@ -121,7 +121,7 @@ static QDF_STATUS vdev_mgr_start_param_update( { struct wlan_channel *des_chan; uint32_t dfs_reg; - bool set_agile = false, dfs_set_cfreq2 = false; + bool set_agile = false, dfs_set_cfreq2 = false, is_stadfs_en = false; struct wlan_objmgr_vdev *vdev; struct wlan_objmgr_pdev *pdev; enum QDF_OPMODE op_mode; @@ -174,6 +174,8 @@ static QDF_STATUS vdev_mgr_start_param_update( utils_dfs_agile_sm_deliver_evt(pdev, DFS_AGILE_SM_EV_AGILE_STOP); + is_stadfs_en = tgt_dfs_is_stadfs_enabled(pdev); + param->channel.is_stadfs_en = is_stadfs_en; param->beacon_interval = mlme_obj->proto.generic.beacon_interval; param->dtim_period = mlme_obj->proto.generic.dtim_period; param->disable_hw_ack = mlme_obj->mgmt.generic.disable_hw_ack; diff --git a/umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_tgt_if_tx_defs.h b/umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_tgt_if_tx_defs.h index 12c449f8d1..d311131bb7 100644 --- a/umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_tgt_if_tx_defs.h +++ b/umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_tgt_if_tx_defs.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2019-2021 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -265,6 +265,7 @@ struct fils_discovery_tmpl_params { * @allow_ht: HT allowed in chan * @allow_vht: VHT allowed on chan * @set_agile: is agile mode + * @is_stadfs_en: STA DFS enabled * @phy_mode: phymode (vht80 or ht40 or ...) * @cfreq1: centre frequency on primary * @cfreq2: centre frequency on secondary @@ -285,7 +286,8 @@ struct mlme_channel_param { is_chan_passive:1, allow_ht:1, allow_vht:1, - set_agile:1; + set_agile:1, + is_stadfs_en:1; enum wlan_phymode phy_mode; uint32_t cfreq1; uint32_t cfreq2; diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index c8276570ca..b45f81bd03 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -1001,6 +1001,9 @@ static inline void copy_channel_info( if (req->channel.dfs_set_cfreq2) WMI_SET_CHANNEL_FLAG(chan, WMI_CHAN_FLAG_DFS_CFREQ2); + if (req->channel.is_stadfs_en) + WMI_SET_CHANNEL_FLAG(chan, WMI_CHAN_FLAG_STA_DFS); + /* According to firmware both reg power and max tx power * on set channel power is used and set it to max reg * power from regulatory.