From 520ebc7a419256d7c03886bc3b92127efecc827c Mon Sep 17 00:00:00 2001 From: Ashish Kumar Dhanotiya Date: Thu, 18 Feb 2021 21:36:10 +0530 Subject: [PATCH] qcacld-3.0: Restart SAP if current channel is disabled Currently when host receives disable channels command, it disables the channels and if SAP is on it checks if SAP is on one of the disabled channels in that case host stops the SAP. Based on current requirement host should restart the SAP, with this change add support to restart the SAP if it is operating on disabled channel. Change-Id: I89ce21a8707e2c0af0737116b883be13503044e0 CRs-Fixed: 2885308 --- core/hdd/src/wlan_hdd_ioctl.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c index 448b070065..0475cc8745 100644 --- a/core/hdd/src/wlan_hdd_ioctl.c +++ b/core/hdd/src/wlan_hdd_ioctl.c @@ -6616,19 +6616,18 @@ static bool check_disable_channels(struct hdd_context *hdd_ctx, } /** - * disconnect_sta_and_stop_sap() - Disconnect STA and stop SAP + * disconnect_sta_and_restart_sap() - Disconnect STA and restart SAP * * @hdd_ctx: Pointer to hdd context * @reason: Disconnect reason code as per @enum wlan_reason_code * * Disable channels provided by user and disconnect STA if it is - * connected to any AP, stop SAP and send deauthentication request - * to STAs connected to SAP. + * connected to any AP, restart SAP. * * Return: None */ -static void disconnect_sta_and_stop_sap(struct hdd_context *hdd_ctx, - enum wlan_reason_code reason) +static void disconnect_sta_and_restart_sap(struct hdd_context *hdd_ctx, + enum wlan_reason_code reason) { struct hdd_adapter *adapter, *next = NULL; QDF_STATUS status; @@ -6647,7 +6646,8 @@ static void disconnect_sta_and_stop_sap(struct hdd_context *hdd_ctx, hdd_ctx->pdev, adapter->session.ap.operating_chan_freq); if (check_disable_channels(hdd_ctx, ap_ch)) - wlan_hdd_stop_sap(adapter); + policy_mgr_check_sap_restart(hdd_ctx->psoc, + adapter->vdev_id); } status = hdd_get_next_adapter(hdd_ctx, adapter, &next); @@ -6834,8 +6834,9 @@ mem_alloc_failed: ret = wlan_hdd_disable_channels(hdd_ctx); if (ret) return ret; - disconnect_sta_and_stop_sap(hdd_ctx, - REASON_OPER_CHANNEL_BAND_CHANGE); + disconnect_sta_and_restart_sap( + hdd_ctx, + REASON_OPER_CHANNEL_BAND_CHANGE); } hdd_exit();