Ver código fonte

qcacld-3.0: Reject scan request on NDI vdev

NDI does not need scan from userspace to establish connection
and it does not support scan request either. Hence reject scan
request on NDI vdev.

Change-Id: I58b0c899b6f1196f32a70e3f2c95d6ff839d4555
CRs-Fixed: 2115215
Naveen Rawat 7 anos atrás
pai
commit
1b91657a1d
2 arquivos alterados com 16 adições e 2 exclusões
  1. 5 0
      core/hdd/src/wlan_hdd_ext_scan.c
  2. 11 2
      core/hdd/src/wlan_hdd_scan.c

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

@@ -3144,6 +3144,11 @@ __wlan_hdd_cfg80211_extscan_start(struct wiphy *wiphy,
 		return -EPERM;
 	}
 
+	if (QDF_NDI_MODE == pAdapter->device_mode) {
+		hdd_err("Command not allowed for NDI interface");
+		return -EPERM;
+	}
+
 	retval = wlan_hdd_validate_context(hdd_ctx);
 	if (0 != retval)
 		return -EINVAL;

+ 11 - 2
core/hdd/src/wlan_hdd_scan.c

@@ -492,9 +492,13 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
 	 * IBSS connection. If IBSS vdev need to support scan,
 	 * Firmware need to make the change to add self peer
 	 * per mac for IBSS vdev.
+	 * NDI does not need scan from userspace to establish connection
+	 * and it does not support scan request either.
 	 */
-	if (QDF_IBSS_MODE == pAdapter->device_mode) {
-		hdd_err("Scan not supported for IBSS");
+	if (QDF_IBSS_MODE == pAdapter->device_mode ||
+	    QDF_NDI_MODE == pAdapter->device_mode) {
+		hdd_err("Scan not supported for %s",
+			hdd_device_mode_to_string(pAdapter->device_mode));
 		return -EINVAL;
 	}
 
@@ -1466,6 +1470,11 @@ static int __wlan_hdd_cfg80211_sched_scan_start(struct wiphy *wiphy,
 		return -EINVAL;
 	}
 
+	if (QDF_NDI_MODE == pAdapter->device_mode) {
+		hdd_err("Command not allowed for NDI interface");
+		return -EINVAL;
+	}
+
 	hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
 	ret = wlan_hdd_validate_context(hdd_ctx);