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
Cette révision appartient à :
Sheenam Monga
2022-10-28 11:01:13 +05:30
révisé par Madan Koyyalamudi
Parent d7ce2c63fe
révision 26ee5aa617

Voir le fichier

@@ -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.