struct ppp_mbuf * ppp_m_get_from_ttfmem(PPP_ZC_STRU *pstMem) { VOS_UINT16 usLen; struct ppp_mbuf *bp; PPP_ZC_STRU *pstCurrMem; VOS_CHAR *pcMbufData; if (VOS_NULL_PTR == pstMem) { return VOS_NULL_PTR; } usLen = PPP_ZC_GET_DATA_LEN(pstMem); bp = ppp_m_get(usLen); if (VOS_NULL_PTR == bp) { return VOS_NULL_PTR; } pstCurrMem = pstMem; pcMbufData = PPP_MBUF_CTOP(bp); /* 目前的零拷贝暂不支持链式 */ /* while (VOS_NULL_PTR != pstCurrMem) { */ PS_MEM_CPY(pcMbufData, PPP_ZC_GET_DATA_PTR(pstCurrMem), PPP_ZC_GET_DATA_LEN(pstCurrMem)); pcMbufData += PPP_ZC_GET_DATA_LEN(pstCurrMem); /* pstCurrMem = pstCurrMem->pNext; } */ return bp; }
/***************************************************************************** Prototype : ipv4_Input Description : 对于TE发送来的数据报文,如果对应的link中是处于网络阶段并且状 态为open,转发此报文到GGSN。 Input : --- Output : ---返回指向mbuf的指针 Return Value : --- Calls : --- Called By : --- History : --- 1.Date : 2005-11-18 Author : --- Modification: Created function *****************************************************************************/ PPP_ZC_STRU *ipv4_Input(/*struct bundle *bundle, */struct link *l, PPP_ZC_STRU *bp) { if(l->phase == PHASE_NETWORK &&l->ipcp.fsm.state == ST_OPENED) { #if (PPP_FEATURE == PPP_FEATURE_PPP) /*将上行数据发往协议栈*/ PPP_SendPulledData((VOS_UINT16)PPP_LINK_TO_ID(l), bp); #else /*调用PPPoE的发送函数*/ PPPoE_PPPSendDataToRABM(PPP_ZC_GET_DATA_PTR(bp), PPP_ZC_GET_DATA_LEN(bp)); PPP_MemFree(bp); #endif } else { PPP_MemFree(bp); } return VOS_NULL_PTR; }
/****************************************************************************** Function: PPP_STUB_TraceDlData Description: 将下行数据发送给GTR Calls: Data Accessed: Data Updated: Input: Output: Return: Others: ******************************************************************************/ VOS_VOID PPP_STUB_TraceDlData(PPP_ZC_STRU *pstImmZc) { PPP_STUB_ZC_DATA_MSG_STRU *pstDlStubMsg; VOS_UINT32 ulLength; ulLength = sizeof(PPP_STUB_ZC_DATA_MSG_STRU) - VOS_MSG_HEAD_LENGTH; pstDlStubMsg = (PPP_STUB_ZC_DATA_MSG_STRU *) PS_ALLOC_MSG( PS_PID_APP_PPP, ulLength); if ( VOS_NULL_PTR == pstDlStubMsg ) { return; } pstDlStubMsg->ulReceiverCpuId = VOS_LOCAL_CPUID; pstDlStubMsg->ulReceiverPid = WUEPS_PID_AT; pstDlStubMsg->ulSenderPid = PS_PID_APP_PPP; pstDlStubMsg->ulSenderCpuId = VOS_LOCAL_CPUID; pstDlStubMsg->ulLength = ulLength; pstDlStubMsg->ulMsgType = PPP_AT_DL_DATA_IND; pstDlStubMsg->u.stDlDataInd.usDataLen = PPP_ZC_GET_DATA_LEN(pstImmZc); PPP_MemSingleCopy(&(pstDlStubMsg->u.stDlDataInd.aucData[0]), PPP_ZC_GET_DATA_PTR(pstImmZc), pstDlStubMsg->u.stDlDataInd.usDataLen); PS_SEND_MSG(PS_PID_APP_PPP, pstDlStubMsg); #ifdef WTTF_PS_FUSION_PC_ST PPP_MemFree(pstImmZc); #endif return; }