From 30a378c5527f1a25fca82a52bd56af10fe31dc6b Mon Sep 17 00:00:00 2001 From: Srikanth Marepalli Date: Mon, 7 Jun 2021 20:11:21 +0530 Subject: [PATCH] qcacld-3.0: Don't send PCL command for P2P vdev Set PCL command should be sent to firmware only for STA mode. For P2P vdev, except the connected band, the other band channels are marked disallowed. With this, if the set PCL command is sent then STA can't roam to the disallowed channels. Hence don't send PCL command if the vdev opmode is not Station. Change-Id: I6c4917f75d5f14169e2c564d5f6deee819fb629a CRs-Fixed: 2939148 --- .../policy_mgr/src/wlan_policy_mgr_core.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c index 720184b178f5..4bb1820e3851 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c @@ -1404,8 +1404,22 @@ void policy_mgr_set_pcl_for_connected_vdev(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, bool clear_pcl) { struct policy_mgr_pcl_list msg = { {0} }; + struct wlan_objmgr_vdev *vdev; uint8_t roam_enabled_vdev_id; + vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id, + WLAN_POLICY_MGR_ID); + if (!vdev) { + policy_mgr_err("vdev is NULL"); + return; + } + + if (wlan_vdev_mlme_get_opmode(vdev) != QDF_STA_MODE) { + wlan_objmgr_vdev_release_ref(vdev, WLAN_POLICY_MGR_ID); + return; + } + wlan_objmgr_vdev_release_ref(vdev, WLAN_POLICY_MGR_ID); + /* * Get the vdev id of the STA on which roaming is already * initialized and set the vdev PCL for that STA vdev if dual