qcacld-3.0: Fix disable channel list command

Currently driver is using sap notify api of regulatory to
update channel list for disable channels list command
which is not the correct way as sap notify api is designed
to be used by sap releted operations.

To address above issue write a separate api for
disable channel list command.

Change-Id: If65c1f4226ced375b9abf3dcdbf21a70d4014e72
CRs-Fixed: 2872007
This commit is contained in:
Ashish Kumar Dhanotiya 2021-02-05 22:31:26 +05:30 • committed by snandini
commit 8611508e78
4 changed files with 9 additions and 15 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@ -783,12 +783,10 @@ int wlan_hdd_send_mode_change_event(void);
* wlan_hdd_restore_channels() - Restore the channels which were cached
* and disabled in wlan_hdd_disable_channels api.
* @hdd_ctx: Pointer to the HDD context
* @notify_sap_event: Indicates if SAP event needs to be notified
*
* Return: 0 on success, Error code on failure
*/
int wlan_hdd_restore_channels(struct hdd_context *hdd_ctx,
bool notify_sap_event);
int wlan_hdd_restore_channels(struct hdd_context *hdd_ctx);
/*
* wlan_hdd_send_sta_authorized_event: Function to send station authorized

View file

@ -4831,8 +4831,7 @@ static struct ieee80211_channel *wlan_hdd_get_wiphy_channel(
return wiphy_channel;
}
int wlan_hdd_restore_channels(struct hdd_context *hdd_ctx,
bool notify_sap_event)
int wlan_hdd_restore_channels(struct hdd_context *hdd_ctx)
{
struct hdd_cache_channels *cache_chann;
struct wiphy *wiphy;
@ -4888,10 +4887,8 @@ int wlan_hdd_restore_channels(struct hdd_context *hdd_ctx,
}
qdf_mutex_release(&hdd_ctx->cache_channel_lock);
if (notify_sap_event)
ucfg_reg_notify_sap_event(hdd_ctx->pdev, false);
else
ucfg_reg_restore_cached_channels(hdd_ctx->pdev);
ucfg_reg_restore_cached_channels(hdd_ctx->pdev);
status = sme_update_channel_list(hdd_ctx->mac_handle);
if (status)
hdd_err("Can't Restore channel list");
@ -4963,7 +4960,7 @@ int wlan_hdd_disable_channels(struct hdd_context *hdd_ctx)
}
qdf_mutex_release(&hdd_ctx->cache_channel_lock);
status = ucfg_reg_notify_sap_event(hdd_ctx->pdev, true);
ucfg_reg_disable_cached_channels(hdd_ctx->pdev);
status = sme_update_channel_list(hdd_ctx->mac_handle);
hdd_exit();
@ -4975,8 +4972,7 @@ int wlan_hdd_disable_channels(struct hdd_context *hdd_ctx)
return 0;
}
int wlan_hdd_restore_channels(struct hdd_context *hdd_ctx,
bool notify_sap_event)
int wlan_hdd_restore_channels(struct hdd_context *hdd_ctx)
{
return 0;
}

View file

@ -6674,7 +6674,7 @@ static int hdd_parse_disable_chan_cmd(struct hdd_adapter *adapter, uint8_t *ptr)
* Restore and Free the cache channels when the command is
* received with num channels as 0
*/
wlan_hdd_restore_channels(hdd_ctx, false);
wlan_hdd_restore_channels(hdd_ctx);
return 0;
}

View file

@ -1421,7 +1421,7 @@ QDF_STATUS hdd_softap_stop_bss(struct hdd_adapter *adapter)
if (adapter->device_mode == QDF_SAP_MODE &&
!hdd_ctx->config->disable_channel)
wlan_hdd_restore_channels(hdd_ctx, true);
wlan_hdd_restore_channels(hdd_ctx);
/* Mark the indoor channel (passive) to enable */
if (indoor_chnl_marking && adapter->device_mode == QDF_SAP_MODE) {