VOS_VOID GMM_RcvMmcSuspendInd(VOS_VOID* pRcvMsg)
{
    MMCGMM_SUSPEND_IND_ST              *pSuspendIndMsg;
    NAS_UTRANCTRL_UTRAN_MODE_ENUM_UINT8 enCurUtranMode;

#if (FEATURE_ON == FEATURE_LTE)
    VOS_UINT32                          ulGprsSuspendFlg;


    ulGprsSuspendFlg    = VOS_FALSE;
#endif

    /* GSM模式处理过程 */
    pSuspendIndMsg      = (MMCGMM_SUSPEND_IND_ST *)pRcvMsg;

    GMM_LOG_INFO("GMM_RcvMmcSuspendInd:Receive MMC_SUSPEND_IND");

    NAS_MML_SetPsTbfStatusFlg(VOS_FALSE);

    NAS_GMM_FreeGsmSysInfo();
    
    NAS_GMM_FreeWasSysInfo();

    /* 指示RABM当前系统模式, 并挂起RABM, bRatChangeFlg为TRUE */
    NAS_GMM_SndRabmSysSrvChgInd(pSuspendIndMsg->ucSuspendOrigen,
                                VOS_TRUE,
                                VOS_TRUE,
                                VOS_TRUE);



    if ( NAS_MML_NET_RAT_TYPE_GSM == pSuspendIndMsg->ucSuspendDestination)
    {
        NAS_GMM_SndGasInfoChangeReq(RRC_NAS_MASK_PTMSI_RAI | RRC_NAS_MASK_ATTACH);
    }

    switch (g_GmmGlobalCtrl.ucState)
    {
        case GMM_GPRS_SUSPENSION:
            gstGmmCasGlobalCtrl.GmmSrvState       = gstGmmSuspendCtrl.ucPreSrvState;

#if (FEATURE_ON == FEATURE_LTE)
            ulGprsSuspendFlg    = VOS_TRUE;
#endif

            break;

        case GMM_SUSPENDED_GPRS_SUSPENSION:
        case GMM_SUSPENDED_WAIT_FOR_SYSINFO:
            Gmm_TimerStop(GMM_TIMER_SUSPENDED);
            GMM_ResumeFailure();
            break;

        case GMM_SUSPENDED_NORMAL_SERVICE:
            GMM_LOG_WARN("GMM_RcvGasSuspensionInd:Receive RRMM_GPRS_SUSPENSION_IND in abnormal state.");
            return;
        case GMM_ROUTING_AREA_UPDATING_INITIATED:
            if (GMM_RAU_FOR_NORMAL != gstGmmSuspendCtrl.ucRauCause)
            {
                GMM_BufferMsgDump();
            }
            break;
        case GMM_DEREGISTERED_INITIATED:
            if (GMM_AGENT_USIM_AUTHENTICATION_CNF_FLG
                == (g_GmmReqCnfMng.ucCnfMask
                & GMM_AGENT_USIM_AUTHENTICATION_CNF_FLG))
            {
                Gmm_TimerStop(GMM_TIMER_PROTECT);
                g_GmmReqCnfMng.ucCnfMask
                    &= ~GMM_AGENT_USIM_AUTHENTICATION_CNF_FLG;
            }
            /*异系统改变时,如果RA发生改变,则RAU完成后继续Detach流程,
            如果RA没有改变,则通过Detach定时器超时保证Detach流程继续。异系统不改变时
            直接重新开始Detach流程*/
            g_GmmGlobalCtrl.ucFollowOnFlg = GMM_TRUE;
            NAS_MML_SetPsServiceBufferStatusFlg(VOS_TRUE);

            g_GmmGlobalCtrl.ucSpecProcHold = g_GmmGlobalCtrl.ucSpecProc;
            break;
        default:
            break;
    }

    /*保存切换之前的状态和网络模式*/
    if ((GMM_GPRS_SUSPENSION != g_GmmGlobalCtrl.ucState)
     && (GMM_SUSPENDED_NORMAL_SERVICE != g_GmmGlobalCtrl.ucState)
     && (GMM_SUSPENDED_GPRS_SUSPENSION != g_GmmGlobalCtrl.ucState)
     && (GMM_SUSPENDED_WAIT_FOR_SYSINFO != g_GmmGlobalCtrl.ucState))
    {
        gstGmmSuspendCtrl.ucPreState                  = g_GmmGlobalCtrl.ucState;
    }

    gstGmmSuspendCtrl.ucPreRat                    = NAS_MML_GetCurrNetRatType();
    gstGmmSuspendCtrl.ucSuspendCause              = pSuspendIndMsg->ucSuspendCause;

    /* 获取切换之前的服务状态 */
    if (NAS_MML_NET_RAT_TYPE_WCDMA == NAS_MML_GetCurrNetRatType())
    {
        if (VOS_TRUE == NAS_GMM_IsDeregisterState(g_GmmGlobalCtrl.ucState))
        {
            gstGmmSuspendCtrl.ucPreSrvState       = GMM_IU_PMM_DETACHED;
        }
        else if (GMM_TRUE == g_GmmGlobalCtrl.ucSigConFlg)
        {
            gstGmmSuspendCtrl.ucPreSrvState       = GMM_IU_PMM_CONNECTED;
        }
        else
        {
            gstGmmSuspendCtrl.ucPreSrvState       = GMM_IU_PMM_IDLE;
        }
    }
    else if (NAS_MML_NET_RAT_TYPE_GSM == NAS_MML_GetCurrNetRatType())
    {
        gstGmmSuspendCtrl.ucPreSrvState           = gstGmmCasGlobalCtrl.GmmSrvState;
    }
    else
    {
        ;
    }

    if (MMC_SUSPEND_CAUSE_CELLCHANGE == pSuspendIndMsg->ucSuspendCause)
    {
        /* 备份GMM的全局变量,用于CCO回退时使用 */
        NAS_GMM_BackupCcoFallbackCtx();
    }


    GMM_SuspendTimer();

    Gmm_ComStaChg(GMM_SUSPENDED_NORMAL_SERVICE);

    /* HO过程中,L进行挂起请求时,需要向L获取安全上下文 */
#if   (FEATURE_ON == FEATURE_LTE)
    /* 3GPP 24008 4.7.5.1.1章节描述:
       If the routing area updating procedure is not initiated by the MS due to
       an S1 mode to Iu mode or S1 mode to A/Gb mode intersystem change,
       or if it is initiated due to such an intersystem change and the TIN
       indicates "RAT related TMSI", the MS shall use the existing UMTS
       security context for the PS domain. The ROUTING AREA UPDATE REQUEST
       message shall contain the P-TMSI signature when received in a previous
       ATTACH ACCEPT or ROUTING AREA UPDATE ACCEPT message.
       If the MS has a valid UMTS security context, the MS shall indicate
       it in the GPRS ciphering key sequence number IE.*/

    if ((MMC_SUSPEND_CAUSE_HANDOVER == pSuspendIndMsg->ucSuspendCause)
     && (NAS_MML_NET_RAT_TYPE_LTE == pSuspendIndMsg->ucSuspendOrigen))
    {
        /* 备份PS的安全上下文,由于HO失败的回退 */
        PS_MEM_CPY(&(g_GmmGlobalCtrl.stBackupShare.stSimPsSecurity),
                   NAS_MML_GetSimPsSecurity(), sizeof(NAS_MML_SIM_PS_SECURITY_INFO_STRU));           

    
        /* 给L模发送GMM_LMM_HO_SECU_INFO_REQ */
        NAS_GMM_SndLmmHoSecuInfoReq();

        gstGmmSuspendCtrl.ucGetLteSecContext = VOS_TRUE;

        /* 启动定时器 */
        Gmm_TimerStart(GMM_TIMER_WAIT_GET_HO_SECU_INFO_CNF);

        return;
    }
    /* 如果挂起目的方为LTE,通知LMM模块Gmm的连接状态 */
    if ((NAS_MML_NET_RAT_TYPE_LTE == pSuspendIndMsg->ucSuspendDestination)
     && (NAS_MML_NET_RAT_TYPE_LTE != pSuspendIndMsg->ucSuspendOrigen))
    {
        /* 只带G模的连接状态,不带PS域状态是挂起还是正常,在收到gas的gprs suspend ind消息时通知 */
        NAS_GMM_SndLmmInfoChangeNotifyReq(NAS_MML_GetCurrNetRatType(),
                                          VOS_TRUE,
                                          VOS_FALSE,
                                          gstGmmSuspendCtrl.ucPreSrvState,
                                          ulGprsSuspendFlg);
    }

#endif

#if (defined(__PS_WIN32_RECUR__)) || ( VOS_WIN32 == VOS_OS_VER )
    if (1 == g_ulGmmDelaySuspendRsp)
    {
        Gmm_TimerStart(GMM_TIMER_TC_DELAY_SUSPEND_RSP);
        return;
    }
#endif


    /* 由于GCF测试原因,TC状态下,在W2G的异系统切换情况下,需要延迟一定时间再回复
       挂起结果。于是启动定时器,待定时器超时后再回复挂起结果。
       由于此处状态已迁移,故使用切换之前GMM状态进行判断。
       W2L挂起时,此处不知道挂起的目的方,故也会做此处理,但只会延迟上报挂起结果,没有其它影响 */
    /* 挂起目的方为GSM,启动定时器,为LTE时不启动定时器 */
    enCurUtranMode = NAS_UTRANCTRL_GetCurrUtranMode();

    if ((NAS_MML_NET_RAT_TYPE_WCDMA == NAS_MML_GetCurrNetRatType())
     && (GMM_TC_ACTIVE == gstGmmSuspendCtrl.ucPreState)
     && (NAS_UTRANCTRL_UTRAN_MODE_FDD == enCurUtranMode)
     && (NAS_MML_NET_RAT_TYPE_GSM == pSuspendIndMsg->ucSuspendDestination))
    {
        Gmm_TimerStart(GMM_TIMER_TC_DELAY_SUSPEND_RSP);
        return;
    }


    Gmm_TimerStart(GMM_TIMER_SUSPENDED);

    GMM_SndMmcSuspendRsp();
}
VOS_VOID GMM_TimReadyExpired(VOS_VOID)
{
    VOS_UINT32                          ulT3311Status;
    VOS_UINT32                          ulT3302Status;

    if (GMM_DEREGISTERED_NORMAL_SERVICE == g_GmmGlobalCtrl.ucState)
    {
        gstGmmCasGlobalCtrl.GmmSrvState     = GMM_IU_PMM_DETACHED;
    }
    else
    {
        gstGmmCasGlobalCtrl.GmmSrvState     = GMM_AGB_GPRS_STANDBY;
    }

    /* WCDMA模式,由HSS 4100 V100R001代码处理 */
    if (NAS_MML_NET_RAT_TYPE_WCDMA == NAS_MML_GetCurrNetRatType())
    {
        /* 在注册状态,并且服务状态是空闲态时,启动3312 */
        if ((0x20 == (g_GmmGlobalCtrl.ucState & 0xF0))
         && (GMM_FALSE == g_GmmGlobalCtrl.ucSigConFlg)
         && (GMM_TRUE != g_GmmRauCtrl.ucT3312ExpiredFlg ))
        {
#if (FEATURE_LTE == FEATURE_ON)
            if (GMM_TIMER_T3312_FLG != (GMM_TIMER_T3312_FLG & g_GmmTimerMng.ulTimerRunMask))
            {
                NAS_GMM_SndLmmTimerInfoNotify(GMM_TIMER_T3312, GMM_LMM_TIMER_START);
            }
#endif
            Gmm_TimerStart(GMM_TIMER_T3312);
        }
        return;     /* 不需处理返回 */
    }

    if (GMM_DEREGISTERED_NORMAL_SERVICE == g_GmmGlobalCtrl.ucState)
    {
        gstGmmCasGlobalCtrl.GmmSrvState     = GMM_IU_PMM_DETACHED;
    }
    else
    {
        ulT3311Status = NAS_GMM_QryTimerStatus(GMM_TIMER_T3311);
        ulT3302Status = NAS_GMM_QryTimerStatus(GMM_TIMER_T3302);

        if ((GMM_REGISTERED_ATTEMPTING_TO_UPDATE_MM == g_GmmGlobalCtrl.ucState)
          || (GMM_REGISTERED_ATTEMPTING_TO_UPDATE == g_GmmGlobalCtrl.ucState))
        {
            if ((VOS_FALSE == ulT3311Status)
             && (VOS_FALSE == ulT3302Status))
            {
#if (FEATURE_LTE == FEATURE_ON)
                if (GMM_TIMER_T3312_FLG != (GMM_TIMER_T3312_FLG & g_GmmTimerMng.ulTimerRunMask))
                {
                    NAS_GMM_SndLmmTimerInfoNotify(GMM_TIMER_T3312, GMM_LMM_TIMER_START);
                }
#endif
                Gmm_TimerStart(GMM_TIMER_T3312);
            }
        }
        else
        {
            if ((0x10 != (g_GmmGlobalCtrl.ucState & 0xF0))
             && (GMM_REGISTERED_INITIATED != g_GmmGlobalCtrl.ucState))
                {
#if (FEATURE_LTE == FEATURE_ON)
                if (GMM_TIMER_T3312_FLG != (GMM_TIMER_T3312_FLG & g_GmmTimerMng.ulTimerRunMask))
                {
                    NAS_GMM_SndLmmTimerInfoNotify(GMM_TIMER_T3312, GMM_LMM_TIMER_START);
                }
#endif
                Gmm_TimerStart(GMM_TIMER_T3312);
            }
        }

        gstGmmCasGlobalCtrl.GmmSrvState     = GMM_AGB_GPRS_STANDBY;
    }

    NAS_GMM_SndGasInfoChangeReq(NAS_GSM_MASK_GSM_GMM_STATE);


    return;
}