From 5597208ded26cfd9bddfc34303537e3e44f75f13 Mon Sep 17 00:00:00 2001 From: Himanshu Agarwal Date: Wed, 18 Apr 2018 14:26:39 +0530 Subject: [PATCH] qcacld-3.0: Stop opportunistic timer while starting new SAP If DBS opportunistic timer is still running while starting new SAP on some DFS channel when STA is already present on some 2.4Ghz channel, wrong hw mode will be set when timer expires as concurrency will only be updated when VDEV_UP happens which will happen after at least 60 seconds in case of DFS channel. So, while starting SAP, hw mode was set to DBS mode but on DBS opportunistic timer expiration, as VDEV_UP doesn't happen yet, concurrency has not been updated till now causing hw mode to reset to SINGLE_MAC resulting in DFS MCC which is not allowed. Stop DBS opportunistic timer if running while starting new SAP to avoid hw mode reset. Change-Id: I9cef0ab5f6208e1822aff4a68c442d61a3f8a20e CRs-Fixed: 2222386 --- core/hdd/src/wlan_hdd_hostapd.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 72572599be80..8b0f337ed55f 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -8609,10 +8609,22 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy, if (!QDF_IS_STATUS_SUCCESS(status)) hdd_err("ERR: clear event failed"); + /* + * Stop opportunistic timer here if running as we are already doing + * hw mode change before vdev start based on the new concurrency + * situation. If timer is not stopped and if it gets triggered before + * VDEV_UP, it will reset the hw mode to some wrong value. + */ + status = policy_mgr_stop_opportunistic_timer(hdd_ctx->hdd_psoc); + if (status != QDF_STATUS_SUCCESS) { + hdd_err("Failed to stop DBS opportunistic timer"); + return -EINVAL; + } + status = policy_mgr_current_connections_update(hdd_ctx->hdd_psoc, adapter->session_id, channel, POLICY_MGR_UPDATE_REASON_START_AP); - if (QDF_STATUS_E_FAILURE == status) { + if (status == QDF_STATUS_E_FAILURE) { hdd_err("ERROR: connections update failed!!"); return -EINVAL; }