BST_VOID BST_OS_PalTimerStop( BST_VOID )
{
    if ( VOS_NULL_PTR == g_BstTimer )
    {
        return;
    }
    if ( VOS_OK != PS_STOP_REL_TIMER( &g_BstTimer ) )
    {
        BST_RLS_LOG( "BST_OS_PalTimerStart : Start(Stop) Tmr Fail." );
    }
}
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 ;
}
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;
}
BST_VOID BST_OS_PalTimerStart( BST_UINT32 ulLength )
{
    BST_RLS_LOG1( "BST_OS_PalTimerStart : Length.", ulLength );
    if ( VOS_NULL_PTR != g_BstTimer )
    {
        if ( VOS_OK != PS_STOP_REL_TIMER( &g_BstTimer ) )
        {
            BST_RLS_LOG( "BST_OS_PalTimerStart : Start(Stop) Tmr Fail." );
            return;
        }
    }
    if ( VOS_OK != PS_START_REL_TIMER(  &g_BstTimer,
                                        UEPS_PID_BASTET,
                                        ulLength,
                                        0,
                                        0,
                                        VOS_RELTIMER_NOLOOP) )
    {
        BST_RLS_LOG( "BST_OS_PalTimerStart : Start Tmr Fail." );
        return ;
    }
}
Beispiel #5
0
/*****************************************************************************
 Prototype      : Ppp_ReleasePppReq
 Description    : 为AT模块"释放PPP链路"提供对应的API函数。

 Input          : ---要释放的PPP链路对应的PPP ID
 Output         : ---
 Return Value   : ---VOS_UINT32
 Calls          : ---
 Called By      : ---

 History        : ---
  1.Date        : 2005-11-18
    Author      : ---
    Modification: Created function
*****************************************************************************/
VOS_UINT32 Ppp_ReleasePppReq ( PPP_ID usPppId)
{
    VOS_UINT32                          ulRet;


    /* 可维可测信息上报*/
    Ppp_EventMntnInfo(usPppId, AT_PPP_RELEASE_PPP_REQ);

    if(VOS_OK != PppIsIdValid(usPppId))
    {
        return VOS_ERR;
    }

    /* 如果当前PPP在PHASE_NETWORK阶段,属于网侧主动去激活
       此时PPP等待和PC间PPP协议结束后通知AT拉管脚信号,并起定时器保护*/
    if (PHASE_NETWORK == (PPP_LINK(usPppId)->phase))
    {
        if (VOS_NULL_PTR != (PPP_LINK(usPppId)->lcp.hLcpCloseTimer))
        {
            PS_STOP_REL_TIMER(&(PPP_LINK(usPppId)->lcp.hLcpCloseTimer));
            PPP_LINK(usPppId)->lcp.hLcpCloseTimer= VOS_NULL_PTR;
        }

        /*起定时器,确保通知拉AT管脚信号*/
        ulRet = VOS_StartRelTimer(&(PPP_LINK(usPppId)->lcp.hLcpCloseTimer),  PS_PID_APP_PPP,
            1000,  usPppId,  PHASE_TERMINATE_PENDING,  VOS_RELTIMER_NOLOOP,  VOS_TIMER_PRECISION_5 );

        if (VOS_OK != ulRet)
        {
            PPP_LINK(usPppId)->lcp.hLcpCloseTimer = VOS_NULL_PTR;
            PPP_ProcPppDisconnEvent(usPppId);
        }
    }

    /*首先调用PPP模块对应的函数*/
    fsm_Close(&(PPP_LINK(usPppId)->ipcp.fsm));
    fsm_Close(&(PPP_LINK(usPppId)->lcp.fsm));

    /*停止IPCP状态机定时器:*/
    if( VOS_NULL_PTR !=((PPP_LINK(usPppId))->ipcp.fsm.timer) )
    {
        VOS_StopRelTimer(&((PPP_LINK(usPppId))->ipcp.fsm.timer));
        (PPP_LINK(usPppId))->ipcp.fsm.timer = VOS_NULL_PTR;
    }

    /*停止CHAP状态机定时器:*/
    if( VOS_NULL_PTR !=((PPP_LINK(usPppId))->chap.auth.hAuthTimer) )
    {
        VOS_StopRelTimer(&((PPP_LINK(usPppId))->chap.auth.hAuthTimer));
        (PPP_LINK(usPppId))->chap.auth.hAuthTimer = VOS_NULL_PTR;
    }

    /*停止LCP状态机定时器:*/
    if( VOS_NULL_PTR !=((PPP_LINK(usPppId))->lcp.fsm.timer) )
    {
        VOS_StopRelTimer(&((PPP_LINK(usPppId))->lcp.fsm.timer));
        (PPP_LINK(usPppId))->lcp.fsm.timer = VOS_NULL_PTR;
    }

    /*释放待PDP激活定时器*/
    if (VOS_NULL_PTR != (PPP_LINK(usPppId)->ipcp.hIpcpPendTimer))
    {
        PS_STOP_REL_TIMER(&(PPP_LINK(usPppId)->ipcp.hIpcpPendTimer));
        PPP_LINK(usPppId)->ipcp.hIpcpPendTimer = VOS_NULL_PTR;
    }

    /*释放待处理IPCP帧*/
    if (VOS_NULL_PTR != (PPP_LINK(usPppId)->ipcp.pstIpcpPendFrame))
    {
        ppp_m_freem(PPP_LINK(usPppId)->ipcp.pstIpcpPendFrame);
        PPP_LINK(usPppId)->ipcp.pstIpcpPendFrame = VOS_NULL_PTR;
    }

    PppFreeId(usPppId);

    /* 不用释放PPP数据队列,因为只要队列里面有数据,PPP任务就会被调度起来处理,
       如果HDLC处理完成而PPP实体已经释放,那么封装或解封装出来的数据自然会被丢弃。
       这个API会在AT任务里被调用,如果这里把数据放掉,PPP任务有可能正在使用 */
    /* PPP_ClearDataQ(); */

    /*返回正确*/
    return VOS_OK;
}
VOS_VOID NAS_ERABM_TimerStop( NAS_ERABM_TIMER_NAME_ENUM_UINT8 enTimerName )
{
    NAS_ERABM_START_TIMER_STRU       *pstTimerInfo = VOS_NULL_PTR;
    VOS_UINT32                        ulTimerRemainLen;

    /*如果ucTimerName对应的定时器处于启动状态,则停止;否则,忽略*/
    pstTimerInfo = NAS_ERABM_GetRbTimer(enTimerName);

    if ( VOS_NULL_PTR == pstTimerInfo )
    {
        NAS_ERABM_WARN_LOG("NAS_ERABM_TimerStop: pstStateTimer NULL.");
        return ;
    }

    if (VOS_NULL_PTR != pstTimerInfo->stHTimer)
    {
        /* 获取当前定时器的剩余时间 */
        if (VOS_OK != VOS_GetRelTmRemainTime(&(pstTimerInfo->stHTimer), &ulTimerRemainLen ))
        {
            ulTimerRemainLen = 0;
        }

        /*关闭失败,则报警返回*/
        if (VOS_OK != PS_STOP_REL_TIMER(&(pstTimerInfo->stHTimer)))
        {
            NAS_ERABM_ERR_LOG("NAS_ERABM_TimerStop: stop reltimer fail ");
            return;
        }

        /*更新定时器超时次数*/
        pstTimerInfo->ucExpireTimes = 0;


        /*钩出当前的定时器信息 */
        NAS_ERABM_SndOmErabmTimerStatus(NAS_ERABM_TIMER_STOPED, enTimerName, ulTimerRemainLen);


        /*根据定时器的不同类型,打印相应信息*/
        switch (enTimerName)
        {
            case NAS_ERABM_WAIT_EPSB_ACT_TIMER:
                NAS_ERABM_NORM_LOG("NAS_ERABM_TimerStop:NORM:RABM TimerStop: NAS_ERABM_RB_WAIT_EPSB_ACT_TIMER");
                break;

            case NAS_ERABM_WAIT_RB_REEST_TIMER:
                NAS_ERABM_NORM_LOG("NAS_ERABM_TimerStop:NORM:RABM TimerStop: NAS_ERABM_WAIT_RB_REEST_TIMER");
                break;

            case NAS_ERABM_WAIT_RB_RESUME_TIMER:
                NAS_ERABM_NORM_LOG("NAS_ERABM_TimerStop:NORM:RABM TimerStop: NAS_ERABM_WAIT_RB_RESUME_TIMER");
                break;

            case NAS_ERABM_WAIT_TC_FREE_BUFFER_TIMER:
                NAS_ERABM_NORM_LOG("NAS_ERABM_TimerStop:NORM:RABM TimerStop: NAS_ERABM_WAIT_TC_FREE_BUFFER_TIMER");
                break;

            default:
                NAS_ERABM_ERR_LOG("NAS_ERABM_TimerStop:ERROR: stop unreasonable reltimer.");
                break;
        }
    }
}
VOS_VOID NAS_ERABM_TimerStart
(
    VOS_UINT32                          ulTimerLen,
    NAS_ERABM_TIMER_NAME_ENUM_UINT8     enTimerName,
    VOS_UINT32                          ulTimerPara
)
{
    NAS_ERABM_START_TIMER_STRU       *pstTimerInfo = VOS_NULL_PTR;

    /*打印进入该函数*/
    NAS_ERABM_INFO_LOG("NAS_ERABM_TimerStart is entered.");

    /*获取RABM实体中的定时器结构地址指针*/
    pstTimerInfo = NAS_ERABM_GetRbTimer(enTimerName);

    if ( VOS_NULL_PTR == pstTimerInfo )
    {
        NAS_ERABM_WARN_LOG("NAS_ERABM_TimerStart: pstStateTimer NULL.");
        return ;
    }

    /*判断定时器是否打开,打开则关闭*/
    if (VOS_NULL_PTR != pstTimerInfo->stHTimer)
    {
        if (VOS_OK != PS_STOP_REL_TIMER(&(pstTimerInfo->stHTimer)))
        {
            NAS_ERABM_ERR_LOG("NAS_ERABM_TimerStart: start reltimer error1 ");
            return;
        }

        NAS_ERABM_LOG1("(TimerType) Timer not close!", (VOS_INT32)enTimerName);
    }

    if(NAS_ERABM_NULL == ulTimerLen)
    {
        NAS_ERABM_WARN_LOG("NAS_ERABM_TimerStart:WARN: TimerLen = 0");
        return;
    }
	/* lihong00150010 emergency tau&service begin */
    /*设定定时器LENGTH和NAME,打开失败则报警返回*/
    if (VOS_OK !=
            PS_START_REL_TIMER(&(pstTimerInfo->stHTimer),PS_PID_RABM,
                                ulTimerLen,(VOS_UINT32)enTimerName, ulTimerPara,
                                VOS_RELTIMER_NOLOOP))
    {
        NAS_ERABM_WARN_LOG("NAS_ERABM_TimerStart:WARN: start reltimer error2");
        return;
    }
	/* lihong00150010 emergency tau&service end */

    /*钩出当前的定时器信息 */
    NAS_ERABM_SndOmErabmTimerStatus(NAS_ERABM_TIMER_RUNNING, enTimerName, ulTimerLen);


    /*更新定时器开启信息和定时器类别*/
    pstTimerInfo->enName   = enTimerName;

    /*根据定时器的不同类型,打印相应信息*/
    switch (enTimerName)
    {
        case NAS_ERABM_WAIT_EPSB_ACT_TIMER:
            NAS_ERABM_NORM_LOG("NAS_ERABM_TimerStart:NORM:RABM TimerStart: NAS_ERABM_RB_WAIT_EPSB_ACT_TIMER");
            break;

        case NAS_ERABM_WAIT_RB_REEST_TIMER:
            NAS_ERABM_NORM_LOG("NAS_ERABM_TimerStart:NORM:RABM TimerStart: NAS_ERABM_WAIT_RB_REEST_TIMER");
            break;

        case NAS_ERABM_WAIT_RB_RESUME_TIMER:
            NAS_ERABM_NORM_LOG("NAS_ERABM_TimerStart:NORM:RABM TimerStart: NAS_ERABM_WAIT_RB_RESUME_TIMER");
            break;

        case NAS_ERABM_WAIT_TC_FREE_BUFFER_TIMER:
            NAS_ERABM_NORM_LOG("NAS_ERABM_TimerStart:NORM:RABM TimerStart: NAS_ERABM_WAIT_TC_FREE_BUFFER_TIMER");
            break;

        default:
            NAS_ERABM_ERR_LOG("NAS_ERABM_TimerStart:ERROR: start unreasonable reltimer.");
            break;
    }
}