Jelajahi Sumber

qcacld-3.0: Add monitor mode check for set_mon_chan command

Currently driver does not check for adapter mode when it receives
set mon chan command, which leads to unexpected behavior when it
receives set mon chan command for non monitor mode adapters.

To address above issue, add a check in driver to avoid set mon
chan command for non monitor mode adapters.

Change-Id: I04f4a0c76823beb10ebfae6489f894ba8a302627
CRs-Fixed: 3175969
Ashish 3 tahun lalu
induk
melakukan
a1854c8ba0
1 mengubah file dengan 5 tambahan dan 0 penghapusan
  1. 5 0
      core/hdd/src/wlan_hdd_main.c

+ 5 - 0
core/hdd/src/wlan_hdd_main.c

@@ -8765,6 +8765,11 @@ int wlan_hdd_set_mon_chan(struct hdd_adapter *adapter, qdf_freq_t freq,
 		return -EINVAL;
 	}
 
+	if (adapter->device_mode != QDF_MONITOR_MODE) {
+		hdd_err_rl("Not supported, adapter is not in monitor mode");
+		return -EINVAL;
+	}
+
 	/* Verify the BW before accepting this request */
 	ch_width = bandwidth;