From d253c1c2fee531e3cb5816d3097db01371af089a Mon Sep 17 00:00:00 2001 From: gaurank kathpalia Date: Tue, 10 Dec 2019 19:11:16 +0530 Subject: [PATCH] qcacld-3.0: Return the safe channel from ACS ch list Currently in case of LTE-coex event, the driver restarts the SAP to a new channel if the current SAP operating channel is unsafe. In the current logic the driver gets the PCL apply the logic to remove unsafe channels, NOL channels etc. and then chose a final channel for the SAP. Now for the case of standlaone SAP the PCL would contain only 5ghz channels, and it may be the case that ACS channel list contains only 2.4ghz channels because the SAP was initially started on 2.4ghz band. Now with the intersection of 2.4ghz and 5ghz, the driver would not get anything left to restart the SAP and the SAP restart would eventually fail. Fix is to directly check the number of connections as 1, that would mean only SAP is present, and if it is the case, just restart the SAP on any other channel from the ACS channel list rather than intersection with PCL. Change-Id: If3a77ca877b2bf5e83ca64930e716936f680940f CRs-Fixed: 2556054 --- core/sap/src/sap_module.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c index 266568b733..47619f6c57 100644 --- a/core/sap/src/sap_module.c +++ b/core/sap/src/sap_module.c @@ -3058,6 +3058,11 @@ wlansap_get_safe_channel_from_pcl_and_acs_range(struct sap_context *sap_ctx) } mac_handle = MAC_HANDLE(mac); + if (policy_mgr_get_connection_count(mac->psoc) == 1) { + sap_debug("only SAP present return best channel from ACS list"); + return wlansap_get_safe_channel(sap_ctx); + } + status = policy_mgr_get_pcl_for_existing_conn( mac->psoc, PM_SAP_MODE, pcl_freqs, &pcl_len, pcl.weight_list, QDF_ARRAY_SIZE(pcl.weight_list),