VOS_VOID  NAS_LMM_DoAfterReadOptFileOver( VOS_VOID )
{
    NAS_LMM_FSM_STATE_STRU               EmmState;
    NAS_LMM_UE_OPERATION_MODE_ENUM_UINT32   ulLteUeMode;

    NAS_LMM_UEID_STRU                    *pstUeId;


    /* 停止TI_NAS_LMM_TIMER_WAIT_USIM_CNF */
    NAS_LMM_StopStateTimer(TI_NAS_LMM_TIMER_WAIT_USIM_CNF);
    /*如果读取到的GUTI无效但是安全上下文有效,则删除本地和NV中的上下文*/
    pstUeId                             = NAS_LMM_GetEmmInfoUeidAddr();

    if((NAS_EMM_BIT_NO_SLCT == pstUeId->bitOpGuti)
        &&(EMM_CUR_SECU_NOT_EXIST!= NAS_LMM_GetSecuCurFsmCS()))
    {
        NAS_EMM_ClearCurSecuCntxt();
        NAS_LMM_WriteEpsSecuContext(NAS_NV_ITEM_DELETE);
    }

    /* Read NV Files*/
    NAS_LMM_ProcessNvData();

    /* 状态转成读必选文件状态 */
    /* V7不再区分必读可选 */
    /*NAS_EMM_GET_USIM_FILE_TYPE() = NAS_LMM_USIM_MANDATORY_FILE;*/
    /*PC REPLAY MODIFY BY LEILI END*/
    ulLteUeMode = NAS_LMM_ComputeLteUeMode( NAS_EMM_GetMsMode(),
                                          NAS_LMM_GetEmmInfoUeCenter());
    NAS_LMM_SetEmmInfoUeOperationMode(ulLteUeMode);
    /*PC REPLAY MODIFY BY LEILI END*/
    /* 启动TI_NAS_EMM_WAIT_MMC_START_CNF_TIMER */
    NAS_LMM_StartStateTimer(TI_NAS_EMM_WAIT_MMC_START_CNF_TIMER);

    /* 转状态 */
    EmmState.enFsmId             = NAS_LMM_PARALLEL_FSM_EMM;
    EmmState.enMainState         = EMM_MS_NULL;
    EmmState.enSubState          = EMM_SS_NULL_WAIT_MMC_START_CNF;
    EmmState.enStaTId            = TI_NAS_EMM_WAIT_MMC_START_CNF_TIMER;
    NAS_LMM_StaTransProc(EmmState);

    /* 向MMC发送MMC_EMM_START_REQ(正常启动)消息 */
    (VOS_VOID)NAS_EMM_PLMN_SendMmcStartReq(EMMC_EMM_START_REQ_CAUSE_NORMAL_START);

    return;
}
VOS_VOID    NAS_EMM_AttDataUpdate(VOS_UINT32 ulDeleteRplmn)
{

    /*设置 EPS update status为EU3*/
    NAS_LMM_GetMmAuxFsmAddr()->ucEmmUpStat = EMM_US_ROAMING_NOT_ALLOWED_EU3;

    /*删除GUTI*/
    NAS_EMM_ClearGuti();

    /*删除LVR TAI*/
    if (NAS_EMM_DELETE_RPLMN == ulDeleteRplmn)
    {
        NAS_EMM_ClearLVRTai();
    }
    else
    {
        NAS_EMM_SetLVRTacInvalid();
    }

    /*删除KSIasme*/
    /*NAS_EMM_ClearCurSecuCntxt();*/
    NAS_EMM_ClearAllSecuCntxt();

    if((NAS_LMM_CAUSE_PLMN_NOT_ALLOW == NAS_EMM_GLO_AD_GetAttRejCau()) ||
            (NAS_LMM_CAUSE_TA_NOT_ALLOW == NAS_EMM_GLO_AD_GetAttRejCau()) ||
            (NAS_LMM_CAUSE_ROAM_NOT_ALLOW == NAS_EMM_GLO_AD_GetAttRejCau()) ||
            (NAS_LMM_CAUSE_EPS_SERV_NOT_ALLOW_IN_PLMN == NAS_EMM_GLO_AD_GetAttRejCau()) ||
            (NAS_LMM_CAUSE_NO_SUITABL_CELL == NAS_EMM_GLO_AD_GetAttRejCau()))
    {

        /*清除ATTACH ATTEMPTING COUNTER计数器*/
        NAS_EMM_GLO_AD_GetAttAtmpCnt()      = 0;
    }

    /* 将无效的安全上下文直接在函数内部写卡 */
    NAS_LMM_WriteEpsSecuContext(NAS_NV_ITEM_UPDATE);
    /*保存PS LOC信息*/
    NAS_LMM_WritePsLoc(NAS_NV_ITEM_UPDATE);

    return;

}
VOS_VOID NAS_EMM_TAU_TAUReqRejectCasue10(VOS_VOID)
{
    VOS_UINT32                          ulAttachFlag    = VOS_TRUE;
    NAS_EMM_ESM_MSG_BUFF_STRU          *pstEsmMsg       = NAS_EMM_NULL_PTR;

    /* 打印进入该函数, INFO_LEVEL */
    NAS_EMM_TAU_LOG_INFO( "Nas_Emm_Tau_TAUReqRejectCasue10 is entered.");
	/* lihong00150010 emergency tau&service begin */
    if (NAS_EMM_TAU_START_CAUSE_ESM_EMC_PDN_REQ == NAS_EMM_TAU_GetEmmTAUStartCause())
    {
        NAS_EMM_TAU_SendEsmStatusInd(EMM_ESM_ATTACH_STATUS_EMC_ATTACHING);
    }
    else
    {
        NAS_EMM_TAU_SendEsmStatusInd(EMM_ESM_ATTACH_STATUS_DETACHED);
    }
	/* lihong00150010 emergency tau&service end */
    /* 状态迁移Dereg.Normal_Service,发送INTRA_ATTACH_REQ消息*/
    NAS_EMM_TAUSER_FSMTranState(EMM_MS_DEREG,
                                EMM_SS_DEREG_NORMAL_SERVICE,
                                TI_NAS_EMM_STATE_NO_TIMER);

    /* 进入DEREG态不再写统一写安全上下文,参照标杆,在TAU被#10拒绝,将安全上下文写卡 */
    NAS_LMM_WriteEpsSecuContext(NAS_NV_ITEM_UPDATE);

    switch(NAS_EMM_TAU_GetEmmCollisionCtrl())
    {

        case NAS_EMM_COLLISION_DETACH:

            /* 向MMC报TAU结果需在DETACH结果上报前 */
            NAS_EMM_MmcSendTauActionResultIndRej((VOS_VOID*)NAS_EMM_NULL_PTR);

            NAS_EMM_TAU_CollisionDetachProc();

            if (MMC_LMM_MO_DET_CS_ONLY != NAS_EMM_GLO_AD_GetDetTypeMo())
            {
                NAS_EMM_DETACH_LOG_INFO("NAS_EMM_TAU_TAUReqRejectCasue10:Process EPS Detach or EPS/IMSI Detach");

                /* 本地DETACH*/
                NAS_LMM_DeregReleaseResource();
                NAS_EMM_RelReq(NAS_LMM_NOT_BARRED);
                return;
            }

            NAS_EMM_DETACH_LOG_INFO("NAS_EMM_TAU_TAUReqRejectCasue10:Process IMSI Detach");

            /* IMSI DETACH后释放资源 */
            NAS_LMM_ImsiDetachReleaseResource();
            break;

        case NAS_EMM_COLLISION_SERVICE:

            /* 如果是紧急CSFB,则标识不发内部ATTACH */
            if(VOS_FALSE == NAS_EMM_SER_IsNotEmergencyCsfb())
            {
               ulAttachFlag = VOS_FALSE;
            }

            /* 上报TAU结果在SER冲突处理中执行 */
            NAS_EMM_TAU_CollisionServiceProc(NAS_EMM_MmcSendTauActionResultIndRej,
                         (VOS_VOID*)NAS_EMM_NULL_PTR,
                         NAS_EMM_TRANSFER_RAT_NOT_ALLOW);
            break;

        default:

            NAS_EMM_MmcSendTauActionResultIndRej((VOS_VOID*)NAS_EMM_NULL_PTR);
            break;
    }
	/* lihong00150010 emergency tau&service begin */
    pstEsmMsg = (NAS_EMM_ESM_MSG_BUFF_STRU*)(VOS_VOID*)NAS_LMM_GetEmmInfoEsmBuffAddr();
    if ((NAS_EMM_TAU_START_CAUSE_ESM_EMC_PDN_REQ == NAS_EMM_TAU_GetEmmTAUStartCause())
        && (NAS_EMM_NULL_PTR != pstEsmMsg))
    {
        NAS_EMM_TAU_LOG_INFO("NAS_EMM_TAU_RrcRelCause_TAUREJ9: CAUSE_ESM_EMC_PDN_REQ");

        /*保存ESM消息*/
        /*lint -e960*/
        NAS_LMM_MEM_CPY(        (VOS_VOID*)NAS_EMM_GLO_AD_GetEsmMsgAddr(),
                               &(pstEsmMsg->stEsmMsg),
                                (pstEsmMsg->stEsmMsg.ulEsmMsgSize)+4);
        /*lint +e960*/

        NAS_EMM_StartEmergencyAttach();
    }
    else if(VOS_TRUE == ulAttachFlag)
    {/* lihong00150010 emergency tau&service end */
        /* 延时发送attach请求 */
        NAS_EMM_ReattachDelay();
    }
    else
    {
        NAS_EMM_RelReq(NAS_LMM_NOT_BARRED);
    }

    /* 清空TAU和APP资源*/
    NAS_EMM_TAU_ClearResouce();
    NAS_EMM_ClearAppMsgPara();

    return;
}