From dc2cefb1533b41ba153b23a78b4b729585a0c523 Mon Sep 17 00:00:00 2001 From: Frank Liu Date: Wed, 21 Jun 2017 15:38:18 +0800 Subject: [PATCH] qcacld-3.0: fix sap not restart when on unsafe channel In LTE Coex test, firmware will report the unsafe channels, and if sap runs on these channels, driver goes through channel select process and restart. There are some situation, in channel select process, SAP can't find the proper PCL channel lists, and fail to restart. This fix is to let SAP continue to pick up a safe channel from ACS range when fail to get pcl. Change-Id: I54145547d2b161aec09caa2dabd4d4b52aa15f03 CRs-Fixed: 2064534 --- core/hdd/src/wlan_hdd_main.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 07816c1733f8..99d1adc85d4f 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -6869,10 +6869,13 @@ static uint8_t hdd_get_safe_channel_from_pcl_and_acs_range( return INVALID_CHANNEL_ID; } - if (!pcl.pcl_len) { - hdd_err("pcl length is zero. this is not expected"); - return INVALID_CHANNEL_ID; - } + /* + * In some scenarios, like hw dbs disabled, sap+sap case, if operating + * channel is unsafe channel, the pcl may be empty, instead of return, + * try to choose a safe channel from acs range. + */ + if (!pcl.pcl_len) + hdd_debug("pcl length is zero!"); hdd_debug("start:%d end:%d", adapter->sessionCtx.ap.sapConfig.acs_cfg.start_ch,