tANI_U16 limAssignPeerIdx(tpAniSirGlobal pMac, tpPESession pSessionEntry) { tANI_U16 peerId; // 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) { // too many associations already active return 0; } /* return head of free list */ if (pSessionEntry->freePeerIdxHead) { peerId=pSessionEntry->freePeerIdxHead; pSessionEntry->freePeerIdxHead = pSessionEntry->gpLimPeerIdxpool[pSessionEntry->freePeerIdxHead]; if (pSessionEntry->freePeerIdxHead==0) pSessionEntry->freePeerIdxTail=0; pSessionEntry->gLimNumOfCurrentSTAs++; return peerId; } return 0; /* no more free peer index */ }
tANI_U16 limAssignPeerIdx(tpAniSirGlobal pMac, tpPESession pSessionEntry) { tANI_U16 peerId; if (peGetCurrentSTAsCount(pMac) >= pMac->lim.gLimAssocStaLimit) { return 0; } if (pSessionEntry->freePeerIdxHead) { peerId=pSessionEntry->freePeerIdxHead; pSessionEntry->freePeerIdxHead = pSessionEntry->gpLimPeerIdxpool[pSessionEntry->freePeerIdxHead]; if (pSessionEntry->freePeerIdxHead==0) pSessionEntry->freePeerIdxTail=0; pSessionEntry->gLimNumOfCurrentSTAs++; return peerId; } return 0; }