qcacld-3.0: Do not allow sched scan command in monitor mode

Currently there is no check for the monitor mode
interface in sched scan start/stop commands.
Add a check for monitor mode in sched scan start/stop
commands and do not allow sched scan stop in case of
monitor mode.

Change-Id: I316c3156c25a9b6e9c3d35aaca174a4f1f03f8f9
CRs-fixed: 2530755
This commit is contained in:
Ashish Kumar Dhanotiya 2019-10-22 20:07:34 +05:30 • committed by nshrivas
commit 96b4c94294

View file

@ -1289,11 +1289,15 @@ static int __wlan_hdd_cfg80211_sched_scan_start(struct wiphy *wiphy,
bool pno_offload_enabled;
uint8_t scan_backoff_multiplier;
bool enable_connected_scan;
enum QDF_GLOBAL_MODE curr_mode;
hdd_enter();
if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
hdd_err("Command not allowed in FTM mode");
curr_mode = hdd_get_conparam();
if (QDF_GLOBAL_FTM_MODE == curr_mode ||
QDF_GLOBAL_MONITOR_MODE == curr_mode) {
hdd_err_rl("Command not allowed in FTM/Monitor mode");
return -EINVAL;
}
@ -1418,11 +1422,15 @@ static int __wlan_hdd_cfg80211_sched_scan_stop(struct net_device *dev)
{
struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
int errno;
enum QDF_GLOBAL_MODE curr_mode;
hdd_enter();
if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
hdd_err_rl("Command not allowed in FTM mode");
curr_mode = hdd_get_conparam();
if (QDF_GLOBAL_FTM_MODE == curr_mode ||
QDF_GLOBAL_MONITOR_MODE == curr_mode) {
hdd_err_rl("Command not allowed in FTM/Monitor mode");
return -EINVAL;
}