From c3fb27d117d0b87a5a01bd42b1a84662a712d6cf Mon Sep 17 00:00:00 2001 From: Will Huang Date: Fri, 16 Aug 2019 16:34:25 +0800 Subject: [PATCH] qcacld-3.0: Make hdd_switch_sap_channel execute once at same time The sap unsafe channel restart process include two subprocesses: CSA ie update and channel switch, but CSA ie update request using mac->sap.SapDfsInfo to save target channel switch parameters, which would be overwritten by 2nd sap restart at same time. For example: SAP1 on chan 1 and SAP2 on chan 36, then lte coex mark chan 1 and chan 36 as unsafe channels, now SAP1 and SAP2 would switch to same channel, but actually they can be on different channels doing DBS. To fix it, one option is save the target channel switch parameters to different session, but looks it may introduce a lot of code change, because the logic is shared with DFS/concurrency. So the simple option is making sap unsafe channel restart execute once at same time. Change-Id: Ieaab3007fb6e79a9741f892e86771d2f52c03e3c CRs-Fixed: 2504867 --- core/hdd/src/wlan_hdd_hostapd.c | 5 +++++ core/hdd/src/wlan_hdd_main.c | 4 +--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index d8a6d1593c64..bcdcabe3e56f 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -2611,6 +2611,11 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event, qdf_atomic_set(&adapter->ch_switch_in_progress, 0); policy_mgr_set_chan_switch_complete_evt(hdd_ctx->psoc); wlan_hdd_enable_roaming(adapter); + + /* Check any other sap need restart */ + if (ap_ctx->sap_context->csa_reason == + CSA_REASON_UNSAFE_CHANNEL) + hdd_unsafe_channel_restart_sap(hdd_ctx); return QDF_STATUS_SUCCESS; default: diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index beecdafbc0bf..f8eb91c7d0fe 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -9195,9 +9195,7 @@ void hdd_unsafe_channel_restart_sap(struct hdd_context *hdd_ctxt) CSA_REASON_UNSAFE_CHANNEL); hdd_switch_sap_channel(adapter, restart_chan, true); - hdd_store_sap_restart_channel( - restart_chan, - restart_chan_store); + return; } else { hdd_debug("sending coex indication");