From 208ab01f20ab163f4f1bc59519b3c9eeffb481d1 Mon Sep 17 00:00:00 2001 From: bings Date: Tue, 13 Aug 2019 12:10:20 +0800 Subject: [PATCH] qcacmn: Trigger eWNI_SME_DFS_RADAR_FOUND once for one radar Currently eWNI_SME_DFS_RADAR_FOUND is triggered for every vdev attached to the pdev in which radar is found. It is incorrect because when handling one eWNI_SME_DFS_RADAR_FOUND event, every sap in the DFS channel processes the event. Trigger eWNI_SME_DFS_RADAR_FOUND once for one radar detection. Change-Id: I72f8a2a34b670bd86f07d0caabf2ee8f96c962be CRs-Fixed: 2504793 --- umac/dfs/dispatcher/src/wlan_dfs_mlme_api.c | 24 ++++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/umac/dfs/dispatcher/src/wlan_dfs_mlme_api.c b/umac/dfs/dispatcher/src/wlan_dfs_mlme_api.c index ef91942d5235..dac0e47a06c7 100644 --- a/umac/dfs/dispatcher/src/wlan_dfs_mlme_api.c +++ b/umac/dfs/dispatcher/src/wlan_dfs_mlme_api.c @@ -76,15 +76,19 @@ void dfs_mlme_mark_dfs(struct wlan_objmgr_pdev *pdev, uint8_t vhtop_ch_freq_seg2, uint64_t flags) { + struct wlan_objmgr_vdev *vdev; + if (!pdev) { dfs_err(NULL, WLAN_DEBUG_DFS_ALWAYS, "null pdev"); return; } - wlan_objmgr_pdev_iterate_obj_list(pdev, - WLAN_VDEV_OP, - dfs_send_radar_ind, - NULL, 0, WLAN_DFS_ID); + vdev = wlan_pdev_peek_active_first_vdev(pdev, WLAN_DFS_ID); + + if (vdev) { + dfs_send_radar_ind(pdev, vdev, NULL); + wlan_objmgr_vdev_release_ref(vdev, WLAN_DFS_ID); + } } #endif @@ -102,15 +106,19 @@ void dfs_mlme_start_csa(struct wlan_objmgr_pdev *pdev, uint8_t ieee_chan, uint16_t freq, uint8_t cfreq2, uint64_t flags) { + struct wlan_objmgr_vdev *vdev; + if (!pdev) { dfs_err(NULL, WLAN_DEBUG_DFS_ALWAYS, "null pdev"); return; } - wlan_objmgr_pdev_iterate_obj_list(pdev, - WLAN_VDEV_OP, - dfs_send_radar_ind, - NULL, 0, WLAN_DFS_ID); + vdev = wlan_pdev_peek_active_first_vdev(pdev, WLAN_DFS_ID); + + if (vdev) { + dfs_send_radar_ind(pdev, vdev, NULL); + wlan_objmgr_vdev_release_ref(vdev, WLAN_DFS_ID); + } } #endif