VOS_VOID   NAS_MMC_SndGmmWasSysInfoInd(
    VOS_UINT32                          ulForbiddenFlg,
    VOS_UINT32                          ulUserSrchFlg,
    struct MsgCB                       *pstMsg
)
{
    MMCGMM_SYS_INFO_IND_STRU           *pstInternalMsg    = VOS_NULL_PTR;
    RRMM_SYS_INFO_IND_STRU             *pstRrMmSysInfoInd = VOS_NULL_PTR;

    pstInternalMsg  = (MMCGMM_SYS_INFO_IND_STRU *)NAS_MML_GetIntMsgSendBuf(sizeof(MMCGMM_SYS_INFO_IND_STRU));

    if ( VOS_NULL_PTR == pstInternalMsg)
    {
        return;
    }

    PS_MEM_SET(pstInternalMsg, 0x00, sizeof(MMCGMM_SYS_INFO_IND_STRU));

    pstRrMmSysInfoInd = (RRMM_SYS_INFO_IND_STRU *)pstMsg;

    /* 填充发送消息 */
    pstInternalMsg->MsgHeader.ulSenderCpuId     = VOS_LOCAL_CPUID;
    pstInternalMsg->MsgHeader.ulSenderPid       = WUEPS_PID_MMC;
    pstInternalMsg->MsgHeader.ulReceiverCpuId   = VOS_LOCAL_CPUID;
    pstInternalMsg->MsgHeader.ulReceiverPid     = WUEPS_PID_GMM;
    pstInternalMsg->MsgHeader.ulMsgName         = MMCGMM_SYS_INFO_IND;
    pstInternalMsg->MsgHeader.ulLength          = sizeof(MMCGMM_SYS_INFO_IND_STRU) - VOS_MSG_HEAD_LENGTH;

    pstInternalMsg->ulCellId              = pstRrMmSysInfoInd->ulCellId;

    /* 根据系统消息的内容,填充Mask值 */
    pstInternalMsg->ulMask = NAS_MMC_GetOptMask_WasSysinfo(pstRrMmSysInfoInd);

    /* 拷贝Common信息 */
    pstInternalMsg->ulCnCommonSize  = (VOS_UINT32)pstRrMmSysInfoInd->ucCnCommonSize;

    PS_MEM_CPY(pstInternalMsg->aucCnCommonInfo,
               pstRrMmSysInfoInd->aucCnCommonInfo, RRC_NAS_MAX_SIZE_NAS_GSM_MAP);

    PS_MEM_CPY(pstInternalMsg->aulPsInfo,
               pstRrMmSysInfoInd->aucPsInfo, RRC_NAS_MAX_SIZE_NAS_GSM_MAP);

    pstInternalMsg->ulPsInfoSize           = (VOS_UINT32)pstRrMmSysInfoInd->ucPsInfoSize;
    pstInternalMsg->PlmnId.ulMcc           = pstRrMmSysInfoInd->PlmnId.ulMcc;
    pstInternalMsg->PlmnId.ulMnc           = pstRrMmSysInfoInd->PlmnId.ulMnc;

    pstInternalMsg->ulPsDrxLength          = pstRrMmSysInfoInd->ulPsDrxLength;

    pstInternalMsg->ulUserSrchFlg          = VOS_FALSE;

    pstInternalMsg->ulForbiddenMask    = ulForbiddenFlg;

    /* 在Hplmn上CS注册被拒后,非E5时,不在发起注册 ,E5时,HplmnRejlist不记录值 */
    if (VOS_TRUE == NAS_MML_ComparePlmnIdWithHplmn(NAS_MML_GetCurrCampPlmnId()))
    {
        if (VOS_FALSE == NAS_MMC_GetHPlmnSpecDomainAccessCapa(NAS_MMC_REG_DOMAIN_PS))
        {
            if (MMCMM_NO_FORBIDDEN == ulForbiddenFlg)
            {
                pstInternalMsg->ulForbiddenMask   = MMCMM_FORBIDDEN_PLMN;
            }

            if (VOS_TRUE == NAS_MML_GetHplmnRegisterCtrlFlg())
            {
                pstInternalMsg->ulForbiddenMask   &= (~MMCMM_FORBIDDEN_PLMN);
            }
        }
    }

        
    /* 从bar转为不bar的标志位 */
    pstInternalMsg->ucCsChanged2UnBarFlg    = (VOS_UINT8)NAS_MML_GetCsRegisterBarToUnBarFlg();
    pstInternalMsg->ucPsChanged2UnBarFlg    = (VOS_UINT8)NAS_MML_GetPsRegisterBarToUnBarFlg();

    NAS_MML_SndInternalMsg(pstInternalMsg);

    return;
}
VOS_VOID   NAS_MMC_SndGmmGsmSysInfoInd(
    VOS_UINT32                          ulForbiddenFlg,
    VOS_UINT32                          ulUserSrchFlg,
    struct MsgCB                       *pstMsg
)
{
    MMCGMM_GSM_SYS_INFO_IND_ST         *pstInternalMsg  = VOS_NULL_PTR;
    GRRMM_SYS_INFO_IND_ST              *pstGrrMmSysInfo = VOS_NULL_PTR;

    pstInternalMsg  = (MMCGMM_GSM_SYS_INFO_IND_ST *)NAS_MML_GetIntMsgSendBuf(sizeof(MMCGMM_GSM_SYS_INFO_IND_ST));
    if ( VOS_NULL_PTR == pstInternalMsg)
    {
        return;
    }

    pstGrrMmSysInfo = (GRRMM_SYS_INFO_IND_ST *)pstMsg;

    pstInternalMsg->MsgHeader.ulSenderCpuId     = VOS_LOCAL_CPUID;
    pstInternalMsg->MsgHeader.ulSenderPid       = WUEPS_PID_MMC;
    pstInternalMsg->MsgHeader.ulReceiverCpuId   = VOS_LOCAL_CPUID;
    pstInternalMsg->MsgHeader.ulReceiverPid     = WUEPS_PID_GMM;

    pstInternalMsg->MsgHeader.ulMsgName   = MMCGMM_GSM_SYS_INFO_IND;
    pstInternalMsg->MsgHeader.ulLength    = sizeof(MMCGMM_GSM_SYS_INFO_IND_ST) - VOS_MSG_HEAD_LENGTH;

    /* 填充CS信息 */
    pstInternalMsg->ucAttachDetach           = pstGrrMmSysInfo->ucAttachDetach;
    pstInternalMsg->ucLRTimerT3212           = pstGrrMmSysInfo->ucLRTimerT3212;
    pstInternalMsg->ucGprsSupportInd         = pstGrrMmSysInfo->ucGprsSupportInd;
    pstInternalMsg->usLac                    = pstGrrMmSysInfo->usLac;
    pstInternalMsg->ucSgsnRelease            = pstGrrMmSysInfo->ucSgsnRelease;

    /* 填充PS信息 */
    if ( GRRMM_NW_OP_MODE_III == pstGrrMmSysInfo->ucNetworkOperationMode)
    {
        pstInternalMsg->ucNetworkOperationMode   = GRRMM_NW_OP_MODE_II;
    }
    else
    {
        pstInternalMsg->ucNetworkOperationMode   = pstGrrMmSysInfo->ucNetworkOperationMode;
    }

    pstInternalMsg->ucRac                    = pstGrrMmSysInfo->ucRac;
    pstInternalMsg->usCellId                 = pstGrrMmSysInfo->usCellId;
    pstInternalMsg->stPlmnId.ulMcc           = pstGrrMmSysInfo->PlmnId.ulMcc;
    pstInternalMsg->stPlmnId.ulMnc           = pstGrrMmSysInfo->PlmnId.ulMnc;

    pstInternalMsg->ucDrxTimerMax            = pstGrrMmSysInfo->ucDrxTimerMax;

    pstInternalMsg->ulUserSrchFlg            = VOS_FALSE;

    pstInternalMsg->ulForbiddenFlg           = ulForbiddenFlg;

    /* 在Hplmn上CS注册被拒后,非E5时,不在发起注册 ,E5时,HplmnRejlist不记录值 */
    if (VOS_TRUE == NAS_MML_ComparePlmnIdWithHplmn(NAS_MML_GetCurrCampPlmnId()))
    {
        if ((VOS_FALSE == NAS_MMC_GetHPlmnSpecDomainAccessCapa(NAS_MMC_REG_DOMAIN_PS))
         && (MMCMM_NO_FORBIDDEN == ulForbiddenFlg))
        {
            pstInternalMsg->ulForbiddenFlg   = MMCMM_FORBIDDEN_PLMN;
        }
    }

    /* 在Hplmn上PS注册被拒后,非E5时,不在发起注册 ,E5时,HplmnRejlist不记录值 */
    if ((VOS_TRUE == NAS_MML_ComparePlmnIdWithHplmn(NAS_MML_GetCurrCampPlmnId()))
     && (VOS_FALSE == ulUserSrchFlg))
    {
        if ((VOS_FALSE == NAS_MMC_GetHPlmnSpecDomainAccessCapa(NAS_MMC_REG_DOMAIN_PS))
         && (NAS_MML_PLMN_FORBID_NULL == ulForbiddenFlg))
        {
            pstInternalMsg->ulForbiddenFlg  = MMC_GMM_FORBIDDEN_PLMN;
        }
    }

    pstInternalMsg->unAcInfo.ucRestrictType               = pstGrrMmSysInfo->unAcInfo.ucRestrictType;

    /* 如果是GSM禁止接入,通知MM/GMM,防止发起注册 */
    if (VOS_TRUE == NAS_MML_GetGsmForbidFlg())
    {
        pstInternalMsg->unAcInfo.ucRestrictType            = RRC_NAS_ACCESS_RESTRICTION_ALL_SERVICE;
    }

    /* 从bar转为不bar的标志位 */
    pstInternalMsg->ucCsChanged2UnBarFlg    = (VOS_UINT8)NAS_MML_GetCsRegisterBarToUnBarFlg();
    pstInternalMsg->ucPsChanged2UnBarFlg    = (VOS_UINT8)NAS_MML_GetPsRegisterBarToUnBarFlg();

    NAS_MML_SndInternalMsg(pstInternalMsg);

    return;

}
VOS_VOID   NAS_MMC_SndMmWasSysInfoInd(
    VOS_UINT32                          ulForbiddenFlg,
    VOS_UINT32                          ulUserSpecSrchPlmnFlg,
    struct MsgCB                       *pstMsg
)
{
    MMCMM_SYS_INFO_IND_STRU            *pstInternalMsg    = VOS_NULL_PTR;
    RRMM_SYS_INFO_IND_STRU             *pstRrMmSysInfoInd = VOS_NULL_PTR;

    pstInternalMsg  = (MMCMM_SYS_INFO_IND_STRU *)NAS_MML_GetIntMsgSendBuf(sizeof(MMCMM_SYS_INFO_IND_STRU));
    if ( VOS_NULL_PTR == pstInternalMsg)
    {
        return;
    }

    PS_MEM_SET(pstInternalMsg, 0x00, sizeof(MMCMM_SYS_INFO_IND_STRU));

    pstRrMmSysInfoInd = (RRMM_SYS_INFO_IND_STRU *)pstMsg;

    pstInternalMsg->MsgHeader.ulSenderCpuId     = VOS_LOCAL_CPUID;
    pstInternalMsg->MsgHeader.ulSenderPid       = WUEPS_PID_MMC;
    pstInternalMsg->MsgHeader.ulReceiverCpuId   = VOS_LOCAL_CPUID;
    pstInternalMsg->MsgHeader.ulReceiverPid     = WUEPS_PID_MM;
    pstInternalMsg->MsgHeader.ulMsgName         = MMCMM_SYS_INFO_IND;
    pstInternalMsg->MsgHeader.ulLength
                                = sizeof(MMCMM_SYS_INFO_IND_STRU) - VOS_MSG_HEAD_LENGTH;

    pstInternalMsg->ulMask = NAS_MMC_GetOptMask_WasSysinfo(pstRrMmSysInfoInd);

    pstInternalMsg->enSysInfoType  = pstRrMmSysInfoInd->enSysInfoType;

    pstInternalMsg->ucCnCommonSize = pstRrMmSysInfoInd->ucCnCommonSize;

    /* aucCnCommonInfo[0] 和 aucCnCommonInfo[1] 代表 lac[0] 和  Lac[1]*/
    pstInternalMsg->usLac  = (VOS_UINT16)pstRrMmSysInfoInd->aucCnCommonInfo[1];
    pstInternalMsg->usLac |= (VOS_UINT16)(pstRrMmSysInfoInd->aucCnCommonInfo[0]<< NAS_MML_OCTET_MOVE_EIGHT_BITS);

    pstInternalMsg->ucCsInfoSize    = pstRrMmSysInfoInd->ucCsInfoSize;
    pstInternalMsg->ucLRTimerT3212  = pstRrMmSysInfoInd->aucCsInfo[0];

    /* aucCsInfo[1]的最低Bit代表当前是否允许注册 */
    if (0 == (pstRrMmSysInfoInd->aucCsInfo[1] & NAS_MML_ATTATCH_IND_BIT_MASK_WAS_SYS_INFO))
    {
        pstInternalMsg->ucAttachDetach = VOS_FALSE;
    }
    else
    {
        pstInternalMsg->ucAttachDetach = VOS_TRUE;
    }

    pstInternalMsg->ucPsInfoSize       = pstRrMmSysInfoInd->ucPsInfoSize;
    pstInternalMsg->ucRac              = pstRrMmSysInfoInd->aucPsInfo[0];

    if (0 == (pstRrMmSysInfoInd->aucPsInfo[1] & NAS_MML_NET_MODE_BIT_MASK_WAS_SYS_INFO))
    {
        pstInternalMsg->ucNetworkOperationMode = GRRMM_NW_OP_MODE_I;
    }
    else
    {
        pstInternalMsg->ucNetworkOperationMode = GRRMM_NW_OP_MODE_II;
    }

    if (0 == pstRrMmSysInfoInd->ucPsInfoSize)
    {
        pstInternalMsg->ucGprsSupportInd = VOS_FALSE;
    }
    else
    {
        pstInternalMsg->ucGprsSupportInd = VOS_TRUE;
    }

    pstInternalMsg->PlmnId.ulMcc           = pstRrMmSysInfoInd->PlmnId.ulMcc;
    pstInternalMsg->PlmnId.ulMnc           = pstRrMmSysInfoInd->PlmnId.ulMnc;

    pstInternalMsg->ulCsDrxLength          = pstRrMmSysInfoInd->ulCsDrxLength;
    pstInternalMsg->ulPsDrxLength          = pstRrMmSysInfoInd->ulPsDrxLength;

    pstInternalMsg->ulForbiddenFlg         = ulForbiddenFlg;


    /* 删除设置用户指定搜时,将ulForbiddenFlg设置为NULL的处理 */
    pstInternalMsg->ulForbiddenFlg           = ulForbiddenFlg;

    /* 在Hplmn上CS注册被拒后,非E5时,不在发起注册 ,E5时,HplmnRejlist不记录值 */
    if (VOS_TRUE == NAS_MML_ComparePlmnIdWithHplmn(NAS_MML_GetCurrCampPlmnId()))
    {
        if (VOS_FALSE == NAS_MMC_GetHPlmnSpecDomainAccessCapa(NAS_MMC_REG_DOMAIN_CS))
        {
            if (MMCMM_NO_FORBIDDEN == ulForbiddenFlg)
            {
                pstInternalMsg->ulForbiddenFlg   = MMCMM_FORBIDDEN_PLMN;
            }

            if ( VOS_TRUE == NAS_MML_GetHplmnRegisterCtrlFlg())
            {
                pstInternalMsg->ulForbiddenFlg   &= (~MMCMM_FORBIDDEN_PLMN);
            }
        }
    }
    
    pstInternalMsg->ulCellId                = pstRrMmSysInfoInd->ulCellId;

    pstInternalMsg->ucUserSpecificSearchFlg = (VOS_UINT8)ulUserSpecSrchPlmnFlg;

     /* 从bar转为不bar的标志位 */
    pstInternalMsg->ucCsChanged2UnBarFlg    = (VOS_UINT8)NAS_MML_GetCsRegisterBarToUnBarFlg();
    pstInternalMsg->ucPsChanged2UnBarFlg    = (VOS_UINT8)NAS_MML_GetPsRegisterBarToUnBarFlg();

    NAS_MML_SndInternalMsg(pstInternalMsg);

    return;
}