/* * Delete TDLD peer info, called from TDLS teardown request. */ static eHalStatus tdlsDeleteTdlsPeerInfo(tpAniSirGlobal pMac, tSirMacAddr peerMac) { tCsrTdlsCtxStruct *disInfo = &pMac->tdlsCtx ; tCsrTdlsPeerLinkinfo *peerInfo = findTdlsPeer(pMac, &disInfo->tdlsPotentialPeerList, peerMac) ; eHalStatus status = eHAL_STATUS_FAILURE ; if((csrLLRemoveEntry(&disInfo->tdlsPotentialPeerList, &peerInfo->tdlsPeerStaLink, LL_ACCESS_NOLOCK))) { status = palFreeMemory(pMac->hHdd, (void *)peerInfo) ; } return status ; }
/* * UPDATE TDLS peer state to TDLS LINK STATE, this will be called after * link is successfully setup with TDLS Peer. */ static eHalStatus tdlsUpdateTdlsPeerState(tpAniSirGlobal pMac, tSirMacAddr peerMac,tANI_U8 state ) { tCsrTdlsCtxStruct *disInfo = &pMac->tdlsCtx ; tCsrTdlsPeerLinkinfo *peerLinkInfo = findTdlsPeer(pMac, &disInfo->tdlsPotentialPeerList, peerMac) ; eHalStatus status = eHAL_STATUS_FAILURE ; if(peerLinkInfo) { tSirTdlsPeerInfo *peerInfo = &peerLinkInfo->tdlsDisPeerInfo ; peerInfo->tdlsPeerState = state ; status = eHAL_STATUS_SUCCESS ; } else { /* TODO: update this peer found in link setup in peer list */ VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, ("This TDLS client is not in discovery list ") ); status = eHAL_STATUS_SUCCESS ; } return status ; }
/* * TDLS Message processor, will be called after TDLS message recieved from * PE */ eHalStatus tdlsMsgProcessor(tpAniSirGlobal pMac, v_U16_t msgType, void *pMsgBuf) { switch(msgType) { case eWNI_SME_TDLS_SEND_MGMT_RSP: { /* remove pending eSmeCommandTdlsDiscovery command */ csrTdlsRemoveSmeCmd(pMac, eSmeCommandTdlsSendMgmt) ; } break; case eWNI_SME_TDLS_ADD_STA_RSP: { tSirTdlsAddStaRsp *addStaRsp = (tSirTdlsAddStaRsp *) pMsgBuf ; eCsrRoamResult roamResult ; tCsrRoamInfo roamInfo = {0} ; vos_mem_copy( &roamInfo.peerMac, addStaRsp->peerMac, sizeof(tSirMacAddr)) ; roamInfo.staId = addStaRsp->staId ; roamInfo.ucastSig = addStaRsp->ucastSig ; roamInfo.bcastSig = addStaRsp->bcastSig ; roamInfo.statusCode = addStaRsp->statusCode ; /* * register peer with TL, we have to go through HDD as this is * the only way to register any STA with TL. */ if (addStaRsp->tdlsAddOper == TDLS_OPER_ADD) roamResult = eCSR_ROAM_RESULT_ADD_TDLS_PEER; else /* addStaRsp->tdlsAddOper must be TDLS_OPER_UPDATE */ roamResult = eCSR_ROAM_RESULT_UPDATE_TDLS_PEER; csrRoamCallCallback(pMac, addStaRsp->sessionId, &roamInfo, 0, eCSR_ROAM_TDLS_STATUS_UPDATE, roamResult); /* remove pending eSmeCommandTdlsDiscovery command */ csrTdlsRemoveSmeCmd(pMac, eSmeCommandTdlsAddPeer) ; } break; case eWNI_SME_TDLS_DEL_STA_RSP: { tSirTdlsDelStaRsp *delStaRsp = (tSirTdlsDelStaRsp *) pMsgBuf ; tCsrRoamInfo roamInfo = {0} ; vos_mem_copy( &roamInfo.peerMac, delStaRsp->peerMac, sizeof(tSirMacAddr)) ; roamInfo.staId = delStaRsp->staId ; roamInfo.statusCode = delStaRsp->statusCode ; /* * register peer with TL, we have to go through HDD as this is * the only way to register any STA with TL. */ csrRoamCallCallback(pMac, delStaRsp->sessionId, &roamInfo, 0, eCSR_ROAM_TDLS_STATUS_UPDATE, eCSR_ROAM_RESULT_DELETE_TDLS_PEER); csrTdlsRemoveSmeCmd(pMac, eSmeCommandTdlsDelPeer) ; } break; case eWNI_SME_TDLS_DEL_STA_IND: { tpSirTdlsDelStaInd pSirTdlsDelStaInd = (tpSirTdlsDelStaInd) pMsgBuf ; tCsrRoamInfo roamInfo = {0} ; vos_mem_copy( &roamInfo.peerMac, pSirTdlsDelStaInd->peerMac, sizeof(tSirMacAddr)) ; roamInfo.staId = pSirTdlsDelStaInd->staId ; roamInfo.reasonCode = pSirTdlsDelStaInd->reasonCode ; /* Sending the TEARDOWN indication to HDD. */ csrRoamCallCallback(pMac, pSirTdlsDelStaInd->sessionId, &roamInfo, 0, eCSR_ROAM_TDLS_STATUS_UPDATE, eCSR_ROAM_RESULT_TEARDOWN_TDLS_PEER_IND); break ; } case eWNI_SME_TDLS_DEL_ALL_PEER_IND: { tpSirTdlsDelAllPeerInd pSirTdlsDelAllPeerInd = (tpSirTdlsDelAllPeerInd) pMsgBuf ; tCsrRoamInfo roamInfo = {0} ; /* Sending the TEARDOWN indication to HDD. */ csrRoamCallCallback(pMac, pSirTdlsDelAllPeerInd->sessionId, &roamInfo, 0, eCSR_ROAM_TDLS_STATUS_UPDATE, eCSR_ROAM_RESULT_DELETE_ALL_TDLS_PEER_IND); break ; } case eWNI_SME_MGMT_FRM_TX_COMPLETION_IND: { tpSirMgmtTxCompletionInd pSirTdlsDelAllPeerInd = (tpSirMgmtTxCompletionInd) pMsgBuf ; tCsrRoamInfo roamInfo = {0} ; roamInfo.reasonCode = pSirTdlsDelAllPeerInd->txCompleteStatus; csrRoamCallCallback(pMac, pSirTdlsDelAllPeerInd->sessionId, &roamInfo, 0, eCSR_ROAM_RESULT_MGMT_TX_COMPLETE_IND, 0); break; } case eWNI_SME_TDLS_LINK_ESTABLISH_RSP: { tSirTdlsLinkEstablishReqRsp *linkEstablishReqRsp = (tSirTdlsLinkEstablishReqRsp *) pMsgBuf ; tCsrRoamInfo roamInfo = {0} ; #if 0 vos_mem_copy(&roamInfo.peerMac, delStaRsp->peerMac, sizeof(tSirMacAddr)) ; roamInfo.staId = delStaRsp->staId ; roamInfo.statusCode = delStaRsp->statusCode ; #endif csrRoamCallCallback(pMac, linkEstablishReqRsp->sessionId, &roamInfo, 0, eCSR_ROAM_TDLS_STATUS_UPDATE, eCSR_ROAM_RESULT_LINK_ESTABLISH_REQ_RSP); /* remove pending eSmeCommandTdlsLinkEstablish command */ csrTdlsRemoveSmeCmd(pMac, eSmeCommandTdlsLinkEstablish); break; } #ifdef FEATURE_WLAN_TDLS_INTERNAL case eWNI_SME_TDLS_DISCOVERY_START_RSP: { /* remove pending eSmeCommandTdlsDiscovery command */ csrTdlsRemoveSmeCmd(pMac, eSmeCommandTdlsDiscovery) ; } /* fall through .. */ case eWNI_SME_TDLS_DISCOVERY_START_IND: { tSirTdlsDisRsp *disRsp = (tSirTdlsDisRsp *)pMsgBuf ; if(eSIR_SME_SUCCESS == disRsp->statusCode) { tCsrTdlsCtxStruct *disInfo = &pMac->tdlsCtx ; tANI_U16 disStaCount = disRsp->numDisSta ; tCsrTdlsPeerLinkinfo *peerLinkInfo = NULL ; tANI_U8 i = 0 ; VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, ("DIS START RSP/IND recieved sta count = %d"), disStaCount) ; for( ; i < disStaCount ; i++) { tSirTdlsPeerInfo *peerInfo = &disRsp->tdlsDisPeerInfo[i] ; VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, ("SME, peer MAC: "MAC_ADDRESS_STR), MAC_ADDR_ARRAY(peerInfo->peerMac)); peerLinkInfo = findTdlsPeer(pMac, &disInfo->tdlsPotentialPeerList, peerInfo->peerMac) ; if(NULL == peerLinkInfo) { /* update discovery data base, if this is new entry */ tdlsSaveTdlsPeerInfo(pMac, peerInfo) ; } else { /* update RSSI of existing peer */ tSirTdlsPeerInfo *newPeerInfo = &peerLinkInfo->tdlsDisPeerInfo ; newPeerInfo->tdlsPeerRssi = peerInfo->tdlsPeerRssi ; } } if(0 == i) { smsLog( pMac, LOGW, "there is no tdls client \ discovered .." ) ; } } else {