From ae4d3c41caf48a927d2e8550fae0dbfd8d42bbab Mon Sep 17 00:00:00 2001 From: Jianmin Zhu Date: Tue, 14 Jan 2020 16:08:30 +0800 Subject: [PATCH] qcacld-3.0: SAP hung in DFS state when disable channel during CAC If SAP start on 5G DFS channel, it will keep in CAC for 1 minute. If Disable 5G by cmd: hostapd_cli -iwlan2 set setband 2G during this minute, SAP won't switch to 2G since SAP isn't in started state, and SAP start also fail since SAP operate channel becomes disabled instead of DFS state, SAP will be hung in DFS state. Fix: When CAC complete and SAP start, check SAP operate channel with wlan_reg_chan_has_dfs_attribute_for_freq. After SAP started, will check for SAP restart, if found current band is disabled, will switch to 2G band. Change-Id: I3c29b5d324d4324ce958a5c2cd2102df2cc183ff CRs-Fixed: 2601081 --- core/sap/src/sap_fsm.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c index d1a59f46e2..9bb6895b20 100644 --- a/core/sap/src/sap_fsm.c +++ b/core/sap/src/sap_fsm.c @@ -1997,6 +1997,7 @@ static QDF_STATUS sap_cac_end_notify(mac_handle_t mac_handle, uint8_t intf; struct mac_context *mac = MAC_CONTEXT(mac_handle); QDF_STATUS qdf_status = QDF_STATUS_E_FAILURE; + uint32_t freq; /* * eSAP_DFS_CHANNEL_CAC_END: @@ -2018,9 +2019,9 @@ static QDF_STATUS sap_cac_end_notify(mac_handle_t mac_handle, sap_context = mac->sap.sapCtxList[intf].sap_context; /* Don't check CAC for non-dfs channel */ profile = &sap_context->csr_roamProfile; - if (!wlan_reg_is_dfs_ch(mac->pdev, - wlan_reg_freq_to_chan(mac->pdev, - profile->op_freq))) + freq = profile->op_freq; + if (!wlan_reg_chan_has_dfs_attribute_for_freq(mac->pdev, + freq)) continue; /* If this is an end notification of a pre cac, the