From 45486ea83e777ffee6865d46fa81da4293619dff Mon Sep 17 00:00:00 2001 From: Peng Xu Date: Thu, 12 Nov 2015 16:37:44 -0800 Subject: [PATCH] qcacld-3.0: Fix second P2P-GO interface fail to startup issue For P2P GO + GO concurrency cases, the second P2P GO interface failed to startup due to the incorrect checkings in the driver code for GO interface. This fixes the condition checking logic. Change-Id: I1a8a1b3dd4eed9dd8c824241d7b1759751e53a18 CRs-fixed: 938850 --- core/hdd/src/wlan_hdd_p2p.c | 16 ++++++++++------ core/sme/src/csr/csr_util.c | 5 ++++- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/core/hdd/src/wlan_hdd_p2p.c b/core/hdd/src/wlan_hdd_p2p.c index a6d5accaad..dbfe8b9643 100644 --- a/core/hdd/src/wlan_hdd_p2p.c +++ b/core/hdd/src/wlan_hdd_p2p.c @@ -2124,6 +2124,7 @@ struct net_device *__wlan_hdd_add_virtual_intf(struct wiphy *wiphy, char *name, hdd_adapter_t *pAdapter = NULL; hdd_scaninfo_t *scan_info = NULL; int ret; + uint8_t session_type; ENTER(); @@ -2141,15 +2142,18 @@ struct net_device *__wlan_hdd_add_virtual_intf(struct wiphy *wiphy, char *name, MTRACE(cdf_trace(CDF_MODULE_ID_HDD, TRACE_CODE_HDD_ADD_VIRTUAL_INTF, NO_SESSION, type)); /* - * Allow addition multiple interface for WLAN_HDD_P2P_CLIENT and - * WLAN_HDD_SOFTAP session type. + * Allow addition multiple interfaces for WLAN_HDD_P2P_GO, + * WLAN_HDD_SOFTAP, WLAN_HDD_P2P_CLIENT and WLAN_HDD_INFRA_STATION + * session type. */ - if ((hdd_get_adapter(pHddCtx, wlan_hdd_get_session_type(type)) != NULL) + session_type = wlan_hdd_get_session_type(type); + if ((hdd_get_adapter(pHddCtx, session_type) != NULL) #ifdef WLAN_FEATURE_MBSSID - && WLAN_HDD_SOFTAP != wlan_hdd_get_session_type(type) + && WLAN_HDD_SOFTAP != session_type + && WLAN_HDD_P2P_GO != session_type #endif - && WLAN_HDD_P2P_CLIENT != wlan_hdd_get_session_type(type) - && WLAN_HDD_INFRA_STATION != wlan_hdd_get_session_type(type)) { + && WLAN_HDD_P2P_CLIENT != session_type + && WLAN_HDD_INFRA_STATION != session_type) { hddLog(LOGE, "%s: Interface type %d already exists. " "Two interfaces of same type are not supported currently.", diff --git a/core/sme/src/csr/csr_util.c b/core/sme/src/csr/csr_util.c index 5c0670414a..42e351a910 100644 --- a/core/sme/src/csr/csr_util.c +++ b/core/sme/src/csr/csr_util.c @@ -1904,6 +1904,7 @@ csr_isconcurrentsession_valid(tpAniSirGlobal mac_ctx, uint32_t cur_sessionid, case CDF_P2P_GO_MODE: temp = eCSR_ASSOC_STATE_TYPE_IBSS_DISCONNECTED; +#ifndef WLAN_FEATURE_MBSSID if ((bss_persona == CDF_P2P_GO_MODE) && (connect_state != eCSR_ASSOC_STATE_TYPE_NOT_CONNECTED)) { @@ -1911,7 +1912,9 @@ csr_isconcurrentsession_valid(tpAniSirGlobal mac_ctx, uint32_t cur_sessionid, CDF_TRACE_LEVEL_ERROR, FL("GO mode already exists")); return CDF_STATUS_E_FAILURE; - } else if ((bss_persona == CDF_IBSS_MODE) + } +#endif + if ((bss_persona == CDF_IBSS_MODE) && (connect_state != temp)) { CDF_TRACE(CDF_MODULE_ID_SME, CDF_TRACE_LEVEL_ERROR,