From fb93a62b9332d14ddb3fe0e41a8602e8eedadcb5 Mon Sep 17 00:00:00 2001 From: bings Date: Mon, 9 Jan 2017 11:22:38 +0800 Subject: qcacld-3.0: Do not set ACS flag if no ACS to be done qcacld-2.0 to qcacld-3.0 propagation wlan_hdd_cfg80211_change_iface will abort if ACS_IN_PROGRESS is set, which causes iface type mismatch between hostapd and driver. When force SCC if same band is enabled, driver will not do ACS for the second AP. So do not set ACS_IN_PROGRESS if no ACS to be done. Change-Id: I2c975c89dc1cf0d11980ad11c8d0d256c680594d CRs-Fixed: 1105386 --- core/hdd/src/wlan_hdd_cfg80211.c | 3 ++- core/sap/inc/sap_api.h | 11 ++++++++++- core/sap/src/sap_module.c | 14 +++++++++++++- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 4d88160188e5..f944e92ef468 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -1355,7 +1355,8 @@ static int wlan_hdd_cfg80211_start_acs(hdd_adapter_t *adapter) hdd_err("ACS channel select failed"); return -EINVAL; } - sap_config->acs_cfg.acs_mode = true; + if (sap_is_auto_channel_select(WLAN_HDD_GET_SAP_CTX_PTR(adapter))) + sap_config->acs_cfg.acs_mode = true; set_bit(ACS_IN_PROGRESS, &hdd_ctx->g_event_flags); return 0; diff --git a/core/sap/inc/sap_api.h b/core/sap/inc/sap_api.h index 522810777738..de258a55a63d 100644 --- a/core/sap/inc/sap_api.h +++ b/core/sap/inc/sap_api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -851,6 +851,15 @@ typedef struct { #endif /* FEATURE_WLAN_CH_AVOID */ void sap_cleanup_channel_list(void *sapContext); void sapCleanupAllChannelList(void); + +/** + * sap_is_auto_channel_select() - is channel AUTO_CHANNEL_SELECT + * @pvos_gctx: Pointer to vos global context structure + * + * Return: true on AUTO_CHANNEL_SELECT, false otherwise + */ +bool sap_is_auto_channel_select(void *pvos_gctx); + QDF_STATUS wlansap_set_wps_ie(void *p_cds_gctx, tSap_WPSIE *pWPSIe); QDF_STATUS wlansap_update_wps_ie(void *p_cds_gctx); QDF_STATUS wlansap_stop_Wps(void *p_cds_gctx); diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c index b4572241bbe6..b5c0944c5996 100644 --- a/core/sap/src/sap_module.c +++ b/core/sap/src/sap_module.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -2918,6 +2918,18 @@ wlansap_set_dfs_restrict_japan_w53(tHalHandle hHal, uint8_t disable_Dfs_W53) return status; } +bool sap_is_auto_channel_select(void *pvos_gctx) +{ + ptSapContext sapcontext = CDS_GET_SAP_CB(pvos_gctx); + + if (NULL == sapcontext) { + QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, + "%s: Invalid SAP pointer", __func__); + return 0; + } + return sapcontext->channel == AUTO_CHANNEL_SELECT; +} + #ifdef FEATURE_AP_MCC_CH_AVOIDANCE /** * wlan_sap_set_channel_avoidance() - sets sap mcc channel avoidance ini param -- cgit v1.2.3