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
This commit is contained in:
@@ -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]) {
|
||||
|
@@ -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) */
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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,
|
||||
|
@@ -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
|
||||
|
@@ -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);
|
||||
|
||||
/*
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user