VOS_VOID NAS_ESM_ClearEsmResoureWhenEstingEmcPdn(VOS_VOID) { VOS_UINT32 ulCnt = 0; NAS_ESM_INFO_LOG("NAS_ESM_ClearEsmResoureWhenEstingEmcPdn: enter"); /*设置ESM状态为正在注册*/ NAS_ESM_SetEmmStatus(NAS_ESM_PS_REGISTER_STATUS_ATTACHING); /* 如果支持双APN,则停止对应定时器,并设置注册承载无效 */ if (NAS_ESM_OP_TRUE == NAS_ESM_AttachBearerReestEnable()) { NAS_ESM_TimerStop(0, TI_NAS_ESM_ATTACH_BEARER_REEST); NAS_ESM_SetAttachBearerId(NAS_ESM_UNASSIGNED_EPSB_ID); } /* 本地去激活除紧急之外的所有承载 */ for( ulCnt = NAS_ESM_MIN_EPSB_ID; ulCnt <= NAS_ESM_MAX_EPSB_ID; ulCnt++ ) { /* * 如果是激活的非紧急默认承载,则去激活; * 如果是非激活的默认承载或紧急的默认承载,不需要去激活,跳过 * 如果是专有承载,则在NAS_ESM_DeactBearerAndInformApp中进行去激活 */ if ((NAS_ESM_BEARER_TYPE_DEFAULT == NAS_ESM_GetBearCntxtType(ulCnt)) && (NAS_ESM_BEARER_STATE_ACTIVE == NAS_ESM_GetBearCntxtState(ulCnt))) { NAS_ESM_DeactBearerAndInformApp(ulCnt); } } /* 初始化PDN连接的个数 */ NAS_ESM_SetCurPdnNum(NAS_ESM_NULL); /* 通知RABM清除资源 */ NAS_ESM_SndEsmRabmRelIndMsg(); /*清除动态表,紧急相关除外*/ NAS_ESM_ClearStateTable(APP_ERR_SM_NON_EMERGENCY_NOT_ALLOWED, PS_TRUE); /* 初始化发送空口消息的结构体 */ NAS_ESM_ClearEsmSndNwMsgAddr(); /* 清除ESM缓存区 */ NAS_ESM_ClearEsmBuff(); }
VOS_VOID NAS_ESM_ProcValidNwMsgResAllocRej ( VOS_UINT32 ulStateTblIndex, const EMM_ESM_INTRA_DATA_IND_STRU *pRcvMsg ) { NAS_ESM_STATE_INFO_STRU *pstStateAddr = VOS_NULL_PTR; VOS_UINT32 ulTmpStateTblIndex = NAS_ESM_NULL; /*打印进入该函数*/ NAS_ESM_NORM_LOG("NAS_ESM_ProcValidNwMsgResAllocRej is entered."); TLPS_PRINT2LAYER_INFO(NAS_ESM_ProcValidNwMsgResAllocRej_ENUM, LNAS_ENTRY); /*停止定时器*/ NAS_ESM_TimerStop(ulStateTblIndex, TI_NAS_ESM_T3480); pstStateAddr = NAS_ESM_GetStateTblAddr(ulStateTblIndex); if(ID_APP_ESM_PDP_SETUP_REQ == pstStateAddr->stAppMsgRecord.enAppMsgType ) { if( NAS_ESM_CAUSE_INVALID_EPS_BEARER_IDENTITY == pRcvMsg->stEsmNwMsgIE.enEsmCau ) { /* 本地释放此承载的关联缺省承载和相关承载 */ NAS_ESM_DeactBearerAndInformApp(pstStateAddr->ulLinkedEpsbId); /*通知EMM当前承载状态信息,发送ID_EMM_ESM_BEARER_STATUS_REQ*/ NAS_ESM_SndEsmEmmBearerStatusReqMsg(EMM_ESM_BEARER_CNTXT_MOD_MUTUAL); /*清除和中止与ulEpsbId关联的流程信息*/ if(NAS_ESM_SUCCESS == NAS_ESM_QueryStateTblIndexByEpsbId(pstStateAddr->ulLinkedEpsbId, &ulTmpStateTblIndex)) { NAS_ESM_RelStateTblResource(ulTmpStateTblIndex); } } /*向APP发送ID_APP_ESM_BEARER_SETUP_CNF(失败)消息*/ NAS_ESM_SndEsmAppSdfSetupCnfFailMsg(ulStateTblIndex, \ NAS_ESM_GetAppErrorByEsmCause(pRcvMsg->stEsmNwMsgIE.enEsmCau)); } /*释放状态表资源*/ NAS_ESM_RelStateTblResource(ulStateTblIndex); }
VOS_VOID NAS_ESM_ClearEsmResource( VOS_VOID ) { VOS_UINT32 ulCnt = NAS_ESM_NULL; /*打印进入该函数*/ NAS_ESM_INFO_LOG("NAS_ESM_ClearEsmResource is entered."); /*根据消息记录通知APP*/ NAS_ESM_ClearStateTable(APP_ERR_SM_DETACHED, PS_FALSE); /* 设置EMM的状态为未注册 */ NAS_ESM_SetEmmStatus(NAS_ESM_PS_REGISTER_STATUS_DETACHED); /* 如果支持双APN,则停止对应定时器,并设置注册承载无效 */ if (NAS_ESM_OP_TRUE == NAS_ESM_AttachBearerReestEnable()) { NAS_ESM_TimerStop(0, TI_NAS_ESM_ATTACH_BEARER_REEST); NAS_ESM_SetAttachBearerId(NAS_ESM_UNASSIGNED_EPSB_ID); } /* 设置已激活的承载数目为零 */ NAS_ESM_SetCurMaxOpIdValue(NAS_ESM_MIN_OPID_VALUE); #ifdef PS_ITT_PC_TEST_NAS /*NAS ST场景下,由于现有用例在注册时使用了PTI值为2,所以PTI初始化为1,调用PTI分配函数,会从2开始使用*/ NAS_ESM_SetCurMaxPTIValue(NAS_ESM_PTI_MIN_VALUE); #else /*PTI初始化为0,注册时,调用PTI分配函数,会从1开始使用*/ /*lint -e778*/ NAS_ESM_SetCurMaxPTIValue(NAS_ESM_PTI_MIN_VALUE-1); /*lint +e778*/ /* CID0在PS融合后比较特殊,在ESM维护的内容与NV的内容会存在不一致, 需将CID0初始化为专有类型 */ NAS_ESM_ClearCid0StaticInfo(); #endif NAS_ESM_SetCurMaxGwAuthIdVaule(NAS_ESM_GWAUTHID_MIN_VALUE); /* 初始化CID 21~31 关联静态信息 */ NAS_ESM_ClearNwCtrlSdfPara(); /* 通知APP和SM 激活承载被释放,初始化承载信息 */ for( ulCnt = NAS_ESM_MIN_EPSB_ID; ulCnt <= NAS_ESM_MAX_EPSB_ID; ulCnt++ ) { if (NAS_ESM_BEARER_STATE_ACTIVE != NAS_ESM_GetBearCntxtState(ulCnt)) { /* 初始化承载信息 */ NAS_ESM_InitEpsbCntxtInfo(ulCnt); continue; } #ifndef PS_ITT_PC_TEST_NAS /* 通知APP 激活承载被释放 */ NAS_ESM_InformAppBearerRel(ulCnt); /* 通知SM 激活承载被释放 */ NAS_ESM_SndSmEspBearerDeactIndMsg(ulCnt); #endif /* 初始化承载信息 */ NAS_ESM_InitEpsbCntxtInfo(ulCnt); } /* 初始化业务流的动态信息 */ for( ulCnt = 0; ulCnt < NAS_ESM_MAX_CID_NUM; ulCnt++ ) { NAS_ESM_MEM_SET(NAS_ESM_GetSdfCntxtInfo(ulCnt), NAS_ESM_NULL, sizeof(NAS_ESM_SDF_CNTXT_INFO_STRU)); } /* 初始化PDN连接的个数 */ NAS_ESM_SetCurPdnNum(NAS_ESM_NULL); /* 初始化发送空口消息的结构体 */ NAS_ESM_ClearEsmSndNwMsgAddr(); /* 清除ESM缓存区 */ NAS_ESM_ClearEsmBuff(); }