コード例 #1
0
VOS_VOID QosFc_RabRelease(CONST MsgBlock  *pstMsg)
{
    QOS_FC_RAB_RELEASE_IND_STRU *pstRabRelease = (QOS_FC_RAB_RELEASE_IND_STRU *)(VOS_VOID*)pstMsg;
    QCI_TYPE_ENUM_UINT8     enQci;
    VOS_UINT8               ucLinkRabId;
    MODEM_ID_ENUM_UINT16    enModemId;
    VOS_UINT8               ucExRabId;

    FC_DBG_RELEASE_MSG_STAT(1);

    /*入参判断*/
    if (VOS_NULL_PTR == pstRabRelease)
    {
        CDS_ERROR_LOG(UEPS_PID_CDS, "QosFc_RabRelease : NULL pointer");
        return;
    }

    if(QosFc_IsInValidRabId(pstRabRelease->ucRabId))
    {
        CDS_ERROR_LOG1(UEPS_PID_CDS, "QosFc_RabRelease : Invalid RabId:", pstRabRelease->ucRabId);
        return;
    }

    enModemId = VOS_GetModemIDFromPid(TTF_GET_MSG_SENDER_PID(pstRabRelease));
    if (MODEM_ID_BUTT <= enModemId)
    {
        CDS_ERROR_LOG1(UEPS_PID_CDS, "QosFc_RabRelease : ModemId Error",enModemId);
        return;
    }

    ucExRabId = (VOS_UINT8)((enModemId << FC_MODEMID_SHIFT) | pstRabRelease->ucRabId);
    ucLinkRabId = QosFc_ReleaseRabEntity(ucExRabId);

    if(FC_INVALID_RABID != ucLinkRabId)
    {
        /* 获得PDN上最高的QCI */
        enQci = QosFc_GetPdnQci(ucLinkRabId);
        QosFc_UpdateChannelQos(ucLinkRabId, enQci);
        /* PDN是否需要流控 */
        /*lint -e960*/
        if((QCI_TYPE_BUTT != enQci) && (FC_INVALID_RABID == QosFc_OtherAvailRabOfPdn(ucLinkRabId)))
        /*lint +e960*/
        {
            QosFc_ChannelControl(ucLinkRabId);
        }
    }
    else
    {
        CDS_ERROR_LOG(UEPS_PID_CDS, "QosFc_RabRelease : Invalid LinkRabId:");
    }

    return;

}
コード例 #2
0
VOS_VOID CDS_ImsaSetImsBearerReqMsgProc(MsgBlock *pstMsg)
{
    IMSA_CDS_SET_IMS_BEARER_REQ_STRU   *pstReqMsg;
    CDS_ENTITY_STRU                    *pstCdsEntity;

    CDS_INFO_LOG(UEPS_PID_CDS,"Enter CDS_ImsaSetImsBearerReqMsgProc.");

    pstReqMsg = (IMSA_CDS_SET_IMS_BEARER_REQ_STRU *)((VOS_UINT32)pstMsg);
    if (pstReqMsg->ulImsBearerNum > IMSA_CDS_MAX_IMS_BEARER_NUM)
    {
        CDS_ERROR_LOG1(UEPS_PID_CDS,"CDS_ImsaSetImsBearerReqMsgProc : IMS Bearer Number Error.",pstReqMsg->ulImsBearerNum);
        CDS_SendImsaSetImsBearerCnfMsg(PS_FAIL);
        return;
    }

    /*默认按MODEM_0处理*/
    pstCdsEntity = CDS_GetCdsEntity(MODEM_ID_0);
    if (VOS_NULL_PTR == pstCdsEntity)
    {
        CDS_ERROR_LOG(UEPS_PID_CDS,"CDS_ImsaSetImsBearerReqMsgProc : Get CDS Entity Fail.");
        CDS_SendImsaSetImsBearerCnfMsg(PS_FAIL);
        return;
    }

    /*注册IMS NIC回调函数*/
    if (PS_SUCC != IMS_NIC_RegUlDataSendCb((IMS_NIC_SEND_UL_DATA_FUNC)CDS_RxDataFromImsNIC,
                                            pstCdsEntity->usModemId))
    {
        CDS_ERROR_LOG(UEPS_PID_CDS,"CDS_ImsaSetImsBearerReqMsgProc : IMS_NIC_RegUlDataSendCb Fail.");
        CDS_SendImsaSetImsBearerCnfMsg(PS_FAIL);
        return;
    }

    /*更新CDS实体信息*/
    pstCdsEntity->ulImsBearerNum = pstReqMsg->ulImsBearerNum;
    PS_MEM_CPY(pstCdsEntity->astImsBearerInfo,
               pstReqMsg->astImsBearerArray,
               pstReqMsg->ulImsBearerNum * sizeof(IMSA_CDS_IMS_BEARER_STRU));

    pstCdsEntity->stImsPortInfo.usMinImsPort = pstReqMsg->stImsPortInfo.usMinImsPort;
    pstCdsEntity->stImsPortInfo.usMaxImsPort = pstReqMsg->stImsPortInfo.usMaxImsPort;

    /*发送成功消息*/
    CDS_SendImsaSetImsBearerCnfMsg(PS_SUCC);

    CDS_INFO_LOG(UEPS_PID_CDS,"Leave CDS_ImsaSetImsBearerReqMsgProc Succ.");

    return;
}
コード例 #3
0
VOS_VOID CDS_SaveIpfDlSrcMem(const IPF_CONFIG_DLPARAM_S *pstIpfDlBdBuff, VOS_UINT32 ulSaveNum)
{
    LUP_QUEUE_STRU                   *pstDlFreeQue;
    VOS_UINT32                        ulCnt;

    if (VOS_NULL_PTR == pstIpfDlBdBuff)
    {
        CDS_ERROR_LOG(UEPS_PID_CDS,"CDS_SaveIpfDlMemInfo:Input Para is NULL.");
        return ;
    }

    if (ulSaveNum > IPF_DLBD_DESC_SIZE)
    {
        CDS_ERROR_LOG1(UEPS_PID_CDS,"CDS_SaveIpfDlMemInfo:Input Bd Num Error.",ulSaveNum);
        return ;
    }

    pstDlFreeQue = CDS_IPF_DL_SRCMEM_FREE_QUE();
    CDS_ASSERT(VOS_NULL_PTR != pstDlFreeQue);

    for (ulCnt = 0; ulCnt < ulSaveNum; ulCnt ++)
    {
        if (PS_SUCC != LUP_EnQue(pstDlFreeQue,pstIpfDlBdBuff[ulCnt].pstSrcTtf))
        {
            CDS_ERROR_LOG2(UEPS_PID_CDS,"CDS_SaveIpfDlMemInfo: Src Mem Leak.",ulCnt,ulSaveNum);
            vos_printf("CDS_SaveIpfDlMemInfo: Buffer Full!! cnt=%d,ulSaveNum=%d\n",ulCnt,ulSaveNum);
            CDS_DBG_DL_IPF_SAVE_SRCMEM_FAIL_NUM(1);
            continue;
        }

        CDS_DBG_DL_IPF_SAVE_SRCMEM_SUCC_NUM(1);
    }

    return ;
}
コード例 #4
0
/*****************************************************************************
 函 数 名  : Cds_LomTraceSendDlData
 功能描述  : 用户面时延Trace,用于记录CDS发送下行数据时间戳
 输入参数  :
 输出参数  : 无
 返 回 值  : 无
 调用函数  :
 被调函数  :

 修改历史      :
  1.日    期   : 2012年5月23日
    作    者   : hujianbo 42180
    修改内容   : 新生成函数

*****************************************************************************/
VOS_VOID Cds_LomTraceSendDlData(VOS_VOID)
{
    if (1 == g_ulCdsOmSwitch)
    {
        CDS_ERROR_LOG(UEPS_PID_CDS, "User plane latency trace: CDS send dl data\n");
    }

    return;
}
コード例 #5
0
VOS_VOID CDS_SendNdDataIndMsg(TTF_MEM_ST *pstNdPkt, VOS_UINT8 ucRabId, const CDS_ENTITY_STRU *pstCdsEntity)
{
    CDS_NDCLIENT_ND_DATA_IND_STRU  *pstDataInd;
    VOS_UINT32                      ulMsgLen;
    VOS_UINT32                      ulPktLen;

    CDS_ASSERT(VOS_NULL_PTR != pstNdPkt);
    CDS_ASSERT(VOS_NULL_PTR != pstCdsEntity);

    CDS_INFO_LOG1(UEPS_PID_CDS,"Enter CDS_SendNdDataIndMsg.ucRabid=",ucRabId);

    /*申请消息内存*/
    ulPktLen = TTF_MemGetLen(UEPS_PID_CDS,pstNdPkt);
    ulMsgLen = sizeof(CDS_NDCLIENT_ND_DATA_IND_STRU) + ulPktLen;
    pstDataInd = CDS_ALLOC_MSG_WITH_HDR(ulMsgLen);
    if (VOS_NULL_PTR == pstDataInd)
    {
        CDS_ERROR_LOG1(UEPS_PID_CDS,"CDS_SendNdDataIndMsg : Alloc Msg Fail. Size=",ulMsgLen);
        return;
    }

    /*填写消息内容*/
    CDS_CFG_MSG_HDR(pstDataInd,UEPS_PID_NDCLIENT);
    pstDataInd->enMsgId   = ID_CDS_NDCLIENT_ND_DATA_IND;
    pstDataInd->enModemId = pstCdsEntity->usModemId;
    pstDataInd->ucRabId   = ucRabId;
    pstDataInd->ulLen     = ulPktLen;

    /*内存拷贝*/
    if (PS_SUCC != TTF_MemGetHeadData(UEPS_PID_CDS,
                                      pstNdPkt,
                                      pstDataInd->aucData,
                                      (VOS_UINT16)ulPktLen))
    {
        /*lint -e961*/
        PS_FREE_MSG(UEPS_PID_CDS, pstDataInd);
        /*lint +e961*/
        CDS_ERROR_LOG(UEPS_PID_CDS,"CDS_SendNdDataIndMsg : TTF_MemGetHeadData Error.");
        return ;
    }

    /*发送消息*/
    CDS_SEND_MSG(pstDataInd);

    CDS_INFO_LOG(UEPS_PID_CDS,"Leave CDS_SendNdDataIndMsg Succ.");

    return;
}
コード例 #6
0
VOS_VOID CDS_StopAdqEmptyProctectTmr(VOS_VOID)
{
    /*已停止*/
    if (VOS_NULL_PTR == CDS_GET_ADQ_EMPTY_TMR_PTR())
    {
        return ;
    }

    if (VOS_OK != PS_STOP_REL_TIMER(&(CDS_GET_ADQ_EMPTY_TMR_PTR())))
    {
        CDS_ERROR_LOG(UEPS_PID_CDS,"CDS_StopAdqEmptyProctectTmr : Stop Timer Fail ");
        return ;
    }

    CDS_DBG_UL_ADQ_STOP_EMPTY_TMR_NUM(1);

    return ;
}
コード例 #7
0
VOS_VOID QosFc_SetRabEntity(QOS_FC_RAB_ENTITY_STRU *pstQosFcRabEntity, CONST QOS_FC_RAB_CREATE_IND_STRU *pstRabCreate)
{
    if((VOS_NULL_PTR == pstRabCreate) || (VOS_NULL_PTR == pstQosFcRabEntity))
    {
        CDS_ERROR_LOG(UEPS_PID_CDS,"QosFc_SetRabEntity : Invalid parameter!");
        return;
    }
    pstQosFcRabEntity->ucRabId = pstRabCreate->ucRabId;
    pstQosFcRabEntity->enQci = pstRabCreate->enQci;
    pstQosFcRabEntity->ucPriority = g_ucQosFcQci2Priority[pstRabCreate->enQci];
    pstQosFcRabEntity->ucLinkRabId = pstRabCreate->ucLinkRabId;
    pstQosFcRabEntity->enRabState = QOS_FC_RAB_STATE_NORMAL;

    QosFc_UpdateRabStatus(pstRabCreate->ucRabId, QOS_FC_RAB_STATE_NORMAL);

    return;

}
コード例 #8
0
VOS_VOID CDS_AllocMemForAdq(VOS_VOID)
{
    BSP_U32             ulAd0CanCfgNum    = 0;
    BSP_U32             ulAd1CanCfgNum    = 0;
    VOS_UINT32          ulAd0CfgNum       = CDS_IPF_ULAD_DESC_SIZE;
    VOS_UINT32          ulAd1CfgNum       = CDS_IPF_ULAD_DESC_SIZE;


    /*获得AD0/AD1 可配置AD个数*/
    if (IPF_SUCCESS != BSP_IPF_GetUlAdNum(&ulAd0CanCfgNum,&ulAd1CanCfgNum))
    {
        return;
    }

    /*配置AD0*/
    if (0 != ulAd0CanCfgNum)
    {
        ulAd0CfgNum = CDS_ConfigUlAdq(IPF_AD_0,ulAd0CanCfgNum);
        CDS_DBG_UL_ADQ_CFG_AD0_NUM(ulAd0CfgNum);
    }

    /*配置AD1*/
    if (0 != ulAd1CanCfgNum)
    {
        ulAd1CfgNum = CDS_ConfigUlAdq(IPF_AD_1,ulAd1CanCfgNum);
        CDS_DBG_UL_ADQ_CFG_AD1_NUM(ulAd1CfgNum);
    }

    /*只要有一个队列没有配置新内存,则启动保护定时器*/
    if (((CDS_IPF_ULAD_START_TMR_THRESHOLD < ulAd0CanCfgNum) && (0 == ulAd0CfgNum))
       || ((CDS_IPF_ULAD_START_TMR_THRESHOLD < ulAd1CanCfgNum) && (0 == ulAd1CfgNum)))
    {
        /*启动保护定时器*/
        if (PS_SUCC != CDS_StartAdqEmptyProctectTmr())
        {
            CDS_ERROR_LOG(UEPS_PID_CDS,"CDS_AllocMemForAdq : Start Protect Timer Fail.");
            return;
        }
    }

    return;
}
コード例 #9
0
VOS_UINT32 CDS_EnableDlIPFFilter(VOS_UINT16  usModemId)
{
    IPF_FILTER_CHAIN_TYPE_E  enFCType;

    /*根据ModemId区分过滤器首地址*/
    if (MODEM_ID_0 == usModemId)
    {
        enFCType = IPF_MODEM0_DLFC;
    }
    else if (MODEM_ID_1 == usModemId)
    {
        enFCType = IPF_MODEM1_DLFC;
    }
    else
    {
        CDS_ERROR_LOG2(UEPS_PID_CDS, "CDS_EnableDlIPFFilter : Input Para Error. ModemId,MaxModemNum:", usModemId,CDS_MAX_MODEM_NUM);
        return PS_FAIL;
    }

    /*改变下行IPF过滤器的类型*/
    if (PS_SUCC != CDS_ChangeDlIpfFilterType(usModemId))
    {
        CDS_ERROR_LOG(UEPS_PID_CDS, "CDS_EnableDlIPFFilter : Change DL Filter Type Fail.");
        return PS_FAIL;
    }

    /*将已设置好的过滤器配置给下行IPF*/
    if (IPF_SUCCESS != BSP_IPF_SetFilter(enFCType,
                                         CDS_GET_DL_IPF_FILTER_ARRAY(),
                                         CDS_GET_DL_IPF_FILTER_NUM()))
    {
        CDS_ERROR_LOG1(UEPS_PID_CDS, "CDS_EnableDlIPFFilter : Enable Dl IPF Filter Fail.Filter Num:", CDS_GET_DL_IPF_FILTER_NUM());
        return PS_FAIL;
    }
    else
    {
        CDS_INFO_LOG(UEPS_PID_CDS, "CDS_EnableDlIPFFilter : Enable Dl IPF Filter Success.");
        return PS_SUCC;
    }
}
コード例 #10
0
VOS_UINT32 QosFc_RestartCheckTmr(VOS_VOID)
{
    /*已运行*/
    if (VOS_NULL_PTR != g_stQosFcCtrl.hTimer)
    {
        (VOS_VOID)PS_STOP_REL_TIMER(&(g_stQosFcCtrl.hTimer));
    }

    if (VOS_OK != PS_START_REL_TIMER(&(g_stQosFcCtrl.hTimer),
                                    UEPS_PID_CDS,
                                    g_stQosFcCtrl.ulTimerLen,
                                    CDS_TMR_ID_FC_CHECK_TMR,
                                    0,
                                    VOS_RELTIMER_NOLOOP))
    {
        /*ERROR LOG*/
        CDS_ERROR_LOG(UEPS_PID_CDS,"QosFc_RestartCheckTmr : Fail to Start FC Tmr.");
        return PS_FAIL;
    }

    return PS_SUCC;
}
コード例 #11
0
VOS_UINT32 CDS_StartAdqEmptyProctectTmr(VOS_VOID)
{

    /*已运行*/
    if (VOS_NULL_PTR != CDS_GET_ADQ_EMPTY_TMR_PTR())
    {
        return PS_SUCC;
    }

    if (VOS_OK != PS_START_REL_TIMER(&(CDS_GET_ADQ_EMPTY_TMR_PTR()),
                                    UEPS_PID_CDS,
                                    CDS_IPF_AD_EMPTY_PROTECT_TMR_LEN,
                                    CDS_TMR_ID_ADQ_EMPTY_PROCTECT,
                                    0,
                                    VOS_RELTIMER_NOLOOP))
    {
        CDS_ERROR_LOG(UEPS_PID_CDS,"CDS_StartAdqEmptyProctectTmr : Start Timer Fail ");
        return PS_FAIL;
    }

    CDS_DBG_UL_ADQ_START_EMPTY_TMR_NUM(1);

    return PS_SUCC;
}
コード例 #12
0
VOS_UINT32 CDS_RxDataFromImsNIC(const VOS_UINT8 *pData, VOS_UINT16 usLen,MODEM_ID_ENUM_UINT16 enModemId)
{
    CDS_ENTITY_STRU             *pstCdsEntity;
    TTF_MEM_ST                  *pstTtfPkt;
    VOS_INT32                    lLock;

    CDS_DBG_IMS_UL_RX_FUN_CALL_NUM(1);

    /*入参判断*/
    if (VOS_NULL_PTR == pData)
    {
        CDS_ERROR_LOG(UEPS_PID_CDS, "CDS_RxPktFromImsNIC:Input Para is NULL");
        CDS_DBG_IMS_UL_RX_FUN_PARA_ERR(1);
        return PS_FAIL;
    }

    if ((0 == usLen) || (usLen > ETH_MAX_MTU))
    {
        CDS_ERROR_LOG1(UEPS_PID_CDS,"CDS_RxPktFromImsNIC ; Packet Length Error.",usLen);
        CDS_DBG_IMS_UL_RX_FUN_PARA_ERR(1);
        return PS_FAIL;
    }

    pstCdsEntity = CDS_GetCdsEntity(enModemId);
    if (VOS_NULL_PTR == pstCdsEntity)
    {
        CDS_ERROR_LOG1(UEPS_PID_CDS,"CDS_RxPktFromImsNIC ; Modem ID Error.",enModemId);
        CDS_DBG_IMS_UL_RX_FUN_PARA_ERR(1);
        return PS_FAIL;
    }

    CDS_DBG_IMS_UL_RX_NIC_PKT_NUM(1);

    /*申请TTF内存,并将其拷贝到TTF内存中*/
    pstTtfPkt = CDS_AllocTtfMem(usLen);
    if (VOS_NULL_PTR == pstTtfPkt)
    {
        CDS_ERROR_LOG(UEPS_PID_CDS,"CDS_RxDataFromImsNIC: Alloc Mem Fail.");
        CDS_DBG_IMS_UL_ALLOC_MEM_FAIL_NUM(1);
        return PS_FAIL;
    }
    PS_MEM_CPY(pstTtfPkt->pData,pData,usLen);

    /*入队*/
    lLock = VOS_SplIMP();
    if (PS_SUCC != LUP_EnQue(pstCdsEntity->pstIMSDataQue,pstTtfPkt))
    {
        VOS_Splx(lLock);
        CDS_DBG_IMS_UL_EN_QUE_FAIL_NUM(1);
        TTF_MemFree(UEPS_PID_CDS, pstTtfPkt);
        CDS_SendEventToCds(CDS_EVENT_UL_IMS_PROC);
        CDS_DBG_IMS_UL_TRIGGER_IMS_EVENT_NUM(1);
        return PS_FAIL;
    }
    VOS_Splx(lLock);
    CDS_DBG_IMS_UL_EN_QUE_SUCC_NUM(1);

    /*wakeup cds*/
    CDS_SendEventToCds(CDS_EVENT_UL_IMS_PROC);
    CDS_DBG_IMS_UL_TRIGGER_IMS_EVENT_NUM(1);
    return PS_SUCC;
}
コード例 #13
0
VOS_VOID QosFc_RabCreate(CONST MsgBlock  *pstMsg)
{
    QOS_FC_RAB_CREATE_IND_STRU *pstRabCreate = (QOS_FC_RAB_CREATE_IND_STRU *)(VOS_VOID*)pstMsg;
    QOS_FC_RAB_ENTITY_STRU *pstQosFcRabEntity = VOS_NULL_PTR;
    QCI_TYPE_ENUM_UINT8     enQci;
    VOS_UINT8               ucOldLinkRabId = FC_INVALID_RABID;
    MODEM_ID_ENUM_UINT16    enModemId;

    FC_DBG_CREATE_MSG_STAT(1);

    /*入参判断*/
    if (VOS_NULL_PTR == pstRabCreate)
    {
        CDS_ERROR_LOG(UEPS_PID_CDS, "QosFc_RabCreate : NULL pointer");
        return;
    }

    /*lint -e960*/
    if(QosFc_IsInValidRabId(pstRabCreate->ucRabId)
        || QosFc_IsInValidRabId(pstRabCreate->ucLinkRabId)
        || (pstRabCreate->enQci < QCI_TYPE_QCI1_GBR)
        || (pstRabCreate->enQci > QCI_TYPE_QCI9_NONGBR))
    {
        CDS_ERROR_LOG3(UEPS_PID_CDS, "QosFc_RabCreate : Invalid MSG RabId: LinkRabId: Qci:",
                                pstRabCreate->ucRabId, pstRabCreate->ucLinkRabId, pstRabCreate->enQci);
        return;
    }
    /*lint +e960*/

    /* 流控都按拼接处理 */
    enModemId = VOS_GetModemIDFromPid(TTF_GET_MSG_SENDER_PID(pstRabCreate));
    if (MODEM_ID_BUTT <= enModemId)
    {
        CDS_ERROR_LOG1(UEPS_PID_CDS, "QosFc_RabCreate : ModemId Error",enModemId);
        return;
    }

    /*lint -e734*/
    pstRabCreate->ucRabId |= (enModemId << FC_MODEMID_SHIFT);
    pstRabCreate->ucLinkRabId |= (enModemId << FC_MODEMID_SHIFT);
    /*lint +e734*/

    pstQosFcRabEntity = QosFc_CreateRabEntity(pstRabCreate, &ucOldLinkRabId);

    if(VOS_NULL_PTR != pstQosFcRabEntity)
    {
        /* 获得PDN上最高的QCI */
        enQci = QosFc_GetPdnQci(pstRabCreate->ucLinkRabId);
        QosFc_UpdateChannelQos(pstRabCreate->ucLinkRabId, enQci);
        /* 新建承载处于非流控状态,打开数传通道 */
        QosFc_ChannelRestore(pstRabCreate->ucLinkRabId);

        if((FC_INVALID_RABID != ucOldLinkRabId)
                && (ucOldLinkRabId != pstRabCreate->ucLinkRabId))
        {
            /* 获得PDN上最高的QCI */
            enQci = QosFc_GetPdnQci(ucOldLinkRabId);
            QosFc_UpdateChannelQos(ucOldLinkRabId, enQci);
            /* PDN是否需要流控 */
            /*lint -e960*/
            if((QCI_TYPE_BUTT != enQci) && (FC_INVALID_RABID == QosFc_OtherAvailRabOfPdn(ucOldLinkRabId)))
            /*lint +e960*/
            {
                QosFc_ChannelControl(ucOldLinkRabId);
            }
        }
    }

    return;

}
コード例 #14
0
QOS_FC_RAB_ENTITY_STRU* QosFc_CreateRabEntity(CONST QOS_FC_RAB_CREATE_IND_STRU *pstRabCreate, VOS_UINT8 *pucOldLinkRabId)
{
    VOS_UINT8   ucPriority;             /* 承载优先级 */
    VOS_UINT32  i;
    VOS_UINT32  idx = FC_MAX_RAB_NUM;

    if((VOS_NULL_PTR == pstRabCreate) || (VOS_NULL_PTR == pucOldLinkRabId))
    {
        CDS_ERROR_LOG(UEPS_PID_CDS,"QosFc_CreateRabEntity : Invalid parameter!");
        return VOS_NULL_PTR;
    }

    for(i = 0; i < FC_MAX_RAB_NUM; i++)
    {
        if((pstRabCreate->ucRabId == g_stQosFcRabEntity[i].ucRabId)
            || (FC_INVALID_RABID == g_stQosFcRabEntity[i].ucRabId))
        {
            break;
        }
    }

    if( FC_MAX_RAB_NUM == i )
    {
        /* 出现异常,超出可支持数量 */
        CDS_ERROR_LOG1(UEPS_PID_CDS,"QosFc_CreateRabEntity : too many Rab Entity, fail to create Entity: ",pstRabCreate->ucRabId);
        return VOS_NULL_PTR;
    }

    ucPriority = g_ucQosFcQci2Priority[pstRabCreate->enQci];

    /* 新建承载 */
    if(FC_INVALID_RABID == g_stQosFcRabEntity[i].ucRabId)
    {
        /* 逆序排列,高 -> 低 */
        idx = QosFc_MoveUpEntityPos(i, ucPriority);

        /* 增加实体计数 */
        g_iRabEntityCnt++;
        if((g_iRabEntityCnt < 0)
            || (g_iRabEntityCnt > FC_MAX_RAB_NUM))
        {
            CDS_ERROR_LOG1(UEPS_PID_CDS, "QosFc_CreateRabEntity : Error g_iRabEntityCnt:", g_iRabEntityCnt);
            g_iRabEntityCnt = FC_MAX_RAB_NUM;
        }

        CDS_WARNING_LOG4(UEPS_PID_CDS, "QosFc_CreateRabEntity : Create Entity RabId: LinkRabId: Qci: Prio:",
                        pstRabCreate->ucRabId, pstRabCreate->ucLinkRabId, pstRabCreate->enQci, ucPriority);

        FC_DBG_CREATE_RAB_STAT(1);
    }
    else
    {
        FC_DBG_UPDATE_RAB_STAT(1);
        *pucOldLinkRabId = g_stQosFcRabEntity[i].ucLinkRabId;

        CDS_WARNING_LOG3(UEPS_PID_CDS, "QosFc_CreateRabEntity : Update Entity  FROM  RabId: LinkRabId: Qci: ",
                        g_stQosFcRabEntity[i].ucRabId, g_stQosFcRabEntity[i].ucLinkRabId, g_stQosFcRabEntity[i].enQci);
        CDS_WARNING_LOG4(UEPS_PID_CDS, "QosFc_CreateRabEntity : Update Entity  TO  RabId: LinkRabId: Qci: Prio:",
                        pstRabCreate->ucRabId, pstRabCreate->ucLinkRabId, pstRabCreate->enQci, ucPriority);

        /* 更新承载 */
        /*if(pstRabCreate->ucRabId == g_stQosFcRabEntity[i].ucRabId)
 */
        {
            if(ucPriority == g_stQosFcRabEntity[i].ucPriority)
            {
                /* 优先级保持不变,实体排序不变 */
                idx = i;;
            }
            else if(ucPriority > g_stQosFcRabEntity[i].ucPriority)
            {
                idx = QosFc_MoveDownEntityPos(i, ucPriority);
            }
            else
            {
                idx = QosFc_MoveUpEntityPos(i, ucPriority);
            }
        }
    }

    if(FC_MAX_RAB_NUM <= idx)
    {
        CDS_ERROR_LOG1(UEPS_PID_CDS, "QosFc_CreateRabEntity : Error Insert Position: ", idx);
        return VOS_NULL_PTR;
    }

    /* 承载恢复正常数传态 */
    QosFc_SetRabEntity(&g_stQosFcRabEntity[idx], pstRabCreate);

    return &g_stQosFcRabEntity[idx];
}