Esempio n. 1
0
/*lint -e961*/
VOS_VOID NAS_ESM_InitAttachBearerReestInfo()
{
    VOS_UINT32 ulResult;
    NAS_ESM_ENTITY_STRU *pEsmEntityInfo = NAS_ESM_Entity();
    LNAS_ESM_NV_ATTACH_BEARER_REEST_STRU stTmpAttachBearerNvData = {0};
    /*lint -e718*/
    /*lint -e732*/
    /*lint -e516*/
    ulResult = LPs_NvimItem_Read((EN_NV_ID_ATTACH_BEARER_RE_ESTABLISH),\
                                 (VOS_VOID *)(&stTmpAttachBearerNvData),\
                                 sizeof(LNAS_ESM_NV_ATTACH_BEARER_REEST_STRU));
    /*lint +e516*/
    /*lint +e732*/
    /*lint +e718*/
    /* 判断读取结果 */
    if (ulResult != ERR_MSP_SUCCESS)
    {
        /*打印异常信息*/
        NAS_ESM_ERR_LOG("NAS_ESM_AttachBearerReestInfoInit:ERROR: Cannot Read from NV .");

        stTmpAttachBearerNvData.bitOpAttachBearerReest = NAS_ESM_OP_FALSE;
        stTmpAttachBearerNvData.ulReestTimeLen = 0;
    }

    /*  判断读取参数的有效性 */
    if ((NAS_ESM_OP_TRUE == stTmpAttachBearerNvData.bitOpAttachBearerReest) &&
            (stTmpAttachBearerNvData.ulReestTimeLen > TI_NAS_ESM_ATTACH_BEARER_REEST_TIMER_LEN))
    {
        NAS_ESM_ERR_LOG("NAS_ESM_AttachBearerReestInfoInit:Timer is too long, use default value");
        stTmpAttachBearerNvData.ulReestTimeLen = TI_NAS_ESM_ATTACH_BEARER_REEST_TIMER_LEN;
    }

    /* 拷贝有效数据到ESM Entity */
    pEsmEntityInfo->stAttachBearerReestInfo.stNvData.bitOpAttachBearerReest= stTmpAttachBearerNvData.bitOpAttachBearerReest;
    pEsmEntityInfo->stAttachBearerReestInfo.stNvData.bitOpRsv = 0;
    pEsmEntityInfo->stAttachBearerReestInfo.stNvData.ulReestTimeLen =
        stTmpAttachBearerNvData.ulReestTimeLen * 1000;

    pEsmEntityInfo->stAttachBearerReestInfo.ulEpsbId = NAS_ESM_UNASSIGNED_EPSB_ID;

    NAS_ESM_MEM_SET(&(pEsmEntityInfo->stAttachBearerReestInfo.stTimerInfo), 0, sizeof(NAS_ESM_TIMER_STRU));
    pEsmEntityInfo->stAttachBearerReestInfo.stTimerInfo.enPara = TI_NAS_ESM_ATTACH_BEARER_REEST;

    NAS_ESM_INFO_LOG2("NAS_ESM_AttachBearerReestInfoInit: Param ",
                      pEsmEntityInfo->stAttachBearerReestInfo.stNvData.bitOpAttachBearerReest,
                      pEsmEntityInfo->stAttachBearerReestInfo.stNvData.ulReestTimeLen);
}
/*lint -e961*/
VOS_VOID NAS_ESM_ProcTimerMsgWaitPtiInvaidExp(const VOS_VOID * pMsg)
{
    VOS_UINT32                          ulEsmBuffIndex      = NAS_ESM_NULL;
    NAS_ESM_PTI_BUFF_ITEM_STRU         *pstPtiBuffItem      = VOS_NULL_PTR;

    /* 获取消息中包含的ESM缓存记录索引号 */
    ulEsmBuffIndex = PS_GET_REL_TIMER_NAME(pMsg);

    /* 获取缓存记录 */
    pstPtiBuffItem = (NAS_ESM_PTI_BUFF_ITEM_STRU*)
                            NAS_ESM_GetBuffItemAddr(NAS_ESM_BUFF_ITEM_TYPE_PTI, ulEsmBuffIndex);

    if (pstPtiBuffItem == VOS_NULL_PTR)
    {
        NAS_ESM_WARN_LOG("NAS_ESM_ProcTimerMsgWaitPtiInvaidExp:WARN:Get buffer item failed!");
        return ;
    }

    NAS_ESM_INFO_LOG2("NAS_ESM_ProcTimerMsgWaitPtiInvaidExp:NORM:PTI is deleted from Esm Buffer!",
                       pstPtiBuffItem->ucPti, ulEsmBuffIndex);

    /* 清除缓存记录 */
    NAS_ESM_ClearEsmBuffItem(NAS_ESM_BUFF_ITEM_TYPE_PTI, ulEsmBuffIndex);
}