/* * 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: { tSirSmeRsp *pMsg = (tSirSmeRsp*) pMsgBuf; tCsrRoamInfo roamInfo = {0} ; /* remove pending eSmeCommandTdlsDiscovery command */ csrTdlsRemoveSmeCmd(pMac, eSmeCommandTdlsSendMgmt) ; if (eSIR_SME_SUCCESS != pMsg->statusCode) { /* Tx failed, so there wont be any ack confirmation*/ /* Indicate ack failure to upper layer */ roamInfo.reasonCode = 0; csrRoamCallCallback(pMac, pMsg->sessionId, &roamInfo, 0, eCSR_ROAM_RESULT_MGMT_TX_COMPLETE_IND, 0); } } 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; } case eWNI_SME_TDLS_CHANNEL_SWITCH_RSP: { #if 0 tSirTdlsChanSwitchReqRsp *ChanSwitchReqRsp = (tSirTdlsChanSwitchReqRsp *) pMsgBuf ; tCsrRoamInfo roamInfo = {0} ; vos_mem_copy(&roamInfo.peerMac, delStaRsp->peerMac, sizeof(tSirMacAddr)) ; roamInfo.staId = delStaRsp->staId ; roamInfo.statusCode = delStaRsp->statusCode ; csrRoamCallCallback(pMac, ChanSwitchReqRsp->sessionId, &roamInfo, 0, eCSR_ROAM_TDLS_STATUS_UPDATE, eCSR_ROAM_RESULT_LINK_ESTABLISH_REQ_RSP); #endif /* remove pending eSmeCommandTdlsChanSwitch command */ csrTdlsRemoveSmeCmd(pMac, eSmeCommandTdlsChannelSwitch); break; } default: { break ; } } return eHAL_STATUS_SUCCESS ; }
/* * 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 {
/* * TDLS Message processor, will be called after TDLS message received from * PE */ eHalStatus tdlsMsgProcessor(tpAniSirGlobal pMac, v_U16_t msgType, void *pMsgBuf) { tCsrRoamInfo roamInfo = {0} ; 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 ; 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 ; 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 ; 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 ; /* 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 ; 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 ; vos_mem_copy(&roamInfo.peerMac, linkEstablishReqRsp->peerMac, sizeof(tSirMacAddr)); roamInfo.staId = (uint8_t)linkEstablishReqRsp->sta_idx; roamInfo.statusCode = linkEstablishReqRsp->statusCode; 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; } case eWNI_SME_TDLS_SHOULD_DISCOVER: { tSirTdlsEventNotify *tevent = (tSirTdlsEventNotify *) pMsgBuf; vos_mem_copy(&roamInfo.peerMac, tevent->peerMac, sizeof(tSirMacAddr)); roamInfo.reasonCode = tevent->peer_reason; VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "%s: eWNI_SME_TDLS_SHOULD_DISCOVER for peer mac: " MAC_ADDRESS_STR " peer_reason: %d", __func__, MAC_ADDR_ARRAY(tevent->peerMac), tevent->peer_reason); csrRoamCallCallback(pMac, tevent->sessionId, &roamInfo, 0, eCSR_ROAM_TDLS_STATUS_UPDATE, eCSR_ROAM_RESULT_TDLS_SHOULD_DISCOVER); break; } case eWNI_SME_TDLS_SHOULD_TEARDOWN: { tSirTdlsEventNotify *tevent = (tSirTdlsEventNotify *) pMsgBuf; vos_mem_copy(&roamInfo.peerMac, tevent->peerMac, sizeof(tSirMacAddr)); roamInfo.reasonCode = tevent->peer_reason; VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "%s: eWNI_SME_TDLS_SHOULD_TEARDOWN for peer mac: " MAC_ADDRESS_STR " peer_reason: %d", __func__, MAC_ADDR_ARRAY(tevent->peerMac), tevent->peer_reason); csrRoamCallCallback(pMac, tevent->sessionId, &roamInfo, 0, eCSR_ROAM_TDLS_STATUS_UPDATE, eCSR_ROAM_RESULT_TDLS_SHOULD_TEARDOWN); break; } case eWNI_SME_TDLS_PEER_DISCONNECTED: { tSirTdlsEventNotify *tevent = (tSirTdlsEventNotify *) pMsgBuf; vos_mem_copy(&roamInfo.peerMac, tevent->peerMac, sizeof(tSirMacAddr)); roamInfo.reasonCode = tevent->peer_reason; VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "%s: eWNI_SME_TDLS_PEER_DISCONNECTED for peer mac: " MAC_ADDRESS_STR " peer_reason: %d", __func__, MAC_ADDR_ARRAY(tevent->peerMac), tevent->peer_reason); csrRoamCallCallback(pMac, tevent->sessionId, &roamInfo, 0, eCSR_ROAM_TDLS_STATUS_UPDATE, eCSR_ROAM_RESULT_TDLS_SHOULD_PEER_DISCONNECTED); break; } default: { break ; } } return eHAL_STATUS_SUCCESS ; }