From 8bafdadff971acc88b119c1e6cd074ec5b8a7422 Mon Sep 17 00:00:00 2001 From: Ryan Hsu Date: Wed, 5 Apr 2017 14:58:57 -0700 Subject: qcacld-3.0: avoiding toggling green ap state change when not in SAP mode In the commit "qcacld-3.0: Disable GAP when concurrent sessions running" We tried to update the green ap state, although inside the hdd_green_ap_start_bss() it'll check if the SAP context/adapter is exist or not, but it'll still show the message as below... wlan: [326:E :HDD] hdd_green_ap_mc: 184: Green-AP no SAP adapter So add sanity check before toggling the SAP related interfaces. Change-Id: I2b6af3e3bb8001e3e34736f714334e37f7d57b2b CRs-fixed: 2029613 --- core/cds/src/cds_concurrency.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/core/cds/src/cds_concurrency.c b/core/cds/src/cds_concurrency.c index 96cf9bc7e61e..2950da45af91 100644 --- a/core/cds/src/cds_concurrency.c +++ b/core/cds/src/cds_concurrency.c @@ -3591,7 +3591,11 @@ void cds_set_concurrency_mode(enum tQDF_ADAPTER_MODE mode) hdd_ctx->concurrency_mode, mode, hdd_ctx->no_of_open_sessions[mode]); - hdd_green_ap_start_bss(hdd_ctx); + /* + * Only toggle the green_ap update when SAP adapter exist. + */ + if (hdd_get_adapter(hdd_ctx, QDF_SAP_MODE)) + hdd_green_ap_start_bss(hdd_ctx); } /** @@ -3630,7 +3634,12 @@ void cds_clear_concurrency_mode(enum tQDF_ADAPTER_MODE mode) hdd_ctx->concurrency_mode, mode, hdd_ctx->no_of_open_sessions[mode]); - hdd_green_ap_start_bss(hdd_ctx); + /* + * Only toggle the green_ap update when SAP adapter exist or + * SAP interface removal. + */ + if (hdd_get_adapter(hdd_ctx, QDF_SAP_MODE) || (mode == QDF_SAP_MODE)) + hdd_green_ap_start_bss(hdd_ctx); } /** -- cgit v1.2.3