/*
 * Find specific TDLS peer (based on peer MAC address).
 */
tCsrTdlsPeerLinkinfo *findTdlsPeer(tpAniSirGlobal pMac, 
                                tDblLinkList *peerList, tSirMacAddr peerMac)
{
    tListElem *pEntry = NULL ;
    tCsrTdlsPeerLinkinfo *peerLinkInfo = NULL ; 
    tSirTdlsPeerInfo *peerInfo = NULL ;

    pEntry = csrLLPeekHead( peerList, LL_ACCESS_LOCK );
    while(pEntry)
    {
        peerLinkInfo = GET_BASE_ADDR( pEntry, tCsrTdlsPeerLinkinfo, 
                                                        tdlsPeerStaLink) ;
        peerInfo = &peerLinkInfo->tdlsDisPeerInfo ;
 
        if(palEqualMemory( pMac->hHdd,(tANI_U8 *)peerInfo->peerMac,
                              (tANI_U8 *) peerMac, sizeof(tSirMacAddr)) )
        {
            break ;
        }

        pEntry = csrLLNext( peerList, pEntry, LL_ACCESS_LOCK) ;
    }
 
    return ((pEntry) ? peerLinkInfo: NULL) ; 
}
Example #2
0
tSirRetStatus schGetP2pIeOffset(tANI_U8 *pExtraIe, tANI_U32 extraIeLen, tANI_U16 *pP2pIeOffset)
{
    tSirRetStatus status = eSIR_FAILURE;   
    *pP2pIeOffset = 0;

    // Extra IE is not present
    if(0 == extraIeLen)
    {
        return status;
    }

    // Calculate the P2P IE Offset
    do
    {
        if(*pExtraIe == 0xDD)
        {
            if(palEqualMemory(NULL, (void *)(pExtraIe+2), &P2pOui, sizeof(P2pOui)))
            {
                status = eSIR_SUCCESS;
                break;
            }
        }

        (*pP2pIeOffset)++;
        pExtraIe++;
     }while(--extraIeLen > 0); 

     return status;
}