From e4c9eb61ee46bf9ea35a1c5058950df3604c9b38 Mon Sep 17 00:00:00 2001 From: Yingying Tang Date: Wed, 13 Jul 2016 18:55:14 +0800 Subject: qcacld-2.0: Fix TDLS setup failure In limAssignPeerIdx() the max_peer is only populated in case of AP and GO mode and for others it remains 0. So TDLS setup will be failed because the max peer number of TDLS is 0, TDLS peer can't be created. Add fix to resolve this regression issue. Regression commit change ID: I9aaacf035efb042f8216ca0d7f1ec3f21f11b212 Regression commit subject: qcacld-2.0: Set number of clients separately for SAP and GO CRs-Fixed: 1041062 Change-Id: I1030a2f33e467f752bdded237e5321f0a59a2ea5 --- CORE/MAC/src/pe/lim/limAIDmgmt.c | 9 ++++++--- CORE/MAC/src/pe/lim/limProcessAssocReqFrame.c | 10 +++++----- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/CORE/MAC/src/pe/lim/limAIDmgmt.c b/CORE/MAC/src/pe/lim/limAIDmgmt.c index 3d3d7a3aad8f..5e286287c251 100644 --- a/CORE/MAC/src/pe/lim/limAIDmgmt.c +++ b/CORE/MAC/src/pe/lim/limAIDmgmt.c @@ -136,16 +136,19 @@ limAssignPeerIdx(tpAniSirGlobal pMac, tpPESession pSessionEntry) tANI_U16 peerId; uint8 max_peer = 0; + + limLog(pMac, LOG1, FL("pePersona:%d"), + pSessionEntry->pePersona); + if (pSessionEntry->pePersona == VOS_STA_SAP_MODE) max_peer = pMac->lim.glim_assoc_sta_limit_ap; - - if (pSessionEntry->pePersona == VOS_P2P_GO_MODE) + else if (pSessionEntry->pePersona == VOS_P2P_GO_MODE) max_peer = pMac->lim.glim_assoc_sta_limit_go; // make sure we haven't exceeded the configurable limit on associations // This count is global to ensure that it doesnt exceed the hardware limits. if (peGetCurrentSTAsCount(pMac) >= pMac->lim.gLimAssocStaLimit || - pSessionEntry->gLimNumOfCurrentSTAs >= max_peer) + (max_peer != 0 && pSessionEntry->gLimNumOfCurrentSTAs >= max_peer)) { // too many associations already active return 0; diff --git a/CORE/MAC/src/pe/lim/limProcessAssocReqFrame.c b/CORE/MAC/src/pe/lim/limProcessAssocReqFrame.c index 29774ea19e73..a8ba21458016 100644 --- a/CORE/MAC/src/pe/lim/limProcessAssocReqFrame.c +++ b/CORE/MAC/src/pe/lim/limProcessAssocReqFrame.c @@ -866,21 +866,21 @@ limProcessAssocReqFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, /// Extract pre-auth context for the STA, if any. pStaPreAuthContext = limSearchPreAuthList(pMac, pHdr->sa); - limLog(pMac, LOG1, FL( "max:%d ap:%d go:%d mode:%d"), + limLog(pMac, LOG1, FL( "max:%d ap:%d go:%d mode:%d pePersona:%d"), pMac->lim.gLimAssocStaLimit, pMac->lim.glim_assoc_sta_limit_ap, - pMac->lim.glim_assoc_sta_limit_go, psessionEntry->pePersona); + pMac->lim.glim_assoc_sta_limit_go, psessionEntry->pePersona, + psessionEntry->pePersona); if (psessionEntry->pePersona == VOS_STA_SAP_MODE) max_peer = pMac->lim.glim_assoc_sta_limit_ap; - - if (psessionEntry->pePersona == VOS_P2P_GO_MODE) + else if (psessionEntry->pePersona == VOS_P2P_GO_MODE) max_peer = pMac->lim.glim_assoc_sta_limit_go; if (pStaDs == NULL) { /// Requesting STA is not currently associated if ((peGetCurrentSTAsCount(pMac) == pMac->lim.gLimAssocStaLimit)|| - (psessionEntry->gLimNumOfCurrentSTAs == max_peer)) + (max_peer != 0 && psessionEntry->gLimNumOfCurrentSTAs == max_peer)) { /** * Maximum number of STAs that AP can handle reached. -- cgit v1.2.3