From 26ee5aa617179765c49d2147c56dbd370661f80a Mon Sep 17 00:00:00 2001 From: Sheenam Monga Date: Fri, 28 Oct 2022 11:01:13 +0530 Subject: [PATCH] qcacld-3.0: Don't allow SR operation in disconnected state Currently, SR enable can be set even if sta is not connected to AP due to which success is returned to userspace but command is not sent to FW. Fix is to not to entertain any SR operation if station is not connected or connected AP is not supporting SR. Change-Id: Ie46e5f4db12a1ecf8eea44847a97355f26163ed8 CRs-Fixed: 3321577 --- core/hdd/src/wlan_hdd_he.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/hdd/src/wlan_hdd_he.c b/core/hdd/src/wlan_hdd_he.c index 7de0213c39..3b3d162ac7 100644 --- a/core/hdd/src/wlan_hdd_he.c +++ b/core/hdd/src/wlan_hdd_he.c @@ -610,6 +610,16 @@ static int __wlan_hdd_cfg80211_sr_operations(struct wiphy *wiphy, hdd_err("Command not allowed in FTM or Monitor mode"); return -EPERM; } + + sr_ctrl = wlan_vdev_mlme_get_sr_ctrl(adapter->vdev); + if ((adapter->device_mode == QDF_STA_MODE) && + (!ucfg_cm_is_vdev_connected(adapter->vdev) || + !(sr_ctrl && ((sr_ctrl & NON_SRG_PD_SR_DISALLOWED) || + !(sr_ctrl & SRG_INFO_PRESENT))))) { + hdd_err("station is not connected to AP that supports SR"); + return -EPERM; + } + /** * Reject command if SR concurrency is not allowed and * only STA mode is set in ini to enable SR.