From 26d9f36f90688241b435e5e95bd3032bfad34bfd Mon Sep 17 00:00:00 2001 From: Shashikala Prabhu Date: Thu, 24 May 2018 12:24:22 +0530 Subject: [PATCH] qcacmn: Do not print DFS error message for non 5 GHz pdev In Repeater AP scenario, when STA vap starts scan, it calls the registered DFS callback function to get the AP CAC status. For a 2 GHz pdev, dfs object is NULL and hence 'dfs is NULL' print is always seen when user enables the dfs error logs. Add non 5 GHz pdev check in dfs callback function before dfs NULL check. Change-Id: Id087d0b126996406f2b6e1b5b34b90a12a18a890 CRs-Fixed: 2245034 --- .../dispatcher/src/wlan_dfs_init_deinit_api.c | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/umac/dfs/dispatcher/src/wlan_dfs_init_deinit_api.c b/umac/dfs/dispatcher/src/wlan_dfs_init_deinit_api.c index 7203b873e96c..6e93ffb35e3e 100644 --- a/umac/dfs/dispatcher/src/wlan_dfs_init_deinit_api.c +++ b/umac/dfs/dispatcher/src/wlan_dfs_init_deinit_api.c @@ -385,6 +385,10 @@ static void dfs_scan_serialization_comp_info_cb( { struct wlan_dfs *dfs = NULL; struct wlan_objmgr_pdev *pdev; + struct wlan_lmac_if_dfs_tx_ops *dfs_tx_ops; + struct wlan_objmgr_psoc *psoc; + bool is_5ghz = false; + QDF_STATUS status; if (!comp_info) { dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS, "comp_info is NULL"); @@ -404,6 +408,27 @@ static void dfs_scan_serialization_comp_info_cb( comp_info->scan_info.is_cac_in_progress = false; + psoc = wlan_pdev_get_psoc(pdev); + if (!psoc) { + dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS, "null psoc"); + return; + } + + dfs_tx_ops = wlan_psoc_get_dfs_txops(psoc); + if (!(dfs_tx_ops && dfs_tx_ops->dfs_is_pdev_5ghz)) { + dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS, "dfs_tx_ops is null"); + return; + } + + status = dfs_tx_ops->dfs_is_pdev_5ghz(pdev, &is_5ghz); + if (QDF_IS_STATUS_ERROR(status)) { + dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS, "Failed to get is_5ghz value"); + return; + } + + if (!is_5ghz) + return; + dfs = wlan_pdev_get_dfs_obj(pdev); if (!dfs) { dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS, "dfs is NULL");