Ver Fonte

qcacld-3.0: Add support to enable/disable scan with reason code

Adds support to enable/disable scan for psoc/vdev with reason,
so that multiple clients can enable/disable the scan at same time.

Scan will remain disabled till all clients enable it back.

Change-Id: I693e223870142f831f8eefa59a9053960886bad6
CRs-Fixed: 2362098
Abhishek Singh há 6 anos atrás
pai
commit
935e4776f4

+ 8 - 1
core/hdd/src/wlan_hdd_cfg80211.c

@@ -5682,7 +5682,14 @@ __wlan_hdd_cfg80211_wifi_configuration_set(struct wiphy *wiphy,
 	if (tb[QCA_WLAN_VENDOR_ATTR_CONFIG_SCAN_ENABLE]) {
 		enable_flag =
 			nla_get_u8(tb[QCA_WLAN_VENDOR_ATTR_CONFIG_SCAN_ENABLE]);
-		sme_set_scan_disable(mac_handle, !enable_flag);
+
+		hdd_debug("scan enable %d", enable_flag);
+		if (enable_flag)
+			ucfg_scan_psoc_set_enable(hdd_ctx->psoc,
+						  REASON_USER_SPACE);
+		else
+			ucfg_scan_psoc_set_disable(hdd_ctx->psoc,
+						   REASON_USER_SPACE);
 	}
 
 	if (tb[QCA_WLAN_VENDOR_ATTR_CONFIG_QPOWER]) {

+ 1 - 1
core/hdd/src/wlan_hdd_main.c

@@ -4026,7 +4026,7 @@ int hdd_vdev_destroy(struct hdd_adapter *adapter)
 
 	ucfg_pmo_del_wow_pattern(vdev);
 	status = ucfg_reg_11d_vdev_delete_update(vdev);
-	ucfg_scan_set_vdev_del_in_progress(vdev);
+	ucfg_scan_vdev_set_disable(vdev, REASON_VDEV_DOWN);
 	hdd_objmgr_put_vdev(adapter);
 
 	/* close sme session (destroy vdev in firmware via legacy API) */

+ 5 - 2
core/hdd/src/wlan_hdd_wext.c

@@ -5099,10 +5099,13 @@ static int hdd_we_set_scan_disable(struct hdd_adapter *adapter, int value)
 
 	hdd_debug("%d", value);
 
-	if (!hdd_ctx->mac_handle)
+	if (!hdd_ctx->psoc)
 		return -EINVAL;
 
-	sme_set_scan_disable(hdd_ctx->mac_handle, value);
+	if (value)
+		ucfg_scan_psoc_set_disable(hdd_ctx->psoc, REASON_USER_SPACE);
+	else
+		ucfg_scan_psoc_set_enable(hdd_ctx->psoc, REASON_USER_SPACE);
 
 	return 0;
 }

+ 0 - 1
core/sme/inc/sme_api.h

@@ -1477,7 +1477,6 @@ QDF_STATUS sme_soc_set_dual_mac_config(struct policy_mgr_dual_mac_config msg);
 QDF_STATUS sme_soc_set_antenna_mode(mac_handle_t mac_handle,
 				    struct sir_antenna_mode_param *msg);
 
-void sme_set_scan_disable(mac_handle_t mac_handle, int value);
 void sme_setdef_dot11mode(mac_handle_t mac_handle);
 
 QDF_STATUS sme_handle_set_fcc_channel(mac_handle_t mac_handle,

+ 0 - 16
core/sme/src/common/sme_api.c

@@ -821,22 +821,6 @@ QDF_STATUS sme_set11dinfo(mac_handle_t mac_handle,
 	return status;
 }
 
-/**
- * sme_set_scan_disable() - Dynamically enable/disable scan
- * @mac_handle: Opaque handle to the global MAC context
- *
- * This command gives the user an option to dynamically
- * enable or disable scans.
- *
- * Return: None
- */
-void sme_set_scan_disable(mac_handle_t mac_handle, int value)
-{
-	struct mac_context *mac_ctx = MAC_CONTEXT(mac_handle);
-
-	sme_info("scan disable %d", value);
-	ucfg_scan_set_enable(mac_ctx->psoc, !value);
-}
 /*
  * sme_get_soft_ap_domain() - Get the current regulatory domain of softAp.
  * This is a synchronous call

+ 1 - 2
core/sme/src/csr/csr_api_roam.c

@@ -1243,7 +1243,6 @@ QDF_STATUS csr_start(struct mac_context *mac)
 		mac->scan.requester_id = ucfg_scan_register_requester(
 						mac->psoc,
 						"CSR", csr_scan_callback, mac);
-		ucfg_scan_set_enable(mac->psoc, true);
 	} while (0);
 	return status;
 }
@@ -1252,7 +1251,7 @@ QDF_STATUS csr_stop(struct mac_context *mac)
 {
 	uint32_t sessionId;
 
-	ucfg_scan_set_enable(mac->psoc, false);
+	ucfg_scan_psoc_set_disable(mac->psoc, REASON_SYSTEM_DOWN);
 	ucfg_scan_unregister_requester(mac->psoc, mac->scan.requester_id);
 
 	/*

+ 4 - 5
core/sme/src/csr/csr_api_scan.c

@@ -110,7 +110,8 @@ QDF_STATUS csr_scan_close(struct mac_context *mac)
 	csr_purge_channel_power(mac, &mac->scan.channelPowerInfoList5G);
 	csr_ll_close(&mac->scan.channelPowerInfoList24);
 	csr_ll_close(&mac->scan.channelPowerInfoList5G);
-	ucfg_scan_set_enable(mac->psoc, false);
+	ucfg_scan_psoc_set_disable(mac->psoc, REASON_SYSTEM_DOWN);
+
 	return QDF_STATUS_SUCCESS;
 }
 
@@ -1438,10 +1439,8 @@ QDF_STATUS csr_scan_for_ssid(struct mac_context *mac_ctx, uint32_t session_id,
 		return status;
 	}
 
-	if (!ucfg_scan_get_enable(mac_ctx->psoc) && (num_ssid != 1)) {
-		sme_err(
-			"cannot scan because scanEnable (%d) or numSSID (%d) is invalid",
-			ucfg_scan_get_enable(mac_ctx->psoc), profile->SSIDs.numOfSSIDs);
+	if (num_ssid != 1) {
+		sme_err("numSSID (%d) is invalid", profile->SSIDs.numOfSSIDs);
 		return status;
 	}