[Feature][Modem]Update MTK MODEM V1.6 baseline version: MOLY.NR15.R3.MD700.IVT.MP1MR3.MP.V1.6
MTK modem version: MT2735_IVT_MOLY.NR15.R3.MD700.IVT.MP1MR3.MP.V1.6.tar.gz
RF modem version: NA
Change-Id: I45a4c2752fa9d1a618beacd5d40737fb39ab64fb
diff --git a/mcu/protocol/interface/general/5g/ddm_vgmm_struct.h b/mcu/protocol/interface/general/5g/ddm_vgmm_struct.h
new file mode 100644
index 0000000..e945595
--- /dev/null
+++ b/mcu/protocol/interface/general/5g/ddm_vgmm_struct.h
@@ -0,0 +1,114 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2018
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+#ifndef DDM_VGMM_STRUCT_H
+#define DDM_VGMM_STRUCT_H
+
+#include "kal_public_api.h"
+#include "atcmd_struct.h"
+
+/********************************************
+ * MACROS *
+ ********************************************/
+
+/********************************************
+ * TYPE DEFINITIONS & ENUMS *
+ ********************************************/
+
+typedef enum
+{
+ DDM_VGMM_CRLADN_RESULT_SUCCESS,
+ DDM_VGMM_CRLADN_RESULT_FAIL_CAUSE_CANNOT_PROCESS,
+ DDM_VGMM_CRLADN_RESULT_FAIL_CAUSE_NW_FORMAT_FAILURE,
+ DDM_VGMM_CRLADN_RESULT_FAIL_CAUSE_GEMINI_FAILURE,
+ DDM_VGMM_CRLADN_RESULT_FAIL_CAUSE_OTHERS,
+ DDM_VGMM_MAX_NUM_OF_CRLADN_RESULT
+} ddm_vgmm_crladn_result_enum;
+
+typedef enum
+{
+ DDM_VGMM_T_3346,
+ DDM_VGMM_T_THROTTLING
+}ddm_vgmm_backoff_timer_id_enum;
+
+typedef enum
+{
+ DDM_VGMM_DEACT_PDUS_INFO_NONE = 0,
+ DDM_VGMM_DEACT_PDUS_INFO_IRAT_4G5_MRU_SUCCESS
+} ddm_vgmm_deact_pdus_info_enum;
+
+typedef ladn_info_struct ddm_vgmm_ladn_info_struct;
+
+/* MSG_ID_DDM_VGMM_CRLADN_CNF */
+typedef struct {
+ LOCAL_PARA_HDR
+ ddm_vgmm_crladn_result_enum result;
+ kal_uint8 num_of_ladn_info;
+ ddm_vgmm_ladn_info_struct ladn_info[MAX_LADN_INFO];
+ kal_bool is_ladn_raw_data_valid;
+ kal_uint16 ladn_raw_data_len;
+ kal_uint8 ladn_raw_data[MAX_LADN_INFO_LEN];
+} ddm_vgmm_crladn_cnf_struct;
+
+/* MSG_ID_DDM_VGMM_CRLADN_REQ */
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 ladn_dnn_num;
+ apn_struct dnn[MAX_LADN_INFO];
+} ddm_vgmm_crladn_req_struct;
+
+/* MSG_ID_DDM_VGMM_CABTSRI_IND */
+typedef struct {
+ LOCAL_PARA_HDR
+ at_cabtsri_ind_struct cabtsri_ind;
+ ddm_vgmm_backoff_timer_id_enum backoff_timer_id;
+} ddm_vgmm_cabtsri_ind_struct ;
+
+/* MSG_ID_DDM_VGMM_DEACT_PDUS_INFO_UPDATE_IND */
+typedef struct {
+ LOCAL_PARA_HDR
+ ddm_vgmm_deact_pdus_info_enum deact_pdus_info;
+} ddm_vgmm_deact_pdus_info_update_ind_struct;
+
+/********************************************
+ * VARIABLES *
+ ********************************************/
+
+/********************************************
+ * FUNCTION DECLARATIONS *
+ ********************************************/
+
+#endif /* DDM_VGMM_STRUCT_H */
diff --git a/mcu/protocol/interface/general/5g/erm_nrrc_struct.h b/mcu/protocol/interface/general/5g/erm_nrrc_struct.h
new file mode 100644
index 0000000..a1b93c8
--- /dev/null
+++ b/mcu/protocol/interface/general/5g/erm_nrrc_struct.h
@@ -0,0 +1,141 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2019
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+#ifndef ERM_NRRC_STRUCT_H
+#define ERM_NRRC_STRUCT_H
+
+#include "kal_general_types.h"
+#include "kal_public_defs.h"
+
+#include "nl1_comm_inter_core_public.h"
+#include "perf_api.h"
+#include "nrrc_nvram_editor.h"
+
+/********************************************
+ * MACROS *
+ ********************************************/
+
+
+/********************************************
+ * TYPE DEFINITIONS & ENUMS *
+ ********************************************/
+
+/**
+ * Enumeration identifies penalty types.
+ */
+typedef enum
+{
+ NRRC_ERROR_RECOVERY_PENALTY_TYPE_LOWER_PRIORITY = 0,
+ NRRC_ERROR_RECOVERY_PENALTY_TYPE_CELL_BARRED = 1,
+ NRRC_ERROR_RECOVERY_PENALTY_TYPE_CELL_SOURCE_NOT_PRIOR = 2
+} nrrc_error_recovery_penalty_type_enum;
+
+/**
+ * Structure represents parameters which
+ * identify a cell for error recovery purposes.
+ */
+typedef struct
+{
+ kal_uint16 dl_frequency_band;
+ kal_uint32 ssb_arfcn;
+ kal_uint16 pci;
+ NR_SCS_TYPE_E subcarrier_spacing_ssb;
+} nrrc_error_recovery_cell_info_struct;
+
+/* MSG_ID_ERM_NRRC_CELL_INFO_IND */
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ kal_bool current_cell_valid;
+ nrrc_error_recovery_cell_info_struct current_cell;
+} erm_nrrc_cell_info_ind_struct;
+
+/* MSG_ID_ERM_NRRC_ERROR_RECOVERY_IND */
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ protocol_exception_recovery_type_enum recovery_event;
+} erm_nrrc_error_recovery_ind_struct;
+
+/* MSG_ID_ERM_NRRC_ERROR_RECOVERY_REQ */
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ error_recovery_method_enum recovery_method;
+} erm_nrrc_error_recovery_req_struct;
+
+/* MSG_ID_ERM_NRRC_ERROR_RECOVERY_CNF */
+typedef struct
+{
+ LOCAL_PARA_HDR
+} erm_nrrc_error_recovery_cnf_struct;
+
+/* MSG_ID_ERM_NRRC_PENALTY_REQ */
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ nrrc_error_recovery_penalty_type_enum penalty_type;
+ nrrc_error_recovery_cell_info_struct cell;
+ kal_uint16 penalty_time;
+} erm_nrrc_penalty_req_struct;
+
+/* MSG_ID_ERM_NRRC_PENALTY_CNF */
+typedef struct
+{
+ LOCAL_PARA_HDR
+} erm_nrrc_penalty_cnf_struct;
+
+/* MSG_ID_ERM_NRRC_BARRING_INFO_UPDATE_REQ */
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool is_customized_value_used;
+ nvram_nrrc_abnormal_control_params_struct error_recovery_param;
+} erm_nrrc_barring_info_update_req_struct;
+/********************************************
+ * VARIABLES *
+ ********************************************/
+
+
+/********************************************
+ * FUNCTION DECLARATIONS *
+ ********************************************/
+
+
+#endif /* ERM_NRRC_STRUCT_H */
diff --git a/mcu/protocol/interface/general/5g/l4c_vgsm_struct.h b/mcu/protocol/interface/general/5g/l4c_vgsm_struct.h
new file mode 100644
index 0000000..31ac018
--- /dev/null
+++ b/mcu/protocol/interface/general/5g/l4c_vgsm_struct.h
@@ -0,0 +1,64 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2021
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * l4c_vgsm_struct.h
+ *
+ * Description:
+ * ------------
+ * message and common structure definition between L4C and VGSM module
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ ****************************************************************************/
+
+
+#ifndef L4C_VGSM_STRUCT_INC
+#define L4C_VGSM_STRUCT_INC
+
+typedef struct {
+ LOCAL_PARA_HDR
+ vdm_voice_status_enum vdm_voice_status;
+ ims_access_rat_enum rat;
+} l4c_vgsm_vdm_ims_voice_status_ntf_struct;
+
+#endif /* ----- #ifndef L4C_VGSM_STRUCT_INC ----- */
diff --git a/mcu/protocol/interface/general/5g/vgmm_msg_unpack.h b/mcu/protocol/interface/general/5g/vgmm_msg_unpack.h
new file mode 100644
index 0000000..a14fced
--- /dev/null
+++ b/mcu/protocol/interface/general/5g/vgmm_msg_unpack.h
@@ -0,0 +1,1809 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2010
+*
+*****************************************************************************/
+
+/*******************************************************************************
+* Filename:
+* ---------
+* vgmm_msg_unpack.h
+*
+* Description:
+* ------------
+* This is the API for LTE MCDDLL to decode the air messages which are defined in TS 24.501 (VGMM).
+*
+*
+* Author:
+* -------
+ * -------
+*
+*******************************************************************************/
+#ifndef VGMM_MSG_UNPACK_H
+#define VGMM_MSG_UNPACK_H
+
+#if defined(__FIVEG_NAS__)
+#include "mcd.h"
+#include "mcd_vgmm_gen_peer.h"
+#include "vgnas_msg_unpack.h"
+
+// The definitions below are used by the IEs in air messages
+#define D_NO_VGS_MOBILE_ID 64
+#define D_NO_CRITERIA_TYPE 8
+#define D_NO_REPLAYED_S1_UE_SEC_CAP 5
+#define D_NO_VGS_TMSI 4
+#define D_NO_IMEI_DIGIT_BYTE 7
+#define D_NO_IMEISV_DIGIT_BYTE 8
+#define D_NO_PSI 16
+#define D_NO_EBI 16
+
+
+typedef enum
+{
+ Plain_5GS_NAS_message_not_security_protected = 0,
+ Integrity_protected,
+ Integrity_protected_and_ciphered,
+ Integrity_protected_with_new_5G_NAS_security_context,
+ Integrity_protected_and_ciphered_with_new_5G_NAS_security_context
+} mcddll_vgmm_sec_hdr_type_enum;
+
+typedef enum
+{
+ Registration_request= 65,
+ Registration_accept= 66,
+ Registration_complete= 67,
+ Registration_reject= 68,
+ Deregistration_request_UE_originating= 69,
+ Deregistration_accept_UE_originating= 70,
+ Deregistration_request_UE_terminated= 71,
+ Deregistration_accept_UE_terminated= 72,
+ Service_request= 76,
+ Service_reject= 77,
+ Service_accept= 78,
+ Configuration_update_command= 84,
+ Configuration_update_complete= 85,
+ Authentication_request= 86,
+ Authentication_response= 87,
+ c= 88,
+ Authentication_failure= 89,
+ Authentication_result= 90,
+ Identity_request= 91,
+ Identity_response= 92,
+ Security_mode_command= 93,
+ Security_mode_complete= 94,
+ Security_mode_reject= 95,
+ VGMM_status= 100,
+ Notification= 101,
+ Notification_response= 102,
+ UL_NAS_transport= 103,
+ DL_NAS_transport= 104
+} mcddll_vgmm_msg_type_enum;
+
+typedef enum
+{
+ initial_registration= 1,
+ mobility_registration_updating= 2,
+ periodic_registration_updating= 3,
+ emergency_registration= 4,
+ reg_type_val_reserved= 7
+} mcddll_vgmm_reg_type_val_enum;
+
+typedef enum
+{
+ SMS_over_NAS_not_supported=0,
+ SMS_over_NAS_supported
+}mcddll_vgmm_SMS_over_NAS_transport_requested_enum;
+
+typedef enum
+{
+ No_follow_on_request_pending=0,
+ Follow_on_request_pending
+}mcddll_vgmm_Follow_on_request_enum;
+
+//New
+typedef enum
+{
+ NG_RAN_radio_capability_update_not_needed = 0,
+ NG_RAN_radio_capability_update_needed = 1
+}mcddll_vgmm_ng_ran_rcu_enum;
+//End of New
+
+typedef struct _vgmm_mcddll_reg_type_struct
+{
+ kal_uint8 length;
+ kal_uint8 _spare;
+ mcddll_vgmm_Follow_on_request_enum follow_on_req;
+ mcddll_vgmm_reg_type_val_enum vgs_reg_type_val;
+} vgmm_mcddll_reg_type_struct;
+
+typedef enum
+{
+ NO_IDENTITY = 0,
+ SUCI = 1,
+ VG_GUTI = 2,
+ IMEI = 3,
+ VG_STMSI = 4,
+ IMEI_SV = 5
+} mcddll_vgmm_type_of_id_enum;
+
+
+typedef enum
+{
+ native_security_context,
+ mapped_security_context
+}mcddll_vgmm_TSC_enum;
+
+
+typedef enum
+{
+ id_rsp_SUCI = 1,
+ id_rsp_vg_GUTI = 2,
+ id_rsp_IMEI = 3,
+ id_rsp_vg_S_TMSI = 4,
+ id_rsp_IMEISVI = 5
+}mcddll_vgmm_id_rsp_type_of_identity_enum;
+
+typedef enum
+{
+ threeGPP_access_reg_result = 1,
+ non_threeGPP_access_reg_result = 2,
+ threeGPP_and_non_threeGPP_access_reg_result,
+ reg_result_reserved_reg_result = 7
+}mcddll_vgmm_vgs_reg_result_val_enum;
+
+typedef enum
+{
+ SMS_over_NAS_not_allowed,
+ SMS_over_NAS_allowed
+}mcddll_vgmm_sms_allowed_enum;
+typedef struct _vgmm_mcddll_reg_result_struct
+{
+ kal_uint8 length;
+ kal_uint8 _spare;
+ mcddll_vgmm_sms_allowed_enum sms_allowed;
+ mcddll_vgmm_vgs_reg_result_val_enum vgs_reg_result_val;
+}vgmm_mcddll_reg_result_struct;
+
+typedef enum
+{
+ Normal_dereg = 0,
+ Switch_off
+}mcddll_vgmm_switch_off_enum;
+
+typedef enum
+{
+ re_egistration_not_required = 0,
+ re_registration_required
+}mcddll_vgmm_dereg_req_enum;
+
+
+
+typedef enum
+{
+ Illegal_UE = 3,
+ PEI_not_accepted= 5,
+ Illegal_ME= 6,
+ vgs_services_not_allowed = 7,
+ UE_identity_cannot_derived_by_the_NW = 9,
+ Implicitly_deregistered= 10,
+ PLMN_not_allowed = 11,
+ Tracking_area_not_allowed = 12,
+ Roaming_not_allowed_in_this_tracking_area = 13,
+ No_suitable_cells_in_tracking_area = 15,
+ MAC_failure = 20,
+ Synch_failure = 21,
+ Congestion = 22,
+ UE_security_capabilities_mismatch = 23,
+ Security_mode_rejected_unspecified = 24,
+ Non_5G_authentication_unacceptable = 26,
+ N1_mode_not_allowed = 27,
+ Restricted_service_area = 28,
+ LADN_not_available = 43,
+ Maximum_number_of_PDU_sessions_reached = 65,
+ Insufficient_resources_for_specific_slice_and_DNN = 67,
+ Insufficient_resources_for_specific_slice = 69,
+ ngKSI_already_in_use = 71,
+ Payload_was_not_forwarded = 82,
+ DNN_not_supported_or_not_subscribed_in_the_slice = 83,
+ Insufficient_user_place_resources_for_the_PDU_session = 84,
+ Semantically_incorrect_message = 95,
+ Invalid_mandatory_information,
+ Message_type_non_existent_or_not_implemented,
+ Message_type_not_compatible_with_the_protocol_state,
+ Information_element_non_existent_or_not_implemented,
+ Conditional_IE_error,
+ Message_not_compatible_with_the_protocol_state,
+ Protocol_error_unspecified = 111
+}mcddll_vgmm_cause_enum;
+
+typedef enum
+{
+ from_N1_to_S1_not_supported = 0,
+ from_N1_to_S1_supported ,
+}mcddll_vgmm_ho_attach_enum;
+
+typedef enum
+{
+ S1_not_supported = 0,
+ S1_supported
+}mcddll_vgmm_s1_mode_enum;
+
+typedef enum
+{
+ LPP_IN_N1_MODE_NOT_SUPPORTED = 0,
+ LPP_IN_N1_MODE_SUPPORTED
+}mcddll_vgmm_lpp_cap_enum;
+
+typedef enum
+{
+ RETRANS_INIT_NAS_MSG_NOT_REQUESTED = 0,
+ RETRANS_INIT_NAS_MSG_REQUESTED
+}mcddll_vgmm_rinmr_enum;
+
+typedef enum
+{
+ REQUESTED_NSSAI_NOT_CREATED_FROM_DEFAULT_CONFIGURED_NSSAI = 0,
+ REQUESTED_NSSAI_CREATED_FROM_DEFAULT_CONFIGURED_NSSAI
+}mcddll_vgmm_dcni_enum;
+
+typedef enum
+{
+ ACC_ID_1_NOT_VALID_IN_RPLMN_OR_EPLMN = 0,
+ ACC_ID_1_VALID_IN_RPLMN_OR_EPLMN
+}mcddll_vgmm_mpsi_enum;
+
+typedef enum
+{
+ IWK_WITHOUT_N26_NOT_SUPPORTED = 0,
+ IWK_WITHOUT_N26_SUPPORTED
+}mcddll_vgmm_iwkn26_enum;
+
+typedef enum
+{
+ EMERGENCY_SERVICE_FALLBACK_NOT_SUPPORTED = 0,
+ EMERGENCY_SERVICE_FALLBACK_SUPPORTED_IN_NR_CONN_TO_5GCN_ONLY,
+ EMERGENCY_SERVICE_FALLBACK_SUPPORTED_IN_EUTRA_CONN_TO_5GCN_ONLY,
+ EMERGENCY_SERVICE_FALLBACK_SUPPORTED_IN_NR_CONN_TO_5GCN_AND_EUTRA_CONN_TO_5GCN
+}mcddll_vgmm_emf_enum;
+
+typedef enum
+{
+ EMERGENCY_SERVICE_NOT_SUPPORTED = 0,
+ EMERGENCY_SERVICE_SUPPORTED_IN_NR_CONN_TO_5GCN_ONLY,
+ EMERGENCY_SERVICE_SUPPORTED_IN_EUTRA_CONN_TO_5GCN_ONLY,
+ EMERGENCY_SERVICE_SUPPORTED_IN_NR_CONN_TO_5GCN_AND_EUTRA_CONN_TO_5GCN
+}mcddll_vgmm_emc_enum;
+
+typedef enum
+{
+ IMS_VOICE_OVER_PS_SESSION_NOT_SUPPORTED_OVER_N3GPP_ACC = 0,
+ IMS_VOICE_OVER_PS_SESSION_SUPPORTED_OVER_N3GPP_ACC
+}mcddll_vgmm_ims_vops_n3gpp_enum;
+
+typedef enum
+{
+ IMS_VOICE_OVER_PS_SESSION_NOT_SUPPORTED_OVER_3GPP_ACC = 0,
+ IMS_VOICE_OVER_PS_SESSION_SUPPORTED_OVER_3GPP_ACC
+}mcddll_vgmm_ims_vops_3gpp_enum;
+
+typedef enum
+{
+ ACC_ID_2_NOT_VALID_IN_RPLMN_OR_EPLMN = 0,
+ ACC_ID_2_VALID_IN_RPLMN_OR_EPLMN
+}mcddll_vgmm_mcsi_enum;
+
+typedef enum
+{
+ EMERGENCY_SERVICE_NOT_SUPPORTED_OVER_N3GPP_ACC = 0,
+ EMERGENCY_SERVICE_SUPPORTED_OVER_N3GPP_ACC
+}mcddll_vgmm_emcn3_enum;
+
+typedef enum
+{
+ signalling=0,
+ data,
+ mobile_terminated_services,
+ emergency_services,
+ emergency_services_fallback,
+ high_priority_access,
+ elevated_signalling,
+ unused_signalling_0,
+ unused_signalling_1,
+ unused_data_0,
+ unused_data_1,
+ unused_data_2
+}mcddll_vgmm_service_type_enum;
+
+typedef struct _vgmm_mcddll_service_type_struct
+{
+ kal_uint8 service_type_spare;
+ mcddll_vgmm_service_type_enum service_type_val;
+} vgmm_mcddll_service_type_struct;
+
+typedef struct _vgmm_mcddll_ue_sec_cap_struct
+{
+ kal_uint8 length;
+ kal_uint8 EA0;
+ kal_uint8 EA1;
+ kal_uint8 EA2;
+ kal_uint8 EA3;
+ kal_uint8 EA4;
+ kal_uint8 EA5;
+ kal_uint8 EA6;
+ kal_uint8 EA7;
+ kal_uint8 IA0;
+ kal_uint8 IA1;
+ kal_uint8 IA2;
+ kal_uint8 IA3;
+ kal_uint8 IA4;
+ kal_uint8 IA5;
+ kal_uint8 IA6;
+ kal_uint8 IA7;
+ kal_uint8 EEA0;
+ kal_uint8 EEA1;
+ kal_uint8 EEA2;
+ kal_uint8 EEA3;
+ kal_uint8 EEA4;
+ kal_uint8 EEA5;
+ kal_uint8 EEA6;
+ kal_uint8 EEA7;
+ kal_uint8 EIA0;
+ kal_uint8 EIA1;
+ kal_uint8 EIA2;
+ kal_uint8 EIA3;
+ kal_uint8 EIA4;
+ kal_uint8 EIA5;
+ kal_uint8 EIA6;
+ kal_uint8 EIA7;
+}vgmm_mcddll_ue_sec_cap_struct;
+
+typedef enum
+{
+ voice_centric = 0,
+ data_centric = 1
+}mcddll_vgmm_ue_usage_setting_enum;
+
+typedef enum
+{
+ N1_SM_information = 1,
+ SMS,
+ LTE_Positioning_Protocol_message_container,
+ SOR_transparent_container,
+ UE_policy_container,
+ UE_para_update_transparent_container,
+ Multiple_payloads = 15
+}mcddll_vgmm_payload_cont_type_val_enum;
+
+typedef enum{
+ initial_request=1,
+ existing_PDU_session,
+ initial_emergency_request,
+ existing_emergency_PDU_session,
+ reserved = 7
+}mcddll_vgmm_req_type_enum;
+
+typedef enum{
+ reg_not_requested = 0,
+ reg_requested
+}mcddll_vgmm_RED_enum;
+
+typedef enum{
+ ack_not_requested = 0,
+ ack_requested
+}mcddll_vgmm_ACK_enum;
+
+typedef struct _vgmm_mcddll_config_update_ind_struct{
+ kal_uint8 _spare;
+ mcddll_vgmm_RED_enum RED;
+ mcddll_vgmm_ACK_enum ACK;
+} vgmm_mcddll_config_update_ind_struct;
+
+typedef struct _vgmm_mcddll_identity_type_struct
+{
+ kal_uint8 identity_type_spare;
+ mcddll_vgmm_id_rsp_type_of_identity_enum identity_type;
+} vgmm_mcddll_identity_type_struct;
+
+typedef enum
+{
+ int_vg_IA0_null_integrity_protection_algorithm = 0,
+ int_128_vg_IA1,
+ int_128_vg_IA2,
+ int_128_vg_IA3,
+ int_vg_IA4,
+ int_vg_IA5,
+ int_vg_IA6,
+ int_vg_IA7
+} mcddll_vgmm_integrity_protection_algorithm_enum;
+
+typedef enum
+{
+ encry_vg_IA0_null_cipering_algorithm = 0,
+ encry_128_vg_IA1,
+ encry_128_vg_IA2,
+ encry_128_vg_IA3,
+ encry_vg_IA4,
+ encry_vg_IA5,
+ encry_vg_IA6,
+ encry_vg_IA7
+}mcddll_vgmm_ciphering_algorithm_enum;
+
+typedef struct _vgmm_mcddll_nas_sec_alg_struct
+{
+ mcddll_vgmm_integrity_protection_algorithm_enum int_pro_alg;
+ mcddll_vgmm_ciphering_algorithm_enum cipher_alg;
+}vgmm_mcddll_nas_sec_alg_struct;
+
+typedef struct _vgmm_mcddll_eps_nas_sec_alg_struct
+{
+ kal_uint8 cipher_alg_spare;
+ mcddll_vgmm_ciphering_algorithm_enum cipher_alg;
+ kal_uint8 int_pro_alg_spare;
+ mcddll_vgmm_integrity_protection_algorithm_enum int_pro_alg;
+} vgmm_mcddll_eps_nas_sec_alg_struct;
+
+typedef struct _vgmm_mcddll_nas_key_set_id_struct
+{
+ mcddll_vgmm_TSC_enum tsc;
+ kal_uint8 ksi_val;
+}vgmm_mcddll_nas_key_set_id_struct;
+
+typedef enum
+{
+ threeGPP_access = 1,
+ non_threeGPP_access,
+ threeGPP_and_non_threeGPP_access
+}mcddll_vgmm_access_type_enum;
+
+typedef struct _vgmm_mcddll_access_type_struct
+{
+ kal_uint8 _spare;
+ mcddll_vgmm_access_type_enum access_type_val;
+}vgmm_mcddll_access_type_struct;
+
+typedef struct _vgmm_mcddll_vgmm_cap_struct
+{
+ kal_uint8 cap_length;
+ kal_uint8 _spare;
+ mcddll_vgmm_ho_attach_enum ho_attach;
+ mcddll_vgmm_s1_mode_enum s1_mode;
+ mcddll_vgmm_lpp_cap_enum lpp;
+}vgmm_mcddll_vgmm_cap_struct;
+
+typedef enum
+{
+ all_PLMN_registration_area_not_allocated,
+ all_PLMN_registration_area_allocated
+}mcddll_vgmm_raai_enum;
+
+typedef struct _vgmm_mcddll_mico_ind_struct
+{
+ kal_uint8 raai_spare;
+ mcddll_vgmm_raai_enum raai;
+}vgmm_mcddll_mico_ind_struct;
+
+//New
+
+typedef enum
+{
+ Network_slicing_subscription_not_changed = 0,
+ Network_slicing_subscription_changed = 1
+}mcddll_vgmm_nssci_enum;
+
+typedef enum
+{
+ list_type_is_a_secure_packet = 0,
+ list_type_is_a_PLMN_ID_and_access_technology_list = 1
+}mcddll_vgmm_list_type_enum;
+
+typedef enum
+{
+ list_of_preferred_PLMN_or_access_technology_combinations_is_not_provided = 0,
+ list_of_preferred_PLMN_or_access_technology_combinations_is_provided = 1
+}mcddll_vgmm_list_ind_enum;
+
+typedef enum
+{
+ The_SOR_transparent_container_carries_steering_of_roaming_information = 0,
+ The_SOR_transparent_container_carries_acknowledgement_of_successful_reception_of_the_steering_of_roaming_information = 1
+}mcddll_vgmm_sor_data_type_enum;
+
+typedef enum
+{
+ K_AMF_derivation_is_not_required = 0,
+ K_AMF_derivation_is_required = 1
+}mcddll_vgmm_hdp_enum;
+
+
+typedef struct _vgmm_mcddll_nw_slice_ind_struct
+{
+ kal_uint8 _spare;
+ mcddll_vgmm_dcni_enum dcni;
+ mcddll_vgmm_nssci_enum nssci;
+}vgmm_mcddll_nw_slice_ind_struct;
+
+typedef struct _vgmm_mcddll_sor_hdr_struct
+{
+ kal_uint8 _spare;
+ mcddll_vgmm_ACK_enum ACK;
+ mcddll_vgmm_list_type_enum list_type;
+ mcddll_vgmm_list_ind_enum list_ind;
+ mcddll_vgmm_sor_data_type_enum sor_data_type;
+}vgmm_mcddll_sor_hdr_struct;
+
+typedef struct _vgmm_mcddll_additional_5g_sec_info_struct
+{
+ kal_uint8 length;
+ kal_uint8 _spare;
+ mcddll_vgmm_rinmr_enum rinmr;
+ mcddll_vgmm_hdp_enum hdp;
+}vgmm_mcddll_additional_5g_sec_info_struct;
+
+//End of New
+
+typedef enum
+{
+ UE_is_not_in_5GMM_REGISTERED_state,
+ UE_is_in_5GMM_REGISTERED_state
+} mcddll_vgmm_s1_mode_reg_enum;
+
+typedef enum
+{
+ UE_is_not_in_EMM_REGISTERED_state,
+ UE_is_in_EMM_REGISTERED_state
+} mcddll_vgmm_n1_mode_reg_enum;
+
+typedef struct _vgmm_mcddll_ue_status_struct
+{
+ mcddll_vgmm_s1_mode_reg_enum s1_mode_reg;
+ mcddll_vgmm_n1_mode_reg_enum n1_mode_reg;
+}vgmm_mcddll_ue_status_struct;
+
+typedef struct _mcddll_vgmm_dereg_type_struct
+{
+ mcddll_vgmm_switch_off_enum switch_off;
+ mcddll_vgmm_dereg_req_enum re_reg_req;
+ mcddll_vgmm_access_type_enum access_type;
+} mcddll_vgmm_dereg_type_struct;
+
+typedef struct _mcddll_vgmm_ue_usage_setting_struct
+{
+ kal_uint8 length;
+ kal_uint8 _spare;
+ mcddll_vgmm_ue_usage_setting_enum ue_usage_setting;
+}mcddll_vgmm_ue_usage_setting_struct;
+
+typedef enum
+{
+ //To fix confliction with VGSM's enum, add _MCDDLL
+ PDU_SESSION_INACTIVE_MCDDLL = 0,
+ PDU_SESSION_ACTIVE_MCDDLL
+} mcddll_vgmm_pdu_session_status_enum;
+
+typedef enum
+{
+ NO_PENDING_UL_DATA_EXIST = 0,
+ PENDING_UL_DATA_EXIST
+}mcddll_ul_data_status_enum;
+
+typedef struct _vgmm_mcddll_pdu_session_status_struct
+{
+ kal_uint8 length;
+ mcddll_vgmm_pdu_session_status_enum PSI[D_NO_PSI];
+} vgmm_mcddll_pdu_session_status_struct;
+
+typedef struct _vgmm_mcddll_pdu_session_react_result_struct
+{
+ kal_uint8 length;
+ kal_uint8 PSI[D_NO_PSI];
+} vgmm_mcddll_pdu_session_react_result_struct;
+
+typedef enum
+{
+ incremented_in_multiples_of_2_seconds = 0,
+ incremented_in_multiples_of_1_minute = 1,
+ incremented_in_multiples_of_decihours = 2,
+ the_timer_is_deactivated = 7
+} mcddll_timer_unit_enum;
+
+typedef struct _mcddll_timer_struct
+{
+ mcddll_timer_unit_enum timer_unit;
+ kal_uint8 timer_val;
+} mcddll_timer_struct;
+typedef enum
+{
+ value_is_incremented_in_multiples_of_10_minutes = 0,
+ value_is_incremented_in_multiples_of_1_hour = 1,
+ value_is_incremented_in_multiples_of_10_hours = 2,
+ value_is_incremented_in_multiples_of_2_seconds = 3,
+ value_is_incremented_in_multiples_of_30_seconds = 4,
+ value_is_incremented_in_multiples_of_1_minute = 5,
+ value_is_incremented_in_multiples_of_320_hours = 6,
+ value_indicates_that_the_timer_is_deactivated = 7
+} mcddll_timer3_value_unit_enum;
+
+typedef struct _mcddll_timer_3_struct
+{
+ kal_uint8 timer_3_len;
+ mcddll_timer3_value_unit_enum timer_unit;
+ kal_uint8 timer_val;
+
+} mcddll_timer_3_struct;
+
+typedef enum
+{
+ should_not_add_the_letters_for_the_Country_Initials_to_the_text_string = 0,
+ should_add_the_letters_for_the_Country_Initials_and_a_separator = 1
+} mcddll_vgmm_add_CI_enum;
+
+typedef enum
+{
+ this_field_carries_no_information_about_the_number_of_spare_bits_in_octet_n = 0,
+ bit_8_is_spare_and_set_to_0_in_octet_n = 1,
+ bits_7_and_8_are_spare_and_set_to_0_in_octet_n = 2,
+ bits_6_to_8_are_spare_and_set_to_0_in_octet_n = 3,
+ bits_5_to_8_are_spare_and_set_to_0_in_octet_n = 4,
+ bits_4_to_8_are_spare_and_set_to_0_in_octet_n = 5,
+ bits_3_to_8_are_spare_and_set_to_0_in_octet_n = 6,
+ bits_2_to_8_are_spare_and_set_to_0_in_octet_n = 7
+} mcddll_vgmm_spare_bits_in_last_octet_enum;
+
+typedef enum
+{
+ No_adjustment_for_Daylight_Saving_Time = 0,
+ add_1_hour_adjustment_for_Daylight_Saving_Time = 1,
+ add_2_hours_adjustment_for_Daylight_Saving_Time = 2,
+ Reserved_val = 3
+} mcddll_vgmm_daylight_saving_time_enum;
+
+typedef enum
+{
+ IMEISV_not_requested = 0,
+ IMEISV_requested = 1,
+} mcddll_vgmm_imeisv_req_val_enum;
+
+typedef struct _vgmm_mcddll_imeisv_req_struct
+{
+ kal_uint8 imeisv_req_spare;
+ mcddll_vgmm_imeisv_req_val_enum imeisv_req_val;
+} vgmm_mcddll_imeisv_req_struct;
+
+typedef struct _vgmm_mcddll_5g_update_type_struct
+{
+ kal_uint8 length;
+ kal_uint8 _spare;
+ mcddll_vgmm_ng_ran_rcu_enum ng_ran_rcu;
+ mcddll_vgmm_SMS_over_NAS_transport_requested_enum sms_req;
+}vgmm_mcddll_5g_update_type_struct;
+
+typedef enum
+{
+ NSSAI_INCLUSION_MODE_A = 0,
+ NSSAI_INCLUSION_MODE_B,
+ NSSAI_INCLUSION_MODE_C,
+ NSSAI_INCLUSION_MODE_D
+}vgmm_mcddll_nssai_inclusion_mode_enum;
+
+typedef enum
+{
+ ST_ACC_CAT_FIELD_NOT_INCLUDED = 0,
+ ST_ACC_CAT_FIELD_INCLUDED
+}mcddll_vgmm_psac_enum;
+
+typedef enum
+{
+ ACC_CAT_NUM_32 = 0,
+ ACC_CAT_NUM_33,
+ ACC_CAT_NUM_34,
+ ACC_CAT_NUM_35,
+ ACC_CAT_NUM_36,
+ ACC_CAT_NUM_37,
+ ACC_CAT_NUM_38,
+ ACC_CAT_NUM_39,
+ ACC_CAT_NUM_40,
+ ACC_CAT_NUM_41,
+ ACC_CAT_NUM_42,
+ ACC_CAT_NUM_43,
+ ACC_CAT_NUM_44,
+ ACC_CAT_NUM_45,
+ ACC_CAT_NUM_46,
+ ACC_CAT_NUM_47,
+ ACC_CAT_NUM_48,
+ ACC_CAT_NUM_49,
+ ACC_CAT_NUM_50,
+ ACC_CAT_NUM_51,
+ ACC_CAT_NUM_52,
+ ACC_CAT_NUM_53,
+ ACC_CAT_NUM_54,
+ ACC_CAT_NUM_55,
+ ACC_CAT_NUM_56,
+ ACC_CAT_NUM_57,
+ ACC_CAT_NUM_58,
+ ACC_CAT_NUM_59,
+ ACC_CAT_NUM_60,
+ ACC_CAT_NUM_61,
+ ACC_CAT_NUM_62,
+ ACC_CAT_NUM_63
+}mcddll_vgmm_op_def_access_cat_num_enum;
+
+typedef enum
+{
+ DNN_TYPE = 0,
+ OS_ID_OS_APP_ID_TYPE,
+ SNSSAI_TYPE,
+ MAX_TYPE = 63
+}mcddll_vgmm_criteria_type;
+
+typedef enum
+{
+ ACC_CAT_NUM_0 = 0,
+ ACC_CAT_NUM_1,
+ ACC_CAT_NUM_2,
+ ACC_CAT_NUM_3,
+ ACC_CAT_NUM_4,
+ ACC_CAT_NUM_5,
+ ACC_CAT_NUM_6,
+ ACC_CAT_NUM_7,
+ ACC_CAT_NUM_MAX = 31
+}vgmm_mcddll_st_acc_cat_enum;
+
+typedef enum
+{
+ DRX_VALUE_NOT_SPECIFIED = 0,
+ DRX_CYCLE_PARA_T_32,
+ DRX_CYCLE_PARA_T_64,
+ DRX_CYCLE_PARA_T_128,
+ DRX_CYCLE_PARA_T_256,
+ DRX_VALUE_ENUM_MAX = 15
+}vgmm_mcddll_drx_value_enum;
+
+typedef enum
+{
+ SMS_OVER_NAS_NOT_AVAILABLE = 0,
+ SMS_OVER_NAS_AVAILABLE
+}vgmm_mcddll_sai_enum;
+
+typedef struct
+{
+ kal_uint8 _spare;
+ vgmm_mcddll_sai_enum sai;
+}vgmm_mcddll_sms_ind_struct;
+
+typedef struct
+{
+ kal_uint8 length;
+ kal_uint8 EEA0;
+ kal_uint8 EEA1;
+ kal_uint8 EEA2;
+ kal_uint8 EEA3;
+ kal_uint8 EEA4;
+ kal_uint8 EEA5;
+ kal_uint8 EEA6;
+ kal_uint8 EEA7;
+ kal_uint8 EIA0;
+ kal_uint8 EIA1;
+ kal_uint8 EIA2;
+ kal_uint8 EIA3;
+ kal_uint8 EIA4;
+ kal_uint8 EIA5;
+ kal_uint8 EIA6;
+ kal_uint8 EIA7;
+ kal_uint8 UEA0;
+ kal_uint8 UEA1;
+ kal_uint8 UEA2;
+ kal_uint8 UEA3;
+ kal_uint8 UEA4;
+ kal_uint8 UEA5;
+ kal_uint8 UEA6;
+ kal_uint8 UEA7;
+ kal_uint8 UIA0;
+ kal_uint8 UIA1;
+ kal_uint8 UIA2;
+ kal_uint8 UIA3;
+ kal_uint8 UIA4;
+ kal_uint8 UIA5;
+ kal_uint8 UIA6;
+ kal_uint8 UIA7;
+ kal_uint8 GEA0;
+ kal_uint8 GEA1;
+ kal_uint8 GEA2;
+ kal_uint8 GEA3;
+ kal_uint8 GEA4;
+ kal_uint8 GEA5;
+ kal_uint8 GEA6;
+ kal_uint8 GEA7;
+}vgmm_mcddll_s1_ue_sec_cap_struct;
+
+typedef struct
+{
+ kal_uint8 length;
+ mcddll_vgmm_mpsi_enum MPSI;
+ mcddll_vgmm_iwkn26_enum IWK_N26;
+ mcddll_vgmm_emf_enum EMF;
+ mcddll_vgmm_emc_enum EMC;
+ mcddll_vgmm_ims_vops_n3gpp_enum IMS_VoPS_N3GPP;
+ mcddll_vgmm_ims_vops_3gpp_enum IMS_VoPS_3GPP;
+ kal_uint8 _spare;
+ mcddll_vgmm_mcsi_enum MCSI;
+ mcddll_vgmm_emcn3_enum EMCN3;
+}mcddll_vgs_nw_feature_support_struct;
+
+typedef struct
+{
+ kal_uint8 _spare;
+ vgmm_mcddll_nssai_inclusion_mode_enum nssai_inclusion_mode_val;
+}mcddll_nssai_inclusion_mode_struct;
+
+typedef struct
+{
+ kal_uint8 length;
+ mcddll_ul_data_status_enum PSI[D_NO_PSI];
+}mcddll_uplink_data_status_struct;
+
+typedef enum
+{
+ NOTIFICATION_PROCEDURE_NOT_SUPPORTED,
+ NOTIFICATION_PROCEDURE_SUPPORTED
+}mcddll_nf_cap_enum;
+
+typedef enum
+{
+ ONExSRVCC_NOT_SUPPORTED,
+ ONExSRVCC_SUPPORTED
+}mcddll_1xsrvcc_cap_enum;
+
+typedef enum
+{
+ LCS_NOT_SUPPORTED,
+ LCS_SUPPORTED
+}mcddll_lcs_cap_enum;
+
+typedef enum
+{
+ LPP_NOT_SUPPORTED,
+ LPP_SUPPORTED
+}mcddll_lpp_cap_enum;
+
+typedef enum
+{
+ ACC_CSFB_NOT_SUPPORTED,
+ ACC_CSFB_SUPPORTED
+}mcddll_acc_csfb_cap_enum;
+
+typedef enum
+{
+ H245_ASH_NOT_SUPPORTED,
+ H245_ASH_SUPPORTED
+}mcddll_h245_ash_cap_enum;
+
+typedef enum
+{
+ ProSe_NOT_SUPPORTED = 0,
+ ProSe_SUPPORTED
+}mcddll_prose_cap_enum;
+
+typedef enum
+{
+ ProSe_DIRECT_DISCOVERY_NOT_SUPPORTED = 0,
+ ProSe_DIRECT_DISCOVERY_SUPPORTED
+}mcddll_prosedd_cap_enum;
+
+typedef enum
+{
+ ProSe_DIRECT_COMMUNICATION_NOT_SUPPORTED = 0,
+ ProSe_DIRECT_COMMUNICATION_SUPPORTED
+}mcddll_prosedc_cap_enum;
+
+typedef enum
+{
+ ACT_AS_ProSe_RELAY_NOT_SUPPORTED = 0,
+ ACT_AS_ProSe_RELAY_SUPPORTED
+}mcddll_prose_relay_cap_enum;
+
+typedef enum
+{
+ CP_CIoT_EPS_OPT_NOT_SUPPORTED = 0,
+ CP_CIoT_EPS_OPT_SUPPORTED
+}mcddll_cp_ciot_eps_op_cap_enum;
+
+typedef enum
+{
+ UP_CIoT_EPS_OPT_NOT_SUPPORTED = 0,
+ UP_CIoT_EPS_OPT_SUPPORTED
+}mcddll_up_ciot_eps_op_cap_enum;
+
+
+typedef enum
+{
+ S1U_DATA_TRANSFER_NOT_SUPPORTED = 0,
+ S1U_DATA_TRANSFER_SUPPORTED
+}mcddll_s1u_data_transfer_cap_enum;
+
+typedef enum
+{
+ ER_WITHOUT_PDN_CONN_NOT_SUPPORTED = 0,
+ ER_WITHOUT_PDN_CONN_SUPPORTED
+}mcddll_erwithoutpdn_cap_enum;
+
+typedef enum
+{
+ HC_CP_CIoT_NOT_SUPPORTED = 0,
+ HC_CP_CIoT_SUPPORTED
+}mcddll_hc_cp_ciot_cap_enum;
+
+typedef enum
+{
+ ePCO_NOT_SUPPORTED = 0,
+ ePCO_SUPPORTED
+}mcddll_epco_cap_enum;
+
+typedef enum
+{
+ MULTI_DRB_NOT_SUPPORTED = 0,
+ MULTI_DRB_SUPPORTED
+}mcddll_mul_drb_cap_enum;
+
+typedef enum
+{
+ V2X_COM_OVER_PC5_NOT_SUPPORTED = 0,
+ V2X_COM_OVER_PC5_SUPPORTED
+}mcddll_v2x_com_over_pc5_cap_enum;
+
+typedef enum
+{
+ RESTRICT_ON_USE_OF_EC_NOT_SUPPORTED = 0,
+ RESTRICT_ON_USE_OF_EC_SUPPORTED
+}mcddll_restrict_ec_cap_enum;
+
+typedef enum
+{
+ CP_BACKOFF_TIMER_NOT_SUPPORTED = 0,
+ CP_BACKOFF_TIMER_SUPPORTED
+}mcddll_cp_backoff_cap_enum;
+
+typedef enum
+{
+ DCNR_NOT_SUPPORTED = 0,
+ DCNR_SUPPORTED
+}mcddll_dcnr_cap_enum;
+
+typedef enum
+{
+ N1_MODE_NOT_SUPPORTED = 0,
+ N1_MODE_SUPPORTED
+}mcddll_n1_mode_cap_enum;
+
+typedef enum
+{
+ SGC_NOT_SUPPORTED = 0,
+ SGC_SUPPORTED
+}mcddll_sgc_cap_enum;
+
+typedef enum
+{
+ SIGNAL_FOR_MAX_15_EPS_BEARER_NOT_SUPPORTED = 0,
+ SIGNAL_FOR_MAX_15_EPS_BEARER_SUPPORTED
+}mcddll_signal_for_max_15eps_bearer_cap_enum;
+
+typedef enum
+{
+ UCS2_NOT_SUPPORTED = 0,
+ UCS2_SUPPORTED
+}mcddll_ucs2_cap_enum;
+
+typedef struct
+{
+ kal_uint8 length;
+ kal_uint8 EEA0;
+ kal_uint8 EEA1;
+ kal_uint8 EEA2;
+ kal_uint8 EEA3;
+ kal_uint8 EEA4;
+ kal_uint8 EEA5;
+ kal_uint8 EEA6;
+ kal_uint8 EEA7;
+ kal_uint8 EIA0;
+ kal_uint8 EIA1;
+ kal_uint8 EIA2;
+ kal_uint8 EIA3;
+ kal_uint8 EIA4;
+ kal_uint8 EIA5;
+ kal_uint8 EIA6;
+ kal_uint8 EIA7;
+ kal_uint8 UEA0;
+ kal_uint8 UEA1;
+ kal_uint8 UEA2;
+ kal_uint8 UEA3;
+ kal_uint8 UEA4;
+ kal_uint8 UEA5;
+ kal_uint8 UEA6;
+ kal_uint8 UEA7;
+ mcddll_ucs2_cap_enum UCS2;
+ kal_uint8 UIA0;
+ kal_uint8 UIA1;
+ kal_uint8 UIA2;
+ kal_uint8 UIA3;
+ kal_uint8 UIA4;
+ kal_uint8 UIA5;
+ kal_uint8 UIA6;
+ mcddll_prosedd_cap_enum Prosedd;
+ mcddll_prose_cap_enum Prose;
+ mcddll_h245_ash_cap_enum H245_ASH;
+ mcddll_acc_csfb_cap_enum ACC_CSFB;
+ mcddll_lpp_cap_enum LPP;
+ mcddll_lcs_cap_enum LCS;
+ mcddll_1xsrvcc_cap_enum OnexSRVCC;
+ mcddll_nf_cap_enum NF;
+ mcddll_epco_cap_enum ePCO;
+ mcddll_hc_cp_ciot_cap_enum HC_CP_CIoT;
+ mcddll_erwithoutpdn_cap_enum ERwithoutPDN;
+ mcddll_s1u_data_transfer_cap_enum S1U_DATA;
+ mcddll_up_ciot_eps_op_cap_enum UP_CIoT;
+ mcddll_cp_ciot_eps_op_cap_enum CP_CIoT;
+ mcddll_prose_relay_cap_enum Prose_relay;
+ mcddll_prosedc_cap_enum Prose_dc;
+ mcddll_signal_for_max_15eps_bearer_cap_enum fifteenbearers;
+ mcddll_sgc_cap_enum SGC;
+ mcddll_n1_mode_cap_enum N1mode;
+ mcddll_dcnr_cap_enum dcnr;
+ mcddll_cp_backoff_cap_enum CP_backoff;
+ mcddll_restrict_ec_cap_enum RestrictEC;
+ mcddll_v2x_com_over_pc5_cap_enum V2XPC5;
+ mcddll_mul_drb_cap_enum multipleDRB;
+}mcddll_s1_ue_nw_cap_struct;
+
+typedef struct
+{
+ kal_uint8 length;
+ kal_uint8 EBI[D_NO_EBI];
+}mcddll_epsb_context_status_struct;
+
+typedef struct
+{
+ kal_uint16 length;
+ kal_uint8 digit0;
+ kal_uint8 _spare;
+ mcddll_vgmm_type_of_id_enum identity_type;
+ vgs_plmn_id_struct plmn_id;
+ kal_uint8 amf_region_id;
+ kal_uint8 amf_set_id;
+ kal_uint8 amf_set_id_cont;
+ kal_uint8 amf_pointer;
+ kal_uint8 vgs_tmsi[D_NO_VGS_TMSI];
+}mcddll_vgs_guti_struct;
+
+typedef struct
+{
+ kal_uint16 length;
+ kal_uint8 digit0;
+ kal_uint8 _spare;
+ mcddll_vgmm_type_of_id_enum identity_type;
+ kal_uint8 amf_set_id;
+ kal_uint8 amf_set_id_cont;
+ kal_uint8 amf_pointer;
+ kal_uint8 vgs_tmsi[D_NO_VGS_TMSI];
+}mcddll_vgs_s_tmsi_struct;
+
+typedef struct
+{
+ kal_uint16 length;
+ kal_uint8 digit0;
+ kal_uint8 odd_or_even;
+ mcddll_vgmm_type_of_id_enum identity_type;
+ kal_uint8 digit_byte[D_NO_IMEI_DIGIT_BYTE];
+}mcddll_vgs_imei_struct;
+
+typedef struct
+{
+ kal_uint16 length;
+ kal_uint8 digit0;
+ kal_uint8 odd_or_even;
+ mcddll_vgmm_type_of_id_enum identity_type;
+ kal_uint8 digit_byte[D_NO_IMEISV_DIGIT_BYTE];
+}mcddll_vgs_imeisv_struct;
+
+typedef union
+{
+ vgs_no_id_struct no_id;
+ kal_uint8 suci[D_NO_VGS_MOBILE_ID];
+ mcddll_vgs_guti_struct vg_guti;
+ mcddll_vgs_imei_struct imei;
+ mcddll_vgs_s_tmsi_struct vg_stmsi;
+ mcddll_vgs_imeisv_struct imeisv;
+}vgmm_mcddll_vgs_mobile_id_union;
+
+typedef struct _vgmm_mcddll_op_def_access_cat_def_struct
+{
+ kal_uint8 len_op_def_access_cat_def;
+ kal_uint8 prece_value;
+ mcddll_vgmm_psac_enum psac;
+ kal_uint8 spare;
+ mcddll_vgmm_op_def_access_cat_num_enum op_def_acc_cat_num;
+ kal_uint8 len_criteria;
+ mcddll_vgmm_criteria_type criteria[D_NO_CRITERIA_TYPE];
+ kal_uint8 st_acc_cat_spare;
+ vgmm_mcddll_st_acc_cat_enum st_acc_cat_enum;
+}vgmm_mcddll_op_def_access_cat_def_struct;
+
+typedef enum
+{
+ USE_OF_NON_3GPP_EMERGENCY_NUMBERS_NOT_PERMITTED = 0,
+ USE_OF_NON_3GPP_EMERGENCY_NUMBERS_PERMITTED
+}mcddll_n3en_ind_enum;
+
+typedef struct
+{
+ kal_uint8 spare;
+ mcddll_n3en_ind_enum n3en_indicator;
+}mcddll_non3gpp_nw_policies_struct;
+
+// The definitions below are used by air messages
+#define D_RAW_DATA_LIMIT 64
+#define D_NO_UE_SEC_CAP 4
+#define D_NO_ADD_GUTI 13
+#define D_NO_REQ_NSSAI 64
+#define D_NO_SI_UE_NW_CAP 15
+#define D_NO_PDU_SESSION_STATUS 34
+#define D_NO_ALLOWED_PDU_SESSION_STATUS 34
+#define D_NO_EPS_NASMSG_CONT 64
+#define D_NO_EPS_NASMSG_CONT 64
+#define D_NO_PAYLOAD_CONT 64
+
+#define D_NO_EAP_MSG 64
+#define D_NO_EMERGENCY_NUM_LIST 50
+#define D_NO_LADN_INFO 64
+#define D_NO_LADN_IND 64
+#define D_NO_PDU_SESSION_REACT_ERROR 64
+#define D_NO_PDU_SESSION_REACT_RESULT 32
+#define D_NO_VGS_NW_FEATURE_SUPPORT 5
+#define D_NO_CONFIG_NSSAI 64
+#define D_NO_REJECTED_NSSAI 42
+#define D_NO_ALLOWED_NSSAI 64
+#define D_NO_TAI_LIST 64
+#define D_NO_EQUAL_PLMNS 47
+#define D_NO_VG_GUTI 13
+#define D_NO_SERVICE_AREA_LIST 64
+#define D_NO_VG_S_TMSI 13
+
+#define D_NO_S_NSSAI 10
+#define D_NO_DNN 64
+#define D_NO_ADD_INFO 64
+#define D_NO_FULL_NAME_FOR_NW 64
+#define D_NO_SHORT_NAME_FOR_NW 64
+#define D_NO_NW_DAYLIGHT_SAVING_TIME 3
+#define D_NO_REPLAYED_UE_SEC_CAP 5
+#define D_NO_VG_IMEISV 11
+#define D_NO_VGMM_NASMSG_CONT 64
+#define D_NO_AUTN 18
+#define D_NO_AUTH_RES_PARA 18
+#define D_NO_REQ_TYPE 10
+#define D_NO_AUTO_FAIL_PARA 16
+#define D_NO_SEC_PKT 50
+#define D_PLMN_ID_AND_ACCESS_TECH_LIST 50
+#define D_NO_ABBA 32
+#define D_NO_EXT_EMERGENCY_NUM_LIST 50
+#define D_NO_SOR_TRANSPARENT_CONT 50
+#define D_NO_OP_DEF_ACCESS_CAT_DEF 64
+
+typedef struct _vgmm_mcddll_reg_req_struct
+{
+ mcddll_EPD_value_enum ext_proto_disc;
+ kal_uint8 sec_hdr_type_spare;
+ mcddll_vgmm_sec_hdr_type_enum sec_hdr_type;
+ //kal_uint8 msg_type;
+ mcddll_vgmm_msg_type_enum msg_type;
+ vgmm_mcddll_reg_type_struct vgs_reg_type;
+ kal_uint8 spare_half_octet;
+ vgmm_mcddll_nas_key_set_id_struct ngksi;
+ mcddll_vgmm_type_of_id_enum type_of_id;
+ vgmm_mcddll_vgs_mobile_id_union vgs_mobile_id;
+ kal_uint8 non_cur_native_nas_ksiP;
+ vgmm_nas_key_set_id_struct non_cur_native_nas_ksi;
+ kal_uint8 vgmm_capP;
+ vgmm_mcddll_vgmm_cap_struct vgmm_cap;
+ kal_uint8 ue_sec_capP;
+ vgmm_mcddll_ue_sec_cap_struct ue_sec_cap;
+ kal_uint8 req_nssaiP;
+ kal_uint8 no_req_nssai;
+ kal_uint8 req_nssai[D_NO_REQ_NSSAI];
+ kal_uint8 last_vis_reg_taiP;
+ vgs_tai_struct last_vis_reg_tai;
+ kal_uint8 s1_ue_nw_capP;
+ mcddll_s1_ue_nw_cap_struct s1_ue_nw_cap;
+ kal_uint8 ul_data_statusP;
+ mcddll_uplink_data_status_struct ul_data_status;
+ kal_uint8 pdu_session_statusP;
+ vgmm_mcddll_pdu_session_status_struct pdu_session_status;
+ kal_uint8 mico_indP;
+ vgmm_mcddll_mico_ind_struct mico_ind;
+ kal_uint8 ue_statusP;
+ vgmm_mcddll_ue_status_struct ue_status;
+ kal_uint8 add_gutiP;
+ vgs_guti_struct add_guti;
+ mcddll_vgmm_type_of_id_enum add_guti_type_of_identity;
+ kal_uint8 allowed_pdu_session_statusP;
+ allowed_pdu_session_status_struct allowed_pdu_session_status;
+ kal_uint8 ue_usage_settingP;
+ mcddll_vgmm_ue_usage_setting_struct ue_usage_setting;
+ kal_uint8 req_drx_paraP;
+ vgs_drx_para_struct req_drx_para;
+ kal_uint8 eps_nasmsg_contP;
+ kal_uint8 no_eps_nasmsg_cont;
+ kal_uint8 eps_nasmsg_cont[D_NO_EPS_NASMSG_CONT];
+ kal_uint8 ladn_indP;
+ kal_uint16 no_ladn_ind;
+ kal_uint8 ladn_ind[D_NO_LADN_IND];
+ kal_uint8 payload_cont_typeP;
+ mcddll_vgmm_payload_cont_type_val_enum payload_cont_type;
+ kal_uint8 payload_contP;
+ kal_uint16 no_payload_cont;
+ kal_uint8 payload_cont[D_NO_PAYLOAD_CONT];
+ kal_uint8 nw_slice_indP;
+ vgmm_mcddll_nw_slice_ind_struct nw_slice_ind;
+ kal_uint8 vgs_update_typeP;
+ vgmm_mcddll_5g_update_type_struct vgs_update_type;
+ kal_uint8 vgmm_nasmsg_contP;
+ kal_uint16 no_vgmm_nasmsg_cont;
+ kal_uint8 vgmm_nasmsg_cont[D_NO_VGMM_NASMSG_CONT];
+ kal_uint8 epsb_context_statusP;
+ mcddll_epsb_context_status_struct epsb_context_status;
+} vgmm_mcddll_reg_req_struct;
+
+typedef struct _vgmm_mcddll_reg_acc_struct
+{
+ mcddll_EPD_value_enum ext_proto_disc;
+ kal_uint8 sec_hdr_type_spare;
+ mcddll_vgmm_sec_hdr_type_enum sec_hdr_type;
+ //kal_uint8 msg_type;
+ mcddll_vgmm_msg_type_enum msg_type;
+ //vgs_reg_result_struct vgs_reg_result;
+ vgmm_mcddll_reg_result_struct vgs_reg_result;
+ kal_uint8 vg_gutiP;
+ mcddll_vgmm_type_of_id_enum vg_guti_type_of_identity;
+ vgs_guti_struct vg_guti;
+ kal_uint8 equal_plmnsP;
+ kal_uint8 no_equal_plmns;
+ kal_uint8 equal_plmns[D_NO_EQUAL_PLMNS];
+ kal_uint8 tai_listP;
+ kal_uint8 no_tai_list;
+ kal_uint8 tai_list[D_NO_TAI_LIST];
+ kal_uint8 allowed_nssaiP;
+ kal_uint8 no_allowed_nssai;
+ kal_uint8 allowed_nssai[D_NO_ALLOWED_NSSAI];
+ kal_uint8 rejected_nssaiP;
+ kal_uint8 no_rejected_nssai;
+ kal_uint8 rejected_nssai[D_NO_REJECTED_NSSAI];
+ kal_uint8 configured_nssaiP;
+ kal_uint8 no_configured_nssai;
+ kal_uint8 configured_nssai[D_NO_CONFIG_NSSAI];
+ kal_uint8 vgs_nw_feature_supportP;
+ mcddll_vgs_nw_feature_support_struct vgs_nw_feature_support;
+ kal_uint8 pdu_session_statusP;
+ vgmm_mcddll_pdu_session_status_struct pdu_session_status;
+ kal_uint8 pdu_session_react_resultP;
+ vgmm_mcddll_pdu_session_react_result_struct pdu_session_react_result;
+ kal_uint8 pdu_session_react_errorP;
+ kal_uint16 no_pdu_session_react_error;
+ kal_uint8 pdu_session_react_error[D_NO_PDU_SESSION_REACT_ERROR];
+ kal_uint8 ladn_infoP;
+ kal_uint16 no_ladn_info;
+ kal_uint8 ladn_info[D_NO_LADN_INFO];
+ kal_uint8 mico_indP;
+ vgmm_mcddll_mico_ind_struct mico_ind;
+ //New
+ kal_uint8 nw_slice_indP;
+ vgmm_mcddll_nw_slice_ind_struct nw_slice_ind;
+ //End of New
+ kal_uint8 service_area_listP;
+ kal_uint8 no_service_area_list;
+ //kal_uint8 *service_area_list;
+ kal_uint8 service_area_list[D_NO_SERVICE_AREA_LIST];
+ kal_uint8 t3512_valP;
+ mcddll_timer_3_struct t3512_val;
+ kal_uint8 t_non3gpp_dereg_valP;
+ timer_2_struct t_non3gpp_dereg_val;
+ kal_uint8 t3502_valP;
+ timer_2_struct t3502_val;
+ kal_uint8 emergency_num_listP;
+ kal_uint8 no_emergency_num_list;
+ //24008 10.5.3.13 Emergency Number List
+ kal_uint8 emergency_num_list[D_NO_EMERGENCY_NUM_LIST];
+ //New
+ kal_uint8 ext_emergency_num_listP;
+ kal_uint16 no_ext_emergency_num_list;
+ //TBD
+ kal_uint8 ext_emergency_num_list[D_NO_EXT_EMERGENCY_NUM_LIST];
+ kal_uint8 sor_transparent_contP;
+ kal_uint16 no_sor_transparent_cont;
+ kal_uint8 sor_transparent_cont[D_NO_SOR_TRANSPARENT_CONT];
+ //kal_uint8 sor_mac_I_ASUF[16];
+ //kal_uint8 counter_sor;
+ //kal_uint8 sec_pkt[D_NO_SEC_PKT];
+ //End of New
+ kal_uint8 eap_msgP;
+ kal_uint16 no_eap_msg;
+ kal_uint8 eap_msg[D_NO_EAP_MSG];
+ kal_uint8 nssai_inclusion_modeP;
+ mcddll_nssai_inclusion_mode_struct nssai_inclusion_mode;
+ kal_uint8 op_def_access_cat_defP;
+ kal_uint8 no_op_def_access_cat_def;
+ kal_uint8 op_def_access_cat_def[D_NO_OP_DEF_ACCESS_CAT_DEF];
+ kal_uint8 nego_drx_paraP;
+ vgs_drx_para_struct nego_drx_para;
+ kal_uint8 non3gpp_nw_policiesP;
+ mcddll_non3gpp_nw_policies_struct non3gpp_nw_policies;
+ kal_uint8 epsb_context_statusP;
+ mcddll_epsb_context_status_struct epsb_context_status;
+}vgmm_mcddll_reg_acc_struct;
+
+typedef struct _vgmm_mcddll_reg_com_struct
+{
+ mcddll_EPD_value_enum ext_proto_disc;
+ kal_uint8 sec_hdr_type_spare;
+ mcddll_vgmm_sec_hdr_type_enum sec_hdr_type;
+ mcddll_vgmm_msg_type_enum msg_type;
+ //New
+ kal_uint8 sor_transparent_contP;
+ kal_uint16 no_sor_transparent_cont;
+ kal_uint8 sor_transparent_cont[D_NO_SOR_TRANSPARENT_CONT];
+ //End of New
+} vgmm_mcddll_reg_com_struct;
+
+typedef struct _vgmm_mcddll_mo_dereg_req_struct
+{
+ mcddll_EPD_value_enum ext_proto_disc;
+ kal_uint8 sec_hdr_type_spare;
+ mcddll_vgmm_sec_hdr_type_enum sec_hdr_type;
+ mcddll_vgmm_msg_type_enum msg_type;
+ vgmm_mcddll_nas_key_set_id_struct ngksi;
+ mcddll_vgmm_dereg_type_struct detach_type;
+ mcddll_vgmm_type_of_id_enum type_of_id;
+ vgmm_mcddll_vgs_mobile_id_union vgs_mobile_id;
+} vgmm_mcddll_mo_dereg_req_struct;
+
+typedef struct _vgmm_mcddll_mo_dereg_acc_struct
+{
+ mcddll_EPD_value_enum ext_proto_disc;
+ kal_uint8 sec_hdr_type_spare;
+ mcddll_vgmm_sec_hdr_type_enum sec_hdr_type;
+ mcddll_vgmm_msg_type_enum msg_type;
+} vgmm_mcddll_mo_dereg_acc_struct;
+
+typedef struct _vgmm_mcddll_mt_dereg_req_struct
+{
+ mcddll_EPD_value_enum ext_proto_disc;
+ kal_uint8 sec_hdr_type_spare;
+ mcddll_vgmm_sec_hdr_type_enum sec_hdr_type;
+ mcddll_vgmm_msg_type_enum msg_type;
+ mcddll_vgmm_dereg_type_struct detach_type;
+ kal_uint8 spare_half_octet;
+ kal_uint8 vgmm_causeP;
+ mcddll_vgmm_cause_enum vgmm_cause;
+ kal_uint8 t3346_valP;
+ timer_2_struct t3346_val;
+} vgmm_mcddll_mt_dereg_req_struct;
+
+typedef struct _vgmm_mcddll_mt_dereg_acc_struct
+{
+ mcddll_EPD_value_enum ext_proto_disc;
+ kal_uint8 sec_hdr_type_spare;
+ mcddll_vgmm_sec_hdr_type_enum sec_hdr_type;
+ mcddll_vgmm_msg_type_enum msg_type;
+} vgmm_mcddll_mt_dereg_acc_struct;
+
+typedef struct _vgmm_mcddll_service_req_struct
+{
+ mcddll_EPD_value_enum ext_proto_disc;
+ kal_uint8 sec_hdr_type_spare;
+ mcddll_vgmm_sec_hdr_type_enum sec_hdr_type;
+ mcddll_vgmm_msg_type_enum msg_type;
+ //vgmm_nas_key_set_id_struct ngksi;
+ vgmm_mcddll_service_type_struct service_type;
+ vgmm_mcddll_nas_key_set_id_struct ngksi;
+ //kal_uint8 no_vg_s_tmsi;
+ //kal_uint8 vg_s_tmsi[D_NO_VG_S_TMSI];
+ mcddll_vgmm_type_of_id_enum type_of_id;
+ vgs_s_tmsi_struct vg_s_tmsi;
+ kal_uint8 ul_data_statusP;
+ mcddll_uplink_data_status_struct ul_data_status;
+ kal_uint8 pdu_session_statusP;
+ vgmm_mcddll_pdu_session_status_struct pdu_session_status;
+ kal_uint8 allowed_pdu_session_statusP;
+ //kal_uint8 no_allowed_pdu_session_status;
+ //kal_uint8 allowed_pdu_session_status[D_NO_ALLOWED_PDU_SESSION_STATUS];
+ allowed_pdu_session_status_struct allowed_pdu_session_status;
+ vgmm_mcddll_pdu_session_status_struct allowed_pdu_session_status_1;
+ kal_uint8 vgmm_nasmsg_contP;
+ kal_uint16 no_vgmm_nasmsg_cont;
+ kal_uint8 vgmm_nasmsg_cont[D_NO_VGMM_NASMSG_CONT];
+} vgmm_mcddll_service_req_struct;
+
+typedef struct _vgmm_mcddll_service_acc_struct
+{
+ mcddll_EPD_value_enum ext_proto_disc;
+ kal_uint8 sec_hdr_type_spare;
+ mcddll_vgmm_sec_hdr_type_enum sec_hdr_type;
+ mcddll_vgmm_msg_type_enum msg_type;
+ kal_uint8 pdu_session_statusP;
+ kal_uint8 no_pdu_session_status;
+ vgmm_mcddll_pdu_session_status_struct pdu_session_status;
+ kal_uint8 pdu_session_react_resultP;
+ vgmm_mcddll_pdu_session_react_result_struct pdu_session_react_result;
+ kal_uint8 pdu_session_react_errorP;
+ kal_uint16 no_pdu_session_react_error;
+ kal_uint8 pdu_session_react_error[D_NO_PDU_SESSION_REACT_ERROR];
+ kal_uint8 eap_msgP;
+ kal_uint16 no_eap_msg;
+ kal_uint8 eap_msg[D_NO_EAP_MSG];
+} vgmm_mcddll_service_acc_struct;
+
+typedef struct _vgmm_mcddll_status_struct
+{
+ mcddll_EPD_value_enum ext_proto_disc;
+ kal_uint8 sec_hdr_type_spare;
+ mcddll_vgmm_sec_hdr_type_enum sec_hdr_type;
+ mcddll_vgmm_msg_type_enum msg_type;
+ mcddll_vgmm_cause_enum vgmm_cause;
+} vgmm_mcddll_status_struct;
+
+typedef struct _vgmm_mcddll_reg_rej_struct
+{
+ mcddll_EPD_value_enum ext_proto_disc;
+ kal_uint8 sec_hdr_type_spare;
+ mcddll_vgmm_sec_hdr_type_enum sec_hdr_type;
+ mcddll_vgmm_msg_type_enum msg_type;
+ mcddll_vgmm_cause_enum vgmm_cause;
+ kal_uint8 t3346_valP;
+ timer_2_struct t3346_val;
+ kal_uint8 t3502_valP;
+ timer_2_struct t3502_val;
+ kal_uint8 eap_msgP;
+ kal_uint16 no_eap_msg;
+ kal_uint8 eap_msg[D_NO_EAP_MSG];
+} vgmm_mcddll_reg_rej_struct;
+
+typedef struct _vgmm_mcddll_ul_nas_transport
+{
+ mcddll_EPD_value_enum ext_proto_disc;
+ kal_uint8 sec_hdr_type_spare;
+ mcddll_vgmm_sec_hdr_type_enum sec_hdr_type;
+ mcddll_vgmm_msg_type_enum msg_type;
+ kal_uint8 spare_half_octet;
+ //vgmm_payload_cont_type_struct payload_cont_type;
+ mcddll_vgmm_payload_cont_type_val_enum payload_cont_type;
+ kal_uint16 no_payload_container;
+ kal_uint8 payload_container[D_NO_PAYLOAD_CONT];
+ kal_uint8 pdu_session_idP;
+ mcddll_PDU_session_identity_value_enum pdu_session_id;
+ kal_uint8 old_pdu_session_idP;
+ mcddll_PDU_session_identity_value_enum old_pdu_session_id;
+ kal_uint8 req_typeP;
+ req_type_struct req_type;
+ mcddll_vgmm_req_type_enum req_type_val;
+ kal_uint8 s_nssaiP;
+ kal_uint8 no_s_nssai;
+ kal_uint8 s_nssai[D_NO_S_NSSAI];
+ kal_uint8 dnnP;
+ kal_uint8 no_dnn;
+ kal_uint8 dnn[D_NO_DNN];
+ kal_uint8 add_infoP;
+ kal_uint8 no_add_info;
+ kal_uint8 add_info[D_NO_ADD_INFO];
+} vgmm_mcddll_ul_nas_transport;
+
+typedef struct _vgmm_mcddll_dl_nas_transport
+{
+ mcddll_EPD_value_enum ext_proto_disc;
+ kal_uint8 sec_hdr_type_spare;
+ mcddll_vgmm_sec_hdr_type_enum sec_hdr_type;
+ mcddll_vgmm_msg_type_enum msg_type;
+ kal_uint8 spare_half_octet;
+ //vgmm_payload_cont_type_struct payload_cont_type;
+ mcddll_vgmm_payload_cont_type_val_enum payload_cont_type;
+ kal_uint16 no_payload_container;
+ kal_uint8 payload_container[D_NO_PAYLOAD_CONT];
+ kal_uint8 pdu_session_idP;
+ mcddll_PDU_session_identity_value_enum pdu_session_id;
+ kal_uint8 add_infoP;
+ kal_uint8 no_add_info;
+ kal_uint8 add_info[D_NO_ADD_INFO];
+ kal_uint8 vgmm_causeP;
+ mcddll_vgmm_cause_enum vgmm_cause;
+ kal_uint8 back_off_timer_valP;
+ mcddll_timer_3_struct back_off_timer_val;
+} vgmm_mcddll_dl_nas_transport;
+
+typedef struct _vgmm_mcddll_service_rej_struct
+{
+ mcddll_EPD_value_enum ext_proto_disc;
+ kal_uint8 sec_hdr_type_spare;
+ mcddll_vgmm_sec_hdr_type_enum sec_hdr_type;
+ mcddll_vgmm_msg_type_enum msg_type;
+ mcddll_vgmm_cause_enum vgmm_cause;
+ kal_uint8 pdu_session_statusP;
+ kal_uint8 no_pdu_session_status;
+ vgmm_mcddll_pdu_session_status_struct pdu_session_status;
+ kal_uint8 t3346_valP;
+ timer_2_struct t3346_val;
+ kal_uint8 eap_msgP;
+ kal_uint16 no_eap_msg;
+ kal_uint8 eap_msg[D_NO_EAP_MSG];
+} vgmm_mcddll_service_rej_struct;
+
+
+typedef struct _vgmm_mcddll_config_update_cmd_struct
+{
+ mcddll_EPD_value_enum ext_proto_disc;
+ kal_uint8 sec_hdr_type_spare;
+ mcddll_vgmm_sec_hdr_type_enum sec_hdr_type;
+ mcddll_vgmm_msg_type_enum msg_type;
+ //kal_uint8 spare_half_octet;
+ kal_uint8 config_update_indP;
+ //config_update_ind_struct config_update_ind;
+ vgmm_mcddll_config_update_ind_struct config_update_ind;
+ kal_uint8 vg_gutiP;
+ //kal_uint8 no_vg_guti;
+ //kal_uint8 vg_guti[D_NO_VG_GUTI];
+ vgs_guti_struct vg_guti;
+ mcddll_vgmm_type_of_id_enum vg_guti_type_of_identity;
+ kal_uint8 tai_listP;
+ kal_uint8 no_tai_list;
+ kal_uint8 tai_list[D_NO_TAI_LIST];
+ kal_uint8 allowed_nssaiP;
+ kal_uint8 no_allowed_nssai;
+ kal_uint8 allowed_nssai[D_NO_ALLOWED_NSSAI];
+ kal_uint8 service_area_listP;
+ kal_uint8 no_service_area_list;
+ kal_uint8 service_area_list[D_NO_SERVICE_AREA_LIST];
+ kal_uint8 full_name_for_nwP;
+ kal_uint8 no_full_name_for_nw;
+ kal_uint8 full_name_for_nw[D_NO_FULL_NAME_FOR_NW];
+ mcddll_vgmm_spare_bits_in_last_octet_enum full_name_spare_bit;
+ mcddll_vgmm_add_CI_enum full_name_add_CI;
+ kal_uint8 full_name_coding_scheme;
+ kal_uint8 short_name_for_nwP;
+ kal_uint8 no_short_name_for_nw;
+ kal_uint8 short_name_for_nw[D_NO_SHORT_NAME_FOR_NW];
+ mcddll_vgmm_spare_bits_in_last_octet_enum short_name_spare_bit;
+ mcddll_vgmm_add_CI_enum short_name_add_CI;
+ kal_uint8 short_name_coding_scheme;
+ kal_uint8 local_time_zoneP;
+ kal_uint8 local_time_zone;
+ kal_uint8 uni_time_and_local_time_zoneP;
+ nw_time_zone_time_struct uni_time_and_local_time_zone;
+ kal_uint8 nw_daylight_saving_timeP;
+ kal_uint8 no_nw_daylight_saving_time;
+ mcddll_vgmm_daylight_saving_time_enum nw_daylight_saving_time[D_NO_NW_DAYLIGHT_SAVING_TIME];
+ kal_uint8 ladn_infoP;
+ kal_uint16 no_ladn_info;
+ kal_uint8 ladn_info[D_NO_LADN_INFO];
+ kal_uint8 mico_indP;
+ vgmm_mcddll_mico_ind_struct mico_ind;
+ //New
+ kal_uint8 nw_slice_indP;
+ vgmm_mcddll_nw_slice_ind_struct nw_slice_ind;
+ //End of New
+ kal_uint8 configured_nssaiP;
+ kal_uint8 no_configured_nssai;
+ kal_uint8 configured_nssai[D_NO_CONFIG_NSSAI];
+ kal_uint8 rejected_nssaiP;
+ kal_uint8 no_rejected_nssai;
+ kal_uint8 rejected_nssai[D_NO_REJECTED_NSSAI];
+ kal_uint8 op_def_access_cat_defP;
+ kal_uint16 no_op_def_access_cat_def;
+ kal_uint8 op_def_access_cat_def[D_NO_OP_DEF_ACCESS_CAT_DEF];
+ kal_uint8 sms_indP;
+ vgmm_mcddll_sms_ind_struct sms_ind;
+} vgmm_mcddll_config_update_cmd_struct;
+
+typedef struct _vgmm_mcddll_config_update_com_struct
+{
+ mcddll_EPD_value_enum ext_proto_disc;
+ kal_uint8 sec_hdr_type_spare;
+ mcddll_vgmm_sec_hdr_type_enum sec_hdr_type;
+ mcddll_vgmm_msg_type_enum msg_type;
+} vgmm_mcddll_config_update_com_struct;
+
+typedef struct _vgmm_mcddll_identity_req_struct
+{
+ mcddll_EPD_value_enum ext_proto_disc;
+ kal_uint8 sec_hdr_type_spare;
+ mcddll_vgmm_sec_hdr_type_enum sec_hdr_type;
+ mcddll_vgmm_msg_type_enum msg_type;
+ kal_uint8 spare_half_octet;
+ //identity_type_struct identity_type;
+ vgmm_mcddll_identity_type_struct identity_type;
+} vgmm_mcddll_identity_req_struct;
+
+typedef struct _vgmm_mcddll_identity_rsp_struct
+{
+ mcddll_EPD_value_enum ext_proto_disc;
+ kal_uint8 sec_hdr_type_spare;
+ mcddll_vgmm_sec_hdr_type_enum sec_hdr_type;
+ mcddll_vgmm_msg_type_enum msg_type;
+ mcddll_vgmm_type_of_id_enum type_of_id;
+ vgmm_mcddll_vgs_mobile_id_union vgs_mobile_id;
+} vgmm_mcddll_identity_rsp_struct;
+
+typedef struct _vgmm_mcddll_sec_mode_cmd_struct
+{
+ mcddll_EPD_value_enum ext_proto_disc;
+ kal_uint8 sec_hdr_type_spare;
+ mcddll_vgmm_sec_hdr_type_enum sec_hdr_type;
+ mcddll_vgmm_msg_type_enum msg_type;
+ //vgmm_nas_sec_alg_struct sel_nas_sec_alg;
+ vgmm_mcddll_nas_sec_alg_struct sel_nas_sec_alg;
+ kal_uint8 spare_half_octet;
+ vgmm_mcddll_nas_key_set_id_struct nas_key_set_id;
+ vgmm_mcddll_ue_sec_cap_struct replayed_ue_sec_cap;
+ kal_uint8 imeisv_reqP;
+ vgmm_mcddll_imeisv_req_struct imeisv_req;
+ kal_uint8 sel_eps_nas_sec_algP;
+ vgmm_mcddll_eps_nas_sec_alg_struct sel_eps_nas_sec_alg;
+ //New
+ kal_uint8 additional_5g_sec_infoP;
+ vgmm_mcddll_additional_5g_sec_info_struct additional_5g_sec_info;
+ //End of New
+ kal_uint8 eap_msgP;
+ kal_uint16 no_eap_msg;
+ kal_uint8 eap_msg[D_NO_EAP_MSG];
+ kal_uint8 abbaP;
+ kal_uint8 no_abba;
+ kal_uint8 abba[D_NO_ABBA];
+ kal_uint8 replayed_s1_ue_sec_capP;
+ vgmm_mcddll_s1_ue_sec_cap_struct replayed_s1_ue_sec_cap;
+} vgmm_mcddll_sec_mode_cmd_struct;
+
+typedef struct _vgmm_mcddll_sec_mode_com_struct
+{
+ mcddll_EPD_value_enum ext_proto_disc;
+ kal_uint8 sec_hdr_type_spare;
+ mcddll_vgmm_sec_hdr_type_enum sec_hdr_type;
+ mcddll_vgmm_msg_type_enum msg_type;
+ kal_uint8 vg_imeisvP;
+ //kal_uint8 no_vg_imeisv;
+ //kal_uint8 vg_imeisv[D_NO_VG_IMEISV];
+ vgs_imeisv_struct vg_imeisv;
+ mcddll_vgmm_type_of_id_enum type_of_id;
+ kal_uint8 vgmm_nasmsg_contP;
+ kal_uint16 no_vgmm_nasmsg_cont;
+ kal_uint8 vgmm_nasmsg_cont[D_NO_VGMM_NASMSG_CONT];
+} vgmm_mcddll_sec_mode_com_struct;
+
+typedef struct _vgmm_mcddll_sec_mode_rej_struct
+{
+ mcddll_EPD_value_enum ext_proto_disc;
+ kal_uint8 sec_hdr_type_spare;
+ mcddll_vgmm_sec_hdr_type_enum sec_hdr_type;
+ mcddll_vgmm_msg_type_enum msg_type;
+ mcddll_vgmm_cause_enum vgmm_cause;
+} vgmm_mcddll_sec_mode_rej_struct;
+
+typedef struct _vgmm_mcddll_notif_struct
+{
+ mcddll_EPD_value_enum ext_proto_disc;
+ kal_uint8 sec_hdr_type_spare;
+ mcddll_vgmm_sec_hdr_type_enum sec_hdr_type;
+ mcddll_vgmm_msg_type_enum msg_type;
+ kal_uint8 spare_half_octet;
+ vgmm_mcddll_access_type_struct access_type;
+} vgmm_mcddll_notif_struct;
+
+
+typedef struct _vgmm_mcddll_notif_rsp_struct
+{
+ mcddll_EPD_value_enum ext_proto_disc;
+ kal_uint8 sec_hdr_type_spare;
+ mcddll_vgmm_sec_hdr_type_enum sec_hdr_type;
+ mcddll_vgmm_msg_type_enum msg_type;
+ kal_uint8 pdu_session_statusP;
+ vgmm_mcddll_pdu_session_status_struct pdu_session_status;
+} vgmm_mcddll_notif_rsp_struct;
+
+typedef struct _vgmm_mcddll_auth_fail_struct
+{
+ mcddll_EPD_value_enum ext_proto_disc;
+ kal_uint8 sec_hdr_type_spare;
+ mcddll_vgmm_sec_hdr_type_enum sec_hdr_type;
+ mcddll_vgmm_msg_type_enum msg_type;
+ mcddll_vgmm_cause_enum vgmm_cause;
+ kal_uint8 auth_fail_paraP;
+ kal_uint8 no_auth_fail_para;
+ kal_uint8 auth_fail_para[D_NO_AUTO_FAIL_PARA];
+} vgmm_mcddll_auth_fail_struct;
+
+typedef struct _vgmm_mcddll_auth_rej_struct
+{
+ mcddll_EPD_value_enum ext_proto_disc;
+ kal_uint8 sec_hdr_type_spare;
+ mcddll_vgmm_sec_hdr_type_enum sec_hdr_type;
+ mcddll_vgmm_msg_type_enum msg_type;
+ kal_uint8 eap_msgP;
+ kal_uint16 no_eap_msg;
+ kal_uint8 eap_msg[D_NO_EAP_MSG];
+} vgmm_mcddll_auth_rej_struct;
+
+typedef struct _vgmm_mcddll_auth_req_struct
+{
+ mcddll_EPD_value_enum ext_proto_disc;
+ kal_uint8 sec_hdr_type_spare;
+ mcddll_vgmm_sec_hdr_type_enum sec_hdr_type;
+ mcddll_vgmm_msg_type_enum msg_type;
+ kal_uint8 spare_half_octet;
+ vgmm_mcddll_nas_key_set_id_struct ngksi;
+ kal_uint8 randP;
+ kal_uint8 rand[16];
+ kal_uint8 autnP;
+ kal_uint8 no_autn;
+ kal_uint8 autn[D_NO_AUTN];
+ //New
+ kal_uint8 no_abba;
+ kal_uint8 abba[D_NO_ABBA];
+ //End of New
+ kal_uint8 eap_msgP;
+ kal_uint16 no_eap_msg;
+ kal_uint8 eap_msg[D_NO_EAP_MSG];
+} vgmm_mcddll_auth_req_struct;
+
+typedef struct _vgmm_mcddll_auth_result_struct
+{
+ mcddll_EPD_value_enum ext_proto_disc;
+ kal_uint8 sec_hdr_type_spare;
+ mcddll_vgmm_sec_hdr_type_enum sec_hdr_type;
+ mcddll_vgmm_msg_type_enum msg_type;
+ kal_uint8 spare_half_octet;
+ vgmm_mcddll_nas_key_set_id_struct ngksi;
+ //kal_uint8 eap_msgP;
+ kal_uint16 no_eap_msg;
+ kal_uint8 eap_msg[D_NO_EAP_MSG];
+ kal_uint8 abbaP;
+ kal_uint8 no_abba;
+ kal_uint8 abba[D_NO_ABBA];
+} vgmm_mcddll_auth_result_struct;
+
+typedef struct _vgmm_mcddll_auth_rsp_struct
+{
+ mcddll_EPD_value_enum ext_proto_disc;
+ kal_uint8 sec_hdr_type_spare;
+ mcddll_vgmm_sec_hdr_type_enum sec_hdr_type;
+ mcddll_vgmm_msg_type_enum msg_type;
+ kal_uint8 auth_res_paraP;
+ kal_uint8 no_auth_res_para;
+ kal_uint8 auth_res_para[D_NO_AUTH_RES_PARA];
+ kal_uint8 eap_msgP;
+ kal_uint16 no_eap_msg;
+ kal_uint8 eap_msg[D_NO_EAP_MSG];
+} vgmm_mcddll_auth_rsp_struct;
+
+/**
+ * "msg_peer_unpack_vgmm()" should be called for LTE MCDDLL to decode VGMM air message
+ *
+ * This function will check whether the message id is valid to carry air message. And use "msg_type"
+ * carried in raw data to find out the corresponding STRUCT_ID and call MCD to decode message.
+ *
+ * @src
+ * the raw data which VGMM MCDDLL wants to decode
+ *
+ * @src_size
+ * the length of the raw data
+ *
+ * @dest_struct_id
+ * the structure id of the air message
+ *
+ * @dest
+ * the decode result which save in this address
+ *
+ * @return
+ * true for success and false for failure
+ *
+ */
+kal_bool msg_peer_unpack_vgmm(const kal_uint8 * src, kal_uint16 src_size, kal_uint16 * dest_struct_id, void ** dest);
+
+#endif /* __FIVEG_NAS__ */
+#endif
+
diff --git a/mcu/protocol/interface/general/5g/vgmm_public_struct.h b/mcu/protocol/interface/general/5g/vgmm_public_struct.h
new file mode 100644
index 0000000..c04eb70
--- /dev/null
+++ b/mcu/protocol/interface/general/5g/vgmm_public_struct.h
@@ -0,0 +1,138 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+#ifndef VGMM_PUBLIC_STRUCT_H
+#define VGMM_PUBLIC_STRUCT_H
+
+#include "kal_public_api.h"
+#include "l3_inc_enums.h"
+#include "ps_public_struct.h"
+#include "mcd_vgmm_gen_peer.h"
+#include "irat_common_enums.h"
+
+/********************************************
+ * MACROS *
+ ********************************************/
+
+
+/********************************************
+ * TYPE DEFINITIONS & ENUMS *
+ ********************************************/
+
+typedef enum
+{
+ EPSFB_IND_NONE,
+ EPSFB_IND_MO,
+ EPSFB_IND_MT
+} epsfb_indicator_enum; /* paging for EMC EPSFB */
+
+#define VGMM_SIM_IDENTITY_MAX_LEN 256
+#define NAS_SECURITY_PARAM_LEN (6)
+
+
+typedef struct {
+ /** key set id and selected security algorithms */
+ kal_bool ngksi_present;
+ vgmm_nas_key_set_id_struct ngksi;
+ kal_uint8 selected_alg;
+
+ /* selected EPS NAS security algorithms IE */
+ kal_bool eps_selected_alg_present;
+ kal_uint8 eps_selected_alg;
+
+ /** make mapped GUTI */
+ kal_bool vg_guti_present;
+ vgs_guti_struct vg_guti;
+
+ /*
+ * TS 33.501 A.14.1 Idle mode mobility
+ * This input string is used when there is a need to derive K'ASME from KAMF during mapping of security contexts from 5G
+ * to EPS at idle mode mobility. The following input parameters shall be used.
+ * - FC = 0x73
+ * - P0 = NAS Uplink COUNT value
+ * - L0 = length of NAS Uplink COUNT value (i.e. 0x00 0x04)
+ * The input key KEY shall be KAMF.
+ */
+ kal_bool ul_nas_count_present;
+ kal_uint32 ul_nas_count;
+
+
+ /*
+ * TS 33.501 A.14 KAMF to KASME' derivation for interworking
+ * A.14.2 Handover
+ * This input string is used when there is a need to derive K'ASME from KAMF during mapping of security contexts from 5G
+ * to EPS at handovers. The following input parameters shall be used.
+ * - FC = 0x74
+ * - P0 = NAS Downlink COUNT value
+ * - L0 = length of NAS Downlink COUNT value (i.e. 0x00 0x04)
+ * The input key KEY shall be KAMF.
+ */
+ kal_bool dl_nas_count_present;
+ kal_uint32 dl_nas_count;
+
+ kal_uint8 key_amf[32];
+
+ //EPSFB
+ //epsfb_indicator_enum epsfb_indicator;
+
+ //vg_option_enum vg_option_setting; // 5G architecture option, refer to 38.801
+ //ue_usage_setting_enum ue_usage_setting; // voice or data, refer to 24.501
+
+ /*
+ * For deriving the status of high priority access
+ * - EF UAC_AIC
+ * - EF_ACC
+ * - MPS indicator received from the network
+ * - MCS indicator received from the network
+ */
+ kal_uint8 ef_uac_aic[LEN_OF_UAC_AIC];
+ kal_uint8 ef_acc[2];
+ mps_ind_enum nw_feature_support_info_mps_ind;
+ mcs_ind_enum nw_feature_support_info_mcs_ind;
+
+ kal_bool is_reged;
+ rat_enum previous_registered_rat;
+
+} vgmm_public_context_struct;
+
+/********************************************
+ * VARIABLES *
+ ********************************************/
+
+/********************************************
+ * FUNCTION DECLARATIONS *
+ ********************************************/
+
+#endif /* VGMM_PUBLIC_STRUCT_H */
diff --git a/mcu/protocol/interface/general/5g/vgmm_public_utility.h b/mcu/protocol/interface/general/5g/vgmm_public_utility.h
new file mode 100644
index 0000000..56329e9
--- /dev/null
+++ b/mcu/protocol/interface/general/5g/vgmm_public_utility.h
@@ -0,0 +1,71 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+#ifndef VGMM_PUBLIC_UTILITY_H
+#define VGMM_PUBLIC_UTILITY_H
+
+#include "vgmm_public_struct.h"
+#include "sim_exported_enum.h"
+#include "irat_common_struct.h"
+
+
+/********************************************
+ * MACROS *
+ ********************************************/
+
+
+/********************************************
+ * TYPE DEFINITIONS & ENUMS *
+ ********************************************/
+
+
+/********************************************
+ * VARIABLES *
+ ********************************************/
+
+/********************************************
+ * FUNCTION DECLARATIONS *
+ ********************************************/
+extern kal_bool vgmm_get_public_context_and_handle_ul_count(
+ vgmm_public_context_struct *ctxt_p, kal_bool is_increment_ul_count);
+extern kal_bool vgmm_get_public_context(vgmm_public_context_struct *ctxt_p);
+extern void vgmm_set_public_security_param(protocol_id_enum ps_id, irat_container_nrrc_to_vgmm_struct *input_ptr);
+extern kal_bool vgmm_get_public_4g5_ho_info(protocol_id_enum ps_id, irat_container_vgmm_to_nrrc_struct *output_ptr);
+
+extern kal_bool vgmm_get_public_is_protocol_error_existed(protocol_id_enum ps_id);
+
+extern kal_uint16 vgmm_derive_access_identities_by_plmn(kal_uint8 protocol_id, plmn_id_struct* target_plmn);
+
+#endif /* VGMM_PUBLIC_UTILITY_H */
diff --git a/mcu/protocol/interface/general/5g/vgnas_msg_unpack.h b/mcu/protocol/interface/general/5g/vgnas_msg_unpack.h
new file mode 100644
index 0000000..85d2812
--- /dev/null
+++ b/mcu/protocol/interface/general/5g/vgnas_msg_unpack.h
@@ -0,0 +1,125 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2010
+*
+*****************************************************************************/
+
+/*******************************************************************************
+* Filename:
+* ---------
+* vgnas_msg_unpack.h
+*
+* Description:
+* ------------
+* This is the API for LTE MCDDLL to decode the air messages which are defined in TS 24.501 (NAS).
+*
+*
+* Author:
+* -------
+ * -------
+*
+*******************************************************************************/
+
+#ifndef VGNAS_MSG_UNPACK_H
+#define VGNAS_MSG_UNPACK_H
+#if defined(__FIVEG_NAS__)
+
+#include "mcd.h"
+
+#define UNPACK_BUFFER_SIZE 65535
+
+typedef enum _vgnas_struct_id_enum
+{
+ // MM (Mobility Management)
+ STRUCT_ID_VGMM_MCDDLL_MSG_START = VGNAS_STRUCT_START,
+ STRUCT_ID_VGMM_MCDDLL_REG_REQ_STRUCT,
+ STRUCT_ID_VGMM_MCDDLL_REG_ACC_STRUCT,
+ STRUCT_ID_VGMM_MCDDLL_REG_COM_STRUCT,
+ STRUCT_ID_VGMM_MCDDLL_REG_REJ_STRUCT,
+ STRUCT_ID_VGMM_MCDDLL_MO_DEREG_REQ_STRUCT,
+ STRUCT_ID_VGMM_MCDDLL_MO_DEREG_ACC_STRUCT,
+ STRUCT_ID_VGMM_MCDDLL_MT_DEREG_REQ_STRUCT,
+ STRUCT_ID_VGMM_MCDDLL_MT_DEREG_ACC_STRUCT,
+ STRUCT_ID_VGMM_MCDDLL_SERVICE_REQ_STRUCT,
+ STRUCT_ID_VGMM_MCDDLL_SERVICE_ACC_STRUCT,
+ STRUCT_ID_VGMM_MCDDLL_SERVICE_REJ_STRUCT,
+ STRUCT_ID_VGMM_MCDDLL_AUTH_FAIL_STRUCT,
+ STRUCT_ID_VGMM_MCDDLL_AUTH_REJ_STRUCT,
+ STRUCT_ID_VGMM_MCDDLL_AUTH_REQ_STRUCT,
+ STRUCT_ID_VGMM_MCDDLL_AUTH_RESULT_STRUCT,
+ STRUCT_ID_VGMM_MCDDLL_AUTH_RSP_STRUCT,
+ STRUCT_ID_VGMM_MCDDLL_CONFIG_UPDATE_CMD_STRUCT,
+ STRUCT_ID_VGMM_MCDDLL_CONFIG_UPDATE_COM_STRUCT,
+ STRUCT_ID_VGMM_MCDDLL_UL_NAS_TRANSPORT,
+ STRUCT_ID_VGMM_MCDDLL_DL_NAS_TRANSPORT,
+ STRUCT_ID_VGMM_MCDDLL_IDENTITY_REQ_STRUCT,
+ STRUCT_ID_VGMM_MCDDLL_IDENTITY_RSP_STRUCT,
+ STRUCT_ID_VGMM_MCDDLL_NOTIF_RSP_STRUCT,
+ STRUCT_ID_VGMM_MCDDLL_NOTIF_STRUCT,
+ STRUCT_ID_VGMM_MCDDLL_SEC_MODE_CMD_STRUCT,
+ STRUCT_ID_VGMM_MCDDLL_SEC_MODE_COM_STRUCT,
+ STRUCT_ID_VGMM_MCDDLL_SEC_MODE_REJ_STRUCT,
+ STRUCT_ID_VGMM_MCDDLL_STATUS_STRUCT,
+ STRUCT_ID_VGMM_MCDDLL_REG_TYPE_STRUCT,
+ STRUCT_ID_VGMM_MCDDLL_ADD_GUTI_STRUCT,
+ STRUCT_ID_VGMM_MCDDLL_REG_RESULT_STRUCT,
+ STRUCT_ID_VGMM_MCDDLL_DEREG_TYPE_STRUCT,
+ STRUCT_ID_VGMM_MCDDLL_SERVICE_TYPE_STRUCT,
+ STRUCT_ID_VGMM_MCDDLL_UE_SEC_CAP_STRUCT,
+ STRUCT_ID_VGMM_MCDDLL_MSG_END,
+
+ // SM (Session Management)
+ STRUCT_ID_VGSM_MCDDLL_MSG_START = STRUCT_ID_VGMM_MCDDLL_MSG_END,
+ STRUCT_ID_VGSM_MCDDLL_PDU_SESSION_ESTABLISHMENT_REQUEST_STRUCT,
+ STRUCT_ID_VGSM_MCDDLL_PDU_SESSION_ESTABLISHMENT_ACCEPT_STRUCT,
+ STRUCT_ID_VGSM_MCDDLL_PDU_SESSION_ESTABLISHMENT_REJECT_STRUCT,
+ STRUCT_ID_VGSM_MCDDLL_PDU_SESSION_AUTHENTICATION_COMMAND_STRUCT,
+ STRUCT_ID_VGSM_MCDDLL_PDU_SESSION_AUTHENTICATION_COMPLETE_STRUCT,
+ STRUCT_ID_VGSM_MCDDLL_PDU_SESSION_AUTHENTICATION_RESULT_STRUCT,
+ STRUCT_ID_VGSM_MCDDLL_PDU_SESSION_MODIFICATION_REQUEST_STRUCT,
+ STRUCT_ID_VGSM_MCDDLL_PDU_SESSION_MODIFICATION_REJECT_STRUCT,
+ STRUCT_ID_VGSM_MCDDLL_PDU_SESSION_MODIFICATION_COMMAND_STRUCT,
+ STRUCT_ID_VGSM_MCDDLL_PDU_SESSION_MODIFICATION_COMPLETE_STRUCT,
+ STRUCT_ID_VGSM_MCDDLL_PDU_SESSION_MODIFICATION_COMMAND_REJECT_STRUCT,
+ STRUCT_ID_VGSM_MCDDLL_PDU_SESSION_RELEASE_REQUEST_STRUCT,
+ STRUCT_ID_VGSM_MCDDLL_PDU_SESSION_RELEASE_REJECT_STRUCT,
+ STRUCT_ID_VGSM_MCDDLL_PDU_SESSION_RELEASE_COMMAND_STRUCT,
+ STRUCT_ID_VGSM_MCDDLL_PDU_SESSION_RELEASE_COMPLETE_STRUCT,
+ STRUCT_ID_VGSM_MCDDLL_5GSM_STATUS_STRUCT,
+ STRUCT_ID_VGSM_MCDDLL_MSG_END,
+
+} vgnas_struct_id_enum;
+
+typedef enum
+{
+ No_PDU_session_identity_assigned = 0,
+ PDU_session_identity_value_1 = 1,
+ PDU_session_identity_value_2 = 2,
+ PDU_session_identity_value_3 = 3,
+ PDU_session_identity_value_4 = 4,
+ PDU_session_identity_value_5 = 5,
+ PDU_session_identity_value_6 = 6,
+ PDU_session_identity_value_7 = 7,
+ PDU_session_identity_value_8 = 8,
+ PDU_session_identity_value_9 = 9,
+ PDU_session_identity_value_10 = 10,
+ PDU_session_identity_value_11 = 11,
+ PDU_session_identity_value_12 = 12,
+ PDU_session_identity_value_13 = 13,
+ PDU_session_identity_value_14 = 14,
+ PDU_session_identity_value_15 = 15
+} mcddll_PDU_session_identity_value_enum;
+
+
+typedef enum
+{
+ vgs_session_management_messages = 46,
+ vgs_mobility_management_messages = 126
+} mcddll_EPD_value_enum;
+
+#endif /* __FIVEG_NAS__ */
+#endif
diff --git a/mcu/protocol/interface/general/5g/vgsm_common_def_public.h b/mcu/protocol/interface/general/5g/vgsm_common_def_public.h
new file mode 100644
index 0000000..564ed7a
--- /dev/null
+++ b/mcu/protocol/interface/general/5g/vgsm_common_def_public.h
@@ -0,0 +1,382 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+#ifndef VGSM_COMMON_DEF_PUBLIC_H
+#define VGSM_COMMON_DEF_PUBLIC_H
+
+#include "kal_public_api.h"
+#include "ps_public_struct.h"
+#include "tftlib_common_enum.h"
+#include "tftlib_common_struct.h"
+
+
+/********************************************
+ * MACROS *
+ ********************************************/
+//#define VGSM_MAX_QFI_NUM 64 -> move to ps_public_enum.h
+#define VGSM_MAX_NUM_OF_QFI VGSM_MAX_QFI_NUM /* Spec defined maximum num of QFI = 64*/
+
+#define VGSM_MIN_S_NSSAI_LEN 3 // 24501 9.10.3.47
+#define VGSM_MAX_S_NSSAI_LEN 10 // 24501 9.10.3.47
+#define VGSM_MIN_EAP_LEN 7 // 24501 9.10.2.2
+#define VGSM_MAX_EAP_LEN 1503 // 24501 9.10.2.2
+#define VGSM_MIN_EPCO_LEN 4 // 24008 10.5.6.3A
+#define VGSM_MAX_EPCO_LEN 65538 // 24008 10.5.6.3A
+#define VGSM_MIN_QOS_RULE_LEN 7 //24501.121 9.10.4.9
+#define VGSM_MAX_QOS_RULE_LEN 65538 //24501.121 9.10.4.9
+#define VGSM_MIN_QOS_FLOW_LEN 6 //24501
+#define VGSM_MAX_QOS_RULE_LEN 65538 //24501
+#define VGSM_MIN_MAPPED_EPSB_LEN 7 //24501 9.10.4.5
+#define VGSM_MAX_MAPPED_EPSB_LEN 65538 //24501 9.10.4.5
+#define VGSM_MAX_SESSION_AMBR_LEN 8 //24501 9.10.4.10
+#define VGSM_PDU_ADDR_LEN_IPV4 4 //24501 9.10.4.7
+#define VGSM_PDU_ADDR_LEN_IPV6 8 //24501 9.10.4.7
+#define VGSM_PDU_ADDR_LEN_IPV4V6 12 //24501 9.10.4.7
+#define VGSM_MIN_PDU_ADDRESS_INFO_LEN 7 // 24501 9.10.4.7
+#define VGSM_MAX_PDU_ADDRESS_INFO_LEN 15 // 24501 9.10.4.7
+#define VGSM_RQ_TIMER_DEACTIVATED 0xFFFF
+#define VGSM_MAX_PF_NUM_PER_PDU 256
+#define VGSM_SPEC_AVG_WINDOW_IN_MILLI_SEC 2000
+#define VGSM_MIN_PSI 1
+#define VGSM_MAX_PSI 15
+#define VGSM_TOTAL_PDU_SESSION (VGSM_MAX_PSI-VGSM_MIN_PSI+1)
+#define S_NSSAI_SD_LEN 3
+#define VGSM_INTEGRITY_PROTECT_MAX_DATA_RATE_FULL_DATA_RATE 0xFF
+
+/* UE Implementaion */
+#define VGSM_MAX_UE_IMPLEMENT_EPCO_LEN 512
+
+#define VGSM_REMOVE_HEADER_LEN(_header_len) ((_header_len)-2)
+#define VGSM_REMOVE_HEADER_LEN_EXTENDED(_header_len) ((_header_len)-3)
+
+
+/********************************************
+ * TYPE DEFINITIONS & ENUMS *
+ ********************************************/
+
+typedef enum {
+ VGSM_PDU_SESSION_TYPE_UNDEFINE = 0,
+ VGSM_PDU_SESSION_TYPE_IPV4 = 1,
+ VGSM_PDU_SESSION_TYPE_IPV6 = 2,
+ VGSM_PDU_SESSION_TYPE_IPV4V6 = 3,
+ VGSM_PDU_SESSION_TYPE_UNSTRUCTURED = 4,
+ VGSM_PDU_SESSION_TYPE_ETHERNET = 5,
+ VGSM_MAX_NUM_OF_PDU_SESSION_TYPE,
+ VGSM_PDU_SESSION_TYPE_RESERVED = 7,
+} vgsm_pdu_session_type_enum;
+
+typedef enum {
+ VGSM_SSC_MODE_UNDEFINE = 0,
+ VGSM_SSC_MODE_1 = 1,
+ VGSM_SSC_MODE_2 = 2,
+ VGSM_SSC_MODE_3 = 3,
+ VGSM_SSC_MODE_4_AS_SSC_1 = 4,
+ VGSM_SSC_MODE_5_AS_SSC_2 = 5,
+ VGSM_SSC_MODE_6_AS_SSC_3 = 6,
+ VGSM_MAX_NUM_OF_SSC_MODE
+} vgsm_ssc_mode_enum;
+
+typedef enum
+{
+ VGSM_DECODE_QOS_RULES_PROCEDURE_ESTABLISHMENT,
+ VGSM_DECODE_QOS_RULES_PROCEDURE_MODIFICATION,
+} vgsm_decode_qos_rules_procedure_enum;
+
+typedef struct _vgsm_qos_rules_tft_node{
+ kal_uint8 qfi;
+ kal_uint8 qri;
+ tft_proc_dir_enum procedure_direction;
+ tft_bearer_act_enum bearer_act;
+
+ tft_info_struct tft;
+ struct _vgsm_qos_rules_tft_node *next;
+} vgsm_qos_rules_tft_node;
+
+typedef enum {
+ VGSM_CONTEXT_DIRECTION_MO, // pti != 0
+ VGSM_CONTEXT_DIRECTION_MT, // pti == 0
+ VGSM_MAX_NUM_OF_CONTEXT_DIRECTION_ENUM,
+} vgsm_context_direction_enum;
+
+
+typedef struct {
+ vgsm_context_direction_enum context_direction;
+ vgsm_qos_rules_tft_node *head;
+ vgsm_qos_rules_tft_node *tail;
+} vgsm_qos_rules_tft_queue;
+
+typedef enum
+{
+ VGSM_MSG_CHECK_RESULT_OK,
+ VGSM_MSG_CHECK_RESULT_FAIL,
+ VGSM_MSG_CHECK_RESULT_NEED_TO_RELEASE_PDUS,
+ VGSM_MSG_CHECK_RESULT_MAX,
+} vgsm_msg_check_result_enum;
+
+typedef enum {
+ VGSM_FLOW_DESCRIPTION_OP_CODE_CREATE = 1,
+ VGSM_FLOW_DESCRIPTION_OP_CODE_DELETE = 2,
+ VGSM_FLOW_DESCRIPTION_OP_CODE_MODIFY = 3,
+ VGSM_MAX_NUM_OF_VGSM_FLOW_DESCRIPTION_OP_CODE,
+} vgsm_flow_description_op_code_enum;
+
+
+typedef struct {
+ kal_uint8 qfi;
+ kal_bool e_bit;
+ qos_params_struct params;
+ vgsm_flow_description_op_code_enum op_code;
+
+} vgsm_flow_description_struct;
+
+typedef struct {
+ kal_uint8 num_of_flow_description;
+ vgsm_flow_description_struct flow_description[VGSM_MAX_NUM_OF_QFI];
+
+} vgsm_flow_description_table_struct;
+
+typedef struct {
+ kal_uint8 qfi;
+ kal_bool is_contain_default_rule;
+ qos_params_struct params;
+ vgsm_flow_action_enum qfi_action;
+
+} vgsm_qfi_action_struct;
+
+typedef struct {
+ kal_uint8 num_of_flow_action;
+ vgsm_qfi_action_struct flow_action[VGSM_MAX_NUM_OF_QFI];
+
+} vgsm_flow_action_table_struct;
+
+typedef struct {
+ kal_uint64 bitmap;
+ ps_cause_enum cause;
+} vgsm_to_delete_qfi_struct;
+
+typedef struct {
+ kal_uint16 length;
+ kal_uint8* data;
+} vgsm_epco_raw_struct;
+
+#if 0 // -> move to ps_public_enum.h / ps_public_struct.h
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+typedef struct {
+ kal_uint32 tmp;
+
+} pdus_mapped_epsb_context_struct;
+
+typedef struct {
+ kal_uint16 len;
+ kal_uint8 msg[VGSM_MAX_EAP_LEN];
+} pdus_eap_message_struct;
+
+typedef enum {
+ VGSM_VGMM_ACCESS_TYPE_3GPP,
+ VGSM_VGMM_ACCESS_TYPE_N3GPP,
+ VGSM_VGMM_MAX_NUM_OF_ACCESS_TYPE,
+} vgsm_vgmm_access_type_enum;
+
+// 3GPP TS 24.501 Table 9.11.4.2A.1, ABO: All PLMNs Back-off timer
+typedef enum {
+ VGSM_CONGESTION_ABO_APPLIED_IN_RPLMN,
+ VGSM_CONGESTION_ABO_APPLIED_IN_ALL_PLMN,
+ VGSM_CONGESTION_ABO_MAX_NUM,
+} vgsm_congestion_abo_enum;
+
+// 3GPP TS 24.501 Table 9.11.4.17.1, RATC:
+typedef enum {
+ VGSM_REATTEMPT_RATC_ALLOWED_IN_S1_MODE,
+ VGSM_REATTEMPT_RATC_NOT_ALLOWED_IN_S1_MODE,
+ VGSM_REATTEMPT_RATC_MAX_NUM,
+} vgsm_reattempt_ratc_enum;
+
+// 3GPP TS 24.501 Table 9.11.4.17.1, EPLMNC:
+typedef enum {
+ VGSM_REATTEMPT_EPLMNC_ALLOWED,
+ VGSM_REATTEMPT_EPLMNC_NOT_ALLOWED,
+ VGSM_REATTEMPT_EPLMNC_MAX_NUM,
+} vgsm_reattempt_eplmnc_enum;
+
+/*Ref: 3GPP TS 24.501 Table 9.7.2 */
+typedef enum
+{
+ VGSM_MSG_NONE = 0X00,
+
+ VGSM_PDU_SESSION_ESTABLISHMENT_REQUEST = 0XC1,
+ VGSM_PDU_SESSION_ESTABLISHMENT_ACCEPT = 0XC2,
+ VGSM_PDU_SESSION_ESTABLISHMENT_REJECT = 0XC3,
+
+ VGSM_PDU_SESSION_AUTHENTICATION_COMMAND = 0XC5,
+ VGSM_PDU_SESSION_AUTHENTICATION_COMPLETE = 0XC6,
+ VGSM_PDU_SESSION_AUTHENTICATION_RESULT = 0XC7,
+
+ VGSM_PDU_SESSION_MODIFICATION_REQUEST = 0XC9,
+ VGSM_PDU_SESSION_MODIFICATION_REJECT = 0XCA,
+ VGSM_PDU_SESSION_MODIFICATION_COMMAND = 0XCB,
+ VGSM_PDU_SESSION_MODIFICATION_COMPLETE = 0XCC,
+ VGSM_PDU_SESSION_MODIFICATION_COMMAND_REJECT = 0XCD,
+
+ VGSM_PDU_SESSION_RELEASE_REQUEST = 0XD1,
+ VGSM_PDU_SESSION_RELEASE_REJECT = 0XD2,
+ VGSM_PDU_SESSION_RELEASE_COMMAND = 0XD3,
+ VGSM_PDU_SESSION_RELEASE_COMPLETE = 0XD4,
+
+ VGSM_5GSM_STATUS = 0XD6,
+
+} vgsm_msg_type_enum;
+
+
+typedef enum {
+ VGSM_CHECK_IF_APPROVE_SEND_PDUS_ESTABLISHMENT,
+ VGSM_CHECK_IF_APPROVE_SEND_PDUS_MODIFICATION,
+ VGSM_CHECK_IF_APPROVE_SEND_PDUS_RELEASE,
+ VGSM_CHECK_IF_APPROVE_MAX_NUM,
+} vgsm_check_if_approve_procedure_enum;
+
+typedef enum {
+ VGSM_xSM_INTERWORKING_LOCAL_REALESE_PDN_TYPE_4G5_NONE = 0x00,
+ VGSM_xSM_INTERWORKING_LOCAL_REALESE_PDN_TYPE_4G5_IMS = 0x01,
+ VGSM_xSM_INTERWORKING_LOCAL_REALESE_PDN_TYPE_4G5_INTERNET = 0x02,
+ VGSM_xSM_INTERWORKING_LOCAL_REALESE_PDN_TYPE_4G5_IMS_AND_INTERNET = 0x03,
+ VGSM_xSM_INTERWORKING_LOCAL_REALESE_PDN_TYPE_4G5_OTHERS = 0x04,
+
+ // for without n26 irat pending scenario
+ VGSM_xSM_INTERWORKING_LOCAL_REALESE_PDN_TYPE_4G5_ALL_WITHOUT_N26_HANDOVER = 0x10, // without N26 4G PDN will all rel and be re-est by upper layer
+ VGSM_xSM_INTERWORKING_LOCAL_REALESE_PDN_TYPE_4G5_INVALID_WITHOUT_N26 = 0x11, // unexpected, without N26 information mismatch from VGMM
+} vgsm_xsm_interworking_local_release_pdn_type_enum;
+
+typedef struct
+{
+ vgsm_congestion_abo_enum abo;
+} vgsm_congestion_reattempt_ind_struct;
+
+typedef struct
+{
+ vgsm_reattempt_ratc_enum ratc;
+ vgsm_reattempt_eplmnc_enum eplmnc;
+} vgsm_reattempt_ind_struct;
+
+typedef struct
+{
+ kal_uint8 psi;
+ pdp_addr_type_enum selected_pdu_session_type;
+ kal_uint8 selected_ssc_mode;
+
+ pdus_session_ambr_struct session_ambr;
+
+ kal_bool is_pdu_address_present;
+ ip_addr_struct pdu_address;
+
+ kal_uint32 rq_timer_value_in_sec;
+
+ kal_bool is_s_nssai_present;
+ pdus_s_nssai_struct s_nssai;
+
+ kal_bool is_always_on_pdu_session_ind_present;
+ always_on_pdu_session_ind_enum always_on_pdu_session_ind;
+
+ pkt_filters_act_list_node_struct *pf_action_list_node;
+
+ kal_uint8 qfi_with_default_rule;
+
+ qos_params_struct *qos_profiles[VGSM_MAX_QFI_NUM]; /* all qos profiles under PDU session */
+
+ pdus_access_type_enum access_type;
+} context_transfer_pdus_info_struct;
+
+typedef struct {
+ kal_uint8 from_ebi;
+ kal_uint8 to_psi;
+ qos_flow_action_table_struct qf_action_table;
+} ebi_map_to_psi_info_struct;
+
+
+
+/********************************************
+ * VARIABLES *
+ ********************************************/
+
+/********************************************
+ * FUNCTION DECLARATIONS *
+ ********************************************/
+
+#endif /* VGSM_COMMON_DEF_PUBLIC_H */
diff --git a/mcu/protocol/interface/general/5g/vgsm_msg_unpack.h b/mcu/protocol/interface/general/5g/vgsm_msg_unpack.h
new file mode 100644
index 0000000..a256cd5
--- /dev/null
+++ b/mcu/protocol/interface/general/5g/vgsm_msg_unpack.h
@@ -0,0 +1,774 @@
+/*****************************************************************************
+ * Copyright Statement:
+ * --------------------
+ * This software is protected by Copyright and the information contained
+ * herein is confidential. The software may not be copied and the information
+ * contained herein may not be used or disclosed except with the written
+ * permission of MediaTek Inc. (C) 2012
+ *
+ * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+ * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+ * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+ * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+ * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+ * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+ * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+ * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+ * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+ * SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+ *
+ * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+ * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+ * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+ * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+ * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+ *
+ * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+ * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+ * LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+ * RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+ * THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+ *
+ *****************************************************************************/
+ /*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * MCD_VGSM_GEN_PEER_H
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ ****************************************************************************/
+
+#ifndef _MCDDLL_VGSM_GEN_PEER_H
+#define _MCDDLL_VGSM_GEN_PEER_H
+
+#if defined(__FIVEG_NAS__)
+
+#include "kal_general_types.h"
+
+#include "vgnas_msg_unpack.h"
+#include "vgmm_msg_unpack.h"
+#include "mcd_vgsm_gen_peer.h"
+
+#define D_NO_EPCO 64
+#define D_NO_AUTH_QOS_RULES 64
+#define D_NO_EAP_MESSAGE 64
+#define D_NO_BACK_OFF_TIMER_VAL 1
+#define D_NO_REQ_QOS_RULES 64
+#define D_NO_SESSION_AMBR 6
+#define D_NO_PDU_ADDR 15
+#define D_NO_REQ_QOS_FLOW 64
+#define D_NO_VGSM_CAPABILITY 15
+#define D_NO_MAPPED_EPSB_CONTEXT 64
+#define D_NO_AUTH_QOS_FLOW 64
+#define D_NO_S_NSSAI 8
+#define D_NO_DNN 64
+
+typedef enum
+{
+ PDU_session_establishment_request= 193,
+ PDU_session_establishment_accept= 194,
+ PDU_session_establishment_reject= 195,
+ PDU_session_authentication_command= 197,
+ PDU_session_authentication_complete= 198,
+ PDU_session_authentication_result= 199,
+ //New
+ //PDU_session_authentication_result_2= 201,
+ PDU_session_modification_request = 201,
+ //End of new
+ PDU_session_modification_reject= 202,
+ PDU_session_modification_command= 203,
+ PDU_session_modification_complete= 204,
+ PDU_session_modification_command_reject= 205,
+ PDU_session_release_request= 209,
+ PDU_session_release_reject= 210,
+ PDU_session_release_command= 211,
+ PDU_session_release_complete= 212,
+ VGSM_status= 214,
+} mcddll_vgsm_msg_type_enum;
+
+
+typedef enum
+{
+ //New
+ Other_value_0_should_be_IPv4v6= 0,
+ //End of new
+ IPv4= 1,
+ IPv6= 2,
+ IPv4v6= 3,
+ Unstructured,
+ Ethernet,
+ //New
+ Other_value_6_should_be_IPv4v6=6,
+ //End of new
+ pdu_session_type_reserved =7
+}mcddll_vgsm_pdu_session_type_enum;
+
+typedef enum
+{
+ SSC_mode_1= 1,
+ SSC_mode_2,
+ SSC_mode_3,
+ unused_if_received_by_the_nw_then_SSC_mode_1,
+ unused_if_received_by_the_nw_then_SSC_mode_2,
+ unused_if_received_by_the_nw_then_SSC_mode_3
+}mcddll_vgsm_ssc_mode_enum;
+
+typedef enum
+{
+ Reflective_QoS_not_supported,
+ Reflective_QoS_supported
+}mcddll_vgsm_RqoS_enum;
+
+typedef enum
+{
+ Multi_homed_IPv6_PDU_session_not_supported,
+ Multi_homed_IPv6_PDU_session_supported
+}mcddll_vgsm_MH6_PDU_enum;
+
+typedef struct
+{
+ kal_uint8 spare;
+ mcddll_vgsm_MH6_PDU_enum mh6_pdu;
+ mcddll_vgsm_RqoS_enum rqos;
+}vgsm_mcddll_capability_struct;
+
+typedef enum
+{
+ value_is_not_used= 0,
+ value_is_incremented_in_multiples_of_1_Kbps,
+ value_is_incremented_in_multiples_of_4_Kbps,
+ value_is_incremented_in_multiples_of_16_Kbps,
+ value_is_incremented_in_multiples_of_64_Kbps,
+ value_is_incremented_in_multiples_of_256_kbps,
+ value_is_incremented_in_multiples_of_1_Mbps,
+ value_is_incremented_in_multiples_of_4_Mbps,
+ value_is_incremented_in_multiples_of_16_Mbps,
+ value_is_incremented_in_multiples_of_64_Mbps,
+ value_is_incremented_in_multiples_of_256_Mbps,
+ value_is_incremented_in_multiples_of_1_Gbps,
+ value_is_incremented_in_multiples_of_4_Gbps,
+ value_is_incremented_in_multiples_of_16_Gbps,
+ value_is_incremented_in_multiples_of_64_Gbps,
+ value_is_incremented_in_multiples_of_256_Gbps,
+ value_is_incremented_in_multiples_of_1_Tbps,
+ value_is_incremented_in_multiples_of_4_Tbps,
+ value_is_incremented_in_multiples_of_16_Tbps,
+ value_is_incremented_in_multiples_of_64_Tbps,
+ value_is_incremented_in_multiples_of_256_Tbps,
+ value_is_incremented_in_multiples_of_1_Pbps,
+ value_is_incremented_in_multiples_of_4_Pbps,
+ value_is_incremented_in_multiples_of_16_Pbps,
+ value_is_incremented_in_multiples_of_64_Pbps,
+ value_is_incremented_in_multiples_of_256_Pbps
+}mcddll_vgsm_Unit_for_Session_AMBR_for_downlink_enum;
+
+typedef enum
+{
+ Insufficient_resources = 26,
+ Missing_or_unknown_DNN = 27,
+ Unknown_PDU_session_type = 28,
+ User_authentication_failed = 29,
+ Request_rejected,_unspecified = 31,
+ Requested_service_option_not_subscribed = 33,
+ Service_option_temporarily_out_of_order = 34,
+ PTI_already_in_use = 35,
+ Regular_deactivation = 36,
+ //New
+ Out_of_LADN_service_area = 38,
+ //End of new
+ Reactivation_requested = 39,
+ //New
+ Invalid_PDU_session_identity = 43,
+ Semantic_errors_in_packet_filters = 44,
+ Syntactical_error_in_packet_filters = 45,
+ PTI_mismatch = 47,
+ //End of new
+ PDU_session_type_IPv4_only_allowed = 50,
+ PDU_session_type_IPv6_only_allowed = 51,
+ //New
+ PDU_session_does_not_exist = 54,
+ //End of new
+ vgsm_Insufficient_resources_for_specific_slice_and_DNN = 67,
+ Not_supported_SSC_mode = 68,
+ vgsm_Insufficient_resources_for_specific_slice = 69,
+ Missing_or_unknown_DNN_in_a_slice = 70,
+ Invalid_PTI_value = 81,
+ //New
+ Maximum_data_rate_per_UE_for_user_plane_integrity_protection_is_too_low = 82,
+ Semantic_error_in_the_QoS_operation = 83,
+ Syntactical_error_in_the_QoS_operation = 84,
+ //End of new
+ vgsm_Semantically_incorrect_message = 95,
+ vgsm_Invalid_mandatory_information = 96,
+ vgsm_Message_type_non_existent_or_not_implemented = 97,
+ vgsm_Message_type_not_compatible_with_the_protocol_state = 98,
+ vgsm_Information_element_non_existent_or_not_implemented = 99,
+ vgsm_Conditional_IE_error = 100,
+ vgsm_Message_not_compatible_with_the_protocol_state = 101,
+ vgsm_Protocol_error_unspecified = 111
+}mcddll_vgsm_cause_value_enum;
+
+typedef struct _vgsm_mcddll_pdu_address_struct
+{
+ kal_uint8 length;
+ kal_uint8 spare;
+ mcddll_vgsm_pdu_session_type_enum pdu_type_val;
+ kal_uint8 no_pdu_addr;
+ kal_uint8 pdu_addr[D_NO_PDU_ADDR];
+} vgsm_mcddll_pdu_address_struct;
+
+typedef enum
+{
+ No_procedure_transaction_identity_assigned = 0,
+ Reserved = 255
+} mcddll_procedure_transaction_identity_enum;
+
+//New
+
+typedef enum
+{
+ data_rate_64kbps = 0,
+ Full_data_rate = 255
+}mcddll_vgsm_max_data_rate_per_UE_for_user_plane_integrity_protection_enum;
+
+typedef enum
+{
+ Always_on_PDU_session_not_requested = 0,
+ Always_on_PDU_session_requested = 1
+}mcddll_vgsm_always_on_pdu_session_requested_enum;
+
+typedef enum
+{
+ Always_on_PDU_session_not_allowed = 0,
+ Always_on_PDU_session_required = 1
+}mcddll_vgsm_always_on_pdu_session_ind_enum;
+
+typedef enum
+{
+ SSC_mode_1_not_allowed = 0,
+ SSC_mode_1_allowed = 1
+}mcddll_vgsm_ssc1_enum;
+
+typedef enum
+{
+ SSC_mode_2_not_allowed = 0,
+ SSC_mode_2_allowed = 1
+}mcddll_vgsm_ssc2_enum;
+
+typedef enum
+{
+ SSC_mode_3_not_allowed = 0,
+ SSC_mode_3_allowed = 1
+}mcddll_vgsm_ssc3_enum;
+
+typedef enum{
+ eMBB = 1,
+ URLLC = 2,
+ MIoT = 3
+}mcddll_vgsm_sst_value_enum;
+
+typedef struct _vgsm_mcddll_allowed_ssc_mode_struct
+{
+ kal_uint8 spare;
+ mcddll_vgsm_ssc1_enum ssc1;
+ mcddll_vgsm_ssc2_enum ssc2;
+ mcddll_vgsm_ssc3_enum ssc3;
+}vgsm_mcddll_allowed_ssc_mode_struct;
+
+
+typedef struct _vgsm_mcddll_always_on_pdu_session_requested_struct
+{
+ kal_uint8 _spare;
+ mcddll_vgsm_always_on_pdu_session_requested_enum apsr;
+}vgsm_mcddll_always_on_pdu_session_requested_struct;
+
+typedef struct _vgsm_mcddll_always_on_pdu_session_ind_struct
+{
+ kal_uint8 _spare;
+ mcddll_vgsm_always_on_pdu_session_ind_enum apsi;
+}vgsm_mcddll_always_on_pdu_session_ind_struct;
+
+#ifndef __MCD_VGNAS_24501_SPEC_2018SEP__
+typedef struct _vgsm_mcddll_integrity_protection_max_data_rate_struct{
+ mcddll_vgsm_max_data_rate_per_UE_for_user_plane_integrity_protection_enum ul;
+ mcddll_vgsm_max_data_rate_per_UE_for_user_plane_integrity_protection_enum dl;
+}vgsm_mcddll_integrity_protection_max_data_rate_struct;
+#else
+typedef struct _vgsm_mcddll_integrity_protection_max_data_rate_struct{
+ mcddll_vgsm_max_data_rate_per_UE_for_user_plane_integrity_protection_enum ul;
+ //mcddll_vgsm_max_data_rate_per_UE_for_user_plane_integrity_protection_enum dl; //Defined in Dec.2018
+}vgsm_mcddll_integrity_protection_max_data_rate_struct;
+#endif
+
+typedef struct _vgsm_mcddll_session_ambr_struct
+{
+ mcddll_vgsm_Unit_for_Session_AMBR_for_downlink_enum unit_for_session_ambr_for_dl;
+ kal_uint16 session_ambr_for_dl;
+ mcddll_vgsm_Unit_for_Session_AMBR_for_downlink_enum unit_for_session_ambr_for_ul;
+ kal_uint16 session_ambr_for_ul;
+}vgsm_mcddll_session_ambr_struct;
+
+#ifndef __MCD_VGNAS_24501_SPEC_2018SEP__
+typedef struct _vgsm_mcddll_s_nssai_struct
+{
+ kal_uint8 is_sst_present;
+ mcddll_vgsm_sst_value_enum sst; //align Anritsu
+ kal_uint8 is_sd_present;
+ kal_uint32 sd;
+ kal_uint8 is_mapped_hplmn_sst_present;
+ mcddll_vgsm_sst_value_enum mapped_hplmn_sst; //align Anritsu
+ kal_uint8 is_mapped_hplmn_sd_present;
+ kal_uint32 mapped_hplmn_sd;
+}vgsm_mcddll_s_nssai_struct;
+#else
+typedef struct _vgsm_mcddll_s_nssai_struct
+{
+ kal_uint8 is_sst_present;
+ mcddll_vgsm_sst_value_enum sst; //align Anritsu
+ kal_uint8 is_sd_present;
+ kal_uint32 sd;
+ kal_uint8 is_mapped_configured_sst_present;
+ mcddll_vgsm_sst_value_enum mapped_configured_sst; //align Anritsu
+ kal_uint8 is_mapped_configured_sd_present;
+ kal_uint32 mapped_configured_sd;
+}vgsm_mcddll_s_nssai_struct;
+#endif
+
+typedef struct _vgsm_mcddll_back_off_timer_val_struct
+{
+ mcddll_timer3_value_unit_enum unit;
+ kal_uint8 timer_val;
+}vgsm_mcddll_back_off_timer_val_struct;
+
+typedef struct _vgsm_mcddll_rq_timer_val_struct
+{
+ mcddll_timer_unit_enum unit;
+ kal_uint8 timer_val;
+}vgsm_mcddll_rq_timer_val_struct;
+
+
+
+//End of New
+
+#ifndef __MCD_VGNAS_24501_SPEC_2018SEP__
+typedef struct _vgsm_mcddll_pdu_session_establishment_request_struct
+{
+ mcddll_EPD_value_enum ext_proto_discr;
+ mcddll_PDU_session_identity_value_enum psi;
+ mcddll_procedure_transaction_identity_enum pti;
+ mcddll_vgsm_msg_type_enum msg_type;
+ vgsm_mcddll_integrity_protection_max_data_rate_struct integrity_max_data_rate; //DEC.2018 : option->mandatory
+ kal_uint8 pdu_session_typeP;
+ mcddll_vgsm_pdu_session_type_enum pdu_session_type;
+ kal_uint8 ssc_modeP;
+ mcddll_vgsm_ssc_mode_enum ssc_mode;
+ kal_uint8 vgsm_capabilityP;
+ kal_uint8 no_vgsm_capability;
+ vgsm_mcddll_capability_struct vgsm_capability;
+ kal_uint8 max_num_of_supported_pfP;
+ kal_uint16 max_num_of_supported_pf;
+ kal_uint8 always_on_pdu_session_reqP;
+ vgsm_mcddll_always_on_pdu_session_requested_struct always_on_pdu_session_req;
+ kal_uint8 epcoP;
+ kal_uint16 no_epco;
+ kal_uint8 epco[D_NO_EPCO];
+} vgsm_mcddll_pdu_session_establishment_request_struct;
+#else
+typedef struct _vgsm_mcddll_pdu_session_establishment_request_struct
+{
+ mcddll_EPD_value_enum ext_proto_discr;
+ mcddll_PDU_session_identity_value_enum psi;
+ mcddll_procedure_transaction_identity_enum pti;
+ mcddll_vgsm_msg_type_enum msg_type;
+ kal_uint8 pdu_session_typeP;
+ mcddll_vgsm_pdu_session_type_enum pdu_session_type;
+ kal_uint8 ssc_modeP;
+ mcddll_vgsm_ssc_mode_enum ssc_mode;
+ kal_uint8 vgsm_capabilityP;
+ kal_uint8 no_vgsm_capability;
+ vgsm_mcddll_capability_struct vgsm_capability;
+ kal_uint8 max_num_of_supported_pfP;
+ kal_uint16 max_num_of_supported_pf;
+ kal_uint8 integrity_max_data_rateP;
+ vgsm_mcddll_integrity_protection_max_data_rate_struct integrity_max_data_rate;
+ kal_uint8 always_on_pdu_session_reqP;
+ vgsm_mcddll_always_on_pdu_session_requested_struct always_on_pdu_session_req;
+ kal_uint8 epcoP;
+ kal_uint16 no_epco;
+ kal_uint8 epco[D_NO_EPCO];
+} vgsm_mcddll_pdu_session_establishment_request_struct;
+#endif
+
+
+#ifndef __MCD_VGNAS_24501_SPEC_2018SEP__
+typedef struct _vgsm_mcddll_pdu_session_establishment_accept_struct
+{
+ mcddll_EPD_value_enum ext_proto_discr;
+ mcddll_PDU_session_identity_value_enum psi;
+ mcddll_procedure_transaction_identity_enum pti;
+ mcddll_vgsm_msg_type_enum msg_type;
+ mcddll_vgsm_pdu_session_type_enum selected_pdu_session_type;
+ mcddll_vgsm_ssc_mode_enum selected_ssc_mode;
+ kal_uint16 no_auth_qos_rules;
+ kal_uint8 auth_qos_rules[D_NO_AUTH_QOS_RULES];
+ kal_uint8 no_session_ambr;
+ //mcddll_vgsm_Unit_for_Session_AMBR_for_downlink_enum session_ambr[D_NO_SESSION_AMBR];
+ vgsm_mcddll_session_ambr_struct session_ambr;
+ kal_uint8 vgsm_causeP;
+ mcddll_vgsm_cause_value_enum vgsm_cause;
+ kal_uint8 pdu_addressP;
+ //vgsm_mcddll_pdu_address_struct pdu_address;
+ kal_uint8 no_pdu_address;
+ kal_uint8 pdu_address[D_NO_PDU_ADDR];
+ kal_uint8 rq_timer_valP;
+ //kal_uint8 rq_timer_val;
+ vgsm_mcddll_rq_timer_val_struct rq_timer_val;
+ kal_uint8 s_nssaiP;
+ kal_uint8 no_s_nssai;
+ //kal_uint8 s_nssai[D_NO_S_NSSAI];
+ vgsm_mcddll_s_nssai_struct s_nssai;
+ //New
+ kal_uint8 always_on_pdu_session_indP;
+ vgsm_mcddll_always_on_pdu_session_ind_struct always_on_pdu_session_ind;
+ //End of new
+ kal_uint8 mapped_epsb_contextP;
+ kal_uint16 no_mapped_epsb_context;
+ kal_uint8 mapped_epsb_context[D_NO_MAPPED_EPSB_CONTEXT];
+ kal_uint8 eap_messageP;
+ kal_uint16 no_eap_message;
+ kal_uint8 eap_message[D_NO_EAP_MESSAGE];
+ kal_uint8 auth_qos_flowP; //DEC.2018 : change IE order
+ kal_uint16 no_auth_qos_flow;
+ kal_uint8 auth_qos_flow[D_NO_AUTH_QOS_FLOW];
+ kal_uint8 epcoP;
+ kal_uint16 no_epco;
+ kal_uint8 epco[D_NO_EPCO];
+ kal_uint8 dnnP; //DEC : mandatory->option
+ kal_uint8 no_dnn;
+ kal_uint8 dnn[D_NO_DNN];
+} vgsm_mcddll_pdu_session_establishment_accept_struct;
+#else //SEPT
+typedef struct _vgsm_mcddll_pdu_session_establishment_accept_struct
+{
+ mcddll_EPD_value_enum ext_proto_discr;
+ mcddll_PDU_session_identity_value_enum psi;
+ mcddll_procedure_transaction_identity_enum pti;
+ mcddll_vgsm_msg_type_enum msg_type;
+ mcddll_vgsm_pdu_session_type_enum selected_pdu_session_type;
+ mcddll_vgsm_ssc_mode_enum selected_ssc_mode;
+ kal_uint8 no_dnn;
+ kal_uint8 dnn[D_NO_DNN];
+ kal_uint16 no_auth_qos_rules;
+ kal_uint8 auth_qos_rules[D_NO_AUTH_QOS_RULES];
+ kal_uint8 no_session_ambr;
+ //mcddll_vgsm_Unit_for_Session_AMBR_for_downlink_enum session_ambr[D_NO_SESSION_AMBR];
+ vgsm_mcddll_session_ambr_struct session_ambr;
+ kal_uint8 vgsm_causeP;
+ mcddll_vgsm_cause_value_enum vgsm_cause;
+ kal_uint8 pdu_addressP;
+ //vgsm_mcddll_pdu_address_struct pdu_address;
+ kal_uint8 no_pdu_address;
+ kal_uint8 pdu_address[D_NO_PDU_ADDR];
+ kal_uint8 rq_timer_valP;
+ vgsm_mcddll_rq_timer_val_struct rq_timer_val;
+ kal_uint8 s_nssaiP;
+ kal_uint8 no_s_nssai;
+ vgsm_mcddll_s_nssai_struct s_nssai;
+ kal_uint8 always_on_pdu_session_indP;
+ vgsm_mcddll_always_on_pdu_session_ind_struct always_on_pdu_session_ind;
+ kal_uint8 mapped_epsb_contextP;
+ kal_uint16 no_mapped_epsb_context;
+ kal_uint8 mapped_epsb_context[D_NO_MAPPED_EPSB_CONTEXT];
+ kal_uint8 eap_messageP;
+ kal_uint16 no_eap_message;
+ kal_uint8 eap_message[D_NO_EAP_MESSAGE];
+ kal_uint8 auth_qos_flowP;
+ kal_uint16 no_auth_qos_flow;
+ kal_uint8 auth_qos_flow[D_NO_AUTH_QOS_FLOW];
+ kal_uint8 epcoP;
+ kal_uint16 no_epco;
+ kal_uint8 epco[D_NO_EPCO];
+} vgsm_mcddll_pdu_session_establishment_accept_struct;
+#endif
+
+
+
+typedef struct _vgsm_mcddll_pdu_session_establishment_reject_struct
+{
+ mcddll_EPD_value_enum ext_proto_discr;
+ mcddll_PDU_session_identity_value_enum psi;
+ mcddll_procedure_transaction_identity_enum pti;
+ mcddll_vgsm_msg_type_enum msg_type;
+ mcddll_vgsm_cause_value_enum vgsm_cause;
+ kal_uint8 back_off_timer_valP;
+ kal_uint8 no_back_off_timer_val;
+ //kal_uint8 back_off_timer_val[D_NO_BACK_OFF_TIMER_VAL];
+ vgsm_mcddll_back_off_timer_val_struct back_off_timer_val;
+ kal_uint8 allowed_ssc_modeP;
+ //kal_uint8 allowed_ssc_mode;
+ vgsm_mcddll_allowed_ssc_mode_struct allowed_ssc_mode;
+ kal_uint8 eap_messageP;
+ kal_uint16 no_eap_message;
+ kal_uint8 eap_message[D_NO_EAP_MESSAGE];
+ kal_uint8 epcoP;
+ kal_uint16 no_epco;
+ kal_uint8 epco[D_NO_EPCO];
+} vgsm_mcddll_pdu_session_establishment_reject_struct;
+
+
+typedef struct _vgsm_mcddll_pdu_session_authentication_command_struct
+{
+ mcddll_EPD_value_enum ext_proto_discr;
+ mcddll_PDU_session_identity_value_enum psi;
+ mcddll_procedure_transaction_identity_enum pti;
+ mcddll_vgsm_msg_type_enum msg_type;
+ kal_uint8 eap_messageP;
+ kal_uint16 no_eap_message;
+ kal_uint8 eap_message[D_NO_EAP_MESSAGE];
+ kal_uint8 epcoP;
+ kal_uint16 no_epco;
+ kal_uint8 epco[D_NO_EPCO];
+} vgsm_mcddll_pdu_session_authentication_command_struct;
+
+
+typedef struct _vgsm_mcddll_pdu_session_authentication_complete_struct
+{
+ mcddll_EPD_value_enum ext_proto_discr;
+ mcddll_PDU_session_identity_value_enum psi;
+ mcddll_procedure_transaction_identity_enum pti;
+ mcddll_vgsm_msg_type_enum msg_type;
+ kal_uint8 eap_messageP;
+ kal_uint16 no_eap_message;
+ kal_uint8 eap_message[D_NO_EAP_MESSAGE];
+ kal_uint8 epcoP;
+ kal_uint16 no_epco;
+ kal_uint8 epco[D_NO_EPCO];
+} vgsm_mcddll_pdu_session_authentication_complete_struct;
+
+#ifndef __MCD_VGNAS_24501_SPEC_2018SEP__
+typedef struct _vgsm_mcddll_pdu_session_modification_request_struct
+{
+ mcddll_EPD_value_enum ext_proto_discr;
+ mcddll_PDU_session_identity_value_enum psi;
+ mcddll_procedure_transaction_identity_enum pti;
+ mcddll_vgsm_msg_type_enum msg_type;
+ kal_uint8 vgsm_capabilityP;
+ kal_uint8 no_vgsm_capability;
+ vgsm_mcddll_capability_struct vgsm_capability;
+ kal_uint8 vgsm_causeP;
+ mcddll_vgsm_cause_value_enum vgsm_cause;
+ kal_uint8 max_num_of_supported_pfP;
+ kal_uint16 max_num_of_supported_pf;
+ kal_uint8 always_on_pdu_session_reqP;
+ vgsm_mcddll_always_on_pdu_session_requested_struct always_on_pdu_session_req;
+ kal_uint8 integrity_max_data_rateP;
+ vgsm_mcddll_integrity_protection_max_data_rate_struct integrity_max_data_rate;
+ kal_uint8 req_qos_rulesP;
+ kal_uint16 no_req_qos_rules;
+ kal_uint8 req_qos_rules[D_NO_REQ_QOS_RULES];
+ kal_uint8 req_qos_flowP;
+ kal_uint16 no_req_qos_flow;
+ kal_uint8 req_qos_flow[D_NO_REQ_QOS_FLOW];
+ kal_uint8 mapped_epsb_contextP; //DEC.2018
+ kal_uint16 no_mapped_epsb_context;
+ kal_uint8 mapped_epsb_context[D_NO_MAPPED_EPSB_CONTEXT];
+ kal_uint8 epcoP; //DEC.2018 : change order
+ kal_uint16 no_epco;
+ kal_uint8 epco[D_NO_EPCO];
+} vgsm_mcddll_pdu_session_modification_request_struct;
+#else
+typedef struct _vgsm_mcddll_pdu_session_modification_request_struct
+{
+ mcddll_EPD_value_enum ext_proto_discr;
+ mcddll_PDU_session_identity_value_enum psi;
+ mcddll_procedure_transaction_identity_enum pti;
+ mcddll_vgsm_msg_type_enum msg_type;
+ kal_uint8 vgsm_capabilityP;
+ kal_uint8 no_vgsm_capability;
+ vgsm_mcddll_capability_struct vgsm_capability;
+ kal_uint8 vgsm_causeP;
+ mcddll_vgsm_cause_value_enum vgsm_cause;
+ kal_uint8 max_num_of_supported_pfP;
+ kal_uint16 max_num_of_supported_pf;
+ kal_uint8 always_on_pdu_session_reqP;
+ vgsm_mcddll_always_on_pdu_session_requested_struct always_on_pdu_session_req;
+ kal_uint8 integrity_max_data_rateP;
+ vgsm_mcddll_integrity_protection_max_data_rate_struct integrity_max_data_rate;
+ kal_uint8 req_qos_rulesP;
+ kal_uint16 no_req_qos_rules;
+ kal_uint8 req_qos_rules[D_NO_REQ_QOS_RULES];
+ kal_uint8 epcoP;
+ kal_uint16 no_epco;
+ kal_uint8 epco[D_NO_EPCO];
+ kal_uint8 req_qos_flowP;
+ kal_uint16 no_req_qos_flow;
+ kal_uint8 req_qos_flow[D_NO_REQ_QOS_FLOW];
+} vgsm_mcddll_pdu_session_modification_request_struct;
+#endif
+
+
+typedef struct _vgsm_mcddll_pdu_session_modification_reject_struct
+{
+ mcddll_EPD_value_enum ext_proto_discr;
+ mcddll_PDU_session_identity_value_enum psi;
+ mcddll_procedure_transaction_identity_enum pti;
+ mcddll_vgsm_msg_type_enum msg_type;
+ mcddll_vgsm_cause_value_enum vgsm_cause;
+ kal_uint8 back_off_timer_valP;
+ kal_uint8 no_back_off_timer_val;
+ //kal_uint8 back_off_timer_val[D_NO_BACK_OFF_TIMER_VAL];
+ vgsm_mcddll_back_off_timer_val_struct back_off_timer_val;
+ kal_uint8 epcoP;
+ kal_uint16 no_epco;
+ kal_uint8 epco[D_NO_EPCO];
+} vgsm_mcddll_pdu_session_modification_reject_struct;
+
+
+typedef struct _vgsm_mcddll_pdu_session_modification_command_struct
+{
+ mcddll_EPD_value_enum ext_proto_discr;
+ mcddll_PDU_session_identity_value_enum psi;
+ mcddll_procedure_transaction_identity_enum pti;
+ mcddll_vgsm_msg_type_enum msg_type;
+ kal_uint8 vgsm_causeP;
+ mcddll_vgsm_cause_value_enum vgsm_cause;
+ kal_uint8 session_ambrP;
+ kal_uint8 no_session_ambr;
+ vgsm_mcddll_session_ambr_struct session_ambr;
+ kal_uint8 rq_timer_valP;
+ vgsm_mcddll_rq_timer_val_struct rq_timer_val;
+ kal_uint8 always_on_pdu_session_indP;
+ vgsm_mcddll_always_on_pdu_session_ind_struct always_on_pdu_session_ind;
+ kal_uint8 auth_qos_rulesP;
+ kal_uint16 no_auth_qos_rules;
+ kal_uint8 auth_qos_rules[D_NO_AUTH_QOS_RULES];
+ kal_uint8 mapped_epsb_contextP;
+ kal_uint16 no_mapped_epsb_context;
+ kal_uint8 mapped_epsb_context[D_NO_MAPPED_EPSB_CONTEXT];
+ kal_uint8 auth_qos_flowP;
+ kal_uint16 no_auth_qos_flow;
+ kal_uint8 auth_qos_flow[D_NO_AUTH_QOS_FLOW];
+ kal_uint8 epcoP;
+ kal_uint16 no_epco;
+ kal_uint8 epco[D_NO_EPCO];
+} vgsm_mcddll_pdu_session_modification_command_struct;
+
+
+typedef struct _vgsm_mcddll_pdu_session_modification_complete_struct
+{
+ mcddll_EPD_value_enum ext_proto_discr;
+ mcddll_PDU_session_identity_value_enum psi;
+ mcddll_procedure_transaction_identity_enum pti;
+ mcddll_vgsm_msg_type_enum msg_type;
+ kal_uint8 epcoP;
+ kal_uint16 no_epco;
+ kal_uint8 epco[D_NO_EPCO];
+} vgsm_mcddll_pdu_session_modification_complete_struct;
+
+
+typedef struct _vgsm_mcddll_pdu_session_modification_command_reject_struct
+{
+ mcddll_EPD_value_enum ext_proto_discr;
+ mcddll_PDU_session_identity_value_enum psi;
+ mcddll_procedure_transaction_identity_enum pti;
+ mcddll_vgsm_msg_type_enum msg_type;
+ mcddll_vgsm_cause_value_enum vgsm_cause;
+ kal_uint8 epcoP;
+ kal_uint16 no_epco;
+ kal_uint8 epco[D_NO_EPCO];
+} vgsm_mcddll_pdu_session_modification_command_reject_struct;
+
+
+typedef struct _vgsm_mcddll_pdu_session_release_request_struct
+{
+ mcddll_EPD_value_enum ext_proto_discr;
+ mcddll_PDU_session_identity_value_enum psi;
+ mcddll_procedure_transaction_identity_enum pti;
+ mcddll_vgsm_msg_type_enum msg_type;
+ //New
+ kal_uint8 vgsm_causeP;
+ mcddll_vgsm_cause_value_enum vgsm_cause;
+ //End of NEw
+ kal_uint8 epcoP;
+ kal_uint16 no_epco;
+ kal_uint8 epco[D_NO_EPCO];
+} vgsm_mcddll_pdu_session_release_request_struct;
+
+
+typedef struct _vgsm_mcddll_pdu_session_release_reject_struct
+{
+ mcddll_EPD_value_enum ext_proto_discr;
+ mcddll_PDU_session_identity_value_enum psi;
+ mcddll_procedure_transaction_identity_enum pti;
+ mcddll_vgsm_msg_type_enum msg_type;
+ mcddll_vgsm_cause_value_enum vgsm_cause;
+ kal_uint8 epcoP;
+ kal_uint16 no_epco;
+ kal_uint8 epco[D_NO_EPCO];
+} vgsm_mcddll_pdu_session_release_reject_struct;
+
+
+typedef struct _vgsm_mcddll_pdu_session_release_command_struct
+{
+ mcddll_EPD_value_enum ext_proto_discr;
+ mcddll_PDU_session_identity_value_enum psi;
+ mcddll_procedure_transaction_identity_enum pti;
+ mcddll_vgsm_msg_type_enum msg_type;
+ mcddll_vgsm_cause_value_enum vgsm_cause;
+ kal_uint8 back_off_timer_valP;
+ kal_uint8 no_back_off_timer_val;
+ //kal_uint8 back_off_timer_val[D_NO_BACK_OFF_TIMER_VAL];
+ vgsm_mcddll_back_off_timer_val_struct back_off_timer_val;
+ kal_uint8 eap_messageP;
+ kal_uint16 no_eap_message;
+ kal_uint8 eap_message[D_NO_EAP_MESSAGE];
+ kal_uint8 epcoP;
+ kal_uint16 no_epco;
+ kal_uint8 epco[D_NO_EPCO];
+} vgsm_mcddll_pdu_session_release_command_struct;
+
+
+typedef struct _vgsm_mcddll_pdu_session_release_complete_struct
+{
+ mcddll_EPD_value_enum ext_proto_discr;
+ mcddll_PDU_session_identity_value_enum psi;
+ mcddll_procedure_transaction_identity_enum pti;
+ mcddll_vgsm_msg_type_enum msg_type;
+ //New
+ kal_uint8 vgsm_causeP;
+ mcddll_vgsm_cause_value_enum vgsm_cause;
+ //End of NEw
+ kal_uint8 epcoP;
+ kal_uint16 no_epco;
+ kal_uint8 epco[D_NO_EPCO];
+} vgsm_mcddll_pdu_session_release_complete_struct;
+
+
+typedef struct _vgsm_mcddll_5gsm_status_struct
+{
+ mcddll_EPD_value_enum ext_proto_discr;
+ mcddll_PDU_session_identity_value_enum psi;
+ mcddll_procedure_transaction_identity_enum pti;
+ mcddll_vgsm_msg_type_enum msg_type;
+ mcddll_vgsm_cause_value_enum vgsm_cause;
+} vgsm_mcddll_5gsm_status_struct;
+
+kal_bool msg_peer_unpack_vgsm(const kal_uint8 * src, kal_uint16 src_size, kal_uint16 * dest_struct_id, void ** dest);
+
+#endif /* __FIVEG_NAS__ */
+
+#endif /*_MCDDLL_VGSM_GEN_PEER_H*/
diff --git a/mcu/protocol/interface/general/TS_36331_ASN1_Interface_plus.h b/mcu/protocol/interface/general/TS_36331_ASN1_Interface_plus.h
new file mode 100644
index 0000000..e74f832
--- /dev/null
+++ b/mcu/protocol/interface/general/TS_36331_ASN1_Interface_plus.h
@@ -0,0 +1,91 @@
+/*******************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+#ifndef _TS_36331_ASN1_INTERFACE_PLUS_H_
+#define _TS_36331_ASN1_INTERFACE_PLUS_H_
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#else
+
+typedef struct OCT_VARY_STR {
+ unsigned long octsLen;
+ unsigned char *octs;
+} OCT_VARY_STR;
+
+typedef struct NULL_SEQ {
+ unsigned char spare;
+} NULL_SEQ;
+
+typedef struct NULL_SET {
+ unsigned char spare;
+} NULL_SET;
+
+#endif
+
+typedef unsigned char BOOL_TYPE;
+typedef unsigned char NULL_TYPE;
+
+#if 0
+/* under construction !*/
+#ifndef D_36331_ASN1_TRUE
+/* under construction !*/
+#endif /* D_36331_ASN1_TRUE */
+#ifndef D_36331_ASN1_FALSE
+/* under construction !*/
+#endif /* D_36331_ASN1_FALSE */
+/* under construction !*/
+#else
+/* Value for "BOOL_TYPE" */
+#ifndef ASN1_TRUE
+#define ASN1_TRUE 1 /* Bit value */
+#endif /* ASN1_TRUE */
+#ifndef ASN1_FALSE
+#define ASN1_FALSE 0 /* Bit value */
+#endif /* ASN1_FALSE */
+#endif
+#endif
diff --git a/mcu/protocol/interface/general/TS_36331_ASN1_Internal.h b/mcu/protocol/interface/general/TS_36331_ASN1_Internal.h
new file mode 100644
index 0000000..21fbbbe
--- /dev/null
+++ b/mcu/protocol/interface/general/TS_36331_ASN1_Internal.h
@@ -0,0 +1,21 @@
+#ifndef _TS_36331_ASN1_INTERNAL_H_
+#define _TS_36331_ASN1_INTERNAL_H_
+
+/*********************** MESSAGE ID DEFINITION START ***************************/
+#define TS_36331_ASN1_BCCH_BCH_Message 70
+#define TS_36331_ASN1_BCCH_DL_SCH_Message 71
+#define TS_36331_ASN1_PCCH_Message 72
+#define TS_36331_ASN1_DL_CCCH_Message 73
+#define TS_36331_ASN1_DL_DCCH_Message 74
+#define TS_36331_ASN1_UL_CCCH_Message 75
+#define TS_36331_ASN1_UL_DCCH_Message 76
+#define TS_36331_ASN1_RRCConnectionReconfiguration 77
+#define TS_36331_ASN1_UECapabilityInformation 78
+#define TS_36331_ASN1_UE_EUTRA_Capability 79
+#define TS_36331_ASN1_VarMeasConfig 80
+#define TS_36331_ASN1_VarMeasReportList 81
+#define TS_36331_ASN1_VarShortMAC_Input 82
+#define TS_36331_ASN1_MCCH_Message 83
+#define TS_36331_ASN1_UECapabilityEnquiry 84
+/*********************** MESSAGE ID DEFINITION END ***************************/
+#endif
diff --git a/mcu/protocol/interface/general/TS_38331_ASN1_Internal.h b/mcu/protocol/interface/general/TS_38331_ASN1_Internal.h
new file mode 100644
index 0000000..48ae058
--- /dev/null
+++ b/mcu/protocol/interface/general/TS_38331_ASN1_Internal.h
@@ -0,0 +1,28 @@
+#ifndef _TS_38331_ASN1_INTERNAL_H_
+#define _TS_38331_ASN1_INTERNAL_H_
+
+/*********************** MESSAGE ID DEFINITION START ***************************/
+#define TS_38331_ASN1_DL_DCCH_Message 100
+#define TS_38331_ASN1_UL_DCCH_Message 101
+#define TS_38331_ASN1_MeasurementReport 102
+#define TS_38331_ASN1_RRCReconfiguration 103
+#define TS_38331_ASN1_RRCReconfigurationComplete 104
+#define TS_38331_ASN1_RadioBearerConfig 105
+#define TS_38331_ASN1_UE_MRDC_Capability 106
+#define TS_38331_ASN1_UE_NR_Capability 107
+#define TS_38331_ASN1_MeasResultSCG_Failure 108
+#define TS_38331_ASN1_BCCH_BCH_Message 109
+#define TS_38331_ASN1_BCCH_DL_SCH_Message 110
+#define TS_38331_ASN1_DL_CCCH_Message 111
+#define TS_38331_ASN1_PCCH_Message 112
+#define TS_38331_ASN1_UL_CCCH_Message 113
+#define TS_38331_ASN1_UL_CCCH1_Message 114
+#define TS_38331_ASN1_FreqBandList 115
+#define TS_38331_ASN1_SIB1 116
+#define TS_38331_ASN1_SystemInformation 117
+#define TS_38331_ASN1_UE_CapabilityRequestFilterNR 118
+#define TS_38331_ASN1_MTK_F40_UE_MRDC_Capability 119
+#define TS_38331_ASN1_MTK_F40_UE_NR_Capability 120
+
+/*********************** MESSAGE ID DEFINITION END ***************************/
+#endif /* _TS_38331_ASN1_INTERNAL_H_ */
diff --git a/mcu/protocol/interface/general/abs_time.h b/mcu/protocol/interface/general/abs_time.h
new file mode 100644
index 0000000..24986ff
--- /dev/null
+++ b/mcu/protocol/interface/general/abs_time.h
@@ -0,0 +1,82 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2012
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * abs_time.h
+ *
+ * Project:
+ * --------
+ * MOLY
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 08 18 2015 head.hsu
+ * [MOLY00137802] [MT6292] abs time global variable rename
+ *
+ *
+ ****************************************************************************/
+
+#ifndef ABS_TIME_INC
+#define ABS_TIME_INC
+
+#include "kal_public_api.h"
+
+typedef kal_uint64 ABS_TICK_TIME;
+
+typedef struct
+{
+ ABS_TICK_TIME sfTick;
+} g_abs_time_struct;
+
+/* L1core modules use */
+extern g_abs_time_struct g_abs_time; // EL1 modules
+extern kal_uint32 g_abs_time_diff; //The tick distance between previous and current interrupt: minimal value is 1
+
+/* Pcore modules use */
+extern g_abs_time_struct g_ps_abs_time; // RATDM, EMAC, EDYN, EL2 copro, L2TPS
+extern kal_uint32 l2_g_abs_time_diff; //The tick distance between previous and current interrupt: minimal value is 1
+#endif /* ----- #ifndef ABS_TIME_INC ----- */
diff --git a/mcu/protocol/interface/general/app2ircomm_struct.h b/mcu/protocol/interface/general/app2ircomm_struct.h
new file mode 100644
index 0000000..cc8612e
--- /dev/null
+++ b/mcu/protocol/interface/general/app2ircomm_struct.h
@@ -0,0 +1,81 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+ /*******************************************************************************
+ * Filename:
+ * ---------
+ * app2ircomm_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * Interface between IRCOMM and APP
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *==============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+#ifndef _APP2IRCOMM_STRUCT_H
+#define _APP2IRCOMM_STRUCT_H
+
+typedef struct
+{
+ kal_uint8 ref_count;
+ kal_uint16 msg_len;
+ kal_bool result;
+} ircomm_connect_rsp_struct;
+
+typedef struct
+{
+ kal_uint8 ref_count;
+ kal_uint16 msg_len;
+ kal_uint16 wait_duration;
+} ircomm_open_struct;
+
+#endif /* ~_APP2IRCOMM_STRUCT_H */
+
diff --git a/mcu/protocol/interface/general/app2saf_enums.h b/mcu/protocol/interface/general/app2saf_enums.h
new file mode 100644
index 0000000..5dcbb93
--- /dev/null
+++ b/mcu/protocol/interface/general/app2saf_enums.h
@@ -0,0 +1,112 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * app2saf_enums.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file contains the Enum for interface of APP and SAF.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *==============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+
+#ifndef _APP2SAF_ENUMS_H
+#define _APP2SAF_ENUMS_H
+
+/* Used to specify the NAT type */
+typedef enum
+{
+ SAF_OPEN_IP = 0, /* Open Internet */
+ SAF_UDP_BLOCKED, /* UDP Blocked */
+ SAF_FULL_CONE_NAT, /* Full cone */
+ SAF_RESTRICTED_CONE_NAT, /* Restricted cone */
+ SAF_PORT_RESTRICTED_CONE_NAT, /* Port restricted cone */
+ SAF_SYM_NAT, /* Symmetric NAT */
+ SAF_SYM_FIREWALL /* Symmetric Firewall*/
+} saf_nat_type_enum;
+
+/* Used to specify the result code of SAF operation */
+typedef enum
+{
+ SAF_OK=0, /* Operation Success */
+ SAF_NO_SERVER_ADDR, /* Server Address Error */
+ SAF_REQUEST_TIMEOUT, /* Request Timeout */
+ SAF_NO_PENDING_OP, /* No Pending Operation */
+ SAF_HAS_PENDING_OP, /* Has Pending Operation */
+ SAF_SOCKET_ERROR, /* Socket Error */
+ SAF_DNS_ERROR, /* DNS Error */
+ SAF_CHANNEL_NOT_EXIST, /* Channel Not Exist */
+ SAF_CHANNEL_EXIST, /* Channel Already Exist */
+ SAF_TOO_MANY_CHANNELS, /* Reach Max Number of Channels */
+ SAF_TOO_MANY_PENDING_OP, /* Reach Max Number of Operations */
+ SAF_RECV_BINDING_ERR_RSP, /* Recieve Error Binding Resp */
+ SAF_SOCKET_CANCEL_ACT_BEARER, /* Socket Cancel Activating Bearer */
+ SAF_UNSPECIFIED_ERROR /* General Error */
+} saf_result_enum;
+
+#endif /* _APP2SAF_ENUMS_H */
+
diff --git a/mcu/protocol/interface/general/app2saf_struct.h b/mcu/protocol/interface/general/app2saf_struct.h
new file mode 100644
index 0000000..b38e24b
--- /dev/null
+++ b/mcu/protocol/interface/general/app2saf_struct.h
@@ -0,0 +1,280 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * app2saf_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file describes the common struct of Applications and SAF.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *==============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+
+#ifndef _APP2SAF_STRUCT_H
+#define _APP2SAF_STRUCT_H
+
+#ifndef _SOC_API_H
+#error pls include soc_api.h before app2saf_struct.h
+#endif
+
+#define SAF_MAX_SERVER_LEN (64) /* server string length constraint */
+#define SAF_MAX_DERIVED_ADDR_NUM (2) /* number of derived addresses quering constraint */
+
+/* The structure for specified the derived address */
+typedef struct
+{
+ sockaddr_struct local_addr; /* local address */
+ sockaddr_struct derived_addr; /* derived address from stun server */
+} saf_addr_struct;
+
+/* Used to open the channel */
+typedef struct
+{
+ kal_uint8 ref_count;
+ kal_uint16 msg_len;
+
+ kal_uint32 data_account_id; /* selected dataaccount for opening channel */
+ kal_char stun_server[SAF_MAX_SERVER_LEN]; /* stun server (null terminated) */
+ kal_uint16 stun_port; /* stun port number */
+ kal_char turn_server[SAF_MAX_SERVER_LEN]; /* turn proto, not support yet */
+ kal_uint16 turn_port; /* turn proto, not support yet */
+} app_saf_open_channel_req_struct;
+
+/* Used for confirmation of OPEN_CHANNEL_REQ */
+typedef struct
+{
+ kal_uint8 ref_count;
+ kal_uint16 msg_len;
+
+ kal_uint8 result; /* saf_result_enum */
+ kal_uint32 error_cause; /* reserved, always return 0 now */
+ kal_uint8 channel_id; /* opened channel id */
+} app_saf_open_channel_cnf_struct;
+
+/* Used to abort OPEN_CHANNEL_REQ */
+typedef struct
+{
+ kal_uint8 ref_count;
+ kal_uint16 msg_len;
+
+} app_saf_abort_open_channel_req_struct;
+
+/* Used for confirmation of ABORT_OPEN_CHANNEL_REQ */
+typedef struct
+{
+ kal_uint8 ref_count;
+ kal_uint16 msg_len;
+
+ kal_uint8 result; /* saf_result_enum */
+ kal_uint32 error_cause; /* reserved, always return 0 now */
+} app_saf_abort_open_channel_cnf_struct;
+
+/* Used to close the channel */
+typedef struct
+{
+ kal_uint8 ref_count;
+ kal_uint16 msg_len;
+
+ kal_uint8 channel_id; /* specified channel id */
+} app_saf_close_channel_req_struct;
+
+/* Used for confirmation of CLOSE_CHANNEL_REQ */
+typedef struct
+{
+ kal_uint8 ref_count;
+ kal_uint16 msg_len;
+
+ kal_uint8 result; /* saf_result_enum */
+ kal_uint32 error_cause; /* reserved, always return 0 now */
+ kal_uint8 channel_id; /* specified channel id */
+} app_saf_close_channel_cnf_struct;
+
+/* Used to get the derived IP address and port number */
+typedef struct
+{
+ kal_uint8 ref_count;
+ kal_uint16 msg_len;
+
+ kal_uint8 channel_id; /* associated channel id */
+ kal_uint32 request_id; /* return same value in cnf */
+
+ kal_uint8 stun_addr_num; /* identify the number of addresses need to query */
+ kal_uint8 turn_addr_num; /* not support yet */
+} app_saf_get_derived_addr_req_struct;
+
+/* Used for confirmation of GET_DERIVED_ADDR_REQ */
+typedef struct
+{
+ kal_uint8 ref_count;
+ kal_uint16 msg_len;
+
+ kal_uint8 result; /* saf_result_enum */
+ kal_uint32 error_cause; /* reserved, always return 0 now */
+ kal_uint8 channel_id; /* associated channel id */
+ kal_uint32 request_id; /* same value in req */
+ saf_addr_struct stun_addr[SAF_MAX_DERIVED_ADDR_NUM]; /* associated stun address object array */
+ kal_uint8 stun_addr_num; /* identify number of objects in array */
+ saf_addr_struct turn_addr[SAF_MAX_DERIVED_ADDR_NUM]; /* turn proto, not support yet */
+ kal_uint8 turn_addr_num; /* turn proto, not support yet */
+} app_saf_get_derived_addr_cnf_struct;
+
+/* Used to abort GET_DERIVED_ADDR_REQ */
+typedef struct
+{
+ kal_uint8 ref_count;
+ kal_uint16 msg_len;
+
+ kal_uint8 channel_id; /* associated channel id */
+ kal_uint32 request_id; /* shall same as the one in req */
+
+} app_saf_abort_get_derived_addr_req_struct;
+
+/* Used for confirmation of ABORT_GET_DERIVED_ADDR_REQ */
+typedef struct
+{
+ kal_uint8 ref_count;
+ kal_uint16 msg_len;
+
+ kal_uint8 result; /* saf_result_enum */
+ kal_uint32 error_cause; /* reserved, always return 0 now */
+ kal_uint8 channel_id; /* shall same as the one in req */
+ kal_uint32 request_id; /* same value in req */
+
+} app_saf_abort_get_derived_addr_cnf_struct;
+
+/* Used to get the NAT type */
+typedef struct
+{
+ kal_uint8 ref_count;
+ kal_uint16 msg_len;
+
+ kal_uint8 channel_id; /* associated NAT type */
+
+ /* TRUE: SAF will report SAF_RESTRICTED_CONE_NAT directly and
+ will not perform further test for distinguishing
+ whether it is Restricted Cone or Port Restricted Cone.
+ This can save the discovery time. */
+ kal_bool not_care_port_restricted;
+
+} app_saf_get_nat_type_req_struct;
+
+/* Used for confirmation of GET_NAT_TYPE_REQ */
+typedef struct
+{
+ kal_uint8 ref_count;
+ kal_uint16 msg_len;
+
+ kal_uint8 result; /* saf_result_enum */
+ kal_uint32 error_cause; /* reserved, always return 0 now */
+ kal_uint8 channel_id; /* associated channel id */
+ kal_uint8 nat_type; /* saf_nat_type_enum */
+
+} app_saf_get_nat_type_cnf_struct;
+
+/* Used to get the NAT binding lifetime */
+typedef struct
+{
+ kal_uint8 ref_count;
+ kal_uint16 msg_len;
+
+ kal_uint8 channel_id; /* associated channel id */
+ kal_uint32 initial_trial_time; /* specifies the first lifetime SAF tried to test.
+ 0: by default, in second */
+ kal_uint32 max_trial_count; /* specifies the maximum of trials.
+ 0: by default */
+ kal_uint32 max_trial_duration; /* specifies the maximum of trial duration which application could endure.
+ 0: by default, in second */
+
+} app_saf_get_nat_binding_lifetime_req_struct;
+
+/* Used for confirmation of GET_NAT_BINDING_LIFETIME_REQ */
+typedef struct
+{
+ kal_uint8 ref_count;
+ kal_uint16 msg_len;
+
+ kal_uint8 result; /* saf_result_enum */
+ kal_uint32 error_cause; /* reserved, always return 0 now */
+ kal_uint8 channel_id; /* associated channel id */
+ kal_uint32 lifetime; /* in second */
+
+} app_saf_get_nat_binding_lifetime_cnf_struct;
+
+/* The abort get nat type request and abort get derived addr request share the same structs */
+typedef app_saf_abort_get_derived_addr_req_struct app_saf_abort_get_nat_type_req_struct;
+
+/* The abort get nat lifetime request and abort get derived addr request share the same structs */
+typedef app_saf_abort_get_derived_addr_req_struct app_saf_abort_get_nat_lifetime_req_struct;
+
+/* The abort get nat type confirm and abort get derived addr confirm share the same structs */
+typedef app_saf_abort_get_derived_addr_cnf_struct app_saf_abort_get_nat_type_cnf_struct;
+
+/* The abort get nat lifetime confirm and abort get derived addr confirm share the same structs */
+typedef app_saf_abort_get_derived_addr_cnf_struct app_saf_abort_get_nat_lifetime_cnf_struct;
+
+#endif /* _APP2SAF_STRUCT_H */
+
diff --git a/mcu/protocol/interface/general/as2mmi_struct.h b/mcu/protocol/interface/general/as2mmi_struct.h
new file mode 100644
index 0000000..0cfa156
--- /dev/null
+++ b/mcu/protocol/interface/general/as2mmi_struct.h
@@ -0,0 +1,138 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+ /*******************************************************************************
+ * Filename:
+ * ---------
+ * as2mmi_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * The structure definition between AS and MMI.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *==============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+
+#ifndef _AS2MMI_STRUCT_H
+#define _AS2MMI_STRUCT_H
+
+/* add RHR */
+#if 0
+/* under construction !*/
+#endif
+#include "kal_general_types.h"
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 rssi; /* received signal strength indication*/
+ kal_uint8 ber; /* dBm power*/
+ kal_uint8 current_band;
+} mmias_cell_power_level_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_pkt_transfer_mode; /* KAL_TRUE: in packet transfer mode, KAL_FALSE: not in packet transfer mode */
+} mmias_pkt_transfer_mode_ind_struct;
+
+typedef enum
+{
+ UAS_POWER_LEVEL_RSSI,
+ UAS_POWER_LEVEL_RSCP,
+ UAS_POWER_LEVEL_ECN0
+}uas_power_level_ind_type;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 rssi; /* received signal strength indication*/
+ kal_uint8 ber;
+ kal_uint8 signal_strength; /* signal bar display value for MMI*/
+} rac_uas_cell_power_level_ind_struct;
+
+#endif
+
diff --git a/mcu/protocol/interface/general/as2nas_struct.h b/mcu/protocol/interface/general/as2nas_struct.h
new file mode 100644
index 0000000..87b572f
--- /dev/null
+++ b/mcu/protocol/interface/general/as2nas_struct.h
@@ -0,0 +1,144 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * as2nas_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *============================================================================
+ ****************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _AS2NAS_STRUCT_H
+#define _AS2NAS_STRUCT_H
+
+#include "kal_general_types.h"
+#include "kal_public_defs.h"
+
+typedef struct
+{
+ module_type module_id; // Eric: module_id might be larger than U8, should align this structure with module_type
+ kal_uint8 peer_msg_id;
+ kal_uint8 trans_id;
+ // For MOD_SM, this trans_id field is not used as transaction id. MOD_SM uses left 4 bit as serial number, the right 4 bit is used as context_num.
+} peer_msg_id_struct;
+
+typedef struct
+{
+ kal_uint8 ref_count;
+ kal_uint16 msg_len;
+ kal_uint8 tx_status;
+ kal_uint16 seq_no;
+ peer_msg_id_struct peer_msg;
+#if defined(__GEMINI__)
+ kal_bool is_rr_in_suspend;
+#endif
+ kal_uint8 abm_trans_id;
+} as_nas_data_cnf_struct;
+
+/* Jeff Wu 2005-02-14 */
+typedef as_nas_data_cnf_struct llgmm_as_nas_data_cnf_struct;
+
+#endif //_AS2NAS_STRUCT_H
+
+
diff --git a/mcu/protocol/interface/general/as_access_sem_context.h b/mcu/protocol/interface/general/as_access_sem_context.h
new file mode 100644
index 0000000..08811cc
--- /dev/null
+++ b/mcu/protocol/interface/general/as_access_sem_context.h
@@ -0,0 +1,114 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * as_access_sem_context.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * semaphore context for AS
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *------------------------------------------------------------------------------
+ * $Log$
+ *
+ * 05 15 2018 chester-zd.huang
+ * [MOLY00326014] [Gen95][MSPM] SW changes check in UMOLYE
+ *
+ * -AS_ACCESS_SEM Callback Function
+ *
+ * 12 14 2010 nancy.chang
+ * removed!
+ * .
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ *
+ ******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _AS_ACCESS_SEM_CONTEXT_H_
+#define _AS_ACCESS_SEM_CONTEXT_H_
+
+#ifdef __GEMINI__
+
+/* Nancy 20101005: Suggest Add for RHR */
+#include "kal_public_defs.h"
+#include "kal_general_types.h"
+
+/*****************************************************************************
+ * Macros Without Parameters
+ *****************************************************************************/
+
+
+/*****************************************************************************
+ * Macros With Parameters
+ *****************************************************************************/
+
+
+/*****************************************************************************
+ * Enums without tags
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Declarations Of Exported Globals
+ *****************************************************************************/
+
+#endif /* __GEMINI__ */
+
+#endif /* _AS_ACCESS_SEM_CONTEXT_H_ */
diff --git a/mcu/protocol/interface/general/as_access_sem_funcs.h b/mcu/protocol/interface/general/as_access_sem_funcs.h
new file mode 100644
index 0000000..8a7730f
--- /dev/null
+++ b/mcu/protocol/interface/general/as_access_sem_funcs.h
@@ -0,0 +1,195 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * as_access_sem_funcs.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *------------------------------------------------------------------------------
+ * $Log$
+ *
+ * 05 15 2018 chester-zd.huang
+ * [MOLY00326014] [Gen95][MSPM] SW changes check in UMOLYE
+ *
+ * -AS_ACCESS_SEM Callback Function
+ *
+ * 08 18 2017 yuhhwang.yu
+ * [MOLY00271925] [SRLTE Enhancement][UMOLYA] RSVA code sync
+ * .
+ *
+ * 03 23 2017 farming.tseng
+ * [MOLY00228414] RSVAS dispatch suspend_req to EL2 in sequence
+ *
+ * .
+ *
+ * 11 19 2015 yuhhwang.yu
+ * [MOLY00148584] [RSVAS] add debug info for trace confirm primitive bitmask
+ * . add callback function to trace cnf bitmask
+ *
+ * 05 06 2014 chi-chung.lin
+ * [MOLY00064093] [LTE-Gemini][2G] Add TST inject code to force sleep in IR specific stage
+ * .
+ *
+ * 01 22 2014 maruco.tu
+ * [MOLY00054324] [4G Gemini][Merge] MOLY.MM.GEMINI.DEV Merge back to MOLY
+ * Merge LTE GEMINI to MOLY
+ *
+ * 06 17 2013 morton.lin
+ * [MOLY00026346] [Volunteer Patch] Fix syntax error while turning Gemini compile option ON
+ * Fix a syntax error because the original assigner who forgot to merge this.
+ *
+ * 01 23 2013 morton.lin
+ * [MOLY00009162] [Multimode][RRCE] Code merge back to MOLY
+ * Part 2 - Other common files for Multimode
+ *
+ * 06 13 2012 justin.li
+ * removed!
+ * .
+ *
+ * 05 09 2012 xuechao.wang
+ * removed!
+ * .
+ *
+ * 04 24 2012 wcpuser_integrator
+ * removed!
+ * .
+ *
+ * 04 13 2012 blanden.wen
+ * removed!
+ * .
+ *
+ * 06 03 2011 william.chang
+ * removed!
+ * .
+ *
+ * 05 10 2011 jingo.yeh
+ * removed!
+ * .
+ *
+ * 05 10 2011 william.chang
+ * removed!
+ * .
+ *
+ * 03 16 2011 peter.chien
+ * removed!
+ * .
+ *
+ * 12 14 2010 nancy.chang
+ * removed!
+ * .
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ *
+ ******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _AS_ACCESS_SEM_FUNCS_H_
+#define _AS_ACCESS_SEM_FUNCS_H_
+
+#ifdef __GEMINI__
+
+/* Nancy 20101005: Suggest Add for RHR */
+#include "rsvas_enum.h"
+#include "kal_public_defs.h" //MSBB change #include "stack_config.h"
+#include "kal_general_types.h"
+
+#ifndef _RSVAS_ENUM_H
+#error "`rsvas_enum.h' must be included before `as_access_sem_funcs.h'"
+#endif
+
+#include "as_access_sem_context.h"
+
+
+extern void as_check_cnf_bitmask(void);
+
+#ifdef __ETWS_SUPPORT__
+#if !defined(__MTK_TARGET__) && !defined(__UE_SIMULATOR__)
+extern void as_set_etws_owner(const rsvas_id_enum new_etws_owner);
+#endif
+#endif
+
+extern void rsvas_send_el2_suspend_sequence(kal_uint32 el2_task_suspend_squence);
+
+#if defined(__ETWS_SUPPORT__)||defined(__LTE_RAT__)
+extern kal_bool as_update_etws_channel_priority(const module_type mod_src, const rsvas_id_enum id, const kal_bool is_protect_req);
+
+extern rsvas_id_enum as_etws_owner_query(void);
+#endif /* __ETWS_SUPPORT__ || __LTE_RAT__*/
+
+
+#endif /* __GEMINI__ */
+
+#endif /* _AS_ACCESS_SEM_FUNCS_H_ */
+
diff --git a/mcu/protocol/interface/general/as_common.h b/mcu/protocol/interface/general/as_common.h
new file mode 100644
index 0000000..57620ee
--- /dev/null
+++ b/mcu/protocol/interface/general/as_common.h
@@ -0,0 +1,405 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * as_common.h
+ *
+ * Project:
+ * --------
+ * Maui
+ *
+ * Description:
+ * ------------
+ * Common header file for access stratum
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *============================================================================
+ ****************************************************************************/
+
+#ifndef __AS_COMMON_H__
+#define __AS_COMMON_H__
+
+/* INCLUDES ****************************************************************************/
+
+#include "task_config.h" //Alfie: added when porting with Karen's ask.
+#include "kal_public_api.h"
+/* TYPE DEFINITIONS ***************************************************************/
+
+#define U8 kal_uint8
+#define S8 kal_int8
+#define U16 kal_uint16
+#define S16 kal_int16
+#define U32 kal_uint32
+#define S32 kal_int32
+#define tBOOL kal_bool
+#define Bool kal_bool
+#define TIME_OF_DAY double
+
+#ifndef FALSE_E
+#define FALSE_E KAL_FALSE
+#endif
+
+#ifndef TRUE_E
+#define TRUE_E KAL_TRUE
+#endif
+
+#ifndef tMsg
+#define tMsg ilm_struct*
+#endif
+
+
+/* Vincent 051230: keep and reorder the enum value SUCCESS_E and FAILURE_E in avoid
+ * to confuse with the usage of kal_bool */
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+typedef enum
+{
+ FAILURE_E, /* generic failure */
+ SUCCESS_E /* Command completed without errors */
+} tReturnCode;
+
+/*****************************************************************************
+ Below enum is used for ELT tool to recognize MCDDLL supported version.
+ and ELT may use different in-tool decoder file
+ Only MCDDLL contact window and tool team can modify this enum
+******************************************************************************/
+
+typedef enum
+{
+ mcddll_f40 /* support ASN to 38.331 f40 version */
+} MCDDLL_File_Info;
+
+/* MACROS ******************************************************************************/
+
+#define BITS_PER_BYTE 8
+
+#ifdef MIN
+#undef MIN
+#endif
+#define MIN(A,B) (((A)<(B))?(A):(B))
+
+#ifdef MAX
+#undef MAX
+#endif
+#define MAX(A,B) (((A)>(B))?(A):(B))
+
+#define PUBLIC
+#define PRIVATE static
+
+#define NOT_USED(x) (void)(x)
+
+#define NOT_USED_FSM_PARAMETERS() \
+ (void)(tReceivedMsg); \
+ (void)(U32InterpretedEvent); \
+ (void)(pU32State); \
+ (void)(ptContext); \
+ (void)(pSaved); \
+ (void)(pReleaseMsg); \
+ (void)(isSavedEvent);
+
+#define SM_POPULATE_STATED_PROCESS(sm, offset, type) \
+ eSM_PopulateProcessServiceSM(&(sm), \
+ offset, \
+ NUM_STATES_ ## type, \
+ NUM_EVENTS_ ## type, \
+ a ## type ## _StateTable, \
+ (kal_int8*)""#type"")
+
+#define IS_VALID_ENTRY(checkParamPtr) \
+ (pContext != NULL) && (pState != NULL) && \
+ ((checkParamPtr) == KAL_TRUE ? (pContext->pvParams != NULL) : KAL_TRUE)
+
+
+/* Description: range checking macro. Test if v is between min and
+ max. Use this macro with contiguous enumerated types (see
+ IS_WEEKEND macro example in contract_programming.h). */
+/* Note: to avoid the following warning: comparison is always 1 due to limited
+ * range of data type. Don't use this IS_INRANGE just use (v <= max). */
+#define IS_INRANGE(v, min, max) ((min) <= (v) && (v) <= (max))
+
+/* Description: valid pointer type checking macro. Test if p is non
+ null pointer. Note: a valid pointer always points on allocated
+ memory. This is similar to the concept of references in C++. */
+#define IS_VALID_PTR(p) ((p) != NULL)
+
+#define IS_TBOOL(flag) ((flag == TRUE) || (flag == FALSE))
+
+#define TT_ENTRY_SIZE sizeof(tTranslateTableEntry)
+
+#define mSM_ENTRY_FN(x) kal_bool x(struct tContext* pContext, kal_uint32* pState)
+
+#define SM_PARAM(contextPtr, paramID) (contextPtr)->ptCC->aSCIParams[(paramID)].U32ParamValue
+
+//macro to initialise max process instance array
+#define INIT_MAX_INSTANCES(component, array, processCount) \
+ {int i; for(i = 0; i < (processCount); i++){(component)->aMaxInstanceArray[i]=((array)[i]);}(component)->aMaxInstanceArray[i] = (array)[i];}
+
+#define ALLOC_SEND_ILM(macro_src_mod, macro_dest_mod, macro_sap_id, macro_msg_id, macro_local_para_ptr, macro_peer_buff_ptr) \
+ msg_send6((macro_src_mod), (macro_dest_mod), (macro_sap_id), (macro_msg_id), (local_para_struct *)(macro_local_para_ptr), (peer_buff_struct *)(macro_peer_buff_ptr))
+
+#ifdef __MTK_TARGET__ //only target
+#define ALLOC_SEND_ILM_CC(macro_src_mod, macro_dest_mod, macro_sap_id, macro_msg_id, macro_local_para_ptr, macro_peer_buff_ptr) \
+ msg_send6_cc((macro_src_mod), (macro_dest_mod), (macro_sap_id), (macro_msg_id), (local_para_struct *)(macro_local_para_ptr), (peer_buff_struct *)(macro_peer_buff_ptr))
+#else //UT(including MoDIS IT) or NWSIM
+#define ALLOC_SEND_ILM_CC(macro_src_mod, macro_dest_mod, macro_sap_id, macro_msg_id, macro_local_para_ptr, macro_peer_buff_ptr) \
+ msg_send6((macro_src_mod), (macro_dest_mod), (macro_sap_id), (macro_msg_id), (local_para_struct *)(macro_local_para_ptr), (peer_buff_struct *)(macro_peer_buff_ptr))
+#endif /* __MTK_TARGET__ */
+
+/* Please notice that dhl_log_primitive6() will not free the local parameter and peer buffer, users should tack care about it by themself. */
+#define ALLOC_LOG_ILM(macro_src_mod, macro_sap_id, macro_msg_id, macro_local_para_ptr) \
+ dhl_log_primitive6((macro_src_mod), (MOD_DHL), (macro_sap_id), (macro_msg_id), (local_para_struct *)(macro_local_para_ptr), NULL)
+
+#define MSG_CAST(ptr, msg, cast); \
+ { \
+ ASSERT(msg->local_para_ptr != NULL); \
+ ptr = ( cast *)msg->local_para_ptr; \
+ }
+
+#define UPLANE_TSTAMP(x) //temporarily
+
+#define UPLANE_BENCHMARK_TSTAMP(x) //temporarily
+
+#define CONFORMANCE_TSTAMP(x) //temporarily
+
+#define tReturn(x); {if (x == SUCCESS_E) return KAL_TRUE; else return KAL_FALSE;}
+
+#define as_free_local_para_set_null(local_para) \
+do { free_local_para((local_para_struct *)(local_para)); (local_para)=NULL; } while(0)
+
+#define as_free_local_para_r_set_null(local_para) \
+do { free_local_para_r((local_para_struct *)(local_para)); (local_para)=NULL; } while(0)
+
+#define as_free_peer_buff_set_null(peer_buff) \
+do { free_peer_buff((peer_buff_struct *)(peer_buff)); (peer_buff)=NULL; } while(0)
+
+#define as_free_peer_buff_r_set_null(peer_buff) \
+do { free_peer_buff_r((peer_buff_struct *)(peer_buff)); (peer_buff)=NULL; } while(0)
+
+#define as_free_ctrl_buffer_set_null(ptr) \
+do { free_ctrl_buffer(ptr); (ptr)=NULL; } while(0)
+
+/* DHL api(dhl_internal_trace) parameter #2 is reserved, parameter #3 use MTK internal.
+ * Redefine for coding convenience.
+ */
+/*#define uas_internal_trace(trc_class, msg_index, ...) \
+dhl_internal_trace(trc_class, DHL_USER_FLAG_NONE, DHL_ACCESS_LEVEL_4_MTK_INTERNAL, \
+ msg_index, ##__VA_ARGS__)
+*/
+
+// modify for T+W Gemini
+typedef enum
+{
+ FDD_L3_SEQ_SELECTOR_INVALID = 0,
+ TDD_L3_SEQ_SELECTOR_INVALID = FDD_L3_SEQ_SELECTOR_INVALID,
+ FDD_L3_SEQ_SELECTOR_PRACHINFOLIST,
+ TDD_L3_SEQ_SELECTOR_PRACHINFOLIST = FDD_L3_SEQ_SELECTOR_PRACHINFOLIST,
+ FDD_L3_SEQ_SELECTOR_SCCPCHINFOLIST,
+ TDD_L3_SEQ_SELECTOR_SCCPCHINFOLIST = FDD_L3_SEQ_SELECTOR_SCCPCHINFOLIST
+
+#ifdef __UMTS_TDD128_MODE__
+ ,TDD_L3_SEQ_SELECTOR_PRACHINFOLCRLIST_R4
+ ,TDD_L3_SEQ_SELECTOR_SCCPCHINFOLCRLIST_R4_EXT
+#endif
+#ifdef __UMTS_R7__
+ , FDD_L3_SEQ_SELECTOR_SCCPCH_SystemInformation_MBMS_r7
+#endif
+}FDD_L3Decode_sequence_selector, TDD_L3Decode_sequence_selector;
+
+typedef struct
+{
+ FDD_L3Decode_sequence_selector decode_selector;
+ kal_int32 sequence_counter;
+ S16 cell_index; // shall be the same type as FDD_DBIdx & TDD_DBIdx
+ U8 sib_index; // shall be the same type as RRC_FDD_DB_SIB_Index & RRC_TDD_DB_SIB_Index
+ kal_bool is_uas_tdd128; // KAL_TRUE means used by TDD, KAL_FALSE means used by FDD
+}FDD_L3DecodeContext, FDD_L3EncodeContext, TDD_L3DecodeContext, TDD_L3EncodeContext;
+
+
+#endif //__AS_COMMON_H__
diff --git a/mcu/protocol/interface/general/asn_gen_include.h b/mcu/protocol/interface/general/asn_gen_include.h
new file mode 100644
index 0000000..2dd35b5
--- /dev/null
+++ b/mcu/protocol/interface/general/asn_gen_include.h
@@ -0,0 +1,91 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * asn_gen_include.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *============================================================================
+ ****************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+
+
+#ifndef _ASN_GEN_INCLUDE_H_
+#define _ASN_GEN_INCLUDE_H_
+
+extern void * (*malloc_fp)(unsigned int);
+extern void * rr_asn_realloc(void *, unsigned int, unsigned int);
+extern void (*free_fp)(void *);
+extern void *(*memset_fp)(void *, int, unsigned int);
+#endif
+
diff --git a/mcu/protocol/interface/general/asn_llc_peer.h b/mcu/protocol/interface/general/asn_llc_peer.h
new file mode 100644
index 0000000..6df07e9
--- /dev/null
+++ b/mcu/protocol/interface/general/asn_llc_peer.h
@@ -0,0 +1,117 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * asn_llc_peer.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ *
+ *
+ *==============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+
+/**************************************************************************
+ *
+ * FILE NAME: asn_llc_peer.h
+ * SYNOPSIS
+ *
+ *
+ */
+
+#ifndef _ASN_LLC_PEER_H_
+#define _ASN_LLC_PEER_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef TEST_TOOL
+#include "tt_defs.h"
+#else
+#include "kal_public_api.h"
+#endif
+#include "l3_inc.h"
+#include "llc_varstr.h"
+#include "llc_peer_interface.h"
+
+#include "asn_llc_peer_struct.h"
+#include "asn_llc_peer_pun.h"
+
+
+
+#ifdef TOOL
+#include "set_asn_llc_peer.h"
+#include "get_asn_llc_peer.h"
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+
diff --git a/mcu/protocol/interface/general/cc_ss_defs.h b/mcu/protocol/interface/general/cc_ss_defs.h
new file mode 100644
index 0000000..c2ca7df
--- /dev/null
+++ b/mcu/protocol/interface/general/cc_ss_defs.h
@@ -0,0 +1,213 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * cc_ss_defs.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file contains Macros related to CC SS.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *==============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _CC_SS_DEFS_H
+#define _CC_SS_DEFS_H
+
+/*****************
+Include Statements
+******************/
+
+#include "cc_defs.h"
+#include "cc_std_defs.h"
+//#include "kal_release.h"
+#include "kal_public_defs.h"
+
+/************************
+Macros Without Parameters
+*************************/
+#define CC_SS_INVALID_ORIGIN 0
+#define CC_SS_FROM_APP 1
+#define CC_SS_FROM_PEER 2
+
+/*-----------SS Operations----------------------------*/
+/*Remove SS_NONE since this value is defined for old DTMF design.*/
+//#define SS_NONE 0
+#define SS_PROCESS_UNSTRUCTURED_SS_REQUEST 59
+#define SS_UNSTRUCTURED_SS_REQUEST 60
+#define SS_UNSTRUCTURED_SS_NOTIFY 61
+#define SS_PROCESS_UNSTRUCTURED_SS_DATA 19
+#define SS_NOTIFY_SS 16
+#define SS_CALL_DEFLECTION 117
+#define SS_USER_USER_SERVICE 118
+#define SS_ACCESS_REGISTERCCENTRY 119
+#define SS_FORWARDCUG_INFO 120
+#define SS_SPLIT_MPTY 121
+#define SS_RETRIEVE_MPTY 122
+#define SS_HOLD_MPTY 123
+#define SS_BUILD_MPTY 124
+#define SS_FORWARD_CHARGE_ADVICE 125
+#define SS_EXPLICIT_CT 126
+
+/*-----------SS Operation Invoke Timeout Value-----------*/
+/* Timeout Value in Milli Secs */
+
+#define SS_INVOCATION_NOTIFY_TIMEOUT (3*KAL_TICKS_5_SEC)
+#define SS_PROCESS_UNSTRUCTURED_SS_DATA_TIMEOUT (3*KAL_TICKS_5_SEC)
+#define SS_PROCESS_UNSTRUCTURED_SS_REQUEST_TIMEOUT (2*KAL_TICKS_30_SEC)
+#define SS_UNSTRUCTURED_SS_REQUEST_TIMEOUT (2*KAL_TICKS_30_SEC)
+#define SS_UNSTRUCTURED_SS_NOTIFY_TIMEOUT (2*KAL_TICKS_30_SEC)
+#define SS_FORWARD_CHARGE_ADVICE_TIMEOUT KAL_TICKS_1_SEC
+#define SS_BUILD_MPTY_TIMEOUT (2*KAL_TICKS_5_SEC)
+#define SS_HOLD_MPTY_TIMEOUT (2*KAL_TICKS_5_SEC)
+#define SS_RETRIEVE_MPTY_TIMEOUT (2*KAL_TICKS_5_SEC)
+#define SS_SPLIT_MPTY_TIMEOUT (2*KAL_TICKS_5_SEC)
+#define SS_EXPLICIT_CT_TIMEOUT (3*KAL_TICKS_5_SEC)
+#define SS_ACCESS_REGISTERCCENTRY_TIMEOUT KAL_TICKS_30_SEC
+#define SS_CALL_DEFLECTION_TIMEOUT KAL_TICKS_30_SEC
+#define SS_USER_USER_SERVICE_TIMEOUT (2*KAL_TICKS_5_SEC)
+
+
+/*-----------Class of SS Operations-----------------------*/
+#define SS_CLASS_1 1
+#define SS_CLASS_2 2
+#define SS_CLASS_3 3
+#define SS_CLASS_4 4
+
+#define SS_PROTO_VER_2 ( kal_uint8 )0x00
+#define SS_PROTO_VER_3 ( kal_uint8 )0x01
+#define SS_ANY_PROTO_VER ( kal_uint8 )0xFF
+
+
+/*********************
+Macros With Parameters
+**********************/
+
+#define cc_reset_inv_fsm(ti, inv_index) \
+{ \
+ CC_CTAB_CONTEXT(cc_ti_info[CC_CTAB_CONTEXT(cc_ti_pool[ti].\
+ ti_info_index)] \
+ .inv[inv_index].state) = \
+ S_CC_INVOKE_IDLE; \
+}
+
+#endif /*_CC_SS_DEFS_H*/
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/mcu/protocol/interface/general/cipher2llc_struct.h b/mcu/protocol/interface/general/cipher2llc_struct.h
new file mode 100644
index 0000000..7612c93
--- /dev/null
+++ b/mcu/protocol/interface/general/cipher2llc_struct.h
@@ -0,0 +1,111 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * cipher2llc_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file describes the common struct of ciphering module and LLC.
+ *
+ * Author:
+ * -------
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _CIPHER2LLC_STRUCT_H
+#define _CIPHER2LLC_STRUCT_H
+
+#include "kal_general_types.h"
+
+typedef struct {
+ kal_uint16 no_input_buffer_ptr;
+ kal_uint16 input_buffer_ptr_size;
+ kal_uint8 *input_buffer_ptr;
+ kal_uint8 cipher_algo;
+ kal_uint8 status;
+ kal_uint8 no_usr_param_ptr;
+ kal_uint8 usr_param_ptr_size;
+ kal_uint8 *usr_param_ptr;
+} ll_cipher_rsp_struct;
+
+typedef struct {
+ kal_uint16 no_input_buffer_ptr;
+ kal_uint16 input_buffer_ptr_size;
+ kal_uint8 *input_buffer_ptr;
+ kal_uint8 cipher_algo;
+ kal_uint8 status;
+ kal_uint8 no_usr_param_ptr;
+ kal_uint8 usr_param_ptr_size;
+ kal_uint8 *usr_param_ptr;
+} ll_decipher_rsp_struct;
+#endif
+
+
diff --git a/mcu/protocol/interface/general/cm2csce_struct.h b/mcu/protocol/interface/general/cm2csce_struct.h
new file mode 100644
index 0000000..27c8971
--- /dev/null
+++ b/mcu/protocol/interface/general/cm2csce_struct.h
@@ -0,0 +1,111 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * cm2csce_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file is intends for structure definition between MM and CSCE layers.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *==============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+
+#ifndef _CM2CSCE_STRUCT_H
+#define _CM2CSCE_STRUCT_H
+
+#include "kal_general_types.h"
+#include "l3_inc_enums.h"
+#include "mmcm_enums.h"
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool ecc_start;
+} cmcsce_emergency_call_status_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+} cc_csce_tas_notify_ind_struct;
+#endif
+
+
diff --git a/mcu/protocol/interface/general/cm2mm_struct.h b/mcu/protocol/interface/general/cm2mm_struct.h
new file mode 100644
index 0000000..39ce407
--- /dev/null
+++ b/mcu/protocol/interface/general/cm2mm_struct.h
@@ -0,0 +1,193 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * cm2mm_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file is intends for structure definition between MM and CM layers.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *==============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+
+#ifndef _CM2MM_STRUCT_H
+#define _CM2MM_STRUCT_H
+
+#define MAX_SUPPORTED_CALLS 7
+
+#include "kal_general_types.h"
+#include "l3_inc_enums.h"
+#include "mmcm_enums.h"
+#include "kal_public_defs.h"
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 ti;
+ est_cause_enum cause;
+ kal_bool send_priority;
+ emlpp_priority_enum priority;
+ kal_bool need_preemption;
+ kal_bool is_ecall;
+ kal_uint8 ecall_type;
+} mmcm_est_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 ti;
+//#ifdef __UMTS_TDD128_MODE__
+ kal_bool force_release; /*For TDD call clearing optimization*/
+//#endif
+} mmcm_rel_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 ti;
+} mmcm_prompt_rsp_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ prompt_rej_cause reject_cause;
+} mmcm_prompt_rej_struct;
+
+#ifdef __REL6__
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 ti_count;
+ kal_uint8 ti_list[MAX_SUPPORTED_CALLS];
+} mmcc_reest_req_struct;
+#endif
+
+typedef struct {
+ LOCAL_PARA_HDR
+} mmcm_start_call_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+} mmcm_abort_call_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 ti_count;
+ kal_uint8 ti_list[MAX_SUPPORTED_CALLS];
+ kal_uint8 ecc_ti; /* if no ecc, this value should be 0xFF */
+} mmcc_srvcc_est_req_struct;
+
+typedef mmcm_est_req_struct mmcc_est_req_struct;
+typedef mmcm_rel_req_struct mmcc_rel_req_struct;
+typedef mmcm_prompt_rsp_struct mmcc_prompt_rsp_struct;
+typedef mmcm_prompt_rej_struct mmcc_prompt_rej_struct;
+
+typedef mmcm_est_req_struct mmss_est_req_struct;
+typedef mmcm_rel_req_struct mmss_rel_req_struct;
+
+typedef mmcm_est_req_struct mmsms_est_req_struct;
+typedef mmcm_rel_req_struct mmsms_rel_req_struct;
+
+#endif
+
+
diff --git a/mcu/protocol/interface/general/csr_fsm.h b/mcu/protocol/interface/general/csr_fsm.h
new file mode 100644
index 0000000..e8f0edc
--- /dev/null
+++ b/mcu/protocol/interface/general/csr_fsm.h
@@ -0,0 +1,633 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * csr_fsm.h
+ *
+ * Project:
+ * --------
+ * Monza
+ *
+ * Description:
+ * ------------
+ * This file is intends for CSR FSM.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *============================================================================
+ *******************************************************************************/
+/****************************************************************************
+ *
+ * Assignment : 3G Protocol Software
+ * CONFIDENTIAL
+ * Copyright (c) 2000-2005, UbiNetics Ltd. All rights reserved.
+ * Cambridge Technology Centre
+ * Melbourn Royston
+ * Herts SG8 6DP UK
+ * Tel: +44 1763 262222
+ *
+ ****************************************************************************
+ *
+ * COMPONENT: CSR
+ * MODULE: $RCSfile: rab.h,v $
+ * VERSION: $Revision: 1.2 $
+ * DATED: 2003/06/19 14:37:49 $
+ * AUTHOR: Kathiravan
+ *
+ * DESCRIPTION: CSR fsm
+ *
+ ****************************************************************************/
+#if !defined(CSR_FSM_H)
+#define CSR_FSM_H
+
+#include "kal_general_types.h"
+#include "kal_public_api.h"
+#include "ul2d_msgid.h"
+#include "as_common.h"
+#include "uas_common_struct.h"
+#include "ratcm_csr_struct.h"
+#include "uas_common_enums.h"
+#include "em_struct.h"
+#include "l1audio.h"
+#ifdef __VIDEO_CALL_SUPPORT__
+#include "TVT_callback.h"
+#endif
+
+/* MACROS *******************************************************************/
+#define MAX_NO_OF_SI 255
+#define UNKNOWN_AMR_FRAME_TYPE 0xff /* CSR internal use */
+#define MAX_NO_OF_CSR_ENTITY 6
+#define MAX_NO_OF_CSR_REACHED (MAX_NO_OF_CSR_ENTITY+1)
+#define CSR_ENTITY_NOT_FOUND (MAX_NO_OF_CSR_ENTITY+2)
+#define MAX_AMR_CLASS 3
+#define GetPos(low, high, pos) (pos = ((low+high)/2))
+#define INIT_CODEC_DATA(Codec_DataToSend) \
+{ \
+ Codec_DataToSend->AMRClass[0] = NULL; \
+ Codec_DataToSend->AMRClass[1] = NULL; \
+ Codec_DataToSend->AMRClass[2] = NULL; \
+}
+#define MAX_AMR_FRAME_SIZE 31
+#define CSR_CS_FCS_LEN 3
+#define CSR_CS_PDU_SIZE 72 /* RLP frame size */
+#define CSR_VT_PDU_SIZE 80 /* video call frame size */
+#define CSR_CS_TRA_PDU_SIZE 80 /* MAUI_02375911, 3G 64K Transparent CSD, add for sync-hdlc CSD */
+#define CSR_ASSERT(x) DEBUG_ASSERT(x)
+
+/* mtk02374 20110801 use CSR_NON_SPEECH_SERVICE to replace checking of services other than speech */
+#if defined(__VIDEO_CALL_SUPPORT__) || defined(__SYNC_HDLC_CSD__)
+#define CSR_NON_SPEECH_SERVICE
+#endif
+
+#ifdef __EM_MODE__
+#define FDD_SET_CSR_EM_NEED_UPDATE() FDD_CSREntityInfo.EmNeedUpdate = KAL_TRUE;
+#define FDD_RESET_CSR_EM_NEED_UPDATE() FDD_CSREntityInfo.EmNeedUpdate = KAL_FALSE;
+#define FDD_IS_CSR_EM_NEED_UPDATE() (FDD_CSREntityInfo.EmNeedUpdate)
+#define FDD_SET_CSR_EM_SRC(em_src) FDD_CSREntityInfo.EmSrc |= em_src;
+#define FDD_CLEAR_CSR_EM_SRC(em_src) FDD_CSREntityInfo.EmSrc &= ~em_src;
+#define FDD_RESET_CSR_EM_SRC() FDD_CSREntityInfo.EmSrc = CSR_EM_NONE;
+#define FDD_IS_CSR_EM_ENABLE() (FDD_CSREntityInfo.EmSrc != CSR_EM_NONE)
+#define FDD_IS_CSR_EM_DISABLE() (FDD_CSREntityInfo.EmSrc == CSR_EM_NONE)
+#define FDD_IS_CSR_UPDATE_EM_TO_ELT() (FDD_CSREntityInfo.EmSrc & CSR_EM_ELT)
+#define FDD_IS_CSR_UPDATE_EM_TO_AP() (FDD_CSREntityInfo.EmSrc & CSR_EM_AP)
+#endif
+
+/* FDD MACROS ***************************************************************/
+#define FDD_GetSizeofAMRClassA(FrameType,SizeOfClassA) (SizeOfClassA = (FDD_FrameTypeAndDataRate[FrameType].sizeOfClassA))
+#define FDD_GetSizeofAMRClassB(FrameType,SizeOfClassB) (SizeOfClassB = (FDD_FrameTypeAndDataRate[FrameType].sizeOfClassB))
+#define FDD_GetSizeofAMRClassC(FrameType,SizeOfClassC) (SizeOfClassC = (FDD_FrameTypeAndDataRate[FrameType].sizeOfClassC))
+#define FDD_CC_DEFAULT_STREAM_ID 1
+#define FDD_CSR_SEND_ILM(src_mod_id, dest_mod_id, msg_id, local_para_ptr, peer_buff_ptr) FDD_CsrSendIlm(src_mod_id, dest_mod_id, msg_id, (local_para_struct *)local_para_ptr, (peer_buff_struct *)peer_buff_ptr);
+#define FDD_mSET_SEND_CONFIG_MAPPING_IND(SendCfgReq) SendCfgReq = KAL_TRUE;
+#define FDD_mReSET_SEND_CONFIG_MAPPING_IND(SendCfgReq) SendCfgReq = KAL_FALSE;
+#define FDD_CSR_STATE_CHANGE(idx, newState) \
+ MD_TRC_FDD_CSR__CHANGE_STATE(idx, FDD_CSREntityInfo.CSRWorkSpace[idx]->CSRCurrentState, newState); \
+ FDD_CSREntityInfo.CSRWorkSpace[idx]->CSRCurrentState = newState;
+
+#define FDD_CSRENTITY_ACTIVE_SIM() (FDD_CSREntityInfo.activeSim)
+#define TDD_CSR_ACTIVE_SIM() (0)
+
+#ifdef __CSHSPA_SUPPORT__
+#define FDD_CSR_UL_AFM_OPT (AFM_OPT_ALIGN_ALLOC | AFM_OPT_DBG)
+#define FDD_CSR_UL_DATA_POOL_SIZE \
+ (AFM_POOL_OVERHEAD(FDD_CSR_UL_AFM_OPT , 1 ) \
+ + AFM_SUBPOOL_OVERHEAD(FDD_CSR_UL_AFM_OPT, (MAX_CS_DATA_SIZE + sizeof(SHAQ_csr_data_req_struct) + FDD_NUM_DRLC_UM_USER_RB_OFFSET + 4), MAX_CS_UL_MEM_NUM) + 64)
+#endif
+
+#ifdef __MTK_TARGET__
+#define FDD_CSR_LOG_FILE(a,b,c)
+#else
+#define FDD_CSR_LOG_FILE(a,b,c) FDD_CsrWriteLog(a,b,c)
+#endif
+
+/* TDD MACROS ***************************************************************/
+#define TDD_GetSizeofAMRClassA(FrameType,SizeOfClassA) (SizeOfClassA = (TDD_FrameTypeAndDataRate[FrameType].sizeOfClassA))
+#define TDD_GetSizeofAMRClassB(FrameType,SizeOfClassB) (SizeOfClassB = (TDD_FrameTypeAndDataRate[FrameType].sizeOfClassB))
+#define TDD_GetSizeofAMRClassC(FrameType,SizeOfClassC) (SizeOfClassC = (TDD_FrameTypeAndDataRate[FrameType].sizeOfClassC))
+#ifdef __MTK_TARGET__
+#define TDD_CSR_LOG_FILE(a,b,c)
+#else
+#define TDD_CSR_LOG_FILE(a,b,c) TDD_csr_write_log(a,b,c)
+#endif
+
+/* TYPES DEFINITIONS ********************************************************/
+typedef U8 AMRFrameType;
+
+typedef enum
+{
+ stCSR_INACTIVE,
+ stCSR_ACTIVE,
+ stCSR_WAIT_FOR_RAB_ESTABLISH,
+ stCSR_WAIT_FOR_RAB_MODIFY_OR_RELEASE,
+ stCSR_WAIT_FOR_ROUTING
+} tCSR_States;
+
+/* MAUI_02375904 */
+typedef enum
+{
+ RAB_ESTAB_CREATE_CSR_ENTITY_IF_NOT_FOUND,
+ SET_ROUTE_CREATE_CSR_ENTITY_IF_NOT_FOUND,
+ FIND_CSR_ENTITY_BY_RAB_ID,
+ FIND_CSR_ENTITY_BY_STREAM_ID
+} tCSR_Action;
+
+/* [MAUI_01663681] Add trace info for Speech Codec Type Reference TS26.103, Table 6.3-1 */
+typedef enum
+{
+ GSM_FR = 0, /* GSM Full Rate */
+ GSM_HR, /* GSM Half Rate */
+ GSM_EFR, /* GSM Enhanced Full Rate */
+ FR_AMR, /* Full Rate Adaptive Multi-Rate */
+ HR_AMR, /* Half Rate Adaptive Multi-Rate */
+ UMTS_AMR, /* UMTS Adaptive Multi-Rate */
+ UMTS_AMR_2, /* UMTS Adaptive Multi-Rate 2*/
+ TDMA_EFR, /* TDMA Enhanced Full Rate */
+ PDC_EFR, /* PDC Enhanced Full Rate */
+ FR_AMR_WB, /* Full Rate Adaptive Multi-Rate WideBand */
+ UMTS_AMR_WB, /* UMTS Adaptive Multi-Rate WideBand */
+ OHR_AMR, /* 8PSK Half Rate Adaptive Multi-Rate */
+ OFR_AMR_WB, /* 8PSK Full Rate Adaptive Multi-Rate WideBand */
+ OHR_AMR_WB, /* 8PSK Half Rate Adaptive Multi-Rate WideBand */
+ MuMe = 255 /* Reserved for MuMe dummy Codec Type, shall not to be used*/
+} tCSR_SpeechCodecType;
+
+/* MAUI_01966343 Note: Any modification of the enum shall sync with FrameTypeAndDataRate[] */
+typedef enum
+{
+ AMR_FRAME_4_75 = 0,
+ AMR_FRAME_5_15,
+ AMR_FRAME_5_90,
+ AMR_FRAME_6_70,
+ AMR_FRAME_7_40,
+ AMR_FRAME_7_95,
+ AMR_FRAME_10_2,
+ AMR_FRAME_12_2,
+ AMR_FRAME_SID,
+ AMR_FRAME_GSM_EFR_SID,
+ AMR_FRAME_TDMA_EFR_SID,
+ AMR_FRAME_PDC_EFR_SID,
+ RFU_AMR_FRAME_TYPE_12, //reserved for future use
+ RFU_AMR_FRAME_TYPE_13, //reserved for future use
+ RFU_AMR_FRAME_TYPE_14, //reserved for future use
+ AMR_FRAME_NO_DATA = 15,
+
+#ifdef __AMRWB_LINK_SUPPORT__
+ AMRWB_FRAME_6_60,
+ AMRWB_FRAME_8_85,
+ AMRWB_FRAME_12_65,
+ AMRWB_FRAME_14_25,
+ AMRWB_FRAME_15_85,
+ AMRWB_FRAME_18_25,
+ AMRWB_FRAME_19_85,
+ AMRWB_FRAME_23_05,
+ AMRWB_FRAME_23_85,
+ AMRWB_FRAME_SID,
+ //AMR WB frame type 10, reserved for future use
+ //AMR WB frame type 11, reserved for future use
+ //AMR WB frame type 12, reserved for future use
+ //AMR WB frame type 13, reserved for future use
+ //AMR WB frame type 14, speech lost, not used
+ //AMR WB frame type 15, No Data, use AMR_FRAME_NO_DATA for both NB and WB
+#endif /*__AMRWB_LINK_SUPPORT__ */
+
+ MAX_NO_OF_FRAME_TYPE, // 25
+ AMR_FRAME_TYPE_ALL_BARRED = 31
+} tAMRWB_FrameType;
+
+typedef enum
+{
+ stCSR_UNKNOWN_PHASE,
+ stCSR_ODD_FRAME,
+ stCSR_EVEN_FRAME
+} tCSR_CodecPhase;
+
+typedef struct
+{
+ U8 sizeOfAMRClass[MAX_AMR_CLASS];
+} Size_AMRClasses;
+
+#ifdef __AMRWB_LINK_SUPPORT__
+/* MAUI_01966343, requested subflow size may exceed 255 */
+typedef struct
+{
+ U16 sizeOfClassA;
+ U16 sizeOfClassB;
+ U16 sizeOfClassC;
+ U16 totalSize;
+} FrameType_DataRate;
+#else
+typedef struct
+{
+ U8 sizeOfClassA;
+ U8 sizeOfClassB;
+ U8 sizeOfClassC;
+ U8 totalSize;
+} FrameType_DataRate;
+#endif /* __AMRWB_LINK_SUPPORT__ */
+
+#ifdef __EM_MODE__
+typedef enum
+{
+ /* EM disable */
+ CSR_EM_NONE = 0x0,
+ /* bit 1: update to ELT */
+ CSR_EM_ELT = 0x1,
+ /* bit 2: update to AP */
+ CSR_EM_AP = 0x2
+} tCSR_UpdateEmSource;
+#endif
+
+typedef struct
+{
+ /* RAB id */
+ U8 CSREntityId;
+
+ /* Stream id */
+ U8 StreamId;
+ tCSR_States CSRCurrentState;
+ tCSR_TargetEntity CSRTargetEntity;
+ U8 CSRRabMode;
+
+ /* MAUI_02375904 */
+
+ /* number of RB */
+ U8 NumRBs;
+ /* RB IDs */
+ U8 RB[MAX_RBS_IN_RAB];
+ U8 RBWithStatus;
+ /* SDU of each RB */
+ U16 ReqSizeOfRBs[MAX_RBS_IN_RAB];
+
+ /* ~MAUI_02375904 */
+
+ U16 dataLength;
+ U8* dlPdu;
+
+ /* Current CodecType */
+ tCSR_SpeechCodecType CodecType;
+ tCSR_CodecPhase CodecPhase;
+
+ /* Current UL Codec Data Rate */
+ AMRFrameType CurCodec;
+ U8 maxCsDelay;
+ U8 prevRxNWDelay;
+
+ /* RLC TM segment config of each RB */
+ kal_bool ulRLCSegment[MAX_RBS_IN_RAB];
+
+ /* Current DL Codec Data Rate */
+ AMRFrameType CurDLCodec;
+} aCSRContext;
+
+typedef struct
+{
+ U8 activeSim; /* for L+W GEMINI, 0:SIM1, 1:SIM2; for single SIM, it will be always 0 */
+ U8 NoOfCSREntityExist;
+ KAL_AFM_ID afm_id;
+ aCSRContext *CSRWorkSpace[MAX_NO_OF_CSR_ENTITY];
+#ifdef __EM_MODE__
+ kal_bool is_EM_activate;
+ U8 EmSrc; /* The bitmap whom CSR need to update EM information to */
+ kal_bool EmNeedUpdate;
+#endif /* __EM_MODE__ */
+} aCSREntityInfo;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ U8 streamId;
+ U8 frameType;
+ U8 data[MAX_AMR_FRAME_SIZE];
+} csr_amr_data_ind_struct;
+
+typedef enum
+{
+ CSR_ILM_INVALID,
+ CSR_ILM_ACCEPT,
+ CSR_ILM_IGNORE
+} tCSR_GeminiIlmCheck;
+
+typedef enum
+{
+ stCSR_UL_FRAME,
+ stCSR_DL_FRAME
+} tCSR_FrameDirect;
+
+/* GLOBAL VARIABLE DECLARATIONS *********************************************/
+extern aCSREntityInfo FDD_CSREntityInfo;
+
+/* PUBLIC FUNCTION PROTOTYPES ***********************************************/
+/* FDD Functions ************************************************************/
+extern void FDD_CsrInitCSREntityInfo(void);
+extern void FDD_CsrResetCSREntityInfo(void);
+extern void FDD_CsrProcessCCUCSRSetRoutingReq(ilm_struct *RcvMsg);
+extern void FDD_CsrProcessCCSRRabEstablishInd(ilm_struct *RcvMsg);
+extern void FDD_CsrProcessCCSRRabModifyInd(ilm_struct *RcvMsg);
+extern void FDD_CsrProcessCCSRRabReleaseInd(ilm_struct *RcvMsg);
+extern void FDD_CsrProcessCSRUmacTfcInd(ilm_struct *RcvMsg);
+extern void FDD_CsrProcessCSRStatusInd(ilm_struct *RcvMsg);
+extern void FDD_CSR_SP3G_Callback(SP3G_Event event, void *data);
+extern void FDD_CsrProcessTstInjectMsg(ilm_struct *RcvMsg);
+
+#ifdef __CSHSPA_SUPPORT__
+extern void SP3GHSPA_UL_GetSpeechFrame(kal_uint8 *frame_type, kal_uint8 *rab_byte_array, kal_uint8 *len);
+extern void SP3GHSPA_DL_PutSpeechFrame(kal_uint32 CFN, kal_uint8 frame_type, kal_bool crc_status, kal_uint8 *subflow);
+extern void SP3GHSPA_DL_SetMaxCsDelay(kal_uint8 max_cs_delay);
+#endif
+
+#ifdef __RATDM_UL_SHAQ__
+extern void FDD_CsrFreeTmElmt(kal_uint8 *addr);
+#ifdef __CSHSPA_SUPPORT__
+extern void FDD_CsrFreeUmElmt(kal_uint8 *addr);
+#endif
+#endif
+
+#if 0
+#ifdef __3G_NEW_CS_DL_ARCH__
+/* under construction !*/
+#else
+/* under construction !*/
+#endif
+#endif
+
+#ifdef __VIDEO_CALL_SUPPORT__
+extern void FDD_vt_csr_activate_req(void);
+extern void FDD_vt_csr_deactivate_req(void);
+#endif
+
+#if defined(__GEMINI__) && defined(__GEMINI_WCDMA__)
+extern tCSR_GeminiIlmCheck FDD_CsrGeminiGuardIlm(ilm_struct *ilm_ptr);
+#endif
+
+#ifdef __EM_MODE__
+extern void FDD_CsrProcessL4CpsEMUpdateReq(ilm_struct *ilm_ptr);
+#endif
+
+#ifndef __MTK_TARGET__
+extern void FDD_CsrProcessCSRUnitTestMsg(ilm_struct *RcvMsg);
+#endif
+
+/* TDD Functions ***********************************************************/
+extern void TDD_InitCSREntityInfo(void);
+extern void TDD_ResetCSREntityInfo(void);
+extern U8 TDD_GetCSRWorkSpace(U8 CSRId, U8 action);
+extern void TDD_ProcessCCUCSRSetRoutingReq(ilm_struct *RcvMsg);
+extern void TDD_ProcessCCSRRabEstablishInd(ilm_struct *RcvMsg);
+extern void TDD_ProcessCCSRRabModifyInd(ilm_struct *RcvMsg);
+extern void TDD_ProcessCCSRRabReleaseInd(ilm_struct *RcvMsg);
+extern void TDD_ProcessUCSDDataReq(ilm_struct* RcvMsg);
+extern void TDD_ProcessCSRUmacTfcInd(ilm_struct *RcvMsg);
+extern void TDD_ProcessCSRStatusInd(ilm_struct* RcvMsg);
+
+#ifdef __VIDEO_CALL_SUPPORT__
+extern void TDD_vt_csr_activate_req(void);
+extern void TDD_vt_csr_deactivate_req(void);
+#endif
+
+#ifdef __EM_MODE__
+extern void TDD_ProcessL4CpsEMUpdateReq(ilm_struct *ilm_ptr);
+#endif
+
+void TDD_UpdateCodecToEmInfo(tCSR_FrameDirect dir, U8 frameType);
+extern void TDD_ProcessPLAUUSAUDConfigMappingInd(ilm_struct *RcvMsg);
+extern void TDD_ProcessPLAUUSAUDConfigMappingCnf(ilm_struct *RcvMsg);
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+#endif
+
+extern void TDD_ProcessUUSAUDCoderDataCnf(ilm_struct *RcvMsg);
+
+#ifndef __MTK_TARGET__
+extern void TDD_ProcessCSRUnitTestMsg(ilm_struct *RcvMsg);
+#endif
+
+extern kal_uint8 FDD_CSR_GetActiveSIM(void);
+
+
+#endif /* CSR_FSM_H */
diff --git a/mcu/protocol/interface/general/cval_ratdm_struct.h b/mcu/protocol/interface/general/cval_ratdm_struct.h
new file mode 100644
index 0000000..fabd8a3
--- /dev/null
+++ b/mcu/protocol/interface/general/cval_ratdm_struct.h
@@ -0,0 +1,102 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * cval_ratdm_struct.h
+ *
+ * Project:
+ * --------
+ *
+ *
+ * Description:
+ * ------------
+ * This file is the interface between CVAL and RATDM_C2K for C2K PDN control
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ ******************************************************************************/
+
+#ifndef _CVAL_RATDM_STRUCT_H
+#define _CVAL_RATDM_STRUCT_H
+
+#include "kal_general_types.h"
+#include "kal_public_defs.h"
+/* for rat_enum */
+#include "l3_inc_enums_public.h"
+
+/** CVAL activate RATDM C2K request
+ * This primitive is sent from CVAL to RATDM to activate RATDM C2K
+ * Message is MSG_ID_CVAL_RATDM_ACTIVATE_REQ
+ */
+typedef struct
+{
+ /** ILM specific header. */
+ LOCAL_PARA_HDR
+
+ /** EPS bearer ID, ranged in [RATDM_MIN_NSAPI_C2K: RATDM_MAX_NSAPI_C2K] which is [16:23] */
+ kal_uint8 ebi;
+ /** C2K air interface PDN ID, ranged in [0,14] */
+ kal_uint8 c2k_air_pdn_id;
+}cval_ratdm_activate_req_struct;
+
+/** CVAL deactivate RATDM C2K request
+ * This primitive is sent from CVAL to RATDM to deactivate RATDM C2K
+ * Message is MSG_ID_CVAL_RATDM_DEACTIVATE_REQ
+ */
+typedef struct {
+ /** ILM specific header. */
+ LOCAL_PARA_HDR
+
+ /** EPS bearer ID, ranged in [RATDM_MIN_NSAPI_C2K: RATDM_MAX_NSAPI_C2K] which is [16:23] */
+ kal_uint8 ebi;
+} cval_ratdm_deactivate_req_struct;
+
+/** CVAL notify RATDM C2K current rat mode setting request
+ * This primitive is sent from CVAL to RATDM to notify RATDM C2K current rat mode setting
+ * Message is MSG_ID_CVAL_RATDM_SET_RAT_MODE_REQ
+ */
+typedef struct {
+ /** ILM specific header. */
+ LOCAL_PARA_HDR
+
+ /** rat mode */
+ rat_enum rat_mode;
+} cval_ratdm_set_rat_mode_req_struct;
+
+#endif /* _CVAL_RATDM_STRUCT_H */
diff --git a/mcu/protocol/interface/general/data_plane2sm_struct.h b/mcu/protocol/interface/general/data_plane2sm_struct.h
new file mode 100644
index 0000000..b4c4af1
--- /dev/null
+++ b/mcu/protocol/interface/general/data_plane2sm_struct.h
@@ -0,0 +1,117 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * data_plane2sm_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file is intends for structure definition between data plane and SM.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *============================================================================
+ ****************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _DATA_PLANE2SM_STRUCT_H
+#define _DATA_PLANE2SM_STRUCT_H
+
+#include "kal_public_defs.h"
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 nsapi;
+} snsm_activate_rsp_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 no_of_valid_entries;
+ kal_uint8 nsapi_list[11];
+} snsm_deactivate_rsp_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 nsapi;
+} snsm_modify_rsp_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 no_of_valid_entries;
+ kal_uint8 nsapi_list[11];
+ kal_uint8 sequence_list[11];
+} snsm_sequence_rsp_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 nsapi;
+ kal_uint16 cause;
+} snsm_status_req_struct;
+#endif
+
+
diff --git a/mcu/protocol/interface/general/data_plane_sm_enums.h b/mcu/protocol/interface/general/data_plane_sm_enums.h
new file mode 100644
index 0000000..7563cc0
--- /dev/null
+++ b/mcu/protocol/interface/general/data_plane_sm_enums.h
@@ -0,0 +1,100 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * data_plane_sm_enums.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file contains enum definition between data plane and SM.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *============================================================================
+ ****************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+
+#ifndef _RABMSM_INTERFACE_H_
+#define _RABMSM_INTERFACE_H_
+
+typedef enum
+{
+ LOCAL_DEACTIVATION,
+ PEER_DEACTIVATION
+}rabmsm_cause_enum;
+
+typedef enum
+{
+ ACTIVATION_PROCEDURE = 0,
+ MODIFICATION_PROCEDURE
+}sm_process_enum;
+
+typedef enum
+{
+ RABM_INSUFF_RESOURCE = 0,
+ RABM_ERR_IND,
+ RABM_REEST_IND,
+ RABM_ABORT_IND
+}rabmsm_status_cause_enum;
+
+#endif
+
+
diff --git a/mcu/protocol/interface/general/data_xid.h b/mcu/protocol/interface/general/data_xid.h
new file mode 100644
index 0000000..85e8ce1
--- /dev/null
+++ b/mcu/protocol/interface/general/data_xid.h
@@ -0,0 +1,104 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * data_xid.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file is for L2R XID usage.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *============================================================================
+ ****************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+
+#ifndef _DATA_XID_H_
+#define _DATA_XID_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef TEST_TOOL
+#include "tt_defs.h"
+#else
+#include "kal_public_api.h"
+#endif
+
+//#include "csm_data_enums.h"
+#include "data_xid_struct.h"
+
+#ifdef TOOL
+#include "set_data_xid.h"
+#include "get_data_xid.h"
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+
diff --git a/mcu/protocol/interface/general/ddm_nwsel_struct.h b/mcu/protocol/interface/general/ddm_nwsel_struct.h
new file mode 100644
index 0000000..a9b239c
--- /dev/null
+++ b/mcu/protocol/interface/general/ddm_nwsel_struct.h
@@ -0,0 +1,112 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * DDM_NWSEL_STRUCT.H
+ *
+ * Project:
+ * --------
+ *
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ *
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ *
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *============================================================================
+ ****************************************************************************/
+
+#ifndef DDM_NWSEL_STRUCT_H
+#define DDM_NWSEL_STRUCT_H
+
+/* enum */
+//#include "ps_public_enum.h"
+
+typedef enum {
+ DDM_NWSEL_DETACH_CAUSE_NONE,
+ DDM_NWSEL_DETACH_CAUSE_NO_ACTION,
+}ddm_nwsel_detach_cause_enum;
+
+/* struct */
+#include "kal_public_defs.h"
+//#include "mcd_l3_inc_struct.h"
+
+/** MOD_DDM -> MOD_NWSEL: DDM responds if need to PS detach to NWSEL.
+ * Design assumption
+ * =================
+ * - DDM responds if need to perform PS detach after DDM receives MSG_ID_DDM_NWSEL_EUTRAN_DISABLE_CHECH_IND.
+ * - If no need to perform PS detach, DDM will bring the cause for NWSEL. NWSEL will decide whether to disable EUTRAN immediately or not.
+ *
+ * How to use
+ * ==========
+ * - 1: When NWSEL receives this message, NWSEL judge if need to deactivate LTE and search 2/3G immediately.
+ */
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_ps_detach_needed;
+ ddm_nwsel_detach_cause_enum cause;
+
+} ddm_nwsel_eutran_disable_check_rsp_struct;
+
+#endif /* DDM_NWSEL_STRUCT_H */
diff --git a/mcu/protocol/interface/general/divider_public.h b/mcu/protocol/interface/general/divider_public.h
new file mode 100644
index 0000000..6a69896
--- /dev/null
+++ b/mcu/protocol/interface/general/divider_public.h
@@ -0,0 +1,127 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * divider_public.h
+ *
+ * Project:
+ * --------
+ * Maui_Software
+ *
+ * Description:
+ * ------------
+ * This file is for the public access for HW divider accelerator operation.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *============================================================================
+ ****************************************************************************/
+
+#ifndef DIVIDER_PUBLIC_H
+#define DIVIDER__PUBLIC_H
+
+#include "kal_general_types.h"
+
+#ifdef __HW_DIVIDER__
+
+#define DIV_CONTROL_SIGNED_QUOTIENT_NONCONST 0x60000011
+#define DIV_CONTROL_SIGNED_REMAINDER_NONCONST 0x80000011
+
+#define DIV_CONTROL_UNSIGNED_QUOTIENT_NONCONST 0x60000001
+#define DIV_CONTROL_UNSIGNED_REMAINDER_NONCONST 0x80000001
+
+#define DIVIDE(a, b) (Divider_ON_OFF(a, b, DIV_CONTROL_SIGNED_QUOTIENT_NONCONST))
+#define MODULO(a, b) (Divider_ON_OFF(a, b, DIV_CONTROL_SIGNED_REMAINDER_NONCONST))
+
+extern kal_uint32 Divider_ON_OFF(kal_uint32 divident, kal_uint32 divisor, kal_uint32 div_control);
+
+//; return kal_uint32: =Quotient if ((div_control>>27)==0x0C)
+//; =Remainder if ((div_control>>27)==0x10)
+//; For signed operation, if ((div_control & 0x00000010)==0x10), and input divident,
+//; divisor, return value are all signed.
+//; For unsigned operation, if ((div_control & 0x00000010)==0).
+//; div_control=0x60000011 for signed, non-const operation, return signed quotient.
+//; div_control=0x80000011 for signed, non-const operation, return signed remainder.
+//; div_control=0x60000001 for unsigned, non-const operation, return unsigned quotient.
+//; div_control=0x80000001 for unsigned, non-const operation, return unsigned remainder.
+
+#else
+
+#define DIVIDE( a, b ) ((a)/(b))
+#define MODULO( a, b ) ((a)%(b))
+
+#endif
+
+#endif
+
diff --git a/mcu/protocol/interface/general/eas_rsva_struct.h b/mcu/protocol/interface/general/eas_rsva_struct.h
new file mode 100644
index 0000000..0cf58f6
--- /dev/null
+++ b/mcu/protocol/interface/general/eas_rsva_struct.h
@@ -0,0 +1,103 @@
+/*******************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*******************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * eas_rsva_struct.h
+ *
+ * Project:
+ * --------
+ * LTE Gemini
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ ******************************************************************************/
+#ifndef _EAS_RSVA_STRUCT_H_
+#define _EAS_RSVA_STRUCT_H_
+
+#include "l3_inc_enums.h"
+#include "kal_general_types.h"
+
+#if defined(__GEMINI__) && defined(__LTE_RAT__)
+
+/*----------------------------------------------------------------------------*/
+/* EAS (ERRC-CEL) to RSVA (RSVAE) */
+/*----------------------------------------------------------------------------*/
+
+typedef struct {
+ LOCAL_PARA_HDR
+ eas_freq_scan_type_enum freq_scan_type;
+ kal_bool is_full_band;
+ kal_uint8 sid; /* session id */
+}eas_rsvae_frequency_scan_start_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ eas_freq_scan_stop_cause_enum cause;
+ /* preemption session id, only used when cause=EAS_FREQ_SCAN_PREEMPTED */
+ /* always release the resource when cause=EAS_FREQ_SCAN_FINISHED */
+ kal_uint8 sid;
+}eas_rsvae_frequency_scan_stop_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ eas_freq_scan_type_enum freq_scan_type;
+ kal_bool is_full_band;
+ kal_uint8 sid; /* session id */
+}eas_rsvae_frequency_scan_modify_req_struct;
+
+/*----------------------------------------------------------------------------*/
+/* RSVA (RSVAE) to EAS (ERRC-CEL) */
+/*----------------------------------------------------------------------------*/
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 sid; /* session id */
+}rsvae_eas_frequency_scan_accept_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 sid; /* preemption session id */
+}rsvae_eas_frequency_scan_preempt_ind_struct;
+
+#endif /* if defined(__GEMINI__) && defined(__LTE_RAT__) */
+#endif /* _EAS_RSVA_STRUCT_H_ */
diff --git a/mcu/protocol/interface/general/emm_public_struct.h b/mcu/protocol/interface/general/emm_public_struct.h
new file mode 100644
index 0000000..4aff6e3
--- /dev/null
+++ b/mcu/protocol/interface/general/emm_public_struct.h
@@ -0,0 +1,108 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+#ifndef EMM_PUBLIC_STRUCT_H
+#define EMM_PUBLIC_STRUCT_H
+
+#include "kal_public_api.h"
+#include "ps_public_struct.h"
+#include "mcd_vgmm_gen_peer.h"
+#include "l3_inc_local.h"
+
+
+/********************************************
+ * MACROS *
+ ********************************************/
+
+
+/********************************************
+ * TYPE DEFINITIONS & ENUMS *
+ ********************************************/
+#define D_EMM_INTEGRITY_TAU_MAX_LEN 30 //*< TAU NAS message (Mandatory IE only) for N1 mode only + Security header
+
+typedef struct
+{
+ /* key set id and selected security algorithms */
+ kal_bool eksi_present;
+ nas_ksi_struct eksi;
+ kal_uint8 selected_alg;
+
+ /* the uplink NAS count */
+ kal_bool nas_count_present;
+ kal_uint32 nas_count;
+
+ /* make mapped GUTI*/
+ kal_bool guti_present;
+ guti_struct guti;
+
+ /* for interworking E2V */
+ kal_bool kasme_present;
+ kal_uint8 kasme[KASME_NUM];
+} emm_public_context_struct;
+
+typedef struct
+{
+
+ /* TAU for VGMM NAS Message Container IE, only valid in HO procedure (between RAT_CHANGE_START->FINISH) */
+ kal_bool tau_msg_present;
+ kal_uint16 tau_msgl;
+ kal_uint8 tau_msg[D_EMM_INTEGRITY_TAU_MAX_LEN];
+
+ /* errc irat nas transparent containert, store errc irat containert sharing for VGMM until 4G5 procedure finish */
+ irat_container_errc_to_emm_struct irat_container;
+} emm_public_irat_context_struct;
+
+
+typedef struct
+{
+
+ /* Generic EMM public context */
+ emm_public_context_struct emm_public_ctxt;
+
+ /* irat related EMM public context, highly dependency with IRAT/Interworking procedure and reset when EMM received FINISH_IND */
+ emm_public_irat_context_struct emm_public_irat_ctxt;
+
+} emm_public_context_pool_struct;
+
+
+/********************************************
+ * VARIABLES *
+ ********************************************/
+
+/********************************************
+ * FUNCTION DECLARATIONS *
+ ********************************************/
+
+#endif /* EMM_PUBLIC_STRUCT_H */
diff --git a/mcu/protocol/interface/general/emm_public_utility.h b/mcu/protocol/interface/general/emm_public_utility.h
new file mode 100644
index 0000000..0555d4e
--- /dev/null
+++ b/mcu/protocol/interface/general/emm_public_utility.h
@@ -0,0 +1,69 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+#ifndef EMM_PUBLIC_UTILITY_H
+#define EMM_PUBLIC_UTILITY_H
+
+#include "kal_public_api.h"
+#include "ps_public_struct.h"
+#include "emm_public_struct.h"
+#include "irat_common_struct.h"
+
+/********************************************
+ * MACROS *
+ ********************************************/
+
+
+/********************************************
+ * TYPE DEFINITIONS & ENUMS *
+ ********************************************/
+
+
+/********************************************
+ * VARIABLES *
+ ********************************************/
+
+/********************************************
+ * FUNCTION DECLARATIONS *
+ ********************************************/
+extern kal_bool emm_get_public_context(emm_public_context_struct *ctxt_p);
+extern kal_bool emm_get_public_irat_context(emm_public_irat_context_struct *ctxt_p);
+extern kal_bool emm_get_5g4_ho_info(protocol_id_enum ps_id, irat_container_emm_to_errc_struct *emm_info_ptr);
+extern kal_bool emm_set_4g5_security_param(protocol_id_enum ps_id, irat_container_errc_to_emm_struct *param_ptr);
+extern kal_bool is_emm_deregistered(kal_uint8 ps_idx);
+extern kal_uint32 emm_get_t3411_remaining_time_for_ps(kal_uint8 ps_idx);
+
+
+#endif /* EMM_PUBLIC_UTILITY_H */
diff --git a/mcu/protocol/interface/general/esm_ratdm_struct.h b/mcu/protocol/interface/general/esm_ratdm_struct.h
new file mode 100644
index 0000000..95401e9
--- /dev/null
+++ b/mcu/protocol/interface/general/esm_ratdm_struct.h
@@ -0,0 +1,380 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * esm_ratdm_struct.h
+ *
+ * Project:
+ * --------
+ *
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ ******************************************************************************
+ * $Log$
+ *
+ * 07 30 2021 stun.wu
+ * [MOLY00656536] [TMO EPSFB][P210420-00364] [Carrier VOC][A326U][TMB][UCF][MQL-TX][NR/BasicFunction/Call/EPSFB]Device "S1 mode not requested" failing EPSFB calls with 503
+ *
+ * .
+ *
+ * 03 26 2019 mike.lu
+ * [MOLY00393456] [Gen97][VMOLY] 45G InterRAT & interSystem feature
+ *
+ * .
+ *
+ * 11 29 2018 mike.lu
+ * [MOLY00361576] TS24.301 R15.4 Aligment
+ * .
+ *
+ * 10 29 2018 mike.lu
+ * [MOLY00361576] TS24.301 R15.4 Aligment
+ *
+ * [MOLY00346729] VMOLY_CBr patch back to VMOLY TRUNK
+ *
+ * .
+ *
+ * 06 05 2018 yu-hsin.lin
+ * [MOLY00325101] [UMOLYE][MT6761][Merlot][O1][MP3][MTBF][HQ][4GMM][Lab][Ericsson][Fatal error(task)] err_code1:0x00000305 err_code2:0x888802DA err_code3:0xCCCCCCCC
+ * [interface] is_emergency_bearer, enum, and msg struct for esm_ratdm_ac_bar_alleviate_req;
+ *
+ * 04 26 2018 willy-wj.chen
+ * [MOLY00322460] [UMOLYE]¡i??¡j¡i¦è¦w¡j¡i?«HVOLTE¡j¥d1?«H4G¥d2?«HVOLTE ¥d2¦b?«HVOLTE B5?¬q¤UMT??¡A??¥X?MT¥¢?
+ * [UMOLYE][EL2][Common]¡i??¡j¡i¦è¦w¡j¡i?«HVOLTE¡j¥d1?«H4G¥d2?«HVOLTE ¥d2¦b?«HVOLTE B5?¬q¤UMT??¡A??¥X?MT¥¢?.
+ *
+ * 04 20 2018 willy-wj.chen
+ * [MOLY00321469] [R2.TC16.SP][COMMON]¡i??¡j¡i¦è¦w¡j¡i?«HVOLTE¡j¥d1?«H4G¥d2?«HVOLTE ¥d2¦b?«HVOLTE B5?¬q¤UMT??¡A??¥X?MT¥¢?
+ * 01 16 2018 yu-hsin.lin
+ * [MOLY00302109] [MT6763][Bianco][N1][India FT][Chennai][WW FT][RCOM][TATA DOCOMO][TC_MTK_P1_4G_Gemini_13] [MP1.5] DUT long SMS to sim2 fails (common interface part)
+ * [Interface] modify ESM cause
+ *
+ *
+ * 01 16 2018 yu-hsin.lin
+ * [MOLY00302109] [MT6763][Bianco][N1][India FT][Chennai][WW FT][RCOM][TATA DOCOMO][TC_MTK_P1_4G_Gemini_13] [MP1.5] DUT long SMS to sim2 fails (common interface part)
+ * [Interface] modify ESM cause
+ *
+ * 12 18 2017 vera.yeh
+ * [MOLY00294275] [6293 Gemini][Common Interface][Switch data to VoLTE call SIM]: Switch data service to SIM which is with ongoing VoLTE call
+ * [ESM] __FORCE_LOCAL_RELEASE__ Add new cause GEMINI_FAILURE for IDLE_LEAVE_REJ
+ *
+ * 10 25 2016 steve.kao
+ * [MOLY00209600] [UMOLYA][RATDM-LTE] M-PS related code changes
+ * [UMOLYA_TRUNK][RATDM-LTE][MPS] Modify interface for IDLE_LEAVE_IND .
+ *
+ * 07 20 2016 head.hsu
+ * [MOLY00174746] [PH1_VZW][joint-camp][Radio_Protocol][hVoLTE] TC 2.2.13 fail: step8. wait for EMM SR timeout
+ *
+ * 02 01 2016 matti.moisanen
+ * [MOLY00145827] [R12] CR2024 Introducing new QCIs for MCPTT signaling
+ *
+ * 04 16 2015 carlson.lin
+ * [MOLY00091769] [GEMINI] Trigger TAU/SR after GEMINI resume
+ * Add iterface (OA Domain)
+ *
+ *
+ ******************************************************************************/
+
+#ifndef ESM_RATDM_STRUCT_H
+#define ESM_RATDM_STRUCT_H
+
+#include "kal_general_types.h"
+#include "kal_public_defs.h"
+#include "mcd_l3_inc_gprs_struct.h"
+#include "l3_inc_local.h"
+#include "qmu_bm.h"
+
+/* the available EBI range is 5~15. The maximum number of EPS bearer is eleven. */
+#define MAX_EPSB_NUMBER 11
+
+typedef enum
+{
+ ESM_QCI_RESERVED_VALUE_0 = 0, // Reserved
+ ESM_QCI_1 = 1, // QCI_1, Conversational Vocie
+ ESM_QCI_2 = 2, // QCI_2, Conversational Video (Live Streaming)
+ ESM_QCI_3 = 3, // QCI_3, Real Time Gaming
+ ESM_QCI_4 = 4, // QCI_4, Non-Conversational Video (Buffered Streaming)
+ ESM_QCI_5 = 5, // QCI_5, IMS Signaling
+ ESM_QCI_6 = 6, // QCI_6, Video (Buffered Streaming), TCP-based (e.g., www, e-mail, chat, ftp, p2p file sharing, progressive video, etc)
+ ESM_QCI_7 = 7, // QCI_7, Voice, Video (Live Streaming), Interactive Gaming
+ ESM_QCI_8 = 8, // QCI_8, Video (Buffered Streaming), TCP-based (e.g., www, e-mail, chat, ftp, p2p file sharing, progressive video, etc)
+ ESM_QCI_9 = 9, // QCI_9, Video (Buffered Streaming), TCP-based (e.g., www, e-mail, chat, ftp, p2p file sharing, progressive video, etc)
+ ESM_QCI_SPARE_VALUE_10 = 10, // Spare (10~64)
+ ESM_QCI_SPARE_VALUE_64 = 64, // Spare (10~64)
+ ESM_QCI_65 = 65, // QCI_65, Mission Critical user plane Push To Talk Voice (e.g., MCPTT)
+ ESM_QCI_66 = 66, // QCI_66, Non-Mission-Critical user plane Push To Talk Voice
+ ESM_QCI_67 = 67, // QCI_67, Mission Critical Video service
+ ESM_QCI_SPARE_VALUE_68 = 68, // Spare (68)
+ ESM_QCI_69 = 69, // QCI_69, Mission Critical delay sensitive signalling (e.g.,MC-PTT signalling)
+ ESM_QCI_70 = 70, // QCI_70, Mission Critical Data (e.g. example services are the same as QCI 6/8/9)
+ ESM_QCI_SPARE_VALUE_71 = 71, // Spare (71~127)
+ ESM_QCI_84 = 84, // QCI_84, e.g. Ultra-reliable and Low Latency Communications
+ ESM_QCI_85 = 85, // QCI_85, e.g. Ultra-reliable and Low Latency Communications
+ ESM_QCI_SPARE_VALUE_127 = 127, // Spare (71~127)
+ ESM_QCI_OPERATOR_SPECIFIC_QCI_MIN_VALUE = 128, // Operator-specific QCIs 128~254
+ ESM_QCI_OPERATOR_SPECIFIC_QCI_MAX_VALUE = 254, // Operator-specific QCIs 128~254
+ ESM_QCI_RESERVED_VALUE_255 = 255 // Reserved
+} esm_qci_enum;
+
+
+// R12 CR2063 QCI code values "spare for future use"
+// Temporary definitions January-2016. When RATDM code is updated to use esm_qci_enum
+// values then these definitions shall be deleted
+#define ESM_QCI_RESERVED_VALUE_10 ESM_QCI_SPARE_VALUE_10
+#define ESM_QCI_RESERVED_VALUE_127 ESM_QCI_SPARE_VALUE_127
+
+
+typedef enum
+{
+ ESM_IDLE_LEAVE_REJ_UNSPEFICIFIED = 0x01,
+ ESM_IDLE_LEAVE_REJ_DETACH = 0x02,
+ ESM_IDLE_LEAVE_REJ_COVERAGE_OUT = 0x10,
+ ESM_IDLE_LEAVE_REJ_AC_BARRED = 0x11,
+ ESM_IDLE_LEAVE_REJ_NW_REJECT = 0x12,
+ ESM_IDLE_LEAVE_REJ_GEMINI_SUSPEND = 0x13, //gemini SUSPEND due to CS semaphore occupied by another protocal stack, wait for resume
+ ESM_IDLE_LEAVE_REJ_T3346_CONGESTION = 0x14,
+ ESM_IDLE_LEAVE_REJ_T3417TO = 0x15,
+ ESM_IDLE_LEAVE_REJ_GEMINI_FAILURE = 0x16, //gemini failure due to PS(or higher) semaphore occupied by another protocal stack
+ ESM_IDLE_LEAVE_REJ_AC_BARRED_EMERGENCY = 0x17,
+ ESM_IDLE_LEAVE_REJ_AC_BARRED_NORMAL = 0x18,
+ ESM_IDLE_LEAVE_REJ_OTHERS = 0x20,
+ ESM_IDLE_LEAVE_REJ_TAU_CONN_FAIL = 0x21,
+}idle_leave_rej_cause_enum;
+
+
+typedef enum
+{
+ ESM_ALLEVIATED_TYPE_EMERGENCY,
+ ESM_ALLEVIATED_TYPE_NORMAL,
+}esm_alleviated_type_enum;
+
+
+typedef struct
+{
+ kal_uint8 ebi;
+ kal_uint8 rb_idx;
+}ebi_rbidx_map_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ /* EPS bearer identity which ESM wants to initialize */
+ kal_uint8 ebi;
+
+ /*
+ * Default EPS bearer identity
+ * If the EPS bearer ESM wants to activate is a default EPS bearer,
+ * linked_ebi will be set to the same as ebi
+ */
+ kal_uint8 linked_ebi;
+
+ /* Hardware channel id (choose by ERRC) */
+ kal_uint8 rb_idx;
+
+ esm_qci_enum qci;
+
+ /* 23G ralated parameters */
+ kal_bool is_llc_sapi_present;
+ kal_uint8 llc_sapi;
+
+ kal_bool is_ug_qos_present;
+ qos_struct ug_qos;
+
+ kal_bool is_radio_priority_present;
+ kal_uint8 radio_priority;
+
+ kal_bool is_pfi_present;
+ kal_uint8 pfi;
+
+ /* Bearer service type */
+ kal_bool is_emergency_bearer;
+
+}esm_ratdm_epsb_init_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ /* EPS bearer identity which ESM wants to activate */
+ kal_uint8 ebi;
+}esm_ratdm_epsb_act_req_struct;
+
+
+typedef struct {
+ /* EPS bearer identity which ESM wants to initialize */
+ kal_uint8 ebi;
+
+ /*
+ * Default EPS bearer identity
+ * If the EPS bearer ESM wants to activate is a default EPS bearer,
+ * linked_ebi will be set to the same as ebi
+ */
+ kal_uint8 linked_ebi;
+
+ /* Hardware channel id (choose by ERRC) */
+ kal_uint8 rb_idx;
+
+ esm_qci_enum qci;
+
+ /* 23G ralated parameters */
+ kal_bool is_llc_sapi_present;
+ kal_uint8 llc_sapi;
+
+ kal_bool is_ug_qos_present;
+ qos_struct ug_qos;
+
+ kal_bool is_radio_priority_present;
+ kal_uint8 radio_priority;
+
+ kal_bool is_pfi_present;
+ kal_uint8 pfi;
+
+ /* Bearer service type */
+ kal_bool is_emergency_bearer;
+
+} epsb_info_struct;
+
+typedef struct {
+ kal_uint8 from_psi;
+ kal_uint64 qfi_bitmap;
+
+ epsb_info_struct epsb;
+
+} esm_ratdm_ebi_map_to_psi_info_struct;
+
+/* MSG_ID_ESM_RATDM_5G4_CONTEXT_TRANSFER_REQ */
+typedef struct {
+ LOCAL_PARA_HDR
+
+ kal_uint8 num_of_map_info;
+ esm_ratdm_ebi_map_to_psi_info_struct map_info[MAX_L4_PS_EBI_NUM];
+} esm_ratdm_5g4_context_transfer_req_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ /* EPS bearer identity which ESM wants to deactivate */
+ kal_uint8 ebi;
+}esm_ratdm_epsb_deact_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 ebi;
+ /* 4G ralated parameters */
+ esm_qci_enum qci;
+ /* 23G ralated parameters */
+ kal_bool is_llc_sapi_present;
+ kal_uint8 llc_sapi;
+
+ kal_bool is_ug_qos_present;
+ qos_struct ug_qos;
+
+ kal_bool is_radio_priority_present;
+ kal_uint8 radio_priority;
+
+ kal_bool is_pfi_present;
+ kal_uint8 pfi;
+} esm_ratdm_epsb_modify_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ /* The total number of EPS bearer with DRB established after UE enter connected mode */
+ kal_uint8 epsb_num;
+
+ /* Mapping between EBI & RB index */
+ ebi_rbidx_map_struct ebi_rbidx_map[MAX_EPSB_NUMBER];
+}esm_ratdm_idle_leave_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ /* The failure cause of leave idle */
+ idle_leave_rej_cause_enum idle_leave_rej_cause;
+
+ /* Backoff timer used with ESM_IDLE_LEAVE_REJ_TAU_CONN_FAIL */
+ kal_uint32 retry_time_ms;
+}esm_ratdm_idle_leave_rej_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ /* Which EPS bearers has data */
+ kal_uint16 ebi_btmp;
+ /* whether the queue of ebi_btmp will be cleared upon Idle_Leave_Rej with gemini */
+ kal_bool is_drop_data_by_gemini_cause;
+}esm_ratdm_idle_leave_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ /* Whether UL data is coming */
+ kal_bool is_ul_data_coming;
+}esm_ratdm_query_ul_data_status_cnf_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ /* type which is going to be alleviated due to ac bar in idle leave*/
+ esm_alleviated_type_enum alleviated_type;
+}esm_ratdm_ac_bar_alleviate_req_struct;
+
+
+/* Adaptation between ESM and LTM */
+typedef esm_ratdm_epsb_init_req_struct esm_ltm_epsb_init_req_struct;
+typedef esm_ratdm_epsb_act_req_struct esm_ltm_epsb_act_req_struct;
+typedef esm_ratdm_epsb_deact_req_struct esm_ltm_epsb_deact_req_struct;
+typedef esm_ratdm_epsb_modify_req_struct esm_ltm_epsb_modify_req_struct;
+typedef esm_ratdm_idle_leave_req_struct esm_ltm_idle_leave_req_struct;
+typedef esm_ratdm_idle_leave_rej_struct esm_ltm_idle_leave_rej_struct;
+typedef esm_ratdm_idle_leave_ind_struct esm_ltm_idle_leave_ind_struct;
+typedef esm_ratdm_query_ul_data_status_cnf_struct esm_ltm_query_ul_data_status_cnf_struct;
+typedef esm_ratdm_ac_bar_alleviate_req_struct esm_ltm_ac_bar_alleviate_req_struct;
+#endif /* ESM_RATDM_STRUCT_H */
diff --git a/mcu/protocol/interface/general/esm_smic_struct.h b/mcu/protocol/interface/general/esm_smic_struct.h
new file mode 100644
index 0000000..1b50780
--- /dev/null
+++ b/mcu/protocol/interface/general/esm_smic_struct.h
@@ -0,0 +1,169 @@
+#ifndef ESM_FAKE_SMIC_STRUCT_H
+#define ESM_FAKE_SMIC_STRUCT_H
+
+#include "kal_general_types.h"
+#include "kal_public_defs.h"
+#include "smic_struct.h"
+
+#define ESM_FAKE_SMIC_MAX_PSI 10
+#define ESM_FAKE_SMIC_MAX_EBI 15 //Should refer to ESM_EPSB_ID_TOTAL_NUM in module, ESM
+#define ESM_FAKE_SMIC_MAX_5G_CONFIG_LEN 20 // This only used by log_smic_5g_config_option_struct
+//----- For Simulating SMIC APIs -----//
+typedef struct
+{
+ kal_bool is_ebi_active[ESM_FAKE_SMIC_MAX_EBI + 1]; // ebi -> If state is active;
+} smic_4g_if_ebi_mapped_success_context_struct;
+
+typedef struct
+{
+ esm_smic_epsb_context_struct epsb_context[ESM_FAKE_SMIC_MAX_EBI + 1]; // ebi -> EPSB Context;
+} smic_4g_get_5g4_ebi_context_struct;
+
+typedef struct
+{
+ kal_uint8 psi;
+ kal_uint64 qfi_bitmap;
+} smic_get_ebi_mapped_psi_and_qfi_struct;
+
+typedef struct
+{
+ kal_uint8 psi; //ebi[1] = 5 => ebi 1 <> psi 5
+} smic_get_ebi_mapped_psi_after_23G4_struct;
+
+typedef struct
+{
+ ps_cause_enum cause_to_nw;
+ smic_4g_set_result_enum ret;
+} smic_4g_peer_msg_precheck_struct;
+typedef struct
+{
+ smic_4g_if_ebi_mapped_success_context_struct smic_4g_if_ebi_mapped_success_api;
+ smic_4g_get_5g4_ebi_context_struct smic_4g_get_5g4_ebi_api;
+ smic_get_ebi_mapped_psi_and_qfi_struct smic_get_ebi_mapped_psi_and_qfi_api[ESM_FAKE_SMIC_MAX_EBI + 1]; // ebi -> PSI and QFI Info;
+ smic_get_ebi_mapped_psi_after_23G4_struct smic_4g_get_psi_by_ebi_after_23G4_api[ESM_FAKE_SMIC_MAX_EBI + 1]; // ebi -> PSI
+ smic_4g_peer_msg_precheck_struct smic_4g_peer_msg_precheck[ESM_FAKE_SMIC_MAX_PSI + 1]; // psi -> smic_4g_peer_msg_precheck() output
+ esm_smic_precheck_epsb_context_struct smic_4g_precheck_epsb_context;
+} esm_ut_fake_smic_context_struct;
+
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ esm_ut_fake_smic_context_struct esm_ut_fake_smic_context;
+} esm_ut_set_fake_smic_context_struct; // MSG_ID_ESM_UT_SET_FAKE_SMIC_CONTEXT, used to set g_esm_ut_fake_smic_context
+
+//---- [End] For Simulating SMIC APIS ----//
+
+typedef enum
+{
+ FUNC_IDX_smic_4g_do_context_transfer_4g5 = 1, // Align with the start idx example in esm_uniontag.txt
+ FUNC_IDX_smic_4g_if_ebi_mapped_success,
+ FUNC_IDX_smic_4g_process_pdn_released,
+ FUNC_IDX_smic_4g_get_5g4_ebi_context,
+ FUNC_IDX_smic_get_ebi_mapped_psi_and_qfi,
+ FUNC_IDX_smic_4g_set_associated_ctx_and_pco,
+ FUNC_IDX_smic_4g_get_psi_by_ebi_after_23G4,
+ FUNC_IDX_smic_4g_peer_msg_precheck,
+} esm_log_args_of_smic_api_enum; // Define func_idx<>func_name mapping in esm_uniontag.txt
+
+
+typedef struct
+{
+ kal_uint16 protocol_id;
+ kal_uint16 protocol_config_len;
+ kal_uint8 protocol_config[ESM_FAKE_SMIC_MAX_5G_CONFIG_LEN];
+} log_smic_5g_config_option_struct; // This is only for ESM UT, and should include the same content as smic_5g_config_option_struct
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ esm_log_args_of_smic_api_enum func_idx; // Will determine the which member to use in the union func_name
+ union {
+ struct{
+ //[In]
+ kal_uint8 sim_idx;
+ //[Out]
+ kal_bool ret;
+ } smic_4g_do_context_transfer_4g5;
+
+ struct{
+ //[In]
+ kal_uint8 sim_idx;
+ kal_uint8 ebi;
+ kal_uint8 psi;
+ //[Out]
+ kal_bool ret;
+ } smic_4g_if_ebi_mapped_success;
+
+ struct{
+ //[In]
+ kal_uint8 sim_idx;
+ kal_uint8 ebi;
+ //[Out]
+ //(void)
+ } smic_4g_process_pdn_released;
+
+ struct{
+ //[In]
+ kal_uint8 sim_idx;
+ kal_uint8 ebi;
+ //[Out]
+ esm_smic_epsb_context_struct ebi_ctx;
+ kal_bool ret;
+ } smic_4g_get_5g4_ebi_context;
+
+ struct{
+ //[In]
+ kal_uint8 sim_idx;
+ kal_uint8 ebi;
+ //[Out]
+ kal_uint8 psi;
+ kal_uint64 qfi_bitmap;
+ kal_bool ret;
+ } smic_get_ebi_mapped_psi_and_qfi;
+
+ struct{
+ //[In]
+ kal_uint8 sim_idx;
+ kal_uint8 ebi;
+ kal_uint8 psi;
+ esm_smic_epsb_context_struct associated_ctx;
+ log_smic_5g_config_option_struct pco_5g[SMIC_MAX_NUM_OF_5G_IE_IN_PCO];
+ kal_uint8 num_of_pco_5g;
+ //[Out]
+ //ps_cause_enum cause_to_nw;
+ //tft_bearer_act_enum bearer_action;
+ smic_4g_set_result_enum ret;
+ } smic_4g_set_associated_ctx_and_pco;
+
+ struct
+ {
+ //[In]
+ kal_uint8 sim_idx;
+ kal_uint8 ebi;
+ //[Out]
+ kal_uint8 psi;
+ kal_bool ret;
+ } smic_4g_get_psi_by_ebi_after_23G4;
+
+
+ struct
+ {
+ //[in]
+ kal_uint8 sim_idx;
+ kal_uint8 psi;
+ kal_uint8 ebi;
+ smic_esm_peer_msg_precheck_info_struct esm_precheck_info;
+ log_smic_5g_config_option_struct pco_5g[SMIC_MAX_NUM_OF_5G_IE_IN_PCO];
+ kal_uint8 num_of_pco_5g;
+ tft_bearer_act_enum bearer_action;
+ //[out]
+ ps_cause_enum cause_to_nw;
+ smic_4g_set_result_enum ret;
+ } smic_4g_peer_msg_precheck;
+
+ } func_name;
+} esm_log_args_of_smic_api_struct; // MSG_ID_ESM_LOG_ARGS_OF_SMIC_API
+
+#endif
diff --git a/mcu/protocol/interface/general/esm_vgsm_struct.h b/mcu/protocol/interface/general/esm_vgsm_struct.h
new file mode 100644
index 0000000..0a06ae3
--- /dev/null
+++ b/mcu/protocol/interface/general/esm_vgsm_struct.h
@@ -0,0 +1,119 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * esm_vgsm_struct.h
+ *
+ * Project:
+ * --------
+ * VMOLY
+ *
+ * Description:
+ * ------------
+ * This file describes the common structure of VGSM and ESM
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _ESM_VGSM_STRUCT_H
+#define _ESM_VGSM_STRUCT_H
+
+#include "kal_general_types.h"
+#include "kal_public_defs.h"
+#include "vgsm_common_def_public.h"
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 psi;
+} esm_vgsm_attach_pdn_activated_ind_struct;
+
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 num_of_ebi;
+ kal_uint8 ebi[MAX_L4_PS_EBI_NUM];
+ kal_bool is_vgsm_do_local_release;
+} vgsm_esm_context_transfer_req_ntf_struct;
+
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 num_of_ebi;
+ kal_uint8 ebi[MAX_L4_PS_EBI_NUM];
+ vgsm_xsm_interworking_local_release_pdn_type_enum local_release_pdn_type;
+} esm_vgsm_context_transfer_req_ntf_struct;
+
+#endif // ~ _ESM_VGSM_STRUCT_H
+
diff --git a/mcu/protocol/interface/general/eval_upcm_struct.h b/mcu/protocol/interface/general/eval_upcm_struct.h
new file mode 100644
index 0000000..ed9f49e
--- /dev/null
+++ b/mcu/protocol/interface/general/eval_upcm_struct.h
@@ -0,0 +1,84 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * eval_upcm_struct.h
+ *
+ * Project:
+ * --------
+ * UMOLYA
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ ******************************************************************************
+ * $Log$
+ *
+ * 02 07 2020 chengyu.chen
+ * [MOLY00486860] 2752924¡G¡i19165¡j¡i?¥~³¡?¥Î¡j¡i??¥ý?¡j¡i²Ä¤T¤è¡j¡i²y²y¤j§@?¡j²y²y¤j§@?´å??µ{¤¤¡A¥X?«·s?±µ
+ * [MPD][Feature Extension] Local Release RRC connection by DL data type
+ * 1. Delete code related to SBP_EMM_NO_DL_DATA_RELEASE_PAGING_SEMAPHORE (Release RRC connection directly after DRB is estbalished but havent's received any DL data for 100ms)
+ * 2. Apply "Local Release RRC connection by DL data type" to MSPM_EMM_TAU_DRB
+ * 3. Compile some duplicate code, merge tham into a common function
+ * 4. Rename the original structure of the feature(Local release RRC connection by DL datat type), make it a common function to request UPCM whenever DRB is established and the connection should be released ASAP
+ * 5. Due to VC guard timer is set as 15 seconds in Gen97, skip additional check designed for the case regarding VC guard timer as 3 seconds
+ *
+ ******************************************************************************/
+
+#ifndef EVAL_UPCM_STRUCT_H
+#define EVAL_UPCM_STRUCT_H
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint16 value;
+} eval_upcm_start_release_drb_session_timer_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool isStartListeningDlData;
+} eval_upcm_drb_session_status_ntf_struct;
+
+
+
+#endif /* EVAL_UPCM_STRUCT_H */
diff --git a/mcu/protocol/interface/general/ext_modem_l4c_struct.h b/mcu/protocol/interface/general/ext_modem_l4c_struct.h
new file mode 100644
index 0000000..910720d
--- /dev/null
+++ b/mcu/protocol/interface/general/ext_modem_l4c_struct.h
@@ -0,0 +1,101 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * EXT_MODEM_L4C_STRUCT.H
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file describes the common struct of EXT_MODEM and L4C.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *============================================================================
+ ****************************************************************************/
+#ifndef _EXT_MODEM_L4C_STRUCT_H
+#define _EXT_MODEM_L4C_STRUCT_H
+
+#include "kal_public_defs.h"
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 csd_profile_id;
+} l4c_ext_modem_setup_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool result; //True: successful, False: failed
+ kal_uint16 err_cause;//refer to l3_inc_enums.h
+ kal_uint8 ip_addr[4];
+ kal_uint8 pri_dns_addr[4];
+ kal_uint8 sec_dns_addr[4];
+ kal_uint16 mtu;
+} l4c_ext_modem_setup_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 csd_profile_id;
+} l4c_ext_modem_disc_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool result; //True: successful, False: failed
+ kal_uint16 err_cause;//refer to l3_inc_enums.h
+} l4c_ext_modem_disc_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 csd_profile_id;
+ kal_uint16 err_cause;//refer to l3_inc_enums.h
+} l4c_ext_modem_disc_ind_struct;
+
+#endif /* _EXT_MODEM_L4C_STRUCT_H */
+
+
diff --git a/mcu/protocol/interface/general/flc2stack_struct.h b/mcu/protocol/interface/general/flc2stack_struct.h
new file mode 100644
index 0000000..666dc96
--- /dev/null
+++ b/mcu/protocol/interface/general/flc2stack_struct.h
@@ -0,0 +1,141 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * flc2stack_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ *
+ *
+ *==============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+
+/*******************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2002
+*
+*******************************************************************************
+ * FILENAME : flc2stack_struct.h
+ * SYNOPSIS : Functions for encoding/decoding.
+ *
+ * R E V I S I O N H I S T O R Y
+ *
+ */
+#ifndef _FLC2STACK_STRUCT_H
+#define _FLC2STACK_STRUCT_H
+
+#include "kal_public_defs.h"
+
+#ifdef __FLC2__
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 count;
+ flc2_entity_struct pool_info[10];
+} flc_pool_status_report_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 count;
+ flc2_mm_block_struct mb_info[10];
+} flc_mb_status_report_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 count;
+ flc2_profile_struct profile_info[10];
+} flc_profile_status_report_ind_struct;
+
+#else
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 mem_id;
+ kal_uint8 percentage_upp_thre;
+ kal_uint8 percentage_low_thre;
+
+ kal_uint32 total_size;
+ kal_uint32 curr_occ;
+
+ kal_uint16 hit_upp_thre_counts; /* hit upper threshold times */
+ kal_uint16 hit_low_thre_counts; /* hit lower threshold times */
+ kal_uint16 hit_no_buff_avail_counts; /* hit no buffer available times */
+ kal_uint16 report_upp_thre_counts; /* report upper threshold times */
+ kal_uint16 report_low_thre_counts; /* report lower threshold times */
+ kal_uint32 max_req_buff_size; /* maximum request buffer size */
+ kal_uint32 max_buff_allocated; /* maximum buffer allocated size in bytes */
+ kal_uint32 total_req_counts; /* total buffer request times */
+} flc_status_report_ind_struct;
+#endif //__FLC2__
+#endif //_FLC2STACK_STRUCT_H
diff --git a/mcu/protocol/interface/general/gas_eas_enums.h b/mcu/protocol/interface/general/gas_eas_enums.h
new file mode 100644
index 0000000..bb4da27
--- /dev/null
+++ b/mcu/protocol/interface/general/gas_eas_enums.h
@@ -0,0 +1,105 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * gas_eas_enums.h
+ *
+ * Project:
+ * --------
+ * MONZA
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ----------------------------------------------------------------------------
+ * $Log:$
+ *
+ * 11 12 2014 tsung-wei.tu
+ * [MOLY00080211] [MT6291_DEV][MT6291_UESIM_DEV] Check in low power to MT6291_DEV, MT6291_UESIM_DEV
+ * Merging GISE low power to UMOLY trunk
+ *
+ * 09 16 2013 henry.lai
+ * [MOLY00037661] [MT6290] GAS development for AFR, L1 measurement control, backup IR measurement mechanism, and meaurement report
+ * .
+ *
+ * 07 03 2013 ming.lee
+ * [MOLY00026501] [GAS_UAS] Cipher status mismatch error handling
+ * .
+ *
+ * 01 23 2013 henry.lai
+ * [MOLY00009222] [GAS][Multi-Mode Development] Merge GAS multi-mode development to MOLY
+ * .
+ *
+ * 01 11 2013 henry.lai
+ * [Henry][Multi-Mode Development] GAS Development and R8 CR Sync
+ *
+ * Add copyright header.
+ ******************************************************************************/
+
+#ifndef _GAS_EAS_ENUMS_H
+#define _GAS_EAS_ENUMS_H
+
+#include "gas_eas_inter_core_enum.h"
+/* MACROS ******************************************************************/
+#define MAX_GAS_EAS_REDIRECT_FREQ_NUM (8)
+
+/* MAX/MIN values */
+#define MAX_ECELL_RSRP_VAL (-120)
+#define MIN_ECELL_RSRP_VAL (-600)
+#define MAX_ECELL_RSRQ_VAL 0
+#define MIN_ECELL_RSRQ_VAL (-100)
+
+/* TYPES DEFINITIONS ********************************************************/
+
+typedef enum
+{
+ CIPHER_NOT_START,
+ CIPHER_START_WITH_ALGO_A5_1,
+ CIPHER_START_WITH_ALGO_A5_2,
+ CIPHER_START_WITH_ALGO_A5_3,
+ CIPHER_START_WITH_ALGO_A5_4,
+ CIPHER_START_WITH_ALGO_A5_5,
+ CIPHER_START_WITH_ALGO_A5_6,
+ CIPHER_START_WITH_ALGO_A5_7
+}te_ir_handover_cipher_algo;
+
+#endif /* GAS_EAS_ENUMS_H */
diff --git a/mcu/protocol/interface/general/gas_eas_struct.h b/mcu/protocol/interface/general/gas_eas_struct.h
new file mode 100644
index 0000000..4439920
--- /dev/null
+++ b/mcu/protocol/interface/general/gas_eas_struct.h
@@ -0,0 +1,506 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * gas_eas_struct.h
+ *
+ * Project:
+ * --------
+ * MONZA
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log:$
+ *
+ * 05 27 2021 ot_renuka.madane
+ * [MOLY00643309] ????? MOLY00617181 ? MOLY.NR15.R3.MP.V1.6
+ *
+ * [CODE SYNC] BLIND FR trigger based on 4G signal strength.
+ *
+ * 12 09 2019 icy.li
+ * [MOLY00464630] Gen97 Elevator Mode feature
+ *
+ * .
+ *
+ * 05 07 2019 sapna.ks
+ * [MOLY00397094] [CODE SYNC] [Gen95 patch back] Modem??SRVCC HO fail cause
+ * .
+ *
+ * 02 18 2019 nalin.chovatia
+ * [MOLY00384995] [VMOLY] GEMINI 3.0, AFR, Unify Frequency scan, BGSEARCH
+ * .gemini_afr_bg
+ *
+ * 10 03 2018 nalin.chovatia
+ * [MOLY00356286] [Gen97] background search feature
+ * .vmoly BG
+ *
+ * 09 15 2017 abhinav.agarwal
+ * [MOLY00278198] [CODE SYNC] [LR11 MP3][GAS] [Interface]New feature requirement: SRVCC fail????
+ * .
+ *
+ * 10 24 2016 dennis.weng
+ * [MOLY00208768] [MT6293] [B66] Band66 porting (ERRC part)
+ * .
+ *
+ * 03 10 2016 mark.ng
+ * [MOLY00165947] [6291 HSR] Protocol Enhancement (Header/Interface)
+ * [HSR UMOLY] cel interface
+ *
+ * 02 26 2016 srihari.maddipati
+ * [MOLY00162461] ¦bAndroid???Modem??Logªº»Ý¨D
+ * .
+ *
+ * 06 01 2015 henry.lai
+ * [MOLY00092508] [MT6291][LTE-C2K] AS Inter RAT feature
+ * .
+ *
+ * 05 26 2015 chun-fan.tsai
+ * [MOLY00097098] [6291][CONN] Code Sync from MOLY to UMOLY
+ * Sync MOLY00097502 to UMOLY (GAS-EAS interface)
+ *
+ * 05 15 2015 songsong.jia
+ * [MOLY00084416] [eCSFB]LU Reduction feature
+ * .
+ *
+ * 12 12 2014 yuhhwang.yu
+ * [MOLY00087211] [CISE] add CSG fingerprint compile option and bug fix
+ * . CISE codes
+ *
+ * 11 14 2014 henry.lai
+ * [MOLY00079072] [MT6291] Change EARFCN from kal_uint16 to kal_uint32 for CEL part
+ * .
+ *
+ * 11 11 2014 shin.chen
+ * [MOLY00080357] [GAS] Extend earfcn to U32 for GAS
+ * .
+ *
+ * 06 09 2014 aaron.liu
+ * [MOLY00068770] [HZ]5.4.1 solution
+ * EAS part:Add interface
+ *
+ * 06 05 2014 xiaochi.zhao
+ * [MOLY00067770] [New SBP feature request] 4G background search - remove compile option __4G_BACKGROUND_SEARCH__
+ * .
+ *
+ * 05 05 2014 xiaochi.zhao
+ * [MOLY00064429] [MT6290LTE][CSFB][ERRC]New Feature : 2G4 Background Search
+ * .
+ *
+ * 01 21 2014 wcpuser_integrator
+ * [MOLY00054475] SGLTE option rename
+ * .
+ *
+ * 12 31 2013 stanleyhy.chen
+ * [MOLY00048478] [MT6290E1][LTG][GCF][CMW500][MM][Pre-Test][case 9.2.3.3.4][Band 38] Fail
+ * Add a flag prohibit_apply_n_layer
+ *
+ * 11 13 2013 vend_simon.huang
+ * [MOLY00046027] [MT6290E1][MMDS_DC] MMDC feature patch back to MOLY trunk
+ * CEL OA part
+ *
+ * 07 24 2013 rujing.zhao
+ * [MOLY00031020] [MMDS_DC] Merge MMDC interface to MOLY
+ * .2->34G NBR transfer
+ *
+ * 07 23 2013 henry.lai
+ * [MOLY00023935] [MT6290E1][W/G][Target IT] Meas result is received so frequently when priority measurement and drx measurement are on-going
+ * .
+ *
+ * 03 14 2013 morton.lin
+ * [MOLY00011957] [MT6290] Multimode IT CBr merge back to MOLY
+ * Multimode IT CBr merge back to MOLY - stage 1
+ *
+ * 01 23 2013 henry.lai
+ * [MOLY00009222] [GAS][Multi-Mode Development] Merge GAS multi-mode development to MOLY
+ * .
+ *
+ * 01 11 2013 henry.lai
+ * [Henry][Multi-Mode Development] GAS Development and R8 CR Sync
+ *
+ * Add copyright header.
+ ****************************************************************************/
+
+#ifndef _GAS_EAS_STRUCT_H
+#define _GAS_EAS_STRUCT_H
+
+#include "uas_gas_enums.h"
+#include "gas_eas_enums.h"
+#include "kal_general_types.h"
+#include "csi_umts_asn.h"
+#include "l3_inc_enums.h"
+#include "mcd_l3_inc_struct.h"
+#include "csi_gsm_asn.h"
+#include "irat_common_struct.h"
+#include "irat_common_enums.h"
+#include "global_type.h"
+#include "mrs_as_struct.h"
+#include "gas_eas_inter_core_struct.h"
+
+
+typedef struct {
+ LOCAL_PARA_HDR
+ te_ir_cell_change_trigger ir_cell_change_trigger;
+ plmn_search_type_enum plmn_search_type;
+ GSM_TargetCellInfo target_gcell_info;
+}eas_gas_evaluate_gcell_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ te_ir_cell_reselection_status ir_cell_eval_status;
+ ts_eval_activate_fail_handle eval_activate_fail_handle;
+}eas_gas_evaluate_gcell_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+}eas_gas_evaluate_gcell_stop_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+}eas_gas_evaluate_gcell_stop_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ te_ir_cell_change_trigger ir_cell_change_trigger;
+ plmn_search_type_enum plmn_search_type;
+ GSM_TargetCell_Info_union target_gcell_info;
+ GSM_TargetCell_SI_Info_union target_gcell_si_info;
+ kal_uint32 cell_change_activation_time; /* milli-seconds, */
+ kal_uint32 cell_change_timeout; /* value in milli-seconds or zero when not required */
+ kal_uint32 wait_time; /* milli-Seconds: 0~15000ms, GAS should not reselect back to UMTS/LTE within "wait_time" period */
+ kal_bool nc_mode_present; /* if TRUE nc_mode is present */
+ kal_uint8 nc_mode; /* Optional, present if nc_mode_present is TRUE */
+ ir_lte_scell_struct lte_scell_inf; /* cell info of the source LTE cell */
+}eas_gas_activate_gcell_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ te_ir_cell_reselection_status ir_cell_activation_status;
+ ts_eval_activate_fail_handle eval_activate_fail_handle;
+ te_ir_cell_change_fail_reason_enum ir_cell_change_failed_reason;
+}eas_gas_activate_gcell_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ te_ir_cell_change_complete_status ir_cell_change_complete_status;
+ te_ir_cell_change_fail_reason_enum ir_cell_change_failed_reason;
+}eas_gas_gcell_change_complete_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ ts_ciphering_info ciphering_info;
+ plmn_search_type_enum plmn_search_type;
+ te_gsm_band_indicator band_indicator;
+ kal_uint16 message_length;
+}eas_gas_handover_gcell_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ te_ir_handover_status ir_handover_to_gsm_status;
+ te_ir_handover_cipher_algo ir_handover_to_gsm_cipher_algo;
+ ho_from_lte_type_enum lte_ho_type;
+#ifdef __SRVCC_CELL_INFO__
+ kal_uint16 bcch_arfcn;
+#endif
+}eas_gas_handover_gcell_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 t3212_timer_val;
+ kal_bool att_flag;
+ kal_uint32 wait_time;
+ /* __ALPS02506878_SUPPORT__ */
+ te_ir_call_type call_type;
+}eas_gas_ho_activate_gcell_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ te_ir_handover_status ir_handover_to_gsm_status;
+ #ifdef __SRVCC_CELL_INFO__
+ te_ir_handover_phy_fail_subcause ir_handover_to_gsm_phy_fail_subcause;
+ #endif /*__SRVCC_CELL_INFO__*/
+}eas_gas_ho_activate_gcell_cnf_struct;
+
+
+typedef struct {
+ LOCAL_PARA_HDR
+ eas_target_cell_info target_cell;
+ plmn_search_type_enum plmn_search_type;
+/* __4G_BACKGROUND_SEARCH__ begin */
+ /*2G4 background search parameter*/
+ kal_bool is_background_search_trigger;
+ gas_cell_info serving_cell_info;
+/* __4G_BACKGROUND_SEARCH__ end */
+
+} gas_eas_evaluate_ecell_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ te_ir_cell_reselection_status eval_status;
+ ts_eval_activate_fail_handle eval_activate_fail_handle;
+} gas_eas_evaluate_ecell_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ te_ir_cell_change_trigger trigger;
+ kal_uint32 remain_wait_time;
+ eas_target_cell_info target_cell;
+ kal_uint32 cell_change_timeout;
+ plmn_search_type_enum plmn_search_type;
+ kal_uint8 redirect_freq_num;
+ lte_redirect_info redirect_freq_info [MAX_GAS_EAS_REDIRECT_FREQ_NUM];
+ kal_bool is_gas_cell_inf_valid;
+ mrs_gas_cell_inf_struct gas_cell_inf;
+ kal_uint32 remaining_time_afr; /*value in milli-seconds valid in case of AFR*/
+ kal_bool is_elevator_mode;
+ kal_bool is_custom_threshold_need;
+} gas_eas_activate_ecell_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ te_ir_cell_reselection_status active_status;
+ ts_eval_activate_fail_handle eval_activate_fail_handle;
+ te_ir_cell_change_fail_reason_enum ir_cell_change_failed_reason;
+} gas_eas_activate_ecell_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ /* No parameters here */
+} gas_eas_evaluate_ecell_stop_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ /* No parameters here */
+} gas_eas_evaluate_ecell_stop_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ te_ir_cell_change_complete_status cell_change_complete_status;
+ te_ir_cell_change_fail_reason_enum cell_change_failed_reason;
+}gas_eas_ecell_change_complete_ind_struct;
+
+
+typedef struct{
+ LOCAL_PARA_HDR
+ plmn_search_type_enum plmn_search_type;
+ auto_search_cmd_enum auto_search_cmd;
+ kal_uint8 num_freq;
+ EARFCN freq_list[MAX_NUM_CSG_FREQ];
+} gas_eas_search_csg_ecell_req_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ search_status_enum search_status;
+ kal_uint8 num_csg_freq_search_result;
+ csg_freq_search_result_struct csg_freq_search_result_list[MAX_NUM_CSG_FREQ];
+} gas_eas_search_csg_ecell_cnf_struct;
+
+
+typedef struct{
+ LOCAL_PARA_HDR
+ plmn_search_type_enum plmn_search_type;
+ auto_search_cmd_enum auto_search_cmd;
+ kal_uint8 num_freq;
+ EARFCN freq_list[MAX_NUM_CSG_FREQ];
+} gas_eas_evaluate_csg_ecell_req_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ search_status_enum search_status;
+ kal_uint8 num_csg_freq_search_result;
+ csg_freq_search_result_struct csg_freq_search_result_list[MAX_NUM_CSG_FREQ];
+} gas_eas_evaluate_csg_ecell_cnf_struct;
+
+/*4G2 CSG FINGERPRINT */
+typedef struct {
+ LOCAL_PARA_HDR
+ plmn_id_struct csg_plmn;
+ kal_uint32 csg_id;
+ kal_uint32 csg_cell_id;
+ EARFCN csg_frequency;
+ kal_uint16 csg_physical_cell_id;
+} eas_gas_build_fingerprint_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+} eas_gas_build_fingerprint_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+} eas_gas_abort_fingerprint_ind_struct;
+
+/* LTE to GAS IR Measurement */
+typedef struct
+{
+ LOCAL_PARA_HDR
+} eas_gas_config_gcell_prio_meas_cnf_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+} eas_gas_config_gcell_meas_cnf_struct;
+
+/* GAS to LTE IR Measurement */
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 tid;
+ kal_bool hps_flag;
+ kal_uint8 prio_meas_period;
+ kal_uint8 freq_num;
+ eas_meas_freq_info_struct freq[MAX_MEAS_IRAT_FREQ];
+} gas_eas_lte_measurement_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+} gas_eas_lte_measurement_cnf_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 freq_num;
+ eas_hps_qualify_struct freq[MAX_MEAS_IRAT_FREQ];
+ /* This flag is used to indicate whether measurement period should be reset
+ * immediately. (TRUE: meas is performed in the first DRX.
+ * FALSE: meas is performed in the first T-meas occasion)
+ * In current design, the following rules should be followed.
+ * (1)If freq_num != 0, this flag will be set as FALSE only if tmeasure measurement
+ * is triggered when priority measurement is on-going (i.e., at
+ * least one of LTE cells hits priority reselection criteria for
+ * priority based measurement reselection). If any improvement is
+ * needed, the usage limitation for this flag should be confirmed
+ * with EL1's colleague.
+ * (2) If freq_num == 0, this flag will alwyas be set as FALSE;
+ */
+ kal_bool is_meas_period_reset;
+} gas_eas_lte_hps_qualify_cell_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 tid;
+ kal_uint8 freq_num;
+ eas_meas_freq_rslt_struct freq[MAX_MEAS_IRAT_FREQ];
+#ifdef UNIT_TEST
+ kal_uint32 meas_ind_ms_diff;
+#endif /* UNIT_TEST */
+} gas_eas_lte_measurement_ind_struct;
+
+/* LTE to GAS CGI Collection */
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 tid;
+ report_cgi_req_type_enum report_cgi_req_type;
+ te_gsm_band_indicator gsm_band_indicator;
+ kal_uint16 arfcn;
+ kal_uint8 bsic;
+} eas_gas_report_cgi_req_struct;
+
+typedef struct {
+ kal_bool is_rac_valid;
+ kal_uint8 rac;
+} gcell_cgi_info_optional_struct;
+
+typedef struct {
+ cgi_info_status_enum cgi_info_status;
+ kal_uint16 arfcn;
+ kal_uint8 bsic;
+ kal_int16 rssi_in_quarter_dbm;
+ kal_uint16 cell_id;
+ plmn_id_struct plmn_id;
+ kal_uint16 lac;
+ gcell_cgi_info_optional_struct optional_field;
+} gcell_cgi_info_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 tid;
+ gcell_cgi_info_struct gcell_cgi_info;
+} eas_gas_report_cgi_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ /* KAL_TRUE : ready timer timeout during 2G4 IR CCO procedure.
+ * KAL_FALSE : 2G4 IR CCO procedure is rejected by NAS and
+ * ready timer timeout is not required to handle by
+ * EAS.
+ */
+ kal_bool is_handling_needed;
+} gas_eas_ready_timer_status_ind_struct;
+
+
+/* __4G_BACKGROUND_SEARCH__ begin */
+/*2G4 background search*/
+typedef struct {
+ LOCAL_PARA_HDR
+ /* No parameters here */
+} gas_eas_background_search_start_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ /* No parameters here */
+} gas_eas_background_search_start_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ /* No parameters here */
+} gas_eas_background_search_stop_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ /* LTE detected cell info */
+ EARFCN earfcn;
+ kal_uint16 pci;
+} eas_gas_background_search_found_ind_struct;
+/* __4G_BACKGROUND_SEARCH__ end */
+
+/* HSR_SNIFF_SEARCH */
+typedef struct {
+ LOCAL_PARA_HDR
+ /* LTE detected cell info */
+ EARFCN earfcn;
+ kal_uint16 pci;
+} eas_gas_hsr_cell_found_ind_struct;
+#endif /* _GAS_EAS_STRUCT_H */
+
+
diff --git a/mcu/protocol/interface/general/gas_rsva_struct.h b/mcu/protocol/interface/general/gas_rsva_struct.h
new file mode 100644
index 0000000..49de6cf
--- /dev/null
+++ b/mcu/protocol/interface/general/gas_rsva_struct.h
@@ -0,0 +1,98 @@
+/*******************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*******************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * gas_rsva_struct.h
+ *
+ * Project:
+ * --------
+ * Gemini(WG+G)
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ ******************************************************************************/
+#ifndef _GAS_RSVA_STRUCT_H_
+#define _GAS_RSVA_STRUCT_H_
+
+/* RHR suggest Add */
+#include "l3_inc_enums.h"
+#include "kal_general_types.h"
+
+#if defined(__GEMINI__) && defined(__UMTS_RAT__) && defined(__GSM_RAT__)
+
+/*----------------------------------------------------------------------------*/
+/* GAS (MPAL) to RSVA (RSVAG) */
+/*----------------------------------------------------------------------------*/
+
+typedef struct {
+ LOCAL_PARA_HDR
+ gas_freq_scan_type_enum freq_scan_type;
+ kal_bool is_full_band;
+ kal_uint8 sid; /* session id */
+}gas_rsvag_frequency_scan_start_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ gas_freq_scan_stop_cause_enum cause;
+
+ /* preemption session id, only used when cause=GAS_FREQ_SCAN_PREEMPTED */
+ kal_uint8 preempt_sid;
+}gas_rsvag_frequency_scan_stop_req_struct;
+
+/*----------------------------------------------------------------------------*/
+/* RSVA (RSVAG) to GAS (MPAL) */
+/*----------------------------------------------------------------------------*/
+
+typedef struct {
+ LOCAL_PARA_HDR
+ gas_freq_scan_result_enum result;
+ kal_uint8 sid; /* session id */
+}rsvag_gas_frequency_scan_start_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 preempt_sid; /* preemption session id */
+}rsvag_gas_frequency_scan_preempt_ind_struct;
+
+#endif
+#endif
diff --git a/mcu/protocol/interface/general/gmmllc_enums.h b/mcu/protocol/interface/general/gmmllc_enums.h
new file mode 100644
index 0000000..e398103
--- /dev/null
+++ b/mcu/protocol/interface/general/gmmllc_enums.h
@@ -0,0 +1,101 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * gmmllc_enums.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file contains enum definition between GMM and LLC.
+ *
+ * Author:
+ * -------
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+
+
+#ifndef _GMMLLC_INTERFACE_H
+#define _GMMLLC_INTERFACE_H
+
+
+/* Assumed : IEI Value to be Used for ARQ Var */
+#define ARQ_VAR_IEI 0x00
+
+/* ARQ var length in LLGMM_WINDOW_CNF and LLGMM_WINDOW_REQ */
+#define ARQ_VAR1_LENGTH 0x02
+#define ARQ_VAR2_LENGTH 0x04
+#define ARQ_VAR3_LENGTH 0x05
+#define ARQ_VAR4_LENGTH 0x07
+
+/* Cause Values to be used in LLGMM_STATUS_IND_MSG */
+#define MULTIPLE_TLLI_ASSIGMNENT 0x00
+#define FRMR_RECEIVED_IN_ABM 0x01
+#define UNSOLICITED_RESPONSE_RECEIVED 0x02
+#define MAX_RETX_COUNT_REACHED 0x03
+#define FRAME_REJECT_CONDITION 0x04
+#define LLC_FAILURE 0x05
+#define LOWER_LAYER_FAILURE 0x06
+
+#endif /* End of gmmllc_interface.h */
+
+
diff --git a/mcu/protocol/interface/general/gmss_nwsel_struct.h b/mcu/protocol/interface/general/gmss_nwsel_struct.h
new file mode 100644
index 0000000..57a4b32
--- /dev/null
+++ b/mcu/protocol/interface/general/gmss_nwsel_struct.h
@@ -0,0 +1,1293 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * gmss_nwsel_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file is intends for struct definition between NWSEL and GMSS.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *==============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+#ifndef _GMSS_NWSEL_STRUCT_H
+#define _GMSS_NWSEL_STRUCT_H
+
+#include "kal_general_types.h"
+#include "l3_inc_enums_public.h"
+#include "l3_inc_enums.h"
+#include "mcd_l3_inc_struct.h"
+#include "ps_public_enum.h"
+#include "l3_inc_local.h"
+#include "mm_mmi_enums.h"
+
+#ifdef __LTE_RAT__
+#include "nvram_data_items.h"
+#include "nvram_editor_data_item.h"
+#endif
+
+#ifdef __IMS_SUPPORT__
+#include "ims_common_def.h"
+#include "ims_interface_md.h"
+#endif /* __IMS_SUPPORT__ */
+
+#include "rsvas_enum.h"
+#include "gmss_public.h"
+#include "rac_gmss_struct.h"
+#include "nwsel_eval_struct.h"
+#include "gmss_cval_struct.h"
+#include "nas_sv_css_struct.h"
+
+#include "nvram_editor_data_item.h"
+#include "nas_nvram_editor.h"
+#include "sim_ps_struct.h"
+#include "sim_public_enum_public.h"
+#include "mmss_def.h"
+#include "nvram_struct.h"
+#include "rac2l4c_struct.h"
+#include "l3_inc_enums.h"
+#include "nas_sv_struct.h"
+
+#include "l4c2rac_struct.h"
+#include "rac2l4c_struct.h"
+
+/* GMSS -> NWSEL */
+typedef rac_gmss_init_req_struct gmss_nwsel_init_req_struct;
+typedef rac_gmss_custom_plmn_list_update_req_struct gmss_nwsel_custom_plmn_list_update_req_struct;
+typedef rac_gmss_get_custom_plmn_list_req_struct gmss_nwsel_get_custom_plmn_list_req_struct;
+typedef rac_gmss_get_custom_plmn_list_cnf_struct gmss_nwsel_get_custom_plmn_list_cnf_struct;
+typedef rac_gmss_uemode_param_update_req_struct gmss_nwsel_uemode_param_update_req_struct;
+typedef rac_gmss_volte_status_update_req_struct gmss_nwsel_volte_status_update_req_struct;
+typedef rac_gmss_call_status_req_struct gmss_nwsel_call_status_ind_struct;
+
+typedef rac_gmss_set_plmn_barring_timer_req_struct gmss_nwsel_set_plmn_barring_timer_req_struct;
+typedef rac_gmss_set_plmn_barring_timer_cnf_struct gmss_nwsel_set_plmn_barring_timer_cnf_struct;
+typedef rac_gmss_get_plmn_barring_timer_req_struct gmss_nwsel_get_plmn_barring_timer_req_struct;
+typedef rac_gmss_get_plmn_barring_timer_cnf_struct gmss_nwsel_get_plmn_barring_timer_cnf_struct;
+typedef rac_gmss_ims_timer_status_update_req_struct gmss_nwsel_ims_timer_status_update_req_struct;
+typedef rac_gmss_abort_enwsel_search_req_struct gmss_nwsel_abort_enwsel_search_req_struct;
+typedef rac_gmss_ims_call_end_status_ind_struct gmss_nwsel_ims_call_end_status_ind_struct;
+typedef rac_gmss_set_ims_roaming_config_req_struct gmss_nwsel_set_ims_roaming_config_req_struct;
+typedef rac_gmss_set_prefer_rat_req_struct gmss_nwsel_set_prefer_rat_req_struct;
+typedef rac_gmss_get_prefer_rat_req_struct gmss_nwsel_get_prefer_rat_req_struct;
+typedef rac_gmss_get_prefer_rat_cnf_struct gmss_nwsel_get_prefer_rat_cnf_struct;
+typedef rac_gmss_camp_ui_ind_struct gmss_nwsel_camp_ui_ind_struct;
+#ifdef __MBIM_MS_NETWORK_BLACKLIST__
+typedef rac_gmss_fplmn_action_cnf_struct gmss_nwsel_fplmn_action_cnf_struct;
+typedef rac_gmss_nw_black_list_state_ind_struct gmss_nwsel_nw_black_list_state_ind_struct;
+#endif
+
+typedef struct {
+ LOCAL_PARA_HDR
+ plmn_selection_mode_enum plmn_sel_mode;
+} gmss_nwsel_sel_mode_req_struct;
+
+typedef nas_sv_any_attach_req_struct gmss_nwsel_attach_req_struct;
+
+typedef nas_sv_any_detach_req_struct gmss_nwsel_detach_req_struct;
+
+
+typedef struct {
+ LOCAL_PARA_HDR
+ plmn_reselection_enum plmn_search_mode; /* plmn_reselection_enum */
+ plmn_id_rat_struct selected_plmn; /* Selected PLMN */
+ kal_bool is_manual_csg_sel;
+ kal_uint32 csg_id;
+ rat_enum prefer_rat; // 0:default , 1:GSM , 2:UMTS
+ kal_bool from_l4c;
+ kal_uint32 factory_mode_arfcn; //0xFFFF means invalid arfcn, /* 20081110 mtk00714, for fast camp on test machine */
+ endc_search_enum endc_search; /* Search ENDC cell or not for LTE cell. */
+} gmss_nwsel_rac_plmn_search_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ plmn_id_rat_struct plmn_id_rat;
+} gmss_nwsel_rac_csg_list_req_struct;
+
+typedef nas_sv_gmss_set_rat_mode_req_struct gmss_nwsel_set_rat_mode_req_struct;
+
+typedef nas_sv_any_rfoff_req_struct gmss_nwsel_rfoff_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_supporting_roaming;
+ kal_bool disable_international_roaming_support;
+ kal_bool disable_national_roaming_support;
+ kal_bool disable_hhplmn_search_support;
+} gmss_nwsel_set_roaming_mode_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ elevator_mode_enum elevator_mode;
+}gmss_nwsel_elevator_mode_req_struct;
+
+/* NWSEL -> GMSS */
+
+typedef nwsel_eval_c2k_csfb_start_ind_struct gmss_nwsel_c2k_csfb_start_ind_struct;
+typedef nwsel_eval_c2k_csfb_est_ind_struct gmss_nwsel_c2k_csfb_est_ind_struct;
+typedef nwsel_eval_c2k_csfb_stop_ind_struct gmss_nwsel_c2k_csfb_stop_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ proc_status_enum status; /* proc_status_enum */
+ mm_cause_enum cause; /* mm_cause_enum */
+ kal_bool is_on_hplmn;
+ cell_info_and_rat_struct cell_info;
+} gmss_nwsel_rac_plmn_search_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ proc_status_enum status; /* proc_status_enum */
+ mm_cause_enum cause; /* mm_cause_enum */
+ kal_uint8 num_of_hplmn;
+ rac_plmn_list_struct plmn_list;
+ list_ind_source_enum source;
+ prio_class_enum gmss_class_list[RAC_MAX_NUM_LISTED_PLMNS];
+ kal_bool is_C2K_sib_scheduled;
+} gmss_nwsel_rac_plmn_list_cnf_struct;
+
+typedef gmss_nwsel_rac_plmn_list_cnf_struct gmss_nwsel_plmn_list_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 susp_id;
+ susp_resu_source_enum target;
+} gmss_nwsel_suspend_status_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ proc_status_enum status;
+ mm_cause_enum cause;
+ rac_csg_list_struct csg_list;
+} gmss_nwsel_rac_csg_list_cnf_struct;
+
+typedef nas_sv_gmss_set_rat_mode_cnf_struct gmss_nwsel_set_rat_mode_cnf_struct;
+
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_not_suspend; /* indicate if is_searching = TRUE is due to Gemini suspend */
+ kal_bool is_update_is_searching; /* if TRUE, RAC can check is_searching flag */
+ kal_bool is_searching;
+ kal_bool is_camp_on_cell; /* if is_searching = FALSE && is_camp_on_cell = FALSE, then RAC update to L4C;
+ else, ignore the is_searching flag. */
+ kal_bool is_on_hplmn;
+ kal_bool is_update_active_rat;
+ rat_enum active_rat;
+//#ifdef __KOR_CUSTOMIZATION__
+ plmn_id_struct rplmn; /* Get RPLMN */
+//#endif
+} gmss_nwsel_plmn_status_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ nwsel_ims_service_enum service_type;
+ kal_bool is_t311_expire; /* RRC connection release due to RRC T311 timer expire */
+} gmss_nwsel_ims_service_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool enter_cause18_plmn;
+} gmss_nwsel_cs_domain_availability_ind_struct;
+
+
+typedef struct {
+ LOCAL_PARA_HDR
+ susp_resu_action_enum action;
+ susp_resu_result_enum result;
+ susp_resu_source_enum target;
+} gmss_nwsel_susp_resu_update_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ susp_resu_mode_enum mode;
+ susp_resu_action_enum action;
+ kal_uint8 susp_id;
+ susp_resu_source_enum source;
+} gmss_nwsel_susp_resu_update_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint32 timer_interval[MAX_RECOVERY_TIMER_NUM];
+} gmss_nwsel_set_recovery_search_timer_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint32 timer_interval[MAX_RECOVERY_TIMER_NUM];
+} gmss_nwsel_get_recovery_search_timer_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool result;
+} gmss_nwsel_set_recovery_search_timer_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ plmn_id_struct plmn;
+ rat_enum rat;
+ kal_uint8 ara_start[2];
+ kal_uint8 ara_end[2];
+}gmss_nwsel_aral_update_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ voice_domain_preference_enum utran_voice_domain_preference;
+} gmss_nwsel_set_utran_voice_domain_preference_req_struct;
+
+typedef rac_gmss_data_service_status_update_req_struct gmss_nwsel_data_service_status_update_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 trx_id;
+
+ /* The MMSS search type.
+ */
+ mmss_search_type_enum mmss_search_type;
+
+ /* The search RAT, only valid for MMSS_SEARCH_NORMAL.
+ */
+ rat_enum rat;
+
+ /* The search prio_class, only valid for MMSS_SEARCH_NORMAL.
+ */
+ prio_class_enum gmss_class;
+
+ /* The search duplex type.
+ */
+ lte_duplex_type_enum duplex_type;
+
+ /* The search target's MCC. NWSEL will ignore PLMNs not in this MCC.
+ ** Only mcc1, mcc2, mcc3 fields are valid.
+ ** If the value are all 0x0F, it means no MCC restriction.
+ ** Note: This field only valid for MMSS_SEARCH_NORMAL.
+ */
+ plmn_id_struct mcc;
+
+ /* scan type for fast roaming.
+ */
+ scan_type_enum scan_type;
+
+ /* ims emergency cell required controlled by GMSS
+ */
+ kal_bool is_ims_emergency_required;
+
+ /* The MMSS search list(ie. MRU, RAL).
+ */
+ mmss_3gpp_list_struct mmss_list;
+
+ /* Search type, e.g stored ,quick or normal.
+ */
+ gmss_search_type_enum gmss_search_type;
+
+ kal_bool is_srlte;
+
+ kal_bool is_to_deactivate_c2k_cs_service;
+
+ // is first search after power-on
+ kal_bool is_power_on;
+
+ /* notify NWSEL if this is for better system reselection, replace MMSS_SEARCH_BETTER_SYSTEM_RESELECTION*/
+ kal_bool is_bsr;
+
+ /* notify NWSEL which camping cell VDM is used now. only for emergency call */
+ kal_uint16 camping_info_id;
+} gmss_nwsel_plmn_search_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 trx_id;
+ proc_status_enum proc_status;
+ rat_enum rat;
+ prio_class_enum gmss_class;
+ mm_cause_enum proc_cause;
+ mm_cause_enum nw_mm_cause;
+ esm_cause_enum esm_cause;
+} gmss_nwsel_plmn_search_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ rat_enum rat;
+ lte_duplex_type_enum duplex_type;
+ plmn_id_struct mcc; /* only mcc1, mcc2, mcc3 are valid, for NWSEL to ignore PLMNs not in this MCC */
+ prio_class_enum quick_list_class; /* Home or PREF: quick list; others: normal list*/
+ scan_type_enum scan_type;
+ kal_bool is_elevator_mode;
+} gmss_nwsel_plmn_list_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool is_user_plmn_list_ongoing;
+} gmss_nwsel_plmn_list_status_update_req_struct;
+
+typedef rac_gmss_plmn_list_req_struct gmss_nwsel_rac_plmn_list_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ plmn_id_struct mcc; /* only mcc1, mcc2, mcc3 are valid, for NWSEL to ignore PLMNs not in this MCC */
+ prio_class_enum quick_list_class; /* Home or PREF: quick list; others: normal list*/
+ gmss_rat_enum c2k_ps_rat; /* 1xRTT or HRPD */
+} gmss_nwsel_c2k_normal_service_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ proc_status_enum proc_status;
+ prio_class_enum gmss_class; // Only count plmn with suitable cell.
+ mm_cause_enum cause;
+ rac_plmn_list_struct plmn_list; // All available plmn including forbidden and may_suitable_cell_exist=FALSE.
+ prio_class_enum gmss_class_list[RAC_MAX_NUM_LISTED_PLMNS]; //mapping to plmn_list.plmn_id_rat[RAC_MAX_NUM_LISTED_PLMNS]
+} gmss_nwsel_plmn_list_cnf_struct;
+
+#ifdef __GEMINI__
+typedef struct {
+ LOCAL_PARA_HDR
+ as_suspend_mode_reason_enum cause;
+} gmss_nwsel_suspend_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_virtual_idle_mode;
+} gmss_nwsel_resume_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_virtual_idle_mode;
+} gmss_nwsel_virtual_mode_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_limited_virtual_idle;
+} gmss_nwsel_limited_virtual_idle_ind_struct;
+
+#endif /* __GEMINI__ */
+
+typedef struct {
+ LOCAL_PARA_HDR
+ mm_cause_enum cause; /* FORBIDDEN_PLMN for limited service; NO_COVERAGE for no coverage */
+ plmn_id_rat_struct plmn_id;
+ kal_bool immediate_duplex_mode_change;
+} gmss_nwsel_out_of_service_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ prio_class_enum gmss_class;
+ rat_enum rat;
+} gmss_nwsel_class_rat_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ nwsel_event_type_enum event;
+} gmss_nwsel_event_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_controlled_by_gmss;
+} gmss_nwsel_gmss_status_update_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool reset_bar_list;
+} gmss_nwsel_reset_search_result_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ irat_type_enum irat_type;
+ c2k_irat_attach_result_enum result;
+} gmss_nwsel_c2k_irat_complete_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ rat_enum rat;
+ as_sniffer_req_service_enum sniffer_service_type;
+} gmss_nwsel_sniffer_start_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ rat_enum rat;
+} gmss_nwsel_sniffer_stop_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ rat_enum rat;
+} gmss_nwsel_signal_appear_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ nvram_gmss_data_struct gmss_data;
+ //Use access_id = 0 to ignore NVRAM_WRITE_CNF
+ // access_id = 0x10~0x1f to wait NVRAM_WRITE_CNF of NVRAM_EF_NWSEL_DATA_LID
+ kal_uint8 access_id;
+} gmss_nwsel_nvram_write_req_struct;
+
+typedef nvram_write_cnf_struct gmss_nwsel_nvram_write_cnf_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ prio_class_enum prio_class;
+ rat_enum rat; /* used to notify nwsel mspl rat when suspend/resume */
+} gmss_nwsel_prio_class_update_req_struct;
+
+typedef sim_gmss_ready_ind_struct gmss_nwsel_sim_ready_req_struct;
+
+typedef sim_error_ind_struct gmss_nwsel_sim_error_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ act_sim_enum active_sim;
+} gmss_nwsel_active_sim_info_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 trx_id;
+ kal_uint8 rat_num;
+ rat_enum rat[MAX_MCC_SEARCH_RAT_NUM];
+ gmss_search_type_enum gmss_search_type;
+ kal_bool is_power_on; // is first search after power-on
+} gmss_nwsel_mcc_search_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 trx_id;
+ proc_status_enum proc_status;
+ kal_uint8 plmn_count;
+ plmn_id_rat_struct plmn_id_rat[RAC_MAX_NUM_LISTED_PLMNS];
+} gmss_nwsel_mcc_search_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ plmn_id_struct plmn_id;
+} gmss_nwsel_disable_eutran_req_struct;
+
+typedef l4crac_nw_reg_status_ind_struct gmss_nwsel_reg_status_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool data_enabled_setting;
+ kal_bool data_roaming_setting;
+} gmss_nwsel_roaming_data_config_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+
+ kal_bool is_sim_ready;
+ kal_uint8 trx_id;
+
+ // HOME+EHOME PLMN
+ // If num_of_ehplmn > 4(MAX_NUM_HPLMN), fill MAX_NUM_HPLMN at most
+ // num_of_ehplmn will be the number in this message
+ // is_remaining_ehplmn indicates the last ehplmn or not
+ kal_bool is_remaining_ehplmn;
+ kal_uint16 num_of_ehplmn;
+ plmn_id_rat_struct ehplmn[PLMN_INFO_MAX_NUM_HPLMN];
+
+ // PREFER PLMN
+ // If num_of_uplmn > 32(NWSEL_MAX_NUM_PLMNS), fill NWSEL_MAX_NUM_PLMNS PLMN at most.
+ // num_of_uplmn will be the number in this message
+ // is_remaining_uplmn indicates the last uplmn or not
+ kal_bool is_remaining_uplmn;
+ kal_uint16 num_of_uplmn;
+ plmn_id_rat_struct uplmn[NWSEL_MAX_NUM_PLMNS];
+
+ // If num_of_oplmn > 32(NWSEL_MAX_NUM_PLMNS), fill NWSEL_MAX_NUM_PLMNS PLMN at most.
+ // num_of_oplmn will be the number in this message
+ // is_remaining_oplmn indicates the last oplmn or not
+ kal_bool is_remaining_oplmn;
+ kal_uint16 num_of_oplmn;
+ plmn_id_rat_struct oplmn[NWSEL_MAX_NUM_PLMNS];
+} gmss_nwsel_plmn_info_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ umts_duplex_mode_type source_umts_duplex_mode;
+ umts_duplex_mode_type target_umts_duplex_mode;
+ lte_duplex_mode_type source_lte_duplex_mode;
+ lte_duplex_mode_type target_lte_duplex_mode;
+ mode_switch_cause_enum cause;
+ plmn_id_rat_struct plmn_id_rat; // only valid when mode_switch_cause == MODE_SWITCH_PLMN_CHANGE
+ // if rat is C2K, only MCC part is valid
+ kal_bool need_cnf;
+} gmss_nwsel_duplex_mode_change_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ mode_switch_cause_enum cause;
+} gmss_nwsel_global_mode_change_start_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool voice_over_ims_ongoing;
+} gmss_nwsel_ims_call_info_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ rat_enum rat;
+ plmn_id_struct plmn_id;
+} gmss_nwsel_set_aux_plmn_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ set_aux_plmn_result_enum result;
+} gmss_nwsel_set_aux_plmn_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ rat_enum rat;
+ plmn_id_struct plmn_id;
+ kal_uint16 arfcn;
+ kal_uint8 requested_band;
+} gmss_nwsel_set_mru_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ set_mru_result_enum result;
+} gmss_nwsel_set_mru_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_attach_needed;
+} gmss_nwsel_rat_change_success_notify_req_struct;
+
+/* NOTE: this primitive need to report in LWCG mode and even GWL only mode */
+typedef struct {
+ LOCAL_PARA_HDR
+
+ /**< the latest camping record */
+ mmss_3gpp_rec_type new_rec;
+
+ /**< indicate if the record is registered or not */
+ kal_bool is_registered;
+
+ /**< indicate if the cell support ims emergency call, only applicable when LTE cell */
+ kal_bool is_ims_emergency_support;
+
+ /**< indicate the current cell info trx id, used by VDM/GMSS/NWSEL to distinguish the emergency call cell used */
+ kal_uint16 camping_info_id;
+
+} gmss_nwsel_camping_info_ind_struct;
+
+// new primitive for AS IRAT stage 1 success
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_attach_needed;
+} gmss_nwsel_irat_c2l_success_notify_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ plmn_based_timer_enum timer_type;
+ timer_status_enum timer_status;
+ plmn_id_struct target_plmn;
+ plmn_restrict_additional_information_enum event;
+} gmss_nwsel_plmn_restriction_change_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 trx_id;
+ kal_uint16 last_idx_of_ehplmn;
+ kal_uint16 last_idx_of_oplmn;
+ kal_uint16 last_idx_of_uplmn;
+} gmss_nwsel_plmn_info_rsp_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ rat_enum rat;
+} gmss_nwsel_set_first_camp_on_prefer_rat_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool bEvdoEnterConnection; /* TRUE, means EVDO has been in PS connection state; else, EVDO has been in idle state. */
+} gmss_nwsel_evdo_ps_connection_status_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool b1xRttEnterConnection; /* TRUE, means 1xRTT has been in PS connection state; else, 1xRTT has been in idle state. */
+} gmss_nwsel_1xrtt_ps_connection_status_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ hvolte_mode_enum source_hvolte_mode; /** indicate original hvolte mode */ // enum defined in ims_common_def.h
+ hvolte_mode_enum target_hvolte_mode; /** indicate source hvolte mode */ // enum defined in ims_common_def.h
+ kal_bool is_silent_redial_and_call_ongoing;
+} gmss_nwsel_hvolte_mode_change_req_struct;
+
+#ifdef __NWSEL_QUICK_SEARCH_FOR_ROAMING__
+typedef l4crac_high_prio_search_timer_config_req_struct gmss_nwsel_high_prio_search_timer_config_req_struct;
+#endif
+
+typedef struct {
+ LOCAL_PARA_HDR
+ rat_enum rat; /* only valid when emc_bar_type != EMC_BAR_TYPE_NONE */
+ plmn_id_struct plmn_id; /* only valid when emc_bar_type != EMC_BAR_TYPE_NONE */
+ kal_uint16 band; /* only valid when emc_bar_type != EMC_BAR_TYPE_NONE */
+} gmss_nwsel_emc_bar_network_req_struct;
+
+//#ifdef __KOR_CUSTOMIZATION__
+typedef struct {
+ LOCAL_PARA_HDR
+ plmn_id_struct rplmn; /* Get RPLMN */
+} gmss_nwsel_rplmn_ind_struct;
+//#endif
+
+typedef l4crac_fplmn_action_req_struct gmss_nwsel_fplmn_action_req_struct;
+
+typedef l4crac_nw_reg_rej_ind_struct gmss_nwsel_nw_reg_rej_ind_struct;
+
+typedef l4crac_plmn_found_ind_struct gmss_nwsel_rac_plmn_found_ind_struct;
+
+typedef l4crac_set_allowed_mcc_list_req_struct gmss_nwsel_set_allowed_mcc_list_req_struct;
+typedef l4crac_set_allowed_mcc_list_cnf_struct gmss_nwsel_set_allowed_mcc_list_cnf_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ recover_cause_enum cause;
+} gmss_nwsel_rac_invalid_sim_recover_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ rat_type_enum source_rat;
+ rat_type_enum target_rat;
+} gmss_nwsel_gmss_irat_start_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ rat_type_enum source_rat;
+ rat_type_enum target_rat;
+} gmss_nwsel_gmss_irat_finish_ind_struct;
+
+typedef nas_sv_css_mcc_search_req_struct gmss_nwsel_css_mcc_search_req_struct;
+typedef nas_sv_css_mcc_search_cnf_struct gmss_nwsel_css_mcc_search_cnf_struct;
+typedef nas_sv_css_ps_reg_req_struct gmss_nwsel_css_ps_reg_req_struct;
+typedef nas_sv_css_ps_reg_cnf_struct gmss_nwsel_css_ps_reg_cnf_struct;
+typedef nas_sv_css_cs_reg_req_struct gmss_nwsel_css_cs_reg_req_struct;
+typedef nas_sv_css_cs_reg_cnf_struct gmss_nwsel_css_cs_reg_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_ims_support;
+} gmss_nwsel_ims_vops_support_status_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ ims_special_event_enum ims_event;
+ kal_uint16 sip_cause;
+} gmss_nwsel_ims_reg_status_update_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ rat_enum disable_rat;
+} gmss_nwsel_rat_disable_config_req_struct;
+
+typedef rac_gmss_data_allow_req_struct gmss_nwsel_data_allow_req_struct;
+
+typedef gmss_cval_send_dan_sms_ind_struct gmss_nwsel_send_dan_sms_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool is_invalid;
+ plmn_id_struct plmn_id;
+} gmss_nwsel_illegal_me_ind_struct;
+
+#if defined(__LTE_RAT__) && (defined(__GSM_RAT__) || defined(__UMTS_RAT__))
+typedef nwsel_eval_power_on_protection_req_struct gmss_nwsel_power_on_protection_req_struct;
+#endif
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 trx_id; /* Transaction ID */
+ rat_enum available_rat; /* rat need to be searched */
+ rat_enum prefer_rat; /* subset of available rat, search those RAT first. RATN_NONE if no preference */
+ module_type source; /* The source module of this service scan */
+} gmss_nwsel_service_scan_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 trx_id; /* Transaction ID */
+ proc_status_enum status; /* PROC_SUCCESS, PROC_FAILED or PROC_REJECTED */
+ module_type source; /* The source module of this service scan */
+} gmss_nwsel_service_scan_cnf_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool normal_oos_recovery_round_present;
+ kal_uint8 normal_oos_recovery_round; /* default value =5, range [2,10] */
+ kal_bool inactive_fullband_period_present;
+ kal_uint16 inactive_fullband_period; /* default value =200s, range [90,360] */
+ kal_bool inactive_sniffer_period_present;
+ kal_uint8 inactive_sniffer_period; /* default value =30s, range [10,60] */
+ kal_bool is_inactive_mode_present;
+ kal_bool is_inactive_mode; /* TRUE: Enter inactive mode, FALSE: Leave inactive mode*/
+} gmss_nwsel_inactive_mode_configuration_req_struct;
+
+typedef rac_gmss_screen_on_req_struct gmss_nwsel_screen_on_req_struct;
+typedef rac_gmss_try_switch_rat_result_ind_struct gmss_nwsel_try_switch_rat_result_ind_struct;
+
+typedef nwsel_nas_sv_sys_info_update_ind_struct gmss_nwsel_sys_info_update_ind_struct;
+typedef nwsel_nas_sv_plmn_found_ind_struct gmss_nwsel_plmn_found_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ plmn_search_status_enum plmn_search_status;
+ regn_proc_status_enum regn_proc_stastus;
+} gmss_nwsel_regn_status_update_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool is_over_inactive_mode_threshold; // True: first scan and sleep is done
+} gmss_nwsel_service_recovery_round_update_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ rat_enum rat;
+ network_scan_rat_union_type nw_scan_rat_output;
+ nwsel_plmn_list_status_enum status;
+} gmss_nwsel_rac_plmn_scan_ind_struct;
+
+#endif
diff --git a/mcu/protocol/interface/general/irat_common_enums.h b/mcu/protocol/interface/general/irat_common_enums.h
new file mode 100644
index 0000000..6dd99f9
--- /dev/null
+++ b/mcu/protocol/interface/general/irat_common_enums.h
@@ -0,0 +1,659 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * irat_common_enums.h
+ *
+ * Project:
+ * --------
+ * MOLY
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ ****************************************************************************/
+
+#ifndef _IRAT_COMMON_ENUMS_H
+#define _IRAT_COMMON_ENUMS_H
+
+#include "as_inter_core_enum.h"
+#include "irat_common_enums_public.h" //TODO: CL#948941, l1core asinterface build error
+#include "global_type.h"
+/* MACROS ******************************************************************/
+/* MAX Values */
+#define STADNBY_GSM_MAX_BSIC_NUM 32
+
+#define MAX_NUM_CSG_FREQ (8) /* Maximum number used for 3G4 Autonumous CSG Search */
+#define MAX_NUM_ECELL_MEAS_RESULT (8)
+
+/* Maximum number used for 2G or 3G to LTE redirection information */
+#define PCI_BITMAP_MAX_NUM (63)
+
+#define MAX_NUM_CSG_CARRIERS 8
+#define MAX_NR_OF_CSG_CELLS_IN_CELL_LIST 8
+
+#if (defined(__UMTS_R5__) && (defined(__GERAN_R5__)))
+#define MAX_GSM_SYS_INFO_BLOCKS_NUM (10)
+#endif
+
+#define MAX_TARGET_GSM_CELLS_NUM (96)
+
+/* Maximun size of GSM list for 4G2 IR direction */
+#define MAX_BYTE_OF_GSM_ARFCN (128)
+
+/* Used for IR Handover */
+#define MAX_LEN_HO_TO_UTRAN_MSG (251) /* Octets */
+#define MAX_LEN_UTRAN_HANDOVER_INFO_MSG (251) /* Octets */
+#define MAX_LEN_UTRAN_HANDOVER_INFO_EUTRAN_MSG (350) /* Octets*/
+#define NAS_SECURITY_PARAM_LEN (6)
+
+/* Used for IR Redirection (ts_eutra_redirect_info) */
+#define MAX_UAS_EAS_REDIRECT_FREQ_NUM (8)
+#define MAX_NRRC_ERRC_REDIRECT_FREQ_NUM (8)
+
+/* NAS Array Length */
+#define UGSM_TI_IE_LEN 2 // according to 24.007 11.2.3.1.3
+#define CK_LEN 16
+#define IK_LEN 16
+#define KC_LEN 8
+#define KC128_LEN 16
+#define PTMSI_LEN 4 /* not include P-TMSI Mobile IE header (0xF4) */
+#define PTMSI_SIG_LEN 3
+#define RAI_LEN 6
+#define LAI_LEN 5
+#define MS_ID_LEN 8
+#define TMSI_LEN 4
+
+#define KASME_NUM 32
+#define NH_NUM 32
+
+#if (CUR_GEN >= MD_GEN97)
+/**
+ * Used for EN-DC and NR capability enquiry in EAS
+ * Data: FreqBandList in TS 38.331
+ * Mathematics: bandEUTRA: 26+(256-1)*9 = 2321
+ * bandNR: 28+(1024-1)*11 = 11281
+ * Total: 1700.25 (octets)
+ */
+#define MAX_LEN_FREQ_BAND_LIST_STRING (1700)
+
+/**
+ * LTE PDCP: "The maximum supported size of a PDCP SDU is 8188 octets.
+ * (36.323) The maximum supported size of a PDCP Control PDU is 8188 octets."
+ * Take UE-EUTRA-Capability into account, let's set the maximum size as 2816
+ * for the time being. (i.e. It shall warn if any capability size is larger than
+ * one-third of maximum allowed PDCP SDU size. (8188 * 1/3))
+ */
+#define MAX_LEN_EUTRA_NR_CAP_STRING (2816) /**< Octets */
+#define MAX_LEN_NR_CAP_STRING (2816) /**< Octets */
+#endif /* (CUR_GEN >= MD_GEN97) */
+
+/* TYPES DEFINITIONS ********************************************************/
+typedef enum
+{
+ IR_RESULT_SUCCESS = 0, //Inter-RAT change is successful.
+ IR_RESULT_FAILURE = 1, //Inter-RAT change is failed in target RAT.
+ IR_RESULT_REJECT = 2, //Inter-RAT change is rejected in source RAT.
+ IR_RESULT_SUCCESS_FORCED_BY_NAS = 3, //Inter-RAT change is forced to success in target NAS.
+ IR_RESULT_GEMINI_SUSPEND_REJECT = 4 // Inter-RAT change is rejected due to gemini suspend
+} irat_result_enum;
+
+typedef enum
+{
+ IR_SM_VIEW_SUCCESS,
+ IR_SM_VIEW_FAIL,
+ IR_SM_VIEW_SUCCESS_BUT_23G_RAT_UNKNOWN, // due to 4G23 IR_TYPE_SEARCH
+ IR_SM_VIEW_NOT_REVELENT_TO_SM //ex: CCO stage 1, from SM's point of view, CCO stage 1 does not mean anything, SM does not need to do anything, SM just need to relay this msg.
+} irat_sm_view_result_enum;
+
+typedef enum
+{
+ IR_TRANSFER_BEARER_PRIMARY_PDP_CONTEXT = 0x00,
+ IR_TRANSFER_BEARER_DEFAULT_EPS_CONTEXT = IR_TRANSFER_BEARER_PRIMARY_PDP_CONTEXT,
+ IR_TRANSFER_BEARER_SECONDARY_PDP_CONTEXT = 0x01,
+ IR_TRANSFER_BEARER_DEDICATED_EPS_CONTEXT = IR_TRANSFER_BEARER_SECONDARY_PDP_CONTEXT,
+ IR_TRANSFER_BEARER_REJECTED_BY_SM_DUE_TO_NSAPI_NOT_VALID,
+ IR_TRANSFER_BEARER_REJECTED_BY_SM_DUE_TO_PDP_ADDR_TYPE_NOT_VALID,
+ IR_TRANSFER_BEARER_REJECTED_BY_SM_DUE_TO_TFT_VALIDATE_FAIL,
+ IR_TRANSFER_BEARER_REJECTED_BY_SM_DUE_TO_NO_23G_QOS,
+ IR_TRANSFER_BEARER_REJECTED_BY_SM_DUE_TO_NO_23G_TI,
+ IR_TRANSFER_BEARER_REJECTED_BY_SM_DUE_TO_NO_2G_LLC_SAPI,
+ IR_TRANSFER_BEARER_REJECTED_BY_SM_DUE_TO_NO_2G_RADIO_PRIORITY,
+ IR_TRANSFER_BEARER_REJECTED_BY_SM_DUE_TO_NO_EPS_QOS,
+ IR_TRANSFER_BEARER_REJECTED_BY_SM_DUE_TO_EXCEED_GPRS_MAX_PDP_SUPPORT_KILL_QCI_1_TO_4,
+ IR_TRANSFER_BEARER_REJECTED_BY_SM_DUE_TO_EXCEED_GPRS_MAX_PDP_SUPPORT_KILL_QCI_5_TO_9_SECONDARY,
+ IR_TRANSFER_BEARER_REJECTED_BY_SM_DUE_TO_EXCEED_GPRS_MAX_PDP_SUPPORT_KILL_QCI_5_TO_9_PRIMARY,
+ IR_TRANSFER_BEARER_REJECTED_BY_SM_DUE_TO_PRIMARY_MAPPED_FAILED,
+ IR_TRANSFER_BEARER_REJECTED_BY_SM_DUE_TO_EMC_BEARER_NOT_ALLOWED,
+ IR_TRANSFER_BEARER_REJECTED_BY_SM_DUE_TO_4G23_IMS_PDN_LOCAL_RELEASE,
+ IR_TRANSFER_BEARER_BEARER_TYPE_NOT_DETERMINED_YET_IN_4G
+} irat_transfer_bearer_type_enum;
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+typedef enum
+{
+ RAT_TYPE_GAS, // GERAN
+ RAT_TYPE_UAS_FDD, // UTRAN (FDD mode)
+ RAT_TYPE_UAS_TDD, // UTRAN (TDD mode)
+ RAT_TYPE_EAS, // E-UTRAN (LTE)
+ RAT_TYPE_GAS_UAS_TBD, // if 4G23 irat_type == IR_TYPE_SEARCH, LTE rat does not know which target rat will be chosen.
+ RAT_TYPE_CAS, // CDMA2000
+ RAT_TYPE_NRAS, // NR
+ RAT_TYPE_NONE // For invalid value, add new RAT aboue it.
+} rat_type_enum;
+
+typedef enum {
+ NAS_SV_CAMPED_ON_CELL_TYPE_UNKNOW,
+ NAS_SV_CAMPED_ON_CELL_TYPE_ACCEPTABLE_CELL,
+ NAS_SV_CAMPED_ON_CELL_TYPE_SUITABLE_CELL,
+ NAS_SV_CAMPED_ON_CELL_TYPE_MAX_NUM_OF_CELL_TYPE,
+} nas_sv_camped_on_cell_type_enum;
+
+typedef enum
+{
+ BEARER_MAP_INVALID, // no such bearer
+ BEARER_MAP_ACTIVE, // bearer mapping success
+ BEARER_MAP_FAILED, // bearer mapping failure and local released
+ BEARER_MAP_FAILED_DUE_TO_DETACH, // bearer mapping failure because new MM is detached.
+ BEARER_MAP_FAILED_DUE_TO_CURRENT_SIM_NOT_HAVE_CONTEXT_MEMORY, // for example, if ESM context transfer to MOD_SM, but context memory is occupied by MOD_SM_2, that means MOD_SM_2 has PDP and hense MOD_SM cannot activate any PDP
+ BEARER_MAP_FAILED_DUE_TO_NSAPI_NOT_VALID,
+ BEARER_MAP_FAILED_DUE_TO_PDP_ADDR_TYPE_NOT_VALID,
+ BEARER_MAP_FAILED_DUE_TO_TFT_VALIDATE_FAIL,
+ BEARER_MAP_FAILED_DUE_TO_NO_23G_QOS,
+ BEARER_MAP_FAILED_DUE_TO_NO_23G_TI,
+ BEARER_MAP_FAILED_DUE_TO_NO_2G_LLC_SAPI,
+ BEARER_MAP_FAILED_DUE_TO_NO_2G_RADIO_PRIORITY,
+ BEARER_MAP_FAILED_DUE_TO_NO_EPS_QOS,
+ BEARER_MAP_FAILED_DUE_TO_EXCEED_GPRS_MAX_PDP_SUPPORT_KILL_QCI_1_TO_4,
+ BEARER_MAP_FAILED_DUE_TO_EXCEED_GPRS_MAX_PDP_SUPPORT_KILL_QCI_5_TO_9_SECONDARY,
+ BEARER_MAP_FAILED_DUE_TO_EXCEED_GPRS_MAX_PDP_SUPPORT_KILL_QCI_5_TO_9_PRIMARY,
+ BEARER_MAP_FAILED_DUE_TO_PRIMARY_MAPPED_FAILED,
+ BEARER_MAP_FAILED_DUE_TO_EMC_BEARER_NOT_ALLOWED,
+ BEARER_MAP_FAILED_DUE_TO_4G23_IMS_LOCAL_RELEASE,
+ BEARER_MAP_FAILED_DUE_TO_4G5_FAILURE,
+ //BEARER_MAP_LOCAL_RELEASE // bearer local released
+} bearer_mapping_result_enum;
+
+typedef enum
+{
+ HO_FROM_LTE_TYPE_INVALID,
+ HO_FROM_LTE_TYPE_PS_HO,
+ HO_FROM_LTE_TYPE_SRVCC_HO,
+ HO_FROM_LTE_TYPE_PS_SRVCC_HO
+} ho_from_lte_type_enum;
+
+typedef enum
+{
+ GAS_CIPHER_ALGO_INVALID,
+ GAS_CIPHER_ALGO_KC,
+ GAS_CIPHER_ALGO_KC128
+} gas_cipher_algo_enum;
+
+typedef enum
+{
+ DOMAIN_ID_INVALID,
+ DOMAIN_ID_PS_PRESENCE,
+ DOMAIN_ID_CS_PRESENCE
+} sec_ctxt_domain_id_enum;
+
+typedef enum
+{
+ MT_CSFB_TYPE_INVALID,
+ MT_CSFB_TYPE_STMSI_TMSI,
+ MT_CSFB_TYPE_IMSI
+} mt_csfb_type_enum;
+
+typedef enum
+{
+ LOOPBACK_MODE_DEACTIVATE,
+ LOOPBACK_MODE_ACTIVATE_A,
+ LOOPBACK_MODE_ACTIVATE_B,
+ LOOPBACK_MODE_ACTIVATE_C,
+ LOOPBACK_MODE_CLOSELOOP_A,
+ LOOPBACK_MODE_CLOSELOOP_B,
+ LOOPBACK_MODE_CLOSELOOP_C
+} loopback_mode_status_enum;
+
+typedef enum
+{
+ TAU_NOT_REQUIRED,
+ TAU_REQUIRED,
+ TAU_COMB_TALA_IMSI_ATTACH
+} tau_required_enum;
+
+#if 0 // use the one defined in l3_inc_enums.h instead
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+/* Merged from GSM / UMTS Multimode development branch **********/
+typedef enum
+{
+ UMTS_UNDEFINED_MODE,
+ UMTS_FDD_MODE,
+ UMTS_TDD_MODE
+} te_umts_mode;
+
+typedef enum {
+ AUTO_SEARCH_START = 0x00,
+ AUTO_SEARCH_RESUME = 0x01,
+ AUTO_SEARCH_STOP = 0x02
+} auto_search_cmd_enum;
+
+typedef enum {
+ SEARCH_STATUS_SUSPENDED = 0x00,
+ SEARCH_STATUS_FINISHED = 0x01,
+ SEARCH_STATUS_STOPPED = 0x02
+} search_status_enum;
+
+/**
+ * @brief
+ * te_ir_handover_status specifies the result of inter-RAT handover
+ * procedure
+ * .
+ */
+typedef enum
+{
+ /* Handover message is correct or procedure is success */
+ IR_HANDOVER_STATUS_NORMAL_EVENT,
+ /* Applicable during Evaluation only */
+ IR_HANDOVER_STATUS_FREQUENCY_NOT_IMPLEMENTED,
+ /* Applicable only for Activation procedure
+ * HO to GSM: Handover procedure failed due to lower layer failure at GSM.
+ * HO to UTRAN: Failure to establish channels on cell(s) required for handover
+ * at any point during handover activation procedure.
+ */
+ IR_HANDOVER_STATUS_PHYSICAL_CHANNEL_FAILURE,
+ /* Applicable during Evaluation procedure
+ * Handover procedure failed due to inconsitent/missing parameters protocol
+ * error.
+ */
+ IR_HANDOVER_STATUS_PROTOCOL_ERROR,
+ /* Applicable only during Evaluation procedure
+ * HO to GSM: Handover message has a channel mode configuration which is not
+ * supported
+ * HO to UTRAN : Predefined configuration not read or default configuration
+ * not implemented.
+ */
+ IR_HANDOVER_STATUS_UNSUPPORTED_CONFIGURATION,
+ /* Applicable only for activation procedure, e.g. abort CS connection by UAS */
+ IR_HANDOVER_STATUS_UNSPICIFIED_ERROR
+} te_ir_handover_status;
+
+typedef enum {
+ IR_FREQUENCY_NOT_IMPLEMENTED,
+ IR_NO_RESPONSE_ON_TARGET_CELL,
+ IR_REJECT_ON_TARGET_CELL,
+ /* 3G failed reason */
+ IR_CONFIGURATION_UNACCEPTABLE,
+ IR_PHYSICAL_CHANNEL_FAILURE,
+ /* for Gemini */
+ IR_SUSPENDING_DURING_IR_CELL_RESEL,
+ IR_CELL_CHANGE_FAIL_REASON_NONE
+} te_ir_cell_change_fail_reason_enum;
+
+typedef enum
+{
+ GAS_UAS_REDIRECTION_INFO = 0x00,
+ EAS_UAS_REDIRECTION_INFO = 0x01,
+ UAS_GAS_REDIRECTION_INFO = 0x02,
+ EAS_GAS_REDIRECTION_INFO = 0x03
+} te_ir_redirection_type;
+
+#ifdef __SRVCC_CELL_INFO__
+typedef enum
+{
+ IR_HANDOVER_PHY_FAIL_SUBCAUSE_NONE = 0x00,
+ IR_HANDOVER_PHY_FAIL_SUBCAUSE_TIME_ADV_OUT_OF_RANGE,
+ IR_HANDOVER_PHY_FAIL_SUBCAUSE_N200_TIMEOUT,
+ IR_HANDOVER_PHY_FAIL_SUBCAUSE_T3124_TIMEOUT,
+ IR_HANDOVER_PHY_FAIL_SUBCAUSE_CONTENTION_RES_FAIL,
+ IR_HANDOVER_PHY_FAIL_SUBCAUSE_OTHER
+}te_ir_handover_phy_fail_subcause;
+#endif /* __SRVCC_CELL_INFO__*/
+
+
+#if (defined(__UMTS_R5__) && defined(__GERAN_R5__))
+typedef enum{
+ GERAN_SysInfo_None,
+ GERAN_SysInfo_SI,
+ GERAN_SysInfo_PSI
+} GERAN_SysInfoType;
+#endif
+
+typedef enum {
+ CIPHER_STATUS_NOT_STARTED,
+ CIPHER_STATUS_STARTED
+} te_cn_domain_cipher_status;
+
+typedef enum
+{
+ IMSI_PAGING_TYPE,
+ TMSI_PAGING_TYPE
+} paging_type_enum; /* paging for CSFB */
+
+typedef enum
+{
+ UNKNOWN_SERVICE_TYPE,
+ CALL_SERVICE_TYPE,
+ SS_SERVICE_TYPE,
+ LCS_SERVICE_TYPE
+} csfb_service_type_enum; /* service type for MO/MT CSFB */
+
+typedef enum
+{
+ CSFB_IND_NONE,
+ CSFB_IND_MO,
+ CSFB_IND_MT
+} csfb_indicator_enum; /* paging for CSFB */
+
+
+typedef enum
+{
+ NORMAL_CELL = 0x00,
+ CSG_CELL = 0x01,
+ HYBRID_CELL = 0x02
+} csg_access_mode_enum;
+
+typedef enum
+{
+ BEARER_SERVICE_TYPE_NORMAL = 0,
+ BEARER_SERVICE_TYPE_EMERGENCY
+} bearer_service_type_enum;
+
+typedef enum
+{
+ CONN_REL_IND_CAUSE_OTHER,
+ CONN_REL_IND_CAUSE_CSFB_HIGH /* 36.331 ReleaseCause */
+} conn_rel_ind_cause_enum;
+
+typedef enum
+{
+ C2K_IRAT_ATTACH_SUCCESS = 0,
+ C2K_IRAT_ATTACH_FAILURE
+} c2k_irat_attach_result_enum;
+
+
+/* __ALPS02506878_SUPPORT__ */
+typedef enum{
+ IR_CALL_TYPE_MO,
+ IR_CALL_TYPE_MT,
+ IR_CALL_TYPE_EMERGENCY,
+ IR_CALL_TYPE_INVALID
+} te_ir_call_type;
+
+typedef enum{
+ ENASAS_ENTER_FLIGHT_MODE,
+ ENASAS_LEAVE_FLIGHT_MODE,
+} enasas_flight_mode_enum;
+
+typedef erac_rat_enum enasas_rat_enum;
+
+typedef enum {
+ CA_BANDWIDTH_CLASS_EUTRA_A,
+ CA_BANDWIDTH_CLASS_EUTRA_B,
+ CA_BANDWIDTH_CLASS_EUTRA_C,
+ CA_BANDWIDTH_CLASS_EUTRA_D,
+ CA_BANDWIDTH_CLASS_EUTRA_E,
+ CA_BANDWIDTH_CLASS_EUTRA_F,
+ CA_BANDWIDTH_CLASS_EUTRA_INVALID
+} ca_bandwidth_class_eutra_enum;
+
+#endif /* _IRAT_COMMON_ENUMS_H */
diff --git a/mcu/protocol/interface/general/irat_common_struct.h b/mcu/protocol/interface/general/irat_common_struct.h
new file mode 100644
index 0000000..f79a1fd
--- /dev/null
+++ b/mcu/protocol/interface/general/irat_common_struct.h
@@ -0,0 +1,884 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * irat_common_struct.h
+ *
+ * Project:
+ * --------
+ * MOLY
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ ****************************************************************************/
+
+#ifndef _IRAT_COMMON_STRUCT_H
+#define _IRAT_COMMON_STRUCT_H
+
+#include "kal_general_types.h"
+#include "mmi_l3_enums.h"
+#include "mcd_l3_inc_gprs_struct.h"
+#include "ps_public_enum.h"
+#include "stack_config.h"
+#include "l3_inc_enums.h"
+#include "l3_inc_local.h"
+#include "irat_common_enums.h"
+#include "mcd_l3_inc_struct.h"
+#include "as_inter_core_struct.h"
+#include "global_type.h"
+#include "general_qos_struct.h"
+
+#define MAX_VAL(VAL_A, VAL_B) (((VAL_A) > (VAL_B)) ? (VAL_A):(VAL_B))
+
+#if defined(GPRS_MAX_PDP_SUPPORT) && defined(LTE_MAX_EPSB_SUPPORT)
+ #define MAX_TRANSFERRED_BEARER_NUM MAX_VAL(GPRS_MAX_PDP_SUPPORT, LTE_MAX_EPSB_SUPPORT)
+#elif defined(LTE_MAX_EPSB_SUPPORT)
+ #define MAX_TRANSFERRED_BEARER_NUM LTE_MAX_EPSB_SUPPORT // fail safe, this line has no meaning. just prevent compile error
+#else
+ #define MAX_TRANSFERRED_BEARER_NUM GPRS_MAX_PDP_SUPPORT // fail safe, this line has no meaning. just prevent compile error
+#endif
+
+//#define MAX_BEARER_CTXT_NUM MAX_TRANSFERRED_BEARER_NUM
+
+#define MAX_BEARER_CTXT_NUM 11
+#define MAX_BEARER_ID 16
+
+typedef struct {
+ kal_uint8 ti_len;
+ kal_uint8 ti[UGSM_TI_IE_LEN];
+}irat_ti_struct;
+
+typedef struct {
+ kal_bool cause_present;
+ ps_cause_enum cause_value;
+}irat_addr_type_limitation_cause_struct;
+
+typedef struct
+{
+ kal_uint8 qci;
+} simple_eps_qos_struct;
+
+typedef struct {
+ // if iRAT, source SM need to fill the following fields
+ irat_transfer_bearer_type_enum bearer_type;
+
+ // NSAPI / EBI (range is 5~15)
+ kal_uint8 bearer_id;
+
+ // NSAPI / EBI (range is 5~15)
+ kal_uint8 linked_bearer_id;
+
+
+ // secondary bearer set ip_addr_type = NULL_TYPE
+ ip_addr_struct ip_addr;
+
+ // secondary bearer doesn't need to set this field
+ apn_struct apn;
+
+ // this parameter is critical to 23G. SM can just send MAP FAIL to ESM when this parameter is not present
+ kal_bool is_ug_qos_present;
+ // negotiated qos parameter used in 23G
+ qos_struct ug_qos;
+
+ kal_bool is_eps_qos_present;
+ // When ESM transfer more than GPRS_MAX_PDP_SUPPORT contexts to SM,
+ // SM need to use eps_qos to decide which contexts need to be mapped failed and inform ESM to local release it.
+ eps_qos_struct eps_qos;
+
+ // this parameter is critical to 2G. if iRAT is 4G2, SM can just send MAP FAIL to ESM when this parameter is not present
+ kal_bool is_llc_sapi_present;
+ kal_uint8 llc_sapi;
+
+ // this parameter is critical to 2G. if iRAT is 4G2, SM can just send MAP FAIL to ESM when this parameter is not present
+ kal_bool is_radio_priority_present;
+ kal_uint8 radio_priority;
+
+ // this parameter is critical to 2G. if iRAT is 4G2, SM can just send MAP FAIL to ESM when this parameter is not present
+ kal_bool is_pfi_present;
+ kal_uint8 pfi;
+
+ // this parameter is critical to 23G. SM can just send MAP FAIL to ESM when this parameter is not present
+ kal_bool is_ti_present;
+ irat_ti_struct ti;
+
+ irat_addr_type_limitation_cause_struct addr_type_limitation_cause;
+
+ bearer_service_type_enum bearer_service_type;
+
+ /* only used in 23G4 inter-RAT, when tcm_requested_deact==KAL_TRUE, this PDP must map fail, used to perform local deact */
+ kal_bool tcm_requested_deact;
+
+ //BCM and ETFT parameters to maintain sync between SM and ESM
+ bcm_enum bcm_info;
+ etft_enum etft_info;
+}bearer_ctxt_struct;
+
+
+typedef struct {
+ kal_uint8 total_number; // Total number of PDP context/EPS bearer which will transfer to target RAT
+ bearer_ctxt_struct context[MAX_TRANSFERRED_BEARER_NUM]; // bearer context which will transfer to target RAT
+}bearer_ctxt_transfer_struct;
+
+typedef struct {
+ // NSAPI / EBI (range is 5~15)
+ kal_uint8 bearer_id;
+
+ // this parameter is critical to 23G. SM can just send MAP FAIL to ESM when this parameter is not present
+ kal_bool is_ug_qos_present;
+ // negotiated qos parameter used in 23G
+ qos_struct ug_qos;
+
+ // this parameter is critical to 2G. if iRAT is 4G2, SM can just send MAP FAIL to ESM when this parameter is not present
+ kal_bool is_llc_sapi_present;
+ kal_uint8 llc_sapi;
+
+ // this parameter is critical to 2G. if iRAT is 4G2, SM can just send MAP FAIL to ESM when this parameter is not present
+ kal_bool is_radio_priority_present;
+ kal_uint8 radio_priority;
+
+ // this parameter is critical to 2G. if iRAT is 4G2, SM can just send MAP FAIL to ESM when this parameter is not present
+ kal_bool is_pfi_present;
+ kal_uint8 pfi;
+
+ // this parameter is critical to 23G. SM can just send MAP FAIL to ESM when this parameter is not present
+ kal_bool is_ti_present;
+ irat_ti_struct ti;
+
+}bearer_legacy_rat_para_struct;
+
+
+typedef struct
+{
+ sec_ctxt_domain_id_enum domain_id;
+ kal_uint8 umts_ciphering_key[CK_LEN];
+ kal_uint8 umts_integrity_key[IK_LEN];
+ kal_uint8 gsm_ciphering_key[KC_LEN];
+ kal_uint8 gsm_ciphering_key128[KC128_LEN];
+}security_context_struct;
+
+
+/* Merged from GSM / UMTS Multimode development branch **********/
+/* Common structure */
+/* Measurement request/confirm related: GAS/UAS to EAS */
+
+typedef struct
+{
+ kal_uint16 physical_cell_id;
+ kal_int16 cpich_rscp;
+ kal_int16 cpich_ec_n0;
+} ir_reported_fdd_cells_csg_meas_info;
+
+typedef struct
+{
+ kal_uint16 uarfcn;
+ kal_int16 uarfcn_rssi;
+ kal_uint8 num_reported_cells;
+ ir_reported_fdd_cells_csg_meas_info ir_reported_fdd_cells_csg_meas_info_list[MAX_NR_OF_CSG_CELLS_IN_CELL_LIST];
+} ir_umts_carrier_csg_meas_result_struct;
+
+typedef struct FDD_meas_UmtsCellList
+{
+ kal_uint8 numElements;
+
+ meas_UmtsCellListPerCarrier element[FDD_MAX_NUM_MEASURED_UMTS_CARRIERS];
+}
+FDD_meas_UmtsCellList;
+
+typedef struct TDD_meas_UmtsCellList
+{
+ kal_uint8 numElements;
+
+ meas_UmtsCellListPerCarrier element[TDD_MAX_NUM_MEASURED_UMTS_CARRIERS];
+}
+TDD_meas_UmtsCellList;
+
+typedef struct
+{
+ kal_bool is_valid;
+ EARFCN earfcn;
+ kal_uint16 pci;
+ kal_uint32 cell_id;
+ kal_bool sib2_hs_flg;
+ kal_bool el1_hst_md_flg;
+ kal_uint32 valid_duration;
+} ir_lte_scell_struct;
+
+/* This structure represents the redirection info from GSM or UMTS to LTE */
+typedef struct
+{
+ EARFCN earfcn;
+ kal_bool target_cell_valid_flag;
+ kal_uint16 target_cell;
+ kal_bool not_allowed_exist_flag;
+ /* It is a LTE PCI bit map (0-503), least significant bit of not_allowed_cells [0]
+ * represents PCI-0, and the most significant bit of not_allowed_cells [0]
+ * represents PCI-7.
+ * The cell IDs (PCI) of not allowed cells are set to "1" and the cell IDs
+ * (PCI) of those other than not allowed cells are set to "0".
+ */
+ kal_uint8 not_allowed_cell[PCI_BITMAP_MAX_NUM];
+} lte_redirect_info;
+#ifdef __UMTS_FDD_MODE__
+typedef struct
+{
+ kal_uint16 uarfcn;
+ kal_uint16 scrambling_code;
+ kal_bool tx_diversity;
+} ts_umts_fdd_cell;
+#endif
+
+#ifdef __UMTS_TDD128_MODE__
+typedef struct
+{
+ kal_uint16 uarfcn;
+ kal_uint16 cell_parameter;
+ kal_bool tstd;
+ kal_bool sctd;
+} ts_umts_tdd_cell;
+#endif
+
+typedef union
+{
+ ts_umts_fdd_cell fdd_cell;
+#ifdef __UMTS_TDD128_MODE__
+ ts_umts_tdd_cell tdd_cell;
+#endif
+} ts_umts_target_cell_union;
+
+typedef struct
+{
+ kal_bool is_best_cell_suitable_allowed_CSG;
+ kal_bool is_best_cell_allowed_hybrid;
+ ir_umts_carrier_csg_meas_result_struct ir_umts_carrier_csg_meas_result;
+} ts_3G_csg_ucell_evluation_result;
+
+typedef struct
+{
+ kal_bool bsic_present; /* if TRUE bsic is present */
+ kal_uint8 bsic; /* Optional, present if bsic_present is TRUE */
+ te_gsm_band_indicator gsm_band_indicator;
+ kal_uint16 bcch_arfcn;
+} GSM_TargetCellInfo;
+
+#if defined(__UMTS_FDD_MODE__) || defined(__UMTS_TDD128_MODE__) // BJM
+typedef struct
+{
+ kal_uint8 numElements;
+ GSM_TargetCellInfo target_gcell_info[MAX_TARGET_GSM_CELLS_NUM];
+} uas_gas_redirectInfo;
+#endif /* defined(__UMTS_FDD_MODE__) || defined(__UMTS_TDD128_MODE__) */
+
+typedef struct
+{
+ te_gsm_band_indicator gsm_band_indicator;
+ kal_uint8 *ARFCN_bitmap;
+} eas_gas_redirectInfo;
+
+#if defined(__UMTS_FDD_MODE__) || defined(__UMTS_TDD128_MODE__) // BJM
+typedef union
+{
+ uas_gas_redirectInfo uas_redirectInfo;
+ eas_gas_redirectInfo eas_redirectInfo;
+} redirect_info_union;
+#endif /* defined(__UMTS_FDD_MODE__) || defined(__UMTS_TDD128_MODE__) */
+
+#if (defined(__UMTS_R5__) && defined(__GERAN_R5__))
+typedef struct
+{
+ kal_uint8 numOctets;
+ kal_uint8 stringData[23]; /* Only the first numOctets elements are valid */
+} GERAN_SystemInfoBlock;
+
+typedef struct
+{
+ kal_uint8 numElements;
+ GERAN_SystemInfoBlock element[MAX_GSM_SYS_INFO_BLOCKS_NUM]; /* Only the first numElements are valid */
+} GERAN_SystemInformation;
+#endif
+
+#if defined(__UMTS_FDD_MODE__) || defined(__UMTS_TDD128_MODE__) // BJM
+typedef struct GSM_Redirect_Info
+{
+ te_ir_redirection_type redirection_type;
+ redirect_info_union redirection_info;
+} GSM_Redirect_Info;
+#endif /* defined(__UMTS_FDD_MODE__) || defined(__UMTS_TDD128_MODE__) */
+
+#if (defined(__UMTS_R5__) && defined(__GERAN_R5__)) // BJM
+typedef struct
+{
+ GERAN_SysInfoType sys_info_type;
+ GERAN_SystemInformation sys_info;
+} te_ir_geran_sys_info;
+
+typedef struct
+{
+ kal_uint8 bsic;
+ te_gsm_band_indicator gsm_band_indicator;
+ kal_uint16 bcch_arfcn;
+ te_ir_geran_sys_info gsm_sys_info;
+} GSM_TargetCell_SI_Info;
+#endif /* (defined(__UMTS_R5__) && defined(__GERAN_R5__)) */
+
+#if defined(__UMTS_FDD_MODE__) || defined(__UMTS_TDD128_MODE__) // BJM
+typedef union
+{
+ GSM_TargetCellInfo target_gcell_reselect_info;
+ GSM_Redirect_Info target_gcell_redirect_list;
+} GSM_TargetCell_Info_union;
+
+typedef struct
+{
+ kal_uint8 numElements;
+ GSM_TargetCell_SI_Info target_gcell_SI_info[MAX_TARGET_GSM_CELLS_NUM];
+} GSM_TargetCell_SI_Info_List;
+
+typedef union
+{
+ te_ir_geran_sys_info target_gcell_reselect_SI_info;
+ GSM_TargetCell_SI_Info_List target_gcell_redirect_SI_list;
+} GSM_TargetCell_SI_Info_union;
+#endif /* defined(__UMTS_FDD_MODE__) || defined(__UMTS_TDD128_MODE__) */
+
+typedef struct
+{
+ te_cn_domain_cipher_status cipher_status;
+ /* The following flag is only used when 2G -> 3G HO and ciphering is on.
+ * Normally, this flag should be set to KAL_FALSE. If GAS got a new
+ * ciphering key, but this hasn't been activated yet (GAS hasn't received
+ * CIPHER COMMAND), and then 2G -> 3G HO happens, 3G NW will use OLD key
+ * for the folllowing ciphering. Thus, at this case, GAS should set this
+ * flag to TRUE. RRCE will use OLD key instead of NEW key for ciphering.
+ * Please refer to 25.331 CR 2567
+ */
+ kal_bool is_new_cipher_key_received;
+} ts_ciphering_info;
+
+typedef struct
+{
+ kal_uint16 pci;
+ kal_int16 rsrp;
+ kal_int16 rsrq;
+} ecell_meas_result_struct;
+
+typedef struct
+{
+ EARFCN earfcn;
+ kal_bool is_best_cell_suitable_allowed_CSG;
+ kal_bool is_best_cell_allowed_hybrid;
+ ecell_meas_result_struct ecell_meas_result;
+} csg_freq_search_result_struct;
+
+// RAT change from 23G to 4G, NAS context transfer(MM->EMM)
+typedef struct
+{
+ // UAS -> EMM
+ kal_uint8 nas_security_param[NAS_SECURITY_PARAM_LEN];
+
+ // MM -> EMM
+ kal_bool is_gmm_ready_connected;
+ tau_required_enum tau_required;
+ kal_uint8 cksn;
+ security_context_struct security_context;
+ kal_bool is_ptmsi_valid;
+ kal_uint8 ptmsi[PTMSI_LEN];
+ kal_bool is_ptmsi_sig_valid;
+ kal_uint8 ptmsi_sig[PTMSI_SIG_LEN];
+ kal_bool is_rai_valid;
+ rai_struct rai;
+ kal_bool is_lai_valid;
+ lai_struct lai;
+ kal_bool is_tmsi_valid;
+ kal_uint8 tmsi[TMSI_LEN];
+ gsm_update_status_enum mm_update_status;
+ kal_bool is_ecc_list_valid;
+ plmn_id_struct ecc_list_plmn;
+ gsm_state_enum gsm_attach_state;
+ kal_bool is_ps_suspended;
+ kal_bool is_prev_rau_suspended; // [2->4 only] To notify EMM whether there is a suspended/unfinished RAU
+#ifdef __NG_ECALL_SUPPORT__
+ kal_bool is_t3242_running;
+ kal_uint32 t3242_remaining_time;
+ kal_bool is_t3243_running;
+ kal_uint32 t3243_remaining_time;
+#endif
+} mm2emm_irat_info_struct;
+
+// RAT change from 4G to 23G, NAS context transfer(EMM->MM)
+typedef struct
+{
+ // ERRC -> RATCM (GAS/UAS?)
+ ho_from_lte_type_enum ir_ho_type;
+ kal_bool gsm_cipher_key_infoP;
+ kal_bool gsm_cipher_key128_infoP;
+ csfb_indicator_enum csfb_indicator;
+
+ // EMM -> RATCM
+ loopback_mode_status_enum loopback_mode_status;
+
+ // EMM to MM
+ kal_bool rau_required;
+ kal_uint8 nas_ksi;
+ security_context_struct security_context[2];
+ kal_bool is_mapped_ptmsi_valid;
+ kal_uint8 mapped_ptmsi[PTMSI_LEN];
+ kal_bool is_mapped_ptmsi_sig_valid;
+ kal_uint8 mapped_ptmsi_sig[PTMSI_SIG_LEN];
+ kal_bool is_mapped_rai_valid;
+ rai_struct mapped_rai;
+ mt_csfb_type_enum mt_csfb_type;
+ kal_bool is_ecc_list_valid;
+ plmn_id_struct ecc_list_plmn;
+ kal_bool is_eia0_used;
+ conn_rel_ind_cause_enum redir_cause;
+ kal_bool is_lte_rrc_conn_failure;
+#ifdef __NG_ECALL_SUPPORT__
+ kal_bool is_t3444_running;
+ kal_uint32 t3444_remaining_time;
+ kal_bool is_t3445_running;
+ kal_uint32 t3445_remaining_time;
+#endif
+} emm2mm_irat_info_struct;
+
+
+typedef struct
+{
+ // SM -> ESM
+ kal_bool sm_deactivate_isr;
+
+} sm2esm_irat_info_struct;
+
+typedef struct {
+ kal_uint8 total_number; // Total number of active EPS bearer on ESM
+ bearer_legacy_rat_para_struct parameters[MAX_TRANSFERRED_BEARER_NUM];
+}sm_esm_bearer_legacy_para_struct;
+
+typedef struct
+{
+ // ESM -> MM
+ kal_bool esm_deactivate_isr;
+
+ // ESM -> SM
+ kal_uint16 nsapi_status;
+
+ // ESM -> SM
+ sm_esm_bearer_legacy_para_struct bearer_legacy_para;
+
+} esm2sm_irat_info_struct;
+
+/* __4G_BACKGROUND_SEARCH__ begin*/
+typedef struct
+{
+ EARFCN earfcn;
+ kal_uint16 pci;
+ kal_int16 rsrp;
+ kal_int16 rsrq;
+ kal_int16 sinr;
+ kal_int16 rs_sinr;
+ kal_bool rsrq_on_all_symbols;
+ kal_bool rsrq_wideband;
+} eas_cell_info;
+
+/* 3G4 background search */
+typedef struct
+{
+ kal_uint16 uarfcn;
+ kal_uint16 pci;
+ kal_int16 rscp;
+/*FDD:in qdBm.Range:-480~-100 means (-120 ~-25)dBm in 0.25 dB Step.*/
+/*TDD:in qdBm.Range:-500~-100 means (-125 ~-25)dBm in 0.25 dB Step.*/
+//#ifdef __UMTS_FDD_MODE__
+ kal_int16 ec_n0; /*Ec/N0, in qdB. Range: -100~0 means -25~0 dB in 0.25 dB setp.*/
+//#endif //__UMTS_FDD_MODE__
+} uas_cell_info;
+
+
+/*2G4 background search */
+typedef struct
+{
+ kal_uint16 garfcn;
+ kal_uint16 bsic;
+ te_gsm_band_indicator gsm_band_ind;
+ kal_int32 rssi;
+} gas_cell_info;
+/* __4G_BACKGROUND_SEARCH__ end*/
+
+
+typedef struct {
+ kal_uint8 epsbearer_id;
+ kal_uint8 rb_index;
+}enasas_epsbearer_mapping_struct;
+
+#define ENASAS_MAX_DRB 11
+
+typedef struct {
+ kal_uint8 num_of_bearer;
+ enasas_epsbearer_mapping_struct bearer[ENASAS_MAX_DRB];
+}enasas_add_epsbearer_list_struct;
+
+/* TS 24.501, 9.11.2.9 S1 mode to N1 mode NAS transparent container, the size of the value part */
+#define ENASAS_MAX_SIZE_IRAT_4G5_NAS_CONTAINER (10)
+
+typedef struct
+{
+ kal_uint16 data_len;
+ kal_uint8 data[ENASAS_MAX_SIZE_IRAT_4G5_NAS_CONTAINER];
+} irat_nas_container_octet_string_struct, errc_nrrc_nas_container_octet_string_struct;
+
+#define NRRC_NAS_SECURITY_PARAM_FROM_NR_LENGTH (1)
+
+/* 5G4 */
+typedef struct {
+ kal_uint8 nas_security_param_from_nr[
+ NRRC_NAS_SECURITY_PARAM_FROM_NR_LENGTH];
+} irat_container_nrrc_to_vgmm_struct;
+
+typedef struct {
+ kal_bool is_kasme_valid; // is_kasme_valid shall be KAL_TRUE when in IRAT HO case
+ kal_uint8 kasme[KASME_NUM];
+} irat_container_emm_info_struct, irat_container_emm_to_errc_struct;
+
+/* 4G5 */
+typedef struct {
+ kal_bool is_nas_container_valid; // is_nas_container_valid and is_nh_valid will be KAL_TRUE when in IRAT HO case
+ irat_nas_container_octet_string_struct nas_container;
+ kal_bool is_nh_valid;
+ kal_uint8 NH[NH_NUM];
+} irat_container_errc_to_emm_struct;
+
+typedef struct {
+ nrrc_kamf_struct kamf;
+ kal_uint32 ul_nas_count;
+} irat_container_vgmm_to_nrrc_struct;
+
+
+#endif /* _IRAT_COMMON_STRUCT_H */
diff --git a/mcu/protocol/interface/general/ircomm2app_struct.h b/mcu/protocol/interface/general/ircomm2app_struct.h
new file mode 100644
index 0000000..8f5bac9
--- /dev/null
+++ b/mcu/protocol/interface/general/ircomm2app_struct.h
@@ -0,0 +1,75 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+ /*******************************************************************************
+ * Filename:
+ * ---------
+ * ircomm2app_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * Interface between IRCOMM and APP
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *==============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+#ifndef _IRCOMM2APP_STRUCT_H
+#define _IRCOMM2APP_STRUCT_H
+
+typedef struct
+{
+ kal_uint8 ref_count;
+ kal_uint16 msg_len;
+ kal_bool result;
+ kal_uint8 err_cause;
+} ircomm_connect_cnf_struct;
+
+#endif /* ~_IRCOMM2APP_STRUCT_H */
+
diff --git a/mcu/protocol/interface/general/ircomm_app_enums.h b/mcu/protocol/interface/general/ircomm_app_enums.h
new file mode 100644
index 0000000..b157dca
--- /dev/null
+++ b/mcu/protocol/interface/general/ircomm_app_enums.h
@@ -0,0 +1,90 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+ /*******************************************************************************
+ * Filename:
+ * ---------
+ * ircomm_app_enums.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * Enum value between IRCOMM and APP.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *==============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+#ifndef _IRCOMM_APP_ENUMS_H
+#define _IRCOMM_APP_ENUMS_H
+
+typedef enum
+{
+ IRCOMM_IDLE,
+ IRCOMM_WAITI,
+ IRCOMM_WAITR,
+ IRCOMM_CONN
+} ircomm_state_enum;
+
+typedef enum
+{
+ IRCOMM_IAS_CLOSE,
+ IRCOMM_IAS_WAITI,
+ IRCOMM_IAS_OPEN
+} ircomm_ias_state_enum;
+
+typedef enum
+{
+ IRCOMM_ERR_LMP_FAILED,
+ IRCOMM_ERR_IAS_FAILED,
+ IRCOMM_ERR_TTP_FAILED,
+ IRCOMM_ERR_IRCOMM_FAILED
+} ircomm_err_cause_enum;
+
+#endif /* ~_IRCOMM_APP_ENUMS_H */
+
diff --git a/mcu/protocol/interface/general/irda_enums.h b/mcu/protocol/interface/general/irda_enums.h
new file mode 100644
index 0000000..33938c0
--- /dev/null
+++ b/mcu/protocol/interface/general/irda_enums.h
@@ -0,0 +1,127 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+#ifndef _IRDA_ENUMS_H
+#define _IRDA_ENUMS_H
+
+/*link error code*/
+typedef enum
+{
+ IRDA_SUCCESS=0,
+ IRDA_WRONG_CC_STATE_ERROR,
+ IRDA_WRONG_SC_STATE_ERROR,
+ IRDA_NO_DEVICE_ERROR,
+ IRDA_LAP_CONNECT_FAIL_ERROR,
+ IRDA_LSAP_CONNECT_FAIL_ERROR,
+ IRDA_LSAP_CONNECT_IN_PROGRESS_ERROR
+} irda_error_code_enum;
+
+/*class ID*/
+typedef enum
+{
+ LPT_CLASS_ID =0,
+ COMM_CLASS_ID,
+ OBEX_DEFAULT_ID,
+ IRLAN_CLASS_ID,
+ DEV_CLASS_ID,
+ TTP2_CLASS_ID,
+ PNP_CLASS_ID
+}irda_class_id_enum;
+
+/*attribute ID */
+typedef enum
+{
+ OBEX_IRXFER_ATTRIBUTE_ID=0,
+ DEV_NAME_ATTRIBUTE_ID, //OBEX_IRXFER_ATTRIBUTE_ID+1
+ IRDA_SUP_ATTRIBUTE_ID, //DEV_NAME_ATTRIBUTE_ID+1
+ LMP_SEL_ATTRIBUTE_ID, //IRDA_SUP_ATTRIBUTE_ID+1
+ TTP_SEL_ATTRIBUTE_ID, //LMP_SEL_ATTRIBUTE_ID+1
+ COMM_PAR_ATTRIBUTE_ID, //TTP_SEL_ATTRIBUTE_ID+1
+ PNP_DEVICEID_ID, //"DeviceID"
+ PNP_NAME_ID, //"Name"
+ PNP_MANUFACTURER_ID, //"Manufacturer"
+ PNP_CATEGORY_ID, //"Category"
+ PNP_VERSION_ID, //"Version"
+ PNP_STATUS_ID //"Status"
+}irda_attribute_id_enum;
+
+/*disconnect code*/
+typedef enum
+{
+ DISCONNECT_REASON_USER_REQUEST=0,
+ DISCONNECT_REASON_LAP_DISCONNECT,
+ DISCONNECT_REASON_LAP_CONNECT_FAIL,
+ DISCONNECT_REASON_LAP_RESET,
+ DISCONNECT_REASON_LM_INITIATE,
+ DISCONNECT_REASON_TTP_DISCONNECTED_LSAP,
+ DISCONNECT_REASON_NON_RESPONSIVE_LM_MUX_CLIENT,
+ DISCONNECT_REASON_NO_LM_MUX_CLIENT,
+ DISCONNECT_REASON_CONENCTION_HALF_OPEN,
+ DISCONNECT_REASON_ILLEGAL_SOURCE_ADDRESS,
+ DISCONNECT_REASON_UNSPECIFIED_REASON=0xff
+}irda_disconnect_code_enum;
+
+typedef enum
+{
+ SUCCESS=0,
+ NO_SUCH_CLASS,
+ NO_SUCH_ATTRIBUTE
+}irda_ias_return_code_enum;
+
+/*IAS LSAP_sel*/
+typedef enum
+{
+IAS_SERVER_LSAP_SEL=0, /* 0 IAS server sel */
+IAS_CLIENT_LSAP_SEL, /* 1 IAS client sel */
+LMP_LSAP_SEL, /* 2 LMP app sel, also IAS Client */
+//RAW_COMM_LSAP_SEL, /* 3 RAW COMM app sel */
+//LPT_LSAP_SEL, /* 4 LPT app sel */
+TTP_LSAP_SEL, /* 5 TINYTP app sel */
+//TTP2_LSAP_SEL, /* 6 TINYTP app 2 sel */
+OBEX_LSAP_SEL, /* 7 Default OBEX app sel */
+OBEX_IRXFER_LSAP_SEL, /* 8 OBEX irxfer app sel */
+COMMX_LSAP_SEL, /* 9 IrCOMM 3 or 9 wire app sel */
+//LAN_CONTROL_LSAP_SEL, /* 10 IrLAN control channel */
+//LAN_DATA_LSAP_SEL, /* 11 IrLAN data channel */
+MAX_SEL
+}irda_lasp_sel_enum;
+
+typedef enum
+{
+FLC_OWNER_NULL = 0,
+FLC_OWNER_OBEX ,
+FLC_OWNER_IRCOMM
+}irda_flc_owner_enum;
+
+#endif
diff --git a/mcu/protocol/interface/general/irda_struct.h b/mcu/protocol/interface/general/irda_struct.h
new file mode 100644
index 0000000..f714373
--- /dev/null
+++ b/mcu/protocol/interface/general/irda_struct.h
@@ -0,0 +1,78 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+#ifndef _IRDA_STRUCT_H
+#define _IRDA_STRUCT_H
+
+
+/*Msg sent to TTP*/
+typedef struct
+{
+ kal_uint8 ref_count;
+ kal_uint16 msg_len; /* LOCAL_PARA_HDR */
+
+ kal_uint8 local_lsap_sel;
+ kal_uint8 remote_lsap_sel;
+ kal_uint8 disconnect_reason; /* for disconnect primitive only */
+ kal_uint8 return_code; /* return code for connect confirm primitive */
+ kal_uint8 remote_ap_lsap_sel; /* LSAP selector get by IAS client, IAS only */
+ kal_uint8 class_name_index; /* index for IAS client to find class name */
+ kal_uint8 attribute_name_index; /* index for IAS client to find attribute name */
+ kal_uint8 ias_return_code; /* for IAS only */
+ kal_uint16 open_time; /* irda open period*/
+} ttp_data_request_struct;
+
+typedef ttp_data_request_struct irda_open_struct;
+typedef ttp_data_request_struct ttp_connect_request_struct;
+typedef ttp_data_request_struct ttp_connect_response_struct;
+typedef ttp_data_request_struct ttp_disconnect_request_struct;
+typedef ttp_data_request_struct lmp_data_request_struct;
+typedef ttp_data_request_struct lmp_connect_request_struct;
+typedef ttp_data_request_struct lmp_connect_response_struct;
+typedef ttp_data_request_struct lmp_disconnect_request_struct;
+typedef ttp_data_request_struct lmp_link_disconnect_request_struct;
+typedef ttp_data_request_struct ias_get_remote_lsap_sel_struct;
+typedef ttp_data_request_struct lmp_data_indication_struct;
+typedef ttp_data_request_struct lmp_connect_indication_struct;
+typedef ttp_data_request_struct lmp_connect_confirm_struct;
+typedef ttp_data_request_struct lmp_lsap_disconnect_indication_struct;
+typedef ttp_data_request_struct lmp_link_disconnect_indication_struct;
+typedef ttp_data_request_struct ias_get_remote_lsap_sel_confirm_struct;
+typedef ttp_data_request_struct ttp_data_indication_struct;
+typedef ttp_data_request_struct ttp_connect_indication_struct;
+typedef ttp_data_request_struct ttp_connect_confirm_struct;
+typedef ttp_data_request_struct ttp_lsap_disconnect_indication_struct;
+
+#endif
+
diff --git a/mcu/protocol/interface/general/l2r2rlp.h b/mcu/protocol/interface/general/l2r2rlp.h
new file mode 100644
index 0000000..cfdaf71
--- /dev/null
+++ b/mcu/protocol/interface/general/l2r2rlp.h
@@ -0,0 +1,103 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * data_xid.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file is for L2R to RLP interface.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *============================================================================
+ ****************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+
+#ifndef _L2R2RLP_H_
+#define _L2R2RLP_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef TEST_TOOL
+#include "tt_defs.h"
+#else
+#include "kal_public_api.h"
+#endif
+
+#include "data_xid.h"
+#include "l2r2rlp_enums.h"
+#include "l2r2rlp_struct.h"
+
+#ifdef TOOL
+#include "set_l2r2rlp.h"
+#include "get_l2r2rlp.h"
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/mcu/protocol/interface/general/l2r2rlp_enums.h b/mcu/protocol/interface/general/l2r2rlp_enums.h
new file mode 100644
index 0000000..e2baf04
--- /dev/null
+++ b/mcu/protocol/interface/general/l2r2rlp_enums.h
@@ -0,0 +1,99 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * l2r2rlp_enums.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file includes the enum value between L2R to RLP interface.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *============================================================================
+ ****************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+
+#ifndef _L2R_2_RLP_ENUMS_H_
+#define _L2R_2_RLP_ENUMS_H_
+
+typedef enum
+{
+ RLP_ERR_N2_TIMEOUTS = 1,
+ RLP_ERR_I_FRAME_N2_TIMEOUTS,
+ RLP_ERR_POLL_N2_TIMEOUTS,
+ RLP_ERR_DATA_MISMATCH,
+ RLP_ERR_IR_FAIL,
+ RLP_ERR_REMAP_NOT_ENABLE
+} RLP_ERROR_ENUM;
+
+typedef enum
+{
+ RLP_RESPONSE = 0,
+ RLP_COMMAND
+} RLP_C_R_ENUM;
+
+#endif
+
+
diff --git a/mcu/protocol/interface/general/l2r2rlp_struct.h b/mcu/protocol/interface/general/l2r2rlp_struct.h
new file mode 100644
index 0000000..0bcd823
--- /dev/null
+++ b/mcu/protocol/interface/general/l2r2rlp_struct.h
@@ -0,0 +1,212 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * l2r2rlp_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file is for L2R to RLP interface.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *============================================================================
+ ****************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+/*******************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2002
+*
+*******************************************************************************
+ * FILENAME : l2r2rlp_struct.h
+ * SYNOPSIS : Functions for encoding/decoding.
+ *
+ * R E V I S I O N H I S T O R Y
+ *
+ */
+#ifndef _L2R2RLP_STRUCT_H
+#define _L2R2RLP_STRUCT_H
+
+#include "data_xid_struct.h"
+
+#include "kal_general_types.h"
+#include "kal_public_defs.h"
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 rat;
+ kal_uint8 user_rate;
+ kal_uint8 is_FR;
+} l2r_rlp_attach_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 is_successful;
+} l2r_rlp_conn_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 is_successful;
+} l2r_rlp_conn_resp_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 c_or_r; /* command or resp*/
+ xid_params_struct xid_params;
+} l2r_rlp_xid_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 c_or_r; /* command or resp*/
+ xid_params_struct xid_params;
+} l2r_rlp_xid_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 error_cause;
+} l2r_rlp_error_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 is_successful;
+} l2r_rlp_reset_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 num_of_frames_allowed;
+} l2r_rlp_ready_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 is_next_followed;
+} l2r_rlp_data_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 user_rate;
+ kal_uint8 rat;
+} l2r_rlp_change_rate_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 rat;
+ kal_uint8 user_rate;
+ kal_uint16 num_of_frames; /* no of frames to be remapped*/
+} l2r_rlp_remap_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 is_successful;
+} l2r_rlp_test_cnf_struct;
+
+/* For UT environment. */
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 dtx_allow;
+ kal_uint8 rat;
+ kal_uint8 user_rate;
+ kal_uint8 is_FR;
+ kal_uint8 tick_rate;
+ kal_uint8 byte_cnt;
+} csd_uplink_tick_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 port;
+ kal_uint16 byte_cnt;
+} csd_uart_ready_to_read_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 port;
+} csd_uart_ready_to_write_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 port;
+} csd_uart_full_ind_struct;
+
+#endif
+
+
diff --git a/mcu/protocol/interface/general/l32llc_enums.h b/mcu/protocol/interface/general/l32llc_enums.h
new file mode 100644
index 0000000..38c9809
--- /dev/null
+++ b/mcu/protocol/interface/general/l32llc_enums.h
@@ -0,0 +1,85 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * l32llc_enums.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *============================================================================
+ ****************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+
+#ifndef _L32LLC_ENUMS_H
+#define _L32LLC_ENUMS_H
+
+
+/* Ciphering to be used or Not for a message : Used */
+/* in cipherInd.value of LL_UNITDATA_REQ_MSG_STRUCT */
+#define CIPHER_OFF 0
+#define CIPHER_ON 1
+
+#endif
+
+
diff --git a/mcu/protocol/interface/general/l32llc_struct.h b/mcu/protocol/interface/general/l32llc_struct.h
new file mode 100644
index 0000000..2b52a53
--- /dev/null
+++ b/mcu/protocol/interface/general/l32llc_struct.h
@@ -0,0 +1,118 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * l32llc_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file describes the common struct of Layer3 and LLC.
+ *
+ * Author:
+ * -------
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _L32LLC_STRUCT_H
+#define _L32LLC_STRUCT_H
+
+#include "as2nas_struct.h"
+#include "kal_general_types.h"
+#include "kal_public_defs.h"
+#include "mcd_l3_inc_gprs_struct.h"
+#include "flc2_config.h"
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 sapi;
+ kal_uint8 radio_priority;
+ kal_uint8 cipher_ind;
+ kal_uint8 msg_type;
+ flc2_pool_id_enum pspdu_ul_pool_id ;
+ kal_uint32 tlli;
+ kal_uint8 pfi;
+ concise_qos_struct qos_param;
+ peer_msg_id_struct peer_msg_id;
+} ll_unitdata_req_struct;
+
+typedef ll_unitdata_req_struct llgmm_unitdata_req_struct;
+typedef ll_unitdata_req_struct llsms_unitdata_req_struct;
+typedef ll_unitdata_req_struct llsnd_unitdata_req_struct;
+#endif
+
+
diff --git a/mcu/protocol/interface/general/l3_inc.h b/mcu/protocol/interface/general/l3_inc.h
new file mode 100644
index 0000000..01abb72
--- /dev/null
+++ b/mcu/protocol/interface/general/l3_inc.h
@@ -0,0 +1,106 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * l3_inc.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *============================================================================
+ ****************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+
+
+#ifndef _L3_INC_H_
+#define _L3_INC_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "kal_public_api.h"
+
+#include "l3_inc_enums.h"
+#include "mcd_l3_inc_struct.h"
+#include "l3_inc_local.h"
+
+#ifdef TOOL
+#include "set_l3_inc.h"
+#include "get_l3_inc.h"
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/mcu/protocol/interface/general/l3llc_enums.h b/mcu/protocol/interface/general/l3llc_enums.h
new file mode 100644
index 0000000..8802ea5
--- /dev/null
+++ b/mcu/protocol/interface/general/l3llc_enums.h
@@ -0,0 +1,120 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * l3llc_enums.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *============================================================================
+ ****************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+
+
+
+#ifndef _L3LLC_ENUMS_H
+#define _L3LLC_ENUMS_H
+
+
+typedef enum {
+ RR_CAUSE_PAGE_RESP,
+ RR_CAUSE_CELL_UPDATE,
+ RR_CAUSE_CELL_UPDATE_WITH_USER_DATA,
+ RR_CAUSE_GMM_SIGNALING,
+ RR_CAUSE_SM_SIGNALING,
+ RR_CAUSE_SMS_DATA,
+ RR_CAUSE_SND_DATA,
+ RR_CAUSE_SND_SIGNALING,
+ RR_CAUSE_LLC_SIGNALING,
+ RR_CAUSE_LLC_DATA,
+ RR_CAUSE_MEAS_REPORT,
+ RR_CAUSE_CELL_CHANGE_FAILURE,
+ RR_CAUSE_RLC_TEST_MODE,
+/* Evelyn 20090415: Merge R6 */
+ RR_CAUSE_RLC_SRB_LOOPBACK_MODE,
+ RR_CAUSE_NONE = 0xFF
+} res_req_cause;
+
+typedef enum {
+ NO_TLLI_CHANGE = 0, /* This is made zero intentionally */
+ UNASSIGN_TLLI,
+ UNASSIGN_OLD_TLLI,
+ ASSIGN_NEW_TLLI,
+ ASSIGN_TLLI,
+ CIPHER_CHANGE_REQ,
+ START_USING_TLLI
+} tlli_update_type_enum;
+
+
+#endif /* End of l3llc_interface.h */
+
+
diff --git a/mcu/protocol/interface/general/l4_common.h b/mcu/protocol/interface/general/l4_common.h
new file mode 100644
index 0000000..4c4c8a9
--- /dev/null
+++ b/mcu/protocol/interface/general/l4_common.h
@@ -0,0 +1,97 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * l4_common.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *============================================================================
+ ****************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+
+
+#ifndef _L4_COMMON_H
+#define _L4_COMMON_H
+
+//#include "kal_non_specific_general_types.h"
+#include "kal_general_types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef TEST_TOOL
+#include "tt_defs.h"
+#else
+//#include "kal_release.h"
+#endif
+
+extern kal_uint32 l4_pun_src_buff[180];
+extern kal_uint32 l4_pun_dest_buff[200];
+
+//#include "mcd_l4_common.h"
+
+#ifdef TOOL
+#include "set_l4_common.h"
+#include "get_l4_common.h"
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/mcu/protocol/interface/general/l4bsbp_public_api.h b/mcu/protocol/interface/general/l4bsbp_public_api.h
new file mode 100644
index 0000000..f603381
--- /dev/null
+++ b/mcu/protocol/interface/general/l4bsbp_public_api.h
@@ -0,0 +1,184 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2014
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ * Filename:
+ * ------------
+ * l4bsbp_public_api.h
+ *
+ * Project:
+ * ------------
+ * MOLY
+ *
+ * Description:
+ * ------------
+ * This file defines functions/enums for external module usage.
+ *
+ * Author:
+ * -----------
+ * -------
+ *
+ *===========================================================
+ * $Log$
+ *
+ * 09 06 2019 titi.wu
+ * [MOLY00431999] [97] code sync
+ *
+ * .
+ *
+ * 06 12 2018 peter-sl.yeh
+ * [MOLY00332770] DSBP reconfig modification and SIM trans_id addition for DSBP
+ * .
+ *
+ * 06 12 2018 peter-sl.yeh
+ * [MOLY00332770] DSBP reconfig modification and SIM trans_id addition for DSBP
+ * .
+ *
+ * 05 17 2018 peter-sl.yeh
+ * [MOLY00326718] [Gen93] Add SBP API to get operator by PLMN ID
+ * .
+ *
+ *
+ *****************************************************************************/
+
+#ifndef _L4BSBP_PUBLIC_API_H_
+#define _L4BSBP_PUBLIC_API_H_
+
+#include "kal_general_types.h"
+#include "sim_exported_enum.h"
+
+
+#ifndef L4BSBP_DSBP_MODE_DEFINED
+#define L4BSBP_DSBP_MODE_DEFINED
+typedef enum
+{
+ L4BSBP_DSBP_MODE_NONE,
+ L4BSBP_DSBP_MODE_1,
+ L4BSBP_DSBP_MODE_2,
+} l4bsbp_dsbp_mode_enum;
+#endif
+
+typedef enum
+{
+ L4BSBP_DSBP_STATUS_NONE,
+ L4BSBP_DSBP_STATUS_LEVEL1_DSBP_ONDOING,
+ L4BSBP_DSBP_STATUS_LEVEL2_DSBP_ONDOING,
+} l4bsbp_dsbp_status_enum;
+
+/*****************************************************************************
+* FUNCTION
+* l4bsbp_get_dsbp_status()
+*
+* DESCRIPTION
+* This function is used to get current D-SBP procedure status.
+*
+* PARAMETERS
+* ps_id [IN] protocol stack ID
+*
+* RETURNS
+* l4bsbp_dsbp_status_enum
+*****************************************************************************/
+extern l4bsbp_dsbp_status_enum l4bsbp_get_dsbp_status(protocol_id_enum ps_id);
+
+/*****************************************************************************
+ * FUNCTION
+ * l4bsbp_expected_efun_state
+ *
+ * DESCRIPTION
+ * Compute expected EFUN state according to the D-SBP status
+ *
+ * PARAMETERS
+ * current_efun [IN] current EFUN state
+ *
+ * RETURNS
+ * kal_uint8 expected EFUN state
+ *
+ *****************************************************************************/
+extern kal_uint8 l4bsbp_expected_efun_state(kal_uint8 current_efun);
+
+/*****************************************************************************
+ * FUNCTION
+ * l4bsbp_get_operator_by_plmn_id
+ *
+ * DESCRIPTION
+ * get SBP ID by PLMN ID (MCC+MNC)
+ *
+ * PARAMETERS
+ * plmn [IN] PLMN ID in integer format, ex. 460-01 = 46001
+ *
+ * RETURNS
+ * void
+ *
+ *****************************************************************************/
+extern kal_uint32 l4bsbp_get_operator_by_plmn_id(kal_uint32 plmn_id);
+
+/*****************************************************************************
+ * FUNCTION
+ * l4bsbp_get_ap_dsbp_mode
+ *
+ * DESCRIPTION
+ * get AP DSBP Mode (None, Mode_1, Mode2)
+ *
+ * PARAMETERS
+ * ilm_ptr [IN]
+ *
+ * RETURNS
+ * void
+ *
+ *****************************************************************************/
+extern l4bsbp_dsbp_mode_enum l4bsbp_get_ap_dsbp_mode(void);
+
+/*****************************************************************************
+ * FUNCTION
+ * l4bsbp_get_mcc_mnc_for_current_sim_sbp_id
+ *
+ * DESCRIPTION
+ * get MCC/MNC for current used SIM SBP ID.
+ * Please contact with SBP owner to make sure you could use this API.
+ *
+ * PARAMETERS
+ * current_ps_id [IN] Current PS ID
+ * mcc[L4BSBP_MAX_MCC_MNC_LEN] [IN] MCC for current used SIM SBP ID
+ * mnc[L4BSBP_MAX_MCC_MNC_LEN] [IN] MNC for current used SIM SBP ID
+ *
+ *
+ * RETURNS
+ * Void
+ *
+ *****************************************************************************/
+extern void l4bsbp_get_mcc_mnc_for_current_sim_sbp_id(protocol_id_enum current_ps_id, kal_uint8 *mcc, kal_uint8 *mnc);
+
+
+#endif // _VDM_EXTERNAL_LIB_H_
diff --git a/mcu/protocol/interface/general/l4c2ext_modem_enums.h b/mcu/protocol/interface/general/l4c2ext_modem_enums.h
new file mode 100644
index 0000000..5c04322
--- /dev/null
+++ b/mcu/protocol/interface/general/l4c2ext_modem_enums.h
@@ -0,0 +1,82 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * l4c2ext_modem_enums.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *============================================================================
+ ****************************************************************************/
+
+#ifndef _L4C_EXT_MODEM_ENUMS_H
+#define _L4C_EXT_MODEM_ENUMS_H
+
+typedef enum {
+ EXT_MODEM_IDLE,
+ EXT_MODEM_CALL_SETUP,
+ EXT_MODEM_PPP_ACTIVATING,
+ EXT_MODEM_PPP_CONNECTED,
+ EXT_MODEM_PPP_DEACTIVATING,
+ EXT_MODEM_RECV_ESCAPE,
+// EXT_MODEM_WAIT_OK,
+ EXT_MODEM_STATE_SIZE
+} ext_modem_state_enum;
+
+#endif
diff --git a/mcu/protocol/interface/general/l4c_mrs_struct.h b/mcu/protocol/interface/general/l4c_mrs_struct.h
new file mode 100644
index 0000000..09a06b9
--- /dev/null
+++ b/mcu/protocol/interface/general/l4c_mrs_struct.h
@@ -0,0 +1,64 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+#ifndef L4C_MRS_STRUCT_H
+#define L4C_MRS_STRUCT_H
+
+#include "kal_public_defs.h"
+#include "kal_general_types.h"
+
+/********************************************
+ * MACROS *
+ ********************************************/
+
+/********************************************
+ * TYPE DEFINITIONS & ENUMS *
+ ********************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool is_dsda_allowed;
+} l4c_mspm_gemini_status_update_ind_struct;
+
+/********************************************
+ * VARIABLES *
+ ********************************************/
+
+
+/********************************************
+ * FUNCTION DECLARATIONS *
+ ********************************************/
+
+#endif /* L4C_MRS_STRUCT_H */
diff --git a/mcu/protocol/interface/general/lapdm2rr_struct.h b/mcu/protocol/interface/general/lapdm2rr_struct.h
new file mode 100644
index 0000000..376ea11
--- /dev/null
+++ b/mcu/protocol/interface/general/lapdm2rr_struct.h
@@ -0,0 +1,260 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * lapdm2rr_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *============================================================================
+ ****************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _LAPDM2RR_STRUCT_H
+#define _LAPDM2RR_STRUCT_H
+
+/* add RHR */
+#include "l3_inc_enums.h" /* MSBB by Rachel */
+#include "kal_general_types.h"
+
+#include "rr_common_enums.h"
+#include "lapdm_enums.h"
+
+typedef struct {
+ LOCAL_PARA_HDR
+ lapdm_sapi_header sap_id;
+ channel_type_enum channel_type;
+} lapdm_rr_unitdata_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ lapdm_sapi_header sap_id;
+ LAPDM_ESTB_MODE estb_mode;
+ channel_type_enum channel_type;
+} lapdm_rr_estb_conf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ lapdm_sapi_header sap_id;
+ LAPDM_ESTB_MODE estb_mode;
+ channel_type_enum channel_type;
+} lapdm_rr_estb_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ lapdm_sapi_header sap_id;
+ channel_type_enum channel_type;
+} lapdm_rr_sus_conf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ lapdm_sapi_header sap_id;
+ LAPDM_ESTB_MODE estb_mode;
+ channel_type_enum channel_type;
+} lapdm_rr_resume_conf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ lapdm_sapi_header sap_id;
+ LAPDM_ESTB_MODE estb_mode;
+ channel_type_enum channel_type;
+} lapdm_rr_recon_conf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ lapdm_sapi_header sap_id;
+ channel_type_enum channel_type;
+} lapdm_rr_data_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ lapdm_sapi_header sap_id;
+ kal_uint8 release_mode;
+ LAPDM_ERROR_CAUSE error_cause;
+ channel_type_enum channel_type;
+} lapdm_rr_rel_conf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ lapdm_sapi_header sap_id;
+ kal_uint8 release_mode;
+ LAPDM_ERROR_CAUSE error_cause;
+ channel_type_enum channel_type;
+} lapdm_rr_rel_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ lapdm_sapi_header sap_id;
+ LAPDM_ERROR_CAUSE error_cause;
+ channel_type_enum channel_type;
+} lapdm_rr_error_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ lapdm_sapi_header sap_id;
+ kal_uint8 ch_mode;
+ channel_type_enum ch_type;
+ kal_uint8 tch_type;
+} lapdm_ul_data_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+
+ /* downlink */
+ kal_bool valid;
+ lapdm_sapi_header sap_id;
+ channel_type_enum ch_type;
+ kal_bool is_bad_frame;
+ lapdm_frame_type frame_type;
+ kal_bool bit_cr;
+ kal_bool bit_m;
+ kal_bool bit_pf;
+ kal_uint8 send_seq_num; /*ripple: used to store NS of down link data*/
+ kal_uint8 recv_seq_num;
+ kal_uint16 info_len;
+
+ /* uplink */
+ kal_uint16 sdcch_tq_current_count; /* Writing time */
+ kal_uint32 sdcch_ul_data_index; /* index of each ul data req */
+ kal_bool sdcch_need_transmit_ul_data; /* indicate if ul_data needs to be transmitted */
+ kal_uint8 sdcch_ul_data[23];
+ kal_uint16 facch_tq_current_count; /* Writing time */
+ kal_uint32 facch_ul_data_index; /* index of each ul data req */
+ kal_bool facch_need_transmit_ul_data; /* indicate if ul_data needs to be transmitted */
+ kal_uint8 facch_ul_data[23];
+ kal_uint16 sacch_tq_current_count; /* Writing time */
+ kal_uint32 sacch_ul_data_index; /* index of each ul data req */
+ kal_bool sacch_need_transmit_ul_data; /* indicate if ul_data needs to be transmitted */
+ kal_uint8 sacch_ul_data[23];
+#ifdef __REPEATED_ACCH__
+ kal_bool is_repetition; /* SACCH */
+#endif /*__REPEATED_ACCH__*/
+} lapdm_dl_and_ul_ind_struct;
+
+/* brwang, 06/04/08, [MAUI_00185915] { */
+typedef struct {
+ LOCAL_PARA_HDR
+ lapdm_sapi_header sapi;
+ kal_uint8 mui;
+ kal_bool is_successful;
+#ifdef __AGPS_CONTROL_PLANE__
+ lapdm_layer3_message_type_enum segment_type;
+#endif /* __AGPS_CONTROL_PLANE__ */
+} lapdm_rr_data_conf_struct;
+/* brwang, 06/04/08, [MAUI_00185915] } */
+
+#endif
+
+
diff --git a/mcu/protocol/interface/general/lapdm_enums.h b/mcu/protocol/interface/general/lapdm_enums.h
new file mode 100644
index 0000000..950c5ca
--- /dev/null
+++ b/mcu/protocol/interface/general/lapdm_enums.h
@@ -0,0 +1,137 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/******************************************************************************
+ * Filename:
+ * ---------
+ * lapdm_enums.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *=============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *=============================================================================
+ ******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _LAPDM_ENUMS_H
+#define _LAPDM_ENUMS_H
+
+/* states of LAPDm FSM */
+typedef enum lapdm_fsm_state
+{
+ LAPDM_IDLE = 0,
+ LAPDM_ESTABLISHING,
+ LAPDM_ESTABLISHED,
+ LAPDM_SUSPENDED,
+ LAPDM_RELEASING,
+ LAPDM_NUM_STATES
+}
+lapdm_fsm_state;
+
+/* LAPDm frame types */
+typedef enum lapdm_frame_type
+{
+ LAPDM_I_FRAME = 1,
+ LAPDM_RR_FRAME,
+ LAPDM_REJ_FRAME,
+ LAPDM_SABM_FRAME,
+ LAPDM_DM_FRAME,
+ LAPDM_DISC_FRAME,
+ LAPDM_UI_FRAME,
+ LAPDM_UA_FRAME,
+ LAPDM_FILL_FRAME
+}
+lapdm_frame_type;
+
+typedef enum lapdm_queue_type
+{
+ LAPDM_INT_Q = 1,
+ LAPDM_EXT_Q
+}
+lapdm_queue_type;
+
+#ifdef __AGPS_CONTROL_PLANE__
+typedef enum
+{
+ LAPDM_INITIAL_CAUSE = 0,
+ L3_MESG_CAN_NOT_PREEMPT_APP_MESG = 1,
+ L3_MESG_CAN_PREEMPT_APP_MESG = 2
+} lapdm_agps_cause_enum;
+
+typedef enum
+{
+ AGPS_SEND_NO_FRAME = 0,
+ AGPS_SEND_FIRST_SEG_OR_SINGLE_MESG = 1,
+ AGPS_SEND_MID_OR_LAST_SEG = 2,
+ AGPS_SEND_NORMAL_L3_MESG = 3
+} lapdm_agps_sending_enum;
+#endif /* __AGPS_CONTROL_PLANE__ */
+
+/* Peter, LAPDM refactor */
+typedef enum
+{
+ LAPDM_NONE_EVENT_IN_PROGRESS = 0,
+ LAPDM_ESTABLISH_IN_PROGRESS,
+ LAPDM_IR_ESTBLISH_IN_PROGRESS,
+ LAPDM_RELEASE_IN_PROGRESS,
+ LAPDM_RESUMPTION_IN_PROGRESS,
+ LAPDM_RECONNECTION_IN_PROGRESS
+}lapdm_triggered_event_enum;
+
+#endif /* _LAPDM_ENUMS_H */
\ No newline at end of file
diff --git a/mcu/protocol/interface/general/llc2l3_enums.h b/mcu/protocol/interface/general/llc2l3_enums.h
new file mode 100644
index 0000000..3c70a45
--- /dev/null
+++ b/mcu/protocol/interface/general/llc2l3_enums.h
@@ -0,0 +1,82 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * llc2l3_enums.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *============================================================================
+ ****************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+
+#ifndef _LLC2L3_ENUMS_H
+#define _LLC2L3_ENUMS_H
+
+/* Value to be used for cipherInd in LL_UNITDATA_IND_MSG */
+#define MSG_DECIPHERED 0
+#define MSG_NOT_DECIPHERED 1
+
+#endif
+
diff --git a/mcu/protocol/interface/general/llc2l3_struct.h b/mcu/protocol/interface/general/llc2l3_struct.h
new file mode 100644
index 0000000..98ade67
--- /dev/null
+++ b/mcu/protocol/interface/general/llc2l3_struct.h
@@ -0,0 +1,110 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * llc2l3_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file describes the common struct of LLC and Layer3.
+ *
+ * Author:
+ * -------
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _LLC2L3_STRUCT_H
+#define _LLC2L3_STRUCT_H
+
+#include "kal_general_types.h"
+#include "kal_public_defs.h"
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 sapi;
+ kal_uint8 cipher_ind;
+ kal_uint32 tlli;
+} ll_unitdata_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+} l3_dummy_struct;
+
+/* John Tang 2003/03/14. */
+typedef ll_unitdata_ind_struct llgmm_unitdata_ind_struct;
+typedef ll_unitdata_ind_struct llsms_unitdata_ind_struct;
+typedef ll_unitdata_ind_struct llsnd_unitdata_ind_struct;
+#endif
+
+
diff --git a/mcu/protocol/interface/general/llc2mm_struct.h b/mcu/protocol/interface/general/llc2mm_struct.h
new file mode 100644
index 0000000..2ac98e6
--- /dev/null
+++ b/mcu/protocol/interface/general/llc2mm_struct.h
@@ -0,0 +1,111 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * llc2mm_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file describes the common struct of LLC and MM.
+ *
+ * Author:
+ * -------
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _LLC2MM_STRUCT_H
+#define _LLC2MM_STRUCT_H
+
+#include "kal_general_types.h"
+#include "kal_public_defs.h"
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint32 tlli;
+} llgmm_trigger_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint32 tlli;
+ kal_uint8 cause;
+} llgmm_status_ind_struct;
+
+typedef llgmm_status_ind_struct llc_gmm_status_ind_struct;
+
+#endif
+
+
diff --git a/mcu/protocol/interface/general/llc2rlc_struct.h b/mcu/protocol/interface/general/llc2rlc_struct.h
new file mode 100644
index 0000000..fa2fa62
--- /dev/null
+++ b/mcu/protocol/interface/general/llc2rlc_struct.h
@@ -0,0 +1,151 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * llc2rlc_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file describes the common struct of LLC and RLC.
+ *
+ * Author:
+ * -------
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _LLC2RLC_STRUCT_H
+#define _LLC2RLC_STRUCT_H
+
+/* Nancy 20101005: Suggest Add for RHR */
+#include "as2nas_struct.h"
+#include "mcd_l3_inc_gprs_struct.h"
+#include "kal_general_types.h"
+#include "kal_public_defs.h"
+#include "flc2_config.h"
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint32 tlli;
+ concise_qos_struct qos_param;
+ kal_uint8 llc_pdu_type;
+ kal_uint8 radio_priority;
+ flc2_pool_id_enum pspdu_ul_pool_id ;
+ kal_uint8 cause;
+ kal_uint8 pdu_format;
+ kal_uint8 pfi;
+ peer_msg_id_struct peer_msg_id;
+ kal_uint8 abm_trans_id; /* Let LLC knows the mode of this PDU*/
+} grr_data_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint32 tlli;
+ concise_qos_struct qos_param;
+ kal_uint8 llc_pdu_type;
+ kal_uint8 radio_priority;
+ flc2_pool_id_enum pspdu_ul_pool_id ;
+ kal_uint8 cause;
+ kal_uint8 pfi;
+ peer_msg_id_struct peer_msg_id;
+} grr_unitdata_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 rx_ready;
+} grr_ready_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_all_flush;
+ kal_bool are_two_pdp_same_qos;
+ kal_uint8 radio_priority; /* LLC shall decrement by one. */
+ concise_qos_struct qos_param;
+ kal_bool is_need_cnf;
+} grr_flush_req_struct;
+
+#endif
+
+
diff --git a/mcu/protocol/interface/general/llc2snd_struct.h b/mcu/protocol/interface/general/llc2snd_struct.h
new file mode 100644
index 0000000..634fee6
--- /dev/null
+++ b/mcu/protocol/interface/general/llc2snd_struct.h
@@ -0,0 +1,204 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * llc2snd_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file describes the common struct of LLC and SNDCP.
+ *
+ * Author:
+ * -------
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _LLC2SND_STRUCT_H
+#define _LLC2SND_STRUCT_H
+
+
+// Poying: 20101105. RHR
+//------------------------------ suggest Add ------------------------------
+#include "kal_general_types.h"
+#include "kal_public_defs.h"
+
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 sapi;
+ kal_uint32 tlli;
+ kal_uint16 ui_info_field_length;
+ kal_uint16 i_info_field_length;
+} ll_establish_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 sapi;
+ kal_uint32 tlli;
+ kal_uint16 ui_info_field_length;
+ kal_uint16 i_info_field_length;
+} ll_establish_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 sapi;
+ kal_uint32 tlli;
+ kal_uint16 ui_info_field_length;
+ kal_uint16 i_info_field_length;
+} ll_xid_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 sapi;
+ kal_uint32 tlli;
+ kal_uint16 ui_info_field_length;
+ kal_uint16 i_info_field_length;
+} ll_xid_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 sapi;
+ kal_uint8 l_parameter;
+ kal_uint32 tlli;
+} ll_release_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 sapi;
+ kal_uint32 tlli;
+} ll_release_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 sapi;
+ kal_uint32 tlli;
+ kal_uint16 ui_info_field_length;
+ kal_uint16 i_info_field_length;
+} ll_reset_ind_struct;
+
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 sapi;
+ kal_uint32 tlli;
+} ll_data_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 sapi;
+ kal_uint16 reference;
+ kal_uint32 tlli;
+} ll_data_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 sapi;
+ kal_uint32 tlli;
+ kal_uint8 cause;
+} ll_status_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+} ll_flush_cnf_struct;
+
+typedef ll_establish_ind_struct llsnd_establish_ind_struct;
+typedef ll_establish_cnf_struct llsnd_establish_cnf_struct;
+typedef ll_xid_ind_struct llsnd_xid_ind_struct;
+typedef ll_xid_cnf_struct llsnd_xid_cnf_struct;
+typedef ll_release_ind_struct llsnd_release_ind_struct;
+typedef ll_release_cnf_struct llsnd_release_cnf_struct;
+typedef ll_data_cnf_struct llsnd_data_cnf_struct;
+typedef ll_reset_ind_struct llsnd_reset_ind_struct;
+typedef ll_data_ind_struct llsnd_data_ind_struct;
+typedef ll_status_ind_struct llsnd_status_ind_struct;
+typedef ll_flush_cnf_struct llsnd_flush_cnf_struct;
+#endif
+
+
diff --git a/mcu/protocol/interface/general/llc_flowctrl.h b/mcu/protocol/interface/general/llc_flowctrl.h
new file mode 100644
index 0000000..022fd11
--- /dev/null
+++ b/mcu/protocol/interface/general/llc_flowctrl.h
@@ -0,0 +1,138 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ *
+ * Filename:
+ * ---------
+ * llc_flowctrl.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file contains declarations of functions and enumerations for LLC-specific flow control.
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *******************************************************************************/
+
+#ifndef _LLC_FLOWCTRL_H
+#define _LLC_FLOWCTRL_H
+
+/*****************
+Include Statements
+******************/
+//#include "kal_non_specific_general_types.h"
+#include "flc2_config.h"
+#include "kal_general_types.h"
+#include "kal_public_defs.h"
+
+/************************
+Macros Without Parameters
+*************************/
+
+/*****************
+Enums Without Tags
+******************/
+
+/***************
+Type Definitions
+****************/
+
+typedef enum {
+ LLC_GPRS_ACK_DATA,
+ LLC_GPRS_UNACK_DATA,
+ LLC_GPRS_SUPERVISORY_DATA
+} llc_flc2_data_type_enum;
+
+typedef enum {
+ LLC_GPRS_UL,
+ LLC_GPRS_DL,
+ LLC_GPRS_UL_DL //Jeff: Need to discuss
+} llc_flc2_dir_enum;
+
+typedef enum {
+ LLC_GPRS_FLC_RNR_TRIGGER,
+ LLC_GPRS_FLC_RR_TRIGGER
+} llc_flc2_stack_trigger_enum;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 sapi;
+ kal_uint32 blocked_mem_size;
+} llc_flc2_rr_rnr_xid_struct;
+
+
+typedef llc_flc2_rr_rnr_xid_struct llsnd_rnr_stop_struct;
+typedef llc_flc2_rr_rnr_xid_struct rlc_llc_rnr_trigger_struct;
+
+/********
+Constants
+*********/
+
+/*********************
+Macros With Parameters
+**********************/
+
+/***************************
+Exported Function Prototypes
+****************************/
+
+flc2_pool_id_enum llc_get_flc2_pool_id_enum_val (kal_uint8 sapi,
+ llc_flc2_data_type_enum data_type,
+ llc_flc2_dir_enum dir);
+
+flc2_pool_id_enum llc_get_flc2_pool_id_enum_from_nsapi (kal_uint8 nsapi);
+
+void llc_flc2_rnr_rr_ind(flc2_pool_id_enum pool_id, llc_flc2_stack_trigger_enum action_req);
+
+/* Roebrt :move to FLC2 */
+/*
+extern void flc2_cipher_callback(flc2_thres_hit_enent_enum event, flc2_pool_id_enum pool_id);
+*/
+
+extern void llc_flc2_pspdu_ack_dl_pool_low_threshold_hit(flc2_pool_id_enum pool_id);
+
+extern void llc_flc2_pspdu_ack_dl_pool_high_threshold_hit(flc2_pool_id_enum pool_id);
+
+flc2_pool_id_enum llc_get_flc2_pool_id_enum_val_by_nsapi (kal_uint8 nsapi, llc_flc2_dir_enum dir);
+
+#endif /* _LLC_FLOWCTRL_H */
diff --git a/mcu/protocol/interface/general/llc_peer_interface.h b/mcu/protocol/interface/general/llc_peer_interface.h
new file mode 100644
index 0000000..b9b9a02
--- /dev/null
+++ b/mcu/protocol/interface/general/llc_peer_interface.h
@@ -0,0 +1,83 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * llc_peer_interface.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file contains definitions of enum type used in ASN-Generated header
+ * file.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *==============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+
+#ifndef _LLC_PEER_INTERFACE_H_
+#define _LLC_PEER_INTERFACE_H_
+
+typedef enum {RR = 0, RNR = 1, ACK = 2, SACK = 3} frame_type_enum;
+typedef enum { TWO_BIT, EIGHT_BIT } len_enum;
+
+#endif
+
+
diff --git a/mcu/protocol/interface/general/llc_specific_defines.h b/mcu/protocol/interface/general/llc_specific_defines.h
new file mode 100644
index 0000000..7f516dd
--- /dev/null
+++ b/mcu/protocol/interface/general/llc_specific_defines.h
@@ -0,0 +1,296 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * llc_specific_defines.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file contains definitions of define constants and MACROs used in LLC
+ * implementation.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *==============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+
+#ifndef _LLC_SPECIFIC_DEFINES_H
+#define _LLC_SPECIFIC_DEFINES_H
+
+/*****************
+Include Statements
+******************/
+
+/************************
+Macros Without Parameters
+*************************/
+
+/* ---- llc_defs.h ---- */
+
+#ifdef __SMS_OVER_PS_SUPPORT__
+#define NO_OF_ADM_SAPI 2
+#else
+#define NO_OF_ADM_SAPI 1
+#endif
+
+#define NO_OF_ABM_SAPI 4
+
+#ifndef __MTK_TARGET__
+#define MAX_LLC_QUEUE_SIZE 48
+#else /* __MTK_TARGET__ */
+
+/* Jeff Wu 2005-12-21: MAX_LLC_QUEUE_SIZE may be obselete. Need discuss with Joseph */
+#define MAX_LLC_QUEUE_SIZE 48*2 //(PDU_CONTXT_UNACK_UL_MAX_NUM_OF_BUFF * 2) //same as PDU_CONTXT_UNACK_UL_MAX_NUM_OF_BUFF * 2 PDP context
+
+#endif /* __MTK_TARGET__ */
+
+#define DEFAULT_LLC_TX_QUEUE_SIZE MAX_LLC_QUEUE_SIZE
+
+#define UNASSIGNED_TLLI 0xFFFFFFFF
+
+#define ACK_FORMAT 1
+#define NON_ACK_FORMAT 0
+#define ACK_REQD 1
+#define ACK_NOT_REQD 2
+
+#define SACK_BITMAP_MASK 0x1f
+#define UI_FRAME_FORMAT 6
+
+
+/* ---- llc_llerx.h ---- */
+#define MIN_U_FRAME_LENGTH 5
+#define MIN_FRMR_FRAME_LENGTH 12
+#define MIN_UI_FRAME_LENGTH_FOR_GMM 6 + 2
+#define MIN_UI_FRAME_LENGTH_FOR_SNDCP 6 + N202
+#define MIN_UI_FRAME_LENGTH_FOR_SMS 8
+#define MIN_S_NONSACK_FRAME_LENGTH 6
+#define MIN_S_SACK_FRAME_LENGTH 7
+#define MIN_SN_DATA_REQ_HEADER_LENGTH 1
+#define MIN_I_NONSACK_FRAME_LENGTH ( 7 + MIN_SN_DATA_REQ_HEADER_LENGTH )
+/* ---- end of llc_llerx.h ---- */
+
+
+/* ---- llc_llme.h ---- */
+#define PM_BIT_ON 0x01
+/* ---- end of llc_llme.h ---- */
+
+
+
+/* ---- llc_mux.h ---- */
+#define GENERATE_CRC 0
+#define CHECK_CRC 1
+#define PROTECTED_MODE 1
+#define UNPROTECTED_MODE 0
+
+#define N202 4
+
+/* ---- end of llc_mux.h ---- */
+
+
+/* ---- llc_peer.h ---- */
+
+#define FCS_LENGTH 3
+#define U_HEADER_LENGTH 2
+#define UI_HEADER_LENGTH 3
+#define I_HEADER_LENGTH 4
+#define I_SACK_FIXED_HEADER_LENGTH 5
+#define S_SACK_FIXED_HEADER_LENGTH 3
+#define CONTROL_FIELD_OFFSET 1
+
+#define SET_W1_FIELD 0x01
+#define SET_W2_FIELD 0x02
+#define SET_W3_FIELD 0x04
+#define SET_W1W3_FIELD 0x05
+#define SET_W3W4_FIELD 0x0C
+#define SET_W2W4_FIELD 0x0A
+#define SET_W1W3W4_FIELD 0x0D
+
+
+/* PD value */
+#define DEFAULT_PD 0x00
+
+
+/*** CR bit values in LLC frame ***/
+#define MS_COMMAND 0
+#define MS_RESPONSE 1
+#define SGSN_COMMAND 1
+#define SGSN_RESPONSE 0
+
+#define FRMR_INFO_LENGTH 0x0A
+#define ADD_FIELD_LENGTH 0x01
+#define REJ_FRM_CNTRL_LENGTH 0x06
+
+/* I frame and S frame formats */
+#define RR_FORMAT 0
+#define SACK_FORMAT 3
+#define ACK_FORMAT 1
+#define RNR_FORMAT 2
+
+#define XID_COMMAND 2
+#define XID_RESPONSE 4
+#define S_FORMAT_BITS 0x02
+
+#define I_FORMAT_BIT 0x00
+
+
+#define UA_RESPONSE 0x06
+#define SABM_COMMAND 0x07
+
+/* ---- end of llc_peer.h ---- */
+
+
+/*****************
+Enums Without Tags
+******************/
+typedef enum {
+ LLC_INVALID_PDU,
+ LLC_L3_PDU,
+ LLC_RES_PDU,
+ LLC_DATA_I_PDU,
+ LLC_SABM_CMD,
+ LLC_XID_CMD,
+ LLC_INQUIRY_CMD,
+ LLC_DISC_CMD,
+ LLC_CELL_UPDATE,
+ LLC_DATA_UI_PDU
+} llc_peer_msg_type_enum;
+
+/* LLC peer message name for tool logging */
+typedef enum {
+ LLC__SABM_CMD,
+ LLC__DISC_CMD,
+ LLC__XID_CMD,
+ LLC__UA_RSP,
+ LLC__DM_RSP,
+ LLC__XID_RSP,
+ LLC__FRMR_RSP
+} llc_peer_msg_name_enum;
+
+/***************
+Type Definitions
+****************/
+
+/********
+Constants
+*********/
+
+#define LLC_PREF_N201_UI 1504
+
+/*********************
+Macros With Parameters
+**********************/
+
+/* ---- llc_arqtx.h ---- */
+
+#define GET_CEIL(a,b) (((a) + (b) - 1) / (b))
+
+/* ---- end of llc_arqtx.h ---- */
+
+/* ---- llc_defs.h ---- */
+#define GET_ADMSAPI_FROM_INDEX(struct_no) \
+ LLC_GET_ADM_SAPI_FROM_STRUCT_CNST[struct_no]
+
+#define GET_ABMSAPI_FROM_INDEX(struct_no) \
+ ((struct_no) <= 1 ) ? ((2 * (struct_no))+3): ((2*(struct_no))+ 5)
+
+#define GET_INDEX_FROM_ABMSAPI(sapi) \
+ (((sapi) - 1) / 3)
+
+//#define BITMASK(X) (1L << (X))
+#define BITMASK(X) (1UL << (X))
+
+/* ---- end of llc_defs.h ---- */
+
+/***************************
+Exported Function Prototypes
+****************************/
+
+/******************************
+Declarations Of Exported Globals
+*******************************/
+
+#endif /* _LLC_SPECIFIC_DEFINES_H */
+
+
diff --git a/mcu/protocol/interface/general/llc_varstr.h b/mcu/protocol/interface/general/llc_varstr.h
new file mode 100644
index 0000000..d9a5450
--- /dev/null
+++ b/mcu/protocol/interface/general/llc_varstr.h
@@ -0,0 +1,107 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * llc_varstr.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+
+#ifndef _LLC_VARSTR_H_
+#define _LLC_VARSTR_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef TEST_TOOL
+#include "tt_defs.h"
+#else
+#include "kal_public_api.h"
+#endif
+
+#include "l3_inc.h"
+#include "llc_varstr_struct.h"
+#include "llc_varstr_pun.h"
+
+#ifdef TOOL
+#include "set_llc_varstr.h"
+#include "get_llc_varstr.h"
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _LLC_VARSTR_H_ */
+
+
diff --git a/mcu/protocol/interface/general/llccipher_enums.h b/mcu/protocol/interface/general/llccipher_enums.h
new file mode 100644
index 0000000..a1ae3b1
--- /dev/null
+++ b/mcu/protocol/interface/general/llccipher_enums.h
@@ -0,0 +1,82 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * llccipher_enums.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file contains enum definition between ciphering module and LLC.
+ *
+ * Author:
+ * -------
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+
+#ifndef _LLCCIPHER_INTERFACE_H
+#define _LLCCIPHER_INTERFACE_H
+
+#define MAX_CIPHER_DECIPHER_REQ 15
+
+#endif /* End of llccipher_interface.h */
+
diff --git a/mcu/protocol/interface/general/llcrlc_enums.h b/mcu/protocol/interface/general/llcrlc_enums.h
new file mode 100644
index 0000000..7350d93
--- /dev/null
+++ b/mcu/protocol/interface/general/llcrlc_enums.h
@@ -0,0 +1,114 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * llcrlc_enums.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file contains enum definition between LLC and RLC.
+ *
+ * Author:
+ * -------
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+
+#ifndef _LLCRLC_INTERFACE_H
+#define _LLCRLC_INTERFACE_H
+
+/*** L3 message types ***/
+#define NOT_SIGNALLING_MSG 0x00
+#define SIGNALLING_MSG 0x01
+
+#define NOT_SIGNALLING_MSG 0x00
+#define SIGNALLING_MSG 0x01
+
+/*** LLC message types ***/
+typedef enum {
+ I_FORMAT_000 = 0,
+ I_FORMAT_001 = 1,
+ I_FORMAT_010 = 2,
+ I_FORMAT_011 = 3,
+
+ S_FORMAT_100 = 4,
+ S_FORMAT_101 = 5,
+
+ UI_FORMAT_110 = 6,
+ U_FORMAT_111 = 7,
+
+ UNCIPHERED_I_FORMAT = 8
+} llc_pdu_format_enum;
+
+typedef enum {
+ LLC_SACK_FRAME,
+ LLC_NON_SACK_FRAME
+} llc_pdu_type;
+
+
+#endif /* End of File 'llcrlc_interface.h' */
+
+
diff --git a/mcu/protocol/interface/general/mac2rlc_struct.h b/mcu/protocol/interface/general/mac2rlc_struct.h
new file mode 100644
index 0000000..01a0cfd
--- /dev/null
+++ b/mcu/protocol/interface/general/mac2rlc_struct.h
@@ -0,0 +1,487 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/******************************************************************************
+ * Filename:
+ * ---------
+ * mac2rlc_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *=============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *=============================================================================
+ ******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _MAC2RLC_STRUCT_H
+#define _MAC2RLC_STRUCT_H
+
+/*Evelyn: Remove redundant header and file */
+#include "rlcmac_struct.h"
+#include "kal_general_types.h"
+#include "rr_common_def.h"
+#include "gprs_rlcmac_common_struct.h"
+#include "rlc_mac_enums.h"
+
+typedef struct tbf_rel_struct mac_rlc_tbf_rel_ind_struct;
+
+typedef struct {
+ kal_uint8 cs;
+ kal_uint8 *data_ptr;
+ #ifdef __EGPRS_MODE__
+ kal_uint8 *data2_ptr;
+ kal_uint8 header[6];
+ #endif
+/* Evelyn 20090415: Merge R6 */
+
+ #ifdef __GERAN_FANR__
+ kal_bool is_data_valid;
+ kal_bool is_pan_valid;
+ kal_uint8 pan[4];
+ #endif
+} dl_block_struct;
+
+/* Evelyn 20090415: Merge R6 */
+typedef struct {
+ kal_uint8 mac_mode;
+ kal_uint8 cs;
+ kal_uint8 timeslots_allocation;
+#if 0
+/* under construction !*/
+#endif
+ /* Claire 041117 change : Revise GPRS header partition between RLC and MAC */
+ kal_uint8 tfi; /*Simon use tfi to fill header*/
+
+ #ifdef __EGPRS_MODE__
+ kal_uint16 egprs_window_size;
+ kal_uint8 resegment; /* resegment bit */
+ #endif
+ kal_uint8 rlc_mode;
+ /* Evelyn: To slove [MAUI_01619453] Kenya FT T3168 restart issue */
+ /* Evelyn: To slove the non-sync problem that MAC clean res_req when receiving assignment
+ * But RLC think res_req already sent after RLC_MAC_RES_REQ in UL state.
+ * So tell RLC res_req is sent or not. */
+ kal_bool res_req_is_sent;
+
+/* Evelyn: R7 Latency Reducation Development */
+#ifdef __GERAN_RTTI__
+ tti_config_enum tti_mode;
+#endif
+} ul_con_ind_struct;
+
+typedef struct mac_rlc_ul_con_ind_struct{
+ LOCAL_PARA_HDR
+ kal_uint8 tlli_channel_coding;
+
+ #ifndef __REMOVE_FA__
+ kal_uint8 final_allocation;
+ #endif
+ #ifndef __REL5__
+ kal_uint16 blks_granted;
+ #endif
+
+ kal_uint8 ph_cont;
+
+ #ifdef __EGPRS_MODE__
+ kal_uint8 tbf_type;
+ #endif
+
+ kal_uint8 no_ul_con_ind;
+ ul_con_ind_struct multi_ul_con_ind[MULTIPLE_TBF_NUM];
+ #ifdef __GERAN_FANR__
+ kal_bool is_fanr_active;
+ kal_uint8 tan_type;
+ kal_uint32 tsh;
+ kal_uint8 Reported_timeslot;
+ #endif
+} mac_rlc_ul_con_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 type;
+} mac_rlc_failure_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 no_blks;
+ kal_uint8 blks_sent;
+ kal_uint16 frame_number;
+/* Evelyn 20090415: Merge R6 */
+ kal_uint8 pfi;
+} mac_rlc_data_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+
+ kal_uint8 cs;
+ kal_uint8 final_allocation;
+ kal_uint8 data_blks_granted;
+ kal_uint16 frame_number;
+#ifdef __EGPRS_MODE__
+ kal_uint8 resegment; /* re-segment bit */
+ kal_uint8 pre_emptive_retrans; /* pre-emptive */
+ TBF_TYPE tbf_type_tag;
+ union
+ {
+ ack_nack_desc_struct gprs_ie;
+ egprsack_nack_description_struct egprs_ie; /* */
+ }ack_nack_struct;
+#else
+ union
+ {
+ ack_nack_desc_struct gprs_ie;
+ }ack_nack_struct;
+#endif
+
+#ifdef __TBF_EST__
+ kal_uint8 tbf_est;
+#endif
+
+ /* Lanslo 20050825: for CRTU-G 52.1.2.1.8.1.8
+ * PUAN without contention TLLI should be accepted
+ * to process request of re-tx of PRR (and ARAC)
+ * and ack/nack description during contention */
+ kal_bool is_contention_success;
+ /* eo Lanslo 20050825 */
+/* Evelyn 20090415: Merge R6 */
+} mac_rlc_ack_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 rlc_mode;
+#ifdef __EGPRS_MODE__
+ kal_uint16 window_size;
+ kal_uint8 tbf_type;
+#endif
+} mac_rlc_switch_to_dl_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 ask_res_req;
+ kal_uint8 cause;
+} mac_rlc_ready_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint16 blks_granted;
+/* Evelyn 20090415: Merge R6 */
+ kal_uint8 no_of_ul_ts_alloc;
+} mac_rlc_pdch_rel_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 mac_mode;
+ kal_uint8 cs;
+ kal_uint8 tlli_channel_coding;
+ kal_uint8 final_allocation;
+ kal_uint8 ph_cont;
+ kal_uint8 timeslots_allocation;
+ kal_uint16 blks_granted;
+ #ifdef __EGPRS_MODE__
+ kal_uint8 resegment; /* resegment bit */
+ kal_uint8 window_size; /* window size */
+ kal_uint8 tbf_type; /* tbf type */
+ #endif
+
+} mac_rlc_switch_to_ul_struct;
+
+/* Evelyn 20090415: Merge R6 */
+typedef struct {
+ kal_uint8 rlc_mode;
+ #ifdef __EGPRS_MODE__
+ kal_uint16 window_size; /* downlink window size */
+ #endif
+/* Evelyn: R7 Latency Reducation Development */
+#ifdef __GERAN_RTTI__
+ tti_config_enum tti_mode;
+#endif
+
+#ifdef __GERAN_FANR__
+ kal_bool is_fanr_activated;
+ kal_bool is_event_based_fanr;
+#endif
+} dl_con_ind_struct;
+/* Evelyn 20090415: Merge R6 */
+typedef struct {
+ LOCAL_PARA_HDR
+
+ #ifdef __EGPRS_MODE__
+ kal_uint8 tbf_type;
+ #endif
+
+ kal_uint8 no_dl_con_ind;
+ dl_con_ind_struct multi_dl_con_ind[MULTIPLE_TBF_NUM];
+} mac_rlc_dl_con_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 no_dl_blocks;
+ /* Evelyn 20090905: Modify for High multislot class */
+ dl_block_struct dl_blocks[MAX_TX_TIMESLOTS];
+ #ifndef __MTK_TARGET__
+ kal_bool enable_dl_loop;
+ kal_uint16 bsn1;
+ kal_uint16 bsn2;
+ #endif
+ /* Claire 041216 change : Tell RLC DSP V(Q) from transfer_data_ind */
+ #ifdef __EGPRS_MODE__
+ kal_uint16 dsp_vq;
+ #endif
+} mac_rlc_dl_data_ind_struct;
+
+/* Lanslo 20070720: should replace MTK_KAL_MNT with __MTK_TARGET__ for MODIS */
+#ifndef __MTK_TARGET__
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 *packed_PDAN_msg;
+ kal_uint8 *egprs_ack_nack_ie_ptr;
+ kal_uint8 avail_len;
+ kal_uint8 s_or_p;
+ kal_bool reconstruct;
+/* Evelyn 20090415: Merge R6 */
+} mac_rlc_ack_req_struct;
+#endif
+/* Exce 030806: After this primitive is received should RES_REQ be sent from RLC */
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_dl_exist; /**
+ * Exce 20040528:
+ * Notify RLC that whether downlink TBF (either it
+ * is onging or pending) exists when confirming
+ * uplink TBF is released. Thus to resolve the problem
+ * that RLC does not send RES_REQ when REL_CNF
+ * is received during the time that ongoing downlink
+ * TBF is released and another one is pending to
+ * start.
+ */
+/* Evelyn 20090415: Merge R6 */
+} mac_rlc_rel_cnf_struct;
+
+/* Evelyn 20090415: Merge R6 */
+
+
+// Matt merge for R6
+typedef struct {
+ #ifdef __EGPRS_MODE__
+ kal_uint8 tbf_type;
+ kal_uint8 resegment; /* resegment bit */
+ kal_uint16 egprs_window_size;
+ #endif
+ kal_uint8 mac_mode;
+ kal_uint8 cs;
+ kal_uint8 tlli_channel_coding;
+ kal_uint8 final_allocation;
+ kal_uint8 ph_cont;
+ kal_uint8 timeslots_allocation;
+ kal_uint16 blks_granted;
+#if 0
+/* under construction !*/
+#endif
+ /* Claire 041117 change : Revise GPRS header partition between RLC and MAC */
+ kal_uint8 tfi; /*Simon use tfi to fill header*/
+ rlc_mode_enum rlc_mode;
+ kal_bool res_req_is_sent;
+}rlc_ul_con_ind_struct;
+
+typedef struct {
+ kal_uint8 rlc_mode;
+ #ifdef __EGPRS_MODE__
+ kal_uint16 window_size; /* downlink window size */
+ kal_uint8 tbf_type;
+#endif
+ kal_uint8 pfi;
+}rlc_dl_con_ind_struct;
+
+typedef struct{
+ kal_uint8 no_of_ul_ts_alloc;
+ kal_uint16 blks_granted; // for fix allocation
+ kal_uint8 pfi;
+}pdch_rel_ind_struct;
+
+#ifdef __MAC_SHOW_TRANS_DATA__
+
+typedef struct{
+ kal_uint8 is_data_valid;
+ kal_uint8 data[78];
+#ifdef __EGPRS_MODE__
+ kal_uint8 data2[78];
+ kal_uint8 is_data2_valid;
+#endif
+} mac_trans_data_content_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ kal_uint8 no_of_data;
+ mac_trans_data_content_struct data[MAX_RX_TIMESLOTS];
+} mac_mac_trans_data_ind_struct;
+#endif
+
+typedef struct mac_rlc_ps_conf_timer_update_req_struct {
+ LOCAL_PARA_HDR
+ ps_conf_timer_action_enum timer_action;
+
+} mac_rlc_ps_conf_timer_update_req_struct;
+
+#ifndef __MTK_TARGET__
+typedef struct{
+ LOCAL_PARA_HDR
+ kal_uint8 timer_index;
+ kal_uint8 timer_action;
+ kal_uint32 timeout_value;
+ kal_uint8 sim_index;
+ kal_uint8 tbf_index;
+} mac_timer_event_ind_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ kal_uint8 pca_give_in_count;
+ kal_uint8 pdan_give_in_count;
+ kal_uint8 pca_give_in_max;
+ kal_uint8 pdan_give_in_max;
+ kal_uint8 pca_give_in_max_learned;
+ kal_uint8 pdan_give_in_max_learned;
+ kal_uint32 next_outgoing_real_polling_frame;
+ kal_uint32 last_reported_polling_frame;
+
+ kal_uint8 is_ps_starvation_protect_activated;
+ kal_uint8 ps_starvation_protect_ul_blk_count;
+ kal_uint8 ul_blk_successive_conflict_count;
+ kal_uint32 ps_starvation_protect_frame;
+
+} mac_next_outgoing_rrbp_ind_struct;
+
+#ifdef __PS_L1_DC_ARCH__
+typedef struct{
+ LOCAL_PARA_HDR
+ kal_uint32 mac_next_rrbp_fn;
+ kal_uint32 mac_protected_rrbp_fn;
+ kal_uint32 mac_share_memory_rrbp_fn;
+ kal_uint32 mac_share_memory_protected_rrbp_fn;
+} mac_mac_rrbp_fn_ind_struct;
+#endif
+
+#endif
+
+#endif
+
+
+
diff --git a/mcu/protocol/interface/general/mac2rmpc_struct.h b/mcu/protocol/interface/general/mac2rmpc_struct.h
new file mode 100644
index 0000000..9d1176f
--- /dev/null
+++ b/mcu/protocol/interface/general/mac2rmpc_struct.h
@@ -0,0 +1,267 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/******************************************************************************
+ * Filename:
+ * ---------
+ * max2rmpc_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *=============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *=============================================================================
+ ******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _MAC2RMPC_STRUCT_H
+#define _MAC2RMPC_STRUCT_H
+
+/* add RHR */
+#include "rr_common_def.h"
+#include "rr2mpal_struct.h"
+//#include "mac_context.h"
+
+#include "mac_enums.h"
+
+/* Evelyn 20090415: Merge R6 */
+// Evelyn MTBF: Change the packet access structure
+typedef struct multiple_res_req_struct mac_rmpc_pkt_access_req_struct;
+
+typedef struct {
+ kal_uint32 starting_frame;
+ kal_uint8 measurement_interval;
+ kal_uint8 measurement_bit_map;
+} measurement_map_struct;
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 type;
+ kal_uint8 cause;
+} mac_rmpc_access_result_ind_struct;
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+/* Adeline: Relpace cs paging, PCCO, PMO, PCCC, PSCD, PNCD, PSCSI */
+typedef struct {
+ LOCAL_PARA_HDR
+ mac_rmpc_ctrl_msg_type_enum msg_type;
+ mac_state_enum mac_state;
+ kal_uint8 no_ctrl_blk;
+ kal_uint8 ctrl_blk_size;
+ kal_uint8 *ctrl_blk;
+ kal_uint8 bit_offset;
+} mac_rmpc_ctrl_msg_ind_struct;
+
+
+typedef struct {
+ LOCAL_PARA_HDR
+ tbf_rel_type_enum rel_type;
+ kal_uint8 mac_state;
+} mac_rmpc_enter_idle_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ measurement_map_struct measurement_map;
+} mac_rmpc_meas_map_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint16 fn_offset;
+ kal_uint8 type;
+ kal_uint8 cause;
+} mac_rmpc_dl_assign_result_ind_struct;
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 mac_state;
+} mac_rmpc_suspend_done_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 is_tbf_exist;
+ freq_params_struct *freq_params_ptr;
+} mac_rmpc_tbf_status_ind_struct;
+
+
+#if 0
+#ifdef __REL4__
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+#endif
+
+
+/* Evelyn 20090415: Merge R6 */
+typedef struct {
+ LOCAL_PARA_HDR
+ rmpc_mac_ctrl_msg_type_enum msg_type;
+ result_type_enum result;
+ kal_uint8 req_id;
+} mac_rmpc_ctrl_msg_cnf_struct;
+
+
+#ifdef __ETWS_SUPPORT__
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 mac_msg_ptr_size;
+ kal_uint8 bit_offset;
+ kal_uint8* mac_msg_ptr;
+} mac_rmpc_packet_application_info_msg_ind_struct;
+#endif /* __ETWS_SUPPORT__ */
+
+
+#endif
+
+
diff --git a/mcu/protocol/interface/general/mac_enums.h b/mcu/protocol/interface/general/mac_enums.h
new file mode 100644
index 0000000..2002b86
--- /dev/null
+++ b/mcu/protocol/interface/general/mac_enums.h
@@ -0,0 +1,445 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/******************************************************************************
+ * Filename:
+ * ---------
+ * mac_enums.h
+ *
+ * Project:
+ * --------
+ * UMOLY
+ *
+ * Description:
+ * ------------
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *=============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *=============================================================================
+ ******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _MAC_ENUMS_H
+#define _MAC_ENUMS_H
+
+typedef enum
+{
+ MAC_IDLE,
+ MAC_PKT_ACCESS,
+ MAC_UL,
+ MAC_DL,
+ MAC_UL_DL,
+ MAC_NUM_STATES
+} mac_state_enum;
+
+/* Jelly Substate -bg- */
+typedef enum
+{
+ DL_NULL,
+ DL_SINGLE_BLK_IN_PROG,
+ DL_SINGLE_BLK_ACK_SENDING,
+ DL_TBF_PEND,
+ DL_TRANSFER,
+ DL_TRANSFER_REALLOC_TBF_PEND,
+ DL_TRANSFER_FINAL_ACK_PACKED,
+ DL_TRANSFER_FAI_SENT_T3192_STARTED,
+ DL_TRANSFER_TBF_PENDING_FROM_T3192,
+ DL_TRANSFER_ABNORMAL_REL_PEND,
+ DL_DISCONNECTING,
+ DL_SUBSTATE_NUM
+} mac_dl_substate_enum;
+
+typedef enum
+{
+ ACS_NULL,
+ ACS_RLC_RES_REQ_SENT,
+ ACS_ONE_PHASE_TBF_PEND,
+ ACS_ONE_PHASE_CONTENTION,
+ ACS_ONE_PHASE_CONTENTION_REALLOC_PEND,
+ ACS_TWO_PHASE_SINGLE_BLK_PEND,
+ ACS_TWO_PHASE_PRR_SENT,
+ ACS_TWO_PHASE_TBF_PEND,
+ ACS_RMPC_RES_REQ_SENT,
+ ACS_UL_SINGLE_BLK_IN_PROG,
+ ACS_UL_SINGLE_BLK_DELETE,
+ ACS_SUBSTATE_NUM
+} mac_acs_substate_enum;
+
+typedef enum
+{
+ UL_NULL,
+ UL_TRANSFER,
+ UL_TRANSFER_TBF_PEND,
+ UL_TRANSFER_REL_PEND,
+ UL_TRANSFER_ABNORMAL_REL_PEND,
+#ifdef __TBF_EST__
+ UL_TBF_EST_WAITING,
+ UL_TBF_EST_ADDED,
+ UL_TBF_EST_SENT_AB,
+ UL_TBF_EST_SENT_NB,
+ UL_TBF_EST_SENT_AB_PUAS_POLL,
+ UL_TBF_EST_PEND_AB,
+ UL_TBF_EST_PEND_NB,
+#endif /* __TBF_EST__ */
+ UL_SUBSTATE_NUM
+} mac_ul_substate_enum;
+
+typedef enum
+{
+ RES_REQ_INVALID,
+ RES_REQ_RMPC_IN_RACH_IDLE,
+ RES_REQ_RLC_IN_RACH_IDLE,
+ RES_REQ_RLC_IN_CTRL_MSG_Q_ACS,
+ RES_REQ_RLC_SENT_ACS,
+ RES_REQ_RLC_PEND_TRANSFER,
+ RES_REQ_RLC_IN_CTRL_MSG_Q_TRANSFER,
+ RES_REQ_RLC_IN_PDAN_TRANSFER,
+ RES_REQ_RLC_SENT_TRANSFER,
+ RES_REQ_RLC_TBF_EST_SENT_IDLE,
+ RES_REQ_STATUS_NUM
+} mac_res_req_status_enum;
+
+
+/* Jelly Substate -ed- */
+
+typedef enum
+{
+ INVALID_TBF, /* Suppose this value is only used by PKT TS RECONFIG */
+ DL_TBF,
+ UL_TBF
+} mac_tbf_direction_enum;
+
+typedef enum
+{
+ CELL_CHANGE_FAIL,
+ /* Lanslo 20070705: NACC */
+#ifdef __GERAN_R4__
+ NACC_PCCN,
+ NACC_SI_STATUS,
+#endif /* __GERAN_R4__ */
+ /* eo Lanslo 20070705: NACC */
+ PKT_MOBILE_TBF_STATUS,
+ MEASUREMENT_REPORT,
+ PKT_PSI_STATUS,
+ PKT_UL_DUMMY_CTRL,
+
+#ifdef __EGPRS_MODE__
+ RESOURCE_REQ,
+ EGPRS_RES_REQ,
+ EGPRS_ARAC
+#else /* __EGPRS_MODE__ */
+ RESOURCE_REQ
+#endif /* __EGPRS_MODE__ */
+} mac_prioritized_ctrl_msg_enum;
+
+typedef enum
+{
+ NORMAL_EVENT,
+ UNSPECIFIED_STATUS,
+ NON_DIST_PART_ERROR,
+ MSG_ESCAPE_ERROR,
+ NON_COMPATIBLE_MSG
+} mac_tbf_cause_enum;
+
+typedef enum
+{
+ FREQ_PARAMS_NOTVALID,
+ FREQ_PARAMS_NOTINBAND,
+ FREQ_PARAMS_MISMATCH,
+ FREQ_PARAMS_OK
+} mac_freq_params_enum;
+
+typedef enum
+{
+ BLOCKS,
+ BLOCK_PERIODS
+} mac_blk_or_blk_period_enum;
+
+typedef enum
+{
+ DL_ASSIGN_NOT_VALID,
+ PKT_DL_ASSIGN_VALID,
+ IMM_DL_ASSIGN_VALID,
+ PDCH_DL_ASSIGN_VALID,
+ MTDAS_DL_ASSIGN_VALID
+} mac_dl_assign_type_enum;
+
+/* Exce 030707: To identify which direction of TBF the incoming CON_IND is for */
+typedef enum
+{
+ CON_IND_UNMATCH,
+ CON_IND_FOR_DL,
+ CON_IND_FOR_UL,
+ CON_IND_FOR_TS_RECONFIG
+} mac_con_ind_enum;
+
+/* Exce 031128: For PKT PDCH RELEASE */
+typedef enum
+{
+ MAC_PDCH_REL_LIMIT_OLD = 0,
+ MAC_PDCH_REL_LIMIT_ALL
+} pdch_release_limit_enum;
+
+typedef enum
+{
+ MAC_PDTCH_NORMAL = 0,
+ MAC_PS_HO_START,
+ MAC_PS_HO_RECONN_ACTIVE,
+ MAC_PS_HO_RECONN_INACTIVE,
+ MAC_PDTCH_INACTIVE_AFTER_PS_HO
+} mac_pdtch_connect_cause_enum;
+
+typedef enum
+{ /* shall sync with MAC_TIMER_NUM_MSGS value */
+ MAC_T3164_TIMER_ID = 0,
+ MAC_T3166_TIMER_ID, /*1*/
+ MAC_T3168_TIMER_ID, /*2*/
+ MAC_T3180_TIMER_ID, /*3*/
+ MAC_T3188_TIMER_ID, /*4*/
+ MAC_T3190_TIMER_ID, /*5*/
+ MAC_T3192_TIMER_ID, /*6*/
+ /* Katie 20130108: for RRBP to PUAN with FAI not sent,
+ wait 5 sec for retransmitted PUAN */
+ MAC_GuardPUAN_TIMER_ID, /*7*/
+ MAC_LCE_hyst_millis_TIMER_ID, /* 12 */
+ MAC_PACCH_PROTECT_TIMER_ID, /*8*/
+#ifdef __MAC_RANDOM_PATTERN_TEST__
+ MAC_FakeMessage_TIMER_ID,
+#endif
+ MAC_T8983_TIMER_ID, /*9*/ /* Custom timer To allow RRBP TX for POLL/PCA/PDAN for GCF MM/SM control messages, before TBF disconnect */
+ MAC_TOTAL_TIMER_NUM
+} mac_timer_id_enum; /* MAC_TIMER Message Type */
+
+#ifndef __MTK_TARGET__
+typedef enum
+{
+ MAC_TIMER_START,
+ MAC_TIMER_STOP,
+ MAC_TIMER_TIMEOUT
+} mac_timer_action_enum;
+#endif
+
+
+
+/* Claire 050128 change : Implement EGPRS SRB mode */
+#ifdef __EGPRS_MODE__
+typedef enum
+{
+ MAC_EGPRS_SRB_LOOP_NONE, /* SRB mode is not active */
+ MAC_EGPRS_SRB_LOOP_UL_TBF_ESTABLISHING, /* MAC is waiting for UL assignment */
+ MAC_EGPRS_SRB_LOOP_SUBMODE_ON, /* EGPRS SRB Loopback submode ON */
+ MAC_EGPRS_SRB_LOOP_SUBMODE_OFF /* EGPRS SRB Loopback submode OFF */
+} egprs_srb_status_enum;
+#endif /* __EGPRS_MODE__ */
+
+
+/* Exce 030818: New exception handling mechanism for MAC */
+typedef enum
+{
+ MAC_MSG_EX_NO_EXCEPTION,
+
+ MAC_MSG_EX_INCOMPATIBLE_STATE, /* 1 */
+ MAC_MSG_EX_UNKNOWN_MSG, /* 2 */
+ MAC_MSG_EX_DIST_PART_ERR, /* 3 */
+ MAC_MSG_EX_ADDRESS_PART_ERR, /* 4 */
+ MAC_MSG_EX_NON_DIST_PART_ERR, /* 5 */
+ MAC_MSG_EX_MSG_ESC_ERR, /* 6 */
+ MAC_MSG_EX_IGNORE_LABEL_ERR, /* 7 */
+ MAC_MSG_EX_TRUNCATED_CONCACT_ERR, /* 8 */
+ MAC_MSG_EX_DECODE_ERR, /* 9 */
+
+ MAC_MSG_EX_MA_INVALID, /* 10 */
+ MAC_MSG_EX_SINGLE_BLOCK_GAP_TOO_SHORT, /* 11 */
+ MAC_MSG_EX_STARTING_TIME_NOT_PRESENT_FOR_FIXED_ALLOC, /* 12 */
+ MAC_MSG_EX_TFI_NOT_ASSIGNED, /* 13 */
+ MAC_MSG_EX_MULTISLOT_CAP_NOT_MEET, /* 14 */
+ MAC_MSG_EX_BEFORE_TIME_VALID_FOR_NON_DYNAMIC_ALLOC, /* 15 */
+ MAC_MSG_EX_FREQ_PARAM_NOT_PRESENT, /* 16 */
+ MAC_MSG_EX_FREQ_PARAM_INVALID, /* 17 */
+ MAC_MSG_EX_FREQ_PARAM_NOTINBAND, /* 18 */
+ MAC_MSG_EX_FREQ_PARAM_MISMATCH, /* 19 */
+ MAC_MSG_EX_MAC_MODE_MISMATCH, /* 20 */
+ MAC_MSG_EX_TBF_MODE_MISMATCH, /* 21 */
+
+ /* Exce 20040218: TLLI_MISMATCH_IN_ONE_PHASE ~ NO_UL_TS_IN_UL_ASSIGN are used by mac_pkt_access_exception_hdlr() only */
+ MAC_MSG_EX_TLLI_MISMATCH_IN_ONE_PHASE, /* 22 */
+ MAC_MSG_EX_TLLI_ABSENT_IN_ONE_PHASE, /* 23 */
+ MAC_MSG_EX_REACH_N3104_MAX_IN_ONE_PHASE, /* 24 */
+ MAC_MSG_EX_NOT_SENT_AS_T3164_TIMEOUT, /* 25 */
+ MAC_MSG_EX_SENT_NO_RESPONSE_AS_T3166_TIMEOUT, /* 26 */
+ MAC_MSG_EX_TLLI_MISMATCH_IN_TWO_PHASE, /* 27 */
+ MAC_MSG_EX_SENT_NO_RESPONSE_AS_T3168_TIMEOUT, /* 28 */
+ MAC_MSG_EX_TWO_PHASE_REQUESTED_BUT_ONE_PHASE_ASSIGNED, /* 29 */
+ MAC_MSG_EX_PKT_PDCH_REL_DURING_TWO_PHASE_CONTENTION, /* 30 */
+ MAC_MSG_EX_NO_UL_TS_IN_UL_ASSIGN, /* 31 */
+
+ MAC_MSG_EX_INCOMPATIBLE_CTRL_ACK_T3192, /* 32 */
+ MAC_MSG_EX_RLC_MODE_MISMATCH, /* 33 */
+ MAC_MSG_EX_MAC_MODE_INVALID_ASSIGNED_BY_NW, /* 34 */
+
+#ifdef __TBF_EST__
+ MAC_MSG_EX_SINGLE_BLOCK_GAP_TOO_SHORT_TBF_EST, /* 35 */
+#endif
+
+
+
+#if defined(__GERAN_RTTI__) || defined(__GERAN_FANR__)
+ MAC_MSG_EX_REL7_PART_ERROR, /* 41 */
+#endif
+ TOTAL_MAC_MSG_EX_END
+} mac_msg_exception_enum;
+
+typedef enum
+{
+ OLD_TBF_POS_INVALID = 0,
+ BACK_UP_ALLOC,
+ ACTIVE_ALLOC
+} old_tbf_para_pos_in_ps_ho_enum;
+
+typedef enum
+{
+ BSIC_SYNC_FAIL = 0,
+ T3216_TIMEOUT,
+ T3218_TIMEOUT,
+ G2U_ACTIVE_FAIL
+} mac_ps_ho_fail_cause;
+
+typedef enum
+{
+ MAC_NON_TBF_VALID = 0,
+ MAC_ACTIVE_VALID,
+ MAC_INACTIVE_VALID
+} mac_backup_tbf_status;
+
+typedef enum
+{
+ MAC_FIND_FIRST_1_FROM_MSB_TO_LSB,
+ MAC_FIND_FIRST_1_FROM_LSB_TO_MSB
+} mac_find_first_1_dir_enum;
+
+typedef enum
+{
+ MAC_RXED_BLK_BITMAP_INVALID,
+ MAC_RXED_BLK_BITMAP_ALL_NACKED,
+ MAC_RXED_BLK_BITMAP_SOME_NACKED,
+ MAC_RXED_BLK_BITMAP_ALL_ACKED
+} mac_rxed_blk_bitmap_enum;
+
+typedef enum
+{
+ MAC_TFI_NOT_MATCH,
+ MAC_TFI_NOT_MATCH_FROM_NON_PACCH,
+ MAC_TFI_MATCH
+} mac_tfi_match_status_enum;
+
+#ifdef __MODEM_EM_MODE__
+typedef enum
+{
+ MAC_EM_UL_TBF_ONE_PHASE_ACCESS_IN_CHANNEL_REQUEST = 1, /*1*/
+ MAC_EM_UL_TBF_SINGLE_BLOCK_OR_TWO_PHASE_ACCESS_IN_CHANNEL_REQUEST = 2, /*2*/
+ MAC_EM_UL_TBF_ONE_PHASE_ACCESS_IN_PACKET_CHANNEL_REQUEST = 11, /*11*/
+ MAC_EM_UL_TBF_TWO_PHASE_ACCESS_IN_PACKET_CHANNEL_REQUEST = 12, /*12*/
+ MAC_EM_UL_TBF_PAGE_RESPONSE_IN_PACKET_CHANNEL_REQUEST = 13, /*13*/
+ MAC_EM_UL_TBF_CELL_UPDATE_IN_PACKET_CHANNEL_REQUEST = 14, /*14*/
+ MAC_EM_UL_TBF_MM_PROCEDURE_IN_PACKET_CHANNEL_REQUEST = 15, /*15*/
+ MAC_EM_UL_TBF_SINGLE_BLOCK_WITHOUT_TBF_ESTABLISHMENT_IN_PACKET_CHANNEL_REQUEST = 16, /*16*/
+ MAC_EM_UL_TBF_ONE_PHASE_ACCESS_IN_RLC_UNACK_MODE_IN_PACKET_CHANNEL_REQUEST = 17, /*17*/
+ MAC_EM_UL_TBF_ONE_PHASE_ACCESS_IN_EGPRS_PACKET_CHANNEL_REQUEST = 21, /*21*/
+ MAC_EM_UL_TBF_TWO_PHASE_ACCESS_IN_EGPRS_PACKET_CHANNEL_REQUEST = 22, /*22*/
+ MAC_EM_UL_TBF_SIGNALLING_IN_EGPRS_PACKET_CHANNEL_REQUEST = 23, /*23*/
+ MAC_EM_UL_TBF_ONE_PHASE_ACCESS_IN_RLC_UNACK_MODE_IN_EGPRS_PACKET_CHANNEL_REQUEST = 24, /*24*/
+ MAC_EM_UL_TBF_CHANNEL_REQUEST_IN_PACKET_DOWNLINK_ACK_NACK = 31, /*31*/
+ MAC_EM_UL_TBF_CHANNEL_REQUEST_IN_EGPRS_PACKET_DOWNLINK_ACK_NACK = 32, /*32*/
+ MAC_EM_UL_TBF_USER_DATA_IN_DTM_REQUEST = 51, /*51*/
+ MAC_EM_UL_TBF_PAGE_RESPONSE_IN_DTM_REQUEST = 52, /*52*/
+ MAC_EM_UL_TBF_CELL_UPDATE_IN_DTM_REQUEST = 53, /*53*/
+ MAC_EM_UL_TBF_MM_PROCEDURE_IN_DTM_REQUEST = 54 /*54*/
+} mac_em_ul_tbf_establishment_cause;
+
+typedef enum
+{
+ MAC_EM_UL_TBF_ONE_PHASE_ACCESS = 1, /*1*/
+ MAC_EM_UL_TBF_TWO_PHASE_ACCESS = 2, /*2*/
+ MAC_EM_UL_TBF_SINGLE_BLOCK_OR_MULTI_BLOCK_ACCESS = 3, /*3*/
+ MAC_EM_UL_TBF_GPRS_OR_EGPRS_PACKET_DOWNLINK_ACK_NACK_CHANNEL_REQUEST = 4, /*4*/
+ MAC_EM_UL_TBF_DTM_REQUEST = 5 /*5*/
+} mac_em_ul_tbf_establishment_type;
+
+typedef enum
+{
+ MAC_EM_UL_TBF_SUCCEEDED = 1, /*1*/
+ MAC_EM_UL_TBF_FAILED = 2, /*2*/
+ MAC_EM_UL_TBF_REJECTED = 3, /*3*/
+ MAC_EM_UL_TBF_ABORTED = 4 /*4*/
+} mac_em_ul_tbf_establishment_status;
+#endif /* __MODEM_EM_MODE__ */
+
+#endif /* _MAC_ENUMS_H */
diff --git a/mcu/protocol/interface/general/mac_rmpc_enums.h b/mcu/protocol/interface/general/mac_rmpc_enums.h
new file mode 100644
index 0000000..85e5fc9
--- /dev/null
+++ b/mcu/protocol/interface/general/mac_rmpc_enums.h
@@ -0,0 +1,205 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/******************************************************************************
+ * Filename:
+ * ---------
+ * mac_rmpc_enums.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file is intends to define related messages and paramters between MAC
+ * and RMPC.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *=============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *=============================================================================
+ ******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _MAC_RMPC_ENUMS_H
+#define _MAC_RMPC_ENUMS_H
+
+
+
+/******************************************************************************
+ * Constant
+ ******************************************************************************/
+#define MAX_RADIO_PRIORITY 4
+#define MAX_OCTETS_IN_CONTROL_BLOCK 22
+#define MAX_OCTETS_WITH_HEADER_IN_CONTROL_BLOCK 23
+
+/******************************************************************************
+ * Enum Value
+ ******************************************************************************/
+typedef enum {
+ UL_FAILURE,
+ UL_SUCCESS,
+ UPDATE_PROTECT_PACCH
+} pa_result_type_enum;
+
+typedef enum {
+ DL_FAILURE,
+ DL_SUCCESS
+} dl_result_type_enum;
+
+typedef enum {
+ ONE_PHASE_CONTENTION_IN_PROG, /* 0 */
+ TWO_PHASE_CONTENTION_IN_PROG, /* 1 */
+ CONTENTION_PASS, /* 2 */
+ DL_TBF_PENDING, /* 3 */
+ INVALID_FREQ_PARAMS, /* 4 */
+ NO_FREQ_PARAMS, /* 5 */
+ NOT_SUPPORTING_MODE, /* 6 */
+ INVALID_CODING_SCHEME, /* 7 */
+ ONE_PHASE_CONTENTION_FAIL, /* 8 */
+ TWO_PHASE_CONTENTION_FAIL, /* 9 */
+ MULTI_SLOT_RESTRICTION_NOT_MET, /* 10 */
+ GOT_ACCESS_REJ, /* 11 */
+ UL_TFI_ABSENT, /* 12 */
+ DL_TFI_ABSENT, /* 13 */
+ MSG_DECODE_ERR, /* 14 */
+ MSG_WITH_INVALID_STARTING_TIME, /* 15 */
+ ACCESS_FAIL_WITH_MAX_RETRY, /* 16 */
+
+#ifdef __TBF_EST__
+ MSG_WITH_INVALID_STARTING_TIME_TBF_EST, /*17 */
+#endif
+
+ /* Lanslo 20070424: MONZA receives bad single block
+ (should be PCCO) during packet access in 8960 inter-RAT test */
+ DL_SINGLE_BLK_ERR, /* 18 */
+
+ /* Byron: Add for GEMINI, for DL single block that MAC accept it,
+ Another RR actually can be resume. Therefore, add this cause
+ to let MAC inform RMC when accept this DL single block assignment.
+ This inform procedure is also the new one*/
+ /*Byron: 2007/11/19: This is needed for MONZA due to there is a DL TBF in progress substate*/
+ DL_SINGLE_BLK_SUCC, /* 19 */
+ /*Evelyn 20080826: Add to notify RMPC that second DL_ASSIGN_IND is dropped by MAC
+ Because DL TBF is in progress*/
+ DROP_DUE_TO_DL_IN_PROG, /* 20 */
+
+ /* Nancy 20090727: Send uplink single block through MAC. */
+ UL_SINGLE_BLK_IN_PROG, /* 21 */
+ UL_SINGLE_BLK_SUCC, /* 22 */
+ /* Nancy 20090727: If uplink single block and failure is due to invalid
+ * starting time, access procedure is aborted.
+ * [TS 04.18] 3.5.2.1.3.3 If the mobile station receives the IMMEDIATE
+ * ASSIGNMENT message after the TBF starting time has expired, a failure has
+ * occurred. If a failure occurs and the packet access attempt was due to the
+ * sending of an RLC/MAC control message, the packet access is aborted, the
+ * mobile station returns to packet idle mode. */
+ MSG_WITH_INVALID_STARTING_TIME_FOR_CTRL_MSG, /* 23 */
+ START_PACCH_PROTECT_REQ, /* 24 */
+ STOP_PACCH_PROTECT_REQ, /* 25 */
+
+ TOTAL_ACCESS_RESULT_ENUM /* 26 */
+} access_result_enum;
+
+/* Vincent 040207 add */
+typedef enum
+{
+ ALL_TBF_END,
+ DL_TBF_START,
+ UL_TBF_START
+} tbf_status_change_enum;
+
+#ifdef __EGPRS_MODE__
+typedef enum EGPRS_MEAS_PARAM
+{
+ LINK_QUALITY_MEASUREMENT_MODE,
+ BEP_PERIOD,
+ BEP_PERIOD2
+} egprs_meas_param_enum;
+#endif /* end of __EGPRS_MODE__ */
+
+#endif /* end of _MAC_RMPC_ENUMS_H */
+
+
diff --git a/mcu/protocol/interface/general/mbmsal_errc_struct.h b/mcu/protocol/interface/general/mbmsal_errc_struct.h
new file mode 100644
index 0000000..bf0e742
--- /dev/null
+++ b/mcu/protocol/interface/general/mbmsal_errc_struct.h
@@ -0,0 +1,356 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2012
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * mbmsal_errc_struct.h
+ *
+ * Project:
+ * --------
+ * TK6291
+ *
+ * Description:
+ * ------------
+ * message, enums and common structure definition between MBMSAL and ERRC module
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 09 18 2020 bart.liang
+ * [MOLY00569501] [Gen97] TC10 patch back
+ * Merge from CL2962151
+ *
+ * 08 17 2017 danny.kuo
+ * [MOLY00270475] [MT6763][Bianco][N1][NIOT][eMBMS] eMBMS session reception on scell stops at connection release.
+ * .
+ *
+ * 10 24 2016 cynthia.chen
+ * [MOLY00208768] [MT6293] [B66] Band66 porting (ERRC part)
+ * - errc mbmsal,em part OA domain
+ *
+ * 03 16 2016 kun-lin.wu
+ * [MOLY00166918] SPV eMBMS potential bug fix
+ *
+ * 02 17 2016 kun-lin.wu
+ * [MOLY00162733] [MT6755][Jade M6][MP3][L+W][In-house FTA][eMBMS][EE][ASSERT] file:pcore/modem/l4/mbmsal/src/mbmsal_hdlr.c line:635
+ *
+ * 02 17 2016 tc.chang
+ * [MOLY00159610] eMBMS VzW/LGE requirement.
+ *
+ * 02 15 2016 kun-lin.wu
+ * [MOLY00155092] [MBMS target IT] [CMW500] ml_035f mbms video stream Assert fail: errc_spv_mbms.c 812
+ *
+ * 06 16 2015 yingwei.huang
+ * [MOLY00098916] [MT6291] MBMS reception on SCELL
+ * .
+ *
+ * 04 08 2015 morton.lin
+ * [MOLY00095623] [eRRC] Gemini virtual mode
+ * eMBMS Gemini 2PS phase-in: MBMSAL IF part
+ *
+ * 01 19 2015 morton.lin
+ * [MOLY00078855] [MT6291_DEV] eRRC eMBMS
+ * [6291][ERRC][SPV] eMBMS phase-in (UMOLY)
+ *
+ * 12 12 2014 morton.lin
+ * [MOLY00084695] [6291] Code merged from MT6291_DEV to UMOLY TRUNK
+ * MBMS IF check-in UMOLY
+ *
+ * 10 13 2014 morton.lin
+ * [MOLY00078855] [MT6291_DEV] eRRC eMBMS
+ * Add mcd_l3_inc_struct header inclusion
+ *
+ * 10 01 2014 morton.lin
+ * [MOLY00078855] [MT6291_DEV] eRRC eMBMS
+ * Use agreed TMGI structure
+ *
+ * 09 14 2014 morton.lin
+ * [MOLY00068710] [TK6291_DEV] Sync MOLY to TK6291_DEV
+ * [ERRC][MBMS][IF] Revise the additional info data structure according to the IF document
+ *
+ * 09 05 2014 morton.lin
+ * [MOLY00068710] [TK6291_DEV] Sync MOLY to TK6291_DEV
+ * [MBMSAL][ERRC][IF] Revise daylight saving time format
+ *
+ * 09 04 2014 cooper.lin
+ * [MOLY00068710] [TK6291_DEV] Sync MOLY to TK6291_DEV
+ * modify MBMSAL-SPV interface usage, and add MBMSAL_ERRC_SAP
+ *
+ * 08 20 2014 cooper.lin
+ * [MOLY00068710] [TK6291_DEV] Sync MOLY to TK6291_DEV
+ * Revise MBMS interface.
+ *
+ ****************************************************************************/
+
+
+#ifndef MBMSAL_ERRC_STRUCT_INC
+#define MBMSAL_ERRC_STRUCT_INC
+
+#include "kal_general_types.h"
+#include "mcd_l3_inc_struct.h" //For plmn_id_struct
+#include "global_type.h"
+
+#define MBMS_SERVSESS_INFO_EARFCN_NUM 5
+#define MBMS_SERVSESS_INFO_SAI_NUM 64
+
+#define MBMS_SERVICE_STATUS_MBSFN_AREA_NUM 8
+
+#define MBMS_SIB15_FREQ_SAI_NUM 64
+#define MBMS_SIB15_INTER_FREQ_NUM 8
+#define MBMS_SIB15_INTER_FREQ_MULTI_BAND_NUM 8
+
+#define MBMS_CONFIG_INFO_MCH_NUM 15
+#define MBMS_CONFIG_INFO_SERVICE_NUM 29
+
+#define MBMS_SERVSESS_STATUS_SERVICE_NUM 8
+
+#define ERRC_MBMS_MAX_CELL_NUM 2
+
+#define ERRC_MBMS_PCELL_VALID 0X01
+#define ERRC_MBMS_SCELL_VALID 0X02
+
+/* Duration of searching MBMS session (second) */
+/* From CK's information, 15 sec is too long for Expway. Recommend 8 sec. */
+#define MBMSAL_SERVSESS_SEARCH_TIME_DEFAULT 8
+
+#define MBMS_INVALID_SESSION_ID 0xFFFF
+
+#define MBMSAL_OUT_SESS_HYSTERESIS_PERIOD_DEFAULT 10 // refer to VZ_REQ_LTEEMBMS_6987
+
+#define MBMS_REPORT_TMGI_PER_MBSFN_AREA 32
+
+/***** enums definition *****/
+typedef enum
+{
+ MBMS_STATUS_COVER_MBMSAREA,
+ MBMS_STATUS_COVER_NONMBMSAREA,
+ MBMS_STATUS_COVER_OOS,
+ MBMS_STATUS_COVER_LEAVELTE,
+#if defined(__GEMINI__)
+ MBMS_STATUS_COVER_GEMINI_SUSPEND,
+ MBMS_STATUS_COVER_GEMINI_VIRTUAL_SUSPEND,
+#endif
+
+ MBMS_STATUS_SERVSESS_ACTSUCC,
+ MBMS_STATUS_SERVSESS_ACTSUCC_ALREADY_DONE,
+ MBMS_STATUS_SERVSESS_ACTFAIL, // Unknown reason
+ MBMS_STATUS_SERVSESS_ACTFAIL_MAX_SESSIONS,
+ MBMS_STATUS_SERVSESS_ACTFAIL_MISS_MCCH,
+ MBMS_STATUS_SERVSESS_ACTFAIL_MISS_TMGI,
+ MBMS_STATUS_SERVSESS_ACTFAIL_OOC,
+ MBMS_STATUS_SERVSESS_ACTFAIL_OOS,
+ MBMS_STATUS_SERVSESS_ACTFAIL_FREQUENCY_CONFLICT,
+ MBMS_STATUS_SERVSESS_DEACTSUCC,
+ MBMS_STATUS_SERVSESS_DEACTFAIL,
+
+ // For below causes:
+ // 1. MBMSAL assume SPV only report indication when there is any active session before the indication.
+ // 2. config_servsess_valid in mbmsal_errc_mbms_servsess_status_ind_struct needs to be KAL_FALSE.
+ MBMS_STATUS_SERVSESS_UPDATE,
+ MBMS_STATUS_SERVSESS_DEACT_NONMBMSAREA,
+ MBMS_STATUS_SERVSESS_DEACT_OOS,
+ MBMS_STATUS_SERVSESS_DEACT_LEAVELTE,
+ MBMS_STATUS_SERVSESS_DEACT_MBMSDISABLED
+#if defined(__GEMINI__)
+ , MBMS_STATUS_SERVSESS_DEACT_GEMINI_SUSPEND
+ , MBMS_STATUS_SERVSESS_DEACT_GEMINI_VIRTUAL_SUSPEND
+#endif
+} mbmsal_errc_mbms_status_enum;
+
+typedef enum
+{
+ DAYLIGHT_SAVING_TIME_NO_ADJ = 0,
+ DAYLIGHT_SAVING_TIME_PLUS_ONE_ADJ = 1,
+ DAYLIGHT_SAVING_TIME_PLUS_TWO_ADJ = 2,
+ DAYLIGHT_SAVING_TIME_RESV = 3
+} daylight_saving_time_enum;
+
+typedef enum
+{
+ MBMS_CONFIG_DELETE_NONE,
+
+ /* VZ_REQ_LTEEMBMS_6939:
+ * Out of MBMS service area in AP view. On-going sessions are not affected.
+ * To prevent the scenario that out of MBMS service is reported but there are active sessions,
+ * MBMSAL/AP could send DELETE_ALL_ACTIVE_SERVESS if out-session-hysteresis is configured.
+ */
+ MBMS_CONFIG_DELETE_ALL_ACTIVE_SERVSESS,
+
+ /* VzW: E911 or hVoLTE flow (AT+EMEVT). Deactivate ALL sessions. */
+ MBMS_CONFIG_DELETE_ALL_ACTIVE_AND_ONGOING_SERVSESS,
+} mbmsal_errc_config_delete_servsess_enum;
+
+/***** message structure definition *****/
+typedef struct
+{
+ plmn_id_struct plmnId;
+ kal_uint8 service_id[3]; //Format is [0], [1], [2]
+} tmgi_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool enable;
+ kal_bool mbms_prioritized;
+ kal_uint32 search_time;
+ kal_uint32 out_sess_hysteresis_period;
+
+ kal_bool servsess_info_valid;
+ struct {
+ kal_bool enable;
+ tmgi_struct tmgi;
+ kal_uint16 sess_id; /* 0xffff = invalid */
+ kal_bool mbsfn_area_id_valid; /* according to AT Spec, although not one of usd info */
+ kal_uint8 mbsfn_area_id; /* according to AT Spec, although not one of usd info */
+ kal_bool additional_info_valid;
+ struct {
+ kal_uint8 num_of_earfcn;
+ EARFCN earfcn[MBMS_SERVSESS_INFO_EARFCN_NUM];
+ kal_uint8 num_of_sai;
+ kal_uint16 sai[MBMS_SERVSESS_INFO_SAI_NUM];
+ } additional_info;
+ } servsess_info;
+
+ /* servsess_info_valid and deact_type are excluded */
+ mbmsal_errc_config_delete_servsess_enum delete_type;
+} mbmsal_errc_mbms_config_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 validity;
+ //ERRC_MBMS_PCELL_VALID => the following fields apply to Pcell only
+ //ERRC_MBMS_SCELL_VALID => the following fields apply to Scell only
+ //ERRC_MBMS_PCELL_VALID | ERRC_MBMS_SCELL_VALID => the following fields apply to both Pcell and Scell.
+
+ mbmsal_errc_mbms_status_enum coverage_status;
+ kal_bool serving_earfcn_valid[ERRC_MBMS_MAX_CELL_NUM];
+ EARFCN serving_earfcn[ERRC_MBMS_MAX_CELL_NUM];
+ kal_uint8 num_of_mbsfn_area_id[ERRC_MBMS_MAX_CELL_NUM];
+ kal_uint8 mbsfn_area_id[ERRC_MBMS_MAX_CELL_NUM][MBMS_SERVICE_STATUS_MBSFN_AREA_NUM];
+} mbmsal_errc_mbms_service_status_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 validity;
+
+ EARFCN serving_earfcn[ERRC_MBMS_MAX_CELL_NUM];
+ kal_uint8 num_of_intra_freq_sai[ERRC_MBMS_MAX_CELL_NUM];
+ kal_uint16 intra_freq_SAI[ERRC_MBMS_MAX_CELL_NUM][MBMS_SIB15_FREQ_SAI_NUM];
+ kal_uint8 num_of_inter_freq_sai_list[ERRC_MBMS_MAX_CELL_NUM];
+ struct {
+ EARFCN earfcn;
+ kal_uint8 num_of_sai;
+ kal_uint16 sai[MBMS_SIB15_FREQ_SAI_NUM];
+ kal_uint8 num_of_multi_band_info;
+ kal_uint16 multi_band_info[MBMS_SIB15_INTER_FREQ_MULTI_BAND_NUM];
+ } inter_freq_SAI_list[ERRC_MBMS_MAX_CELL_NUM][MBMS_SIB15_INTER_FREQ_NUM];
+} mbmsal_errc_mbms_sib15_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 validity;
+
+ EARFCN serving_earfcn[ERRC_MBMS_MAX_CELL_NUM];
+ kal_uint64 utc[ERRC_MBMS_MAX_CELL_NUM];
+ kal_bool daylight_saving_time_valid[ERRC_MBMS_MAX_CELL_NUM]; /* false = clear daylight saving time */
+ daylight_saving_time_enum daylight_saving_time[ERRC_MBMS_MAX_CELL_NUM];
+ kal_int16 leap_seconds[ERRC_MBMS_MAX_CELL_NUM]; /* 0xffff = clear */
+ kal_int8 local_time_offset[ERRC_MBMS_MAX_CELL_NUM]; /* 0xff = clear */
+ kal_uint32 rcv_os_time[ERRC_MBMS_MAX_CELL_NUM];
+} mbmsal_errc_mbms_sib16_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 validity;
+
+ EARFCN serving_earfcn[ERRC_MBMS_MAX_CELL_NUM];
+ kal_uint8 mbsfn_area_id[ERRC_MBMS_MAX_CELL_NUM];
+ kal_uint8 num_of_mch_info[ERRC_MBMS_MAX_CELL_NUM];
+ struct {
+ kal_uint8 num_of_servsess_info;
+ struct {
+ tmgi_struct tmgi;
+ kal_uint16 sess_id; /* 0xffff = invalid */
+ } servsess_info[MBMS_CONFIG_INFO_SERVICE_NUM];
+ } mch_info[ERRC_MBMS_MAX_CELL_NUM][MBMS_CONFIG_INFO_MCH_NUM];
+} mbmsal_errc_mbms_config_info_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ EARFCN serving_earfcn;
+ mbmsal_errc_mbms_status_enum servsess_status; /* Caution: MBMSAL has assumption for each status. Refer to enum definication for details. */
+ kal_bool act_servsess_valid; /* FALSE means no active servsess */
+ struct {
+ kal_bool valid;
+ tmgi_struct tmgi;
+ kal_uint16 sess_id; /* 0xffff = invalid */
+ } act_servsess[MBMS_SERVSESS_STATUS_SERVICE_NUM];
+ kal_bool config_servsess_valid;
+ struct {
+ tmgi_struct tmgi;
+ kal_uint16 sess_id; /* 0xffff = invalid */
+ } config_servsess;
+} mbmsal_errc_mbms_servsess_status_ind_struct;
+
+/*** Requirement of TC10 ***/
+typedef struct
+{
+ kal_uint8 mbsfn_area_id;
+ kal_int16 snr;
+ kal_int16 esnr;
+ kal_uint8 num_tmgi;
+ tmgi_struct tmgi[MBMS_CONFIG_INFO_SERVICE_NUM];
+} mbmsal_errc_mbms_info_element_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 num_list;
+ mbmsal_errc_mbms_info_element_struct list[MBMS_SERVICE_STATUS_MBSFN_AREA_NUM];
+} mbmsal_errc_mbms_info_ind_struct;
+/*** Requirement of TC10 ***/
+
+#endif /* ----- #ifndef MBMSAL_ERRC_STRUCT_INC ----- */
+
diff --git a/mcu/protocol/interface/general/mcc_recog_test_data.h b/mcu/protocol/interface/general/mcc_recog_test_data.h
new file mode 100644
index 0000000..bb9a6fb
--- /dev/null
+++ b/mcu/protocol/interface/general/mcc_recog_test_data.h
@@ -0,0 +1,24 @@
+#ifndef _MCC_RECOG_TEST_DATA_H
+#define _MCC_RECOG_TEST_DATA_H
+
+#include "mcc_recog_train_data.h"
+
+#define MCC_RECOG_LTE_TEST_DATA_NUM 1550
+#define MCC_RECOG_LTE_TEST_MAX_MCC_LEN 2
+
+#define MCC_RECOG_NR_TEST_DATA_NUM 431
+#define MCC_RECOG_NR_TEST_MAX_MCC_LEN 2
+
+#ifdef __MCC_RECOGNITION__
+
+extern const kal_int8 mcc_recog_lte_test_data[MCC_RECOG_LTE_TEST_DATA_NUM][MCC_RECOG_LTE_DATA_LEN];
+
+extern const kal_uint16 mcc_recog_lte_test_mcc[MCC_RECOG_LTE_TEST_DATA_NUM][MCC_RECOG_LTE_TEST_MAX_MCC_LEN];
+
+extern const kal_int16 mcc_recog_nr_test_data[MCC_RECOG_NR_TEST_DATA_NUM][MCC_RECOG_NR_DATA_LEN];
+
+extern const kal_uint16 mcc_recog_nr_test_mcc[MCC_RECOG_NR_TEST_DATA_NUM][MCC_RECOG_NR_TEST_MAX_MCC_LEN];
+
+#endif /*__MCC_RECOGNITION__*/
+
+#endif /*_MCC_RECOG_TEST_DATA_H*/
\ No newline at end of file
diff --git a/mcu/protocol/interface/general/mcc_recog_train_data.h b/mcu/protocol/interface/general/mcc_recog_train_data.h
new file mode 100644
index 0000000..cbfabe7
--- /dev/null
+++ b/mcu/protocol/interface/general/mcc_recog_train_data.h
@@ -0,0 +1,56 @@
+#ifndef _MCC_RECOG_TRAIN_DATA_H
+#define _MCC_RECOG_TRAIN_DATA_H
+
+#include "kal_public_api.h"
+
+#define MCC_RECOG_LTE_BAND_NUM 17
+#define MCC_RECOG_LTE_DATA_NUM 209
+#define MCC_RECOG_LTE_DATA_LEN 311
+#define MCC_RECOG_LTE_MAX_MCC_LEN 2
+
+#define MCC_RECOG_NR_BAND_NUM 3
+#define MCC_RECOG_NR_DATA_NUM 91
+#define MCC_RECOG_NR_DATA_LEN 68
+#define MCC_RECOG_NR_MAX_MCC_LEN 2
+
+#ifdef __MCC_RECOGNITION__
+
+/*
+ * mcc_recog_lte_band: the remarkable bands
+ * mcc_recog_earfcn: the centered freq of 1st and last subband for each remarbable band in mcc_recog_lte_band
+ * mcc_recog_lte_subband_num: the subband number of each remarbable band in mcc_recog_lte_band
+ * mcc_recog_lte_mcc: the medoids data, of each item composed by rssi(dBm) values flattened by each ordered subband for each ordered band in mcc_recog_lte_band.
+ * Some value are marked 0 as invalid because some bands are not support in orginal data.
+ */
+
+extern const kal_uint8 mcc_recog_lte_band[MCC_RECOG_LTE_BAND_NUM];
+
+extern const kal_uint32 mcc_recog_earfcn[MCC_RECOG_LTE_BAND_NUM][2];
+
+extern const kal_uint8 mcc_recog_lte_subband_num[MCC_RECOG_LTE_BAND_NUM];
+
+extern const kal_int8 mcc_recog_lte_data[MCC_RECOG_LTE_DATA_NUM][MCC_RECOG_LTE_DATA_LEN];
+
+extern const kal_uint16 mcc_recog_lte_mcc[MCC_RECOG_LTE_DATA_NUM][MCC_RECOG_LTE_MAX_MCC_LEN];
+
+/*
+ * mcc_recog_nr_band: the remarkable bands
+ * mcc_recog_nrarfcn: the frequency range of 1st and last subband for each remarbable band in mcc_recog_nr_band
+ * mcc_recog_nr_subband_num: the subband number of each remarbable band in mcc_recog_nr_band
+ * mcc_recog_nr_data: the medoids data, of each item composed by rssi(qdBm) values flattened by each ordered subband for each ordered band in mcc_recog_nr_band.
+ * Some value are marked 0 as invalid because some bands are not support in orginal data.
+ */
+
+extern const kal_uint8 mcc_recog_nr_band[MCC_RECOG_NR_BAND_NUM];
+
+extern const kal_uint32 mcc_recog_nrarfcn[MCC_RECOG_NR_BAND_NUM][4];
+
+extern const kal_uint8 mcc_recog_nr_subband_num[MCC_RECOG_NR_BAND_NUM];
+
+extern const kal_int16 mcc_recog_nr_data[MCC_RECOG_NR_DATA_NUM][MCC_RECOG_NR_DATA_LEN];
+
+extern const kal_uint16 mcc_recog_nr_mcc[MCC_RECOG_NR_DATA_NUM][MCC_RECOG_NR_MAX_MCC_LEN];
+
+#endif /*__MCC_RECOGNITION__*/
+
+#endif /*_MCC_RECOG_TRAIN_DATA_H*/
diff --git a/mcu/protocol/interface/general/mll1_common.h b/mcu/protocol/interface/general/mll1_common.h
new file mode 100644
index 0000000..3030447
--- /dev/null
+++ b/mcu/protocol/interface/general/mll1_common.h
@@ -0,0 +1,470 @@
+#ifndef _MLL1_COMMON_H
+#define _MLL1_COMMON_H
+
+#include "irat_common_enums_public.h"
+#include "global_type.h"
+
+/* [20150309 Ali] for MD1<->MD3 integration, move to mcu/interface/sap/cross_core/irat_common_enum_public.h
+typedef enum
+{
+ LL1_MODE_STATUS_INIT = 0,
+ LL1_GSM_MODE_BEGIN,
+ LL1_GSM_NULL_MODE,
+ LL1_GSM_IDLE_MODE,
+ LL1_GSM_SDCCH_MODE,
+ LL1_GSM_DCH_MODE,
+ LL1_GSM_PKT_MODE,
+ LL1_GSM_MODE_END,
+ LL1_FDD_MODE_BEGIN,
+ LL1_FDD_NULL_MODE,
+ LL1_FDD_IDLE_MODE,
+ LL1_FDD_EFACH_DRX_MODE,
+ LL1_FDD_FACH_MODE,
+ LL1_FDD_DCH_MODE,
+ LL1_FDD_MODE_END,
+ LL1_TDD_MODE_BEGIN,
+ LL1_TDD_NULL_MODE,
+ LL1_TDD_IDLE_MODE,
+ LL1_TDD_FACH_MODE,
+ LL1_TDD_DCH_MODE,
+ LL1_TDD_HSPA_MODE,
+ LL1_TDD_MODE_END,
+ LL1_LTE_MODE_BEGIN,
+ LL1_LTE_NULL_MODE,
+ LL1_LTE_IDLE_MODE,
+ LL1_LTE_CONNECT_MODE,
+ LL1_LTE_CONNECT_DRX_MODE,
+ LL1_LTE_MODE_END
+} ll1_active_rat_mode_status_enum;
+*/
+// [20150331 Ali] Gemini_L_W
+/*****************************************************************************
+* ENUMERATION
+* mll1_current_cntx_enum
+*
+* DESCRIPTIONS
+* Used to identify the current used cntx (MLL1_1 or MLL1_2), for Gemini L+W project
+* for GEMINI_PLUS_WCDMA >= 3 : MLL1_3, for GEMINI_PLUS_WCDMA >= 4: MLL1_4.
+*****************************************************************************/
+typedef enum
+{
+ MLL1_1 = 0,
+ MLL1_2 = 1,
+ MLL1_3 = 2,
+ MLL1_4 = 3
+} mll1_current_cntx_enum;
+
+/*****************************************************************************
+* ENUMERATION
+* mll1_tick_count_type_enum
+*
+* DESCRIPTIONS
+* Used to identify the tick count of certain type
+*****************************************************************************/
+typedef enum
+{
+ MLL1_TICK_COUNT_TYPE_RANK = 0,
+ MLL1_TICK_COUNT_TYPE_DETC = 1,
+ MLL1_TICK_COUNT_TYPE_PRIO = 3
+} mll1_tick_count_type_enum;
+
+/*****************************************************************************
+* STRUCT
+* mll1_gap_fsm_para_struct
+*
+* DESCRIPTIONS
+* xL1-LL1 pass information structure.
+*
+* PARAMETERS
+* rat - always be MLL1_GERAN_RAT
+* gap_service_enable - is gsm request gap service
+* tick_bmp - bit 0 : ranking search tick, bit 1 : priority search tick
+* carrier_num - HPS on, Meas off, is equal to the number of higher priority search frequencies
+* HPS on, Meas on, No meaning
+* HPS off, Meas on, is equal to the total number of measurement frequencies
+* carrier_num_rpg - frequency number of RPG (IncMon)
+* rach_rpt_carrier_num- In idle/eFACH state, UMTS FDD may request to meas. special freqs for rach report
+* t_hps - high priority period = 25/60/75 (unit : s)
+* is_period_reset_bmp - bit 0 for rank period, 1 means to reset
+* - bit 1 for prio period, 0 means not to reset
+* - when freq. num is same as before, ll1 will check this flag to reset period or not
+* auto_success - KAL_TRUE - xL1 will not use RF from the starting time of LL1_xL1_AUTONOMOIS_GAP_IND
+* KAL_FALSE - xL1 may use RF after starting time of LL1_xL1_AUTONOMOIS_GAP_IND.
+* valid_period - The length of autonomous gap allowed in GL1. The value is valid when GL1 is active rat and success = KAL_TRUE. Unit : ebit
+* NOTE
+*****************************************************************************/
+typedef struct
+{
+ kal_int32 rat;
+ kal_bool gap_service_enable;
+ kal_uint8 tick_bmp;
+ kal_uint8 carrier_num;
+ kal_uint8 carrier_num_rpg;
+ kal_uint8 rach_rpt_carrier_num;
+ kal_uint16 t_hps;
+ kal_int32 is_period_reset_bmp;
+ kal_bool auto_success;
+ kal_int64 valid_period;
+}mll1_gap_fsm_para_struct;
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif /*__GSM_RAT__*/
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif /*__UMTS_FDD_MODE__*/
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif /*__UMTS_TDD128_MODE__*/
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif /*__LTE_RAT__*/
+
+#endif /*_MLL1_COMMON_H*/
+
diff --git a/mcu/protocol/interface/general/mll1_eutran.h b/mcu/protocol/interface/general/mll1_eutran.h
new file mode 100644
index 0000000..95bd67d
--- /dev/null
+++ b/mcu/protocol/interface/general/mll1_eutran.h
@@ -0,0 +1,1248 @@
+#ifndef _MLL1_EUTRAN_H
+#define _MLL1_EUTRAN_H
+
+#include "kal_public_defs.h" /*for LOCAL_PARA_HDR*/
+#include "mll1_common.h"
+/*****************************************************************************
+* DEFINITIONS
+*****************************************************************************/
+#define EUTRAN_SESSION_IN_PERIOD 48 /*align TDS DMO based on 10ms, 480ms/10ms = 48*/
+
+#define EUTRAN_SCHEDULE_DELAY 0 /* used to postpone available gap start time */
+
+/*****************************************************************************
+* ENUMERATIONS
+*****************************************************************************/
+
+/*****************************************************************************
+* ENUMERATION
+* el1_ll1_rat_status_enum
+*
+* DESCRIPTIONS
+* Used to identify the status in EUTRAN RAT.
+* NOTE
+* any modification should sync. with ll1_rat_status_enum
+*****************************************************************************/
+typedef enum
+{
+ EL1_LL1_RAT_FLIGHT =0,
+ EL1_LL1_RAT_STANDBY,
+ EL1_LL1_RAT_ACTIVE,
+ EL1_LL1_RAT_NUM
+} el1_ll1_rat_status_enum;
+
+/*****************************************************************************
+* STRUCTURES
+*****************************************************************************/
+
+/*****************************************************************************
+* STRUCT
+* eutran_time_struct
+*
+* DESCRIPTIONS
+* EUTRAN system timing base
+*
+* PARAMETERS
+* sfn - EUTRAN system frame number (0~0XFFFFFFF). -1 = IMMEDIATELY
+* sub_frame - EUTRAN sub-frame number (0~9)
+* sample - EUTRAN half samples (0~61439)
+*****************************************************************************/
+typedef struct
+{
+ kal_uint32 sfn;
+ kal_uint8 sub_frame;
+ kal_uint16 sample;
+}eutran_time_struct;
+
+/*****************************************************************************
+* STRUCT
+* ll1_eutran_standby_gap_struct
+*
+* DESCRIPTIONS
+* EUTRAN standby gap pattern structure.
+*
+* PARAMETERS
+* start_time - start time of the gap session
+* length - length of the gap session (in sample)
+*****************************************************************************/
+typedef struct
+{
+ eutran_time_struct start_time;
+ kal_int64 length;
+}ll1_eutran_standby_gap_struct;
+
+/*****************************************************************************
+* STRUCT
+* ll1_el1_expand_gap_pattern_struct
+*
+* DESCRIPTIONS
+* LL1 expands gap pattern for EL1
+*
+* PARAMETERS
+* session_num - Indicate how many gap session
+* session[] - Standby gap session.
+* measure_tid - Transition id for RANK tick./Valid when active RAT is in DRX mode./And bit 0 in tick_bitmap is "1"
+* hps_tid - Transition id for HPS tick./Valid when active RAT is in DRX mode./And bit 1 in tick_bitmap is "1"
+* tick_bitmap - Bit 0 : Rank search , Bit 1 : Priority search
+* gap_seq - Valid only in SDCCH mode. 2* (9 frames / 102 frames) for one frequency. 1: the first gap pattern ; 2: the last gap pattern
+*****************************************************************************/
+typedef struct
+{
+ kal_uint8 session_num;
+ ll1_eutran_standby_gap_struct session[EUTRAN_SESSION_IN_PERIOD];
+ kal_uint8 measure_tid;
+ kal_uint8 hps_tid;
+ kal_uint8 tick_bitmap;
+ kal_uint8 gap_seq;
+}ll1_el1_expand_gap_pattern_struct;
+
+/*****************************************************************************
+* STRUCT
+* ll1_eutran_gap_config_struct
+*
+* DESCRIPTIONS
+* EUTRAN gap configuration when EUTRAN is active RAT.
+*
+* PARAMETERS
+* start_time - Valid time of gap pattern in active RAT
+* use_num - Continuous gap number could be used in active RAT(Basic unit = 480ms)
+* skip_num - Skip number in active RAT. (Basic unit = 480ms)
+*****************************************************************************/
+typedef struct
+{
+ eutran_time_struct start_time;
+ kal_uint8 use_num;
+ kal_uint8 skip_num;
+}ll1_eutran_gap_config_struct;
+
+/*****************************************************************************
+* STRUCT
+* eutran_drx_gap_struct
+*
+* DESCRIPTIONS
+* EUTRAN drx gap structure.
+*
+* PARAMETERS
+* start_time - start time of the gap session
+* length - length of the gap session (in sub_frame)
+* is_drx_tick - KAL_TRUE : First tick in this DRX period
+* KAL_FALSE: Not the first free interval in this DRX period
+*****************************************************************************/
+typedef struct
+{
+ eutran_time_struct start_time;
+ kal_int32 length;
+ kal_bool is_drx_tick;
+}eutran_drx_gap_struct;
+
+/*****************************************************************************
+* STRUCT
+* eutran_connect_gap_struct
+*
+* DESCRIPTIONS
+* EUTRAN gap structure in connection mode without DRX .
+*
+* PARAMETERS
+* start_time - start time of the gap session
+* period - ID 0 = 40 ms ; ID 1 = 80 ms;
+* length - length of the gap session = 6 (ms)
+*****************************************************************************/
+typedef struct
+{
+ eutran_time_struct start_time;
+ kal_uint8 period;
+ kal_uint8 length;
+}eutran_connect_gap_struct;
+
+/*****************************************************************************
+* STRUCT
+* el1_ll1_sync_cnf_struct
+*
+* DESCRIPTIONS
+* EL1 uses this primitive to confirm LL1 that current EUTRAN timing
+* and micro second counter value.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* current_time - sync. time in eutran_time_struct
+* eutran_ustime - sync. time in USC
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ eutran_time_struct current_time;
+ kal_uint32 eutran_ustime;
+}el1_ll1_sync_cnf_struct;
+
+/*****************************************************************************
+* STRUCT
+* el1_ll1_rat_status_ind_struct
+*
+* DESCRIPTIONS
+* This message is sent from EL1 to LL1 for informing current GL1 RAT status.
+* This message should be sent when EL1 RAT status changed.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* rat_status - RAT status in EL1
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ el1_ll1_rat_status_enum rat_status;
+}el1_ll1_rat_status_ind_struct;
+
+/*****************************************************************************
+* STRUCT
+* el1_ll1_mode_status_ind_struct
+*
+* DESCRIPTIONS
+* This message is sent from EL1 to LL1 for informing that GL1 mode status when GL1 is active RAT.
+* This message should be sent when EL1 mode status changed.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* eutran_mode_status - current mode in EL1 when EUTRAN is active RAT
+* is_cell_changed - KAL_TRUE : Cell changed
+* KAL_FALSE : When only status or drx_cycle_length changed.
+* drx_cycle_length - valid when eutran_mode_status = EL1_LL1_IDLE_MODE
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ ll1_active_rat_mode_status_enum eutran_mode_status;
+ kal_bool is_cell_changed;
+ kal_uint16 drx_cycle_length;
+}el1_ll1_mode_status_ind_struct;
+
+/*****************************************************************************
+* STRUCT
+* ll1_el1_mode_status_update_ind_struct
+*
+* DESCRIPTIONS
+* This message is sent to EL1 for informing that mode status of active RAT when EL1 is standby RAT.
+* This message should be updated for EL1 in standby when any mode status changed in active RAT.
+* Also when EL1 enters into standby RAT from FLIGHT, LL1 will update current mode state in active RAT to EL1.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* active_rat_mode_status - current mode status in active RAT
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ ll1_active_rat_mode_status_enum active_rat_mode_status;
+}ll1_el1_mode_status_update_ind_struct;
+
+/*****************************************************************************
+* STRUCT
+* el1_ll1_active_measure_status_ind_struct
+*
+* DESCRIPTIONS
+* EL1 informs LL1 that how many higher priority inter-frequencies in EL1 when high priority search is turned on
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* freq_num - The number of higher priority inter-freq. in EL1.(0~3)
+* When HPS off, the freq_num is equal to zero.
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 freq_num;
+}el1_ll1_active_measure_status_ind_struct;
+
+/*****************************************************************************
+* STRUCT
+* el1_ll1_measure_req_struct
+*
+* DESCRIPTIONS
+* This message is sent from EL1 to inform LL1 that how many EUTRAN frequencies are required to be
+* measured and the measurement purposes both in EUTRAN Active and Standby. The message is not
+* applicable for EL1 to request gaps for inter-frequency measurement in idle mode.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* meas_purpose_bitmap - bit 0 for measurement, bit 1 for cell search, bit 2 for BCCH
+* tid - tid for lastest meas_req on (should only change when off)
+* tick_bitmap - bit 0 for ranking search, bit 1 for priority search
+* freq_num - high priority freqencies when HPS ON, measurement frequencies when HPS OFF
+* t_hps - basic period of high priority search (25s,60s,70s)
+* is_period_reset_bmp - bit 0 for rank period, 1 means to reset
+* - bit 1 for prio period, 0 means not to reset
+* - when freq. num is same as before, ll1 will check this flag to reset period or not
+* - KAL_TRUE : reset hps period, KAL_FALSE : doesnt reset hps period.
+* current_time - current in EL1
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 meas_purpose_bitmap;
+ kal_uint8 tid;
+ kal_uint8 tick_bitmap;
+ kal_uint8 freq_num;
+ kal_uint16 t_hps;
+ kal_int32 is_period_reset_bmp;
+ eutran_time_struct current_time;
+}el1_ll1_measure_req_struct;
+
+/*****************************************************************************
+* STRUCT
+* el1_ll1_standby_measure_done_ind_struct
+*
+* DESCRIPTIONS
+* For low power optimization, EL1 informs LL1 which measurement purpose is
+* measured done in its period. If all measurement purposes are measured done,
+* LL1 will not tick EL1 anymore in shortest measurement period.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* tid - For LL1 to know this tid is mapped to which gap pattern period sent before
+* tick_bitmap - bit 0 for ranking search, bit 1 for priority search. Only one bit will be set in one message
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 tid;
+ kal_uint8 tick_bitmap;
+}el1_ll1_standby_measure_done_ind_struct;
+
+/*****************************************************************************
+* STRUCT
+* ll1_el1_gap_service_req_struct
+*
+* DESCRIPTIONS
+* LL1 uses this primitive to enable (disable) active RAT gap service to get (release)
+* the free radio frequency period in EUTRAN.When LL1 disables active RAT gap service,
+* it means that EUTRAN could use all RF time already.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* enable - KAL_TRUE : request gap service
+* KAL_FALSE : stop gap service
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool enable;
+}ll1_el1_gap_service_req_struct;
+
+
+/*****************************************************************************
+* STRUCT
+* el1_ll1_gap_stop_cnf_struct
+*
+* DESCRIPTIONS
+* EL1 uses this primitive to confirm LL1_EL1_GAP_STOP_REQ when there is no gap usage in EUTRAN..
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* current_time - current time in EL1
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ eutran_time_struct current_time;
+}el1_ll1_gap_stop_cnf_struct;
+
+
+/*****************************************************************************
+* STRUCT
+* el1_ll1_auto_gap_req_struct
+*
+* DESCRIPTIONS
+* EL1 sends this message to request LL1 that EL1 wants to use the auto gap from (sfn, sub_frame, half_sample).
+* EL1 could use this auto gap after getting the successful confirm
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* auto_time - Start time of auto gap in EL1
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ eutran_time_struct auto_time;
+}el1_ll1_auto_gap_req_struct;
+
+/*****************************************************************************
+* STRUCT
+* ll1_el1_auto_gap_cnf_struct
+*
+* DESCRIPTIONS
+* LL1 sends this message to confirm EL1 auto gap request.
+* After receiving this message, EL1 could use required auto gap.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* success - KAL_TRUE : EL1 could use auto gap to search
+* KAL_FALSE: EL1 could not use auto gap to search.
+* And GL1 should not request auto gap until AUTO_GAP_AVAILABLE_IND
+* valid_period - The length of autonomous gap allowed by active RAT
+* The value is valid when success = KAL_TRUE
+* Unit : sample
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool success;
+ kal_int64 valid_period;
+}ll1_el1_auto_gap_cnf_struct;
+
+/*****************************************************************************
+* STRUCT
+* ll1_el1_auto_gap_ind_struct
+*
+* DESCRIPTIONS
+* LL1 sends this message to inform EL1 stopping using RF in this auto gap from (sfn, sub_frame, half_sample).
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* auto_time - Start time of auto gap
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ eutran_time_struct auto_time;
+}ll1_el1_auto_gap_ind_struct;
+
+/*****************************************************************************
+* STRUCT
+* el1_ll1_auto_gap_res_struct
+*
+* DESCRIPTIONS
+* EL1 sends this message to response LL1 that EL1 will/won't use RF from
+* the start timing of auto gap which is informed by LL1_EL1_auto_GAP_IND.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* success - KAL_TRUE : EL1 will not use RF from the starting time of LL1_EL1_AUTO_GAP_IND
+* KAL_FALSE: EL1 may use RF after starting time of LL1_EL1_AUTO_GAP_IND.
+* valid_period - The length of autonomous gap allowed in EL1
+* The value is valid when EL1 is active rat and success = KAL_TRUE
+* Unit : sample
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool success;
+ kal_int64 valid_period;
+}el1_ll1_auto_gap_res_struct;
+
+/*****************************************************************************
+* STRUCT
+* ll1_el1_gap_notify_ind_struct
+*
+* DESCRIPTIONS
+* LL1 sends this message to inform EL1 that the starting time and length of gap pattern.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* standby_gap - standby gap pattern
+* active_gap - active gap pattern configuration
+* tid - tid for lastest meas_req on
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ ll1_el1_expand_gap_pattern_struct standby_gap;
+ ll1_eutran_gap_config_struct active_gap;
+ kal_uint8 tid; /* Tid for lastest meas_req on, LL1 will expand gap notify ind with this tid*/
+}ll1_el1_gap_notify_ind_struct;
+
+/*****************************************************************************
+* STRUCT
+* el1_ll1_gap_pattern_ind_struct
+*
+* DESCRIPTIONS
+* EL1 sends this message to inform LL1 that the free RF period in EL1 as gap pattern.
+* PARAMETERS
+* LOCAL_PARA_HDR
+* el1_current_time - EL1 current time
+* drx_gap - No matter the length is bigger than zero or not, EL1 should send
+* this message and sets is_drx_tick = KAL_TRUE in one DRX period once.
+* connect_gap - GP0 or GP1
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ eutran_time_struct el1_current_time;
+ eutran_drx_gap_struct drx_gap;
+ eutran_connect_gap_struct connect_gap;
+}el1_ll1_gap_pattern_ind_struct;
+
+/*****************************************************************************
+* STRUCT
+* ll1_el1_sync_req_struct
+* el1_ll1_gap_stop_req_struct
+* ll1_el1_gap_stop_cnf_struct
+* ll1_el1_gap_stop_req_struct
+* el1_ll1_gap_stop_cnf_struct
+* el1_ll1_gap_suspend_req_struct
+* ll1_el1_gap_suspend_cnf_struct
+* ll1_el1_gap_suspend_req_struct
+* el1_ll1_gap_suspend_cnf_struct
+* el1_ll1_gap_resume_ind_struct
+* ll1_el1_gap_resume_ind_struct
+* el1_ll1_auto_gap_stop_req_struct
+* ll1_el1_auto_gap_stop_ind_struct
+* el1_ll1_auto_gap_stop_res_struct
+* ll1_el1_auto_gap_stop_cnf_struct
+* el1_ll1_auto_gap_end_ind_struct
+* ll1_el1_auto_gap_end_ind_struct
+* el1_ll1_auto_gap_available_ind_struct
+* ll1_el1_auto_gap_available_ind_struct
+*
+* DESCRIPTIONS
+* ll1_el1_sync_req_struct
+* LL1 will use this primitive to get EL1 current UMTS timing and micro
+* second counter value in both EL1 in active and standby mode.
+*
+* el1_ll1_gap_stop_req_struct
+* EL1 uses this primitive to inform LL1 to stop all gap usage in standby
+* RAT when GERAN GSM wants to change configuration or other purposes.
+*
+* ll1_el1_gap_stop_cnf_struct
+* LL1 uses this primitive to confirm EL1 that LL1 has already stopped
+* all gap usages in standby RAT and EL1 could use all RF time.
+*
+* ll1_el1_gap_stop_req_struct
+* LL1 uses this primitive to stop gap usage in EUTRAN when EUTRAN is standby RAT.
+*
+* el1_ll1_gap_stop_cnf_struct
+* EL1 uses this primitive to confirm LL1_EL1_GAP_STOP_REQ when there is no gap usage in EUTRAN.
+*
+* el1_ll1_gap_suspend_req_struct
+* EL1 uses this primitive to temporal suspend gap usage in standby RAT for higher priority
+* task and doesn't need to give new gap configuration in connection mode when resumed.
+*
+* ll1_el1_gap_suspend_cnf_struct
+* LL1 sends this confirm message to EL1 after all standby RAT gap usage are suspended.
+*
+* ll1_el1_gap_suspend_req_struct
+* LL1 sends this message to EL1 to request that EL1 suspends RF usage immediately.
+*
+* el1_ll1_gap_suspend_cnf_struct
+* EL1 sends this message to confirm LL1 that EL1 will not use gap from
+* now to receiving resume indicator
+*
+* el1_ll1_gap_resume_ind_struct
+* EL1 sends this message to inform LL1 that EL1 has already finished
+* higher priority task, and standby RAT could use gap normally.
+*
+* ll1_el1_gap_resume_ind_struct
+* LL1 sends this message to EL1 to resume EL1's gap usage.
+* After receiving this message, EL1 could use gap pattern normally.
+*
+* el1_ll1_auto_gap_stop_req_struct
+* EL1 sends this message to request LL1 that EL1 wants to
+* retrieve auto gap for higher priority task.
+*
+* ll1_el1_auto_gap_stop_ind_struct
+* LL1 sends this message to inform EL1 of stopping using RF
+* during auto gap period.
+*
+* el1_ll1_auto_gap_stop_res_struct
+* EL1 sends this message to response LL1 that EL1 stops
+* auto gap usage.
+*
+* ll1_el1_auto_gap_stop_cnf_struct
+* LL1 sends this message to confirm that EL1 could use RF now.
+*
+* el1_ll1_auto_gap_end_ind_struct
+* EL1 sends this message to inform LL1 that auto gap usage is finished.
+*
+* ll1_el1_auto_gap_end_ind_struct
+* LL1 sends this message to inform EL1 that auto gap usage is finished.
+*
+* el1_ll1_auto_gap_available_ind_struct
+* EL1 sends this message to inform LL1 that auto gap is available now. Standby RAT
+* could request auto gap now. Standby RAT could request auto gap now
+*
+* ll1_el1_auto_gap_available_ind_struct
+* LL1 sends this message to inform EL1 that auto gap
+* is available now. EL1 could request auto gap now.
+*
+* el1_ll1_auto_gap_unavailable_ind_struct
+* EL1 sends this message to inform LL1 that auto gap is unavailable now.
+* Standby RAT could not request auto gap now.
+*
+* ll1_el1_auto_gap_unavailable_ind_struct
+* LL1 sends this message to inform EL1 that auto gap is unavailable now.
+* EL1 could not request auto gap now.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+}ll1_el1_sync_req_struct,
+ el1_ll1_gap_stop_req_struct,
+ ll1_el1_gap_stop_cnf_struct,
+ ll1_el1_gap_stop_req_struct,
+ el1_ll1_gap_suspend_req_struct,
+ ll1_el1_gap_suspend_cnf_struct,
+ ll1_el1_gap_suspend_req_struct,
+ el1_ll1_gap_suspend_cnf_struct,
+ el1_ll1_gap_resume_ind_struct,
+ ll1_el1_gap_resume_ind_struct,
+ el1_ll1_auto_gap_stop_req_struct,
+ ll1_el1_auto_gap_stop_ind_struct,
+ el1_ll1_auto_gap_stop_res_struct,
+ ll1_el1_auto_gap_stop_cnf_struct,
+ el1_ll1_auto_gap_end_ind_struct,
+ ll1_el1_auto_gap_end_ind_struct,
+ el1_ll1_auto_gap_available_ind_struct,
+ ll1_el1_auto_gap_available_ind_struct,
+ el1_ll1_auto_gap_unavailable_ind_struct,
+ ll1_el1_auto_gap_unavailable_ind_struct;
+
+/*****************************************************************************
+* STRUCT
+* mll1_el1_info_database_struct
+*
+* DESCRIPTIONS
+* EL1 information structure.
+*
+* PARAMETERS
+*
+*****************************************************************************/
+typedef struct
+{ /* measure req*/
+ kal_uint8 tick_bmp; /* use to record tick bitmap*/
+ kal_uint8 rank_tick_tid; /* tid for rank tick*/
+ kal_uint8 prio_tick_tid; /* tid for prio tick*/
+ kal_uint8 meas_done_bmp; /* measurement done ind bitmap*/
+ kal_bool is_meas_done_useful; /* eutran uses meas_done or not by checking meas_purpose_bmp*/
+ kal_uint8 meas_purpose_bitmap; /* record the measure purpose bitmap*/
+ eutran_time_struct current_time; /* eutran current time when request gap service*/
+ /* Paging period in active RAT */
+ kal_int32 drx_cycle; /* 80,160,350,640,1280,2560,5120 Unit : ms*/
+ /* Store gap information*/
+ el1_ll1_gap_pattern_ind_struct gap_pattern; /* store gap pattern ilm*/
+ /* auto gap para*/
+ eutran_time_struct auto_time; /* auto gap time*/
+ /* Mode status*/
+ ll1_active_rat_mode_status_enum mode_status; /* mode status*/
+ /* Gap request from standby rat should do sync in connection*/
+ kal_bool valid_timing; /* KAL_TRUE : sync not finish after request*/
+ /* KAL_FALSE : sync done*/
+ kal_uint8 meas_req_tid; /* Tid for lastest meas_req on, LL1 will expand gap notify ind with this tid*/
+}mll1_el1_info_database_struct;
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif /*__POP_FSM__*/
+/*****************************************************************************
+* GLOBAL FUNCTIONS
+*****************************************************************************/
+
+/*****************************************************************************
+* FUNCTION
+* mll1_el1_auto_gap_available_ind
+* DESCRIPTION
+* ll1 sends auto gap available ind to EUTRAN now
+*
+* PARAMETERS
+* kal_bool available
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_el1_auto_gap_available_ind(kal_bool available);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_el1_auto_gap_cnf
+* DESCRIPTION
+* ll1 sends auto gap cnf to EUTRAN now
+*
+* PARAMETERS
+* success - success or not
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_el1_auto_gap_cnf(kal_bool success, kal_int64 valid_period);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_el1_auto_gap_end_ind
+* DESCRIPTION
+* ll1 sends auto gap end ind to EUTRAN now
+*
+* PARAMETERS
+* none
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_el1_auto_gap_end_ind(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_el1_auto_gap_ind
+* DESCRIPTION
+* ll1 sends auto gap ind to EUTRAN now
+*
+* PARAMETERS
+* eutran_time - auto time
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_el1_auto_gap_ind(eutran_time_struct eutran_time);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_el1_auto_gap_stop_cnf
+* DESCRIPTION
+* ll1 sends auto gap stop cnf to EUTRAN now
+*
+* PARAMETERS
+* None
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_el1_auto_gap_stop_cnf(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_el1_auto_gap_stop_ind
+* DESCRIPTION
+* ll1 sends auto gap stop ind to EUTRAN now
+*
+* PARAMETERS
+* None
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_el1_auto_gap_stop_ind(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_el1_auto_time_minus
+* DESCRIPTION
+* Add more rf margin for any standby rat which will enter sleep during autonomous serch procedure
+* Assume margin is smaller than one sfn
+* PARAMETERS
+* eutran_time_struct*
+* kal_int64 - more RF margin (recovery from sleep).
+* RETURNS
+* void
+*****************************************************************************/
+void mll1_el1_auto_time_minus(eutran_time_struct* time, kal_int64 sample);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_el1_expand_active_gap_pattern_ind
+* DESCRIPTION
+* ll1 sends active gap pattern ind to EUTRAN now
+*
+* PARAMETERS
+* start_time - the first gap start time
+* use_num - how many 480ms period el1 could use
+* skip_num - how many 480ms period el1 should skip after use use_cnt 480ms period.
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_el1_expand_active_gap_pattern_ind(eutran_time_struct* start_time,kal_uint8 use_num,kal_uint8 skip_num);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_el1_expand_gap_pattern_ind
+* DESCRIPTION
+* ll1 sends auto gap available ind to EUTRAN now
+*
+* PARAMETERS
+* none
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_el1_expand_gap_pattern_ind(ll1_el1_expand_gap_pattern_struct* standby_gap);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_el1_gap_resume_ind
+* DESCRIPTION
+* LL1 sends this message to EL1 to resume EL1 gap usage.
+* After receiving this message, EL1 could use gap pattern normally.
+*
+* PARAMETERS
+* none
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_el1_gap_resume_ind(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_el1_gap_service_request
+* DESCRIPTION
+* ll1 sends gap service req to EUTRAN now
+*
+* PARAMETERS
+* enable - KAL_TRUE : turn on gap service
+* - KAL_FALSE : turn off gap service
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_el1_gap_service_req(kal_bool enable);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_el1_gap_stop_cnf
+* DESCRIPTION
+* LL1 uses this primitive to confirm EL1 that LL1 has already stopped
+* all gap usages in standby RAT and EL1 could use all RF time.
+*
+* PARAMETERS
+* NONE
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_el1_gap_stop_cnf(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_el1_gap_stop_req
+* DESCRIPTION
+* LL1 uses this primitive to stop gap usage in EUTRAN when EUTRAN is standby RAT.
+*
+* PARAMETERS
+* NONE
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_el1_gap_stop_req(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_el1_gap_suspend_cnf
+* DESCRIPTION
+* LL1 sends this confirm message to EL1 after gap usage in standby RAT is suspended.
+* EL1 could use RF only after getting this message.
+*
+* PARAMETERS
+* NONE
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_el1_gap_suspend_cnf(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_el1_gap_suspend_req
+* DESCRIPTION
+* LL1 uses this primitive to suspend gap usage in EUTRAN when EUTRAN is standby RAT.
+*
+* PARAMETERS
+* NONE
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_el1_gap_suspend_req(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_el1_get_auto_time
+* DESCRIPTION
+* return auto time from EL1
+*
+* PARAMETERS
+* None
+* RETURNS
+* eutran_time_struct auto_time
+*****************************************************************************/
+eutran_time_struct mll1_el1_get_auto_time(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_el1_get_current_time
+* DESCRIPTION
+* ll1 gets current time + ahead margin to expand gap
+*
+* PARAMETERS
+* eutran_time - start time of expansion period
+* kal_bool is_ahead_time
+* TRUE : advance eutran_time with the predefined ahead_time
+* FALSE: don't advance eutran_time with the predefined ahead_time
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+extern void mll1_el1_get_current_time(eutran_time_struct* eutran_time, kal_bool is_ahead_time);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_el1_get_el1_rf_margin
+* DESCRIPTION
+* EL1 gets RF margin in current state
+*
+* PARAMETERS
+* head - header_margin
+* tail - tail_margin
+* RETURNS
+* none
+*****************************************************************************/
+void mll1_el1_get_el1_rf_margin(kal_int32* head,kal_int32* tail);
+#ifdef __GSM_RAT__
+/*****************************************************************************
+* FUNCTION
+* mll1_el1_get_gl1_rf_margin
+* DESCRIPTION
+* EL1 gets GL1 RF margin in current state
+*
+* PARAMETERS
+* head - header_margin
+* tail - tail_margin
+* RETURNS
+* none
+*****************************************************************************/
+void mll1_el1_get_gl1_rf_margin(kal_int32* head,kal_int32* tail);
+#endif /*__GSM_RAT__*/
+/*****************************************************************************
+* FUNCTION
+* mll1_el1_get_timing_status
+* DESCRIPTION
+*
+* PARAMETERS
+* RETURNS
+* kal_bool - valid_timing KAL_TRUE : means still sync. cant be expanded
+* KAL_FALSE : means sync. done
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+kal_bool mll1_el1_get_timing_status(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_el1_get_mode_status
+* DESCRIPTION
+* return mode status from EL1
+*
+* PARAMETERS
+* None
+* RETURNS
+* ll1_active_rat_mode_status_enum mode_status
+*****************************************************************************/
+ll1_active_rat_mode_status_enum mll1_el1_get_mode_status(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_el1_get_t_abort
+* DESCRIPTION
+* Tidentify,gsm / Treconfirm,gsm uint: ms
+*
+* PARAMETERS
+* carriers_other_than_gsm - Number of carriers other than GSM
+*
+* RETURNS
+* kal_uint32 t_abort;
+*****************************************************************************/
+kal_uint32 mll1_el1_get_t_abort(kal_uint8 carriers_other_than_gsm, kal_bool is_identify);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_el1_get_tick_count
+* DESCRIPTION
+* EL1 tick number
+*
+* PARAMETERS
+* is_prio_search - KAL_FALSE : ll1_main wants to get meas. tick
+* KAL_TRUE : ll1_main wants to get prio. tick
+* t_hps - 60 (uint : second)
+*
+* RETURNS
+* kal_uint32 count;
+*****************************************************************************/
+kal_uint32 mll1_el1_get_tick_count(kal_bool is_prio_search, kal_uint16 t_hps);
+
+#ifdef __UMTS_RAT__
+#ifdef __UMTS_TDD128_MODE__
+/*****************************************************************************
+* FUNCTION
+* mll1_el1_get_tl1_rf_margin
+* DESCRIPTION
+* EL1 gets TL1 RF margin in current state
+*
+* PARAMETERS
+* head - header_margin
+* tail - tail_margin
+* RETURNS
+* none
+*****************************************************************************/
+void mll1_el1_get_tl1_rf_margin(kal_int32* head,kal_int32* tail);
+#endif /*__UMTS_TDD128_MODE__*/
+#ifdef __UMTS_FDD_MODE__
+/*****************************************************************************
+* FUNCTION
+* mll1_el1_get_ul1_rf_margin
+* DESCRIPTION
+* EL1 gets UL1 RF margin in current state
+*
+* PARAMETERS
+* head - header_margin
+* tail - tail_margin
+* RETURNS
+* none
+*****************************************************************************/
+void mll1_el1_get_ul1_rf_margin(kal_int32* head,kal_int32* tail);
+#endif /*__UMTS_FDD_MODE__*/
+#endif /*__UMTS_RAT__*/
+/*****************************************************************************
+* FUNCTION
+* mll1_el1_handle_gap_margin_in_connect
+* DESCRIPTION
+* EL1 handle gap margin in connection mode
+*
+* PARAMETERS
+* *st - gap starting time
+* *length - gap length in sample
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_el1_handle_gap_margin_in_connect(eutran_time_struct* st, kal_int32* length);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_el1_is_before_dest_time
+* DESCRIPTION
+* check if gap start time is before dest time,
+*
+* PARAMETERS
+* src - gap start time
+* dest - expand start time
+* RETURNS
+* kal_bool - KAL_TRUE : means that src is before dest time
+* KAL_FALSE : means that dest is before src time
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+kal_bool mll1_el1_is_before_dest_time(eutran_time_struct* src,eutran_time_struct* dest);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_el1_is_in_connect_gp1
+* DESCRIPTION
+* use to check if el1 is in connect gp1 configuration
+*
+* PARAMETERS
+*
+* RETURNS
+* kal_bool - KAL_TRUE : with GP1 configuration
+* KAL_FALSE : without GP1 configuration
+*****************************************************************************/
+kal_bool mll1_el1_is_in_connect_gp1(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_el1_is_lower_pwr_on
+* DESCRIPTION
+* Check if el1 is low pwr on
+*
+* PARAMETERS
+*
+* RETURNS
+* kal_bool - KAL_FALSE : measurement is not finished and need gap in this period
+* KAL_TRUE : measurement is finished and doesnt need gap in this period
+*****************************************************************************/
+kal_bool mll1_el1_is_lower_pwr_on(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_el1_mode_status_update_ind
+* DESCRIPTION
+* This message is sent to EL1 for informing that mode status of active RAT when EL1 is standby RAT.
+* This message should be updated for EL1 in standby when any mode status changed in active RAT.
+*
+* PARAMETERS
+* status - mode status in active RAT
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_el1_mode_status_update_ind(ll1_active_rat_mode_status_enum status);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_el1_set_timing_status
+* DESCRIPTION
+*
+* PARAMETERS
+* flag - set valid_timing = flag
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_el1_set_timing_status(kal_bool flag);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_el1_sync_time_req
+* DESCRIPTION
+* When timing synchronization procedure is triggered, mll1 will decide which rat should do
+* timing synchronization based on the result of g_ll1_flight_rat|| g_ll1_standby_rat || g_ll1_active_rat.
+*
+* PARAMETERS
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_el1_sync_time_req(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_el1_time_add
+* DESCRIPTION
+* This function is used to add samples to time
+*
+* PARAMETERS
+* time - basic time
+* samples - samples
+* RETURNS
+* none
+*****************************************************************************/
+void mll1_el1_time_add( eutran_time_struct* time, kal_int32 samples);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_el1_update_current_time
+* DESCRIPTION
+* ll1 updates current after timing sync done
+*
+* PARAMETERS
+* eutran_time - current time
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_el1_update_current_time(eutran_time_struct* eutran_time);
+
+/*****************************************************************************
+* CALL FUNCTION PROTOTYPE
+* mll1_eutran_handler()
+*
+* DESCRIPTION
+* Function to handle the primitive from EL1.
+*
+* PARAMETERS
+* current_ilm - primitive from EL1.
+*
+* RETURN
+* None
+*****************************************************************************/
+void mll1_eutran_handler(void *ptr_ilm);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_tick_el1_gap_expansion
+* DESCRIPTION
+* tick el1 to expand gap when sync done
+*
+* PARAMETERS
+* none
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_tick_el1_gap_expansion(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_el1_info_init
+* DESCRIPTION
+* Initialize el1 internal global variable
+*
+* PARAMETERS
+* none
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_el1_info_init(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_tl1_gap_pattern_timing_checking
+* DESCRIPTION
+* check if the pending gap is out of date or not
+*
+* PARAMETERS
+* eutran_time - el1 timing correspond to some standby rat's timing indicated in measure request
+* RETURNS
+* TRUE - the pending gap has not been out of date
+* FALSE - the pending gap has been out of date
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+kal_bool mll1_el1_gap_pattern_timing_checking(eutran_time_struct eutran_time);
+
+#endif /*_MLL1_EUTRAN_H*/
diff --git a/mcu/protocol/interface/general/mll1_gsm.h b/mcu/protocol/interface/general/mll1_gsm.h
new file mode 100644
index 0000000..742fc06
--- /dev/null
+++ b/mcu/protocol/interface/general/mll1_gsm.h
@@ -0,0 +1,1180 @@
+#ifndef _MLL1_GSM_H
+#define _MLL1_GSM_H
+
+#include "kal_public_defs.h" /*for LOCAL_PARA_HDR*/
+#include "mll1_common.h"
+
+/*****************************************************************************
+* DEFINITIONS
+*****************************************************************************/
+#ifdef __UMTS_RAT__
+#ifdef __UMTS_FDD_MODE__
+#define GSM_SESSION_IN_PERIOD 48 /* it is possible to have 2 gaps in 3 frames. 48/3*2= 3 , However, 8960 can have the set with 48 gap.*/
+#endif /*__UMTS_FDD_MODE__*/
+
+#ifdef __UMTS_TDD128_MODE__
+#define GSM_SESSION_IN_PERIOD 312 /*DMO in two frames will give at most 13 spare slots (4+3+3+3), 480/20 *13 = 312*/
+#endif /*__UMTS_TDD128_MODE__*/
+#else /* LTE/GSM dual mode*/
+#define GSM_SESSION_IN_PERIOD 6 /* LTE GP0 /GP1 = 6 gap*/
+#endif /*__UMTS_RAT__*/
+
+
+/* should sync. with mll1_const.h, and modify LL1_TGPS_GSM_PURPOSE_BITMAP_MAGIC_NUM in mll1_private.h */
+#define MLL1_GAP_GSM_MEAS_BIT (0x0002) /* bit 1*/
+#define MLL1_GAP_GSM_BSIC_IDENTITY_BIT (0x0004) /* bit 2*/
+#define MLL1_GAP_GSM_BSIC_RECONFIRM_BIT (0x0008) /* bit 3*/
+#define MLL1_GAP_RESERVED_GSM_BSIC_BIT (0x0040) /* bit 6*/
+#define MLL1_GAP_DROP_TDS_FOR_GSM_BSIC_BIT (0x0040) /* bit 6*/
+#define MLL1_GAP_GSM_FMO (0x0100) /* bit 8*/
+#define MLL1_GAP_RESERVED_FOR_GSM_BSIC_BIT (0x0800) /* bit 11*/
+#define MLL1_GAP_GSM_UNDEFINED_BIT (0x1000) /* bit 12*/
+#define MLL1_GAP_LTE_LEFT_TO_GSM_BIT (0x2000) /* bit 13*/
+#define GERAN_SCHEDULE_DELAY 0 /* used to postpone available gap start time */
+/*****************************************************************************
+* ENUMERATIONS
+*****************************************************************************/
+/*****************************************************************************
+* ENUMERATION
+* gl1_ll1_rat_status_enum
+*
+* DESCRIPTIONS
+* Used to identify the status in GSM RAT.
+* NOTE
+* any modification should sync. with ll1_rat_status_enum
+*****************************************************************************/
+typedef enum
+{
+ GL1_LL1_RAT_FLIGHT =0,
+ GL1_LL1_RAT_STANDBY,
+ GL1_LL1_RAT_ACTIVE,
+ GL1_LL1_RAT_NUM
+} gl1_ll1_rat_status_enum;
+
+/*****************************************************************************
+* ENUMERATION
+* gsm_tgmp_enum
+*
+* DESCRIPTIONS
+* tgmp for gsm .
+* Note
+* any modification should sync. with umts_fdd_tgmp_enum
+* GSM_PURPOSE_BSIC_CNF_ONLY, only used for TDS
+*****************************************************************************/
+typedef enum
+{
+ GSM_PURPOSE_RSSI = 1,
+ GSM_PURPOSE_BSIC_INIT,
+ GSM_PURPOSE_BSIC_CNF,
+ GSM_PURPOSE_BSIC_CNF_ONLY,
+ GSM_PURPOSE_UNDEFINED
+} gsm_tgmp_enum;
+
+/*****************************************************************************
+* STRUCTURES
+*****************************************************************************/
+/*****************************************************************************
+* STRUCT
+* gsm_time_struct
+*
+* DESCRIPTIONS
+* GSM system timing base
+*
+* PARAMETERS
+* fn - GSM Frame Number (0~2715647), 1 FN = 10000 Ebits.
+* ebit - GSM Ebit (0~9999)
+*****************************************************************************/
+typedef struct
+{
+ kal_int32 fn;
+ kal_int32 ebit;
+}geran_gsm_time_struct;
+
+/*****************************************************************************
+* STRUCT
+* ll1_gsm_standby_gap_struct
+*
+* DESCRIPTIONS
+* GSM standby gap pattern structure.
+*
+* PARAMETERS
+* start_time - start time of the gap session
+* length - length of the gap session (in ebit)
+* purpose - Purpose for this gap session
+* purpose_bitmap - Purpose bitmap for this gap session
+*****************************************************************************/
+typedef struct
+{
+ geran_gsm_time_struct start_time;
+ kal_int32 length;
+ gsm_tgmp_enum purpose;
+ kal_int32 purpose_bitmap;
+}ll1_gsm_standby_gap_struct;
+
+/*****************************************************************************
+* STRUCT
+* ll1_gl1_expand_gap_pattern_struct
+*
+* DESCRIPTIONS
+* LL1 expands gap pattern for GL1
+*
+* PARAMETERS
+* session_num - Indicate how many gap session
+* session[] - Standby gap session.
+* measure_tid - Transition id for RANK tick./Valid when active RAT is in DRX mode./And bit 0 in tick_bitmap is "1"
+* hps_tid - Transition id for HPS tick./Valid when active RAT is in DRX mode./And bit 1 in tick_bitmap is "1"
+* tick_bitmap - Bit 0 : Rank search , Bit 1 : Priority search
+* t_identify_abort - 0xFFFFFFFF means no requirement, Unit : ms, Valid when active rat is in connection mode
+* abort the bsic identification if it has not successfully decoded it with the period
+* t_reconfirm_abort - 0xFFFFFFFF means no requirement, Unit : ms, Valid when active rat is in connection mode, abort the bsic re-comfirmation
+* If fails to decode bsic after two successive attempts or if has not been able to reconfirm the bsic for a cell with the period
+* gap_expand_period - only valid when mode status in active rat is LL1_GL1_EUTRAN_CONNECT
+* - value = 240/480 ms
+* n_freq_without_m_gsm - only valid when mode status in active rat is LL1_GL1_EUTRAN_CONNECT
+* - equals to Nfreq,E-UTRA + Nfreq,UTRA.
+* dmo_lte_period - the period in DMO for lte. GSM uses remained DMO with lte purpose for gsm usage when tds is active rat
+* - Valid when : purpose_bitmap & MLL1_GAP_LTE_LEFT_TO_GSM_BIT != 0
+* dmo_lte_length - the length in DMO for lte. GSM uses remained DMO with lte purpose for gsm usage when tds is active rat
+* - Valid when : purpose_bitmap & MLL1_GAP_LTE_LEFT_TO_GSM_BIT != 0
+*****************************************************************************/
+typedef struct
+{
+ kal_uint16 session_num;
+ ll1_gsm_standby_gap_struct session[GSM_SESSION_IN_PERIOD];
+ kal_uint8 measure_tid;
+ kal_uint8 hps_tid;
+ kal_uint8 tick_bitmap;
+ kal_uint32 t_identify_abort;
+ kal_uint32 t_reconfirm_abort;
+ kal_uint16 gap_expand_period;
+ kal_uint8 n_freq_without_m_gsm;
+ kal_uint16 dmo_lte_period;
+ kal_uint16 dmo_lte_length;
+}ll1_gl1_expand_gap_pattern_struct;
+
+/*****************************************************************************
+* STRUCT
+* gl1_ll1_sync_cnf_struct
+*
+* DESCRIPTIONS
+* GL1 uses this primitive to confirm LL1 that current GERAN GSM timing
+* and micro second counter value.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* current_time - sync. time in geran_gsm_time_struct
+* gsm_ustime - sync. time in USC
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ geran_gsm_time_struct current_time;
+ kal_uint32 gsm_ustime;
+}gl1_ll1_sync_cnf_struct;
+
+/*****************************************************************************
+* STRUCT
+* gl1_ll1_rat_status_ind_struct
+*
+* DESCRIPTIONS
+* This message is sent from GL1 to LL1 for informing current GL1 RAT status.
+* This message should be sent when GL1 RAT status changed.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* rat_status - RAT status in GL1
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ gl1_ll1_rat_status_enum rat_status;
+}gl1_ll1_rat_status_ind_struct;
+
+/*****************************************************************************
+* STRUCT
+* gl1_ll1_mode_status_ind_struct
+*
+* DESCRIPTIONS
+* This message is sent from GL1 to LL1 for informing that GL1 mode status when GL1 is active RAT.
+* This message should be sent when GL1 mode status changed.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* gsm_mode_status - current mode in GL1 when GSM is active RAT
+* paging_period - valid when gsm_mode_status = GL1_LL1_IDLE_MODE
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ ll1_active_rat_mode_status_enum gsm_mode_status;
+ kal_uint8 paging_period;
+}gl1_ll1_mode_status_ind_struct;
+
+/*****************************************************************************
+* STRUCT
+* ll1_gl1_mode_status_update_ind_struct
+*
+* DESCRIPTIONS
+* This message is sent to GL1 for informing that mode status of active RAT when GL1 is standby RAT.
+* This message should be updated for GL1 in standby when any mode status changed in active RAT.
+* Also when GL1 enters into standby RAT from FLIGHT, LL1 will update current mode state in active RAT to GL1.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* active_rat_mode_status - current mode status in active RAT
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ ll1_active_rat_mode_status_enum active_rat_mode_status;
+}ll1_gl1_mode_status_update_ind_struct;
+
+/*****************************************************************************
+* STRUCT
+* gl1_ll1_measure_req_struct
+*
+* DESCRIPTIONS
+* This message is sent from GL1 to inform LL1 that how many GERAN GSM frequencies
+* are required to be measured and the measurement purposes in GERAN GSM Standby.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* meas_purpose_bitmap - bit 0 for measurement, bit 1 for cell search
+* tid - tid for lastest meas_req on (should only change when off)
+* tick_bitmap - bit 0 for ranking search, bit 1 for priority search
+* carrier_num - high priority freqencies when HPS ON, measurement frequencies when HPS OFF
+* t_hps - basic period of high priority search (60s)
+* is_period_reset_bmp - bit 0 for rank period, 1 means to reset
+* - bit 1 for prio period, 0 means not to reset
+* - when freq. num is same as before, ll1 will check this flag to reset period or not
+* - KAL_TRUE : reset hps period, KAL_FALSE : doesnt reset hps period.
+* current_time - current in GL1
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 meas_purpose_bitmap;
+ kal_uint8 tid;
+ kal_uint8 tick_bitmap;
+ kal_uint8 carrier_num;
+ kal_uint16 t_hps;
+ kal_int32 is_period_reset_bmp;
+ geran_gsm_time_struct current_time;
+}gl1_ll1_measure_req_struct;
+
+/*****************************************************************************
+* STRUCT
+* gl1_ll1_standby_measure_done_ind_struct
+*
+* DESCRIPTIONS
+* For low power optimization, GL1 informs LL1 which measurement purpose is
+* measured done in its period. If all measurement purposes are measured done,
+* LL1 will not tick GL1 anymore in shortest measurement period.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* tid - For LL1 to know this tid is mapped to which gap pattern period sent before
+* tick_bitmap - bit 0 for ranking search, bit 1 for priority search. Only one bit will be set in one message
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 tid;
+ kal_uint8 tick_bitmap;
+}gl1_ll1_standby_measure_done_ind_struct;
+
+/*****************************************************************************
+* STRUCT
+* ll1_gl1_gap_service_req_struct
+*
+* DESCRIPTIONS
+* LL1 uses this primitive to enable (disable) active RAT gap service to get (release)
+* the free radio frequency period in GERAN GSM.When LL1 disables active RAT gap service,
+* it means that GERAN GSM could use all RF time already.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* enable - KAL_TRUE : request gap service
+* KAL_FALSE : stop gap service
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool enable;
+}ll1_gl1_gap_service_req_struct;
+
+/*****************************************************************************
+* STRUCT
+* ll1_gl1_gap_stop_req_struct
+*
+* DESCRIPTIONS
+* LL1 uses this primitive to stop gap usage in GERAN GSM when GERAN GSM is standby RAT.
+* Stop all purposes in gsm, confirmed with SY Yeh/Albert Lee SE2/CS3
+* PARAMETERS
+* LOCAL_PARA_HDR
+*
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+}ll1_gl1_gap_stop_req_struct;
+
+/*****************************************************************************
+* STRUCT
+* gl1_ll1_gap_stop_cnf_struct
+*
+* DESCRIPTIONS
+* GL1 uses this primitive to confirm LL1_GL1_GAP_STOP_REQ when there is no gap usage in GERAN GSM..
+* Stop all purposes in gsm, confirmed with SY Yeh/Albert Lee SE2/CS3
+* PARAMETERS
+* LOCAL_PARA_HDR
+* current_time - current time in GL1
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ geran_gsm_time_struct current_time;
+}gl1_ll1_gap_stop_cnf_struct;
+
+/*****************************************************************************
+* STRUCT
+* gl1_ll1_auto_gap_req_struct
+*
+* DESCRIPTIONS
+* GL1 sends this message to request LL1 that GL1 wants to use the auto gap from (fn, ebits).
+* GL1 could use this auto gap after getting the successful confirm
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* auto_time - Start time of auto gap in GL1
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ geran_gsm_time_struct auto_time;
+}gl1_ll1_auto_gap_req_struct;
+
+/*****************************************************************************
+* STRUCT
+* ll1_gl1_auto_gap_cnf_struct
+*
+* DESCRIPTIONS
+* LL1 sends this message to confirm GL1 auto gap request.
+* After receiving this message, GL1 could use required auto gap.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* success - KAL_TRUE : GL1 could use auto gap to search
+* KAL_FALSE: GL1 could not use auto gap to search.
+* And GL1 should not request auto gap until AUTO_GAP_AVAILABLE_IND
+* valid_period - The length of autonomous gap allowed by active RAT.
+* The value is valid when success = KAL_TRUE,
+* Unit : ebit
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool success;
+ kal_int32 valid_period;
+}ll1_gl1_auto_gap_cnf_struct;
+
+/*****************************************************************************
+* STRUCT
+* ll1_gl1_auto_gap_ind_struct
+*
+* DESCRIPTIONS
+* LL1 sends this message to inform GL1 stopping using RF in this auto gap from (fn, ebits).
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* auto_time - Start time of auto gap
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ geran_gsm_time_struct auto_time;
+}ll1_gl1_auto_gap_ind_struct;
+
+/*****************************************************************************
+* STRUCT
+* gl1_ll1_auto_gap_res_struct
+*
+* DESCRIPTIONS
+* GL1 sends this message to response LL1 that GL1 will/won't use RF from
+* the start timing of auto gap which is informed by LL1_GL1_auto_GAP_IND.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* success - KAL_TRUE : GL1 will not use RF from the starting time of LL1_GL1_AUTO_GAP_IND
+* KAL_FALSE: GL1 may use RF after starting time of LL1_GL1_AUTO_GAP_IND.
+* valid_period - The length of autonomous gap allowed in GL1
+* The value is valid when GL1 is active rat and success = KAL_TRUE
+* Unit : ebit
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool success;
+ kal_int32 valid_period;
+}gl1_ll1_auto_gap_res_struct;
+
+/*****************************************************************************
+* STRUCT
+* ll1_gl1_gap_notify_ind_struct
+*
+* DESCRIPTIONS
+* LL1 sends this message to inform GL1 that the starting time and length of gap pattern.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* standby_gap - standby gap pattern
+* tid - tid for lastest meas_req on
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ ll1_gl1_expand_gap_pattern_struct standby_gap;
+ kal_uint8 tid; /* Tid for lastest meas_req on, LL1 will expand gap notify ind with this tid*/
+}ll1_gl1_gap_notify_ind_struct;
+
+/*****************************************************************************
+* STRUCT
+* gl1_ll1_gap_pattern_ind_struct
+*
+* DESCRIPTIONS
+* GL1 sends this message to inform LL1 that the free RF period in GL1 as gap pattern.
+* No matter the length is bigger than zero or not, GL1 should send this message
+* and sets is_drx_tick = KAL_TRUE in one DRX period once.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* repeat_count - (1) : GSM in NULL/IDLE /SDCCH mode (8) : GSM in TCH/PKT mode.
+* start_time - starting time of the first gap
+* length - gap length
+* is_drx_tick - KAL_TRUE : First tick in this DRX period
+* KAL_FALSE: Not the first free interval in this DRX period
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 repeat_count;
+ geran_gsm_time_struct start_time;
+ kal_int32 length;
+ kal_bool is_drx_tick;
+}gl1_ll1_gap_pattern_ind_struct;
+
+/*****************************************************************************
+* STRUCT
+* ll1_gl1_sync_req_struct
+* gl1_ll1_active_measure_status_ind_struct
+* gl1_ll1_gap_stop_req_struct
+* ll1_gl1_gap_stop_cnf_struct
+* gl1_ll1_gap_suspend_req_struct
+* ll1_gl1_gap_suspend_cnf_struct
+* ll1_gl1_gap_suspend_req_struct
+* gl1_ll1_gap_suspend_cnf_struct
+* gl1_ll1_gap_resume_ind_struct
+* ll1_gl1_gap_resume_ind_struct
+* gl1_ll1_auto_gap_stop_req_struct
+* ll1_gl1_auto_gap_stop_ind_struct
+* gl1_ll1_auto_gap_stop_res_struct
+* ll1_gl1_auto_gap_stop_cnf_struct
+* gl1_ll1_auto_gap_end_ind_struct
+* ll1_gl1_auto_gap_end_ind_struct
+* gl1_ll1_auto_gap_available_ind_struct
+* ll1_gl1_auto_gap_available_ind_struct
+*
+* DESCRIPTIONS
+* ll1_gl1_sync_req_struct
+* LL1 will use this primitive to get GL1 current UMTS timing and micro
+* second counter value in both GL1 in active and standby mode.
+*
+* gl1_ll1_active_measure_status_ind_struct (Useless Now)
+* GL1 informs LL1 that how many configured inter-RAT frequencies in GL1
+* when priority search is turned on.
+*
+* gl1_ll1_gap_stop_req_struct
+* GL1 uses this primitive to inform LL1 to stop all gap usage in standby
+* RAT when GERAN GSM wants to change configuration or other purposes.
+*
+* ll1_gl1_gap_stop_cnf_struct
+* LL1 uses this primitive to confirm GL1 that LL1 has already stopped
+* all gap usages in standby RAT and GL1 could use all RF time.
+*
+* gl1_ll1_gap_suspend_req_struct
+* GL1 uses this primitive to temporal suspend gap usage in standby RAT for higher priority
+* task and doesn't need to give new gap configuration in connection mode when resumed.
+*
+* ll1_gl1_gap_suspend_cnf_struct
+* LL1 sends this confirm message to GL1 after all standby RAT gap usage are suspended.
+*
+* ll1_gl1_gap_suspend_req_struct
+* LL1 sends this message to GL1 to request that GL1 suspends RF usage immediately.
+*
+* gl1_ll1_gap_suspend_cnf_struct
+* GL1 sends this message to confirm LL1 that GL1 will not use gap from
+* now to receiving resume indicator
+*
+* gl1_ll1_gap_resume_ind_struct
+* GL1 sends this message to inform LL1 that GL1 has already finished
+* higher priority task, and standby RAT could use gap normally.
+*
+* ll1_gl1_gap_resume_ind_struct
+* LL1 sends this message to GL1 to resume GL1's gap usage.
+* After receiving this message, GL1 could use gap pattern normally.
+*
+* gl1_ll1_auto_gap_stop_req_struct
+* GL1 sends this message to request LL1 that GL1 wants to
+* retrieve auto gap for higher priority task.
+*
+* ll1_gl1_auto_gap_stop_ind_struct
+* LL1 sends this message to inform GL1 of stopping using RF
+* during auto gap period.
+*
+* gl1_ll1_auto_gap_stop_res_struct
+* GL1 sends this message to response LL1 that GL1 stops
+* auto gap usage.
+*
+* ll1_gl1_auto_gap_stop_cnf_struct
+* LL1 sends this message to confirm that GL1 could use RF now.
+*
+* gl1_ll1_auto_gap_end_ind_struct
+* GL1 sends this message to inform LL1 that auto gap usage is finished.
+*
+* ll1_gl1_auto_gap_end_ind_struct
+* LL1 sends this message to inform GL1 that auto gap usage is finished.
+*
+* gl1_ll1_auto_gap_available_ind_struct
+* GL1 sends this message to inform LL1 that auto gap is available now. Standby RAT
+* could request auto gap now. Standby RAT could request auto gap now
+*
+* ll1_gl1_auto_gap_available_ind_struct
+* LL1 sends this message to inform GL1 that auto gap
+* is available now. GL1 could request auto gap now.
+*
+* gl1_ll1_auto_gap_unavailable_ind_struct
+* GL1 sends this message to inform LL1 that auto gap is unavailable now.
+* Standby RAT could not request auto gap now.
+*
+* ll1_gl1_auto_gap_unavailable_ind_struct
+* LL1 sends this message to inform GL1 that auto gap is unavailable now.
+* GL1 could not request auto gap now.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+}ll1_gl1_sync_req_struct,
+ gl1_ll1_active_measure_status_ind_struct,
+ gl1_ll1_gap_stop_req_struct,
+ ll1_gl1_gap_stop_cnf_struct,
+ gl1_ll1_gap_suspend_req_struct,
+ ll1_gl1_gap_suspend_cnf_struct,
+ ll1_gl1_gap_suspend_req_struct,
+ gl1_ll1_gap_suspend_cnf_struct,
+ gl1_ll1_gap_resume_ind_struct,
+ ll1_gl1_gap_resume_ind_struct,
+ gl1_ll1_auto_gap_stop_req_struct,
+ ll1_gl1_auto_gap_stop_ind_struct,
+ gl1_ll1_auto_gap_stop_res_struct,
+ ll1_gl1_auto_gap_stop_cnf_struct,
+ gl1_ll1_auto_gap_end_ind_struct,
+ ll1_gl1_auto_gap_end_ind_struct,
+ gl1_ll1_auto_gap_available_ind_struct,
+ ll1_gl1_auto_gap_available_ind_struct,
+ gl1_ll1_auto_gap_unavailable_ind_struct,
+ ll1_gl1_auto_gap_unavailable_ind_struct;
+
+/*****************************************************************************
+* STRUCT
+* mll1_gl1_info_database_struct
+*
+* DESCRIPTIONS
+* GL1 information structure.
+*
+* PARAMETERS
+*
+*****************************************************************************/
+typedef struct
+{ /* Measure req*/
+ kal_uint8 tick_bmp; /* use to record tick bitmap*/
+ kal_uint8 rank_tick_tid; /* tid for rank tick*/
+ kal_uint8 prio_tick_tid; /* tid for prio tick*/
+ kal_uint8 meas_done_bmp; /* measurement done ind bitmap*/
+ kal_bool is_meas_done_useful; /* gsm uses meas_done or not by checking meas_purpose_bmp*/
+ kal_uint8 meas_purpose_bitmap; /* record the measure purpose bitmap*/
+ geran_gsm_time_struct current_time; /* gsm current time when request gap service*/
+ /* Paging period in active RAT */
+ kal_uint8 paging_period; /* Range : 2~9 Unit : 51 frames*/
+ /* Used for Mgsm in LET GP1 */
+ kal_uint8 carrier; /* in LTE GP1 Mgsm = (ceil(carrier/20))*/
+ /* Store gap information*/
+ gl1_ll1_gap_pattern_ind_struct gap_pattern; /* store gap pattern ilm*/
+ /* auto gap para*/
+ geran_gsm_time_struct auto_time; /* auto gap time*/
+ /* Mode status*/
+ ll1_active_rat_mode_status_enum mode_status; /* mode status*/
+ /* Gap request from standby rat should do sync in connection*/
+ kal_bool valid_timing; /* KAL_TRUE : with valid timing*/
+ /* KAL_FALSE : with invalid timing */
+ kal_uint8 meas_req_tid; /* Tid for lastest meas_req on, LL1 will expand gap notify ind with this tid*/
+}mll1_gl1_info_database_struct;
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif /*__POP_FSM__*/
+/*****************************************************************************
+* GLOBAL FUNCTIONS
+*****************************************************************************/
+/*****************************************************************************
+* FUNCTION
+* mll1_gl1_auto_gap_available_ind
+* DESCRIPTION
+* ll1 sends auto gap available ind to GERAN now
+*
+* PARAMETERS
+* kal_bool available
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_gl1_auto_gap_available_ind(kal_bool available);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_gl1_auto_gap_cnf
+* DESCRIPTION
+* ll1 sends auto gap cnf to GERAN now
+*
+* PARAMETERS
+* success - success or not
+* valid_period - autonomous gap length which is allowed by active rat
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_gl1_auto_gap_cnf(kal_bool success,kal_int32 valid_period);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_gl1_auto_gap_end_ind
+* DESCRIPTION
+* ll1 sends auto gap end ind to GERAN now
+*
+* PARAMETERS
+* none
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_gl1_auto_gap_end_ind(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_gl1_auto_gap_ind
+* DESCRIPTION
+* ll1 sends auto gap ind to GERAN now
+*
+* PARAMETERS
+* gsm_time - auto time
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_gl1_auto_gap_ind(geran_gsm_time_struct gsm_time);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_gl1_auto_gap_stop_cnf
+* DESCRIPTION
+* ll1 sends auto gap stop cnf to GERAN now
+*
+* PARAMETERS
+* None
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_gl1_auto_gap_stop_cnf(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_gl1_auto_gap_stop_ind
+* DESCRIPTION
+* ll1 sends auto gap stop ind to GERAN now
+*
+* PARAMETERS
+* None
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_gl1_auto_gap_stop_ind(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_gl1_auto_time_minus
+* DESCRIPTION
+* add more rf margin for any standby rat which will enter sleep during autonomous serch procedure
+*
+* PARAMETERS
+* geran_gsm_time_struct*
+* kal_int32 - more RF margin (recovery from sleep).
+* RETURNS
+* void
+*****************************************************************************/
+void mll1_gl1_auto_time_minus(geran_gsm_time_struct* time, kal_int32 ebits);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_gl1_expand_gap_pattern_ind
+* DESCRIPTION
+* ll1 sends gap pattern ind to GERAN now
+*
+* PARAMETERS
+* standby_gap - gap pattern for geran
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_gl1_expand_gap_pattern_ind(ll1_gl1_expand_gap_pattern_struct* standby_gap);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_gl1_gap_resume_ind
+* DESCRIPTION
+* LL1 sends this message to GL1 to resume GL1's gap usage.
+* After receiving this message, GL1 could use gap pattern normally.
+*
+* PARAMETERS
+* none
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_gl1_gap_resume_ind(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_gl1_gap_service_request
+* DESCRIPTION
+* ll1 sends gap service req to GERAN now
+*
+* PARAMETERS
+* enable - KAL_TRUE : turn on gap service
+* - KAL_FALSE : turn off gap service
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_gl1_gap_service_req(kal_bool enable);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_gl1_gap_stop_cnf
+* DESCRIPTION
+* LL1 uses this primitive to confirm GL1 that LL1 has already stopped
+* all gap usages in standby RAT and GL1 could use all RF time.
+*
+* PARAMETERS
+* NONE
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_gl1_gap_stop_cnf(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_gl1_gap_stop_req
+* DESCRIPTION
+* LL1 uses this primitive to stop gap usage in GERAN GSM when GERAN GSM is standby RAT.
+* Stop all purposes in gsm, confirmed with SY Yeh/Albert Lee SE2/CS3
+* PARAMETERS
+* None
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_gl1_gap_stop_req(void);
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif /* currently GL1 will not use suspend procedure*/
+/*****************************************************************************
+* FUNCTION
+* mll1_gl1_gap_suspend_req
+* DESCRIPTION
+* LL1 uses this primitive to suspend gap usage in GERAN GSM when GERAN GSM is standby RAT.
+*
+* PARAMETERS
+* None
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_gl1_gap_suspend_req(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_gl1_get_current_time
+* DESCRIPTION
+* ll1 gets current time
+*
+* PARAMETERS
+* geran_time - gl1 current time
+*
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_gl1_get_current_time(geran_gsm_time_struct* geran_time);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_gl1_get_auto_time
+* DESCRIPTION
+* return auto time from GL1
+*
+* PARAMETERS
+* None
+* RETURNS
+* geran_gsm_time_struct auto_time
+*****************************************************************************/
+geran_gsm_time_struct mll1_gl1_get_auto_time(void);
+
+#ifdef __LTE_RAT__
+/*****************************************************************************
+* FUNCTION
+* mll1_gl1_get_el1_rf_margin
+* DESCRIPTION
+* GL1 gets EL1 RF margin in current state
+* margin should be small, so use kal_int32
+* PARAMETERS
+* head - header_margin
+* tail - tail_margin
+* RETURNS
+* none
+*****************************************************************************/
+void mll1_gl1_get_el1_rf_margin(kal_int32* head,kal_int32* tail);
+#endif /*__LTE_RAT__*/
+
+/*****************************************************************************
+* FUNCTION
+* mll1_gl1_get_gl1_rf_margin
+* DESCRIPTION
+* GL1 gets GL1 RF margin in current state
+*
+* PARAMETERS
+* head - header_margin
+* tail - tail_margin
+* RETURNS
+* none
+*****************************************************************************/
+void mll1_gl1_get_gl1_rf_margin(kal_int32* head,kal_int32* tail);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_gl1_get_timing_status
+* DESCRIPTION
+*
+* PARAMETERS
+* RETURNS
+* kal_bool - valid_timing KAL_TRUE : with valid timing
+* KAL_FALSE : with invalid timing
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+kal_bool mll1_gl1_get_timing_status(void);
+
+
+/*****************************************************************************
+* FUNCTION
+* mll1_gl1_get_m_gsm
+* DESCRIPTION
+* return M_GSM in GL1
+*
+* PARAMETERS
+* None
+* RETURNS
+* kal_uint8 m_gsm
+*****************************************************************************/
+kal_uint8 mll1_gl1_get_m_gsm(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_gl1_get_mode_status
+* DESCRIPTION
+* return mode status from GL1
+*
+* PARAMETERS
+* None
+* RETURNS
+* ll1_active_rat_mode_status_enum mode_status
+*****************************************************************************/
+ll1_active_rat_mode_status_enum mll1_gl1_get_mode_status(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_gl1_get_tick_count
+* DESCRIPTION
+* GL1 tick number
+*
+* PARAMETERS
+* is_prio_search - KAL_TRUE : ll1_main wants to get prio. tick
+* KAL_FALSE : ll1_main wants to get rank tick
+* hps - 25 or 70 (uint : second)
+*
+* RETURNS
+* kal_uint32 count;
+*****************************************************************************/
+kal_uint32 mll1_gl1_get_tick_count(kal_bool is_prio_search, kal_uint16 hps);
+
+#ifdef __UMTS_RAT__
+#ifdef __UMTS_FDD_MODE__
+/*****************************************************************************
+* FUNCTION
+* mll1_gl1_get_ul1_rf_margin
+* DESCRIPTION
+* GL1 gets UL1 RF margin in current state
+*
+* PARAMETERS
+* head - header_margin
+* tail - tail_margin
+* RETURNS
+* none
+*****************************************************************************/
+void mll1_gl1_get_ul1_rf_margin(kal_int32* head,kal_int32* tail);
+#endif /*__UMTS_FDD_MODE__*/
+
+#ifdef __UMTS_TDD128_MODE__
+/*****************************************************************************
+* FUNCTION
+* mll1_gl1_get_tl1_rf_margin
+* DESCRIPTION
+* GL1 gets TL1 RF margin in current state
+*
+* PARAMETERS
+* head - header_margin
+* tail - tail_margin
+* RETURNS
+* none
+*****************************************************************************/
+void mll1_gl1_get_tl1_rf_margin(kal_int32* head,kal_int32* tail);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_gl1_is_fb_sb_search_on
+* DESCRIPTION
+* Check if gl1 turns on fb/sb search
+*
+* PARAMETERS
+*
+* RETURNS
+* kal_bool - KAL_FALSE : turns off fb/sb search
+* KAL_TRUE : turns on fb/sb search
+*****************************************************************************/
+kal_bool mll1_gl1_is_fb_sb_search_on(void);
+
+#endif /*__UMTS_TDD128_MODE__*/
+#endif /*__UMTS_RAT__*/
+/*****************************************************************************
+* FUNCTION
+* mll1_gl1_is_lower_pwr_on
+* DESCRIPTION
+* Check if gl1 is low pwr on
+*
+* PARAMETERS
+*
+* RETURNS
+* kal_bool - KAL_FALSE : measurement is not finished and need gap in this period
+* KAL_TRUE : measurement is finished and doesnt need gap in this period
+*****************************************************************************/
+kal_bool mll1_gl1_is_lower_pwr_on(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_gl1_mode_status_update_ind
+* DESCRIPTION
+* This message is sent to GL1 for informing that mode status of active RAT when GL1 is standby RAT.
+* This message should be updated for GL1 in standby when any mode status changed in active RAT.
+*
+* PARAMETERS
+* status - mode status in active RAT
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_gl1_mode_status_update_ind(ll1_active_rat_mode_status_enum status);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_gl1_set_timing_status
+* DESCRIPTION
+*
+* PARAMETERS
+* flag - set valid_timing = flag
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_gl1_set_timing_status(kal_bool flag);
+
+
+/*****************************************************************************
+* FUNCTION
+* mll1_gl1_sync_time_req
+* DESCRIPTION
+* When timing synchronization procedure is triggered, mll1 will decide which rat should do
+* timing synchronization based on the result of g_ll1_flight_rat|| g_ll1_standby_rat || g_ll1_active_rat.
+*
+* PARAMETERS
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_gl1_sync_time_req(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_gl1_time_add
+* DESCRIPTION
+* This function is used to add ebits to time , for rf margin, should smaller than kal_int32
+*
+* PARAMETERS
+* time - basic time
+* ebits - add ebits
+* RETURNS
+* none
+*****************************************************************************/
+void mll1_gl1_time_add( geran_gsm_time_struct* time, kal_int32 ebits );
+
+/*****************************************************************************
+* CALL FUNCTION PROTOTYPE
+* mll1_gsm_handler()
+*
+* DESCRIPTION
+* Function to handle the primitive from GL1.
+*
+* PARAMETERS
+* current_ilm - primitive from GL1.
+*
+* RETURN
+* None
+*****************************************************************************/
+void mll1_gsm_handler(void *ptr_ilm);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_tick_gl1_gap_expansion
+* DESCRIPTION
+* tick gl1 to expand gap when sync done
+*
+* PARAMETERS
+* none
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_tick_gl1_gap_expansion(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_gl1_info_init
+* DESCRIPTION
+* Initialize gl1 internal global variable
+*
+* PARAMETERS
+* none
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_gl1_info_init(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_gl1_gap_pattern_timing_checking
+* DESCRIPTION
+* check if the pending gap is out of date or not
+*
+* PARAMETERS
+* gsm_time - gl1 timing correspond to some standby rat's timing indicated in measure request
+* RETURNS
+* TRUE - the pending gap has not been out of date
+* FALSE - the pending gap has been out of date
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+kal_bool mll1_gl1_gap_pattern_timing_checking(geran_gsm_time_struct gsm_time);
+
+#endif /*_MLL1_GSM_H*/
+
diff --git a/mcu/protocol/interface/general/mll1_umts_fdd.h b/mcu/protocol/interface/general/mll1_umts_fdd.h
new file mode 100644
index 0000000..a3dd17c
--- /dev/null
+++ b/mcu/protocol/interface/general/mll1_umts_fdd.h
@@ -0,0 +1,1352 @@
+#ifndef _MLL1_UMTS_FDD_H
+#define _MLL1_UMTS_FDD_H
+
+#include "kal_public_defs.h" /*for LOCAL_PARA_HDR*/
+#include "mll1_common.h"
+/*****************************************************************************
+* DEFINITIONS
+*****************************************************************************/
+#define UMTS_FDD_SESSION_IN_PERIOD 8 /* align gsm, LTE only need 6 for gp0/gp1 */
+
+#define UMTS_FDD_MAX_DCH_GAP_PARAM_NUM 6 /*2 Pop temp modification for UL1's TGPS free buffer issue*/
+#define UMTS_FDD_MAX_TGPS_NUM 6
+#define UMTS_FDD_SCHEDULE_DELAY 0 /* used to postpone available gap start time */
+/*****************************************************************************
+* ENUMERATIONS
+*****************************************************************************/
+
+/*****************************************************************************
+* ENUMERATION
+* ul1_ll1_rat_status_enum
+*
+* DESCRIPTIONS
+* Used to identify the status in UMTS FDD RAT.
+* NOTE
+* any modification should sync. with ll1_rat_status_enum
+*****************************************************************************/
+typedef enum
+{
+ UL1_LL1_RAT_FLIGHT =0,
+ UL1_LL1_RAT_STANDBY,
+ UL1_LL1_RAT_ACTIVE,
+ UL1_LL1_RAT_NUM
+} ul1_ll1_rat_status_enum;
+
+/*****************************************************************************
+* ENUMERATION
+* umts_fdd_tgps_status_enum
+*
+* DESCRIPTIONS
+* ACTIVE_GAP: the tgps is used in standby L1.
+* INACTIVE_GAP: the tgps is not used in standby L1.
+*****************************************************************************/
+typedef enum
+{
+ UL1_ACTIVATE_GAP=0, /* 0 */
+ UL1_DEACTIVATE_GAP /* 1 */
+}umts_fdd_tgps_status_enum;
+
+/*****************************************************************************
+* ENUMERATION
+* umts_fdd_tgmp_enum
+*
+* DESCRIPTIONS
+* The enum type of TGPS purpose
+* NOTE
+* any change should note x_tgmp_enum
+*****************************************************************************/
+typedef enum
+{
+ UL1_LL1_FDD_MEASURE, /* Inter-frequency measurement */
+ UL1_LL1_GSM_RSSI, /* GSM RSSI measurement */
+ UL1_LL1_GSM_BSIC_INIT, /* GSM initial BSIC */
+ UL1_LL1_GSM_BSIC_CNF, /* GSM BSIC confirm */
+ UL1_LL1_EUTRAN, /* Inter-RAT LTE measurement*/
+ UL1_LL1_UMTS_TDD, /* Inter-RAT UMTS_TDD measurement*/
+ UL1_LL1_PURPOSE_UNDEFINED
+} umts_fdd_tgmp_enum;
+
+/*****************************************************************************
+* STRUCTURES
+*****************************************************************************/
+
+/*****************************************************************************
+* STRUCT
+* umts_fdd_time_struct
+*
+* DESCRIPTIONS
+* UMTS FDD system timing base
+*
+* PARAMETERS
+* sfn - UMTS FDD system frame number (0~4095), 1 sfn = 38400*8.
+* echip - UMTS FDD Echip (0~307199)
+*****************************************************************************/
+typedef struct
+{
+ kal_int32 sfn;
+ kal_int32 echip;
+}umts_fdd_time_struct;
+
+/*****************************************************************************
+* STRUCT
+* ll1_umts_fdd_standby_gap_struct
+*
+* DESCRIPTIONS
+* UMTS FDD standby gap pattern structure.
+*
+* PARAMETERS
+* start_time - start time of the gap session
+* length - length of the gap session (in echip)
+*****************************************************************************/
+typedef struct
+{
+ umts_fdd_time_struct start_time;
+ kal_int32 length;
+}ll1_umts_fdd_standby_gap_struct;
+
+/*****************************************************************************
+* STRUCT
+* ll1_ul1_expand_gap_pattern_struct
+*
+* DESCRIPTIONS
+* LL1 expands gap pattern for UL1
+*
+* PARAMETERS
+* session_num - Indicate how many gap session
+* session[] - Standby gap session.
+* measure_tid - Transition id for RANK tick./Valid when active RAT is in DRX mode./And bit 0 in tick_bitmap is "1"
+* hps_tid - Transition id for HPS tick./Valid when active RAT is in DRX mode./And bit 1 in tick_bitmap is "1"
+* tick_bitmap - Bit 0 : Rank search , Bit 1 : Priority search
+*****************************************************************************/
+typedef struct
+{
+ kal_uint8 session_num;
+ ll1_umts_fdd_standby_gap_struct session[UMTS_FDD_SESSION_IN_PERIOD];
+ kal_uint8 measure_tid;
+ kal_uint8 hps_tid;
+ kal_uint8 tick_bitmap;
+}ll1_ul1_expand_gap_pattern_struct;
+
+/*****************************************************************************
+* STRUCT
+* ll1_umts_fdd_gap_config_struct
+*
+* DESCRIPTIONS
+* UMTS FDD gap configuration when UMTS FDD is active RAT.
+*
+* PARAMETERS
+* start_time - Valid time of gap pattern in active RAT
+* use_num - Continuous gap number could be used in active RAT(Each FMO cycle = 10*M_REP*NTTI as a unit)
+* skip_num - Skip number in active RAT (Each FMO cycle = 10*M_REP*NTTI as a unit)
+*****************************************************************************/
+typedef struct
+{
+ umts_fdd_time_struct start_time;
+ kal_uint8 use_num;
+ kal_uint8 skip_num;
+}ll1_umts_fdd_gap_config_struct;
+
+/*****************************************************************************
+* STRUCT
+* umts_fdd_idle_gap_struct
+*
+* DESCRIPTIONS
+* UMTS FDD idle gap structure.
+*
+* PARAMETERS
+* start_time - start time of the gap session
+* length - length of the gap session (in echip)
+* is_drx_tick - KAL_TRUE : First tick in this DRX period
+* KAL_FALSE: Not the first free interval in this DRX period
+*****************************************************************************/
+typedef struct
+{
+ umts_fdd_time_struct start_time;
+ kal_int32 length;
+ kal_bool is_drx_tick;
+}umts_fdd_idle_gap_struct;
+
+/*****************************************************************************
+* STRUCT
+* umts_fdd_fach_gap_struct
+*
+* DESCRIPTIONS
+* UMTS FDD FACH gap structure.(FMO)
+*
+* PARAMETERS
+* active_time_sfm - The first SFN for starting FMO.
+* fmo_offset - The FMO offset from the beginning of each FMO cycle in UMTS FDD frames.
+* fmo_duration - The FMO duration for measurements within each FMO cycle in UMTS FDD frames
+* period_length - Equal to 10*M_REP*NTTI
+*****************************************************************************/
+typedef struct
+{
+ kal_uint32 active_time_sfn;
+ kal_uint32 fmo_offset;
+ kal_uint32 fmo_duration;
+ kal_uint32 period_length;
+}umts_fdd_fach_gap_struct;
+
+/*****************************************************************************
+* STRUCT
+* umts_fdd_dch_gap_info_struct
+*
+* DESCRIPTIONS
+* UMTS FDD gap information structure. (TGPSi configuration)
+*
+* PARAMETERS
+* refer to spec. 36.331
+*****************************************************************************/
+typedef struct
+{
+ kal_uint8 tgpsi;
+ umts_fdd_tgps_status_enum status;
+ kal_int16 tgsfn;
+ umts_fdd_tgmp_enum purpose;
+ kal_uint16 original_tgprc;
+ kal_uint16 remain_tgprc;
+ kal_uint8 tgsn;
+ kal_uint8 tgl1;
+ kal_uint8 tgl2;
+ kal_uint16 tgd;
+ kal_uint8 tgpl1;
+ kal_uint8 tgpl2;
+ kal_uint16 t_reconfirm_dch;
+ kal_uint16 t_identify_dch;
+}umts_fdd_dch_gap_info_struct;
+
+/*****************************************************************************
+* STRUCT
+* umts_fdd_dch_gap_param_struct
+*
+* DESCRIPTIONS
+* UMTS FDD DCH gap info structure. (gap_info_lenthg TGPSi in one TGPS configuration )
+*
+* PARAMETERS
+* gap_info_length - The DCH gap pattern sequence number
+* reconfig_time_sfn - valid time of this configuration
+* dch_gap_info[] -
+*****************************************************************************/
+typedef struct
+{
+ kal_uint8 gap_info_length;
+ kal_int16 reconfig_time_sfn;
+ umts_fdd_dch_gap_info_struct dch_gap_info[UMTS_FDD_MAX_TGPS_NUM];
+}umts_fdd_dch_gap_param_struct;
+
+/*****************************************************************************
+* STRUCT
+* umts_fdd_dch_gap_struct
+*
+* DESCRIPTIONS
+* UMTS FDD DCH gap structure. ( many TGPS configurations)
+*
+* PARAMETERS
+* gap_param_num - Indicate that whether the patterns need to be applied
+* umts_fdd_dch_gap_param[] - DCH gap configurations
+*****************************************************************************/
+typedef struct
+{
+ kal_uint8 gap_param_num;
+ umts_fdd_dch_gap_param_struct umts_fdd_dch_gap_param[UMTS_FDD_MAX_DCH_GAP_PARAM_NUM];
+}umts_fdd_dch_gap_struct;
+
+/*****************************************************************************
+* STRUCT
+* ul1_ll1_sync_cnf_struct
+*
+* DESCRIPTIONS
+* UL1 uses this primitive to confirm LL1 that current UMTS FDD timing
+* and micro second counter value.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* current_time - sync. time in umts_fdd_time_struct
+* umts_fdd_ustime - sync. time in USC
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ umts_fdd_time_struct current_time;
+ kal_uint32 umts_fdd_ustime;
+}ul1_ll1_sync_cnf_struct;
+
+/*****************************************************************************
+* STRUCT
+* ul1_ll1_rat_status_ind_struct
+*
+* DESCRIPTIONS
+* This message is sent from UL1 to LL1 for informing current UL1 RAT status.
+* This message should be sent when UL1 RAT status changed.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* rat_status - RAT status in UL1
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ ul1_ll1_rat_status_enum rat_status;
+}ul1_ll1_rat_status_ind_struct;
+
+/*****************************************************************************
+* STRUCT
+* ul1_ll1_mode_status_ind_struct
+*
+* DESCRIPTIONS
+* This message is sent from UL1 to LL1 for informing that UL1 mode status when UL1 is active RAT.
+* This message should be sent when UL1 mode status changed.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* fdd_mode_status - current mode in UL1 when UMTS FDD is active RAT
+* drx_cycle_length - valid when gsm_mode_status = UL1_LL1_IDLE_MODE || LL1_FDD_EFACH_DRX_MODE
+* burst_length - valid when gsm_mode_status = LL1_FDD_EFACH_DRX_MODE, and should be smaller than drx_cycle_length
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ ll1_active_rat_mode_status_enum fdd_mode_status;
+ kal_uint16 drx_cycle_length;
+ kal_uint16 burst_length;
+}ul1_ll1_mode_status_ind_struct;
+
+/*****************************************************************************
+* STRUCT
+* ll1_ul1_mode_status_update_ind_struct
+*
+* DESCRIPTIONS
+* This message is sent to UL1 for informing that mode status of active RAT when UL1 is standby RAT.
+* This message should be updated for UL1 in standby when any mode status changed in active RAT.
+* Also when UL1 enters into standby RAT from FLIGHT, LL1 will update current mode state in active RAT to UL1.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* active_rat_mode_status - current mode status in active RAT
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ ll1_active_rat_mode_status_enum active_rat_mode_status;
+}ll1_ul1_mode_status_update_ind_struct;
+
+/*****************************************************************************
+* STRUCT
+* ul1_ll1_active_measure_status_ind_struct
+*
+* DESCRIPTIONS
+* UL1 informs LL1 that how many higher priority inter-frequencies in UL1 when high priority search is turned on
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* freq_num - The number of higher priority inter-freq. in UL1.(0~3)
+* When HPS off, the freq_num is equal to zero.
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 freq_num;
+}ul1_ll1_active_measure_status_ind_struct;
+
+/*****************************************************************************
+* STRUCT
+* ul1_ll1_measure_req_struct
+*
+* DESCRIPTIONS
+* This message is sent from UL1 to inform LL1 that how many UMTS FDD frequencies are required to be
+* measured and the measurement purposes both in UMTS FDD Active and Standby. The message is not
+* applicable for UL1 to request gaps for inter-frequency measurement in idle mode.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* meas_purpose_bitmap - bit 0 for measurement, bit 1 for cell search
+* tid - tid for lastest meas_req on (should only change when off)
+* tick_bitmap - bit 0 for ranking search, bit 1 for priority search
+* freq_num - high priority freqencies when HPS ON, measurement frequencies when HPS OFF
+* t_hps - basic period of high priority search (25s,60s,70s)
+* is_period_reset_bmp - bit 0 for rank period, 1 means to reset
+* - bit 1 for prio period, 0 means not to reset
+* - when freq. num is same as before, ll1 will check this flag to reset period or not
+* - bit 2 for Tmeas prohibit n_laer, 0 means not to apply n_layer
+* - when freq. num is same as before, ll1 will check this flag to apply n_layer or not
+* current_time - current in UL1
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 meas_purpose_bitmap;
+ kal_uint8 tid;
+ kal_uint8 tick_bitmap;
+ kal_uint8 freq_num;
+ kal_uint16 t_hps;
+ kal_int32 is_period_reset_bmp;
+ umts_fdd_time_struct current_time;
+}ul1_ll1_measure_req_struct;
+
+/*****************************************************************************
+* STRUCT
+* ul1_ll1_standby_measure_done_ind_struct
+*
+* DESCRIPTIONS
+* For low power optimization, UL1 informs LL1 which measurement purpose is
+* measured done in its period. If all measurement purposes are measured done,
+* LL1 will not tick UL1 anymore in shortest measurement period.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* tid - For LL1 to know this tid is mapped to which gap pattern period sent before
+* tick_bitmap - bit 0 for ranking search, bit 1 for priority search. Only one bit will be set in one message.
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 tid;
+ kal_uint8 tick_bitmap;
+}ul1_ll1_standby_measure_done_ind_struct;
+
+/*****************************************************************************
+* STRUCT
+* ll1_ul1_gap_service_req_struct
+*
+* DESCRIPTIONS
+* LL1 uses this primitive to enable (disable) active RAT gap service to get (release)
+* the free radio frequency period in UMTS FDD.When LL1 disables active RAT gap service,
+* it means that UMTS FDD could use all RF time already.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* enable - KAL_TRUE : request gap service
+* KAL_FALSE : stop gap service
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool enable;
+}ll1_ul1_gap_service_req_struct;
+
+/*****************************************************************************
+* STRUCT
+* ul1_ll1_gap_stop_cnf_struct
+*
+* DESCRIPTIONS
+* UL1 uses this primitive to confirm LL1_UL1_GAP_STOP_REQ when there is no gap usage in UMTS_FDD..
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* current_time - current time in UL1
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ umts_fdd_time_struct current_time;
+}ul1_ll1_gap_stop_cnf_struct;
+
+/*****************************************************************************
+* STRUCT
+* ul1_ll1_auto_gap_req_struct
+*
+* DESCRIPTIONS
+* UL1 sends this message to request LL1 that UL1 wants to use the auto gap from (sfn, echip).
+* UL1 could use this auto gap after getting the successful confirm
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* auto_time - Start time of auto gap in UL1
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ umts_fdd_time_struct auto_time;
+}ul1_ll1_auto_gap_req_struct;
+
+/*****************************************************************************
+* STRUCT
+* ll1_ul1_auto_gap_cnf_struct
+*
+* DESCRIPTIONS
+* LL1 sends this message to confirm UL1 auto gap request.
+* After receiving this message, UL1 could use required auto gap.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* success - KAL_TRUE : UL1 could use auto gap to search
+* KAL_FALSE: UL1 could not use auto gap to search.
+* And UL1 should not request auto gap until AUTO_GAP_AVAILABLE_IND
+* valid_period - The length of autonomous gap allowed by active RAT
+* The value is valid when success = KAL_TRUE
+* Unit : echip
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool success;
+ kal_int32 valid_period;
+}ll1_ul1_auto_gap_cnf_struct;
+
+/*****************************************************************************
+* STRUCT
+* ll1_ul1_auto_gap_ind_struct
+*
+* DESCRIPTIONS
+* LL1 sends this message to inform UL1 stopping using RF in this auto gap from (sfn, echip).
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* auto_time - Start time of auto gap
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ umts_fdd_time_struct auto_time;
+}ll1_ul1_auto_gap_ind_struct;
+
+/*****************************************************************************
+* STRUCT
+* ul1_ll1_auto_gap_res_struct
+*
+* DESCRIPTIONS
+* UL1 sends this message to response LL1 that UL1 will/won't use RF from
+* the start timing of auto gap which is informed by LL1_UL1_AUTO_GAP_IND.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* success - KAL_TRUE : UL1 will not use RF from the starting time of LL1_UL1_AUTONOMOIS_GAP_IND
+* KAL_FALSE: UL1 may use RF after starting time of LL1_UL1_AUTONOMOIS_GAP_IND.
+* valid_period - The length of autonomous gap allowed in UL1
+* The value is valid when UL1 is active rat and success = KAL_TRUE
+* Unit : echip
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool success;
+ kal_int32 valid_period;
+}ul1_ll1_auto_gap_res_struct;
+
+/*****************************************************************************
+* STRUCT
+* ll1_ul1_gap_notify_ind_struct
+*
+* DESCRIPTIONS
+* LL1 sends this message to inform UL1 that the starting time and length of gap pattern when UL1 is standby RAT.
+* LL1 sends this message to inform UL1 the gap pattern configuration when UL1 is active RAT.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* standby_gap - standby gap pattern
+* active_gap - active gap pattern configuration
+* tid - tid for lastest meas_req on
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ ll1_ul1_expand_gap_pattern_struct standby_gap;
+ ll1_umts_fdd_gap_config_struct active_gap;
+ kal_uint8 tid; /* Tid for lastest meas_req on, LL1 will expand gap notify ind with this tid*/
+}ll1_ul1_gap_notify_ind_struct;
+
+/*****************************************************************************
+* STRUCT
+* ul1_ll1_gap_pattern_ind_struct
+*
+* DESCRIPTIONS
+* UL1 sends this message to inform LL1 that the free RF period in UL1 as gap pattern.
+* PARAMETERS
+* LOCAL_PARA_HDR
+* ul1_current_time - Ul1 current time
+* idle_gap - No matter the length is bigger than zero or not,
+* UL1 should send this message and sets is_drx_tick = KAL_TRUE in one DRX period once.
+* fach_gap - fach gap pattern
+* dch_gap - tgps gap pattern
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ umts_fdd_time_struct ul1_current_time;
+ umts_fdd_idle_gap_struct idle_gap;
+ umts_fdd_fach_gap_struct fach_gap;
+ umts_fdd_dch_gap_struct dch_gap;
+}ul1_ll1_gap_pattern_ind_struct;
+
+/*****************************************************************************
+* STRUCT
+* ll1_ul1_sync_req_struct
+* ul1_ll1_gap_stop_req_struct
+* ll1_ul1_gap_stop_cnf_struct
+* ll1_ul1_gap_stop_req_struct
+* ul1_ll1_gap_suspend_req_struct
+* ll1_ul1_gap_suspend_cnf_struct
+* ll1_ul1_gap_suspend_req_struct
+* ul1_ll1_gap_suspend_cnf_struct
+* ul1_ll1_gap_resume_ind_struct
+* ll1_ul1_gap_resume_ind_struct
+* ul1_ll1_auto_gap_stop_req_struct
+* ll1_ul1_auto_gap_stop_ind_struct
+* ul1_ll1_auto_gap_stop_res_struct
+* ll1_ul1_auto_gap_stop_cnf_struct
+* ul1_ll1_auto_gap_end_ind_struct
+* ll1_ul1_auto_gap_end_ind_struct
+* ul1_ll1_auto_gap_available_ind_struct
+* ll1_ul1_auto_gap_available_ind_struct
+*
+* DESCRIPTIONS
+* ll1_ul1_sync_req_struct
+* LL1 will use this primitive to get UL1 current UMTS timing and micro
+* second counter value in both UL1 in active and standby mode.
+*
+* ul1_ll1_gap_stop_req_struct
+* UL1 uses this primitive to inform LL1 to stop all gap usage in standby
+* RAT when GERAN GSM wants to change configuration or other purposes.
+*
+* ll1_ul1_gap_stop_cnf_struct
+* LL1 uses this primitive to confirm UL1 that LL1 has already stopped
+* all gap usages in standby RAT and UL1 could use all RF time.
+*
+* ll1_ul1_gap_stop_req_struct
+* LL1 uses this primitive to stop gap usage in UMTS FDD when UMTS FDD is standby RAT.
+*
+* ul1_ll1_gap_suspend_req_struct
+* UL1 uses this primitive to temporal suspend gap usage in standby RAT for higher priority
+* task and doesn't need to give new gap configuration in connection mode when resumed.
+*
+* ll1_ul1_gap_suspend_cnf_struct
+* LL1 sends this confirm message to UL1 after all standby RAT gap usage are suspended.
+*
+* ll1_ul1_gap_suspend_req_struct
+* LL1 sends this message to UL1 to request that UL1 suspends RF usage immediately.
+*
+* ul1_ll1_gap_suspend_cnf_struct
+* UL1 sends this message to confirm LL1 that UL1 will not use gap from
+* now to receiving resume indicator
+*
+* ul1_ll1_gap_resume_ind_struct
+* UL1 sends this message to inform LL1 that UL1 has already finished
+* higher priority task, and standby RAT could use gap normally.
+*
+* ll1_ul1_gap_resume_ind_struct
+* LL1 sends this message to UL1 to resume UL1's gap usage.
+* After receiving this message, UL1 could use gap pattern normally.
+*
+* ul1_ll1_auto_gap_stop_req_struct
+* UL1 sends this message to request LL1 that UL1 wants to
+* retrieve auto gap for higher priority task.
+*
+* ll1_ul1_auto_gap_stop_ind_struct
+* LL1 sends this message to inform UL1 of stopping using RF
+* during auto gap period.
+*
+* ul1_ll1_auto_gap_stop_res_struct
+* UL1 sends this message to response LL1 that UL1 stops
+* auto gap usage.
+*
+* ll1_ul1_auto_gap_stop_cnf_struct
+* LL1 sends this message to confirm that UL1 could use RF now.
+*
+* ul1_ll1_auto_gap_end_ind_struct
+* UL1 sends this message to inform LL1 that auto gap usage is finished.
+*
+* ll1_ul1_auto_gap_end_ind_struct
+* LL1 sends this message to inform UL1 that auto gap usage is finished.
+*
+* ul1_ll1_auto_gap_available_ind_struct
+* UL1 sends this message to inform LL1 that auto gap is available now. Standby RAT
+* could request auto gap now. Standby RAT could request auto gap now
+*
+* ll1_ul1_auto_gap_available_ind_struct
+* LL1 sends this message to inform UL1 that auto gap
+* is available now. UL1 could request auto gap now.
+*
+* ul1_ll1_auto_gap_unavailable_ind_struct
+* UL1 sends this message to inform LL1 that auto gap is unavailable now.
+* Standby RAT could not request auto gap now.
+*
+* ll1_ul1_auto_gap_unavailable_ind_struct
+* LL1 sends this message to inform UL1 that auto gap is unavailable now.
+* UL1 could not request auto gap now.
+*
+
+* PARAMETERS
+* LOCAL_PARA_HDR
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+}ll1_ul1_sync_req_struct,
+ ul1_ll1_gap_stop_req_struct,
+ ll1_ul1_gap_stop_cnf_struct,
+ ll1_ul1_gap_stop_req_struct,
+ ul1_ll1_gap_suspend_req_struct,
+ ll1_ul1_gap_suspend_cnf_struct,
+ ll1_ul1_gap_suspend_req_struct,
+ ul1_ll1_gap_suspend_cnf_struct,
+ ul1_ll1_gap_resume_ind_struct,
+ ll1_ul1_gap_resume_ind_struct,
+ ul1_ll1_auto_gap_stop_req_struct,
+ ll1_ul1_auto_gap_stop_ind_struct,
+ ul1_ll1_auto_gap_stop_res_struct,
+ ll1_ul1_auto_gap_stop_cnf_struct,
+ ul1_ll1_auto_gap_end_ind_struct,
+ ll1_ul1_auto_gap_end_ind_struct,
+ ul1_ll1_auto_gap_available_ind_struct,
+ ll1_ul1_auto_gap_available_ind_struct,
+ ul1_ll1_auto_gap_unavailable_ind_struct,
+ ll1_ul1_auto_gap_unavailable_ind_struct;
+
+/*****************************************************************************
+* STRUCT
+* mll1_ul1_info_database_struct
+*
+* DESCRIPTIONS
+* UL1 information structure.
+*
+* PARAMETERS
+*
+*****************************************************************************/
+typedef struct
+{ /* measure req*/
+ kal_uint8 tick_bmp; /* use to record tick bitmap*/
+ kal_uint8 rank_tick_tid; /* tid for rank tick*/
+ kal_uint8 prio_tick_tid; /* tid for prio tick*/
+ kal_uint8 meas_done_bmp; /* measurement done ind bitmap*/
+ kal_bool is_meas_done_useful; /* umts fdd uses meas_done or not by checking meas_purpose_bmp*/
+ kal_uint8 meas_purpose_bitmap; /* record the measure purpose bitmap*/
+ umts_fdd_time_struct current_time; /* umts fdd current time when request gap service*/
+ umts_fdd_time_struct current_time_from_ul1; /* Record the UL1 current time carried in the gap pattern ind */
+ /* Paging period in active RAT */
+ kal_int32 drx_cycle; /* 80,160,320,640,1280,2560,5120 Unit : ms*/
+ /* Burst length for eFACH DRX*/
+ kal_int32 burst_length; /* 10,20,40,80,160 Unit : ms*/
+ /* auto gap para*/
+ umts_fdd_time_struct auto_time; /* auto gap time*/
+ /* Mode status*/
+ ll1_active_rat_mode_status_enum mode_status; /* mode status*/
+ /* GAP pattern*/
+ ul1_ll1_gap_pattern_ind_struct gap_pattern; /* Gap pattern */
+ /* Gap request from standby rat should do sync in connection*/
+ kal_bool valid_timing; /* KAL_TRUE : with valid timing */
+ /* KAL_FALSE : with invalid timing */
+ kal_uint8 meas_req_tid; /* Tid for lastest meas_req on, LL1 will expand gap notify ind with this tid*/
+}mll1_ul1_info_database_struct;
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif /*__POP_FSM__*/
+
+/*****************************************************************************
+* GLOBAL FUNCTIONS
+*****************************************************************************/
+
+/*****************************************************************************
+* FUNCTION
+* mll1_tick_ul1_gap_expansion
+* DESCRIPTION
+* tick ul1 to expand gap when sync done
+*
+* PARAMETERS
+* none
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_tick_ul1_gap_expansion(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_ul1_auto_gap_available_ind
+* DESCRIPTION
+* ll1 sends auto gap available ind to UMTS FDD now
+*
+* PARAMETERS
+* kal_bool available
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_ul1_auto_gap_available_ind(kal_bool available);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_ul1_auto_gap_cnf
+* DESCRIPTION
+* ll1 sends auto gap cnf to UMTS_FDD now
+*
+* PARAMETERS
+* success - success or not
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_ul1_auto_gap_cnf(kal_bool success,kal_int32 valid_period);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_ul1_auto_gap_end_ind
+* DESCRIPTION
+* ll1 sends auto gap end ind to UMTS FDD now
+*
+* PARAMETERS
+* none
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_ul1_auto_gap_end_ind(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_ul1_auto_gap_ind
+* DESCRIPTION
+* ll1 sends auto gap end ind to UMTS FDD now
+*
+* PARAMETERS
+* fdd_time - auto time
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_ul1_auto_gap_ind(umts_fdd_time_struct fdd_time);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_ul1_auto_gap_stop_cnf
+* DESCRIPTION
+* ll1 sends auto gap stop cnf to UMTS_FDD now
+*
+* PARAMETERS
+* None
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_ul1_auto_gap_stop_cnf(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_ul1_auto_gap_stop_ind
+* DESCRIPTION
+* ll1 sends auto gap stop ind to UMTS_FDD now
+*
+* PARAMETERS
+* None
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_ul1_auto_gap_stop_ind(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_ul1_auto_time_minus
+* DESCRIPTION
+* Add more rf margin for any standby rat which will enter sleep during autonomous serch procedure
+* Assume margin is smaller than one sfn
+* PARAMETERS
+* umts_fdd_time_struct*
+* kal_int32 - more RF margin (recovery from sleep).
+* RETURNS
+* void
+*****************************************************************************/
+void mll1_ul1_auto_time_minus(umts_fdd_time_struct* time, kal_int32 echip);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_ul1_expand_active_gap_pattern_ind
+* DESCRIPTION
+* ll1 sends active gap pattern ind to UMTS_FDD now
+*
+* PARAMETERS
+* start_time - Valid time of gap pattern in active RAT
+* use_num - Continuous gap number could be used in active RAT(Each FMO cycle = 10*M_REP*NTTI as a unit)
+* skip_num - Skip number in active RAT (Each FMO cycle = 10*M_REP*NTTI as a unit)
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_ul1_expand_active_gap_pattern_ind(umts_fdd_time_struct* start_time,kal_uint8 use_num,kal_uint8 skip_num);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_ul1_expand_gap_pattern_ind
+* DESCRIPTION
+* ll1 sends auto gap available ind to UMTS FDD now
+*
+* PARAMETERS
+* standby_gap - gap pattern for umts fdd
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_ul1_expand_gap_pattern_ind(ll1_ul1_expand_gap_pattern_struct* standby_gap);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_ul1_gap_resume_ind
+* DESCRIPTION
+* LL1 sends this message to UL1 to resume UL1's gap usage.
+* After receiving this message, UL1 could use gap pattern normally.
+*
+* PARAMETERS
+* none
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_ul1_gap_resume_ind(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_ul1_gap_service_req
+* DESCRIPTION
+* ll1 sends gap service req to UMTS_FDD now
+*
+* PARAMETERS
+* enable - KAL_TRUE : turn on gap service
+* - KAL_FALSE : turn off gap service
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_ul1_gap_service_req(kal_bool enable);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_ul1_gap_stop_cnf
+* DESCRIPTION
+* LL1 uses this primitive to confirm UL1 that LL1 has already stopped
+* all gap usages in standby RAT and UL1 could use all RF time.
+*
+* PARAMETERS
+* NONE
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_ul1_gap_stop_cnf(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_ul1_gap_stop_req
+* DESCRIPTION
+* LL1 uses this primitive to stop gap usage in UMTS FDD when UMTS FDD is standby RAT.
+*
+* PARAMETERS
+* NONE
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_ul1_gap_stop_req(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_ul1_gap_suspend_cnf
+* DESCRIPTION
+* LL1 sends this confirm message to UL1 after gap usage in standby RAT is suspended.
+* UL1 could use RF only after getting this message.
+*
+* PARAMETERS
+* NONE
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_ul1_gap_suspend_cnf(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_ul1_gap_suspend_req
+* DESCRIPTION
+* LL1 uses this primitive to suspend gap usage in UMTS FDD when UMTS FDD is standby RAT.
+*
+* PARAMETERS
+* NONE
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_ul1_gap_suspend_req(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_ul1_get_auto_time
+* DESCRIPTION
+* return auto time from UL1
+*
+* PARAMETERS
+* None
+* RETURNS
+* umts_fdd_time_struct auto_time
+*****************************************************************************/
+umts_fdd_time_struct mll1_ul1_get_auto_time(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_ul1_get_current_time
+* DESCRIPTION
+* ll1 gets current time + ahead margin to expand gap
+*
+* PARAMETERS
+* umts_fdd_time - start time of expansion period
+* kal_bool is_ahead_time
+* TRUE : advance eutran_time with the predefined ahead_time
+* FALSE: don't advance eutran_time with the predefined ahead_time
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_ul1_get_current_time(umts_fdd_time_struct* fdd_time, kal_bool is_ahead_time);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_ul1_get_efach_drx_tick_count
+* DESCRIPTION
+* ll1 gets rank tick base when umts fdd in efach drx mode
+*
+* PARAMETERS
+* none
+* RETURNS
+* kal_uint32 count
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+kal_uint32 mll1_ul1_get_efach_drx_tick_count(void);
+
+#ifdef __LTE_RAT__
+/*****************************************************************************
+* FUNCTION
+* mll1_ul1_get_el1_rf_margin
+* DESCRIPTION
+* UL1 gets EL1 RF margin in current state
+*
+* PARAMETERS
+* head - header_margin
+* tail - tail_margin
+* RETURNS
+* none
+*****************************************************************************/
+void mll1_ul1_get_el1_rf_margin(kal_int32* head,kal_int32* tail);
+#endif /*__LTE_RAT__*/
+
+#ifdef __GSM_RAT__
+/*****************************************************************************
+* FUNCTION
+* mll1_ul1_get_gl1_rf_margin
+* DESCRIPTION
+* UL1 gets GL1 RF margin in current state
+*
+* PARAMETERS
+* head - header_margin
+* tail - tail_margin
+* RETURNS
+* none
+*****************************************************************************/
+void mll1_ul1_get_gl1_rf_margin(kal_int32* head,kal_int32* tail);
+#endif /*__GSM_RAT__*/
+
+/*****************************************************************************
+* FUNCTION
+* mll1_ul1_get_mode_status
+* DESCRIPTION
+* return mode status from UL1
+*
+* PARAMETERS
+* None
+* RETURNS
+* ll1_active_rat_mode_status_enum mode_status
+*****************************************************************************/
+ll1_active_rat_mode_status_enum mll1_ul1_get_mode_status(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_ul1_get_t_abort
+* DESCRIPTION
+* Tidentify,gsm / Treconfirm,gsm uint: ms
+*
+* PARAMETERS
+* tti - in ms
+* t_meas - in ms
+*
+* RETURNS
+* kal_uint32 t_abort;
+*****************************************************************************/
+kal_uint32 mll1_ul1_get_t_abort(kal_uint32 tti, kal_uint32 t_meas, kal_bool is_identify);
+
+
+/*****************************************************************************
+* FUNCTION
+* mll1_ul1_get_t_abort_for_efach_drx
+* DESCRIPTION
+* Tidentify,gsm / Treconfirm,gsm uint: ms
+*
+* PARAMETERS
+* kal_bool is_identify
+*
+* RETURNS
+* kal_uint32 t_abort;
+*****************************************************************************/
+kal_uint32 mll1_ul1_get_t_abort_for_efach_drx(kal_bool is_identify);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_ul1_get_tick_count
+* DESCRIPTION
+* UL1 tick number
+*
+* PARAMETERS
+* is_prio_search - KAL_FALSE : ll1_main wants to get meas. tick
+* KAL_TRUE : ll1_main wants to get prio. tick
+* t_hps - 60 (uint : second)
+*
+* RETURNS
+* kal_uint32 count;
+*****************************************************************************/
+kal_uint32 mll1_ul1_get_tick_count(kal_bool is_prio_search, kal_uint16 t_hps);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_ul1_get_timing_status
+* DESCRIPTION
+*
+* PARAMETERS
+* RETURNS
+* kal_bool - valid_timing KAL_TRUE : with valid timing
+* KAL_FALSE : with invalid timing
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+kal_bool mll1_ul1_get_timing_status(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_ul1_get_ul1_rf_margin
+* DESCRIPTION
+* UL1 gets RF margin in current state
+*
+* PARAMETERS
+* head - header_margin
+* tail - tail_margin
+* RETURNS
+* none
+*****************************************************************************/
+void mll1_ul1_get_ul1_rf_margin(kal_int32* head,kal_int32* tail);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_ul1_is_before_dest_time
+* DESCRIPTION
+* check if gap start time is before dest time,
+*
+* PARAMETERS
+* src - gap start time sfn
+* dest - expand start time sfn
+* RETURNS
+* kal_bool - KAL_TRUE : means that src is before dest time
+* : the src_time is before the dest_time. Return false if they are equal.
+* KAL_FALSE : means that dest is before src time
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+kal_bool mll1_ul1_is_before_dest_time(kal_int32 src,kal_int32 dest);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_ul1_offset_to_fmo_act_time
+* DESCRIPTION
+* calculate the timing offset between FMO activation time and expand start time.
+*
+* PARAMETERS
+* src - gap start time sfn
+* dest - expand start time sfn
+* RETURNS
+* kal_int32 - (-1) : FMO activation time fall in the duration of 480ms expand period.
+* other positive value: the offset between MO activation time and expand start time.
+*
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+kal_int32 mll1_ul1_offset_to_fmo_act_time(kal_int32 src, umts_fdd_time_struct* dest);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_ul1_is_lower_pwr_on
+* DESCRIPTION
+* Check if ul1 is low pwr on
+*
+* PARAMETERS
+*
+* RETURNS
+* kal_bool - KAL_FALSE : measurement is not finished and need gap in this period
+* KAL_TRUE : measurement is finished and doesnt need gap in this period
+*****************************************************************************/
+kal_bool mll1_ul1_is_lower_pwr_on(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_ul1_mode_status_update_ind
+* DESCRIPTION
+* This message is sent to UL1 for informing that mode status of active RAT when UL1 is standby RAT.
+* This message should be updated for UL1 in standby when any mode status changed in active RAT.
+*
+* PARAMETERS
+* status - mode status in active RAT
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_ul1_mode_status_update_ind(ll1_active_rat_mode_status_enum status);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_ul1_set_timing_status
+* DESCRIPTION
+*
+* PARAMETERS
+* flag - set valid_timing = flag
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_ul1_set_timing_status(kal_bool flag);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_ul1_sync_time_req
+* DESCRIPTION
+* When timing synchronization procedure is triggered, mll1 will decide which rat should do
+* timing synchronization based on the result of g_ll1_flight_rat|| g_ll1_standby_rat || g_ll1_active_rat.
+*
+* PARAMETERS
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_ul1_sync_time_req(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_ul1_time_add
+* DESCRIPTION
+* This function is used to add echips to time
+*
+* PARAMETERS
+* time - basic time
+* echips - echips
+* RETURNS
+* none
+*****************************************************************************/
+void mll1_ul1_time_add( umts_fdd_time_struct* time, kal_int32 echips);
+
+
+/*****************************************************************************
+* FUNCTION
+* mll1_ul1_update_current_time
+* DESCRIPTION
+* ll1 updates current time after timing sync. done
+*
+* PARAMETERS
+* umts_fdd_time - current time
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_ul1_update_current_time(umts_fdd_time_struct* fdd_time);
+
+/*****************************************************************************
+* CALL FUNCTION PROTOTYPE
+* mll1_umts_fdd_handler()
+*
+* DESCRIPTION
+* Function to handle the primitive from UL1.
+*
+* PARAMETERS
+* current_ilm - primitive from UL1.
+*
+* RETURN
+* None
+*****************************************************************************/
+void mll1_umts_fdd_handler(void *ptr_ilm);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_ul1_info_init
+* DESCRIPTION
+* Initialize ul1 internal global variable
+*
+* PARAMETERS
+* none
+* RETURNS
+* none
+*****************************************************************************/
+void mll1_fdd_info_init(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_ul1_gap_pattern_timing_checking
+* DESCRIPTION
+* check if the pending gap is out of date or not
+*
+* PARAMETERS
+* umts_fdd_time - ul1 timing correspond to some standby rat's timing indicated in measure request
+* RETURNS
+* TRUE - the pending gap has not been out of date
+* FALSE - the pending gap has been out of date
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+kal_bool mll1_ul1_gap_pattern_timing_checking(umts_fdd_time_struct umts_fdd_time);
+
+#endif /*_MLL1_UMTS_FDD_H*/
+
diff --git a/mcu/protocol/interface/general/mll1_umts_tdd.h b/mcu/protocol/interface/general/mll1_umts_tdd.h
new file mode 100644
index 0000000..83bd3a6
--- /dev/null
+++ b/mcu/protocol/interface/general/mll1_umts_tdd.h
@@ -0,0 +1,1209 @@
+#ifndef _MLL1_UMTS_TDD_H
+#define _MLL1_UMTS_TDD_H
+
+#include "kal_public_defs.h" /*for LOCAL_PARA_HDR*/
+#include "mll1_common.h"
+/*****************************************************************************
+* DEFINITIONS
+*****************************************************************************/
+#define MO_PURPOSE_NUM 12 /* Undefined */
+#define UMTS_TDD_SESSION_IN_PERIOD 8 /* align gsm, LTE only need 6 for gp0/gp1 */
+#define UMTS_TDD_SCHEDULE_DELAY 0 /* used to postpone available gap start time */
+/*****************************************************************************
+* ENUMERATIONS
+*****************************************************************************/
+/*****************************************************************************
+* ENUMERATION
+* tl1_ll1_rat_status_enum
+* DESCRIPTIONS
+* Used to identify the status in UMTS TDD RAT.
+* NOTE
+* any modification should sync. with ll1_rat_status_enum
+*****************************************************************************/
+typedef enum
+{
+ TL1_LL1_RAT_FLIGHT =0,
+ TL1_LL1_RAT_STANDBY,
+ TL1_LL1_RAT_ACTIVE,
+ TL1_LL1_RAT_NUM
+} tl1_ll1_rat_status_enum;
+
+/*****************************************************************************
+* STRUCTURES
+*****************************************************************************/
+/*****************************************************************************
+* STRUCT
+* umts_tdd_time_struct
+*
+* DESCRIPTIONS
+* UMTS TDD system timing base
+*
+* PARAMETERS
+* sub_sfn - UMTS TDD sub-system frame number (0~8191), 1 sub_sfn = 6400*8.
+* echips - UMTS TDD Echip (0~51199)
+*****************************************************************************/
+typedef struct
+{
+ kal_int32 sub_sfn;
+ kal_int32 echips;
+}umts_tdd_time_struct;
+
+/*****************************************************************************
+* STRUCT
+* umts_tdd_mo_allocation_struct
+*
+* DESCRIPTIONS
+* UMTS TDD measurement occasion allocation structure in subframe.
+*
+* PARAMETERS
+* period - Measurement occasion period
+* length - The measurement occasion length starting from the Offset
+* offset - The measurement occasion position in the measurement period.
+* slot_bmp - Bit 0 is for timeslot 0/DwPTS/GP (LL1 will not expand UpPTS for TA of slot 1).
+* Bit 1 is for timeslot 1/UpPTS.
+* Bit 2 is for timeslot 2 ¡K Bit 6 is for timeslot 6.
+* The value 1 of a bit means the corresponding timeslot is used for measurement.
+* Bit 0 is the first/right most bit of the bit string.
+* purpose_bmp - Measurement Purpose.
+* Bit 0 is for E-UTRA measurement.
+* Bit 1 is for Inter-frequency measurement.
+* Bit 2 is for BSIC re-confirmation.
+* Bit 3 is for Initial BSIC identification.
+* Bit 4 is for GSM carrier RSSI measurement.
+* Bit 5 is for Drop frame for EL1-Meas.
+* Bit 6 is for Reserved for FB/SB search
+* Bit 7 is for ISCP.
+* Bit 8 is for FMO.
+* Bit 9 is for DL.
+* Bit 10 is for UL.
+* The value 1 of a bit means that the measurement occasion pattern sequence is applicable for the corresponding type of measurement.
+* Bit 0 is the first/rightmost bit of the bit string.
+* Only one bit will be set to 1, the others are set to zero.
+*****************************************************************************/
+typedef struct
+{
+ kal_uint16 period;
+ kal_uint16 length;
+ kal_uint16 offset;
+ kal_uint8 slot_bmp;
+ kal_uint32 purpose_bmp;
+}umts_tdd_mo_allocation_struct;
+
+/*****************************************************************************
+* STRUCT
+* umts_tdd_idle_gap_struct
+*
+* DESCRIPTIONS
+* Idle gap structure of UMTS TDD.
+*
+* PARAMETERS
+* start_time - start time of the gap
+* length - length of the gap session (in echip)
+* is_drx_tick - KAL_TRUE : First tick in this DRX period
+* KAL_FALSE: Not the first free interval in this DRX period
+*****************************************************************************/
+typedef struct
+{
+ umts_tdd_time_struct start_time;
+ kal_int32 length;
+ kal_bool is_drx_tick;
+}umts_tdd_idle_gap_struct;
+
+/*****************************************************************************
+* STRUCT
+* umts_tdd_connected_gap_struct
+*
+* DESCRIPTIONS
+* UMTS TDD gap structure in CELL_FACH/CELL_DCH.
+*
+* PARAMETERS
+* mo_num - The number of mo pattern
+* measure_occasion[] - One measure_occasion[] stands for one measurement occasion.
+* purpose_bmp in umts_tdd_mo_allocation_struct may set more than one bit to 1 due to DMO configuration.
+* MO_PURPOSE_NUM = total number of measurement purposes = 12.
+* last_tx_slot - The last TX slot UE used before the second switch point in one sub-frame.
+* doff - to align CFN in sub-frame,
+* only used when umts_tdd_mo_allocation_struct.purpose_bmp
+* Bit 9 or 10 is set to 1.
+* Bit 9 is for DL.
+* Bit 10 is for UL.
+*****************************************************************************/
+typedef struct
+{
+ kal_uint16 mo_num;
+ umts_tdd_mo_allocation_struct measure_occasion[MO_PURPOSE_NUM];
+ kal_uint8 last_tx_slot;
+ kal_uint8 doff;
+}umts_tdd_connected_gap_struct;
+
+/*****************************************************************************
+* STRUCT
+* ll1_umts_tdd_standby_gap_struct
+*
+* DESCRIPTIONS
+* UMTS TDD standby gap pattern structure.
+*
+* PARAMETERS
+* start_time - start time of the gap session
+* length - length of the gap session (in echip)
+*****************************************************************************/
+typedef struct
+{
+ umts_tdd_time_struct start_time;
+ kal_int32 length;
+}ll1_umts_tdd_standby_gap_struct;
+
+/*****************************************************************************
+* STRUCT
+* ll1_tl1_expand_gap_pattern_struct
+*
+* DESCRIPTIONS
+* LL1 expands gap pattern for TL1
+*
+* PARAMETERS
+* session_num - Indicate how many gap session
+* session[] - Standby gap session.
+* measure_tid - Transition id for RANK tick./Valid when active RAT is in DRX mode./And bit 0 in tick_bitmap is "1"
+* hps_tid - Transition id for HPS tick./Valid when active RAT is in DRX mode./And bit 1 in tick_bitmap is "1"
+* tick_bitmap - Bit 0 : Rank search , Bit 1 : Priority search when active rat in idle mode,
+* Bit 0 : is_first gap in Nfreq*expansion_period when active rat in connect mode.
+*****************************************************************************/
+typedef struct
+{
+ kal_uint8 session_num;
+ ll1_umts_tdd_standby_gap_struct session[UMTS_TDD_SESSION_IN_PERIOD];
+ kal_uint8 measure_tid;
+ kal_uint8 hps_tid;
+ kal_uint8 tick_bitmap;
+}ll1_tl1_expand_gap_pattern_struct;
+
+/*****************************************************************************
+* STRUCT
+* tl1_ll1_sync_cnf_struct
+*
+* DESCRIPTIONS
+* TL1 uses this primitive to confirm LL1 that current UMTS TDD timing
+* and micro second counter value.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* current_time - sync. time in umts_tdd_time_struct
+* umts_tdd_ustime - sync. time in USC
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ umts_tdd_time_struct current_time;
+ kal_uint32 umts_tdd_ustime;
+}tl1_ll1_sync_cnf_struct;
+
+/*****************************************************************************
+* STRUCT
+* tl1_ll1_rat_status_ind_struct
+*
+* DESCRIPTIONS
+* This message is sent from TL1 to LL1 for informing current TL1 RAT status.
+* This message should be sent when TL1 RAT status changed.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* rat_status - RAT status in TL1
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ tl1_ll1_rat_status_enum rat_status;
+}tl1_ll1_rat_status_ind_struct;
+
+/*****************************************************************************
+* STRUCT
+* tl1_ll1_mode_status_ind_struct
+*
+* DESCRIPTIONS
+* This message is sent from TL1 to LL1 for informing that TL1 mode status when TL1 is active RAT.
+* This message should be sent when TL1 mode status changed.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* tdd_mode_status - current mode in TL1 when UMTS TDD is active RAT
+* drx_cycle_length - valid when gsm_mode_status = TL1_LL1_PCH_MODE
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ ll1_active_rat_mode_status_enum tdd_mode_status;
+ kal_uint16 drx_cycle_length;
+}tl1_ll1_mode_status_ind_struct;
+
+/*****************************************************************************
+* STRUCT
+* ll1_tl1_mode_status_update_ind_struct
+*
+* DESCRIPTIONS
+* This message is sent to TL1 for informing that mode status of active RAT when TL1 is standby RAT.
+* This message should be updated for TL1 in standby when any mode status changed in active RAT.
+* Also when TL1 enters into standby RAT from FLIGHT, LL1 will update current mode state in active RAT to TL1.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* active_rat_mode_status - current mode status in active RAT
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ ll1_active_rat_mode_status_enum active_rat_mode_status;
+}ll1_tl1_mode_status_update_ind_struct;
+
+/*****************************************************************************
+* STRUCT
+* tl1_ll1_active_measure_status_ind_struct
+*
+* DESCRIPTIONS
+* TL1 informs LL1 that how many higher priority inter-frequencies in TL1 when high priority search is turned on
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* freq_num - The number of higher priority inter-freq. in TL1.(0~3)
+* When HPS off, the freq_num is equal to zero.
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 freq_num;
+}tl1_ll1_active_measure_status_ind_struct;
+
+
+/*****************************************************************************
+* STRUCT
+* tl1_ll1_measure_req_struct
+*
+* DESCRIPTIONS
+* This message is sent from TL1 to inform LL1 that how many UMTS TDD frequencies are required to be measured and the measurement purposes in UMTS TDD Standby.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* meas_purpose_bitmap - bit 0 for measurement, bit 1 for cell search
+* tid - tid for lastest meas_req on (should only change when off)
+* tick_bitmap - bit 0 for ranking search, bit 1 for priority search
+* freq_num - high priority freqencies when HPS ON, measurement frequencies when HPS OFF
+* t_hps - basic period of high priority search (25s,60s,70s)
+* is_period_reset_bmp - bit 0 for rank period, 1 means to reset
+* - bit 1 for prio period, 0 means not to reset
+* - when freq. num is same as before, ll1 will check this flag to reset period or not
+* current_time - current in TL1
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 meas_purpose_bitmap;
+ kal_uint8 tid;
+ kal_uint8 tick_bitmap;
+ kal_uint8 freq_num;
+ kal_uint16 t_hps;
+ kal_int32 is_period_reset_bmp;
+ umts_tdd_time_struct current_time;
+}tl1_ll1_measure_req_struct;
+
+/*****************************************************************************
+* STRUCT
+* tl1_ll1_standby_measure_done_ind_struct
+*
+* DESCRIPTIONS
+* For low power optimization, TL1 informs LL1 which measurement purpose is
+* measured done in its period. If all measurement purposes are measured done,
+* LL1 will not tick TL1 anymore in shortest measurement period.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* tid - For LL1 to know this tid is mapped to which gap pattern period sent before
+* tick_bitmap - bit 0 for ranking search, bit 1 for priority search. Only one bit will be set in one message.
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 tid;
+ kal_uint8 tick_bitmap;
+}tl1_ll1_standby_measure_done_ind_struct;
+
+/*****************************************************************************
+* STRUCT
+* ll1_tl1_gap_service_req_struct
+*
+* DESCRIPTIONS
+* LL1 uses this primitive to enable (disable) active RAT gap service to get (release)
+* the free radio frequency period in UMTS TDD.When LL1 disables active RAT gap service,
+* it means that UMTS TDD could use all RF time already.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* enable - KAL_TRUE : request gap service
+* KAL_FALSE : stop gap service
+* service_type_bmp - Bit 0 for FB/SB search in GSM
+* Bit 1 for LTE meas.
+* The value 1 of a bit means that TL1 should provide suitable gap pattern for the corresponding type of measurement.
+* Bit 0 is the first/rightmost bit of the bit string.
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool enable;
+ kal_uint8 service_type_bmp;
+}ll1_tl1_gap_service_req_struct;
+
+
+/*****************************************************************************
+* STRUCT
+* tl1_ll1_gap_stop_cnf_struct
+*
+* DESCRIPTIONS
+* TL1 uses this primitive to confirm LL1_TL1_GAP_STOP_REQ when there is no gap usage in UMTS_TDD..
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* current_time - current time in TL1
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ umts_tdd_time_struct current_time;
+}tl1_ll1_gap_stop_cnf_struct;
+
+/*****************************************************************************
+* STRUCT
+* tl1_ll1_auto_gap_req_struct
+*
+* DESCRIPTIONS
+* TL1 sends this message to request LL1 that TL1 wants to use the auto gap from (sub_sfn, echips).
+* TL1 could use this auto gap after getting the successful confirm
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* auto_time - Start time of auto gap in TL1
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ umts_tdd_time_struct auto_time;
+}tl1_ll1_auto_gap_req_struct;
+
+/*****************************************************************************
+* STRUCT
+* ll1_tl1_auto_gap_cnf_struct
+*
+* DESCRIPTIONS
+* LL1 sends this message to confirm TL1 auto gap request.
+* After receiving this message, TL1 could use required auto gap.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* success - KAL_TRUE : TL1 could use auto gap to search
+* KAL_FALSE: TL1 could not use auto gap to search.
+* And TL1 should not request auto gap until AUTO_GAP_AVAILABLE_IND
+* valid_period - The length of autonomous gap allowed by active RAT
+* The value is valid when success = KAL_TRUE
+* Unit : echip
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool success;
+ kal_int32 valid_period;
+}ll1_tl1_auto_gap_cnf_struct;
+
+/*****************************************************************************
+* STRUCT
+* ll1_tl1_auto_gap_ind_struct
+*
+* DESCRIPTIONS
+* LL1 sends this message to inform TL1 stopping using RF in this auto gap from (sub_sfn, echips).
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* auto_time - Start time of auto gap
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ umts_tdd_time_struct auto_time;
+}ll1_tl1_auto_gap_ind_struct;
+
+/*****************************************************************************
+* STRUCT
+* tl1_ll1_auto_gap_res_struct
+*
+* DESCRIPTIONS
+* TL1 sends this message to response LL1 that TL1 will/won't use RF from
+* the start timing of auto gap which is informed by LL1_TL1_AUTO_GAP_IND.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* success - KAL_TRUE : TL1 will not use RF from the starting time of LL1_TL1_AUTONOMOIS_GAP_IND
+* KAL_FALSE: TL1 may use RF after starting time of LL1_TL1_AUTONOMOIS_GAP_IND.
+* valid_period - The length of autonomous gap allowed in TL1
+* The value is valid when TL1 is active rat and success = KAL_TRUE
+* Unit : echip
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool success;
+ kal_int32 valid_period;
+}tl1_ll1_auto_gap_res_struct;
+
+/*****************************************************************************
+* STRUCT
+* ll1_tl1_gap_notify_ind_struct
+*
+* DESCRIPTIONS
+* LL1 sends this message to inform TL1 that the starting time and length of gap pattern when TL1 is standby RAT.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+* standby_gap - standby gap pattern
+* tid - tid for lastest meas_req on
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ ll1_tl1_expand_gap_pattern_struct standby_gap;
+ kal_uint8 tid; /* Tid for lastest meas_req on, LL1 will expand gap notify ind with this tid*/
+}ll1_tl1_gap_notify_ind_struct;
+
+/*****************************************************************************
+* STRUCT
+* tl1_ll1_gap_pattern_ind_struct
+*
+* DESCRIPTIONS
+* TL1 sends this message to inform LL1 that the free RF period in TL1 as gap pattern.
+* PARAMETERS
+* LOCAL_PARA_HDR
+* tl1_current_time - TL1 current time
+* idle_gap - No matter the length is bigger than zero or not,
+* TL1 should send this message and sets is_drx_tick = KAL_TRUE in one DRX period once.
+* dch_gap - Gap pattern provided by TL1 in CELL_FACH/CELL_DCH
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ umts_tdd_time_struct tl1_current_time;
+ umts_tdd_idle_gap_struct idle_gap;
+ umts_tdd_connected_gap_struct connect_gap;
+}tl1_ll1_gap_pattern_ind_struct;
+
+/*****************************************************************************
+* STRUCT
+* ll1_tl1_sync_req_struct
+* tl1_ll1_gap_stop_req_struct
+* ll1_tl1_gap_stop_cnf_struct
+* ll1_tl1_gap_stop_req_struct
+* tl1_ll1_gap_suspend_req_struct
+* ll1_tl1_gap_suspend_cnf_struct
+* ll1_tl1_gap_suspend_req_struct
+* tl1_ll1_gap_suspend_cnf_struct
+* tl1_ll1_gap_resume_ind_struct
+* ll1_tl1_gap_resume_ind_struct
+* tl1_ll1_auto_gap_stop_req_struct
+* ll1_tl1_auto_gap_stop_ind_struct
+* tl1_ll1_auto_gap_stop_res_struct
+* ll1_tl1_auto_gap_stop_cnf_struct
+* tl1_ll1_auto_gap_end_ind_struct
+* ll1_tl1_auto_gap_end_ind_struct
+* tl1_ll1_auto_gap_available_ind_struct
+* ll1_tl1_auto_gap_available_ind_struct
+*
+* DESCRIPTIONS
+* ll1_tl1_sync_req_struct
+* LL1 will use this primitive to get TL1 current UMTS timing and micro
+* second counter value in both TL1 in active and standby mode.
+*
+* tl1_ll1_gap_stop_req_struct
+* TL1 uses this primitive to inform LL1 to stop all gap usage in standby
+* RAT when GERAN GSM wants to change configuration or other purposes.
+*
+* ll1_tl1_gap_stop_cnf_struct
+* LL1 uses this primitive to confirm TL1 that LL1 has already stopped
+* all gap usages in standby RAT and TL1 could use all RF time.
+*
+* ll1_tl1_gap_stop_req_struct
+* LL1 uses this primitive to stop gap usage in UMTS TDD when UMTS TDD is standby RAT.
+*
+* tl1_ll1_gap_suspend_req_struct
+* TL1 uses this primitive to temporal suspend gap usage in standby RAT for higher priority
+* task and doesn't need to give new gap configuration in connection mode when resumed.
+*
+* ll1_tl1_gap_suspend_cnf_struct
+* LL1 sends this confirm message to TL1 after all standby RAT gap usage are suspended.
+*
+* ll1_tl1_gap_suspend_req_struct
+* LL1 sends this message to TL1 to request that TL1 suspends RF usage immediately.
+*
+* tl1_ll1_gap_suspend_cnf_struct
+* TL1 sends this message to confirm LL1 that TL1 will not use gap from
+* now to receiving resume indicator
+*
+* tl1_ll1_gap_resume_ind_struct
+* TL1 sends this message to inform LL1 that TL1 has already finished
+* higher priority task, and standby RAT could use gap normally.
+*
+* ll1_tl1_gap_resume_ind_struct
+* LL1 sends this message to TL1 to resume TL1's gap usage.
+* After receiving this message, TL1 could use gap pattern normally.
+*
+* tl1_ll1_auto_gap_stop_req_struct
+* TL1 sends this message to request LL1 that TL1 wants to
+* retrieve autonomous gap for higher priority task.
+*
+* ll1_tl1_auto_gap_stop_ind_struct
+* LL1 sends this message to inform TL1 of stopping using RF
+* during autonomous gap period.
+*
+* tl1_ll1_auto_gap_stop_res_struct
+* TL1 sends this message to response LL1 that TL1 stops
+* autonomous gap usage.
+*
+* ll1_tl1_auto_gap_stop_cnf_struct
+* LL1 sends this message to confirm that TL1 could use RF now.
+*
+* tl1_ll1_auto_gap_end_ind_struct
+* TL1 sends this message to inform LL1 that autonomous gap usage is finished.
+*
+* ll1_tl1_auto_gap_end_ind_struct
+* LL1 sends this message to inform TL1 that autonomous gap usage is finished.
+*
+* tl1_ll1_auto_gap_available_ind_struct
+* TL1 sends this message to inform LL1 that autonomous gap is available now. Standby RAT
+* could request autonomous gap now. Standby RAT could request autonomous gap now
+*
+* ll1_tl1_auto_gap_available_ind_struct
+* LL1 sends this message to inform TL1 that autonomous gap
+* is available now. TL1 could request autonomous gap now.
+*
+* tl1_ll1_auto_gap_unavailable_ind_struct
+* TL1 sends this message to inform LL1 that auto gap is unavailable now.
+* Standby RAT could not request auto gap now.
+*
+* ll1_tl1_auto_gap_unavailable_ind_struct
+* LL1 sends this message to inform TL1 that auto gap is unavailable now.
+* TL1 could not request auto gap now.
+*
+* PARAMETERS
+* LOCAL_PARA_HDR
+*****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+}ll1_tl1_sync_req_struct,
+ tl1_ll1_gap_stop_req_struct,
+ ll1_tl1_gap_stop_cnf_struct,
+ ll1_tl1_gap_stop_req_struct,
+ tl1_ll1_gap_suspend_req_struct,
+ ll1_tl1_gap_suspend_cnf_struct,
+ ll1_tl1_gap_suspend_req_struct,
+ tl1_ll1_gap_suspend_cnf_struct,
+ tl1_ll1_gap_resume_ind_struct,
+ ll1_tl1_gap_resume_ind_struct,
+ tl1_ll1_auto_gap_stop_req_struct,
+ ll1_tl1_auto_gap_stop_ind_struct,
+ tl1_ll1_auto_gap_stop_res_struct,
+ ll1_tl1_auto_gap_stop_cnf_struct,
+ tl1_ll1_auto_gap_end_ind_struct,
+ ll1_tl1_auto_gap_end_ind_struct,
+ tl1_ll1_auto_gap_available_ind_struct,
+ ll1_tl1_auto_gap_available_ind_struct,
+ tl1_ll1_auto_gap_unavailable_ind_struct,
+ ll1_tl1_auto_gap_unavailable_ind_struct;
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif /*__POP_FSM__*/
+/*****************************************************************************
+* STRUCT
+* mll1_tl1_info_database_struct
+*
+* DESCRIPTIONS
+* TL1 information structure.
+*
+* PARAMETERS
+*
+*****************************************************************************/
+typedef struct
+{ /* measure req*/
+ kal_uint8 tick_bmp; /* use to record tick bitmap*/
+ kal_uint8 rank_tick_tid; /* tid for rank tick*/
+ kal_uint8 prio_tick_tid; /* tid for prio tick*/
+ kal_uint8 meas_done_bmp; /* measurement done ind bitmap*/
+ kal_bool is_meas_done_useful; /* umts tdd uses meas_done or not by checking meas_purpose_bmp*/
+ kal_uint8 meas_purpose_bitmap; /* record the measure purpose bitmap*/
+ umts_tdd_time_struct current_time; /* umts tdd current time when request gap service*/
+ /* Paging period in active RAT */
+ kal_int32 drx_cycle; /* 80,160,320,640,1280,2560,5120 Unit : ms*/
+ /* auto gap para*/
+ umts_tdd_time_struct auto_time; /* auto gap time*/
+ /* Mode status*/
+ ll1_active_rat_mode_status_enum mode_status; /* mode status*/
+ /* GAP pattern*/
+ tl1_ll1_gap_pattern_ind_struct gap_pattern; /* Gap pattern */
+ /* Gap request from standby rat should do sync in connection*/
+ kal_bool valid_timing; /* KAL_TRUE : with valid timing*/
+ /* KAL_FALSE : with invalid timing*/
+ kal_uint16 dmo_lte_len; /* length of dmo for lte*/
+ kal_uint16 dmo_lte_period; /* period of dmo for lte*/
+ kal_uint8 meas_req_tid; /* Tid for lastest meas_req on, LL1 will expand gap notify ind with this tid*/
+}mll1_tl1_info_database_struct;
+
+/*****************************************************************************
+* GLOBAL FUNCTIONS
+*****************************************************************************/
+
+
+/*****************************************************************************
+* FUNCTION
+* mll1_tick_tl1_gap_expansion
+* DESCRIPTION
+* tick tl1 to expand gap when sync done
+*
+* PARAMETERS
+* none
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_tick_tl1_gap_expansion(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_tl1_auto_gap_available_ind
+* DESCRIPTION
+* ll1 sends auto gap available ind to UMTS TDD now
+*
+* PARAMETERS
+* kal_bool available
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_tl1_auto_gap_available_ind(kal_bool available);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_tl1_auto_gap_cnf
+* DESCRIPTION
+* ll1 sends auto gap cnf to UMTS_TDD now
+*
+* PARAMETERS
+* success - success or not
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_tl1_auto_gap_cnf(kal_bool success,kal_int32 valid_period);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_tl1_auto_gap_end_ind
+* DESCRIPTION
+* ll1 sends auto gap end ind to UMTS TDD now
+*
+* PARAMETERS
+* none
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_tl1_auto_gap_end_ind(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_tl1_auto_gap_ind
+* DESCRIPTION
+* ll1 sends auto gap end ind to UMTS TDD now
+*
+* PARAMETERS
+* tdd_time - auto time
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_tl1_auto_gap_ind(umts_tdd_time_struct tdd_time);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_tl1_auto_gap_stop_cnf
+* DESCRIPTION
+* ll1 sends auto gap stop cnf to UMTS_TDD now
+*
+* PARAMETERS
+* None
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_tl1_auto_gap_stop_cnf(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_tl1_auto_gap_stop_ind
+* DESCRIPTION
+* ll1 sends auto gap stop ind to UMTS_TDD now
+*
+* PARAMETERS
+* None
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_tl1_auto_gap_stop_ind(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_tl1_auto_time_minus
+* DESCRIPTION
+* Add more rf margin for any standby rat which will enter sleep during autonomous serch procedure
+* Assume margin is smaller than one sub_sfn
+* PARAMETERS
+* umts_tdd_time_struct*
+* kal_int32 - more RF margin (recovery from sleep).
+* RETURNS
+* void
+*****************************************************************************/
+void mll1_tl1_auto_time_minus(umts_tdd_time_struct* time, kal_int32 echip);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_tl1_expand_gap_pattern_ind
+* DESCRIPTION
+* ll1 sends auto gap available ind to UMTS TDD now
+*
+* PARAMETERS
+* standby_gap - gap pattern for umts tdd
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_tl1_expand_gap_pattern_ind(ll1_tl1_expand_gap_pattern_struct* standby_gap);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_tl1_gap_resume_ind
+* DESCRIPTION
+* LL1 sends this message to TL1 to resume TL1's gap usage.
+* After receiving this message, TL1 could use gap pattern normally.
+*
+* PARAMETERS
+* none
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_tl1_gap_resume_ind(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_tl1_gap_service_req
+* DESCRIPTION
+* ll1 sends gap service req to UMTS_TDD now
+*
+* PARAMETERS
+* enable - KAL_TRUE : turn on gap service
+* - KAL_FALSE : turn off gap service
+* service_type_bmp - Bit 0 for FB/SB search in GSM
+* Bit 1 for LTE meas.
+* The value 1 of a bit means that TL1 should provide suitable gap pattern for the corresponding type of measurement.
+* Bit 0 is the first/rightmost bit of the bit string.
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_tl1_gap_service_req(kal_bool enable, kal_uint8 service_type_bmp);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_tl1_gap_stop_cnf
+* DESCRIPTION
+* LL1 uses this primitive to confirm TL1 that LL1 has already stopped
+* all gap usages in standby RAT and TL1 could use all RF time.
+*
+* PARAMETERS
+* NONE
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_tl1_gap_stop_cnf(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_tl1_gap_stop_req
+* DESCRIPTION
+* LL1 uses this primitive to stop gap usage in UMTS TDD when UMTS TDD is standby RAT.
+*
+* PARAMETERS
+* NONE
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_tl1_gap_stop_req(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_tl1_gap_suspend_cnf
+* DESCRIPTION
+* LL1 sends this confirm message to TL1 after gap usage in standby RAT is suspended.
+* TL1 could use RF only after getting this message.
+*
+* PARAMETERS
+* NONE
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_tl1_gap_suspend_cnf(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_tl1_gap_suspend_req
+* DESCRIPTION
+* LL1 uses this primitive to suspend gap usage in UMTS TDD when UMTS TDD is standby RAT.
+*
+* PARAMETERS
+* NONE
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_tl1_gap_suspend_req(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_tl1_get_auto_time
+* DESCRIPTION
+* return auto time from TL1
+*
+* PARAMETERS
+* None
+* RETURNS
+* umts_tdd_time_struct auto_time
+*****************************************************************************/
+umts_tdd_time_struct mll1_tl1_get_auto_time(void);
+
+
+/*****************************************************************************
+* FUNCTION
+* mll1_tl1_get_current_time
+* DESCRIPTION
+* ll1 gets current time + ahead margin to expand gap
+*
+* PARAMETERS
+* umts_tdd_time - start time of expansion period
+* kal_bool is_ahead_time
+* TRUE : advance eutran_time with the predefined ahead_time
+* FALSE: don't advance eutran_time with the predefined ahead_time
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_tl1_get_current_time(umts_tdd_time_struct* tdd_time, kal_bool is_ahead_time);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_tl1_get_dmo_para
+* DESCRIPTION
+* return length , period of dmo for lte from TL1
+*
+* PARAMETERS
+* *length
+* *period
+* RETURNS
+* none
+*****************************************************************************/
+void mll1_tl1_get_dmo_para(kal_uint16* length,kal_uint16* period);
+
+#ifdef __LTE_RAT__
+/*****************************************************************************
+* FUNCTION
+* mll1_tl1_get_el1_rf_margin
+* DESCRIPTION
+* TL1 gets EL1 RF margin in current state
+*
+* PARAMETERS
+* head - header_margin
+* tail - tail_margin
+* RETURNS
+* none
+*****************************************************************************/
+void mll1_tl1_get_el1_rf_margin(kal_int32* head,kal_int32* tail);
+#endif /*__LTE_RAT__*/
+
+#ifdef __GSM_RAT__
+/*****************************************************************************
+* FUNCTION
+* mll1_tl1_get_gl1_rf_margin
+* DESCRIPTION
+* TL1 gets GL1 RF margin in current state
+*
+* PARAMETERS
+* head - header_margin
+* tail - tail_margin
+* st_slot - gap start slot in DCH
+* len - gap len in DCH
+* RETURNS
+* none
+*****************************************************************************/
+void mll1_tl1_get_gl1_rf_margin(kal_int32* head,kal_int32* tail, kal_int32 st_slot, kal_int32 len);
+#endif /*__GSM_RAT__*/
+
+/*****************************************************************************
+* FUNCTION
+* mll1_tl1_get_mode_status
+* DESCRIPTION
+* return mode status from TL1
+*
+* PARAMETERS
+* None
+* RETURNS
+* ll1_active_rat_mode_status_enum mode_status
+*****************************************************************************/
+ll1_active_rat_mode_status_enum mll1_tl1_get_mode_status(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_tl1_get_tick_count
+* DESCRIPTION
+* TL1 tick number
+*
+* PARAMETERS
+* is_prio_search - KAL_FALSE : ll1_main wants to get meas. tick
+* KAL_TRUE : ll1_main wants to get prio. tick
+* t_hps - 60 (uint : second)
+*
+* RETURNS
+* kal_uint32 count;
+*****************************************************************************/
+kal_uint32 mll1_tl1_get_tick_count(kal_bool is_prio_search, kal_uint16 t_hps);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_tl1_get_timing_status
+* DESCRIPTION
+*
+* PARAMETERS
+* RETURNS
+* kal_bool - valid_timing KAL_TRUE : with valid timing
+* KAL_FALSE : with invalid timing
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+kal_bool mll1_tl1_get_timing_status(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_tl1_get_tl1_rf_margin
+* DESCRIPTION
+* TL1 gets RF margin in current state
+*
+* PARAMETERS
+* head - header_margin
+* tail - tail_margin
+* RETURNS
+* none
+*****************************************************************************/
+void mll1_tl1_get_tl1_rf_margin(kal_int32* head,kal_int32* tail);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_tl1_is_lower_pwr_on
+* DESCRIPTION
+* Check if tl1 is low pwr on
+*
+* PARAMETERS
+*
+* RETURNS
+* kal_bool - KAL_FALSE : measurement is not finished and need gap in this period
+* KAL_TRUE : measurement is finished and doesnt need gap in this period
+*****************************************************************************/
+kal_bool mll1_tl1_is_lower_pwr_on(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_tl1_mode_status_update_ind
+* DESCRIPTION
+* This message is sent to TL1 for informing that mode status of active RAT when TL1 is standby RAT.
+* This message should be updated for TL1 in standby when any mode status changed in active RAT.
+*
+* PARAMETERS
+* status - mode status in active RAT
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_tl1_mode_status_update_ind(ll1_active_rat_mode_status_enum status);
+
+
+/*****************************************************************************
+* FUNCTION
+* mll1_tl1_set_purpose_for_expansion_period
+* DESCRIPTION
+*
+* PARAMETERS
+* kal_uint32** m - two dimension array of gap purposes
+* kal_int32 st_subsfn - starting time of expansion period
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_tl1_set_purpose_for_expansion_period(kal_uint32** m, kal_int32 st_subsfn);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_tl1_set_timing_status
+* DESCRIPTION
+*
+* PARAMETERS
+* flag - set valid_timing = flag
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_tl1_set_timing_status(kal_bool flag);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_tl1_sync_time_req
+* DESCRIPTION
+* When timing synchronization procedure is triggered, mll1 will decide which rat should do
+* timing synchronization based on the result of g_ll1_flight_rat|| g_ll1_standby_rat || g_ll1_active_rat.
+*
+* PARAMETERS
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_tl1_sync_time_req(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_tl1_time_add
+* DESCRIPTION
+* This function is used to add echips to time
+*
+* PARAMETERS
+* time - basic time
+* echips - echips
+* RETURNS
+* none
+*****************************************************************************/
+void mll1_tl1_time_add( umts_tdd_time_struct* time, kal_int32 echips);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_tl1_update_current_time
+* DESCRIPTION
+* ll1 updates current time after timing sync. done
+*
+* PARAMETERS
+* umts_tdd_time - current time
+* RETURNS
+* none
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+void mll1_tl1_update_current_time(umts_tdd_time_struct* tdd_time);
+
+/*****************************************************************************
+* CALL FUNCTION PROTOTYPE
+* mll1_umts_tdd_handler()
+*
+* DESCRIPTION
+* Function to handle the primitive from TL1.
+*
+* PARAMETERS
+* current_ilm - primitive from TL1.
+*
+* RETURN
+* None
+*****************************************************************************/
+void mll1_umts_tdd_handler(void *ptr_ilm);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_tl1_info_init
+* DESCRIPTION
+* Initialize tl1 internal global variable
+*
+* PARAMETERS
+* none
+* RETURNS
+* none
+*****************************************************************************/
+void mll1_tdd_info_init(void);
+
+/*****************************************************************************
+* FUNCTION
+* mll1_tl1_gap_pattern_timing_checking
+* DESCRIPTION
+* check if the pending gap is out of date or not
+*
+* PARAMETERS
+* umts_tdd_time - tl1 timing correspond to some standby rat's timing indicated in measure request
+* RETURNS
+* TRUE - the pending gap has not been out of date
+* FALSE - the pending gap has been out of date
+* GLOBALS AFFECTED
+* none
+*****************************************************************************/
+kal_bool mll1_tl1_gap_pattern_timing_checking(umts_tdd_time_struct umts_tdd_time);
+
+#endif /*_MLL1_UMTS_TDD_H*/
diff --git a/mcu/protocol/interface/general/mm2cm_struct.h b/mcu/protocol/interface/general/mm2cm_struct.h
new file mode 100644
index 0000000..b279699
--- /dev/null
+++ b/mcu/protocol/interface/general/mm2cm_struct.h
@@ -0,0 +1,244 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * mm2cm_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file is intends for structure definition between MM and Cm layers.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *==============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+
+#ifndef _MM2CM_STRUCT_H
+#define _MM2CM_STRUCT_H
+
+#include "kal_general_types.h"
+#include "mcd_l3_inc_struct.h"
+#include "l3_inc_enums.h"
+#include "kal_public_defs.h"
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 ti;
+} mmcm_est_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 ti;
+} mmcm_est_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 ti;
+} mmcm_data_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ ps_cause_enum cause;
+} mmcm_rel_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ ps_cause_enum cause;
+ kal_bool remain_ecc; /* 1: emergency call is kept */
+} mmcc_rel_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_successful;
+} mmcc_srvcc_ho_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 ti;
+} mmcm_est_intr_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 ti;
+ ps_cause_enum cause;
+} mmcm_est_rej_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ sync_ind_cause_enum cause;
+ channel_type_enum channel_type;
+ channel_mode_enum channel_mode;
+} mmcm_sync_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ rat_enum rat; /* RATCM_RAT_ENUM */
+} mmcm_rat_ind_struct;
+
+typedef struct {
+ // When 4G23 irat_type==IR_TYPE_SEARCH, SM need to queue ESM transferred context until receiving MSG_ID_GMMSM_RAT_IND.
+ // SM only need to process this message when __LTE_RAT__ is on because this message is only used when 4G23 IR_TYPE_SEARCH interRAT
+ // in 2G single mode project or 23G dual mode project, SM will drop this message
+ LOCAL_PARA_HDR
+ rat_enum rat; /* RATCM_RAT_ENUM */
+ kal_bool is_suitable_cell;
+ kal_bool is_in_no_service;
+} gmmsm_rat_ind_struct;
+
+
+typedef struct {
+ LOCAL_PARA_HDR
+ plmn_id_struct plmn_id;
+} mmcm_plmn_info_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+} mmcm_dummy_local_para_struct;
+
+typedef mmcm_est_ind_struct mmcc_est_ind_struct;
+typedef mmcm_est_cnf_struct mmcc_est_cnf_struct;
+typedef mmcm_data_ind_struct mmcc_data_ind_struct;
+typedef mmcm_est_intr_struct mmcc_est_intr_struct;
+typedef mmcm_est_rej_struct mmcc_est_rej_struct;
+typedef mmcm_sync_ind_struct mmcc_sync_ind_struct;
+
+typedef mmcm_rat_ind_struct mmcc_rat_ind_struct;
+
+typedef mmcm_plmn_info_ind_struct mmcc_plmn_info_ind_struct;
+
+typedef mmcm_est_ind_struct mmss_est_ind_struct;
+typedef mmcm_est_cnf_struct mmss_est_cnf_struct;
+typedef mmcm_data_ind_struct mmss_data_ind_struct;
+typedef mmcm_rel_ind_struct mmss_rel_ind_struct;
+typedef mmcm_est_intr_struct mmss_est_intr_struct;
+typedef mmcm_est_rej_struct mmss_est_rej_struct;
+typedef mmcm_rat_ind_struct mmss_rat_ind_struct;
+
+
+typedef mmcm_est_ind_struct mmsms_est_ind_struct;
+typedef mmcm_est_cnf_struct mmsms_est_cnf_struct;
+typedef mmcm_data_ind_struct mmsms_data_ind_struct;
+typedef mmcm_rel_ind_struct mmsms_rel_ind_struct;
+typedef mmcm_est_intr_struct mmsms_est_intr_struct;
+typedef mmcm_est_rej_struct mmsms_est_rej_struct;
+typedef mmcm_rat_ind_struct mmsms_rat_ind_struct;
+
+#endif
+
+
diff --git a/mcu/protocol/interface/general/mm2llc_struct.h b/mcu/protocol/interface/general/mm2llc_struct.h
new file mode 100644
index 0000000..2de5019
--- /dev/null
+++ b/mcu/protocol/interface/general/mm2llc_struct.h
@@ -0,0 +1,135 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * mm2llc_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file describes the common structure of MM and LLC.
+ *
+ * Author:
+ * -------
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _MM2LLC_STRUCT_H
+#define _MM2LLC_STRUCT_H
+
+#include "kal_general_types.h"
+#include "kal_public_defs.h"
+#include "security_keys_struct.h"
+#include "l3llc_enums.h"
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint32 old_tlli; /* xyz*/
+ kal_uint32 new_tlli; /* xyz*/
+ tlli_update_type_enum tlli_update_type; /* xyz*/
+ kal_uint8 cipher_algo; /* xyz*/
+ key_struct cipher_key; /* Cipher Key*/
+} llgmm_assign_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint32 tlli; /* xyz*/
+ kal_uint8 cause; /* xyz*/
+ kal_uint8 cell_update_type;
+} llgmm_trigger_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint32 tlli; /* xyz*/
+} llgmm_suspend_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint32 tlli; /* xyz*/
+} llgmm_resume_req_struct;
+
+typedef llgmm_assign_req_struct llc_gmm_assign_req_struct;
+typedef llgmm_trigger_req_struct llc_gmm_trigger_req_struct ;
+typedef llgmm_suspend_req_struct llc_gmm_suspend_req_struct ;
+typedef llgmm_resume_req_struct llc_gmm_resume_req_struct ;
+
+#endif
+
+
diff --git a/mcu/protocol/interface/general/mm2sm_struct.h b/mcu/protocol/interface/general/mm2sm_struct.h
new file mode 100644
index 0000000..ad98be1
--- /dev/null
+++ b/mcu/protocol/interface/general/mm2sm_struct.h
@@ -0,0 +1,268 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * mm2sm_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file describes the common structure of MM and SM.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _MM2SM_STRUCT_H
+#define _MM2SM_STRUCT_H
+
+#include "kal_general_types.h"
+#include "kal_public_defs.h"
+#include "l3_inc_enums.h"
+#include "mmcm_enums.h"
+#include "smmm_enums.h"
+#include "as2nas_struct.h"
+#include "irat_common_struct.h"
+
+typedef struct {
+ LOCAL_PARA_HDR
+ gmmsm_cause_enum cause;
+} gmmsm_suspend_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+} gmmsm_resume_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ //kal_uint8 cell_support_egprs;
+ rr_mm_sgsnr_flag_enum sgsnr_flag; /* Erica: 20070320 sgsnr */
+} gmmsm_cell_info_update_ind_struct; /* Johnny: for egprs */
+
+typedef struct {
+ LOCAL_PARA_HDR
+ rr_mm_sgsnr_flag_enum sgsnr_flag;
+ gmmsm_fop_status_enum follow_on_status;
+} gmmsm_attach_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ gmmsm_cause_enum cause;
+} gmmsm_attach_rej_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ gmmsm_cause_enum cause;
+
+ /** MM notifies SM to stop t3396 as specified in 24.008.
+ * TRUE
+ * - 1: NW detaches with cause "re-attach required"
+ * - 2: NW pages for GPRS service using IMSI
+ *
+ * FALSE
+ * Otherwise .
+ */
+ kal_bool is_stop_t3396 ;
+} gmmsm_detach_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ gmmcm_result_enum cause; /* gmmcm_result_enum */
+} gmmsm_est_rej_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ DC_Status status;
+ peer_msg_id_struct peer_msg_id;
+} gmmsm_unitdata_cnf_struct;
+
+#ifdef __REL4__
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint16 nsapi_status;
+} gmmsm_nsapi_status_ind_struct;
+#endif
+
+/**
+ * According to Multimode interRAT message processing rules,
+ * the receiving module, said... the MOD_A, need to process this message in the following way
+ * - (1) Relay this interRAT message to next module, said... the MOD_B, first
+ * - (2) then MOD_A can start to do processing of this message
+ * because when a RD designs a new MM iRAT feature, he/she will assume others process these messages in this way
+ * this rules make sures the interRAT message flow is as expected
+ */
+typedef struct {
+ LOCAL_PARA_HDR
+ irat_type_enum irat_type; //Indicates the inter-RAT type
+ rat_type_enum source_rat; //Source RAT (GAS or UAS)
+ rat_type_enum target_rat; //Target RAT (Should be EAS)
+
+ mm2emm_irat_info_struct mm_info;
+ void* as_info_ptr; //Indicates the address of the activation request for RAT change to LTE, the information is dedicated for AS.
+ //The buffer will be freed by soure or target AS
+ //Note: It should be NULL if irat_type is IR_TYPE_SEARCH
+} gmmsm_rat_change_ind_struct;// (23G4 start)
+
+/**
+ * According to Multimode interRAT message processing rules,
+ * the receiving module, said... the MOD_A, need to process this message in the following way
+ * - (1) Relay this interRAT message to next module, said... the MOD_B, first
+ * - (2) then MOD_A can start to do processing of this message
+ * because when a RD designs a new MM iRAT feature, he/she will assume others process these messages in this way
+ * this rules make sures the interRAT message flow is as expected
+ */
+typedef struct {
+ LOCAL_PARA_HDR
+ irat_type_enum irat_type;
+ rat_type_enum source_rat;
+ rat_type_enum target_rat;
+ irat_result_enum irat_result;
+
+ kal_bool is_ps_sig_connected; //GMM inform SM about the PS Signalling Conn status
+ kal_bool is_attached; // 2012/12/4 mail confirmed. GMM tells SM if GMM is currently attached or detached (GMM owner confirmed that attaching is not possible, only attached or detached is possible)
+
+ void* as_info_ptr; //The pointer of AS container information
+ // check L4_NAS_RAT_CHANGE_SAP.docx for detail
+} gmmsm_rat_change_cnf_struct; // (4G23 finish) note: need two stage CNF if IRCCO
+
+#ifdef __GEMINI__
+typedef struct {
+ LOCAL_PARA_HDR
+ as_gemini_status_enum as_gemini_status;
+}gmmsm_virtual_mode_ind_struct;
+#endif
+
+#endif
+
+
diff --git a/mcu/protocol/interface/general/mm2sms_enums.h b/mcu/protocol/interface/general/mm2sms_enums.h
new file mode 100644
index 0000000..ce212cb
--- /dev/null
+++ b/mcu/protocol/interface/general/mm2sms_enums.h
@@ -0,0 +1,110 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * mm2sms_enums.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *============================================================================
+ ****************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+
+#ifndef _MM2SMS_ENUMS_H
+#define _MM2SMS_ENUMS_H
+
+typedef enum {
+ CS_RELEASE = 0,
+ PS_RELEASE,
+ RELEASE_FOR_BOTH,
+ CS_ATTACHED,
+ PS_ATTACHED,
+ COMBINED_ATTACHED,
+ ATTACH_REJECT,
+ GMM_SUSPENDED, /* Ripple*/
+ GMM_RESUMED
+}gmm_sms_reg_state_enum;
+
+typedef enum {
+ RAU_STARTED = 0,
+ RAU_END
+}gmm_sms_rau_state_enum;
+
+//Added for SKT Operator : KOR REQ ID : 328,299
+typedef enum {
+ CS_CONNECTED = 0, //[i]CS Connected indicates that RRC Connection is established
+ PS_CONNECTED_CUSTOM, // [ii]PS Connected indicates that PDP context is Active and RRC Connection is established[UMTS]/GMM is not in Susupend State[GSM]
+ CS_PS_CONNECTED_CUSTOM,// This enum indicates a combination of the above mentioned 2 Enums([i] & [ii])
+ CS_PS_IDLE_CUSTOM
+}gmm_sms_cn_domain_state_enum;
+
+
+
+#endif
+
+
diff --git a/mcu/protocol/interface/general/mm2sms_struct.h b/mcu/protocol/interface/general/mm2sms_struct.h
new file mode 100644
index 0000000..ca62580
--- /dev/null
+++ b/mcu/protocol/interface/general/mm2sms_struct.h
@@ -0,0 +1,158 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * mm2sms_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file is intends for structure definition between SMS and MM.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *==============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+
+/*******************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2002
+*
+*******************************************************************************
+ * FILENAME : mm2sms_struct.h
+ * SYNOPSIS : Functions for encoding/decoding.
+ *
+ * R E V I S I O N H I S T O R Y
+ *
+ */
+#ifndef _MM2SMS_STRUCT_H
+#define _MM2SMS_STRUCT_H
+
+#include "kal_general_types.h"
+#include "l3_inc_enums.h"
+#include "mmcm_enums.h"
+#include "mm2sms_enums.h"
+#include "kal_public_defs.h"
+#include "mm2cm_struct.h"
+
+
+typedef struct {
+ LOCAL_PARA_HDR
+ gmm_sms_reg_state_enum reg_state;
+ rp_enum radio_priority;
+} gmmsms_reg_state_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ gmm_sms_rau_state_enum rau_state;
+} gmmsms_rau_state_ind_struct;
+
+
+typedef struct {
+ LOCAL_PARA_HDR
+ gmmcm_result_enum cause; /* gmmcm_result_enum */
+} gmmsms_est_rej_struct;
+
+typedef mmcm_sync_ind_struct mmsms_sync_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ gmm_sms_cn_domain_state_enum cn_domain_state;
+} gmmsms_cn_domain_state_ind_struct;
+
+
+#endif
+
+
diff --git a/mcu/protocol/interface/general/mm_ratcm_enums.h b/mcu/protocol/interface/general/mm_ratcm_enums.h
new file mode 100644
index 0000000..fdd067f
--- /dev/null
+++ b/mcu/protocol/interface/general/mm_ratcm_enums.h
@@ -0,0 +1,86 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * mm_ratcm_enums.h
+ *
+ * Project:
+ * --------
+ * MONZA
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ ******************************************************************************/
+
+#ifndef MM_RATCM_ENUMS_H
+#define MM_RATCM_ENUMS_H
+
+typedef enum {
+ RATCM_ORIG_CONVER_CALL,
+ RATCM_ORIG_STREAMING_CALL,
+ RATCM_ORIG_INTERACTIVE_CALL,
+ RATCM_ORIG_BACKGROUND_CALL,
+ RATCM_ORIG_SUBSCRIBED_CALL,
+ RATCM_TERM_CONVER_CALL,
+ RATCM_TERM_STREAMING_CALL,
+ RATCM_TERM_INTERACTIVE_CALL,
+ RATCM_TERM_BACKGROUND_CALL,
+ RATCM_EMERGENCY_CALL,
+ RATCM_INTER_RAT_CELL_RESELECTION,
+ RATCM_REGISTRATION,
+ RATCM_DETACH,
+ RATCM_HIGH_PRIORITY_SIG,
+ RATCM_LOW_PRIORITY_SIG,
+ RATCM_CALL_RE_ESTABLISHMENT,
+ RATCM_RRC_EstablishmentCause_terminatingHighPrioritySignalling,
+ RATCM_RRC_EstablishmentCause_terminatingLowPrioritySignalling,
+ RATCM_RRC_EstablishmentCause_terminatingCauseUnknown,
+ RATCM_SPEECH_CALL,
+ RATCM_DATA_CALL,
+ RATCM_SS_DATA,
+ RATCM_VIDEO_CALL /* __REL6__ */
+}mm_ratcm_est_cause_enum;
+
+#endif
+
+
diff --git a/mcu/protocol/interface/general/mm_ratcm_struct.h b/mcu/protocol/interface/general/mm_ratcm_struct.h
new file mode 100644
index 0000000..ab06bfe
--- /dev/null
+++ b/mcu/protocol/interface/general/mm_ratcm_struct.h
@@ -0,0 +1,783 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * mm_ratcm_struct.h
+ *
+ * Project:
+ * --------
+ * MONZA
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ ******************************************************************************/
+
+#ifndef MM_RATCM_STRUCT_H
+#define MM_RATCM_STRUCT_H
+
+#include "l3_inc_enums.h"
+#include "mcd_l3_inc_struct.h"
+#include "l3_inc_local.h"
+#include "l3llc_enums.h"
+#include "mmllc_enums.h"
+#include "as2nas_struct.h"
+#include "mcd_l3_inc_gprs_struct.h"
+#include "ps_public_enum.h"
+#include "mm_ratcm_enums.h"
+#include "rsvas_enum.h"
+#include "kal_public_defs.h"
+#include "irat_common_struct.h"
+#include "irat_common_enums.h"
+#include "nas_as_inter_core_enum.h"
+#include "gmss_public.h"
+#include "nwsel_mm_struct.h"
+
+#include "nas_sv_struct.h"
+
+#include "ratcm_rrce_struct.h"
+#include "ratcm_csce_struct.h"
+#include "mmi2mm_struct.h"
+
+typedef struct {
+ LOCAL_PARA_HDR
+ rfoff_cause_enum rfoff_cause;
+} mm_ratcm_rfoff_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ rat_enum rat;
+ rat_enum reported_rat;
+ rat_enum active_rat;
+} mm_ratcm_set_rat_mode_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_successful;
+ mm_cause_enum cause;
+} mm_ratcm_set_rat_mode_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 drx_para[2]; /* for split paging cycle and non-drx timer */
+ kal_uint8 imeisv_value_digit0;
+ kal_uint8 imeisv_value_digit_byte[8];
+#ifdef __MONITOR_PAGE_DURING_TRANSFER__
+ gprs_transfer_preference_enum prefer;
+#endif
+ init_cause_enum init_cause;
+} mm_ratcm_init_req_struct;
+
+
+typedef nwsel_nas_sv_plmn_search_req_struct mm_ratcm_plmn_search_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 trx_id;
+ plmn_search_result_enum result;
+ rat_enum rat;
+ plmn_id_struct selected_plmn;
+ kal_bool is_as_plmn_list_present;
+ as_plmn_list_struct as_plmn_list;
+ as_cell_type_enum selected_cell_type; //20081027
+ kal_uint8 multi_plmn_count;
+ plmn_id_struct multi_selected_plmn[MAX_NUM_MULTI_PLMN];
+ as_cell_type_enum multi_selected_cell_type[MAX_NUM_MULTI_PLMN];
+ scan_type_enum scan_type;
+ kal_bool is_stored_list_exist; // only for stored search not for fullband + fullband and stored
+ fullband_result_enum is_fullband_finished;
+ kal_bool is_quick_search;
+} mm_ratcm_plmn_search_cnf_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 multi_plmn_count;
+ plmn_id_struct multi_plmn_id[MAX_NUM_MULTI_PLMN];
+ as_cell_type_enum multi_cell_type[MAX_NUM_MULTI_PLMN];
+ rat_enum rat;
+ /// source from cell reselection or search
+ found_ind_source_enum source;
+} mm_ratcm_plmn_found_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 plmn_id_count;
+ plmn_id_struct plmn_id[MD1_MAX_NUM_HPLMN];
+ kal_uint8 home_country_mcc[3];
+} mm_ratcm_hplmn_info_update_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 la_code[2];
+ forbidden_la_type_enum forbidden_la_type; /* forbidden_la_type_enum */
+ plmn_id_struct plmn_id;
+} mm_ratcm_add_forbidden_la_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 la_code[2];
+ plmn_id_struct plmn_id;
+ kal_bool delete_all;
+} mm_ratcm_del_forbidden_la_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ csg_update_type_enum csg_update_type;
+ plmn_id_struct plmn_id;
+ kal_uint32 csg_id;
+} mm_ratcm_update_allowed_csg_list_req_struct;
+
+typedef mm_sys_info_ind_struct mm_ratcm_sys_info_ind_struct;
+typedef mm_cell_global_identity_info_ind_struct mm_ratcm_cell_global_identity_info_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_as_plmn_list_present;
+ as_plmn_list_struct as_plmn_list;
+ csfb_indicator_enum csfb_ind;
+#ifdef __GEMINI__
+ as_suspend_mode_reason_enum cause; /* for RR suspend mode */
+#endif /* __GEMINI__ */
+ plmn_loss_reason_enum plmn_loss_reason;
+} mm_ratcm_plmn_loss_ind_struct;
+
+typedef nas_sv_mm_plmn_list_req_struct mm_ratcm_plmn_list_req_struct;
+
+typedef nwsel_mm_plmn_list_status_update_req_struct mm_ratcm_plmn_list_status_update_req_struct;
+
+typedef nas_sv_mm_plmn_list_cnf_struct mm_ratcm_plmn_list_cnf_struct;
+
+typedef nas_sv_mm_csg_list_req_struct mm_ratcm_csg_list_req_struct;
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+typedef struct {
+ LOCAL_PARA_HDR
+ RATCM_RRC_PagingCause paging_cause;
+ domain_id_enum cn_domain_id;
+ ue_id_type_enum ue_id_type;
+} mm_ratcm_page_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint32 old_tlli;
+ kal_uint32 new_tlli;
+ tlli_update_type_enum status_tlli;
+ rai_struct rai;
+} mm_ratcm_tlli_assign_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_tmsi_lai_present;
+ kal_uint8 tmsi[4];
+ kal_bool is_lai_abnormal; /* MAUI_01959495 */
+ lai_struct reg_lai;
+ kal_bool is_ptmsi_rai_present;
+ kal_uint8 ptmsi[4];
+ kal_bool is_rai_abnormal; /* MAUI_01959495 */
+ rai_struct reg_rai;
+ kal_uint8 umts_ps_drx_clc;
+} mm_ratcm_paging_param_assign_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ domain_id_enum cn_domain_id;
+ kal_bool is_new_keys;
+ kal_uint8 cksn;
+ kal_bool gsm_cipher_key_infoP;
+ kal_uint8 gsm_cipher_key_info[KC_LEN];
+ kal_bool gsm_cipher_key128_infoP;
+ kal_uint8 gsm_cipher_key128_info[KC128_LEN];
+ kal_uint8 ps_cipher_algo;
+ kal_bool umts_keys_infoP;
+ kal_uint8 umts_cipher_key_info[CK_LEN];
+ kal_uint8 umts_integrity_key_info[IK_LEN];
+ kal_bool is_power_on; // for TS 24.008 CR1994
+} mm_ratcm_security_mode_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ sync_ind_cause_enum cause;
+ channel_type_enum channel_type; /* channel_type_enum */
+ channel_mode_enum channel_mode; /* channel_mode_enum */
+ kal_uint8 si;
+ kal_bool is_cipher_on;
+} mm_ratcm_sync_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ domain_id_enum cn_domain_id;
+ kal_bool is_integrity_enabled;
+ Ciphering_Status umts_ciphering_status;
+ kal_uint8 service_req_mui;
+} mm_ratcm_security_mode_complete_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ domain_id_enum cn_domain_id;
+ Ciphering_Status umts_ciphering_status; /* Ciphering_Status */
+} mm_ratcm_security_mode_change_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 mui;
+ kal_uint16 gibi_tag;
+ domain_id_enum cn_domain_id;
+ mm_ratcm_est_cause_enum estb_cause;
+ peer_msg_id_struct peer_msg_id;
+ kal_bool is_service_req;
+#if defined (__R6_DSAC__) || defined (UNIT_TEST)
+ kal_bool is_dsac_present;
+ kal_uint16 selected_dsac_info;
+#endif
+ plmn_id_struct selected_plmn;
+
+#if defined(__PPACR_SUPPORT__) || defined (UNIT_TEST)
+ ppac_checked_type_enum PPACCheckedType;
+ kal_uint16 selectedPPACInfo; //used by PPAC_LR_ALLOWED
+#endif
+
+#ifdef __LTE_RAT__
+ csfb_indicator_enum csfb_indicator;
+ csfb_service_type_enum csfb_service_type;
+#endif /* __LTE_RAT__*/
+ rat_enum current_rat; /* CELL_CHANGE_FINISH is in MM external queue and MM current rat is still source rat *
+ * RATCM should reject conn_est_req when current_rat is not match RATCM active rat */
+ kal_bool is_imsi_detach_for_power_off;
+} mm_ratcm_conn_est_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ domain_id_enum cn_domain_id;
+ as_est_cnf_cause_enum result;
+ kal_bool wait_gibi_flag;
+ kal_bool is_rrc_conn_already_existed;
+} mm_ratcm_conn_est_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_successful;
+ domain_id_enum cn_domain_id;
+ kal_bool is_t3126_expiry;
+} mm_ratcm_conn_est_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ domain_id_enum cn_domain_id;
+ as_rel_scope_enum scope;
+ conn_rel_cause_enum cause;
+} mm_ratcm_conn_rel_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ domain_id_enum cn_domain_id;
+ as_rel_scope_enum scope;
+ kal_bool ps_resume_flag;
+ kal_bool wait_gibi_flag;
+ kal_bool wait_rrc_connection_release_ind;
+} mm_ratcm_conn_rel_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ domain_id_enum cn_domain_id;
+ RATCM_RRC_ReleaseCause cause;
+ kal_bool ps_resume_flag;
+ kal_bool wait_gibi_flag;
+ kal_bool wait_rrc_connection_release_ind;
+} mm_ratcm_conn_rel_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ regn_proc_status_enum mm_proc_status;
+ kal_uint32 t3212_or_t3302;
+ gmm_ms_state_enum ms_state;
+ mmas_regn_status_enum regn_status;
+ plmn_search_status_enum plmn_search_status;
+ plmn_search_type_enum plmn_search_type; /* new plmn search type */
+ lai_struct lai; /* for GAS bar cell */
+ kal_uint32 cell_id; /* for GAS bar cell */
+} mm_ratcm_regn_status_req_struct;
+
+typedef mm_ratcm_regn_status_req_struct mm_ratcm_regn_status_update_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ action_on_ready_timer_enum action;
+ gmm_ms_state_enum new_state;
+ kal_uint32 value;
+} mm_ratcm_ready_timer_update_req_struct; /* should be same as ratcm_gas_ready_timer_update_req_struct. */
+
+typedef struct {
+ LOCAL_PARA_HDR
+ ready_timer_status_enum status;
+} mm_ratcm_ready_timer_update_ind_struct; /* should be same as ratcm_gas_ready_timer_update_ind_struct. */
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_gprs_required;
+} mm_ratcm_service_change_req_struct; /* Should same as ratcm_gas_service_change_req_struct. */
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 mui;
+ kal_uint16 gibi_tag;
+ DC_Priority priority;
+ kal_bool is_service_req;
+ kal_bool is_imsi_detach_for_power_off;
+ peer_msg_id_struct peer_msg_id;
+} mm_ratcm_cs_data_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_integrity_applied;
+} mm_ratcm_cs_data_ind_struct;
+typedef struct {
+ LOCAL_PARA_HDR
+ peer_msg_id_struct peer_msg_id;
+ DC_Status status;
+} mm_ratcm_cs_data_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 mui;
+ kal_uint16 gibi_tag;
+ llc_sapi_enum sapi;
+ rp_enum radio_priority;
+ kal_uint8 cipher_ind;
+ res_req_cause msg_type;
+ kal_uint8 nsapi;
+ kal_uint32 tlli;
+ kal_uint8 pfi;
+ concise_qos_struct qos_param;
+ peer_msg_id_struct peer_msg_id;
+} mm_ratcm_ps_data_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ //kal_uint8 mui;
+ DC_Status status;
+ peer_msg_id_struct peer_msg_id;
+} mm_ratcm_ps_data_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_integrity_applied;
+ kal_uint32 tlli;
+} mm_ratcm_ps_data_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_cs_reset_keys;
+ kal_bool is_ps_reset_keys;
+} mm_ratcm_reset_keys_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint32 tlli;
+} mm_ratcm_llc_resume_req_struct; /* Should be same as ratcm_llc_resume_req_struct */
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint32 tlli;
+} mm_ratcm_llc_suspend_req_struct; /* Should be same as ratcm_llc_suspend_req_struct */
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint32 tlli;
+ res_req_cause cause; /* res_req_cause */
+ llgmm_cell_update_type_enum cell_update_type; /* llgmm_cell_update_type_enum */
+} mm_ratcm_llc_trigger_req_struct; /* Should be same as ratcm_llc_trigger_req_struct */
+
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_expiry; /*KAL_TRUE: T3122 expires, MM will retry LU immediately
+ KAL_FALSE: T3122 is stopped */
+} mm_ratcm_t3122_timeout_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_expiry; /*KAL_TRUE: CCO activation time expires, MM will retry LU immediately
+ KAL_FALSE: CCO activation time is stopped */
+} mm_ratcm_cco_activation_time_timeout_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ rat_enum rat;
+} mm_ratcm_signal_appear_ind_struct;
+
+#ifdef __DYNAMIC_BAND_SEL__
+typedef struct {
+ LOCAL_PARA_HDR
+ band_selection_enum gsm_band; /* refer to band_selection_enum value*/
+ kal_bool is_gsm_band_present;
+ kal_uint8 umts_fdd_band[SIZE_OF_UMTS_BAND]; /* 3G band change */
+ kal_bool is_umts_band_present; /* 3G band change */
+}mm_ratcm_set_preferred_band_req_struct;
+#endif
+
+#ifdef __GEMINI__
+typedef struct {
+ LOCAL_PARA_HDR
+ sim_config_status_enum sim_config_status;
+ sim_insert_status_enum sim_insert_status;
+} mm_ratcm_sim_status_update_req_struct;
+
+
+typedef struct {
+ LOCAL_PARA_HDR
+} mm_ratcm_suspend_ind_struct;
+
+
+//mtk02475: local param struct is only exist in GEMINI 2.0 project
+typedef struct {
+ LOCAL_PARA_HDR
+ as_gemini_status_enum as_gemini_status;
+} mm_ratcm_resume_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ as_gemini_status_enum as_gemini_status;
+} mm_ratcm_virtual_mode_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ as_gemini_status_enum as_gemini_status;
+} mm_ratcm_uas_virtual_mode_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ gprs_transfer_preference_enum prefer;
+} mm_ratcm_set_gprs_transfer_preference_req_struct;
+#endif /* __GEMINI__ */
+
+/* MAUI_02852442, __NO_PSDATA_SEND_SCRI__ */
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool force_send_SCRI;
+ end_session_cause_enum cause;
+}mm_ratcm_end_ps_data_session_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ end_session_result_enum cause;
+}mm_ratcm_end_ps_data_session_cnf_struct;
+/* __NO_PSDATA_SEND_SCRI__ */
+
+#ifdef __TC7__CS__SUPPORT__
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool isForceLau;
+} mm_ratcm_cell_change_start_ind_struct;
+#endif
+
+typedef struct {
+ LOCAL_PARA_HDR
+ rat_enum rat;
+ domain_id_enum connection_domain;
+ kal_bool is_gibi_tag_valid;
+ kal_uint16 gibi_tag;
+} mm_ratcm_cell_change_finish_ind_struct;
+
+/* MAUI_03101878, [Silver Clam][CV][SilverClam-94]Pre-CV-CMAS: GPRS failed due to timeout */
+typedef struct {
+ LOCAL_PARA_HDR
+ lai_struct current_lai;
+} mm_ratcm_cb_loc_update_req_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ nas_req_gemini_ps_high_sem_enum gemini_ps_high_sem_status;
+} mm_ratcm_uas_gemini_ps_high_sem_req_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ kal_bool is_sim_inserted;
+ kal_bool is_delete_pending;
+} mm_ratcm_sim_info_reset_req_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ RATCM_RRC_LocalReleaseType localReleaseType;
+ kal_uint16 locally_released_PS_RAB_bitmap;
+ //traffic_class_enum max_traffic_class;
+} mm_ratcm_local_release_ind_struct;
+
+//__LTE__
+typedef struct{
+ LOCAL_PARA_HDR
+ eutran_cap_enum eutran_cap;
+} mm_ratcm_eutran_cap_update_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_successful;
+} mm_ratcm_eutran_cap_update_cnf_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ irat_type_enum irat_type; //Indicates the inter-RAT type
+ rat_type_enum source_rat; //Source RAT (GAS or UAS)
+ rat_type_enum target_rat; //Target RAT (Should be EAS)
+ void* as_info_ptr; //Indicates the address of the activation request for RAT change to LTE, the information is dedicated for AS.
+ //The buffer will be freed by soure or target AS
+ ratcm_gas_security_mode_req_struct gas_security; //Indicates the GERAN security context if target_rat is GAS.
+ //Note that if the RAT change is failed and return to LTE, the security context should be reverted to the original one. NAS will send RATCM_GAS_SECURITY_MODE_REQ to update the original security information when NAS receives RAT_CHANGE_CNF indicated that the inter-RAT procedure is failed.
+ uas_security_context_struct uas_security[2]; //Indicates the UTRAN security context if target_rat is UAS.
+ //Note that if the RAT change is failed and return to LTE, the security information should be reverted to the original one. NAS will send RATCM_RRCE_SECURITY_MODE_REQ to update the original security information when NAS receives RAT_CHANGE_CNF indicated that the inter-RAT procedure is failed.
+ csfb_indicator_enum csfb_indicator; //Indicate that the purpose of current inter-RAT change is for CS fallback which is combined the information (MobilityFromEutra) from ERRC and the processing type of CSFB in EMM.
+ loopback_mode_status_enum loopback_mode_status; //Notify RATCM to enter test mode for LTE-LBM mode B
+ kal_bool is_lai_valid; //CSFB enhancement
+ lai_struct lai; //CSFB enhancement
+ kal_bool is_srvcc; //SRVCC support. If is_srvcc=KAL_TRUE, it means RATCM vsd_mod is 4. (is_r99_nw = KAL_TRUE)
+ kal_bool is_mapped_rai_valid; // For 4G3 HO, AS may not have valid plmn id. AS will derive plmn id from mapped rai.
+ rai_struct mapped_rai;
+} mm_ratcm_rat_change_req_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ irat_type_enum irat_type; //Indicates the inter-RAT type
+ rat_type_enum source_rat; //Source RAT
+ rat_type_enum target_rat; //Target RAT
+ irat_result_enum irat_result; //The result of inter-RAT change
+ void* as_info_ptr; //The pointer of AS container information
+ domain_id_enum connection_domain; //Indicates that the current connection domain for the target RAT
+ kal_bool is_gibi_tag_valid;
+ kal_uint16 gibi_tag;
+} mm_ratcm_rat_change_cnf_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ irat_type_enum irat_type;
+ rat_type_enum source_rat; //Source RAT (GAS or UAS)
+ rat_type_enum target_rat; //Target RAT (Should be EAS)
+ void* as_info_ptr; //Indicates the address of the activation request for RAT change to LTE, the information is dedicated for AS.
+ //The buffer will be freed by soure or target AS
+ kal_uint8 nas_security_param[NAS_SECURITY_PARAM_LEN];
+ //NAS security parameter (Only valid for IRHO from UAS)
+ //Byte1 ~ 4: NouceMME
+ //Byte5: Selected Algorithm (Ciphering/Integrity)
+ //Byte6: eKSI (including type of security context)
+} mm_ratcm_rat_change_ind_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ irat_type_enum irat_type;
+ rat_type_enum source_rat; //Source RAT (GAS or UAS)
+ rat_type_enum target_rat; //Target RAT (Should be EAS)
+ irat_result_enum irat_result; //The result of inter-RAT change
+ irat_reject_cause_enum irat_reject_cause; //Reject cause when irat_result is equal to IR_RESULT_REJECT.
+ void* as_info_ptr; //Indicates the address of the activation request for RAT change to LTE, the information is dedicated for AS.
+ //The buffer will be freed by soure or target AS
+} mm_ratcm_rat_change_rsp_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ paging_type_enum paging_type;
+ csfb_service_type_enum paging_service;
+ kal_bool is_paging_retry;
+}mm_ratcm_page_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_completed;
+}mm_ratcm_deactivate_cnf_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ cs_status_enum status;
+} mm_ratcm_cs_status_update_req_struct;
+
+/*For TDD call clearing optimization*/
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+} mm_ratcm_force_rel_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 imeisv_value_digit0;
+ kal_uint8 imeisv_value_digit_byte[8];
+}mm_ratcm_set_imei_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool is_pch_state;
+}mm_ratcm_rrc_state_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ rat_enum rat_mode;
+ kal_bool is_pgcheck_on;
+}mm_ratcm_set_pgcheck_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ umts_duplex_mode_type source_umts_duplex_mode;
+ umts_duplex_mode_type target_umts_duplex_mode;
+ lte_duplex_mode_type source_lte_duplex_mode;
+ lte_duplex_mode_type target_lte_duplex_mode;
+ mode_switch_cause_enum cause;
+} mm_ratcm_duplex_mode_change_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool result;
+} mm_ratcm_duplex_mode_change_cnf_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ rat_enum rat;
+ plmn_id_struct plmn_id;
+ kal_uint16 arfcn;
+ kal_uint8 requested_band;
+} mm_ratcm_set_mru_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ set_mru_result_enum result;
+} mm_ratcm_set_mru_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ aral_op_enum op_code;
+ plmn_id_struct plmn;
+ rat_enum rat;
+ kal_uint8 ara_start[2];
+ kal_uint8 ara_end[2];
+} mm_ratcm_aral_update_req_struct;
+
+typedef nwsel_mm_emc_forbidden_nw_list_update_req_struct mm_ratcm_emc_forbidden_nw_list_update_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ call_status_enum call_status;
+ call_type_indication_enum call_type;
+} mm_ratcm_call_status_ind_struct;
+typedef nwsel_mm_rat_disable_config_req_struct mm_ratcm_rat_disable_config_req_struct;
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 imeisv_value_digit0;
+ kal_uint8 imeisv_value_digit_byte[8];
+} mm_ratcm_set_imei_sv_req_struct;
+
+typedef ratcm_rrce_conn_loss_ind_struct mm_ratcm_conn_loss_ind_struct;
+
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_auth_download_ongoing;
+} mm_ratcm_rsim_auth_download_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool is_over_inactive_mode_threshold; // True: recovery counter > normal_oos_recovery_round
+} mm_ratcm_service_recovery_round_update_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool normal_oos_recovery_round_present;
+ kal_uint8 normal_oos_recovery_round; // default value = 5, range [2, 10]
+ kal_bool inactive_fullband_period_present;
+ kal_uint16 inactive_fullband_period; // default = 200s, range: [90, 360]
+ kal_bool inactive_sniffer_period_present;
+ kal_uint8 inactive_sniffer_period; // default = 30s, range: [10, 60]
+ kal_bool is_inactive_mode_present;
+ kal_bool is_inactive_mode; // True: enter inactive mode, False: leave inactive mode
+} mm_ratcm_inactive_mode_configuration_req_struct;
+
+//MSG_ID_MM_RATCM_LTE_NORMAL_SERVICE_LOSS_UPDATE_REQ
+typedef gmmreg_lte_normal_service_loss_update_req_struct mm_ratcm_lte_normal_service_loss_update_req_struct ;
+
+//MSG_ID_MM_RATCM_END_PS_DATA_SESSION_IND
+typedef ratcm_csce_end_ps_data_session_ind_struct mm_ratcm_end_ps_data_session_ind_struct ;
+
+//MSG_ID_MM_RATCM_NO_CC_DATA_DETECT_IND
+typedef ratcm_rrce_no_cc_data_detect_ind_struct mm_ratcm_no_cc_data_detect_ind_struct;
+
+#ifdef __GEMINI__
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_data_allowed;
+} mm_ratcm_data_allow_req_struct;
+#endif
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ rat_enum rat;
+ network_scan_23g_union nw_scan_23g_output;
+} mm_ratcm_plmn_scan_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ plmn_id_struct plmn_id;
+} mm_ratcm_plmn_info_update_req_struct;
+
+#endif /* MM_RATCM_STRUCT_H */
diff --git a/mcu/protocol/interface/general/mm_ratdm_struct.h b/mcu/protocol/interface/general/mm_ratdm_struct.h
new file mode 100644
index 0000000..1c9ee1b
--- /dev/null
+++ b/mcu/protocol/interface/general/mm_ratdm_struct.h
@@ -0,0 +1,113 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * mm_ratdm_struct.h
+ *
+ * Project:
+ * --------
+ * MONZA
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ ******************************************************************************/
+
+#ifndef MM_RATDM_STRUCT_H
+#define MM_RATDM_STRUCT_H
+
+#include "kal_general_types.h"
+#include "kal_public_defs.h"
+#include "l3_inc_enums.h"
+#include "mmcm_enums.h"
+#include "l3_inc_enums_public.h"
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 no_of_valid_entries;
+ kal_uint8 nsapi_list[11];
+ kal_uint8 sequence_list[11];
+} mm_ratdm_sequence_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 no_of_valid_entries;
+ kal_uint8 nsapi_list[11];
+ kal_uint8 sequence_list[11];
+} mm_ratdm_sequence_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ traffic_class_enum traffic_class; /* tTrafficClass */
+#ifdef __REL7__
+ kal_uint16 ul_data_status; /* 24.008 CR1053 R7: Indicate which preserved PDP contexts have uplink data pending. */
+#endif
+} mm_ratdm_reestablish_rab_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ gmmcm_result_enum result; /* gmmcm_result_enum */
+} mm_ratdm_reestablish_rab_rsp_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ gmmcm_result_enum result; /* gmmcm_result_enum */
+ rat_enum current_rat; /* MM will send current RAT of MM, helpful for interRAT Collision cases*/
+} mm_ratdm_send_user_data_rsp_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+} mm_ratdm_reestablish_rab_ready_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+} mm_ratdm_rab_release_ind_struct;
+
+typedef struct {
+ kal_uint8 ref_count;
+ kal_uint16 msg_len;
+ traffic_class_enum traffic_class; /* tTrafficClass */
+ kal_uint16 ul_data_status;
+ gmmcm_service_proc_cause_enum cause; /* gmmcm_service_proc_cause_enum */
+} mm_ratdm_service_proc_ind_struct;
+
+#endif /* MM_RATDM_STRUCT_H */
diff --git a/mcu/protocol/interface/general/mmas_enums.h b/mcu/protocol/interface/general/mmas_enums.h
new file mode 100644
index 0000000..52fdc1a
--- /dev/null
+++ b/mcu/protocol/interface/general/mmas_enums.h
@@ -0,0 +1,107 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * mmas_enums.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *============================================================================
+ ****************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _MMAS_ENUMS_H
+#define _MMAS_ENUMS_H
+
+typedef enum {
+ TERMINATING_CONVERSATIONAL_CALL,
+ TERMINATING_STREAMING_CALL,
+ TERMINATING_INTERACTIVE_CALL,
+ TERMINATING_BACKGROUND_CALL,
+ TERMINATING_HIGH_PRIORITY_SIGNALLING,
+ TERMINATING_LOW_PRIORITY_SIGNALLING,
+ TERMINATING_CAUSE_UNKNOWN
+}mmas_page_cause_enum;
+
+typedef enum {
+ HIGH_PRIORITY,
+ NORMAL_PRIORITY = HIGH_PRIORITY,
+ LOW_PRIORITY
+}mmas_priority_enum;
+
+
+#endif
+
+
diff --git a/mcu/protocol/interface/general/mmcm_enums.h b/mcu/protocol/interface/general/mmcm_enums.h
new file mode 100644
index 0000000..3045b5d
--- /dev/null
+++ b/mcu/protocol/interface/general/mmcm_enums.h
@@ -0,0 +1,175 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * mmcm_enums.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file is intends for enum definition about mm and cm layer.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *==============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+
+
+#ifndef _MMCM_ENUMS_H
+#define _MMCM_ENUMS_H
+
+
+typedef enum
+{
+ GCC_PD = 0x00, /* GROUP_CALL_CONTROL */
+ BCC_PD = 0x01, /* BROADCAST_CALL_CONTROL */
+ PDSS1_PD = 0x02,
+ CC_PD = 0x03, /* CALL_CONTROL */
+ /* TRANSPARENT TRANSPORT PTOTOCOL*/
+ GTTP_PD = 0x04,
+ MM_PD = 0x05,
+ RRM_PD = 0x06,
+ GMM_PD = 0x08,
+ SMS_PD = 0x09,
+ SM_PD = 0x0A,
+ CISS_PD = 0x0B, /* NON_CALL_RLTD_SS_PD */
+ LOC_SERV_PD = 0x0C,
+ TC_PD = 0x0F
+}pd_list_enum;
+
+/* Skip Indicator Value */
+#define SKIP_IND 0
+
+typedef enum {
+ EMLPP_NO_PRIORITY = 0,
+ EMLPP_PRIORITY_4 = 1,
+ EMLPP_PRIORITY_3 = 2,
+ EMLPP_PRIORITY_2 = 3,
+ EMLPP_PRIORITY_1 = 4,
+ EMLPP_PRIORITY_0 = 5,
+ EMLPP_PRIORITY_B = 6,
+ EMLPP_PRIORITY_A = 7
+} emlpp_priority_enum;
+
+typedef enum
+{
+ CM_BASIC_CALL = EMLPP_PRIORITY_3,
+ CM_EMERGENCY_CALL = EMLPP_PRIORITY_0
+}call_type_enum;
+
+typedef enum
+{
+ TI_EXHAUSTED,
+ CCBS_NOT_SUPPORTED
+}prompt_rej_cause;
+
+typedef enum
+{
+ GMMCM_SUCCESS = 0,
+ GMMCM_DETACH = 1,
+ GMMCM_REATTACH_REQ = 2, /* Reject cause #9, #10 */
+ GMMCM_T3317_EXPIRY = 3,
+ GMMCM_OTHER_REJ_CAUSE = 4, /* Service reject with other causes */
+ GMMCM_LOWER_LAYER_FAILURE = 5,
+ GMMCM_INCOMPATIBLE_RAT = 6, /* Receive MM_RATCM_REESTABLISH_RAB_IND in GSM RAT */
+ GMMCM_INCOMPATIBLE_STATE = 7, /* Limited, No service, Access class not granted */
+ GMMCM_INTER_RAT_COLLISION = 8,
+ GMMCM_T3319_RUNNING = 9, /* __REL6__ */
+ GMMCM_INCOMPATIBLE_NSAPI = 10, /* GMM discover NSAPI inactive while dequeu service */
+ GMMCM_T3346_RUNNING = 11
+}gmmcm_result_enum;
+
+typedef enum
+{
+ GMMCM_INTER_RAT = 0,
+ GMMCM_LOCAL_RELEASE = 1,
+}gmmcm_service_proc_cause_enum;
+
+#endif
+
+
diff --git a/mcu/protocol/interface/general/mmi2voip_enums.h b/mcu/protocol/interface/general/mmi2voip_enums.h
new file mode 100644
index 0000000..d0d1564
--- /dev/null
+++ b/mcu/protocol/interface/general/mmi2voip_enums.h
@@ -0,0 +1,367 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * mmi2voip_enums.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file contains the Enum for interface between MMI and VoIP task.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *==============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+
+#ifndef _MMI2VOIP_ENUMS_H
+#define _MMI2VOIP_ENUMS_H
+
+/* call act enum */
+typedef enum
+{
+ VOIP_CALL_ACT_IDLE = 0, /* 0 No action */
+ VOIP_CALL_ACT_DIAL_CALL, /* 1 Make a call */
+ VOIP_CALL_ACT_RETRIEVE_CALL, /* 2 retrieve a specific held call */
+ VOIP_CALL_ACT_HOLD_CALL, /* 3 Hold an active call */
+ VOIP_CALL_ACT_ACCEPT_CALL, /* 4 Accept call */
+ VOIP_CALL_ACT_REL_CALL, /* 5 Release a specific call, whether it is a waiting, active, or help call */
+ VOIP_CALL_ACT_REL_ALL_CALLS, /* 6 Release all calls */
+ VOIP_CALL_ACT_REL_ALL_HOLD, /* 7 Release all held calls */
+ VOIP_CALL_ACT_REL_ALL_EXCEPT_WAITING, /* 8 Release all calls except waiting call */
+ VOIP_CALL_ACT_REL_ACTIVE_AND_ACCEPT, /* 9 Release active call and accept waiting call */
+ VOIP_CALL_ACT_FORCE_REL_CALL, /* 10 Force to release an call that is already released but response not comes back yet */
+ VOIP_CALL_ACT_SWAP_CALL, /* 11 Hold active call and activate a specific held call */
+ VOIP_CALL_ACT_SPLIT_CALL, /* 12 Split a multiparty call into two calls */
+ VOIP_CALL_ACT_MERGE_CALL, /* 13 Add a held call into an active call */
+ VOIP_CALL_ACT_BLIND_TRANSFER, /* 14 Blind transfer a call */
+ VOIP_CALL_ACT_UNATTENDED_TRANSFER, /* 15 Unattended transfer a call */
+ VOIP_CALL_ACT_CONSULT_TRNASFER, /* 16 Consultive transfer a call (Not supported yet) */
+ VOIP_CALL_ACT_ATTENDED_TRNASFER, /* 17 Attended transfer a call (Not supported yet) */
+ VOIP_CALL_ACT_REL_ALL_AND_DIAL_EMERGENCY, /* 18 Force release all call and dial emergency call */
+ VOIP_CALL_ACT_HOLD_AND_DIAL, /* 19 Hold active and dial */
+ VOIP_CALL_ACT_HOLD_AND_ACCEPT, /* 20 Hold active and accept */
+ VOIP_CALL_ACT_TRANSFEREE, /* 21 Transfer call to another location (transfee case). Triggered by remove site. */
+ VOIP_CALL_ACT_BK_REL_MT_CALL, /* 22 Release call in the background */
+ VOIP_CALL_ACT_BK_REL_ALL_CALL, /* 23 Release all calls in the background */
+ VOIP_CALL_ACT_ADD_PARTICIPANT, /* 24 Add participant into a conference call */
+ VOIP_CALL_ACT_REMOVE_PARTICIPANT, /* 25 Remove participant from a conference call */
+ VOIP_CALL_ACT_CONF_REFRESH, /* 26 Subscribe state of a call (Not supported yet) */
+ VOIP_CALL_ACT_ACCEPT_REPLACED_CALL, /* 27 Accept new call with replaces */
+ VOIP_CALL_ACT_TOTAL /* 28 Total number of call action */
+}voip_call_act_enum;
+
+/* call main state. */
+typedef enum
+{
+ VOIP_CALL_STATE_TERMINATED = 0, /* 0 Call is terminated */
+ VOIP_CALL_STATE_CONFIRMED, /* 1 Call is connected. The call might be active or hold */
+ VOIP_CALL_STATE_GET_MO_ADDR, /* 2 Getting NAT address for MO call For MO call */
+ VOIP_CALL_STATE_INVITE_PENDING, /* 3 Waiting for the response of INVITE request */
+ VOIP_CALL_STATE_RECV_1XX, /* 4 Receive 1XX resposne for INVITE */
+ VOIP_CALL_STATE_RECV_2XX_REINVITE, /* 5*/
+ VOIP_CALL_STATE_RINGING, /* 6 Incoming call, waiting user to accept (for MT call) */
+ VOIP_CALL_STATE_GET_MT_ADDR, /* 7 Getting NAT address (for MT call) */
+ VOIP_CALL_STATE_ACCEPTING, /* 8 Waiting for the ACK of ACCEPT request (for MT call) */
+ VOIP_CALL_STATE_HOLDING, /* 9 Holding dialog inner a single call (Call HOLD) */
+ VOIP_CALL_STATE_UNHOLDING, /* 10 Retrieving dialog inner a single call (Call HOLD) */
+ VOIP_CALL_STATE_HOLDING_1D, /* 11 Holding the first dialog of a call and waiting for the response (Call HOLD)*/
+ VOIP_CALL_STATE_HOLDING_2D, /* 12 Holding the second dialog of a call and waiting for the response (Call HOLD) */
+ VOIP_CALL_STATE_REL_HOLD_FAILED, /* 13 Releasing the failed dialog during the HOLD process (Call HOLD) */
+ VOIP_CALL_STATE_UNHOLDING_1D, /* 14 Retrieving the first dialog of a call and waiting for the response (Call UNHOLD) */
+ VOIP_CALL_STATE_UNHOLDING_2D, /* 15 Retrieving the second dialog of a call and waiting for the response (Call UNHOLD) */
+ VOIP_CALL_STATE_REL_UNHOLD_FAILED, /* 16 Releasing the failed dialog during the UNHOLD process (Call UNHOLD) */
+ VOIP_CALL_STATE_TERMINATING, /* 17 Releasing call */
+ VOIP_CALL_STATE_WAIT_TRANSFER, /* 18 Waiting for the response of previous sent REFER CALL Transfer */
+ VOIP_CALL_STATE_TRANSFERING, /* 19 Trasfering a call and waiting for the result. */
+ VOIP_CALL_STATE_ABORT_MO_NAT_ADDR, /* 20 Aborting the getting derived address process */
+ VOIP_CALL_STATE_ABORT_MT_NAT_ADDR, /* 21 Aborting the getting derived address process */
+ VOIP_CALL_STATE_WAIT_CANCEL, /* 22 Received the request to abort the MO, is waiting the 1xx indication to proceed the canceling procedure */
+ VOIP_CALL_STATE_CANCELING, /* 23 Canceling a MO call, and waiting for the response */
+ VOIP_CALL_STATE_WAIT_TERMINATE, /* 24 Waiting for the reposne of accpetance to proceed the terminating process */
+ VOIP_CALL_STATE_TERMINATING_2D, /* 25 Terminating a mulit-party call, and waiting for the response */
+ VOIP_CALL_STATE_TERMINATING_1D, /* 26 Terminating a mulit-party call, and already received the first response */
+ VOIP_CALL_STATE_ADD_PARTICIPANT, /* 27 Adding participant and waiting for the response */
+ VOIP_CALL_STATE_REMOVE_PARTICIPENT, /* 28 Removing participant and waiting for the response */
+ VOIP_CALL_STATE_SUBSCRIBING, /* 29 Subscribing the call state */
+// VOIP_CALL_STATE_UNSUBSCRIBING, /* 30 Unsubscribing the call state before release a call */
+ VOIP_CALL_STATE_TOTAL
+}voip_call_state_enum;
+
+/* dialog state */
+typedef enum
+{
+ VOIP_DLG_STATE_TERMINATED = 0, /* dialog is terminated */
+ VOIP_DLG_STATE_ACTIVE, /* 1 Active call */
+ VOIP_DLG_STATE_HOLD, /* 2 Held call */
+ VOIP_DLG_STATE_WAITING, /* 3 Waiting call */
+ VOIP_DLG_STATE_HOLDING, /* 4 The dialog is holding and waiting for the response */
+ VOIP_DLG_STATE_UNHOLDING, /* 5 The dialog is unholding and waiting for the response */
+ VOIP_DLG_STATE_TERMINATING, /* 6 Terminating a dialog */
+ VOIP_DLG_STATE_WAIT_NAT, /* 7 Wait NAT response to proceed MO/MT call */
+ VOIP_DLG_STATE_MO, /* 8 During MO procedure */
+ VOIP_DLG_STATE_MT, /* 9 During MT procedure */
+ VOIP_DLG_STATE_WAIT_ACK, /* 10 Waiting for remote ACK */
+ VOIP_DLG_STATE_WAIT_PRACK, /* 11 Waiting for PRACK */
+ VOIP_DLG_STATE_WAIT_PRACK_RESP, /* 12 Waiting for 200 of PRACK */
+ VOIP_DLG_STATE_TRANSFERING, /* 12 During transfering procedure */
+ VOIP_DLG_STATE_TRANSFEREE, /* 13 During background transfering procedure */
+ VOIP_DLG_STATE_TOTAL
+}voip_dlg_state_enum;
+
+
+typedef enum
+{
+ VOIP_RTP_DIRECTION_SENDRECV = 0, /* Send and Receive */
+ VOIP_RTP_DIRECTION_SENDONLY, /* Send only */
+ VOIP_RTP_DIRECTION_RECVONLY, /* Receive only */
+ VOIP_RTP_DIRECTION_INACTIVE, /* RTP session suspends */
+ VOIP_RTP_DIRECTION_DEFAULT,
+ VOIP_RTP_DIRECTION_TOTAL
+}voip_rtp_direction_enum;
+
+
+/* PROGRESSING_IND */
+typedef enum
+{
+ VOIP_CALL_PROG_TRYING = 0, /* specific for sending call_id to mmi */
+ VOIP_CALL_PROG_RINGING, /* Receive 180 (ringing indication) */
+ VOIP_CALL_PROG_FORWARDED, /* Receove 181 (call forwarded) */
+ VOIP_CALL_PROG_SDP_EXCHANGED, /* Receive 1xx with SDP */
+ VOIP_CALL_PROG_TOTAL
+}voip_call_progress_enum;
+
+/* Type of call state in CALL_STATE_IND. */
+typedef enum
+{
+ VOIP_STATE_IND_SDP_CHANGE = 0,
+ VOIP_STATE_IND_TRANSFERING,
+ VOIP_STATE_IND_TRANSFERED,
+ VOIP_STATE_IND_TRANSFER_FAILED,
+ VOIP_STATE_IND_TOTAL
+}voip_state_ind_enum;
+
+typedef enum
+{
+ VOIP_MWI_VOICE=0, /* Voice Message */
+ VOIP_MWI_FAX, /* Fax Message */
+ VOIP_MWI_PAGER, /* Pager Message */
+ VOIP_MWI_MM, /* Multimedia Message */
+ VOIP_MWI_TEXT, /* Text Message */
+ VOIP_MWI_NONE, /* Unrecognized Message */
+ VOIP_MWI_TOTAL
+} voip_mwi_type_enum;
+
+
+typedef enum
+{
+ VOIP_CONF_STATE_FULL = 0, /* full information of conference */
+ VOIP_CONF_STATE_PARTIAL, /* particial information, contains only changed part */
+ VOIP_CONF_STATE_DELETED, /* conference is deleted (call end) */
+ VOIP_CONF_STATE_END
+}voip_conf_state_enum;
+
+typedef enum
+{
+ VOIP_CONF_USER_STATUS_CONNECTED = 0, /* User connected */
+ VOIP_CONF_USER_STATUS_DISCONNECTED, /* User disconnected */
+ VOIP_CONF_USER_STATUS_END
+}voip_conf_user_status_enum;
+
+typedef enum
+{
+ VOIP_SUBS_STATE_NONE = 0,
+ VOIP_SUBS_STATE_SUCCESS,
+ VOIP_SUBS_STATE_BK_SUBSCRIBING,
+ VOIP_SUBS_STATE_END
+}voip_subs_state_enum;
+
+typedef enum
+{
+ VOIP_ANNEX_NONE = 0,
+ VOIP_ANNEX_NO,
+ VOIP_ANNEX_YES,
+ VOIP_ANNEX_END
+}voip_annex_enum;
+
+typedef enum
+{
+ VOIP_SIP_CAP_AUDIO = 0, /* 0 sip.audio */
+ VOIP_SIP_CAP_APPLICATION, /* 1 sip.application */
+ VOIP_SIP_CAP_DATA, /* 2 sip.data */
+ VOIP_SIP_CAP_CONTROL, /* 3 sip.control */
+ VOIP_SIP_CAP_VIDEO, /* 4 sip.video */
+ VOIP_SIP_CAP_TEXT, /* 5 sip.text */
+ VOIP_SIP_CAP_AUTOMATA, /* 6 sip.automata */
+ VOIP_SIP_CAP_CLASS, /* 7 sip.class */
+ VOIP_SIP_CAP_DUPLEX, /* 8 sip.duplex */
+ VOIP_SIP_CAP_MOBILITY, /* 9 sip.mobility */
+ VOIP_SIP_CAP_DESCRIPTION, /* 10 sip.description */
+ VOIP_SIP_CAP_EVENTS, /* 11 sip.events */
+ VOIP_SIP_CAP_PRIORITY, /* 12 sip.priority */
+ VOIP_SIP_CAP_METHODS, /* 13 sip.methods */
+ VOIP_SIP_CAP_EXTENSIONS, /* 14 sip.extensions */
+ VOIP_SIP_CAP_SCHEMES, /* 15 sip.schemes */
+ VOIP_SIP_CAP_ACTOR, /* 16 sip.actor */
+ VOIP_SIP_CAP_ISFOCUS, /* 17 sip.isfocus */
+ VOIP_SIP_CAP_BASE_TAGS = VOIP_SIP_CAP_ISFOCUS,
+/* new defined tags starting from here */
+ VOIP_SIP_CAP_TOTAL
+} voip_sip_capability_enum;
+
+#define VOIP_SIP_CAP_NON_SPECIFIED 0
+typedef enum
+{
+ VOIP_SIP_CAP_BOOLEAN_TRUE = 1,
+ VOIP_SIP_CAP_BOOLEAN_FALSE
+} voip_sip_cap_boolean_type_enum;
+
+typedef enum
+{
+ VOIP_SIP_CAP_CLASS_BUSINESS = 1,
+ VOIP_SIP_CAP_CLASS_PERSONAL,
+ VOIP_SIP_CAP_CLASS_SYSTEM = VOIP_SIP_CAP_CLASS_PERSONAL
+} voip_sip_cap_class_type_enum;
+
+typedef enum
+{
+ VOIP_SIP_CAP_DUPLEX_FULL = 1,
+ VOIP_SIP_CAP_DUPLEX_SYSTEM = VOIP_SIP_CAP_DUPLEX_FULL,
+ VOIP_SIP_CAP_DUPLEX_HALF,
+ VOIP_SIP_CAP_DUPLEX_RECVONLY,
+ VOIP_SIP_CAP_DUPLEX_SENDONLY
+} voip_sip_cap_duplex_type_enum;
+
+typedef enum
+{
+ VOIP_SIP_CAP_MOBILITY_FIXED = 1,
+ VOIP_SIP_CAP_MOBILITY_MOBILE,
+ VOIP_SIP_CAP_MOBILITY_SYSTEM = VOIP_SIP_CAP_MOBILITY_MOBILE
+} voip_sip_cap_mobility_type_enum;
+
+typedef enum
+{
+ VOIP_SIP_CAP_ACTOR_PRINCIPAL = 1,
+ VOIP_SIP_CAP_ACTOR_SYSTEM = VOIP_SIP_CAP_ACTOR_PRINCIPAL,
+ VOIP_SIP_CAP_ACTOR_ATTENDANT,
+ VOIP_SIP_CAP_ACTOR_MSG_TAKER,
+ VOIP_SIP_CAP_ACTOR_INFORMATION
+} voip_sip_cap_actor_type_enum;
+
+typedef enum
+{
+ VOIP_CALLER_PREF_NON_SPECIFIED = 0,
+ VOIP_CALLER_PREF_ACCEPT_EXPLICIT,
+ VOIP_CALLER_PREF_ACCEPT_REQUIRE,
+ VOIP_CALLER_PREF_ACCEPT_NONE,
+ VOIP_CALLER_PREF_REJECT_EXPLICIT,
+ VOIP_CALLER_PREF_REJECT_REQUIRE,
+ VOIP_CALLER_PREF_REJECT_NONE
+} voip_caller_pref_type_enum;
+
+#endif /* _MMI2VOIP_ENUMS_H */
+
diff --git a/mcu/protocol/interface/general/mmi2voip_struct.h b/mcu/protocol/interface/general/mmi2voip_struct.h
new file mode 100644
index 0000000..4813523
--- /dev/null
+++ b/mcu/protocol/interface/general/mmi2voip_struct.h
@@ -0,0 +1,759 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2006
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * mmi2voip_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file describes the structure used for communicating between MMI and VoIP.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *============================================================================
+ ****************************************************************************/
+#ifndef _MMI2VOIP_STRUCT_H
+#define _MMI2VOIP_STRUCT_H
+
+#define VOIP_DEBUG_CALL_LIST
+//#define VOIP_3PCC_SUPPORT /* 3pcc call flows support */
+//#define VOIP_EARLY_MEDIA_SUPPORT /* early media support */
+//#define VOIP_SIP_CAPACITY_SUPPORT
+
+/*****************************************************************************
+* Define
+*****************************************************************************/
+#define SIP_CONFORMANCE_TEST
+
+#define VOIP_MAX_NUM_CODEC (15) /* Maximum number of codec */
+//#define VOIP_MAX_NUM_SESSION (2) /* Maximum number of RTP session within a dialog */
+#define VOIP_MAX_SOCK_ADDR_LEN (16) /* Length of IP address */
+#define VOIP_MAX_DERIEVED_ADDR (2) /* Maximum number of derived address */
+#define VOIP_MAX_IP_SEG_LEN (4) /* Maximum number of IP segement */
+
+/* result */
+#define VOIP_OK (0) /* Succsess */
+#define VOIP_ERROR (1) /* Failure happens in VoIP task */
+#define VOIP_SIP_ERROR (2) /* Failure happens in SIP task */
+#define VOIP_FS_ERROR (3) /* File system related error */
+#define VOIP_NAT_ERROR (4) /* NAT related error */
+
+/* cause */
+#define VOIP_NO_ERROR (0) /*no error */
+#define VOIP_UNSPECIFIED_ERROR (-1) /*Unspecified error */
+#define VOIP_NOT_REGISTERED (-2) /* UA has not registered yet */
+#define VOIP_ALREADY_REGISTERED (-3) /*UA has already registered */
+#define VOIP_INVALID_PARAM (-4) /* Invalid parameter */
+#define VOIP_CREATE_UAC_ERROR (-5) /*Create UAC failed */
+#define VOIP_GET_ADDR_FAILED (-6) /* Get derived address failed during MO/MT call */
+#define VOIP_CALL_ABORT_LOCALLY (-7) /* Force to abort call */
+#define VOIP_RECV_BYE (-8) /* Receive BYE request from remote side */
+#define VOIP_INCORRECT_CALL_STATE (-9) /* Call state is not possible to achieve requested operation */
+#define VOIP_BEARER_DISCONNECTED (-10) /* Network is down */
+#define VOIP_ABORT_FAILED (-11) /*Abort failed */
+#define VOIP_CALL_NOT_EXIST (-12) /* Call does not exist */
+#define VOIP_INVALID_URI (-13) /* Invalid URI */
+#define VOIP_SWAP_FAILED (-14) /* Whole swap failed */
+#define VOIP_SWAP_PARTIAL_FAILED (-15) /* Hold successfully, retrieve failed */
+#define VOIP_TRANSFER_FAILED (-16) /* Transfer failed, keep the same state */
+#define VOIP_MERGE_FAILED (-17) /* Call merge failed */
+#define VOIP_MERGE_PARTIAL_FAILED (-18) /* Call merge partial failed */
+#define VOIP_NAT_FAILED (-19) /* Get NAT information from sever failed. */
+#define VOIP_TEMPORARY_BUSY (-20) /* No empty slot in call list to servce request. */
+#define VOIP_UNSUPPORTED_NAT_TYPE (-21) /* The NAT type is not supported. */
+#define VOIP_NETWORK_ERROR (-22) /* Network Error */
+#define VOIP_BUSY (-23) /* VoIP task is executoing another action now */
+#define VOIP_INVALID_CALL_REQ (-24) /* Invalid call request */
+#define VOIP_PARTIAL_FAILED (-25) /* Partial failed */
+#define VOIP_REREGISTER_FAILED (-26) /* Re-register failed. */
+#define VOIP_SDP_MISMATCHED (-27) /* Incorrect SDP session in the response */
+#define VOIP_DNS_ERROR (-28) /* Failure happens in SIP task */
+#define VOIP_NO_RESOURCE (-29) /* no resource or memory to execute */ /* new for Julia */
+#define VOIP_SIP_FS_ERROR (-30) /* FS error *//* new for Julia */
+#define VOIP_DHCP_ERROR (-31) /* DHCP get IP error */ /* for MMI to retry login */
+
+
+/* sync with SIP error */
+#define VOIP_SIP_300_MULTIPLE_CHOICES (300)
+#define VOIP_SIP_301_MOVED_PERMANENTLY (301)
+#define VOIP_SIP_302_MOVED_TEMPORARILY (302)
+#define VOIP_SIP_305_USE_PROXY (305)
+#define VOIP_SIP_400_BAD_REQUEST (400)
+#define VOIP_SIP_401_UNAUTHORIZED (401)
+#define VOIP_SIP_403_FORBIDDEN (403)
+#define VOIP_SIP_404_NOT_FOUND (404)
+#define VOIP_SIP_405_METHOD_NOT_ALLOW (405)
+#define VOIP_SIP_406_NOT_ACCEPTABLE (406)
+#define VOIP_SIP_407_PROXY_AUTH_REQUIRED (407)
+#define VOIP_SIP_408_REQUEST_TIMEOUT (408)
+#define VOIP_SIP_412_CONDITIONAL_REQ_FAIL (412) /* Conditional Request Failed */
+#define VOIP_SIP_422_INTERVAL_TOO_BRIEF (422) /* Session-Expires too brief */
+#define VOIP_SIP_423_INTERVAL_TOO_BRIEF (423) /* Expires too brief */
+#define VOIP_SIP_478_UNRESOLVEABLE_DEST (478) /* unresolveable destination */
+#define VOIP_SIP_480_TEMP_UNAVAILABLE (480)
+#define VOIP_SIP_481_CALL_TRANS_NOT_EXIST (481)
+#define VOIP_SIP_484_ADDRESS_INCOMPLETE (484)
+#define VOIP_SIP_486_BUSY_HERE (486)
+#define VOIP_SIP_488_NOT_ACCEPTABLE_HERE (488)
+#define VOIP_SIP_487_REQ_TERMINATED (487)
+#define VOIP_SIP_491_REQUEST_PENDING (491)
+#define VOIP_SIP_499_UNRESOLVEABLE_DEST (499) /* unresolveable destination */
+#define VOIP_SIP_500_SERVER_INT_ERROR (500)
+#define VOIP_SIP_503_SERVICE_UNAVAILABLE (503)
+#define VOIP_SIP_600_BUSY_EVERYWHERE (600)
+#define VOIP_SIP_603_DECLINE (603)
+#define VOIP_SIP_606_NOT_ACCEPTABLE (606)
+
+/* Type of OUTBOUND server */
+#define VOIP_OUTBOUND_NEVER (0)
+#define VOIP_OUTBOUND_AUTO (1)
+#define VOIP_OUTBOUND_ALWAYS (2)
+
+/* Type of NAT */
+#define VOIP_NAT_TYPE_NONE (0)
+#define VOIP_NAT_TYPE_STATIC_IP (1)
+#define VOIP_NAT_TYPE_STUN (2)
+
+/* Type of DTMF */
+#define VOIP_DTMF_IN_BAND (0)
+#define VOIP_DTMF_OUT_OF_BAND (1)
+#define VOIP_DTMF_TYPE_NONE (2)
+
+/* File Length */
+#define VOIP_FILE_LEN (32)
+#define VOIP_CALL_FILE_PATH "Z:\\@voip"
+#define VOIP_CALL_FILE_NAME "call"
+#define VOIP_CONF_STATE_FILE_NAME "conf"
+
+#define VOIP_MAX_NUM_DIALOG (2) /* Maximum number of dialogs within a call */
+
+/* Conference Server Related */
+#define VOIP_CONF_STATE_USER_COUNT (10) /* Maximum number of conference server state */
+
+#ifdef SIP_CONFORMANCE_TEST
+
+#define VOIP_SIP_OPTION_LEN (1500)
+#endif
+
+/*****************************************************************************
+* Dialog status
+*****************************************************************************/
+#define VOIP_SDP_STATUS_NONE 0x00000000
+#define VOIP_SDP_STATUS_IS_DTMF 0x00000001
+#define VOIP_SDP_STATUS_PT_CHANGE 0x00000002
+#define VOIP_SDP_STATUS_INVITE_SDP 0x00000004
+#define VOIP_SDP_STATUS_SDP_NO_MEDIA 0x00000008
+#define VOIP_SDP_STATUS_EXCHANGED 0x00000010
+#define VOIP_SDP_STATUS_EARLY_MEDIA 0x00000020
+
+/*****************************************************************************
+* Typedef
+*****************************************************************************/
+/* This structure is used for the profile setting */
+typedef struct
+{
+ kal_uint16 sip_port; /* Sip server port number */
+ kal_uint16 local_port; /* Local port (default 0: auto assign) */
+ kal_uint16 outbound_port; /* Port of outbound server */
+ kal_uint16 registrar_port; /* Port of registrar server */
+ kal_uint16 stun_port; /* Port of STUN server */
+ kal_uint16 rtp_start_port; /* Start of RTP port */
+ kal_uint16 rtp_end_port; /* End of RTP port */
+ kal_char disp_name[VOIP_DISP_NAME_LEN*3]; /* Display name of the user */
+ kal_char sip_server[VOIP_URI_LEN]; /* Sip server address */
+ kal_char sip_username[VOIP_USERNAME_LEN]; /* Username of SIP */
+ kal_char sip_password[VOIP_PASSWORD_LEN]; /* Password of SIP */
+ kal_char *domain_name; /* pointer to the domain part of username filed*/
+ kal_bool is_IP_domain; /* if the domain is in IP form */
+ kal_uint8 outbound_type; /* Enable or disable outbound server */
+ kal_bool enable_registrar; /* Enable or disable registrar server */
+ kal_char outbound_server[VOIP_URI_LEN]; /* Address of outbound server */
+ kal_char outbound_username[VOIP_USERNAME_LEN]; /* Username of outbound server */
+ kal_char outbound_password[VOIP_PASSWORD_LEN]; /* Password of outbound server */
+ kal_char registrar_server[VOIP_URI_LEN]; /* Address of registrar server */
+ kal_char registrar_username[VOIP_USERNAME_LEN]; /* Username of registrar server */
+ kal_char registrar_password[VOIP_PASSWORD_LEN]; /* Password of registrar server */
+ kal_char auth_username[VOIP_USERNAME_LEN]; /* Authorization username */
+ kal_uint8 nat_type; /* Type of NAT*/
+ kal_uint8 fire_wall[4]; /* IP address of firewall */
+ kal_char stun_server[VOIP_URI_LEN]; /* Address of STUN server */
+ kal_char voice_mail[VOIP_URI_LEN]; /* Voice mail serfer */
+ kal_bool nat_refresh; /* Auto or manual refresh NAT */
+ kal_uint8 nat_refresh_time; /* NAT manual refresh interval */
+ kal_uint32 data_account; /* Index of data account */
+}voip_profile_struct;
+
+/* This structure is used for SIP capability */
+#ifdef VOIP_SIP_CAPACITY_SUPPORT
+typedef struct
+{
+ kal_bool enable;
+ voip_sip_cap_boolean_type_enum audio;
+ voip_sip_cap_boolean_type_enum application;
+ voip_sip_cap_boolean_type_enum data;
+ voip_sip_cap_boolean_type_enum control;
+ voip_sip_cap_boolean_type_enum video;
+ voip_sip_cap_boolean_type_enum text;
+ voip_sip_cap_boolean_type_enum automata;
+ voip_sip_cap_class_type_enum class;
+ voip_sip_cap_duplex_type_enum duplex;
+ voip_sip_cap_mobility_type_enum mobility;
+ kal_char description[64];
+ kal_bool events;
+ kal_uint8 priority;
+ kal_bool methods;
+ kal_bool extensions;
+ kal_bool schemes;
+ voip_sip_cap_actor_type_enum actor;
+ voip_sip_cap_boolean_type_enum isfocus;
+}voip_sip_cap_struct;
+#endif
+
+#ifdef VOIP_SIP_CAPACITY_SUPPORT
+typedef struct _voip_caller_pref_struct
+{
+ voip_sip_cap_struct caller_pref;
+ voip_caller_pref_type_enum pref_type;
+} voip_caller_pref_struct;
+#endif
+/* This structure is used for the option of a call */
+typedef struct
+{
+ voip_codec_enum codec_order[VOIP_MAX_NUM_CODEC]; /* Array index of codec */
+ kal_bool auto_decline; /* Auto decline anonymouse */
+ kal_bool do_not_disturb; /* Auto reject all calls */
+ kal_bool hide_user_id; /* Hide user id or not */
+ kal_bool auto_answer; /* Auto answer mode in MMI */
+ kal_uint8 dtmf; /* In band or out-of-band DTMF */
+ kal_bool comfortable_noise; /* enable confortable noise or not */
+ kal_bool srtp; /* enable srtp usage or not */
+#ifdef VOIP_SIP_CAPACITY_SUPPORT
+ voip_sip_cap_struct sip_cap; /* SIP Capability */
+ voip_caller_pref_struct caller_pref[VOIP_MAX_CALLER_PREFERENCE];/* Caller Preference */
+#endif
+ kal_bool early_media; /* if send early media */
+}voip_setting_struct;
+
+
+/* This structure defines a structure to carry all kinds of call id. */
+typedef struct
+{
+ kal_uint32 call_id; /* Call ID */
+ kal_uint32 dialog_id; /* Dialog ID */
+}voip_call_id_struct;
+
+
+/* This structure is used for the address of a call. */
+typedef struct
+{
+ kal_char disp_name[VOIP_DISP_NAME_LEN*3]; /*Display name of the user, could be null */
+ kal_char uri[VOIP_URI_LEN]; /* Eg, "sip: a@b.c" */
+}voip_addr_struct;
+
+/* This structure is used for ringing indication */
+typedef struct
+{
+ voip_addr_struct *refer_by;
+ voip_call_id_struct *replaced_call;
+}voip_ring_data_struct;
+
+typedef struct
+{
+ kal_uint32 newmsgs;
+ kal_uint32 oldmsgs;
+ kal_bool is_urgent_present;
+ kal_uint32 new_urgentmsgs;
+ kal_uint32 old_urgentmsgs;
+}voip_msg_struct;
+
+/* socket address strcuture */
+typedef struct
+{
+ kal_int16 addr_len;
+ kal_uint8 addr[VOIP_MAX_SOCK_ADDR_LEN];
+ kal_uint16 port;
+} voip_sockaddr_struct;
+
+/* NAT address information */
+typedef struct
+{
+ voip_sockaddr_struct local_addr;
+ voip_sockaddr_struct derived_addr;
+}voip_nat_addr_struct;
+
+/* SDP crypto */
+typedef struct
+{
+ kal_uint8 crypto_idx;
+ srtp_crypto_struct crypto;
+} voip_crypto_struct;
+
+/* SDP sessoin */
+typedef struct
+{
+ kal_uint64 remote_sdp_version; /* remote SDP version */
+ kal_uint16 payload_type[VOIP_MAX_NUM_CODEC]; /* payload type */
+ kal_uint16 local_payload_type[VOIP_MAX_NUM_CODEC]; /* local payload type */
+ kal_uint16 dtmf_payload_type; /* payload type of DTMF */
+ kal_uint16 num_codec; /* number of codec supported in this section */
+ kal_uint16 remote_rtp_port; /* remote RTP port number */
+ kal_uint16 remote_rtcp_port; /* remote RTCP port number */
+ kal_uint16 local_rtp_port; /* local RTP port number */
+ kal_uint16 local_rtcp_port; /* local RTCP port number */
+ kal_uint16 ptime;
+ kal_uint16 maxptime;
+ kal_uint16 modeset[VOIP_MAX_NUM_CODEC]; /* modeset of codec */
+ voip_codec_enum codec[VOIP_MAX_NUM_CODEC]; /* suppored codec list */
+ kal_uint8 local_addr[VOIP_MAX_IP_SEG_LEN]; /* local address */
+ kal_uint8 remote_addr[VOIP_MAX_IP_SEG_LEN]; /* remote address */
+ kal_uint32 sdp_status; /* status info about sdp session */
+ voip_rtp_direction_enum direction; /* media direction,
+ sendonly, recvonly, sendrecv, inactive */
+ voip_annex_enum g7231_annexa; /* annexa for G7231 */
+ voip_annex_enum g729_annexb; /* annexb for G729 */
+ voip_crypto_struct *crypto_info; /* crypto information */
+}voip_sdp_struct; /* voip_session_struct; */
+
+/* This structure defines a dialog between two peers */
+typedef struct
+ {
+ kal_uint32 dialog_id; /* unique id of the dialog */
+ kal_int16 dialog_idx; /* unique index of call dialog */
+ voip_addr_struct user_addr; /* remote side address */
+ voip_sdp_struct sdp_info; /* Information of each media stream */
+#ifdef VOIP_EARLY_MEDIA_SUPPORT
+ voip_sdp_struct early_sdp_info; /* information of early media stream */
+#endif
+ voip_nat_addr_struct stun_addr[VOIP_MAX_DERIEVED_ADDR]; /* stun address */
+ voip_dlg_state_enum dialog_state; /* dialog state */
+ kal_bool in_use; /* dialog is in used */
+ kal_uint8 rel_prov_rsp; /* if 100rel is required in MT invite */
+}voip_dialog_struct;
+
+typedef struct
+{
+ kal_uint32 version; /* version of the conference state */
+ kal_bool is_conference; /* if the call is a conference server call */
+ voip_subs_state_enum subs_state; /* if the call state is subscribed */
+}voip_call_conf_info_struct;
+
+typedef struct
+{
+ kal_uint32 call_id; /* Call id */
+ voip_dialog_struct dialog[VOIP_MAX_NUM_DIALOG]; /* Dialog */
+ voip_call_conf_info_struct conf_info; /* information of conference server */
+ voip_call_state_enum call_state; /* Call state */
+ kal_uint8 num_dialogs; /* Number of dialog in this call */
+ kal_bool is_bk_call; /* If the call is a background call */
+}voip_call_struct;
+
+typedef struct
+{
+ voip_codec_enum codec[VOIP_MAX_NUM_CODEC]; /* suppored codec list */
+ voip_dlg_state_enum dialog_state; /* dialog state */
+ kal_bool in_use; /* dialog is in used */
+ kal_uint16 payload_type[VOIP_MAX_NUM_CODEC]; /* payload type */
+ kal_uint16 dtmf_payload_type; /* payload type of DTMF */
+ kal_uint16 num_codec; /* number of codec supported in this section */
+ kal_uint16 remote_rtp_port; /* remote RTP port number */
+ kal_uint16 remote_rtcp_port; /* remote RTCP port number */
+ kal_uint16 local_rtp_port; /* local RTP port number */
+ kal_uint16 local_rtcp_port; /* local RTCP port number */
+ kal_uint8 local_addr[VOIP_MAX_IP_SEG_LEN]; /* local address */
+ kal_uint8 remote_addr[VOIP_MAX_IP_SEG_LEN]; /* remote address */
+ kal_bool is_dtmf; /* is DTMF supported */
+ kal_bool is_sdp_exchanged; /* is SDP exchange finished */
+ voip_rtp_direction_enum direction; /* media direction, */
+ voip_annex_enum g7231_annexa; /* G7231 annexa */
+ voip_annex_enum g729_annexb; /* G729 annexb */
+ voip_crypto_struct *crypto_info; /* crypto info */
+}voip_dialog_info_struct;
+
+typedef struct
+{
+ kal_uint32 call_id;
+ voip_dialog_info_struct dialog[VOIP_MAX_NUM_DIALOG]; /* dialog */
+ voip_call_state_enum call_state; /* Call state */
+ kal_uint8 num_dialogs; /* Number of dialog in this call */
+ kal_bool is_bk_call; /* If the call is a background call */
+ kal_bool is_conference; /* If the call is a conference server call */
+}voip_call_info_struct;
+
+typedef struct
+{
+ voip_msg_struct msg[VOIP_MWI_TOTAL]; /* message indication list */
+ kal_bool msg_present[VOIP_MWI_TOTAL]; /* if the message is present */
+ kal_bool is_account_present; /* if message account is present */
+ kal_char msg_account[VOIP_URI_LEN]; /* Eg, "sip: a@b.c" */
+}voip_mwi_info_struct;
+
+
+typedef struct
+{
+ kal_char disp_name[VOIP_DISP_NAME_LEN*3]; /*Display name of the user, could be null */
+ kal_char uri[VOIP_URI_LEN]; /* Eg, "sip: a@b.c" */
+ voip_conf_user_status_enum state;
+}voip_conf_user_struct;
+
+
+/*****************************************************************************
+* Message struct
+*****************************************************************************/
+#define VOIP_MSG_STRUCT
+/* Registration */
+typedef struct
+{
+ kal_uint8 ref_count;
+ kal_uint16 msg_len;
+ voip_profile_struct profile; /* Profile settings */
+ voip_setting_struct setting; /* Setting of the call */
+}mmi_voip_register_req_struct;
+
+/* Setting */
+typedef struct
+{
+ kal_uint8 ref_count;
+ kal_uint16 msg_len;
+ voip_setting_struct setting; /*Setting of the call */
+}mmi_voip_setting_req_struct;
+
+typedef struct
+{
+ kal_uint8 ref_count;
+ kal_uint16 msg_len;
+ kal_uint8 result; /* result */
+ kal_int32 cause; /* cause of the result */
+}mmi_voip_result_struct;
+
+typedef mmi_voip_result_struct mmi_voip_register_rsp_struct;
+typedef mmi_voip_result_struct mmi_voip_deregister_rsp_struct;
+typedef mmi_voip_result_struct mmi_voip_deregister_ind_struct;
+typedef mmi_voip_result_struct mmi_voip_setting_rsp_struct;
+
+/* call related indications */
+typedef struct
+{
+ kal_uint8 ref_count;
+ kal_uint16 msg_len;
+ kal_uint32 call_id; /* call id of the ringing call */
+ kal_uint32 dialog_id; /* dialog id of the ringing call */
+ voip_addr_struct refer_by; /* Address of the refer-by field */
+ kal_wchar call_list[VOIP_FILE_LEN]; /* Name of call list file */
+ kal_bool is_refer_by; /* If the call is refered by other users */
+#ifdef VOIP_DEBUG_CALL_LIST
+ voip_call_info_struct call_info[6];
+#endif
+}mmi_voip_call_ring_ind_struct;
+
+typedef struct
+{
+ kal_uint8 ref_count;
+ kal_uint16 msg_len;
+ kal_uint32 call_id; /* call id of the ringing call */
+ kal_uint32 dialog_id; /* dialog id of the ringing call */
+ kal_uint32 replace_call_id; /* call id of the replaced call */
+ kal_uint32 replace_dialog_id; /* dialog id of the ringing call */
+}mmi_voip_call_replace_ind_struct;
+
+typedef struct
+{
+ kal_uint8 ref_count;
+ kal_uint16 msg_len;
+ kal_uint8 result; /* Accept the call or not */
+ kal_uint32 call_id; /* call id of the ringing call */
+ kal_uint32 dialog_id; /* dialog id of the ringing call */
+ kal_uint32 replace_call_id; /* call id of the replaced call */
+ kal_uint32 replace_dialog_id; /* dialog id of the ringing call */
+}mmi_voip_call_replace_cnf_struct;
+
+typedef struct
+{
+ kal_uint8 ref_count;
+ kal_uint16 msg_len;
+ kal_uint32 replace_call_id; /* call id of the replaced call */
+ kal_uint32 replace_dialog_id; /* dialog id of the replaced call */
+ voip_call_struct call; /* affected call */
+}mmi_voip_call_replace_complete_ind_struct;
+
+typedef struct
+{
+ kal_uint8 ref_count;
+ kal_uint16 msg_len;
+ kal_uint32 call_id; /* Call ID */
+ kal_uint32 dialog_id; /* Dialog ID */
+ kal_int32 cause; /* cause of the result */
+ kal_uint8 result; /* result */
+ kal_wchar call_list[VOIP_FILE_LEN]; /* length of cal list file */
+ kal_uint16 status_code; /* status code of call end */
+#ifdef VOIP_DEBUG_CALL_LIST
+ voip_call_info_struct call_info[6];
+#endif
+}mmi_voip_call_end_ind_struct;
+
+typedef struct
+{
+ kal_uint8 ref_count;
+ kal_uint16 msg_len;
+ kal_uint32 call_id; /* Call ID */
+ kal_uint32 dialog_id; /* Dialog ID */
+ kal_char tansfer_target[VOIP_URI_LEN]; /* Address of the transfer target. Used when the remote site asks to transfer the call */
+ voip_state_ind_enum change_cause; /* Main state of changes */
+ voip_call_struct call; /* affect call */
+#if 0
+/* under construction !*/
+#ifdef VOIP_DEBUG_CALL_LIST
+/* under construction !*/
+#endif
+#endif
+}mmi_voip_call_state_ind_struct;
+
+typedef struct
+{
+ kal_uint8 ref_count;
+ kal_uint16 msg_len;
+ kal_uint32 call_id; /* Call ID */
+ kal_uint32 dialog_id; /* Dialog ID */
+ voip_call_progress_enum status; /* Status of the call (ringing, forward, and etc..) */
+ kal_wchar call_list[VOIP_FILE_LEN]; /* length of cal list file */
+#ifdef VOIP_DEBUG_CALL_LIST
+ voip_call_info_struct call_info[6];
+#endif
+}mmi_voip_progressing_ind_struct;
+
+/* call action request */
+typedef struct
+{
+ kal_uint8 ref_count;
+ kal_uint16 msg_len;
+ kal_char target_call[VOIP_URI_LEN]; /* Eg, "sip: a@b.c" Call to be dialed */
+ voip_call_id_struct active_call; /* Call to be activated. Call Transfer also uses this as the transferee */
+ voip_call_id_struct hold_call; /* Call to be held */
+ voip_call_id_struct rel_call; /* Call to be released or rejected */
+ voip_call_act_enum op_code; /* Operation code */
+ kal_int8 abort_call_id;
+#ifdef VOIP_SIP_CAPACITY_SUPPORT
+ voip_caller_pref_struct caller_pref[VOIP_MAX_CALLER_PREFERENCE];
+#endif
+}mmi_voip_call_act_req_struct;
+
+typedef struct
+{
+ kal_uint8 ref_count;
+ kal_uint16 msg_len;
+ voip_call_act_enum op_code; /* Operation code */
+ kal_uint8 result; /* result */
+ kal_int32 cause; /* cause of the result */
+ kal_wchar call_list[VOIP_FILE_LEN]; /* length of cal list file */
+#ifdef VOIP_DEBUG_CALL_LIST
+ voip_call_info_struct call_info[6];
+#endif
+}mmi_voip_call_act_rsp_struct;
+
+/* MWI, this primitive is used to notify the status of waiting message. */
+typedef struct
+{
+ kal_uint8 ref_count;
+ kal_uint16 msg_len;
+ kal_bool is_msg_waiting;
+ voip_mwi_info_struct mwi_info;
+}mmi_voip_waiting_msg_ind_struct;
+
+/* conference state indication structure */
+typedef struct
+{
+ kal_uint8 ref_count;
+ kal_uint16 msg_len;
+ kal_uint32 call_id; /* call ID */
+ kal_uint32 dlg_id; /* dialog ID */
+ kal_uint32 count; /* number of entity in this indication */
+ kal_wchar file_path[VOIP_FILE_LEN]; /* file path+name for entity list */
+ voip_conf_state_enum conf_state; /* state of conference indication */
+}mmi_voip_conference_state_ind_struct;
+
+#ifdef SIP_CONFORMANCE_TEST
+/* MWI, this primitive is used to notify the status of waiting message. */
+typedef struct
+{
+ kal_uint8 ref_count;
+ kal_uint16 msg_len;
+ kal_char uri[VOIP_URI_LEN]; /* Address of remote server */
+}mmi_voip_option_req_struct;
+
+/* MWI, this primitive is used to notify the status of waiting message. */
+typedef struct
+{
+ kal_uint8 ref_count;
+ kal_uint16 msg_len;
+ kal_uint8 result; /* result */
+ kal_int32 cause; /* cause of the result */
+ kal_char data[VOIP_SIP_OPTION_LEN];
+}mmi_voip_option_rsp_struct;
+#endif /* SIP_CONFORMANCE_TEST */
+
+/* Transferee, this primitive is used to notify an refer is received */
+typedef struct
+{
+ kal_uint8 ref_count;
+ kal_uint16 msg_len;
+ kal_bool result;
+}mmi_voip_transferee_cnf_struct;
+
+typedef struct
+{
+ kal_uint8 ref_count;
+ kal_uint16 msg_len;
+ kal_uint8 result; /* result */
+ kal_int32 cause; /* cause of the result */
+ kal_uint32 call_id; /* Call ID */
+ kal_uint32 dialog_id; /* Dialog ID */
+}mmi_voip_act_bk_rej_rsp_struct;
+
+#endif /* _MMI2VOIP_STRUCT_H */
+
diff --git a/mcu/protocol/interface/general/mmllc_enums.h b/mcu/protocol/interface/general/mmllc_enums.h
new file mode 100644
index 0000000..f150ed2
--- /dev/null
+++ b/mcu/protocol/interface/general/mmllc_enums.h
@@ -0,0 +1,116 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * mmllc_enums.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file contains enum definition between MM and LLC.
+ *
+ * Author:
+ * -------
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _MMLLC_ENUMS_H_
+#define _MMLLC_ENUMS_H_
+
+/* MMLLC_ENUMS is for the enums used b/w modules MM and LLC Only
+ * It can be either MM2LLC or LLC2MM
+ * We will have a single file
+ */
+
+#define CIPHERING_NOT_USED 0
+
+
+typedef enum {
+ LLGMM_CAUSE_MULTIPLE_TLLI_ASSIGMNENT,
+ LLGMM_CAUSE_FRMR_RECEIVED_IN_ABM,
+ LLGMM_CAUSE_UNSOLICITED_RESPONSE_RECEIVED,
+ LLGMM_CAUSE_MAX_RETX_COUNT_REACHED,
+ LLGMM_CAUSE_FRAME_REJECT_CONDITION,
+ LLGMM_CAUSE_LLC_FAILURE,
+ LLGMM_CAUSE_LOWER_LAYER_FAILURE /* Only this is being used in MM */
+#ifdef __GEMINI__
+ , LLGMM_CAUSE_RR_IN_SUSPEND_MODE
+#endif
+} llgmm_cause_enum;
+
+/* Jeff Wu 2005-03-03 :R99 feature */
+typedef enum {
+ LLGMM_ANY_FRAME = 0,
+ LLGMM_ANY_FRAME_EXCEPT_NULL,
+ LLGMM_NULL_FRAME_ONLY
+} llgmm_cell_update_type_enum;
+/* End of Jeff Wu 2005-03-03 */
+#endif
+
+
diff --git a/mcu/protocol/interface/general/mpal2rr_struct.h b/mcu/protocol/interface/general/mpal2rr_struct.h
new file mode 100644
index 0000000..6166cbe
--- /dev/null
+++ b/mcu/protocol/interface/general/mpal2rr_struct.h
@@ -0,0 +1,729 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * mpal2rr_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ *
+ *
+ *==============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+
+#ifndef _MPAL2RR_STRUCT_H
+#define _MPAL2RR_STRUCT_H
+
+/*Evelyn: Remove redundant header and file */
+#include "rr_mpal_interface.h"
+#include "kal_general_types.h"
+#include "l3_inc_enums.h"
+#include "mph_cs_def.h"
+#include "rr_common_enums.h"
+#ifdef __PS_L1_DC_ARCH__
+#include "ps_l1_shared_info.h"
+#endif
+
+
+typedef struct {
+ kal_int16 c_value; /* Austin 040413: report c_value in dbm, instead of rxlev */
+ kal_uint8 is_bl_var_valid;
+ kal_uint16 bl_var;
+ kal_uint16 bit_count[4];
+ kal_uint16 bit_error_count[4];
+} ch_quality_rep_struct;
+
+typedef struct {
+ kal_uint8 time_slot;
+ kal_uint8 cs;
+ kal_uint8 is_bad_block;
+ channel_type_enum ch_type;
+/* End Claire 041118 change : Modify dl_radio_blk_struct : To be removed later */
+ kal_uint8 is_data_buffer;
+#ifdef MCD_PACK_UNPACK
+ kal_uint8 data[75];
+#else
+ kal_uint8 *data;
+#endif
+
+ #ifdef __EGPRS_MODE__
+ kal_int32 meanBep; /* Mean_BEP(block), no meaning if not in EGPRS mode*/
+ kal_int32 cvBep; /* CV_BEP(block), no meaning if not in EGPRS mode */
+ kal_uint8 header[6];
+#ifdef MCD_PACK_UNPACK
+ kal_uint8 data2[75];
+#else
+ kal_uint8 *data2;
+#endif
+ kal_uint8 is_data_valid;
+ kal_uint8 is_data2_valid;
+
+#ifdef __GERAN_FANR__
+ kal_uint8 is_pan_valid;
+ kal_uint8 pan[4];
+#endif
+
+ #endif
+
+} dl_radio_blk_struct;
+
+typedef struct{
+ kal_uint32 frame_no;
+ kal_uint8 rrbp_txed;
+ kal_uint8 is_usf_detected;// bitmap of usf detected
+ kal_uint8 ctrl_blks_free_in_q;
+ kal_uint8 no_data_txed[MAX_TBF_NUM];
+ kal_uint8 is_alloc_exhausted;
+#ifdef __GERAN_FANR__
+ kal_uint8 time_slot;
+#endif
+}ready_to_send_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 scan_id;
+ kal_bool bcch_list_valid;
+ kal_int16 power_sum_in_quarter_dbm[MPH_MAX_POWER_SCAN_RESULTS_LEN]; /* Defined in mph_cs_msg.h */
+ kal_uint8 bands_scan;
+ kal_bool is_quick_mcc_search;
+} mpal_rr_search_rf_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint16 arfcn;
+ kal_uint8 result;
+ kal_uint8 bsic;
+ kal_int32 frame_offset;
+ kal_int32 ebit_offset;
+ kal_int32 bitErrorCount;
+ kal_int16 snr;
+ kal_int16 real_snr;
+} mpal_rr_bsic_sync_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ rr_block_monitor_enum block_ind; /* ref. to mph_block_monitor_enum */
+ kal_uint8 tc;
+ kal_uint32 frame_no;
+ kal_uint16 arfcn;
+ channel_type_enum channel_type;
+ kal_uint8 data[23];
+ kal_int16 c_value; /* Austin 040413: report c_value in dbm, instead of rxlev */
+ kal_bool is_serving; /* Only for check NBCCH or BCCH*/
+} mpal_rr_data_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 req_id; /*sequence number for RR to know the ._cnf received is old or new*/
+ kal_uint32 frame_number;
+ kal_uint16 rach_data;
+ kal_uint16 current_tx_power_in_dbm;
+} mpal_rr_rach_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 t0;
+
+#ifdef __BLIND_HANDOVER__
+ /* Elly20080228, report the frame offset and ebit offset to RR in case that the blind handover is executed
+ * and RR has no timing information to report the OTD to NW if requested. */
+ kal_int32 target_frame_offset;
+ kal_int32 target_ebit_offset;
+#endif /* end of __BLIND_HANDOVER__ */
+
+} mpal_rr_handover_success_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ handover_fail_cause_enum error_cause;
+
+} mpal_rr_handover_fail_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 current_dch;
+ kal_uint8 is_freq_in_one_band;
+ kal_uint8 starting_time_expired;
+} mpal_rr_frequency_redefinition_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 ext_meas_freq_list_len;
+ kal_uint8 dtx_used;
+ kal_uint8 list_ref;
+ kal_uint16 arfcn[64];
+ kal_int16 rlac_in_quarter_dbm[64];
+} mpal_rr_extended_meas_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_int16 rla_in_quarter_dbm;
+ kal_uint8 timing_advanced; /* TY: used for AGPS, report packet TA in PTM */
+#ifdef UNIT_TEST
+ kal_uint32 meas_ind_ms_diff;
+#endif /* UNIT_TEST */
+ kal_int16 real_snr;
+} mpal_rr_serv_idle_meas_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_int16 rlac_full_in_quarter_dbm;
+ kal_int16 rlac_sub_in_quarter_dbm;
+ kal_uint8 rxqual_full_avg;
+ kal_uint8 rxqual_sub_avg;
+ kal_uint8 dtx_used;
+ kal_int16 current_tx_power_in_dbm; /* Maruco20100423, to show the tx power level in engineering mode */
+ kal_int8 mean_bep;
+ kal_int8 cv_bep;
+ kal_int32 rxlev_val;
+ kal_int8 nbr_rcdv_blocks;
+#if defined (__AMR_SUPPORT__) || defined (__AMRWB_LINK_SUPPORT__)
+ kal_bool amr_info_valid;
+ kal_bool dl_dtx; /* Maruco20100423, to show DL DTX is on/off in engineering mode */
+ kal_uint8 cmr_cmc_cmiu_cmid;
+ kal_uint8 c_i;
+ kal_uint16 icm;
+ kal_uint16 acs;
+#endif /* __AMR_SUPPORT__ || __AMRWB_LINK_SUPPORT__*/
+
+ kal_int16 real_snr;
+} mpal_rr_serv_dedi_meas_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 list_ref;
+ kal_uint8 list_len;
+ kal_uint16 arfcn_list[33];
+ kal_int16 rla_in_quarter_dbm[33];
+ kal_int16 afc_dac[33];
+#if defined(__UMTS_RAT__) || defined(__LTE_RAT__)
+ /* Elly20081003, Indicates the following 4 idle frames are for GSM or other RAT. */
+ kal_uint8 is_occupied_by_other_rat;
+#endif /* defined(__UMTS_RAT__) || defined(__LTE_RAT__) */
+} mpal_rr_neighbor_meas_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+#if defined (__PS_SERVICE__) && defined (__PKT_EXT_MEAS__)
+ kal_uint8 is_for_extended_meas;
+#endif /*(__PS_SERVICE__) && (__PKT_EXT_MEAS__)*/
+ kal_uint16 arfcn;
+ kal_uint8 bsic_valid;
+ kal_uint8 bsic;
+ kal_uint8 burst_access_id;
+ kal_int32 frame_offset;
+ kal_int32 ebit_offset;
+ kal_uint8 is_for_manual_list;
+ kal_int16 snr;
+ kal_int16 real_snr;
+} mpal_rr_neighbor_bsic_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint16 arfcn;
+ kal_uint8 bsic_valid;
+ kal_uint8 bsic;
+ kal_uint8 burst_access_id;
+ kal_int32 frame_offset;
+ kal_int32 ebit_offset;
+} mpal_rr_cell_bsic_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 list_ref;
+ kal_uint8 list_len;
+ kal_uint16 arfcn_list[33];
+ kal_int16 nc_meas_in_qdbm[33];
+} mpal_rr_nc_measurement_ind_struct;
+
+#ifdef __PKT_EXT_MEAS__
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 list_len;
+ kal_uint16 arfcn_list[32];
+ kal_uint8 ext_meas_in_rxlev[32];
+} mpal_rr_pkt_ext_measurement_ind_struct;
+#endif /*__PKT_EXT_MEAS__*/
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 carrier_ref;
+ kal_uint8 valid_meas_ts;
+ kal_int16 ss_sample[8];
+ kal_uint8 int_meas_freq;
+ kal_uint32 frame_number;
+} mpal_rr_int_measurement_ind_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ kal_bool is_all_tbf_rel;
+ kal_uint8 ul_tbf_bitmap;
+ kal_uint8 dl_tbf_bitmap;
+}mpal_rr_pdtch_disconn_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 transition_id_ul[MAX_TBF_NUM];
+ kal_uint8 transition_id_dl[MAX_TBF_NUM];
+ kal_uint8 ul_tbf_bitmap;
+ kal_uint8 dl_tbf_bitmap;
+} mpal_rr_pdtch_connect_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint32 frame_no;
+ kal_uint16 arfcn;
+ ch_quality_rep_struct ch_qual_rep;
+ kal_uint8 no_dl_radio_blks;
+ //kal_uint8 dl_radio_blks_size;
+ dl_radio_blk_struct dl_radio_blks[4];
+ #ifdef __EGPRS_MODE__
+ kal_uint8 out_of_mem;
+ kal_uint16 dsp_vq[MAX_TBF_NUM];
+ #endif
+
+ kal_uint8 is_ul_blk_conflict; /* only used in G2.0+ */
+ kal_uint8 is_rts_info_valid;
+ ready_to_send_ind_struct rts_info;
+ kal_uint8 dl_mTBFtid[MAX_TBF_NUM];
+
+#ifdef __MONITOR_PAGE_DURING_TRANSFER__
+ /* Provide next pch frame number for MAC to enhance ps performance during PS transfer*/
+ kal_uint32 next_pch_fn;
+#endif /*end of __MONITOR_PAGE_DURING_TRANSFER__*/
+
+#ifndef __MTK_TARGET__
+ kal_uint8 pack_data[23];
+#endif
+
+ /* Yu-Po: 20140430 add for report transmit power to upper layer*/
+ kal_uint16 current_tx_power_in_dbm[8];
+
+} mpal_rr_transfer_data_ind_struct;
+
+#ifdef __PS_L1_DC_ARCH__
+#ifndef __MTK_TARGET__
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 source;
+ /* U1 part */
+ PrePacketUplinkSpecDescription ppusDes;
+
+ /* U2 part */
+ mpal_l1i_rts_information_struct RTSInfo;
+}mpal_dc_debug_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 tail;
+ kal_uint32 head;
+ kal_uint32 num_of_rrbp_in_mpal_queue;
+ kal_uint32 mpal_rrbp[4];
+ kal_uint32 mpal_min_rrbp_fn;
+}mpal_dc_debug_min_rrbp_ind_struct;
+#endif
+#endif
+
+#if (!defined(__MTK_TARGET__)) && (defined (__GERAN_RTTI__) || defined(__GERAN_FANR__))
+#include "mph_cnst.h"
+#include "mph_types.h"
+#include "mph_cs_def.h"
+#include "mph_cs_msg.h"
+#include "mph_ps_def.h"
+#include "mph_ps_msg.h"
+
+typedef struct {
+ LOCAL_PARA_HDR
+ mphp_packet_downlink_struct ptr_pkt_dl;
+ mph_rx_multislot_data_struct rx_data[4];
+}mpal_rr_transfer_data_notice_ind_struct;
+#endif
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 is_successful;
+} mpal_rr_ccch_rrbp_cnf_struct;
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 is_successful;
+} mpal_rr_deactivate_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool success;
+} mpal_rr_set_rat_service_cnf_struct;
+
+#ifdef __PS_SERVICE__
+#endif /* end of __PS_SERVICE__ */
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 pch_data[23];
+} mpal_rr_detect_paging_block_callback_req_struct;
+
+/******************************************************************************/
+/* Multi-mode Standby GSM inter-RAT process */
+/******************************************************************************/
+
+#if defined(__UMTS_RAT__) || defined(__LTE_RAT__)
+#include "gas_eas_enums.h"
+
+#define STANDBY_GSM_MEAS_MAX_CELL_NUM (32)
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 list_ref;
+ kal_uint8 list_len;
+ kal_int16 arfcn_list[STANDBY_GSM_MEAS_MAX_CELL_NUM];
+ kal_int16 rla_in_quarter_dbm[STANDBY_GSM_MEAS_MAX_CELL_NUM];
+ kal_uint32 bsic_reconfirm_para;
+#ifdef UNIT_TEST
+ kal_uint32 time_stamp;
+#endif /* UNIT_TEST */
+ kal_bool is_not_all_arfcn_measured;
+} mpal_rr_standby_gsm_meas_ind_struct;
+
+#if defined(__23G_PRI_RESEL_SUPPORT__) || defined(__LTE_RAT__)
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 list_ref;
+ kal_uint8 list_len;
+ kal_int16 arfcn_list[STANDBY_GSM_MEAS_MAX_CELL_NUM];
+ kal_int16 rla_in_quarter_dbm[STANDBY_GSM_MEAS_MAX_CELL_NUM];
+#ifdef UNIT_TEST
+ kal_uint32 time_stamp;
+#endif /* UNIT_TEST */
+} mpal_rr_standby_gsm_prio_meas_ind_struct;
+#endif /* defined(__23G_PRI_RESEL_SUPPORT__) || || defined(__LTE_RAT__) */
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint16 arfcn;
+ kal_bool bsic_valid;
+ kal_uint8 bsic;
+ kal_uint32 frame_offset;
+ kal_uint32 ebit_offset;
+ kal_uint32 time_stamp;
+} mpal_rr_standby_gsm_bsic_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+} mpal_rr_inter_rat_handover_cnf_struct;
+
+#ifdef __LTE_RAT__
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 scan_id;
+ kal_uint16 arfcn;
+ kal_int16 power_sum_in_quarter_dbm;
+} mpal_rr_standby_gsm_report_cgi_search_rf_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 bsic_tid;
+ kal_uint16 arfcn;
+ kal_bool bsic_valid;
+ kal_int8 bsic;
+ kal_int32 frame_offset;
+ kal_int32 ebit_offset;
+} mpal_rr_standby_gsm_report_cgi_bsic_ind_struct;
+#endif /* __LTE_RAT__ */
+#endif /* defined(__UMTS_RAT__) || defined(__LTE_RAT__) */
+
+#endif /* _MPAL2RR_STRUCT_H */
diff --git a/mcu/protocol/interface/general/mpal_enums.h b/mcu/protocol/interface/general/mpal_enums.h
new file mode 100644
index 0000000..41e7f9a
--- /dev/null
+++ b/mcu/protocol/interface/general/mpal_enums.h
@@ -0,0 +1,133 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/******************************************************************************
+ * Filename:
+ * ---------
+ * mpal_enums.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *=============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *=============================================================================
+ ******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _MPAL_ENUMS_H
+#define _MPAL_ENUMS_H
+
+/* The states of MPAL */
+typedef enum
+{
+ MPAL_NULL_STATE = 0x00,
+ MPAL_CS_SCAN = 0x80,
+ MPAL_CS_IDLE = 0x40,
+ MPAL_CS_ACCESS = 0x20,
+ MPAL_CS_DEDICATED = 0x10,
+ MPAL_CCCH_PS_IDLE = 0x08, /* __PS_SERVICE__ start */
+ MPAL_PCCCH_PS_IDLE = 0x04,
+ MPAL_PS_ACCESS = 0x02,
+ MPAL_PS_TRANSFER = 0x01 /* __PS_SERVICE__ end */
+} mpal_state_enum;
+
+#ifdef __GEMINI__
+typedef enum
+{
+ MPAL1 = 0x0,
+ MPAL2 = 0x1,
+ MPAL3 = 0x2, /* Gemini+ */
+ MPAL4 = 0x3, /* Gemini+ */
+ MPAL_INVALID_NO = 0xF
+} mpal_current_cntx_ptr_enum;
+
+typedef enum
+{
+ GEMINI_NORMAL_MODE = 0x0,
+ GEMINI_SUSPEND_MODE = 0x1,
+ GEMINI_VIRTUAL_MODE = 0x2 /* Gemini 2.0 */
+} mpal_gemini_mode_enum;
+#endif /* end of __GEMINI__ */
+
+
+typedef enum
+{
+ MPAL_QUEUE_NULL = 0x0,
+ MPAL_QUEUE_PDTCH_DISCONN = 0x1,
+ MPAL_QUEUE_SUSPENSION = 0x2 /* for Gemini */
+} mpal_queue_reason_enum;
+
+typedef enum
+{ /* shall sync with RLC_TIMER_NUM_MSGS value */
+ MPAL_T3124_TIMER_ID = 0,
+ MPAL_TIMER_NUM_MSGS
+} mpal_timer_id_enum; /* MPAL_TIMER Message Type */
+
+#endif /* _MPAL_ENUMS_H */
diff --git a/mcu/protocol/interface/general/mrs_as_enums.h b/mcu/protocol/interface/general/mrs_as_enums.h
new file mode 100644
index 0000000..7f28270
--- /dev/null
+++ b/mcu/protocol/interface/general/mrs_as_enums.h
@@ -0,0 +1,593 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * mrs_as_enums.h
+ *
+ * Project:
+ * --------
+ * Multimode
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ----------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ ******************************************************************************/
+#ifndef _MRS_AS_ENUMS_H
+#define _MRS_AS_ENUMS_H
+
+#include "global_def.h"
+#include "l3_inc_enums.h"
+#include "ps_public_enum.h"
+#include "mrs_as_inter_core_enum.h"
+#include "mrs_as_irat_enums.h"
+
+typedef enum
+{
+ INITIAL,
+ SHARED,
+ OCCUPIED
+}lower_layer_availability_enum;
+
+#if defined(__GEMINI__)
+#define MAX_GAS_CAPABILITY MAX_GSM_NUM
+#define MAX_UAS_CAPABILITY MAX_UMTS_NUM
+#define MAX_EAS_CAPABILITY MAX_LTE_NUM
+#define MAX_MM_CAPABILITY MAX_GSM_NUM /* assume GSM number > UMTS number */
+#define MAX_EMM_CAPABILITY MAX_LTE_NUM
+#ifdef __FIVEG_NAS__
+#define MAX_VGNAS_CAPABILITY MAX_SIM_NUM
+#endif /* __FIVEG_NAS__ */
+#define MAX_CAS_CAPABILITY 1
+#ifdef __NR_RAT__
+#define MAX_NRAS_CAPABILITY MAX_NR_NUM
+#endif /* __NR_RAT__ */
+#else
+#define MAX_GAS_CAPABILITY 1
+#define MAX_UAS_CAPABILITY 1
+#define MAX_EAS_CAPABILITY 1
+#define MAX_MM_CAPABILITY 1
+#define MAX_EMM_CAPABILITY 1
+#ifdef __FIVEG_NAS__
+#define MAX_VGNAS_CAPABILITY 1
+#endif /* __FIVEG_NAS__ */
+#define MAX_CAS_CAPABILITY 1
+#ifdef __NR_RAT__
+#define MAX_NRAS_CAPABILITY 1
+#endif /* __NR_RAT__ */
+#endif
+
+#define MAX_ASSOCIATION_LAI_CELL_INFO 12
+#define MAX_ASSOCIATION_SAME_LAI_CELL_INFO 24
+
+/* For fast resume and Search info. reuse for mode switch. */
+#define SI1_RAW_VALID 0x01 //00000001
+#define SI2_RAW_VALID 0x02 //00000010
+#define SI2BIS_RAW_VALID 0x04 //00000100
+#define SI3_RAW_VALID 0x08 //00001000
+#define SI4_RAW_VALID 0x10 //00010000
+#define SI13_RAW_VALID 0x20 //00100000
+#define SI1_EXIS 0x80 //10000000
+#define SI2SERIES_RAW_VALiD 0x06 //00000110 si2 & si2bis
+#define ALL_SI_RAW_VALID 0xbf //10111111
+#ifdef __PS_SERVICE__
+#define GAS_FAST_MODE_SWITCH_VALID_SI 0xbf //10111111
+#else
+#define GAS_FAST_MODE_SWITCH_VALID_SI 0x9f //10011111
+#endif
+#define GAS_SI_RAW_DATA_LEN 20
+
+
+#ifdef __GAS_STORED_SI_FEAT__
+#define RRM_MAX_SI2TER_INSTANCES 8
+#define RRM_SI2TER_REST_LEN 4
+#define RRM_MAX_SI2QUARTER_INSTANCES 16
+#define RRM_SI2QUARTER_REST_LEN 20
+#define RRM_MAX_SIZE_OF_GAS_STORED_SI_LIST 8
+#define GAS_CANDIDATE_TICK_INIT (0xFFFFFFFF)
+#endif
+
+#define AFR_MASK_2G4 0x0001
+#define AFR_MASK_3G4 0x0002
+#define AFR_MASK_2G5_FDD 0x0004
+#define AFR_MASK_2G5_TDD 0x0008
+#define AFR_MASK_3G5_FDD 0x0010
+#define AFR_MASK_3G5_TDD 0x0020
+#define AFR_MASK_4G5 0x0040
+
+/* Already in l3_inc_enums.h
+typedef enum
+{
+ DEL_CSG,
+ ADD_CSG
+}csg_update_type_enum;
+*/
+
+typedef enum
+{
+ NO_CHANGE,
+ ALLOWED_CSG_LIST_CHANGED,
+ OPERATOR_CSG_LIST_CHANGED,
+ BOTH_CSG_LIST_CHANGED
+}white_list_update_type;
+
+/* Already in ps_public_enum.h
+typedef enum
+{
+ NOT_IN_WHITE_LIST,
+ ALLOWED_CSG,
+ OPERATOR_CSG,
+ UNAUTH_OPERATOR_CSG
+}csg_type_enum;
+*/
+
+typedef enum
+{
+ ALLOWED_CSG_LIST,
+ OPERATOR_CSG_LIST
+}csg_list_type_enum;
+
+typedef enum
+{
+ SIM_NEW_INSERTED,
+ SIM_FILE_UPDATED,
+ AS_UPDATED
+}csg_white_list_update_cause;
+
+typedef enum
+{
+ CSFB_REDUCE_LAU = 1,
+ CSFB_DEFER_SI13,
+ CSFB_2G_AFR,
+ CSFB_3G_AFR,
+ CSFB_2G_FDD_eCSFB,
+ CSFB_3G_FDD_eCSFB,
+ CSFB_2G_TDD_eCSFB,
+ CSFB_3G_TDD_eCSFB,
+ CSFB_ENHANCEMENT_ITEM_END
+}csfb_enhancement_enum;
+
+typedef enum
+{
+ BAND_39_DISABLE,
+ BAND_39_ENABLE
+}band_39_control_enum;
+
+typedef enum
+{
+ BAND_DISABLE,
+ BAND_ENABLE
+}eas_band_control_enum;
+
+typedef enum
+{
+ BG_SEARCH_2G4_FDD,
+ BG_SEARCH_3G4_FDD,
+ BG_SEARCH_2G4_TDD,
+ BG_SEARCH_3G4_TDD,
+ BG_SEARCH_2G5_FDD,
+ BG_SEARCH_3G5_FDD,
+ BG_SEARCH_2G5_TDD,
+ BG_SEARCH_3G5_TDD,
+ BG_SEARCH_4G5
+}background_search_enum;
+
+typedef enum
+{
+ MRS_GAS_FAST_MODE_SWITCH_NOT_ALLOWED = 0x00, //Initial value
+ MRS_GAS_FAST_MODE_SWITCH_COLLECTING_ESSENTIAL_SI = 0x01 << 0, //RATCM_GAS_SYS_INFO not sent or still receiving essential SI
+ MRS_GAS_FAST_MODE_SWITCH_ESSENTIAL_SI_COLLECTED = 0x01 << 1, //RATCM_GAS_SYS_INFO sent
+ MRS_GAS_FAST_MODE_SWITCH_NOT_HAPPENED = 0x01 << 2, // DUPLEX mode change not happened
+ MRS_GAS_FAST_MODE_SWITCH_HAPPENED = 0x01 << 3, // DUPLEX mode change happened
+ MRS_GAS_FAST_MODE_SWITCH_NOT_HAPPENED_WO_SI = MRS_GAS_FAST_MODE_SWITCH_COLLECTING_ESSENTIAL_SI
+ + MRS_GAS_FAST_MODE_SWITCH_NOT_HAPPENED,
+ MRS_GAS_FAST_MODE_SWITCH_HAPPENED_BUT_WO_SI = MRS_GAS_FAST_MODE_SWITCH_COLLECTING_ESSENTIAL_SI
+ + MRS_GAS_FAST_MODE_SWITCH_HAPPENED,
+ MRS_GAS_FAST_MODE_SWITCH_NOT_HAPPENED_W_SI = MRS_GAS_FAST_MODE_SWITCH_ESSENTIAL_SI_COLLECTED
+ + MRS_GAS_FAST_MODE_SWITCH_NOT_HAPPENED,
+ MRS_GAS_FAST_MODE_SWITCH_ALLOWED = MRS_GAS_FAST_MODE_SWITCH_ESSENTIAL_SI_COLLECTED
+ + MRS_GAS_FAST_MODE_SWITCH_HAPPENED,
+} mrs_gas_fast_mode_switch_status_enum;
+
+typedef enum
+{
+ MODULE_NONE,
+ MODULE_ERRC_RCM,
+ MODULE_ERRC_CEL,
+ MODULE_ERRC_SPV,
+ MODULE_UAS_FDD,
+ MODULE_UAS_TDD,
+ MODULE_GAS_FDD,
+ MODULE_GAS_TDD,
+ MODULE_C2K
+#ifdef __NR_RAT__
+ ,
+ MODULE_NRRC_IDLE,
+ MODULE_NRRC_BACKGROUND,
+ MODULE_NRRC_NCONN,
+ MODULE_NRRC_MAIN
+#endif /* __NR_RAT__ */
+}function_caller_id_enum;
+
+typedef enum
+{
+ STATE_NONE=0,
+ CHINA_MCC
+}mrs_sim_band_cfg_state_enum;
+
+typedef enum
+{
+ DISABLE_BAND_STATE_NONE = 0,
+ DISABLE_BAND_7_38,
+ DISABLE_BAND_NULL_BAND
+}mrs_plmn_band_cfg_state_enum;
+
+typedef enum
+{
+ PARTIAL_BAND_SETTING_NONE = 0,
+ CHINA_PARTIAL_BAND_SETTING,
+ JAPAN_PARTIAL_BAND_SETTING
+}mrs_sim_partial_band_cfg_state_enum;
+
+typedef enum
+{
+ CUSTOM_DISABLE_BAND_BY_PLMN_NONE = 0,
+ CUSTOM_DISABLE_BAND_BY_PLMN,
+ CUSTOM_DISABLE_BAND_BY_PLMN_NULL_BAND
+}mrs_custom_disable_band_by_plmn_state_enum;
+
+typedef enum
+{
+ PLMN_REGION_BAND_SETTING_NONE=0,
+ PLMN_REGION_BAND_SETTING,
+ PLMN_REGION_BAND_SETTING_NULL_BAND
+}mrs_plmn_region_band_cfg_state_enum;
+
+typedef enum
+{
+ AS_RELEASE_INVALID=0,
+ AS_RELEASE_REL9,
+ AS_RELEASE_REL10,
+ AS_RELEASE_REL11,
+ AS_RELEASE_REL12,
+ AS_RELEASE_REL13,
+ AS_RELEASE_REL14,
+ AS_RELEASE_REL15
+}mrs_as_release_enum;
+
+typedef enum
+{
+ CSFB_CALL_STATUS_UNKNOWN=0,
+ CSFB_CALL_SUCCESS,
+ CSFB_CALL_FAILURE
+}mrs_gas_ecsfb_call_status_enum;
+
+typedef enum
+{
+ AFR_2G4,
+ AFR_3G4,
+ AFR_2G5_FDD,
+ AFR_2G5_TDD,
+ AFR_3G5_FDD,
+ AFR_3G5_TDD,
+ AFR_4G5,
+ AFR_ENHANCEMENT_ITEM_END
+}afr_enhancement_enum;
+
+typedef enum
+{
+ SRVC_VOICE_TRIGGER_AT_5G,
+ SRVC_VOICE_TRIGGER_AT_4G,
+ SRVC_SS_TRIGGER_AT_5G,
+ SRVC_SS_TRIGGER_AT_4G,
+ SRVC_CSFB_TRIGGER_AT_4G,
+ SRVC_EPSFB_TRIGGER_AT_5G,
+ SRVC_LPP,
+ SRVC_EMERGENCY,
+ SRVC_CELLULAR_CALL,
+ AFR_SRVC_MAX_NUM
+}afr_service_enum;
+
+typedef enum
+{
+ PROC_CSFB_FROM_4G,
+ PROC_SRVCC_FROM_4G,
+ PROC_EPSFB_FROM_5G,
+ PROC_SRVCC_FROM_5G,
+ AFR_PROC_MAX_NUM
+}afr_pre_cond_proc_enum;
+
+typedef enum
+{
+ IRAT_PINGPONG_4G3=0, /* When the RAT Change between 4G & 3G, inclding 4G3 and 3G4 */
+ IRAT_PINGPONG_4GC2K, /* When the RAT Change is 4G to C2K, but C2K to 4G is MPSR */
+ IRAT_PINGPONG_4G2, /* When the RAT Change between 4G & 2G, inclding 4G2 and 2G4 */
+// IRAT_PINGPONG_3G2, /* When the RAT Change between 3G & 2G, inclding 3G2 and 2G3 */
+ IRAT_PINGPONG_4G5, /* When the RAT Change between 4G & 5G, inclding 4G5 and 5G4 */
+ IRAT_PINGPONG_TYPE_NUM
+}mrs_irat_pingpong_type_enum;
+
+typedef enum
+{
+ MRS_GEMINI_DSDS_MODE,
+ MRS_GEMINI_DR_DSDS_MODE,
+ MRS_GEMINI_DSDA_MODE,
+}mrs_gemini_mode_enum;
+
+
+typedef enum
+{
+ /* MRS_FEAT_IGNORE_REDIRECT_TO_LTE:
+ * - Usage: Ignore the redirection to LTE if no suitable cell could be found.
+ * [EAS] ERRC would set this feature to TRUE if continous redirection failures are detected.
+ * [UAS] 3G TDD would query if needed to ignore the redirection. */
+ MRS_FEAT_IGNORE_REDIRECT_TO_LTE=0,
+ MRS_FEAT_NUM
+}mrs_feature_enum;
+
+typedef enum
+{
+ MRS_AFR_STRICT_CONSTRAIN_SEARCH_NOT_TRIGGERED,
+ MRS_AFR_STRICT_CONSTRAIN_SEARCH_TRIGGERED,
+ MRS_AFR_STRICT_CONSTRAIN_SEARCH_TRIGGERED_AND_FAILED
+}mrs_afr_strict_constrain_state;
+
+
+#define MRS_FEAT_BITMAP_SIZE ( (MRS_FEAT_NUM % 8 == 0)? (MRS_FEAT_NUM/8) : (MRS_FEAT_NUM/8 + 1) )
+
+#if (CUR_GEN >= MD_GEN97)
+typedef enum
+{
+ MRS_GEMINI_STATUS_FULL_CAP,
+ MRS_GEMINI_STATUS_DATA_SIM,
+ MRS_GEMINI_STATUS_NON_DATA_SIM,
+ MRS_GEMINI_STATUS_INVALID
+} mrs_gemini_status_enum;
+#endif /* (CUR_GEN >= MD_GEN97) */
+typedef enum
+{
+ MRS_AS_CAPA_NONE =0,
+ MRS_AS_CAPA_ERRC_NSA_MODE_ASN_DECODE_ERROR =1,
+ MRS_AS_CAPA_ERRC_NSA_MODE_IE_ERROR =2,
+ MRS_AS_CAPA_EMM_TAU_TAI_CHANGED =3,
+ MRS_AS_CAPA_EMM_DETACH_REQ = 4
+}mrs_as_capa_event_enum;
+
+typedef enum
+{
+ MRS_AS_CAPA_FEATURE_DISABLE_NSA = 0, /*bit 0 of mrs_capability_change_info.capability_change_feature_enable_state*/
+
+ MRS_AS_CAPA_FEATURE_INVALID
+}mrs_as_capa_change_feature_enum;
+
+#endif /* _MRS_AS_ENUMS_H */
diff --git a/mcu/protocol/interface/general/mrs_as_irat_enums.h b/mcu/protocol/interface/general/mrs_as_irat_enums.h
new file mode 100644
index 0000000..deada0c
--- /dev/null
+++ b/mcu/protocol/interface/general/mrs_as_irat_enums.h
@@ -0,0 +1,119 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2015
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * mrs_as_irat_enums.h
+ *
+ * Project:
+ * --------
+ *
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ *
+ *
+ * ----------------------------------------------------------------------------
+ * $Log:$
+ *
+ * 07 09 2019 gibran.chang
+ * [MOLY00418072] [Gen97] Adv. Cell Search Feature
+ * BBL VMOLY Trunk (MRS part)
+ *
+ * 10 03 2018 muneeswaraiah.dama
+ * [MOLY00356286] [Gen97] background search feature
+ * .
+ *
+ * 08 15 2018 yingwei.huang
+ * [MOLY00346146] [VMOLY] GEN97.DEV patch back to VMOLY
+ *
+ * .
+ *
+ * 11 09 2016 titi.wu
+ * [MOLY00208435] [6293][C2K]Sync C2K code to UMOLYA TRUNK
+ * .
+ *
+ *
+ ******************************************************************************/
+#ifndef _MRS_AS_IRAT_ENUMS_H_
+#define _MRS_AS_IRAT_ENUMS_H_
+
+#define MRS_RAT_TYPE_GSM_BMP 0x000001
+#define MRS_RAT_TYPE_UMTS_BMP 0x000002
+#define MRS_RAT_TYPE_LTE_BMP 0x000004
+#define MRS_RAT_TYPE_NR_BMP 0x000008
+#define MRS_RAT_TYPE_C2K_BMP 0x000010
+
+typedef enum
+{
+ MRS_GSM_RAT,
+ MRS_UMTS_RAT,
+ MRS_LTE_RAT,
+ MRS_NR_RAT,
+ MRS_C2K_RAT,
+ MRS_RAT_NONE,
+ MRS_NULL_RAT
+}MRS_RAT_MODE_TYPE;
+
+
+typedef enum
+{
+ MRS_SIM1,
+ MRS_SIM2,
+ MRS_SIM3,
+ MRS_SIM4
+}MRS_SIM_INDEX;
+
+
+typedef enum
+{
+ MRS_MAJOR_PROC, /* By active rat only */
+ MRS_LIST_PROC,
+ MRS_ACTIVE_RAT_CSG_AUTO_SEARCH,
+ MRS_INACTIVE_RAT_CSG_AUTO_SEARCH,
+ MRS_NW_SEARCH_PROC,
+ MRS_BG_SEARCH_FREQ_PROC,
+ MRS_BG_SEARCH_BAND_PROC,
+ MRS_CSG_FINGERPRINT,
+ MRS_BG_BAND_LEARNING_PROC,
+ MRS_OCCUPY_NONE
+}MRS_OCCUPY_PROCEDURE;
+
+#endif /* _MRS_AS_IRAT_ENUMS_H_ */
diff --git a/mcu/protocol/interface/general/mrs_as_struct.h b/mcu/protocol/interface/general/mrs_as_struct.h
new file mode 100644
index 0000000..7aca1b4
--- /dev/null
+++ b/mcu/protocol/interface/general/mrs_as_struct.h
@@ -0,0 +1,674 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * mrs_as_struct.h
+ *
+ * Project:
+ * --------
+ * Multimode
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ----------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ ******************************************************************************/
+#ifndef _MRS_AS_STRUCT_H
+#define _MRS_AS_STRUCT_H
+
+#include "mrs_as_enums.h"
+#include "mrs_as_inter_core_struct.h"
+#include "kal_public_defs.h"
+#include "global_type.h"
+#include "l3_inc_enums.h"
+#include "mcd_l3_inc_struct.h"
+#include "ps_public_enum.h"
+
+#define AFR_FREQ_MAX_NUM 8
+#define MAX_NUM_MULTI_MCC 6
+
+#ifdef __NR_RAT__
+#define EUTRA_MULTI_BANDS_MAX_NUM (8)
+#define EUTRA_NS_PMAX_LIST_MAX_NUM (8)
+#endif /* __NR_RAT__ */
+
+#define MRS_NRAS_EUTRAN_FEATURE_SETS_MAX_NUM (256) // 36.331 maxFeatureSets-r15
+#define MRS_MAX_AFR_FREQ_NUM 64
+#define MRS_AFR_TO_4G_TIMER 2000 //msec
+#define MRS_AFR_TO_5G_TIMER 2000 //msec
+
+#define AS_PINGPONG_THRESHOLD_MAX 8 /* if IRAT Change fount exceeds threshold, PINGPONG confirmed */
+
+#define MRS_MAX_CC_NUM 8
+#define MAX_NUM_VALID_MCC_REGIONS 22
+#define MAX_NUM_VALID_MCC_REGION_PLMNS 55
+#define NVRAM_EF_AS_GSM_BAND_SETTING_SIZE 1
+#define NVRAM_EF_AS_FDD_UMTS_BAND_SETTING_SIZE 4
+#define NVRAM_EF_AS_LTE_BAND_SETTING_SIZE 32
+
+#define MRS_COMPILE_TIME_ASSERT(e) ((void)sizeof(char[1-2*!(e)]))
+
+/* MRS uses this primitive to inform AS about white list change */
+typedef struct {
+ LOCAL_PARA_HDR
+ csg_white_list_update_cause update_cause;
+ kal_bool acsgl_changed;
+ kal_bool ocsgl_changed;
+} mrs_as_csg_white_list_update_ind_struct;
+
+/* MRS uses this primitive to synch LLA status with AS */
+typedef struct {
+ LOCAL_PARA_HDR
+ //lower_layer_availability_enum l1_availibility_status;
+} mrs_lower_layer_availability_update_ind_struct;
+
+/* GAS synch LLA status with MRS */
+typedef struct {
+ LOCAL_PARA_HDR
+ lower_layer_availability_enum l1_availibility_status;
+} mrs_gas_lower_layer_availability_update_req_struct;
+
+/* UAS synch LLA status with MRS */
+typedef struct {
+ LOCAL_PARA_HDR
+ lower_layer_availability_enum l1_availibility_status;
+} mrs_uas_lower_layer_availability_update_req_struct;
+
+/* EAS synch LLA status with MRS */
+typedef struct {
+ LOCAL_PARA_HDR
+ lower_layer_availability_enum l1_availibility_status;
+} mrs_eas_lower_layer_availability_update_req_struct;
+
+/* Inform GAS band setting is changed */
+typedef struct {
+ LOCAL_PARA_HDR
+} mrs_gas_band_setting_update_ind_struct;
+
+/* Inform UAS band setting is changed */
+typedef struct {
+ LOCAL_PARA_HDR
+} mrs_uas_band_setting_update_ind_struct;
+
+/* Inform EAS band setting is changed */
+typedef struct {
+ LOCAL_PARA_HDR
+} mrs_eas_band_setting_update_ind_struct;
+
+/* Inform EAS band contral */
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint16 band;
+ eas_band_control_enum ctrl_info;
+} mrs_eas_band_ctrl_ind_struct;
+
+
+typedef struct mrs_plmn_id
+{
+ kal_uint8 mcc1;
+ kal_uint8 mcc2;
+ kal_uint8 mcc3;
+ kal_uint8 mnc1;
+ kal_uint8 mnc2;
+ kal_uint8 mnc3;
+} mrs_plmn_id;
+
+typedef struct
+{
+ kal_uint8 plmn_id_len;
+ mrs_plmn_id plmn_id[MAX_NUM_MULTI_PLMN];
+} mrs_plmn_id_list;
+
+/* Used to store EHPLMN ID List in SIM card */
+typedef struct
+{
+ kal_uint8 plmn_id_len;
+ mrs_plmn_id plmn_id[MD1_MAX_NUM_HPLMN];
+} mrs_ehplmn_id_list;
+
+/* MRS notifies UAS of the transmission of INTER RAT HANDOVER INFO in GSM */
+typedef struct {
+ LOCAL_PARA_HDR
+} mrs_uas_umts_ho_info_rsp_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+} mrs_l4c_capability_update_ind_struct;
+
+//NR freq nfo for AFR
+typedef struct
+{
+ kal_uint8 periodicity;
+ kal_uint8 offset;
+}mrs_ssb_mtc_periodicity_and_offset_struct;
+
+typedef struct
+{
+ mrs_ssb_mtc_periodicity_and_offset_struct periodicity_and_offset;
+ kal_uint8 duration;
+}mrs_ssb_mtc_struct;
+
+typedef struct
+{
+ NRARFCN freq;
+ mrs_nr_scs_enum ssb_scs;
+ kal_bool is_ssb_mtc_valid;
+ mrs_ssb_mtc_struct ssb_mtc;
+} mrs_afr_nr_freq_info_struct;
+
+typedef struct
+{
+ kal_uint8 freq_num;
+ mrs_afr_nr_freq_info_struct freq_info[MRS_MAX_AFR_FREQ_NUM];
+} mrs_afr_nr_freq_list_struct;
+
+typedef struct
+{
+ kal_bool ongoing_status;
+ MRS_RAT_MODE_TYPE afr_target_rat;
+ mrs_afr_strict_constrain_state strict_constrain_state;
+} mrs_afr_service_struct;
+
+typedef struct
+{
+ kal_bool ever_trigger;
+ kal_bool pre_cond_reqd;
+ MRS_RAT_MODE_TYPE afr_src_rat;
+} mrs_afr_pre_cond_proc_struct;
+
+typedef struct
+{
+ /* [b1: not used] [b2: reduce lau, enable] [b3: defer si13, enable] [b4: 2g afr, enable] [b5: 3g afr, enable] */
+ /* [b6: CSFB_2G_FDD_eCSFB, disable] [b7: CSFB_3G_FDD_eCSFB, disable] [b8: CSFB_2G_TDD_eCSFB, enable] [b9: CSFB_3G_TDD_eCSFB, disable] */
+ /* [b10 ~ b16: reserved] */
+ kal_uint16 csfb_enhancement_item_status;
+ /* [b1: not used] [b2: reduce lau, disable] [b3: defer si13, enable] [b4: 2g afr, disable] [b5: 3g afr, disable] */
+ /* [b6: CSFB_2G_FDD_eCSFB, disable] [b7: CSFB_3G_FDD_eCSFB, disable] [b8: CSFB_2G_TDD_eCSFB, disable] [b9: CSFB_3G_TDD_eCSFB, disable] */
+ /* [b10 ~ b16: reserved] */
+ kal_uint16 csfb_enhancement_item_status_in_test_mode;
+ kal_bool is_csfb_ongoing;
+ kal_uint8 num;
+ EARFCN afr_list[AFR_FREQ_MAX_NUM];
+} mrs_afr_main_struct;
+
+typedef struct
+{
+ /* [b1: 2g4 afr, enable] [b2: 3g4 afr, enable, enable] [b3: 2g5 fdd afr, enable] [b4: 2g5 tdd afr, enable] [b5: 3g5 fdd afr, enable] */
+ /* [b6: 3g5 tdd afr, disable] [b7: 4g5 fdd afr, disable] */
+ /* [b8 ~ b16: reserved] */
+ kal_uint16 afr_enhancement_item_status;
+ /* [b1: 2g4 afr, enable] [b2: 3g4 afr, enable, enable] [b3: 2g5 fdd afr, enable] [b4: 2g5 tdd afr, enable] [b5: 3g5 fdd afr, enable] */
+ /* [b6: 3g5 tdd afr, disable] [b7: 4g5 fdd afr, disable] */
+ /* [b8 ~ b16: reserved] */
+ kal_uint16 afr_enhancement_item_status_in_test_mode;
+
+ mrs_afr_service_struct service_tbl[AFR_SRVC_MAX_NUM];
+ mrs_afr_pre_cond_proc_struct pre_cond_proc_tbl[AFR_PROC_MAX_NUM];
+
+#ifdef __NR_RAT__
+ mrs_afr_nr_freq_list_struct afr_nr_priority_freq_list;
+#endif /* __NR_RAT__ */
+ mrs_afr_nr_freq_list_struct afr_nr_freq_list;
+ mrs_afr_nr_freq_info_struct nr_serving_freq_info;
+ kal_uint32 afr_to_4g_timer; //msec
+ kal_uint32 afr_to_5g_timer; //msec
+} mrs_afr_nr_main_struct;
+
+typedef struct {
+ mrs_plmn_id plmn_id;
+ kal_uint8 la_code[2];
+} mrs_lai_struct;
+
+typedef struct
+{
+ kal_uint16 arfcn;
+ kal_uint8 bsic;
+}mrs_gas_cell_struct;
+
+typedef struct
+{
+ mrs_gas_cell_struct gas_cell;
+ mrs_lai_struct lai;
+ mrs_gas_ecsfb_call_status_enum ecsfb_call_status;
+}mrs_gas_cell_inf_struct;
+
+typedef struct
+{
+ kal_uint16 uarfcn;
+ kal_uint16 psc;
+}mrs_uas_cell_struct;
+
+typedef struct
+{
+ mrs_uas_cell_struct uas_cell;
+ mrs_lai_struct lai;
+}mrs_uas_cell_inf_struct;
+
+typedef struct
+{
+ EARFCN earfcn;
+ kal_uint16 pci;
+}mrs_eas_cell_struct;
+
+typedef struct {
+ kal_bool valid;
+ MRS_RAT_MODE_TYPE rat;
+ mrs_plmn_id plmn_id;
+ kal_uint16 lac_or_tac;
+ kal_uint32 cell_id;
+ kal_uint32 arfcn_or_uarfcn_or_earfcn;
+ kal_uint16 bsic_or_psc_or_pci;
+ kal_int16 report_offset_for_serv_in_black_list; /* serving is a black cell, unit:dbm */
+ kal_int16 report_offset_for_nc_in_black_list; /* neighbor is a black cell, unit:dbm */
+} mrs_as_black_cell_struct;
+
+/* inform xAS black cell list added/cleared. */
+typedef struct {
+ LOCAL_PARA_HDR
+} mrs_uas_add_black_cell_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+} mrs_gas_add_black_cell_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+} mrs_uas_clear_black_cell_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+} mrs_gas_clear_black_cell_ind_struct;
+
+typedef struct mrs_mcc_id
+{
+ kal_uint8 mcc1;
+ kal_uint8 mcc2;
+ kal_uint8 mcc3;
+} mrs_mcc_id;
+
+/* AS use this struct to get MCC from MRS */
+typedef struct mrs_as_mcc_struct
+{
+ kal_uint8 mrs_as_mcc_count;
+ mrs_mcc_id multi_mcc_id[MAX_NUM_MULTI_MCC];
+} mrs_as_mcc_struct;
+
+/* MRS use this struct to set and save MCC from NAS */
+typedef struct
+{
+ kal_uint8 multi_plmn_count;
+ mrs_plmn_id multi_plmn_id[MAX_NUM_MULTI_PLMN];
+} mrs_nas_mcc_struct;
+
+typedef struct
+{
+ /* Fast Mode Switch, record the latest serving cell's essential SI
+ for fast camp on for FDD/TDD mode switch. */
+ mrs_gas_fast_mode_switch_status_enum fast_mode_switch_status;
+ kal_uint8 bsic;
+ kal_uint16 arfcn;
+ plmn_id_struct plmn_id;
+ kal_uint8 si_raw_data_valid_bitmap;
+ kal_uint8 si1_raw_data[GAS_SI_RAW_DATA_LEN];
+ kal_uint8 si2_raw_data[GAS_SI_RAW_DATA_LEN];
+ kal_uint8 si2bis_raw_data[GAS_SI_RAW_DATA_LEN];
+ kal_uint8 si3_raw_data[GAS_SI_RAW_DATA_LEN];
+ kal_uint8 si4_raw_data[GAS_SI_RAW_DATA_LEN];
+#ifdef __PS_SERVICE__
+ kal_uint8 si13_raw_data[GAS_SI_RAW_DATA_LEN];
+#endif /* __PS_SERVICE__ */
+} mrs_gas_shared_info_struct;
+
+/* MRS use this struct to set and get PLMN status from NAS
+ * is_roaming: current PLMN is roaming or not
+ */
+typedef struct
+{
+ kal_bool is_roaming;
+} mrs_nas_plmn_info_struct;
+
+#ifdef __GAS_STORED_SI_FEAT__
+typedef struct
+{
+ kal_bool valid;
+ /* RRM_BA_ROW_DATA_SIZE */
+ kal_uint8 ba_raw_data[16];
+ kal_uint8 count;
+ kal_uint8 rest[RRM_MAX_SI2TER_INSTANCES][RRM_SI2TER_REST_LEN];
+}rrm_si2ter_struct;
+
+typedef struct
+{
+ kal_bool valid;
+ kal_uint8 count;
+ kal_uint8 rest[RRM_MAX_SI2QUARTER_INSTANCES][RRM_SI2QUARTER_REST_LEN];
+}rrm_si2quarter_struct;
+
+typedef struct
+{
+ kal_bool valid;
+ kal_bool essential_si_valid;
+ kal_uint32 system_tick;
+ kal_uint16 storedSI_arfcn;
+ kal_uint8 storedSI_bsic;
+ kal_uint8 si_raw_data_bitmap;
+ kal_uint8 si1_data[21];
+ kal_uint8 si2_data[21];
+ kal_uint8 si2bis_data[21];
+ kal_uint8 si3_data[21];
+ kal_uint8 si4_data[21];
+ kal_uint8 si13_data[21];
+ rrm_si2ter_struct si2ter;
+ rrm_si2quarter_struct si2quarter;
+} rrm_gsm_storedSI_struct;
+
+#endif
+
+#ifdef __NR_RAT__
+typedef struct
+{
+ kal_bool additional_pmax_valid;
+ kal_int8 additional_pmax;
+ kal_bool additional_spectrum_emission_valid;
+ kal_uint16 additional_spectrum_emission;
+} eutra_ns_pmax_value_struct;
+
+typedef struct
+{
+ kal_uint8 eutra_ns_pmax_list_len;
+ eutra_ns_pmax_value_struct eutra_ns_pmax_list[EUTRA_NS_PMAX_LIST_MAX_NUM];
+} eutra_ns_pmax_list_struct;
+
+typedef struct
+{
+ kal_uint16 freq_band_indicator_eutra;
+ eutra_ns_pmax_list_struct ns_pmax_list;
+} eutra_multibandinfo_struct;
+
+typedef struct
+{
+ kal_uint8 eutra_multibandinfo_list_len;
+ eutra_multibandinfo_struct eutra_multibandinfo_list[EUTRA_MULTI_BANDS_MAX_NUM];
+} eutra_multibandinfo_list_struct;
+#endif /* __NR_RAT__ */
+
+typedef struct {
+ kal_uint8 *oct;
+ kal_uint16 oct_len;
+} mrs_nras_octet_string_struct;
+
+/**
+ * Structure for EUTRAN feature set IDs. IDs are in the order they shall be
+ * reported to the network. ID values are IDs of feature sets read from L1.
+ * fs_dl_num Number of IDs in fs_dl_id list
+ * fs_dl_id List of EUTRAN DL feature set IDs
+ * fs_ul_num Number of IDs in fs_ul_id list
+ * fs_ul_id List of EUTRAN UL feature set IDs
+ */
+typedef struct
+{
+ kal_uint16 fs_dl_num;
+ kal_uint16 fs_dl_id[MRS_NRAS_EUTRAN_FEATURE_SETS_MAX_NUM];
+ kal_uint16 fs_ul_num;
+ kal_uint16 fs_ul_id[MRS_NRAS_EUTRAN_FEATURE_SETS_MAX_NUM];
+} mrs_nras_eutran_feature_set_ids_struct;
+
+/* record systime of RAT_CHANGE_CNF(succes),
+ During timewindow, if the rat change reaches specific times, PINGPONG confirmed.
+ the MAX record for RAT change is AS_PINGPONG_THRESHOLD_MAX, but user can customize their PINGPONG scenario with count less than AS_PINGPONG_THRESHOLD_MAX
+*/
+typedef struct
+{
+ kal_uint32 rat_change_time[AS_PINGPONG_THRESHOLD_MAX];
+} mrs_irat_change_info_struct;
+
+typedef struct
+{
+ rat_enum rat; // Current active rat
+ kal_uint8 cc_idx; // Idle mode: always 0. Connected mode: NW configured CC idx.
+ kal_uint32 freq_1khz; // Corresponding Pcell/Scell frequency in 1khz.
+ kal_uint32 bw_1khz; // Corresponding Pcell/Scell BW in 1khz
+ kal_uint16 band; // Universal band
+ kal_uint8 mimo_layer; // 0xFF if no valid info
+} mrs_common_cc_info_struct;
+
+typedef struct
+{
+ protocol_id_enum ps_id;
+ kal_uint8 dl_cc_num; // Idle mode: always 1. Connected mode: NW configured DL cc num.
+ mrs_common_cc_info_struct dl_cc_info[MRS_MAX_CC_NUM];
+ kal_uint8 ul_cc_num; // Idle mode: always 1 or 0 if UL info is not available. Connected mode: NW configured UL cc num.
+ mrs_common_cc_info_struct ul_cc_info[MRS_MAX_CC_NUM];
+} mrs_cell_cc_info_struct;
+
+typedef struct
+{
+ kal_uint8 gsm_band;
+ kal_uint8 fdd_umts_band[NVRAM_EF_AS_FDD_UMTS_BAND_SETTING_SIZE];
+ kal_uint8 lte_band[NVRAM_EF_AS_LTE_BAND_SETTING_SIZE];
+} mrs_mcc_band_setting_per_region_struct;
+
+typedef struct
+{
+ kal_uint8 mcc_region_number;
+ kal_uint8 no_of_plmns;
+ mrs_plmn_id mcc_region_plmns[MAX_NUM_VALID_MCC_REGION_PLMNS];
+ mrs_mcc_band_setting_per_region_struct band_setting;
+} mrs_mcc_plmn_list_within_region_record_struct;
+
+
+typedef struct
+{
+ kal_uint8 no_of_mcc_regions;
+ mrs_mcc_plmn_list_within_region_record_struct setting[MAX_NUM_VALID_MCC_REGIONS];
+} mrs_mcc_region_band_setting_record_struct;
+
+#endif /* _MRS_AS_STRUCT_H */
diff --git a/mcu/protocol/interface/general/mrs_cas_capability.h b/mcu/protocol/interface/general/mrs_cas_capability.h
new file mode 100644
index 0000000..2a06539
--- /dev/null
+++ b/mcu/protocol/interface/general/mrs_cas_capability.h
@@ -0,0 +1,165 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2016
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS (""MEDIATEK SOFTWARE"")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN ""AS-IS"" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSKAL_TRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/******************************************************************************
+ * Filename:
+ * --------------------------------------------------------
+ * mrs_cas_capability.h
+ *
+ * Project:
+ * --------------------------------------------------------
+ * Multimode
+ *
+ * Description:
+ * --------------------------------------------------------
+ * The C2K AS capability stored in MRS context.
+ *
+ * Author:
+ * --------------------------------------------------------
+ * -------
+ *
+ * --------------------------------------------------------
+ * $Log$
+ *
+ * 07 03 2018 yanfeng.xu
+ * [MOLY00335660] ¡¾BD091¡¿¡¾Êý¾ÝÍøÂç¡¿¡¾Êг¡·´À¡¡¿¿Í»§ÊÖ»úʹÓÃÊý¾ÝÍøÂçÉÏqq»á³öÏÖÁ¬½Ó³¬Ê±ºÍÓïÒôͨ»°ÑÓʱÎÊÌâ¡£
+ *
+ * 12 09 2016 guanglong.wu
+ * [MOLY00211482] [6293][C2K AS re-arch item] Add API in MRS for checking C2K supported band
+ *
+ * Updated C2K default support band for UT TEST
+ *
+ * 11 10 2016 guanglong.wu
+ * [MOLY00211482] [6293][C2K AS re-arch item] Add API in MRS for checking C2K supported band
+ * modifed cas capability strcucture name.
+ *
+ *****************************************************************************/
+
+#ifndef _MRS_CAS_CAPABILITY_H
+#define _MRS_CAS_CAPABILITY_H
+
+#include "mrs_as_inter_core_def.h"
+#include "mrs_as_enums.h"
+#include "mrs_as_struct.h"
+#include "reg_base.h"
+#include "global_type.h"
+#include "mrs_common_capability.h"
+
+/*****************************************************************************
+ * Macros Without Parameters
+ *****************************************************************************/
+#ifdef UNIT_TEST
+/*supported band 0 ,1, 4, 6 and band 10 for UT test*/
+#define C2K_UT_TEST_SUPPORTED_BAND_MASK 0x00000453
+#endif
+/*****************************************************************************
+ * Macros With Parameters
+ *****************************************************************************/
+#define mrs_get_cas_band_bitmask(cas_band) (0x0001 << (cas_band))
+
+/*****************************************************************************
+ * Enums without tags
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Type Definitions
+ *****************************************************************************/
+typedef enum
+{
+ CAS_BAND_CLASS_0 = 0, /* 800 MHz cellular band */
+ CAS_BAND_CLASS_1, /* 1.8 to 2.0 GHz band */
+ CAS_BAND_CLASS_2, /* 872 to 960 MHz TACS band */
+ CAS_BAND_CLASS_3, /* 832 to 925 MHz JTACS band */
+ CAS_BAND_CLASS_4, /* 1.75 to 1.87 GHz Korean PCS */
+ CAS_BAND_CLASS_5, /* 450 MHz NMT band */
+ CAS_BAND_CLASS_6, /* 2 GHz IMT-2000 band */
+ CAS_BAND_CLASS_7, /* 700 MHz band */
+ CAS_BAND_CLASS_8, /* 1800 MHz band */
+ CAS_BAND_CLASS_9, /* 900 MHz band */
+ CAS_BAND_CLASS_10, /* Secondary 800 MHz NMT band */
+ CAS_BAND_CLASS_11, /* 400 MHz European PARM band */
+ CAS_BAND_CLASS_12, /* 800 MHz PAMR band */
+ CAS_BAND_CLASS_13, /* 2.5 GHz IMT-2000 */
+ CAS_BAND_CLASS_14, /* US PCS 1.9 GHz band */
+ CAS_BAND_CLASS_15, /* AWS band */
+ CAS_BAND_CLASS_16, /* US 2.5 GHz band */
+ CAS_BAND_CLASS_17, /* US 2.5GHz Forward Link Only Band */
+ CAS_BAND_CLASS_18, /* 700 MHz Public Safety Band */
+ CAS_BAND_CLASS_19, /* Lower 700 MHz Band */
+ CAS_BAND_CLASS_20, /* L-Band */
+ CAS_BAND_CLASS_MAX,
+ CAS_BAND_CLASS_NOT_USED = CAS_BAND_CLASS_MAX,
+ CAS_BAND_CLASS_UNSUPPORTED /* MUST be DIFFERENT than CAS_BAND_CLASS_MAX / CAS_BAND_CLASS_NOT_USED */
+} cas_band_enum;
+
+#define MAX_A21_MS_SUBS_INFO_LEN 35
+
+typedef struct
+{
+ kal_uint8 length;
+ kal_uint8 sub_info[MAX_A21_MS_SUBS_INFO_LEN];
+} a21_mobile_sub_info_struct;
+
+typedef struct{
+ kal_uint32 cas_rf_support_band_bitmask; /*All Support band of C2k RF*/
+ kal_uint32 cas_support_band_bitmask; /*configured to active band */
+ a21_mobile_sub_info_struct a21_cap;
+}cas_capability_context_struct;
+
+/*****************************************************************************
+ * Declarations Of Exported Globals
+ *****************************************************************************/
+
+kal_uint32 mrs_cas_all_rf_supported_band(void);
+
+kal_uint32 mrs_cas_all_supported_band(void);
+
+kal_bool mrs_cas_is_rf_supported_band(kal_uint8 cas_band);
+
+kal_bool mrs_cas_is_supported_band(kal_uint8 cas_band) ;
+
+void mrs_cas_update_rf_supported_band(kal_uint32 rf_supported_band_mask);
+
+void mrs_cas_update_supported_band(kal_uint32 supported_band_mask);
+
+kal_uint8 mrs_cas_get_a21_mobile_sub_info_length(MRS_SIM_INDEX sim_index);
+
+void mrs_cas_get_a21_mobile_sub_info(MRS_SIM_INDEX sim_index, kal_uint8 **a21_mobile_sub_info);
+
+void mrs_cas_set_a21_cap_info(kal_uint8 length, kal_uint8 *a21_mobile_sub_info);
+
+#endif /* _MRS_CAS_CAPABILITY_H */
+
+
diff --git a/mcu/protocol/interface/general/mrs_common_band_table_public.h b/mcu/protocol/interface/general/mrs_common_band_table_public.h
new file mode 100644
index 0000000..1c27a00
--- /dev/null
+++ b/mcu/protocol/interface/general/mrs_common_band_table_public.h
@@ -0,0 +1,163 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+#ifndef MRS_COMMON_BAND_TABLE_PUBLIC_H
+#define MRS_COMMON_BAND_TABLE_PUBLIC_H
+
+#include "kal_general_types.h"
+#include "mcd_l3_inc_struct.h"
+#include "l3_inc_local.h"
+#include "l3_inc_enums.h"
+
+
+/********************************************
+ * MACROS *
+ ********************************************/
+
+/**
+ * Maximum number of bands expected to be used by specific PLMN or MCC
+ * Which limits the band number of query result
+ */
+#define MRS_MAX_PLMN_BAND_NUM 32 // Shall align the number of entries in NWSEL search_request
+
+/********************************************
+ * VARIABLES *
+ ********************************************/
+
+
+/********************************************
+ * FUNCTION DECLARATIONS *
+ ********************************************/
+
+/**
+ * @brief Query if a band is supported by specific PLMN/RAT
+ * @param[in] plmn_id is the PLMN ID (MCC+MNC) to be queried
+ * @param[in] band is the band number to be queried
+ * @param[in] rat is the radio access technology to be queried
+ * @param[in] band is the band to be queried
+ * @return KAL_TRUE if the band is supported by the PLMN/RAT specified; KAL_FALSE if not supported
+ */
+kal_bool mrs_is_known_plmn_band(const plmn_id_struct *plmn_id, kal_uint16 band, rat_enum rat);
+
+/**
+ * @brief Query the bands supported by specific PLMN/RAT
+ * @param[in] plmn_id is the PLMN ID (MCC+MNC) to be queried
+ * @param[in] rat is the radio access technology to be queried
+ * @param[out] band_num is the number of bands supported by the PLMN/RAT specified
+ * @param[out] band_list is the band list supported by the PLMN/RAT specified
+ */
+void mrs_get_plmn_support_band(const plmn_id_struct *plmn_id, rat_enum rat, kal_uint32 *band_num, kal_uint16 band_list[]);
+
+/**
+ * @brief Query the bands supported by multiple PLMNs/RAT
+ * @param[in] plmn_num is the number of PLMNs to be queried
+ * @param[in] plmn_list is the list of PLMN IDs (MCC+MNC) to be queried
+ * @param[in] rat is the radio access technology to be queried
+ * @param[out] band_num is the number of bands supported by the PLMNs/RAT specified
+ * @param[out] band_list is the band list supported by the PLMNs/RAT specified
+ */
+void mrs_get_multiple_plmn_support_band(kal_uint32 plmn_num, const plmn_id_struct plmn_list[], rat_enum rat, kal_uint32 *band_num, kal_uint16 band_list[]);
+
+/**
+ * @brief Query the bands supported by specific operator/RAT
+ * @param[in] plmn_id is the PLMN ID (MCC+MNC) of operator to be queried (one operator may allocate multiple PLMN IDs, e.g. CMCC)
+ * @param[in] rat is the radio access technology to be queried
+ * @param[out] band_num is the number of bands supported by the operator/RAT specified
+ * @param[out] band_list is the band list supported by the operator/RAT specified
+ */
+void mrs_get_operator_support_band(const plmn_id_struct *plmn_id, rat_enum rat, kal_uint32 *band_num, kal_uint16 band_list[]);
+
+/**
+ * @brief Query if a band is supported by specific MCC/RAT
+ * @param[in] plmn_id is the MCC (MCC part of plmn_id_struct) to be queried
+ * @param[in] band is the band to be queried
+ * @param[in] rat is the radio access technology to be queried
+ * @param[in] band is the band number to be queried
+ * @return KAL_TRUE if the band is supported by the MCC/RAT specified; KAL_FALSE if not supported
+ */
+kal_bool mrs_is_known_mcc_band(const plmn_id_struct *plmn_id, kal_uint16 band, rat_enum rat);
+
+/**
+ * @brief Query the bands supported by specific MCC/RAT
+ * @param[in] plmn_id is the MCC (MCC part of plmn_id_struct) to be queried
+ * @param[in] rat is the radio access technology to be queried
+ * @param[out] band_num is the number of bands supported by the MCC/RAT specified
+ * @param[out] band_list is the band list supported by the MCC/RAT specified
+ */
+void mrs_get_mcc_support_band(const plmn_id_struct *plmn_id, rat_enum rat, kal_uint32 *band_num, kal_uint16 band_list[]);
+
+/**
+ * @brief Query the bands supported by specific country/RAT
+ * @param[in] plmn_id is the MCC (MCC part of plmn_id_struct) of country to be queried (one country may allocate multiple MCCs, e.g. USA)
+ * @param[in] rat is the radio access technology to be queried
+ * @param[out] band_num is the number of bands supported by the country/RAT specified
+ * @param[out] band_list is the band list supported by the country/RAT specified
+ */
+void mrs_get_country_support_band(const plmn_id_struct *plmn_id, rat_enum rat, kal_uint32 *band_num, kal_uint16 band_list[]);
+
+/**
+ * @brief Query the bands supported by multiple countries/RAT
+ * @param[in] plmn_num is the number of MCCs to be queried
+ * @param[in] plmn_list is the list of MCCs (MCC part of plmn_id_struct) of country to be queried (one country may allocate multiple MCCs, e.g. USA)
+ * @param[in] rat is the radio access technology to be queried
+ * @param[out] band_num is the number of bands supported by the countries/RAT specified
+ * @param[out] band_list is the band list supported by the countries/RAT specified
+ */
+void mrs_get_multiple_country_support_band(kal_uint32 plmn_num, const plmn_id_struct plmn_list[], rat_enum rat, kal_uint32 *band_num, kal_uint16 band_list[]);
+
+/**
+ * @brief Add new PLMN/RAT support band to database
+ * @param[in] rat is the radio access technology to be added
+ * @param[in] plmn_band_count is the number of PLMN/bands to be added
+ * @param[in] plmn_band_list is the list of PLMN/bands to be added
+ */
+void mrs_add_learned_plmn_band(rat_enum rat, kal_uint32 plmn_band_count, const plmn_band_struct plmn_band_list[]);
+
+/**
+ * @brief Reset the learned PLMN/band database
+ */
+void mrs_reset_learned_plmn_band(void);
+
+/**
+ * @brief Get the neightbor country based on MRS_NEIGHBOR_COUNTRY_MCC_SET_NUM by specific MCC
+ * @param[in] plmn_id is the MCC (MCC part of plmn_id_struct) to be queried
+ * @param[out] neigh_mcc_num is number of neighbor country found in MRS_NEIGHBOR_COUNTRY_MCC_LIST
+ * @param[out] neigh_mcc_list is the country(mcc) entry found in MRS_NEIGHBOR_COUNTRY_MCC_LIST
+ * @return KAL_TRUE if there is a match of first country of MRS_NEIGHBOR_COUNTRY_MCC_LIST; KAL_FALSE if there is no match
+ */
+kal_bool mrs_get_neighbor_country(const plmn_id_struct *plmn_id, kal_uint32 *neigh_mcc_num, plmn_id_struct neigh_mcc_list[]);
+
+#endif /* MRS_COMMON_BAND_TABLE_PUBLIC_H */
+
diff --git a/mcu/protocol/interface/general/mrs_common_capability.h b/mcu/protocol/interface/general/mrs_common_capability.h
new file mode 100644
index 0000000..9a480f5
--- /dev/null
+++ b/mcu/protocol/interface/general/mrs_common_capability.h
@@ -0,0 +1,259 @@
+/******************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*******************************************************************************/
+
+/******************************************************************************
+ * Filename:
+ * --------------------------------------------------------
+ * mrs_common_capability.h
+ *
+ * Project:
+ * --------------------------------------------------------
+ * Multimode
+ *
+ * Description:
+ * --------------------------------------------------------
+ * Declaration of funcitons of mrs_common_capability.c.
+ *
+ * Author:
+ * --------------------------------------------------------
+ * -------
+ *
+ * --------------------------------------------------------
+ * $Log$
+ *
+ * 01 11 2022 tom.wu
+ * [MOLY00742518] MIPC API support for Enable/Disable SA for a given 5G band
+ *
+ * .
+ *
+ * 10 30 2020 vend_mtb_aricent017
+ * [MOLY00581307] [LOVE]Question about l4c_nw_set_preferred_band_req_nosave()
+ *
+ * .
+ *
+ * 10 01 2020 tero.miettinen
+ * [MOLY00560032] ????SA???
+ * MRS - PLMN based 5G band disabling.
+ *
+ * 09 28 2020 esko.oikarinen
+ * [MOLY00557246] [P200803-00845] [MTK][5G][A326B] AT+EPBSEH ì
í
ì?´í ue capa info ì? nr41,79 ì¬ë?¼ê°ë íì?
+ *
+ * 01 22 2020 bo-yao.tsai
+ * [MOLY00475582] �i��?��?�j�i���n??��?�j �i19165�j���n??��Z��?��?���q?�v��??�A?��?�E? - TAU capability change for workaround
+ *
+ * 09 18 2019 vinayak.bandagi
+ * [MOLY00441244] [CODE SYNC] modem mini dump??????????-USIR Changes
+ *
+ * 01 31 2019 esko.oikarinen
+ * [MOLY00308821] [6297][MRS] NR implementation
+ * Band support configuration with AT command
+ *
+ * 09 07 2018 esko.oikarinen
+ * [MOLY00346011] [Gen97][NRRC] Merge to VMOLY TRUNK
+ *
+ * CL 6335055 merge to VMOLY
+ *
+ * 05 29 2018 jiawei.he
+ * [MOLY00329258] [GAS part]FT SRVCC improvement
+ *
+ * .
+ *
+ * 04 18 2018 lw.chen
+ * [MOLY00320662] [Gen93][P40][UMOLYE] Gionee blacklist feature - MRS
+ *
+ * 04 18 2018 morton.lin
+ * [MOLY00320662] [Gen93][P40][UMOLYE] Gionee blacklist feature - MRS
+ * [MRS] Gionee Blacklist feature phase-in
+ *
+ * 03 02 2018 qingyu.lai
+ * [MOLY00310177] [����][CMCC VoLTE]���ݽ����껪_�컪Է_3.1SRVCC fail SW workaround solution
+ * .
+ *
+ * 11 29 2017 sapna.ks
+ * [MOLY00292082] [Gen93][TMO] 2G disable with ecc enable
+ * .
+ *
+ * 07 06 2017 morton.lin
+ * [MOLY00261305] [Gen93] B71 development
+ * MRS and NVRAM phase in
+ *
+ * 03 14 2017 menghau.wu
+ * [MOLY00217129] [MT6293] code sync from UMOLY (Phase4)
+ * UMOLY CR : [MOLY00224474] [6291][MP3][Post MP] CU HST Patch - MRS and CUSTOM
+ * UMOLY CL : 3547100
+ *
+ * 02 08 2017 menghau.wu
+ * [MOLY00217129] [MT6293] code sync from UMOLY (Phase4)
+ * UMOLY CR : [ALPS02900073][MT6292][ELBRUS][Phone][GCF][BLOCKING][TS8980][TDD B41,TC 8.7.13] No 4G measurement report from WCDMA to TD-LTE
+ * UMOLY CL : 3354520/3354606
+ *
+ * 12 27 2016 david.niu
+ * LR12->UMOLYA sync for CR[MOLY00210217].
+ *
+ * 10 24 2016 vend_mtb_mobiveil003
+ * [MOLY00209293] Band 66 support
+ * Band 66 support
+ *
+ * 10 12 2016 menghau.wu
+ * [MOLY00207053] [MT6293] code sync form UMOLY
+ * UMOLY CR : [MOLY00153524] [6291] Vivo BlackList feature
+ * UMOLY CL : 2577150
+ *
+ * 03 10 2016 morton.lin
+ * [MOLY00165947] [6291 HSR] Protocol Enhancement (Header/Interface)
+ * CMCC requirement: HSFR CTRL (SBP, NVRAM and MRS) (Protocol Header / Interface)
+ *
+ * 02 17 2016 sabrina.hsu
+ * [MOLY00156230] [6292] ERRC code sync LR11 to UMOLY
+ * AT+EPBSE
+ *
+ * 12 02 2015 wonder.lee
+ * [MOLY00151252] World Mode ID & Support Band collision check
+ *
+ * .
+ *
+ * 11 05 2014 wonder.lee
+ * [MOLY00083318] [USIME/MCDLL/UMA] sync code from MT6291_DEV
+ * .
+ *
+ * 01 21 2014 wcpuser_integrator
+ * [MOLY00054475] SGLTE option rename
+ * .
+ *
+ * 12 31 2013 wonder.lee
+ * [MOLY00051335] USIMEcall SCSI function with sim index which UMTS is not supported
+ *
+ * 11 13 2013 peng.pan
+ * [MOLY00046027] [MT6290E1][MMDS_DC] MMDC feature patch back to MOLY trunk
+ * B3/B39 common capability.
+ *
+ * 02 05 2013 yenchih.yang
+ * [MOLY00009186] [SIBE/USIME/DBME] Multi-Mode CBr merge to MOLY
+ * .
+ *
+ *****************************************************************************/
+
+#ifndef _MRS_COMMON_CAPABILITY_H
+#define _MRS_COMMON_CAPABILITY_H
+
+#include "mrs_as_enums.h" // for MRS_SIM_INDE
+
+#include "mrs_as_struct.h" //for mrs_as_black_cell_struct
+
+#define MRS_LTE_BAND_BITMASK_SIZE 8
+#define MRS_NR_BAND_BITMASK_SIZE 128
+
+/* Type Definitions */
+typedef struct {
+ kal_uint8 gsm_band;
+ kal_uint32 umts_band;
+ kal_uint8 lte_band[MRS_LTE_BAND_BITMASK_SIZE];
+} mrs_as_band_setting;
+
+/* B66 support */
+typedef struct {
+ kal_uint8 gsm_band;
+ kal_uint32 umts_band;
+ kal_uint8 lte_band[SIZE_LTE_BAND_MASK_TABLE_EXTENDED];
+ kal_uint8 nr_band[MRS_NR_BAND_BITMASK_SIZE]; // NR SA band only
+ kal_uint8 nr_endc_band[MRS_NR_BAND_BITMASK_SIZE]; // NR ENDC band only
+} mrs_as_band_setting_extended;
+
+/* Shall be aligned to NVRAM_MAX_MRS_AS_BLACK_CELL_NUM */
+#define MAX_BLACK_CELL_NUM 50
+
+typedef struct {
+ kal_uint8 num;
+ mrs_as_black_cell_struct as_black_cell_list[MAX_BLACK_CELL_NUM];
+} mrs_as_black_cell_list_struct;
+
+/* PUBLIC FUNCTION PROTOTYPES ***********************************************/
+extern void mrs_get_asband_settings(MRS_SIM_INDEX sim_index, kal_uint8 *nocheck_invalidrat, kal_uint8 *support_rat);
+extern void mrs_em_get_as_band_setting(MRS_SIM_INDEX sim_index, mrs_as_band_setting *band_setting);
+extern void mrs_em_get_as_band_setting_extended(MRS_SIM_INDEX sim_index, mrs_as_band_setting_extended *band_setting);
+extern void mrs_get_as_band_setting(MRS_SIM_INDEX sim_index, mrs_as_band_setting *band_setting);
+extern void mrs_get_as_band_setting_extended(MRS_SIM_INDEX sim_index, mrs_as_band_setting_extended *band_setting);
+#if defined(__TC10__) || defined(__TC01__)
+extern void mrs_em_set_as_band_setting(MRS_SIM_INDEX sim_index, mrs_as_band_setting *band_setting, kal_bool is_nvram_save_needed);
+extern void mrs_em_set_as_band_setting_extended( MRS_SIM_INDEX sim_index, mrs_as_band_setting_extended *band_setting, kal_bool is_nvram_save_needed);
+#else
+extern void mrs_em_set_as_band_setting(MRS_SIM_INDEX sim_index, mrs_as_band_setting *band_setting);
+extern void mrs_em_set_as_band_setting_extended( MRS_SIM_INDEX sim_index, mrs_as_band_setting_extended *band_setting);
+#endif
+extern void mrs_set_as_band_setting(MRS_SIM_INDEX sim_index, mrs_as_band_setting *band_setting);
+extern void mrs_set_as_band_setting_extended(MRS_SIM_INDEX sim_index, mrs_as_band_setting_extended *band_setting);
+extern void mrs_set_as_band_setting_nosave(MRS_SIM_INDEX sim_index, mrs_as_band_setting_extended *band_setting);
+
+extern void mrs_hsr_set_mode(MRS_SIM_INDEX sim_index, kal_bool hsr_mode);
+extern kal_bool mrs_hsr_get_mode(MRS_SIM_INDEX sim_index);
+void FDD_mrs_cleanup(kal_uint8 sim_index);
+
+
+extern void mrs_scsi_retrieveGsmBandBitmask(MRS_SIM_INDEX sim_index, kal_uint8 *pGBandBitmask);
+extern void mrs_scsi_retrieveUmtsBandBitmask(MRS_SIM_INDEX sim_index, kal_uint32 *pUBandBitmask);
+extern void mrs_scsi_retrieveLteBandBitmask(MRS_SIM_INDEX sim_index, void *pLBandBitmask);
+extern void mrs_scsi_retrieveLteBandBitmask_extended(MRS_SIM_INDEX sim_index, void *pLBandBitmask);
+#ifdef __NR_RAT__
+void mrs_scsi_retrieveNRBandBitmask(MRS_SIM_INDEX sim_index, void *pNRBandBitmask);
+void mrs_scsi_retrieveNR_ENDCBandBitmask(MRS_SIM_INDEX sim_index,
+ mrs_gemini_status_enum gemini_status, void *pNR_ENDCBandBitmask);
+#endif /* __NR_RAT__ */
+
+extern kal_bool mrs_add_black_cell_list(MRS_SIM_INDEX sim_index, mrs_as_black_cell_list_struct *black_cell_list);
+extern void mrs_get_black_cell_list(MRS_SIM_INDEX sim_index, mrs_as_black_cell_list_struct *black_cell_list);
+extern kal_bool mrs_check_black_cell_list(MRS_SIM_INDEX sim_index, MRS_RAT_MODE_TYPE rat, mrs_plmn_id plmn_id, kal_uint32 cell_identity, kal_uint16 lac_or_tac);
+// SBP_BLACK_CELL_LIST for CONNECTED mode
+extern kal_int16 mrs_check_black_cell_list_earfcn_pci(MRS_SIM_INDEX sim_index, MRS_RAT_MODE_TYPE rat, mrs_plmn_id plmn_id, kal_uint16 lac_or_tac, kal_uint32 earfcn, kal_uint16 pci, kal_bool is_serv_cell);
+extern void mrs_clear_black_cell_list(MRS_SIM_INDEX sim_index);
+extern void mrs_update_disable_rat_mode(MRS_SIM_INDEX sim_index, rat_enum disable_rat_mode);
+
+void mrs_common_read_nvram_cnf_handler(kal_uint16 nvram_file_id, kal_uint8 *data, kal_uint16 len);
+
+#if defined(__ANT_RXPWR_OFFSET_SUPPORT__)
+extern kal_int16 L1D_RF_Antenna_RX_Power_Offset(kal_uint16 rf_band, kal_uint16 arfcn, kal_int16 RSSI, kal_uint32 pcell_id);
+extern kal_int16 EAS_GAS_RF_Antenna_RX_Power_Offset(kal_uint16 rf_band, kal_uint16 arfcn, kal_int16 RSSI, kal_uint32 pcell_id);
+#endif
+
+void mrs_update_as_capability_event(MRS_SIM_INDEX sim_index, mrs_as_capa_event_enum event);
+
+kal_bool mrs_get_as_capability_change_feature_state(MRS_SIM_INDEX sim_index, mrs_as_capa_change_feature_enum feature);
+
+kal_bool mrs_get_as_radio_capability_change(MRS_SIM_INDEX sim_index);
+
+kal_bool mrs_as_is_mcc_match(mrs_plmn_id plmn1, mrs_plmn_id plmn2);
+
+kal_bool mrs_as_is_plmn_match(mrs_plmn_id plmn1, mrs_plmn_id plmn2);
+
+#endif /* _MRS_COMMON_CAPABILITY_H */
diff --git a/mcu/protocol/interface/general/mrs_common_operator_feature_table_public.h b/mcu/protocol/interface/general/mrs_common_operator_feature_table_public.h
new file mode 100644
index 0000000..a9b54c2
--- /dev/null
+++ b/mcu/protocol/interface/general/mrs_common_operator_feature_table_public.h
@@ -0,0 +1,163 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+#ifndef MRS_COMMON_OPERATOR_FEATURE_PUBLIC_H
+#define MRS_COMMON_OPERATOR_FEATURE_PUBLIC_H
+
+#include "kal_general_types.h"
+#include "mcd_l3_inc_struct.h"
+#include "l3_inc_local.h"
+#include "l3_inc_enums.h"
+#include "ps_public_enum.h"
+
+
+/********************************************
+ * MACROS *
+ ********************************************/
+// op_feature_bitmap, see ps_public_enum.h
+
+/********************************************
+ * ENUMS *
+ ********************************************/
+// op_feature_enum, see ps_public_enum.h
+
+/********************************************
+ * FUNCTION DECLARATIONS *
+ ********************************************/
+
+/**
+ * @brief Query if an operator feature is supported by specific PLMN
+ * @param[in] plmn_id is the PLMN ID (MCC+MNC) to be queried
+ * @param[in] feature is the operator feature to be queried
+ * @return KAL_TRUE if the band is supported by the PLMN/RAT specified; KAL_FALSE if not supported
+ */
+kal_bool mrs_is_feature_supported_by_plmn(const plmn_id_struct *plmn_id, op_feature_enum feature);
+
+/**
+ * @brief Query if an operator feature is supported by specific MCC
+ * @param[in] plmn_id is the MCC to be queried
+ * @param[in] feature is the operator feature to be queried
+ * @return KAL_TRUE if the band is supported by the PLMN/RAT specified; KAL_FALSE if not supported
+ */
+kal_bool mrs_is_feature_supported_by_mcc(const plmn_id_struct *plmn_id, op_feature_enum feature);
+
+/**
+ * @brief Query the operator feature set by specific PLMN
+ * @param[in] plmn_id is the PLMN ID (MCC+MNC) to be queried
+ * @return the operator feature set by bitmap
+ */
+op_feature_bitmap mrs_get_feature_by_plmn(const plmn_id_struct *plmn_id);
+
+/**
+ * @brief Query the operator feature set by specific MCC
+ * @param[in] plmn_id is the MCC to be queried
+ * @return the operator feature set by bitmap
+ */
+op_feature_bitmap mrs_get_feature_by_mcc(const plmn_id_struct *plmn_id);
+
+/**
+ * @brief Query if operator 5G capability shall be disabled
+ * @param[in] hplmn is the PLMN ID (MCC+MNC) of Home PLMN
+ * @param[in] splmn is the PLMN ID (MCC+MNC) of Serving PLMN
+ * @param[in] is_roaming is the roaming status
+ * @param[in] vg_option is the 5G option to be checked
+ * @return KAL_TRUE if operator 5G capability shall be disabled; KAL_FALSE if not
+ */
+kal_bool mrs_is_op_vg_option_disabled(const plmn_id_struct *hplmn, const plmn_id_struct *splmn, kal_bool is_roaming, vg_option_enum vg_option);
+
+/**
+ * @brief Query if rat capability shall be disabled
+ * @param[in] hplmn is the PLMN ID (MCC+MNC) of Home PLMN
+ * @param[in] splmn is the PLMN ID (MCC+MNC) of Serving PLMN
+ * @param[in] is_roaming is the roaming status
+ * @param[in] rat_cap is the rat capability to be checked
+ * @return KAL_TRUE if rat capability shall be disabled; KAL_FALSE if not
+ */
+kal_bool mrs_is_rat_capability_disabled(const plmn_id_struct *hplmn, const plmn_id_struct *splmn, kal_bool is_roaming, rat_capability_enum rat_cap);
+
+/**
+ * @brief Query the custom PLMN search rat order by specific MCC
+ * @param[in] simInterface is the index of tagret SIM to be queried
+ * @param[in] plmn_id is the MCC to be queried
+ * @param[in] search_rat is the RAT set to be decided the priority
+ * @return 1st RAT's rat_enum among search_rat
+ */
+rat_enum mrs_get_first_search_rat_by_mcc(kal_uint8 simInterface, const plmn_id_struct *plmn_id, rat_enum search_rat);
+
+/**
+ * @brief Query the custom PLMN search rat order by specific PLMN
+ * @param[in] simInterface is the index of tagret SIM to be queried
+ * @param[in] plmn_id is the PLMN ID (MCC+MNC) to be queried
+ * @param[in] search_rat is the RAT set to be decided the priority
+ * @return 1st RAT's rat_enum among search_rat
+ */
+rat_enum mrs_get_first_search_rat_by_plmn(kal_uint8 simInterface, const plmn_id_struct *plmn_id, rat_enum search_rat);
+
+/**
+ * @brief Query the barred rat by specific MCC
+ * @param[in] simInterface is the index of tagret SIM to be queried
+ * @param[in] plmn_id is the MCC to be queried
+ * @param[in] search_rat is the RAT set to be checked
+ * @return rat_enum of barred rat among search_rat
+ */
+rat_enum mrs_get_barred_rat_by_mcc(kal_uint8 simInterface, const plmn_id_struct *plmn_id, rat_enum search_rat);
+
+/**
+ * @brief Query the barred rat by specific PLMN
+ * @param[in] simInterface is the index of tagret SIM to be queried
+ * @param[in] plmn_id is the PLMN ID (MCC+MNC) to be queried
+ * @param[in] search_rat is the RAT set to be checked
+ * @return rat_enum of barred rat among search_rat
+ */
+rat_enum mrs_get_barred_rat_by_plmn(kal_uint8 simInterface, const plmn_id_struct *plmn_id, rat_enum search_rat);
+
+/**
+ * @brief Check whether custom search order is applied to STORED_SEARCH or not by specific PLMN
+ * @param[in] simInterface is the index of tagret SIM to be queried
+ * @param[in] plmn_id is the MCC to be queried
+ * @return KAL_TRUE if it is applied to STORED_SEARCH
+ */
+kal_bool mrs_is_search_order_applied_to_stored_search_by_mcc(kal_uint8 simInterface, const plmn_id_struct *plmn_id);
+
+/**
+ * @brief Check whether custom search order is applied to STORED_SEARCH or not by specific MCC
+ * @param[in] simInterface is the index of tagret SIM to be queried
+ * @param[in] plmn_id is the PLMN ID (MCC+MNC) to be queried
+ * @return KAL_TRUE if it is applied to STORED_SEARCH
+ */
+kal_bool mrs_is_search_order_applied_to_stored_search_by_plmn(kal_uint8 simInterface, const plmn_id_struct *plmn_id);
+
+#endif /* MRS_COMMON_OPERATOR_FEATURE_PUBLIC_H */
+
diff --git a/mcu/protocol/interface/general/mrs_common_search.h b/mcu/protocol/interface/general/mrs_common_search.h
new file mode 100644
index 0000000..7e0703c
--- /dev/null
+++ b/mcu/protocol/interface/general/mrs_common_search.h
@@ -0,0 +1,78 @@
+#ifndef _MRS_COMMON_SEARCH_H
+#define _MRS_COMMON_SEARCH_H
+
+
+#include "mrs_common_capability.h"
+#include "mrs_as_struct.h"
+#include "mcc_recog_train_data.h"
+
+#define MAX_PREDICT_FREQ_NUM 64 // Only output 64 predict arfcn
+
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint32 arfcn_table_num;
+ kal_uint32 arfcn_table[350];
+} mrs_arfcn_predict_util_ut_result_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint32 arfcn_table_num;
+ kal_uint32 arfcn_table[MAX_PREDICT_FREQ_NUM];
+ kal_bool is_test_mode_on;
+} mrs_arfcn_predict_util_config_struct;
+
+typedef struct{
+ kal_uint32 *table_ptr;
+ kal_uint32 table_max_num;
+ kal_uint32 table_valid_num;
+ kal_uint32 cur_idx;
+} mrs_freq_table_struct;
+
+typedef struct{
+ mrs_freq_table_struct *arfcn_table;
+ mrs_freq_table_struct *skip_freq_table;
+ mrs_freq_table_struct *output_table;
+ kal_uint32 band_list_num;
+ kal_uint16 *band_list;
+} mrs_compose_freq_table_by_bands_struct;
+
+typedef enum
+{
+ MRS_SEARCH_PRIORITY_ENUM_ENDC,
+ MRS_SEARCH_PRIORITY_ENUM_SIGNAL_LEVEL,
+ MRS_SEARCH_PRIORITY_ENUM_LARGE_BANDWIDTH,
+ MRS_SEARCH_PRIORITY_ENUM_LOW_LATENCY,
+ MRS_SEARCH_PRIORITY_ENUM_WITH_NR_NEIGHBOR,
+ MRS_SEARCH_PRIORITY_ENUM_NUM,
+ MRS_SEARCH_PRIORITY_ENUM_INVALID
+} mrs_search_priority_enum;
+
+typedef struct{
+ mrs_search_priority_enum priority;
+ kal_bool is_enable;
+} mrs_search_priority_struct;
+
+typedef struct{
+ mrs_search_priority_struct index[MRS_SEARCH_PRIORITY_ENUM_NUM];
+} mrs_search_priority_list_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_int8 input[MCC_RECOG_LTE_DATA_LEN];
+ maif_mcc_enum maif_mcc;
+} mrs_mcc_ai_result_ind_struct;
+
+kal_int32 mrs_freq_compare(const void *a, const void *b);
+void mrs_plmn_to_l3_inc_plmn(const mrs_plmn_id *mrs_plmn, plmn_id_struct *nwsel_plmn);
+kal_bool mrs_freq_tbl_append_item(mrs_freq_table_struct *freq_table, kal_uint32 input_freq);
+extern void mrs_dump_arfcn_predict_result(kal_uint32 *arfcn_table, kal_uint32 arfcn_table_num);
+extern void mrs_compose_freq_table_by_bands(rat_enum target_rat,mrs_freq_table_struct *skip_freq_table,mrs_freq_table_struct *output_table,kal_uint32 band_list_num,const kal_uint16 *band_list,MRS_SIM_INDEX sim_index);
+extern kal_bool mrs_is_supported_band(MRS_SIM_INDEX sim_index, kal_uint16 band, rat_enum rat);
+extern kal_bool mrs_compose_freq_table(mrs_freq_table_struct *input_table, mrs_freq_table_struct *skip_table, mrs_freq_table_struct *output_table);
+extern void mrs_remove_duplicate_freq_table_entry(mrs_freq_table_struct *freq_table);
+extern void mrs_get_predict_test_table_by_band(kal_uint32 nr_band, mrs_freq_table_struct *arfcn_table);
+extern void mrs_search_read_nvram_cnf_handler(kal_uint16 nvram_file_id, kal_uint8 *data, kal_uint16 len);
+extern void mrs_search_get_search_priority_list(mrs_search_priority_list_struct *p_list);
+extern void mrs_search_set_search_priority_list(mrs_search_priority_list_struct *p_list);
+#endif
diff --git a/mcu/protocol/interface/general/mrs_eas_capability.h b/mcu/protocol/interface/general/mrs_eas_capability.h
new file mode 100644
index 0000000..972572d
--- /dev/null
+++ b/mcu/protocol/interface/general/mrs_eas_capability.h
@@ -0,0 +1,1201 @@
+/******************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*******************************************************************************/
+
+/******************************************************************************
+ * Filename:
+ * --------------------------------------------------------
+ * mrs_eas_capability.h
+ *
+ * Project:
+ * --------------------------------------------------------
+ * Multimode
+ *
+ * Description:
+ * --------------------------------------------------------
+ * The EAS capability stored in MRS context.
+ *
+ * Author:
+ * --------------------------------------------------------
+ * -------
+ *
+ * --------------------------------------------------------
+ * $Log$
+ *
+ * 05 13 2021 mandy.zheng
+ * [MOLY00627894] [Blocking][MT6885][Petrus][TMO-US][MP7 Excluded][q0][Lab IOT][Ericsson-Nokia][VoNR]VoNR PSHO to LTE failed because no B2 MR from UE
+ * R3-interface.
+ *
+ * 10 20 2020 yi-han.chung
+ * [MOLY00575501] [Xiaomi][J22][softbank] b41 ?¬q»Ý¨D
+ *
+ * SBM B41 partial band - MRS EAS
+ *
+ * 10 12 2020 gibran.chang
+ * [MOLY00571879] [Gen98][MT6880][Colgin][Internal][Machine][HQ][5GMM][RTD Test][Protocol Test System][General PTS] Sometimes UE is not able to camp on machine cell when two same EARFCN are present with different PLMN ID
+ * Todo#67 Check all PLMN in searched sib cell
+ *
+ * 10 01 2020 tero.miettinen
+ * [MOLY00560032] ????SA???
+ * MRS - PLMN based 5G band disabling.
+ *
+ * 09 22 2020 mandy.zheng
+ * [MOLY00572471] [MakeFile] [Modify Common Makefile Rules] commincdirs_def.mak.
+ *
+ * Fix Macro
+ *
+ * 09 08 2020 mandy.zheng
+ * [MOLY00565038] ¡i19420¡j¡iES¡j ¡iMovistar¡j¡iOperator feedback¡j¡iIOT3°e?¥²¸Ñ¡j¡iP2¡j¡iFUNC¡j¡i5G¡jSome Network can not handle LTE CA report, following ALPS05267036
+ * back out.
+ *
+ * 06 29 2020 yenchih.yang
+ * [MOLY00536627] [Gen97][MP6 feature] ?5G NSA > SA preferred? network search
+ *
+ * .
+ *
+ * 06 01 2020 yi-han.chung
+ * [MOLY00527121] LGE/FCC requirement for Band 41 AMPR
+ *
+ * ERRC/MRS
+ *
+ * 04 29 2020 plum.tseng
+ * [MOLY00515893] [HCR][MT6875][Margaux][Q0][MP5][R3][SQC][HQ][MTBF][Lab][Ericsson][ErrorTimes:4][ASSERT] file:mcu/protocol/lte_sec/errc/common/src/errc_asn1_wrapper.c line:159
+ *
+ * [VMOLY_R3] UE capability restriction. (and recover enter connected mode)
+ *
+ * 02 07 2020 plum.tseng
+ * [MOLY00496701] [VMOLY][ERRC&NRRC][Capability] Gemini status sync between ERRC&NRRC
+ *
+ * 12 09 2019 ke-ting.lee
+ * [MOLY00458503] [CODE SYNC][MH4P-POS] patch request about ALPS04309026- RCM/MRS_EAS
+ *
+ * 12 02 2019 yung-chun.chang
+ * [MOLY00462472] [Gen97][95.OPPO patch back to VMOLY]¡i¤G?°e?¥²¸Ñ¡jFast return to 4G should be disabled on UE
+ *
+ * .
+ *
+ * 10 30 2019 mandy.zheng
+ * [MOLY00455171] [Remote FT][MT6885][Petrus][MP1][SQC][MSL][RFT][Test Plan][FDD][LWTGC][4GMM][Static][NCT] DUT does not camps on 4G network when 5G is selected as preferred network type
+ *
+ * .
+ *
+ * 09 25 2019 mandy.zheng
+ * [MOLY00443402] [Gen97]2019 Jun CR - Clarification on SA fallback BC support
+ *
+ * -[ERRC]LTE SA band combination derived from ENDC support check API.
+ *
+ * 09 23 2019 yung-chun.chang
+ * [MOLY00440687] VMOLY code sync CR
+ *
+ * 1. CA TBL V2 main part
+ * 2. fix rf_param_v1390 not reset problem
+ *
+ * 08 21 2019 ke-ting.lee
+ * [MOLY00431023] [ERRC] VMOLY code sync for VMOLY (MOLY00401482)
+ * -iQi LT29 UE category
+ *
+ * 06 13 2019 plum.tseng
+ * [MOLY00413522] [VMOLY][Code Sync][ERRC][RCM] CA HPUE class B/C clarify
+ *
+ * 03 28 2019 morton.lin
+ * [MOLY00393767] [MT6297] TS 36.331 2018 December baseline migration
+ * [ERRC][RCM] 2018DEC version upgrading (MPD)
+ *
+ * 03 14 2019 plum.tseng
+ * [MOLY00391178] [MCF][VMOLY][ERRC] custom disable band feature with MCF
+ *
+ * [MCF][COSTOM_DISABLE_BAND][RCM & MRS].
+ *
+ * 01 21 2019 plum.tseng
+ * [MOLY00380403] Move XXX_PLMN_END definition from custom file to MRS_EAS
+ *
+ * [RCM&MRS] .
+ *
+ * 01 09 2019 sabrina.hsu
+ * [MOLY00377618] [VMOLY] RF partial band API for single band query change
+ * [MRS][EAS] change to use new API to get single band partial band parameter.
+ *
+ * 01 08 2019 sabrina.hsu
+ * [MOLY00377618] [VMOLY] RF partial band API for single band query change
+ * rollback for change header file.
+ *
+ * 12 27 2018 morton.lin
+ * [MOLY00375221] [Gen97][NSA] UE Capability development - Feature Set
+ * [ERRC][RCM] EUTRA Feature Set development
+ *
+ * 12 10 2018 morton.lin
+ * [MOLY00371624] [VMOLY][ERRC] provide API for NRRC to calculate P_compensation for LTE neighbor cells
+ * [ERRC][RCM][MRS] Pcompensation retrieval interface for 5G4 IRCR development
+ *
+ * 10 29 2018 sabrina.hsu
+ * [MOLY00345267] [6297][ERRC][RCM] LTE new feature
+ * [RCM]
+ * 1. LTE new custom CA report way by EL1D
+ * 2. LTE CA/partial band check API interface
+ * 3. F30 ASN feature merge
+ *
+ * 08 20 2018 plum.tseng
+ * [MOLY00346737] [ERRC][RCM] B41C HPUE
+ *
+ * [VMOLY] (OA)
+ *
+ * 08 17 2018 yenchih.yang
+ * [MOLY00346658] [VMOLY] Gen97 ERRC-CEL modifications
+ *
+ * 1) ERRC-CEL ENDC support.
+ * 2) MRS ERRC Up to Down Search Information.
+ *
+ * 07 19 2018 ke-ting.lee
+ * [MOLY00322830] [UMOLYE][ERRC] source code release
+ * - mrs eas
+ *
+ * 07 18 2018 plum.tseng
+ * [MOLY00338708] �i�t??�w�ʡjAssert fail: errc_cel_iscells.c 2108 - ERRC
+ *
+ * Fix reset part in band setting update by hplmn and cplmn.
+ *
+ * 07 03 2018 yung-chun.chang
+ * [MOLY00334670] [CV5a] block specific LTE bands for particular roaming plmns
+ * rcm/mrs part.
+ *
+ * 03 09 2018 morton.lin
+ * [MOLY00309570] [Gen93/95][UMOLYE][ERRC][RCM] WWLTEDB table movement for better customization
+ * 1. LTEBand and CAComb table movement
+ * 2. Introduce LTEBandExcl
+ * 3. Add new DL only bands: B75 & B76
+ *
+ * 01 05 2018 otto.liu
+ * [MOLY00298065] [MT6293] VZW feature developement & patch back
+ *
+ * .
+ *
+ * 12 11 2017 morton.lin
+ * [MOLY00295077] [Gen93][ERRC][RCM] LTE support band and CA combination customization re-arch
+ * Common IF and MRS part (LR12A.R3.MP) (Not in V-List)
+ *
+ * 11 29 2017 yung-chun.chang
+ * [MOLY00292082] [Gen93][TMO] 2G disable with ecc enable
+ * rcm oa part
+ *
+ * 10 31 2017 otto.liu
+ * [MOLY00285011] ?iGIONEE_MODEM?j?iMT6755?j?i17G01?j ???BAND 41
+ *
+ * .
+ *
+ * 10 31 2017 otto.liu
+ * [MOLY00285011] ?iGIONEE_MODEM?j?iMT6755?j?i17G01?j ???BAND 41
+ *
+ * 10 13 2017 otto.liu
+ * [MOLY00283132] [Gen93] R3 US operator customization
+ *
+ * .
+ *
+ * 09 14 2017 otto.liu
+ * [MOLY00277983] [Market]��???��?TDD LTE�I?�U???�qFDD LTE band ��]
+ *
+ * OPPO disable band according to SIM and plmn
+ *
+ * 08 24 2017 morton.lin
+ * [MOLY00273532] [MT6763][Bianco][N1][in-FTA][4G PCT][Anritsu][HQ][E04][8.2.1.5]
+ * Add new extended version for MRS EAS APIs to reduce trace print (UMOLYA)
+ *
+ * 07 28 2017 morton.lin
+ * [MOLY00266852] [Bianco/Zion] fre sw check-in
+ * [MRS] B71 SW phase in (UMOLYA)
+ *
+ * 07 06 2017 morton.lin
+ * [MOLY00261305] [Gen93] B71 development
+ * MRS and NVRAM phase in
+ *
+ * 04 16 2017 menghau.wu
+ * [MOLY00241464] [MT6293]Code sync from LR12 (W15, phase 21)- bug only
+ * UMOLY CR : [MOLY00209939] [ERRC][CEL][LCEL] L+L
+ * UMOLY CL : 3733883, [MRS] L+L, clear black cell bug fix.
+ *
+ * 04 05 2017 dennis.weng
+ * [MOLY00238929] [BIANCO][MT6763][RDIT][PHONE][Overnight][HQ][MTBF][Lab][Ericsson]"[Fatal error(task)] err_code1:0x00000305 err_code2:0x888802C2 err_code3:0xCCCCCCCC"
+ * add API: mrs_eas_get_dl_earfcn_freq
+ *
+ * 03 14 2017 menghau.wu
+ * [MOLY00217129] [MT6293] code sync from UMOLY (Phase4)
+ * UMOLY CR : [MOLY00224474] [6291][MP3][Post MP] CU HST Patch - MRS and CUSTOM
+ * UMOLY CL : 3547100
+ *
+ * 01 25 2017 menghau.wu
+ * [MOLY00217129] [MT6293] code sync from UMOLY (Phase4)
+ * UMOLY CR : [MOLY00223173] [6292][Gemini][L+L][Merge LR12][WCS/SE3/PS1~PS15]
+ * UMOLY CL : 3370203
+ *
+ * 12 21 2016 menghau.wu
+ * [MOLY00217129] [MT6293] code sync from UMOLY (Phase4)
+ * UMOLY CR : [MOLY00210217] [MT6292] UE Capability preparation for Gen92 MP1
+ * UMOLY CL : 3212767
+ *
+ * 12 02 2016 adeline.chang
+ * [MOLY00214717] [6293] CHM modification for UT enhancement
+ * .
+ *
+ * 11 15 2016 menghau.wu
+ * [MOLY00213308] [6293] add MRS_EAS debug trace
+ * add MRS_EAS debug trace
+ *
+ * 11 10 2016 menghau.wu
+ * [MOLY00210784] [MT6293] code sync form UMOLY
+ * UMOLY CR : MOLY00209435
+ * UMOLY CL : 3015617
+ *
+ * 11 10 2016 menghau.wu
+ * [MOLY00210784] [MT6293] code sync form UMOLY
+ * UMOLY CR : MOLY00208743
+ * UMOLY CL : 2997397
+ *
+ * 11 09 2016 menghau.wu
+ * [MOLY00210784] [MT6293] code sync form UMOLY
+ * other parts of
+ * UMOLY CR : MOLY00200565
+ * UMOLY CL : 2855909
+ *
+ * 10 24 2016 menghau.wu
+ * [MOLY00208768] [MT6293] [B66] Band66 porting (ERRC part)
+ * UMOLY CL2892669 : Menghau's part
+ *
+ * 10 12 2016 menghau.wu
+ * [MOLY00207053] [MT6293] code sync form UMOLY
+ * UMOLY CR : [MOLY00188984] [ERRC][CEL] code sync for VIVO black cell
+ * UMOLY CL : 2577019
+ *
+ * 09 26 2016 adeline.chang
+ * [MOLY00205093] [UMOLYA] merge CR from mw.hsu CBr
+ * .
+ *
+ * 09 13 2016 adeline.chang
+ * [MOLY00203230] [PS_DEV][6293] MRS critical section protect in mrs_eas_capability.c
+ * .
+ *
+ * 08 19 2016 hong-yuan.yang
+ * [MOLY00196550] [6293] ERRC CSR development
+ *
+ * . API replace -MRS_EAS_CAPABILITY.c
+ *
+ * 06 22 2016 maruco.tu
+ * [MOLY00185901] UMOLYA errc relevant latest code sync from UMOLY
+ * Help HY to integrate mrs_eas_capability.c/.h from UMOLY to UMOLYA
+ *
+ * 05 12 2016 morton.lin
+ * [MOLY00178939] [MT6797L]modem,md1:(MCU_L1CORE) [ASSERT] file:l1core/modem/el1/el1d/src/common/ldsp_err_chk_cm.c line:115
+ * MT6797 setting correction (UMOLY)
+ *
+ * 03 18 2016 sabrina.hsu
+ * [MOLY00169952] [MT6292][FPGA][Phone Call][4G TDD][Normal][Sanity] Assert fail: errc_rcm_main.c 2700 - L4
+ * remove R12 category extension for L4 CA icon query function
+ *
+ * 03 16 2016 ryan.ou
+ * [MOLY00159902] [ERRC][CEL] 2015 Q4 code sync from LR11 to UMOLY
+ * [MOLY00150744] [LTE-A] Limit device operation on partial band.
+ *
+ * 03 09 2016 sabrina.hsu
+ * [MOLY00156230] [6292] ERRC code sync LR11 to UMOLY
+ * merge LR11 CL 1801342 [MOLY00148166]CT CA capability query support
+ *
+ * 02 17 2016 sabrina.hsu
+ * [MOLY00156230] [6292] ERRC code sync LR11 to UMOLY
+ * AT+EPBSE
+ *
+ * 02 17 2016 sabrina.hsu
+ * [MOLY00156230] [6292] ERRC code sync LR11 to UMOLY
+ * mrs/nvram/sbp merge
+ *
+ * 02 16 2016 nicky.chou
+ * [MOLY00160414] [ERRC][CONN] sync from LR11 to UMOLY
+ * [CL1929095][MOLY00154210] [MT6755][E2][GCF][Anritsu][4G][FDD][MP3][17.4.11.2][eMBMS][E01-E03] Fail on this case.
+ *
+ * 12 01 2015 sabrina.hsu
+ * [MOLY00151252] World Mode ID & Support Band collision check
+ * WMID band check.
+ *
+ * 10 12 2015 chi-chung.lin
+ * [MOLY00144274] [MOLY->UMOLY][MOLY00136067][SBM]New Feature : Partial Channel Bandwidth supported.
+ * .
+ *
+ * 10 06 2015 sabrina.hsu
+ * [MOLY00144311] [UMOLY][CEL][MRS] __RF_BYPASS__ option wrap modification for Elbrus DIQ/AIQ test
+ * remove chip option to enable __RF_BYPASS__ for ELbrus.
+ *
+ * 10 06 2015 chih-chien.lin
+ * [MOLY00132591] [ERRC][CEL]CMCC B38/B41 CA issue
+ * B38/41 CA Issue
+ *
+ * 09 21 2015 panu.peisa
+ * [MOLY00141214] DE6 code merge from LR11_VzW CBr to UMOLY trunk
+ * Integrated CL 1601909 from LR11_VzW CBr. VzW: Dynamic LTE band support when roaming in MRS
+ *
+ * 09 04 2015 roland.li
+ * [MOLY00139861] [MT6291][SBM] New Feature : Disable LTE B41 for roaming out side of Japan.
+ * .
+ *
+ * 08 20 2015 sabrina.hsu
+ * [MOLY00138312] [6292] UMOLY code sync
+ * disable #error check for ElBRUS build.
+ *
+ * 08 04 2015 chi-chung.lin
+ * [MOLY00133208] [RCM] Jade code revision
+ * .
+ *
+ * 06 01 2015 henry.lai
+ * [MOLY00092508] [MT6291][LTE-C2K] AS Inter RAT feature
+ * .
+ *
+ * 04 16 2015 doug.shih
+ * [MOLY00091463] [MT6291] ERRC RCM/MRS development
+ * 1. [CR1515] Network-requested CA Band Combination Capability Signalling
+ * 2. [CR1535] Introduction of UE capability for eMBMS reception on SCell and Non-Serving Cell
+ * 3. C2K FGI/Capability IE refinement
+ * (OA domain).
+ *
+ * 03 16 2015 justin.li
+ * [MOLY00098827] [MT6291][ERRC-CEL] Extension EARFCN feature
+ * .
+ *
+ * 03 09 2015 ivy.wang
+ * [MOLY00097236] [TK6291 FPGA][pre-1stCallTest][UMOLY][4G] Assert @ lcel_paging.c #910
+ * [MOLY00091983] [VzW][6.2.16.1] FEMTO SYSTEM SELECTION(VZ_REQ_LTEDATA_6820)
+ *
+ * 02 10 2015 doug.shih
+ * [MOLY00091463] [MT6291] ERRC RCM/MRS development
+ * Extend encoded EUTRAN UE capability buffer size.
+ *
+ * 11 14 2014 henry.lai
+ * [MOLY00079072] [MT6291] Change EARFCN from kal_uint16 to kal_uint32 for CEL part
+ * .
+ *
+ * 11 13 2014 doug.shih
+ * [MOLY00068710] [MT6291_DEV] Sync MOLY to MT6291_DEV
+ * Merge MT6291_DEV code to UMOLY trunk.
+ *
+ * 08 01 2014 menghau.wu
+ * [MOLY00073987] [MT6290E2][MRS] Create mrs_eas_max_band_cap_for_user() to L4C for user friendly UI
+ * Create mrs_eas_max_band_cap_for_user() to L4C for user friendly UI
+ *
+ * 01 21 2014 wcpuser_integrator
+ * [MOLY00054475] SGLTE option rename
+ * .
+ *
+ * 11 13 2013 adeline.chang
+ * [MOLY00046027] [MT6290E1][MMDS_DC] MMDC feature patch back to MOLY trunk
+ * .
+ *
+ * 10 21 2013 hong-yuan.yang
+ * [MOLY00040050] [MultiMode] Dynamic band selection
+ * .
+ *
+ * 09 26 2013 adeline.chang
+ * [MOLY00038974] [LTE Gemini] Add SIM index as input parameter for two MRS API
+ * .
+ *
+ * 08 23 2013 adeline.chang
+ * [MOLY00034813] [MT6290] DL/UL EARFCN check using DL/UL BW
+ * .
+ *
+ * 07 12 2013 hong-yuan.yang
+ * [MOLY00028770] add eas fdd/tdd judge api in MRS
+ * .modify enum
+ *
+ * 07 05 2013 hong-yuan.yang
+ * [MOLY00028770] add eas fdd/tdd judge api in MRS
+ * .add fdd/tdd jdg api
+ *
+ * 07 05 2013 hong-yuan.yang
+ * [MOLY00028770] add eas fdd/tdd judge api in MRS
+ * .add eas fdd/tdd judge api in MRS
+ *
+ * 05 13 2013 shih-chieh.liao
+ * [MOLY00022028] LTE MM.IT errc merge to MOLY
+ * merge mrs
+ *
+ * 01 22 2013 david.niu
+ * [MOLY00009205] [MRS] Code checked-in for MOLY branch
+ * .
+ *
+ *****************************************************************************/
+
+#ifndef _MRS_EAS_CAPABILITY_H
+#define _MRS_EAS_CAPABILITY_H
+
+#include "mrs_as_inter_core_def.h"
+#include "mrs_as_enums.h"
+#include "mrs_as_struct.h"
+#include "reg_base.h"
+#include "global_type.h"
+#include "mrs_common_capability.h"
+//#include "el1d_rf_def.h"
+#include "lte_rf_public.h" //for LTE_BIT_MASK_BUFFER_SIZE
+#include "el1d_rf_public.h"
+#if (CUR_GEN >= MD_GEN95)
+#include "el1d_rf_def.h" //for LTE_CA_SIMUL_BAND_MAX
+#include "nl1_ue_capability.h"
+#endif
+#include "errc_nvram_editor.h"
+/*****************************************************************************
+ * Macros Without Parameters
+ *****************************************************************************/
+
+/* Pcore reading */
+typedef volatile unsigned long* APBADDR32;
+
+#define MASK_1_BIT 0x0001
+
+/* (This value should be aligned with EL1D_RF_GET_BAND_SUPPORT_MASK() interface
+ * and the LTE Band number in the NVRAM_EF_AS_BAND_SETTING_LID)
+ */
+#define LTE_BAND_MASK_WORD_COUNT LTE_BIT_MASK_BUFFER_SIZE
+
+// Because EAS srch Info only has 1 instance, but we want to reuse eas_mutex, so only choose SIM_IDX = 0
+#define MRS_EAS_SRCH_INFO_REF_SIM_IDX 0
+
+#define MRS_EAS_SRCH_INFO_BAND_MAX 64
+#define MRS_EAS_SRCH_INFO_FREQ_MAX 256
+#define MRS_EAS_SRCH_INFO_CELL_MAX 128
+// The actual value of MRS_MAX_SUB_BAND_NUM is MAX_SUB_BAND_NUM in el1_cnst.h
+// The actual value of MRS_BW_INVALID is BW_INVALID in el1_cnst.h
+// The actual value of MRS_ERRC_PCI_INVALID is ERRC_PCI_INVALID in errc_lcommon_def.h
+// Directly defined here to prevent dependancy problem.
+#define MRS_MAX_SUB_BAND_NUM ((286/8)+1)
+#define MRS_BW_INVALID 0xFF
+#define MRS_ERRC_PCI_INVALID 0xFFFF
+
+/* Define the end of all PLMN config lists in custom files (containing custom_eas and wwltedb) */
+#define MRS_EAS_CUSTOM_PLMN_CFG_END "FFFFFF"
+#define MRS_EAS_UE_CAT_INVALID NVRAM_LTE_UE_CAT_INVALID
+
+#define LTE_CA_MAX_NUM_SIMUL_BANDS 5 //align ERRC_CAP_EUTRA_CA_MAX_SIMUL_AGGR_BAND_NUM
+#define MRDC_MAX_NUM_BAND_COMBINATIONS NL1_CAP_MAX_NUM_BAND_COMBINATIONS//align NL1_CAP_MAX_NUM_BAND_COMBINATIONS
+/*****************************************************************************
+ * Macros With Parameters
+ *****************************************************************************/
+#define MRS_COMPILE_TIME_ASSERT(e) ((void)sizeof(char[1-2*!(e)]))
+
+/*****************************************************************************
+ * Enums without tags
+ *****************************************************************************/
+/* Workaround for MT6291 FGPA Digital IQ */
+/* #if defined(__RF_BYPASS__) */
+#define EAS_LOCK_MULTI_FREQ_NUM_MAX 4
+#define EAS_LOCK_MULTI_FREQ_NUM_EMPTY 0
+
+typedef enum {
+ MRS_EAS_SRCH_INFO_BAND_NOT_SEARCHED,
+ MRS_EAS_SRCH_INFO_BAND_PARTIAL,
+ MRS_EAS_SRCH_INFO_BAND_COMPLETED
+} mrs_eas_srch_info_band_status_enum;
+
+typedef enum {
+ MRS_EAS_SRCH_INFO_FREQ_UNKNOWN,
+ MRS_EAS_SRCH_INFO_FREQ_FOUND,
+ MRS_EAS_SRCH_INFO_FREQ_NOT_FOUND
+} mrs_eas_srch_info_freq_status_enum;
+
+typedef enum {
+ BAND_SETTING_UPDATE,
+ READ_NVRAM_CNF,
+ MAX_BAND_CAP,
+ BAND_CTRL_FUNC,
+ ADD_REMOVE_BAND,
+ SET_CONTEXT_NVRAM,
+ GET_CONTEXT_NVRAM,
+ GET_LTE_SUPPORT_BAND,
+ IS_FDD_SUPPORT,
+ IS_TDD_SUPPORT,
+ SIM_PLMN_BAND_UPDATE,
+ DISABLE_B7_B38,
+ DISABLE_BAND_BY_PLMN,
+ PLMN_REGION_BAND
+} eas_band_print_func_enum;
+
+typedef enum {
+ FUNC_INPUT,
+ COMP_OPT_FILTER,
+ RF_FILTER,
+ SWUSE_DUPLEX_FILTER,
+ MODEM_COMP_OPT_FILTER,
+ SWUSE_FILTER,
+ SCSI_INPUT,
+ SINGLE_BAND_TOGGLE,
+ NVRAM_OUTPUT,
+ RF_SWUSE_FILTER,
+ SCSI_OUTPUT,
+ MRS_NVRAM_STORED_BAND,
+ CUSTOM_PLMN_BAND,
+ RF_INPUT
+} eas_band_print_check_point_enum;
+
+/*****************************************************************************
+ * Type Definitions
+ *****************************************************************************/
+
+typedef struct {
+ // The actual type of csr_special_type is el1_csr_search_spcial_type_enum in el1_enum.h
+ // Here use uint8 to prevent dependancy problem (L4/LBS include mrs_eas_capability.h but could not access L1 header)
+ kal_uint8 csr_special_type;
+ kal_bool skip_weak_freq;
+ kal_int16 rssi_threshold;
+ kal_uint8 subband_bandwidth;
+ kal_uint16 strong_n_subband_num;
+} mrs_eas_srch_info_band_condition_struct;
+
+typedef struct {
+ kal_uint16 band;
+ kal_bool is_complete;
+ // cmpl_subband only valid when is_complete = FALSE
+ kal_uint8 cmpl_subband[MRS_MAX_SUB_BAND_NUM];
+ // cond describe the band is searched during which setting of carrier_search_req
+ // It's valid no matter is_complete = FALSE or TRUE
+ mrs_eas_srch_info_band_condition_struct cond;
+} mrs_eas_srch_info_band_struct;
+
+typedef struct {
+ // The actual type of srch_type is el1_csr_search_type_enum in el1_enum.h
+ // Here use uint8 to prevent dependancy problem (L4/LBS include mrs_eas_capability.h but could not access L1 header)
+ kal_uint8 srch_type;
+ kal_bool skip_weak_freq;
+ kal_int16 rssi_threshold;
+ kal_bool is_endc_only_search;
+} mrs_eas_srch_info_freq_condition_struct;
+
+typedef struct {
+ EARFCN earfcn;
+ kal_bool is_found;
+ // cond describe the earfcn is not found during which setting of carrier_search_req
+ // so it's only valid when is_found = FALSE
+ mrs_eas_srch_info_freq_condition_struct cond;
+} mrs_eas_srch_info_freq_struct;
+
+typedef struct {
+ EARFCN earfcn;
+ kal_uint16 pci;
+ // The following collect from MIB
+ // The actual type of srch_type is el1_bandwidth_enum in el1_enum.h
+ // Here use uint8 to prevent dependancy problem (L4/LBS include mrs_eas_capability.h but could not access L1 header)
+ kal_uint8 dl_bw;
+ // The following collect from SIB1
+ mrs_plmn_id_list plmn_list;
+ kal_uint16 tac;
+} mrs_eas_srch_info_cell_struct;
+
+// The MRS EAS searched info is divided to 3 lists (band/freq/cell) to prevent using a big ctrl buffer
+// Besides, directly use the band->freq->cell hierarchy will cause a huge data structure
+typedef struct {
+ kal_uint32 band_num;
+ mrs_eas_srch_info_band_struct *band_level_list;
+ kal_uint32 freq_num;
+ mrs_eas_srch_info_freq_struct *freq_level_list;
+ kal_uint32 cell_num;
+ mrs_eas_srch_info_cell_struct *cell_level_list;
+} mrs_eas_srch_info_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+
+ kal_uint32 band_num;
+ mrs_eas_srch_info_band_struct band_level_list[MRS_EAS_SRCH_INFO_BAND_MAX];
+} mrs_eas_srch_info_band_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+
+ kal_uint32 freq_num;
+ mrs_eas_srch_info_freq_struct freq_level_list[MRS_EAS_SRCH_INFO_FREQ_MAX];
+} mrs_eas_srch_info_freq_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+
+ kal_uint32 cell_num;
+ mrs_eas_srch_info_cell_struct cell_level_list[MRS_EAS_SRCH_INFO_CELL_MAX];
+} mrs_eas_srch_info_cell_ind_struct;
+
+typedef struct {
+ kal_uint16 band;
+ EARFCN dl_lower_earfcn;
+ EARFCN dl_upper_earfcn;
+ EARFCN ul_lower_earfcn;
+ EARFCN ul_upper_earfcn;
+} eas_partial_band_list_struct;
+
+typedef struct {
+ kal_uint8 valid_num;
+ eas_partial_band_list_struct band_list[EAS_EF_ERRC_PARTIAL_BAND_NUM];
+} eas_partial_band_inf_struct;
+
+typedef struct {
+ EARFCN earfcn;
+ kal_uint16 lte_band_num;
+ kal_uint16 *lte_band_list_ptr;
+}earfcn_list_struct;
+
+
+/* Workaround for MT6291 FGPA Digital IQ */
+/* #if defined(__RF_BYPASS__) */
+typedef struct {
+ kal_uint8 lock_multi_freq_num;
+ kal_uint16 lock_multi_freq[EAS_LOCK_MULTI_FREQ_NUM_MAX];
+} eas_lock_multi_freq_capa_struct;
+
+/* B66 support */
+typedef struct {
+ kal_uint8 lte_band_list[SIZE_LTE_BAND_MASK_TABLE_EXTENDED];
+} mrs_lte_band_list_struct;
+
+/*4G UE category*/
+
+//mrs_eas_ue_category_max_struct should be the same as errc_rcm_ue_category_max_struct
+typedef struct
+{
+ kal_uint8 dl;
+ kal_uint8 ul;
+}mrs_eas_ue_category_max_struct;
+
+typedef struct
+{
+ kal_uint8 nvram_ue_category; // ue-category -> nvram_errc_ue_cat_enum
+ mrs_eas_ue_category_max_struct max_ue_category;
+} mrs_eas_ue_category_struct;
+
+
+typedef struct {
+#ifdef UNIT_TEST
+ kal_uint32 eutra_capa_length;
+#if (CUR_GEN >= MD_GEN95)
+ kal_uint8 eutra_capa[8000]; //shall be aligned to ERRC_RCM_EUTRA_CAPA_MAX_LEN
+#else
+ kal_uint8 eutra_capa[4096]; //shall be aligned to ERRC_RCM_EUTRA_CAPA_MAX_LEN
+#endif /* #if (CUR_GEN >= MD_GEN95) */
+#endif /* UNIT_TEST */
+ kal_uint8 eea_support;/*MSB: EEA0, EEA1,.....EEA7*/
+ kal_uint8 eia_support;/*MSB: EIA0, EIA1,.....EIA7*/
+ kal_uint8 eas_power_class;
+//#ifdef __SGLTE__
+ kal_bool is_band_39_ori_support;
+//#endif /* __SGLTE__ */
+ kal_uint8 is_band_ori_support[SIZE_LTE_BAND_MASK_TABLE_EXTENDED];
+/* Workaround for MT6291 FGPA Digital IQ */
+/* #if defined(__RF_BYPASS__) */
+ eas_lock_multi_freq_capa_struct lock_multi_dl_freq_capa;
+ kal_uint8 data[3]; // for LTE_CAP write back to NVRAM
+ kal_uint8 op_femtocell_system_selection; /* VzW : 6.2.16.1 FEMTOCELL SYSTEM SELECTION */
+ kal_uint8 disable_bw_bmp[LTE_BAND_NUM_EXTENDED];
+ eas_partial_band_inf_struct partial_band_inf;
+ eas_partial_band_inf_struct partial_band_inf_backup;
+ kal_uint8 nvram_lte_band[SIZE_LTE_BAND_MASK_TABLE_EXTENDED];
+ mrs_eas_ue_category_struct eas_ue_category;
+} eas_capability_context_struct;
+
+
+#if (CUR_GEN >= MD_GEN95)
+
+typedef struct{
+ kal_uint16 band;
+ kal_uint8 ca_bw_clas_ul; /* A=0, B=1, C=2, ....for cc num 0 set as 6*/
+ kal_uint8 ca_bw_clas_dl; /* A=0, B=1, C=2, ....for cc num 0 set as 6*/
+}mrs_eas_ca_band_param_struct;
+
+typedef struct{
+ kal_uint8 band_param_num;
+ mrs_eas_ca_band_param_struct band_param[LTE_CA_SIMUL_BAND_MAX];
+}mrs_eas_ca_band_comb_struct;
+
+#endif /* #if (CUR_GEN >= MD_GEN95) */
+
+#if (CUR_GEN >= MD_GEN97)
+
+typedef struct{
+ kal_uint8 band_param_num;
+ mrs_eas_ca_band_param_struct band_param[LTE_CA_MAX_NUM_SIMUL_BANDS];
+}mrs_eas_lte_band_comb_struct;
+
+typedef struct{
+ kal_uint16 bc_num;
+ mrs_eas_lte_band_comb_struct lte_standalone_bc[MRDC_MAX_NUM_BAND_COMBINATIONS];
+ kal_bool is_bc_support[MRDC_MAX_NUM_BAND_COMBINATIONS];
+}mrs_eas_mrdc_lte_standalone_bc_list;
+
+#endif /* #if (CUR_GEN >= MD_GEN97) */
+
+typedef enum {
+ EAS_BAND_PHY_FREQ_MIN,
+ EAS_BAND_PHY_FREQ_MAX,
+ EAS_BAND_EARFCN_MIN,
+ EAS_BAND_EARFCN_MAX,
+ EAS_BAND_EARFCN_FREQ_INFO_NUM
+} eas_band_earfcn_freq_info_enum;
+
+typedef enum {
+ EAS_CELL_MODE_UNKNOWN,
+ EAS_CELL_MODE_FDD,
+ EAS_CELL_MODE_TDD
+} eas_cell_mode_enum;
+
+typedef enum {
+ EAS_COUNTRY_JAPAN,
+ EAS_COUNTRY_CHINA,
+ EAS_COUNTRY_USA,
+ EAS_COUNTRY_NORTH_AMERICA_BY_CUSTOMER
+} eas_country_enum;
+
+typedef enum {
+ EAS_CAT_4 = 0, /* EAS_CAT_4 set to 0: means no CA support for L4 to display CT CA icon */
+ EAS_CAT_6 = 1 /* EAS_CAT_6 set to 1: means CA support */
+} eas_category_enum;
+
+typedef enum {
+ EAS_CAP_SHORT_MEAS_GAP_R14,
+
+ EAS_CAP_TOTAL_NUM
+}eas_cap_feature_enum;
+
+#ifdef UNIT_TEST
+typedef struct {
+ kal_uint32 band_mask_word_count;
+ kal_uint32 band_mask[LTE_BAND_MASK_WORD_COUNT];
+} eas_rf_supported_bands_struct;
+#endif /* UNIT_TEST */
+
+typedef struct{
+ kal_uint32 dl_start_earfcn;
+ kal_uint32 dl_end_earfcn;
+ kal_uint32 ul_start_earfcn;
+ kal_uint32 ul_end_earfcn;
+}eas_rf_partial_band_param_struct;
+
+
+/*****************************************************************************
+ * Declarations Of Exported Globals
+ *****************************************************************************/
+
+// no need mutex protection, use freely
+eas_category_enum mrs_eas_ue_category(MRS_SIM_INDEX sim_index);
+
+
+// no need mutex protection, use freely
+kal_bool mrs_eas_is_supported_band(MRS_SIM_INDEX sim_index,
+ kal_uint16 lte_band);
+
+// no need mutex protection, use freely
+kal_bool mrs_eas_is_supported_band_ext(MRS_SIM_INDEX sim_index,
+ kal_uint16 lte_band,
+ kal_bool show_trace);
+
+// no need mutex protection, use freely
+kal_bool mrs_eas_is_rf_supported_band(kal_uint16 lte_band);
+
+
+// no need mutex protection, use freely
+kal_bool mrs_eas_get_unsupported_range(MRS_SIM_INDEX sim_index, kal_uint16 lte_band, EARFCN *l1, EARFCN *r1, EARFCN *l2, EARFCN *r2);
+
+
+// no need mutex protection, use freely
+void mrs_eas_convert_dl_earfcn(EARFCN dl_earfcn,
+ kal_uint16 *lte_band_ptr,
+ kal_uint32 *phy_freq_ptr);
+
+
+// no need mutex protection, use freely
+void mrs_eas_convert_ul_earfcn(EARFCN ul_earfcn,
+ kal_uint16 *lte_band_ptr,
+ kal_uint32 *phy_freq_ptr);
+
+
+// need mutex protection, call "mrs_eas_internal_xxx..." for internal use (to avoid taking mutex recursively)
+kal_bool mrs_eas_is_supported_dl_earfcn(MRS_SIM_INDEX sim_index,
+ EARFCN dl_earfcn);
+
+
+// need mutex protection, call "mrs_eas_internal_xxx..." for internal use (to avoid taking mutex recursively)
+kal_bool mrs_eas_is_supported_ul_earfcn(MRS_SIM_INDEX sim_index,
+ EARFCN ul_earfcn);
+
+
+// no need mutex protection, use freely
+kal_bool mrs_eas_is_dl_earfcn_overlap(EARFCN dl_earfcn1,
+ EARFCN dl_earfcn2);
+
+
+// no need mutex protection, use freely
+kal_bool mrs_eas_is_ul_earfcn_overlap(EARFCN ul_earfcn1,
+ EARFCN ul_earfcn2);
+
+
+// no need mutex protection, use freely
+kal_bool mrs_eas_partial_band_range_chk(kal_uint16 lte_band,
+ EARFCN dl_lower_earfcn,
+ EARFCN dl_upper_earfcn,
+ EARFCN ul_lower_earfcn,
+ EARFCN ul_upper_earfcn);
+
+
+// no need mutex protection, use freely
+kal_uint32 mrs_eas_convert_dl_earfcn_to_freq(EARFCN dl_earfcn);
+
+
+// need mutex protection, call "mrs_eas_internal_xxx..." for internal use (to avoid taking mutex recursively)
+EARFCN mrs_eas_convert_to_best_dl_earfcn_mfbi(MRS_SIM_INDEX sim_index,
+ EARFCN dl_earfcn,
+ kal_uint16 band_indicator,
+ kal_uint8 lte_band_num,
+ kal_uint16 *lte_band_list_ptr,
+ eas_bandwidth_enum band_width,
+ kal_bool allow_disabled_bands);
+
+
+// need mutex protection, call "mrs_eas_internal_xxx..." for internal use (to avoid taking mutex recursively)
+EARFCN mrs_eas_convert_to_best_dl_earfcn_mfbi_freq_pri(MRS_SIM_INDEX sim_index,
+ EARFCN dl_earfcn,
+ kal_uint16 band_indicator,
+ kal_uint8 lte_band_num,
+ kal_uint16 *lte_band_list_ptr,
+ kal_bool freq_pri,
+ eas_bandwidth_enum band_width,
+ kal_bool allow_disabled_bands);
+
+
+// no need mutex protection, use freely
+EARFCN mrs_eas_convert_dl_earfcn_to_target_band(EARFCN dl_earfcn,
+ kal_uint16 target_band);
+
+
+// no need mutex protection, use freely
+EARFCN mrs_eas_convert_ul_earfcn_to_target_band(EARFCN ul_earfcn,
+ kal_uint16 target_band);
+
+
+// no need mutex protection, use freely
+kal_bool mrs_eas_is_ca_supplemental_dl_earfcn(EARFCN dl_earfcn);
+
+
+// no need mutex protection, use freely
+kal_bool mrs_eas_is_ca_supplemental_dl_band(kal_uint16 lte_band);
+
+
+// no need mutex protection, use freely
+kal_bool mrs_eas_is_ca_supplemental_dl_band_ext(kal_uint16 lte_band,
+ kal_bool show_trace);
+
+
+// need mutex protection, create new "mrs_eas_internal_yyy..." for internal use (to avoid taking mutex recursively) (refer to "mrs_eas_is_supported_dl_earfcn")
+EARFCN mrs_eas_multi_band_conversion(MRS_SIM_INDEX sim_index,
+ EARFCN earfcn,
+ kal_uint16 lte_band_num,
+ kal_uint16 *lte_band_list_ptr);
+
+
+// need mutex protection, create new "mrs_eas_internal_yyy..." for internal use (to avoid taking mutex recursively) (refer to "mrs_eas_is_supported_dl_earfcn")
+EARFCN mrs_eas_multi_band_conversion_rej_redirection(MRS_SIM_INDEX sim_index,
+ EARFCN redirection_earfcn,
+ kal_uint8 freq_num,
+ earfcn_list_struct *earfcn_list_ptr);
+
+
+// no need mutex protection, use freely
+kal_bool mrs_eas_is_lte_fdd_support(MRS_SIM_INDEX sim_index);
+
+
+// no need mutex protection, use freely
+kal_bool mrs_eas_is_lte_tdd_support(MRS_SIM_INDEX sim_index);
+
+
+// need mutex protection, create new "mrs_eas_internal_yyy..." for internal use (to avoid taking mutex recursively) (refer to "mrs_eas_is_supported_dl_earfcn")
+kal_uint8 mrs_eas_get_eea_support(MRS_SIM_INDEX sim_index);
+
+
+// need mutex protection, create new "mrs_eas_internal_yyy..." for internal use (to avoid taking mutex recursively) (refer to "mrs_eas_is_supported_dl_earfcn")
+kal_uint8 mrs_eas_get_eia_support(MRS_SIM_INDEX sim_index);
+
+
+kal_uint8 mrs_eas_get_powerclass(MRS_SIM_INDEX sim_index, kal_uint16 lte_band);
+
+#if (CUR_GEN >= MD_GEN95)
+kal_uint8 mrs_eas_get_ca_comb_powerclass(MRS_SIM_INDEX sim_index, mrs_eas_ca_band_comb_struct *ca_band_comb);
+
+kal_uint8 mrs_eas_get_ca_comb_powerclass_by_carrier_info(MRS_SIM_INDEX sim_index, mrs_eas_ca_band_comb_struct *ca_band_comb);
+#endif /* #if (CUR_GEN >= MD_GEN95) */
+
+// need mutex protection, create new "mrs_eas_internal_yyy..." for internal use (to avoid taking mutex recursively) (refer to "mrs_eas_is_supported_dl_earfcn")
+kal_uint8 mrs_eas_get_femtocell_system_selection(MRS_SIM_INDEX sim_index);
+
+
+// need mutex protection, create new "mrs_eas_internal_yyy..." for internal use (to avoid taking mutex recursively) (refer to "mrs_eas_is_supported_dl_earfcn")
+void mrs_eas_set_femtocell_system_selection(MRS_SIM_INDEX sim_index, kal_uint8 fss);
+
+
+// only use in mrs init phase only, no need mutex protection
+void mrs_eas_read_nvram_cnf_handler(kal_uint16 nvram_file_id, kal_uint8 *data, kal_uint16 len);
+
+
+#ifdef UNIT_TEST
+void mrs_eas_set_ue_eutra_capability(MRS_SIM_INDEX sim_index, kal_uint8 *p_ue_eutra_cap, kal_uint32 cap_length);
+
+void mrs_eas_set_eea_support(MRS_SIM_INDEX sim_index, kal_uint8 eea_support);
+
+void mrs_eas_set_eia_support(MRS_SIM_INDEX sim_index, kal_uint8 eia_support);
+#endif /* UNIT_TEST */
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+#endif /* #if 0 */
+
+// no need mutex protection, use freely
+kal_uint32 mrs_eas_get_ue_eutra_capability_by_plmn(MRS_SIM_INDEX sim_index, kal_uint8 **pp_ue_eutra_capa, mrs_plmn_id_list *p_plmn_id_list, kal_bool is_disable_gsm);
+
+#if (CUR_GEN >= MD_GEN97)
+kal_uint32 mrs_eas_get_ue_eutra_capability_for_nr(
+ MRS_SIM_INDEX sim_index,
+ mrs_plmn_id_list *p_plmn_id_list,
+ kal_bool is_disable_gsm,
+ mrs_nras_octet_string_struct cap_request_filter,
+ kal_uint8 **pp_ue_eutra_capa,
+ mrs_gemini_status_enum gemini_status,
+ kal_bool is_restriction_size_valid,
+ kal_uint32 restriction_size);
+void mrs_eas_is_mrdc_lte_standalone_band_combination_support(
+ MRS_SIM_INDEX sim_index,
+ mrs_plmn_id_list *p_plmn_id_list,
+ mrs_eas_mrdc_lte_standalone_bc_list *p_band_comb_list);
+
+#endif /* (CUR_GEN >= MD_GEN97) */
+
+// no need mutex protection, use freely
+eas_cell_mode_enum mrs_eas_jdg_cell_mode_by_band(kal_uint16 lte_band);
+
+
+// no need mutex protection, use freely
+eas_cell_mode_enum mrs_eas_jdg_cell_mode_by_earfcn(EARFCN earfcn);
+
+
+// need mutex protection, call "mrs_eas_internal_xxx..." for internal use (to avoid taking mutex recursively)
+kal_bool mrs_eas_is_supported_dl_earfcn_with_bw_check(MRS_SIM_INDEX sim_index,
+ EARFCN dl_earfcn,
+ eas_bandwidth_enum band_width,
+ kal_bool allow_disabled_bands);
+
+// no need mutex protection, use freely, but you need check input dl_earfcn is supported band by yourself
+kal_bool mrs_eas_dl_full_partial_band_check(kal_uint16 band,
+ EARFCN dl_earfcn,
+ eas_bandwidth_enum band_width,
+ EARFCN start_earfcn,
+ EARFCN end_earfcn,
+ kal_bool skip_full_band_check);
+
+// need mutex protection, call "mrs_eas_internal_xxx..." for internal use (to avoid taking mutex recursively)
+kal_bool mrs_eas_is_supported_ul_earfcn_with_bw_check(MRS_SIM_INDEX sim_index,
+ EARFCN ul_earfcn,
+ eas_bandwidth_enum band_width);
+
+
+// need mutex protection, call "mrs_eas_internal_xxx..." for internal use (to avoid taking mutex recursively)
+kal_bool mrs_eas_is_supported_dl_bandwidth(MRS_SIM_INDEX sim_index,
+ kal_uint16 lte_band,
+ eas_bandwidth_enum band_width);
+
+
+// need mutex protection, create new "mrs_eas_internal_yyy..." for internal use (to avoid taking mutex recursively) (refer to "mrs_eas_is_supported_dl_earfcn")
+kal_bool mrs_eas_band_setting_update(MRS_SIM_INDEX sim_index, kal_uint8 *lte_band_bmp, kal_bool with_duplex_mode);
+
+
+// no need mutex protection, use freely
+void mrs_eas_max_band_cap_for_user_extended( mrs_lte_band_list_struct *lte_band );
+
+//#ifdef __SGLTE__
+// need mutex protection, call "mrs_eas_internal_xxx..." for internal use (to avoid taking mutex recursively)
+kal_bool mrs_eas_is_supported_band_in_nvram_stored(MRS_SIM_INDEX sim_index,
+ kal_uint16 lte_band);
+
+
+// need mutex protection, create new "mrs_eas_internal_yyy..." for internal use (to avoid taking mutex recursively) (refer to "mrs_eas_is_supported_dl_earfcn")
+kal_bool mrs_eas_is_supported_earfcn_in_nvram_stored(MRS_SIM_INDEX sim_index,
+ EARFCN dl_earfcn);
+//#endif /* __SGLTE__ */
+
+
+/* Workaround for MT6291 FGPA Digital IQ */
+#if defined(__RF_BYPASS__)
+void mrs_eas_set_lock_multi_freq_capa(eas_lock_multi_freq_capa_struct *lock_multi_freq_capa);
+#endif /* #if defined(__RF_BYPASS__) */
+
+
+// no need mutex protection, use freely
+kal_bool mrs_eas_is_supported_c2k_band(kal_uint8 band);
+
+
+// need mutex protection, create new "mrs_eas_internal_yyy..." for internal use (to avoid taking mutex recursively) (refer to "mrs_eas_is_supported_dl_earfcn")
+void mrs_eas_band_control_func(kal_uint16 lte_band, eas_band_control_enum band_ctrl_info, MRS_SIM_INDEX sim_index);
+
+
+// no need mutex protection, use freely
+kal_bool mrs_eas_is_mcc_match_country(eas_country_enum country, kal_uint8 mcc1, kal_uint8 mcc2, kal_uint8 mcc3);
+
+
+// need mutex protection, create new "mrs_eas_internal_yyy..." for internal use (to avoid taking mutex recursively) (refer to "mrs_eas_is_supported_dl_earfcn")
+void mrs_eas_add_remove_band(kal_uint16 lte_band, eas_band_control_enum band_ctrl_info, MRS_SIM_INDEX sim_index);
+
+void mrs_eas_get_rf_supported_band_mask(MRS_SIM_INDEX sim_index, kal_uint8 *p_lte_support_band);
+
+
+// need mutex protection, call "mrs_eas_internal_xxx..." for internal use (to avoid taking mutex recursively)
+void mrs_eas_get_context_nvram_lte_band(kal_uint8 *p_lte_band_mask, MRS_SIM_INDEX sim_index);
+
+
+// need mutex protection, call "mrs_eas_internal_xxx..." for internal use (to avoid taking mutex recursively)
+void mrs_eas_set_context_nvram_lte_band(kal_uint8 *p_lte_band_mask, MRS_SIM_INDEX sim_index);
+
+
+// need mutex protection, call "mrs_eas_internal_xxx..." for internal use (to avoid taking mutex recursively)
+void mrs_eas_get_em_lte_support_band(MRS_SIM_INDEX sim_index, kal_uint8 *p_lte_support_band);
+
+
+// need mutex protection, create new "mrs_eas_internal_yyy..." for internal use (to avoid taking mutex recursively) (refer to "mrs_eas_is_supported_dl_earfcn")
+kal_uint8 mrs_eas_WMID_lte_band_check(MRS_SIM_INDEX sim_index);
+
+void mrs_eas_add_black_cell_list_notification(void);
+
+void mrs_eas_clear_black_cell_list_notification(MRS_SIM_INDEX sim_index);
+
+EARFCN mrs_eas_get_dl_earfcn_freq(kal_uint16 lte_band, eas_band_earfcn_freq_info_enum idx);
+
+EARFCN mrs_eas_get_ul_earfcn_freq(kal_uint16 lte_band, eas_band_earfcn_freq_info_enum idx);
+
+/* LTE band conversion function */
+kal_uint16 mrs_eas_cvrt_lte_band_to_uint(LTE_Band lte_band);
+
+void mrs_eas_clear_support_band_bit_by_cell_mode(kal_uint8 *supportBandBitmask,
+ const eas_cell_mode_enum cellMode);
+
+extern void mrs_eas_retrieveLteBandBitmask_by_plmn(MRS_SIM_INDEX sim_index,
+ void *pLBandBitmask,
+ mrs_plmn_id_list *p_plmn_id_list);
+
+extern kal_bool mrs_eas_band_setting_update_by_hplmn_and_cplmn(function_caller_id_enum caller_id,
+ MRS_SIM_INDEX sim_index,
+ mrs_plmn_id* hplmn,
+ mrs_plmn_id_list* cplmn);
+
+mrs_sim_partial_band_cfg_state_enum mrs_eas_get_sim_partial_band_state(MRS_SIM_INDEX sim_index);
+
+mrs_sim_band_cfg_state_enum mrs_eas_get_sim_band_state(MRS_SIM_INDEX sim_index);
+
+mrs_plmn_band_cfg_state_enum mrs_eas_get_plmn_band_state(MRS_SIM_INDEX sim_index);
+
+mrs_custom_disable_band_by_plmn_state_enum mrs_eas_get_custom_disable_band_by_plmn_state(MRS_SIM_INDEX sim_index);
+
+mrs_plmn_region_band_cfg_state_enum mrs_eas_get_plmn_region_band_state(MRS_SIM_INDEX sim_index);
+
+function_caller_id_enum mrs_eas_get_sim_band_last_caller_id(MRS_SIM_INDEX sim_index);
+
+void mrs_eas_update_partial_band_support_info(mrs_plmn_id_list plmn_id_list,MRS_SIM_INDEX sim_index);
+
+void mrs_eas_reset_partial_band_support_info(MRS_SIM_INDEX sim_index);
+
+kal_bool mrs_eas_get_rf_sw_unsupported_range(MRS_SIM_INDEX sim_index, kal_uint16 lte_band, EARFCN *l1, EARFCN *r1, EARFCN *l2, EARFCN *r2, EARFCN *l3, EARFCN *r3);
+
+kal_bool mrs_eas_judge_country_plmn(eas_country_enum eas_country,const mrs_plmn_id_list* target_plmn);
+
+kal_bool mrs_eas_get_lte_support_band_from_ca_sel_table(
+ const MRS_SIM_INDEX sim_index,
+ const mrs_plmn_id *p_plmn_id,
+ kal_uint8 *p_lte_band_bitmask);
+
+kal_bool mrs_eas_check_special_plmn_excluded(
+ const MRS_SIM_INDEX sim_index,
+ const mrs_plmn_id_list *p_plmn_id_list);
+
+void mrs_eas_set_as_release(kal_uint8 as_rel, MRS_SIM_INDEX sim_index);
+
+mrs_as_release_enum mrs_eas_get_as_release(MRS_SIM_INDEX sim_index);
+
+void mrs_eas_clear_srch_info(void);
+
+void mrs_eas_print_srch_info(void);
+
+void mrs_eas_srch_info_band_level_add(const mrs_eas_srch_info_band_struct *b);
+
+mrs_eas_srch_info_band_status_enum mrs_eas_srch_info_band_level_query(
+ const kal_uint16 band,
+ mrs_eas_srch_info_band_struct *b);
+
+void mrs_eas_srch_info_freq_level_add(const mrs_eas_srch_info_freq_struct *f);
+
+mrs_eas_srch_info_freq_status_enum mrs_eas_srch_info_freq_level_query(
+ const EARFCN earfcn,
+ mrs_eas_srch_info_freq_struct *f);
+
+void mrs_eas_srch_info_cell_level_add_from_mib(
+ const EARFCN earfcn,
+ const kal_uint16 pci,
+ const kal_uint8 dl_bw);
+
+void mrs_eas_srch_info_cell_level_add_from_sib1(
+ const EARFCN earfcn,
+ const kal_uint16 pci,
+ const mrs_plmn_id_list *plmn_list,
+ const kal_uint16 tac);
+
+kal_bool mrs_eas_srch_info_cell_level_query(
+ const EARFCN earfcn,
+ const kal_uint16 pci,
+ mrs_eas_srch_info_cell_struct *c);
+
+kal_bool mrs_eas_srch_info_cell_level_is_plmn_identical_on_freq(
+ const EARFCN earfcn,
+ const plmn_id_struct plmn_id);
+
+void mrs_eas_mrs_plmn_id_to_plmn_id(const mrs_plmn_id *src, plmn_id_struct *dst);
+
+void mrs_eas_set_ue_category(mrs_eas_ue_category_struct* p_lte_ue_category, MRS_SIM_INDEX sim_index);
+
+kal_bool mrs_eas_get_ue_category(mrs_eas_ue_category_struct* p_lte_ue_category, MRS_SIM_INDEX sim_index);
+
+kal_bool mrs_eas_get_afr_by_custom_hplmn_and_splmn(MRS_SIM_INDEX sim_index, kal_bool *p_2g4_afr_status, kal_bool *p_3g4_afr_status);
+
+#ifdef __NR_RAT__
+kal_int8 mrs_eas_calculate_p_compensation(
+ MRS_SIM_INDEX sim_idx,
+ EARFCN target_earfcn,
+ kal_int8 pmax,
+ eutra_multibandinfo_list_struct *p_multi_band_list,
+ const plmn_id_struct *p_plmn_id);
+#endif /* __NR_RAT__ */
+
+kal_bool mrs_eas_check_eutra_capability_supported(eas_cap_feature_enum feature);
+
+#endif /* _MRS_EAS_CAPABILITY_H */
+
diff --git a/mcu/protocol/interface/general/mrs_eas_search.h b/mcu/protocol/interface/general/mrs_eas_search.h
new file mode 100644
index 0000000..32a2992
--- /dev/null
+++ b/mcu/protocol/interface/general/mrs_eas_search.h
@@ -0,0 +1,81 @@
+#ifndef _MRS_EAS_SEARCH_H
+#define _MRS_EAS_SEARCH_H
+
+#include "mrs_common_capability.h"
+#include "mrs_common_search.h"
+#include "mrs_as_struct.h"
+#include "mcc_recog_train_data.h"
+#ifdef UNIT_TEST
+#include "mcc_recog_test_data.h"
+#endif /* UNIT_TEST */
+
+#define MRS_EAS_MCC_RECOG_MAX_SUBBAND_NUM 64 //Should be same as MAX_RSSI_SNIFFER_BAND_COMPLETE_SUBBAND
+
+typedef enum {
+ MRS_GET_PREDICT_EARFCN_TABLE,
+ MRS_EAS_GET_PREDICT_FREQ_LIST_BY_PLMN_1,
+ MRS_EAS_GET_PREDICT_FREQ_LIST_BY_PLMN_2,
+ MRS_EAS_GET_PREDICT_FREQ_LIST_BY_PLMN_3,
+ MRS_EAS_GET_PREDICT_FREQ_LIST_BY_PLMN_4,
+ MRS_EAS_GET_PREDICT_FREQ_LIST_BY_PLMN_5,
+ MRS_EAS_GET_PREDICT_FREQ_LIST_BY_BAND_1,
+}mrs_predict_utility_ut_enum;
+
+typedef struct eas_mcc_recog_mcc_list {
+ kal_uint8 mcc_num;
+ mrs_mcc_id mcc[MCC_RECOG_LTE_MAX_MCC_LEN];
+} mrs_eas_mcc_recog_mcc_list_struct;
+
+typedef struct
+{
+ EARFCN freq; // The central frequency of each subband.
+ kal_int16 rssi; // The rssi result (qdBm) or each subband.
+} mrs_eas_subband_rssi_struct;
+
+typedef struct
+{
+ kal_uint16 band;
+ kal_uint8 subband_num; // The number of subbands to report.
+ mrs_eas_subband_rssi_struct subband_rssi[MRS_EAS_MCC_RECOG_MAX_SUBBAND_NUM];
+} mrs_eas_band_rssi_distribution_struct;
+
+typedef struct
+{
+ kal_uint16 band_num;
+ mrs_eas_band_rssi_distribution_struct band[MCC_RECOG_LTE_BAND_NUM];
+} mrs_eas_rssi_distribution_struct;
+
+kal_uint16 mrs_eas_get_predict_freq_list_by_plmn(
+ MRS_SIM_INDEX sim_index,
+ const mrs_plmn_id_list *plmn_list,
+ const EARFCN *skip_freq_list,
+ const kal_uint16 skip_freq_list_num,
+ EARFCN *predict_freq_list);
+
+void mrs_get_predict_earfcn_table_by_band(kal_uint32 lte_band, mrs_freq_table_struct *earfcn_table);
+void mrs_get_top10_earfcn(mrs_freq_table_struct *earfcn_table);
+void mrs_append_top10_earfcn_table(mrs_freq_table_struct *skip_freq_table, mrs_freq_table_struct *output_table);
+kal_uint16 mrs_eas_get_predict_freq_list_by_band(
+ MRS_SIM_INDEX sim_index,
+ const kal_uint32 band_list_num,
+ const kal_uint16 *band_list,
+ const EARFCN *skip_freq_list,
+ const kal_uint16 skip_freq_list_num,
+ EARFCN *predict_freq_list // kal_uint32 array[64]
+);
+
+void mrs_eas_mrs_plmn_id_to_plmn_id(const mrs_plmn_id *src, plmn_id_struct *dst);
+void mrs_eas_plmn_id_to_mrs_plmn_id(const plmn_id_struct *src, mrs_plmn_id *dst);
+
+double mrs_eas_mcc_recog_centered_cosine_distance(const kal_int8 *data1, const kal_int8 *data2, kal_uint32 data_len);
+kal_bool mrs_eas_mcc_recog_is_remarkable_band(kal_uint16 band);
+mrs_eas_mcc_recog_mcc_list_struct mrs_eas_mcc_recog_get_mcc(mrs_eas_rssi_distribution_struct *rssi_distribution);
+void mcc_ai_init_wrapper();
+int mcc_ai_inference_wrapper
+ (kal_int8 *input_buf, int input_length,
+ maif_mcc_enum *prediction_mcc_code, float *softmax_probability);
+#ifdef UNIT_TEST
+void mrs_eas_mcc_recog_regression();
+void mrs_eas_mcc_recog_test(kal_int8 *test_data, kal_uint32 data_len);
+#endif /* UNIT_TEST */
+#endif
\ No newline at end of file
diff --git a/mcu/protocol/interface/general/mrs_emm_capability.h b/mcu/protocol/interface/general/mrs_emm_capability.h
new file mode 100644
index 0000000..6323c10
--- /dev/null
+++ b/mcu/protocol/interface/general/mrs_emm_capability.h
@@ -0,0 +1,224 @@
+/******************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*******************************************************************************/
+
+/******************************************************************************
+ * Filename:
+ * --------------------------------------------------------
+ * mrs_emm_capability.h
+ *
+ * Project:
+ * --------------------------------------------------------
+ * Multimode
+ *
+ * Description:
+ * --------------------------------------------------------
+ * The EMM capability stored in MRS context.
+ *
+ * Author:
+ * --------------------------------------------------------
+ * -------
+ *
+ * --------------------------------------------------------
+ * $Log$
+ *
+ * 03 22 2022 ot_samiksha.d
+ * [MOLY00785023] [Gen97] NAS_SV disable GSM through capability update
+ *
+ * - EMM part.
+ *
+ * 05 28 2020 youru.chen
+ * [MOLY00505511] [P200306-03896][A315N][MTK] UE has to set as off IEs for SRVCC with korean operator.
+ *
+ * [MPD][R3.MP][out-of-Vlist]
+ * code sync
+ * 1. MOLY00505511:CL10859074, 10907564 (need to handle specific in TC10.SP branch)
+ *
+ * 09 20 2018 chinte.chen
+ * [MOLY00352532] [EMM][5GS_Ph1] R15 new feature
+ * Set S1 mode & N1 mode & ePCO in ue network capability.
+ *
+ * 08 30 2018 tim.huang
+ * [MOLY00306148] [NAS] pangu giant CR
+ * fix UT for mrs_nras_is_endc_support.
+ *
+ * 08 17 2018 jerry-yh.chang
+ * [MOLY00306148] [NAS] pangu giant CR
+ * [EMM][ Code Sync][GEN97.DEV][OA Domain] Remove NVRAM group header file
+ * CL: 6096555, 6124250
+ *
+ * 08 17 2018 chinte.chen
+ * [MOLY00306148] [NAS] pangu giant CR
+ * patch back 6136963.
+ *
+ * 04 25 2018 zanya.peng
+ * [MOLY00321650] [UMOLYE][MT6765][Cervino][O1][MD Static Test][China][Auto]The UMTS security capability is not correctly set in UE Network Capability from the URRC Dynamic CAP.
+ *
+ * .
+ *
+ * 08 17 2017 zanya.peng
+ * [MOLY00270723] [BIANCO][MT6763][RDIT][L+L][BringUp]mtklogsim2-volte-fail?]Call ?^??2G?^
+ *
+ * .
+ *
+ * 01 28 2016 bob.chiang
+ * [MOLY00159957] AT+CISRVCC implementation
+ * : [MRS][EMM]
+ *
+ * 08 11 2014 tuan-che.chen
+ * [MOLY00075019] [Critical][NS-IOT][CMCC Case][K2 DSDS][CSFB][NS-IOT][anite9000][25.0][band38][5.1.1]fail:PDN decode error
+ * consider RAT mode for EMM MRS
+ *
+ * 01 22 2013 david.niu
+ * [MOLY00009205] [MRS] Code checked-in for MOLY branch
+ * .
+ *
+ *****************************************************************************/
+
+#ifndef _MRS_EMM_CAPABILITY_H
+#define _MRS_EMM_CAPABILITY_H
+
+#include "mrs_as_enums.h"
+#include "errc_nvram_def.h"
+
+/*****************************************************************************
+ * Macros Without Parameters
+ *****************************************************************************/
+
+
+/*****************************************************************************
+ * Macros With Parameters
+ *****************************************************************************/
+
+
+/*****************************************************************************
+ * Enums without tags
+ *****************************************************************************/
+#define UE_NETWORK_CAPABILITY_LEN 7
+#define UE_SECURITY_CAPABILITY_LEN 5
+
+#define UE_ADD_SECURITY_CAPABILITY_LEN 4
+
+/*****************************************************************************
+ * Type Definitions
+ *****************************************************************************/
+typedef struct {
+
+ kal_uint8 ue_network_capability[UE_NETWORK_CAPABILITY_LEN];
+ kal_uint8 ue_security_capability[UE_SECURITY_CAPABILITY_LEN];
+ kal_bool nf;
+ kal_bool srvcc;
+#ifdef __GEMINI_LTE__
+ kal_bool is_lte_needed;
+ kal_uint64 sim_plmn;
+#endif /* __GEMINI_LTE__ */
+ kal_bool s1_mode; /* disable & enable E-UTRAN capability by UE_CAPABILITY_CHANGE_PROCEDURE, clause 4.5 in TS 24.301 */
+} emm_capability_context_struct;
+
+/*****************************************************************************
+ * Declarations Of Exported Globals
+ *****************************************************************************/
+
+void mrs_emm_init_contx_default_value(void);
+
+void mrs_emm_read_nvram_cnf_handler(kal_uint16 nvram_file_id, kal_uint8* data, kal_uint16 len);
+
+void mrs_emm_get_ue_nw_cap(MRS_SIM_INDEX sim_index, rat_enum rat_mode, kal_uint8* data, kal_uint8* len);
+
+void mrs_emm_get_ue_nw_cap_without_rat_mode_modification(MRS_SIM_INDEX sim_index, rat_enum rat_mode, kal_uint8* data, kal_uint8* len);
+
+void mrs_emm_get_ue_sec_cap(MRS_SIM_INDEX sim_index, rat_enum rat_mode, kal_uint8* data, kal_uint8 *len);
+
+void mrs_emm_get_ue_add_sec_cap(MRS_SIM_INDEX sim_index, rat_enum rat_mode, kal_uint8* data, kal_uint8 *len);
+
+#if defined(__GSM_RAT__) || defined(__UMTS_RAT__)
+void usime_cap_set_emm_capability(MRS_SIM_INDEX sim_index,emm_capability_context_struct *emm_cap);
+
+void classmark_racap_set_emm_capability(MRS_SIM_INDEX sim_index,emm_capability_context_struct *emm_cap);
+#endif
+
+void lte_cap_set_emm_capability(kal_uint8 *data, emm_capability_context_struct *emm_cap);
+
+/* Used by MM */
+kal_bool mrs_emm_get_srcvv(MRS_SIM_INDEX sim_index, rat_enum rat_mode);
+
+/*Titan requirement to set SRVCC FALSE for some operators*/
+kal_bool mrs_emm_get_srvcc_support_for_select_operators(MRS_SIM_INDEX sim_index);
+
+/* Used by L4C */
+kal_bool mrs_emm_set_srvcc(MRS_SIM_INDEX sim_index, kal_bool is_support);
+
+/* Used by MM */
+kal_bool mrs_emm_get_nf(MRS_SIM_INDEX sim_index);
+
+
+#ifdef __GEMINI_LTE__
+
+/* Used by EMM */
+
+void mrs_emm_set_sim_currplmn(MRS_SIM_INDEX sim_index, kal_uint64 plmnId);
+
+void mrs_emm_set_lte_needed(MRS_SIM_INDEX sim_index, kal_bool is_lte_needed);
+
+/* Used by GAS */
+
+kal_bool mrs_emm_is_sim_currplmn_cmcc(MRS_SIM_INDEX sim_index);
+
+kal_bool mrs_emm_is_lte_needed(MRS_SIM_INDEX sim_index);
+
+#endif /* __GEMINI_LTE__ */
+
+/**
+ * @brief A function that sets epc nas(S1 mode) supported
+ * @param[in] sim_index indicates the protocol which is selected
+ * @param[in] s1_mode is used for setting the configuration.
+ * @return KAL_TRUE if s1_mode set sucessfully.
+ *
+ * the s1 mode is used for 5GMM capability IE and defined in TS 24.501
+ */
+kal_bool mrs_emm_set_cap_epc_nas_support(MRS_SIM_INDEX sim_index, kal_bool s1_mode);
+
+/**
+ * @brief A function that gets epc nas(S1 mode) supported
+ * @param[in] sim_index indicates the protocol which is selected
+ * @param[in] rat_mode is used for checking if we could get the s1_mode configuration.
+ * @return KAL_TRUE if epc nas(s1_mode) is supported.
+ *
+ * the s1 mode is used for 5GMM capability IE and defined in TS 24.501
+ */
+kal_bool mrs_emm_get_cap_epc_nas_support(MRS_SIM_INDEX sim_index, rat_enum rat_mode);
+
+
+#endif /* _MRS_EMM_CAPABILITY_H */
+
diff --git a/mcu/protocol/interface/general/mrs_endc_query_utility.h b/mcu/protocol/interface/general/mrs_endc_query_utility.h
new file mode 100644
index 0000000..52019f1
--- /dev/null
+++ b/mcu/protocol/interface/general/mrs_endc_query_utility.h
@@ -0,0 +1,157 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2019
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+#ifndef MRS_ENDC_QUERY_UTILITY_H
+#define MRS_ENDC_QUERY_UTILITY_H
+
+#include "kal_general_types.h"
+#include "l3_inc_enums_public.h"
+#include "sim_exported_enum.h"
+
+#if defined(__ENDC__) || defined(__NR_RAT__)
+#include "mml1_endc_public_rrc.h"
+#include "nrrc_nl1_struct.h"
+#endif /* defined(__ENDC__) || defined(__NR_RAT__) */
+
+#ifdef __NR_RAT__
+#include "mrs_nvram_editor.h"
+#endif /* __NR_RAT__ */
+
+/********************************************
+ * MACROS *
+ ********************************************/
+
+
+/********************************************
+ * TYPE DEFINITIONS & ENUMS *
+ ********************************************/
+#ifdef __ENDC__
+typedef struct
+{
+ LTE_BAND_E band;
+ kal_uint32 freq; // in 100kHz
+ LTE_BW_E bw;
+ kal_uint8 mimo_layer; // 0xFF if no valid info
+} mrs_lte_cc_info_struct;
+
+typedef struct
+{
+ kal_uint8 cc_num;
+ kal_uint8 cc_mask; // cc bitmap. Ex: cc0 & cc1 ==> cc_mask=3
+ mrs_lte_cc_info_struct cc_info[MRS_MAX_CC_NUM];
+ kal_uint8 rx_cc_idx[MRS_MAX_CC_NUM]; // Only necessary for tx_cc_list. For rx_cc_list, don't care.
+} mrs_lte_cc_list_struct;
+
+
+typedef struct
+{
+ mrs_lte_cc_list_struct rx_cc_list;
+ mrs_lte_cc_list_struct tx_cc_list;
+} mrs_lte_cell_cc_config_struct;
+#endif /* __ENDC__ */
+
+#if defined(__ENDC__) || defined(__NR_RAT__)
+typedef struct
+{
+ MML1_ENDC_NRRC_CC_LIST_T rx_cc_list;
+ MML1_ENDC_NRRC_CC_LIST_T tx_cc_list;
+ nl1_carrier_bw_info_list_struct *p_carrier_bw_info_list;
+} mrs_nr_cell_cc_config_struct;
+#endif /* defined(__ENDC__) || defined(__NR_RAT__) */
+
+/********************************************
+ * VARIABLES *
+ ********************************************/
+
+
+/********************************************
+ * FUNCTION DECLARATIONS *
+ ********************************************/
+#ifdef __ENDC__
+kal_bool mrs_query_nr_support_status(protocol_id_enum ps_id);
+
+kal_bool mrs_query_endc_support_status(protocol_id_enum ps_id);
+
+kal_bool mrs_query_gapless_support_status(protocol_id_enum ps_id);
+
+MML1_ENDC_NRRC_CC_LIST_T* mrs_get_nr_rfdb_rx_cc_config_list(protocol_id_enum ps_id);
+
+MML1_ENDC_NRRC_CC_LIST_T* mrs_get_nr_rfdb_tx_cc_config_list(protocol_id_enum ps_id);
+
+void mrs_reset_nr_rfdb_tx_rx_config(protocol_id_enum ps_id);
+
+MML1_ENDC_NRRC_CC_LIST_T* mrs_get_ie_check_nr_rfdb_rx_cc_config_list(protocol_id_enum ps_id);
+
+MML1_ENDC_NRRC_CC_LIST_T* mrs_get_ie_check_nr_rfdb_tx_cc_config_list(protocol_id_enum ps_id);
+
+void mrs_reset_ie_check_nr_rfdb_tx_rx_config(protocol_id_enum ps_id);
+
+MML1_ENDC_NRRC_CC_LIST_T* mrs_get_test_nr_rfdb_rx_cc_config_list(protocol_id_enum ps_id);
+
+MML1_ENDC_NRRC_CC_LIST_T* mrs_get_test_nr_rfdb_tx_cc_config_list(protocol_id_enum ps_id);
+
+void mrs_set_lte_rfdb_cc_config_list(protocol_id_enum ps_id, mrs_lte_cell_cc_config_struct *p_mrs_lte_cell_cc_config);
+
+void mrs_set_ie_check_lte_rfdb_cc_config_list(protocol_id_enum ps_id, mrs_lte_cell_cc_config_struct *p_mrs_lte_cell_cc_config);
+
+void mrs_reset_ie_check_lte_nr_rfdb_tx_rx_pdcp_config(protocol_id_enum ps_id);
+
+void mrs_update_pdcp_nr_bearer(protocol_id_enum ps_id, kal_bool is_nrpdcp_exist, kal_bool for_ie_chk);
+
+void mrs_update_nr_security_key_used(protocol_id_enum ps_id, kal_bool is_nr_security_key_used, kal_bool for_ie_chk);
+#endif
+
+#if defined(__ENDC__) || defined(__NR_RAT__)
+void mrs_set_nr_rfdb_cc_config_list(protocol_id_enum ps_id, const mrs_nr_cell_cc_config_struct *p_nr_cc_config, kal_bool is_test_db);
+void mrs_reset_all_endc_check_db(void);
+#endif /* defined(__ENDC__) || defined(__NR_RAT__) */
+
+#ifdef __NR_RAT__
+kal_uint8 mrs_nr_target_carrier_scs_convert(NR_SCS_TYPE_E nr_carrier_scs);
+
+kal_uint32 mrs_nvram_nr_bw_bitmap_bw_get(kal_uint32 bitmap_bit_index,
+ kal_uint16 bw_bitmap, kal_bool nr_band_is_fr1);
+
+kal_bool mrs_nr_bw_recalculation_check(
+ const nl1_carrier_bw_info_list_struct *p_nr_cc_bw_info_list, MRS_SIM_INDEX sim_index);
+
+kal_bool mrs_nr_band_channel_bw_is_valid(
+ const nl1_carrier_bw_scs_info_struct *p_nr_carrier_bw_scs_info,
+ const nvram_ef_mrs_nr_bw_per_band_setting_struct *p_nvram_band_bw_setting);
+
+kal_uint32 mrs_nr_channel_bw_convert(kal_uint32 channel_bw);
+#endif /* __NR_RAT__ */
+
+#endif /* MRS_ENDC_QUERY_UTILITY_H */
diff --git a/mcu/protocol/interface/general/mrs_gas_capability.h b/mcu/protocol/interface/general/mrs_gas_capability.h
new file mode 100644
index 0000000..84a3772
--- /dev/null
+++ b/mcu/protocol/interface/general/mrs_gas_capability.h
@@ -0,0 +1,1024 @@
+/******************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*******************************************************************************/
+
+/******************************************************************************
+ * Filename:
+ * --------------------------------------------------------
+ * mrs_gas_capability.h
+ *
+ * Project:
+ * --------------------------------------------------------
+ * Multimode
+ *
+ * Description:
+ * --------------------------------------------------------
+ * The GAS capability stored in MRS context.
+ *
+ * Author:
+ * --------------------------------------------------------
+ * -------
+ *
+ * --------------------------------------------------------
+ * $Log$
+ *
+ * 03 25 2022 jiawei.he
+ * [MOLY00785023] [Gen97] NAS_SV disable GSM through capability update
+ *
+ * .
+ *
+ * 03 22 2022 ot_deeksha.thakre
+ * [MOLY00785023] [Gen97] NAS_SV disable GSM through capability update
+ *
+ * 09 13 2021 ot_deeksha.thakre
+ * [MOLY00682081] md1:(MCU_core0.vpe0.tc0(VPE0)) [Fatal error(buf)] err_code1:0x00000844 err_code2:0x28A1EC34 err_code3:0xCCCCCCCC MD Offender:ERRC
+ *
+ * 05 28 2021 vend_mtb_aritha026
+ * [MOLY00608949] ??band????
+ *
+ * [CODE SYNC][NR15.R3.MD700.MP][GAS FDD]
+ *
+ * 10 07 2020 jiawei.he
+ * [MOLY00565617] ¡¾CALL¡¿¡¾H+¡¿¹Ø±Õ»ò´ò¿ªGSM¶ÌÐÅÄÜÁ¦½Ó¿Ú
+ *
+ * .
+ *
+ * 10 07 2020 vend_mtb_aritha019
+ * [MOLY00565617] ?CALL??H+??????GSM??????
+ *
+ * 12 09 2019 tanmoy.chatterjee
+ * [MOLY00458503] [CODE SYNC][MH4P-POS] patch request about ALPS04309026
+ * .
+ *
+ * 12 05 2019 sapna.ks
+ * [MOLY00443892] [CODE SYNC] A5/4 algorithm related
+ * .
+ *
+ * 02 18 2019 nalin.chovatia
+ * [MOLY00384995] [VMOLY] GEMINI 3.0, AFR, Unify Frequency scan, BGSEARCH
+ * .gemini_afr_bg
+ *
+ * 12 06 2018 yenchih.yang
+ * [MOLY00371156] [VMOLY] NRRC-SEARCH check-in.
+ * Fill physical frequency range during Power Scan.
+ *
+ * 08 20 2018 tanmoy.chatterjee
+ * [MOLY00306148] [NAS] pangu giant CR
+ * [GAS_FDD]Capability changes.
+ *
+ * 08 20 2018 rujing.zhao
+ * [MOLY00347128] [Gen97][TDD GAS] feature development check in
+ * .capability update
+ *
+ * 07 02 2018 sapna.ks
+ * [MOLY00336530] [MT3967][Eiger][O1][MP1][Overnight][Shenzhen][4GMM][SWIFT] [Fatal error(buf)] err_code1:0x00000844 err_code2:0x23BEE7E0 err_code3:0xCCCCCCCC
+ * .
+ *
+ * 05 16 2018 sapna.ks
+ * [MOLY00325825] [MT6761][Merlot][O1][MD Static Test][China][Auto]MFBI flags of E-UTRA/UTRA in Mobile station classmark 3 shall be set to True as supported.
+ * .
+ *
+ * 05 10 2018 rujing.zhao
+ * [MOLY00324570] [SMO][UMOLYE][TDD GAS] legacy option cleanup refine
+ * .
+ *
+ * 04 18 2018 nalin.chovatia
+ * [MOLY00320928] [CODE SYNC] ?????ALPS03474129 ???????patch--????P40 android o??
+ * . black list in UMOLYE
+ *
+ * 04 05 2018 sapna.ks
+ * [MOLY00318108] [MT6765][Cervino][O1][MD Static Test][China][Auto]Bit flag of E-UTRA Wideband RSRQ measurements support should be RAT dependent.
+ * .
+ *
+ * 04 03 2018 sapna.ks
+ * [MOLY00315207] [CODE SYNC] [ES2]VAMOS I & II should be off
+ * .
+ *
+ * 03 13 2018 rujing.zhao
+ * [MOLY00312598] [DSBP] patch back "D-SBP enhancment for all modem" to UMOLYE and TC01.R3.DEV
+ * .
+ *
+ * 01 22 2018 sapna.ks
+ * [MOLY00302832] [CODE SYNC] AT command (+ESCELLINFO) to modem to query serving cell band and arfcn info, when needed.
+ * .
+ *
+ * 06 15 2017 nalin.chovatia
+ * [MOLY00253698] [CODE SYNC] GSM - Extended EARFCN support - NVRAM Changes
+ * .b66 gas
+ *
+ * 04 12 2017 sapna.ks
+ * [MOLY00240270] [6293][Gemini][T+W] Phase 1: Common Interface Changes Check in
+ * .
+ *
+ * 11 11 2016 nalin.chovatia
+ * [MOLY00193300] Porting of NW BAND Info from LR9 to LR11 TC01
+ * . NBR Band
+ *
+ * 11 09 2016 nalin.chovatia
+ * [MOLY00198865] [Titan] [PLMN] Wrong "revision level indicator " in ATTACH
+ * . UmolyA - Revision Level
+ *
+ * 10 14 2016 wenxing.yao
+ * [MOLY00153524] [6291] Vivo BlackList feature.
+ *
+ * 06 27 2016 chuangde.zhang
+ * [MOLY00186513] Sync code From UMOLY to UMOLYA
+ * .
+ *
+ * 04 19 2016 chuangde.zhang
+ * [MOLY00174834] TDD GAS UT init optimization
+ * .
+ *
+ * 09 18 2015 qingyu.lai
+ * [MOLY00140707] [GAS][PLMN search enhancement II] Search info reuse
+ * .
+ *
+ * 09 18 2015 ming.lee
+ * [MOLY00140707] [GAS][PLMN search enhancement II] Search info reuse
+ * .
+ *
+ * 06 01 2015 henry.lai
+ * [MOLY00092508] [MT6291][LTE-C2K] AS Inter RAT feature
+ * .
+ *
+ * 05 14 2015 ming.lee
+ * [MOLY00113725] [GAS] Dynamic SBP - L2 random fill bit
+ * dynamic SBP l2 random fill bit.
+ *
+ * 05 06 2015 titi.wu
+ * [MOLY00111201] [UMOLY][MRS] According to NVRAM setting, Some fields in Classmark 3 and MS radio capability should sync with setting
+ * .
+ *
+ * 05 05 2015 titi.wu
+ * [MOLY00111201] [UMOLY][MRS] According to NVRAM setting, Some fields in Classmark 3 and MS radio capability should sync with setting
+ * sync CM3 and RACAP.
+ *
+ * 03 24 2015 wenxing.yao
+ * [MOLY00100228] [FDD2TDD] according to TS 24.008 subclause 10.5.5.12a MS.
+ *
+ * 03 16 2015 tangte.lo
+ * [MOLY00079573] according to TS 24.008 subclause 10.5.5.12a MS -add inject instead of compile option
+ *
+ * 03 09 2015 ming.lee
+ * [MOLY00087470] [Universal Bin] FDD GAS developement
+ * .
+ *
+ * 01 15 2015 qingyu.lai
+ * [MOLY00087571] [Universal Bin] TDD GAS developement
+ * __AMRWB_LINK_SUPPORT__ change to __TDD_AMRWB_LINK_SUPPORT__
+ *
+ * 01 07 2015 qingyu.lai
+ * [MOLY00087571] [Universal Bin] TDD GAS developement
+ * fix build error ra_cap_support_rel
+ *
+ * 01 06 2015 ming.lee
+ * [MOLY00087470] [Universal Bin] FDD GAS developement
+ * .Fix build error
+ *
+ * 01 05 2015 ming.lee
+ * [MOLY00087470] [Universal Bin] FDD GAS developement
+ * mrs_gas_capability.h (power class def)
+ *
+ * 12 31 2014 ming.lee
+ * [MOLY00087470] [Universal Bin] FDD GAS developement
+ * Fix codegen err
+ *
+ * 12 16 2014 qingyu.lai
+ * [MOLY00087571] [Universal Bin] TDD GAS developement
+ * sync fix build error
+ *
+ * 12 15 2014 ming.lee
+ * [MOLY00087470] [Universal Bin] FDD GAS developement
+ * .
+ *
+ * 11 14 2014 tangte.lo
+ * [MOLY00080948] [GAS] MS capability report to R10R11
+ * [GAS] MS capability report to R10R11
+ *
+ * 10 15 2014 tangte.lo
+ * [MOLY00080948] [GAS] MS capability report to R10R11
+ *
+ * 12 11 2013 ming.lee
+ * [MOLY00049166] GAS MRS capability refine
+ * .
+ *
+ * 11 21 2013 ming.lee
+ * [MOLY00047326] [82LTEv1][Pre-SQC]UE can't MO/MT while registered on 2G only
+ * .
+ *
+ * 11 21 2013 ming.lee
+ * [MOLY00047326] [82LTEv1][Pre-SQC]UE can't MO/MT while registered on 2G only
+ * Back out changelist 321857
+ *
+ * 11 14 2013 james.chan
+ * [MOLY00040522] [GAS] RCS IR enhancement
+ * .
+ *
+ * 10 25 2013 katie.tseng
+ * [MOLY00043400] [MRS] add injection to turn off R8R9 capability in MS RA capability IE
+ * .
+ *
+ * 10 23 2013 james.chan
+ * [MOLY00040050] [MultiMode] Dynamic band selection
+ *
+ * 10 21 2013 james.chan
+ * [MOLY00040050] [MultiMode] Dynamic band selection
+ * .
+ *
+ * 10 18 2013 rujing.zhao
+ * [MOLY00041595] [MT6290E1][MMDS_DC] MMDC feature patch back to MOLY trunk
+ * .GAS part
+ *
+ * 09 26 2013 ming.lee
+ * [MOLY00039142] [MAUItoMOLY][RR] Switch L2 random fill bit and VAMOS capability via NVRAM settting
+ * .
+ *
+ * 05 09 2013 henry.lai
+ * [MOLY00009222] [GAS][Multi-Mode Development] Merge GAS multi-mode development to MOLY
+ * .
+ *
+ * 03 20 2013 henry.lai
+ * [MOLY00009222] [GAS][Multi-Mode Development] Merge GAS multi-mode development to MOLY
+ * .
+ *
+ * 03 18 2013 peng-an.chen
+ * [MOLY00007881] [2G-PS] Deliver R9 modification
+ * .
+ *
+ * 01 22 2013 david.niu
+ * [MOLY00009205] [MRS] Code checked-in for MOLY branch
+ * .
+ *
+ * 01 11 2013 henry.lai
+ * [Henry][Multi-Mode Development] GAS Development and R8 CR Sync
+ *
+ * 09 25 2012 justin.li
+ * NULL
+ * gas capability.
+ *
+ *****************************************************************************/
+
+#ifndef _MRS_GAS_CAPABILITY_H
+#define _MRS_GAS_CAPABILITY_H
+
+#include "mrs_as_inter_core_enum.h"
+#include "mrs_as_inter_core_struct.h"
+#include "kal_general_types.h"
+#include "kal_public_api.h"
+#include "bitstream.h"
+#include "l3_inc_enums.h"
+#include "mrs_as_enums.h"
+#include "gmss_public.h"
+#include "as2l4c_struct.h"
+#include "mrs_as_struct.h"
+
+/* Common definition for both FDD and TDD */
+#define ADD_CLASSMARK_INFO_IEI 0x20
+#define CLASSMARK_2_IEI 0x33
+
+typedef enum
+{
+ GSM_SMS_CAP_UNKNOWN = 0,
+ GSM_SMS_CAP_ON = 1,
+ GSM_SMS_CAP_OFF = 2
+}gsm_sms_cap_enum;
+
+
+/* Common function declaration ********************************************************/
+#ifdef __GSM_RAT__
+void mrs_gas_get_classmark3 (MRS_SIM_INDEX sim_index, bit_stream *bs_ptr);
+kal_uint8 mrs_gas_get_classmark3msg_len(MRS_SIM_INDEX sim_index);
+kal_bool mrs_gas_get_ucs2_support(MRS_SIM_INDEX sim_index);
+kal_uint8 mrs_gas_get_gsm_algo_support(MRS_SIM_INDEX sim_index);
+#ifdef __PS_SERVICE__
+kal_uint16 mrs_gas_get_radio_access_cap(MRS_SIM_INDEX sim_index, kal_uint8 support_band, kal_uint8 **ra_cap);
+#endif /* __PS_SERVICE__ */
+kal_bool mrs_gas_get_2g3_ps_ho_cap (MRS_SIM_INDEX sim_index, rat_enum rat_mode);
+kal_bool mrs_gas_get_2g4_ps_ho_cap (MRS_SIM_INDEX sim_index, rat_enum rat_mode);
+kal_bool mrs_gas_band_setting_update(MRS_SIM_INDEX sim_index, kal_uint8 * gsm_band_ptr);
+#endif /* __GSM_RAT__ */
+void mrs_gas_read_nvram_cnf_handler(kal_uint16 nvram_file_id, kal_uint8* data, kal_uint16 len);
+void mrs_gas_decode_ms_capability(MRS_SIM_INDEX sim_index, bit_stream *bit_stream_ptr, kal_bool is_dynmc_cfg);
+kal_uint8 *mrs_gas_get_classmark2 (MRS_SIM_INDEX sim_index, MRS_RAT_MODE_TYPE required_rat, kal_bool get_full_ie);
+void mrs_gas_get_powerclass(MRS_SIM_INDEX sim_index, mrs_gsm_power_class_struct *gsm_pow_class);
+
+extern kal_bool rr_mrs_is_arfcn_band_supported(MRS_SIM_INDEX sim_index, kal_uint16 arfcn);
+extern kal_uint16 rr_mrs_arfcn_PCS_band_tag(kal_uint16 arfcn, kal_uint8 sim_index);
+
+kal_bool mrs_gas_retrieve_arfcn_band(MRS_SIM_INDEX sim_index,kal_uint16 arfcn, kal_uint8 *band_ptr);
+extern kal_bool rr_mrs_get_band_for_arfcn(MRS_SIM_INDEX sim_index, kal_uint16 arfcn,kal_uint8 * gsm_band_ptr);
+
+extern void mrs_gas_add_black_cell_list_notification(MRS_SIM_INDEX sim_index);
+extern void mrs_gas_clear_black_cell_list_notification(MRS_SIM_INDEX sim_index);
+
+extern kal_bool mrs_gas_band_setting_update_by_plmn(MRS_SIM_INDEX sim_index, mrs_plmn_id cplmn);
+extern void mrs_gas_get_gsm_all_supported_band(MRS_SIM_INDEX sim_index, kal_uint8 *gsmbandmask);
+extern kal_bool mrs_gas_mcc_band_setting_update(MRS_SIM_INDEX sim_index, kal_uint8 * gsm_band_ptr);
+extern void mrs_gas_band_setting_update_for_OOS (MRS_SIM_INDEX sim_index, kal_uint8 * gsm_band_ptr);
+
+extern void mrs_gas_set_gsm_sms_capability(MRS_SIM_INDEX sim_index, kal_bool gsm_sms_cap);
+extern void mrs_gas_set_gsm_cap_update (MRS_SIM_INDEX sim_index, capability_switch_enum gsm_cap);
+extern capability_switch_enum mrs_gas_get_gsm_cap_update (MRS_SIM_INDEX sim_index);
+
+/************************************************* Begin of TDD's part *************************************************/
+
+#if defined(__UMTS_TDD128_MODE__) || defined(__TDD_MODEM__) || defined(__TDD_2G_OP01__)
+
+/************************************************* Begin of TDD's part *************************************************/
+
+
+/*****************************************************************************
+ * Macros Without Parameters
+ *****************************************************************************/
+
+
+/*****************************************************************************
+ * Macros With Parameters
+ *****************************************************************************/
+/* Define the needed file size kept in NVRAM */
+#define TDD_RR_NVRAM_CLK2_LEN 3
+/* Peter, 20080804: change the len of classmark3 */
+#define TDD_RR_NVRAM_CLK3_LEN 34
+#define TDD_RR_NVRAM_READ_CLK_LEN 12
+#define TDD_RR_FULL_CLK2_LEN 5
+
+#define TDD_P_GSM_MASK_IN_NVRAM 0x01
+#define TDD_E_GSM_MASK_IN_NVRAM 0x02
+#define TDD_DCS_1800_MASK_IN_NVRAM 0x04
+#define TDD_GSM_480_MASK_IN_NVRAM 0x01
+#define TDD_GSM_450_MASK_IN_NVRAM 0x02
+
+/*****************************************************************************
+ * Enums without tags
+ *****************************************************************************/
+
+
+/*****************************************************************************
+ * Type Definitions
+ *****************************************************************************/
+/* Stucture of supported channel modes */
+typedef struct
+{
+ kal_uint8 is_signalling_supp;
+ kal_uint8 is_speech_full_or_half_ver_1_supp;
+ kal_uint8 is_speech_full_or_half_ver_2_supp;
+ kal_uint8 is_speech_full_or_half_ver_3_supp;
+ /* ZY: add for AMR-WB */
+#ifdef __TDD_AMRWB_LINK_SUPPORT__
+ kal_uint8 is_speech_full_or_half_ver_4_supp;
+ kal_uint8 is_speech_full_or_half_ver_5_supp;
+#endif /* __TDD_AMRWB_LINK_SUPPORT__ */
+ kal_uint8 is_data_43_5_dl_or_14_5_ul_supp;
+ kal_uint8 is_data_29_0_dl_or_14_5_ul_supp;
+ kal_uint8 is_data_43_5_dl_or_29_0_ul_supp;
+ kal_uint8 is_data_14_5_dl_or_43_5_ul_supp;
+ kal_uint8 is_data_14_5_dl_or_29_0_ul_supp;
+ kal_uint8 is_data_29_0_dl_or_43_5_ul_supp;
+ kal_uint8 is_data_43_5_radio_intf_rate_supp;
+ kal_uint8 is_data_32_0_radio_intf_rate_supp;
+ kal_uint8 is_data_29_0_radio_intf_rate_supp;
+ kal_uint8 is_data_14_5_radio_intf_rate_supp;
+ kal_uint8 is_data_12_0_radio_intf_rate_supp;
+ kal_uint8 is_data_06_0_radio_intf_rate_supp;
+ kal_uint8 is_data_03_6_radio_intf_rate_supp;
+ kal_uint8 is_half_rate_supp;
+
+}
+tdd_channel_mode_supported_struct;
+
+typedef struct
+{
+ kal_uint8 access_tech[16];
+ kal_uint8 power_cap[16];
+ kal_uint8 hscsd_multi_slot_class;
+ kal_uint8 gprs_multi_slot_class;
+ kal_uint8 pseudo_sync_cap;
+ kal_uint8 vbs;
+ kal_uint8 vgcs;
+ kal_uint8 algo_supported;
+ kal_uint8 hscsd_multi_slot_class_present;
+ kal_uint8 gprs_multi_slot_class_present;
+ kal_uint8 revision_level_indicator;
+ kal_uint8 gprs_ext_dynamic_cap;
+ kal_uint8 gea_supported;
+ kal_uint8 sm_cap_gprs;
+ kal_uint8 pfc_mode;
+
+ kal_bool early_class_mark_support;
+ kal_uint8 mm_non_drx_timer_value;
+ tdd_channel_mode_supported_struct chl_mode_supported; /* struct of supported channel modes */
+
+ /* Evelyn 20080909 */
+ /* Lanslo 20050215: for selecting GPRS or EGPRS capability */
+#ifdef __EGPRS_MODE__
+ kal_uint8 egprs_multi_slot_class_present;
+ kal_uint8 egprs_multi_slot_class;
+ kal_uint8 egprs_ext_dynamic_cap;
+ //Jelly 20090602 Use __EPSK_TX__
+ /* Evelyn 20090422: set difference power class of 8PSK */
+#ifdef __EPSK_TX__
+ kal_uint8 power_cap_8psk[16];
+#endif /* __EPSK_TX__ */
+#endif /* __EGPRS_MODE__ */
+
+ /* Evelyn 20090905: Modify for High multislot class */
+#if defined (__MULTISLOT_CLASS_34__) || defined (__MULTISLOT_CLASS_45__)
+ kal_uint8 high_multi_slot_class_present;
+ kal_uint8 high_multi_slot_class;
+#endif
+ /* eo Lanslo */
+} tdd_ms_capability_from_mrs_struct;
+
+/* The structure is defined here, but the variables are stored in rr_cntx_info.
+ Because they are obtained from RATCM initialization procedure, not MRS .*/
+typedef struct {
+ kal_uint8 non_drx_timer;
+ kal_uint8 split_on_ccch;
+ kal_uint16 split_pg_cycle;
+} tdd_ms_capability_from_nas_struct;
+
+typedef struct {
+ access_technology_type_enum serving_band;
+ kal_uint8 band_indicator;
+ kal_uint16 arfcn;
+ kal_uint8 bsic;
+ kal_uint8 msc_r;
+ rr_mm_sgsnr_flag_enum sgsn_r;
+} tdd_gas_serving_cell_info_struct;
+
+typedef struct{
+ mrs_gsm_power_class_enum pow_class_band450;
+ mrs_gsm_power_class_enum pow_class_band480;
+ mrs_gsm_power_class_enum pow_class_band710;
+ mrs_gsm_power_class_enum pow_class_band750;
+ mrs_gsm_power_class_enum pow_class_band810;
+ mrs_gsm_power_class_enum pow_class_band850;
+ mrs_gsm_power_class_enum pow_class_band900P;
+ mrs_gsm_power_class_enum pow_class_band900E;
+ mrs_gsm_power_class_enum pow_class_band900R;
+ mrs_gsm_power_class_enum pow_class_band1800;
+ mrs_gsm_power_class_enum pow_class_band1900;
+}tdd_mrs_gsm_power_class_struct;
+
+
+typedef struct {
+
+ tdd_ms_capability_from_mrs_struct ms_capability;
+ kal_uint8 ms_classmark3_len; /* The bit length of Classmark3 */
+ kal_uint8 ms_classmark3_R98_len; /* The bit length of Classmark3 when MS supports Release 98 */
+ kal_uint8 ms_default_classmark2[TDD_RR_NVRAM_CLK2_LEN]; /* read from nvram and has been decoded as power on */
+ kal_uint8 ms_classmark2[TDD_RR_NVRAM_CLK2_LEN];
+ kal_uint8 ms_full_classmark2[TDD_RR_FULL_CLK2_LEN];
+ kal_uint8 ms_classmark3[TDD_RR_NVRAM_CLK3_LEN];
+ rat_enum rat_mode;
+ /* GSM supported band */
+ kal_uint8 gsm_supported_band;
+ kal_bool is_test_sim;
+ tdd_gas_serving_cell_info_struct serving_cell_info;
+
+#ifdef __LTE_RAT__
+ capability_switch_enum eutran_cap;
+#endif /* __LTE_RAT__ */
+
+#ifdef __UMTS_FDD_MODE__
+ /* record the bit location for UMTS FDD RAT Capibility; this bit
+ * is set to 1 only when the MS is in GSM+UMTS dual mode
+ */
+ kal_uint8 cm3_umts_fdd_bit_location;
+#endif /* __UMTS_FDD_MODE__ */
+
+#ifdef __UMTS_TDD128_MODE__
+ /* record the bit location for UMTS TDD RAT Capibility;
+ * this bit is set to 1 only when the MS is in GSM+UMTS dual mode
+ */
+ kal_uint8 cm3_umts_tdd_bit_location;
+#endif /* __UMTS_TDD128_MODE__ */
+
+ /* record the bit location for VAMOS level setting. */
+ kal_uint8 cm3_vamos_bit_location;
+ kal_uint8 inject_vamos;
+ kal_uint8 vamos_level_from_nvram;
+
+#ifdef __GERAN_R8__
+ /* record the bit location for R8 Capibility;
+ * this bit is set to 1 only when the MS is in GSM+LTE
+ * dual mode or GSM+UMTS+LTE triple mode
+ */
+ kal_uint8 cm3_r8_bit_location;
+#endif /* __GERAN_R8__ */
+
+#if defined(__GERAN_R9__)
+ /* record the bit length for R9 Capibility;
+ * used to change classmark3 len for force r9 feature
+ */
+ kal_uint8 ms_classmark3_R9_len;
+#endif /* defined(__GERAN_R9__) */
+
+#if defined(__EGPRS_MODE__)
+ kal_bool is_epsk_tx_enabled;
+#endif
+
+#ifdef __AGPS_CONTROL_PLANE__
+ kal_bool agps_supported_in_clk;
+#endif /* __AGPS_CONTROL_PLANE__ */
+
+#ifdef __PS_SERVICE__
+ kal_bool inject_ra_cap_normal_coding;
+ /* Katie 20130304: add inject to turn off R8R9 capability for CRTUG 44.2.10 */
+ /* TangTe 20140929 change inject_ra_cap_turn_R8R9_off into inject_ra_cap_support_rel,
+ default value:255, the value will represent the release version*/
+ kal_uint8 inject_ra_cap_support_rel;
+ /* Wenxing FDD2TDD 20150313 add for report 2G capability(Access technology tepe and RF power Capability) when 3G only*/
+ kal_bool inject_2g_cap_in_3gonly;
+#endif /* __PS_SERVICE__ */
+
+ /* store the nvram CLK in context to allow set gas band without reboot */
+ kal_uint8 *ms_classmark_in_nvram_ptr;
+ kal_uint8 ms_classmark_in_nvram_len;
+
+ /* This variable hold enable or disable of MT SMS capability set through AT cmd */
+ gsm_sms_cap_enum gsm_sms_capability;
+ capability_switch_enum gsm_cap;
+} tdd_gas_capability_context_struct;
+
+/*****************************************************************************
+ * Declarations Of Exported Globals
+ *****************************************************************************/
+#ifdef __GSM_RAT__
+void tdd_mrs_gas_init_contx_default_value(void);
+
+extern void tdd_mrs_gas_reset(void);
+
+extern void tdd_mrs_gas_get_ms_capability(MRS_SIM_INDEX sim_index, tdd_gas_capability_context_struct *gas_ms_cap_ptr);
+
+extern kal_uint8 *tdd_mrs_gas_get_classmark1 (MRS_SIM_INDEX sim_index, MRS_RAT_MODE_TYPE required_rat);
+
+extern void tdd_mrs_gas_get_classmark3 (MRS_SIM_INDEX sim_index, bit_stream *bs_ptr);
+
+extern kal_uint8 tdd_mrs_gas_get_classmark3msg_len(MRS_SIM_INDEX sim_index);
+
+extern kal_bool tdd_mrs_gas_get_ucs2_support(MRS_SIM_INDEX sim_index);
+
+extern void tdd_mrs_gas_set_sim_type(MRS_SIM_INDEX sim_index, kal_bool is_test_sim);
+
+extern kal_uint8 tdd_mrs_gas_get_gsm_algo_support(MRS_SIM_INDEX sim_index);
+
+#ifdef __PS_SERVICE__
+extern kal_uint8 tdd_mrs_gas_get_radio_access_cap (MRS_SIM_INDEX sim_index, kal_uint8 support_band, kal_uint8 **ra_cap);
+extern kal_uint8 tdd_mrs_mac_get_radio_access_cap(MRS_SIM_INDEX sim_index, kal_uint8 support_band, kal_uint8 **ra_cap, kal_bool *is_truncated, const kal_bool is_exclude_A5, const kal_uint8 bit_len_limit);
+#endif /* __PS_SERVICE__ */
+
+extern kal_bool tdd_mrs_gas_get_2g3_ps_ho_cap (MRS_SIM_INDEX sim_index, rat_enum rat_mode);
+
+extern kal_bool tdd_mrs_gas_get_2g4_ps_ho_cap (MRS_SIM_INDEX sim_index, rat_enum rat_mode);
+
+extern kal_bool tdd_mrs_gas_get_ir_srvcc_cap (MRS_SIM_INDEX sim_index, rat_enum rat_mode);
+
+extern void tdd_mrs_gas_update_serving_cell_info(MRS_SIM_INDEX sim_index, tdd_gas_serving_cell_info_struct serving_cell_info);
+
+extern void tdd_mrs_gas_update_current_rat_mode(MRS_SIM_INDEX sim_index, rat_enum rat_mode);
+
+extern kal_bool tdd_mrs_gas_validate_arfcn(MRS_SIM_INDEX sim_index, kal_uint16 arfcn, te_gsm_band_indicator band_indicator);
+
+extern kal_bool tdd_mrs_gas_band_setting_update(MRS_SIM_INDEX sim_index, kal_uint8 * gsm_band_ptr);
+
+#endif /* __GSM_RAT__ */
+
+#ifdef __LTE_RAT__
+
+extern void tdd_mrs_gas_update_disable_eutran_cap(MRS_SIM_INDEX sim_index, capability_switch_enum eutran_cap);
+
+#endif /* __LTE_RAT__ */
+
+void tdd_mrs_gas_read_nvram_cnf_handler(kal_uint16 nvram_file_id, kal_uint8* data, kal_uint16 len);
+
+extern void tdd_mrs_gas_decode_mscap_from_nvram(MRS_SIM_INDEX sim_index, kal_uint8 *bit_ptr);
+
+extern void tdd_mrs_gas_decode_ms_capability(MRS_SIM_INDEX sim_index, bit_stream *bit_stream_ptr, kal_bool is_dynmc_cfg);
+
+extern kal_bool tdd_mrs_gas_is_R99_supported_in_CS(MRS_SIM_INDEX sim_index);
+
+extern kal_bool tdd_mrs_gas_is_R99_supported_in_PS(MRS_SIM_INDEX sim_index);
+
+extern kal_uint8 *tdd_mrs_gas_get_classmark2 (MRS_SIM_INDEX sim_index, MRS_RAT_MODE_TYPE required_rat, kal_bool get_full_ie);
+
+extern void tdd_mrs_gas_get_powerclass(MRS_SIM_INDEX sim_index, tdd_mrs_gsm_power_class_struct *gsm_pow_class);
+
+extern void tdd_mrs_gas_add_black_cell_list_notification(void);
+
+extern void tdd_mrs_gas_clear_black_cell_list_notification(void);
+
+extern kal_bool tdd_mrs_gas_retrieve_arfcn_band(MRS_SIM_INDEX sim_index,kal_uint16 arfcn, kal_uint8 *band_ptr);
+#ifndef __MTK_TARGET__
+extern void mrs_init_tdd_gas_ut_capability(MRS_SIM_INDEX sim_index);
+#endif
+
+extern kal_uint8 tdd_mrs_gas_get_vamos_level_setting(MRS_SIM_INDEX sim_index);
+
+extern void tdd_mrs_set_gsm_sms_capability(MRS_SIM_INDEX sim_index, kal_bool gsm_sms_cap);
+extern void tdd_mrs_gas_set_gsm_cap_update(MRS_SIM_INDEX sim_index, capability_switch_enum gsm_cap);
+extern capability_switch_enum tdd_mrs_gas_get_gsm_cap_update(MRS_SIM_INDEX sim_index);
+extern kal_bool tdd_mrs_gas_gsm_enabled (MRS_SIM_INDEX sim_index, rat_enum rat_mode);
+
+
+/************************************************** End of TDD's part **************************************************/
+
+#endif /* defined(__UMTS_TDD128_MODE__) || defined(__TDD_MODEM__) */
+
+/************************************************* Begin of FDD's part *************************************************/
+
+/*****************************************************************************
+ * Macros Without Parameters
+ *****************************************************************************/
+/* Define the needed file size kept in NVRAM */
+#define FDD_RR_NVRAM_CLK2_LEN 3
+/* Peter, 20080804: change the len of classmark3 */
+#define FDD_RR_NVRAM_CLK3_LEN 34
+#define FDD_RR_NVRAM_READ_CLK_LEN 12
+#define FDD_RR_FULL_CLK2_LEN 5
+
+#define FDD_P_GSM_MASK_IN_NVRAM 0x01
+#define FDD_E_GSM_MASK_IN_NVRAM 0x02
+#define FDD_DCS_1800_MASK_IN_NVRAM 0x04
+#define FDD_GSM_480_MASK_IN_NVRAM 0x01
+#define FDD_GSM_450_MASK_IN_NVRAM 0x02
+
+#define DISABLE_A54_CIPHER_ALGO 0xF7
+
+/*
+ mrs_gas_band_setting_update_for_OOS() essentially does same thing as
+ mrs_gas_reset_band_settings(). mrs_gas_band_setting_update_for_OOS()function
+ is retained as this is ported from of MCC based band update feature
+*/
+#define mrs_gas_reset_band_settings mrs_gas_band_setting_update_for_OOS
+#define mrs_gas_update_gsm_band_setting mrs_gas_band_setting_update_for_OOS
+
+/*****************************************************************************
+ * Macros With Parameters
+ *****************************************************************************/
+
+
+/*****************************************************************************
+ * Enums without tags
+ *****************************************************************************/
+#ifdef __A5_3_AND_GEA_WHILTE_LIST__
+
+typedef enum
+{
+ DEFAULT_VALUE = 0,
+ PLMN_MATCHED = 1,
+ PLMN_NOT_MATCHED = 2
+}plmn_match_enum;
+
+#endif
+
+/*****************************************************************************
+ * Type Definitions
+ *****************************************************************************/
+/* Stucture of supported channel modes */
+typedef struct
+{
+ kal_uint8 is_signalling_supp;
+ kal_uint8 is_speech_full_or_half_ver_1_supp;
+ kal_uint8 is_speech_full_or_half_ver_2_supp;
+ kal_uint8 is_speech_full_or_half_ver_3_supp;
+ /* ZY: add for AMR-WB */
+#ifdef __AMRWB_LINK_SUPPORT__
+ kal_uint8 is_speech_full_or_half_ver_4_supp;
+ kal_uint8 is_speech_full_or_half_ver_5_supp;
+#endif /* __AMRWB_LINK_SUPPORT__ */
+ kal_uint8 is_data_43_5_dl_or_14_5_ul_supp;
+ kal_uint8 is_data_29_0_dl_or_14_5_ul_supp;
+ kal_uint8 is_data_43_5_dl_or_29_0_ul_supp;
+ kal_uint8 is_data_14_5_dl_or_43_5_ul_supp;
+ kal_uint8 is_data_14_5_dl_or_29_0_ul_supp;
+ kal_uint8 is_data_29_0_dl_or_43_5_ul_supp;
+ kal_uint8 is_data_43_5_radio_intf_rate_supp;
+ kal_uint8 is_data_32_0_radio_intf_rate_supp;
+ kal_uint8 is_data_29_0_radio_intf_rate_supp;
+ kal_uint8 is_data_14_5_radio_intf_rate_supp;
+ kal_uint8 is_data_12_0_radio_intf_rate_supp;
+ kal_uint8 is_data_06_0_radio_intf_rate_supp;
+ kal_uint8 is_data_03_6_radio_intf_rate_supp;
+ kal_uint8 is_half_rate_supp;
+}fdd_channel_mode_supported_struct;
+
+typedef struct
+{
+ kal_uint8 access_tech[16];
+ kal_uint8 power_cap[16];
+ kal_uint8 hscsd_multi_slot_class;
+ kal_uint8 gprs_multi_slot_class;
+ kal_uint8 pseudo_sync_cap;
+ kal_uint8 vbs;
+ kal_uint8 vgcs;
+ kal_uint8 algo_supported;
+ kal_uint8 hscsd_multi_slot_class_present;
+ kal_uint8 gprs_multi_slot_class_present;
+ kal_uint8 revision_level_indicator;
+ kal_uint8 gprs_ext_dynamic_cap;
+ kal_uint8 gea_supported;
+ kal_uint8 sm_cap_gprs;
+ kal_uint8 pfc_mode;
+
+ kal_bool early_class_mark_support;
+ kal_uint8 mm_non_drx_timer_value;
+ fdd_channel_mode_supported_struct chl_mode_supported; /* struct of supported channel modes */
+
+ /* Evelyn 20080909 */
+ /* Lanslo 20050215: for selecting GPRS or EGPRS capability */
+#ifdef __EGPRS_MODE__
+ kal_uint8 egprs_multi_slot_class_present;
+ kal_uint8 egprs_multi_slot_class;
+ kal_uint8 egprs_ext_dynamic_cap;
+ //Jelly 20090602 Use __EPSK_TX__
+ /* Evelyn 20090422: set difference power class of 8PSK */
+#ifdef __EPSK_TX__
+ kal_uint8 power_cap_8psk[16];
+#endif /* __EPSK_TX__ */
+#endif /* __EGPRS_MODE__ */
+
+ /* Evelyn 20090905: Modify for High multislot class */
+#if defined (__MULTISLOT_CLASS_34__) || defined (__MULTISLOT_CLASS_45__)
+ kal_uint8 high_multi_slot_class_present;
+ kal_uint8 high_multi_slot_class;
+#endif
+ /* eo Lanslo */
+
+ kal_uint8 gmsk_multislot_power_profile;
+ kal_uint8 eightpsk_multislot_power_profile;
+ kal_uint8 downlink_advanced_receiver_performance;
+
+#ifdef __GERAN_R11__
+ kal_uint8 extended_earfcn;
+ kal_uint8 eutran_wb_rsrq;
+ kal_uint8 umts_mfbi;
+ kal_uint8 eutra_mfbi;
+#endif /* __GERAN_R11__ */
+
+#ifdef __A5_3_AND_GEA_WHILTE_LIST__
+ kal_uint8 a5_default_supported;
+ kal_uint8 gea_default_supported;
+#endif /* __A5_3_AND_GEA_WHILTE_LIST__ */
+#ifdef __VAMOS_CUSTOM_CONFIG__
+ kal_uint8 vamos_level_from_custom_config;
+#endif
+
+} fdd_ms_capability_from_mrs_struct;
+
+/* The structure is defined here, but the variables are stored in rr_cntx_info.
+ Because they are obtained from RATCM initialization procedure, not MRS .*/
+typedef struct {
+ kal_uint8 non_drx_timer;
+ kal_uint8 split_on_ccch;
+ kal_uint16 split_pg_cycle;
+} fdd_ms_capability_from_nas_struct;
+
+typedef struct {
+ access_technology_type_enum serving_band;
+ kal_uint8 band_indicator;
+ kal_uint16 arfcn;
+ kal_uint8 bsic;
+ kal_uint8 msc_r;
+ rr_mm_sgsnr_flag_enum sgsn_r;
+} fdd_gas_serving_cell_info_struct;
+
+typedef struct {
+ mrs_gsm_power_class_enum pow_class_band450;
+ mrs_gsm_power_class_enum pow_class_band480;
+ mrs_gsm_power_class_enum pow_class_band710;
+ mrs_gsm_power_class_enum pow_class_band750;
+ mrs_gsm_power_class_enum pow_class_band810;
+ mrs_gsm_power_class_enum pow_class_band850;
+ mrs_gsm_power_class_enum pow_class_band900P;
+ mrs_gsm_power_class_enum pow_class_band900E;
+ mrs_gsm_power_class_enum pow_class_band900R;
+ mrs_gsm_power_class_enum pow_class_band1800;
+ mrs_gsm_power_class_enum pow_class_band1900;
+} fdd_mrs_gsm_power_class_struct;
+
+
+typedef struct {
+ fdd_ms_capability_from_mrs_struct ms_capability;
+ kal_uint8 ms_classmark3_len; /* The bit length of Classmark3 */
+ kal_uint8 ms_classmark3_R98_len; /* The bit length of Classmark3 when MS supports Release 98 */
+ kal_uint8 ms_default_classmark2[FDD_RR_NVRAM_CLK2_LEN]; /* read from nvram and has been decoded as power on */
+ kal_uint8 ms_classmark2[FDD_RR_NVRAM_CLK2_LEN];
+ kal_uint8 ms_full_classmark2[FDD_RR_FULL_CLK2_LEN];
+ kal_uint8 ms_classmark3[FDD_RR_NVRAM_CLK3_LEN];
+ rat_enum rat_mode;
+ /* GSM supported band */
+ kal_uint8 gsm_supported_band;
+ kal_bool is_test_sim;
+ fdd_gas_serving_cell_info_struct serving_cell_info;
+ capability_switch_enum gsm_cap;
+
+#ifdef __LTE_RAT__
+ capability_switch_enum eutran_cap;
+#endif /* __LTE_RAT__ */
+
+#ifdef __UMTS_FDD_MODE__
+ /* record the bit location for UMTS FDD RAT Capibility; this bit
+ * is set to 1 only when the MS is in GSM+UMTS dual mode
+ */
+ kal_uint8 cm3_umts_fdd_bit_location;
+#endif /* __UMTS_FDD_MODE__ */
+
+ /* record the bit location for VAMOS level setting. */
+ kal_uint8 cm3_vamos_bit_location;
+ kal_uint8 inject_vamos;
+ kal_uint8 vamos_level_from_nvram;
+
+#ifdef __GERAN_R8__
+ /* record the bit location for R8 Capibility;
+ * this bit is set to 1 only when the MS is in GSM+LTE
+ * dual mode or GSM+UMTS+LTE triple mode
+ */
+ kal_uint8 cm3_r8_bit_location;
+#endif /* __GERAN_R8__ */
+
+#ifdef __GERAN_R9__
+ kal_uint8 cm3_r9_csg_bit_location;
+#endif /* __GERAN_R9__ */
+
+/* Extended EARFCN is late addition to Rel 11 also 44.018 and 44.060 spec has this feature in REL11, */
+/*So right now keep code change under __GERAN_R11__, if needed in future, change to __GERAN_R12__*/
+#ifdef __GERAN_R11__
+ kal_uint8 cm3_r12_extended_earfcn_bit_location;
+ kal_uint8 cm3_r11_eutra_wb_rsrq_location;
+ kal_uint8 cm3_r12_umts_mfbi_bit_location;
+ kal_uint8 cm3_r12_eutra_mfbi_bit_location;
+#endif /* __GERAN_R11__ */
+
+#if defined(__EGPRS_MODE__)
+ kal_bool is_epsk_tx_enabled;
+#endif
+
+#ifdef __AGPS_CONTROL_PLANE__
+ kal_bool agps_supported_in_clk;
+#endif /* __AGPS_CONTROL_PLANE__ */
+
+#ifdef __PS_SERVICE__
+ kal_bool inject_ra_cap_normal_coding;
+ /* Katie 20130304: add inject to turn off R8R9 capability for CRTUG 44.2.10 */
+ /* TangTe 20140929 change inject_ra_cap_turn_R8R9_off into inject_ra_cap_support_rel,
+ default value:255, the value will represent the release version*/
+ kal_uint8 inject_ra_cap_support_rel;
+ /* TangTe 02150313 add for report 2G capability(Access technology tepe and RF power Capability) when 3G only*/
+ kal_bool inject_2g_cap_in_3gonly;
+#endif /* __PS_SERVICE__ */
+
+ /* store the nvram CLK in context to allow set gas band without reboot */
+ kal_uint8 *ms_classmark_in_nvram_ptr;
+ kal_uint8 ms_classmark_in_nvram_len;
+
+#ifdef __NR_RAT__
+ capability_switch_enum nr_cap;
+#endif /* __NR_RAT__ */
+
+ /* This Context variable will contain gsm AS and HW supported band */
+ kal_uint8 gsm_all_supported_band;
+
+ /* This variable hold enable or disable of MT SMS capability set through AT cmd */
+ gsm_sms_cap_enum gsm_sms_capability;
+
+} fdd_gas_capability_context_struct;
+
+/*****************************************************************************
+ * Declarations Of Exported Globals
+ *****************************************************************************/
+#ifdef __GSM_RAT__
+void fdd_mrs_gas_init_contx_default_value(void);
+
+extern void fdd_mrs_gas_reset(void);
+
+extern void fdd_mrs_gas_get_ms_capability(MRS_SIM_INDEX sim_index, fdd_gas_capability_context_struct *gas_ms_cap_ptr);
+
+extern kal_uint8 *fdd_mrs_gas_get_classmark1 (MRS_SIM_INDEX sim_index, MRS_RAT_MODE_TYPE required_rat);
+
+extern void fdd_mrs_gas_get_classmark3 (MRS_SIM_INDEX sim_index, bit_stream *bs_ptr);
+
+extern kal_uint8 fdd_mrs_gas_get_classmark3msg_len(MRS_SIM_INDEX sim_index);
+
+extern kal_bool fdd_mrs_gas_get_ucs2_support(MRS_SIM_INDEX sim_index);
+
+extern void fdd_mrs_gas_set_sim_type(MRS_SIM_INDEX sim_index, kal_bool is_test_sim);
+
+extern kal_uint8 fdd_mrs_gas_get_gsm_algo_support(MRS_SIM_INDEX sim_index);
+
+#ifdef __PS_SERVICE__
+extern kal_uint16 fdd_mrs_gas_get_radio_access_cap (MRS_SIM_INDEX sim_index, kal_uint8 support_band, kal_uint8 **ra_cap);
+extern kal_uint16 fdd_mrs_mac_get_radio_access_cap(MRS_SIM_INDEX sim_index, kal_uint8 support_band, kal_uint8 **ra_cap, kal_bool *is_truncated, const kal_bool is_exclude_A5, const kal_uint8 bit_len_limit);
+#endif /* __PS_SERVICE__ */
+
+extern kal_bool fdd_mrs_gas_get_2g3_ps_ho_cap (MRS_SIM_INDEX sim_index, rat_enum rat_mode);
+
+extern kal_bool fdd_mrs_gas_get_2g4_ps_ho_cap (MRS_SIM_INDEX sim_index, rat_enum rat_mode);
+
+extern kal_bool fdd_mrs_gas_get_ir_srvcc_cap (MRS_SIM_INDEX sim_index, rat_enum rat_mode);
+
+extern void fdd_mrs_gas_update_serving_cell_info(MRS_SIM_INDEX sim_index, fdd_gas_serving_cell_info_struct serving_cell_info);
+
+extern void fdd_mrs_gas_update_current_rat_mode(MRS_SIM_INDEX sim_index, rat_enum rat_mode);
+
+extern kal_bool fdd_mrs_gas_validate_arfcn(MRS_SIM_INDEX sim_index, kal_uint16 arfcn, te_gsm_band_indicator band_indicator);
+
+extern kal_bool fdd_mrs_gas_band_setting_update(MRS_SIM_INDEX sim_index, kal_uint8 * gsm_band_ptr);
+
+extern gsm_nw_band_enum fdd_mrs_gas_get_l4c_band_bitmap_from_arfcn (MRS_SIM_INDEX sim_index, kal_uint16 arfcn, te_gsm_band_indicator band_indicator);
+
+extern gsm_nw_band_enum rr_mrs_get_l4c_gsm_bandbitmap_from_arfcn(MRS_SIM_INDEX sim_index, kal_uint16 arfcn);
+
+#endif /* __GSM_RAT__ */
+
+#ifdef __LTE_RAT__
+
+extern void fdd_mrs_gas_update_disable_eutran_cap(MRS_SIM_INDEX sim_index, capability_switch_enum eutran_cap);
+extern void fdd_mrs_setLTEBand(kal_uint32 lte_band, kal_uint16* lte_nbr_band_list);
+
+#endif /* __LTE_RAT__ */
+
+void fdd_mrs_gas_read_nvram_cnf_handler(kal_uint16 nvram_file_id, kal_uint8* data, kal_uint16 len);
+
+extern void fdd_mrs_gas_decode_mscap_from_nvram(MRS_SIM_INDEX sim_index, kal_uint8 *bit_ptr);
+
+extern void fdd_mrs_gas_decode_ms_capability(MRS_SIM_INDEX sim_index, bit_stream *bit_stream_ptr, kal_bool is_dynmc_cfg);
+
+extern kal_bool fdd_mrs_gas_is_R99_supported_in_CS(MRS_SIM_INDEX sim_index);
+
+extern kal_bool fdd_mrs_gas_is_R99_supported_in_PS(MRS_SIM_INDEX sim_index);
+extern kal_uint8 *fdd_mrs_gas_get_classmark2 (MRS_SIM_INDEX sim_index, MRS_RAT_MODE_TYPE required_rat, kal_bool get_full_ie);
+
+
+extern void fdd_mrs_gas_get_powerclass(MRS_SIM_INDEX sim_index, fdd_mrs_gsm_power_class_struct *gsm_pow_class);
+
+extern kal_bool fdd_mrs_gas_retrieve_arfcn_band(MRS_SIM_INDEX sim_index,kal_uint16 arfcn, kal_uint8 *band_ptr);
+#ifdef __A5_3_AND_GEA_WHILTE_LIST__
+extern void fdd_mrs_set_a5_and_gea_algo(MRS_SIM_INDEX sim_index, const kal_uint8 *a5,const kal_uint8 *gea, plmn_match_enum plmn_match);
+#endif /* __A5_3_AND_GEA_WHILTE_LIST__ */
+
+extern void fdd_mrs_gas_add_black_cell_list_notification(void);
+
+extern void fdd_mrs_gas_clear_black_cell_list_notification(void);
+
+extern void fdd_mrs_set_current_camped_plmn(MRS_SIM_INDEX sim_index,plmn_id_struct plmn_id);
+
+#ifdef __VAMOS_CUSTOM_CONFIG__
+extern void fdd_mrs_set_custom_vamos(MRS_SIM_INDEX sim_index, kal_uint8 *vamos, kal_bool plmn_match);
+extern kal_uint8 fdd_mrs_get_custom_vamos(MRS_SIM_INDEX sim_index);
+
+#endif /* __VAMOS_CUSTOM_CONFIG__ */
+
+extern void fdd_mrs_print_classmark(kal_uint8 *bs_ptr, kal_uint16 line_num);
+
+extern kal_bool mrs_gas_is_supported_band(MRS_SIM_INDEX sim_index, kal_uint16 lte_band_idx);
+
+#ifdef __NR_RAT__
+extern void fdd_mrs_gas_update_disable_nr_cap(MRS_SIM_INDEX sim_index, capability_switch_enum nr_cap);
+#endif /* __NR_RAT__ */
+
+extern kal_bool fdd_mrs_update_gsm_band_setting(MRS_SIM_INDEX sim_index, kal_uint8 *band_setting);
+extern kal_bool fdd_mrs_gas_band_setting_update_by_plmn(MRS_SIM_INDEX sim_index, mrs_plmn_id cplmn);
+extern void fdd_mrs_gas_get_gsm_all_supported_band(MRS_SIM_INDEX sim_index, kal_uint8 *gsmbandmask);
+extern kal_bool fdd_mrs_gas_mcc_band_setting_update(MRS_SIM_INDEX sim_index, kal_uint8 * gsm_band_ptr);
+
+extern void fdd_mrs_set_gsm_sms_capability(MRS_SIM_INDEX sim_index, kal_bool gsm_sms_cap);
+extern void fdd_mrs_gas_set_gsm_cap_update(MRS_SIM_INDEX sim_index, capability_switch_enum gsm_cap);
+extern capability_switch_enum fdd_mrs_gas_get_gsm_cap_update(MRS_SIM_INDEX sim_index);
+extern kal_bool fdd_mrs_gas_gsm_enabled (MRS_SIM_INDEX sim_index, rat_enum rat_mode);
+
+/************************************************** End of FDD's part **************************************************/
+
+#endif /* _MRS_GAS_CAPABILITY_H */
+
diff --git a/mcu/protocol/interface/general/mrs_mm_capability.h b/mcu/protocol/interface/general/mrs_mm_capability.h
new file mode 100644
index 0000000..407a168
--- /dev/null
+++ b/mcu/protocol/interface/general/mrs_mm_capability.h
@@ -0,0 +1,151 @@
+/******************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*******************************************************************************/
+
+/******************************************************************************
+ * Filename:
+ * ---------
+ * mrs_mm_capability.h
+ *
+ * Project:
+ * --------
+ * Multimode
+ *
+ * Description:
+ * ------------
+ * The MM capability stored in MRS context.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *==============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *===========================================================================
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *===========================================================================
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *
+ *****************************************************************************/
+
+#ifndef _MRS_MM_CAPABILITY_H
+#define _MRS_MM_CAPABILITY_H
+
+#include "kal_general_types.h"
+#include "kal_public_api.h"
+#include "mrs_as_enums.h"
+#include "mcd_l3_inc_struct.h"
+
+/*****************************************************************************
+ * Macros Without Parameters
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Macros With Parameters
+ *****************************************************************************/
+
+
+/*****************************************************************************
+ * Enums without tags
+ *****************************************************************************/
+
+
+
+/*****************************************************************************
+ * Type Definitions
+ *****************************************************************************/
+typedef struct {
+ kal_bool isr_support;
+ kal_bool epc_capability;
+ kal_bool inject_ms_nw_cap_disable_lte_bit;
+ kal_uint8 speech_version; /*first byte for GSM supported speech codec*/
+ kal_uint8 speech_version_byte2; /*second byte for GSM supported speech codec*/
+ kal_uint8 fdd_umts_supported_speech; /*first byte for FDD UMTS supported speech codec*/
+ kal_uint8 fdd_umts_supported_speech_byte2; /*second byte for FDD UMTS supported speech codec*/
+ kal_uint8 tdd_umts_supported_speech; /*first byte for TDD UMTS supported speech codec*/
+ kal_uint8 tdd_umts_supported_speech_byte2; /*second byte for TDD UMTS supported speech codec*/
+} mm_capability_context_struct;
+
+
+/*****************************************************************************
+ * Declarations Of Exported Globals
+ *****************************************************************************/
+void mrs_mm_init_contx_default_value(void);
+void mrs_mm_get_ms_nw_cap(MRS_SIM_INDEX sim_index, rat_enum rat_mode, rat_enum current_rat, kal_uint8 *data, kal_uint8 *len);
+kal_uint8 mrs_mm_get_gea_supported(MRS_SIM_INDEX sim_index);
+void mrs_mm_read_nvram_cnf_handler(kal_uint16 nvram_file_id, kal_uint8* data, kal_uint16 len);
+void mrs_mm_get_supported_codec_list(MRS_SIM_INDEX sim_index, rat_enum rat_mode, plmn_id_struct *plmn_id, kal_uint8 *data, kal_uint8 *len);
+
+#ifdef __LTE_RAT__
+void mrs_mm_set_isr_support(MRS_SIM_INDEX sim_index, kal_bool is_isr);
+kal_bool mrs_mm_get_isr_support(MRS_SIM_INDEX sim_index);
+void mrs_mm_set_epc_cap(MRS_SIM_INDEX sim_index, kal_bool is_epc);
+kal_bool mrs_is_end_of_custom_plmn_array_to_disable_isr_support(const kal_char *plmn_str);
+kal_bool mrs_is_sim_plmn_in_custom_config(MRS_SIM_INDEX sim_index);
+#endif
+kal_uint8 *mrs_mm_get_classmark1(MRS_SIM_INDEX sim_index, MRS_RAT_MODE_TYPE required_rat);
+
+#endif /* _MRS_MM_CAPABILITY_H */
+
diff --git a/mcu/protocol/interface/general/mrs_nras_capability.h b/mcu/protocol/interface/general/mrs_nras_capability.h
new file mode 100644
index 0000000..9f45d5f
--- /dev/null
+++ b/mcu/protocol/interface/general/mrs_nras_capability.h
@@ -0,0 +1,615 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+#ifndef MRS_NRAS_CAPABILITY_H
+#define MRS_NRAS_CAPABILITY_H
+
+#include "irat_common_enums.h"
+#include "mrs_as_enums.h"
+#include "mrs_as_struct.h"
+#include "mrs_common_capability.h"
+
+#include "custom_nras_config.h"
+
+/********************************************
+ * MACROS *
+ ********************************************/
+
+#define NRARFCN_INVALID 0xFFFFFFFF
+#define NRFREQ_INVALID 0
+/*
+ * MRS_NRAS_MAX_OVERLAPPING_BANDS value 8 follows the maximum length
+ * (maxNrofMultiBands) of IE MultiFrequencyBandListNR-SIB specified in
+ * TS 38.331.
+ */
+#define MRS_NRAS_MAX_OVERLAPPING_BANDS 8
+
+#define MRS_NRAS_MIN_FR1_BAND (1)
+#define MRS_NRAS_MAX_FR1_BAND (86)
+#define MRS_NRAS_MIN_FR2_BAND (257)
+#define MRS_NRAS_MAX_FR2_BAND (261)
+
+#define MRS_NRAS_SEARCH_MAX_POWER_SCAN_RANGE_NUM 512
+#define MRS_NRAS_SEARCH_MAX_DETECTED_CELL_NUM 256
+
+#define MRS_NRAS_MAX_EUTRA_BAND_LIST_LENGTH 256
+
+#define MRS_NRAS_GEMINI_STATUS_NUM 3
+/********************************************
+ * TYPE DEFINITIONS & ENUMS *
+ ********************************************/
+
+typedef enum
+{
+ NR_DUPLEX_FDD,
+ NR_DUPLEX_TDD,
+ NR_DUPLEX_SDL,
+ NR_DUPLEX_SUL,
+ NR_DUPLEX_INVALID
+} nr_duplex_enum;
+
+typedef enum {
+ NRAS_READ_NVRAM_CNF,
+ NRAS_BAND_SETTING_UPDATE,
+ NRAS_MAX_BAND_CAP_FOR_USER,
+ NRAS_INTERNAL_BAND_SETTING_UPDATE,
+ COMMON_EM_GET_AS_BAND_SETTING,
+ COMMON_EM_SET_AS_BAND_SETTING,
+ NRAS_BNAD_GET_CONTEXT_NVRAM,
+ NRAS_BNAD_GET_ENDC_CONTEXT_NVRAM,
+ NRAS_BAND_SET_CONTEXT_NVRAM,
+ NRAS_BAND_SET_ENDC_CONTEXT_NVRAM,
+#ifdef __NVM_GLOBAL_CABC__
+ NRAS_BAND_SUPPORT_BY_PLMN,
+#endif /* __NVM_GLOBAL_CABC__ */
+ NRAS_ENDC_NR_SUPPORTED_BAND_LIST_INITIAL,
+ NRAS_INTERNAL_ENDC_BAND_SETTING_UPDATE
+} nras_band_print_func_enum;
+
+typedef enum {
+ NRAS_FUNC_INPUT,
+ NRAS_RF_FILTER,
+ NRAS_BAND_READ_NR_BANDS_FROM_SCSI,
+ NRAS_BAND_READ_NR_ENDC_BANDS_FROM_SCSI,
+ NRAS_BAND_SET_NR_BANDS,
+ NRAS_BAND_SET_NR_ENDC_BANDS,
+ NRAS_BAND_SET_NR_BANDS_FROM_SCSI,
+ NRAS_BAND_SET_NR_ENDC_BANDS_FROM_SCSI,
+ NRAS_BAND_NVRAM_OUTPUT_NR_BANDS,
+ NRAS_BAND_NVRAM_OUTPUT_NR_ENDC_BANDS,
+#ifdef __NVM_GLOBAL_CABC__
+ NRAS_SA_BAND_SUPPORT,
+ NRAS_ENDC_BAND_SUPPORT,
+#endif /* __NVM_GLOBAL_CABC__ */
+ NRAS_RF_FILTER_ENDC_NR_FULL_CAP,
+ NRAS_RF_FILTER_ENDC_NR_DATA_SIM,
+ NRAS_RF_FILTER_ENDC_NR_NON_DATA_SIM
+} nras_band_print_check_point_enum;
+
+typedef enum {
+ NRAS_LOW_CARRIER_FREQ,
+ NRAS_MID_CARRIER_FREQ,
+ NRAS_HIGH_CARRIER_FREQ
+} mrs_nras_carrier_freq_type_enum;
+
+typedef enum {
+ MRS_NRAS_SEARCH_RESULT_NOT_FINISHED,
+ MRS_NRAS_SEARCH_RESULT_FINISHED
+} mrs_nras_search_result_status_enum;
+
+typedef enum {
+ NRAS_SFTD_MEAS_PSCELL,
+ NRAS_SFTD_MEAS_NR_CELL
+} mrs_nras_sftd_meas_type_enum;
+
+typedef enum {
+ MRS_NRAS_PLMN_MATCH_RESULT_NOT_FOUND, /* No SIB is found on this frequency */
+ MRS_NRAS_PLMN_MATCH_RESULT_NOT_MATCH, /* Exist SIB on this frequency, but PLMN doesn't match */
+ MRS_NRAS_PLMN_MATCH_RESULT_MATCH /* Exist SIB on this frequency and PLMN match exactly*/
+} mrs_nras_plmn_match_result_enum;
+
+typedef enum {
+ MRS_NRAS_QUICK_POWER_SEARCH_RESULT = 0,
+ MRS_NRAS_NORMAL_POWER_SEARCH_RESULT = 1,
+ MRS_NRAS_NORMAL_POWER_SEARCH_RESULT_MAX
+} mrs_nras_power_scan_result_rssi_threshold_enum;
+
+typedef enum
+{
+ MRS_NR_BAND_DISABLE_BY_PLMN_STATE_NONE,
+ MRS_NR_BAND_DISABLE_BY_PLMN_STATE_ONE_OR_MORE,
+ MRS_NR_BAND_DISABLE_BY_PLMN_STATE_ALL,
+ MRS_NR_BAND_DISABLE_BY_PLMN_STATE_INVALID
+} mrs_nr_band_disable_by_plmn_state_enum;
+
+#ifdef __GEMINI__
+typedef enum
+{
+ MRS_NRAS_GEMINI_STATUS_DR_DSDS_SUPPORTED,
+ MRS_NRAS_GEMINI_STATUS_DSDA_SUPPORTED,
+ MRS_NRAS_GEMINI_STATUS_MULTI_SIM_INSERTED,
+ MRS_NRAS_GEMINI_STATUS_IS_DATA_SIM,
+ MRS_NRAS_GEMINI_STATUS_INVALID
+} mrs_nras_gemini_query_option_enum;
+#endif
+
+
+typedef struct {
+ kal_uint8 nea_support; /*MSB: NEA0, 128-NEA1, 128-NEA2, 128-NEA3 */
+ kal_uint8 nia_support; /*MSB: NIA0, 128-NIA1, 128-NIA2, 128-NIA3 */
+ kal_uint8 nras_power_class;
+ kal_uint8 endc_support;
+ kal_uint8 nvram_nr_band[MRS_NR_BAND_BITMASK_SIZE];
+ kal_uint8 nvram_endc_nr_band[MRS_NR_BAND_BITMASK_SIZE];
+#ifdef __NVM_GLOBAL_CABC__
+ //mrs_plmn_id_list saved_plmn_id_list;
+ //mrs_gemini_status_enum saved_gemini_status;
+ //kal_bool saved_sa_nr_band_valid;
+ //kal_uint8 saved_sa_nr_band_bitmask[MRS_NR_BAND_BITMASK_SIZE];
+ //kal_bool saved_endc_nr_band_valid;
+ //kal_uint8 saved_endc_nr_band_bitmask[MRS_NR_BAND_BITMASK_SIZE];
+#endif /* __NVM_GLOBAL_CABC__ */
+} nras_capability_context_struct;
+
+typedef struct {
+ nr_duplex_enum nr_duplex;
+ kal_uint16 nr_band;
+} nras_band_duplex_struct;
+
+typedef struct
+{
+ kal_uint32 begin;
+ kal_uint32 end;
+} mrs_freq_range_struct;
+
+typedef struct {
+ kal_uint16 band;
+ kal_uint32 ssb_arfcn;
+ kal_uint16 pci;
+ kal_uint8 subcarrier_spacing_ssb; // The original type is NR_SCS_TYPE_E, but MRS does not include NL1 header, so use U8
+ mrs_plmn_id_list plmn_list;
+
+#if 1//defined(__SKIP_BW__)
+ mrs_freq_range_struct cell_arfcn_begin_end_points;
+#endif /* __SKIP_BW__ */
+} mrs_nras_search_cell_sib_result_entry_struct;
+
+typedef struct {
+ kal_uint16 band;
+ kal_uint32 begin;
+ kal_uint32 end;
+ mrs_nr_scs_enum ssb_scs;
+} mrs_nras_search_ccs_result_entry_struct;
+
+typedef struct {
+ kal_uint32 continuous_carrier_search_result_num;
+ mrs_nras_search_ccs_result_entry_struct continuous_carrier_search_result[MRS_NRAS_SEARCH_MAX_POWER_SCAN_RANGE_NUM];
+ kal_uint32 cell_sib_result_num;
+ mrs_nras_search_cell_sib_result_entry_struct cell_sib_result[MRS_NRAS_SEARCH_MAX_DETECTED_CELL_NUM];
+ kal_uint32 non_cell_defining_ssb_range_num;
+ mrs_freq_range_struct non_cell_defining_ssb_range[MRS_NRAS_SEARCH_MAX_DETECTED_CELL_NUM];
+ kal_uint32 power_scan_result_num[MRS_NRAS_NORMAL_POWER_SEARCH_RESULT_MAX];
+ mrs_freq_range_struct power_scan_result[MRS_NRAS_NORMAL_POWER_SEARCH_RESULT_MAX][MRS_NRAS_SEARCH_MAX_POWER_SCAN_RANGE_NUM];
+} mrs_nras_search_info_struct;
+
+/*
+ * List implementing NR band support bitmask where LSB in the first one byte
+ * (index 0) of nr_band_list represents NR band 1.
+ */
+typedef struct {
+ kal_uint8 nr_band_list[MRS_NR_BAND_BITMASK_SIZE];
+} mrs_nr_band_list_struct;
+
+typedef struct
+{
+ ca_bandwidth_class_eutra_enum ca_bandwidth_class_dl;
+ ca_bandwidth_class_eutra_enum ca_bandwidth_class_ul;
+ kal_uint16 eutra_band;
+} nras_eutra_band_info_struct;
+
+typedef struct
+{
+ nras_eutra_band_info_struct
+ eutra_band_list[MRS_NRAS_MAX_EUTRA_BAND_LIST_LENGTH];
+ kal_uint16 eutra_band_list_length;
+} nras_eutra_band_list_struct;
+
+/********************************************
+ * VARIABLES *
+ ********************************************/
+
+
+/********************************************
+ * FUNCTION DECLARATIONS *
+ ********************************************/
+
+kal_uint8 mrs_nras_is_supported_dl_nrarfcn_on_any_band(kal_uint16 *band,
+ NRARFCN nr_dl_arfcn, MRS_SIM_INDEX sim_index);
+kal_uint16 mrs_nras_supported_band_of_dl_nrarfcn_get(NRARFCN nr_dl_arfcn,
+ MRS_SIM_INDEX sim_index);
+kal_bool mrs_nras_is_supported_dl_nrarfcn(NRARFCN nr_dl_arfcn, kal_uint16 band,
+ MRS_SIM_INDEX sim_index);
+kal_bool mrs_nras_is_supported_dl_nrarfcn_partial_band(
+ const mrs_plmn_id *p_mrs_plmn_id,
+ NRARFCN nr_dl_arfcn, kal_uint16 band, MRS_SIM_INDEX sim_index);
+kal_bool mrs_nras_is_supported_ul_nrarfcn(NRARFCN nr_dl_arfcn, kal_uint16 band,
+ MRS_SIM_INDEX sim_index);
+kal_bool mrs_nras_is_supported_band(kal_uint16 nr_band, MRS_SIM_INDEX sim_index);
+kal_bool mrs_nras_is_supported_band_public(kal_uint16 nr_band,
+ MRS_SIM_INDEX sim_index,
+ kal_bool show_trace);
+void mrs_nras_read_nvram_cnf_handler(kal_uint16 nvram_file_id, kal_uint8 *data, kal_uint16 len);
+kal_uint8 mrs_nras_get_powerclass(MRS_SIM_INDEX sim_index, kal_uint16 nr_band);
+kal_uint8 mrs_nras_get_powerclass_value(MRS_SIM_INDEX sim_index,
+ kal_uint16 nr_band);
+kal_uint32 mrs_nras_dl_nrarfcn_phy_freq_get(NRARFCN dl_nrarfcn);
+kal_uint32 mrs_nras_ul_nrarfcn_phy_freq_get(NRARFCN ul_nrarfcn);
+void mrs_nras_dl_nrarfcn_duplex_type_get(NRARFCN dl_nrarfcn,
+ nras_band_duplex_struct *duplex_list, kal_uint8 *duplex_list_length);
+void mrs_nras_ul_nrarfcn_duplex_type_get(NRARFCN ul_nrarfcn,
+ nras_band_duplex_struct *duplex_list, kal_uint8 *duplex_list_length);
+kal_bool mrs_nras_is_specified_nr_band(kal_uint16 nr_band);
+kal_bool mrs_nras_is_gscn_supported(
+ mrs_nras_carrier_freq_type_enum carrier_freq_type,
+ kal_uint16 freq_index, kal_int8 freq_offset);
+kal_bool mrs_nras_is_endc_support(MRS_SIM_INDEX sim_index);
+kal_uint32 mrs_nras_get_ue_nr_cap(MRS_SIM_INDEX sim_index,
+ const mrs_nras_octet_string_struct freqbandlist_ie,
+ const mrs_nras_octet_string_struct UE_CapabilityRequestFilterNR_ie,
+ const mrs_plmn_id_list *p_plmn_id_list,
+ kal_uint8 **pp_ue_nr_cap,
+ kal_bool eutra_nr_only,
+ mrs_gemini_status_enum gemini_status,
+ kal_bool is_restriction_size_valid,
+ kal_uint32 restriction_size,
+ kal_bool is_bc_list_set);
+kal_uint32 mrs_nras_get_ue_mrdc_cap(MRS_SIM_INDEX sim_index,
+ const mrs_nras_octet_string_struct freqbandlist_ie,
+ const mrs_nras_octet_string_struct UE_CapabilityRequestFilterNR_ie,
+ const mrs_plmn_id_list *p_plmn_id_list,
+ kal_uint8 **pp_ue_mrdc_cap,
+ kal_bool eutra_nr_only,
+ mrs_gemini_status_enum gemini_status,
+ kal_bool is_restriction_size_valid,
+ kal_uint32 restriction_size,
+ kal_bool is_bc_list_set);
+void mrs_nras_get_ue_nr_and_mrdc_cap(MRS_SIM_INDEX sim_index,
+ const mrs_nras_octet_string_struct freqbandlist_ie,
+ const mrs_nras_octet_string_struct UE_CapabilityRequestFilterNR_ie,
+ const mrs_plmn_id_list *p_plmn_id_list,
+ kal_uint8 **pp_ue_nr_cap,
+ kal_uint8 **pp_ue_mrdc_cap,
+ kal_bool eutra_nr_only,
+ mrs_gemini_status_enum gemini_status,
+ kal_uint16 *nr_cap_size,
+ kal_uint16 *mrdc_cap_size,
+ kal_bool is_restriction_size_valid,
+ kal_uint32 restriction_size,
+ kal_bool is_bc_list_set);
+
+/**
+ * @brief Gets EUTRAN feature set IDs
+ * @param[in] freqbandlist_ie Encoded NR FreqBandList IE as specified in TS 38.331
+ * @param[in] p_plmn_id_list PLMN Id List is used for band filtering or customization
+ * @param[out] p_eutran_feature_sets Pointer to EUTRAN feature set IDs
+ * @param[in] sim_index SIM index
+ * @return N/A
+ */
+void mrs_nras_eutran_feature_set_ids_get(
+ const mrs_nras_octet_string_struct freqbandlist_ie,
+ const mrs_plmn_id_list *p_plmn_id_list,
+ mrs_nras_eutran_feature_set_ids_struct *p_eutran_feature_sets,
+ MRS_SIM_INDEX sim_index,
+ mrs_gemini_status_enum gemini_status,
+ kal_bool is_bc_list_set);
+
+kal_uint16 mrs_nras_max_band_number_get(void);
+nr_duplex_enum mrs_nras_band_duplex_get(kal_uint16 band);
+kal_uint32 mrs_nras_max_ul_phy_freq_get(kal_uint16 band);
+kal_uint32 mrs_nras_min_ul_phy_freq_get(kal_uint16 band);
+kal_uint32 mrs_nras_max_dl_phy_freq_get(kal_uint16 band);
+kal_uint32 mrs_nras_min_dl_phy_freq_get(kal_uint16 band);
+kal_uint32 mrs_nras_all_rat_max_dl_phy_freq_get(kal_uint16 band);
+kal_uint32 mrs_nras_all_rat_min_dl_phy_freq_get(kal_uint16 band);
+NRARFCN mrs_nras_max_dl_nr_arfcn_get(kal_uint16 band);
+NRARFCN mrs_nras_min_dl_nr_arfcn_get(kal_uint16 band);
+NRARFCN mrs_nras_max_ul_nr_arfcn_get(kal_uint16 band);
+NRARFCN mrs_nras_min_ul_nr_arfcn_get(kal_uint16 band);
+NRARFCN mrs_nras_dl_phy_freq_nrarfcn_get(kal_uint32 dl_phy_freq);
+#ifndef __NVM_GLOBAL_CABC__
+kal_bool mrs_nras_nr_fdd_supported(MRS_SIM_INDEX sim_index);
+kal_bool mrs_nras_nr_tdd_supported(MRS_SIM_INDEX sim_index);
+kal_bool mrs_nras_nr_fr1_supported(MRS_SIM_INDEX sim_index);
+kal_bool mrs_nras_nr_fr2_supported(MRS_SIM_INDEX sim_index);
+kal_bool mrs_nras_endc_nr_fdd_supported(MRS_SIM_INDEX sim_index);
+kal_bool mrs_nras_endc_nr_tdd_supported(MRS_SIM_INDEX sim_index);
+kal_bool mrs_nras_endc_nr_fr1_supported(MRS_SIM_INDEX sim_index);
+kal_bool mrs_nras_endc_nr_fr2_supported(MRS_SIM_INDEX sim_index);
+#else
+kal_bool mrs_nras_nr_fdd_supported(MRS_SIM_INDEX sim_index, const mrs_plmn_id_list *p_plmn_id_list);
+kal_bool mrs_nras_nr_tdd_supported(MRS_SIM_INDEX sim_index, const mrs_plmn_id_list *p_plmn_id_list);
+kal_bool mrs_nras_nr_fr1_supported(MRS_SIM_INDEX sim_index, const mrs_plmn_id_list *p_plmn_id_list);
+kal_bool mrs_nras_nr_fr2_supported(MRS_SIM_INDEX sim_index, const mrs_plmn_id_list *p_plmn_id_list);
+kal_bool mrs_nras_endc_nr_fdd_supported(MRS_SIM_INDEX sim_index, const mrs_plmn_id_list *p_plmn_id_list);
+kal_bool mrs_nras_endc_nr_tdd_supported(MRS_SIM_INDEX sim_index, const mrs_plmn_id_list *p_plmn_id_list);
+kal_bool mrs_nras_endc_nr_fr1_supported(MRS_SIM_INDEX sim_index, const mrs_plmn_id_list *p_plmn_id_list);
+kal_bool mrs_nras_endc_nr_fr2_supported(MRS_SIM_INDEX sim_index, const mrs_plmn_id_list *p_plmn_id_list);
+#endif /* __NVM_GLOBAL_CABC__ */
+
+void mrs_nras_clear_search_info(MRS_SIM_INDEX sim_index);
+void mrs_nras_search_continuous_carrier_search_result_add(const MRS_SIM_INDEX sim_index, mrs_nras_search_ccs_result_entry_struct *input);
+kal_uint32 mrs_nras_search_continuous_carrier_search_result_query(const MRS_SIM_INDEX sim_index, mrs_nras_search_ccs_result_entry_struct *p_list);
+kal_uint32 mrs_nras_search_non_cell_defining_ssb_range_query(mrs_freq_range_struct *p_list);
+void mrs_nras_search_cell_sib_result_add(const MRS_SIM_INDEX sim_index, const mrs_nras_search_cell_sib_result_entry_struct *input);
+void mrs_nras_search_non_cell_defining_ssb_range_add(const MRS_SIM_INDEX sim_index, const mrs_freq_range_struct *input);
+mrs_nras_plmn_match_result_enum mrs_nras_search_plmn_in_sib_of_freq(
+ const MRS_SIM_INDEX sim_index,
+ const kal_uint32 nrarfcn,
+ const plmn_id_struct *selected_plmn);
+
+kal_uint32 mrs_nras_search_cell_bw_query(
+ const MRS_SIM_INDEX sim_index,
+ mrs_freq_range_struct *range_list);
+
+void mrs_nras_search_power_scan_result_add(const MRS_SIM_INDEX sim_index,
+ const mrs_freq_range_struct *input,
+ kal_bool is_quick_search);
+
+kal_uint32 mrs_nras_search_power_scan_result_query(const MRS_SIM_INDEX sim_index,
+ mrs_freq_range_struct *p_list,
+ kal_bool is_quick_search);
+
+void mrs_nras_search_power_scan_result_remove(const MRS_SIM_INDEX sim_index,
+ const mrs_freq_range_struct *input,
+ kal_bool is_quick_search);
+
+void mrs_nras_mrs_plmn_id_to_plmn_id(const mrs_plmn_id *src, plmn_id_struct *dst);
+
+kal_bool mrs_nras_sftd_measurement_type_supported(
+ MRS_SIM_INDEX sim_index,
+ mrs_nras_sftd_meas_type_enum sftd_meas_type,
+ NRARFCN nr_arfcn);
+
+/**
+ * @brief Function for reading the list of the NR bands supported by RF.
+ * @param[out] NR band list.
+ */
+void mrs_nras_max_band_cap_for_user(mrs_nr_band_list_struct *nr_band);
+
+void mrs_nras_nr_band_rf_cap_for_user(mrs_nr_band_list_struct *nr_sa_band, mrs_nr_band_list_struct *nr_endc_band);
+
+kal_bool mrs_nras_band_setting_update(MRS_SIM_INDEX sim_index,
+ kal_uint8 *p_nr_band, kal_bool with_duplex_mode);
+
+kal_bool mrs_nras_endc_band_setting_update(MRS_SIM_INDEX sim_index,
+ mrs_gemini_status_enum *gemini_status, kal_uint8 *p_endc_nr_band);
+
+void mrs_nras_print_band_bitmask(const kal_uint8* p_band_mask_byte,
+ nras_band_print_func_enum func_name,
+ nras_band_print_check_point_enum check_point);
+
+void mrs_nras_get_context_nvram_nr_band(kal_uint8 *p_nr_band_mask, MRS_SIM_INDEX sim_index);
+
+void mrs_nras_set_context_nvram_nr_band(kal_uint8 *p_nr_band_mask, MRS_SIM_INDEX sim_index);
+
+void mrs_nras_get_context_nvram_endc_nr_band(kal_uint8 *p_endc_nr_band_mask, MRS_SIM_INDEX sim_index);
+
+void mrs_nras_set_context_nvram_endc_nr_band(kal_uint8 *p_endc_nr_band_mask, MRS_SIM_INDEX sim_index);
+
+/**
+ * @brief Function for retrieving NR band bit mask indicating the NR bands
+ * supported by the UE in EN-DC.
+ * @param[out] NR band bit mask with MAX_BYTE_NR_BAND_BITMASK bytes.
+ * @return -
+ */
+void mrs_nras_endc_nr_band_list_get(mrs_gemini_status_enum gemini_status,
+ MRS_SIM_INDEX sim_index,
+ kal_uint8 *nr_band);
+
+/**
+ * @brief Function for checking if NR band given is supported ENDC NR band by UE.
+ * @param[in] gemini_status Gemini status.
+ * @param[in] SIM index
+ * @param[in] NR band
+ * @return KAL_TRUE if the NR band given in input is supported ENDC NR band by UE.
+ * @return KAL_FALSE if the NR band given in input is not supported ENDC NR band by UE.
+ */
+
+kal_bool mrs_nras_is_supported_endc_nr_band(mrs_gemini_status_enum gemini_status,
+ MRS_SIM_INDEX sim_index,
+ kal_uint16 nr_band);
+
+/**
+ * @brief Function to get SA NR band bitmask is supported by PLMN.
+ * @param[in] SIM index
+ * @param[out] support band bitmask
+ * @param[in] PLMN id list
+ * @param[in] Trace print is shown or not
+ */
+void mrs_nras_sa_nr_band_bitmask_get_by_plmn(
+ MRS_SIM_INDEX sim_index,
+ kal_uint8 *p_nr_band_bitmask,
+ const mrs_plmn_id_list *p_plmn_id_list,
+ kal_bool show_trace);
+
+/**
+ * @brief Function to get ENDC NR band bitmask is supported by PLMN.
+ * @param[in] gemini_status Gemini status.
+ * @param[in] SIM index
+ * @param[out] support band bitmask
+ * @param[in] PLMN id list
+ * @param[in] Trace print is shown or not
+ */
+void mrs_nras_endc_nr_band_bitmask_get_by_plmn(
+ mrs_gemini_status_enum gemini_status,
+ MRS_SIM_INDEX sim_index,
+ kal_uint8 *p_nr_band_bitmask,
+ const mrs_plmn_id_list *p_plmn_id_list,
+ kal_bool show_trace);
+
+#ifdef __NVM_GLOBAL_CABC__
+/**
+ * @brief check if SA NR band given is supported by PLMN.
+ * @param[in] NR band
+ * @param[in] SIM index
+ * @param[in] PLMN id list
+ * @param[in] Trace print is shown or not
+ * @return KAL_TRUE if the NR band given in input is supported by PLMN.
+ * @return KAL_FALSE if the NR band given in input is not supported by PLMN.
+ */
+kal_bool mrs_nras_is_supported_sa_nr_band_plmn(
+ kal_uint16 nr_band,
+ MRS_SIM_INDEX sim_index,
+ const mrs_plmn_id_list *p_plmn_id_list,
+ kal_bool show_trace);
+
+/**
+ * @brief check if ENDC NR band given is supported by PLMN.
+ * @param[in] gemini status
+ * @param[in] NR band
+ * @param[in] SIM index
+ * @param[in] PLMN id list
+ * @param[in] Trace print is shown or not
+ * @return KAL_TRUE if the NR band given in input is supported by PLMN.
+ * @return KAL_FALSE if the NR band given in input is not supported by PLMN.
+ */
+kal_bool mrs_nras_is_supported_endc_nr_band_plmn(
+ mrs_gemini_status_enum gemini_status,
+ kal_uint16 nr_band,
+ MRS_SIM_INDEX sim_index,
+ const mrs_plmn_id_list *p_plmn_id_list,
+ kal_bool show_trace);
+#endif /* __NVM_GLOBAL_CABC__ */
+
+/**
+ * @brief Function for reading EUTRA band list from FreqBandList
+ * @param[in] Encoded FreqBandList IE as specified in TS 38.331
+ * @param[out] EUTRA band list
+ * @return N/A
+ */
+void mrs_nras_freq_band_list_eutra_bands_retrieve(
+ const mrs_nras_octet_string_struct freqbandlist_ie,
+ nras_eutra_band_list_struct *p_eutra_band_list);
+
+void mrs_nras_set_radio_capability_for_ng_ran_changed(
+ MRS_SIM_INDEX sim_index, kal_bool value);
+
+kal_bool mrs_nras_get_radio_capability_for_ng_ran_changed(
+ MRS_SIM_INDEX sim_index);
+
+kal_bool mrs_nras_band_setting_update_by_plmn(function_caller_id_enum caller_id,
+ MRS_SIM_INDEX sim_index, mrs_plmn_id_list* p_plmn, mrs_ehplmn_id_list* p_ehplmn);
+
+mrs_nr_band_disable_by_plmn_state_enum mrs_nras_get_band_disable_by_plmn_state(MRS_SIM_INDEX sim_index);
+
+function_caller_id_enum mrs_nras_get_band_disable_last_caller_id(MRS_SIM_INDEX sim_index);
+
+/**
+ * @brief Checks if EN-DC band combination is supported with given LTE/NR bands.
+ * @param[in] sim_index SIM index
+ * @param[in] lte_band LTE band
+ * @param[in] p_nr_band Pointer to NR band, if NULL, any NR band is OK for EN-DC band combination check
+ * @param[in] p_plmn_id_list PLMN Id List is used for band filtering or customization
+ * @param[in] gemini_status Gemini status.
+ * @return TRUE if EN-DC band combination found, otherwise FALSE.
+ */
+kal_bool mrs_nras_is_endc_comb_supported_band(
+ kal_uint8 sim_index,
+ kal_uint16 lte_band,
+ kal_uint16* p_nr_band,
+ const mrs_plmn_id_list *p_plmn_id_list,
+ mrs_gemini_status_enum gemini_status);
+
+/**
+ * @brief Function for reading Gemini status
+ * @param[in] SIM index
+ * @return Gemini status
+ */
+mrs_gemini_status_enum mrs_nras_get_gemini_status(MRS_SIM_INDEX sim_idx);
+
+/* EN-DC equivalents for some API functions that check for band support */
+kal_uint8 mrs_nras_is_supported_endc_dl_nrarfcn_on_any_band(kal_uint16 *band,
+ NRARFCN nr_dl_arfcn, MRS_SIM_INDEX sim_index);
+kal_uint8 mrs_nras_is_supported_endc_and_nr_only_dl_nrarfcn_on_any_band(kal_uint16 *band,
+ NRARFCN nr_dl_arfcn, MRS_SIM_INDEX sim_index);
+kal_bool mrs_nras_is_supported_endc_dl_nrarfcn(NRARFCN nr_dl_arfcn, kal_uint16 band,
+ MRS_SIM_INDEX sim_index);
+kal_bool mrs_nras_is_supported_endc_dl_nrarfcn_partial_band(
+ const mrs_plmn_id *p_mrs_plmn_id, NRARFCN nr_dl_arfcn, kal_uint16 band,
+ MRS_SIM_INDEX sim_index);
+kal_bool mrs_nras_is_supported_endc_ul_nrarfcn(NRARFCN nr_dl_arfcn, kal_uint16 band,
+ MRS_SIM_INDEX sim_index);
+
+/**
+ * @brief Requests MRS to inform NL1 about possible need to modify NR band
+ * bandwidth according to the PLMN.
+ * @param[in] GEMINI status
+ * @param[in] PLMN ID
+ * @param[in] SIM index
+ * @return N/A
+ */
+void mrs_nras_modify_nr_bw(
+ mrs_gemini_status_enum gemini_status, mrs_plmn_id plmn_id,
+ MRS_SIM_INDEX sim_index);
+
+
+/**
+ * @brief Checks if NL1_CAP is not building band combinations and can return the band combinations immediately when mrs_nras_is_endc_comb_supported_band is called
+ * @param[in] sim_index SIM index
+ * @return TRUE if NL1_CAP is ready and not building band combinations
+ */
+kal_bool mrs_nras_is_nl1_band_combination_ready(MRS_SIM_INDEX sim_index);
+
+/**
+ * @brief When NL1_CAP start/finish building capability, it will update the status.
+ * @param[in] sim_index SIM index
+ * @param[in] nl1_cap_build_done NL1_CAP status
+ * @return N/A
+ */
+void mrs_nras_nl1_cap_status_update(MRS_SIM_INDEX sim_index, kal_bool nl1_cap_build_done);
+
+kal_bool mrs_nras_is_matched_from_nr_partial_band_table(const mrs_plmn_id *p_mrs_plmn_id, MRS_SIM_INDEX sim_index, kal_uint16 band,
+ mrs_nras_partial_freq_range_list_struct *p_freq_range_list);
+
+/**
+ * @brief Check whether UE supports extended band n77 in USA
+ * @param[in] p_plmn_id_list PLMN id list
+ * @param[in] sim_idx SIM index
+ * @return kal_bool If extended n77 in USA supported, KAL_TRUE will be returned
+ */
+kal_bool mrs_nras_extendedBand_n77_supported(const mrs_plmn_id_list* p_plmn_id_list, MRS_SIM_INDEX sim_idx);
+
+#endif /* MRS_NRAS_CAPABILITY_H */
+
diff --git a/mcu/protocol/interface/general/mrs_nras_search.h b/mcu/protocol/interface/general/mrs_nras_search.h
new file mode 100644
index 0000000..f8266d6
--- /dev/null
+++ b/mcu/protocol/interface/general/mrs_nras_search.h
@@ -0,0 +1,99 @@
+#ifndef _MRS_NRAS_SEARCH_H
+#define _MRS_NRAS_SEARCH_H
+
+#include "mrs_common_capability.h"
+#include "mrs_common_search.h"
+#include "mrs_as_struct.h"
+#include "mcc_recog_train_data.h"
+#ifdef UNIT_TEST
+#include "mcc_recog_test_data.h"
+#endif /* UNIT_TEST */
+
+#define MRS_NRAS_MCC_RECOG_MAX_SUBBAND_NUM 64
+
+typedef struct
+{
+ kal_uint32 min_gscn;
+ kal_uint32 max_gscn;
+ kal_uint8 step_size;
+} nr_gscn_range_struct;
+
+typedef struct
+{
+ kal_uint32 begin;
+ kal_uint32 end;
+} nr_freq_range_struct;
+
+typedef struct nras_mcc_recog_mcc_list {
+ kal_uint8 mcc_num;
+ mrs_mcc_id mcc[MCC_RECOG_NR_MAX_MCC_LEN];
+} mrs_nras_mcc_recog_mcc_list_struct;
+
+typedef struct
+{
+ nr_freq_range_struct freq_range;
+ kal_int16 rssi; // qdbm = dbm * 4
+} mrs_nras_subband_rssi_struct;
+
+typedef struct
+{
+ kal_uint16 band;
+ kal_uint8 subband_num; // The number of subbands to report.
+ mrs_nras_subband_rssi_struct subband_rssi[MRS_NRAS_MCC_RECOG_MAX_SUBBAND_NUM];
+} mrs_nras_band_rssi_distribution_struct;
+
+typedef struct
+{
+ kal_uint16 band_num;
+ mrs_nras_band_rssi_distribution_struct band[MCC_RECOG_NR_BAND_NUM];
+} mrs_nras_rssi_distribution_struct;
+
+extern mrs_nras_mcc_recog_mcc_list_struct nr_mcc_list;
+
+void mrs_get_predict_nrarfcn_table_by_band(kal_uint32 nr_band, mrs_freq_table_struct *nrarfcn_table);
+kal_uint32 mrs_nras_gscn_to_nrarfcn(kal_uint32 gscn);
+
+kal_uint16 mrs_nras_get_predict_freq_list_by_band(
+ MRS_SIM_INDEX sim_index,
+ const kal_uint32 band_list_num,
+ const kal_uint16 *band_list,
+ const NRARFCN *skip_freq_list,
+ const kal_uint16 skip_freq_list_num,
+ NRARFCN *predict_freq_list // kal_uint32 array[64]
+);
+
+kal_uint16 mrs_nras_get_predict_freq_list_by_plmn(
+ MRS_SIM_INDEX sim_index,
+ const mrs_plmn_id_list *plmn_list,
+ const NRARFCN *skip_freq_list,
+ const kal_uint16 skip_freq_list_num,
+ NRARFCN *predict_freq_list);
+
+void mrs_get_predict_nrarfcn_table_by_band(kal_uint32 nr_band, mrs_freq_table_struct *nrarfcn_table);
+kal_uint32 mrs_nras_gscn_to_nrarfcn(kal_uint32 gscn);
+
+void mrs_nras_plmn_id_to_mrs_plmn_id(const plmn_id_struct *src, mrs_plmn_id *dst);
+
+kal_uint16 mrs_nras_get_predict_freq_list_by_band(
+ MRS_SIM_INDEX sim_index,
+ const kal_uint32 band_list_num,
+ const kal_uint16 *band_list,
+ const NRARFCN *skip_freq_list,
+ const kal_uint16 skip_freq_list_num,
+ NRARFCN *predict_freq_list // kal_uint32 array[64]
+);
+kal_uint16 mrs_nras_get_predict_freq_list_by_plmn(
+ MRS_SIM_INDEX sim_index,
+ const mrs_plmn_id_list *plmn_list,
+ const NRARFCN *skip_freq_list,
+ const kal_uint16 skip_freq_list_num,
+ NRARFCN *predict_freq_list);
+
+double mrs_nras_mcc_recog_centered_cosine_distance(const kal_int16 *data1, const kal_int16 *data2, kal_uint32 data_len);
+kal_bool mrs_nras_mcc_recog_is_remarkable_band(kal_uint16 band);
+mrs_nras_mcc_recog_mcc_list_struct mrs_nras_mcc_recog_get_mcc(mrs_nras_rssi_distribution_struct *rssi_distribution);
+mrs_nras_mcc_recog_mcc_list_struct mrs_nras_mcc_recog_get_latest_mcc();
+#ifdef UNIT_TEST
+void mrs_nras_mcc_recog_regression();
+#endif /* UNIT_TEST */
+#endif
diff --git a/mcu/protocol/interface/general/mrs_uas_capability.h b/mcu/protocol/interface/general/mrs_uas_capability.h
new file mode 100644
index 0000000..5048c2d
--- /dev/null
+++ b/mcu/protocol/interface/general/mrs_uas_capability.h
@@ -0,0 +1,225 @@
+/******************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*******************************************************************************/
+
+/******************************************************************************
+ * Filename:
+ * --------------------------------------------------------
+ * mrs_uas_capability.h
+ *
+ * Project:
+ * --------------------------------------------------------
+ * Multimode
+ *
+ * Description:
+ * --------------------------------------------------------
+ * The UAS capability stored in MRS context.
+ *
+ * Author:
+ * --------------------------------------------------------
+ * -------
+ *
+ * --------------------------------------------------------
+ * $Log$
+ *
+ * 06 11 2020 vend_mtb_aritha002
+ * [MOLY00519500] ???????19165??864039041106553????????????
+ *
+ * NR15.R3.MP
+ *
+ * 12 09 2019 vend_mtb_aritha002
+ * [MOLY00458503] [CODE SYNC][MH4P-POS] patch request about ALPS04309026
+ *
+ * Band Configuration to VMOLY
+ *
+ * 12 06 2018 yenchih.yang
+ * [MOLY00371156] [VMOLY] NRRC-SEARCH check-in.
+ * Fill physical frequency range during Power Scan.
+ *
+ * 04 18 2018 ashik.tj
+ * [MOLY00321080] ?????ALPS03474129 ???????patch--????P40 android o??
+ *
+ * 01 22 2018 muneeswaraiah.dama
+ * [MOLY00302897] [CODE SYNC] AT command (+ESCELLINFO) to modem to query serving cell band and arfcn info, when needed.
+ * .
+ *
+ * 10 14 2016 wenlong.an
+ * [MOLY00153524] [6291] Vivo BlackList feature
+ * .vivo black list sync to umolya
+ *
+ * 06 01 2015 henry.lai
+ * [MOLY00092508] [MT6291][LTE-C2K] AS Inter RAT feature
+ * .
+ *
+ * 12 16 2014 ethan.han
+ * [MOLY00087858] [RRCE] Universal Bin Modification
+ * MRS.
+ *
+ * 12 16 2014 jiajia.luo
+ * [MOLY00087491] [UMOLY][TDD][UAS][SLCE/RRCE]sync U-Bin CBr to UMOLY TRUNCK.
+ * .
+ * mrs_uas_capability (TDD RRCE part)
+ *
+ * 11 17 2014 yuhhwang.yu
+ * [MOLY00084676] [CISE] Sync CSCE/CSE from 6291_DEV to UMOLY
+ * .
+ *
+ * 01 21 2014 wcpuser_integrator
+ * [MOLY00054475] SGLTE option rename
+ * .
+ *
+ * 11 13 2013 birui.li
+ * [MOLY00046027] [MT6290E1][MMDS_DC] MMDC feature patch back to MOLY trunk
+ * B3/B39.
+ *
+ * 11 12 2013 morton.lin
+ * [MOLY00045967] [Gemini] Add SIM index in INTER RAT HANDOVER INFO set/get function
+ * SIM index argument added in MRS INTER RAT HANDOVER INFO set/get function
+ *
+ * 10 21 2013 vend_yuhhwang.yu
+ * [MOLY00040050] [MultiMode] Dynamic band selection
+ * .
+ *
+ * 03 14 2013 morton.lin
+ * [MOLY00011957] [MT6290][3G][RRCE] Multimode IT CBr merge back to MOLY
+ * MRS UAS Capability header
+ *
+ * 01 22 2013 david.niu
+ * [MOLY00009205] [MRS] Code checked-in for MOLY branch
+ * .
+ *
+ *****************************************************************************/
+
+#ifndef _MRS_UAS_CAPABILITY_H
+#define _MRS_UAS_CAPABILITY_H
+
+/* COMMON INCLUDES ***********************************************************/
+#include "irat_common_enums.h"
+#include "mrs_as_enums.h"
+#include "mrs_as_inter_core_enum.h"
+#include "mrs_as_struct.h"
+
+/*****************************************************************************
+ * Macros Without Parameters
+ *****************************************************************************/
+
+
+/*****************************************************************************
+ * Macros With Parameters
+ *****************************************************************************/
+
+
+/*****************************************************************************
+ * Enums without tags
+ *****************************************************************************/
+
+
+
+/*****************************************************************************
+ * Type Definitions
+ *****************************************************************************/
+typedef struct {
+ kal_uint32 length;
+ kal_uint8 value[MAX_LEN_UTRAN_HANDOVER_INFO_MSG];
+} ho_info_buf;
+
+typedef struct {
+ ho_info_buf fdd_iRATHOInfo_GSM;
+ ho_info_buf fdd_iRATHOInfoCompact_GSM;
+ ho_info_buf fdd_iRATHOInfo_EUTRA;
+ ho_info_buf tdd_iRATHOInfo_GSM;
+ ho_info_buf tdd_iRATHOInfoCompact_GSM;
+ ho_info_buf tdd_iRATHOInfo_EUTRA;
+
+ kal_uint16 fdd_uea;
+ kal_uint16 fdd_uia;
+ kal_uint16 tdd_uea;
+ kal_uint16 tdd_uia;
+ kal_uint32 fdd_umts_supported_band;
+
+} uas_capability_context_struct;
+
+/*****************************************************************************
+ * Declarations Of Exported Globals
+ *****************************************************************************/
+
+
+/*****************************************************************************
+ * Function prototypes
+ *****************************************************************************/
+extern void mrs_uas_set_irat_ho_info(MRS_SIM_INDEX sim_index, module_type src_mod, kal_bool needToNotify);
+
+extern void TDD_mrs_uas_set_irat_ho_info(MRS_SIM_INDEX sim_index, module_type src_mod, kal_bool needToNotify);
+
+extern void mrs_uas_get_irat_ho_info(MRS_SIM_INDEX sim_index, kal_bool isGSM, kal_bool isCompact,
+ kal_uint32 *pSize, void *pCtrlBuf);
+
+extern void mrs_uas_read_nvram_cnf_handler(kal_uint16 nvram_file_id, kal_uint8* data, kal_uint16 len);
+
+extern void mrs_uas_get_uea_uia(MRS_SIM_INDEX sim_index, kal_uint16 *uea, kal_uint16 *uia);
+#ifdef __UMTS_FDD_MODE__
+extern mrs_utra_power_class_enum mrs_uas_get_FDD_powerclass();
+#endif
+#ifdef __UMTS_TDD128_MODE__
+extern mrs_utra_power_class_enum mrs_uas_get_TDD_powerclass();
+#endif
+
+extern void mrs_uas_band_setting_update(MRS_SIM_INDEX sim_index, kal_uint32* data);
+
+void mrs_tas_add_black_cell_list_notification(void);
+void mrs_tas_clear_black_cell_list_notification(void);
+void mrs_uas_add_black_cell_list_notification(void);
+void mrs_uas_clear_black_cell_list_notification(void);
+
+#ifdef __UMTS_R11__
+kal_uint16 mrs_uas_multi_band_conversion(MRS_SIM_INDEX sim_index,
+ kal_uint16 uarfcn,
+ kal_bool useRrcMFBIList,
+ kal_uint16 band_num,
+ kal_uint16 *band_list_ptr,
+ void *pMFBI);
+#endif
+
+kal_bool mrs_uas_retrieve_dl_uarfcn_band(MRS_SIM_INDEX sim_index, kal_uint16 dl_uarfcn, kal_uint8 *band_ptr);
+kal_bool mrs_uas_is_supported_FDD_band(MRS_SIM_INDEX sim_index, kal_uint16 umts_band);
+kal_bool mrs_uas_is_supported_TDD_band(MRS_SIM_INDEX sim_index, kal_uint16 umts_band);
+
+kal_bool mrs_uas_band_setting_update_by_plmn(MRS_SIM_INDEX sim_index, mrs_plmn_id cplmn);
+
+void mrs_uas_reset_uas_supported_band(MRS_SIM_INDEX sim_index);
+kal_bool mrs_is_band_capability_update_needed(MRS_SIM_INDEX sim_index, kal_uint8 bandID);
+void mrs_uas_reset_disabled_band_to_scsi_per_plmn(MRS_SIM_INDEX sim_index, kal_uint32 band);
+
+#endif /* _MRS_UAS_CAPABILITY_H */
+
diff --git a/mcu/protocol/interface/general/mrs_utility.h b/mcu/protocol/interface/general/mrs_utility.h
new file mode 100644
index 0000000..bc44eb2
--- /dev/null
+++ b/mcu/protocol/interface/general/mrs_utility.h
@@ -0,0 +1,897 @@
+/******************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*******************************************************************************/
+
+/******************************************************************************
+ * Filename:
+ * --------------------------------------------------------
+ * mrs_utility.h
+ *
+ * Project:
+ * --------------------------------------------------------
+ * Multimode
+ *
+ * Description:
+ * --------------------------------------------------------
+ * Declaration of funcitons of the utilities in MRS.
+ *
+ * Author:
+ * --------------------------------------------------------
+ * -------
+ *
+ * --------------------------------------------------------
+ * $Log$
+ *
+ * 01 28 2022 ot_krishna.charan
+ * [MOLY00685488] cloned from ALPS05677217 [B210622-876][?????]UE CSFB CALL MT???RR???????????????????????????
+ *
+ * 01 18 2022 tom.wu
+ * [MOLY00735828] SBP_MRS_AFR_TO_5G_CONTROL return error
+ *
+ * .
+ *
+ * 10 07 2020 tero.miettinen
+ * [MOLY00570382] [Gen97]Apply BW customization setting from NVRAM to report capability
+ * [MRS] Update in BW setting list handling.
+ *
+ * 10 07 2020 bo-yao.tsai
+ * [MOLY00565738] [MODEM][Assert] Assert fail: errc_cel_cscom.c 6572 - ERRC
+ * - Channel protection fixing
+ *
+ * 10 01 2020 tero.miettinen
+ * [MOLY00560032] ????SA???
+ * MRS - PLMN based 5G band disabling.
+ *
+ * 09 22 2020 vend_mtb_aritha031
+ * [MOLY00561862] [Gen97][MP7][VzW][AFR] feature check-in, (check-in approved: item_344)
+ *
+ * 09 22 2020 vend_mtb_aritha031
+ * [MOLY00561862] [Gen97][MP7][VzW][AFR] feature check-in, (check-in approved: item_344)
+ *
+ * 09 18 2020 vend_mtb_aritha031
+ * [MOLY00561862] [Gen97][MP7][VzW][AFR] feature check-in, (check-in approved: item_344)
+ *
+ * 09 18 2020 tom.wu
+ * [MOLY00554348] [Colgin] cell measure and white cell lock feature development
+ *
+ * .
+ *
+ * 06 29 2020 vend_mtb_aritha002
+ * [MOLY00536615] [MCF] user flow enhancement
+ *
+ * .
+ *
+ * 06 12 2020 vend_mtb_mobiveil015
+ * [MOLY00528344] [URGENT][SSI][MT6885][Petrus][Q0][MP2][AT&T][10776v20_1][R3MP][PTN][simulation][inhouse][RnS][ATTACH/RESTART][LTE-BTR-1-8220]Test case failed due to ## LTE ## RRCConnectionRequest TimeOut
+ *
+ * [MOLY00535086] ?DM?34G??
+ *
+ * .
+ *
+ * 04 04 2020 farming.tseng
+ * [MOLY00509534] [MT6875][Margaux][Q0][MP3][SQC]][Internal][China][Shenzhen][MDST][SWIFT][CU+CT][ErrorTimes:1][ASSERT] file:mcu/l1/nl1/internal/md97/src/rx/nr_rx_scheduler_rtb.c line:6045
+ *
+ * .
+ *
+ * 03 24 2020 farming.tseng
+ * [MOLY00506815] [MT6875][Margaux][Q0][SQC][MP3][Gemini][N+L][NTC_SA_Gemini_0022]Margaux doesn't support SA+L DSDA.
+ *
+ * 01 06 2020 harish.reddy
+ * [MOLY00469528] [Gen97][VMOLY][SA][hVolte] hVolte revise for SA
+ *
+ * 12 09 2019 kun-lin.wu
+ * [MOLY00464345] [Gen97] Gemini MP2/MP3 features phase-in
+ *
+ * 12 09 2019 jutta.liuska
+ * [MOLY00448654] [6297][NRRC] Implementation for VoNR capabilities and enhancements
+ * [MRS] VoNR enhancements
+ *
+ * 12 09 2019 elle.sun
+ * [MOLY00464443] [ERRC][MRS][NL1MOB] move operator table to mrs
+ *
+ * [ERRC/MRS] move oprator table.
+ *
+ * 12 09 2019 vend_mtb_aritha002
+ * [MOLY00458503] [CODE SYNC][MH4P-POS] patch request about ALPS04309026
+ *
+ * Band Configuration to VMOLY
+ *
+ * 12 02 2019 vinayak.bandagi
+ * [MOLY00459945] [Gen97][AFR][RDIT] NAS-SV reset MRS AFR CNTX
+ *
+ * 10 14 2019 prime.xiao
+ * [MOLY00447831] [Rose][Petrus]BSP+][Q0]The ECC call calling 3 mintues and not connected.
+ *
+ * .
+ *
+ * 09 26 2019 kun-lin.wu
+ * [MOLY00443062] [Gemini] SA+L DR-DSDS/DSDA
+ *
+ * 07 18 2019 emily.lu
+ * [MOLY00422928] [Gen97 Patch back][ERRC_CEL] Code Sync to VMOLY
+ *
+ * .merge CL#7709556 (MRS)
+ *
+ * 07 01 2019 jiawei.he
+ * [MOLY00415509] [CODE SYNC][VMOLY][MOLY00370411][MOLY00377605][MOLY00394234][MOLY00397043][MOLY00398281]eCSFB related patch-back from Gen93
+ *
+ * .
+ *
+ * 05 30 2019 kun-lin.wu
+ * [MOLY00402003] [VMOLY] GEMINI N+L DSDS
+ *
+ * 04 30 2019 muneeswaraiah.dama
+ * [MOLY00402590] [Gen97] reset AFR target rat and ongoing status by service
+ * .
+ *
+ * 04 17 2019 puneet.t
+ * [MOLY00399390] [CODE SYNC] [VMOLY][Eiger RD IT][GEMINI & AFR]LAU request has been rejected with cause AS_IN_SUSPEND_MODE and it never camped on 2G.
+ *
+ * GEMINI RDIT code changes in VMOLY TRUNK
+ *
+ * 04 16 2019 otto.liu
+ * [MOLY00399190] [GEN97] GEN95 to GEN97 sync patch
+ *
+ * .
+ *
+ * 02 18 2019 muneeswaraiah.dama
+ * [MOLY00384995] [VMOLY] GEMINI 3.0, AFR, Unify Frequency scan, BGSEARCH
+ * .
+ *
+ * 10 03 2018 muneeswaraiah.dama
+ * [MOLY00356286] [Gen97] background search feature
+ * .
+ *
+ * 05 25 2018 otto.liu
+ * [MOLY00325228] [UMOLYE] Remove NVRAM group header file
+ *
+ * .
+ *
+ * 05 09 2018 amit.sharma
+ * [MOLY00325096] [Gen95][GAS]FAST_IRCR and LG+WG CMCC feature change for I-RAT RESEL to be merged and replaced by STORED SI.
+ * .
+ *
+ * 04 18 2018 morton.lin
+ * [MOLY00320662] [Gen93][P40][UMOLYE] Gionee blacklist feature - MRS
+ * [MRS] Gionee Blacklist feature phase-in
+ *
+ * 01 23 2018 muneeswaraiah.dama
+ * [MOLY00302582] [Gen93][Huawei][CHR] Index 8, Index 9 - header/ interface files
+ * .
+ *
+ * 10 31 2017 amit.sharma
+ * [MOLY00285547] [P170518-04585]airplane mode search network times fail
+ * .
+ *
+ * 07 06 2017 morton.lin
+ * [MOLY00261305] [Gen93] B71 development
+ * MRS and NVRAM phase in
+ *
+ * 04 26 2017 rujing.zhao
+ * [MOLY00243767] [TDD GAS]RACH fail bar cell feature patch back UMOLYA
+ * .
+ *
+ * 04 25 2017 mu.ding
+ * [MOLY00244356] [6293][Gemini][T+W] Phase 2: T+W Changes Check in
+ *
+ * .
+ *
+ * 11 10 2016 vend_mtb_aricent_05
+ * [MOLY00212319] [MT6293] Channel Lock feature porting and enhancement -MRS
+ *
+ * .
+ *
+ * 10 24 2016 menghau.wu
+ * [MOLY00208768] [MT6293] [B66] Band66 porting (ERRC part)
+ * complement of CL 3008555
+ *
+ * 06 24 2016 cookie.chen
+ * [MOLY00185901] UMOLYA errc relevant latest code sync from UMOLY
+ * .
+ *
+ * 12 10 2015 tim.huang
+ * [MOLY00150157] VZ_REQ_LTEDATA_38498 (MT6291 Verizon Jun-2015 baseline)
+ * .
+ *
+ * 10 07 2015 titi.wu
+ * [MOLY00141786] [MT6755][SRLTE][L+C] Support connectivity of C2K on dual SIM
+ * .
+ *
+ * 09 18 2015 ming.lee
+ * [MOLY00140707] [GAS][PLMN search enhancement II] Search info reuse
+ * .
+ *
+ * 08 06 2015 claud.li
+ * [MOLY00125612] [PS1][91plus] core change modification
+ * 1. from l1core_is_test_sim to is_test_sim.
+ * 2. from l1core_query_ps_sim_type to sim_query_type
+ * 3. remove shared variable "l1core_sim_type_info" and "l1core_is_test_sim_info_ready"
+ * 4. remove mrs_update_l1core_SIM_type
+ * 5. from l1core_is_ps_conf_xta_mode() to is_ps_conf_test_xta_mode()
+ * 6. from l1core_query_ps_conf_test_mode() to query_ps_conf_test_mode()
+ * 7. from l1core_query_ps_conf_test_profile_setting() to query_ps_conf_test_profile_setting()
+ * 8. remove shared variable: "l1core_ps_conf_test_xta_mode", "l1core_is_test_mode_info_ready", "l1core_ps_conf_test_profile_setting", "l1core_ps_conf_test_mode"
+ * 9. remove mrs_update_l1core_test_mode()
+ * 10. remove l1core_is_mmdc_mode()
+ *
+ * 08 06 2015 claud.li
+ * [MOLY00125612] [PS1][91plus] core change modification
+ * 1. remove l1core_is_vsim() : could use L4/sim's API: is_vsim_on()
+ * 2. remove l1core_test_mode_consider_sim() : could use L4/sim's API: test_mode_consider_sim()
+ *
+ * 07 14 2015 bruce.li
+ * [MOLY00128246] [eCSFB]LU Reduction Enhancement
+ * Implemented 2 enhancements:
+ * 1. If there is successful call on the black cell, add it to bleach list;
+ * the priority order is: white list > bleach list > gray list > black list;
+ * 2. If the decoded BSIC of white cell or bleach cell does not match the stored,
+ * add it to retry list; the retry list would be tried after white list and
+ * bleach list have been done.
+ *
+ * 06 21 2015 alan.peng
+ * [MOLY00122048] [6795] Request new feature to improve registration time of roaming case
+ * _MRS part.
+ *
+ * 05 29 2015 shin.chen
+ * [MOLY00115617] [6291] Dynamic SIM switch without modem reset
+ * .
+ *
+ * 05 14 2015 henry.lai
+ * [MOLY00113630] [MT6291] Add IS_TEST_SIM and IS_VSIM for l1core
+ * .
+ *
+ * 04 20 2015 shin.chen
+ * [MOLY00087882] [Universal Bin] MRS general developement
+ * .Remove tabs
+ *
+ * 02 16 2015 doug.shih
+ * [MOLY00091463] [MT6291] ERRC RCM/MRS development
+ * MOLY CR Code Sync to UMOLY (OA domain):
+ * [MOLY00079131] AT&T requirement connection reject
+ * [MOLY00083427] [ERRC][MOB] UMTS proximity indication
+ * [MOLY00084324] [ROHC] Modem load with configurable compile options: profile support and context number
+ * [MOLY00084416] [eCSFB]LU Reduction feature
+ * [MOLY00091967] Merge C2K IRAT code (CT specific UE cap SBP setting).
+ *
+ * 01 20 2015 henry.lai
+ * [MOLY00087668] [MT6291][UBIN] Check in ERRC/CEL modifications
+ * .
+ *
+ * 12 15 2014 henry.lai
+ * [MOLY00087668] [MT6291][UBIN] Check in ERRC/CEL modifications
+ * .
+ *
+ * 11 17 2014 shin.chen
+ * [MOLY00081154] [ATT_TMO_DEV] AT&T requirement merge back
+ * .
+ *
+ * 11 14 2014 henry.lai
+ * [MOLY00079072] [MT6291] Change EARFCN from kal_uint16 to kal_uint32 for CEL part
+ * .
+ *
+ * 11 12 2014 cooper.lin
+ * [MOLY00068710] [MT6291_DEV] Sync MOLY to MT6291_DEV
+ * Merge MT6291_DEV code to UMOLY trunk.
+ *
+ * 11 12 2014 henry.lai
+ * [MOLY00079071] [MT6291][U4G] Low Power Modification for CEL Paging
+ * .
+ *
+ * 05 23 2014 adeline.chang
+ * [MOLY00066214] [SBP] 4G background search
+ * .
+ *
+ * 10 29 2013 adeline.chang
+ * [MOLY00042471] [MT6290] CSFB_enhancements inject message extension
+ * .
+ *
+ * 10 21 2013 adeline.chang
+ * [MOLY00042471] [MT6290] CSFB_enhancements inject message extension
+ * .
+ *
+ * 10 18 2013 peng.pan
+ * [MOLY00041595] [MT6290E1][MMDS_DC] MMDC feature patch back to MOLY trunk
+ * MRS support MMDC.
+ *
+ * 08 30 2013 adeline.chang
+ * [MOLY00030187] [MT6290] CSFB Enhancement Implementation for Autonomous Fast Return
+ * [MT6290] CSFB Enhancement Implementation for Autonomous Fast Return - add new MRS API.
+ *
+ * 08 26 2013 adeline.chang
+ * [MOLY00030187] [MT6290] CSFB Enhancement Implementation for Autonomous Fast Return
+ * [MT6290] CSFB Enhancement Implementation for Autonomous Fast Return - add SIM index.
+ *
+ * 07 17 2013 adeline.chang
+ * [MOLY00030187] [MT6290] CSFB Enhancement Implementation for Autonomous Fast Return
+ * .
+ *
+ * 07 17 2013 adeline.chang
+ * [MOLY00030187] [MT6290] CSFB Enhancement Implementation for Autonomous Fast Return
+ * .
+ *
+ * 03 18 2013 justin.li
+ * [MOLY00009222] [GAS][Multi-Mode Development] Merge GAS multi-mode development to MOLY
+ * .
+ *
+ * 02 05 2013 yenchih.yang
+ * [MOLY00009186] [SIBE/USIME/DBME] Multi-Mode CBr merge to MOLY
+ * .
+ *
+ * 01 22 2013 david.niu
+ * [MOLY00009205] [MRS] Code checked-in for MOLY branch
+ * .
+ *
+ *****************************************************************************/
+
+#ifndef _MRS_UTILITY_H
+#define _MRS_UTILITY_H
+
+#include "mrs_as_enums.h"
+#include "mrs_as_struct.h"
+#include "nvram_editor_data_item.h"
+#include "kal_general_types.h"
+#include "ps_em_enum.h"
+#include "sim_common_enums.h"
+#include "global_type.h"
+#include "bitstream.h"
+#include "mrs_as_inter_core_struct.h"
+#include "errc_nvram_editor.h"
+#include "asband_nvram_editor.h"
+#include "ps_inter_core_public.h"
+
+#ifdef __CHR_AB_INFO__
+#include "nbr_public_struct.h"
+#endif /* __CHR_AB_INFO__ */
+
+
+/* GLOBAL VARIABLE DECLARATIONS *********************************************/
+#ifdef UNIT_TEST
+extern kal_bool modis_IT_mode;
+#endif
+
+/* Type Definitions */
+
+#define MD3_INVALID 0x00
+#define SIM1_MD3_VALID 0x01
+#define SIM2_MD3_VALID 0x02
+#define SIM3_MD3_VALID 0x04
+#define SIM4_MD3_VALID 0x08
+#define INVALID_PS_IDX 0xFF
+
+#define SBP_DATA_AFR_TO_4G_FOLLOW_NVRAM 0x01
+#define SBP_DATA_AFR_TO_4G_ENFORCE_ON 0x02
+#define SBP_DATA_AFR_TO_4G_ENFORCE_OFF 0x04
+
+#define SBP_DATA_AFR_TO_5G_FOLLOW_NVRAM 0x01
+#define SBP_DATA_AFR_TO_5G_ENFORCE_ON 0x02
+#define SBP_DATA_AFR_TO_5G_ENFORCE_OFF 0x04
+
+/* PUBLIC FUNCTION PROTOTYPES ***********************************************/
+extern void mrs_send_msg(kal_uint32 dest_mod_id, sap_type sap_id, msg_type msg_id, local_para_struct *local_para_ptr, peer_buff_struct *peer_buff_ptr);
+
+#if defined(__3G_CSG_SUPPORT__) || defined(__LTE_RAT__)
+extern void NPSI_newAcsglFromUSIM(MRS_SIM_INDEX sim_index, kal_uint8 acsglRecNum, kal_uint16 acsglSizePerRec
+ , kal_uint8* acsglData, csg_white_list_update_cause update_cause, kal_bool is_valid);
+
+extern void NPSI_newOcsglFromUSIM(MRS_SIM_INDEX sim_index, kal_uint8 ocsglRecNum, kal_uint16 ocsgalSizePerRec
+ , kal_uint8* ocsglData, csg_white_list_update_cause update_cause, kal_bool is_valid);
+
+extern white_list_update_type NPSI_updateCsgWhiteList(MRS_SIM_INDEX sim_index,
+ MRS_RAT_MODE_TYPE rat,
+ csg_update_type_enum csg_update_type,
+ mrs_plmn_id* plmn_id,
+ kal_uint32 csg_id);
+
+extern kal_uint8* NPSI_getEncodedAllowedCsgList(MRS_SIM_INDEX sim_index,
+ kal_uint8* recNum,
+ kal_uint16 *sizePerRec);
+
+extern void NPSI_deleteCSGList(MRS_SIM_INDEX sim_index);
+
+extern kal_uint8 NPSI_getValidCsgPlmn(MRS_SIM_INDEX sim_index,
+ mrs_plmn_id** plmns);
+
+extern csg_type_enum NPSI_checkCsgType(MRS_SIM_INDEX sim_index,
+ mrs_plmn_id *plmn_id,
+ kal_uint32 csg_id);
+
+kal_bool NPSI_isCsgListEmpty(MRS_SIM_INDEX sim_index);
+
+kal_uint16 NPSI_checkCsgNumberPerPlmn(MRS_SIM_INDEX sim_index, mrs_plmn_id *plmn_id);
+
+extern kal_bool mrs_write_next_csg_record_to_USIM(MRS_SIM_INDEX sim_index);
+
+extern void mrs_write_ue_based_csg_to_nvram(MRS_SIM_INDEX sim_index);
+
+
+extern kal_bool mrs_write_csg_to_USIM(MRS_SIM_INDEX sim_index);
+
+extern void mrs_read_ue_based_nv(MRS_SIM_INDEX sim_index);
+
+extern void mrs_csg_read_nvram_cnf_handler(kal_uint8* data, kal_uint16 len);
+
+
+#endif /* #if defined(__CSG_SUPPORT__) || defined(__LTE_RAT__) */
+
+extern kal_bool MRS_occupy_lla(MRS_SIM_INDEX sim_index,
+ MRS_RAT_MODE_TYPE rat,
+ MRS_OCCUPY_PROCEDURE procedure);
+
+extern void MRS_release_lla(MRS_SIM_INDEX sim_index,
+ MRS_RAT_MODE_TYPE rat);
+
+extern kal_bool MRS_test_occupy_lla(MRS_SIM_INDEX sim_index,
+ MRS_OCCUPY_PROCEDURE procedure);
+
+extern MRS_RAT_MODE_TYPE MRS_get_lla_occupy_rat(MRS_SIM_INDEX sim_index);
+
+extern MRS_SIM_INDEX mrs_get_current_sim_index(void);
+
+extern void mrs_afr_reset_afr_list(MRS_SIM_INDEX sim_index);
+
+extern void mrs_afr_insert_freq(MRS_SIM_INDEX sim_index, EARFCN earfcn);
+
+extern void mrs_afr_get_afr_list(MRS_SIM_INDEX sim_index, mrs_afr_main_struct *afr_list_ptr);
+
+void mrs_set_csfb_enhancement_status(MRS_SIM_INDEX sim_index, csfb_enhancement_enum enhancement_item, kal_bool activate);
+
+void mrs_set_csfb_enhancement_status_in_test_mode(MRS_SIM_INDEX sim_index, csfb_enhancement_enum enhancement_item, kal_bool activate);
+
+kal_bool mrs_get_csfb_enhancement_status(MRS_SIM_INDEX sim_index, csfb_enhancement_enum enhancement_item);
+
+extern void mrs_afr_set_csfb_status(MRS_SIM_INDEX sim_index, kal_bool csfb_ongoing);
+
+extern kal_bool mrs_afr_get_csfb_status(MRS_SIM_INDEX sim_index);
+
+extern void mrs_set_background_search_status_in_test_mode(MRS_SIM_INDEX sim_index, background_search_enum background_search_type, kal_bool activate);
+
+extern void mrs_set_latest_camp_on_rat(MRS_SIM_INDEX sim_index, MRS_RAT_MODE_TYPE rat);
+
+extern void mrs_clear_latest_camp_on_rat(MRS_SIM_INDEX sim_index, kal_uint32 rat_bmp);
+
+extern MRS_RAT_MODE_TYPE mrs_get_latest_camp_on_rat(MRS_SIM_INDEX sim_index, kal_uint32 rat_type_bitmask);
+
+extern kal_bool mrs_get_background_search_status(MRS_SIM_INDEX sim_index, background_search_enum background_search_type);
+
+extern void mrs_ecsfb_add_2g_association(MRS_SIM_INDEX sim_index, kal_uint32 eas_cell_id, mrs_gas_cell_inf_struct *p_gas_cell_inf);
+
+extern void mrs_ecsfb_set_2g_association_call_flag(MRS_SIM_INDEX sim_index, kal_uint32 eas_cell_id, mrs_gas_cell_inf_struct *p_gas_cell_inf);
+
+extern kal_uint8 mrs_ecsfb_get_2g_lai(MRS_SIM_INDEX sim_index, kal_uint32 eas_cell_id, mrs_gas_cell_inf_struct *p_gas_cell_inf);
+
+extern kal_uint8 mrs_ecsfb_get_same_lai_2g(MRS_SIM_INDEX sim_index, mrs_lai_struct *lai, kal_uint32 valid_duration, mrs_gas_cell_inf_struct *p_gas_cell);
+
+extern void mrs_ecsfb_reset_association_info(MRS_SIM_INDEX sim_index);
+
+extern void mrs_fast_roaming_set_mcc(MRS_SIM_INDEX sim_index, mrs_nas_mcc_struct *mrs_nas_mcc);
+
+extern void mrs_fast_roaming_get_mcc(MRS_SIM_INDEX sim_index, mrs_as_mcc_struct *mrs_as_mcc_ptr);
+/* used for setting and getting 4G cell id when CSFB to 2G by PLMN search scenario */
+extern void mrs_ecsfb_set_4g_cell_info(MRS_SIM_INDEX sim_index, kal_uint32 eas_cell_id);
+extern kal_uint32 mrs_ecsfb_get_4g_cell_info(MRS_SIM_INDEX sim_index);
+
+extern kal_uint8 mrs_ecsfb_get_cur_2g_cell_association(MRS_SIM_INDEX sim_index, kal_uint32 *eas_cell_id, mrs_gas_cell_inf_struct *gas_cell_inf);
+/* Fast mode switch. */
+extern void mrs_gas_fast_mode_switch_set_status(MRS_SIM_INDEX sim_index, mrs_gas_fast_mode_switch_status_enum status);
+extern kal_bool mrs_gas_fast_mode_switch_check_allowed(MRS_SIM_INDEX sim_index, const kal_uint32 num_plmn, plmn_id_struct* plmn_id_ptr);
+extern void mrs_gas_fast_mode_switch_set_plmn_id(MRS_SIM_INDEX sim_index, plmn_id_struct* plmn);
+extern void mrs_gas_fast_mode_switch_set_arfcn(MRS_SIM_INDEX sim_index, kal_uint16 arfcn);
+extern void mrs_gas_fast_mode_switch_set_bsic(MRS_SIM_INDEX sim_index, kal_uint8 bsic);
+extern kal_uint16 mrs_gas_fast_mode_switch_get_arfcn(MRS_SIM_INDEX sim_index);
+extern kal_uint8 mrs_gas_fast_mode_switch_get_bsic(MRS_SIM_INDEX sim_index);
+extern kal_uint8 mrs_gas_fast_mode_switch_get_si_bitmap(MRS_SIM_INDEX sim_index);
+extern kal_uint8* mrs_gas_fast_mode_switch_get_si_raw_data(MRS_SIM_INDEX sim_index, kal_uint8 si_type);
+extern void mrs_gas_fast_mode_switch_store_essential_si(MRS_SIM_INDEX sim_index, bit_stream* bit_stream_ptr, kal_uint8 si_bitmap_pos);
+extern void mrs_gas_fast_mode_switch_clean_stored_essential_si(MRS_SIM_INDEX sim_index, kal_uint8 si_bitmap_pos);
+/* Fast mode switch. */
+
+/* Support VzW: VZ_REQ_LTEDATA_38498 (MT6291 Verizon Jun-2015 baseline). */
+extern void mrs_nas_set_roaming_status(MRS_SIM_INDEX sim_index, kal_bool is_roaming);
+extern kal_bool mrs_nas_get_roaming_status(MRS_SIM_INDEX sim_index);
+/* Support VzW: VZ_REQ_LTEDATA_38498 (MT6291 Verizon Jun-2015 baseline). */
+
+//#ifdef __LTE_R11__
+void mrs_ltea_son_set_reest_proc_status(MRS_SIM_INDEX sim_index, kal_bool lte_reest_ir_search);
+void mrs_ltea_son_set_selected_cell(MRS_SIM_INDEX sim_index, kal_uint32 selected_arfcn, kal_uint16 selected_pci);
+void mrs_ltea_son_reset_selected_cell(MRS_SIM_INDEX sim_index);
+kal_bool mrs_ltea_son_get_selected_cell(MRS_SIM_INDEX sim_index, kal_uint32 *selected_arfcn_p, kal_uint16 *selected_pci_p);
+//#endif
+
+//L1 call back function
+extern kal_uint8 mrs_l1_query_ps_c2k_sim_config();
+
+/* Common TFO API functions for all RATs */
+void mrs_tfo_cell_list_clear(MRS_SIM_INDEX sim_index, MRS_RAT_MODE_TYPE rat_type);
+
+/* EAS specific TFO API functions */
+void mrs_tfo_cell_list_add_eas_cell(MRS_SIM_INDEX sim_index, EARFCN earfcn, kal_uint16 pci, kal_uint16 validity_time, kal_uint8 offset);
+kal_uint8 mrs_tfo_cell_list_eas_cell_offset_get(MRS_SIM_INDEX sim_index, EARFCN earfcn, kal_uint16 pci);
+
+#ifdef __CHANNEL_LOCK__
+/*******************************************************************************
+Description:
+ This function is used to write channel lock information to MRS.
+
+Parameters:
+ ch_lock_info: Pointer to channel lock information to be stored
+
+Return Value: None
+*******************************************************************************/
+kal_bool mrs_ch_lock_info_set( MRS_SIM_INDEX sim_index, const mrs_ch_lock_info_struct* p_ch_lock_info);
+
+/*******************************************************************************
+Description:
+ This function is used to read channel lock information from MRS.
+
+Parameters:
+ ch_lock_info: Pointer to where channel lock information shall be copied
+
+Return Value: None
+*******************************************************************************/
+void mrs_ch_lock_info_get( MRS_SIM_INDEX sim_index, mrs_ch_lock_info_struct* p_ch_lock_info );
+
+/*******************************************************************************
+Description:
+ This function is used to read channel lock state from MRS.
+
+Parameters: None
+
+Return Value: Channel lock state
+*******************************************************************************/
+MRS_CH_LOCK_STATE mrs_ch_lock_state_get(MRS_SIM_INDEX sim_index);
+
+/*******************************************************************************
+Description:
+ This function is used to read channel lock mode from MRS.
+
+Parameters: None
+
+Return Value: Channel lock mode
+*******************************************************************************/
+kal_uint8 mrs_ch_lock_mode_get(MRS_SIM_INDEX sim_index);
+
+
+#ifdef __WHITE_CELL_LOCK__
+/*******************************************************************************
+Description:
+ This function is used to write white cell lock information to MRS.
+
+Parameters:
+ ch_lock_info: Pointer to channel lock information to be stored
+
+Return Value: kal_bool
+*******************************************************************************/
+kal_bool mrs_wh_cell_lock_info_set(MRS_SIM_INDEX sim_index, const mrs_ch_lock_info_struct* p_ch_lock_info);
+
+/*******************************************************************************
+Description:
+ This function is used to read white cell lock state from MRS.
+
+Parameters: None
+
+Return Value: White cell lock state
+*******************************************************************************/
+kal_uint8 mrs_wh_cell_lock_state_get(MRS_SIM_INDEX sim_index);
+#endif /* __WHITE_CELL_LOCK__ */
+
+#endif /* __CHANNEL_LOCK */
+/*the following 2 mrs functions are provided for T + W feature*/
+extern void mrs_update_gas_system_mode(MRS_SIM_INDEX sim_index,kal_uint8 system_mode);
+
+#ifdef __GAS_STORED_SI_FEAT__
+void mrs_gas_update_gsm_storedSI_list(MRS_SIM_INDEX sim_index, rrm_gsm_storedSI_struct *gas_candidate_list);
+void mrs_gas_read_gsm_storedSI_list(MRS_SIM_INDEX sim_index, rrm_gsm_storedSI_struct *gas_candidate_list);
+#endif
+extern kal_uint8 mrs_get_gas_system_mode(MRS_SIM_INDEX sim_index);
+
+#ifdef __CHR_AB_INFO__
+//Huawei Index8 requirement: Inidication of reason for Not moving to 4G.
+
+/*******************************************************************************
+Description:
+ This function NAS is used to set nas reason for not moving to LTE.
+
+Parameters: sim_index
+
+Return Value: none
+*******************************************************************************/
+void mrs_set_nas_reason_not_moving_to_lte(MRS_SIM_INDEX sim_index, nas_reason_not_moving_to_lte_enum nas_reason);
+
+/*******************************************************************************
+Description:
+ This function AS is used to set as reason for not moving to LTE.
+
+Parameters: sim_index
+
+Return Value: none
+*******************************************************************************/
+void mrs_set_as_reason_not_moving_to_lte(MRS_SIM_INDEX sim_index, as_reason_not_moving_to_lte_enum as_reason);
+
+
+/*******************************************************************************
+Description:
+ This function L4C is used to get both nas and as reason for not moving to LTE.
+
+Parameters: sim_index
+
+Return Value: If returns KAL_TRUE mean as reason is valid and L4C has to indicate info to AP.
+ If return KAL_FALSE mean CSFB call is ongoing and L4C no need to idicate info to AP.
+ ps_reason: contains both NAS and AS reason for not moving LTE
+*******************************************************************************/
+kal_bool mrs_get_ps_reason_not_moving_to_lte(MRS_SIM_INDEX sim_index, ps_reason_not_moving_to_lte_struct *ps_reason);
+#endif /* __CHR_AB_INFO__ */
+
+MRS_RAT_MODE_TYPE mrs_translate_nvram_rat_mode_to_mrs(const nvram_rat_enum nvm_rat);
+nvram_rat_enum mrs_translate_mrs_rat_mode_to_nvram(const MRS_RAT_MODE_TYPE mrs_rat);
+
+//--------------NR-AFR API's-------------------
+void mrs_afr_nr_init(MRS_SIM_INDEX sim_index);
+
+extern void mrs_afr_clear_all_afr_target_rat(MRS_SIM_INDEX sim_index);
+
+#ifdef __NR_RAT__
+extern void mrs_afr_reset_nr_priority_freq_list_from_lte(MRS_SIM_INDEX sim_index);
+
+extern void mrs_afr_insert_nr_priority_freq_list_from_lte(MRS_SIM_INDEX sim_index, mrs_afr_nr_freq_list_struct *afr_nr_freq_list);
+
+extern void mrs_afr_get_nr_priority_freq_list_from_lte(MRS_SIM_INDEX sim_index, mrs_afr_nr_freq_list_struct *afr_nr_freq_list);
+#endif /* __NR_RAT__ */
+
+extern void mrs_afr_reset_nr_freq_list(MRS_SIM_INDEX sim_index);
+
+extern void mrs_afr_insert_nr_freq_list(MRS_SIM_INDEX sim_index, mrs_afr_nr_freq_list_struct *afr_nr_freq_list);
+
+extern void mrs_afr_get_nr_freq_list(MRS_SIM_INDEX sim_index, mrs_afr_nr_freq_list_struct *afr_nr_freq_list);
+
+extern void mrs_afr_set_nr_serving_freq_info(MRS_SIM_INDEX sim_index, mrs_afr_nr_freq_info_struct nr_freq_info);
+
+extern void mrs_afr_get_nr_serving_freq_info(MRS_SIM_INDEX sim_index, mrs_afr_nr_freq_info_struct *p_nr_freq_info);
+
+void mrs_set_afr_enhancement_status(MRS_SIM_INDEX sim_index, afr_enhancement_enum enhancement_item, kal_bool activate);
+
+void mrs_set_afr_enhancement_status_in_test_mode(MRS_SIM_INDEX sim_index, afr_enhancement_enum enhancement_item, kal_bool activate);
+
+extern kal_bool mrs_get_afr_support_status(MRS_SIM_INDEX sim_index, kal_uint16 bitmask);
+
+kal_bool mrs_get_afr_enhancement_status(MRS_SIM_INDEX sim_index, afr_enhancement_enum enhancement_item);
+
+void mrs_afr_nas_update_service_table_start(MRS_SIM_INDEX sim_index, afr_service_enum service, MRS_RAT_MODE_TYPE target_rat);
+
+void mrs_afr_nas_update_service_table_end(MRS_SIM_INDEX sim_index, afr_service_enum service);
+
+void mrs_afr_reset_table_by_service(MRS_SIM_INDEX sim_index, afr_service_enum service);
+
+void mrs_afr_rat_fallback_triggerred(MRS_SIM_INDEX sim_index, afr_pre_cond_proc_enum procedure);
+
+void mrs_afr_update_by_high_rat(MRS_SIM_INDEX sim_index, MRS_RAT_MODE_TYPE rat);
+
+void mrs_afr_fail_update_by_low_rat(MRS_SIM_INDEX sim_index, MRS_RAT_MODE_TYPE rat);
+
+kal_uint32 mrs_afr_as_determine_afr_rat(MRS_SIM_INDEX sim_index, MRS_RAT_MODE_TYPE rat, kal_bool skip_voice_status);
+
+kal_uint32 mrs_afr_get_afr_to_4g_timer(MRS_SIM_INDEX sim_index);
+void mrs_afr_set_afr_to_4g_timer(MRS_SIM_INDEX sim_index, kal_uint32 afr_to_4g_timer_val);
+
+kal_uint32 mrs_afr_get_afr_to_5g_timer(MRS_SIM_INDEX sim_index);
+void mrs_afr_set_afr_to_5g_timer(MRS_SIM_INDEX sim_index, kal_uint32 afr_to_5g_timer_val);
+
+void mrs_afr_update_strict_constrain_triggered_by_high_rat(MRS_SIM_INDEX sim_index, MRS_RAT_MODE_TYPE high_rat);
+
+kal_bool mrs_afr_get_4g_csfb_status(MRS_SIM_INDEX sim_index);
+kal_bool mrs_afr_get_5g_epsfb_status(MRS_SIM_INDEX sim_index);
+//--------------NR-AFR-------------------
+
+/*******************************************************************************
+Description:
+ This function is used to count RAT change for IRAT PINGPONG detection.
+
+Parameters: sim_index, irat_type
+
+Return Value: none
+*******************************************************************************/
+extern void mrs_set_irat_pingpong_info(MRS_SIM_INDEX sim_index, mrs_irat_pingpong_type_enum irat_type);
+/*******************************************************************************
+Description:
+ This function is used to judge IRAT PINGPONG by count RAT change times during given period.
+
+Parameters: sim_index, irat_type, duration (unit: seconds), threshold (MAX: 8)
+
+Return Value:
+ TRUE: IRAT PINGPONG detected
+ FALSE: there's no PINGPONG or the corresponding SBP is not ON
+*******************************************************************************/
+extern kal_bool mrs_query_irat_pingpong_status(MRS_SIM_INDEX sim_index, mrs_irat_pingpong_type_enum irat_type,kal_uint32 duration, kal_uint8 pingpong_thres);
+
+
+// DR-DSDS/DSDA APIs
+/**
+* @brief This function is used by each RRC to check if the indicated frequency could be searched without gap with peer SIM connection ongoing.
+* @param[in] sim_index
+* @param[in] rat
+* @param[in] band
+* @param[in] arfcn: For RAT_NR, it means NRARFCN. For LTE, it means EARFCN
+* @return KAL_TRUE: if search w/o GAP is supported. KAL_FALSE: if search w/o GAP is not supported
+*/
+kal_bool mrs_is_freq_search_allowed_with_peer_sim_connection (
+ MRS_SIM_INDEX sim_index,
+ MRS_RAT_MODE_TYPE rat,
+ kal_uint16 band,
+ kal_uint32 arfcn
+);
+
+/**
+* @brief This function is if there are more than one SIM card are inserted.
+* @param[in] none
+* @return KAL_TRUE: if more than one SIM card are inserted. KAL_FALSE: if no or only one SIM card is inserted.
+*/
+kal_bool mrs_is_multi_sim_inserted(void);
+
+/**
+* @brief This function is to check whether DSDA is supported.
+* @param[in] p_cell_cc_info: check DSDA support status by p_cell_cc_info and stored peer SIM cell cc info. If p_cell_cc_info is NULL, check DSDA status by all stored cell cc info.
+* @param[in] is_test_rfdb_query: If current SIM need to check gemini_mode by using mrs_gemini_ie_check_cell_cc_config_db
+* @param[in] ps_id: current sim_index. MRS only use this parameter when is_test_rfdb_query is TRUE.
+* @return mrs_gemini_mode_enum: If DSDA support is returned, DR-DSDS is also supported. If DR-DSDS is returned, DSDA is not supported.
+*/
+mrs_gemini_mode_enum mrs_query_support_gemini_mode(mrs_cell_cc_info_struct *p_cell_cc_info, kal_bool is_test_rfdb_query, protocol_id_enum ps_id);
+
+void mrs_set_test_rfdb_to_config_rfdb(protocol_id_enum sim_index);
+
+rat_enum mrs_get_active_rat_for_dr_dsds_dsda(protocol_id_enum ps_id);
+
+protocol_id_enum mrs_get_peer_sim_index_for_dr_dsds_dsda(protocol_id_enum ps_id);
+
+kal_bool mrs_take_channel_protect_sem(protocol_id_enum ps_id, rat_enum rat);
+
+void mrs_give_channel_protect_sem(protocol_id_enum ps_id, rat_enum rat);
+
+/*******************************************************************************
+Description:
+ This function is used to query if a specific feature is turned on.
+ For inter-RAT or cross module features that needs to be triggered by the other modules, this API could be applied.
+
+Parameters:
+ [sim_index] SIM index
+ [feature_enum] The enum value of the querying feature
+
+Return Value:
+ TRUE: feature ON
+ FALSE: feature OFF
+*******************************************************************************/
+kal_bool mrs_get_feature_status_by_sim(MRS_SIM_INDEX sim_index, mrs_feature_enum feature_enum);
+
+/*******************************************************************************
+Description:
+ This function is used to set if a specific feature is turned on.
+ For inter-RAT or cross module features that needs to be executed by the other modules, this API could be applied.
+
+Parameters:
+ [sim_index] SIM index
+ [feature_enum] The enum value of the querying feature
+ [value] The staus we're going to set for this feature (TRUE: ON / FALSE: OFF)
+
+Return Value: void
+*******************************************************************************/
+void mrs_set_feature_status_by_sim(MRS_SIM_INDEX sim_index, mrs_feature_enum feature_enum, kal_bool status);
+
+kal_bool mrs_check_disable_fast_plmn_list(MRS_SIM_INDEX sim_index);
+
+void mrs_l4c_send_capability_update_ind(MRS_SIM_INDEX sim_index);
+void mrs_save_previous_region_to_nvram(void);
+kal_bool mrs_umts_update_detected_band_for_plmn_region(mrs_plmn_id plmn_id, kal_uint32 bandIDBmp);
+kal_bool mrs_gsm_update_detected_band_for_plmn_region(mrs_plmn_id plmn_id, kal_uint8 bandIDBmp);
+kal_bool mrs_lte_update_detected_band_for_plmn_region( mrs_plmn_id plmn_id, kal_uint8 *bandID);
+kal_bool mrs_get_all_the_lte_supported_bands_per_region(mrs_plmn_id plmn_id, kal_uint8 *bandID);
+void mrs_copy_mrs_context_to_nvram(nvram_ef_band_setting_per_region_info_record_struct *pnvram_band);
+kal_bool mrs_get_mcc_region_umts_bands(mrs_plmn_id plmn_id, kal_uint32 *UBandBitmask_FDD);
+kal_bool mrs_get_mcc_region_gsm_bands(mrs_plmn_id plmn_id, kal_uint8 *gsmBandBitmask);
+void mrs_as_band_setting_update_by_plmn( MRS_SIM_INDEX sim_index, function_caller_id_enum caller_id, mrs_plmn_id* hplmn, mrs_plmn_id_list* cplmn);
+
+/*******************************************************************************
+Description:
+ This function is used to get operator ID for the PLMN.
+
+Parameters:
+ [operator_enum] operator id (input)
+ [p_plmn] Pointer to PLMN code (input)
+
+Return Value:
+ TRUE: plmn match operator id
+ FALSE: plmn does not belong to this operator
+
+*******************************************************************************/
+kal_bool mrs_check_if_plmn_match_operator_id(operator_id_enum operator_enum, const plmn_id_struct *p_plmn);
+
+/*******************************************************************************
+Description:
+ This function is used to get operator ID for the PLMN.
+
+Parameters:
+ [p_plmn] Pointer to PLMN code
+
+Return Value: Operator ID
+*******************************************************************************/
+operator_id_enum mrs_get_operator_id_of_plmn(const plmn_id_struct *p_plmn);
+
+/*******************************************************************************
+Description:
+ This function is called during MRS task init, to check for OTA Update
+
+Parameters:
+ None
+
+Return Value: void
+*******************************************************************************/
+extern void mrs_set_ota_update_during_init();
+
+/*******************************************************************************
+Description:
+ This function is used to reset the NVRAM values to through OTA during Init.
+
+Parameters:
+ LID Name and SIZE
+
+Return Value: void
+*******************************************************************************/
+void mrs_update_nvram_with_ota_values(kal_uint16 nvram_id, kal_uint32 size);
+
+/*******************************************************************************
+Description:
+ This function is used to check SBP bit state.
+
+Parameters:
+ [feature] Feature whose SBP bit is checked
+ [sim_index] MRS SIM index
+
+Return Value:
+ KAL_TRUE: if feature is turned on
+ KAL_FALSE: if feature is turned off
+*******************************************************************************/
+kal_bool mrs_sbp_query_md_feature_by_ps(sbp_md_feature_enum feature, MRS_SIM_INDEX sim_index);
+
+/*******************************************************************************
+Description:
+ This function compares two PLMNs.
+
+Parameters:
+ [ms_plmn_id] PLMN ID
+ [bcch_plmn_id] PLMN ID
+
+Return Value:
+ KAL_TRUE: PLMNs are the same
+ KAL_FALSE: PLMNs are different
+*******************************************************************************/
+kal_bool mrs_is_plmn_id_match_with_bcch_plmn_id(const plmn_id_struct *ms_plmn_id, const plmn_id_struct *bcch_plmn_id);
+
+#endif /* _MRS_UTILITY_H */
diff --git a/mcu/protocol/interface/general/mrs_vgnas_capability.h b/mcu/protocol/interface/general/mrs_vgnas_capability.h
new file mode 100644
index 0000000..3749473
--- /dev/null
+++ b/mcu/protocol/interface/general/mrs_vgnas_capability.h
@@ -0,0 +1,150 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2018
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+#ifndef MRS_VGNAS_CAPABILITY_H
+#define MRS_VGNAS_CAPABILITY_H
+
+#include "mrs_as_irat_enums.h"
+#include "l3_inc_enums_public.h"
+#include "ps_public_enum.h"
+
+
+/********************************************
+ * MACROS *
+ ********************************************/
+
+#define RAT_ANY 0xFF
+#define OPTION_ANY 0XFF
+
+
+/********************************************
+ * TYPE DEFINITIONS & ENUMS *
+ ********************************************/
+
+/**
+ * NVRAM_EF_N1_MODE_CAP_LID & NVRAM_EF_NR_CAP_LID
+ */
+typedef struct
+{
+ kal_bool n1_mode; // 24.301 UE network capability IE: N1 mode supported (N1 mode)
+ kal_bool ho_attach; // 5GMM capability IE: attach request message containing PDN connectivity request with request type handover to transfer PDU session from N1 mode to S1 mode supported (HO attach)
+ kal_uint8 ue_5gs_enc_algo; // UE security capability IE: 5GS encryption algorithm supported
+ kal_uint8 ue_5gs_int_algo; // UE security capability IE: 5GS integrity algorithm supported
+
+} vgnas_capability_context_struct;
+
+
+/********************************************
+ * VARIABLES *
+ ********************************************/
+
+
+/********************************************
+ * FUNCTION DECLARATIONS *
+ ********************************************/
+
+/**
+ * @brief Initializes MRS 5G NAS context
+ * @return void
+ */
+void mrs_vgnas_init_context_default_value(void);
+
+/**
+ * @brief Initial procedure to set MRS 5G NAS context by data retrieved from NVRAM
+ * @return void
+ * @param[IN] nvram_file_id: NVRAM_EF_NR_CAP_LID, NVRAM_EF_N1_CAP_LID
+ * @param[IN] data: of nvram_file_id
+ * @param[IN] len: of data
+ */
+void mrs_vgnas_read_nvram_cnf_handler(kal_uint16 nvram_file_id, kal_uint8 *data, kal_uint16 len);
+
+/**
+ * @brief A function that sets 5gc nas(n1 mode) supported
+ * @param[in] sim_index indicates the protocol which is selected
+ * @param[in] n1_mode is used for setting the configuration.
+ * @return KAL_TRUE if n1_mode set sucessfully.
+ *
+ * the n1 mode is used for ue network capability IE and defined in TS 24.301
+ */
+kal_bool mrs_vgnas_set_cap_5gc_nas_support(MRS_SIM_INDEX sim_index, kal_bool n1_mode);
+
+/**
+ * @brief A function that gets 5gc nas(n1 mode) supported
+ * @param[in] sim_index indicates the protocol which is selected
+ * @param[in] rat_mode is used for checking if we could get the n1_mode configuration.
+ * @return KAL_TRUE if epc nas(n1_mode) is supported.
+ *
+ * the n1 mode is used for ue network capability IE and defined in TS 24.301
+ */
+kal_bool mrs_vgnas_get_cap_5gc_nas_support(MRS_SIM_INDEX sim_index, rat_enum rat_mode);
+
+/**
+ * @brief Get ME's setting on HO attach supported
+ * @return KAL_TRUE: supported; KAL_FALSE: not supported
+ * @param[IN] sim_index: for which protocol
+ * @param[IN] rat_mode: current rat mode
+ *
+ * result is filtered by rat_mode, input rat_mode=RAT_ANY to by-pass filtering
+ */
+kal_bool mrs_vgnas_get_cap_ho_attach_support(MRS_SIM_INDEX sim_index, rat_enum rat_mode);
+
+/**
+ * @brief Get ME's setting on 5GS encryption algorithms supported
+ * @return kal_uint8: bit map (bit 8 is 5G-EA0, bit 7 is 128-5G-EA1, ...
+ * bit 1 is 5G-EA7), each bit is either 0 for not supported or 1
+ * for supported
+ * @param[IN] sim_index: for which protocol
+ * @param[IN] option: current 5G architecture option
+ *
+ * 5G-EA is used for:
+ * UE security capability IE and defined in TS 24.501
+ */
+kal_uint8 mrs_vgnas_get_cap_5gs_encryption_algo_support(MRS_SIM_INDEX sim_index, vg_option_enum option);
+
+/**
+ * @brief Get ME's setting on 5GS integrity algorithms supported
+ * @return kal_uint8: bit map (bit 8 is 5G-IA0, bit 7 is 128-5G-IA1, ...
+ * bit 1 is 5G-IA7), each bit is either 0 for not supported or 1
+ * for supported
+ * @param[IN] sim_index: for which protocol
+ * @param[IN] option: current 5G architecture option
+ *
+ * 5G-IA is used for:
+ * UE security capability IE and defined in TS 24.501
+ */
+kal_uint8 mrs_vgnas_get_cap_5gs_integrity_algo_support(MRS_SIM_INDEX sim_index, vg_option_enum option);
+
+
+#endif /* MRS_VGNAS_CAPABILITY_H */
diff --git a/mcu/protocol/interface/general/nas_sv_ratdm_struct.h b/mcu/protocol/interface/general/nas_sv_ratdm_struct.h
new file mode 100644
index 0000000..713bde1
--- /dev/null
+++ b/mcu/protocol/interface/general/nas_sv_ratdm_struct.h
@@ -0,0 +1,98 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2018
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+/*****************************************************************************
+*
+* Filename:
+* ---------
+* nas_sv_ratdm_struct.h
+*
+* Project:
+* --------
+* UMOLYA
+*
+* Description:
+* ------------
+*
+* Author:
+* -------
+ * -------
+******************************************************************************/
+
+#ifndef _NAS_SV_RATDM_STRUCT_H_
+#define _NAS_SV_RATDM_STRUCT_H_
+
+
+#include "kal_general_types.h"
+#include "ps_public_enum.h"
+#include "l3_inc_enums.h"
+#include "mcd_l3_inc_struct.h"
+
+#include "l3_inc_local.h"
+
+#include "gmss_public.h"
+#include "mm_mmi_enums.h"
+#include "mmi2mm_struct.h"
+
+#include "kal_public_defs.h"
+#include "sim_public_enum.h"
+#include "global_type.h"
+
+#include "kal_general_types.h"
+#include "kal_public_defs.h"
+#include "gmss_public.h"
+
+typedef enum {
+ RATDM_NO_RAT,
+ RATDM_GSM_RAT,
+ RATDM_WCDMA_RAT,
+ RATDM_LTE_RAT,
+ RATDM_C2K_RAT,
+ RATDM_NR_RAT,
+} ratdm_rat_enum;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ ratdm_rat_enum dst_rat;
+} nas_sv_ratdm_rat_change_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ umts_duplex_mode_type source_umts_duplex_mode;
+ umts_duplex_mode_type target_umts_duplex_mode;
+ lte_duplex_mode_type source_lte_duplex_mode;
+ lte_duplex_mode_type target_lte_duplex_mode;
+} nas_sv_ratdm_duplex_mode_change_req_struct;
+
+#endif /* _NWSEL_RATDM_STRUCT_H */
diff --git a/mcu/protocol/interface/general/non_std_llc_peer.h b/mcu/protocol/interface/general/non_std_llc_peer.h
new file mode 100644
index 0000000..c21b72a
--- /dev/null
+++ b/mcu/protocol/interface/general/non_std_llc_peer.h
@@ -0,0 +1,112 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * non_std_llc_peer.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+
+#ifndef _NON_STD_LLC_PEER_H_
+#define _NON_STD_LLC_PEER_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef TEST_TOOL
+#include "tt_defs.h"
+#else
+#include "kal_public_api.h"
+#endif
+
+
+#include "l3_inc.h"
+#include "llc_varstr.h"
+#include "llc_peer_interface.h"
+
+#include "asn_llc_peer.h"
+#include "non_std_llc_peer_struct.h"
+#include "non_std_llc_peer_pun.h"
+
+#ifdef TOOL
+#include "set_non_std_llc_peer.h"
+#include "get_non_std_llc_peer.h"
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+
diff --git a/mcu/protocol/interface/general/nrrc_rsva_struct.h b/mcu/protocol/interface/general/nrrc_rsva_struct.h
new file mode 100644
index 0000000..515f211
--- /dev/null
+++ b/mcu/protocol/interface/general/nrrc_rsva_struct.h
@@ -0,0 +1,85 @@
+/*******************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2018
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*******************************************************************************/
+
+#ifndef _NRRC_RSVA_STRUCT_H_
+#define _NRRC_RSVA_STRUCT_H_
+
+#include "l3_inc_enums.h"
+#include "kal_general_types.h"
+
+#if defined(__GEMINI__) && defined(__NR_RAT__)
+
+/*----------------------------------------------------------------------------*/
+/* NRRC (SEARCH) to RSVA (RSVAN) */
+/*----------------------------------------------------------------------------*/
+
+typedef struct {
+ LOCAL_PARA_HDR
+ nrrc_freq_scan_type_enum freq_scan_type;
+ kal_bool is_full_band;
+ kal_uint8 sid; /* session id */
+}nrrc_rsvan_frequency_scan_start_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ nrrc_freq_scan_stop_cause_enum cause;
+ /* preemption session id, only used when cause=NRAS_FREQ_SCAN_PREEMPTED */
+ /* always release the resource when cause=NRAS_FREQ_SCAN_FINISHED */
+ kal_uint8 sid;
+}nrrc_rsvan_frequency_scan_stop_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ nrrc_freq_scan_type_enum freq_scan_type;
+ kal_bool is_full_band;
+ kal_uint8 sid; /* session id */
+}nrrc_rsvan_frequency_scan_modify_req_struct;
+
+/*----------------------------------------------------------------------------*/
+/* RSVA (RSVAN) to NRAS (SEARCH) */
+/*----------------------------------------------------------------------------*/
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 sid; /* session id */
+}rsvan_nrrc_frequency_scan_accept_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 sid; /* preemption session id */
+}rsvan_nrrc_frequency_scan_preempt_ind_struct;
+
+#endif /* if defined(__GEMINI__) && defined(__NR_RAT__) */
+#endif /* _NRRC_RSVA_STRUCT_H_ */
diff --git a/mcu/protocol/interface/general/nwsel_mm_struct.h b/mcu/protocol/interface/general/nwsel_mm_struct.h
new file mode 100644
index 0000000..cad6aeb
--- /dev/null
+++ b/mcu/protocol/interface/general/nwsel_mm_struct.h
@@ -0,0 +1,394 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * nwsel_mm_struct.h
+ *
+ * Project:
+ * --------
+ * MONZA
+ *
+ * Description:
+ * ------------
+ * This file define the interface structure used by NWSEL_MM SAP
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ ******************************************************************************/
+
+#ifndef NWSEL_MM_STRUCT_H
+#define NWSEL_MM_STRUCT_H
+
+#include "l3_inc_enums.h"
+#include "mcd_l3_inc_struct.h"
+#include "l3_inc_local.h"
+#include "as2nas_struct.h"
+#include "mcd_l3_inc_gprs_struct.h"
+#include "ps_public_enum.h"
+#include "rsvas_enum.h"
+#include "mm_mmi_enums.h"
+#include "mm_ratcm_enums.h"
+#include "gmss_nwsel_struct.h"
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 multi_plmn_count;
+ plmn_id_struct multi_plmn_id[MAX_NUM_MULTI_PLMN];
+ as_cell_type_enum multi_cell_type[MAX_NUM_MULTI_PLMN];
+ rat_enum rat;
+ /// source from cell reselection or search
+ found_ind_source_enum source;
+} nwsel_mm_plmn_found_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_plmn_search_lte_ongoing;
+ as_cell_type_enum cell_type; // 4G camped on cell type
+} nwsel_mm_search_status_update_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint16 gibi_tag;
+ rat_enum rat;
+ kal_bool is_data_pending;
+ kal_bool is_sys_info_present;
+ hplmn_status_enum hplmn_status;
+ fplmn_status_enum fplmn_status;
+ kal_bool is_in_eq_plmn_list;
+ mm_cell_change_enum abnormal_cell_change;
+ mm_cell_change_enum abnormal_rai_cell_change;
+ plmn_id_struct plmn_id;
+ kal_uint8 la_code[2];
+ kal_uint8 ra_code;
+ kal_uint32 cell_id; //mtk02475: extended cell id in UMTS
+ kal_bool cell_support_cs;
+ kal_bool cell_support_ps; /* if FALSE, nmo and ra_code should not refer. */
+ kal_bool is_acc_class_present;
+ kal_uint16 acc_class;
+ kal_uint8 extra_info_bitmask; /* mtk02475: for DSAC/data_speed_support update in connected mode*/
+#if defined (__R6_DSAC__) || defined (UNIT_TEST)
+ kal_bool is_dsac_present;
+ kal_uint16 cs_dsac;
+ kal_uint16 ps_dsac;
+#endif
+ kal_uint8 t3212_timer_val;
+ network_mode_enum nmo;
+ as_cell_type_enum cell_type;
+ att_flag_enum att_flag;
+ kal_bool mscr;
+ rr_mm_sgsnr_flag_enum sgsnr;
+#ifdef __PS_SERVICE__
+ data_speed_support_enum cell_data_speed_support; /* MAUI_02361221: for egprs and hspa */
+#endif
+
+#if defined (__PPACR_SUPPORT__) || defined (UNIT_TEST)
+ kal_bool is_ppacr_present;
+ ppacr_info_struct ppacr_info;
+#endif
+
+ csg_access_mode_enum csg_access_mode;
+ csg_info_struct csg_info;
+
+#ifdef __LTE_RAT__
+ kal_bool is_gprs_info_in_si13_deferred;
+#endif
+ kal_uint8 band;
+} nwsel_mm_sys_info_update_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ rat_enum rat;
+ kal_uint32 cell_id;
+ kal_bool is_la_valid;
+ kal_uint8 la_code[2];
+ kal_bool is_ra_valid;
+ kal_uint8 ra_code;
+ plmn_id_struct plmn_id;
+ kal_bool is_on_hplmn;
+} nwsel_mm_cell_global_identity_info_update_req_struct;
+
+typedef mm_cell_global_identity_info_ind_struct nwsel_mm_cell_global_identity_info_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ mode_switch_cause_enum cause;
+} nwsel_mm_global_mode_change_start_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ rat_type_enum target_rat;
+ kal_uint8 freq_num;
+ kal_uint32 redirect_freq[MAX_REDIRECT_FREQ_NUM];
+ mt_csfb_type_enum mt_csfb_type;
+} nwsel_mm_need_duplex_mode_chg_update_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_as_plmn_list_present;
+ as_plmn_list_struct as_plmn_list;
+#ifdef __GEMINI__
+ as_suspend_mode_reason_enum cause; /* for RR suspend mode */
+#endif /* __GEMINI__ */
+ csfb_indicator_enum csfb_ind;
+ kal_bool is_nas_csfb_ongoing;
+ plmn_loss_reason_enum plmn_loss_reason;
+} nwsel_mm_plmn_loss_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ rat_enum rat;
+ kal_bool is_manual_list;
+ scan_type_enum scan_type;
+ kal_uint8 plmn_count;
+ plmn_id_struct plmn_id[MAX_NUM_SEARCH_PLMN];
+ found_mcc_info_struct found_mcc_info;
+} nwsel_mm_plmn_list_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool is_user_plmn_list_ongoing;
+} nwsel_mm_plmn_list_status_update_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_uas_plmn_list_present;
+ as_plmn_list_struct uas_plmn_list;
+ kal_bool is_gas_plmn_list_present;
+ as_plmn_list_struct gas_plmn_list;
+ scan_type_enum scan_type;
+ plmn_list_result_enum cause;
+} nwsel_mm_plmn_list_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ rat_enum rat;
+ kal_uint8 plmn_count;
+ plmn_id_struct plmn_id[MAX_NUM_EQ_PLMN];
+} nwsel_mm_csg_list_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ //kal_bool is_uas_csg_list_present;
+ as_csg_list_struct uas_csg_list;
+} nwsel_mm_csg_list_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ aral_op_enum op_code;
+ plmn_id_struct plmn;
+ rat_enum rat;
+ kal_uint8 ara_start[2];
+ kal_uint8 ara_end[2];
+}nwsel_mm_aral_update_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ regn_proc_status_enum nwsel_proc_status;
+ plmn_search_status_enum plmn_search_status;
+ plmn_search_type_enum plmn_search_type; /* new plmn search type */
+ kal_bool is_send_to_as;
+} nwsel_mm_regn_status_update_req_struct;
+
+#ifdef __DYNAMIC_BAND_SEL__
+typedef struct {
+ LOCAL_PARA_HDR
+ band_selection_enum gsm_band; /* refer to band_selection_enum value*/
+ kal_bool is_gsm_band_present;
+ kal_uint8 umts_fdd_band[2]; /* 3G band change */
+ kal_bool is_umts_band_present; /* 3G band change */
+}nwsel_mm_set_preferred_band_req_struct;
+#endif
+
+typedef struct {
+ LOCAL_PARA_HDR
+ lr_result_enum lr_result;
+ mm_cause_enum lr_cause;
+ mm_proc_enum mm_proc;
+ kal_uint8 attempt_counter; //update only when lr_proc needed
+ plmn_id_struct rplmn; //from stored lai. Valid when LR_ACCEPT & LR_ACCEPT_PS_ONLY
+ kal_bool forbidden_plmn_update_not_allowed; /*MM may change NW reject cause, and no need to add forbidden PLMN */
+ kal_bool is_update_eq_plmn_needed; /* always check; indicate if NWSEL need to update EPLMN */
+ kal_uint8 eq_plmn_byte_count;
+ kal_uint8 eq_plmn_id[MAX_NUM_EQ_PLMN*3]; /* the EPLMN list from NW; 3 is NWSEL_PLMN_LEN */
+ kal_bool is_back_to_abnormal_la;
+ kal_bool is_rau_performed;
+ kal_bool is_stored_lai_same_as_current;
+ kal_bool stored_lai_valid;
+ kal_bool stored_rai_valid;
+ gsm_state_enum gsm_attach_state;
+ gprs_state_enum gprs_attach_state;
+ gsm_update_status_enum gsm_update_status;
+ gprs_update_status_enum gprs_update_status;
+ mm_check_ecall_status_enum ecall_status;
+ kal_bool is_mobility_rau; /*To check whether update_type is periodic rau or mobility rau */
+ integ_protect_status_enum is_integ_protected;
+ kal_uint8 invalid_cs_sim_counter;
+ kal_uint8 invalid_ps_sim_counter;
+} nwsel_mm_regn_result_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ domain_id_enum conn_domain;
+} nwsel_mm_out_of_service_ind_struct;
+
+#ifdef __GEMINI__
+typedef struct {
+ LOCAL_PARA_HDR
+ as_suspend_mode_reason_enum cause;
+} nwsel_mm_suspend_ind_struct;
+
+//mtk02475: local param struct is only exist in GEMINI 2.0 project
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_virtual_idle_mode;
+} nwsel_mm_resume_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_virtual_idle_mode;
+ kal_bool is_in_connected;
+ /*Naming is "is_in_connected but it is expected that GMM updates only
+ virtual_connected state to NWSEL"*/
+} nwsel_mm_virtual_mode_ind_struct;
+#endif /* __GEMINI__ */
+
+typedef struct {
+ LOCAL_PARA_HDR
+ mm_event_type_enum event;
+} nwsel_mm_event_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 plmn_id_count;
+ plmn_id_struct plmn_id[MD1_MAX_NUM_HPLMN]; //MAX_NUM_HPLMN: 4
+ kal_uint8 home_country_mcc[3];
+} nwsel_mm_hplmn_info_update_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ eutran_cap_enum eutran_cap;
+ kal_bool is_eucap_sysinfo_triggered;
+} nwsel_mm_eutran_cap_update_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_successful;
+} nwsel_mm_eutran_cap_update_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ voice_domain_preference_enum utran_voice_domain_preference;
+ kal_bool is_eutran_param_updated; /* if FALSE, the following parameters are invalid */
+ kal_bool is_eutran_vdp_or_ue_usage_changed;
+ voice_domain_preference_enum eutran_voice_domain_preference;
+ ue_usage_setting_enum ue_usage_setting;
+ eutran_cap_update_wait_status_enum eutran_cap_update_wait_status;
+} nwsel_mm_voice_prefer_ue_usage_update_req_struct;
+
+/* 24.008 CR# 2109 Start */
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_manual_sel;
+} nwsel_mm_manual_mode_update_req_struct;
+/* 24.008 CR# 2109 End */
+
+typedef struct {
+ LOCAL_PARA_HDR
+ rat_enum rat;
+ plmn_id_struct plmn_id;
+ kal_uint16 arfcn;
+ kal_uint8 requested_band;
+} nwsel_mm_set_mru_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ set_mru_result_enum result;
+} nwsel_mm_set_mru_cnf_struct;
+
+/* VzW requirement for MRU/RAL, only band/channel */
+typedef struct {
+ LOCAL_PARA_HDR
+ cell_band_info_type_enum type;
+ rat_enum rat;
+ plmn_id_struct plmn_id;
+ kal_uint8 band;
+} nwsel_mm_cell_band_info_update_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ rat_enum rat;
+ kal_uint8 num_of_nw;
+ emc_forbidden_nw_list_struct nw_list[MAX_FORBIDDEN_NETWORK_NUM];
+} nwsel_mm_emc_forbidden_nw_list_update_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ call_status_enum call_status;
+ call_type_indication_enum call_type;
+} nwsel_mm_call_status_ind_struct;
+
+typedef gmss_nwsel_rat_disable_config_req_struct nwsel_mm_rat_disable_config_req_struct;
+
+typedef gmss_nwsel_inactive_mode_configuration_req_struct nwsel_mm_inactive_mode_configuration_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool is_over_inactive_mode_threshold; // True: recovery counter > normal_oos_recovery_round
+} nwsel_mm_service_recovery_round_update_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ rat_enum rat;
+ network_scan_23g_union nw_scan_23g_output;
+}nwsel_mm_plmn_scan_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ plmn_id_struct plmn_id;
+} nwsel_mm_plmn_info_update_req_struct;
+
+
+#endif /* NWSEL_MM_STRUCT_H */
diff --git a/mcu/protocol/interface/general/nwsel_pam_struct.h b/mcu/protocol/interface/general/nwsel_pam_struct.h
new file mode 100644
index 0000000..4d4842b
--- /dev/null
+++ b/mcu/protocol/interface/general/nwsel_pam_struct.h
@@ -0,0 +1,167 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * NWSEL_PAM_STRUCT.H
+ *
+ * Project:
+ * --------
+ *
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ *
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *============================================================================
+ ****************************************************************************/
+
+#ifndef NWSEL_PAM_STRUCT_H
+#define NWSEL_PAM_STRUCT_H
+
+/* enum */
+#include "kal_general_types.h"
+#include "l3_inc_enums.h"
+
+/* struct */
+#include "kal_public_defs.h"
+#include "mcd_l3_inc_struct.h"
+
+/** MOD_NWSEL -> MOD_PAM: Update eq-plmn-list[] when registered to PS domain.
+ * Design assumption
+ * =================
+ * - 23G: Since GMM always completes its PS-ATTACH (REG) before PDP-ACT-REQ procedure,
+ * for the rejection case below, PAM always has a current_eq_plmn_list[] to use
+ * - 4G : Since PDN-CONN-REQ would be embedded in ATTACH-REQ,
+ * for 4G attach-reject case, the plmn info would be sent from EMM -> ESM -> PAM
+ * - Note: NWSEL always updates eq-plmn-list[] to PAM, no matter it is 23G or 4G now
+ *
+ * How to use
+ * ==========
+ * - 1: When receiving this message, PAM saves eq_plmn_id[] into its context: current_eq_plmn_list[]
+ * - 2: When receiving PDP-ACT-REJ from SM,
+ * PAM refers current_eq_plmn_list[] and saves both current-plmn and eq-plmns into the arbitration table
+ * - 3: When receiving a new PDP-ACT-REQ from TCM,
+ * PAM checks current_eq_plmn_list[0] against the arbitration table
+ * - If current_eq_plmn_list[0] exists, then PAM rejects the incoming PDP-ACT-REQ
+ * .
+ */
+typedef struct {
+ LOCAL_PARA_HDR
+
+ kal_uint8 eq_plmn_count;
+
+ /** The eq_plmn_id[0] would be Registered PLMN. */
+ plmn_id_struct eq_plmn_id[MAX_NUM_EQ_PLMN];
+} nwsel_pam_eq_plmn_list_update_ind_struct;
+
+/** MOD_NWSEL -> MOD_PAM: indicts there is no available PDN for current PLMN
+ * Design assumption
+ * =================
+ * - 4G : To replace EMM report EVENT to notify NWSEL no available PDN,
+ * in order to avoid 4G skip but 3G4 IRCR infinite loop. Disable EUTRAN for 3396 running is neccesary
+ *
+ * How to use
+ * ==========
+ * - 1: If there is 3396 (for VzW, there are two PDNs internet & IMS, use shorter one after all tried)
+ * PAM give the timer and NWSEL start a PLMN base timer to disable EUTRAN
+ * - 2: If there is no 3396, just follow original design skip current 4G and rollback after search round
+ * - 3: APN changes PAM will notify NWSEL to clear all records.
+ * - 4: No need to keep in NVRAM, retry all network after power cycle
+ */
+
+typedef struct {
+ LOCAL_PARA_HDR
+ pdn_update_event_enum type;
+ kal_uint32 time_value;
+} nwsel_pam_pdn_availability_update_req_struct;
+
+typedef struct {
+ plmn_id_struct plmn_id;
+
+ /* The apn_type is bitmap format. An APN may have multiple type attribute, so it is possible to have more
+ than one bit as '1'. for example, the CHT emome APN has "default" type + "mms" type.*/
+ pam_nwsel_apn_type_enum apn_type;
+
+ rat_enum reject_rat;
+ kal_bool timer_is_deactivated;
+ kal_uint32 throttling_timestamp;
+} throttling_apn_block_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 throttling_apn_block_count;
+ throttling_apn_block_struct throttling_apn_block[MAX_THROTTLING_APN_BLOCK_NUM];
+ kal_bool is_last_reject_rat_nr; // Indicate MSG_NWSEL_PAM_THROTTLING_APN_UPDATE_IND is triggerd due to 5G Reject Cause is received.
+} nwsel_pam_throttling_apn_update_ind_struct;
+
+#endif /* NWSEL_PAM_STRUCT_H */
diff --git a/mcu/protocol/interface/general/nwsel_ratcm_struct.h b/mcu/protocol/interface/general/nwsel_ratcm_struct.h
new file mode 100644
index 0000000..9aebe45
--- /dev/null
+++ b/mcu/protocol/interface/general/nwsel_ratcm_struct.h
@@ -0,0 +1,98 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * nwsel_ratcm_struct.h
+ *
+ * Project:
+ * --------
+ * MONZA
+ *
+ * Description:
+ * ------------
+ * This file define the interface structure used by NWSEL_RATCM SAP
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ ******************************************************************************/
+
+#ifndef NWSEL_RATCM_STRUCT_H
+#define NWSEL_RATCM_STRUCT_H
+
+#include "l3_inc_enums.h"
+#include "mcd_l3_inc_struct.h"
+#include "l3_inc_local.h"
+#include "as2nas_struct.h"
+#include "mcd_l3_inc_gprs_struct.h"
+#include "ps_public_enum.h"
+#include "rsvas_enum.h"
+#include "kal_public_defs.h"
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 eq_plmn_count;
+ plmn_id_struct eq_plmn_id[MAX_NUM_EQ_PLMN]; /* The eq_plmn_id[0] should be RPLMN */
+} nwsel_ratcm_eq_plmn_list_update_req_struct;
+
+/* abstrated from mm_ratcm_regn_status_req */
+#ifdef __REL8__
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 r_eq_plmn_count;
+ plmn_id_struct r_eq_plmn_id[MAX_NUM_EQ_PLMN];
+} nwsel_ratcm_rplmn_eq_plmn_list_update_req_struct;
+#endif
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 plmn_id_count;
+ plmn_id_struct plmn_id[MD1_MAX_NUM_HPLMN]; // MD1_MAX_NUM_HPLMN
+} nwsel_ratcm_hplmn_info_update_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ rat_enum rat;
+} nwsel_ratcm_signal_appear_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ rat_enum rat;
+} nwsel_ratcm_cell_change_finish_ind_struct;
+
+#endif /* NWSEL_RATCM_STRUCT_H */
diff --git a/mcu/protocol/interface/general/nwsel_ratdm_struct.h b/mcu/protocol/interface/general/nwsel_ratdm_struct.h
new file mode 100644
index 0000000..e201bf1
--- /dev/null
+++ b/mcu/protocol/interface/general/nwsel_ratdm_struct.h
@@ -0,0 +1,59 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * nwsel_ratdm_struct.h
+ *
+ * Project:
+ * --------
+ *
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ ******************************************************************************/
+
+#ifndef _NWSEL_RATDM_STRUCT_H
+#define _NWSEL_RATDM_STRUCT_H
+#include "nas_sv_ratdm_struct.h"
+
+#endif /* _NWSEL_RATDM_STRUCT_H */
diff --git a/mcu/protocol/interface/general/obex_app_enums.h b/mcu/protocol/interface/general/obex_app_enums.h
new file mode 100644
index 0000000..e532768
--- /dev/null
+++ b/mcu/protocol/interface/general/obex_app_enums.h
@@ -0,0 +1,126 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+ /*******************************************************************************
+ * Filename:
+ * ---------
+ * obex_app_enums.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * Enum value between OBEX and APP.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *==============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+#ifndef _OBEX_APP_ENUMS_H
+#define _OBEX_APP_ENUMS_H
+
+#define IRDA_MAX_USER_DATA 512 /* OBEX + TTP + LMP */
+#define IRDA_MAX_DECLARED_OBEX_PKT_SIZE 32672 /* Follow PC device */
+//#define IRDA_MAX_USER_DATA 128 /* OBEX + TTP + LMP */ /* 04.02.23 Change from 256 to 128 */
+
+#define TTP_HEADER_SIZE 1
+#define LMP_HEADER_SIZE 2
+#define OBEX_MAX_PKT_SIZE IRDA_MAX_USER_DATA - TTP_HEADER_SIZE - LMP_HEADER_SIZE
+#define OBEX_MAX_APP_DATA OBEX_MAX_PKT_SIZE - 6 /* 6 = OBEX PUT header(3) and BODY header(3) */
+
+#define IRCOMM_MAX_PKT_SIZE IRDA_MAX_USER_DATA - TTP_HEADER_SIZE - LMP_HEADER_SIZE
+#define IRCOMM_MAX_APP_DATA OBEX_MAX_PKT_SIZE - 1 /* 1 = IrCOMM control len field */
+
+typedef enum
+{
+ OBEX_CLOSE,
+ OBEX_CONNECTED,
+ OBEX_OPEN
+} obex_state_enum;
+
+typedef enum
+{
+ OBEX_IAS_CLOSE,
+ OBEX_IAS_WAITI,
+ OBEX_IAS_OPEN
+} obex_ias_state_enum;
+
+typedef enum
+{
+ OBEX_ERR_LMP_FAILED,
+ OBEX_ERR_IAS_FAILED,
+ OBEX_ERR_TTP_FAILED,
+ OBEX_ERR_OBEX_FAILED
+} obex_err_cause_enum;
+
+typedef enum
+{
+ OBEX_APP_RES_CONTINUE_F=0x90,
+ OBEX_APP_RES_SUCCESS_F=0xA0,
+ OBEX_APP_RES_FAILED_F=0xC4
+} obex_app_rsp_code_enum;
+
+typedef enum
+{
+ OBEX_FIRST_PKT,
+ OBEX_NORMAL_PKT,
+ OBEX_FINAL_PKT
+} obex_pkt_type_enum;
+
+typedef enum
+{
+ OBEX_TRANSMISSION_FINISHED,
+ OBEX_USER_CANCELLED
+} obex_disconnect_reason_enum;
+
+#endif /* ~_OBEX_APP_ENUMS_H */
+
+
diff --git a/mcu/protocol/interface/general/p2p_struct.h b/mcu/protocol/interface/general/p2p_struct.h
new file mode 100644
index 0000000..734bf47
--- /dev/null
+++ b/mcu/protocol/interface/general/p2p_struct.h
@@ -0,0 +1,93 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * p2p_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file describes the common struct of LLC and Layer3.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _P2P_STRUCT_H
+#define _P2P_STRUCT_H
+
+#ifdef __P2P_SUPPORT__
+
+typedef struct {
+ kal_uint8 ref_count;
+ kal_uint16 msg_len;
+ kal_uint8 start_ind;
+} p2p_send_ul_data_ind_struct;
+
+#endif
+
+#endif
+
+
diff --git a/mcu/protocol/interface/general/pam_msg_struct.h b/mcu/protocol/interface/general/pam_msg_struct.h
new file mode 100644
index 0000000..ca79a86
--- /dev/null
+++ b/mcu/protocol/interface/general/pam_msg_struct.h
@@ -0,0 +1,200 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * PAM_MSG_STRUCT.H
+ *
+ * Project:
+ * --------
+ *
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ *
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *============================================================================
+ ****************************************************************************/
+
+#ifndef PAM_MSG_STRUCT_H
+#define PAM_MSG_STRUCT_H
+
+/* struct */
+#include "kal_public_defs.h"
+
+#include "nwsel_eval_struct.h"
+
+/* Multimode */
+#include "irat_common_struct.h"
+#include "mcd_l3_inc_gprs_struct.h"
+#include "l3_inc_enums.h"
+#include "mcd_l3_inc_struct.h"
+
+#ifndef MAX_BEARER_CTXT_NUM
+#define MAX_BEARER_CTXT_NUM 11
+#endif
+
+typedef struct {
+ LOCAL_PARA_HDR
+} tcm_pam_start_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+} tcm_pam_attach_context_defined_notify_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_ue_voice_centric ; /* Configured by AT+CEUS (voice/data centric) */
+ kal_bool is_ims_roaming_supported ; /* Configured by IMS */
+ kal_bool is_mobile_data_on ; /* Configured by AT+ECNCFG (from Android UI) */
+ kal_bool is_mobile_data_roaming_on ; /* Configured by AT+ECNCFG (from Android UI) */
+
+ kal_bool is_vzw_ims_test_mode_on ; /* IMS Test Mode is defined by VZW requirements */
+} tcm_pam_cellular_network_config_req_struct ;
+
+typedef ia_apn_change_req_struct tcm_pam_ia_apn_change_req_struct;
+
+/** Used by ESM/SM, to notify PAM stopping all T3396 timers. */
+typedef struct {
+ LOCAL_PARA_HDR
+} pam_stop_all_t3396_ind_struct;
+
+/** Used by ESM/SM, to notify PAM that PDP numbers is currently sync'd with NW. */
+typedef struct {
+ LOCAL_PARA_HDR
+} pam_pdp_synced_ind_struct;
+
+
+/***** VZW(OP12) message structure *****/
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_valid_available_apn_num;
+ kal_uint8 available_apn_num;
+ plmn_id_struct current_plmn_id;
+} pam_esm_available_apn_info_req_struct; // __VZW__ __VZW_2__
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ plmn_id_struct current_plmn_id;
+} pam_esm_t3402_stop_ind_struct; // __VZW__ __VZW_3__
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ // Indicates the below current_plmn_id should be used or not.
+ kal_bool is_valid_current_plmn_id;
+ // current_plmn_id for stopping throttling timer
+ plmn_id_struct current_plmn_id;
+} pam_esm_stop_all_pdn_thrott_timer_ind_struct; // __VZW__ __VZW_10__
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 ebi_est_num;
+ kal_uint8 ebi_est_list[MAX_BEARER_CTXT_NUM];
+ // Indicates the below current_plmn_id should be used or not.
+ kal_bool is_valid_current_plmn_id;
+ // current_plmn_id for connection (DRB) establish
+ plmn_id_struct current_plmn_id;
+} pam_esm_conn_est_ind_struct; // __VZW__ __VZW_4__
+
+/***** AT&T(OP07) message structure *****/
+typedef nwsel_eval_t3402_change_ind_struct pam_esm_t3402_change_ind_struct;
+
+#endif /* PAM_MSG_STRUCT_H */
diff --git a/mcu/protocol/interface/general/rac_gas_enums.h b/mcu/protocol/interface/general/rac_gas_enums.h
new file mode 100644
index 0000000..5eb5aa3
--- /dev/null
+++ b/mcu/protocol/interface/general/rac_gas_enums.h
@@ -0,0 +1,61 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * rac_gas_enums.h
+ *
+ * Project:
+ * --------
+ * MONZA
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:Bo.wu
+ * -------
+ *
+ *
+ * ----------------------------------------------------------------------------
+ * $Log:$
+ *
+ * 01 21 2014 wcpuser_integrator
+ * [MOLY00054475] SGLTE option rename
+ * .
+ *
+
+ ******************************************************************************/
diff --git a/mcu/protocol/interface/general/rac_gas_struct.h b/mcu/protocol/interface/general/rac_gas_struct.h
new file mode 100644
index 0000000..c7ea374
--- /dev/null
+++ b/mcu/protocol/interface/general/rac_gas_struct.h
@@ -0,0 +1,61 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * rac_gas_struct.h
+ *
+ * Project:
+ * --------
+ * MONZA
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:Bo.wu
+ * -------
+ *
+ *
+ * ==========================================================================
+ * $Log:$
+ *
+ * 01 21 2014 wcpuser_integrator
+ * [MOLY00054475] SGLTE option rename
+ * .
+ *
+ * Add copyright header.
+ ****************************************************************************/
diff --git a/mcu/protocol/interface/general/rac_mrs_struct.h b/mcu/protocol/interface/general/rac_mrs_struct.h
new file mode 100644
index 0000000..2dc1c1f
--- /dev/null
+++ b/mcu/protocol/interface/general/rac_mrs_struct.h
@@ -0,0 +1,92 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * rac_mrs_struct.h
+ *
+ * Project:
+ * --------
+ * Multimode
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ----------------------------------------------------------------------------
+ * $Log:$
+ *
+ * 10 07 2015 titi.wu
+ * [MOLY00141786] [MT6755][SRLTE][L+C] Support connectivity of C2K on dual SIM
+ * .
+ *
+ * 05 29 2015 shih-che.chou
+ * [MOLY00115617] [6291] Dynamic SIM switch without modem reset
+ * RAC part
+ *
+ * 12 17 2014 shin.chen
+ * [MOLY00087882] [Universal Bin] MRS general developement.
+ *
+ * 01 22 2013 david.niu
+ * [MOLY00009205] [MRS] Code checked-in for MOLY branch
+ * .
+ *
+ ******************************************************************************/
+#ifndef _RAC_MRS_STRUCT_H
+#define _RAC_MRS_STRUCT_H
+
+/* RAC uses this primitive to initialize MRS */
+typedef struct {
+ LOCAL_PARA_HDR
+
+ // TBD: capability to initialize 3G InterRAT HO Info and 2G classmark
+
+ hspa_preference_enum fdd_hspa_preference; // store to MRS context
+ hspa_preference_enum tdd_hspa_preference;
+ init_cause_enum init_cause;
+} rac_mrs_init_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ emdstatus_md_config_enum md_config;
+ emdstatus_sim_config_enum sim_config;
+} rac_mrs_md_sim_config_req_struct;
+
+#endif /* _RAC_MRS_STRUCT_H */
diff --git a/mcu/protocol/interface/general/ratadp_stats.h b/mcu/protocol/interface/general/ratadp_stats.h
new file mode 100644
index 0000000..21a285d
--- /dev/null
+++ b/mcu/protocol/interface/general/ratadp_stats.h
@@ -0,0 +1,89 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2012
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * ratadp_stats.h
+ *
+ * Project:
+ * --------
+ * MOLY
+ *
+ * Description:
+ * ------------
+ * RATADP statistics
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *
+ * ==========================================================================
+ * $Log$
+ ****************************************************************************/
+/*
+ * =====================================================================================
+ *
+ * Filename: ratadp_stats.h
+ *
+ * Description: RATADP EM Stats.
+ *
+ * Created: 2013/05/27 11:38:10
+ * Author: mtk01641 (moja)
+ * =====================================================================================
+ */
+
+#ifndef RATADP_STATS_INC
+#define RATADP_STATS_INC
+
+typedef struct
+{
+ kal_uint32 ltm_hook_times;
+ kal_uint32 ratdm_hook_times;
+ kal_uint32 ug_ready_ind_times;
+
+ kal_uint32 ratdm_rollback_times;
+ kal_uint32 ratdm_dlvr_dl_times;
+ kal_uint32 ul_to_ratdm_times;
+ kal_uint32 ul_to_dummy_times;
+
+ kal_uint32 leave_ratdm_times;
+ kal_uint32 other_to_ltm_times;
+ kal_uint32 other_to_ratdm_times;
+}ratadp_stats_t;
+#endif /* ----- #ifndef RATADP_STATS_INC ----- */
+
diff --git a/mcu/protocol/interface/general/ratcm_as_struct.h b/mcu/protocol/interface/general/ratcm_as_struct.h
new file mode 100644
index 0000000..9306cd1
--- /dev/null
+++ b/mcu/protocol/interface/general/ratcm_as_struct.h
@@ -0,0 +1,112 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * ratcm_as_struct.h
+ *
+ * Project:
+ * --------
+ *
+ *
+ * Description:
+ * ------------
+ * Structure declaration which are common for GAS and UAS
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * removed!
+ *
+ ****************************************************************************/
+
+#ifndef _RATCM_AS_STRUCT_H
+#define _RATCM_AS_STRUCT_H
+
+/* MAUI_02828210, redundant header removal */
+//#include "ratcm_uas_enums.h"
+//#include "ratcm_uas_struct.h"
+//#include "ratcm_csce_enums.h"
+#include "l3_inc_local.h"
+#include "kal_public_api.h"
+#include "kal_general_types.h"
+#include "l3_inc_enums.h"
+#include "mcd_l3_inc_struct.h"
+#include "ps_public_enum.h"
+#include "ps_public_struct.h"
+#include "nas_sv_struct.h"
+
+
+/*Sniffer related RATCM to AS structures*/
+typedef struct {
+ LOCAL_PARA_HDR
+ as_sniffer_req_service_enum as_sniffer_service;
+ as_sniffer_plmn_list_operate_type_enum plmn_list_operate_type;
+ kal_uint8 plmn_id_count;
+ plmn_id_struct plmn_id[MAX_NUM_SNIFFER_PLMN];
+}ratcm_as_sniffer_start_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+}ratcm_as_sniffer_stop_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+}ratcm_as_signal_appear_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+}ratcm_as_check_active_rat_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_active_rat;
+}ratcm_as_check_active_rat_cnf_struct;
+
+//MSG_ID_RATCM_UAS_SET_ACTIVE_RAT_REQ,
+typedef struct {
+ LOCAL_PARA_HDR
+}ratcm_as_set_active_rat_req_struct;
+
+//MSG_ID_RATCM_UAS_SET_ACTIVE_RAT_CNF
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_success;
+}ratcm_as_set_active_rat_cnf_struct;
+
+#endif /* _RATCM_AS_STRUCT_H */
diff --git a/mcu/protocol/interface/general/ratcm_bmc_struct.h b/mcu/protocol/interface/general/ratcm_bmc_struct.h
new file mode 100644
index 0000000..9400e70
--- /dev/null
+++ b/mcu/protocol/interface/general/ratcm_bmc_struct.h
@@ -0,0 +1,161 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * ratcm_bmc_struct.h
+ *
+ * Project:
+ * --------
+ * MONZA
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ ****************************************************************************/
+
+#ifndef _RATCM_BMC_STRUCT_H
+#define _RATCM_BMC_STRUCT_H
+
+#include "kal_public_defs.h"
+#include "kal_general_types.h"
+#include "ps_public_enum.h"
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool is_cbs_required;
+} ratcm_bmc_cbch_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint16 cbmi[CB_MAX_MSG_CBMI_NUM];
+ kal_uint16 cbmd[CB_MAX_MSG_CBMID_NUM];
+ kal_uint16 cbmr[CB_MAX_MSG_CBMIR_NUM];
+ kal_uint16 dcs[CB_MAX_LANG_NUM];
+ kal_bool is_all_language_on;
+ l4c_cb_set_type_enum set_type;
+} ratcm_bmc_update_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint16 mi;
+ kal_uint16 sn;
+} ratcm_bmc_cb_msg_removal_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint16 msgid;
+ kal_uint16 serial_Num;
+ kal_uint8 dcs;
+ kal_bool is_mids;
+} ratcm_bmc_data_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ cb_geography_enum geography_type;
+} ratcm_bmc_cb_gs_change_ind_struct;
+
+typedef ratcm_bmc_cb_msg_removal_req_struct ratcm_bmc_cb_dup_det_timer_stop_ind_struct;
+
+#endif /* _RATCM_BMC_STRUCT_H */
diff --git a/mcu/protocol/interface/general/ratcm_csce_struct.h b/mcu/protocol/interface/general/ratcm_csce_struct.h
new file mode 100644
index 0000000..5a74570
--- /dev/null
+++ b/mcu/protocol/interface/general/ratcm_csce_struct.h
@@ -0,0 +1,908 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * ratcm_csce_struct.h
+ *
+ * Project:
+ * --------
+ * MONZA
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ ****************************************************************************/
+
+#ifndef _RATCM_CSCE_STRUCT_H
+#define _RATCM_CSCE_STRUCT_H
+
+/* MAUI_02828210, redundant header removal */
+//#include "ratcm_uas_enums.h"
+//#include "ratcm_uas_struct.h"
+//#include "ratcm_csce_enums.h"
+#include "l3_inc_local.h"
+#include "kal_public_api.h"
+#include "kal_general_types.h"
+#include "l3_inc_enums.h"
+#include "mcd_l3_inc_struct.h"
+#include "ps_public_enum.h"
+#include "ps_public_struct.h"
+#include "nas_sv_struct.h"
+#include "ratcm_as_struct.h"
+#include "mmi2mm_struct.h"
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+/**************************************************************
+ * RATCM_CSCE_ARAL_UPDATE_REQ
+ *
+ * Sent from RATCM to CSCE to to notify uas already entered NS-IOT TC
+ * and let uas clear about cell in which LA(RA) is allowable to camp on
+ *
+ ***************************************************************/
+typedef struct{
+ LOCAL_PARA_HDR
+ aral_op_enum op_code;
+ plmn_id_struct plmn;//record NSIOT plmn
+ kal_uint8 ara_start[2];//Allowed LA upper boundry
+ kal_uint8 ara_end[2]; // lower boundry
+}ratcm_csce_aral_update_req_struct;
+
+/**************************************************************
+ * RATCM_CSCE_INIT_REQ
+ *
+ * Sent from RATCM to CSCE to initialise UAS
+ * 1.IMEI number.
+ * 2.preferred_GSM_band is the working band info from NVRAM.
+ * 3.working_UMTS_FDD_band is the working band info transferred from
+ * Upper layer also with byte 0 indicates the band info of band I - VIII.
+ * where second byte indicates the band info of band IX - X.
+ * (LSB of byte 1 is used for band IX and X)
+ ***************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ kal_uint8 imeisv_value_digit0;
+ kal_uint8 imeisv_value_digit_byte[8];
+
+ /* remove requested_gsm_band, requested_umts_band, and hspa_preference
+ * because they are initialized to MRS directly
+ */
+
+ init_cause_enum init_cause;
+}ratcm_csce_init_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ kal_uint8 imeisv_value_digit0;
+ kal_uint8 imeisv_value_digit_byte[8];
+}ratcm_csce_set_imei_req_struct;
+
+/***********************/
+/* RATCM_CSCE_INIT_CNF */
+/***********************/
+// No local parameter for this primitive
+
+
+/******************************/
+/* RATCM_CSCE_PLMN_SEARCH_REQ */
+/******************************/
+/* Scenario 1: PLMN Selection, automatic mode, normal case
+ PLMNSearchType == SINGLE_PLMN
+
+ At power-on, the non-access stratum (NAS) selects the PLMN with
+ highest priority, possibly the last PLMN stored prior to previous
+ power off. The access stratum (AS) is requested to find a cell
+ belonging to that PLMN.
+
+ When searching for the requested PLMN and in order to speed up the
+ search, AS may use a list of cell information stored prior to
+ previous power-off. When a cell belonging to the requested PLMN is
+ found, that cell is selected and NAS is notified that the PLMN was
+ found (ref: [25.304;10.4]).
+
+ Initiates search for cell with given PLMN Identity, (or one of its equivalent),
+ or any PLMN.On receipt of a new PLMN identity list, the previously stored equivalent
+ PLMN list is discarded.The search type also allows a search for a given PLMN to be made
+ excluding or allowing cells from Forbidden LAs. Forbidden LAs are not taken into
+ account for a PLMN search of type "any". If forbidden LAs are allowed then AS can
+ camp on a cell regardless whether it is in a forbidden Location Area or not and this
+ will continue until either a new UGC-CELL-SELECTION_CONTROL _REQ or a new
+ GC-PLMN-SEARCH-REQ is issued.
+ */
+
+typedef struct{
+ LOCAL_PARA_HDR
+ kal_uint8 trx_id;
+ plmn_search_type_enum plmn_search_type;
+ kal_uint8 plmn_id_count;
+ plmn_id_struct plmn_id[MAX_NUM_SEARCH_PLMN];
+ search_param_container_struct as_param_container;
+ umts_search_param_container_struct umts_param;
+}ratcm_csce_plmn_search_req_struct;
+
+/******************************/
+/* RATCM_CSCE_PLMN_SEARCH_CNF */
+/******************************/
+/* Note: the GC PLMN Search Confirm should only be used when the
+ requested PLMN Id is found. The failure case use a the list
+ primitive. */
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool is_plmn_list_valid;
+ kal_uint8 trx_id;
+ plmn_search_result_enum result;
+
+ as_cell_type_enum multi_selected_cell_type[MAX_NUM_MULTI_PLMN];
+ as_cell_type_enum selected_cell_type; //20081027: Quick PLMN Recovery ANY PLMN on H/R-PLMN cell
+
+ kal_uint8 multi_plmn_count;
+ /* Range: 1 to MAX_NUM_MULTI_PLMN, only valid if result == PLMN_FOUND */
+ plmn_id_struct multi_selected_plmn[MAX_NUM_MULTI_PLMN];
+ plmn_id_struct selected_plmn; /* only valid if result == PLMN_FOUND *//* Reserved for before R6*/
+ as_plmn_list_struct plmn_list;
+ scan_type_enum scan_type;
+ kal_bool is_stored_list_exist; // only for stored search not for fullband + fullband and stored
+ fullband_result_enum is_fullband_finished;
+ kal_bool is_quick_search;
+} ratcm_csce_plmn_search_cnf_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 multi_plmn_count;
+ plmn_id_struct multi_plmn_id[MAX_NUM_MULTI_PLMN];
+ as_cell_type_enum multi_cell_type[MAX_NUM_MULTI_PLMN];
+ /// source from cell reselection or search
+ found_ind_source_enum source;
+} ratcm_csce_plmn_found_ind_struct;
+
+
+/*********************************************/
+/* RATCM_CSCE_START_TIMER_OUT_OF_SERVICE_IND */
+/*********************************************/
+// No local parameter for this primitive
+
+
+/****************************/
+/* RATCM_CSCE_PLMN_LOSS_IND */
+/****************************/
+/* This primitive is used when the selected PLMN is LOST */
+typedef struct
+{
+ LOCAL_PARA_HDR
+ csfb_indicator_enum csfb_indicator; /* Added by Multimode */
+ as_plmn_list_struct plmn_list;
+ plmn_loss_reason_enum plmn_loss_reason;
+} ratcm_csce_plmn_loss_ind_struct;
+
+/*********************************/
+/* RATCM_CSCE_RRC_DEACTIVATE_REQ */
+/*********************************/
+/*
+REQ: Signals that UMTS RRC must become inactive.
+Note: This primitive may be received in idle mode,
+subsequently to a NAS request for a PLMN search on another RAT
+*/
+// No local parameter for this primitive
+
+/*********************************/
+/* RATCM_CSCE_RRC_DEACTIVATE_CNF */
+/*********************************/
+// No local parameter for this primitive
+
+/****************************/
+/* RATCM_CSCE_PLMN_LIST_REQ */
+/****************************/
+/* This service provides the list of currently available PLMN. */
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool is_manual_list;
+ scan_type_enum scan_type;
+ kal_uint8 plmn_count;
+ plmn_id_struct plmn_id[MAX_NUM_SEARCH_PLMN];
+ found_mcc_info_struct found_mcc_info;
+ kal_uint32 num_of_band; //number of valid records in band list
+ /*Band list for MCC Band for PLMN list optimization*/
+ kal_uint16 band_list[MAX_SEARCH_BAND_LIST_SIZE];
+ user_list_type_enum user_list_type;
+ kal_uint8 given_number_of_plmn; // used for the USER_LIST_TYPE_GIVEN_TIMER_NUMBER. When xAS found the given number of plmn, xAS return PLMN_LIST_CNF. When value is 0 means xAS do complete list, no need care it.
+ network_scan_input_struct network_scan_input;
+
+} ratcm_csce_plmn_list_req_struct;
+
+/****************************/
+/* RATCM_CSCE_PLMN_LIST_STATUS_UPDATE_REQ */
+/****************************/
+/* This msg to inform as that user list is ongoing to perseve scanned result. */
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool is_user_plmn_list_ongoing;
+} ratcm_csce_plmn_list_status_update_req_struct;
+
+/*********************************/
+/* RATCM_CSCE_PLMN_LIST_STOP_REQ */
+/*********************************/
+/**
+ * The NAS may stop the search for PLMN on the rest
+ * of the carriers.
+ */
+// No local parameter for this primitive
+
+
+
+/***********************************/
+/* RATCM_CSCE_ADD_FORBIDDEN_LA_REQ */
+/***********************************/
+/* Scenario: NAS Controlled Cell Selection
+
+ NAS may influence the cell selection and reselection by sending
+ control information to AS. This information can include, for
+ example, lists of forbidden registration areas and a list of NAS
+ defined service areas in priority order. The control information is
+ used by AS in cell selection and reselection:
+
+ - Cells belonging to a forbidden registration area will only be
+ selected if no better cell is found. At this point, the services
+ provided the UE might be limited.
+
+ - Cells belonging to a NAS defined service area with higher
+ priority than current service area will be considered better than
+ the cell currently camped on. Depending on radio access mode, the
+ most suitable cell in idle mode may not be the most suitable cell
+ in connected mode. */
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 la_code[2];
+ forbidden_la_type_enum forbidden_la_type;
+ plmn_id_struct plmn_id;
+} ratcm_csce_add_forbidden_la_req_struct;
+
+/***********************************/
+/* RATCM_CSCE_DEL_FORBIDDEN_LA_REQ */
+/***********************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 la_code[2];
+ plmn_id_struct plmn_id;
+ kal_bool delete_all;
+} ratcm_csce_del_forbidden_la_req_struct;
+
+/**************************************/
+/* RATCM_CSCE_EQ_PLMN_LIST_UPDATE_REQ */
+/**************************************/
+/*
+This primitive is sent by NAS whenever it obtains the equivalent PLMN list.
+The PLMN Identity list contains the PLMN Id of the current PLMN.A new list
+overrides the previously stored "equivalent PLMN" list. This primitive may
+be received at any time, while the UMTS RAT is either active or inactive.
+
+To delete the PLMN ID List, NAS will send a list containing 1 PLMN ID, i.e.
+currently active one.
+The first element in the array of eq_plmn_id is rplmn.
+*/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 eq_plmn_count;/* Range: 1 to MAX_NUM_EQ_PLMN. */
+ plmn_id_struct eq_plmn_id[MAX_NUM_EQ_PLMN];
+}ratcm_csce_eq_plmn_list_update_req_struct;
+
+/*******************************/
+/* RATCM_CSCE_SET_RAT_MODE_REQ */
+/*******************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ rat_enum rat;
+ rat_enum reported_rat;
+}ratcm_csce_set_rat_mode_req_struct;
+
+/*
+Yongjiao 20100612 MAUI_20542230
+Add RATCM_CSCE_SET_RAT_MODE_CNF to resolve 2G_3G_L1 conflict
+*/
+/*******************************/
+/* RATCM_CSCE_SET_RAT_MODE_CNF */
+/*******************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+}ratcm_csce_set_rat_mode_cnf_struct;
+
+/***********************/
+/* RATCM_CSCE_RFON_REQ */
+/***********************/
+// No local parameter for this primitive
+
+/***********************/
+/* RATCM_CSCE_RFON_CNF */
+/***********************/
+// No local parameter for this primitive
+
+/************************/
+/* RATCM_CSCE_RFOFF_REQ */
+/************************/
+// No local parameter for this primitive
+
+/************************/
+/* RATCM_CSCE_RFOFF_REQ */
+/************************/
+// No local parameter for this primitive
+
+/**************************/
+/* REGN_STATUS_UPDATE_REQ */
+/**************************/
+/**
+ * Gibran 20080320: MONZA00006851
+ * NAS will directly send REGN_STATUS_UPDATE_REQ to CSCE
+ * since RRCE will save REGN_STATUS_UPDATE_REQ
+ * when it is configuring lower layer.
+ */
+typedef struct
+{
+ LOCAL_PARA_HDR
+ plmn_search_status_enum plmn_search_status;
+ plmn_search_type_enum plmn_search_type;
+
+ /* Viola 20090302
+ * Add proc_status to inform CSCE current NAS procedure.
+ * CSCE mainly cares 5 procedures,
+ * ATTACH_PROCEDURE_SUCCESS, RAU_PROCEDURE_SUCCESS, LU_PROCEDURE_SUCCESS, MS_IN_LIMITED_SERVICE, MS_IN_NO_SERVICE
+ */
+ regn_proc_status_enum proc_status;
+
+ /* Rachel 20130722
+ * In R9 and later, TS 25.304 5.2.6.1.4a changed the descriptions as following:
+ * UE specific priorities shall be cleared when the validity time of the UE sepecific priority expires,
+ * or when a PLMN selection is performed on request by NAS.
+ * Therefore, RPLMN info is not required for CSCE anymore.
+ */
+#if 0 //def __REL8__
+/* under construction !*/
+/* under construction !*/
+#endif
+}ratcm_csce_regn_status_update_req_struct;
+
+/**************************************/
+/* RATCM_CSCE_EHPLMN_INFO_UPDATE_REQ */
+/* This message is used by RATCM to forward EHPLMN list to CSCE */
+/**************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 plmn_id_count;
+ plmn_id_struct plmn_id[MD1_MAX_NUM_HPLMN];
+ kal_uint8 home_country_mcc[3];
+}ratcm_csce_hplmn_info_update_req_struct;
+
+#if defined(__3G_CSG_SUPPORT__) || defined(__LTE_RAT__)
+/**************************************/
+/* RATCM_CSCE_UPDATE_ALLOWED_CSG_LIST_REQ */
+/* This message is used by RATCM to add/delete Allowed CSG to CSCE */
+/**************************************/
+typedef struct {
+ LOCAL_PARA_HDR
+ csg_update_type_enum csg_update_type;
+ plmn_id_struct plmn_id;
+ kal_uint32 csg_id;
+#if 0
+/* under construction !*/
+#endif
+} ratcm_csce_update_white_list_req_struct;
+
+/**************************************/
+/* RATCM_CSCE_CSG_LIST_REQ */
+/* This message is used by RATCM to request CSCE to do manual CSG list */
+/**************************************/
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+typedef nwsel_nas_sv_csg_list_req_struct ratcm_csce_csg_list_req_struct;
+/*********************************/
+/* RATCM_CSCE_CSG_LIST_STOP_REQ */
+/*********************************/
+// No local parameter for this primitive
+#endif /* __CSG_SUPPORT__ */
+
+#ifdef __GEMINI__
+/**************************/
+/* RATCM_CSCE_SIM_STATUS_UPDATE_REQ */
+/* This message is used by NAS to inform CSCE current SIM Status */
+/**************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+ sim_config_status_enum sim_config_status;
+ sim_insert_status_enum sim_insert_status;
+} ratcm_csce_sim_status_update_req_struct;
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+#endif
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ plmn_id_struct plmn_id;
+ kal_uint16 arfcn;
+} ratcm_csce_set_mru_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ set_mru_result_enum result;
+} ratcm_csce_set_mru_cnf_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ call_status_enum call_status;
+ call_type_indication_enum call_type;
+} ratcm_csce_call_status_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ ue_capability_struct capability;
+} ratcm_csce_cap_update_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool is_successful;
+} ratcm_csce_cap_update_cnf_struct;
+
+#ifdef __LTE_RAT__
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 num_of_nw;
+ emc_forbidden_nw_list_struct nw_list[MAX_FORBIDDEN_NETWORK_NUM];
+} ratcm_csce_emc_forbidden_nw_list_update_req_struct;
+
+#endif
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ plmn_id_struct plmn_id;
+} ratcm_csce_plmn_info_update_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ elevator_mode_enum elevator_mode;
+} ratcm_csce_elevator_mode_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ rat_enum disable_rat;
+} ratcm_csce_disable_rat_config_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint32 num_of_detected_band;
+ kal_uint16 detected_band_list[MAX_SEARCH_BAND_LIST_SIZE];
+} ratcm_uas_signal_appear_ind_struct;
+
+/*Sniffer related message structures*/
+
+//MSG_ID_RATCM_UAS_SNIFFER_START_REQ
+typedef ratcm_as_sniffer_start_req_struct ratcm_uas_sniffer_start_req_struct;
+
+//MSG_ID_RATCM_UAS_SNIFFER_STOP_REQ
+typedef ratcm_as_sniffer_stop_req_struct ratcm_uas_sniffer_stop_req_struct;
+
+//MSG_ID_RATCM_UAS_SIGNAL_APPEAR_IND
+//typedef ratcm_as_signal_appear_ind_struct ratcm_uas_signal_appear_ind_struct;
+
+//MSG_ID_RATCM_UAS_CHECK_ACTIVE_RAT_REQ,
+typedef ratcm_as_check_active_rat_req_struct ratcm_uas_check_active_rat_req_struct;
+
+//MSG_ID_RATCM_UAS_CHECK_ACTIVE_RAT_CNF
+typedef ratcm_as_check_active_rat_cnf_struct ratcm_uas_check_active_rat_cnf_struct;
+
+//MSG_ID_RATCM_UAS_SET_ACTIVE_RAT_REQ,
+typedef ratcm_as_set_active_rat_req_struct ratcm_uas_set_active_rat_req_struct;
+
+//MSG_ID_RATCM_UAS_SET_ACTIVE_RAT_CNF
+typedef ratcm_as_set_active_rat_cnf_struct ratcm_uas_set_active_rat_cnf_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool normal_oos_recovery_round_present;
+ kal_uint8 normal_oos_recovery_round; /* default value = 5, range [2, 10] */
+ kal_bool inactive_fullband_period_present;
+ kal_uint16 inactive_fullband_period; /* default = 200s, range: [90, 360] */
+ kal_bool inactive_sniffer_period_present;
+ kal_uint8 inactive_sniffer_period; /* default = 30s, range: [10, 60] */
+ kal_bool is_inactive_mode_present;
+ kal_bool is_inactive_mode; /* True: enter inactive mode, False: leave inactive mode */
+} ratcm_csce_inactive_mode_configuration_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool is_over_inactive_mode_threshold; /* True: recovery counter > normal_oos_recovery_round */
+} ratcm_csce_service_recovery_round_update_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+} ratcm_csce_end_ps_data_session_ind_struct;
+
+typedef gmmreg_lte_normal_service_loss_update_req_struct ratcm_csce_lte_normal_service_loss_update_req_struct ;
+#endif /* RATCM_CSCE_STRUCT_H */
diff --git a/mcu/protocol/interface/general/ratcm_cse_enums.h b/mcu/protocol/interface/general/ratcm_cse_enums.h
new file mode 100644
index 0000000..1b85ffe
--- /dev/null
+++ b/mcu/protocol/interface/general/ratcm_cse_enums.h
@@ -0,0 +1,68 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * ratcm_cse_enums.h
+ *
+ * Project:
+ * --------
+ * MONZA
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ----------------------------------------------------------------------------
+ * $Log:$
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ * Add copyright header.
+ ******************************************************************************/
+
+#ifndef _RATCM_CSE_ENUMS_H
+#define _RATCM_CSE_ENUMS_H
+
+
+#endif /* _RATCM_CSE_ENUMS_H */
diff --git a/mcu/protocol/interface/general/ratcm_cse_struct.h b/mcu/protocol/interface/general/ratcm_cse_struct.h
new file mode 100644
index 0000000..ebdde76
--- /dev/null
+++ b/mcu/protocol/interface/general/ratcm_cse_struct.h
@@ -0,0 +1,195 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * ratcm_cse_struct.h
+ *
+ * Project:
+ * --------
+ * MONZA
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ ****************************************************************************/
+
+#ifndef _RATCM_CSE_STRUCT_H
+#define _RATCM_CSE_STRUCT_H
+
+/* MAUI_02828210, redundant header removal */
+#include "ratcm_cse_enums.h"
+#include "kal_public_api.h"
+#include "kal_general_types.h"
+#include "mcd_l3_inc_struct.h"
+#include "l3_inc_local.h"
+#include "nas_sv_struct.h"
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ plmn_id_struct plmn_id;
+} ratcm_cse_plmn_list_update_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ as_plmn_list_struct plmn_list;
+ scan_type_enum scan_type;
+ plmn_list_result_enum cause;
+ kal_bool is_complete; // If list not complete, the available list is not complete too.
+ kal_bool is_plmn_list_aborted; //indicate if the PLMN List is aborted by PLMN_LIST_ABORT_REQ
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+} ratcm_cse_plmn_list_cnf_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 multi_plmn_count;
+ plmn_id_struct multi_plmn_id[MAX_NUM_MULTI_PLMN];
+ as_cell_type_enum multi_cell_type[MAX_NUM_MULTI_PLMN];
+ found_ind_source_enum source;
+ cell_id_union cell_id;
+} ratcm_cse_plmn_found_ind_struct;
+
+
+/* Jethro: Since RATCM_CSE_PLMN_LIST_STOP_CNF is an empty message, no structure is required for this message. */
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+#if defined(__3G_CSG_SUPPORT__) || defined(__LTE_RAT__)
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ as_csg_list_struct csg_list;
+} ratcm_cse_csg_list_cnf_struct;
+#endif
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ network_scan_3g_output_struct nw_scan_3g_output;
+} ratcm_cse_plmn_scan_ind_struct;
+
+
+#endif /* _RATCM_CSE_STRUCT_H */
diff --git a/mcu/protocol/interface/general/ratcm_csr_struct.h b/mcu/protocol/interface/general/ratcm_csr_struct.h
new file mode 100644
index 0000000..41114cb
--- /dev/null
+++ b/mcu/protocol/interface/general/ratcm_csr_struct.h
@@ -0,0 +1,217 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * ratcm_csr_struct.h
+ *
+ * Project:
+ * --------
+ * MONZA
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log:$
+ *
+ * 01 04 2013 andrew.wu
+ * [MOLY00008328] [CSR/PDCP]fix UT test code
+ * UT testcode bugs fix
+ *
+ * 10 01 2012 andrew.wu
+ * [MOLY00004236] [interface][service][kal]remove stack_ltlcom.h
+ *
+ * Remove stack_ltlcom.h
+ *
+ * 01 12 2012 andrew.wu
+ * removed!
+ * <saved by Perforce>
+ *
+ * 11 11 2011 andrew.wu
+ * removed!
+ * <saved by Perforce>
+ *
+ * 12 14 2010 max.yin
+ * removed!
+ * .
+ *
+ * 12 14 2010 cosine.jheng
+ * removed!
+ * Integration change.
+ *
+ * 10 18 2010 max.yin
+ * removed!
+ * .
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ * Add copyright header.
+ ****************************************************************************/
+
+#ifndef RATCM_CSR_STRUCT_H
+#define RATCM_CSR_STRUCT_H
+
+#include "kal_public_api.h" //kal api change #include "stack_ltlcom.h"
+#include "kal_general_types.h"
+#include "as_common.h"
+
+typedef enum
+{
+ CS_ROUTE_NONE=0,
+ CS_ROUTE_AUDIO_CODEC,
+ CS_ROUTE_CS_DATA,
+ CS_ROUTE_VT_DATA,
+ CS_ROUTE_SYNC_HDLC_DATA /* MAUI_02375911 */
+} tCSR_TargetEntity;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ U8 StreamId;
+ tCSR_TargetEntity TargetEntity;
+}csr_set_routing_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ U8 StreamId;
+ U8 frameType;
+ U8 dataLen;
+ U16 frameIndex;
+}csr_codec_data_req_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ U8 FrameType;
+}csr_sp3g_set_frame_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ U8 event;
+ U8 data[32];
+}csr_sp3g_callback_req_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ U8 frameType;
+ U8 dataLen;
+ U16 frameIndex;
+ U8 voiceData[32];
+}csr_sp3g_get_frame_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ U8 subFlowID;
+ U8 frameType;
+ U8 CRCStatus;
+ U8 voiceData[32];
+}csr_sp3g_put_frame_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ U8 size;
+ U8 CSD_data[70];
+}csr_ratcm_data_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ U8 size;
+ U8 VT_data[80];
+}csr_vt_data_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ U8 maxCsDelay;
+}csr_sp3ghspa_set_csdelay_ind_struct;
+
+/* for CS only */
+typedef struct
+{
+ /* Dont touch this part */
+ //M_SHAQ_ELMT_HEADER
+
+ LOCAL_PARA_HDR
+
+ kal_uint16 pdu_len; \
+ kal_uint8 __ref_count; \
+ kal_uint8 pb_resvered; \
+ kal_uint16 free_header_space; \
+ kal_uint16 free_tail_space;
+ struct SHAQ_qElmtHeader *next_shaqElmt;
+ /* Hands off please */
+
+ kal_uint16 bitLength;
+ kal_uint16 frame_index;
+
+ ExtendedRbId RBId;
+ kal_bool __align_00;
+ kal_uint16 dummy;
+
+} csr_shaq_data_req_struct;
+
+#endif /* RATCM_CSR_STRUCT_H */
diff --git a/mcu/protocol/interface/general/ratcm_gas_enums.h b/mcu/protocol/interface/general/ratcm_gas_enums.h
new file mode 100644
index 0000000..6febca8
--- /dev/null
+++ b/mcu/protocol/interface/general/ratcm_gas_enums.h
@@ -0,0 +1,88 @@
+/*******************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*******************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * ratcm_gas_struct.h
+ *
+ * Project:
+ * --------
+ * MONZA
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ ******************************************************************************/
+
+#ifndef _RATCM_GAS_ENUMS_H
+#define _RATCM_GAS_ENUMS_H
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+typedef enum{
+ GAS_BAND_NONE = 0x00,
+ GAS_BAND_PGSM900 = 0x01,
+ GAS_BAND_EGSM900 = 0x02,
+ GAS_BAND_RGSM900 = 0x04,
+ GAS_BAND_DCS1800 = 0x08,
+ GAS_BAND_PCS1900 = 0x10,
+ GAS_BAND_GSM450 = 0x20,
+ GAS_BAND_GSM480 = 0x40,
+ GAS_BAND_GSM850 = 0x80,
+ GSM_BAND_900_1800 = 0x0a,
+ GSM_BAND_850_1900 = 0x90,
+ GSM_BAND_900_TRIPPLE = 0x1a,
+ GSM_BAND_850_TRIPPLE = 0x98,
+ GSM_BAND_QUAD = 0x9a
+}gsm_band_enum;
+
+#endif /* _RATCM_GAS_ENUMS_H */
diff --git a/mcu/protocol/interface/general/ratcm_gas_struct.h b/mcu/protocol/interface/general/ratcm_gas_struct.h
new file mode 100644
index 0000000..efc5c01
--- /dev/null
+++ b/mcu/protocol/interface/general/ratcm_gas_struct.h
@@ -0,0 +1,738 @@
+/*******************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*******************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * ratcm_gas_struct.h
+ *
+ * Project:
+ * --------
+ * MONZA
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ ******************************************************************************/
+
+#ifndef _RATCM_GAS_STRUCT_H
+#define _RATCM_GAS_STRUCT_H
+
+
+#ifdef __GEMINI__
+#include "rsvas_enum.h"
+#endif
+
+/* add RHR */
+#include "ratcm_gas_enums.h"
+#include "mcd_l3_inc_struct.h"
+#include "l3_inc_enums.h"
+#include "l3_inc_local.h"
+#include "rr_mpal_interface.h"
+#include "l3llc_enums.h"
+#include "kal_general_types.h"
+#include "ps_public_enum.h"
+#include "nas_as_inter_core_enum.h"
+#include "gmss_public.h"
+#include "ratcm_as_struct.h"
+
+#include "nas_sv_struct.h"
+#include "mmi2mm_struct.h"
+/*----------------------------------------------------------------------------*/
+/* pre-define struct */
+/*----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------*/
+/* GAS to RATCM */
+/*----------------------------------------------------------------------------*/
+
+typedef struct{
+ LOCAL_PARA_HDR
+ plmn_id_struct plmn_id;
+ kal_uint16 arfcn;
+ kal_uint8 request_band;
+}ratcm_gas_set_mru_req_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ set_mru_result_enum result;
+}ratcm_gas_set_mru_cnf_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ domain_id_enum cn_domain_id;
+ as_est_cnf_cause_enum result;
+ kal_bool wait_gibi_flag;
+ kal_bool is_rrc_conn_already_existed;
+}ratcm_gas_conn_est_cnf_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ kal_bool is_successful;
+ domain_id_enum cn_domain_id;
+ kal_bool is_t3126_expiry;
+}ratcm_gas_conn_est_ind_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ kal_bool is_successful;
+ domain_id_enum cn_domain_id;
+ kal_bool ps_resume_flag;
+ kal_bool wait_gibi_flag;
+}ratcm_gas_conn_rel_cnf_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ domain_id_enum cn_domain_id;
+ kal_bool ps_resume_flag;
+ kal_bool wait_gibi_flag;
+}ratcm_gas_conn_rel_ind_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ DC_Priority sapi;
+ kal_uint8 mui;
+ kal_bool is_successful;
+}ratcm_gas_data_cnf_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ domain_id_enum cn_domain_id;
+}ratcm_gas_data_ind_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ as_plmn_list_struct plmn_list;
+ scan_type_enum scan_type;
+ plmn_list_result_enum cause;
+ kal_bool is_complete; // If list not complete, the available list is not complete too.
+ kal_bool is_plmn_list_aborted; //indicate if the PLMN List is aborted by PLMN_LIST_ABORT_REQ
+}ratcm_gas_plmn_list_cnf_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+#ifdef __LTE_RAT__
+ csfb_indicator_enum csfb_indicator;
+#endif /* __LTE_RAT__ */
+ as_plmn_list_struct plmn_list;
+ plmn_loss_reason_enum plmn_loss_reason;
+}ratcm_gas_plmn_loss_ind_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ domain_id_enum cn_domain_id;
+ ue_id_type_enum ue_id_type;
+ kal_uint8 ue_identity[9];
+}ratcm_gas_page_ind_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ kal_uint8 trx_id;
+ plmn_search_result_enum result;
+ plmn_id_struct selected_plmn;
+ kal_bool is_plmn_list_valid;
+ as_plmn_list_struct plmn_list;
+ scan_type_enum scan_type;
+ kal_bool is_stored_list_exist; // only for stored search not for fullband + fullband and stored
+ fullband_result_enum is_fullband_finished;
+ kal_bool is_quick_search;
+}ratcm_gas_plmn_search_cnf_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ plmn_id_struct plmn_id;
+ as_cell_type_enum cell_type;
+ /// source from cell reselection or search
+ found_ind_source_enum source;
+ cell_id_union cell_id;
+} ratcm_gas_plmn_found_ind_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ ready_timer_status_enum status;
+}ratcm_gas_ready_timer_update_ind_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ sync_ind_cause_enum cause;
+ channel_type_enum channel_type;
+ channel_mode_enum channel_mode;
+ kal_bool is_ciphering_on;
+}ratcm_gas_sync_ind_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ kal_uint16 gibi_tag;
+ plmn_id_struct plmn_id;
+ kal_uint16 cell_id;
+ as_cell_type_enum cell_type;
+ kal_uint16 access_class;
+ kal_bool cell_support_ps;
+ kal_bool cell_support_cs;
+ kal_uint8 la_code[2];
+ kal_uint8 ra_code;
+ kal_uint8 att_flag;
+ kal_uint8 t3212_timer_val;
+ kal_uint8 nmo;
+ kal_uint8 mscr;
+ kal_uint8 sgsnr;
+ kal_uint8 cell_support_egprs;
+#ifdef __LTE_RAT__
+ kal_bool is_gprs_info_in_si13_deferred;
+#endif /* __LTE_RAT__ */
+ kal_uint8 band;
+}ratcm_gas_sys_info_ind_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ plmn_id_struct plmn_id;
+ kal_uint8 la_code[2];
+ kal_uint16 cell_id;
+}ratcm_gas_cell_global_identity_info_ind_struct;
+
+#if defined(__UMTS_RAT__) || defined (__LTE_RAT__)
+typedef struct{
+ LOCAL_PARA_HDR
+ domain_id_enum connection_domain;
+ rat_type_enum active_rat;
+} ratcm_gas_cell_change_finish_ind_struct;
+#endif /* defined(__UMTS_RAT__) || defined (__LTE_RAT__)*/
+
+#ifdef __GEMINI__
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 is_success; /*TRUE if session can be started*/
+ kal_uint8 req_id;
+} ratcm_gas_ps_session_start_cnf_struct;
+#endif
+
+#ifdef __LTE_RAT__
+typedef struct{
+ LOCAL_PARA_HDR
+ irat_type_enum irat_type;
+ rat_type_enum source_rat;
+ rat_type_enum target_rat;
+ void* as_info_ptr;
+}ratcm_gas_rat_change_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ irat_type_enum irat_type;
+ rat_type_enum source_rat;
+ rat_type_enum target_rat;
+ irat_result_enum irat_result;
+ void* as_info_ptr;
+ domain_id_enum connection_domain;
+} ratcm_gas_rat_change_cnf_struct;
+
+
+#endif /* __LTE_RAT__ */
+
+typedef struct{
+ LOCAL_PARA_HDR
+ ue_capability_struct capability;
+} ratcm_gas_cap_update_req_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ kal_bool is_successful; /* Indicates whether enabling or disabling capability is successful. */
+} ratcm_gas_cap_update_cnf_struct;
+
+
+/*----------------------------------------------------------------------------*/
+/* RATCM to GAS */
+/*----------------------------------------------------------------------------*/
+
+typedef struct{
+ LOCAL_PARA_HDR
+ kal_bool is_sim_inserted;
+
+ /* ALPS01612057: In orginial design, MM will queue SIM_ERROR during PLMN search,
+ but this causes SIM status unsynced between AS/NAS. Because SIM_READY is sent
+ from SIM to RR whereas SIM_ERROR is sent only from SIM to MM. MM proposes the
+ solution: delete pending SIM_READY to sync AS/NAS sim status. */
+ kal_bool is_delete_pending;
+}ratcm_gas_sim_info_reset_req_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+}ratcm_gas_clear_mru_req_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ kal_uint8 la_code[2];
+ forbidden_la_type_enum forbidden_la_type;
+ plmn_id_struct plmn_id;
+}ratcm_gas_add_forbidden_la_req_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ kal_uint8 mui;
+ kal_uint16 gibi_tag;
+ domain_id_enum cn_domain_id;
+ gas_est_cause_enum estb_cause;
+#ifdef __LTE_RAT__
+ csfb_indicator_enum csfb_indicator;
+ csfb_service_type_enum csfb_service_type;
+#endif /* __LTE_RAT__ */
+ kal_bool is_imsi_detach;
+}ratcm_gas_conn_est_req_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ domain_id_enum cn_domain_id;
+}ratcm_gas_conn_rel_req_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ kal_uint8 mui;
+ kal_uint16 gibi_tag;
+ domain_id_enum cn_domain_id;
+ kal_bool is_imsi_detach;
+}ratcm_gas_data_req_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ kal_uint8 la_code[2];
+ plmn_id_struct plmn_id;
+ kal_bool delete_all;
+}ratcm_gas_del_forbidden_la_req_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ kal_uint8 eq_plmn_count;
+ plmn_id_struct eq_plmn_id[MAX_NUM_EQ_PLMN];
+}ratcm_gas_eq_plmn_list_update_req_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ //kal_uint8 requested_band; /* refer to gsm_band_enum */
+ kal_uint8 drx_para[2]; /* for split paging cycle and non-drx timer */
+ kal_uint8 imeisv_value_digit0;
+ kal_uint8 imeisv_value_digit_byte[8];
+#ifdef __MONITOR_PAGE_DURING_TRANSFER__
+ gprs_transfer_preference_enum prefer;
+#endif /* __MONITOR_PAGE_DURING_TRANSFER__ */
+ init_cause_enum init_cause;
+}ratcm_gas_init_req_struct;
+
+#ifdef __DYNAMIC_BAND_SEL__
+/* MAUI_01972920 */
+typedef struct{
+ LOCAL_PARA_HDR
+ kal_uint8 gsm_band; /* refer to band_selection_enum value*/
+}ratcm_gas_set_preferred_band_req_struct;
+#endif
+
+typedef struct{
+ LOCAL_PARA_HDR
+ kal_bool is_tmsi_lai_present;
+ kal_uint8 tmsi[4];
+ lai_struct reg_lai;
+ kal_bool is_ptmsi_rai_present;
+ kal_uint8 ptmsi[4];
+ rai_struct reg_rai;
+}ratcm_gas_paging_param_assign_req_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ kal_bool is_manual_list;
+ scan_type_enum scan_type;
+ kal_uint8 plmn_count;
+ plmn_id_struct plmn_id[MAX_NUM_SEARCH_PLMN];
+ found_mcc_info_struct found_mcc_info;
+ kal_uint32 num_of_band; //number of valid records in band list
+ /*Band list for MCC Band for PLMN list optimization*/
+ kal_uint16 band_list[MAX_SEARCH_BAND_LIST_SIZE];
+ user_list_type_enum user_list_type;
+ kal_uint8 given_number_of_plmn; // used for the USER_LIST_TYPE_GIVEN_TIMER_NUMBER. When xAS found the given number of plmn, xAS return PLMN_LIST_CNF. When value is 0 means xAS do complete list, no need care it.
+#ifdef __IPC_NETWORK_SCAN__
+ network_scan_input_struct network_scan_input;
+#endif
+}ratcm_gas_plmn_list_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool is_user_plmn_list_ongoing;
+} ratcm_gas_plmn_list_status_update_req_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ kal_uint8 trx_id;
+ plmn_search_type_enum plmn_search_type;
+ kal_uint8 plmn_id_count;
+ plmn_id_struct plmn_id[MAX_NUM_SEARCH_PLMN];
+ search_param_container_struct as_param_container;
+ gsm_search_param_container_struct gsm_param;
+}ratcm_gas_plmn_search_req_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ rat_enum rat_info;
+}ratcm_gas_plmn_loss_info_update_req_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ action_on_ready_timer_enum action;
+ gmm_ms_state_enum new_state;
+ kal_uint32 value;
+}ratcm_gas_ready_timer_update_req_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ regn_proc_status_enum proc_status;
+ kal_uint32 t3212_or_t3302;
+ gmm_ms_state_enum ms_state;
+ mmas_regn_status_enum regn_status;
+ plmn_search_status_enum plmn_search_status;
+ plmn_search_type_enum plmn_search_type;
+ /* __AUTH_FAIL_BAR_CELL__ */
+ lai_struct lai; /* for bar cell list */
+ kal_uint32 cell_id; /* for bar cell list (argument type sync. with UAS) */
+ /* __AUTH_FAIL_BAR_CELL__ */
+}ratcm_gas_regn_status_update_req_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ kal_uint8 r_eq_plmn_count;
+ plmn_id_struct r_eq_plmn_id[MAX_NUM_EQ_PLMN];
+} ratcm_gas_rplmn_eq_plmn_list_update_req_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ kal_bool is_gprs_required;
+}ratcm_gas_service_change_req_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ rat_enum rat;
+ rat_enum reported_rat;
+}ratcm_gas_set_rat_mode_req_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ kal_uint32 old_tlli;
+ kal_uint32 new_tlli;
+ tlli_update_type_enum status_tlli;
+ rai_struct rai;
+}ratcm_gas_tlli_assign_req_struct;
+
+#ifdef __MONITOR_PAGE_DURING_TRANSFER__
+typedef struct{
+ LOCAL_PARA_HDR
+ gprs_transfer_preference_enum prefer;
+}ratcm_gas_set_gprs_transfer_preference_req_struct;
+#endif /* __MONITOR_PAGE_DURING_TRANSFER__ */
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool cbch_req;
+} ratcm_gas_cbch_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint16 cbmi[CB_MAX_MSG_CBMI_NUM];
+ kal_uint16 cbmid[CB_MAX_MSG_CBMID_NUM];
+ kal_uint16 cbmir[CB_MAX_MSG_CBMIR_NUM];
+ kal_uint16 dcs[CB_MAX_LANG_NUM];
+ kal_bool is_all_language_on;
+ l4c_cb_set_type_enum set_type;
+} ratcm_gas_cb_update_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint16 mi;
+ kal_uint16 sn;
+} ratcm_gas_cb_msg_removal_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint16 sn;
+ kal_uint16 mi;
+ kal_uint8 dcs;
+ kal_uint8 page;
+ kal_uint8 pages;
+ kal_uint8 is_mids;
+ kal_uint8 mi_index;
+ kal_uint8 page_data[CB_MAX_DATA_NUM_PER_PAGE];
+
+ kal_uint8 valid_blk_num;
+} ratcm_gas_cb_page_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ cb_geography_enum geography_type;
+} ratcm_gas_cb_gs_change_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_expiry; /*KAL_TRUE: T3122 expires, MM will retry LU immediately
+ KAL_FALSE: T3122 is stopped */
+} ratcm_gas_t3122_timeout_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_expiry; /*KAL_TRUE: CCO activation timer expires, MM will retry LU immediately
+ KAL_FALSE: CCO activation timer is stopped */
+} ratcm_gas_cco_activation_time_timeout_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 plmn_id_count;
+ plmn_id_struct plmn_id[MD1_MAX_NUM_HPLMN]; /* MAX_NUM_HPLMN: 4 */
+ kal_uint8 home_country_mcc[3];
+} ratcm_gas_hplmn_info_update_req_struct; //mtk02475: for MAUI_02456964
+
+#if defined(__GEMINI__)
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 sim_config_status;
+ kal_uint8 sim_insert_status;
+} ratcm_gas_sim_status_update_req_struct;
+
+#endif /* __GEMINI__ || __SGLTE__ */
+
+#ifdef __GEMINI__
+typedef struct {
+ LOCAL_PARA_HDR
+} ratcm_gas_suspend_ind_struct;
+
+
+/* MAUI_02865693 */
+typedef struct {
+ LOCAL_PARA_HDR
+ as_gemini_status_enum as_gemini_status;
+} ratcm_gas_virtual_mode_ind_struct;
+
+/* MAUI_02877191, this message contains no local_param except for GEMINI2.0 */
+typedef struct {
+ LOCAL_PARA_HDR
+ as_gemini_status_enum as_gemini_status;
+} ratcm_gas_resume_ind_struct;
+
+#endif /* __GEMINI__ */
+
+#if defined(__GEMINI__) && defined( __UMTS_RAT__)
+typedef struct {
+ LOCAL_PARA_HDR
+} ratcm_gas_no_ir_sig_proc_req_struct;
+#endif
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 imeisv_value_digit0;
+ kal_uint8 imeisv_value_digit_byte[8];
+}ratcm_gas_set_imei_req_struct;
+
+#if defined(__GEMINI__) && defined( __LTE_RAT__)
+typedef struct {
+ LOCAL_PARA_HDR
+ cs_status_enum status;
+} ratcm_gas_cs_status_update_req_struct;
+#endif
+
+#ifdef __LTE_RAT__
+typedef struct{
+ LOCAL_PARA_HDR
+ irat_type_enum irat_type;
+ rat_type_enum source_rat;
+ rat_type_enum target_rat;
+ void* as_info_ptr;
+ ratcm_gas_security_mode_req_struct security_mode_info;
+ csfb_indicator_enum csfb_indicator;
+ kal_bool is_lai_valid;
+ lai_struct lai;
+}ratcm_gas_rat_change_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ irat_type_enum irat_type;
+ rat_type_enum source_rat;
+ rat_type_enum target_rat;
+ irat_result_enum irat_result;
+ irat_reject_cause_enum irat_reject_cause; //Reject cause when irat_result is equal to IR_RESULT_REJECT.
+ void* as_info_ptr;
+} ratcm_gas_rat_change_rsp_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ paging_type_enum paging_type;
+ csfb_service_type_enum paging_service;
+ kal_bool is_paging_retry;
+}ratcm_gas_page_req_struct;
+
+#endif /* __LTE_RAT__ */
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+typedef struct{
+ LOCAL_PARA_HDR
+ aral_op_enum op_code;
+ plmn_id_struct plmn;
+ kal_uint8 ara_start[2];
+ kal_uint8 ara_end[2];
+}ratcm_gas_aral_update_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 num_of_nw;
+ emc_forbidden_nw_list_struct nw_list[MAX_FORBIDDEN_NETWORK_NUM];
+} ratcm_gas_emc_forbidden_nw_list_update_req_struct;
+
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_pgcheck_on;
+} ratcm_gas_set_pgcheck_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ call_status_enum call_status;
+ call_type_indication_enum call_type;
+} ratcm_gas_call_status_ind_struct;
+
+/*Sniffer related message structures*/
+//MSG_ID_RATCM_GAS_SNIFFER_START_REQ
+typedef ratcm_as_sniffer_start_req_struct ratcm_gas_sniffer_start_req_struct;
+
+//MSG_ID_RATCM_GAS_SNIFFER_STOP_REQ
+typedef ratcm_as_sniffer_stop_req_struct ratcm_gas_sniffer_stop_req_struct;
+
+//MSG_ID_RATCM_GAS_SIGNAL_APPEAR_IND
+typedef ratcm_as_signal_appear_ind_struct ratcm_gas_signal_appear_ind_struct;
+
+//MSG_ID_RATCM_GAS_CHECK_ACTIVE_RAT_REQ,
+typedef ratcm_as_check_active_rat_req_struct ratcm_gas_check_active_rat_req_struct;
+
+//MSG_ID_RATCM_GAS_CHECK_ACTIVE_RAT_CNF
+typedef ratcm_as_check_active_rat_cnf_struct ratcm_gas_check_active_rat_cnf_struct;
+
+//MSG_ID_RATCM_GAS_SET_ACTIVE_RAT_REQ,
+typedef ratcm_as_set_active_rat_req_struct ratcm_gas_set_active_rat_req_struct;
+
+//MSG_ID_RATCM_GAS_SET_ACTIVE_RAT_CNF
+typedef ratcm_as_set_active_rat_cnf_struct ratcm_gas_set_active_rat_cnf_struct;
+
+#ifdef __GEMINI__
+typedef struct{
+ LOCAL_PARA_HDR
+ kal_bool is_data_allowed;
+}ratcm_gas_data_allow_req_struct;
+#endif
+
+typedef struct{
+ LOCAL_PARA_HDR
+ plmn_band_struct plmn_band;
+}ratcm_gas_plmn_band_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ rfoff_cause_enum rfoff_cause;
+} ratcm_gas_rfoff_req_struct;
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_auth_download_ongoing;
+} ratcm_gas_rsim_auth_download_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool normal_oos_recovery_round_present;
+ kal_uint8 normal_oos_recovery_round; // default value = 5, range [2, 10]
+ kal_bool inactive_fullband_period_present;
+ kal_uint16 inactive_fullband_period; // default = 200s, range: [90, 360]
+ kal_bool inactive_sniffer_period_present;
+ kal_uint8 inactive_sniffer_period; // default = 30s, range: [10, 60]
+ kal_bool is_inactive_mode_present;
+ kal_bool is_inactive_mode; // True: enter inactive mode, False: leave inactive mode
+} ratcm_gas_inactive_mode_configuration_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool is_over_inactive_mode_threshold; // True: recovery counter > normal_oos_recovery_round
+} ratcm_gas_service_recovery_round_update_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ elevator_mode_enum elevator_mode;
+} ratcm_gas_elevator_mode_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ csfb_page_config_enum csfb_page_config;
+}ratcm_gas_csfb_page_config_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ network_scan_2g_output_struct nw_scan_2g_output;
+} ratcm_gas_plmn_scan_ind_struct;
+
+
+typedef gmmreg_lte_normal_service_loss_update_req_struct ratcm_gas_lte_normal_service_loss_update_req_struct ;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ plmn_id_struct plmn_id;
+} ratcm_gas_plmn_info_update_req_struct;
+
+typedef ratcm_gas_cb_msg_removal_req_struct ratcm_gas_cb_dup_det_timer_stop_ind_struct;
+
+#endif /* _RATCM_GAS_STRUCT_H */
diff --git a/mcu/protocol/interface/general/ratcm_llc_struct.h b/mcu/protocol/interface/general/ratcm_llc_struct.h
new file mode 100644
index 0000000..77cbd00
--- /dev/null
+++ b/mcu/protocol/interface/general/ratcm_llc_struct.h
@@ -0,0 +1,134 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * ratcm_llc_struct.h
+ *
+ * Project:
+ * --------
+ * MONZA
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ ******************************************************************************/
+
+#ifndef _RATCM_LLC_STRUCT_H
+#define _RATCM_LLC_STRUCT_H
+
+#include "mcd_l3_inc_gprs_struct.h"
+#include "as2nas_struct.h"
+#include "kal_general_types.h"
+#include "kal_public_defs.h"
+#include "l3llc_enums.h"
+#include "irat_common_enums.h"
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint32 old_tlli;
+ kal_uint32 new_tlli;
+ tlli_update_type_enum tlli_update_type; /* tlli_update_type_enum */
+ kal_uint8 cipher_algo; /* 0=no ciphering, 1=GEA1, 2=GEA2, 3=GEA3*/
+ kal_uint8 is_gprs_cipher_key_info_present; /* if GPRS cipher key present */
+ kal_uint8 gprs_cipher_key_info[KC_LEN]; /* GPRS cipher key (Kc) */
+ kal_uint8 is_gprs_cipher_key128_info_present; /* if GPRS cipher key128 present */
+ kal_uint8 gprs_cipher_key128_info[KC128_LEN]; /* GPRS cipher key128 (Kc) */
+} ratcm_llc_assign_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint32 tlli; /* xyz*/
+} ratcm_llc_resume_req_struct; /* Should be same as mm_ratcm_llc_resume_req_struct */
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint32 tlli; /* xyz*/
+} ratcm_llc_suspend_req_struct; /* Should be same as mm_ratcm_llc_suspend_req_struct */
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint32 tlli;
+ kal_uint8 cause;
+} ratcm_llc_status_ind_struct; /* Should be same as mm_ratcm_llc_status_ind_struct */
+
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint32 tlli; /* xyz*/
+ kal_uint8 cause; /* res_req_cause */
+ kal_uint8 cell_update_type; /* R99 feature: llgmm_cell_update_type_enum */
+} ratcm_llc_trigger_req_struct; /* Should be same as mm_ratcm_llc_trigger_req_struct */
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 sapi;
+ kal_uint8 radio_priority;
+ kal_uint8 cipher_ind;
+ kal_uint8 msg_type;
+ kal_uint8 nsapi;
+ kal_uint32 tlli;
+ kal_uint8 pfi; /* R99 feature */
+ concise_qos_struct qos_param;
+ peer_msg_id_struct peer_msg_id;
+} ratcm_llc_unitdata_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 sapi;
+ kal_bool cipher_ind;
+ kal_uint32 tlli;
+} ratcm_llc_unitdata_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 tx_status; /* MAUI_02388489 */
+ peer_msg_id_struct peer_msg;
+} ratcm_llc_as_nas_data_cnf_struct;
+
+typedef ratcm_llc_assign_req_struct llc_gmm_assign_req_struct;
+typedef ratcm_llc_trigger_req_struct llc_gmm_trigger_req_struct;
+typedef ratcm_llc_suspend_req_struct llc_gmm_suspend_req_struct;
+typedef ratcm_llc_resume_req_struct llc_gmm_resume_req_struct;
+typedef ratcm_llc_status_ind_struct llc_gmm_status_ind_struct;
+
+#endif /* RATCM_LLC_STRUCT_H */
diff --git a/mcu/protocol/interface/general/ratcm_ratdm_struct.h b/mcu/protocol/interface/general/ratcm_ratdm_struct.h
new file mode 100644
index 0000000..3ee4853
--- /dev/null
+++ b/mcu/protocol/interface/general/ratcm_ratdm_struct.h
@@ -0,0 +1,76 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * ratcm_ratdm_struct.h
+ *
+ * Project:
+ * --------
+ * MONZA
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ ******************************************************************************/
+
+#ifndef _RATCM_RATDM_STRUCT_H
+#define _RATCM_RATDM_STRUCT_H
+
+#include "kal_general_types.h"
+#include "kal_public_defs.h"
+#include "nwsel_ratdm_struct.h"
+
+
+typedef struct {
+ LOCAL_PARA_HDR
+ ratdm_rat_enum current_rat;
+} ratcm_ratdm_regain_coverage_req_struct;
+
+#ifdef __GEMINI__
+typedef struct {
+ LOCAL_PARA_HDR
+ as_gemini_status_enum as_gemini_status;
+} ratcm_ratdm_virtual_mode_ind_struct;
+#endif
+
+
+#endif /* _RATCM_RATDM_STRUCT_H */
diff --git a/mcu/protocol/interface/general/ratcm_rrce_enums.h b/mcu/protocol/interface/general/ratcm_rrce_enums.h
new file mode 100644
index 0000000..cb0b413
--- /dev/null
+++ b/mcu/protocol/interface/general/ratcm_rrce_enums.h
@@ -0,0 +1,315 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * ratcm_rrce_enum.h
+ *
+ * Project:
+ * --------
+ * MONZA
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ----------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ ******************************************************************************/
+
+#ifndef _RATCM_RRCE_ENUMS_H
+#define _RATCM_RRCE_ENUMS_H
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+/*
+typedef enum
+{
+ PAGE_TYPE_INVALID = 0,
+ PAGE_TYPE_IMSI,
+ PAGE_TYPE_TMSI,
+ PAGE_TYPE_PTMSI
+} PagingIdType;
+*/
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+typedef enum
+{
+ HIGH_Priority = 0,
+ LOW_Priority = 1,
+ BOTH = 2
+} SRB_Priority;
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+
+
+/* ENUMERATED EstablishmentCause */
+typedef enum
+{
+ originatingConversationalCall,
+ originatingStreamingCall,
+ originatingInteractiveCall,
+ originatingBackgroundCall,
+ originatingSubscribedTrafficCall,
+ EstablishmentCause_terminatingConversationalCall,
+ EstablishmentCause_terminatingStreamingCall,
+ EstablishmentCause_terminatingInteractiveCall,
+ EstablishmentCause_terminatingBackgroundCall,
+ emergencyCall,
+ interRAT_CellReselection,
+ interRAT_CellChangeOrder,
+ registration,
+ detach,
+ originatingHighPrioritySignalling,
+ originatingLowPrioritySignalling,
+ callRe_establishment,
+ EstablishmentCause_terminatingHighPrioritySignalling,
+ EstablishmentCause_terminatingLowPrioritySignalling,
+ EstablishmentCause_terminatingCauseUnknown,
+ EstablishmentCause_mbms_Reception,//R6
+ EstablishmentCause_mbms_PTP_RB_Request,//R6
+ originatingCSVideoCall //R6
+}
+RATCM_RRC_EstablishmentCause;
+
+#endif /* _RATCM_RRCE_ENUMS_H */
diff --git a/mcu/protocol/interface/general/ratcm_rrce_struct.h b/mcu/protocol/interface/general/ratcm_rrce_struct.h
new file mode 100644
index 0000000..c329e5f
--- /dev/null
+++ b/mcu/protocol/interface/general/ratcm_rrce_struct.h
@@ -0,0 +1,634 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * ratcm_rrce_struct.h
+ *
+ * Project:
+ * --------
+ * MONZA
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ ******************************************************************************/
+
+#ifndef _RATCM_RRCE_STRUCT_H
+#define _RATCM_RRCE_STRUCT_H
+
+/* MAUI_02828210, redundant header removal */
+#include "ratcm_rrce_enums.h"
+#include "mcd_l3_inc_struct.h"
+#include "ratcm_uas_struct.h"
+//#include "app_ltlcom.h"
+#include "kal_public_api.h"
+#include "kal_general_types.h"
+#include "l3_inc_enums.h"
+
+//move LAC to ratcm_uas_struct.h since CSCE will also need it.
+//typedef kal_uint16 LAC;
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+//typedef kal_uint8 NAS_MUI;
+
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+//UDC
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ kal_bool is_tmsi_lai_present;
+ /*Note that bit 8 of tmsi[0] is MSB and bit 1 of tmsi[3] is LSB of TMSI */
+ kal_uint8 tmsi[4];
+ kal_bool is_lai_abnormal; /* MAUI_01959495*/
+ lai_struct reg_lai;
+ kal_bool is_ptmsi_rai_present;
+ /*Note that bit 8 of ptmsi[0] is MSB and bit 1 of ptmsi[3] is LSB of P-TMSI*/
+ kal_uint8 ptmsi[4];
+ kal_bool is_rai_abnormal; /* MAUI_01959495 */
+ rai_struct reg_rai;
+ kal_uint8 PS_CNSpecificDRX_CLC;
+} ratcm_rrce_paging_param_assign_req_struct ;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ mmas_regn_status_enum regn_status;
+ kal_bool PowerOff;
+}ratcm_rrce_regn_status_update_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ RATCM_RRC_PagingCause pagingCause;
+ /* Description: Identifies the type of core network domain. This an
+ enumerated type (RRC_CN_DomainIdentity_cs_domain, RRC_CN_DomainIdentity_ps_domain). */
+ domain_id_enum cn_DomainIdentity;
+ ue_id_type_enum pagingIdType;
+} ratcm_rrce_page_ind_struct ;
+
+/*2013/03/26, local release enhancement*/
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ RATCM_RRC_LocalReleaseType localReleaseType;
+ kal_uint16 locally_released_PS_RAB_bitmap;
+} ratcm_rrce_local_release_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+// NAS_MUI MUI;
+ kal_uint8 MUI;
+ gibi_tag_type gibiTag;
+ domain_id_enum cnDomainID;
+ RATCM_RRC_EstablishmentCause cause;
+ kal_bool is_service_req;
+#ifdef __R6_DSAC__
+ kal_bool isDsacPresent;
+ kal_uint16 selectedDsacInfo;
+#endif
+ plmn_id_struct selectedplmn;
+#ifdef __PPACR_SUPPORT__
+ ppac_checked_type_enum PPACCheckedType;
+ kal_uint16 selectedPPACInfo; //used by PPAC_LR_ALLOWED
+#endif
+#ifdef __LTE_RAT__
+ kal_bool is_csfb; /* Ivy Ivy */
+ csfb_indicator_enum csfb_indicator; // For AT&T requirement: CSFB_REJECT
+#endif /* __LTE_RAT__*/
+ umts_service_priority_enum service_priority; // [Gemini][Two PS attach]
+} ratcm_rrce_conn_est_req_struct ;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ domain_id_enum cnDomainID ;
+ as_est_cnf_cause_enum status; /* status of the RRC connection */
+ kal_bool wait_gibi_flag;
+ kal_bool is_rrc_conn_already_existed;
+} ratcm_rrce_conn_est_cnf_struct ;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ // NAS_MUI MUI;
+ kal_uint8 MUI;
+ gibi_tag_type gibiTag;
+ domain_id_enum cnDomainID ;
+ DC_Priority priority ;
+ kal_bool is_service_req;
+} ratcm_rrce_data_transfer_req_struct ;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ domain_id_enum cnDomainID ;
+ /* This flag is used to inform RATCM that the integrity is applied on this NAS message. Note that at this time,
+ it is possible RRCE has not sent RATCM_RRCE_SECURITY_MODE_COMPLETE_IND.*/
+ kal_bool integrityApplied;
+} ratcm_rrce_data_transfer_ind_struct ;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ // NAS_MUI MUI;
+ kal_uint8 MUI;
+ DC_Status status;
+ domain_id_enum cnDomainID ;
+ DC_Priority priority ;
+}ratcm_rrce_data_transfer_cnf_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ domain_id_enum cnDomainID ;
+ as_rel_scope_enum scope;
+ conn_rel_cause_enum cause;
+} ratcm_rrce_conn_rel_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ domain_id_enum cnDomainID ;
+ RATCM_RRC_ReleaseCause cause; /* cause of the connection release */
+ kal_bool waitGibiFlag;
+ kal_bool waitForReleaseInd; /*Inform NAS to wait for connection Release if Network releases the last signalling connection*/
+} ratcm_rrce_conn_rel_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ kal_bool is_rsva_abort;
+} ratcm_rrce_conn_loss_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ domain_id_enum cnDomainID ;
+ as_rel_scope_enum scope;
+ /* True means the signaling connection of this domain has been released successfully.
+ Otherwise, it means the release fails. Currently, it will report "failure" only during inter-RAT procedure.
+ RATCM should not resend the release of connection until the completion of inter-RAT procedure.*/
+ kal_bool Is_successful;
+ kal_bool waitGibiFlag;
+ kal_bool waitForReleaseInd; /*Inform NAS to wait for connection Release*/
+} ratcm_rrce_conn_rel_cnf_struct;
+
+/*
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+} ratcm_rrce_conn_loss_ind_struct;
+*/
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ SRB_Priority priority;
+ domain_id_enum cnDomainID;
+}ratcm_rrce_rb_re_establishment_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ SRB_Priority priority;
+ domain_id_enum cnDomainID;
+}ratcm_rrce_rb_re_establishment_rsp_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ kal_bool newKeys;
+ umts_security_key security_key;
+ kal_bool is_power_on;
+ kal_uint8 cksn;
+} ratcm_rrce_security_mode_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ domain_id_enum cnDomainID;
+ kal_bool integrityEnabled;
+ Ciphering_Status cipheringStatus;
+ kal_uint8 service_req_mui;
+} ratcm_rrce_security_mode_complete_ind_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ domain_id_enum cnDomainID;
+ Ciphering_Status cipheringStatus;
+} ratcm_rrce_security_mode_change_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ kal_bool cs_Domain_ResetKeys;
+ kal_bool ps_Domain_ResetKeys;
+} ratcm_rrce_reset_keys_ind_struct;
+
+#ifdef __TC7__CS__SUPPORT__
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ kal_bool isForceLau;
+}ratcm_rrce_cell_change_start_ind_struct;
+#endif
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+} ratcm_rrce_force_rel_req_struct;
+
+
+#if defined(__NO_PSDATA_SEND_SCRI__) || defined(__FAST_DORMANCY__)
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ kal_bool force_send_SCRI;
+ end_session_cause_enum cause;
+} ratcm_rrce_end_ps_data_session_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ end_session_result_enum result;
+} ratcm_rrce_end_ps_data_session_cnf_struct;
+#endif /* __NO_PSDATA_SEND_SCRI__ || __FAST_DORMANCY__ */
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ cs_status_enum status;
+} ratcm_rrce_cs_status_update_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ kal_bool is_pch_state;
+} ratcm_rrce_rrc_state_ind_struct;
+
+#ifdef __GEMINI__
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ nas_req_gemini_ps_high_sem_enum gemini_ps_high_sem_status;
+} ratcm_uas_gemini_ps_high_sem_req_struct;
+
+//medium ps
+typedef struct{
+ LOCAL_PARA_HDR
+ kal_bool is_data_allowed;
+}ratcm_uas_data_allow_req_struct;
+#endif //__GEMINI__
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_pgcheck_on;
+} ratcm_rrce_set_pgcheck_req_struct;
+
+//MSG_ID_RATCM_RRCE_NO_DATA_DETECT_IND
+typedef struct
+{
+ LOCAL_PARA_HDR
+}ratcm_rrce_no_cc_data_detect_ind_struct;
+
+
+#endif /* _RATCM_RRCE_STRUCT_H */
diff --git a/mcu/protocol/interface/general/ratcm_slce_enums.h b/mcu/protocol/interface/general/ratcm_slce_enums.h
new file mode 100644
index 0000000..d4cd7de
--- /dev/null
+++ b/mcu/protocol/interface/general/ratcm_slce_enums.h
@@ -0,0 +1,75 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * ratcm_slce_struct.h
+ *
+ * Project:
+ * --------
+ * MONZA
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ----------------------------------------------------------------------------
+ * $Log:$
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ * Add copyright header.
+ ******************************************************************************/
+
+#ifndef _RATCM_SLCE_ENUMS_H
+#define _RATCM_SLCE_ENUMS_H
+
+
+typedef enum CRC_Append_Cmd{
+ UMONITOR_NO_CRC,
+ UMONITOR_APPEND_CRC
+}CRC_Append_Cmd;
+
+
+#endif /* _RATCM_SLCE_ENUMS_H */
diff --git a/mcu/protocol/interface/general/ratcm_slce_struct.h b/mcu/protocol/interface/general/ratcm_slce_struct.h
new file mode 100644
index 0000000..a16aec5
--- /dev/null
+++ b/mcu/protocol/interface/general/ratcm_slce_struct.h
@@ -0,0 +1,215 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * ratcm_slce_struct.h
+ *
+ * Project:
+ * --------
+ * MONZA
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log:$
+ *
+ * 06 11 2020 vend_mtb_aritha002
+ * [MOLY00519500] ???????19165??864039041106553????????????
+ *
+ * NR15.R3.MP
+ *
+ * 04 16 2015 elle.sun
+ * [MOLY00087788] [Universal Bin] FDD SLCE Check-in
+ * UBIN Phase2 - set RAT and mode switch.
+ *
+ * 09 28 2012 bao.han
+ * [MOLY00004236] [interface][service][kal]remove stack_ltlcom.h
+ * .
+ *
+ * 09 28 2012 austin.tsai
+ * [MOLY00004236] [interface][service][kal]remove stack_ltlcom.h
+ * .
+ *
+ * 11 09 2011 elle.sun
+ * removed!
+ * .
+ *
+ * 12 14 2010 cosine.jheng
+ * removed!
+ * Integration change.
+ *
+ * 10 20 2010 cosine.jheng
+ * removed!
+ * [RATCM][RHR]Check in ratcm file in uas\interface
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ * Add copyright header.
+ ****************************************************************************/
+
+#ifndef _RATCM_SLCE_STRUCT_H
+#define _RATCM_SLCE_STRUCT_H
+
+/* MAUI_02828210, redundant header removal */
+#include "ratcm_slce_enums.h"
+//#include "kal_general_types.h"
+//#include "app_ltlcom.h" Elle20111011 - MSBB private header in BSP cleaning
+#include "kal_public_api.h"//Austin: remove stack_ltlcom.h and replace to kal_public_api.h
+#include "l3_inc_enums.h"
+#include "uas_common_enums.h"
+#include "gmss_public.h"
+
+typedef kal_uint8 RAB_Identity;
+typedef kal_uint8 NAS_Synchronisation_Indicator;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ kal_uint8 validity;
+
+ RAB_Identity rabId; /* Range from 5~15 */
+ channel_mode_enum rab_mode;
+ NAS_Synchronisation_Indicator nasSyncIndicator;
+
+} udc_rab_generic_ind_struct;
+
+/************************/
+/* UDC_RAB_ESTABLISHMENT */
+/************************/
+/* Description: These operations allow the transfer of control
+ messages for radio access bearer establishment between non-access
+ strata elements on each side of the access interface. The
+ operations allow the IF side to initialise a radio access
+ bearer. The operation also implies a request to the AS to allocate
+ transmission resources to the radio access bearer.
+
+ A radio access bearer identification uniquely identifies the radio
+ access bearer. It is used in all primitives that pertain to the
+ radio access bearer. It also serves as the binding to a NAS call.
+
+ The Iu bearer identification identifies the Iu connection. A
+ quality of service request specifies the bearer characteristics
+ that apply to the radio access bearer (ref: [23.110;6.2.2.3.4]).
+*/
+typedef udc_rab_generic_ind_struct ratcm_slce_rab_establishment_ind_struct ;
+
+/************************/
+/* UDC_RAB_MODIFY */
+/************************/
+/* Description: These operations allow the transfer of control
+ messages for radio access bearer modification between non-access
+ strata elements on each side of the access interface. The
+ operations allow the IF side to modify a radio access
+ bearer.
+ A radio access bearer identification uniquely identifies the radio
+ access bearer. It is used in all primitives that pertain to the
+ radio access bearer. It also serves as the binding to a NAS call.
+*/
+typedef udc_rab_generic_ind_struct ratcm_slce_rab_modify_ind_struct ;
+
+/******************/
+/* UDC_RAB_RELEASE */
+/******************/
+/* Description: These operations allow the transfer of radio access
+ bearer release messages between non-access strata elements on each
+ side of the access interface. The operations allow IF side to
+ release a radio access bearer (ref: [23.110;6.2.2.3.5]).
+
+ This primitive indicates the release of the radio access bearer to upper layers. */
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ RAB_Identity rabId; /* Range from 5~15 */
+ rab_release_cause_enum rel_cause;
+
+}ratcm_slce_rab_release_ind_struct ;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ CRC_Append_Cmd cmd;
+}ratcm_slce_monitoring_close_loop_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+}ratcm_slce_monitoring_close_loop_cnf_struct;
+
+
+/****************************************************************************
+ * RATCM_SLCE_MONITORING_CLOSE_LOOP_IND
+ *
+ * Sent by SLCE to RATCM to indicate that the loop test mode 2 has been stopped by lower lower layer.
+ *
+ ****************************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+} ratcm_slce_monitoring_close_loop_ind_struct ;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ umts_duplex_mode_type source_umts_duplex_mode;
+ umts_duplex_mode_type target_umts_duplex_mode;
+ lte_duplex_mode_type source_lte_duplex_mode;
+ lte_duplex_mode_type target_lte_duplex_mode;
+ mode_switch_cause_enum cause;
+} ratcm_slce_duplex_mode_change_req_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ kal_bool result;
+} ratcm_slce_duplex_mode_change_cnf_struct;
+
+#endif /* _RATCM_SLCE_STRUCT_H */
diff --git a/mcu/protocol/interface/general/ratcm_uas_enums.h b/mcu/protocol/interface/general/ratcm_uas_enums.h
new file mode 100644
index 0000000..9cf470a
--- /dev/null
+++ b/mcu/protocol/interface/general/ratcm_uas_enums.h
@@ -0,0 +1,107 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * ratcm_uas_enum.h
+ *
+ * Project:
+ * --------
+ * MONZA
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ----------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ ******************************************************************************/
+
+#ifndef _RATCM_UAS_ENUMS_H
+#define _RATCM_UAS_ENUMS_H
+
+#define IS_VALID_CN_DomainSysInfoList(ptr) \
+(IS_INRANGE((ptr)->count, 0, MAX_CN_DOMAIN))
+
+#define IS_VALID_RRC_NAS_SystemInformationGSM_MAP(ptr) \
+((ptr)->numOctets<=8)
+
+#define MAX_PLMN_ID_DIGIT (3)
+#define MAX_CN_DOMAIN (2)
+#define MAX_GIBI_TAG 0x01FF
+#define MIN_GIBI_TAG 0x0100
+
+typedef enum
+{
+ ACCESS_CLASS_EMERGENCY_BLOCKED = 0,
+ ACCESS_CLASS_NORMAL_BLOCKED,
+ ACCESS_CLASS_BOTH_BLOCKED,
+ ACCESS_CLASS_BOTH_ALLOWED,
+ ACCESS_CLASS_NOT_CHECKED
+} access_class_status_enum;
+#define IS_VALID_ACCESS_CLASS_STATUS(status) \
+(IS_INRANGE((status), ACCESS_CLASS_EMERGENCY_BLOCKED, ACCESS_CLASS_NOT_CHECKED))
+
+#define IS_VALID_CellIdentity(id) ((id)<=0x0FFFFFFF)
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+#endif /* _RATCM_UAS_ENUMS_H */
diff --git a/mcu/protocol/interface/general/ratcm_uas_struct.h b/mcu/protocol/interface/general/ratcm_uas_struct.h
new file mode 100644
index 0000000..9dce9da
--- /dev/null
+++ b/mcu/protocol/interface/general/ratcm_uas_struct.h
@@ -0,0 +1,534 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * ratcm_uas_struct.h
+ *
+ * Project:
+ * --------
+ * MONZA
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ ******************************************************************************/
+
+#ifndef _RATCM_UAS_STRUCT_H
+#define _RATCM_UAS_STRUCT_H
+
+/* MAUI_02828210, redundant header removal */
+#include "ratcm_uas_enums.h"
+#include "mcd_l3_inc_struct.h"
+#include "kal_general_types.h"
+#include "l3_inc_enums.h"
+#include "kal_public_api.h"
+#include "ps_public_enum.h"
+#include "l3_inc_local.h"
+#include "ps_public_struct.h"
+#include "irat_common_struct.h"
+
+typedef kal_uint16 LAC;
+typedef kal_uint16 gibi_tag_type;
+/*typedef kal_uint8 PLMN_Identity[MAX_PLMN_ID_DIGIT];*/
+typedef kal_uint32 cell_identity_type;
+
+typedef struct nas_sys_info_gsm_map_struct
+{
+ kal_uint8 numOctets;
+ kal_uint8 stringData[8];
+} nas_sys_info_gsm_map_struct;
+
+typedef struct CN_DomainSysInfo
+{
+ /* Description: Identifies the type of core network domain. This an
+ enumerated type (RRC_CN_DomainIdentity_cs_domain, RRC_CN_DomainIdentity_ps_domain). */
+ domain_id_enum cn_DomainIdentity;
+ /* Description: NAS system information (GSM-MAP) This information
+ element contains system information that belongs to the
+ non-access stratum for a GSM-MAP type of PLMN. This information
+ is transparent to RRC. It may contain either information
+ specific to one CN domain (CS or PS) or information common for
+ both CN domains (Ref: [25.331;10.3.1.9]).
+ RRC_NAS_SystemInformationGSM_MAP information element description:
+ - length - Number of bytes
+ - value[8] - Array of bytes (maximum is 8). */
+ nas_sys_info_gsm_map_struct cn_specificGSM_MAP_NAS_SysInfo;
+} CN_DomainSysInfo;
+
+typedef struct CN_DomainSysInfoList
+{
+ kal_uint8 count;
+ CN_DomainSysInfo value[MAX_CN_DOMAIN];
+} CN_DomainSysInfoList;
+
+/* UMTS security keys data structure originally used by RATCM and RRCE.
+ * Now it's reused in multimode development.
+ */
+typedef struct {
+ domain_id_enum cnDomainID;
+ kal_uint8 umts_cipheringKey[CK_LEN];
+ kal_uint8 umts_integrityKey[IK_LEN];
+} umts_security_key;
+
+typedef struct{
+ kal_bool is_valid;
+ gibi_tag_type gibi_tag;
+} gibiTag_info;
+
+/****************************/
+/* UGC_INFORMATION_BROADCAST */
+/****************************/
+/* Description: this operation consists in the broadcast from IF
+ * toward User Equipment of some information in some geographical
+ * area.
+ *
+ * a GC Information broadcast indication primitive is issued to the
+ * NAS entity UE over the General Control (GC) SAP when the RRC layer
+ * finds out that the non-access part of the system information has
+ * been changed.
+ *
+ * This information is to be used by the User Equipment for instance
+ * to choose among access points or to be taken into account during
+ * initial access. The information can also be destinated to an
+ * application.
+ *
+ * UGC Information broadcast is sent to the NAS whenever the UE, in idle mode,
+ * has started camping on a cell, and has sufficient SIBs for a connection, or
+ * if the NAS data in SIB 1 changes.In addition NAS updates optionally contained
+ * in Radio Bearer Setup, Active Set Update, etc. shall be reported using this
+ * primitive. The primitive is also used subsequently to an Inter-RAT cell re-
+ * selection / change over or Inter-RAT handover to UMTS. In that case, the
+ * primitive may be issued with "additional info flag= FALSE" to indicate that
+ * no CN information is included.
+ *
+ * Note 1: GSM-MAP NAS contains LAC & RAC with the PLMN id and UTRAN cell id.
+ * The NAS should be able to map UTRAN cell id and Location Area/Routing Area.
+ *
+ * Note 2: In connected mode, e.g. subsequently to a cell reselection, CN Common
+ * GSM_MAP NAS SysInfo is not forwarded to upper layer.
+ * Ref: [23.110-340;6.2.2.1.1] & [25.304;10.1,10.2].
+ */
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ gibi_tag_type gibi_tag;
+ cell_identity_type cell_id;
+
+ kal_uint16 update_bitmask;
+
+ #define INFO_BITMASK_CN_INFO 0x0001
+ #define INFO_BITMASK_DATA_SPEED_SUPPORT 0x0002
+ #define INFO_BITMASK_AC 0x0004
+ #define INFO_BITMASK_DSAC 0x0008
+ #define INFO_BITMASK_PPACR 0x0010
+ #define INFO_BITMASK_CSG_INFO 0x0020
+ #define INFO_BITMASK_BAND_INFO 0x0040
+
+ /* CN_INFO */
+ kal_uint8 cn_info_validity;
+
+ #define CN_Info_plmn_cellType_valid 0x01
+ #define CN_Info_cn_CommonGSM_MAP_NAS_SysInfo_valid 0x02
+ #define CN_Info_cn_DomainInformationList_valid 0x04
+
+ kal_uint8 multi_plmn_count;
+ /* Range: 1 to MAX_NUM_MULTI_PLMN. */
+ plmn_id_struct multi_plmn_id[MAX_NUM_MULTI_PLMN];
+ as_cell_type_enum multi_plmn_cell_type[MAX_NUM_MULTI_PLMN];
+ as_cell_type_enum cell_type; /* Reserved for before R6 compatible */
+ plmn_id_struct plmn_id; /* Reserved for before R6 compatible */
+
+ nas_sys_info_gsm_map_struct cn_CommonGSM_MAP_NAS_SysInfo;
+ CN_DomainSysInfoList cn_DomainSysInfoList;
+ /* END CN_INFO */
+
+ data_speed_support_enum data_speed_support; /* MAUI_02361221: H-icon display */
+
+ kal_uint16 access_class;
+
+#ifdef __R6_DSAC__
+ kal_uint8 dsac_plmn_bitmask;
+ /* "1" in LSB bit for 1st PLMN CS/PS domain DSAC valid */
+ kal_uint16 cs_dsac[MAX_NUM_MULTI_PLMN];
+ kal_uint16 ps_dsac[MAX_NUM_MULTI_PLMN];
+#endif
+
+#ifdef __PPACR_SUPPORT__
+ kal_uint8 ppacr_plmn_bitmask;
+ ppacr_info_struct ppacr_info_plmn_list[MAX_NUM_MULTI_PLMN];
+#endif
+
+ csg_access_mode_enum csg_access_mode;
+ csg_info_struct csg_info;
+ kal_uint8 band;
+} ratcm_uas_sys_info_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ cell_identity_type cell_id;
+
+ kal_uint8 multi_plmn_count;
+ /* Range: 1 to MAX_NUM_MULTI_PLMN. */
+ plmn_id_struct multi_plmn_id[MAX_NUM_MULTI_PLMN];
+
+ kal_bool cn_CommonGSM_MAP_NAS_SysInfo_present;
+ nas_sys_info_gsm_map_struct cn_CommonGSM_MAP_NAS_SysInfo;
+ CN_DomainSysInfoList cn_DomainSysInfoList;
+} ratcm_uas_cell_global_identity_info_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ data_speed_support_enum data_speed_support;
+} ratcm_uas_update_capability_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ kal_bool is_usim_inserted;
+ kal_bool is_delete_pending;
+} ratcm_uas_usim_info_reset_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ domain_id_enum connection_domain;
+ rat_type_enum active_rat;
+
+ /* 20140715 Ming: Add this field in CELL_CHANGE_FINISH_IND and RAT_CHANGE_CNF
+ * to sync the gibi_tag value between NAS and AS after interRAT procedure.
+ * (Avoid NAS sends previous rat's gibi_tag to current rat)
+ *
+ * Related issues: MOLY00051065, ALPS01461467 and ALPS01537397
+ *
+ * Note that since only problems may happen after xG3HO now, only RRCE carries this field.
+ */
+ gibiTag_info gibiTag_sync;
+} ratcm_rrce_cell_change_finish_ind_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ kal_uint8 plmn_band_count;
+ plmn_band_struct plmn_band[MAX_PLMN_BAND_NUM];
+}ratcm_uas_plmn_band_ind_struct;
+
+#ifdef __GEMINI__
+typedef struct
+{
+ LOCAL_PARA_HDR
+} ratcm_rrce_no_ir_sig_proc_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ as_gemini_status_enum as_gemini_status;
+} ratcm_uas_virtual_mode_ind_struct;
+#endif /* __GEMINI__ */
+
+#ifdef __LTE_RAT__
+/* RATCM -> RRCE */
+/* CSCE and RRCE uses ratcm_uas_rat_change_req_struct jointly */
+typedef struct {
+ LOCAL_PARA_HDR
+ irat_type_enum irat_type;
+ rat_type_enum source_rat;
+ rat_type_enum target_rat;
+ void *as_info_ptr;
+ umts_security_key security_key[2];
+ csfb_indicator_enum csfb_indicator;
+ kal_bool is_lai_valid; //CSFB enhancement
+ lai_struct lai; //CSFB enhancement
+ kal_bool is_mapped_rai_valid; // For 4G3 HO, AS may not have valid plmn id. AS will derive plmn id from mapped rai.
+ rai_struct mapped_rai;
+} ratcm_uas_rat_change_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ irat_type_enum irat_type;
+ rat_type_enum source_rat;
+ rat_type_enum target_rat;
+ irat_result_enum irat_result;
+ irat_reject_cause_enum irat_reject_cause; //Reject cause when irat_result is equal to IR_RESULT_REJECT.
+ void *as_info_ptr;
+} ratcm_uas_rat_change_res_struct;
+
+/* RRCE -> RATCM */
+typedef struct {
+ LOCAL_PARA_HDR
+ irat_type_enum irat_type;
+ rat_type_enum source_rat;
+ rat_type_enum target_rat;
+ void *as_info_ptr;
+ kal_uint8 nas_sec_param_to_eutra[NAS_SECURITY_PARAM_LEN];
+} ratcm_uas_rat_change_ind_struct;
+
+/* CSCE and RRCE uses ratcm_uas_rat_change_cnf_struct jointly */
+typedef struct {
+ LOCAL_PARA_HDR
+ irat_type_enum irat_type;
+ rat_type_enum source_rat;
+ rat_type_enum target_rat;
+ irat_result_enum irat_result;
+ void *as_info_ptr;
+ domain_id_enum connection_domain;
+
+ /* 20140715 Ming: Add this field in CELL_CHANGE_FINISH_IND and RAT_CHANGE_CNF
+ * to sync the gibi_tag value between NAS and AS after interRAT procedure.
+ * (Avoid NAS sends previous rat's gibi_tag to current rat)
+ *
+ * Related issues: MOLY00051065, ALPS01461467 and ALPS01537397
+ *
+ * Note that since only problems may happen after xG3HO now, only RRCE carries this field.
+ */
+ gibiTag_info gibiTag_sync;
+} ratcm_uas_rat_change_cnf_struct;
+#endif
+
+
+#endif /* _RATCM_UAS_STRUCT_H */
diff --git a/mcu/protocol/interface/general/ratcm_ul2_struct.h b/mcu/protocol/interface/general/ratcm_ul2_struct.h
new file mode 100644
index 0000000..e48b1fc
--- /dev/null
+++ b/mcu/protocol/interface/general/ratcm_ul2_struct.h
@@ -0,0 +1,80 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2015
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * ratcm_ul2_struct.h
+ *
+ * Project:
+ * --------
+ * UMOLY Universal Bin
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ *
+ *
+ * ==========================================================================
+ * $Log:$
+ *
+ ****************************************************************************/
+
+#ifndef _RATCM_UL2_STRUCT_H
+#define _RATCM_UL2_STRUCT_H
+
+#include "kal_general_types.h"
+#include "kal_public_api.h"
+#include "gmss_public.h"
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ umts_duplex_mode_type source_umts_duplex_mode;
+ umts_duplex_mode_type target_umts_duplex_mode;
+ lte_duplex_mode_type source_lte_duplex_mode;
+ lte_duplex_mode_type target_lte_duplex_mode;
+} ratcm_ul2_duplex_mode_change_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool result;
+} ratcm_ul2_duplex_mode_change_cnf_struct;
+
+#endif /* _RATCM_UL2_STRUCT_H */
diff --git a/mcu/protocol/interface/general/ratcm_ul2d_struct.h b/mcu/protocol/interface/general/ratcm_ul2d_struct.h
new file mode 100644
index 0000000..e3e4765
--- /dev/null
+++ b/mcu/protocol/interface/general/ratcm_ul2d_struct.h
@@ -0,0 +1,80 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2015
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * ratcm_ul2d_struct.h
+ *
+ * Project:
+ * --------
+ * UMOLY Universal Bin
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ *
+ *
+ * ==========================================================================
+ * $Log:$
+ *
+ ****************************************************************************/
+
+#ifndef _RATCM_UL2D_STRUCT_H
+#define _RATCM_UL2D_STRUCT_H
+
+#include "kal_general_types.h"
+#include "kal_public_api.h"
+#include "gmss_public.h"
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ umts_duplex_mode_type source_umts_duplex_mode;
+ umts_duplex_mode_type target_umts_duplex_mode;
+ lte_duplex_mode_type source_lte_duplex_mode;
+ lte_duplex_mode_type target_lte_duplex_mode;
+} ratcm_ul2d_duplex_mode_change_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool result;
+} ratcm_ul2d_duplex_mode_change_cnf_struct;
+
+#endif /* _RATCM_UL2D_STRUCT_H */
diff --git a/mcu/protocol/interface/general/ratcm_urlc_struct.h b/mcu/protocol/interface/general/ratcm_urlc_struct.h
new file mode 100644
index 0000000..f451c8d
--- /dev/null
+++ b/mcu/protocol/interface/general/ratcm_urlc_struct.h
@@ -0,0 +1,159 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * ratcm_urlc_struct.h
+ *
+ * Project:
+ * --------
+ * MONZA
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log:$
+ *
+ * 12 15 2014 kun-lin.wu
+ * [MOLY00078268] [UMOLY][R10][R11][MOLY CR] PS5 NAS check-in 6291_DEV and 6291_UESIM_DEV
+ * .
+ *
+ * 11 07 2014 kun-lin.wu
+ * [MOLY00082366] Loop back mode 4 support
+ *
+ * 10 02 2012 ij.liao
+ * [MOLY00004236] [interface][service][kal]remove stack_ltlcom.h
+ *
+ * 09 28 2012 weimin.zeng
+ * [MOLY00004236] [interface][service][kal]remove stack_ltlcom.h
+ * header file.
+ *
+ * 11 11 2011 weimin.zeng
+ * removed!
+ * .
+ *
+ * 11 08 2011 weimin.zeng
+ * removed!
+ * merge MSBB.
+ *
+ * 12 14 2010 cosine.jheng
+ * removed!
+ * Integration change.
+ *
+ * 10 20 2010 cosine.jheng
+ * removed!
+ * [RATCM][RHR]Check in ratcm file in uas\interface
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ * Add copyright header.
+ ****************************************************************************/
+
+#ifndef _RATCM_URLC_STRUCT_H
+#define _RATCM_URLC_STRUCT_H
+
+#include "uas_common_enums.h"
+#include "kal_general_types.h"
+#include "kal_public_api.h"
+
+typedef struct
+{
+ ExtendedRbId RBId;
+ kal_uint16 SDUSize;
+}tRBLoopBackInfo;
+# if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ kal_bool result;
+}ratcm_urlc_utest_open_loop_cnf_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ kal_uint8 noOfRBs;
+ tRBLoopBackInfo RBInfo[MAX_RB_LOOPED_BACK];
+}ratcm_urlc_utest_close_loop_m1_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ kal_bool result;
+}ratcm_urlc_utest_close_loop_m1_cnf_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ kal_bool result;
+}ratcm_urlc_utest_close_loop_m2_cnf_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ kal_bool result;
+}ratcm_urlc_utest_close_loop_m4_cnf_struct;
+
+#endif /* _RATCM_URLC_STRUCT_H */
diff --git a/mcu/protocol/interface/general/ratdm_chlp_struct.h b/mcu/protocol/interface/general/ratdm_chlp_struct.h
new file mode 100644
index 0000000..e7f6a74
--- /dev/null
+++ b/mcu/protocol/interface/general/ratdm_chlp_struct.h
@@ -0,0 +1,215 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * ratdm_chlp_struct.h
+ *
+ * Project:
+ * --------
+ *
+ *
+ * Description:
+ * ------------
+ * This file is the interface between RATDM and HLP for C2K PDN data
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ ******************************************************************************/
+
+#ifndef _RATDM_CHLP_STRUCT_H
+#define _RATDM_CHLP_STRUCT_H
+
+#include "kal_general_types.h"
+#include "kal_public_defs.h"
+
+/** length of next peer buffer pointer in peer buffer header */
+#define C2K_NDIS_PEER_BUFF_NEXT_POINTER_HEADER_LEN (sizeof(peer_buff_struct*))
+/** offset of next peer buffer pointer in peer buffer, started from peer buffer pointer */
+#define C2K_NDIS_PEER_BUFF_NEXT_POINTER_HEADER_OFFSET (sizeof(peer_buff_struct))
+/** in NDIS mode free header space length, now free header space stores only next peer buffer pointer */
+#define C2K_NDIS_PEER_BUFF_HEADER_LEN (C2K_NDIS_PEER_BUFF_NEXT_POINTER_HEADER_LEN)
+/** offset of PDU in peer buffer header, started from peer buffer pointer */
+#define C2K_NDIS_PEER_BUFF_PDU_OFFSET (C2K_NDIS_PEER_BUFF_NEXT_POINTER_HEADER_OFFSET + C2K_NDIS_PEER_BUFF_NEXT_POINTER_HEADER_LEN)
+/** extra bytes in NDIS mode to save memcpy in HLP PPP HA, allocated inside pdu area, before the real IP pdu data from UPCM
+ ** PPP_HEADER_OFFSET defined in pp_frame.h
+ */
+#define C2K_NDIS_UL_PPP_HEADER_RESERVE_LEN (8)
+/** offset of real PDU IP pdu data in peer buffer pdu, started from the pdu pointer allocated by flc */
+#define C2K_NDIS_UL_PDU_PPP_HEADER_OFFSET C2K_NDIS_UL_PPP_HEADER_RESERVE_LEN
+/** offset of UL real PDU IP data in peer buffer, started from peer buffer pointer */
+#define C2K_NDIS_PEER_BUFF_UL_PDU_IP_DATA_OFFSET (C2K_NDIS_PEER_BUFF_PDU_OFFSET + C2K_NDIS_UL_PDU_PPP_HEADER_OFFSET)
+/** offset of DL real PDU IP data in peer buffer, started from peer buffer pointer */
+#define C2K_NDIS_PEER_BUFF_DL_PDU_IP_DATA_OFFSET (C2K_NDIS_PEER_BUFF_PDU_OFFSET)
+/** offset of tailer in peer buffer, started from peer buffer pointer */
+#define C2K_NDIS_PEER_BUFF_TAILER_OFFSET(_peer_buff_ptr) (C2K_NDIS_PEER_BUFF_PDU_OFFSET+(_peer_buff_ptr)->pdu_len)
+/** alloc extra byte in NDIS mode for UL to store C2K air interface PDN ID */
+#define C2K_NDIS_UL_PEER_BUFF_TAILER_LEN (1)
+/** no extra byte in NDIS mode for DL is needed */
+#define C2K_NDIS_DL_PEER_BUFF_TAILER_LEN (0)
+
+/* get next pointer */
+#define C2K_NDIS_PEER_BUFF_GET_NEXT(_curr_node) (*(kal_uint32*)((kal_uint8 *)(_curr_node) + C2K_NDIS_PEER_BUFF_NEXT_POINTER_HEADER_OFFSET))
+/* link next pointer */
+#define C2K_NDIS_PEER_BUFF_SET_NEXT(_curr_node, _next_node) *(kal_uint32*)((kal_uint8 *)(_curr_node) + C2K_NDIS_PEER_BUFF_NEXT_POINTER_HEADER_OFFSET) = (kal_uint32)(_next_node)
+
+
+/* get c2k air interface PDN ID */
+#define C2K_NDIS_PEER_BUFF_UL_GET_PDN_ID(_curr_node) *((kal_uint8 *)(_curr_node) + C2K_NDIS_PEER_BUFF_TAILER_OFFSET(_curr_node))
+/* set c2k air interface PDN ID */
+#define C2K_NDIS_PEER_BUFF_UL_SET_PDN_ID(_curr_node, _pdn_id) *((kal_uint8 *)(_curr_node) + C2K_NDIS_PEER_BUFF_TAILER_OFFSET(_curr_node)) = (_pdn_id)
+
+/** C2K data status enum
+ * currently only dormant & connected are necessary
+ */
+typedef enum
+{
+ RATDM_C2K_DATA_STATUS_DORM,
+ RATDM_C2K_DATA_STATUS_CONNECTED,
+ RATDM_C2K_DATA_STATUS_MAX
+}ratdm_c2k_data_status_enum;
+
+/** C2K uplink data request
+ * This primitive is sent from RATDM carring IP packet in FLC2_C2K_REV_POOL buffer to HLP
+ * HLP need encode the IP packet into PPP frame which is delivered to C2K L2
+ */
+typedef struct
+{
+ /** ILM specific header. */
+ LOCAL_PARA_HDR
+
+ /** C2K air interface PDN ID, ranged in [0,14] */
+ kal_uint8 c2k_air_pdn_id;
+ /** indicate current data is from nml sit or pri sit. FALSE: nml; TRUE: pri */
+ kal_bool sit_flag;
+ /** pointer to peer buffer linked list head
+ * the 1st four bytes behind peer buffer_struct in free_header_space stores the pointer to the next list node
+ */
+ peer_buff_struct *peer_buffer_head_ptr;
+ /** pointer to peer buffer linked list tail */
+ peer_buff_struct *peer_buffer_tail_ptr;
+}ratdm_chlp_ul_data_req_struct;
+
+/** C2K downlink data indication
+ * This primitive is sent from HLP carring IP packet in FLC2_C2K_FWD_POOL buffer to RATDM
+ */
+typedef struct
+{
+ /** ILM specific header. */
+ LOCAL_PARA_HDR
+
+ /** C2K air interface PDN ID, ranged in [0,14] */
+ kal_uint8 c2k_air_pdn_id;
+ /** pointer to peer buffer linked list head
+ * the 1st four bytes behind peer buffer_struct in free_header_space stores the pointer to the next list node
+ */
+ peer_buff_struct *peer_buffer_head_ptr;
+ /** pointer to peer buffer linked list tail */
+ peer_buff_struct *peer_buffer_tail_ptr;
+}ratdm_chlp_dl_data_ind_struct;
+
+/** C2K data status indication
+ * This primitive is sent from HLP to RATDM to indicate current data status
+ */
+typedef struct
+{
+ /** ILM specific header. */
+ LOCAL_PARA_HDR
+
+ /** data status */
+ ratdm_c2k_data_status_enum data_status;
+}ratdm_chlp_data_status_ind_struct;
+
+/** UL buffer watermark indication
+ * This primitive is sent from FLC2 to HLP to indicate watermark reached
+ */
+typedef struct
+{
+ /** ILM specific header. */
+ LOCAL_PARA_HDR
+
+ /** true: on; false: off */
+ kal_bool flag;
+}ratdm_chlp_ul_buffer_status_ntf_struct;
+
+
+#ifdef __RATDM_UT__
+/* for MSG_ID_RATDM_UT_UPCM_UL_DATA_REQ */
+typedef struct
+{
+ /** ILM specific header. */
+ LOCAL_PARA_HDR
+
+ kal_uint8 nsapi;
+
+ /* SIT table, data is in message's peer buffer */
+ kal_uint32 sit_idx;
+
+ kal_uint32 pri_start;
+ kal_uint32 pri_num;
+ kal_uint32 pri_sz;
+
+ kal_uint32 nml_start;
+ kal_uint32 nml_num;
+ kal_uint32 nml_sz;
+}ratdm_ut_upcm_ul_data_req_struct;
+
+typedef enum
+{
+ RATDM_UT_C2K_UL_FC_SET_BEFORE_MSG_RECV,
+ RATDM_UT_C2K_UL_FC_SET_DURING_DATA_PARSE_LOOP
+}ratdm_ut_c2k_ul_fc_set_mode_enum;
+
+/* for MSG_ID_RATDM_UT_C2K_FLC2_REV_BUF_STATUS_IND */
+typedef struct
+{
+ /** ILM specific header. */
+ LOCAL_PARA_HDR
+
+ /* reuse this message for ul flow control
+ * to avoid db update in compile cgen fail
+ * TRUE, hwm reached, ul flow control on
+ * FALSE, lwm reached, ul flow control off
+ */
+ kal_bool fc_status;
+
+ ratdm_ut_c2k_ul_fc_set_mode_enum ul_fc_set_mode;
+}ratdm_ut_c2k_flc2_rev_buf_status_ind_struct;
+#endif
+
+#endif /* _RATDM_CHLP_STRUCT_H */
diff --git a/mcu/protocol/interface/general/ratdm_el2_struct.h b/mcu/protocol/interface/general/ratdm_el2_struct.h
new file mode 100644
index 0000000..d5c7d01
--- /dev/null
+++ b/mcu/protocol/interface/general/ratdm_el2_struct.h
@@ -0,0 +1,204 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * ratdm_el2_struct.h
+ *
+ * Project:
+ * --------
+ *
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ ******************************************************************************
+ * $Log$
+ *
+ * 09 15 2017 steve.kao
+ * [MOLY00278245] [UMOLYA] Remove obsolete parts for copro and LTM
+ * [UMOLYA][TRUNK] Remove LTM parts from EPDCP & RATDM and delete ltm_el2_msg_struct.h
+ *
+ * 08 28 2017 i-feng.chen
+ * [MOLY00273828] [Bianco][N1][RJIL] Externel (EE),0,0,99,/data/core/,1,modem,Trigger time:[2017-08-24 14:19:33.793598] md1:(MCU_core0.vpe0.tc0(VPE0)) [ASSERT] file:mcu/pcore/modem/rohc/ral/rohc_ral_cr4.c line:1276 p1:0x00000000 p2:0x00000000 p3:0x00000000 ELM
+ * [TRUNK][EPDCP][UL] Fix for data in data_req different from current epdcp rb_idx-ebi mapping
+ *
+ * 08 22 2017 i-feng.chen
+ * [MOLY00272749] [BIANCO][MT6763][RDIT][L+L][FDD][Overnight] Externel (EE),[ASSERT] file:mcu/pcore/modem/el2/el2/epdcp/src/epdcp_ul_proc.c line:3339
+ *
+ * [TRUNK][EPDCP][UL] Handle data received in inactive protocol_idx
+ *
+ * 07 06 2017 timothy.yao
+ * [MOLY00261868] [6293]UL SIT new handling
+ * new SIT handling (to TRUNK)
+ * - UPCM / RATDM.
+ *
+ * 02 21 2017 steve.kao
+ * [MOLY00230978] [6293][EL2] Forced indirect path (VRB mode).
+ * [UMOLYA][TRUNK][RATDM] Forced VRB mode.
+ *
+ * 09 26 2016 cammie.yang
+ * [MOLY00195563] [6293][EL2][UPCM][RATDM][EPDCP] Initial feature integrations
+ * [TRUNK] UPCM/RATDM/EPDCP feature integrations from PS.DEV
+ *
+ * 08 09 2016 nicole.hsu
+ * [MOLY00196065] [MT6293][folder structure] Move EL1/EL2 files from LTE domain to SWRD domain
+ * 93 EL2 others
+ *
+ * 07 20 2016 head.hsu
+ * [MOLY00182559] [MT6292][LWA] U-Plane Development: ePDCP and RATDM
+ * (RATDM default off)
+ * [RATDM] LWA support
+ * 1. WLAN/ePDCP UP control message
+ * 2. RATDM_LWA_ENABLE
+ * 3. wrap CCMSG_ID_SYSMSGSVC with __CCCIDEV_SUPPORT__
+ *
+ * 05 25 2015 head.hsu
+ * [MOLY00109855] [TK6291E1][1st AIQ Call][UMOLY][4G][TDD][CA] Assert Fail ccci_debug.c 498
+ * RATDM switch regular tick source via EMAC_SCH_STATUS_IND instead of LTE IDLE state
+ *
+ *
+ ******************************************************************************/
+
+#ifndef RATDM_EL2_STRUCT_H
+#define RATDM_EL2_STRUCT_H
+
+#include "kal_general_types.h"
+#include "kal_public_defs.h"
+#include "abs_time.h"
+#include "ltm_el2_struct.h" // TODO: remove
+#include "qmu_bm.h"
+#include "upcm_did.h"
+#include "ue_testmode_struct.h"
+
+#define RATDM_EPDCP_MAX_NUM_DRB 8
+
+/* mapping to the definitions in ltm_el2.h */
+//typedef drb_ulsdu_info_head_t drb_ulsdu_info_t;
+#define ULSDU_INFO_FLAG_PRIORITY ULSDU_INFO_HEAD_FLAG_PRIORITY
+#define ULSDU_INFO_FLAG_CTRL_PDU ULSDU_INFO_HEAD_FLAG_CTRL_PDU
+#define ULSDU_INFO_FLAG_RETX_WI_SN ULSDU_INFO_HEAD_FLAG_RETX_WI_SN
+#define GET_ULSDU_INFO(_p) GET_ULSDU_INFO_HEAD(_p)
+
+typedef struct
+{
+ kal_uint32 total_size; /* bytes */
+ kal_uint16 start_idx; /* SDU start index in SIT; valid range: 0~65535 */
+ kal_uint16 cnt; /* SDU count */
+}ratdm_lte_dlvr_data_struct;
+
+typedef struct
+{
+ kal_uint32 rb_idx;
+ upcm_did *p_head;
+ upcm_did *p_tail;
+}epdcp_dlvr_data_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ kal_uint32 rb_idx; /* RB Index (2~9) */
+ ratdm_lte_dlvr_data_struct data_pri; /* Priority data (e.g: TCP ACK) */
+ ratdm_lte_dlvr_data_struct data_nml; /* Normal data */
+ kal_uint8 ebi; /* Used to recognize sit_idx */
+}ratdm_epdcp_data_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ kal_uint8 eps_br_id;
+ kal_bool is_forced_indirect_path;
+ // KAL_TRUE: ask EPDCP to use indirect path (VRB) for the EPSB specified
+ // KAL_FALSE: let EPDCP decide the DL path (direct path or indirect path)
+}ratdm_epdcp_dl_path_switch_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ kal_uint32 num;
+ epdcp_dlvr_data_struct data[RATDM_EPDCP_MAX_NUM_DRB];
+}ratdm_epdcp_data_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ kal_uint32 message;
+}wlan_epdcp_ctrl_msg_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ kal_bool is_sch_open;
+}ratdm_emac_sch_status_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ ABS_TICK_TIME wakeup_time;
+}ratdm_emac_next_drx_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ kal_uint8 rb_idx;
+ kal_uint8 eps_br_id;
+
+ //kal_uint8 rollback_exist_nml;
+ //kal_uint8 rollback_exist_pri;
+ /* rollback data in the range [start, end) */
+ kal_uint16 rollback_start_nml; // included
+ kal_uint16 rollback_end_nml; // excluded
+ kal_uint16 rollback_start_pri; // included
+ kal_uint16 rollback_end_pri; // excluded
+
+
+}ratdm_epdcp_ul_data_redir_ind_struct;
+
+typedef testloop_cfg_struct ratdm_epdcp_testloop_ind_struct;
+
+#endif /* RATDM_EL2_STRUCT_H */
diff --git a/mcu/protocol/interface/general/ratdm_enl2_struct.h b/mcu/protocol/interface/general/ratdm_enl2_struct.h
new file mode 100644
index 0000000..c9834ee
--- /dev/null
+++ b/mcu/protocol/interface/general/ratdm_enl2_struct.h
@@ -0,0 +1,207 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+#ifndef RATDM_ENL2_STRUCT_H
+#define RATDM_ENL2_STRUCT_H
+
+#include "kal_general_types.h"
+#include "kal_public_defs.h"
+
+#include "enl2_sap_common.h"
+#include "upcm_did.h"
+
+#include "ue_testmode_struct.h"
+
+#define RATDM_ENPDCP_MAX_NUM_DRB 32
+#define RATDM_ENPDCP_MAX_NUM_ROLLBACK_NAS_SIT 1 /// for NSA, 1 DRB map to only 1 EPSB
+#define RATDM_ENPDCP_INVALID_RB_IDX 0xFF
+
+#define ENPDCP_SAP_MAX_QOS_FLOWS_PER_PDU_SESSION 64
+#define RATDM_ENPDCP_MAX_NUM_PDU_SESSION 16
+#define ENPDCP_MAX_FLOW_NUM_PER_DRB 64
+
+/**
+ * @brief the NAS SIT information of new arriaval uplink data for LTE and NR Layer 2 modules
+ */
+typedef struct
+{
+ kal_uint32 total_size; ///< Total size in byte of the new arrival data
+ kal_uint16 start_idx; ///< The start index of new arrival data in the NAS SIT
+ kal_uint16 cnt; ///< Number of new arrival data
+} ratdm_enl2_ul_data_struct;
+
+/**
+ * @brief MSG_ID_RATDM_ENPDCP_DATA_REQ, MSG_ID_RATDM_SDAP_DATA_REQ
+ *
+ * The new data arrival of uplink data from RATDM to EN-L2.
+ */
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ enpdcp_cn_generation_enum cn_generation;
+ kal_uint8 ebi;
+ kal_uint8 pdu_session_id;
+ kal_uint8 qfi;
+ kal_uint16 sit_tbl_idx; ///< NAS SIT table index
+ kal_uint8 rb_idx; ///< valid only for loopback mode A. Invalid value (0xFF) for other scenarios.
+
+ ratdm_enl2_ul_data_struct data_pri; ///< Priority data list
+ ratdm_enl2_ul_data_struct data_nml; ///< Normal data list
+} ratdm_enpdcp_data_req_struct, ratdm_sdap_data_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ kal_uint32 num; /* num of rb */
+ kal_uint32 rb_idx[RATDM_ENPDCP_MAX_NUM_DRB]; /* RB Index (0~15, 19~34)*/
+} ratdm_enpdcp_data_disc_req_struct;
+
+// MSG_ID_RATDM_ENPDCP_SIT_FULL_REQ
+typedef struct
+{
+ LOCAL_PARA_HDR
+ enpdcp_cn_generation_enum cn_generation;
+ kal_uint8 ebi;
+ kal_uint8 pdu_session_id;
+ kal_uint8 qfi;
+} ratdm_enpdcp_sit_full_req_struct;
+
+
+// MSG_ID_RATDM_ENPDCP_5QI_UPDATE_REQ
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ kal_uint8 psi;
+ kal_uint8 num_qfi;
+ kal_uint8 qfi[ENPDCP_SAP_MAX_QOS_FLOWS_PER_PDU_SESSION];
+ kal_uint8 vqi[ENPDCP_SAP_MAX_QOS_FLOWS_PER_PDU_SESSION];
+} ratdm_enpdcp_5qi_update_req_struct;
+
+/**
+ * @brief MSG_ID_RATDM_ENPDCP_UL_DATA_REDIR_IND
+ *
+ * Uplink Rollback (Redirect) data from ENPDCP to RATDM due to inter-RAT change.
+ */
+// TODO: possible batch multiple QFI in one DATA-REQ
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ enpdcp_cn_generation_enum cn_generation;
+ kal_uint8 nas_bearer_num;
+ kal_uint8 ebi;
+ kal_uint8 pdu_session_id;
+ kal_uint8 qfi[ENPDCP_MAX_FLOW_NUM_PER_DRB];
+ kal_uint16 sit_tbl_idx[ENPDCP_MAX_FLOW_NUM_PER_DRB]; ///< NAS SIT table index
+ kal_uint16 rollback_start_nml[ENPDCP_MAX_FLOW_NUM_PER_DRB]; ///< The start index of normal SIT
+ kal_uint16 rollback_end_nml[ENPDCP_MAX_FLOW_NUM_PER_DRB]; ///< The end index of normal SIT
+ kal_uint16 rollback_start_pri[ENPDCP_MAX_FLOW_NUM_PER_DRB]; ///< The start index of priority SIT
+ kal_uint16 rollback_end_pri[ENPDCP_MAX_FLOW_NUM_PER_DRB]; ///< The end index of priority SIT
+} ratdm_enpdcp_ul_data_redir_ind_struct;
+
+typedef struct
+{
+ enpdcp_cn_generation_enum cn_generation;
+ kal_uint8 ebi; ///< valid when CN generation is EPC
+ kal_uint8 pdu_session_id; ///< valid when CN generation is 5G
+ upcm_did *p_head;
+ upcm_did *p_tail;
+} enpdcp_deliver_data_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ kal_uint32 num;
+ enpdcp_deliver_data_struct data[RATDM_ENPDCP_MAX_NUM_DRB];
+} ratdm_enpdcp_data_ind_struct;
+
+
+// MSG_ID_RATDM_ENPDCP_PDU_SESSION_RB_STATUS_IND
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ kal_uint8 num_psi;
+ kal_uint8 psi[RATDM_ENPDCP_MAX_NUM_PDU_SESSION];
+ kal_bool rb_exist[RATDM_ENPDCP_MAX_NUM_PDU_SESSION];
+} ratdm_enpdcp_pdu_session_rb_status_ind_struct;
+
+// MSG_ID_RATDM_ENPDCP_DL_PATH_SWITCH_REQ
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ enpdcp_cn_generation_enum cn_generation;
+ /* Bit set to 1 all DRBs are SW path. */
+ kal_bool force_all_drb;
+
+ kal_bool is_force_indirect_path;
+
+ /* Bit set to 1 iff the corresponding EPSB or PDU session is SW path. Depend on cn_generation: EBI or PSI
+ * LSB: for EBI / PSI 0
+ * MSB: for EBI / PSI 15
+ */
+ kal_uint16 indirect_path_bearer_bmp;
+
+ /* Valid when cn_generation is 5G.
+ * indirect_path_5g_qfi[1] = b'100; // PSI 1 QFI 2 is SW path.
+ */
+ kal_uint64 indirect_path_5g_qfi[RATDM_ENPDCP_MAX_NUM_PDU_SESSION];
+
+ // TODO: retire
+ kal_uint8 ebi; // to be removed
+ kal_uint8 pdu_session_id; // to be removed
+ kal_uint8 qfi; // to be removed
+} ratdm_enpdcp_dl_path_switch_req_struct;
+
+// MSG_ID_RATDM_ENPDCP_TESTLOOP_IND
+typedef testloop_cfg_struct ratdm_enpdcp_testloop_ind_struct;
+
+#define ENPDCP_RATDM_DATA_IND_HIGH_THRESHOLD (20)
+#define ENPDCP_RATDM_DATA_IND_LOW_THRESHOLD (10)
+/**
+ * @brief increasing data-ind-consumer counter
+ * and send DATA-IND-RESUME-REQ if producer-consumer is lower than threshold
+ *
+ * @param protocol_idx protocol index of caller
+ *
+ * @return void
+ */
+void enpdcp_ratdm_data_ind_consume(kal_uint8 protocol_idx);
+
+#endif /* RATDM_ENL2_STRUCT_H */
diff --git a/mcu/protocol/interface/general/ratdm_export_api.h b/mcu/protocol/interface/general/ratdm_export_api.h
new file mode 100644
index 0000000..5210ac5
--- /dev/null
+++ b/mcu/protocol/interface/general/ratdm_export_api.h
@@ -0,0 +1,362 @@
+/******************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*******************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * --------------------------------------------------------
+ * ratdm_export_api.h
+ *
+ * Project:
+ * --------------------------------------------------------
+ *
+ *
+ * Description:
+ * --------------------------------------------------------
+ *
+ *
+ * Author:
+ * --------------------------------------------------------
+ * -------
+ *
+ * --------------------------------------------------------
+ * $Log$
+ *
+ * 03 17 2021 stun.wu
+ * [MOLY00594656] SA?¥ß?ÊI][?«H-??][N78][±µ³q²v]?«H5G SA+?«H5G SA??©I¥X¡B©I¤J¡A???ºÝ¥X?7¦¸°_©I¥¢?¡F?¤ñ?ºÝ¥X?6¦¸¡]7/100¡^
+ *
+ * .
+ *
+ * 05 07 2020 andy-wc.chang
+ * [MOLY00506312] [Titan][IPC][IMS] IPC_IMS_INVITE_FLUSH (0x1C) - EL2 dev
+ * [VMOLY][TITAN] ipc flush command porting - header
+ *
+ * 04 30 2020 yi-lin.lee
+ * [MOLY00517952] [MT6875][Margaux][For Mouton][Q0][MP3][SQC][5G FT][NSA][5GMM][China][CMCC FT][Pre SQC][5G-FT-NSA-2.3][Lanzhou]DUT call drop 2 times during VOLTE call.
+ *
+ * [RATDM] 5g copro rb-pdn mapping of dedicated bearer (r3.mp)
+ *
+ * 03 30 2020 chin-wei.hsu
+ * [MOLY00508613] [BLOCKING][MT6885][Petrus][MP3][NVIOT][Nokia][Dallas][NR_MB][TCID83] After leg switch from NR only to LTE only, Data stuck and can't recovery.
+ * SIT full handling.
+ *
+ * 03 10 2020 chin-wei.hsu
+ * [MOLY00503427] [MT6885][Petrus][TMO-US][WWFT][Seattle][5G4G][NSN][MDST][SWIFT][Assert] file:mcu/middleware/hif/ipcore/src/ipc_filter.c line:3815
+ *
+ * [TRUNK]monitor DL data.
+ *
+ * 01 08 2020 tc.chang
+ * [MOLY00468771] [IODT][MT6885][Petrus][MP1][ZTE][Lab][5GSM][China][Xian][F60][N41]Assert fail: upcm_data.c 737 - EL2.
+ *
+ * 12 06 2019 tc.chang
+ * [MOLY00463231] [GEN97][GWSD+] patchback from 1001dev.
+ *
+ * 12 05 2019 tc.chang
+ * [MOLY00459279] [Gen97][UPCM] MCPS optimization.
+ *
+ * 09 23 2019 tc.chang
+ * [MOLY00427068] [Gen97][UPCM][RATDM][ENPDCP] Dynamic SIT.
+ *
+ * 08 09 2019 tc.chang
+ * [MOLY00417411] [TOP Issue][MT6297][PCT IODT][SA FullStack][StarPoint][PCT 7.1.1.3.3] lgch 5 trigger SR while lgch 6 is waiting for SR delay timer.
+ *
+ * 07 18 2019 tc.chang
+ * [MOLY00422973] [Gen97][UPCM][RATDM] update trace.
+ *
+ * 07 12 2019 tc.chang
+ * [MOLY00421061] [Gen97] ANBR (RBR,RBRQ) over NR.
+ *
+ * 07 04 2019 tc.chang
+ * [MOLY00418272] [Gen97] Sync Gen95 UMOLYE patch
+ * [UPCM][RATDM] Sync MOLY00409699, MOLY00409664, MOLY00410350.
+ *
+ * 04 19 2019 tc.chang
+ * [MOLY00399993] [Gen97][VMOLY] interworking withN26 features.
+ *
+ * 02 18 2019 tc.chang
+ * [MOLY00383816] [Gen97] Sync UMOLYE Gen95 patch
+ * [MOLY00346942] [MT3967][EIGER][O1][MP1][NIOT][Nokia][Oulu][4G][eMBMS][Regression]: Fatal Error (0x305, 0x8888028f, 0xcccccccc) - IPCORE.
+ *
+ * 01 14 2019 tc.chang
+ * [MOLY00376018] [Gen97] Update UT cases.
+ *
+ * 01 02 2019 tc.chang
+ * [MOLY00375982] [Gen97] Trace improvement.
+ *
+ * 10 08 2018 tc.chang
+ * [MOLY00356444] [VMOLY] Bug fix and add UT cases.
+ *
+ * 09 18 2018 tc.chang
+ * [MOLY00345990] [VMOLY] Code sync.
+ *
+ * 09 14 2018 tc.chang
+ * [MOLY00345990] [VMOLY] Code sync
+ * Rollback first. Fix build error locally
+ *
+ * 07 24 2018 willy-wj.chen
+ * [MOLY00337943] [R2.MP][EL2][MT6761][Merlot][O1][MP3][FT][India][Delhi][VoLTE][RJIO][IDEA][Auto][Android Linux Script][SST] Modem Warning: +EWARNING: [1][643] dpcopro_mmu_drv.c #992; (timestamp: 650294582) VRB:1.ofs:0x107.pv:0x282DFC4 rfail pidx:0x340
+ * [UMOLYE] Notify UG to release queued data when Rx Unbind Request.
+ *
+ * 06 11 2018 timothy.yao
+ * [MOLY00319373] [MT6295] recommended bit rate feature
+ * recommended bit rate feature: upcm design (merged from 5764964)
+ *
+ * 03 13 2018 chin-wei.hsu
+ * [MOLY00313039] �iTop�j�iTH-CNX-DCO66_Bugs1289305�j�iFT�jDUT1 SIM2 video call DUT2 SIM1, DUT2 can not access the Internet after connecting
+ * [UMOLYE] when network interface unbind PDN, clear epsb queue whose default EBI is linked to this PDN.
+ *
+ * 01 09 2018 chin-wei.hsu
+ * [MOLY00299863] [PVT must resolve] �L�H??�]�C?? - keep alive
+ *
+ * [TRUNK][UPCM][RATDM] UPCM_FEATURE_301.
+ *
+ * 01 09 2018 chin-wei.hsu
+ * [MOLY00299863] [PVT must resolve] �L�H??�]�C?? - keep alive
+ * [TRUNK][UPCM][RATDM] UPCM_FEATURE_301.
+ *
+ * 09 15 2017 rajesh.sastry
+ * [MOLY00278405] [Gen93] Fixed UPCM FLOW ID implementation for GSM/WCDMA RAT
+ *
+ * 07 06 2017 timothy.yao
+ * [MOLY00261868] [6293]UL SIT new handling
+ * new SIT handling (to TRUNK)
+ * - UPCM / RATDM.
+ *
+ * 05 10 2017 timothy.yao
+ * [MOLY00248481] [BIANCO][MT6763][RDIT][FT][FDD][CU][SH][SIM1:CU][SIM2:NA][ASSERT] file:mcu/pcore/modem/el2/ert/emux/src/emux.c line:467
+ * 1. fix IRAT data resume issue.
+ * (1) SIT bias
+ * (2) add UG -> LTE rollback proc
+ * (3) modify LTE -> UG rollback procedure.
+ *
+ * 04 26 2017 xiaokai.liu
+ * [MOLY00244013] [Gen93][TDD 3G] RATDM Code SMP
+ * .
+ *
+ * 04 20 2017 chin-wei.hsu
+ * [MOLY00241877] [UMOLYA][TRUNK][UPCM][RATDM] Build warning removal
+ * Remove unused function.
+ *
+ * 04 18 2017 chin-wei.hsu
+ * [MOLY00243037] [BIANCO][MT6763][RDIT][FT][FDD][CU][SZ][SIM1:CU][SIM2:CU] Externel (EE),[ASSERT] file:mcu/pcore/modem/nas/ratdm/cmn_data/secure/ratdm_ratadp.c line:377
+ * Reset EPSB info in RATDM when UPCM resume.
+ *
+ * 03 30 2017 chin-wei.hsu
+ * [MOLY00238716] [Gen93] 6M RATDM Multiple PS feature sync
+ * [CMN-DATA] L+L, Multiple PS merge from Head Hsu's CBr
+ *
+ * 03 23 2017 chin-wei.hsu
+ * [MOLY00237294] [MT6293][UPCM] Forced SW path
+ * Fix typo.
+ *
+ * 03 23 2017 chin-wei.hsu
+ * [MOLY00237294] [MT6293][UPCM] Forced SW path
+ * [trunk] Forced SW path for EBI/PDN.
+ *
+ * 02 16 2017 steve.kao
+ * [MOLY00230062] [UMOLYA] M-PS related interface changes for UPCM, RATDM, and EPDCP
+ * [M-PS][RATDM][Common].
+ * 1. add protocol_idx into callback interfaces,
+ * 2. one set of UPCM UL SIT per SIM.
+ *
+ * 09 26 2016 ravitej.ballakur
+ * [MOLY00195360] [3G][RATDM][PDCP] - Gen93 3G RATDM and PDCP code modification for new HW and MCU Archi
+ * Merging 2G and WCDMA RATDM and PDCP changes from merge_CBr.
+ *
+ * 08 03 2016 ravitej.ballakur
+ * [MOLY00195360] [3G][RATDM][PDCP] - Gen93 3G RATDM and PDCP code modification for new HW and MCU Archi
+ * 3G RATDM and PDCP changes.
+ * 07 27 2016 jeremy.chen
+ * [MOLY00190683] [UMOLYA][6293] EL2 merge back to UMOLYA TRUNK & PS DEV
+ * [EL2][OA] merge UPCM/RATDM
+ * 09 26 2016 cammie.yang
+ * [MOLY00195563] [6293][EL2][UPCM][RATDM][EPDCP] Initial feature integrations
+ * [TRUNK] UPCM/RATDM/EPDCP feature integrations from PS.DEV
+ *
+ * 07 20 2016 head.hsu
+ * [MOLY00182559] [MT6292][LWA] U-Plane Development: ePDCP and RATDM
+ * (RATDM default off)
+ * [RATDM] LWA support
+ * 1. WLAN/ePDCP UP control message
+ * 2. RATDM_LWA_ENABLE
+ * 3. wrap CCMSG_ID_SYSMSGSVC with __CCCIDEV_SUPPORT__
+ *
+ *
+ * 05 20 2015 head.hsu
+ * [MOLY00089131] [MT6291 Gemini] L+W+W+W code revision check in
+ * ;RATDM/RABM/PDCP/CSR part check-in
+ *
+ * 02 13 2015 yungfu.chen
+ * [MOLY00091822] RATDM reorganization
+ *
+ * 12 23 2013 yungfu.chen
+ * [MOLY00047398] [MT6582LTE][WWFT][UK][Vodafone][EE] CSFB performance anlysis [only for UKFT]
+ *
+ ******************************************************************************/
+#ifndef _RATDM_EXPORT_API_H
+#define _RATDM_EXPORT_API_H
+
+/* KAL - RTOS Abstraction Layer */
+#include "kal_general_types.h"
+#include "kal_public_api.h"
+#include "qmu_bm.h"
+#include "upcm_ul_sit.h"
+#include "upcm_did.h"
+#include "ue_testmode_struct.h"
+
+/* MACRO DEFINITION */
+/*! @brief define predefined bearer id for EMBMS data plane.
+ * Data plane uses this virtual bearer id (4) on EMBMS packets. */
+#define MBMS_DEFAULT_EBI (4)
+
+#define RATDM_INVALID_RB_IDX (0xFF)
+#define RATDM_INVALID_EBI (0)
+
+/* FLOW ID for WCDMA */
+#define WCDMA_FLOW_ID 13
+
+/* DATA STRUCTURE */
+typedef struct
+{
+ qbm_gpd *p_pri_head; // priority SDU head.
+ qbm_gpd *p_pri_tail; // priority SDU tail.
+ qbm_gpd *p_head; // normal SDU head.
+ qbm_gpd *p_tail; // normal SDU tail.
+} ratcmn_ul_sdu_t;
+typedef ratcmn_ul_sdu_t ratdm_lte_ul_sdu_t;
+
+typedef struct
+{
+ kal_bool is_5g_id;
+ kal_uint8 pdu_session_id;
+
+ /* When is_5g_id is TRUE, bearer_id indicates QoS flow id (qfi).
+ * When is_5g_id is FALSE, bearer_id indicates EPS bearer id (or NSAPI).
+ */
+ kal_uint8 bearer_id;
+ kal_uint8 rb_idx; // Valid for loopback mode A. Invalid value (0xFF) for other scenarios.
+
+ kal_uint32 sit_idx;
+ kal_uint32 nml_start;
+ kal_uint32 nml_num;
+ kal_uint32 nml_sz;
+
+ kal_uint32 pri_start;
+ kal_uint32 pri_num;
+ kal_uint32 pri_sz;
+} ratcmn_ul_sdu_93_t;
+
+typedef struct
+{
+ kal_uint32 rb_idx;
+ upcm_did *p_head;
+ upcm_did *p_tail;
+} ratdm_dlvr_data_t;
+
+/* EXPORT FUNCTIONS */
+/* RABM/PDCP/RATDM */
+extern void ratdm_rabm_callback_increment_rx_data_octets(kal_uint8 tcm_cid, kal_uint64 increment_value, kal_uint8 sim_interface);
+extern void ratdm_rabm_callback_reset_rx_data_octets(kal_uint8 tcm_cid, kal_uint8 sim_interface);
+extern void ratdm_rabm_callback_set_new_vr_value(kal_uint8 nsapi, kal_uint16 new_vr_value, kal_uint8 sim_interface);
+extern void ratdm_deliver_dl_data(ratdm_dlvr_data_t *p_data, kal_uint8 sim_idx);
+extern void ratdm_fdd_rabm_callback_increment_proc_data_req();
+extern void ratdm_tdd_rabm_callback_increment_proc_data_req();
+
+/* ENPDCP */
+extern kal_uint8 ratdm_enpdcp_callback_get_default_ebi(kal_uint8 nsapi, kal_uint8 sim_idx);
+
+/* SNDCP */
+extern void ratdm_sndcp_callback_increment_proc_data_req();
+
+/* UPCM */
+/* Multimode Callback Function */
+//typedef void (*ratdm_lte_dlvr_dl_sdu_f)(kal_uint32 ebi, upcm_did *p_head, upcm_did *p_tail, kal_uint8 protocol_idx);
+//typedef void (*ratdm_lte_rollback_sdu_f)(kal_uint32 ebi, qbm_gpd *p_head, qbm_gpd *p_tail);
+typedef void (*ratdm_dlvr_dl_sdu_f)(kal_uint32 mapped_pdn_id, upcm_did *p_head, upcm_did *p_tail, kal_uint8 protocol_idx);
+typedef void (*ratdm_irat_context_transfer_f)(kal_bool suspend, kal_uint8 protocol_idx);
+typedef void (*ratdm_rollback_sit_f)(kal_uint32 bearer_id, kal_uint16 sit_idx,
+ kal_uint8 protocol_idx, kal_uint32 pri_start, kal_uint32 pri_end, kal_uint32 nml_start, kal_uint32 nml_end);
+typedef void (*ratdm_notify_lte_tick_f)(kal_bool is_lte_tick);
+typedef void (*ratdm_notify_ebi_sit_mapping_f)(kal_uint32 ebid, kal_uint32 sit_idx, kal_uint8 protocol_idx);
+typedef void (*ratdm_ind_test_loop_f)(testloop_cfg_struct *p_cfg, kal_uint8 protocol_idx);
+typedef void (*ratdm_ind_act_pdn_id_f)(kal_uint32 pdn_id, kal_uint32 protocol_idx);
+
+extern void ratdm_ratadp_init(void);
+extern void ratdm_ratadp_free_ulsdus_93(ratcmn_ul_sdu_93_t *p_sdus, kal_uint8 protocol_idx);
+extern void ratdm_ratadp_drop_sdu_in_sit(kal_uint32 sit_idx, kal_bool is_priority, kal_uint32 start, kal_uint32 num, kal_uint8 protocol_idx);
+extern void ratdm_ratadp_rcv_ul_sdu_93(kal_uint32 ebi, ratcmn_ul_sdu_93_t *p_sdus, kal_uint8 protocol_idx);
+extern void ratdm_ratadp_set_forced_sw_path(kal_uint32 ebi, kal_bool is_dl_forced_indirect_path, kal_uint8 protocol_idx);
+extern void ratdm_ratadp_send_dl_path_switch_all_req(kal_bool is_forced_indirect_path,
+ kal_uint8 protocol_idx);
+extern void ratdm_ratadp_rcv_ul_sdu_5g_nas(ratcmn_ul_sdu_93_t *p_sdus, kal_uint8 protocol_idx);
+extern void ratdm_ratadp_set_forced_sw_path_5g_nas(kal_bool is_5g_id,
+ kal_uint8 pdu_session_id, kal_uint8 bearer_id,
+ kal_bool is_dl_forced_indirect_path, kal_uint8 protocol_idx);
+extern void ratdm_ratadp_send_dl_sw_path_bitmap_req(kal_bool is_5g,
+ kal_uint8 protocol_idx);
+extern void ratdm_ratadp_sit_full_5g_nas(kal_bool is_5g_id, kal_uint8 psi, kal_uint8 bearer_id, kal_uint8 protocol_idx);
+extern void ratdm_ratadp_sit_full(kal_uint32 ebi, kal_uint8 protocol_idx);
+extern void ratdm_lte_sit_full_req(kal_uint8 bearer_id, kal_uint8 protocol_idx);
+void ratdm_nr_sit_full_req(kal_uint8 psi, kal_uint8 bearer_id, kal_uint8 protocol_idx);
+
+extern void ratdm_ratadp_reg_cbk_rollback_sit(ratdm_rollback_sit_f pf_rollback_sdu);
+extern void ratdm_ratadp_reg_cbk_irat_context_transfer(ratdm_irat_context_transfer_f pf_irat_context_transfer);
+extern void ratdm_ratadp_reg_cbk_dlvr_dl_sdu(ratdm_dlvr_dl_sdu_f pf_dlvr_dl_sdu);
+extern void ratdm_reg_cbk_notify_lte_tick(ratdm_notify_lte_tick_f pf_notify);
+extern void ratdm_ratadp_reg_cbk_sit_mapping(ratdm_notify_ebi_sit_mapping_f pf_notify);
+extern void ratdm_ratadp_reg_cbk_ind_testloop(ratdm_ind_test_loop_f pf_ind);
+extern void ratdm_ratadp_reg_cbk_ind_act_pdn_id(ratdm_ind_act_pdn_id_f pf_ind);
+extern void ratdm_ratadp_testloop_rsp(kal_uint32 is_success, kal_uint8 protocol_idx);
+extern void ratdm_ratadp_bind_ind(kal_uint32 pdn_id, kal_uint32 netif, kal_uint8 protocol_idx);
+extern void ratdm_ratadp_unbind_ind(kal_uint32 pdn_id, kal_uint8 protocol_idx);
+void ratdm_ratadp_bearer_act_ind(kal_uint32 bearer_id, kal_uint32 pdn_id, kal_uint8 protocol_idx);
+void ratdm_ratadp_bearer_deact_ind(kal_uint32 bearer_id, kal_uint8 protocol_idx);
+extern kal_uint32 ratdm_ratadp_is_able_to_rcv_ul_sdu(kal_uint8 protocol_id);
+extern void ratdm_ratadp_keep_connected_idle_leave_req(kal_uint8 protocol_idx);
+extern void ratdm_ratadp_free_epsbs_ul_queue_n_notify_as(kal_uint32 *a_ebi, kal_uint32 num, kal_uint32 sim_idx);
+
+#ifdef __LTE_RAT__
+extern kal_uint32 ratdm_lte_is_able_to_rcv_ul_sdu(kal_uint8 protocol_id);
+extern kal_uint8 ratdm_lte_ebi_to_rb_idx(kal_uint32 ebi, kal_uint8 protocol_idx);
+extern kal_uint8 ratdm_lte_rb_idx_to_ebi(kal_uint32 rb_idx, kal_uint8 protocol_idx);
+#endif
+extern void ratdm_ratadp_free_epsb_all_rat(kal_uint32 bearer_id, kal_uint8 sim_idx);
+extern void ratdm_ratadp_output_aggregated_trace(void);
+
+extern void ratdm_reg_cbk_notify_lwa_wifi_tick(ratdm_notify_lte_tick_f pf_notify);
+extern kal_uint8 ratdm_autogen_sim_idx();
+
+extern void ratdm_nr_45g_irat_suspend_upcm_done(kal_uint8 protocol_idx);
+extern kal_uint16 ratdm_nr_get_pending_ul_data_status_5g(kal_uint8 protocol_id);
+#endif /* _RATDM_EXPORT_API_H */
diff --git a/mcu/protocol/interface/general/ratdm_multimode.h b/mcu/protocol/interface/general/ratdm_multimode.h
new file mode 100644
index 0000000..c56fa3c
--- /dev/null
+++ b/mcu/protocol/interface/general/ratdm_multimode.h
@@ -0,0 +1,175 @@
+/******************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*******************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * --------------------------------------------------------
+ * ratdm_multimode.h
+ *
+ * Project:
+ * --------------------------------------------------------
+ *
+ *
+ * Description:
+ * --------------------------------------------------------
+ *
+ *
+ * Author:
+ * --------------------------------------------------------
+ * -------
+ *
+ * --------------------------------------------------------
+ * $Log$
+ *
+ * 04 03 2019 meghana.ganji
+ * [MOLY00393568] [CODE SYNC] [TSD] [KB3] [network] [FieldTest] [PR2] Main card Unicom 3G adhesion test, adhesion delay followed by more than 1 minute (73.42)
+ *
+ * 08 01 2017 ravitej.ballakur
+ * [MOLY00268053] [Gen93] Miscelleneous changes in RATDM UG
+ * .
+ *
+ * 07 06 2017 head.hsu
+ * [MOLY00261868] [6293]UL SIT new handling
+ * RATDM-UG, RATDM-CMN-SIG part
+ *
+ * 03 30 2017 ravitej.ballakur
+ * [MOLY00238716] [Gen93] 6M RATDM Multiple PS feature sync
+ * M-PS changes for UMOLYA.
+ *
+ * 09 26 2016 ravitej.ballakur
+ * [MOLY00195360] [3G][RATDM][PDCP] - Gen93 3G RATDM and PDCP code modification for new HW and MCU Archi
+ * Merging 2G and WCDMA RATDM and PDCP changes from merge_CBr.
+ *
+ * 08 03 2016 ravitej.ballakur
+ * [MOLY00195360] [3G][RATDM][PDCP] - Gen93 3G RATDM and PDCP code modification for new HW and MCU Archi
+ * 3G RATDM and PDCP changes.
+ *
+ * 05 20 2015 head.hsu
+ * [MOLY00089131] [MT6291 Gemini] L+W+W+W code revision check in
+ * ;RATDM/RABM/PDCP/CSR part check-in
+ *
+ * 02 13 2015 yungfu.chen
+ * [MOLY00091822] RATDM reorganization
+ *
+ * 08 25 2014 head.hsu
+ * [MOLY00074929] [Multimode] UAS related header split
+ *
+ * 06 25 2014 johnson.liu
+ * [MOLY00070329] [MT6595TDD][SS][CMCC Case][NS-IOT][R&S CMW500][29.33.2][4GSM][E38][5.2.7]FAIL,????iperf_TCP??
+ * .
+ *
+ * 05 07 2013 jl.hsiao
+ * [MOLY00018567] [MT7208][NW-UE SIM][MM][TC 13.3.2.1] 4G23 IR_TYPE_SEARCH re-design
+ * .
+ *
+ * 04 24 2013 johnson.liu
+ * [MOLY00020653] [TDD][RATDM][PDCP]UT Code Integration and VC Build Warning Remove
+ * .
+ *
+ * 03 19 2013 jl.hsiao
+ * [MOLY00009170] LTE Multimode Merge to MOLY
+ * .
+ *
+ * 01 31 2013 jl.hsiao
+ * [MOLY00009170] LTE Multimode Merge to MOLY
+ * .
+ *
+ * 01 22 2013 jl.hsiao
+ * [MOLY00009170] LTE Multimode Merge to MOLY
+ * .
+ *
+ * 12 04 2012 jl.hsiao
+ * [MOLY00003699] [RATDM] Multimode code check-in
+ * .
+ *
+ * 10 24 2012 jl.hsiao
+ * [MOLY00003699] [RATDM] Multimode code check-in
+ * .
+ *
+ * 09 17 2012 jl.hsiao
+ * [MOLY00003699] [RATDM] Multimode code check-in
+ * .
+ *
+ ******************************************************************************/
+#ifndef _RATDM_MULTIMODE_H
+#define _RATDM_MULTIMODE_H
+
+#ifndef __USE_LEGACY_23G_DATAPATH__
+#include "ratdm_shaq_application_api.h"
+#include "kal_general_types.h"
+#include "kal_public_defs.h"
+#include "mcd_l3_inc_gprs_struct.h"
+#include "stack_ltlcom.h"
+#include "l3_inc_local.h"
+#include "mmi_l3_enums.h"
+#include "kal_public_api.h"
+#include "ps_ratdm_struct.h"
+#include "global_def.h"
+#include "flc2_ent_functions.h"
+#include "l3_inc_enums.h"
+#include "mcd_l3_inc_struct.h"
+#include "ratdm_utils.h"
+
+#ifdef __GEMINI__
+#include "sim_common_enums.h"
+#endif
+
+#ifdef __DIALUP_GPRS_COUNTER_SUPPORT__
+#include "l4c_ratdm_struct.h"
+#endif
+
+#ifdef __UMTS_RAT__
+#include "uas_common_enums.h"
+#endif
+
+/* MACRO DEFINITION */
+
+/* EXPORT FUNCTIONS */
+extern void ratdm_multimode_ps_dscr_data_ind_hdlr(ilm_struct *ilm_ptr);
+extern kal_uint8 ratdm_multimode_assign_pcid(kal_uint8 nsapi, kal_uint8 sim_interface);
+extern kal_uint8 ratdm_multimode_remove_pcid(kal_uint8 nsapi, kal_uint8 sim_interface);
+extern void ratdm_multimode_ug_data_req_hdlr(kal_uint8 nsapi, ratdm_ps_data_req_struct *pPeer, flc2_pool_id_enum pool_id, SHAQ_ENQUEUE_WHICH_QUEUE enqueue_decision, kal_uint8 sim_interface);
+extern kal_bool ratdm_multimode_init(void);
+extern void ratdm_multimode_on_ilm(ilm_struct *ilm);
+extern kal_bool ratdm_multimode_reset(void);
+extern void ratdm_sm_update_max_traffic_class_req(ilm_struct *ilm_ptr);
+extern void ratdm_handle_ps_dscr_data_93_ind(ilm_struct *ilm_ptr);
+extern void ratdm_switch_on_dpcopro(kal_uint8 mod_id);
+extern void ratdm_switch_off_dpcopro(kal_uint8 mod_id);
+
+#endif // ~ #ifndef __USE_LEGACY_23G_DATAPATH__
+extern void ratcm_ratdm_virtual_mode_ind_hdlr (ilm_struct *ilm_ptr);
+
+#endif /* _RATDM_MULTIMODE_H */
diff --git a/mcu/protocol/interface/general/ratdm_rabm_api.h b/mcu/protocol/interface/general/ratdm_rabm_api.h
new file mode 100644
index 0000000..df1c335
--- /dev/null
+++ b/mcu/protocol/interface/general/ratdm_rabm_api.h
@@ -0,0 +1,74 @@
+/******************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*******************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * --------------------------------------------------------
+ * ratdm_rabm_api.h
+ *
+ * Project:
+ * --------------------------------------------------------
+ *
+ *
+ * Description:
+ * --------------------------------------------------------
+ *
+ *
+ * Author:
+ * --------------------------------------------------------
+ * -------
+ *
+ * --------------------------------------------------------
+ * $Log$
+ *
+ * 05 20 2015 head.hsu
+ * [MOLY00089131] [MT6291 Gemini] L+W+W+W code revision check in
+ * ;RATDM/RABM/PDCP/CSR part check-in
+ *
+ *
+ * 01 23 2014 yungfu.chen
+ * [MOLY00047398] [MT6582LTE][WWFT][UK][Vodafone][EE] CSFB performance anlysis
+ *
+ * 02 07 2012 carlson.lin
+ * removed!
+ * <saved by Perforce>
+ *
+ ******************************************************************************/
+#ifndef _RATDM_RABM_API_H
+#define _RATDM_RABM_API_H
+
+#include "kal_general_types.h"
+
+#endif /* _RATDM_RABM_API_H */
diff --git a/mcu/protocol/interface/general/ratdm_rabm_struct.h b/mcu/protocol/interface/general/ratdm_rabm_struct.h
new file mode 100644
index 0000000..ec9850d
--- /dev/null
+++ b/mcu/protocol/interface/general/ratdm_rabm_struct.h
@@ -0,0 +1,557 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * --------------------------------------------------------
+ * ratdm_rabm_struct.h
+ *
+ * Project:
+ * --------------------------------------------------------
+ * MONZA
+ *
+ * Description:
+ * --------------------------------------------------------
+ *
+ *
+ * Author:
+ * --------------------------------------------------------
+ * -------
+ *
+ * --------------------------------------------------------
+ * $Log$
+ *
+ * 10 28 2016 ravitej.ballakur
+ * [MOLY00195360] [3G][RATDM][PDCP] - Gen93 3G RATDM and PDCP code modification for new HW and MCU Archi
+ * Fux for UESIM TC 13_4_2_1 and merge of MASE CBr changes.
+ *
+ * 09 26 2016 ravitej.ballakur
+ * [MOLY00195360] [3G][RATDM][PDCP] - Gen93 3G RATDM and PDCP code modification for new HW and MCU Archi
+ * Merging 2G and WCDMA RATDM and PDCP changes from merge_CBr.
+ *
+ * 08 03 2016 ravitej.ballakur
+ * [MOLY00195360] [3G][RATDM][PDCP] - Gen93 3G RATDM and PDCP code modification for new HW and MCU Archi
+ * 3G RATDM and PDCP changes.
+ *
+ * 02 13 2015 head.hsu
+ * [MOLY00091822] RATDM reorganization
+ * FDD/TDD RABM/PDCP checkin
+ *
+ * 12 12 2014 tc.chang
+ * [MOLY00087434] [Universal Bin] Check in.
+ * FDD RABM
+ *
+ * 05 29 2014 yungfu.chen
+ * [MOLY00067176] SERVICE REQUEST change design
+ *
+ * 01 21 2014 wcpuser_integrator
+ * [MOLY00054475] SGLTE option rename
+ * .
+ *
+ * 10 18 2013 johnson.liu
+ * [MOLY00041595] [MT6290E1][MMDS_DC] MMDC feature patch back to MOLY trunk
+ * .
+ *
+ * 09 26 2013 yungfu.chen
+ * [MOLY00038877] remove MAX_EXT_PDP_CONTEXT/MAX_INT_PDP_CONTEXT usage of RATDM code
+ * .
+ *
+ * 01 22 2013 jl.hsiao
+ * [MOLY00009170] LTE Multimode Merge to MOLY
+ * .
+ *
+ * 12 07 2012 andrew.wu
+ * [MOLY00007098] LOCAL_PARA_HDR/PEER_BUF_HDR modification
+ * LOCAL_PARA_HDR/PEER_BUF_HDR modification
+ *
+ * 09 17 2012 jl.hsiao
+ * [MOLY00003699] [RATDM] Multimode code check-in
+ * .
+ *
+ * 05 21 2012 johnson.liu
+ * removed!
+ * .
+ *
+ * 05 19 2012 johnson.liu
+ * removed!
+ * .
+ *
+ * 02 07 2012 andrew.wu
+ * removed!
+ * Integration change.
+ *
+ * 01 24 2011 max.yin
+ * removed!
+ * .
+ *
+ * 01 21 2011 max.yin
+ * removed!
+ * .
+ *
+ * 01 03 2011 max.yin
+ * removed!
+ * .
+ *
+ * 12 31 2010 max.yin
+ * removed!
+ * .
+ *
+ * 12 16 2010 jl.hsiao
+ * removed!
+ * .
+ *
+ * 12 14 2010 jl.hsiao
+ * removed!
+ * .
+ *
+ * 10 18 2010 jl.hsiao
+ * removed!
+ * .
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ * Add copyright header.
+ *
+ * removed!
+ * removed!
+ * add to source control recursely
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ * Add ratcm_rabm_retransmit_ind_struct
+ *
+ * removed!
+ * removed!
+ *
+ *
+ ******************************************************************************/
+
+#ifndef _RATDM_RABM_STRUCT_H
+#define _RATDM_RABM_STRUCT_H
+
+#include "flc2_config.h"
+#include "mcd_l3_inc_gprs_struct.h"
+#include "ps_ratdm_struct.h"
+#include "l3_inc_enums.h"
+#include "ps_public_enum.h"
+#include "kal_general_types.h"
+#include "uas_common_enums.h"
+#include "kal_public_defs.h"
+#include "mmi_l3_enums.h"
+#include "ratdm_export_api.h"
+
+typedef kal_uint16 tPdcpSeqNumber;
+typedef kal_uint8 tRabmNsapi;
+typedef kal_uint32 tRabmContextsNum;
+
+typedef enum
+{
+ TRAFFIC_CLASS_UNKNOWN,
+ TRAFFIC_CLASS_CONVERSATIONAL,
+ TRAFFIC_CLASS_STREAMING,
+ TRAFFIC_CLASS_INTERACTIVE,
+ TRAFFIC_CLASS_BACKGROUND
+} tTrafficClass;
+
+typedef enum
+{
+ RATDM_RABM_INVALID_CAUSE,
+ //RABM_SUSPEND_RATDM_BY_PDCP_FLC,
+ //RABM_RESUME_RATDM_BY_PDCP_FLC,
+ RABM_RESUME_RATDM_BY_FLC_PDCP_NOT_EXIST,
+ RABM_SUSPEND_RATDM_BY_PDCP_RELOC,
+ RABM_RESUME_RATDM_BY_PDCP_RELOC,
+ RABM_SUSPEND_RATDM_BY_NRT_RAB_REEST,
+ RABM_RESUME_RATDM_BY_NRT_RAB_REEST_SUCCESS,
+ RABM_RESUME_RATDM_BY_NRT_RAB_REEST_FAIL,
+ RABM_RESUME_RATDM_BY_SR_SUCCESS_RAB_NOT_ESTABLISHED,
+ RABM_TRIGGER_RATDM_RETRANSMIT_BY_RLC_RESET,
+ RABM_TRIGGER_RATDM_RETRANSMIT_BY_RLC_REESTABLISH,
+ RATDM_DEACTIVATE_RABM_BY_REGULAR,
+ RATDM_DEACTIVATE_RABM_BY_RAT_CHANGE,
+ RATDM_RABM_TOTAL_CAUSE
+} tRatcmRabmCause;
+
+typedef struct
+{
+ tRabmNsapi Nsapi;
+ flc2_pool_id_enum dl_pool_id;
+ qos_struct qos_negotiated;
+ tPdcpSeqNumber SendSeqNumber;
+ tPdcpSeqNumber ReceiveSeqNumber;
+#ifdef __USE_LEGACY_23G_DATAPATH__
+ kal_uint8 context_id; // originally in tcm_ratdm_config_req_struct
+#endif
+ module_type module_id; // originally in tcm_ratdm_config_req_struct
+} tRabmActReqPara;
+
+/* RATDM_RABM_ACTIVATE_REQ */
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool RAT_Change;
+ kal_uint8 NoOfContexts;
+ tRabmActReqPara RabmContexts[RABM_MAX_PS_RABS];
+#ifndef __USE_LEGACY_23G_DATAPATH__
+ kal_bool loopback;
+#endif
+} ratdm_rabm_activate_req_struct;
+
+/* RATDM_RABM_ACTIVATE_CNF */
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 NoOfContexts;
+ kal_uint8 Nsapi[RABM_MAX_PS_RABS];
+} ratdm_rabm_activate_cnf_struct;
+
+/* RATDM_RABM_ACTIVATE_IND */
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 NoOfContexts;
+ kal_uint8 Nsapi[RABM_MAX_PS_RABS];
+} ratdm_rabm_activate_ind_struct;
+
+/* RATDM_RABM_ACTIVATE_RSP */
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 Nsapi;
+ kal_bool is_successful;
+} ratdm_rabm_activate_rsp_struct;
+
+/* RATDM_RABM_DEACTIVATE_REQ */
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 Cause;
+ kal_uint8 NoOfContexts;
+ kal_uint8 Nsapi[RABM_MAX_PS_RABS];
+} ratdm_rabm_deactivate_req_struct;
+
+typedef ratdm_rabm_deactivate_req_struct ratdm_rabm_deactivate_cnf_struct;
+
+/* RATDM_RABM_DEACTIVATE_IND */
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 NoOfContexts;
+ kal_uint8 Nsapi[RABM_MAX_PS_RABS];
+ kal_uint8 Cause[RABM_MAX_PS_RABS];
+} ratdm_rabm_deactivate_ind_struct;
+
+/* RATDM_RABM_MODIFY_REQ */
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 Nsapi;
+ kal_uint8 TrafficClass;
+ kal_bool DeliveryOfErrorSdus;
+} ratdm_rabm_modify_req_struct;
+
+/* RATDM_RABM_MODIFY_CNF */
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 Nsapi;
+} ratdm_rabm_modify_cnf_struct;
+
+/* RATDM_RABM_RESUME_REQ */
+typedef struct {
+ LOCAL_PARA_HDR
+} ratdm_rabm_resume_req_struct;
+
+/* RATDM_RABM_REESTABLISH_IND */
+typedef struct {
+ LOCAL_PARA_HDR
+#ifdef __REL7__
+ kal_uint16 ul_data_status; //24.008 clause 10.5.7.7 MSB: NSAPI15
+#endif
+} ratdm_rabm_reestablish_ind_struct;
+
+/* RATDM_RABM_REESTABLISH_RSP */
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool Result;
+
+#ifdef __REL7__
+ kal_uint16 ul_data_status; //24.008 clause 10.5.7.7 MSB: NSAPI15
+#endif
+} ratdm_rabm_reestablish_rsp_struct;
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+/* RATDM_RABM_DATA_CNF */
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 nsapi;
+ kal_uint16 npdu_num; /* The send sequence number this data conf refers to */
+} ratdm_rabm_data_cnf_struct;
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+/* RATDM_RABM_SUSPEND_DATA_PLANE_IND */
+typedef struct {
+ LOCAL_PARA_HDR
+ tRatcmRabmCause cause;
+ kal_uint8 NoOfContexts;
+ kal_uint8 Nsapi[RABM_MAX_PS_RABS];
+} ratdm_rabm_suspend_data_plane_ind_struct;
+
+/* RATDM_RABM_RESUME_DATA_PLANE_IND */
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_need_retransmit; /* Jeff Wu 2006-04-02: New */
+ tRatcmRabmCause cause;
+ kal_uint8 NoOfContexts;
+ kal_uint8 Nsapi[RABM_MAX_PS_RABS];
+ kal_uint16 RetransmitFromSN[RABM_MAX_PS_RABS];
+} ratdm_rabm_resume_data_plane_ind_struct;
+
+/* RATDM_RABM_PDCP_RELOC_IND */
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 NoOfContexts;
+ kal_uint8 Nsapi[RABM_MAX_PS_RABS];
+ kal_uint16 UtranNextReceiveSN[RABM_MAX_PS_RABS];
+} ratdm_rabm_pdcp_reloc_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 Nsapi;
+ kal_uint16 RetransmitFromSN;
+ tRatcmRabmCause cause;
+} ratdm_rabm_retransmit_ind_struct;
+
+/* RATDM-RABM-RAB-RELEASE-IND */
+typedef struct {
+ LOCAL_PARA_HDR
+} ratdm_rabm_rab_release_ind_struct;
+
+/* MSG_ID_RATDM_RABM_RAB_STATUS_IND */
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 Nsapi;
+ kal_bool need_data_cnf;
+} ratdm_rabm_rb_config_ind_struct;
+
+typedef ps_data_req_struct ratdm_rabm_data_req_struct;
+typedef ps_data_ind_struct ratdm_rabm_data_ind_struct;
+#ifdef __HSDPA_SUPPORT__
+/* MSG_ID_RATDM_RABM_RAB_CAPABILITY_IND */
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 NoOfContexts;
+ kal_uint8 Nsapi[RABM_MAX_PS_RABS];
+ data_speed_activate_enum Capability[RABM_MAX_PS_RABS];
+} ratdm_rabm_rab_capability_ind_struct;
+#endif
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+/* RATDM_RABM_RAT_ENTER_REQ */
+typedef struct {
+ LOCAL_PARA_HDR
+ tRabmActReqPara RabmContexts;
+} ratdm_rabm_rat_enter_req_struct;
+
+/* RATDM_RABM_RAT_LEAVE_REQ */
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 NoOfContexts;
+ kal_uint8 Nsapi[RABM_MAX_PS_RABS];
+} ratdm_rabm_rat_leave_req_struct;
+
+/* RATDM_RABM_RAT_READY_IND */
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 Nsapi;
+} ratdm_rabm_rat_ready_ind_struct;
+
+/* PS statistics */
+typedef struct {
+ kal_uint8 nsapi;
+ kal_uint8 result;
+} single_nsapi_info_struct;
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+typedef struct {
+ kal_uint8 nsapi;
+ kal_uint8 context_id;
+ kal_bool reset_tx;
+ kal_bool reset_rx;
+} single_nsapi_reset_cmd_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 src_id;
+ kal_uint8 serial_num;
+ kal_uint8 total_nsapi;
+ single_nsapi_reset_cmd_struct reset_cmd[PS_TOT_CONTEXT+1];
+} ratdm_pdcp_reset_statistics_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 src_id;
+ kal_uint8 serial_num;
+ kal_uint8 total_nsapi;
+ single_nsapi_reset_cmd_struct reset_cmd[PS_TOT_CONTEXT+1];
+ single_nsapi_info_struct reset_result[PS_TOT_CONTEXT+1];
+} ratdm_pdcp_reset_statistics_rsp_struct;
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+typedef struct {
+ LOCAL_PARA_HDR
+ ratdm_dlvr_data_t data;
+} ratdm_ps_dscr_data_93_ind_struct;
+#endif /* _RATDM_RABM_STRUCT_H */
diff --git a/mcu/protocol/interface/general/ratdm_shaq_api.h b/mcu/protocol/interface/general/ratdm_shaq_api.h
new file mode 100644
index 0000000..383c87d
--- /dev/null
+++ b/mcu/protocol/interface/general/ratdm_shaq_api.h
@@ -0,0 +1,600 @@
+/******************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*******************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * --------------------------------------------------------
+ * ratdm_shaq_api.h
+ *
+ * Project:
+ * --------------------------------------------------------
+ *
+ *
+ * Description:
+ * --------------------------------------------------------
+ *
+ *
+ * Author:
+ * --------------------------------------------------------
+ * -------
+ *
+ * --------------------------------------------------------
+ * $Log$
+ *
+ * 12 21 2020 vend_mtb_aricent019
+ * [MOLY00535131] [MP3 Excluded][Gen97][MT6885][Petrus][TMO-US][F4L][Seattle][3G][NSN][3G_DP] DUT 3G AVG HTTP MS/SS DL worse than REF GS9 in Moderate Location (CN Phone)
+ *
+ * 07 22 2020 vend_mtb_mobiveil024
+ * [MOLY00535131] [MP3 Excluded][Gen97][MT6885][Petrus][TMO-US][F4L][Seattle][3G][NSN][3G_DP] DUT 3G AVG HTTP MS/SS DL worse than REF GS9 in Moderate Location (CN Phone)
+ *
+ * .
+ *
+ * 04 27 2017 xiaokai.liu
+ * [MOLY00244013] [Gen93][TDD 3G] RATDM Code SMP
+ * odify SMP fucntion SHAQ_rlcQueryNormalQueueLeftBits for FDD not ready SMP..
+ *
+ * 04 26 2017 xiaokai.liu
+ * [MOLY00244013] [Gen93][TDD 3G] RATDM Code SMP
+ * .
+ *
+ * 03 30 2017 ravitej.ballakur
+ * [MOLY00238716] [Gen93] 6M RATDM Multiple PS feature sync
+ * M-PS changes for UMOLYA.
+ *
+ * 11 15 2016 ravitej.ballakur
+ * [MOLY00195360] [3G][RATDM][PDCP] - Gen93 3G RATDM and PDCP code modification for new HW and MCU Archi
+ * Fix for 14_6_6a,14_6_6b UESIM.
+ *
+ * 09 26 2016 ravitej.ballakur
+ * [MOLY00195360] [3G][RATDM][PDCP] - Gen93 3G RATDM and PDCP code modification for new HW and MCU Archi
+ * Merging 2G and WCDMA RATDM and PDCP changes from merge_CBr.
+ *
+ * 08 03 2016 ravitej.ballakur
+ * [MOLY00195360] [3G][RATDM][PDCP] - Gen93 3G RATDM and PDCP code modification for new HW and MCU Archi
+ * 3G RATDM and PDCP changes.
+ *
+ * 09 01 2015 head.hsu
+ * [MOLY00136551] [LR11 UT] RATDM UT code refine
+ *
+ * 05 20 2015 head.hsu
+ * [MOLY00089131] [MT6291 Gemini] L+W+W+W code revision check in
+ * ;RATDM/RABM/PDCP/CSR part check-in
+ *
+ * 05 30 2014 yungfu.chen
+ * [MOLY00067307] [RATDM][SHAQ] API refine for RAB remapping
+ *
+ * 05 29 2014 yungfu.chen
+ * [MOLY00067176] SERVICE REQUEST change design
+ *
+ * 04 09 2014 yungfu.chen
+ * [MOLY00061711] [K2 MD2] Call for Checkin
+ *
+ * 01 05 2014 johnson.liu
+ * [MOLY00052503] [MT6290E2][SGLTE][82LTEv2] [T+G] After a while, Can't ping on the 3G after PS switch back to 3G
+ * .
+ *
+ * 09 26 2013 yungfu.chen
+ * [MOLY00038877] remove MAX_EXT_PDP_CONTEXT/MAX_INT_PDP_CONTEXT usage of RATDM code
+ * .
+ *
+ * 09 12 2013 andrew.wu
+ * [MOLY00037580] [RATDM/PDCP]__NDIS_SUPPORT__ related code removal
+ * __NDIS_SUPPORT__ related code removal
+ *
+ * 04 24 2013 johnson.liu
+ * [MOLY00020653] [TDD][RATDM][PDCP]UT Code Integration and VC Build Warning Remove
+ * .
+ *
+ * 01 23 2013 andrew.wu
+ * [MOLY00004240] [RABM/PDCP]LTE multimode modification
+ * Integration change.
+ *
+ * 12 07 2012 andrew.wu
+ * [MOLY00007098] LOCAL_PARA_HDR/PEER_BUF_HDR modification
+ * LOCAL_PARA_HDR/PEER_BUF_HDR modification
+ *
+ * 10 01 2012 andrew.wu
+ * [MOLY00004236] [interface][service][kal]remove stack_ltlcom.h
+ *
+ * Remove stack_ltlcom.h
+ *
+ * 08 22 2012 andrew.wu
+ * [MOLY00002319] [MSBB] Remove Invalid Inter-Category Including.
+ * modem related option move to modem internal
+ *
+ * 08 07 2012 andrew.wu
+ * [MOLY00001588] [MT6575_ADAPT][LTE-BTR-1-7302] Bad audio qualilty in 12.2Kbps Uplink
+ * [uas]URLC TM queue switchable modification
+ *
+ * 07 05 2012 jl.hsiao
+ * [MOLY00000288] [RATDM] Removal of kal_internal_api.h
+ * .
+ *
+ * 06 20 2012 carlson.lin
+ * removed!
+ * <saved by Perforce>
+ *
+ * 06 20 2012 carlson.lin
+ * removed!
+ * <saved by Perforce>
+ *
+ * 06 19 2012 carlson.lin
+ * removed!
+ * decide not to use mutex, decide to use lock IRQ to replace change_priority
+ *
+ *
+ * 06 11 2012 carlson.lin
+ * removed!
+ * <saved by Perforce>
+ *
+ * 04 24 2012 wcpuser_integrator
+ * removed!
+ * .
+ *
+ * 03 16 2012 carlson.lin
+ * removed!
+ * <saved by Perforce>
+ *
+ * 02 01 2012 carlson.lin
+ * removed!
+ * <saved by Perforce>
+ *
+ * 01 13 2012 carlson.lin
+ * removed!
+ * <saved by Perforce>
+ *
+ * 01 11 2012 carlson.lin
+ * removed!
+ * <saved by Perforce>
+ *
+ * 08 12 2011 carlson.lin
+ * removed!
+ * <saved by Perforce>
+ *
+ * 04 25 2011 carlson.lin
+ * removed!
+ * <saved by Perforce>
+ *
+ *
+ ******************************************************************************/
+#ifndef _RATDM_SHAQ_API_H
+#define _RATDM_SHAQ_API_H
+
+#include "ratdm_shaq_application_api.h"
+
+#ifdef __RATDM_UL_SHAQ__
+#include "kal_general_types.h"
+#include "kal_public_defs.h"
+#include "mcd_l3_inc_gprs_struct.h"
+#include "l3_inc_local.h"
+#include "mmi_l3_enums.h"
+#include "kal_public_api.h"
+#include "ps_ratdm_struct.h"
+#include "global_def.h"
+#include "flc2_ent_functions.h"
+#include "l3_inc_enums.h"
+#include "mcd_l3_inc_struct.h"
+
+#ifdef __GEMINI__
+#include "sim_common_enums.h"
+#endif
+
+#ifdef __DIALUP_GPRS_COUNTER_SUPPORT__
+#include "l4c_ratdm_struct.h"
+#endif
+
+#ifdef __UMTS_RAT__
+#include "uas_common_enums.h"
+#endif
+
+/* MACRO DEFINITION */
+#ifndef __UMTS_RAT__
+#define LAST_EXTENDED_RB_ID (32) //refer to uas_common_enums.h
+#endif // ~ #ifndef __UMTS_RAT__
+
+//#define __SHAQ_MINIMUM_LEVEL_GUARD_PATTERN_CHECK__ // can be turn off
+//#define __SHAQ_MAXIMUM_LEVEL_GUARD_PATTERN_CHECK__ // can be turn off
+
+#if defined (__SHAQ_MAXIMUM_LEVEL_GUARD_PATTERN_CHECK__) || defined (__SHAQ_MINIMUM_LEVEL_GUARD_PATTERN_CHECK__)
+#define __SHAQ_GUARD_PATTERN_CHECK__
+#endif // ~ #if defined (__SHAQ_MAXIMUM_LEVEL_GUARD_PATTERN_CHECK__) || defined (__SHAQ_MINIMUM_LEVEL_GUARD_PATTERN_CHECK__)
+
+#define SHAQ_32BIT_GUARD_PATTERN (0x7D7E7D7E)
+#define SHAQ_16BIT_GUARD_PATTERN (0x7D7E)
+#define SHAQ_8BIT_GUARD_PATTERN (0x7D)
+#define SHAQ_REASONABLE_MAXIMUM_SDU_SIZE MAX_VAL((MAX_L2_EXTERNAL_SDU_SIZE), 1520)
+
+/*
+ 3 ways to protest the queue
+ 1. lock interrupt
+ kal_uint32 savedIRQMask;
+ savedIRQMask = SaveAndSetIRQMask();
+ RestoreIRQMask(savedIRQMask);
+ 2. Disable scheduler
+ 3. change priority to equal to UL2 task
+*/
+#define M_SHAQ_IN_CRITICAL_ZONE(taskid,orig_prio)
+#define M_SHAQ_OUT_CRITICAL_ZONE(taskid,orig_pri)
+
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif // ~ #if 0
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif // ~ #if 0
+
+#define M_SHAQ_IN_CRITICAL_ZONE_USING_LOCK_IRQ()
+#define M_SHAQ_OUT_CRITICAL_ZONE_USING_LOCK_IRQ()
+
+#define M_SHAQ_LOGGER(p)
+// TODO: implement
+#define M_SHAQ_PRINT(X)
+// TODO: implement
+#define M_SHAQ_SAP NULL
+// TODO: implement?
+
+#define MAX_CS_TM_Q_NUM (3)
+#define MAX_CS_UM_Q_NUM (1)
+
+#define M_SHAQ_ASSERT(X) ASSERT(X)
+#define M_SHAQ_DEBUG_ASSERT(X) ASSERT(X) // TODO: this configuration can be turned off
+#define M_SHAQ_MAX_Q_SIZE ((PS_TOT_NSAPI_NUM)+((MAX_CS_TM_Q_NUM)+(MAX_CS_UM_Q_NUM))+(1))
+#define M_SHAQ_MINIMUM_CONTEXT_ID (1)
+#define M_SHAQ_MAXIMUM_CONTEXT_ID ((PS_TOT_NSAPI_NUM)+((MAX_CS_TM_Q_NUM)+(MAX_CS_UM_Q_NUM)))
+
+#define M_MIN_PS_SHAQ_NUMBER (M_SHAQ_MINIMUM_CONTEXT_ID)
+#define M_MAX_PS_SHAQ_NUMBER (PS_TOT_NSAPI_NUM)
+#define M_MIN_CS_SHAQ_NUMBER ((M_MAX_PS_SHAQ_NUMBER)+(1))
+#define M_MAX_CS_SHAQ_NUMBER (M_SHAQ_MAXIMUM_CONTEXT_ID)
+
+#define M_MIN_PS_CONTEXT_ID (M_MIN_PS_SHAQ_NUMBER)
+#define M_MAX_PS_CONTEXT_ID (M_MAX_PS_SHAQ_NUMBER)
+#define M_MIN_CS_CONTEXT_ID (M_MIN_CS_SHAQ_NUMBER)
+#define M_MAX_CS_CONTEXT_ID (M_MAX_CS_SHAQ_NUMBER)
+
+#define M_SHAQ_CS_TM_Q_NUM_1 (M_MIN_CS_CONTEXT_ID)
+#define M_SHAQ_CS_TM_Q_NUM_2 ((M_MIN_CS_CONTEXT_ID)+(1))
+#define M_SHAQ_CS_TM_Q_NUM_3 ((M_MIN_CS_CONTEXT_ID)+(2))
+#define M_SHAQ_CS_UM_Q_NUM (M_MAX_CS_CONTEXT_ID)
+
+#define M_SHAQ_MAX_NUM (MAX_SIM_NUM)
+#define GET_SHAQ_IDX(sim) ((sim >= M_SHAQ_MAX_NUM)?0:sim)
+
+#define M_SHAQ_MAX_NSAPI (15)
+#define M_SHAQ_SOCKET_NSAPI_ARRAY_SIZE ((M_SHAQ_MAX_NSAPI)+((MAX_CS_TM_Q_NUM)+(MAX_CS_UM_Q_NUM))+(1))
+#define M_SHAQ_SOCKET_CID_ARRAY_SIZE ((M_SHAQ_MAXIMUM_CONTEXT_ID)+(1))
+#define M_SHAQ_SOCKET_RBID_ARRAY_SIZE ((LAST_EXTENDED_RB_ID)+(1))
+
+#define M_SHAQ_FIND_Q_USING_CID(qPtr, cid, shaq_idx) qPtr = &(RATDM_SHAQ[shaq_idx][cid]);
+
+#define M_SHAQ_PRINT_SHAQ_CONTENT(ap_Queue) SHAQ_int_print_queue(ap_Queue)
+#define M_SHAQ_RECORD_SHAQ_IMPORTANT_CONTENT(ap_Queue) SHAQ_int_record_important_queue(ap_Queue)
+#define M_SHAQ_PRINT_SHAQ_IMPORTANT_CONTENT(ap_Queue,queue_idx,cid_for_logging) SHAQ_int_print_important_queue(ap_Queue,queue_idx,cid_for_logging)
+#if defined (__SHAQ_MAXIMUM_LEVEL_GUARD_PATTERN_CHECK__) || defined (__SHAQ_MINIMUM_LEVEL_GUARD_PATTERN_CHECK__)
+#define M_SHAQ_INIT_Q_GUARD_PATTERN(ap_Queue) SHAQ_int_init_q_guard_pattern(ap_Queue)
+#define M_SHAQ_CHECK_Q_GUARD_PATTERN(ap_Queue) SHAQ_int_check_q_guard_pattern(ap_Queue)
+#define M_SHAQ_INIT_SOCKET_GUARD_PATTERN() SHAQ_int_init_socket_guard_pattern()
+#define M_SHAQ_CHECK_SOCKET_GUARD_PATTERN(sim_interface) SHAQ_int_check_socket_guard_pattern(sim_interface)
+#define M_SHAQ_DOUBLE_CHECK_QUEUE_ELEMENT_NUMBERS_CONSISTENCY(ap_Queue) SHAQ_int_double_check_queue_element_numbers_consistency(ap_Queue)
+#else
+#define M_SHAQ_INIT_Q_GUARD_PATTERN(ap_Queue)
+#define M_SHAQ_CHECK_Q_GUARD_PATTERN(ap_Queue)
+#define M_SHAQ_INIT_SOCKET_GUARD_PATTERN()
+#define M_SHAQ_CHECK_SOCKET_GUARD_PATTERN(sim_interface)
+#define M_SHAQ_DOUBLE_CHECK_QUEUE_ELEMENT_NUMBERS_CONSISTENCY(ap_Queue)
+#endif // ~ #if defined (__SHAQ_MAXIMUM_LEVEL_GUARD_PATTERN_CHECK__) || defined (__SHAQ_MINIMUM_LEVEL_GUARD_PATTERN_CHECK__)
+
+#define SHAQ_psProcessOneCTrackPkt(X,Y)
+
+#ifdef __RATDM_UT__
+/*#define RATDM_SHAQ_CALL_FLC_FREE(X,Y) kal_brief_trace(TRACE_GROUP_1, RATDM_SHAQ_FAKE_FLC_FREE_IN_UT, X, Y)*/
+#else // #ifdef __RATDM_UT__
+/*#define RATDM_SHAQ_CALL_FLC_FREE(X,Y) flc2_free_peer_buff(X,Y)*/
+#endif // ~ #ifdef __RATDM_UT__
+
+#ifdef __MTK_TARGET__
+#define RATDM_GET_BITS(_uc, _s, _w) GET_BITS(_uc, _s, _w)
+#else
+#define RATDM_GET_BITS(_uc, _s, _w) get_bits(_uc, _s, _w)
+#endif
+
+/*
+#define M_SHAQ_ELMT_HEADER \
+ PEER_BUFF_HDR \
+ SHAQ_qElmtHeader* next_shaqElmt;
+*/
+
+/* memory free function */
+typedef void (*pShaqFuncFree) (kal_uint8*);
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+#ifdef __UMTS_RAT__
+/* for CS only */
+typedef struct
+{
+ /* Dont touch this part */
+ //M_SHAQ_ELMT_HEADER
+ PEER_BUFF_HDR
+ struct SHAQ_qElmtHeader *next_shaqElmt;
+
+ /* Hands off please */
+
+ kal_uint16 bitLength;
+ kal_uint16 frame_index;
+
+ ExtendedRbId RBId;
+ kal_bool queued_enabled;
+ kal_uint16 dummy;
+
+} SHAQ_csr_data_req_struct;
+#endif //~#ifdef __UMTS_RAT__
+
+typedef struct
+{
+ #ifdef __SHAQ_MINIMUM_LEVEL_GUARD_PATTERN_CHECK__
+ kal_uint32 shareQMinLvlGuardPattern1;
+ #endif // ~ #ifdef __SHAQ_MINIMUM_LEVEL_GUARD_PATTERN_CHECK__
+
+ /* Main Queue */
+ kal_uint32 m_qCount;
+ kal_uint32 m_qDataQuantity; /* In BITs */
+ #ifdef __SHAQ_MAXIMUM_LEVEL_GUARD_PATTERN_CHECK__
+ kal_uint32 shareQMaxLvlGuardPattern1;
+ #endif // ~ #ifdef __SHAQ_MAXIMUM_LEVEL_GUARD_PATTERN_CHECK__
+ struct SHAQ_qElmtHeader *mp_tail;
+ #ifdef __SHAQ_MAXIMUM_LEVEL_GUARD_PATTERN_CHECK__
+ kal_uint32 shareQMaxLvlGuardPattern2;
+ #endif // ~ #ifdef __SHAQ_MAXIMUM_LEVEL_GUARD_PATTERN_CHECK__
+ struct SHAQ_qElmtHeader m_sentinel;
+ #ifdef __SHAQ_MAXIMUM_LEVEL_GUARD_PATTERN_CHECK__
+ kal_uint32 shareQMaxLvlGuardPattern3;
+ #endif // ~ #ifdef __SHAQ_MAXIMUM_LEVEL_GUARD_PATTERN_CHECK__
+
+} SHAQ_linkListQEntity;
+
+#ifdef __RATDM_SHAQ_HAS_PRIORITY_QUEUE__
+typedef enum
+{
+ SHAQ_PRIORITY_QUEUE,
+ SHAQ_NORMAL_QUEUE,
+ SHAQ_NUMBER_OF_LINKED_LIST_QUEUE_FOR_A_RB
+} SHAQ_LLQUEUE_IDX;
+#else // #ifdef __RATDM_SHAQ_HAS_PRIORITY_QUEUE__
+typedef enum
+{
+ SHAQ_NORMAL_QUEUE,
+ SHAQ_PRIORITY_QUEUE = SHAQ_NORMAL_QUEUE,
+ SHAQ_NUMBER_OF_LINKED_LIST_QUEUE_FOR_A_RB
+} SHAQ_LLQUEUE_IDX;
+#endif // ~ #ifdef __RATDM_SHAQ_HAS_PRIORITY_QUEUE__
+
+typedef struct
+{
+ SHAQ_linkListQEntity ll_queue[SHAQ_NUMBER_OF_LINKED_LIST_QUEUE_FOR_A_RB];
+ pShaqFuncFree mpf_free; /* free function */
+ #ifdef __SHAQ_MAXIMUM_LEVEL_GUARD_PATTERN_CHECK__
+ kal_uint32 shareQMaxLvlGuardPattern4;
+ #endif // ~ #ifdef __SHAQ_MAXIMUM_LEVEL_GUARD_PATTERN_CHECK__
+
+ //kal_uint16 m_cTrackCount; /* the count of current cTrack data (inc: PPP) (dec: PDCP) */
+ // #ifdef __SHAQ_MAXIMUM_LEVEL_GUARD_PATTERN_CHECK__
+ // kal_uint16 shareQMaxLvlGuardPattern5;
+ // #endif // ~ #ifdef __SHAQ_MAXIMUM_LEVEL_GUARD_PATTERN_CHECK__
+
+ kal_bool m_isShaqInitiated; /* Used to identify if Q is ready, for RLC to know if it need to check this Q or not */
+
+ #ifdef __SHAQ_MINIMUM_LEVEL_GUARD_PATTERN_CHECK__
+ kal_uint8 shareQMinLvlGuardPattern2;
+ #endif // ~ #ifdef __SHAQ_MINIMUM_LEVEL_GUARD_PATTERN_CHECK__
+
+} SHAQ_qEntity;
+
+typedef struct rb_nsapi_cid_mapping_arrays_struct
+{
+ #ifdef __SHAQ_MINIMUM_LEVEL_GUARD_PATTERN_CHECK__
+ kal_uint8 socketMinLvlGuardPattern11;
+ #endif // ~ #ifdef __SHAQ_MINIMUM_LEVEL_GUARD_PATTERN_CHECK__
+ kal_uint8 CID_nsapi_map[M_SHAQ_SOCKET_CID_ARRAY_SIZE];
+ #ifdef __SHAQ_MINIMUM_LEVEL_GUARD_PATTERN_CHECK__
+ kal_uint8 socketMinLvlGuardPattern12;
+ #endif // ~ #ifdef __SHAQ_MINIMUM_LEVEL_GUARD_PATTERN_CHECK__
+ kal_uint8 nsapi_CID_map[M_SHAQ_SOCKET_NSAPI_ARRAY_SIZE];
+ #ifdef __SHAQ_MINIMUM_LEVEL_GUARD_PATTERN_CHECK__
+ kal_uint8 socketMinLvlGuardPattern13;
+ #endif // ~ #ifdef __SHAQ_MINIMUM_LEVEL_GUARD_PATTERN_CHECK__
+ kal_uint8 RBId_nsapi_map[M_SHAQ_SOCKET_RBID_ARRAY_SIZE];
+ #ifdef __SHAQ_MINIMUM_LEVEL_GUARD_PATTERN_CHECK__
+ kal_uint8 socketMinLvlGuardPattern14;
+ #endif // ~ #ifdef __SHAQ_MINIMUM_LEVEL_GUARD_PATTERN_CHECK__
+ kal_uint8 nsapi_RBId_map[M_SHAQ_SOCKET_NSAPI_ARRAY_SIZE];
+ #ifdef __SHAQ_MINIMUM_LEVEL_GUARD_PATTERN_CHECK__
+ kal_uint8 socketMinLvlGuardPattern15;
+ #endif // ~ #ifdef __SHAQ_MINIMUM_LEVEL_GUARD_PATTERN_CHECK__
+ kal_bool RBId_already_occupied_by_lbm[M_SHAQ_SOCKET_RBID_ARRAY_SIZE]; // this is to remember if certain RB is occupied by LBM
+ kal_uint8 RBId_RabId_lbm[M_SHAQ_SOCKET_RBID_ARRAY_SIZE]; //used for getting the SIT index
+#ifdef __MTK_TARGET__
+ kal_bool nsapi_RBId_plmn_map[M_SHAQ_SOCKET_NSAPI_ARRAY_SIZE];
+#endif
+} rb_nsapi_cid_mapping_arrays_struct;
+
+typedef struct ratdm_shaq_trace_data_for_a_llq{
+ kal_uint32 m_qCount;
+ kal_uint32 m_qDataQuantity; /* In BITs */
+} ratdm_shaq_trace_data_for_a_llq;
+
+typedef struct ratdm_shaq_trace_data_temp_buffer{
+ SHAQ_qEntity *ap_Queue;
+ SHAQ_qElmtHeader *ap_qElmt;
+ ratdm_shaq_trace_data_for_a_llq llq_trace_info[SHAQ_NUMBER_OF_LINKED_LIST_QUEUE_FOR_A_RB];
+ kal_uint16 ip_id;
+ SHAQ_LLQUEUE_IDX queue_idx;
+} ratdm_shaq_trace_data_temp_buffer;
+
+typedef struct ratdm_shaq_print_ps_q_element_struct
+{
+ LOCAL_PARA_HDR
+
+ ratdm_ps_data_req_struct ps_data_req;
+} ratdm_shaq_print_ps_q_element_struct;
+
+#ifdef __UMTS_RAT__
+typedef struct {
+ LOCAL_PARA_HDR
+
+ SHAQ_csr_data_req_struct csr_data_req;
+} ratdm_shaq_print_cs_q_element_struct;
+#endif // ~ #ifdef __UMTS_RAT__
+
+/* Structure */
+// IPv4 Header
+#define RATDM_IPV4_UPPER_LAYER_PROTOCOL_OFFSET (9)
+#define RATDM_IPV4_UPPER_LAYER_PROTOCOL_TCP (6)
+#define RATDM_IPV4_UPPER_LAYER_PROTOCOL_UDP (17)
+#define RATDM_TCP_ACK_POSITION_OFFSET (13)
+// IPv6 Header
+#define RATDM_IPV6_FIRST_NEXT_HEADER_OFFSET (6)
+#define RATDM_IPV6_NEXT_HEADER_TCP (6)
+#define RATDM_IPV6_NO_EXT_HDR_HEADER_LENGTH (40)
+// Judge TCP ACK
+ #define REASONABLE_TCP_ACK_PKT_SIZE (60)
+
+#ifdef __RATDM_UT__
+#define NEED_TO_BE_CHECKED_PKT_SIZE (99)
+#else // #ifdef __RATDM_UT__
+#define NEED_TO_BE_CHECKED_PKT_SIZE ((REASONABLE_TCP_ACK_PKT_SIZE)+(16)) // 16 is a RD decided buffer value and can be adjusted based on observed TCP ACK size distributions
+#endif // ~ #ifdef __RATDM_UT__
+
+#define SHAQ_psFillRBIdRABIdMapping SHAQ_psFillRBIdNsapiMapping
+#define SHAQ_psEraseRBIdRABIdMapping SHAQ_psEraseRBIdNsapiMapping
+
+#ifdef __UMTS_RAT__
+#ifdef UNIT_TEST
+#define SHAQ_RLC_UT_CreateRB SHAQ_LBM_CreateRB
+#define SHAQ_RLC_UT_ReleaseRB SHAQ_LBM_ReleaseRB
+#endif
+#endif // ~ #ifdef __UMTS_RAT__
+
+#define SHAQ_dequeue_normal_queue(RB, LEFT_BITS, sim_interface) SHAQ_dequeue_diff_priority_queue(RB, LEFT_BITS, SHAQ_NORMAL_QUEUE, sim_interface)
+
+#ifdef __RATDM_SHAQ_HAS_PRIORITY_QUEUE__
+#define SHAQ_dequeue_priority_queue(RB, LEFT_BITS, sim_interface) SHAQ_dequeue_diff_priority_queue(RB, LEFT_BITS, SHAQ_PRIORITY_QUEUE, sim_interface)
+#endif
+
+#ifdef UNIT_TEST
+#define SHAQ_pdcp_ut_check_queue_context(RBId, ut_module, sim_interface) SHAQ_pdcp_ut_check_queue_context_with_priority_info(RBId, ut_module, SHAQ_NORMAL_QUEUE, sim_interface)
+#endif
+
+/* EXPORT FUNCTIONS */
+extern void SHAQ_bootup(void);
+extern void SHAQ_psFillCidNsapiMapping(kal_uint8 CID, kal_uint8 nsapi, kal_uint8 sim_interface);
+extern void SHAQ_psEraseCidNsapiMapping(kal_uint8 nsapi, kal_uint8 sim_interface);
+extern void SHAQ_psFillRBIdNsapiMapping(kal_uint8 RBId, kal_uint8 nsapi, kal_uint8 sim_interface);
+extern void SHAQ_psEraseRBIdNsapiMapping(kal_uint8 RBId, kal_uint8 sim_interface);
+extern void SHAQ_change_turn_off_priority_queue_setting(kal_bool new_setting, kal_uint8 sim_interface);
+
+#ifdef __UMTS_RAT__
+extern void SHAQ_mountFreeFunc(kal_uint8 a_cid, pShaqFuncFree apf_free, kal_uint8 sim_interface);
+extern pShaqFuncFree SHAQ_queryFreeFunc(ExtendedRbId RbId, kal_uint8 sim_interface);
+extern kal_uint8 SHAQ_getCidFromRbid(ExtendedRbId RbId, kal_taskid taskid, kal_uint8 sim_interface);
+extern kal_uint8 SHAQ_rlcGetCidFromRbid(ExtendedRbId RbId, kal_uint8 sim_interface);
+extern kal_uint32 SHAQ_rlcQueryNormalQueueLeftBits_wt_lock(ExtendedRbId RbId, kal_uint8 sim_interface);
+extern kal_uint32 SHAQ_rlcQueryNormalQueueLeftBits(ExtendedRbId RbId, kal_uint8 sim_interface);
+extern SHAQ_qEntity *SHAQ_rlcFindQFromCid(kal_uint8 cid, kal_uint8 sim_interface);
+extern SHAQ_qElmtHeader *SHAQ_dequeue_diff_priority_queue(kal_uint8 a_txRbId, kal_uint32 *queue_left_bits, SHAQ_LLQUEUE_IDX priority, kal_uint8 sim_interface);
+extern SHAQ_retCode SHAQ_psPdcpEnqueue(ExtendedRbId RbId, SHAQ_qElmtHeader *pPeer, kal_taskid taskid, kal_uint8 sim_interface);
+extern SHAQ_retCode SHAQ_csCsrEnqueue(kal_uint8 a_cid, SHAQ_qElmtHeader *ap_data, kal_uint8 sim_interface);
+extern void SHAQ_csRBestablished(kal_uint8 CID, kal_uint8 RBId, kal_uint8 sim_interface);
+extern void SHAQ_csRBreleased(kal_uint8 RBId, kal_uint8 sim_interface);
+extern kal_uint8 SHAQ_LBM_CreateRB(kal_uint8 RBId, kal_uint8 sim_interface);
+extern kal_bool SHAQ_LBM_ReleaseRB(kal_uint8 RBId, kal_uint8 sim_interface);
+extern kal_uint16 SHAQ_get_activated_RAB_status(kal_uint8 sim_interface);
+extern void SHAQ_clearPsKickUL2(ExtendedRbId RbId, kal_uint8 sim_interface);
+extern void SHAQ_csKickUL2(module_type source_module, kal_uint8 sim_interface);
+extern void SHAQ_psKickUL2(module_type source_module, ExtendedRbId RbId, kal_uint8 sim_interface);
+
+#ifdef __RATDM_SHAQ_HAS_PRIORITY_QUEUE__
+extern kal_uint32 SHAQ_rlcQueryPriorityQueueLeftBits_wt_lock(ExtendedRbId RbId, kal_uint8 sim_interface);
+extern kal_uint32 SHAQ_rlcQueryPriorityQueueLeftBits(ExtendedRbId RbId, kal_uint8 sim_interface);
+#endif
+
+#ifdef UNIT_TEST
+extern void SHAQ_RLC_UT_enqueue(SHAQ_qEntity *ap_Queue, struct SHAQ_qElmtHeader *ap_qElmt, SHAQ_LLQUEUE_IDX queue_idx);
+extern struct SHAQ_qElmtHeader *SHAQ_RLC_UT_dequeue(SHAQ_qEntity *ap_queue, SHAQ_LLQUEUE_IDX queue_idx);
+extern struct SHAQ_qElmtHeader *SHAQ_RLC_UT_dequeue_normal_queue(ExtendedRbId RbId, kal_uint32 *queue_left_bits, kal_uint8 sim_interface);
+extern void SHAQ_csr_ut_check_queue_context(kal_uint8 a_cid, module_type ut_module, kal_uint8 sim_interface);
+extern void SHAQ_pdcp_ut_check_queue_context_with_priority_info(ExtendedRbId RbId, module_type ut_module, SHAQ_LLQUEUE_IDX priority, kal_uint8 sim_interface);
+
+#ifdef __RATDM_SHAQ_HAS_PRIORITY_QUEUE__
+extern struct SHAQ_qElmtHeader *SHAQ_RLC_UT_dequeue_priority_queue(ExtendedRbId RbId, kal_uint32 *queue_left_bits, kal_uint8 sim_interface);
+#endif // ~ #ifdef __RATDM_SHAQ_HAS_PRIORITY_QUEUE__
+#endif // ~ #ifdef UNIT_TEST
+
+#ifdef __RATDM_UT__
+extern void SHAQ_fake_free_buff_func(kal_uint8 *pBuffer);
+extern void SHAQ_test1(void);
+extern void SHAQ_test2(void);
+extern void SHAQ_test3(void);
+#endif // ~ #ifdef __RATDM_UT__
+#endif // ~ #ifdef __UMTS_RAT__
+#endif // ~ #ifdef __RATDM_UL_SHAQ__
+
+#endif /* _RATDM_SHAQ_API_H */
diff --git a/mcu/protocol/interface/general/ratdm_sit_api.h b/mcu/protocol/interface/general/ratdm_sit_api.h
new file mode 100644
index 0000000..820d0f2
--- /dev/null
+++ b/mcu/protocol/interface/general/ratdm_sit_api.h
@@ -0,0 +1,405 @@
+/******************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*******************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * --------------------------------------------------------
+ * ratdm_sit_api.h
+ *
+ * Project:
+ * --------------------------------------------------------
+ *
+ *
+ * Description:
+ * --------------------------------------------------------
+ *
+ *
+ * Author:
+ * --------------------------------------------------------
+ * -------
+ *
+ * --------------------------------------------------------
+ * $Log$
+ *
+ * 12 21 2020 vend_mtb_aricent019
+ * [MOLY00535131] [MP3 Excluded][Gen97][MT6885][Petrus][TMO-US][F4L][Seattle][3G][NSN][3G_DP] DUT 3G AVG HTTP MS/SS DL worse than REF GS9 in Moderate Location (CN Phone)
+ *
+ * 07 22 2020 vend_mtb_mobiveil024
+ * [MOLY00535131] [MP3 Excluded][Gen97][MT6885][Petrus][TMO-US][F4L][Seattle][3G][NSN][3G_DP] DUT 3G AVG HTTP MS/SS DL worse than REF GS9 in Moderate Location (CN Phone)
+ *
+ * .
+ *
+ * 09 23 2019 tc.chang
+ * [MOLY00427068] [Gen97][UPCM][RATDM][ENPDCP] Dynamic SIT.
+ *
+ * 10 31 2018 tc.chang
+ * [MOLY00361478] [Gen97] Gemini Compile Option Clean Up.
+ *
+ * 09 18 2018 tc.chang
+ * [MOLY00345990] [VMOLY] Code sync.
+ *
+ * 09 14 2018 tc.chang
+ * [MOLY00345990] [VMOLY] Code sync
+ * Rollback first. Fix build error locally
+ *
+ * 07 20 2018 kiran.bm
+ * [MOLY00338295] [CODE SYNC] [R2.MP][UG][MT6761][Merlot][O1][MP3][FT][India][Delhi][VoLTE][RJIO][IDEA][Auto][Android Linux Script][SST] Modem Warning: +EWARNING: [1][643] dpcopro_mmu_drv.c #992; (timestamp: 650294582) VRB:1.ofs:0x107.pv:0x282DFC4 rfail pidx:0x340
+ * .
+ *
+ * 11 09 2017 rajesh.sastry
+ * [MOLY00288379] ?CU official test??OPPO??17031??CU??CA NS-IOT?FDD B3,active data session on B3c CA cell, start MO voice call and CSFB to WCDMA cells, voice and data session continued MO disconnect the call, fast return to LTE network and start CA
+ *
+ * 10 16 2017 ravitej.ballakur
+ * [MOLY00280838] [UMOLYA] PDCP indirect mode corrections
+ * misc ccorrection for PDCP indirect mode and UT.
+ *
+ * 09 12 2017 sean.jheng
+ * [MOLY00275212] [RATDM] Fix UT UG cases
+ *
+ * .
+ *
+ * 09 04 2017 tc.chang
+ * [MOLY00275212] [RATDM] Fix UT UG cases.
+ *
+ * 08 29 2017 ravitej.ballakur
+ * [MOLY00274506] [BIANCO][MT6763][RDIT][L+L][MTBF][PHONE][Overnight][HQ][Lab][Ericsson][HCR]Fatal error(ADDRESS_ERROR_STORE)] err_code1:0x00000005 err_code2:0x910C7E03 err_code3:0x910C7DEB
+ * .
+ *
+ * 08 23 2017 ravitej.ballakur
+ * [MOLY00268053] [Gen93] Miscelleneous changes in RATDM UG
+ * .
+ *
+ * 08 23 2017 ravitej.ballakur
+ * [MOLY00268053] [Gen93] Miscelleneous changes in RATDM UG
+ * .
+ *
+ * 08 18 2017 ming.lee
+ * [MOLY00271498] [MT6763][Bianco][N1][EIOT-3G][TW][HQ][3GSM][HSDPA][TC-IOT-HS156] throughput not stable ,MAX 17Mb/s down to 600Kb/s
+ * .
+ *
+ * 08 18 2017 ravitej.ballakur
+ * [MOLY00271871] [MT6763][Bianco][N1][WW FT][Australia][Sydney][Overnight][Sydney][SIM1:Telstra]Trigger time:[2017-08-11 18:43:45.548535] md1:(MCU_core1.vpe0.tc0(VPE2)) [Fatal error(task)] err_code1:0x00000305 err_code2:0x8888007C err_code3:0xCCCCCCCC MD Offender:UL2
+ * .
+ *
+ * 08 01 2017 ravitej.ballakur
+ * [MOLY00268053] [Gen93] Miscelleneous changes in RATDM UG
+ * .
+ *
+ * 07 25 2017 xiaokai.liu
+ * [MOLY00266539] [TDD][MD MTBF][10.67 hours] Externel (EE),0,0,99,/data/core/,1,modem,Trigger time:[2017-07-20 01:39:42.970127]md1:(MCU_core0.vpe0.tc0(VPE0))[ASSERT] file:mcu/common/driver/sleep_drv/internal/src/ostd.c line:2224p1:0xa1000302p2:
+ * 1. dont set sit information within FLC for TDD3G
+ * 2. mark resync 0xff in rat_info
+ * 3. strong mapping RATDM buffer type to UPCM buffer type.
+ *
+ * 07 24 2017 ravitej.ballakur
+ * [MOLY00266295] [MT6763][C2K][CNOP][Regression]SIM2(CU card) send MMS fail
+ * .
+ *
+ * 07 06 2017 head.hsu
+ * [MOLY00261868] [6293]UL SIT new handling
+ * RATDM-UG, RATDM-CMN-SIG part
+ *
+ * 06 20 2017 timothy.yao
+ * [MOLY00257646] [SLIM] SIT enlarges memory size of 1.73MB when bug fix.
+ * SIT size reduction in TRUNK.
+ * (verified in MP1 local build & SE3 sanity)
+ *
+ * 06 11 2017 ravitej.ballakur
+ * [MOLY00256562] [MT6763][Bianco][N1][MTBF][PHONE][Overnight][HQ][Lab][Ericsson][ASSERT] file:mcu/common/driver/dpcopro/src/dpcopro_mmu_drv.c line:1645
+ * .
+ *
+ * 06 01 2017 ravitej.ballakur
+ * [MOLY00253823] [RATDM]code changes with specific RAT combination in CMN_SIG
+ * .
+ *
+ * 05 12 2017 ravitej.ballakur
+ * [MOLY00249237] [BIANCO][MT6763][RDIT][FT][SZ][Overnight][FDD][SIM1:CU][SIM2:CU][ASSERT] file:mcu/common/driver/dpcopro/src/dpcopro_mmu_drv.c line:1635
+ * cleaning up the upcm queue on pdp deactivation.
+ *
+ * 05 08 2017 ravitej.ballakur
+ * [MOLY00246514] [BIANCO][MT6763][RDIT] Sanity fail in case 6.2 SIM1 FTP DL xMB, SIM2 MT, SIM1 DL finish in 2G
+ * dynamic copro switch for GSM.
+ *
+ * 05 03 2017 ravitej.ballakur
+ * [MOLY00246824] [BIANCO][MT6763][RDIT][PHONE][Overnight][HQ][MTBF][Lab][Ericsson][ASSERT] file:mcu/common/driver/dpcopro/src/dpcopro_mmu_drv.c line:1591
+ * Fix for ALPS03275341
+ *
+ * 04 24 2017 ravitej.ballakur
+ * [MOLY00244615] [BIANCO][MT6763][RDIT][FT][FDD][CU][SH][SIM1:CU][SIM2:NA][ASSERT] file:mcu/common/driver/dpcopro/src/dpcopro_mmu_drv.c line:1638
+ * PDU stored in RABM but PDP deactivated, copro needs to be freed
+ *
+ * 04 24 2017 ravitej.ballakur
+ * [MOLY00244588] [BIANCO][MT6763][RDIT][FT][FDD][CU][SH][SIM1:CU][SIM2:NA]Assert fail: dpcopro_mmu_drv.c 1623 - DPCOPRO
+ * Fix resetting RATDM SIT table tail and head on IRAT to LTE
+ *
+ * 04 23 2017 anurag.pancholi
+ * [MOLY00244333] [BIANCO][MT6763] RATDM Target Warning Removal
+ * .
+ *
+ * 04 20 2017 ravitej.ballakur
+ * [MOLY00243931] [BIANCO][MT6763][RDIT][PHONE][Overnight][HQ][MTBF][Lab][Ericsson][ASSERT] file:mcu/pcore/modem/nas/ratdm/ug/src/ratdm_sit_api.c line:878
+ * Fix for ALPS03258421.
+ *
+ * 04 18 2017 ravitej.ballakur
+ * [MOLY00243205] [6293] Increase the SIT_Socket to hold 2 PS
+ * Increase SIT_Socket to hold 2 PS.
+ *
+ * 01 06 2017 ravitej.ballakur
+ * [MOLY00195360] [3G][RATDM][PDCP] - Gen93 3G RATDM and PDCP code modification for new HW and MCU Archi
+ * merge changes from FPGA dev branch.
+ *
+ * 12 28 2016 ravitej.ballakur
+ * [MOLY00195360] [3G][RATDM][PDCP] - Gen93 3G RATDM and PDCP code modification for new HW and MCU Archi
+ * Fix bug while wraparound SIT.
+ *
+ * 12 26 2016 ravitej.ballakur
+ * [MOLY00195360] [3G][RATDM][PDCP] - Gen93 3G RATDM and PDCP code modification for new HW and MCU Archi
+ * Fixing bug in RATDM free SDU for Target and UESIM as well as fixes for PDCP HC..
+ *
+ * 10 11 2016 ravitej.ballakur
+ * [MOLY00195360] [3G][RATDM][PDCP] - Gen93 3G RATDM and PDCP code modification for new HW and MCU Archi
+ * Bug fix for UESIM failure 7.1.7.4.
+ *
+ * 10 04 2016 ravitej.ballakur
+ * [MOLY00195360] [3G][RATDM][PDCP] - Gen93 3G RATDM and PDCP code modification for new HW and MCU Archi
+ * PDCP loopback bug fix for um mode.
+ *
+ *
+ ******************************************************************************/
+
+#ifndef _RATDM_SIT_API_H
+#define _RATDM_SIT_API_H
+
+#include "kal_general_types.h"
+#include "kal_public_defs.h"
+#include "event_info_utility.h"
+#include "mcd_l3_inc_gprs_struct.h"
+#include "l3_inc_local.h"
+#include "mmi_l3_enums.h"
+#include "kal_public_api.h"
+#include "ps_ratdm_struct.h"
+#include "global_def.h"
+#include "flc2_ent_functions.h"
+#include "l3_inc_enums.h"
+#include "mcd_l3_inc_struct.h"
+#include "upcm_ul_sit.h"
+#ifdef __GEMINI__
+#include "sim_common_enums.h"
+#endif
+
+#ifdef __UMTS_RAT__
+#include "uas_common_enums.h"
+#endif
+#include "ratdm_shaq_application_api.h"
+#include "ratdm_export_api.h"
+
+
+
+/* MACRO DEFINITION */
+#ifndef __UMTS_RAT__
+#define LAST_EXTENDED_RB_ID (32) //refer to uas_common_enums.h
+#endif // ~ #ifndef __UMTS_RAT__
+/* SIT definitions */
+#define MAX_SIT_INTERFACE 2 /* To care of 2 active PS connection at the same time */
+#define M_SIT_MAX_NSAPI (15)
+#define M_SIT_SOCKET_NSAPI_ARRAY_SIZE ((M_SIT_MAX_NSAPI)+((MAX_CS_TM_Q_NUM)+(MAX_CS_UM_Q_NUM))+(1))
+#define M_SIT_SOCKET_CID_ARRAY_SIZE ((M_SIT_MAXIMUM_CONTEXT_ID)+(1))
+#define M_SIT_SOCKET_RBID_ARRAY_SIZE ((LAST_EXTENDED_RB_ID)+(1))
+
+#define M_SIT_MINIMUM_CONTEXT_ID (1)
+#define M_SIT_MAXIMUM_CONTEXT_ID ((PS_TOT_NSAPI_NUM)+((MAX_CS_TM_Q_NUM)+(MAX_CS_UM_Q_NUM)))
+#ifdef __MTK_TARGET__
+#define M_SIT_PRIO_Q_SIZE_AFTER_DISCARD 10 /* PRIO Q SIZE after head movement*/
+#endif
+#if defined(__GEMINI__)
+#define RATDM_SIT_MAX_NUM MAX_SIM_NUM
+#else
+#define RATDM_SIT_MAX_NUM 1
+#endif
+
+/* RATDM SIT operations */
+#ifdef __MTK_TARGET__
+#define RATDM_SIT_CIRC_DIST(x,y,circ_buf_size) (((y)+(circ_buf_size)-(x)) % (circ_buf_size))
+#endif
+#define RATDM_IS_SIT_TABLE_EMPTY UPCM_SIT_IS_EMPTY
+#define RATDM_IS_SIT_TABLE_FULL UPCM_SIT_IS_FULL
+#define RATDM_IS_SIT_FREE UPCM_IS_SDU_FREED
+#define RATDM_GET_SIT_ENTRY(_tbl, _idx) (ratdm_ul_sdu_info_t *)((_tbl)->p_addr + (_idx))
+#define RATDM_GET_UPCM_SIT_ENTRY(_tbl, _idx) (upcm_ul_sdu_info_t *)((_tbl)->p_addr + (_idx))
+#define RATDM_GET_SIT_HEAD_ENTRY(_tbl) RATDM_GET_SIT_ENTRY(_tbl, (_tbl)->head)
+#define RATDM_GET_SIT_TAIL_ENTRY(_tbl) RATDM_GET_SIT_ENTRY(_tbl, (_tbl)->tail)
+#define RATDM_NEXT_SIT_IDX UPCM_SIT_IDX_NEXT
+#define RATDM_NEXT_N_SIT_IDX(_idx, _n, _size) UPCM_SIT_IDX_NEXT_N((_idx), (_n), (_size))
+#define RATDM_SIT_HEAD_NEXT(_tbl) UPCM_SIT_MV_HEAD((_tbl), 1)
+#define RATDM_SIT_TAIL_NEXT(_tbl) UPCM_SIT_MV_TAIL((_tbl), 1)
+#define RATDM_SIT_SET_TAIL(_tbl, _tail) \
+{\
+ (_tbl)->tail = (_tail);\
+}
+#define RATDM_GET_SDU_BUF_TYPE UPCM_GET_SDU_BUF_TYPE
+#define RATDM_SET_SDU_BUF_TYPE UPCM_SET_SDU_BUF_TYPE
+#define RATDM_SET_SIT_FREE UPCM_SET_SDU_FREED
+#define RATDM_CLR_SIT_FREE UPCM_CLR_SDU_FREED
+#define RATDM_SIT_FLAG_BIT_BCONFIRM ((kal_uint8)0x02)
+#define RATDM_SIT_SET_BCONFIRM(sdu_info_ptr) (sdu_info_ptr->rat_info |= RATDM_SIT_FLAG_BIT_BCONFIRM)
+#define RATDM_SIT_CLR_BCONFIRM(sdu_info_ptr) (sdu_info_ptr->rat_info &= ~RATDM_SIT_FLAG_BIT_BCONFIRM)
+#define RATDM_SIT_GET_BCONFIRM(sdu_info_ptr) ((sdu_info_ptr->rat_info & RATDM_SIT_FLAG_BIT_BCONFIRM)>>1)
+#define RATDM_SIT_FLAG_BIT_PRIO ((kal_uint8)0x01)
+#define RATDM_SIT_SET_PRIO(sdu_info_ptr,x) (sdu_info_ptr->rat_info |= (x & RATDM_SIT_FLAG_BIT_PRIO))
+#define RATDM_SIT_GET_PRIO(sdu_info_ptr) ((sdu_info_ptr->rat_info) & (RATDM_SIT_FLAG_BIT_PRIO))
+
+#define RATDM_MRAK_SIT_ENTRY_AS_RESYNC(_sit) \
+{\
+ (_sit)->rat_info = 0x0;\
+}
+#define RATDM_SET_MUI_FOR_SIT(is_prio,_idx) ((is_prio <<31)|(_idx))
+
+#ifdef __RATDM_UT__
+/* Do not free RATDM UT VRB */
+#define RATDM_FREE_SIT_ENTRY UPCM_FREE_SIT_ENTRY_WO_FREE_BUF
+#else
+#define RATDM_FREE_SIT_ENTRY UPCM_FREE_SIT_ENTRY
+#endif
+
+/* SIT enums */
+/* Error codes & Return codes */
+typedef enum
+{
+ SIT_OK,
+ SIT_GENERAL_ABORT,
+ SIT_CONVENTIONAL_TRACK,
+ SIT_UPLINK_DATA_GOTO_CONVENTIONAL_TRACK = SIT_CONVENTIONAL_TRACK,
+ SIT_KICK_UL2,
+ SIT_NOT_INITIATED,
+ SIT_CANNOT_FIND_Q,
+ SIT_CANNOT_FIND_NSAPI_FROM_CONTEXT_ID,
+ SIT_NSAPI_CHECK_FAIL,
+ SIT_EXCEPTION,
+ SIT_ABORT,
+ SIT_NOT_READY,
+ SIT_CANNOT_FIND_CID_FROM_RBID
+} SIT_retCode;
+
+/**
+ * @brief buffer type
+ */
+typedef enum
+{
+ RATDM_BUF_T_VRB = BUF_T_VRB,
+ RATDM_BUF_T_PRB = BUF_T_PRB,
+ RATDM_BUF_T_FLCV2 = BUF_T_UNUSED,
+ RATDM_BUF_T_CSR = BUF_T_GPD, // could be FLCv2/GPD/others...
+ RATDM_BUF_T_NUM = BUF_T_NUM
+} ratdm_ul_sdu_buf_type_e; // refer to ul_sdu_buf_type_e enum
+
+/* SIT Structures */
+typedef struct ratdm_ps_vrb_data_req_struct_tag
+{
+ kal_bool bConfirm;
+ kal_bool isVRB; //flag set for either VRB or PRB address
+ kal_uint8 TxRbId;
+ kal_uint16 bitLength;
+ kal_uint32 MUI;
+ kal_uint8 *sdu_addr;
+ kal_uint32 sit_entry_idx;
+} ratdm_ps_vrb_data_req_struct;
+
+
+
+typedef struct ratdm_ul_sdu_info_t_tag
+{
+ kal_int16 len;
+ kal_uint8 flags; // buffer type and free-bit
+ kal_uint8 rat_info; // priority/normal
+ kal_uint32 addr;
+ //kal_uint32 npdu_num; npdu num removed to optimize RAM space
+} ratdm_ul_sdu_info_t;
+
+typedef struct ratdm_ul_sit_t_tag
+{
+ ratdm_ul_sdu_info_t *p_addr; // SIT base address
+ kal_uint32 size; // SIT size (entry #)
+ kal_uint32 head;
+ kal_uint32 tail;
+ kal_uint32 used_size; //currently used size in bytes
+} ratdm_ul_sit_t;
+
+typedef struct
+{
+ kal_uint32 *sdu_addr;
+ kal_uint16 pkt_length;
+} ratdm_sit_ut_sdu_t;
+
+
+
+extern ratdm_ul_sit_t g_ratdm_sit_pri[RATDM_SIT_MAX_NUM][UPCM_SIT_GROUP_NUM_FOR_RATDM_SIT];
+extern ratdm_ul_sit_t g_ratdm_sit_nml[RATDM_SIT_MAX_NUM][UPCM_SIT_GROUP_NUM_FOR_RATDM_SIT];
+
+/*SIT Get and query API's */
+extern void *Get_SDU_Priority_SIT(ExtendedRbId tx_rb_id, kal_uint32 *left_bits, kal_uint8 sim_interface);
+extern void *Get_SDU_Normal_SIT(ExtendedRbId tx_rb_id, kal_uint32 *left_bits, kal_uint8 sim_interface);
+extern kal_uint32 RlcQuery_Normal_SIT_LeftBits(ExtendedRbId tx_rb_id, kal_uint8 sim_interface);
+extern kal_uint32 RlcQuery_Priority_SIT_LeftBits(ExtendedRbId tx_rb_id, kal_uint8 sim_interface);
+extern void RlcFree_SIT_SDU(ExtendedRbId tx_rb_id, kal_bool IsPrioSIT, kal_uint16 sit_entry_idx, kal_uint8 sim_interface);
+extern void FDD_urlc_vrb_va_shortage_hdlr(kal_uint32 vrb_id, kal_uint32 sim_idx);
+
+/* LoopBack API's */
+extern void SIT_LBM_CreateRB(ExtendedRbId rb_id,kal_uint8 sim_interface);
+extern void SIT_LBM_ReleaseRB(ExtendedRbId rb_id,kal_uint8 sim_interface);
+
+/*Non LB RBID RABId mapping API's*/
+extern void SIT_FillRBIdNsapiMapping(ExtendedRbId RBId, kal_uint8 nsapi, kal_uint8 sim_interface);
+#ifdef __MTK_TARGET__
+extern void SIT_MapPLMNinfo(ExtendedRbId RBId, kal_uint8 nsapi, kal_uint8 sim_interface, kal_bool is_seattle_plmn);
+extern void SIT_ResetPLMNinfo(ExtendedRbId RbId, kal_uint8 nsapi, kal_uint8 sim_interface);
+#endif
+extern void SIT_EraseRBIdNsapiMapping(ExtendedRbId RBId, kal_uint8 sim_interface);
+extern void SIT_psEraseCidNsapiMapping(kal_uint8 nsapi, kal_uint8 sim_interface);
+extern void SIT_psLeaveRatUmtsFdd(kal_uint8 sim_interface);
+extern void SIT_psFillCidNsapiMapping(kal_uint8 CID, kal_uint8 nsapi, kal_uint8 sim_interface);
+
+extern void SIT_RLC_test_enqueue(ExtendedRbId rb_id,ratdm_sit_ut_sdu_t *sdu_p, kal_bool IsPrioSIT,kal_uint8 sim_interface);
+extern void SIT_psEnqueueWithOnePacket(ratdm_ps_data_req_struct *ps_data_req,kal_uint8 sim_interface);
+extern void ratdm_SIT_free_vrb(kal_uint8 *FreePdu, kal_uint8 nsapi, kal_uint8 sim_interface);
+extern void SIT_psSimUnbind_FreeEnqueuedData(kal_uint8 nsapi, kal_uint8 sim_interface);
+
+extern void ratdm_ratadp_free_ug_epsb_ul_queue(kal_uint8 nsapi, kal_uint8 sim_interface);
+
+extern void ratdm_psEnqueueWithPriorityInfo(kal_uint8 nsapi,ratcmn_ul_sdu_93_t *p_sdus, kal_uint8 enqueue_decision, kal_uint8 sim_interface);
+extern void ratdm_sit_resync_head_n_tail(ratdm_ul_sit_t *ratdm_sit_tbl, kal_uint32 start_index);
+extern kal_bool ratdm_sit_table_free_bit_check(kal_uint8 sit_tbl_idx, kal_bool is_priority, kal_uint8 sim_interface);
+extern kal_uint16 SIT_get_activated_RAB_status(kal_uint8 sim_interface);
+
+#endif /* _RATDM_SIT_API_H */
diff --git a/mcu/protocol/interface/general/ratdm_sndcp_struct.h b/mcu/protocol/interface/general/ratdm_sndcp_struct.h
new file mode 100644
index 0000000..bfeb92d
--- /dev/null
+++ b/mcu/protocol/interface/general/ratdm_sndcp_struct.h
@@ -0,0 +1,222 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * ratdm_sndcp_struct.h
+ *
+ * Project:
+ * --------
+ * MONZA
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ ******************************************************************************/
+
+#ifndef RATDM_SNDCP_STRUCT_H
+#define RATDM_SNDCP_STRUCT_H
+
+// Poying: 20101005. RHR.
+// ------------------------------ suggest Add ------------------------------
+#include "mcd_l3_inc_gprs_struct.h"
+#include "l3_inc_local.h"
+//
+// Poying: 20101105. RHR
+//------------------------------ suggest Add ------------------------------
+#include "kal_general_types.h"
+#include "kal_public_defs.h"
+
+#include "flc2_config.h"
+
+#ifndef _MCD_L3_INC_GPRS_STRUCT_H
+#error "Please include mcd_l3_inc_grps_struct.h before ratdm_sndcp_struct.h"
+#endif
+
+typedef enum {
+ RATDM_SND_SEND_FROM_OLDEST, //0
+ RATDM_SND_SEND_FROM_SN // 1
+} ratdm_sndcp_transmit_type_enum;
+
+typedef struct {
+ kal_uint8 nsapi;
+ kal_uint8 is_NwRxSeq_valid; //valid only when it is ACK mode
+ kal_uint16 nw_rx_seq; //this is derived from SGSN's Received NPDU number
+ kal_uint8 ms_rx_seq; //this is MS's Received NPDU number, need to be passed to network.
+} nsapi_npdu_number_list;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 nsapi;
+ kal_uint16 npdu_number;
+ flc2_pool_id_enum pool_id;
+} ratdm_sndcp_data_req_struct, ratdm_sndcp_data_ind_struct, ratdm_sndcp_data_cnf_struct;
+
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 nsapi;
+ qos_struct qos_negotiated;
+ kal_uint32 p_comp_algo;
+ kal_uint32 d_comp_algo;
+ kal_uint8 llc_sapi;
+ kal_uint8 dl_pool_id; //flc2_pool_id_enum
+ kal_uint8 radio_priority;
+ kal_uint16 rcv_seq_no;
+ kal_uint16 send_seq_no;
+ kal_uint8 pfi; //erica 20060719
+} ratdm_sndcp_activate_req_struct, ratdm_sndcp_rat_enter_req_struct;
+
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 nsapi;
+} ratdm_sndcp_activate_cnf_struct, ratdm_sndcp_rat_ready_ind_struct;
+
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 nsapi;
+ qos_struct qos_negotiated;
+ kal_uint8 llc_sapi;
+ kal_uint8 radio_priority;
+ kal_uint8 pfi; //erica 20060719
+} ratdm_sndcp_modify_req_struct;
+
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 nsapi;
+} ratdm_sndcp_modify_cnf_struct;
+
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 no_of_valid_entries;
+ kal_uint8 nsapi_list[11];
+ kal_uint32 cause;
+ kal_bool xid_neg_indicator[11];
+} ratdm_sndcp_deactivate_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 no_of_valid_entries;
+ kal_uint8 nsapi_list[11];
+} ratdm_sndcp_deactivate_cnf_struct;
+
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 nsapi;
+ kal_uint8 cause; //llsnd_cause_enum
+} ratdm_sndcp_status_ind_struct;
+
+/* RATDM_RABM_SUSPEND_DATA_PLANE_IND */
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 no_of_valid_entries;
+ kal_uint8 nsapi_list[11];
+} ratdm_sndcp_suspend_data_plane_ind_struct;
+
+/* RATDM_RABM_RESUME_DATA_PLANE_IND */
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 no_of_valid_entries;
+ kal_uint8 nsapi_list[11];
+ kal_uint16 RetransmitFromSN[11];
+} ratdm_sndcp_resume_data_plane_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 no_of_valid_entries;
+ kal_uint8 nsapi_list[11];
+ kal_uint16 sequence_list[11];
+} ratdm_sndcp_sequence_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 no_of_valid_entries;
+ nsapi_npdu_number_list nsapi_list[11];
+} ratdm_sndcp_sequence_cnf_struct;
+
+/*
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 nsapi;
+} ratcm_sndcp_flush_ind_struct;
+*/
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 nsapi;
+ kal_bool set_send_to_0;
+ kal_bool set_recv_to_0;
+} ratdm_sndcp_flush_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 nsapi;
+ kal_bool set_send_to_0;
+ kal_bool set_recv_to_0;
+} ratdm_sndcp_reset_npdu_seq_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 nsapi;
+ ratdm_sndcp_transmit_type_enum type;
+ kal_uint16 seq_no;
+} ratdm_sndcp_transmit_ind_struct;
+
+/*
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 nsapi;
+ kal_uint16 ack_seq_no;
+} ratcm_sndcp_retransmit_ind_struct;
+*/
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 no_of_valid_entries;
+ kal_uint8 nsapi_list[11];
+} ratdm_sndcp_rat_leave_req_struct;
+
+#endif /* RATDM_SNDCP_STRUCT_H */
diff --git a/mcu/protocol/interface/general/ratdm_urlc_struct.h b/mcu/protocol/interface/general/ratdm_urlc_struct.h
new file mode 100644
index 0000000..dc70001
--- /dev/null
+++ b/mcu/protocol/interface/general/ratdm_urlc_struct.h
@@ -0,0 +1,119 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * ratdm_urlc_struct.h
+ *
+ * Project:
+ * --------
+ * MONZA
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log:$
+ *
+ * 08 18 2017 ming.lee
+ * [MOLY00271498] [MT6763][Bianco][N1][EIOT-3G][TW][HQ][3GSM][HSDPA][TC-IOT-HS156] throughput not stable ,MAX 17Mb/s down to 600Kb/s
+ * .
+ *
+ * 11 24 2016 jinpeng.hu
+ * [MOLY00214984] ALPS03021301 [TDD][MD MTBF][Whitney][EE][ASSERT] file:mcu/common/service/kal/common/src/kal_hw_itc.c line:98
+ *
+ * 05 13 2013 johnson.liu
+ * [MOLY00011931] [EE][HW Issue Workaround Verify][MT6589TDV1_Phone][CMCC Case][FT][Nanjing][C1.2][M] ???2?5th_14:28_???3G???2G???????EE??_????_buffer.c
+ * [TDD]Inter-RAT Code Sync with FDD.
+ *
+ * 12 07 2012 andrew.wu
+ * [MOLY00007098] LOCAL_PARA_HDR/PEER_BUF_HDR modification
+ * LOCAL_PARA_HDR/PEER_BUF_HDR modification
+ *
+ * 01 16 2012 carlson.lin
+ * removed!
+ * <saved by Perforce>
+ *
+ * 11 08 2011 weimin.zeng
+ * removed!
+ * merge MSBB.
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ * Add copyright header.
+ ****************************************************************************/
+
+#ifndef _RATDM_URLC_STRUCT_H
+#define _RATDM_URLC_STRUCT_H
+
+#include "kal_public_defs.h"
+
+ typedef enum
+ {
+ DEACTIVATE_ABORT=0,
+ DEACTIVATE_SUCCESS
+ }DEACTIVATE_PSRAB_RESULT;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ DEACTIVATE_PSRAB_RESULT result;
+}ratdm_urlc_deactivate_ps_rab_cnf_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint16 event;
+ kal_uint16 pool_id;
+ void *user_info_ptr;
+} ratdm_urlc_npdu_dl_cb_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 vrb_id;
+} ratdm_urlc_vrb_va_shortage_ntf_struct;
+
+#endif /* _RATDM_URLC_STRUCT_H */
diff --git a/mcu/protocol/interface/general/reasm2rlc_struct.h b/mcu/protocol/interface/general/reasm2rlc_struct.h
new file mode 100644
index 0000000..9bab383
--- /dev/null
+++ b/mcu/protocol/interface/general/reasm2rlc_struct.h
@@ -0,0 +1,87 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/******************************************************************************
+ * Filename:
+ * ---------
+ * reasm2rlc_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *=============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *=============================================================================
+ ******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _REASM2RLC_STRUCT_H
+#define _REASM2RLC_STRUCT_H
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint16 begin_indx;
+ kal_uint16 num_blks_to_free;
+ kal_uint8 is_rnr_active;
+} reasm_rlc_reasm_done_ind_struct;
+#endif
+
+
diff --git a/mcu/protocol/interface/general/rfc2507_lib.h b/mcu/protocol/interface/general/rfc2507_lib.h
new file mode 100644
index 0000000..4a41b91
--- /dev/null
+++ b/mcu/protocol/interface/general/rfc2507_lib.h
@@ -0,0 +1,297 @@
+/******************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*******************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * --------------------------------------------------------
+ * rfc2507_lib.h
+ *
+ * Project:
+ * --------------------------------------------------------
+ * MONZA
+ *
+ * Description:
+ * --------------------------------------------------------
+ * RFC2507 library extern function declaration.
+ *
+ * Author:
+ * --------------------------------------------------------
+ * -------
+ *
+ * --------------------------------------------------------
+ * $Log$
+ *
+ * 12 12 2014 tc.chang
+ * [MOLY00087434] [Universal Bin] Check in.
+ * RFC2507
+ *
+ * 08 03 2011 tc.chang
+ * removed!
+ * .
+ *
+ * 05 25 2011 tc.chang
+ * removed!
+ * .
+ *
+ * 05 23 2011 tc.chang
+ * removed!
+ * .
+ *
+ * 12 14 2010 max.yin
+ * removed!
+ * .
+ *
+ * 10 18 2010 max.yin
+ * removed!
+ * .
+ *
+ * 09 03 2010 max.yin
+ * removed!
+ * .
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ ******************************************************************************/
+
+#ifndef _RFC2507_LIB_H
+#define _RFC2507_LIB_H
+
+#include "kal_general_types.h"
+#include "kal_public_api.h"
+
+#define RFC2507_ASSERT(x) DEBUG_ASSERT(x)
+
+typedef kal_uint32 RFC2507_TIME_OF_DAY;
+typedef kal_uint32 RFC2507_TIME_DIFFERENCE;
+
+/*
+ * Macro for definitions for RFC2507 PID references.
+ *
+ * The number of RFC2507 PIDs.
+ */
+#define RFC2507_NO_OF_PIDS 5
+
+#define IP_V4_HEADER_LEN 20
+#define IP_V6_HEADER_LEN 40
+
+#define RFC2507_DEBUG_FULL_HEADER_LEN 40
+#define RFC2507_DEBUG_HEADER_LEN 10
+#define RFC2507_COMPRESSED_MAX_HEADER_LEN 40
+
+#define RFC2507_PACKET_FLOW_TCP_MASK 0X01
+#define RFC2507_PACKET_FLOW_NONTCP_MASK 0X02
+
+#define RFC2507_SKIPPED_CID_NUMBER 0xFF
+
+#define CID_COUNT(_CID_LIST_) (_CID_LIST_.uCount)
+
+typedef void (*rfc2507_reg_callback_func_ptr)(kal_uint32, kal_uint8 *);
+
+typedef enum
+{
+ RFC2507_DECOMPRESS_SUCCESS,
+ RFC2507_DECOMPRESS_SUCCESS_MORE_TO_GO,
+ RFC2507_DECOMPRESS_SUCCESS_RCV_CONTEXT_STATE,
+ RFC2507_DECOMPRESS_FAIL_FREED,
+ RFC2507_DECOMPRESS_FAIL_STORED,
+ RFC2507_DECOMPRESS_FAIL_FREED_SEND_CONTEXT_STATE,
+ RFC2507_DECOMPRESS_FAIL_STORED_SEND_CONTEXT_STATE
+} RFC2507_DECOMPRESS_RESULT_ENUM;
+
+typedef enum
+{
+ RFC2507_FULL_HEADER,
+ RFC2507_COMPRESSED_TCP,
+ RFC2507_COMPRESS_TCP_NO_DELTA,
+ RFC2507_COMPRESS_NON_TCP,
+ RFC2507_CONTEXT_STATE
+} RFC2507_PACKET_TYPE_ENUM;
+
+typedef struct _RFC2507_COMMON_CID
+{
+ struct _RFC2507_COMMON_CID *pPrev;
+ struct _RFC2507_COMMON_CID *pNext;
+} RFC2507_COMMON_CID;
+
+typedef struct _RFC2507_CID_LIST
+{
+ kal_uint32 uCount;
+ struct _RFC2507_COMMON_CID *pFirst;
+ struct _RFC2507_COMMON_CID *pLast;
+} RFC2507_CID_LIST;
+
+typedef struct
+{
+ kal_uint16 Rfc2507MaxPeriod; /*
+ * Largest number of
+ * COMPRESSED_NON_TCP
+ * packets that may be
+ * sent without sending
+ * a FULL_HEADER packet
+ */
+ kal_uint8 Rfc2507MaxTime; /*
+ * COMRESSED_NON_TCP
+ * packets may not be
+ * sent more than this
+ * number of seconds
+ * after sending a
+ * FULL_HEADER packet
+ */
+ kal_uint16 Rfc2507MaxHeader; /*
+ * The largest header
+ * size (in bytes) that
+ * may be compressed
+ */
+ kal_uint8 Rfc2507MaxTcpSpace; /*
+ * The maximum TCP CID
+ * value
+ */
+ kal_uint16 Rfc2507MaxNonTcpSpace; /*
+ * The maximum non-TCP
+ * CID value
+ */
+ kal_bool Rfc2507ExpectReordering; /*
+ * Whether the algorithm
+ * shall re-order PDCP
+ * SDUs, or not
+ */
+
+ /* New: Register callback function to free memory of stored compressed packets */
+ kal_uint32 u4DecompSrcId;
+ rfc2507_reg_callback_func_ptr pfDeallocDecompSrc;
+} RFC2507_ENTITY_PARAMS;
+
+/*
+ * RFC2507 information structure.
+ */
+typedef struct
+{
+ RFC2507_TIME_OF_DAY BootingTime;
+
+ RFC2507_ENTITY_PARAMS Params; /*
+ * The RFC2507 parameters received
+ * when the PDCP entity was created
+ * or reconfigured
+ */
+ kal_uint8 FirstPid; /*
+ * The first protocol identifier
+ * used with RFC2507 - this value
+ * identifies FULL_HEADER packets
+ * and other packet type PIDs are
+ * offsets from this value
+ */
+ RFC2507_CID_LIST TcpCompressorInfo; /*
+ * List of compressor TCP CIDs
+ */
+ RFC2507_CID_LIST TcpDecompressorInfo; /*
+ * List of decompressor TCP CIDs
+ */
+ RFC2507_CID_LIST NonTcpCompressorInfo; /*
+ * List of compressor non-TCP CIDs
+ */
+ RFC2507_CID_LIST NonTcpDecompressorInfo; /*
+ * List of decompressor non-TCP CIDs
+ */
+ void *pSubHdrChain;
+ kal_uint8 *pDecompressedHeader;
+} RFC2507_ENTITY_INFO;
+
+typedef struct
+{
+ kal_uint8* pSrc;
+ kal_uint8* pDst;
+ kal_uint16 SrcLen;
+ kal_uint16 DstLen;
+ kal_uint16 CompressedLength;
+ kal_uint8 DesiredCompressType;
+ kal_uint16 CidNumber; // Output: CidNumber for this PDU
+ kal_bool TcpPDU; // Output: KAL_FALSE for NonTCP, KAL_TRUE for Tcp
+ kal_uint8 CompressedHdr[RFC2507_COMPRESSED_MAX_HEADER_LEN];
+} RFC2507_COMPRESS_INPUT_INFO;
+
+typedef struct
+{
+ kal_uint8* pSrc;
+ kal_uint16 SrcOffset;
+ kal_uint16 SrcLen;
+ kal_uint8 SrcPid;
+ kal_uint8 SrcInfo;
+ kal_uint8* pDst;
+ kal_uint8* pCid;
+ kal_uint16 DstLen;
+ kal_uint16 DecompressedLength;
+ kal_uint8* pNextSrc;
+ kal_uint16 NextSrcOffset;
+ kal_uint16 NextSrcLen;
+ kal_uint8 NextSrcPid;
+ kal_uint8 NextSrcInfo;
+ kal_uint8 L2HdrLength;
+ kal_uint32 NextSrcNonTcpTime;
+} RFC2507_DECOMPRESS_INPUT_INFO;
+
+extern RFC2507_DECOMPRESS_INPUT_INFO Rfc2507DecompInputBuff;
+extern RFC2507_COMPRESS_INPUT_INFO Rfc2507CompInputBuff;
+
+extern RFC2507_ENTITY_INFO *rfc2507_create(void);
+extern kal_bool rfc2507_config(RFC2507_ENTITY_INFO *pEntity, RFC2507_ENTITY_PARAMS* pRfc2507Params, kal_uint8 ucFirstPid);
+extern kal_uint8 rfc2507_compress(RFC2507_ENTITY_INFO *pEntity, RFC2507_COMPRESS_INPUT_INFO* pInput);
+extern kal_uint8 rfc2507_decompress(RFC2507_ENTITY_INFO *pEntity, RFC2507_DECOMPRESS_INPUT_INFO *pInput);
+extern kal_uint8 rfc2507_get_first_pid(RFC2507_ENTITY_INFO *pEntity);
+extern void rfc2507_reset(RFC2507_ENTITY_INFO *pEntity);
+extern void rfc2507_release(RFC2507_ENTITY_INFO *pEntity);
+extern void rfc2507_set_full_header_status(RFC2507_ENTITY_INFO *pEntity, kal_bool bTcp, kal_uint8 CidNumber, kal_bool bSendFullHeader);
+#endif /* _RFC2507_LIB_H */
diff --git a/mcu/protocol/interface/general/rfc2507_lib_common.h b/mcu/protocol/interface/general/rfc2507_lib_common.h
new file mode 100644
index 0000000..7ccddc1
--- /dev/null
+++ b/mcu/protocol/interface/general/rfc2507_lib_common.h
@@ -0,0 +1,769 @@
+/******************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*******************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * --------------------------------------------------------
+ * rfc2507_lib_comon.h
+ *
+ * Project:
+ * --------------------------------------------------------
+ * MONZA
+ *
+ * Description:
+ * --------------------------------------------------------
+ * RFC2507 library common enums, macros and function declarations
+ *
+ * Author:
+ * --------------------------------------------------------
+ * -------
+ *
+ * --------------------------------------------------------
+ * $Log$
+ *
+ * 12 12 2014 tc.chang
+ * [MOLY00087434] [Universal Bin] Check in.
+ * RFC2507
+ *
+ * 07 25 2012 andrew.wu
+ * [MOLY00001136] [RFC2507]Change KAL API usage
+ * change kal_get_time() to kal_get_systicks()
+ *
+ * 03 15 2012 andrew.wu
+ * removed!
+ * Modification for GCC migration
+ *
+ * 08 08 2011 tc.chang
+ * removed!
+ * .
+ *
+ * 08 07 2011 tc.chang
+ * removed!
+ * .
+ *
+ * 08 07 2011 tc.chang
+ * removed!
+ * .
+ *
+ * 08 03 2011 tc.chang
+ * removed!
+ * .
+ *
+ * 08 03 2011 tc.chang
+ * removed!
+ * .
+ *
+ * 07 26 2011 tc.chang
+ * removed!
+ * .
+ *
+ * 06 12 2011 tc.chang
+ * removed!
+ * .
+ *
+ * 06 03 2011 tc.chang
+ * removed!
+ * Send FULL_HEADER if the length of compressed header is larger than the length of the original header.
+ * .
+ *
+ * 05 25 2011 tc.chang
+ * removed!
+ * .
+ *
+ * 12 14 2010 max.yin
+ * removed!
+ * .
+ *
+ * 10 18 2010 max.yin
+ * removed!
+ * .
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ ******************************************************************************/
+
+#ifndef _RFC2507_LIB_COMMON_H
+#define _RFC2507_LIB_COMMON_H
+
+#include "kal_public_api.h"
+#include "kal_public_defs.h"
+#include "kal_general_types.h"
+#include "rfc2507_lib.h"
+
+/* Macro */
+#if !defined(__MTK_TARGET__) && defined(__RFC2507_CHECK_MEM_LEAK__)
+
+/* For MoDOS UT environment. */
+#define rfc2507_alloc_sys_mem(size) rfc2507_get_ctrl_buffer(size, __FILE__, __LINE__)
+#define rfc2507_dealloc_sys_mem(ptr) rfc2507_free_ctrl_buffer(ptr, __FILE__, __LINE__)
+extern void* rfc2507_get_ctrl_buffer(kal_uint16 size, kal_char * file_name, kal_uint32 line);
+extern void rfc2507_free_ctrl_buffer(void* buf, kal_char * file_name, kal_uint32 line);
+#else /* __RFC2507_CHECK_MEM_LEAK__ */
+
+/* Target load */
+#define rfc2507_alloc_sys_mem(size) get_ctrl_buffer(size)
+#define rfc2507_dealloc_sys_mem(ptr) free_ctrl_buffer(ptr)
+#endif /* __RFC2507_CHECK_MEM_LEAK__ */
+
+#define BITS_PER_BYTE 8
+
+/*
+ * Macros for determining RFC2507 PID values from a supplied base
+ * (RFC2507_PARAMETERS FirstPid).
+ */
+#define RFC2507_FULL_HEADER_PID(x) (x + 0)
+#define RFC2507_COMPRESSED_TCP_PID(x) (x + 1)
+#define RFC2507_COMPRESSED_TCP_NODELTA_PID(x) (x + 2)
+#define RFC2507_COMPRESSED_NON_TCP_PID(x) (x + 3)
+#define RFC2507_CONTEXT_STATE_PID(x) (x + 4)
+#define RFC2507_REGULAR_HEADER_PID (0xFE)
+
+/* MUST skip 0 for TCP packet SN when compressing TCP header.
+ * Also used for differentiation in Rfc2507ProcessStoredPacket().
+ */
+#define INVALID_TCP_PSN 0
+
+/*
+ * A constant defining the maximum number of IP sub-header length fields that
+ * may be used for a FULL_HEADER packet
+ */
+#define FULL_HEADER_MAX_LENGTH_FIELDS 2
+
+/*
+ * 2009.4.14 Robert add
+ * Max. subheader number in SUB_HEADER_CHAIN_LIST.
+ */
+#define RFC2507_MAX_SUB_HEADER_CHAIN_NUM 10
+
+/*
+ * Definitions of special values for TLV-encoding options
+ */
+#define TLV_OPTION_TYPE_PAD1 0
+#define TLV_OPTION_TYPE_PADN 1
+
+/*
+ * Contants for determining the type of an IP packet
+ */
+#define IP_VERSION_NUMBER_MASK 0xF0
+#define IP_V4_VERSION_NUMBER 0x40
+#define IP_V6_VERSION_NUMBER 0x60
+
+/*
+ * Constants and macro for determining the length of IP_V4_SUB_HEADER
+ */
+#define IP_V4_IHL_MASK 0x0F
+#define IP_V4_MINIMUM_IHL 5
+#define IP_V4_LEN_OFFSET 0
+#define BYTES_PER_IP_V4_LEN(x) (((x) & IP_V4_IHL_MASK) * 4)
+#define IP_V4_HAS_OPTIONS(x) (((x) & IP_V4_IHL_MASK) != IP_V4_MINIMUM_IHL)
+
+/*
+ * Constants and macros for determining that the IPv4 packet is a fragment
+ */
+#define IP_V4_FLAGS_OFFSET 6
+#define IP_V4_FLAGS_MASK 0xE0
+#define IP_V4_FLAGS_SHIFT 5
+#define IP_V4_FLAGS(x) (((x) & IP_V4_FLAGS_MASK) >> IP_V4_FLAGS_SHIFT)
+#define IP_V4_MF_FLAG 0x01
+#define IP_V4_MF_FLAG_IS_SET(x) (0 != (IP_V4_FLAGS(x) & IP_V4_MF_FLAG))
+#define IP_V4_FRAGMENT_FIELD 6
+#define IP_V4_FRAGMENT_MASK 0x1FFF
+
+/*
+ * Macro for determining the position of the IP_V4_TYPE_OF_SERVICE field in a
+ * IP_V4_SUB_HEADER
+ */
+#define IP_V4_TYPE_OF_SERVICE_OFFSET 1
+#define IP_V4_TYPE_OF_SERVICE_DEF_MASK 0xFC
+
+/*
+ * Macro for determining positions of IPv4 fields
+ */
+#define IP_V4_TOTAL_LENGTH_OFFSET 2
+#define IP_V4_IDENTIFICATION_OFFSET 4
+#define IP_V4_IDENTIFICATION_LENGTH 2
+#define IP_V4_PROTOCOL_OFFSET 9
+#define IP_V4_CHECKSUM_OFFSET 10
+
+#define IP_V4_SUB_HEADER_LEN 20
+#define IP_V6_SUB_HEADER_LEN 40
+
+#define IP_V6_PAYLOAD_LENGTH_OFFSET 4
+#define IP_V6_PROTOCOL_OFFSET 6
+#define IP_V6_ADDRESS_LENGTH 16
+
+/*
+ * Constant and macro to determine the length of HOP_BY_HOP_OPTIONS_SUB_HEADER,
+ * DESTINATION_OPTIONS_SUB_HEADER and ROUTING_SUB_HEADER
+ */
+#define HDR_EXT_LEN_OFFSET 1
+#define BYTES_PER_HDR_EXT_LEN(x) (((x) + 1) * 8)
+
+#define TLV_OPTION_DATA_OFFSET 2
+
+/*
+ * Constant for determining the type of the sub-header after
+ * HOP_BY_HOP_OPTIONS_SUB_HEADER, DESTINATION_OPTIONS_SUB_HEADER,
+ * ROUTING_SUB_HEADER, FRAGMENT_SUB_HEADER and AUTHENTICATION_SUB_HEADER
+ */
+#define NEXT_HEADER_PROTOCOL_OFFSET 0
+
+/*
+ * Constants defining the positions of the "type" and "segments left" fields of
+ * the ROUTING_SUB_HEADER
+ */
+#define ROUTING_TYPE_OFFSET 2
+#define ROUTING_SEGMENTS_LEFT_OFFSET 3
+
+#define FRAGMENT_SUB_HEADER_LEN 8
+
+/*
+ * Macros to determine the length of AUTHENTICATION_SUB_HEADER
+ */
+#define AUTHENTICATION_LEN_OFFSET 1
+#define BYTES_PER_AUTHENTICATION_LEN(x) (((x) + 2) * 4)
+#define AUTHENTICATION_DATA_OFFSET 8
+
+/*
+ * Macros to determine the length of MINIMAL_ENCAPSULATION_SUB_HEADER
+ */
+#define MINIMAL_ENCAPSULATION_LEN_OFFSET 1
+#define BYTES_PER_MINIMAL_ENCAPSULATION_LEN(x) (((x) & 0x80) ? 12 : 8)
+#define MINIMAL_ENCAPSULATION_CHECKSUM_OFFSET 2
+
+#define ESP_SUB_HEADER_LEN 4
+
+#define TCP_LEN_OFFSET 12
+#define BYTES_PER_TCP_LEN(x) (((x) >> 4) * 4)
+#define MIN_TCP_SUB_HEADER_LEN 20
+
+#define UDP_LENGTH_OFFSET 4
+#define UDP_CHECKSUM_OFFSET 6
+#define UDP_CHECKSUM_LENGTH 2
+#define UDP_SUB_HEADER_LEN 8
+
+#define PROTOCOL_NUMBER_TCP 6
+
+/*
+ * 2009.4.14 Robert add
+ * Subheader chain operation macro.
+ */
+#define GET_SUB_HDR_ITEM(_pList_, _Index_) \
+ ( &((_pList_)->HdrItem[_Index_]) )
+
+#define GET_FIRST_HDR(_pList_) Rfc2507_GetFirstSubHdrItem((SUB_HEADER_CHAIN_LIST *)_pList_)
+#define GET_LAST_HDR(_pList_) Rfc2507_GetLastSubHdrItem((SUB_HEADER_CHAIN_LIST *)_pList_)
+#define GET_NEXT_HDR(_pList_) Rfc2507_GetNextSubHdrItem((SUB_HEADER_CHAIN_LIST *)_pList_)
+#define GET_PREV_HDR(_pList_) Rfc2507_GetPrevSubHdrItem((SUB_HEADER_CHAIN_LIST *)_pList_)
+
+/* Remember to modify the mapping table */
+typedef enum
+{
+ RFC2507_INT_DECOMPRESS_SUCCESS,
+ RFC2507_INT_DECOMPRESS_SUCCESS_MORE_TO_GO,
+ RFC2507_TCP_DECOMPRESS_SUCCESS_RCV_CONTEXT_STATE,
+ RFC2507_TCP_DECOMPRESS_FAIL_CANNOT_CREATE_CID,
+ RFC2507_TCP_DECOMPRESS_FAIL_NO_PACKET_IN_WINDOW,
+ RFC2507_TCP_DECOMPRESS_FAIL_CID_NO_EXIST,
+ RFC2507_TCP_DECOMPRESS_FAIL_CAN_BE_FREED_SEND_CONTEXT_STATE,
+ RFC2507_TCP_DECOMPRESS_FAIL_CAN_BE_FREED,
+ RFC2507_NON_TCP_DECOMPRESS_FAIL_CAN_BE_FREED,
+ RFC2507_NON_TCP_DECOMPRESS_FAIL_STORED,
+ RFC2507_DECOMPRESS_UNKNOWN_PID_TYPE,
+ NO_OF_RFC2507_INTERNAL_DECOMPRESS_RESULT,
+ INVALID_RFC2507_INTERNAL_DECOMPRESS_RESULT
+} RFC2507_INTERNAL_DECOMPRESS_RESULT_ENUM;
+
+/*
+ * SUB_HEADER_TYPE: Enumeration listing the types of sub-header supported
+ * and the number of sub-headers supported.
+ */
+typedef enum
+{
+ IP_V4_SUB_HEADER,
+ IP_V6_SUB_HEADER,
+ HOP_BY_HOP_OPTIONS_SUB_HEADER,
+ DESTINATION_OPTIONS_SUB_HEADER,
+ ROUTING_SUB_HEADER,
+ FRAGMENT_SUB_HEADER,
+ AUTHENTICATION_SUB_HEADER,
+ ESP_SUB_HEADER, /* Encapsulating Security Payload */
+ MINIMAL_ENCAPSULATION_SUB_HEADER,
+ TCP_SUB_HEADER,
+ UDP_SUB_HEADER,
+ NO_NEXT_SUB_HEADER,
+ NO_SUB_HEADERS
+} SUB_HEADER_TYPE;
+
+/*
+ * SUB_HEADER_LIST: Structure used for lists of sub-headers in CID information
+ */
+typedef struct
+{
+ kal_uint16 Offset; /*
+ * Offset of the start of the sub-header
+ * from the start of the SDU (in bytes)
+ */
+ SUB_HEADER_TYPE Type; /*
+ * The type of the sub-header at this offset
+ */
+} SUB_HEADER_LIST;
+
+/*
+ * FIELD_COMPRESSION_TYPE: Enumeration listing the field types for compression
+ * and decompression of sub-headers
+ */
+typedef enum
+{
+ NOCHANGE_FIELD,
+ DELTA_FIELD,
+ RANDOM_FIELD,
+ INFERRED_FIELD
+} FIELD_COMPRESSION_TYPE;
+
+/*
+ * FIELD_DEFINING_TYPE: Enumeration listing the field types for defining packet
+ * streams for compression of sub-headers
+ */
+typedef enum
+{
+ NOT_DEF_FIELD,
+ DEF_FIELD,
+ ROUTING_TYPE_0_DEF_FIELD
+} FIELD_DEFINING_TYPE;
+
+/*
+ * FIELD_INFO: Structure to hold information on the fields in a sub-header
+ */
+typedef struct
+{
+ kal_uint16 Start; /*
+ * The position of the start of the
+ * field in terms of bits from the
+ * start of the sub-header
+ */
+ kal_uint8 Length; /*
+ * The length of the field in bits
+ */
+ FIELD_COMPRESSION_TYPE Type; /*
+ * The type of the field for
+ * compression purposes
+ */
+ FIELD_DEFINING_TYPE Defining; /*
+ * Indicates how this field is used in
+ * defining the packet stream (CID)
+ */
+} FIELD_INFO;
+
+/*
+ * SUB_HEADER_INFO: Structure to hold information on the sub-headers
+ */
+typedef struct
+{
+ SUB_HEADER_TYPE Type; /*
+ * A unique identifier indicating the
+ * type of the sub-header
+ */
+ kal_uint8 Protocol; /*
+ * The value of the field in the
+ * previous sub-header that identifies
+ * this type sub-header follows. Not
+ * necessarily unique.
+ */
+ kal_uint8 NoFields; /*
+ * The number of fields in the
+ * sub-header, indicating the number
+ * of elements in the FieldInfo array
+ * that follows
+ */
+ const FIELD_INFO *FieldInfo; /*
+ * An array of structures, with each
+ * element in the array describing a
+ * field within the sub-header
+ */
+} SUB_HEADER_INFO;
+
+
+/*
+ * IP_V4_FIELDS: Enumeration listing the fields in an IPv4 sub-header, acting as
+ * an index to the Rfc2507SubHeaderInfo[IP_V4_SUB_HEADER].FieldInfo array of FIELD_INFO, with the last item in
+ * this enumeration defining the number of elements in that array
+ */
+typedef enum
+{
+ IP_V4_VERSION,
+ IP_V4_IHL,
+ IP_V4_TYPE_OF_SERVICE,
+ IP_V4_TOTAL_LENGTH,
+ IP_V4_IDENTIFICATION,
+ IP_V4_FLAG,
+ IP_V4_FRAGMENT_OFFSET,
+ IP_V4_TIME_TO_LIVE,
+ IP_V4_PROTOCOL,
+ IP_V4_HEADER_CHECKSUM,
+ IP_V4_SOURCE_ADDRESS,
+ IP_V4_DESTINATION_ADDRESS,
+ NO_IP_V4_FIELDS
+} IP_V4_FIELDS;
+
+/*
+ * IP_V6_FIELDS: Enumeration listing the fields in an IPv6 sub-header, acting as
+ * an index to the Rfc2507SubHeaderInfo[IP_V6_SUB_HEADER].FieldInfo array of FIELD_INFO, with the last item in
+ * this enumeration defining the number of elements in that array
+ */
+typedef enum
+{
+ IP_V6_VERSION,
+ IP_V6_TRAFFIC_CLASS,
+ IP_V6_FLOW_LABEL,
+ IP_V6_PAYLOAD_LENGTH,
+ IP_V6_NEXT_HEADER,
+ IP_V6_HOP_LIMIT,
+ IP_V6_SOURCE_ADDRESS,
+ IP_V6_DESTINATION_ADDRESS,
+ NO_IP_V6_FIELDS
+} IP_V6_FIELDS;
+
+/*
+ * HOP_BY_HOP_OPTIONS_FIELDS: Enumeration listing the fields in a hop-by-hop
+ * options sub-header, acting as an index to the Rfc2507SubHeaderInfo[HOP_BY_HOP_OPTIONS_SUB_HEADER].FieldInfo
+ * array of FIELD_INFO, with the last item in this enumeration defining the
+ * number of elements in that array
+ */
+typedef enum
+{
+ HOP_BY_HOP_OPTIONS_NEXT_HEADER,
+ HOP_BY_HOP_OPTIONS_HDR_EXT_LEN,
+ HOP_BY_HOP_OPTIONS_OPTION_TYPE,
+ HOP_BY_HOP_OPTIONS_OPTION_LENGTH,
+ HOP_BY_HOP_OPTIONS_OPTION_DATA,
+ NO_HOP_BY_HOP_OPTIONS_FIELDS
+} HOP_BY_HOP_OPTIONS_FIELDS;
+
+/*
+ * DESTINATION_OPTIONS_FIELDS: Enumeration listing the fields in a hop-by-hop
+ * options sub-header, acting as an index to the Rfc2507SubHeaderInfo[HOP_BY_HOP_OPTIONS_SUB_HEADER].FieldInfo
+ * array of FIELD_INFO, with the last item in this enumeration defining the
+ * number of elements in that array
+ */
+typedef enum
+{
+ DESTINATION_OPTIONS_NEXT_HEADER,
+ DESTINATION_OPTIONS_HDR_EXT_LEN,
+ DESTINATION_OPTIONS_OPTION_TYPE,
+ DESTINATION_OPTIONS_OPTION_LENGTH,
+ DESTINATION_OPTIONS_OPTION_DATA,
+ NO_DESTINATION_OPTIONS_FIELDS
+} DESTINATION_OPTIONS_FIELDS;
+
+/*
+ * ROUTING_FIELDS: Enumeration listing the fields in a routing sub-header,
+ * acting as an index to the Rfc2507SubHeaderInfo[ROUTING_SUB_HEADER].FieldInfo array of FIELD_INFO, with the
+ * last item in this enumeration defining the number of elements in that array
+ */
+typedef enum
+{
+ ROUTING_NEXT_HEADER,
+ ROUTING_HDR_EXT_LEN,
+ ROUTING_ROUTING_TYPE,
+ ROUTING_SEGMENTS_LEFT,
+ ROUTING_TYPE_SPECIFIC_DATA,
+ NO_ROUTING_FIELDS
+} ROUTING_FIELDS;
+
+/*
+ * FRAGMENT_FIELDS: Enumeration listing the fields in a fragment sub-header,
+ * acting as an index to the Rfc2507SubHeaderInfo[FRAGMENT_SUB_HEADER].FieldInfo array of FIELD_INFO, with the
+ * last item in this enumeration defining the number of elements in that array
+ */
+typedef enum
+{
+ FRAGMENT_NEXT_HEADER,
+ FRAGMENT_RESERVED,
+ FRAGMENT_OFFSET,
+ FRAGMENT_RES,
+ FRAGMENT_M,
+ FRAGMENT_IDENTIFICATION,
+ NO_FRAGMENT_FIELDS
+} FRAGMENT_FIELDS;
+
+/*
+ * AUTHENTICATION_FIELDS: Enumeration listing the fields in a authentification
+ * sub-header, acting as an index to the Rfc2507SubHeaderInfo[AUTHENTICATION_SUB_HEADER].FieldInfo array of
+ * FIELD_INFO, with the last item in this enumeration defining the number of
+ * elements in that array
+ */
+typedef enum
+{
+ AUTHENTICATION_NEXT_HEADER,
+ AUTHENTICATION_LENGTH,
+ AUTHENTICATION_RESERVED,
+ AUTHENTICATION_SPI,
+ AUTHENTICATION_DATA,
+ NO_AUTHENTICATION_FIELDS
+} AUTHENTICATION_FIELDS;
+
+/*
+ * ESP_FIELDS: Enumeration listing the fields in a ESP sub-header, acting as an
+ * index to the EspSubHeaderField array of FIELD_INFO, with the last item in
+ * this enumeration defining the number of elements in that array
+ */
+typedef enum
+{
+ ESP_SPI,
+ ESP_DATA,
+ NO_ESP_FIELDS
+} ESP_FIELDS;
+
+/*
+ * MINIMAL_ENCAPSULATION_FIELDS: Enumeration listing the fields in a minimal
+ * encapsulation sub-header, acting as an index to the
+ * Rfc2507SubHeaderInfo[MINIMAL_ENCAPSULATION_SUB_HEADER].FieldInfo array of FIELD_INFO, with the last item in
+ * this enumeration defining the number of elements in that array
+ */
+typedef enum
+{
+ MINIMAL_ENCAPSULATION_PROTOCOL,
+ MINIMAL_ENCAPSULATION_S_BIT,
+ MINIMAL_ENCAPSULATION_RESERVED,
+ MINIMAL_ENCAPSULATION_HEADER_CHECKSUM,
+ MINIMAL_ENCAPSULATION_ORIG_DEST_ADDR,
+ MINIMAL_ENCAPSULATION_ORIG_SRC_ADDR,
+ NO_MINIMAL_ENCAPSULATION_FIELDS
+} MINIMAL_ENCAPSULATION_FIELDS;
+
+/*
+ * TCP_FIELDS: Enumeration listing the fields in a TCP sub-header, acting as an
+ * index to the Rfc2507SubHeaderInfo[TCP_SUB_HEADER].FieldInfo array of FIELD_INFO, with the last item in
+ * this enumeration defining the number of elements in that array
+ */
+typedef enum
+{
+ TCP_SOURCE_PORT,
+ TCP_DESTINATION_PORT,
+ TCP_SEQUENCE_NUMBER,
+ TCP_ACKNOWLEDGEMENT_NUMBER,
+ TCP_DATA_OFFSET,
+ TCP_RESERVED,
+ TCP_FLAGS,
+ TCP_WINDOW,
+ TCP_CHECKSUM,
+ TCP_URGENT_POINTER,
+ TCP_OPTIONS,
+ NO_TCP_FIELDS
+} TCP_FIELDS;
+
+/*
+ * UDP_FIELDS: Enumeration listing the fields in a UDP sub-header, acting as an
+ * index to the Rfc2507SubHeaderInfo[UDP_SUB_HEADER].FieldInfo array of FIELD_INFO, with the last item in
+ * this enumeration defining the number of elements in that array
+ */
+typedef enum
+{
+ UDP_SOURCE_PORT,
+ UDP_DESTINATION_PORT,
+ UDP_LENGTH,
+ UDP_CHECKSUM,
+ NO_UDP_FIELDS
+} UDP_FIELDS;
+
+/*
+ * SUB_HEADER_CHAIN_INFO: structure for items in a linked list describing the
+ * sub-headers in an IP packet
+ */
+typedef struct
+{
+ SUB_HEADER_TYPE Type; /*
+ * The type of the sub-header. Index to the
+ * Rfc2507SubHeaderInfo array of structures.
+ */
+ kal_uint16 Start; /*
+ * The byte offset of the start of the sub-header
+ * from the start of the IP packet
+ */
+ kal_uint16 Length; /*
+ * The length in bytes of the sub-header
+ */
+} SUB_HEADER_CHAIN_INFO;
+
+/*
+ * 2009.4.14 Robert add
+ * Use array to replace Dlist queue
+ */
+typedef struct
+{
+ kal_uint8 HdrItemCount; /* Count of the sub-header. */
+ kal_uint8 HdrItemCurrIdx; /* index of Current item. */
+
+ SUB_HEADER_CHAIN_INFO HdrItem[RFC2507_MAX_SUB_HEADER_CHAIN_NUM];
+ /*
+ * The byte offset of the start of the sub-header
+ * from the start of the IP packet
+ */
+} SUB_HEADER_CHAIN_LIST;
+
+typedef struct _WindowHeader
+{
+ struct _WindowHeader *pNext;
+ struct _WindowHeader *pPrev;
+ kal_uint8 *pPacket;
+ kal_uint16 PacketLen;
+ kal_uint16 PacketOffset;
+ kal_uint8 Pid;
+ kal_uint8 PacketInfo;
+ kal_uint8 L2HdrLength;
+ union
+ {
+ RFC2507_TIME_OF_DAY PacketTime;
+ kal_uint32 uwSequenceNo;
+ } uni;
+} WindowHeader;
+
+typedef struct
+{
+ kal_uint8 uCount;
+ WindowHeader *pHead;
+ WindowHeader *pTail;
+} WindowList;
+
+/*********** FUNCTION DECLARATION ****************************************************/
+
+INLINE_MODIFIER INLINE void Rfc2507_OS_CurrentTime(RFC2507_TIME_OF_DAY *currentTimeInTicks)
+{
+ *currentTimeInTicks = kal_get_systicks();
+}
+
+extern void Rfc2507_CidInfoInsertAtStart(RFC2507_CID_LIST *pCidInfoList,RFC2507_COMMON_CID *pNewCidInfo);
+extern void Rfc2507_CidInfoInsertAtEnd(RFC2507_CID_LIST *pCidInfoList,RFC2507_COMMON_CID *pNewCidInfo);
+extern void Rfc2507_CidInfoInsertAtBefore(RFC2507_CID_LIST *pCidInfoList, RFC2507_COMMON_CID *pCurrCidInfo,
+ RFC2507_COMMON_CID *pNewCidInfo);
+extern void Rfc2507_CidInfoDeleteFromList(RFC2507_CID_LIST *pCidInfoList, RFC2507_COMMON_CID *pCidInfo);
+extern SUB_HEADER_CHAIN_INFO* Rfc2507_GetFirstSubHdrItem(SUB_HEADER_CHAIN_LIST *pSubHdrList );
+extern SUB_HEADER_CHAIN_INFO* Rfc2507_GetLastSubHdrItem(SUB_HEADER_CHAIN_LIST *pSubHdrList );
+extern SUB_HEADER_CHAIN_INFO* Rfc2507_GetNextSubHdrItem(SUB_HEADER_CHAIN_LIST *pSubHdrList );
+extern SUB_HEADER_CHAIN_INFO* Rfc2507_GetPrevSubHdrItem(SUB_HEADER_CHAIN_LIST *pSubHdrList );
+extern void Rfc2507_GetSubHeaderChainInfo(RFC2507_ENTITY_INFO *pEntity, kal_uint8* pPacket,
+ SUB_HEADER_CHAIN_LIST *pSubHdrList );
+extern kal_bool Rfc2507_IPv4IsFragment(kal_uint8 *SubHeader);
+extern kal_bool Rfc2507_IPv4IsRandom(kal_uint8 *SubHeader);
+extern kal_uint16 Rfc2507CalculateIpChecksum(kal_uint8 *pData, kal_uint32 length);
+extern kal_bool Rfc2507_CompareSubHeaderChains(kal_uint8 *Chain1, SUB_HEADER_CHAIN_LIST *pSubHdrList1,
+ kal_uint8 *Chain2, SUB_HEADER_CHAIN_LIST *pSubHdrList2);
+extern kal_uint16 Rfc2507_CompressOptions(kal_uint8 *dest, kal_uint32 compHdrOffset, const kal_uint8 *src, const kal_uint8 *saved, kal_uint16 size);
+extern kal_uint16 Rfc2507_DecompressOptions(kal_uint8 *saved, const kal_uint8 *src, kal_uint16 size);
+extern kal_bool Rfc2507ContextHasChanged(kal_uint8 *pInputSrc,
+ kal_uint8 *pSavedHeader,
+ SUB_HEADER_CHAIN_LIST *pSavedSubHdrList,
+ SUB_HEADER_CHAIN_LIST *pGivenSubHdrList,
+ kal_bool isTcpContext);
+extern kal_uint16 Rfc2507CalculateChecksum(kal_uint8 *pData,
+ kal_uint16 dataLength,
+ kal_uint8 *pPseudoHeader,
+ kal_uint16 pseudoHeaderLength);
+extern void Rfc2507InferFields(SUB_HEADER_CHAIN_LIST *pSubHdrList,
+ kal_uint8 *pReconstitutedPacket,
+ kal_uint16 uwPacketLength);
+extern kal_bool Rfc2507InitStoredPacket(RFC2507_DECOMPRESS_INPUT_INFO *pInput, WindowList *pList,
+ kal_uint32 unionValue, WindowHeader **pStoredPacket);
+extern void Rfc2507EmptyWindow(RFC2507_ENTITY_INFO *pEntity, WindowList *pList);
+extern void Rfc2507DeleteStoredPacket(WindowList *pList, WindowHeader *pWindowItem);
+extern kal_uint8 Rfc2507ProcessStoredPacket(RFC2507_DECOMPRESS_INPUT_INFO *pInput,
+ WindowList *pList,
+ kal_uint16 tcpExpectedPacketSn);
+extern kal_uint16 Rfc2507ReconsIpv4SubHeader(kal_uint8 *pSavedHeader,
+ kal_uint8 *pPosReceivedHeader,
+ SUB_HEADER_CHAIN_LIST *pSubHdrList,
+ SUB_HEADER_CHAIN_INFO *pItem,
+ kal_bool isTcpDelta,
+ kal_uint16 *pSavedHeaderLength);
+extern kal_uint16 Rfc2507DecompressRandomField(kal_uint8 *pSavedHeader,
+ kal_uint8 *pPosn,
+ SUB_HEADER_CHAIN_LIST *pSubHdrList,
+ kal_uint16 *pSavedHeaderLength,
+ kal_bool isTcpDelta);
+extern kal_bool Rfc2507CompressRandomField(RFC2507_COMPRESS_INPUT_INFO *pInput,
+ SUB_HEADER_CHAIN_LIST *pSubHdrList,
+ kal_uint8 *pSavedHeader,
+ kal_uint8 *pPosn,
+ kal_uint32 *pCompHdrOffset);
+kal_uint8 Rfc2507_BigEndGet8(kal_uint8 *pbSource);
+kal_uint16 Rfc2507_BigEndGet16(kal_uint8 *abSource);
+kal_uint32 Rfc2507_BigEndGet32(kal_uint8 *abSource);
+void Rfc2507_BigEndSet16(kal_uint16 usSource, kal_uint8 *abDestination);
+void Rfc2507_BigEndSet32(kal_uint32 ulSource, kal_uint8 *abDestination);
+
+/***** GLOBAL ************************************************************************/
+extern const SUB_HEADER_INFO Rfc2507SubHeaderInfo[NO_SUB_HEADERS];
+extern const kal_uint8 aRfc2507DecompressResultMappingTable[NO_OF_RFC2507_INTERNAL_DECOMPRESS_RESULT];
+
+#ifdef __RFC2507_PDCP_UT__
+extern kal_uint8 PDCP_UT_SLIDING_WINDOW_SIZE_g;
+#endif
+
+#endif /* _RFC2507_LIB_COMMON_H */
diff --git a/mcu/protocol/interface/general/rfc2507_lib_test.h b/mcu/protocol/interface/general/rfc2507_lib_test.h
new file mode 100644
index 0000000..499efb1
--- /dev/null
+++ b/mcu/protocol/interface/general/rfc2507_lib_test.h
@@ -0,0 +1,358 @@
+#ifndef __RFC2507_LIB_TEST_H__
+#define __RFC2507_LIB_TEST_H__
+
+#define RFC2507_DBG_MAX_NUMBER_BUFFER_ALLOC 300
+#define MAX_NUM_OF_PACKETS 6
+#define MAX_LEN_OF_PACKET 128
+
+struct rfc2507_ctrl_buff_dbg_struct
+{
+ kal_uint32 address;
+ kal_bool alloc;
+ kal_char *file_name;
+ kal_uint32 line;
+};
+
+struct rfc2507_ctrl_buff_size_info_struct
+{
+ kal_uint32 buff_size;
+ kal_uint32 times;
+};
+
+extern struct rfc2507_ctrl_buff_dbg_struct g_rfc2507_alloc_buff_dbg[];
+extern kal_uint16 g_rfc2507_alloc_buff_dbg_count;
+
+struct rfc2507_dl_queue_struct
+{
+ kal_bool is_used;
+ kal_uint16 bitLength;
+ peer_buff_struct *pFlcBuff;
+};
+
+/* Structure */
+// IPv4 Header
+typedef struct ip_hdr
+{
+ unsigned char ip_header_len:4; // 4-bit header length (in 32-bit words)
+ // normally=5 (Means 20 Bytes may be 24 also)
+ unsigned char ip_version :4; // 4-bit IPv4 version
+ unsigned char ip_tos; // IP type of service
+ unsigned short ip_total_length; // Total length
+ unsigned short ip_id; // Unique identifier
+
+ unsigned char ip_frag_offset :5; // Fragment offset field
+
+ unsigned char ip_more_fragment :1;
+ unsigned char ip_dont_fragment :1;
+ unsigned char ip_reserved_zero :1;
+
+ unsigned char ip_frag_offset1; //fragment offset
+
+ unsigned char ip_ttl; // Time to live
+ unsigned char ip_protocol; // Protocol(TCP,UDP etc)
+ unsigned short ip_checksum; // IP checksum
+ unsigned int ip_srcaddr; // Source address
+ unsigned int ip_destaddr; // Source address
+} IPV4_HDR;
+
+// TCP header
+typedef struct tcp_header
+{
+ unsigned short source_port; // source port
+ unsigned short dest_port; // destination port
+ unsigned int sequence; // sequence number - 32 bits
+ unsigned int acknowledge; // acknowledgement number - 32 bits
+
+ unsigned char reserved_part1:4; //according to rfc
+ unsigned char data_offset:4; /*The number of 32-bit words
+ in the TCP header.
+ This indicates where the data begins.
+ The length of the TCP header
+ is always a multiple
+ of 32 bits.*/
+
+ unsigned char fin :1; //Finish Flag
+ unsigned char syn :1; //Synchronise Flag
+ unsigned char rst :1; //Reset Flag
+ unsigned char psh :1; //Push Flag
+ unsigned char ack :1; //Acknowledgement Flag
+ unsigned char urg :1; //Urgent Flag
+ unsigned char reserved_part2 :2;
+
+ ////////////////////////////////
+
+ unsigned short window; // window
+ unsigned short checksum; // checksum
+ unsigned short urgent_pointer; // urgent pointer
+} TCP_HDR;
+
+/* RFC793 and RFC768: Format of Pseudo Header
+ 0 7 8 15 16 23 24 31
+ +--------+--------+--------+--------+
+ | source address |
+ +--------+--------+--------+--------+
+ | destination address |
+ +--------+--------+--------+--------+
+ | zero | protocol | Length |
+ +--------+--------+--------+--------+
+ */
+typedef struct ipv4_pseudo_header
+{
+ unsigned int src_addr;
+ unsigned int dst_addr;
+ unsigned char zero;
+ unsigned char protocol;
+ unsigned short tcp_len;
+} TCP_IPV4_PSEUDO_HEADER, UDP_IPV4_PSEUDO_HEADER;
+
+// UDP header
+typedef struct udp_header
+{
+ unsigned short source_port; // source port
+ unsigned short dest_port; // destination port
+ unsigned short length; /*
+ Length is the length in octets of this user datagram including this
+ header and the data. (This means the minimum value of the length is
+ eight.)
+ */
+ unsigned short checksum; /*
+ Checksum is the 16-bit one's complement of the one's complement sum of a
+ pseudo header of information from the IP header, the UDP header, and the
+ data, padded with zero octets at the end (if necessary) to make a
+ multiple of two octets.
+ */
+} UDP_HDR;
+
+//IPv6 Header
+typedef struct ipv6_header
+{
+ unsigned char traffic_class_1:4; /* MSB of 8-bit traffic class */
+ unsigned char version:4; /* 4-bit IPv6 version number = 6 */
+ unsigned char flow_label_1:4; /* First 4-bit of of 20-bit flow label */
+ unsigned char traffic_class_2:4; /* LSB of 8-bit traffic class */
+ unsigned short flow_label_2; /* Last 16-bit of of 20-bit flow label */
+ unsigned short payload_legth; /* 16-bit payload length.
+ Length of the IPv6 payload, i.e., the rest of the packet following this IPv6 header, in octets.
+ (Note that any extension headers present are considered part of the payload, i.e., included in the length count.)
+ */
+ unsigned char next_header;/* 8-bit next header
+0: Hop-by-Hop Options header
+43: Routing header
+44: Fragment header
+59: No Next Header
+*/
+ unsigned char hop_limit;/* 8-bit hop limit */
+ unsigned int src_addr_1;
+ unsigned int src_addr_2;
+ unsigned int src_addr_3;
+ unsigned int src_addr_4;
+ unsigned int dst_addr_1;
+ unsigned int dst_addr_2;
+ unsigned int dst_addr_3;
+ unsigned int dst_addr_4;
+} IPV6_HDR;
+
+//Hop-by-Hop Options Header
+typedef struct hop_by_hop_header
+{
+ unsigned char next_header;/* 8-bit next header */
+ unsigned char hdr_ext_len; /* Length of the Hop-by-Hop Options header in 8-octet units,
+ NOT including the first 8 octets.
+ */
+} HOP_BY_HOP_HDR;
+
+//Routing Header
+typedef struct routing_header
+{
+ unsigned char next_header;/* 8-bit next header */
+ unsigned char hdr_ext_len;/* Length of the Routing header in 8-octet units,
+ NOT including the first 8 octets.
+ */
+ unsigned char routing_type;
+ unsigned char segments_left;
+} ROUTING_HDR;
+
+//Fragment Header
+typedef struct fragment_header
+{
+ unsigned char next_header;/* 8-bit next header */
+ unsigned char reserved;/* 8-bit reserved */
+ unsigned char fragment_offset_1;/* First 8-bit of 13-bit fragment offset */
+ unsigned char fragment_offset_2:4;/* Next 4-bit of 13-bit fragment offset */
+ unsigned char fragment_offset_3:1;/* Last 1-bit of 13-bit fragment offset */
+ unsigned char res:2;/* 2-bit Res */
+ unsigned char m_flag:1;/* 1-bit M flag: 1=more fragments;0=last fragment */
+ unsigned int identification;/* 32-bit identification */
+} FRAGMENT_HDR;
+
+//Authentication Header
+typedef struct authentication_header
+{
+ unsigned char next_header;/* 8-bit next header */
+ unsigned char length;/* 8-bit length */
+ unsigned short reserved;/* 16 bit reserved */
+ unsigned int spi; /* 32-bit security parameters index */
+} AUTHENTICATION_HDR;
+
+//Destination Options Header
+typedef struct destination_options_header
+{
+ unsigned char next_header;/* 8-bit next header */
+ unsigned char hdr_ext_len;/* Length of the Destination Options header in 8-octet units,
+ NOT including the first 8 octets.
+ */
+} DESTINATION_OPTIONS_HDR;
+
+//Encapsulating Security Payload Header
+typedef struct esp_header
+{
+ unsigned int spi; /* 32-bit security association identifier (SPI), 32 bits */
+} ESP_HDR;
+
+typedef struct ipv6_pseudo_header
+{
+ unsigned int src_addr1;
+ unsigned int src_addr2;
+ unsigned int src_addr3;
+ unsigned int src_addr4;
+ unsigned int dst_addr1;
+ unsigned int dst_addr2;
+ unsigned int dst_addr3;
+ unsigned int dst_addr4;
+ unsigned int upper_layer_pkt_len;
+ unsigned short zero1;
+ unsigned char zero2;
+ unsigned char next_header;
+} TCP_IPV6_PSEUDO_HEADER, UDP_IPV6_PSEUDO_HEADER;
+
+typedef struct
+{
+ /* IP Part */
+ unsigned char TOS;
+ unsigned short IPId;
+ unsigned char Protocol;
+ unsigned int SrcAddr;
+ unsigned int DstAddr;
+ /* TCP Part */
+ unsigned short SrcPort;
+ unsigned short DstPort;
+ unsigned int Seq;
+ unsigned int Ack;
+ unsigned char Reserved;
+ unsigned short Window;
+ unsigned short UrgentPointer;
+} TCP_IP_CONN_PROFILE;
+
+typedef struct
+{
+ /* IP Part */
+ unsigned char TOS;
+ unsigned short IPId;
+ unsigned char Protocol;
+ unsigned int SrcAddr;
+ unsigned int DstAddr;
+ /* UDP Part */
+ unsigned short SrcPort;
+ unsigned short DstPort;
+} UDP_IP_CONN_PROFILE;
+
+typedef struct
+{
+ /* IPv6 Part */
+ unsigned char TrafficClass;
+ unsigned int FlowLabel;
+ unsigned char NextHeader;
+ unsigned char HopLimit;
+ unsigned int SrcAddr1;
+ unsigned int SrcAddr2;
+ unsigned int SrcAddr3;
+ unsigned int SrcAddr4;
+ unsigned int DstAddr1;
+ unsigned int DstAddr2;
+ unsigned int DstAddr3;
+ unsigned int DstAddr4;
+ /* TCP Part */
+ unsigned short SrcPort;
+ unsigned short DstPort;
+ unsigned int Seq;
+ unsigned int Ack;
+ unsigned char Reserved;
+ unsigned short Window;
+ unsigned short UrgentPointer;
+} TCP_IPv6_CONN_PROFILE;
+
+typedef struct
+{
+ /* IPv6 Part */
+ unsigned char TrafficClass;
+ unsigned int FlowLabel;
+ unsigned char NextHeader;
+ unsigned char HopLimit;
+ unsigned int SrcAddr1;
+ unsigned int SrcAddr2;
+ unsigned int SrcAddr3;
+ unsigned int SrcAddr4;
+ unsigned int DstAddr1;
+ unsigned int DstAddr2;
+ unsigned int DstAddr3;
+ unsigned int DstAddr4;
+ /* UDP Part */
+ unsigned short SrcPort;
+ unsigned short DstPort;
+} UDP_IPv6_CONN_PROFILE;
+
+typedef struct
+{
+ unsigned int length;
+ unsigned char PacketData[MAX_LEN_OF_PACKET];
+} PACKET;
+
+typedef struct
+{
+ unsigned int NoPackets;
+ PACKET *Packets[MAX_NUM_OF_PACKETS];
+} PACKET_STREAM_PATTERN;
+
+typedef enum
+{
+ PACKET_STREAM_PATTERN_BEGIN = 201,
+ PSP_IPV4_TCP = PACKET_STREAM_PATTERN_BEGIN,
+ PSP_IPV4_UDP,
+ PSP_IPV6_TCP,
+ PSP_IPV6_UDP,
+ PSP_SPECIFIC_BEGIN = PSP_IPV6_UDP + 1, // 205
+ PSP_IPV6_ROUTING_TCP = PSP_SPECIFIC_BEGIN, // 205
+ PSP_IPV6_ROUTING_UDP, // 206
+ PSP_IPV6_AUTH_TCP, // 207
+ PSP_IPV6_ESP, // 208
+ PSP_IPV6_FRAGMENT_TCP, // 209, TCP header will not be compressed
+ PSP_IPV4_MINIMAL_ENCAPSULATION_TCP, // 210, Minimal encapsulation header now is for IPv4 only
+ PSP_IPV6_ROUTING_NO_NEXT, // 211
+ PSP_IPV6_HOP_BY_HOP_TCP, // 212
+ PSP_IPV6_DESTINATION_TCP, // 213
+ PSP_DEFINED_LAST = PSP_IPV6_DESTINATION_TCP,
+ PSP_SPECIFIC_END = 254
+} packet_stream_pattern_enum;
+
+extern packet_stream_pattern_enum psp_pattern;
+
+#define NUM_SPECIFIC_PSP (PSP_DEFINED_LAST - PSP_SPECIFIC_BEGIN + 1)
+#define NOW_PSP() (psp_pattern)
+#define SET_PSP(x) \
+ if ((PACKET_STREAM_PATTERN_BEGIN <= x) && (PSP_SPECIFIC_END >= x)) \
+ { \
+ psp_pattern = x; \
+ }
+
+/* External Function */
+extern void InitializePacketGenerator(void);
+extern void rfc2507_dbg_buff_init(void);
+extern void rfc2507_check_mem_leak(void);
+
+extern kal_uint8 rfc2507_check_if_queue_dl_data(kal_uint16 bitLength, peer_buff_struct *pFlcBuff);
+extern peer_buff_struct *rfc2507_retrive_dl_data_from_queue(kal_uint16 *bitLength);
+extern void rfc2507_packet_verify(peer_buff_struct *pData);
+extern kal_bool rfc2507_prepare_test_data_to_ratdm(void** ppData, int* pDataSize, packet_stream_pattern_enum psp);
+extern void rfc2507_dump_packet(char* pData, int pDataSize);
+
+#endif /* __RFC2507_LIB_TEST_H__*/
diff --git a/mcu/protocol/interface/general/rlc2llc_struct.h b/mcu/protocol/interface/general/rlc2llc_struct.h
new file mode 100644
index 0000000..5bf1279
--- /dev/null
+++ b/mcu/protocol/interface/general/rlc2llc_struct.h
@@ -0,0 +1,136 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * rlc2llc_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file describes the common structure of RLC and LLC.
+ *
+ * Author:
+ * -------
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _RLC2LLC_STRUCT_H
+#define _RLC2LLC_STRUCT_H
+
+/* Nancy 20101005: Suggest Add for RHR */
+#include "kal_general_types.h"
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint32 tlli;
+} grr_unitdata_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint32 tlli;
+} grr_data_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint32 tlli;
+ kal_uint8 status_cause;
+ kal_uint8 sapi;
+} grr_status_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+} grr_flush_cnf_struct;
+
+
+#endif
+
+
diff --git a/mcu/protocol/interface/general/rlc2mac_struct.h b/mcu/protocol/interface/general/rlc2mac_struct.h
new file mode 100644
index 0000000..80d2150
--- /dev/null
+++ b/mcu/protocol/interface/general/rlc2mac_struct.h
@@ -0,0 +1,183 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/******************************************************************************
+ * Filename:
+ * ---------
+ * rlc2mac_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *=============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *=============================================================================
+ ******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _RLC2MAC_STRUCT_H
+#define _RLC2MAC_STRUCT_H
+
+/*Evelyn: Remove redundant header and file */
+#include "rr_common_def.h"
+#include "rlcmac_struct.h"
+#include "kal_general_types.h"
+#include "gprs_rlcmac_common_struct.h"
+
+/* Evelyn 20090415: Merge R6 */
+typedef struct multiple_res_req_struct rlc_mac_res_req_struct;
+
+typedef struct tbf_rel_struct rlc_mac_tbf_rel_req_struct;
+
+typedef struct {
+ kal_uint8 payload_type;
+ kal_uint8 cv;
+ kal_uint8 stall_ind;
+ kal_uint8 retry;
+ kal_uint8 spare;
+ kal_uint8 pfi_ind;
+ kal_uint8 tfi;
+ kal_uint8 tlli_ind;
+ kal_uint8 bsn;
+ kal_uint8 extn;
+} ul_header_struct;
+
+typedef struct {
+ ul_header_struct gprs_hdr;
+} ul_block_header_struct;
+
+typedef struct {
+ //ul_block_header_struct ulheader;
+ kal_uint8 cs;
+ #ifndef __MTK_TARGET__
+ kal_uint8 data1[75];
+ #else
+ kal_uint8 *data1;
+ #endif
+ #ifdef __EGPRS_MODE__
+ #ifndef __MTK_TARGET__
+ kal_uint8 data2[75];
+ #else
+ kal_uint8 *data2;
+ #endif
+ kal_uint8 header[6];
+ /* Claire 041208 change : Fill UL data header, blockDataPS1, blockDataPS2 fields */
+ kal_uint8 blockDataPS1; // punturing scheme for EGPRS in the first RLC data block of one block
+ kal_uint8 blockDataPS2; // punturing scheme for EGPRS in the second RLC data block of one block
+ #endif
+
+ #ifdef __GERAN_FANR__
+ kal_uint8 pan[4];
+ #endif
+
+} ul_data_block_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 res_req_blk;
+ kal_uint8 no_rlc_mac_res_req;
+ kal_uint8 rlc_mac_res_req_size;
+ rlc_mac_res_req_struct *rlc_mac_res_req;
+ kal_uint16 no_ul_blks;
+ /* Evelyn 20090905: Modify for High multislot class */
+ ul_data_block_struct ul_blks[MAX_TX_TIMESLOTS*2];
+/* Evelyn 20090415: Merge R6 */
+} rlc_mac_ul_data_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ ack_nack_desc_struct ack_nack_res;
+ #ifdef __EGPRS_MODE__
+ egprsack_nack_description_struct egprs_ack_nac_res;
+ #endif
+/* Evelyn 20090415: Merge R6 */
+} rlc_mac_ack_res_struct;
+#endif
+
+
diff --git a/mcu/protocol/interface/general/rlc2reasm_struct.h b/mcu/protocol/interface/general/rlc2reasm_struct.h
new file mode 100644
index 0000000..f95e2a6
--- /dev/null
+++ b/mcu/protocol/interface/general/rlc2reasm_struct.h
@@ -0,0 +1,128 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/******************************************************************************
+ * Filename:
+ * ---------
+ * rlc2reasm_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *=============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *=============================================================================
+ ******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _RLC2REASM_STRUCT_H
+#define _RLC2REASM_STRUCT_H
+
+/* Nancy 20101005: Suggest Add for RHR */
+#include "rr_common_def.h"
+
+typedef struct {
+ LOCAL_PARA_HDR
+#ifdef __EGPRS_MODE__
+ TBF_TYPE tbf_type;
+#endif
+ kal_uint16 num_blks_to_reasm;
+ kal_uint16 begin_indx;
+ kal_uint8 rnr_reasm_in_progress;
+ kal_uint8 rlc_mode;
+ kal_uint8 TBF_index;
+} rlc_reasm_begin_reasm_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint16 end_of_win_indx;
+ kal_uint8 is_need_clean_bsn_in_tbf;
+ #ifdef __EGPRS_MODE__
+ TBF_TYPE tbf_type;
+ #endif
+ kal_uint8 TBF_index;
+ /*We will release dl memory in REASM when dl tbf release. Set ture in rlc_dl_tbf_rel.*/
+ kal_bool DL_rel;
+} rlc_reasm_tbf_rel_ind_struct;
+
+#endif
+
+
diff --git a/mcu/protocol/interface/general/rlc2rmpc_struct.h b/mcu/protocol/interface/general/rlc2rmpc_struct.h
new file mode 100644
index 0000000..2bf3a1c
--- /dev/null
+++ b/mcu/protocol/interface/general/rlc2rmpc_struct.h
@@ -0,0 +1,85 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/******************************************************************************
+ * Filename:
+ * ---------
+ * rlc2rmpc_struct.h
+ *
+ * Project:
+ * --------
+ * MOLY
+ *
+ * Description:
+ * ------------
+ * This file defines the interface between RLC and RMPC
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *=============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *=============================================================================
+ ******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _RLC2RMPC_STRUCT_H
+#define _RLC2RMPC_STRUCT_H
+
+#include "rr_common_def.h"
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 multiple;
+} rlc_rmpc_adjust_paging_period_ind_struct;
+
+#endif /* _RLC2RMPC_STRUCT_H */
+
+
diff --git a/mcu/protocol/interface/general/rlc_enums.h b/mcu/protocol/interface/general/rlc_enums.h
new file mode 100644
index 0000000..5fbe5ab
--- /dev/null
+++ b/mcu/protocol/interface/general/rlc_enums.h
@@ -0,0 +1,257 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/******************************************************************************
+ * Filename:
+ * ---------
+ * rlc_enums.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *=============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *=============================================================================
+ ******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _RLC_ENUMS_H
+#define _RLC_ENUMS_H
+
+//for test mode
+typedef enum
+{
+ GPRS_TEST_MODE_A,
+ GPRS_TEST_MODE_B,
+ EGPRS_SRB_LOOPBACK_MODE
+} gprs_test_mode;
+
+typedef enum
+{
+ RLC_HO_IDLE,
+ RLC_HO_START,
+ RLC_HO_STATE_NUM
+} rlc_ho_mode;
+
+typedef enum
+{
+ RLC_UNLOCKED_UL,
+ RLC_LOCK_UL_WAIT_FOR_XID,
+ RLC_UL_Q_FLUSHED,
+ RLC_XID_IN_Q,
+ RLC_NUM_XID_STATE
+} rlc_psho_xid_state_enum;
+
+#include "l3_inc_enums.h"
+typedef enum {
+ RLC_TX_SUCCESS = DC_Status_SUCCESS ,
+ RLC_TX_FAIL = DC_Status_Normal_FAILURE,
+ RLC_TX_FAIL_WITH_CELL_RESEL = DC_Status_GAS_CellResel_Discard,
+ RLC_TX_FAIL_CCO_ACTIVATION_TIME_ONGOING = DC_Status_RLC_CCO_Activation_Time_Ongoing,
+ RLC_TX_FAIL_WITH_GPRS_RESUME = DC_Status_GAS_RLC_GPRS_Resume_Discard, /*SM/MM ask RLC to send CNF to LLC if RLC discard signalling pdu when GPRS_RESUME */
+ RLC_TX_FAIL_NO_CELL_COVERAGE = DC_Status_RLC_No_Cell_Coverage_Discard
+#ifdef __GEMINI__
+ ,
+ RLC_TX_FAIL_GEMINI_PS_ACTIVE = DC_Status_Gemini_Fail
+#endif /* __GEMINI__ */
+} rlc_tx_status_enum;
+
+#ifdef __EGPRS_MODE__
+typedef enum
+{
+ RLC_DECODE_OK,
+ RLC_NACK_BLOCK,
+ RLC_INVALID_BITMAP,
+ RLC_INVALID_SSN
+} rlc_decode_bitmap_result;
+#endif /* __EGPRS_MODE__ */ /* __EPSK_TX__ */
+
+typedef enum
+{
+ RLC_IDLE,
+ RLC_OPEN_PEND,
+ RLC_TRANSFER,
+ RLC_REL_PEND,
+ RLC_UL_TEST_MODE,
+ RLC_NUM_STATES
+} rlc_state_enum;
+
+typedef enum
+{
+ RLC_DL_IDLE,
+ RLC_DL_TRANSFER,
+ RLC_DL_REL_PEND,
+ RLC_DL_TEST_MODE,
+ RLC_DL_NUM_STATES
+} rlc_dl_state_enum;
+
+typedef enum
+{
+ RLC_ACKED,
+ RLC_NACKED,
+ RLC_PEND_ACK,
+ RLC_NEW_BLK
+ //,
+ // RLC_BLK_TO_DELETE
+} rlc_blk_state_enum;
+
+typedef enum
+{
+ RLC_RESOLVED,
+ RLC_INPROGRESS
+} rlc_phase_cont_enum;
+
+typedef enum
+{
+ RLC_NO,
+ RLC_YES
+} rlc_bool_enum;
+
+typedef enum
+{
+ RLC_PFI_BEST_EFFORT = 0,
+ RLC_PFI_SIGNAL
+} rlc_pfi_type;
+
+typedef enum
+{
+ RLC_ACCESS_ALLOW = 0,
+ RLC_ACCESS_NOT_ALLOW,
+ RLC_ACCESS_T3142_RUNNING,
+ RLC_ACCESS_NOT_ALLOW_AND_T3142_RUNNING
+}
+rlc_access_state_enum;
+
+typedef enum
+{
+ PREVIOUS_BLK,
+ CURRENT_BLK,
+ NEXT_BLK
+} reseg_blk_type_enum;
+
+typedef enum
+{ /* shall sync with RLC_TIMER_NUM_MSGS value */
+ RLC_T3182_TIMER_ID = 0,
+#ifndef __REMOVE_FA__
+ RLC_T3184_TIMER_ID,
+#endif /* __REMOVE_FA__ */
+
+ RLC_READY_TIMER_ID, /* Vincent: new add */
+#ifdef __GERAN_R4__
+ RLC_T3185_TIMER_ID,
+#endif /* __GERAN_R4__ */
+ RLC_PS_CONF_TIMER_ID,
+ RLC_EVENT_TIMER_ID,
+ RLC_TIMER_NUM_MSGS
+} rlc_timer_id_enum; /* RLC_TIMER Message Type */
+
+#ifdef __EGPRS_MODE__
+typedef enum
+{
+ PUN_SCHEME1,
+ PUN_SCHEME2,
+ PUN_SCHEME3
+} pun_scheme_enum;
+#endif /* __EGPRS_MODE__ */
+
+typedef enum
+{
+ RLC_ACKED_BLK_RETRANS_FLUSH,
+ CONTENTION_RESOLVED_FLUSH,
+ CS_CHANGED_FLUSH,
+ ULTBF_END_FLUSH,
+ RLC_NACK_FLUSH,
+ STALL_CHANGED_FLUSH,
+ UNACK_CV0_FLUSH,
+ EXT_ULTBF_FLUSH,
+ MAC_FLUSH_ALL,
+ TBF_CHANGED_IN_PSHO_FLUSH,
+ NO_FLUSH
+} flush_cause_enum;
+
+typedef enum
+{
+ RLC_TBF_SWITCH_FAIL,
+ RLC_TBF_SWITCH_NO_TBF,
+ RLC_TBF_SWITCH_SUCCESS,
+ RLC_TBF_SWITCH_ADD_NEW_TBF,
+ RCL_TBF_SWTICH_NO
+} rlc_tbf_switch_enum;
+
+/* typedef enum
+ {
+ RLC_RES_REQ_IDLE = 0,
+ RLC_RES_REQ_WAIT
+ } rlc_res_req_state_enum; */
+
+/* typedef enum{
+ RLC_EVENT_TIMER_ID = 3182
+ }RLC_TIMER_ID_ENUM; */
+
+#endif /* _RLC_ENUMS_H */
diff --git a/mcu/protocol/interface/general/rlc_mac_enums.h b/mcu/protocol/interface/general/rlc_mac_enums.h
new file mode 100644
index 0000000..cf5ec76
--- /dev/null
+++ b/mcu/protocol/interface/general/rlc_mac_enums.h
@@ -0,0 +1,128 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/******************************************************************************
+ * Filename:
+ * ---------
+ * rlc_mac_enums.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file is intends to define the enums used between MAC and RLC.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *=============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *=============================================================================
+ ******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _RLC_MAC_ENUMS_H
+#define _RLC_MAC_ENUMS_H
+
+#ifndef _RR_COMMON_DEF_H
+#error "rr_common_def.h should be included first"
+#endif
+
+/******************************************************************************
+ * Constant
+ ******************************************************************************/
+#define RLC_MAX_DL_SLOTS 8
+
+/******************************************************************************
+ * Enum Value
+ ******************************************************************************/
+typedef enum
+{
+ RLC_ACK_MODE,
+ RLC_UNACK_MODE
+} rlc_mode_enum;
+
+typedef enum
+{
+ RLC_TBF_CLOSE_ENDED,
+ RLC_TBF_OPEN_ENDED
+} rlc_tbf_endness_enum;
+
+typedef enum
+{
+ REQ_FT_ONE_PHASE_CONTENTION_FAIL,
+ REQ_FT_ACCESS_NOT_ALLOWED,
+ REQ_FT_UNASSIGNED_TLLI,
+ REQ_FT_PA_FAILED
+} req_failure_type_enum;
+
+typedef enum
+{
+ ASK_RES_REQ_ALLOWED,
+ ASK_RES_REQ_NOT_ALLOWED,
+ ASK_RES_REQ_UNCHANGED
+} ask_res_req_enum; /* inform RLC if ask res req is allowed or not */
+
+typedef enum
+{
+ PS_CONF_TIMER_START,
+ PS_CONF_TIMER_STOP,
+ PS_CONF_TIMER_RESTART
+} ps_conf_timer_action_enum;
+
+#endif /* end of _RLC_MAC_ENUMS_H */
+
+
diff --git a/mcu/protocol/interface/general/rlcmac_struct.h b/mcu/protocol/interface/general/rlcmac_struct.h
new file mode 100644
index 0000000..d6672c2
--- /dev/null
+++ b/mcu/protocol/interface/general/rlcmac_struct.h
@@ -0,0 +1,119 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/******************************************************************************
+ * Filename:
+ * ---------
+ * rlcmac_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *=============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *=============================================================================
+ ******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _RLCMAC_STRUCT_H
+#define _RLCMAC_STRUCT_H
+
+/*Evelyn: Remove redundant header and file */
+#include "kal_general_types.h"
+#include "rr_common_def.h"
+
+/* Evelyn 20090415: Merge R6 */
+//#ifdef __MTBF__
+typedef struct tbf_rel_struct {
+ LOCAL_PARA_HDR
+ kal_uint8 rel_type;
+ kal_uint8 no_ul_pfi_valid;
+ kal_uint8 ul_pfi[MULTIPLE_TBF_NUM];
+ kal_uint8 no_dl_pfi_valid;
+ kal_uint8 dl_pfi[MULTIPLE_TBF_NUM];
+ kal_uint8 is_all_tbf_rel;
+} tbf_rel_struct;
+//#else
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+//#endif /* end of __MTBF__*/
+
+#endif
+
+
diff --git a/mcu/protocol/interface/general/rmpc2mac_struct.h b/mcu/protocol/interface/general/rmpc2mac_struct.h
new file mode 100644
index 0000000..0b667a1
--- /dev/null
+++ b/mcu/protocol/interface/general/rmpc2mac_struct.h
@@ -0,0 +1,291 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/******************************************************************************
+ * Filename:
+ * ---------
+ * rmpc2mac_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *=============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *=============================================================================
+ ******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _RMPC2MAC_STRUCT_H
+#define _RMPC2MAC_STRUCT_H
+
+/*Evelyn: Remove redundant header and file */
+#include "kal_general_types.h"
+#include "rmc_peer_struct.h"
+#include "rr_common_def.h"
+
+typedef struct {
+ kal_uint8 is_valid;
+ kal_uint8 length_of_list;
+ kal_uint16 freq_list[64];
+} freq_alloc_list_struct;
+
+typedef struct {
+ kal_uint8 bit_offset;
+ kal_uint8 no_ul_assign_ptr;
+ kal_uint8 ul_assign_ptr_size;
+ kal_uint8 *ul_assign_ptr;
+} rmpc_mac_pkt_ul_assign_ind_struct;
+
+typedef struct {
+ pkt_chan_desc_struct pkt_ch_desc;
+ timing_advance_struct timing_adv;
+ freq_alloc_list_struct freq_alloc;
+ kal_uint8 no_ia_rest_octs;
+ kal_uint8 ia_rest_octs_size;
+ kal_uint8 *ia_rest_octs;
+} rmpc_mac_imm_pkt_ul_assign_ind_struct;
+
+typedef struct {
+ kal_uint8 before_time_valid;
+ channel_desc_struct chan_desc_before_time;
+ freq_alloc_list_struct freq_alloc_before_time;
+ STARTING_TIME_STRUCT_1 start_time;
+ channel_desc_struct chan_desc_after_time;
+ freq_alloc_list_struct freq_alloc_after_time;
+ kal_uint8 no_ul_asgn;
+ kal_uint8 ul_asgn_size;
+ kal_uint8 *ul_asgn;
+} rmpc_mac_pdch_pkt_ul_assign_ind_struct;
+
+typedef struct {
+ kal_uint8 bit_offset;
+ kal_uint8 no_dl_assign_ptr;
+ kal_uint8 dl_assign_ptr_size;
+ kal_uint8 *dl_assign_ptr;
+} rmpc_mac_pkt_dl_assign_ind_struct;
+
+typedef struct {
+ pkt_chan_desc_struct pkt_ch_desc;
+ timing_advance_struct timing_adv;
+ freq_alloc_list_struct freq_alloc;
+ kal_uint8 no_ia_rest_octs;
+ kal_uint8 ia_rest_octs_size;
+ kal_uint8 *ia_rest_octs;
+} rmpc_mac_imm_pkt_dl_assign_ind_struct;
+
+typedef struct {
+ kal_uint8 before_time_valid;
+ channel_desc_struct chan_desc_before_time;
+ freq_alloc_list_struct freq_alloc_before_time;
+ STARTING_TIME_STRUCT_1 start_time;
+ channel_desc_struct chan_desc_after_time;
+ freq_alloc_list_struct freq_alloc_after_time;
+ kal_uint8 no_dl_asgn;
+ kal_uint8 dl_asgn_size;
+ kal_uint8 *dl_asgn;
+} rmpc_mac_pdch_pkt_dl_assign_ind_struct;
+
+// Evelyn : merge control message indication ro RMPC as mac_rmpc_ctrl_msg_ind
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+/* Exce 030827: Change interface; RES_REQ fowarded back to MAC is kept in the primitive itself */
+typedef struct {
+ LOCAL_PARA_HDR
+ /* Evelyn 20090415: Merge R6 */
+ // Evelyn MTBF: Change the packet access structure
+ multiple_res_req_struct res_req_msg; /* Exce 030827: Note that forwarded back RES_REQ in the primitve is ALWAYS valid */
+ ts_frame_no_struct ts_frame_no;
+ kal_uint8 access_type;
+ pkt_assign_type_enum pkt_assign_type_tag;
+ union {
+ rmpc_mac_pkt_ul_assign_ind_struct pkt_ul_assign;
+ rmpc_mac_imm_pkt_ul_assign_ind_struct imm_ul_assign;
+ rmpc_mac_pdch_pkt_ul_assign_ind_struct pdch_ul_assign;
+ } pkt_assign_type_value;
+} rmpc_mac_ul_assign_ind_struct;
+
+/* Exce 030827: Change interface; RES_REQ fowarded back to MAC is kept in the primitive itself, also remove unnecessary fields. */
+typedef struct {
+ LOCAL_PARA_HDR
+// kal_uint8 no_res_req_msg;
+// kal_uint8 res_req_msg_size;
+ kal_bool is_res_req_msg_valid;
+/* Evelyn 20090415: Merge R6 */
+ multiple_res_req_struct res_req_msg;
+ ts_frame_no_struct ts_frame_no;
+ pkt_assign_type_enum pkt_assign_type_tag;
+ union {
+ rmpc_mac_pkt_dl_assign_ind_struct pkt_dl_assign;
+ rmpc_mac_imm_pkt_dl_assign_ind_struct imm_dl_assign;
+ rmpc_mac_pdch_pkt_dl_assign_ind_struct pdch_dl_assign;
+ } pkt_assign_type_value;
+} rmpc_mac_dl_assign_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 ready_flag;
+ kal_uint8 conf_reqd;
+ kal_uint8 no_rmpc_msg_ptr;
+ kal_uint8 rmpc_msg_ptr_size;
+ kal_uint8 *rmpc_msg_ptr;
+} rmpc_mac_si_info_ready_ind_struct;
+
+/* Lanslo 20051102: for MNT */
+#if (!defined(__MTK_TARGET__)) || defined(__MAC_SHOW_TRANS_DATA__)
+typedef struct {
+ LOCAL_PARA_HDR
+ tbf_rel_type_enum rel_cause;
+ kal_bool is_for_rmpc_test;
+} rmpc_mac_cell_status_ind_struct;
+#endif
+
+// Evelyn : merge control message indication ro RMPC as mac_rmpc_ctrl_msg_ind
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+/* Evelyn 20090415: Merge R6 */
+typedef struct{
+ LOCAL_PARA_HDR
+ rmpc_mac_ctrl_msg_type_enum msg_type;
+ kal_uint8* enc_data_ptr;
+ kal_uint8 req_id;
+} rmpc_mac_ctrl_msg_req_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ rmpc_mac_ctrl_msg_type_enum msg_type;
+ kal_uint8 req_id;
+} rmpc_mac_ctrl_msg_delete_req_struct;
+
+
+typedef enum {
+ SERV_SI_PTR,
+ PS_HO_BEGIN_TARGET_CELL_SI_PTR,
+ PS_HO_FAIL_OLD_SERV_SI_PTR
+} mac_si_ptr_query_type_enum;
+
+#endif
diff --git a/mcu/protocol/interface/general/rmpc2rlc_struct.h b/mcu/protocol/interface/general/rmpc2rlc_struct.h
new file mode 100644
index 0000000..c91cc3e
--- /dev/null
+++ b/mcu/protocol/interface/general/rmpc2rlc_struct.h
@@ -0,0 +1,85 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/******************************************************************************
+ * Filename:
+ * ---------
+ * rmpc2rlc_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *=============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *=============================================================================
+ ******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _RMPC2RLC_STRUCT_H
+#define _RMPC2RLC_STRUCT_H
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 cause;
+} rmpc_rlc_access_failure_ind_struct;
+#endif
+
+
diff --git a/mcu/protocol/interface/general/rmpc2rrm_struct.h b/mcu/protocol/interface/general/rmpc2rrm_struct.h
new file mode 100644
index 0000000..81c2e0d
--- /dev/null
+++ b/mcu/protocol/interface/general/rmpc2rrm_struct.h
@@ -0,0 +1,100 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * rmpc2rrm_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *============================================================================
+ ****************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _RMPC2RRM_STRUCT_H
+#define _RMPC2RRM_STRUCT_H
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 start_or_stop;
+} rmpc_rrm_hplmn_srch_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 update_type;
+ /* JACK 0710, modify for informing RRM abnormal cell reselection
+ * start/end */
+} rmpc_rrm_ba_change_ind_struct;
+
+ /* Claire 041105 change : Implement Inter-PLMN handover */
+ typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 is_inter_plmn_handover;
+ kal_uint8 number_of_channels;
+ kal_uint16 *arfcn_list;
+} rmpc_rrm_cell_sel_req_struct;
+#endif
+
diff --git a/mcu/protocol/interface/general/rmpc_rlc_enums.h b/mcu/protocol/interface/general/rmpc_rlc_enums.h
new file mode 100644
index 0000000..559edb7
--- /dev/null
+++ b/mcu/protocol/interface/general/rmpc_rlc_enums.h
@@ -0,0 +1,104 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/******************************************************************************
+ * Filename:
+ * ---------
+ * rmpc_rlc_enums.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file is intends to define related messages and paramters between RLC
+ * and RMPC.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *=============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *=============================================================================
+ ******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _RMPC_RLC_ENUMS_H
+#define _RMPC_RLC_ENUMS_H
+
+#ifndef _RR_COMMON_DEF_H
+#error "rr_common_def.h should be included first"
+#endif
+
+/******************************************************************************
+ * Constant
+ ******************************************************************************/
+
+/******************************************************************************
+ * Enum Value
+ ******************************************************************************/
+typedef enum
+{
+ //ACCESS_NOT_ALLOWED,
+ CELL_RESELECTION,
+ NW_CNTRL_CELL_RESEL,
+ NW_CNTRL_CELL_RESEL_FAIL,
+ NETWORK_NOT_RESPONDING,
+ TBF_ESTABLISHMENT_REINITIATE,
+ //TBF_ESTABLISHMENT_FAILURE,
+ //RAND_ACCESS_FAILURE,
+ NO_SIM_FAIL,
+ RR_DETACH
+} ACCESS_FAILURE_CAUSE;
+
+#endif /* end of _RMPC_RLC_ENUMS_H */
+
+
diff --git a/mcu/protocol/interface/general/rohc_export_api.h b/mcu/protocol/interface/general/rohc_export_api.h
new file mode 100644
index 0000000..8dd881f
--- /dev/null
+++ b/mcu/protocol/interface/general/rohc_export_api.h
@@ -0,0 +1,145 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2012
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * rohc_export_api.h
+ *
+ * Project:
+ * --------
+ * VMOLY
+ *
+ * Description:
+ * ------------
+ * This file contains RAL (ROHC Abstract Layer) export interface definitions.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ *
+ ****************************************************************************/
+
+#ifndef _ROHC_EXPORT_API_H_
+#define _ROHC_EXPORT_API_H_
+
+#include "kal_general_types.h"
+
+/*--------------------------------------------------------------------------
+ * Constant Definition
+ *--------------------------------------------------------------------------*/
+
+#define ROHC_REG_RTP_FLOW_IP_HDR_MAX_NUM (2)
+
+/*--------------------------------------------------------------------------
+ * Structure Definition
+ *--------------------------------------------------------------------------*/
+typedef struct
+{
+ kal_uint32 is_ipv4;
+
+ /*
+ * src/dst address, which are network byte order
+ * Note that the order of src_addr and dst_addr can't be changed.
+ */
+ kal_uint32 src_addr[4];
+ kal_uint32 dst_addr[4];
+} ral_rtp_flow_ip_param_t;
+
+typedef struct
+{
+ /// src/dst ports, which are network byte order
+ kal_uint16 src_port;
+ kal_uint16 dst_port;
+} ral_rtp_flow_udp_param_t;
+
+typedef struct
+{
+ /// ssrc, which is network byte order
+ kal_uint32 ssrc;
+
+ /// expected ts_stride while voice is ongoing
+ kal_uint32 ts_stride;
+} ral_rtp_flow_rtp_param_t;
+
+typedef struct
+{
+ /// number of entry in ip_flow_param
+ kal_uint32 ip_hdr_num;
+
+ /*
+ * ip flow parameters, from outer to inner, e.g. ip_flow_param[ip_hdr_num-1] is the
+ * innermost ip header parameter.
+ */
+ ral_rtp_flow_ip_param_t ip_param[ROHC_REG_RTP_FLOW_IP_HDR_MAX_NUM];
+
+ /// udp flow parameters
+ ral_rtp_flow_udp_param_t udp_param;
+
+ /// rtp flow parameters
+ ral_rtp_flow_rtp_param_t rtp_param;
+
+} ral_rtp_flow_param_t;
+
+/*--------------------------------------------------------------------------
+ * Public Macro Definition
+ *--------------------------------------------------------------------------*/
+
+
+/*--------------------------------------------------------------------------
+ * Interface Function Definition
+ *--------------------------------------------------------------------------*/
+
+/**
+ * @brief Register the RTP flow described in p_rtp_flow_param to use RTP profile
+ * @param p_rtp_flow_param the RTP flow parameters
+ * @return < 0 if any error happens
+ * 0 otherwise
+ */
+kal_int32 ral_cr4_reg_rtp_flow(ral_rtp_flow_param_t *p_rtp_flow_param);
+
+/**
+ * @brief Unregister the RTP flow described in p_rtp_flow_param
+ * @param p_rtp_flow_param the RTP flow parameters
+ * @return < 0 if any error happens
+ * 0 otherwise
+ */
+kal_int32 ral_cr4_unreg_rtp_flow(ral_rtp_flow_param_t *p_rtp_flow_param);
+
+#endif /* _ROHC_EXPORT_API_H_ */
diff --git a/mcu/protocol/interface/general/rr2lapdm_struct.h b/mcu/protocol/interface/general/rr2lapdm_struct.h
new file mode 100644
index 0000000..651cd3c
--- /dev/null
+++ b/mcu/protocol/interface/general/rr2lapdm_struct.h
@@ -0,0 +1,225 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * rr2lapdm_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *============================================================================
+ ****************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _RR2LAPDM_STRUCT_H
+#define _RR2LAPDM_STRUCT_H
+
+/* add RHR */
+#if 0
+/* under construction !*/
+#endif
+#include "l3_inc_enums.h" /* MSBB by Rachel */
+#include "kal_general_types.h"
+
+#include "rr_common_enums.h"
+
+typedef struct
+{
+ kal_bool is_dtx_updated;
+ kal_uint8 is_dtx_tch_h;
+ kal_uint8 is_dtx_tch_f;
+}
+rr_dtx_update_struct;
+
+typedef struct
+{
+ kal_bool is_maxrlc_updated;
+ kal_uint16 max_rlcvalue;
+}
+rr_maxrlc_update_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ lapdm_sapi_header sap_id;
+ kal_uint8 l2header;
+ channel_type_enum channel_type;
+} rr_lapdm_unitdata_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ lapdm_sapi_header sap_id;
+ LAPDM_ESTB_MODE estb_mode;
+ channel_type_enum channel_type;
+ rr_maxrlc_update_struct maxrlc_update;
+} rr_lapdm_estb_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ lapdm_sapi_header sap_id;
+ channel_type_enum channel_type;
+ kal_uint8 half_to_full;
+} rr_lapdm_sus_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ lapdm_sapi_header sap_id;
+ channel_type_enum channel_type;
+} rr_lapdm_resume_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ lapdm_sapi_header sap_id;
+ channel_type_enum channel_type;
+} rr_lapdm_recon_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ lapdm_sapi_header sap_id;
+ kal_uint8 priority;
+ channel_type_enum channel_type;
+/* brwang, 06/04/08, [MAUI_00185915] { */
+ kal_uint8 mui;
+/* brwang, 06/04/08, [MAUI_00185915] } */
+} rr_lapdm_data_req_struct;
+
+#ifdef __AGPS_CONTROL_PLANE__
+typedef struct {
+ LOCAL_PARA_HDR
+ lapdm_sapi_header sap_id;
+ kal_uint8 priority;
+ channel_type_enum channel_type;
+ lapdm_layer3_message_type_enum segment_type;
+ kal_uint8 mui;
+} rr_lapdm_app_data_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool need_clear;
+} rr_lapdm_clear_app_queue_req_struct;
+#endif /* __AGPS_CONTROL_PLANE__ */
+
+typedef struct {
+ LOCAL_PARA_HDR
+ lapdm_sapi_header sap_id;
+ kal_uint8 release_mode;
+ channel_type_enum channel_type;
+} rr_lapdm_rel_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ lapdm_sapi_header sap_id;
+ channel_type_enum channel_type;
+} rr_lapdm_mdl_rel_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ rr_dtx_update_struct dtx_update;
+ rr_maxrlc_update_struct maxrlc_update;
+} rr_lapdm_cell_option_update_req_struct;
+
+
+typedef struct {
+ LOCAL_PARA_HDR
+ lapdm_sapi_header sap_id;
+ channel_type_enum channel_type;
+ rr_maxrlc_update_struct maxrlc_update;
+} rr_lapdm_inter_rat_est_req_struct;
+
+#endif
+
+
diff --git a/mcu/protocol/interface/general/rr2mpal_struct.h b/mcu/protocol/interface/general/rr2mpal_struct.h
new file mode 100644
index 0000000..c87f79e
--- /dev/null
+++ b/mcu/protocol/interface/general/rr2mpal_struct.h
@@ -0,0 +1,1673 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+/*******************************************************************************
+ * Modification Notice:
+ * --------------------------
+ * This software is modified by MediaTek Inc. and the information contained
+ * herein is confidential. The software may not be copied and the information
+ * contained herein may not be used or disclosed except with the written
+ * permission of MediaTek Inc. (C) 2001
+ *
+ *******************************************************************************/
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * rr2mpal_struct.h
+ *
+ * Project:
+ * --------
+ * Maui_Software
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *============================================================================
+ ****************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+
+#ifndef _RR2MPAL_STRUCT_H
+#define _RR2MPAL_STRUCT_H
+
+/*Evelyn: Remove redundant header and file */
+#include "rr_mpal_interface.h"
+#include "l3_inc_enums.h"
+#include "l3_inc_local.h"
+#include "kal_general_types.h"
+#include "gmss_public.h"
+/*Justin: RHR*/
+#ifdef __UMTS_RAT__
+#include "uas_gas_enums.h"
+#endif
+#include "rr_common_def.h"
+#include "gas_eas_enums.h"
+
+#include "rr_common_enums.h"
+
+#include "gas_gise_enum.h"
+#if defined(__UMTS_RAT__) || defined(__LTE_RAT__)
+#include "uas_gas_inter_core_enum.h"
+#include "as_inter_core_struct.h"
+#endif /* defined(__UMTS_RAT__) || defined(__LTE_RAT__) */
+#if defined(__23G_PRI_RESEL_SUPPORT__) || defined(__LTE_RAT__)
+#include "gas_eas_inter_core_enum.h"
+#endif /* defined(__23G_PRI_RESEL_SUPPORT__) || defined(__LTE_RAT__) */
+
+#ifdef __GEMINI__
+#include "rsvas_enum.h"
+#endif /* __GEMINI__ */
+
+#if defined(__UMTS_RAT__) || defined(__LTE_RAT__)
+#define STANDBY_GSM_MEAS_MAX_CELL_NUM (32) // ref to MPH_STANDBY_GSM_MEAS_MAX_CELL_NUM
+#define STANDBY_GSM_MAX_BSIC_NUM (32) // ref to MPH_STANDBY_GSM_MEAS_MAX_CELL_NUM
+#endif /* defined(__UMTS_RAT__) || defined(__LTE_RAT__) */
+
+
+typedef struct {
+ kal_uint8 valid;
+ kal_uint16 t1;
+ kal_uint8 t2;
+ kal_uint8 t3;
+} starting_time_struct;
+
+typedef struct {
+ kal_uint8 is_value_valid;
+ kal_uint8 value;
+} timing_adv_struct;
+
+typedef struct {
+ kal_uint8 is_value_valid;
+ kal_uint8 pwr_ctrl_level;
+} pwr_cmd_struct;
+
+typedef struct {
+ kal_uint8 cipher_mode;
+ kal_uint8 cipher_key[KC_LEN];
+#ifdef __A54_ALGORITHM_SUPPORT__
+ kal_uint8 cipher_key_128[KC128_LEN];
+#endif /* __A54_ALGORITHM_SUPPORT__ */
+} cipher_setting_struct;
+
+typedef struct {
+ kal_uint8 maio;
+ kal_uint8 hsn;
+ kal_uint8 length_of_list;
+ kal_uint16 freq_list[64];
+} hopping_freq_list_struct;
+
+typedef struct {
+ kal_uint16 arfcn;
+ hopping_freq_list_struct hopping_freq_list;
+} freq_comp_struct;
+
+typedef struct {
+ kal_bool is_hopping;
+ kal_uint8 tsc;
+ kal_uint8 tsc_set; /* 0 or 1; only valid in handover_req and dedicated_channel_connect_req */
+ freq_comp_struct freq_comp;
+} freq_params_struct;
+
+typedef struct {
+ kal_uint8 time_slot;
+ channel_type_enum ch_type;
+ channel_mode_enum ch_mode;
+ freq_params_struct freq_params;
+} ch_connect_ctrl_params_struct;
+
+typedef struct {
+ kal_uint8 list_ref;
+ kal_uint8 arfcn_list_len;
+ kal_uint16 arfcn_list[33];
+} bcch_list_struct;
+
+typedef struct {
+ kal_uint8 list_ref;
+ kal_uint16 arfcn_list_len;
+ kal_uint16 arfcn_list[512];
+} stored_bcch_list_struct;
+
+typedef struct {
+ kal_uint16 arfcn;
+ kal_uint8 bsic_valid;
+ kal_int32 frame_offset;
+ kal_int32 ebit_offset;
+ kal_uint8 need_retry;
+ kal_uint8 retry_FB_SB;
+ kal_bool short_FB;
+} neighbor_bsic_acquisition_struct;
+
+typedef struct {
+ kal_uint16 arfcn;
+ kal_uint8 is_need_freq_correction;
+} cell_bsic_acquisition_struct;
+
+typedef struct {
+ kal_uint16 arfcn;
+ kal_uint8 bsic_valid;
+ kal_uint8 bsic;
+ kal_uint16 bcch_mask;
+ kal_int32 frame_offset;
+ kal_int32 ebit_offset;
+ kal_uint8 is_prior_to_acquire;
+ kal_uint8 need_retry;
+ kal_uint8 use_priority_index_order;
+#ifdef __GEMINI__
+ kal_uint16 priority_index; /*maruco20071107,RR may add more priorities for acquiring NBCCH.*/
+#else
+ kal_uint8 priority_index;
+#endif/* end of __GEMINI__*/
+} neighbor_bcch_acquisition_struct;
+
+typedef struct {
+ kal_uint16 arfcn;
+ kal_uint8 bsic;
+ kal_uint16 bcch_mask;
+ kal_int32 frame_offset;
+ kal_int32 ebit_offset;
+ kal_uint8 use_priority_index_order;
+#ifdef __GEMINI__
+ kal_uint16 priority_index; /*maruco20071107,RR may add more priorities for acquiring NBCCH.*/
+#else
+ kal_uint8 priority_index;
+#endif /* end of __GEMINI__*/
+
+#ifdef __GEMINI__
+ /* Maruco20081125,GEMINI MAUI_91553,for BCCH_preempt_peer_PCH */
+ kal_uint8 is_prior_to_acquire;
+#endif /* end of __GEMINI__*/
+} cell_bcch_acquisition_struct;
+
+typedef struct {
+ kal_uint8 is_valid;
+ kal_uint8 gamma;
+} gamma_struct;
+
+typedef struct {
+ kal_uint8 alpha;
+ kal_uint8 pb;
+ kal_uint8 t_avg_w;
+ kal_uint8 pc_meas_chan;
+ kal_uint8 t_avg_t;
+ gamma_struct gamma[8];
+} pwr_ctrl_params_struct;
+
+typedef struct {
+ kal_uint8 is_valid;
+ kal_uint8 value;
+} usf_value_struct;
+
+typedef struct {
+ kal_uint8 is_value_valid;
+ kal_uint8 value;
+ kal_uint8 is_ul_valid;
+ kal_uint8 ul_index;
+ kal_uint8 ul_timeslot_no;
+ kal_uint8 is_dl_valid;
+ kal_uint8 dl_index;
+ kal_uint8 dl_timeslot_no;
+} pkt_timing_adv_struct;
+
+typedef struct {
+ kal_uint8 is_valid;
+ kal_uint8 p0;
+ kal_uint8 bts_pwr_ctrl_mode;
+ kal_uint8 pr_mode;
+} dl_pwr_ctrl_struct;
+
+typedef struct {
+ kal_uint8 blk_or_blk_period;
+ kal_uint8 dl_ctrl_timeslot;
+ kal_uint8 is_repeat_info_valid;
+ kal_uint8 repeat_alloc;
+ kal_uint8 ts_override;
+ kal_uint16 alloc_bitmap_len;
+ kal_uint8 alloc_bitmap[36];
+} rr_fixed_alloc_struct;
+
+typedef struct {
+ kal_uint8 ul_tfi;
+ kal_uint8 ul_timeslot_alloc;
+ rr_fixed_alloc_struct fixed_alloc;
+} ul_alloc_struct;
+
+typedef struct {
+ kal_uint8 dl_tfi;
+ kal_uint8 dl_timeslot_alloc;
+} dl_alloc_struct;
+
+typedef struct {
+ freq_params_struct freq_params;
+#ifdef __PS_SERVICE__
+ ch_connect_ind_enum is_ch_connect_ind_needed;
+#else
+ kal_uint8 is_ch_connect_ind_needed;
+#endif
+ kal_uint8 is_starting_frame_valid;
+ kal_uint32 tbf_starting_frame;
+ pkt_timing_adv_struct pkt_timing_adv;
+ pwr_ctrl_params_struct pwr_ctrl_params;
+ dl_pwr_ctrl_struct dl_pwr_ctrl;
+ ul_alloc_struct ul_alloc;
+ dl_alloc_struct dl_alloc;
+} pdtch_ch_ctrl_struct;
+
+typedef struct {
+ kal_uint32 frame_number;
+ kal_uint8 time_slot;
+#ifdef __GERAN_RTTI__
+ kal_uint8 time_slot_2;
+#endif
+ burst_type_enum burst_type;
+ kal_uint8 no_data;
+#ifdef MCD_PACK_UNPACK
+ kal_uint8 data[23];
+#else
+ kal_uint8 *data;
+#endif
+
+#ifdef __GERAN_FANR__
+ rlc_polling_type_enum polling_type;
+ kal_bool is_pan_valid;
+ kal_uint8 pan[4];
+#endif
+
+} ul_rrbp_block_struct;
+
+typedef struct {
+ kal_uint8 no_data;
+#ifdef MCD_PACK_UNPACK
+ kal_uint8 data[23];
+#else
+ kal_uint8 *data;
+#endif
+} ul_ctrl_block_struct;
+
+typedef struct {
+ kal_uint8 burst_type;
+#ifdef MCD_PACK_UNPACK
+ kal_uint8 data[75];
+#else
+ kal_uint8 *data;
+#endif
+ #ifdef __EGPRS_MODE__
+#ifdef MCD_PACK_UNPACK
+ kal_uint8 data2[75];
+#else
+ kal_uint8 *data2; /* For MCS9~MCS7, there are 2 RLC blocks per radio block*/
+#endif
+ kal_uint8 header[6];
+ kal_uint8 blockDataPS1; // punturing scheme for EGPRS in the first RLC data block of one block
+ kal_uint8 blockDataPS2; // punturing scheme for EGPRS in the second RLC data block of one block
+#endif
+
+} ul_radio_blk_struct;
+
+typedef struct{
+ kal_uint8 transition_id;
+ kal_uint8 is_starting_frame_valid;
+ kal_uint32 tbf_starting_frame;
+ kal_uint8 usf_granularity;
+ usf_value_struct usf[8];
+ kal_uint8 ul_tfi;
+ kal_uint8 ul_timeslot_alloc;
+ kal_uint8 type_of_allocation;
+ /*There is no fix allocation in Rel-6*/
+ #ifndef __REMOVE_FA__
+ rr_fixed_alloc_struct fixed_alloc;
+ #endif /*__REMOVE_FA__*/
+ /* Evelyn: R7 Latency Reducation Development */
+ #ifdef __GERAN_RTTI__
+ kal_uint8 dl_timeslot_pair;
+ tti_config_enum tti_mode;
+ usf_mode_enum usf_mode;
+ #endif
+ #ifdef __GERAN_FANR__
+ kal_bool is_fanr_active;
+ kal_bool tan_type;
+ #endif
+}ul_tbf_params_struct;
+
+typedef struct{
+ kal_uint8 transition_id;
+ kal_uint8 is_starting_frame_valid;
+ kal_uint32 tbf_starting_frame;
+ kal_uint8 dl_tfi;
+ kal_uint8 dl_timeslot_alloc;
+ #ifdef __EGPRS_MODE__
+ kal_bool is_egprs_ackmode;
+ kal_bool is_reset_ir_memory;
+ kal_uint16 egprs_window_size;
+ #endif
+ kal_uint8 type_of_allocation;
+ /* Evelyn: R7 Latency Reducation Development */
+ #ifdef __GERAN_RTTI__
+ tti_config_enum tti_mode;
+ #endif
+ #ifdef __GERAN_FANR__
+ kal_bool is_fanr_activated;
+ kal_bool is_event_based_fanr;
+ #endif
+}dl_tbf_params_struct;
+
+
+#ifdef __GEMINI__
+typedef enum{
+ MPAL_SIM1_ONLY_CONFIG,
+ MPAL_SIM2_ONLY_CONFIG,
+ MPAL_DAUL_SIM_CONFIG
+}mpal_sim_config_status_enum;
+
+typedef enum{
+ MPAL_NO_SIM_INSERTED,
+ MPAL_ONLY_SIM1_INSERTED,
+ MPAL_ONLY_SIM2_INSERTED,
+ MPAL_DUAL_SIM_INSERTED
+}mpal_sim_insert_status_enum;
+#endif /* end of __GEMINI__*/
+
+#if defined (__AMR_SUPPORT__) || defined (__AMRWB_LINK_SUPPORT__)
+typedef enum{
+ AMR_SPEECH_VERSION_1 = 1
+#ifdef __AMRWB_LINK_SUPPORT__
+ ,AMR_SPEECH_VERSION_2 = 2
+#endif //__AMRWB_LINK_SUPPORT_
+}multirate_speech_version_enum;
+#endif /* __AMR_SUPPORT__ || __AMRWB_LINK_SUPPORT__*/
+
+#ifdef __PS_SERVICE__
+#endif /* end of __PS_SERVICE__ */
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 scan_id;
+ kal_uint8 bands_scan;
+ kal_uint8 bcch_list_valid;
+ kal_uint8 is_for_plmn_list;
+ stored_bcch_list_struct bcch_list;
+#ifdef __GEMINI__
+ kal_uint32 pwr_scan_period_in_virtual; //in frame, 0: invalid, MAX: TBD, MIN: TBD
+ kal_uint32 virtual_mode_num_in_virtual; //in frame, 0: invalid, MAX: TBD, MIN: TBD
+#endif /* __GEMINI__*/
+#ifdef __GEMINI_WCDMA__
+ kal_bool is_plmn_list;
+#endif /* __GEMINI_WCDMA__*/
+ kal_bool is_quick_mcc_search; //plmn search enhancement mcc quick search.
+} rr_mpal_search_rf_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 scan_id;
+} rr_mpal_search_rf_stop_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint16 arfcn;
+ kal_uint8 is_need_freq_correction;
+#ifdef __LTE_RAT__
+ kal_bool is_srvcc_n_timing_valid;
+ kal_int32 frame_offset;
+ kal_int32 ebit_offset;
+#endif
+} rr_mpal_bsic_sync_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint16 arfcn_sync;
+ kal_uint8 bsic;
+ kal_int32 frame_offset;
+ kal_int32 ebit_offset;
+} rr_mpal_specific_sync_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint16 arfcn;
+ kal_uint16 mask;
+#ifdef __GEMINI__
+ /* Maruco20081125,GEMINI MAUI_91553,for BCCH_preempt_peer_PCH */
+ kal_uint8 is_prior_to_acquire;
+#endif /*__GEMINI__*/
+} rr_mpal_serv_bcch_monitor_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 imsi_valid;
+ kal_uint16 imsi_mod_1000;
+ kal_uint8 bs_pa_mfrms;
+ kal_uint8 bs_ag_blks_res;
+ kal_uint8 ccch_conf;
+ rr_mode_enum rr_mode;
+ kal_uint8 alpha; /* Austin: 040709: alpha should not be removed */
+ kal_uint8 t_avg_w;
+ kal_uint8 pc_meas_chan;
+ kal_uint8 t_avg_t;
+ /* Austin: for NMO III, for curcurrent ccch & pccch monitoring */
+ kal_uint8 monitor_required;
+} rr_mpal_ccch_monitor_req_struct;
+
+#ifdef __MONITOR_PAGE_DURING_TRANSFER__
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 imsi_valid;
+ kal_uint16 imsi_mod_1000;
+ kal_uint8 bs_pa_mfrms;
+ kal_uint8 bs_ag_blks_res;
+ kal_uint8 ccch_conf;
+ kal_uint8 paging_mode;
+ kal_uint8 smart_bs_pa_mfrms;
+ kal_uint8 smart_mfrms_group_offset;
+} rr_mpal_monitor_page_in_ptm_start_req_struct;
+#endif /* __MONITOR_PAGE_DURING_TRANSFER__ */
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 paging_mode;
+ /* Austin: for NMO III, page mode changes of ccch and pccch are handled separately */
+ kal_uint8 page_channel_type;
+} rr_mpal_page_mode_change_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 req_id; /*sequence number for RR to know the ._cnf received is old or new*/
+ burst_type_enum burst_type;
+ rach_req_type_enum req_type;
+ kal_uint16 rach_data;
+ kal_uint16 rand;
+ #ifdef __EGPRS_MODE__
+ ats_type_enum ats_type; /* synch. sequence bits type, TS05.02 clause 5.2.7 */
+ #endif
+} rr_mpal_rach_req_struct;
+
+
+#if defined (__AMR_SUPPORT__) || defined (__AMRWB_LINK_SUPPORT__)
+/***************************************************************************
+* PRIMITIVE STRUCTURE
+* rr_mpal_amr_req_struct
+*
+* DESCRIPTION
+* This struct is sent from RR to MPAL with rr_mpal_dedicated_channel_connect_req_struct
+*
+***************************************************************************/
+typedef struct
+{
+ kal_bool amr_valid; /* the AMR(TRUE) or not(FALSE) */
+// kal_uint32 frame_number;/* the frame number to get RATSCCH messages */
+// kal_uint8 cmip; /* CMI phase */
+
+ /*ZY: add for AMR-WB*/
+ multirate_speech_version_enum mr_ver; /* MultiRate speech VERsion : 001-amr verion 1*/
+
+ kal_bool nscb; /* Noise Supression Control Bit : 0-noise supression is used */
+ kal_bool icmi; /* Initial Codec Mode Indicator : 0-is defined bythe implicit rule */
+ kal_uint8 start_codec_mode; /* Start Codec Mode */
+ kal_uint8 acs; /* AMR Codec Activate Set */
+ kal_uint8 threshold[3]; /* Threshold1/Threshold2/Threshold3 */
+ kal_uint8 hysteresis[3]; /* Hysteresis1/Hysteresis2/Hysteresis3 */
+} rr_mpal_amr_req_struct;
+#endif /* __AMR_SUPPORT__ || __AMRWB_LINK_SUPPORT__*/
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 req_type;
+ kal_uint8 dtx_allowed;
+ kal_uint8 pwrc;
+ timing_adv_struct timing_advance;
+ pwr_cmd_struct pwr_cmd;
+ starting_time_struct starting_time;
+ kal_uint8 before_time_channel_valid;
+ cipher_setting_struct cipher_set;
+ ch_connect_ctrl_params_struct before_time_channel;
+ ch_connect_ctrl_params_struct after_time_channel;
+#if defined (__AMR_SUPPORT__) || defined (__AMRWB_LINK_SUPPORT__)
+ rr_mpal_amr_req_struct rr_mpal_amr_para;
+#endif /* __AMR_SUPPORT__ || __AMRWB_LINK_SUPPORT__*/
+ kal_uint8 vamos_level; /* To config L1 non-VAMOS, VAMOS1, or VAMOS2 */
+} rr_mpal_dedicated_channel_connect_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 handover_type;
+ handover_atc_enum atc;
+ kal_uint8 dtx_allowed;
+ starting_time_struct starting_time;
+ timing_adv_struct timing_advance;
+ pwr_cmd_struct pwr_cmd;
+ cipher_setting_struct cipher_set;
+ kal_uint8 before_time_channel_valid;
+ ch_connect_ctrl_params_struct before_time_channel;
+ ch_connect_ctrl_params_struct after_time_channel;
+ kal_uint8 handover_ref;
+ kal_uint8 rtd_valid;
+ kal_uint8 rtd;
+ kal_uint8 ncc;
+ kal_uint8 bcc;
+ kal_uint8 nci;
+ kal_int32 frame_offset;
+ kal_int32 ebit_offset;
+ kal_uint16 target_bcch_arfcn;
+#if defined (__AMR_SUPPORT__) || defined (__AMRWB_LINK_SUPPORT__)
+ rr_mpal_amr_req_struct rr_mpal_amr_para;
+#endif /* __AMR_SUPPORT__ || __AMRWB_LINK_SUPPORT__*/
+#ifdef __BLIND_HANDOVER__
+ kal_bool is_blind_handover_req;
+#endif /*__BLIND_HANDOVER__*/
+#ifdef __PS_L1_DC_ARCH__
+#ifdef __HO_IMPROVE__
+ kal_uint8 sabm_data[23]; /* [U3G]: SABM pattern. */
+#endif /* __HO_IMPROVE__ */
+#endif /* __PS_L1_DC_ARCH__ */
+} rr_mpal_handover_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 timing_advance;
+} rr_mpal_handover_stop_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 is_freq_in_one_band;
+ starting_time_struct starting_time;
+ freq_params_struct freq_def;
+} rr_mpal_frequency_redefinition_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ channel_mode_enum ch_mode;
+ kal_uint8 dtx_allowed;
+#if defined (__AMR_SUPPORT__) || defined (__AMRWB_LINK_SUPPORT__)
+ rr_mpal_amr_req_struct rr_mpal_amr_para;
+#endif /* __AMR_SUPPORT__ || __AMRWB_LINK_SUPPORT__*/
+} rr_mpal_channel_mode_modify_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ cipher_setting_struct cipher_cmd;
+} rr_mpal_ciphering_mode_command_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_int8 loopback_type;
+} rr_mpal_close_tch_loop_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 device;
+} rr_mpal_dai_test_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 dtx_allowed;
+ kal_uint8 pwrc;
+} rr_mpal_cell_option_update_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 cause; /*current no use*/
+} rr_mpal_dedicated_channel_disconnect_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_int8 gsm450_power_class;
+ kal_int8 gsm480_power_class;
+ kal_int8 gsm850_power_class;
+ kal_int8 gsm900_power_class;
+ kal_int8 dcs_power_class;
+ kal_int8 pcs_power_class;
+ kal_int8 tx_pwr;
+ kal_int8 tx_pwr_pccch;
+ change_cause_enum change_cause;
+ /*Pop 090420 add for support to E2 in 8-PSK*/
+#ifdef __EPSK_TX__
+ kal_int8 gsm450_power_class_8psk;
+ kal_int8 gsm480_power_class_8psk;
+ kal_int8 gsm850_power_class_8psk;
+ kal_int8 gsm900_power_class_8psk;
+ kal_int8 dcs_power_class_8psk;
+ kal_int8 pcs_power_class_8psk;
+#endif
+#ifdef __GERAN_R6__
+ kal_int8 tx_pwr_LB;
+ kal_bool LB_valid;
+#endif /*__GERAN_R6__ */
+} rr_mpal_power_class_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ bcch_list_struct ext_meas_freq_list;
+} rr_mpal_extended_meas_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ nbr_meas_mode_enum meas_mode;
+ kal_uint8 is_ba_list_valid;
+ bcch_list_struct ba_list;
+} rr_mpal_neighbor_meas_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 burst_access_id;
+#ifdef __PKT_EXT_MEAS__
+ kal_uint8 is_for_extended_meas;
+#endif
+ kal_uint8 list_len;
+ neighbor_bsic_acquisition_struct neighbor_bsic_acquisition_list[33];
+
+#ifdef __GEMINI__
+ kal_uint32 fb_decode_interval; //used in PLMN List tunning, 0: invalid, other values in frame.
+#endif /* __GEMINI__*/
+#ifdef __GEMINI_WCDMA__
+ kal_bool is_plmn_list;
+#endif /* __GEMINI_WCDMA__*/
+} rr_mpal_neighbor_bsic_start_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+#ifdef __PKT_EXT_MEAS__
+ kal_uint8 is_for_extended_meas;
+#endif
+ kal_uint8 list_len;
+ kal_uint16 neighbor_bsic_acquisition_stop_list[33];
+} rr_mpal_neighbor_bsic_stop_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ neighbor_bcch_acquisition_struct nbcch_acquisition_list[1];
+ kal_uint8 is_prior_to_pdtch_rx;
+#ifdef __GEMINI_WCDMA__
+ kal_bool is_plmn_list;
+#endif /* __GEMINI_WCDMA__*/
+} rr_mpal_neighbor_sys_info_read_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 list_len;
+ kal_uint16 nbcch_acquisition_stop_list[1];
+ kal_uint8 manual_list; /* 1: stop the manual list, 0: stop the neighbor list */
+} rr_mpal_neighbor_sys_info_stop_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 burst_access_id;
+ kal_uint8 list_len;
+ cell_bsic_acquisition_struct cell_bsic_acquisition_list[33];
+
+ /* Used in PLMN list and 4G->2G meas/resel in virtual mode */
+ kal_uint32 fb_decode_interval; //used in PLMN List tunning, 0: invalid, other values in frame.
+#ifdef __GEMINI_WCDMA__
+ kal_bool is_plmn_list;
+#endif /*__GEMINI_WCDMA__*/
+} rr_mpal_cell_bsic_start_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+} rr_mpal_cell_bsic_stop_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ cell_bcch_acquisition_struct cell_bcch_acquisition_list[1];
+#ifdef __GEMINI_WCDMA__
+ kal_bool is_plmn_list;
+#endif /* __GEMINI_WCDMA__*/
+} rr_mpal_cell_sys_info_read_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 list_len;
+ kal_uint16 cell_bcch_acquisition_stop_list[1];
+} rr_mpal_cell_sys_info_stop_req_struct;
+
+/* 2013/1/2 James: new primitive to adjust prority */
+#ifdef __GEMINI__
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint16 arfcn;
+ kal_uint8 is_prior_to_acquire;
+} rr_mpal_cell_sys_info_pri_adjust_req_struct;
+#endif /* __GEMINI__ */
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 pb;
+ kal_uint8 timeslot_alloc;
+ freq_params_struct freq_params;
+ kal_uint8 bs_pbcch_blks;
+ kal_uint8 psi1_repeat_period;
+ kal_uint8 psi_count_hr;
+#ifdef __PS_SERVICE__
+ psi_mode_enum psi_reading_mode;
+#else
+ kal_uint8 psi_reading_mode;
+#endif
+} rr_mpal_monitor_pbcch_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ freq_params_struct freq_params;
+ kal_uint8 timeslot_alloc;
+ pwr_ctrl_params_struct pwr_ctrl_params;
+ kal_uint16 imsi_mod_1000;
+ kal_uint16 split_pg_cycle;
+ kal_uint16 kcn;
+ kal_uint8 bs_pag_blks_res;
+ kal_uint8 bs_pbcch_blks;
+} rr_mpal_monitor_pccch_req_struct;
+
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint16 c0_arfcn;
+ kal_uint8 pb;
+ kal_uint8 timeslot_alloc;
+ freq_params_struct freq_params;
+ kal_uint8 bs_pbcch_blks;
+ kal_uint8 psi1_repeat_period;
+#ifdef __PS_SERVICE__
+ psi_mode_enum psi_reading_mode;
+#else
+ kal_uint8 psi_reading_mode;
+#endif
+ kal_int32 frame_offset;
+ kal_int32 ebit_offset;
+} rr_mpal_ncell_pbcch_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 nc_reporting_period_i;
+ kal_uint8 nc_reporting_period_t;
+} rr_mpal_nc_measurement_req_struct;
+
+#ifdef __PKT_EXT_MEAS__
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 list_len;
+ kal_uint16 ext_freq_list[32];
+} rr_mpal_pkt_ext_measurement_req_struct;
+#endif /*__PKT_EXT_MEAS__*/
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 carrier_ref;
+ freq_params_struct freq_params;
+ kal_uint8 ts_allocation;
+} rr_mpal_int_measurement_req_struct;
+
+
+ typedef struct {
+ LOCAL_PARA_HDR
+ freq_params_struct freq_params;
+ pkt_timing_adv_struct pkt_timing_adv;
+ pwr_ctrl_params_struct pwr_ctrl_params;
+ dl_pwr_ctrl_struct dl_pwr_ctrl;
+ kal_uint8 is_ptcch_8bit_access;
+ #ifdef __EGPRS_MODE__
+ kal_bool is_egprs;
+ #endif
+ #ifdef __REL4__
+ kal_uint8 ext_utbf_nodata; /* 0: PUDCB must be sent (delayed uplink TBF not supported)
+ 1: PUDCB may not be sent (delayed uplink TBF supported) */
+ #endif /* __REL4__ */
+ kal_uint8 ul_tbf_bitmap;
+ kal_uint8 dl_tbf_bitmap;
+ ul_tbf_params_struct ul_tbf_params[MAX_TBF_NUM];
+ dl_tbf_params_struct dl_tbf_params[MAX_TBF_NUM];
+} rr_mpal_pdtch_connect_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 type_of_allocation;
+ kal_uint8 identity;
+ kal_uint8 usf_granularity;
+ usf_value_struct usf[8];
+ kal_uint8 is_before_params_valid;
+ pdtch_ch_ctrl_struct pdtch_chan_params_before;
+ pdtch_ch_ctrl_struct pdtch_chan_params_after;
+ kal_uint8 direction;
+ kal_uint8 is_ul_nw_assign;
+ kal_uint8 is_dl_nw_assign;
+ kal_uint8 is_ptcch_8bit_access;
+} rr_mpal_pdch_assignment_req_struct;
+
+#ifdef __EGPRS_MODE__
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 egprs_loopback_on;
+ kal_uint8 mode_flag;
+} rr_mpal_egprs_loop_req_struct;
+#endif
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 no_rrbp_blks;
+ ul_rrbp_block_struct rrbp_blks[4];
+} rr_mpal_rrbp_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 no_ctrl_blks;
+ ul_ctrl_block_struct ctrl_blks[4];
+} rr_mpal_ctrl_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+#ifdef __PS_SERVICE__
+ block_type_enum type_of_block;
+#else
+ kal_uint8 type_of_block;
+#endif
+ kal_uint8 no_ul_blks;
+ ul_radio_blk_struct ul_blks[8];
+ kal_uint8 tbf_index;
+} rr_mpal_data_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 is_timing_adv_valid;
+ pkt_timing_adv_struct pkt_timing_adv;
+ kal_uint8 is_ptcch_8bit_access;
+ kal_uint8 is_pwr_ctrl_valid;
+ pwr_ctrl_params_struct pwr_ctrl_params;
+} rr_mpal_pkt_timing_adv_pwr_ctrl_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 ts_available;
+ kal_uint8 limit; /* 0: OLD, 1:ALL */
+} rr_mpal_pdch_release_req_struct;
+
+ typedef struct{
+ LOCAL_PARA_HDR
+ kal_bool is_all_tbf_rel;
+ kal_uint8 ul_tbf_bitmap;
+ kal_uint8 dl_tbf_bitmap;
+ kal_uint8 identity;/* add identity for L1 */
+ }rr_mpal_pdtch_disconn_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ ch_connect_ctrl_params_struct ch_desc;
+} rr_mpal_cbch_config_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 cbch_mode;
+ kal_bool high_priority_on_cbch;
+} rr_mpal_cbch_start_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 cbch_mode;
+} rr_mpal_cbch_stop_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_int32 num_skip;
+ kal_uint8 cbch_mode;
+} rr_mpal_cbch_skip_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 status;
+} rr_mpal_sim_ready_notify_req_struct;
+
+#ifdef __EGPRS_MODE__
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 tbf_resetIR;//the index of TBF to resetIR
+}rr_mpal_update_ir_reset_req_struct;
+#endif
+
+typedef struct {
+ LOCAL_PARA_HDR
+ channel_type_enum ch_type;
+ kal_uint8 is_bad_frame;
+#ifdef __REPEATED_ACCH__
+ kal_bool is_combined;
+#endif
+ kal_uint8 data[23];
+} mpal_rr_dedicated_data_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ channel_type_enum ch_type;
+ kal_uint8 is_bad_frame;
+#ifdef __REPEATED_ACCH__
+ kal_bool is_combined;
+#endif
+ kal_uint8 data[23];
+} mpal_rr_dedicated_data_callback_ind_struct;
+
+#if 0 //__UMTS_TDD128_MODE__
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#ifdef __REPEATED_ACCH__
+/* under construction !*/
+#endif /* __REPEATED_ACCH__ */
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#ifdef __REPEATED_ACCH__
+/* under construction !*/
+#endif /* __REPEATED_ACCH__ */
+/* under construction !*/
+#else
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 sap_id;
+ kal_bool is_signalling;
+ channel_type_enum ch_type;
+ kal_uint8 tch_type;
+#ifdef __REPEATED_ACCH__
+ kal_bool is_repetition;
+#endif /* __REPEATED_ACCH__ */
+} rr_mpal_dedicated_data_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 sap_id;
+ kal_bool is_signalling;
+ channel_type_enum ch_type;
+ kal_uint8 tch_type;
+#ifdef __REPEATED_ACCH__
+ kal_bool is_repetition;
+#endif /* __REPEATED_ACCH__ */
+} mpal_rr_dedicated_ready_to_send_ind_struct;
+#endif
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 sap_id;
+ channel_mode_enum ch_mode;
+ channel_type_enum ch_type;
+ kal_uint8 tch_type;
+} mpal_rr_dedicated_ready_to_send_callback_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool result;
+} rr_mpal_detect_paging_block_result_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ system_mode_enum system_mode;
+}rr_mpal_set_rat_service_req_struct;
+
+#if defined(__UMTS_RAT__) || defined(__LTE_RAT__)
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 list_ref;
+ ts_ir_gsm_cell_list gsm_cell_list;
+
+ /* This flag is used to indicate whether measurement period should be reset
+ * immediately (i.e., GAS measurement will be triggered for the first available
+ * gap from other RAT). In current design, the following rules should be followed.
+ * (1)If list_len != 0, this flag will be set as FALSE only if tmeas,gsm measurement
+ * is triggered when priority measurement is on-going (i.e., one
+ * of GSM cells hits priority reselection criteria for priority
+ * based measurement reselection). For other case, this flag should
+ * be set as TRUE. If any improvement is needed, the usage limitation
+ * for this flag should be confirmed with GL1's colleague.
+ * (2) If list_len == 0, this flag will alwyas be set as FALSE;
+ */
+ kal_bool is_meas_period_reset;
+
+ /* When this flag is set to TRUE, the standby measurement will be performed every T-meas without */
+ /* multiplying by N layers. So that there will be 2 measurement results within 10s OOS period, which */
+ /* increases the successful rate of finding a candidate during OOS */
+ kal_bool prohibit_apply_n_layer;
+ standby_gsm_meas_req_rat_enum request_rat;
+ te_ir_urrc_state umts_rrc_state;
+ te_ir_errc_state lte_rrc_state;
+#ifdef __TDD_DM_GAP_OPTIMIZATION__
+ kal_bool is_bsic_gap_valid;
+#endif /* __TDD_DM_GAP_OPTIMIZATION__ */
+#ifdef __LTE_RAT__
+ /*eas configures gas to make use of idle rf to decode bsic in order to speed up srvcc to geran*/
+ kal_bool is_auto_gap_valid;
+#endif
+ kal_int16 b2_threshold_in_qdbm; // pass the B2 threshold to GL1
+} rr_mpal_standby_gsm_meas_req_struct;
+
+#if defined(__23G_PRI_RESEL_SUPPORT__) || defined(__LTE_RAT__)
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 list_ref;
+ ts_ir_gsm_cell_list gsm_cell_list;
+ kal_uint16 period_in_second;
+ standby_gsm_meas_req_rat_enum request_rat;
+ te_ir_urrc_state umts_rrc_state;
+ te_ir_errc_state lte_rrc_state;
+} rr_mpal_standby_gsm_prio_meas_req_struct;
+#endif /* defined(__23G_PRI_RESEL_SUPPORT__) || defined(__LTE_RAT__) */
+
+typedef struct
+{
+ kal_uint16 arfcn;
+ kal_uint8 bsic_valid;
+ kal_int32 frame_offset;
+ kal_int32 ebit_offset;
+ kal_bool retry_FB_SB;
+ kal_uint32 time_stamp;
+ kal_bool is_enh_bsic_verify_used;
+} mpal_standby_gsm_bsic_read_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 list_len; /* The number of valid element in bsic_read_list */
+ mpal_standby_gsm_bsic_read_struct cell_bsic_list[STADNBY_GSM_MAX_BSIC_NUM]; /* The database for BSIC read */
+} rr_mpal_standby_gsm_bsic_read_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 list_len; /* The number of valid element in bsic_stop_list */
+ kal_uint16 stop_bsic_list[STADNBY_GSM_MAX_BSIC_NUM]; /* The database for BSIC stop */
+} rr_mpal_standby_gsm_bsic_stop_req_struct;
+
+
+#ifdef __LTE_RAT__
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 scan_id;
+ kal_uint16 arfcn;
+} rr_mpal_standby_gsm_report_cgi_search_rf_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 scan_id;
+} rr_mpal_standby_gsm_report_cgi_search_rf_stop_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 bsic_tid;
+ kal_uint16 arfcn;
+} rr_mpal_standby_gsm_report_cgi_bsic_start_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+} rr_mpal_standby_gsm_report_cgi_bsic_stop_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint16 arfcn;
+ kal_uint8 bsic;
+ kal_uint16 bcch_mask;
+ kal_int32 frame_offset;
+ kal_int32 ebit_offset;
+} rr_mpal_standby_gsm_report_cgi_sys_info_read_req_struct;
+
+typedef struct {
+ kal_uint8 ref_count;
+ kal_uint16 msg_len;
+} rr_mpal_standby_gsm_report_cgi_sys_info_stop_req_struct;
+#endif /* __LTE_RAT__ */
+
+/* make L1 keep the resource (gap) for next BSIC decoding activity */
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_standby_cell_bsic_res_required;
+} rr_mpal_standby_cell_bsic_res_req_struct;
+
+#endif /* defined(__UMTS_RAT__) || defined(__LTE_RAT__) */
+
+#ifdef __UMTS_RAT__
+#ifdef __UMTS_TDD128_MODE__
+typedef struct {
+ kal_uint8 ref_count;
+ kal_uint16 msg_len;
+ kal_bool high_priority;
+} rr_mpal_3g_search_priority_req_struct;
+#endif
+#endif /*__UMTS_RAT__ */
+
+#if defined(__GEMINI__)
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 sim_config_status;
+ kal_uint8 sim_insert_status;
+} rr_mpal_sim_status_update_req_struct;
+#endif
+
+#ifdef __GEMINI__
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint32 protected_channel;
+} rr_mpal_channel_protect_start_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ rsvas_sim_enum sim_in_transfer;
+} rr_mpal_virtual_suspend_req_struct;
+
+#endif/* end of __GEMINI__*/
+
+#ifdef __PS_SERVICE__
+#endif /* end of __PS_SERVICE__ */
+
+#ifndef __MTK_TARGET__
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 *no_rts_sent;
+ kal_uint8 *total_blks_sent;
+ kal_uint8 tbf_index;
+} rr_mpal_flush_req_struct;
+#endif
+
+#ifndef __MTK_TARGET__ /* for UT */
+#include "mph_types.h"
+typedef struct
+{
+ LOCAL_PARA_HDR
+ channel_type_enum ch_type;
+} mphc_ut_dl_data_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ channel_type_enum ch_type;
+ TChMode ch_mode;
+ LogChannel tch_type;
+#ifdef __PS_L1_DC_ARCH__
+ kal_uint32 ul_data_index;
+#endif /* __PS_L1_DC_ARCH__ */
+} mphc_ut_ul_data_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ channel_type_enum ch_type;
+ kal_bool is_bad_frame;
+ kal_uint8* downlink_data_ptr;
+#ifdef __REPEATED_ACCH__
+ kal_bool isCombinedACCh;
+#endif /*end of (__REPEATED_ACCH__) */
+} mpal_rr_ut_dl_data_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ channel_type_enum ch_type;
+ channel_type_enum tch_type;
+ kal_bool is_signalling;
+ kal_bool is_fill_frame;
+} mpal_rr_ut_ul_data_req_struct;
+#endif
+
+#endif
+
+
diff --git a/mcu/protocol/interface/general/rr2prr_struct.h b/mcu/protocol/interface/general/rr2prr_struct.h
new file mode 100644
index 0000000..454da9e
--- /dev/null
+++ b/mcu/protocol/interface/general/rr2prr_struct.h
@@ -0,0 +1,134 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+/*******************************************************************************
+ * Modification Notice:
+ * --------------------------
+ * This software is modified by MediaTek Inc. and the information contained
+ * herein is confidential. The software may not be copied and the information
+ * contained herein may not be used or disclosed except with the written
+ * permission of MediaTek Inc. (C) 2001
+ *
+ *******************************************************************************/
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * rr2prr_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *============================================================================
+ ****************************************************************************/
+
+#ifndef _RR2PRR_STRUCT_H
+#define _RR2PRR_STRUCT_H
+
+#include "mph_cs_def.h"
+
+#ifdef __GEMINI__
+
+typedef struct
+{
+ /* Please notify that this structure should be exactly the same as mpal_rr_Search_rf_cnf_struct. */
+ LOCAL_PARA_HDR
+ kal_uint8 scan_id;
+ kal_bool bcch_list_valid;
+ kal_int16 power_sum_in_quarter_dbm[MPH_MAX_POWER_SCAN_RESULTS_LEN]; /* Defined in mph_cs_msg.h */
+} rr_prr_rf_result_notify_req_struct;
+
+#ifdef __ADAPTIVE_PAGING_PERIOD_IN_UNACK_MODE__
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 multiple; /* Notify peer SIM to adjust paging period configured by RLC. */
+} rr_prr_adjust_paging_period_ind_struct;
+#endif /* __ADAPTIVE_PAGING_PERIOD_IN_UNACK_MODE__ */
+
+#endif /* __GEMINI__ */
+
+#endif
+
diff --git a/mcu/protocol/interface/general/rr2rrlp_struct.h b/mcu/protocol/interface/general/rr2rrlp_struct.h
new file mode 100644
index 0000000..4fd91be
--- /dev/null
+++ b/mcu/protocol/interface/general/rr2rrlp_struct.h
@@ -0,0 +1,175 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2006
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * rr2rrlp_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file contains SUPL task entry function.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *============================================================================
+ ****************************************************************************/
+
+#ifndef RR2RRLP_STRUCT_H
+#define RR2RRLP_STRUCT_H
+
+/* add RHR */
+#if 0
+/* under construction !*/
+#endif
+#include "l3_inc_enums.h"
+#include "kal_general_types.h"
+
+/*----------------------------------------------------------------------------*/
+/* GAS to RRLP */
+/*----------------------------------------------------------------------------*/
+
+typedef struct
+{
+ kal_uint16 mcc;
+ kal_uint16 mnc;
+ kal_uint16 lac;
+ kal_uint16 ci;
+ kal_uint8 nmr_idx; /* index to nmr_cell array */
+}rr_rrlp_cell_info_struct;
+
+typedef struct
+{
+ kal_uint16 arfcn;
+ kal_uint8 bsic;
+ kal_uint8 rx_lev;
+}rr_rrlp_nmr_cell_struct;
+
+typedef struct
+{
+ kal_uint8 nmr_cell_num; /* number of cell with nmr infor. */
+ rr_rrlp_nmr_cell_struct nmr_cell[15]; /* max reported cell number is defined to be 15 according to supl spec. */
+}rr_rrlp_nmr_struct;
+
+typedef struct
+{
+ kal_int32 reported_FN; /* current reported frame number */
+ rr_rrlp_cell_info_struct serv_info; /* serving cell information */
+ kal_uint8 ncell_num; /* neighbor cell number */
+ rr_rrlp_cell_info_struct ncell_info[6]; /* max allowed number of neighbor cell is defined to be 6 */
+ rr_rrlp_nmr_struct nmr; /* network measurement report infor => only valid for serving cell? */
+}rr_rrlp_cell_info_report_struct;
+
+#ifdef __AGPS_CONTROL_PLANE__
+typedef struct{
+ LOCAL_PARA_HDR
+ kal_bool more_to_send; /* more RRLP message would be sent continuous, for future use */
+ app_data_cr_enum cr_flag; /* distinguish command and response */
+ kal_uint16 arfcn;
+}gas_rrlp_data_ind_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ abort_rrlp_cause_enum abort_cause; /* notify RRLP if GPS chip should be disabled or not */
+}gas_rrlp_abort_ind_struct;
+#endif /* __AGPS_CONTROL_PLANE__ */
+/*----------------------------------------------------------------------------*/
+/* RRLP to GAS */
+/*----------------------------------------------------------------------------*/
+#ifdef __AGPS_CONTROL_PLANE__
+typedef struct{
+ LOCAL_PARA_HDR
+ kal_uint8 mui;
+ kal_bool is_successful;
+}rrlp_gas_data_cnf_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ kal_uint8 mui;
+ kal_bool more_to_send; /* more RRLP message would be sent continuous */
+ app_data_cr_enum cr_flag; /* distinguish command or final response */
+ //kal_uint8 cr_flag; /* distinguish command or final response */
+}rrlp_gas_data_req_struct;
+#endif /* __AGPS_CONTROL_PLANE__ */
+
+#endif /* RR2RRLP_STRUCT_H */
diff --git a/mcu/protocol/interface/general/rr_common_def.h b/mcu/protocol/interface/general/rr_common_def.h
new file mode 100644
index 0000000..d864254
--- /dev/null
+++ b/mcu/protocol/interface/general/rr_common_def.h
@@ -0,0 +1,794 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * rr_common_def.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *------------------------------------------------------------------------------
+ * $Log$
+ *
+ * 05 31 2018 anurag.pancholi
+ * [MOLY00325228] [UMOLYE] Remove NVRAM group header file
+ * .
+ *
+ * 04 07 2017 anurag.pancholi
+ * [MOLY00239842] [SE2/SE3 internal][UMOLYA] SMP modifications : GAS, GL1
+ * .SMP Check-in To UMOLYA.
+ *
+ * 02 19 2016 yu-po.wang
+ * [MOLY00165413] [UMOLY] change the naming for TCM usage
+ * .
+ *
+ * 09 15 2015 chi-chung.lin
+ * [MOLY00141360] [GAS] LR11 build warning fix
+ * .
+ *
+ * 05 27 2015 titi.wu
+ * [MOLY00097502] SRVCC HO evaluation phase fail, trigger send SIP re-invite
+ * .
+ *
+ * 03 20 2015 yu-po.wang
+ * [MOLY00087619] [UMOLY][Universal Bin] GAS check in
+ * Let the shared data with DSP be 4 byte aligned.
+ *
+ * 01 26 2015 tsung-wei.tu
+ * [MOLY00087619] [UMOLY][Universal Bin] GAS check in
+ * .
+ *
+ * 01 12 2015 ming.lee
+ * [MOLY00087470] [Universal Bin] FDD GAS developement
+ * .
+ *
+ * 01 12 2015 ming.lee
+ * [MOLY00087470] [Universal Bin] FDD GAS developement
+ * .
+ *
+ * 01 12 2015 ming.lee
+ * [MOLY00087470] [Universal Bin] FDD GAS developement
+ * Fix link error.
+ *
+ * 01 05 2015 ming.lee
+ * [MOLY00087470] [Universal Bin] FDD GAS developement
+ * xxx_enums.h not included (code not synced between peng-an CBr and UMOLY)
+ *
+ * 11 13 2014 ming.lee
+ * [MOLY00080211] [MT6291_DEV][MT6291_UESIM_DEV] Check in low power to MT6291_DEV, MT6291_UESIM_DEV
+ * GISE Paging.
+ *
+ * 11 05 2014 ming.lee
+ * [MOLY00081154] [ATT_TMO_DEV] AT&T requirement merge back
+ * CSG fingerprint GAS part.
+ *
+ * 04 08 2014 yu-po.wang
+ * [MOLY00061711] [K2 MD2] Call for Checkin - [MPAL] reducing TCM usage for K2 MD2
+ *
+ * 03 17 2014 tangte.lo
+ * [MOLY00058655] Add PSI_13 message trace decode support in ELT
+ *
+ * 10 03 2013 jeremiah.lin
+ * [MOLY00040091] [MAC] MAC/ACS Peer Msg Decode
+ *
+ * 09 16 2013 henry.lai
+ * [MOLY00037661] [MT6290] GAS development for AFR, L1 measurement control, backup IR measurement mechanism, and meaurement report
+ * .
+ *
+ * 08 30 2013 katie.tseng
+ * [MOLY00035887] [3G Gemini2.0+][GAS] Limit PS access channel protect duration in Gemini 2.0 projects
+ * .
+ *
+ * 08 26 2013 james.chan
+ * [MOLY00031373] [MOLY][SM][MM][RLC][RR] UNITDATA_CNF mechanism modification
+ * .
+ *
+ * 04 29 2013 vend_rex.tung
+ * [MOLY00020542] [SystemService][MOLY] To remove useless input sections by the request
+ * [gas] Remove input section for input section central management
+ *
+ * 03 22 2013 vend_rex.tung
+ * [MOLY00012031] [MODIS] WR8 warning fix on MOLY branch
+ *
+ * 03 15 2013 henry.lai
+ * [MOLY00009222] [GAS][Multi-Mode Development] Merge GAS multi-mode development to MOLY
+ * .
+ *
+ * 01 23 2013 henry.lai
+ * [MOLY00009222] [GAS][Multi-Mode Development] Merge GAS multi-mode development to MOLY
+ * .
+ *
+ * 01 11 2013 henry.lai
+ * [Henry][Multi-Mode Development] GAS Development and R8 CR Sync
+ *
+ * 12 13 2012 katie.tseng
+ * [MOLY00007446] [MOLY] MOLY LOCAL_PARA_HDR/PEER_BUFF_HDR replacement
+ * .
+ *
+ * 08 14 2012 peter.chien
+ * [MOLY00002118] [PS1][GAS] Internal inject message test for MEAS IT
+ * .
+ *
+ * 08 14 2012 peter.chien
+ * [MOLY00002118] [PS1][GAS] Internal inject message test for MEAS IT
+ * .
+ *
+ * 05 22 2012 adeline.chang
+ * removed!
+ * .
+ *
+ * 05 17 2012 peter.chien
+ * .
+ *
+ * 04 17 2012 yiting.cheng
+ * removed!
+ * .
+ *
+ * 04 13 2012 henry.lai
+ * removed!
+ * .
+ *
+ * 04 13 2012 yiting.cheng
+ * removed!
+ * .
+ *
+ * 04 13 2012 yiting.cheng
+ * removed!
+ * .
+ *
+ * 04 12 2012 yiting.cheng
+ * removed!
+ * .
+ *
+ * 04 12 2012 henry.lai
+ * removed!
+ * .
+ *
+ * 03 07 2012 adeline.chang
+ * removed!
+ * .
+ *
+ * 01 11 2012 henry.lai
+ * removed!
+ * .
+ *
+ * 12 20 2011 henry.lai
+ * removed!
+ * .
+ *
+ * 09 21 2011 jeremiah.lin
+ * removed!
+ * .
+ *
+ * 12 14 2010 nancy.chang
+ * removed!
+ * .
+ *
+ * 10 27 2010 henry.lai
+ * removed!
+ * .
+ *
+ * 10 16 2010 nancy.chang
+ * removed!
+ * .
+ *
+ * 09 21 2010 evelyn.wang
+ * removed!
+ * .
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ * add to source control recursely
+ *
+ * removed!
+ * removed!
+ * Change rr to rr2.
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ * add IR HO related enums into tbf_rel_type_enum
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ * created by clearfsimport
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ * this is a temporary solution to remove the compile option MTK_KAL_MNT from MoDIS
+ *
+ ******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _RR_COMMON_DEF_H
+#define _RR_COMMON_DEF_H
+
+/* Nancy 20101005: Suggest Add for RHR */
+#include "kal_public_api.h"
+#include "kal_general_types.h"
+/* for MODEM_WARNING_MESSAGE macro */
+#include "event_info_utility.h"
+#include "nvram_editor_data_item.h"
+#include "rr_nvram_editor.h"
+#include "bitstream.h"
+#include "rr_common_enums.h"
+
+/******************************************************************************
+ * Constants
+ ******************************************************************************/
+#ifdef __MTK_INTERNAL__
+#ifndef __GAS_INTERNAL_IT__
+#define __GAS_INTERNAL_IT__
+#endif /* __GAS_INTERNAL_IT__ */
+#ifndef __GAS_INTERNAL_IR_IT__
+#define __GAS_INTERNAL_IR_IT__
+#endif /* __GAS_INTERNAL_IR_IT__ */
+#endif /* __MTK_INTERNAL__ */
+
+#define RLC_MAC_CTRL_BLK_SIZE 23
+
+/* Evelyn 20090415: Merge R6 */
+#define MULTIPLE_TBF_NUM 1
+
+/* Vincent: defined for RR-MPAL */
+
+#ifdef __PS_SERVICE__
+#define PKT_CELL_CHANGE_FAILURE_MSG 0x00
+
+/* RRBP response message types */
+#define PKT_CTRL_ACK_MSG 0x01 /* RRBP response to control messages */
+#define PKT_DL_CTRL_ACK_MSG 0x03 /* RRBP response to data block with FBI in RLC UNACK mode */
+#define PKT_DL_ACK_NACK_MSG 0x02 /* RRBP response to data block in RLC ACK mode */
+
+/*
+ * To indicate an RRBP responding to PUAN with FAI allowing for
+ * TBF-EST procedure should be sent later. The actual RRBP sent
+ * depends on whether RLC requests for TBF-EST and Control Ack Type
+ */
+#define PKT_CTRL_ACK_TBF_EST_MSG 0x04
+/* Claire 041216 change : Implement R99 PFI */
+#define RLC_MAC_INVALID_PFI 0xff
+
+#define PKT_UL_DUMMY_CTRL_BURST_MSG 0x03
+#define PKT_MEASUREMENT_REPORT_MSG 0x04
+#define PKT_RESOURCE_REQ_MSG 0x05
+#define PKT_MOBILE_TBF_STATUS_MSG 0x06
+#define PKT_PSI_STATUS_MSG 0x07
+#ifdef __EGPRS_MODE__
+#define EGPRS_PKT_DL_ACK_NACK_MSG 0x08
+#endif
+#define PKT_PAUSE_MSG 0x09
+#define ADDITIONAL_MS_RADIO_ACCESS_MSG 0x0b
+#define PKT_ENHANCED_MEASUREMENT_MSG 0x0a /* no error in standard */
+
+/* Byron: Add for PKT SI Status */
+#ifdef __GERAN_R4__
+#define PKT_SI_STATUS_MSG 0x0d /* no error in standard */
+#define PKT_CELL_CHANGE_NOTIFICATION_MSG 0x0c
+#endif
+
+/*
+ * Downlink Peer-to-Peer Messages.(Network --> Mobile Station)The
+ * * distribution messages start with 1 in their MSB and non-distribution
+ * * messages start with 0 in their MSB(v6.4.0 sec 11.1.1)
+ */
+#define PKT_ACCESS_REJECT_MSG 0x21
+#define PKT_CELL_CHANGE_ORDER_MSG 0x01
+#define PKT_DL_ASSIGNMENT_MSG 0x02
+#define PKT_MEASUREMENT_ORDER_MSG 0x03
+#define PKT_PAGING_REQ_MSG 0x22
+#define PKT_PDCH_RELEASE_MSG 0x23
+#define PKT_POLLING_REQ_MSG 0x04
+#define PKT_PWR_CTRL_TIMING_ADVANCE_MSG 0x05
+#define PKT_PRACH_PARAMS_MSG 0x24
+#define PKT_QUEUING_NOTIFICATION_MSG 0x06
+#define PKT_TIMESLOT_RECONFIG_MSG 0x07
+#define PKT_TBF_RELEASE_MSG 0x08
+#define PKT_TBF_RELEASE_UL_MSG 0xE8 /* To distinguish RRBP responding to PKT TBF RELEASE releasing UL TBF; see comment of rr_rrbp_resps_add() on date 030902 */
+#define PKT_TBF_RELEASE_DL_MSG 0xF8 /* To distinguish RRBP responding to PKT TBF RELEASE releasing DL TBF; see comment of rr_rrbp_resps_add() on date 030902 */
+#define PKT_UL_ACK_NACK_MSG 0x09
+#define PKT_UL_ASSIGNMENT_MSG 0x0a
+#define PKT_DL_DUMMY_CTRL_MSG 0x25
+#define PKT_INVALID_MSG 0xFF /* Exce 20040306: add invalid msg type for rr_check_nsend_rrbpresponse() */
+
+/* Lanslo 20070706: NACC */
+#ifdef __GERAN_R4__
+#define PKT_CELL_CHANGE_CONTINUE_MSG 0x0b
+#define PKT_NEIGH_CELL_DATA_MSG 0x0c
+#define PKT_SERV_CELL_DATA_MSG 0x0d
+#endif /* __GERAN_R4__ */
+
+/* Evelyn 20090415: Merge R6 */
+/* Evelyn MTBF */
+
+#define PS_HANDOVER_COMMAND_MSG 0x15
+
+#ifdef __GERAN_R6__
+#define PKT_SERV_CELL_SI_MSG 0x20
+#endif /* __GERAN_R6__ */
+
+#ifdef __ETWS_SUPPORT__
+#define PKT_APP_INFO_MSG 0x2d
+#endif
+
+/* PACKET SYSTEM INFORMATION Messages */
+#define PSI1_MSG 0x31
+#define PSI2_MSG 0x32
+#define PSI3_MSG 0x33
+#define PSI3_BIS_MSG 0x34
+#define PSI4_MSG 0x35
+#define PSI5_MSG 0x36
+#define PSI13_MSG 0x37
+
+#ifdef __GERAN_R4__
+#define PSI3_TER_MSG 0x3c
+#define PSI3_QUATER_MSG 0x3d
+#define PSI6_MSG 0x30
+#define PSI7_MSG 0x38
+#define PSI8_MSG 0x39
+#define PSI14_MSG 0x3a
+#define PSI15_MSG 0x3e
+#endif /* __GERAN_R4__ */
+
+#ifdef __GERAN_R5__
+#define PSI16_MSG 0x28
+#endif /* __GERAN_R5__ */
+
+#define ALL_PSI_MSGS 0x39
+
+#define MAX_TIMESLOTS 8
+/* Evelyn 20090905: Modify for High multislot class */
+#if defined (__MULTISLOT_CLASS_45__)
+#define MAX_TX_TIMESLOTS 6
+#define MAX_RX_TIMESLOTS 6
+#elif defined (__MULTISLOT_CLASS_34__)
+#define MAX_TX_TIMESLOTS 5
+#define MAX_RX_TIMESLOTS 5
+#else
+#define MAX_TX_TIMESLOTS 4
+#define MAX_RX_TIMESLOTS 4
+#endif
+
+#define RR_INVALID_FN_NUMBER 0xFFFFFFFF
+
+#define RR_INVALID_TN 0xFF /* Exce 20040310: add invalid timeslot number */
+#define RR_RTI_INVALID 0xFF /* Exce 20040310: add invalid RTI value */
+
+#define MPAL_RLC_CONTINUE_FLUSH_NEXT 0x1
+#define MPAL_RLC_CONTINUE_FLUSH_CURRENT 0x2
+#define MPAL_RLC_RESEG_CONTINUE_FLUSH_NEXT 0x3
+#define MPAL_RLC_RESEGMENT_CURRENT 0x4
+#endif /* __PS_SERVICE__ */
+
+/* Information Element Identifiers (IEI) for RR mesgs */
+/*****************************************************************************/
+#define MOBILE_IDENTITY_IEI 0x17
+#define STARTING_TIME_IEI 0x7c
+#define CELL_CHAN_DESC_IEI 0x62
+
+#define MULTISLOT_CONFIG_IEI 0x10
+#define CHAN_MODE_SET_1_IEI 0x63
+#define CHAN_MODE_SET_2_IEI 0x11
+#define CHAN_MODE_SET_3_IEI 0x13
+#define CHAN_MODE_SET_4_IEI 0x14
+#define CHAN_MODE_SET_5_IEI 0x15
+#define CHAN_MODE_SET_6_IEI 0x16
+#define CHAN_MODE_SET_7_IEI 0x17
+#define CHAN_MODE_SET_8_IEI 0x18
+
+#define SECOND_CHAN_MODE_IEI 0x66
+
+#define SECOND_CHAN_DESC_AFTER_TIME_IEI 0x64
+#define FREQ_LIST_AFTER_TIME_IEI 0x05
+#define MOB_ALLOC_AFTER_TIME_IEI 0x72
+#define MOB_ALLOC_IEI 0x72
+
+#define FREQ_LIST_BEFORE_TIME_IEI 0x19
+#define CHAN_DESC_BEFORE_TIME_IEI 0x1c
+#define FREQ_CHAN_SEQ_BEFORE_TIME_IEI 0x1e
+#define FREQ_CHAN_SEQ_AFTER_TIME_IEI 0x69
+#define MOB_ALLOC_BEFORE_TIME_IEI 0x21
+#define SECOND_CHAN_DESC_BEFORE_TIME_IEI 0x1d
+
+#define CIPHER_MODE_SETTING_IEI 0x90
+
+#define RR_PKT_UL_ASGN_IEI 0x22
+#define RR_PKT_DL_ASGN_IEI 0x23
+#define SYNC_IND_IEI 0x0d
+#define FREQ_SHORT_LIST_AFTER_TIME_IEI 0x02
+#define REAL_TIME_DIFFERENCE_IEI 0x7b
+#define TIMING_ADVANCE_IEI 0x7d
+#define FREQUENCY_SHORT_LIST_BEFORE_TIME_IEI 0x12
+#define MS_TIME_DIFF_IE 0x77
+#define VGCS_TARGET_MODE_IND_IEI 0x01
+#define MULTI_RATE_CONFIG_IEI 0x03
+
+#define RR_BA_RANGE_IEI 0x73
+#define RR_GROUP_CHANNEL_DESC_IEI 0x74
+#define RR_GROUP_CIPHER_KEY_NUM_IEI 0x80
+#define RR_GPRS_RESUME_IEI 0xc0
+#define RR_BA_LIST_PREF_IEI 0x75
+#define RR_UTRAN_FREQ_LIST_IEI 0x76
+#define RR_CELL_SELECTION_IND_IEI 0x77
+#define RR_ENH_DTM_CS_REL_IND_IEI 0xa0
+#define RR_VGCS_CIPHER_PARA_IEI 0x04
+#define RR_GROUP_CHANNEL_DESC_2_IEI 0x78
+#define RR_TALKER_IDENTITY_IEI 0x79
+#define RR_TALKER_PRIO_STATUS_IEI 0x7A
+#define RR_VGCS_AMR_CONFIG_IEI 0x7B
+#define RR_INDIVIDUAL_PRIORITIES_IEI 0x7c
+
+#define RR_CLASSMARK_ENQ_MASK_IEI 0x10
+/*****************************************************************************/
+
+#define RR_FAILURE 0x00
+#define RR_SUCCESS 0x01
+#define RR_VALID 0x01
+#define RR_INVALID_SYS_INFO_ID 0xff
+
+/* 3GPP TS 04.18 v 8.7.0 sec 10.5.2.38
+ * Calculation of start frame number.
+ */
+#define S_RR_FN_INTERVAL_42432 42432
+#define S_RR_FRAME_NUM_32024 32024
+#define S_RR_MOST_POSTIVE_DELAY 31623
+
+/* Claire 041208 change : Solve rr_mpal_data_req_struct header missing problem */
+#ifdef __EGPRS_MODE__
+#define EGPRS_RLC_MAC_HEADER_LEN 6
+#define EGPRS_SIZEOF_MCS1 22
+#endif /* __EGPRS_MODE__ */
+
+/* The following macros are defined in bits */
+#define MAC_HEADER_LEN 8
+#define RLC_MAC_MSG_TYPE_LEN 6
+#define TLLI_LEN 32
+
+/* Claire 050118 change : Add signaling macro for both RLC and MAC use */
+#define RR_IS_SIGNAL_PDU(cause) (cause == RR_CAUSE_GMM_SIGNALING || cause == RR_CAUSE_CELL_UPDATE || \
+ cause == RR_CAUSE_SM_SIGNALING || cause == RR_CAUSE_SND_SIGNALING \
+ || cause == RR_CAUSE_LLC_SIGNALING || cause == RR_CAUSE_PAGE_RESP || cause == RR_CAUSE_CELL_UPDATE_WITH_USER_DATA)
+
+#ifdef __ARMCC_VERSION
+#define __ZI__ __attribute__ ((zero_init))
+#else
+#define __ZI__
+#endif
+
+#ifdef __MTK_TARGET__
+#include "sys/cdefs.h" /* GCC has different definition for __section in cdefs.h */
+#undef __section /* undefined it to avoid re-define */
+#define __section(S) __attribute__ ((__section__(#S)))
+#define __SECONDARY_ROCODE__
+#define __SECONDARY_RODATA__ __section(SECONDARY_RODATA)
+#if defined(MT6752)
+#if defined(__MD2__)
+#define __INTERNCODE__
+#else
+#define __INTERNCODE__ __attribute__ ((section ("ISPRAM_ROCODE_CORE2")))
+#endif
+#else
+#define __INTERNCODE__
+#endif
+#define __EXTRAM_TXDATA__ __attribute__ ((section ("EXTRAM_TXDATA"), aligned(4))) __ZI__
+#define __EXTRAM_TXDATA_0__ __section(EXTRAM_TXDATA_0) __ZI__
+#else
+#define __SECONDARY_ROCODE__
+#define __SECONDARY_RODATA__
+#define __INTERNCODE__
+#define __EXTRAM_TXDATA__
+#define __EXTRAM_TXDATA_0__
+#endif
+
+
+#if defined(__MTK_TARGET__)
+#if defined (__ARMCC_VERSION)
+#define INLINE __inline
+#elif defined (__GNUC__)
+#define INLINE inline
+#endif /* ARMCC , GNUC */
+#else /* __MTK_TARGET__ */
+#define INLINE __inline
+#endif /* __MTK_TARGET__ */
+
+
+
+/******************************************************************************
+ * Enums Without Tags
+ ******************************************************************************/
+
+#ifdef __PS_SERVICE__
+#ifdef EGPRS
+#include "egprs_headers_struct.h"
+#endif
+#endif /* __PS_SERVICE__ */
+
+typedef kal_int32 TDMA_FRAME_NUMBER_TYPE;
+
+/******************************************************************************
+ * Structure Definition
+ ******************************************************************************/
+typedef struct
+{
+ kal_uint8 time_slot;
+ kal_uint32 tdma_frame_number;
+} ts_frame_no_struct;
+
+typedef struct
+{
+ kal_uint8 valid;
+ kal_uint8 t1;
+ kal_uint8 t2;
+ kal_uint8 t3;
+} STARTING_TIME_STRUCT_1;
+
+typedef struct
+{
+ kal_uint8 maio;
+ kal_uint8 ma_num_index;
+ kal_uint8 change_mark;
+ kal_uint8 hsn;
+} hopping_chan_desc;
+
+typedef struct
+{
+ kal_uint8 is_valid;
+ kal_uint8 pkt_or_ded;
+ kal_uint8 chan_type;
+ kal_uint8 tn;
+ kal_uint8 tsc;
+ rmc_tsc_set_type tsc_set;
+ ispresent hopp_or_non_hopp_tag;
+ union
+ {
+ kal_uint16 arfcn;
+ hopping_chan_desc hop_params;
+ } hopp_or_non_hopp_value;
+} channel_desc_struct;
+
+typedef struct
+{
+ kal_uint8 valid;
+ kal_uint8 value;
+} timing_advance_struct;
+
+typedef struct
+{
+ kal_uint16 arfcn;
+ kal_uint8 bsic;
+ kal_int32 frame_offset;
+ kal_int32 ebit_offset;
+} target_cell_timing_struct;
+
+#ifdef __PS_SERVICE__
+typedef struct res_req_struct
+{
+ /* Evelyn 20090415: Merge R6 */
+ kal_uint8 ptc; /* peak_throughput_class */
+ kal_uint8 rp; /* radio_priority */
+ kal_uint8 rlc_mode; /* rlc_mode_enum */
+ kal_uint8 llc_pdu_type; /* llc_pdu_type */
+ kal_uint8 res_req_cause; /* res_req_cause */
+ kal_uint16 rlc_octets;
+ kal_uint8 pfi; /* Claire 041216 change : Implement R99 PFI */
+ kal_uint8 modeflag; /* Simon for SRB */
+} res_req_struct;
+
+/* Evelyn 20090415: Merge R6 */
+/* Evelyn MTBF */
+
+
+typedef struct multiple_res_req_struct
+{
+ LOCAL_PARA_HDR
+ /* Katie 20130531: ps channel protect issue */
+ /* mac_rmpc_pkt_access_req_struct and multiple_res_req_struct are the same struct */
+ kal_uint8 is_protect_ps_channel; /* this variable only used in mac_rmpc_pkt_access_req_struct */
+ kal_uint8 no_res_req;
+ res_req_struct multi_res_req[MULTIPLE_TBF_NUM];
+} multiple_res_req_struct;
+
+#endif /* __PS_SERVICE__ */
+
+typedef union
+{
+ nvram_ef_gas_csg_fingerprint_struct gas_csg_fg_info;
+} rrm_struct_to_verify_union;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ rrm_struct_to_verify_union struct_to_verify;
+} rrm_verify_gv_for_ut_struct;
+
+
+/******************************************************************************
+ * Function Prototype definition
+ ******************************************************************************/
+extern kal_uint8 rr_get_spare_bit(bit_stream *bit_stream_ptr);
+extern kal_bool rr_validate_rest_bit_number(kal_uint32 rest_len, kal_uint32 len_to_be_decoded);
+#ifdef __ETWS_SUPPORT__
+extern void rr_decode_group_call_info(bit_stream *bs_ptr, kal_uint16 *length, kal_bool *result);
+extern void rr_decode_cell_global_count(bit_stream *bs_ptr, kal_uint16 *length, kal_bool *result);
+extern void rr_decode_mbms_freq_para_ie(bit_stream *bs_ptr, kal_uint16* length, kal_bool *result);
+extern void rr_decode_mbms_session_list_ie(bit_stream *bs_ptr, kal_uint16* length, kal_bool *result);
+extern void rr_decode_mbms_channel_para_ie(bit_stream *bs_ptr, kal_uint16* length, kal_bool *result);
+extern void rr_decode_mbms_para(bit_stream *bs_ptr, kal_uint16* length, kal_bool *result);
+#ifdef __PS_SERVICE__
+extern void rr_decode_page_info_struct(bit_stream *bs_ptr, kal_uint16 *length);
+extern void rr_decode_repeated_iu_page_info(bit_stream *bs_ptr, kal_uint16 *length);
+#endif /* __PS_SERVICE__ */
+#endif /* __ETWS_SUPPORT__ */
+
+#endif /* _RR_COMMON_DEF_H */
+
diff --git a/mcu/protocol/interface/general/rr_common_enums.h b/mcu/protocol/interface/general/rr_common_enums.h
new file mode 100644
index 0000000..e2b97fa
--- /dev/null
+++ b/mcu/protocol/interface/general/rr_common_enums.h
@@ -0,0 +1,2014 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/******************************************************************************
+ * Filename:
+ * ---------
+ * rr_common_enums.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *=============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *=============================================================================
+ ******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _RR_COMMON_ENUMS_H
+#define _RR_COMMON_ENUMS_H
+
+typedef enum
+{
+ RR_PSI_1_MSG_TYPE = 0x31,
+ RR_PSI_2_MSG_TYPE = 0x32,
+ RR_PSI_3_MSG_TYPE = 0x33,
+ RR_PSI_3_BIS_MSG_TYPE = 0x34,
+ RR_PSI_4_MSG_TYPE = 0x35,
+ RR_PSI_5_MSG_TYPE = 0x36,
+ RR_PSI_6_MSG_TYPE = 0x30,
+ RR_PSI_7_MSG_TYPE = 0x38,
+ RR_PSI_3_TER_MSG_TYPE = 0x3C,
+ RR_PSI_3_QUATER_MSG_TYPE = 0x3D,
+ RR_PSI_13_MSG_TYPE = 0x37,
+ RR_PSI_8_MSG_TYPE = 0x39,
+ RR_PSI_14_MSG_TYPE = 0x3a
+} rr_psi_msg_type;
+
+typedef enum
+{
+ PSI_NO_BANDINFO,
+ PSI_DCS1800,
+ PSI_PCS1900
+} band_indicator_enum;
+
+typedef enum
+{
+ /* Note that the sequence and the value of each item can't be changed because the
+ * content of pbcch_mode_mapping[] is designed according to this define value! */
+ PSI_POSITION_NONE = 0,
+ PSI_POSITION_PSI1 = 1,
+ PSI_POSITION_LR = 2,
+ PSI_POSITION_HR = 4,
+ PSI_POSITION_UNKNOWN = 8 /* default value for psi_position[] */
+} psi_position_enum;
+
+#ifdef __PS_SERVICE__
+/* enum for indicating hopping or non-hopping pbcch */
+typedef enum
+{
+ PSI_SI_NON_HOPPING_PBCCH,
+ PSI_SI_HOPPING_PBCCH
+}
+PBCCH_TYPE;
+#endif /* __PS_SERVICE__ */
+
+typedef enum
+{
+ SAPI0 = 0,
+ SAPI3 = 3
+} lapdm_sapi_header;
+
+typedef enum
+{
+ UNUSED_ESTB,
+ NORMAL_ESTB,
+ CORES_ESTB
+} LAPDM_ESTB_MODE;
+
+typedef enum
+{
+ UNUSED_REL,
+ NORMAL_REL,
+ LOCAL_END_REL,
+ ABNORMAL_REL
+} LAPDM_REL_MODE;
+
+typedef enum
+{
+ NORMAL_HEADER = 1,
+ SHORT_HEADER
+} lapdm_l2_header;
+
+typedef enum
+{
+ LOW_PRIO = 1,
+ NORMAL_PRIO,
+ HIGH_PRIO
+} lapdm_priority;
+
+#ifdef __AGPS_CONTROL_PLANE__
+typedef enum
+{
+ RRM_APDU_INITIAL_VALUE = 0, //inital value
+ RRM_APDU_SINGLE_MESSAGE = 1, // APDU without segment
+ RRM_APDU_FIRST_SEGMENT = 2, // APDU with first segment
+ RRM_APDU_MIDDLE_SEGMENT = 3, // APDU with middle segment
+ RRM_APDU_LAST_SEGMENT = 4, // APDU with last segment
+ RRM_NORMAL_LAYER3_MESG = 5 // Normal Layer3 message
+} lapdm_layer3_message_type_enum;
+
+#endif /* __AGPS_CONTROL_PLANE__ */
+
+typedef enum
+{
+ ERROR_NO = 1,
+ ERROR_TIMER_EXPD_N200_ABNORMAL_REL,
+ ERROR_RE_EST_REQ,
+ ERROR_UNSOL_UA,
+ ERROR_UNSOL_DM,
+ ERROR_UNSOL_DM_ESTD_STATE_ABNORMAL_REL,
+ ERROR_UNSOL_S_RESP,
+ ERROR_SEQ_ERROR_ABNORMAL_REL,
+ ERROR_U_INCORRECT_PARA,
+ ERROR_SHORT_L2_TYPE1_NOT_SUP,
+ ERROR_SHORTL2TYPE1_NOT_APP,
+ ERROR_S_INCORRECT_PARA,
+ ERROR_I_INCORRECT_M,
+ ERROR_I_INCORRECT_LEN,
+ ERROR_FRAME_NOT_IMPL,
+ ERROR_SABM_ESTD_STATE,
+ ERROR_SABM_INFO_NOT_ALL,
+ ERROR_SABM_INFO_MISMATCH,
+ ERROR_RADIO_LINK_FAILURE,
+ ERROR_SAPI0_NOT_ESTABLISHED,
+ ERROR_EXCEED_MAX_L3_LEN,
+ ERROR_SAPI3_NOT_ESTABLISHED
+ //ERROR_RCVD_NW_DISC
+} LAPDM_ERROR_CAUSE;
+
+/* Evelyn: R7 Latency Reducation Development */
+#ifdef __GERAN_RTTI__
+typedef enum
+{
+ RR_BTTI_MODE = 0,
+ RR_RTTI_MODE
+} tti_config_enum;
+typedef enum
+{
+ RR_BTTI_USF_MODE = 0,
+ RR_RTTI_USF_MODE
+} usf_mode_enum;
+#endif/* __GERAN_RTTI__ */
+
+#ifdef __GERAN_FANR__
+typedef enum
+{
+ RLC_NORMAL_POLLING = 0,
+ RLC_PAN_POLLING
+} rlc_polling_type_enum;
+#endif/* __GERAN_FANR__ */
+
+typedef enum
+{
+ ABSENT,
+ PRESENT
+} ispresent;
+
+typedef enum
+{
+ ZERO = 0,
+ ONE = 1,
+ TWO = 2,
+ THREE = 3
+} twobit;
+
+/* Prot Disc for RR mesgs */
+typedef enum
+{
+ RR_PD = 0x06,
+ SMS_PD = 0x09,
+ TEST_PD = 0x0f,
+ RESERV_PD = 0x0e
+} RR_PD_TYPE;
+
+typedef enum
+{
+ DEDICATED,
+ TBF
+} CHANNEL_RESOURCE_TYPE;
+
+typedef enum
+{
+ RMC_CHANNEL_DESCRIPTION_1,
+ RMC_CHANNEL_DESCRIPTION_2
+} CHANNEL_DESCRIPTION_TYPE;
+
+typedef enum
+{
+ RMC_TSC_SET_1,
+ RMC_TSC_SET_2
+} rmc_tsc_set_type;
+
+
+typedef enum
+{
+ NO_CIPHERING,
+ CIPHERING
+} CIPHERING_MODE_SETTING;
+
+typedef enum
+{
+ AFTER_BEFORE,
+ AFTER_ONLY,
+ OLD_CHANNEL_DESC
+} DED_CHAN_PARAMS;
+
+typedef enum
+{
+ CHAN_DESC1,
+ CHAN_DESC2
+} CHAN_DESC_IE_TYPE;
+
+typedef enum
+{
+ CN_ANY_CHAN,
+ CN_SDCCH,
+ CN_TCH_F,
+ CN_TCH_F_H
+} CHAN_NEEDED;
+
+typedef enum
+{
+ TWO_PHASE,
+ PAGE_RESPONSE,
+ CELL_UPDATE,
+ GMM_PROC,
+ SHORT_ACCESS,
+ ONE_PHASE,
+ MEAS_PROC,
+ CELL_CHANGE_FAILURE,
+#ifdef __EGPRS_MODE__
+ SIGNALLING,
+#endif
+ GSM_PROC /* Vincent add (for GSM) */
+} ACCESS_TYPE;
+
+/* Vincent */
+typedef enum
+{
+ SAPI_NOT_ESTABLISHED,
+ SAPI_ESTABLISHING,
+ SAPI_ESTABLISHED
+} sapi_status_enum;
+
+#ifdef __PS_SERVICE__
+typedef enum
+{
+ FREQUENCY_NOT_IMPLEMENTED,
+ NO_RESPONSE_ON_TARGET_CELL,
+ REJECT_ON_TARGET_CELL,
+ ON_GOING_CS_CONNECTION,
+ ANOYMOUS_ACCESS,
+ MS_GMM_STANDBY_STATE,
+ MS_GMM_FORCED_TO_STANDBY,
+ CELL_CHG_UNUSED_VALUE
+} cell_change_failure_cause_enum;
+
+typedef enum
+{
+ CELL_CHANGE_BSIC_SYNC_IN_PROGRESS,
+ CELL_CHANGE_ABORT_SUCCESS
+} CELL_CHANGE_ABORT_RESULT_ENUM;
+
+typedef enum
+{
+ PL_DATA_BLOCK,
+ PL_CTRL_BLOCK1,
+ PL_CTRL_BLOCK2,
+ PL_RESERVED
+} pay_load_type_enum;
+
+typedef enum
+{
+ ARFCN_TYPE = 0,
+ INDIRECT_ENCOD = 1,
+ DIRECT_ENCOD1 = 2,
+ DIRECT_ENCOD2 = 3
+} freq_enum;
+
+typedef enum
+{
+ MSID_GLOBALTFI = 0,
+ MSID_TLLI = 2,
+ MSID_TQI = 6,
+ MSID_PKTREQREF = 7
+} msid_enum;
+
+typedef enum
+{
+ MSID1_TLLI = 1,
+ MSID1_TQI = 6,
+ MSID1_PKTREQREF = 7,
+ MSID1_GLOBALTFI = 0
+} msid1_enum;
+
+typedef enum
+{
+ DYNAMIC = 1,
+ SINGLEBLK = 2,
+ EXTENSION = 0,
+ FIXED_TYPE = 3
+} challoc_enum;
+
+typedef enum
+{
+ TLLI1 = 0,
+ PKTREQREF1 = 2,
+ GLOBALTFI1 = 3
+} add_enum;
+
+typedef enum
+{
+ ACCESS_BURST_TYPE_8_BITS,
+ ACCESS_BURST_TYPE_11_BITS
+} access_burst_type_enum;
+
+typedef enum
+{
+ RLC_MAC_DATA_BLOCK,
+ CONTROL_BLOCK_WITHOUT_OPT_OCTETS,
+ CONTROL_BLOCK_WITH_OPT_OCTETS
+} blk_type_enum;
+
+/* Evelyn 20090415: Merge R6 */
+typedef enum
+{
+ PS_HO_TO_A_GB_PAYLOAD,
+ PS_HO_TO_UTRAN_PAYLOAD
+} ps_ho_payload;
+
+typedef enum
+{
+ PS_HO_RR_INFO
+} ps_ho_rr;
+
+/* Claire 050128 change : Implement EGPRS SRB mode */
+#ifdef __EGPRS_MODE__
+typedef enum
+{
+ EGPRS_SRB_LOOPBACK_ON_WITHOUT_OPT_OCTETS, /* 0x00 */
+ EGPRS_SRB_LOOPBACK_OFF_WITHOUT_OPT_OCTETS, /* 0x01 */
+ EGPRS_SRB_LOOPBACK_ON_WITH_OPT_OCTETS, /* 0x10 */
+ EGPRS_SRB_LOOPBACK_OFF_WITH_OPT_OCTETS /* 0x11 */
+} egprs_srb_blk_type_enum;
+#endif /* __EGPRS_MODE__ */
+
+typedef enum
+{
+ /****** SI ******/
+ SI_INFO_READY = 0, /* 0 */
+ SI_INFO_NOT_READY, /* 1 */
+ SI_INFO_NOT_READY_AS_CELL_SEL, /* 2 */
+ SI_INFO_NOT_READY_AS_LIMITED_SERVICE, /* 3 */
+ SI_INFO_NOT_READY_AS_NO_SERVICE, /* 4 */
+ SI_INFO_GPRS_TO_EGPRS, /* 5 */
+ SI_INFO_EGPRS_TO_GPRS, /* 6 */
+
+ /****** CS SERVICE ******/
+ RAND_ACCESS_FAILURE = 20, /* 20 */
+ ACCESS_NOT_ALLOWED, /* 21 */
+ GPRS_SUSPEND, /* 22 */
+ GPRS_RESUME_NOT_POSSIBLE, /* 23 */
+ GPRS_RESUME_POSSIBLE, /* 24 */
+ GPRS_RESUME_CS_ACCESS_FAIL, /* 25 */
+
+ /****** PS SERVICE ******/
+ TBF_ESTABLISHMENT_FAILURE = 40, /* 40 */
+ PAN_MAX_REINIT, /* 41 */
+ TBF_REL_NORMAL, /* 42 */
+ TBF_REL_ABNORMAL, /* 43 */
+ TBF_REL_RND_ACCESS, /* 44 */
+ TBF_REL_CELL_RESEL, /* 45 */
+ TBF_REL_RETURN_PCCCH, /* 46 */
+ TBF_REL_RETURN_SI, /* 47 */
+ TBF_REL_ACCESSREJECT_END, /* 48 */
+ TBF_REL_DETACH, /* 49 */
+ TBF_REL_NO_SIM, /* 50 */
+ TBF_REL_ATT_REJ, /* 51 */
+ TBF_REL_T3142_T3172_RUNING, /* 52 */
+ DL_SINGLE_BLOCK_PROC_IN_PROGRESS, /* 53 */
+ DL_SINGLE_BLOCK_PROC_END, /* 54 */
+ UL_SINGLE_BLOCK_PROC_IN_PROGRESS, /* 55 */
+ UL_SINGLE_BLOCK_PROC_END, /* 56 */
+ UL_SINGLE_BLOCK_PROC_FAIL, /* 57 */
+ RAU_PROC_BEGIN, /* 58 */
+ RAU_PROC_SUCCESS, /* 59 */
+ RAU_PROC_FAILURE, /* 60 */
+ TBF_REL_POWER_OFF, /* 61 */
+ TBF_EST_FAIL_WITH_RETURN_SI, /* 62 */
+ TBF_EST_FAIL_WITH_MAX_RETRY, /* 63 */
+#ifdef __TBF_EST__
+ TBF_REL_FOR_TBF_EST, /* 64 */
+#endif /* __TBF_EST__ */
+
+#ifdef __GEMINI__
+ RR_SUSPEND_DUAL_SIM, /* 65 */
+#endif /* __GEMINI__ */
+
+ TBF_REL_ACCESSREJECT_WAIT_IND, /* 67 */
+ TBF_REL_UNSOLICITED_FINAL_PUAN, /* 68 */
+
+ /****** CELL RESELECTION ******/
+ ABNORMAL_RESEL_BEGIN = 80, /* 80 */
+ /* If RPMC reselects back to original cell, ABNORMAL_RESEL_FAIL will be sent
+ * to prevent RLC clearing its signaling queue */
+ ABNORMAL_RESEL_FAIL, /* 81 */
+ /* Added for C2 and PCCO based resel scenarios */
+ C1_C2_RESEL_BEGIN, /* 82 */
+ C1_C2_RESEL_SUCCESS, /* 83 */
+ C1_C2_RESEL_FAIL, /* 84 */
+ C1_C2_RESEL_FAIL_GSM_CELL, /* 85 */
+ C31_C32_RESEL_BEGIN, /* 86 */
+ C31_C32_RESEL_SUCCESS, /* 87 */
+ C31_C32_RESEL_FAIL, /* 88 */
+ NW_CTRL_RESEL_BEGIN, /* 89 */
+ NW_CTRL_RESEL_FAIL, /* 90 */
+ NW_CTRL_RESEL_SUCCESS, /* 91 */
+ PCCO_RESEL_SUCCESS, /* 92 */
+ PCCO_RESEL_BEGIN, /* 93 */
+ PCCO_RESEL_FAIL, /* 94 */
+ PCCO_RESEL_INTERMEDIATE_SUCCESS, /* 95 */
+ PCCO_RESEL_INTERMEDIATE_FAIL, /* 96 */
+ /* ABNORMAL_RESEL_SUCCESS informs RLC to clear its signaling queue */
+ ABNORMAL_RESEL_SUCCESS, /* 97 */
+
+ /****** Iter-RAT CELL RESELECTION ******/
+ IR_RESEL_BEGIN = 120, /* 120 */
+ IR_RESEL_SUCCESS, /* 121 */
+ IR_RESEL_FAIL, /* 122 */
+ /* Byron: 2007/05/08: When CCO Activation time timer is running, can not do access */
+ TBF_REL_CCO_ACTIVATION_TIME_ONGOING, /* 123 */
+ /* Byron: 2007/05/28: To tell RLC the GSM RAT changes to standby */
+ IR_RAT_CHANGE_GSM_STANDBY, /* 124 */
+
+ /* brwang, 070205, to avoid RLC assert due to not paired RESUME_NOT_POSSIBLE */
+ /****** Iter-RAT HO ******/
+ IR_HO_BEGIN = 140, /* 140 */
+ IR_HO_TO_UTRAN, /* 141 */
+ IR_HO_FROM_UTRAN, /* 142 */
+
+ /* Evelyn 20090415: Merge R6 */
+
+ /* To Indicate VIRTUAL MODE to MAC */
+ RR_GEMINI_VIRTUAL, /* 144 */
+ /* To Indicate NORMAL MODE to MAC */
+ RR_GEMINI_NORMAL, /* 145 */
+ /*It is in virtual but can also trigger PS access*/
+ RR_GEMINI_VIRTUAL_ALLOW, /*146*/
+ MSPM_RF_OWNER_PRIORITY_CHANGE, /*147*/
+ TBF_REL_PKT_TBF_REL_ABNORMAL_MAX, /* 148 */
+ SI_INFO_NOT_READY_OUT_OF_DATE, /* 149 */
+ TOTAL_TBF_REL_TYPE_ENUM = 255 /* 255 */
+} tbf_rel_type_enum;
+
+typedef enum
+{
+ DYNAMIC_MODE,
+ EXT_DYNAMIC_MODE,
+ FIXED_WITHOUT_HALF_DUPLEX_MODE,
+ FIXED_WITH_HALF_DUPLEX_MODE,
+ SINGLE_BLOCK_WITHOUT_TBF,
+ SINGLE_BLOCK_FOR_TWO_PHASE,
+#ifdef __EGPRS_MODE__
+ MULTI_BLOCK_FOR_TWO_PHASE,
+#endif /* __EGPRS_MODE__ */
+ DYNAMIC_TEST_MODE,
+ EXT_DYNAMIC_TEST_MODE,
+ NO_MAC_MODE, /* MAC mode is not assigned by the Network, eg, downlink IMM ASSIGN */
+ TOTAL_MAC_MODE_ENUM
+} mac_mode_enum;
+
+/* Exce 030917: Add an invalid value for engineering mode */
+typedef enum
+{
+ CS1,
+ CS2,
+ CS3,
+ CS4,
+ /* Claire 041118 change : Modify MCS enums */
+#ifdef __EGPRS_MODE__
+ MCS1,
+ MCS2,
+ MCS3,
+ MCS4,
+ MCS5,
+ MCS6,
+ MCS7,
+ MCS8,
+ MCS9,
+ MCS5_7,
+ MCS6_9,
+#endif /* __EGPRS_MODE__ */
+
+/* Evelyn: R7 Latency Reducation Development */
+#ifdef __GERAN_RTTI__
+ MCS0,
+#endif /* __GERAN_RTTI__ */
+
+ CS_INVALID
+} gprs_cs_enum;
+
+/* Exce 20040116: `rrbp_mode' is to provide an interface to RMPC for adjusting PCA/PDAN/NB prority dynamically */
+typedef enum
+{
+ RRBP_MODE_NORMAL = 0,
+ RRBP_MODE_NB_PRIORITY_OVER_PDAN
+} rrbp_mode_enum;
+
+typedef enum
+{
+ PKT_ASSIGN,
+ IMM_PKT_ASSIGN,
+ PDCH_ASSIGN
+} pkt_assign_type_enum;
+
+#ifdef EGPRS
+#include "egprs_headers_struct.h"
+#endif
+
+#ifdef __EGPRS_MODE__
+
+typedef enum
+{
+ MODULATION_GMSK,
+ MODULATION_8PSK
+} MODULATION_TYPE;
+
+/* Claire 041118 change : Modify MCS enums */
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif /* 0 */
+
+typedef enum
+{
+ GPRS_TBF,
+ EGPRS_TBF
+} TBF_TYPE;
+
+#endif /* __EGPRS_MODE__ */
+
+/* Lanslo 20050801 Ref: 3GPP TS 04.60 V8.25.0 2004-09 */
+typedef enum
+{
+ /* --------------------------------------------------*/
+ /* Downlink RLC/MAC control messages */
+ /* --------------------------------------------------*/
+ RR__DL_MSG_TYPE_VALUE_0, /* 0 */
+ RR__PACKET_CELL_CHANGE_ORDER, /* 1 */
+ RR__PACKET_DOWNLINK_ASSIGNMENT, /* 2 */
+ RR__PACKET_MEASUREMENT_ORDER, /* 3 */
+ RR__PACKET_POLLING_REQUEST, /* 4 */
+ RR__PACKET_POWER_CONTROL_TIMING_ADVANCE, /* 5 */
+ RR__PACKET_QUEUEING_NOTIFICATION, /* 6 */
+ RR__PACKET_TIMESLOT_RECONFIGURE, /* 7 */
+ RR__PACKET_TBF_RELEASE, /* 8 */
+ RR__PACKET_UPLINK_ACK_NACK, /* 9 */
+ RR__PACKET_UPLINK_ASSIGNMENT, /* 10 */
+ RR__PKT_CELL_CHANGE_CONTINUE, /* 11 */
+ RR__PACKET_NEIGH_CELL_DATA, /* 12 */
+ RR__PACKET_SERV_CELL_DATA, /* 13 */
+ RR__DL_MSG_TYPE_VALUE_14, /* 14 */
+ RR__MTBF_DL_ASSIGNMENT, /* 15 */
+ RR__MTBF_UL_ASSIGNMENT, /* 16 */
+ RR__MTBF_TIMESLOT_RECONFIG, /* 17 */
+ RR__DL_MSG_TYPE_VALUE_18, /* 18 */
+ RR__DL_MSG_TYPE_VALUE_19, /* 19 */
+ RR__DL_MSG_TYPE_VALUE_20, /* 20 */
+ RR__PS_HANDOVER_COMMAND, /* 21 */
+ RR__PKT_PHYSICAL_INFO, /* 22 */
+ RR__DL_MSG_TYPE_VALUE_23, /* 23 */
+ RR__DL_MSG_TYPE_VALUE_24, /* 24 */
+ RR__DL_MSG_TYPE_VALUE_25, /* 25 */
+ RR__DL_MSG_TYPE_VALUE_26, /* 26 */
+ RR__DL_MSG_TYPE_VALUE_27, /* 27 */
+ RR__DL_MSG_TYPE_VALUE_28, /* 28 */
+ RR__DL_MSG_TYPE_VALUE_29, /* 29 */
+ RR__DL_MSG_TYPE_VALUE_30, /* 30 */
+ RR__DL_MSG_TYPE_VALUE_31, /* 31 */
+ RR__PACKET_SERV_CELL_SI, /* 32*/
+ RR__PACKET_ACCESS_REJECT, /* 33 */
+ RR__PACKET_PAGING_REQUEST, /* 34 */
+ RR__PACKET_PDCH_RELEASE, /* 35 */
+ RR__PACKET_PRACH_PARAMETERS, /* 36 */
+ RR__PACKET_DUMMY_CONTROL, /* 37 */
+ RR__DL_MSG_TYPE_VALUE_38, /* 38 */
+ RR__DL_MSG_TYPE_VALUE_39, /* 39 */
+ RR__PSI_16, /* 40 */
+ RR__DL_MSG_TYPE_VALUE_41, /* 41 */
+ RR__DL_MSG_TYPE_VALUE_42, /* 42 */
+ RR__DL_MSG_TYPE_VALUE_43, /* 43 */
+ RR__DL_MSG_TYPE_VALUE_44, /* 44 */
+ RR__PACKET_APPLICATION_INFO, /* 45 */
+ RR__DL_MSG_TYPE_VALUE_46, /* 46 */
+ RR__DL_MSG_TYPE_VALUE_47, /* 47 */
+ RR__PSI_6, /* 48 */
+ RR__PSI_1, /* 49 */
+ RR__PSI_2, /* 50 */
+ RR__PSI_3, /* 51 */
+ RR__PSI_3_bis, /* 52 */
+ RR__PSI_4, /* 53 */
+ RR__PSI_5, /* 54 */
+ RR__PSI_13, /* 55 */
+ RR__PSI_7, /* 56 */
+ RR__PSI_8, /* 57 */
+ RR__PSI_14, /* 58 */
+ RR__DL_MSG_TYPE_VALUE_59, /* 59 */
+ RR__PSI_3_ter, /* 60 */
+ RR__PSI_3_quater, /* 61 */
+ RR__PSI_15, /* 62 */
+ RR__DL_MSG_TYPE_VALUE_63 /* 63 */
+} rr_gprs_dl_peer_msg_name_enum;
+
+typedef enum
+{
+ /* --------------------------------------------------*/
+ /* Uplink RLC/MAC control messages (*/
+ /* --------------------------------------------------*/
+ RR__PACKET_CELL_CHANGE_FAILURE, /* 0 */
+ RR__PACKET_CONTROL_ACKNOWLEDGE, /* 1 */
+ RR__PACKET_DOWNLINK_ACK_NACK, /* 2 */
+ RR__PACKET_UL_DUMMY_CTRL, /* 3 */
+ RR__PACKET_MEASUREMENT_REPORT, /* 4 */
+ RR__PACKET_RESOURCE_REQUEST, /* 5 */
+ RR__PACKET_MOBILE_TBF_STATUS, /* 6 */
+ RR__PACKET_PSI_STATUS, /* 7 */
+ RR__EGPRS_PKT_DL_ACK_NACK, /* 8 */
+ RR__UL_MSG_TYPE_VALUE_9, /* 9 */
+ RR__PACKET_ENHANCED_MEASUREMENT_REPORT, /*0x0a */
+ RR__ADDITIONAL_MS_RADIO_ACCESS_CAP, /*0x0b */
+ RR__PACKET_CELL_CHANGE_NOTIFCATION, /*0x0c */
+ RR__PACKET_SI_STATUS /* 0x0d */
+} rr_gprs_ul_peer_msg_name_enum;
+
+/* Evelyn 20090415: Merge R6 */
+typedef enum
+{
+ FAILURE = 0,
+ SUCCESS
+} result_type_enum;
+
+typedef enum
+{
+ PMR_NC = 0 ,
+#ifdef __PKT_EXT_MEAS__
+ PMR_EXT ,
+#endif /* __PKT_EXT_MEAS__ */
+ PMR_ENH ,
+ PCCF,
+ PCCN,
+ PSS,
+ PPS
+} rmpc_mac_ctrl_msg_type_enum;
+
+typedef enum
+{
+ CS_PAGING = 0,
+ PCCO,
+ PMO,
+#ifdef __GERAN_R4__
+ PCCC,
+ PSCD,
+ PNCD,
+#endif /* __GERAN_R4__ */
+#ifdef __GERAN_R6__
+ PSCS,
+#endif /* __GERAN_R6__ */
+#ifndef __MTK_TARGET__
+ PSI_13_MSG,
+#endif /* __MTK_TARGET__ */
+ MAC_RMPC_CTRL_MSG_NUM
+}
+mac_rmpc_ctrl_msg_type_enum;
+
+/* Adeline: Relpace cs paging, PCCO, PMO, PCCC, PSCD, PNCD, PSCS */
+
+/* Katie 20130531: ps channel protect issue */
+typedef enum
+{
+ PROTECT_CHANNEL = 0,
+ NOT_PROTECT_CHANNEL
+} is_protect_ps_channel_type_enum;
+
+/* Simon20051222 for FLC2 */
+typedef enum
+{
+ GPRS_SAPI3_MEM,
+ GPRS_SAPI5_MEM,
+ GPRS_SAPI9_MEM,
+ GPRS_SAPI11_MEM,
+ GPRS_NUM_SAPIS,
+ GPRS_INVALID_SAPI
+} gprs_flc_sapi_type_enum;
+
+#endif /* __PS_SERVICE__ */
+
+typedef enum
+{
+ RR_ZERO_CELL = 0,
+ RR_ONE_CELL = 1,
+ RR_TWO_CELL = 2,
+ RR_THREE_CELL = 3,
+ RR_FOUR_CELL = 4,
+ RR_FIVE_CELL = 5,
+ RR_SIX_CELL = 6,
+ RR_SEVEN_CELL = 7,
+ RR_EIGHT_CELL = 8
+} rr_cell_num_enum;
+
+typedef enum
+{
+ RR_NO_PAGE_PENDING,
+ RR_CS_IMSI_PAGE_PENDING,
+ RR_CS_TMSI_PAGE_PENDING,
+ RR_PS_IMSI_PAGE_PENDING,
+ RR_PS_PTMSI_PAGE_PENDING
+} page_type_enum;
+
+typedef enum
+{
+ RR1 = 0,
+ RR2 = 1,
+ RR3 = 2,
+ RR4 = 3,
+ MAX_RR = 4
+} rr_current_cntx_ptr_enum;
+
+#ifdef __GEMINI__
+/* The current semaphore is owned by which module */
+typedef enum
+{
+ RR_OWNER_NONE,
+ RR_OWNER_OF_CNTX_1,
+ RR_OWNER_OF_CNTX_2
+} rr_semaphore_owner_enum;
+
+/* Is current PS session ongoing */
+typedef enum
+{
+ RR_PS_SESSION_NONE,
+ RR_PS_SESSION_ONGOING
+} rr_ps_session_enum;
+
+typedef enum
+{
+ RR_NONE_SERVICE,
+ RR_CS_SERVICE,
+ RR_TRANSFER_FROM_CS_TO_PS_SERVICE,
+ RR_PS_SERVICE,
+ RR_TRANSFER_FROM_PS_TO_CS_SERVICE,
+} rr_cs_ps_service_enum;
+
+typedef enum
+{
+ GAS_SEMA_RELEASE,
+ GAS_SEMA_OCCUPY,
+ GAS_SEMA_OCCUPY_DURING_ABORT
+} gas_sema_status_enum;
+
+
+typedef enum
+{
+ RR_GEMINI_NORMAL_MODE = 0,
+ RR_GEMINI_VIRTUAL_MODE = 1,
+ RR_GEMINI_SUSPEND_MODE = 2
+
+ , RR_GEMINI_VIRTUAL_CONNECTED_MODE = 3
+
+} rr_monitor_peer_paging_mode;
+
+
+#endif /* __GEMINI__ */
+
+typedef enum
+{
+ LIMITED_SERVICE,
+ NORMAL_SERVICE,
+ NO_PLMN_SERVICE
+} rr_service_type_enum;
+
+typedef enum
+{
+ RRM_RAT_GSM = 0,
+ RRM_RAT_UMTS = 1,
+ RRM_RAT_LTE = 2
+} rr_support_rat_enum;
+
+typedef enum
+{
+ QMSG_TYPE_SI2TER,
+ QMSG_TYPE_SI2Q,
+ QMSG_TYPE_SI2N,
+
+ QMSG_TYPE_PSI2,
+ QMSG_TYPE_PSI3BIS,
+ QMSG_TYPE_PSI3TER,
+ QMSG_TYPE_PSI3Q,
+ QMSG_TYPE_PSI5,
+
+ QMSG_TYPE_MI,
+ QMSG_TYPE_PMO,
+
+ QMSG_TYPE_PNCD_FOR_SI,
+ QMSG_TYPE_PNCD_FOR_PSI
+}
+queue_msg_type_enum;
+
+typedef enum
+{
+ QMSG_NOT_REQUIRED_ABNORAML = 0,
+ QMSG_NOT_REQUIRED_COMPLETE = 1,
+ QMSG_REQUIRED_FOR_DECODE = 2
+} QUEUE_STATUS_ENUM;
+
+typedef enum
+{
+ FORCE_SLEEP_IR_NULL = 0,
+
+ FORCE_SLEEP_XG2IR_SEND_ACTIVATE_CNF = 0x01,
+ FORCE_SLEEP_XG2IR_SEND_CHANGE_COMPLETE,
+ FORCE_SLEEP_XG2IR_REVERT_RAT_TO_INACTIVE,
+
+ FORCE_SLEEP_2GXIR_SET_RAT_TO_INACTIVE = 0x10,
+ FORCE_SLEEP_2GXIR_PENDING_ACTIVATE_CNF,
+ FORCE_SLEEP_2GXIR_FAIL_BSIC_SYNC,
+ FORCE_SLEEP_2GXIR_PENDING_CHANGE_COMPLETE,
+ FORCE_SLEEP_2GXIR_PEND_IR_MEAS_REQ,
+
+ FORCE_SLEEP_CGI_SCAN = 0x20,
+ FORCE_SLEEP_CGI_BSIC,
+ FORCE_SLEEP_CGI_SI,
+ FORCE_SLEEP_CGI_COMPLETE,
+} rr_force_sleep_during_2gir_enum;
+
+typedef enum
+{
+ RR_RTI_STATUS_INVALID, /* Note that this value is also responsible for TBF-EST procedure */
+ RR_RTI_STATUS_NO_MATCH,
+ RR_RTI_STATUS_FIRST_BLOCK,
+ RR_RTI_STATUS_MATCH
+} rr_rti_status_enum;
+
+typedef enum
+{
+ RR_NO_ERROR_MSG_RETURN,
+ RR_INCOMPATIBLE_STATE_MSG_RETURN,
+ RR_UNKNOWN_MSG_RETURN,
+ RR_DIST_PART_ERR_RETURN,
+ RR_ADDRESS_PART_ERR_RETURN,
+ RR_NON_DIST_PART_ERROR_RETURN,
+ RR_MSG_ESC_ERROR_RETURN,
+ RR_IGNORE_LABEL_ERR_RETURN,
+ RR_TRUNCATED_CONCACT_ERR_RETURN,
+ RR_PSI_INCONSISTENCE_RETURN,
+ RR_INSTANCE_NOT_COMPLETE
+} rr_msg_ret_result_enum;
+
+typedef enum
+{
+ RR_DL_BLK_INVALID,
+ RR_DL_BLK_INVALID_PAYLOAD_TYPE,
+ RR_DL_BLK_INVALID_RBSN_FS,
+ RR_DL_BLK_DATA_BLK,
+ RR_DL_BLK_CTRL_MSG_UNSGEMENTED, /* unsegemented control message */
+ RR_DL_BLK_CTRL_MSG_SEGMENTED, /* segmented control message, if returned pointer of rr_common_mpal_data_ind_hldr() is not NULL, then control message is concatenated */
+ RR_DL_BLK_CTRL_BLK_NOT_FOR_US,
+ RR_DL_BLK_CTRL_BLK_NON_CS1 /* Exce 20040210: To distinguish RLC/MAC control blocks with non-CS1 coding scheme. */
+} rr_dl_blk_type_enum;
+
+typedef enum
+{
+ RR_EM_TBF_IDLE,
+ RR_EM_TBF_PKT_ACCESS,
+ RR_EM_TBF_ONGOING,
+ RR_EM_TBF_UL_RELEASING,
+ RR_EM_TBF_DL_RELEASING_T3192,
+ RR_EM_TBF_DL_RELEASING_PKT_TBF_REL
+} rr_em_tbf_status_enum;
+
+// TODO: Refine these status may be necessary...
+typedef enum
+{
+ RR_EM_TBF_UL_INACTIVE,
+ RR_EM_TBF_UL_ACCESS,
+ RR_EM_TBF_UL_ACTIVE,
+ RR_EM_TBF_UL_INVALID
+} rr_em_tbf_status_ul_enum;
+
+typedef enum
+{
+ RR_EM_TBF_DL_INACTIVE,
+ RR_EM_TBF_DL_ACTIVE,
+ RR_EM_TBF_DL_REL_PEND,
+ RR_EM_TBF_DL_INVALID
+} rr_em_tbf_status_dl_enum;
+
+/************************ 3G & 4G Part ****************************************/
+
+typedef enum
+{
+ BARRED_CELL_OBJ,
+ BARRED_GROUP_CELL_OBJ,
+ BARRED_FREQ_OBJ
+} barred_obj_enum;
+
+typedef enum
+{
+ BARRED_CAUSE_REMOVED,
+ BARRED_CAUSE_ADDED
+} ir_bar_cause_action_enum;
+
+typedef enum
+{
+ IR_RESEL_MODE_RANKING = 0
+
+#if defined(__LTE_RAT__) || defined(__23G_PRI_RESEL_SUPPORT__)
+ , IR_RESEL_MODE_PRIORITY
+#endif /* defined(__LTE_RAT__) || defined(__23G_PRI_RESEL_SUPPORT__) */
+
+} ir_resel_mode_enum;
+
+typedef enum
+{
+ IR_RESEL_NO_CRITERIA_HIT = 0x00,
+ IR_RESEL_RANKING_CRITERIA_HIT = 0x01
+
+
+#if defined(__LTE_RAT__) || defined(__23G_PRI_RESEL_SUPPORT__)
+ , IR_RESEL_HIGH_PRIORITY_HIT = 0x10,
+ IR_RESEL_LOW_PRIORITY_HIT = 0x20,
+ IR_RESEL_ANY_PRIORITY_HIT = 0x40
+#endif /* defined(__LTE_RAT__) || defined(__23G_PRI_RESEL_SUPPORT__) */
+} ir_resel_criteria_hit_enum;
+
+typedef enum
+{
+ IR_RESEL_CRITERIA_CHECK_NOT_ALLOW_RAT_MODE_INVALID,
+ IR_RESEL_CRITERIA_CHECK_NOT_ALLOW_MEAS_STOPPED,
+ IR_RESEL_CRITERIA_CHECK_NOT_ALLOW_RRM_STATE_INVALID,
+ IR_RESEL_CRITERIA_CHECK_NOT_ALLOW_MS_IN_VIRTUAL_MODE,
+ IR_RESEL_CRITERIA_CHECK_NOT_ALLOW_MS_IN_NC2_MODE,
+ IR_RESEL_CRITERIA_CHECK_NOT_ALLOW_SYS_INFO_NOT_SENT,
+ IR_RESEL_CRITERIA_CHECK_NOT_ALLOW_SERV_RLA_INVALID,
+ IR_RESEL_CRITERIA_CHECK_NOT_ALLOW_RESEL_PARA_INVALID,
+ IR_RESEL_CRITERIA_CHECK_NOT_ALLOW_RAT_CAP_DISEABLED,
+ IR_RESEL_CRITERIA_CHECK_ALLOW
+} IR_RESEL_CRITERIA_CHECK_ALLOW_STATUS_ENUM;
+
+typedef enum
+{
+ IR_RESEL_WITH_BACKUP_RESULT_NOT_ALLOW,
+ IR_RESEL_WITH_BACKUP_RESULT_SUSPEND,
+ IR_RESEL_WITH_BACKUP_RESULT_ALLOW
+} IR_RESEL_WITH_BACKUP_RESULT_STATUS_ENUM;
+
+typedef enum{
+ IR_QSEARCH_CRITERIA_CHECK_PURPOSE_MEAS,
+ IR_QSEARCH_CRITERIA_CHECK_PURPOSE_REPORT
+} ir_qsearch_criteria_check_purpose_enum;
+
+typedef enum
+{
+ NO_INDIV_PRIO = 0,
+ NEW_INDIV_PRIO,
+ DEL_INDIV_PRIO
+} indiv_prio_action_enum;
+
+typedef enum
+{
+ INDIV_PRIO_SRC_CHL_REL,
+ INDIV_PRIO_SRC_PMO,
+ INDIV_PRIO_SRC_PCCO
+} indiv_prio_src_enum;
+
+typedef enum
+{
+ SERV_PRIO_SRC_INVALID,
+ SERV_PRIO_SRC_SI,
+ SERV_PRIO_SRC_PMO
+} serving_prio_src_enum;
+
+typedef enum{
+ NO_RPLMN,
+ NO_INDIVI_PRIO_STORE_IN_SCSI,
+ INDIVI_PRIO_NOT_BELONG_TO_EQ_PLMN_LIST,
+ MS_IN_ANY_CELL_STATE,
+ INVALID_INDIVI_PRIO_SET,
+ MS_NOT_CAMP_ON_CELL,
+ PCCO_NOT_SUCCESS,
+ INDIVI_PRIO_UPDATED_BY_NR_RAT
+}apply_indivi_prio_faill_cause_enum;
+
+typedef enum{
+ DEPRIO_NO_RPLMN,
+ DEPRIO_NO_INFO_IN_SCSI,
+ DEPRIO_MS_IN_ANY_CELL_STATE
+}apply_deprio_info_faill_cause_enum;
+
+typedef enum{
+ PRIO_COMMON = 0,
+ PRIO_COMMON_DEFAULT = 1,
+ PRIO_INDIVI = 2,
+ PRIO_INDIVI_DEFAULT = 3
+}prio_info_source_enum;
+
+typedef enum{
+ COMMON_PRIO_CHECK,
+ INDIVI_PRIO_CHECK
+} prio_info_check_src_enum;
+
+typedef enum
+{
+ CHECK_SEARCH_CSG_CELL_REQ_ALLOWED = 0,
+ CHECK_START_T_RESEL_TIMER_ALLOWED,
+ CHECK_EVALUATE_CSG_CELL_REQ_ALLOWED,
+ CHECK_ACTIVATE_CSG_CELL_ALLOWED
+} CHECK_PURPOSE;
+
+typedef enum
+{
+ REPORT_CGI_NULL_STATE,
+ REPORT_CGI_POWER_SCAN_STATE,
+ REPORT_CGI_BSIC_READ_STATE,
+ REPORT_CGI_SI_INFO_READ_STATE
+} report_cgi_state_enum;
+
+typedef enum
+{
+ REPORT_CGI_INFO_STATUS_NO_ERROR,
+ REPORT_CGI_INFO_STATUS_POWER_SCAN_ERROR,
+ REPORT_CGI_INFO_STATUS_BSIC_ERROR,
+ REPORT_CGI_INFO_STATUS_SI_INFO_ERROR
+} report_cgi_error_status_enum;
+
+/************************ 3G Only Part ****************************************/
+typedef enum
+{
+ UMTS_CARRIER = 0,
+ UMTS_CELL = 1
+} umts_carrier_or_cell_enum;
+
+typedef enum
+{
+ FROM_NW = 0,
+ FROM_MS = 1
+#ifdef __CMCC_STD_FR__
+ ,
+ FROM_FR = 2
+#endif
+} umts_from_nw_or_ms_enum;
+
+typedef enum
+{
+ UMTS_CELL_LIST_INVALID,
+ UMTS_CELL_LIST_FROM_SI2T,
+ UMTS_CELL_LIST_FROM_SI2Q,
+ UMTS_CELL_LIST_FROM_PSI3Q,
+ UMTS_CELL_LIST_FROM_PMO,
+ UMTS_CELL_LIST_FROM_MI,
+#if (defined(__UMTS_RAT__) && defined(__FDD_REDIRECTION__)) || defined(__UMTS_R6__)
+ /* ZY : R6 redirection */
+ UMTS_CELL_LIST_FROM_CH_REL,
+#endif /* (defined(__UMTS_RAT__) && defined(__FDD_REDIRECTION__)) || defined(__UMTS_R6__) */
+ UMTS_CELL_LIST_FROM_PCCO
+} umts_cell_list_src_enum;
+
+typedef enum
+{
+ UMTS_CARRIER_LIST_SRC_SI2TER,
+ UMTS_CARRIER_LIST_SRC_SI2Q
+} UMTS_CARRIER_LIST_SRC;
+
+typedef enum {
+ UMTS_REP_QUAN_RSCP,
+ UMTS_REP_QUAN_ECN0,
+ UMTS_REP_QUAN_RSSI
+} umts_rep_quan;
+
+typedef enum{
+ UCELL_SORT_PURPOSE_RESEL,
+ UCELL_SORT_PURPOSE_MEAS_REP,
+ UCELL_SORT_PURPOSE_PCCN_REP
+} ucell_sort_purpose_enum;
+
+typedef enum
+{
+ QSEARCH_I_TYPE,
+ QSEARCH_P_TYPE,
+ QSEARCH_C_TYPE,
+ QSEARCH_C_INIT_TYPE
+} umts_qsearch_value_type_enum;
+
+typedef enum{
+ UMTS_TOP_POWERFUL_CELL = 0,
+ UMTS_LOW_PRIORITY_CELL = 1,
+ UMTS_RESEL_CANDIDATE = 2,
+ UMTS_RESEL_TARGET = 3,
+ UMTS_CR3_BARRED_CELL = 4,
+ UMTS_CR3_UNBARRED_CELL = 5,
+ UMTS_BARRED_CELL_TIME = 6,
+ UMTS_UNBARRED_CELL = 7,
+ UMTS_TEMP_FAILURE_CELL_TIME = 8,
+ UMTS_UN_TEMP_FAILURE_CELL = 9
+}umts_trace_type_enum;
+
+typedef enum
+{
+ SI2Q_UMTS_INFO_EXIST_STATUS_UNKNOWN = 0,
+ SI2Q_UMTS_INFO_NOT_BROADCAST,
+ SI2Q_UMTS_INFO_NOT_AVAIL_Q_NOT_EXIST,
+ SI2Q_UMTS_INFO_NOT_AVAIL_Q_NOT_FULL_FACQ_NOT_DONE,
+ SI2Q_UMTS_INFO_PARTIAL_AVAIL_Q_NOT_FULL_FACQ_NOT_DONE,
+ SI2Q_UMTS_INFO_AVAIL_Q_NOT_EXIST,
+ SI2Q_UMTS_INFO_AVAIL_Q_NOT_FULL_FACQ_NOT_DONE,
+ SI2Q_UMTS_INFO_AVAIL_Q_NOT_FULL_FACQ_DONE,
+ SI2Q_UMTS_INFO_AVAIL_Q_FULL_FACQ_DONE,
+ SI2Q_UMTS_INFO_AVAIL_Q_FULL_FACQ_NOT_DONE
+} SI2Q_UMTS_INFO_RCVD_STATUS;
+
+typedef enum
+{
+ SI2T_UMTS_INFO_EXIST_STATUS_UNKNOWN = 0,
+ SI2T_UMTS_INFO_NOT_BROADCAST,
+ SI2T_UMTS_INFO_NOT_AVAIL_Q_NOT_EXIST,
+ SI2T_UMTS_INFO_NOT_AVAIL_Q_NOT_FULL,
+ SI2T_UMTS_INFO_PARTIAL_AVAIL_Q_NOT_FULL,
+ SI2T_UMTS_INFO_AVAIL_Q_NOT_EXIST,
+ SI2T_UMTS_INFO_AVAIL_Q_NOT_FULL,
+ SI2T_UMTS_INFO_AVAIL_Q_FULL
+} SI2T_UMTS_INFO_RCVD_STATUS;
+
+typedef enum
+{
+ MI_UMTS_INFO_NOT_AVAIL_Q_NOT_EXIST = 0,
+ MI_UMTS_INFO_NOT_AVAIL_Q_NOT_FULL_FACQ_NOT_DONE,
+ MI_UMTS_INFO_AVAIL_Q_NOT_EXIST,
+ MI_UMTS_INFO_AVAIL_Q_NOT_FULL_FACQ_NOT_DONE,
+ MI_UMTS_INFO_AVAIL_Q_NOT_FULL_FACQ_DONE,
+ MI_UMTS_INFO_AVAIL_Q_FULL_FACQ_DONE,
+ MI_UMTS_INFO_AVAIL_Q_FULL_FACQ_NOT_DONE
+} MI_UMTS_INFO_RCVD_STATUS;
+
+typedef enum
+{
+ PSI_UMTS_INFO_EXIST_STATUS_UNKNOWN = 0,
+ PSI_UMTS_INFO_BROADCAST,
+ PSI_UMTS_INFO_EXIST
+} PSI_UMTS_INFO_RCVD_STATUS;
+
+typedef enum
+{
+ UMTS_RANKING_RESEL_PARA_NO_RCVD = 0x00,
+ UMTS_RANKING_RESEL_PARA_QSEARCH_I_RCVD = 0x01
+#ifdef __UMTS_FDD_MODE__
+ , UMTS_RANKING_RESEL_PARA_FDD_Q_OFFSET_RCVD = 0x02
+ , UMTS_RANKING_RESEL_PARA_FDD_Q_MIN_RCVD = 0x04
+#ifdef __GERAN_R5__
+ , UMTS_RANKING_RESEL_PARA_FDD_Q_MIN_OFFSET_RCVD = 0x08
+ , UMTS_RANKING_RESEL_PARA_FDD_RSCP_MIN_RCVD = 0x10
+ , UMTS_RANKING_RESEL_PARA_FDD_ALL_RCVD_WO_3G_ADD_PARA = 0x07
+ , UMTS_RANKING_RESEL_PARA_FDD_ALL_RCVD = 0x1F
+#else /* __GERAN_R5__ */
+ , UMTS_RANKING_RESEL_PARA_FDD_ALL_RCVD = 0x07
+#endif /* __GERAN_R5__ */
+#endif /* __UMTS_FDD_MODE__ */
+#ifdef __UMTS_TDD128_MODE__
+ , UMTS_RANKING_RESEL_PARA_TDD_Q_OFFSET_RCVD = 0x22
+ , UMTS_RANKING_RESEL_PARA_TDD_ALL_RCVD = 0x23
+#endif /* __UMTS_TDD128_MODE__ */
+
+} UMTS_RANKING_RESEL_PARA_RCVD_STATUS;
+
+typedef enum
+{
+ UMTS_MEAS_LIST_NO_RCVD = 0,
+ UMTS_MEAS_LIST_PARIAL_RCVD,
+ UMTS_MEAS_LIST_ALL_RCVD
+} UMTS_MEAS_LIST_RCVD_STATUS;
+
+typedef enum
+{
+ WCDMA_PREFER_ALLOW = 0,
+ WCDMA_PREFER_NOT_ALLOW = 1,
+ WCDMA_PREFER_NOT_ALLOW_FOR_NW_CONTROL = 2
+} WCDMA_PREFER_STATUS_ENUM;
+
+typedef enum {
+ UMTS_sort_method_s_non_serving,
+ UMTS_sort_method_priority_n_s_non_serving
+} umts_prio_resel_sort_method_enum;
+
+/************************ 4G Only Part ****************************************/
+typedef enum{
+ LAI_UNKNOWN_AS_MM_LAI,
+ LAI_SAME_AS_MM_LAI,
+ LAI_DIFF_AS_MM_LAI
+} lte_lai_status_in_csfb_geran_si;
+
+typedef enum {
+ LTE_REP_QUAN_RSRP,
+ LTE_REP_QUAN_RSRQ,
+} lte_rep_quan_enum;
+
+typedef enum {
+ LTE_CS_3BIT_THRESHOLD,
+ LTE_CS_6BIT_THRESHOLD,
+ LTE_PS_6BIT_THRESHOLD
+} lte_rep_thres_src_enum;
+
+typedef enum
+{
+ LTE_SUITABILITY_CHECK_INVALID = 0,
+ LTE_RSRQ_SUITABILITY_CHECK,
+ LTE_RSRP_SUITABILITY_CHECK
+} lte_suitability_check_enum;
+
+typedef enum
+{
+ LTE_PARA_INVALID = 0,
+ LTE_PARA_FROM_SI2Q = 1,
+ LTE_PARA_FROM_MI = 2,
+ LTE_PARA_FROM_PMO = 3
+} lte_para_src_enum;
+
+typedef enum
+{
+ LTE_MEAS_LIST_NO_RCVD = 0,
+ LTE_MEAS_LIST_PARIAL_RCVD,
+ LTE_MEAS_LIST_ALL_RCVD
+} LTE_MEAS_LIST_RCVD_STATUS;
+
+typedef enum
+{
+ SI2Q_LTE_INFO_EXIST_STATUS_UNKNOWN = 0,
+ SI2Q_LTE_INFO_NOT_BROADCAST,
+ SI2Q_LTE_INFO_NOT_AVAIL_Q_NOT_EXIST,
+ SI2Q_LTE_INFO_NOT_AVAIL_Q_NOT_FULL_FACQ_NOT_DONE,
+ SI2Q_LTE_INFO_PARTIAL_AVAIL_Q_NOT_FULL_FACQ_NOT_DONE,
+ SI2Q_LTE_INFO_AVAIL_Q_NOT_EXIST,
+ SI2Q_LTE_INFO_AVAIL_Q_NOT_FULL_FACQ_NOT_DONE,
+ SI2Q_LTE_INFO_AVAIL_Q_NOT_FULL_FACQ_DONE,
+ SI2Q_LTE_INFO_AVAIL_Q_FULL_FACQ_DONE,
+ SI2Q_LTE_INFO_AVAIL_Q_FULL_FACQ_NOT_DONE
+} SI2Q_LTE_INFO_RCVD_STATUS;
+
+typedef enum{
+ LTE_TOP_POWERFUL_CELL = 0,
+ LTE_LOW_PRIORITY_CELL = 1,
+ LTE_RESEL_CANDIDATE = 2,
+ LTE_RESEL_TARGET = 3,
+ LTE_CR3_BARRED_CELL = 4,
+ LTE_CR3_UNBARRED_CELL = 5,
+ LTE_BARRED_CELL_TIME = 6,
+ LTE_UNBARRED_CELL = 7,
+ LTE_TEMP_FAILURE_CELL_TIME = 8,
+ LTE_UN_TEMP_FAILURE_CELL = 9
+} lte_trace_type_enum;
+
+typedef enum
+{
+ LTE_QSEARCH_TYPE_INVALID,
+ LTE_QSEARCH_C_INIT_TYPE,
+ LTE_QSEARCH_C_TYPE,
+ LTE_QSEARCH_P_TYPE
+} lte_qsearch_value_type_enum;
+
+typedef enum{
+ EUTRAN_CAP_UPDATE_HANDLE_NOT_ALLOW,
+ EUTRAN_CAP_UPDATE_HANDLE_ALLOW,
+ EUTRAN_CAP_UPDATE_HANDLE_SUSPEND
+} eutran_cap_update_handle_enum;
+
+typedef enum{
+ CAP_UPDATE_HANDLE_NOT_ALLOW,
+ CAP_UPDATE_HANDLE_ALLOW,
+ CAP_UPDATE_HANDLE_SUSPEND
+} cap_update_handle_enum;
+
+typedef enum
+{
+ LU_FOR_CSFB_SERVICE_NONE = 0,
+ LU_FOR_CSFB_MO_CALL_SERVICE = 1,
+ LU_FOR_CSFB_MO_SS_SERVICE = 2,
+ LU_FOR_CSFB_MO_LCS_SERVICE = 3,
+ LU_FOR_CSFB_MO_UNKNOWN_SERVICE = 4,
+ LU_FOR_CSFB_MT_CALL_SERVICE = 5,
+ LU_FOR_CSFB_MT_SS_SERVICE = 6,
+ LU_FOR_CSFB_MT_LCS_SERVICE = 7,
+ LU_FOR_CSFB_MT_UNKNOWN_SERVICE = 8
+} lu_for_csfb_service_type_enum;
+
+#if defined(__LTE_RAT__) || defined(__NR_RAT__)
+/*The abort reason for LTE/NR background search*/
+typedef enum
+{
+ ABORT_BY_LTE_RESEL_SUCCESS,
+ ABORT_BY_UMTS_RESEL_SUCCESS,
+ ABORT_BY_DEACTIVATE_REQ,
+ ABORT_BY_PLMN_SEARCH_REQ,
+ ABORT_BY_EUTRAN_UPDATE_REQ,
+ ABORT_BY_CELL_SEL,
+ ABORT_BY_CS_CALL,
+ ABORT_BY_LTE_MEAS,
+ ABORT_BY_MEAS_TICK,
+ ABORT_BY_GEMINI,
+ ABORT_BY_AFR,
+ ABORT_BY_NR_RESEL_SUCCESS,
+ ABORT_BY_NR_UPDATE_REQ,
+ ABORT_BY_CRITERIA_NOT_MEET
+} lte_bg_srch_abort_reason_enum,
+ bg_srch_abort_reason_enum;
+#endif /* defined(__LTE_RAT__) || defined(__NR_RAT__) */
+
+#if defined(__LTE_RAT__) || defined(__NR_RAT__)
+typedef enum
+{
+ START_MEAS_IND,
+ START_CSFB,
+ START_OTHERS
+}bg_start_enum;
+#endif /* defined(__LTE_RAT__) || defined(__NR_RAT__) */
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif /* 0 */
+
+#ifdef __PS_SERVICE__
+typedef enum
+{
+ COMPLETE,
+ PSI1_ONLY,
+ HR_ONLY,
+ LR_ONLY,
+ HR_AND_PSI1,
+ LR_AND_PSI1,
+ HR_AND_LR,
+ PSI1_B0_ONLY,
+ NO_PSI
+} psi_mode_enum;
+
+typedef enum
+{
+ INT_AS_REQUEST,
+ INT_NEW_TBF
+} int_meas_freq_enum;
+
+#endif /* __PS_SERVICE__ */
+
+typedef enum
+{
+ GSM_IDLE_MODE,
+ CCCH_PACKET_IDLE_MODE,
+ CS_ACCESS_WITH_PBCCH
+} rr_mode_enum;
+
+typedef enum
+{
+ GSM_MEAS_MODE,
+ GPRS_MEAS_MODE
+} nbr_meas_mode_enum;
+
+typedef enum
+{
+ MPAL_BOTH_CHANGE = 0,
+ MPAL_BOTH_CHANGE_PCCCH,
+ MPAL_POWER_CLASS_CHANGE,
+ MPAL_MS_TXPWR_CHANGE,
+ MPAL_MS_TXPWR_CHANGE_PCCCH
+} change_cause_enum;
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+typedef enum
+{
+ RR_GOOD_BLOCK = 0,
+ RR_BAD_BLOCK = 1,
+ RR_CONFLICT_WITH_SELF_CHANNEL = 2,
+
+ /* __GEMINI__ */
+ RR_SHARING_WITH_PEER_GSM_PCH = 3, /* channel sharing when conflict with peer-PCH */
+ RR_SHARING_WITH_PEER_GSM_BCCH = 4, /* channel sharing when conflict with peer-BCCH */
+
+ RR_CONFLICT_WITH_PEER_GSM_NBCCH = 5, /* channel conflict with peer-NBCCH */
+ RR_CONFLICT_WITH_PEER_GSM_PCH = 6, /* channel conflict with peer-PCH */
+ RR_CONFLICT_WITH_PEER_GSM_BCCH = 7, /* channel conflict with peer-BCCH */
+ RR_CONFLICT_WITH_PEER_GSM_OTHERS = 8, /* channel conflict with peer misc. channels */
+
+ /* __CDMA2000_RAT__ */
+ RR_CONFLICT_WITH_PEER_CDMA2000 = 9, /* channel conflict with high priority peer-C2K channels. */
+
+ /* __GEMINI__ + __UMTS_RAT__ */
+ RR_CONFLICT_WITH_PEER_UMTS_BCH_HIGH = 10, /* channel conflict with high priority peer-BCH */
+ RR_CONFLICT_WITH_PEER_UMTS_PICH = 11, /* channel conflict with peer-PICH */
+ RR_CONFLICT_WITH_PEER_UMTS_BCH_LOW = 12, /* channel conflict with low priority peer-BCH */
+ RR_CONFLICT_WITH_PEER_UMTS_OTHERS = 13, /* channel conflict with peer misc. channels */
+
+ /* __GEMINI__ + __LTE_RAT__ */
+ RR_CONFLICT_WITH_PEER_LTE_SRV_BCH = 14, /* channel conflict with peer-BCH */
+ RR_CONFLICT_WITH_PEER_LTE_NBCCH = 15, /* channel conflict with high priority peer-NBCCH */
+ RR_CONFLICT_WITH_PEER_LTE_PCH = 16, /* channel conflict with peer-PCH */
+ RR_CONFLICT_WITH_PEER_LTE_OTHERS = 17, /* channel conflict with peer misc. channels */
+
+ /* __GEMINI__ + __NR_RAT__ */
+ RR_CONFLICT_WITH_PEER_NR_SRV_BCH = 18, /* channel conflict with peer BCH */
+ RR_CONFLICT_WITH_PEER_NR_NBCCH = 19, /* channel conflict with peer NBCCH */
+ RR_CONFLICT_WITH_PEER_NR_PCH = 20, /* channel conflict with peer PCH */
+ RR_CONFLICT_WITH_PEER_NR_OTHERS = 21 /* channel conflict with peer misc channel */
+} rr_block_monitor_enum;
+
+typedef enum
+{
+ ONE_ACCESS_BURST_OF_TYPE_8_BITS,
+ ONE_ACCESS_BURST_OF_TYPE_11_BITS,
+ FOUR_ACCESS_BURST_OF_TYPE_8_BITS,
+ FOUR_ACCESS_BURST_OF_TYPE_11_BITS,
+ DUMMY_BURST,
+ NORMAL_CS_1_RADIO_BLK_BURST,
+ NORMAL_CS_2_RADIO_BLK_BURST,
+ NORMAL_CS_3_RADIO_BLK_BURST,
+ NORMAL_CS_4_RADIO_BLK_BURST,
+#ifdef __EGPRS_MODE__
+ NORMAL_MCS_1_RADIO_BLK_BURST,
+ NORMAL_MCS_2_RADIO_BLK_BURST,
+ NORMAL_MCS_3_RADIO_BLK_BURST,
+ NORMAL_MCS_4_RADIO_BLK_BURST,
+ NORMAL_MCS_5_RADIO_BLK_BURST,
+ NORMAL_MCS_6_RADIO_BLK_BURST,
+ NORMAL_MCS_7_RADIO_BLK_BURST,
+ NORMAL_MCS_8_RADIO_BLK_BURST,
+ NORMAL_MCS_9_RADIO_BLK_BURST,
+#endif /* __EGPRS_MODE__ */
+
+ NORMAL_BURST = NORMAL_CS_1_RADIO_BLK_BURST
+} burst_type_enum;
+
+#ifndef __EGPRS_MODE__
+typedef enum
+{
+ PRACH_REQ,
+ RACH_REQ
+} rach_req_type_enum;
+#else /* __EGPRS_MODE__ */
+typedef enum
+{
+ PRACH_REQ,
+ RACH_REQ,
+ E_PRACH_REQ,
+ E_RACH_REQ
+} rach_req_type_enum;
+#endif /* __EGPRS_MODE__ */
+
+#ifdef __EGPRS_MODE__
+typedef enum
+{
+ NONE_ATS,
+ TS1,
+ TS2
+} ats_type_enum;
+#endif /* __EGPRS_MODE__ */
+
+typedef enum
+{
+ ATC_MANDATORY = 0,
+ ATC_OPTIONAL
+} handover_atc_enum;
+
+typedef enum
+{
+ NO_ERROR,
+ TA_OUT_OF_RANGE, /* L1A set this cause in m11125.c */
+ T3124_TIMEOUT,
+ BLIND_HANDOVER_BSIC_INVALID
+} handover_fail_cause_enum;
+
+#ifdef __PS_SERVICE__
+
+typedef enum
+{
+ TBF_DL,
+ TBF_UL,
+ TBF_UL_DL,
+ NO_TBF
+} tbf_dir_enum;
+
+typedef enum
+{
+ RRBP_BLK,
+ CTRL_BLK,
+ DATA_BLK,
+ DUMMY_BLK
+} block_type_enum;
+
+typedef enum
+{
+ CH_CONNECT_IND_NOT_NEEDED,
+ CH_CONNECT_IND_NEEDED
+} ch_connect_ind_enum;
+#endif /* __PS_SERVICE__ */
+
+#ifdef __GEMINI__
+/* __GEMINI__, Gemini 2.0 */
+typedef enum{
+ PROTECT_CH_NONE = 0x0000,
+
+ /* CCCH: accesss proecedure */
+ PROTECT_CH_RACH = 0x0001,
+ PROTECT_CH_AGCH = 0x0002,
+ PROTECT_CH_PCH = 0x0004,
+ PROTECT_CH_CCCH = 0x0007, /* CCCH = RACH | AGCH | PCH, for access procedure */
+
+ /* FB+SB: PS HO, PCCO, IR CCO, IRCR */
+ PROTECT_CH_FBSB = 0x0008,
+
+ /* PCCCH: accesss proecedure */
+ PROTECT_CH_PRACH = 0x0010,
+ PROTECT_CH_PAGCH = 0x0020,
+ PROTECT_CH_PPCH = 0x0040,
+ PROTECT_CH_PCCCH = 0x0070, /* PCCCH = PRACH | PAGCH | PPCH, for access procedure */
+
+ /* POLLING RESPONSE timer: for accesss procedure */
+ PROTECT_CH_POLLRESP = 0x0080,
+
+ /* PTMCH: RAU or ATTACH proecedure */
+ PROTECT_CH_PDTCH = 0x0100,
+ PROTECT_CH_PACCH = 0x0200,
+ PROTECT_CH_PTCCH = 0x0400,
+ PROTECT_CH_PTMCH = 0x0700, /* PTMCH = PDTCH | PACCH | PTCCH, for RAU or GPRS attach procedure */
+
+ /* PACCH_SB: UL SB */
+ PROTECT_CH_ULSB = 0x0800,
+
+ /* (N)(P)BCCH: reseleciton proecudre */
+ PROTECT_CH_BCCH = 0x1000,
+ PROTECT_CH_NBCCH = 0x2000,
+ PROTECT_CH_PBCCH = 0x4000,
+ PROTECT_CH_NPBCCH = 0x8000,
+
+ /* MIX CHANNEL PROTECTION */
+ PROTECT_CH_CCCH_PTMCH = (PROTECT_CH_CCCH | PROTECT_CH_PTMCH), /* For one-phase in PS Session */
+ PROTECT_CH_FBSB_PTMCH = (PROTECT_CH_FBSB | PROTECT_CH_PTMCH), /* For Blind PS HO */
+ PROTECT_CH_CCCH_ULSB_PTMCH = (PROTECT_CH_CCCH | PROTECT_CH_ULSB | PROTECT_CH_PTMCH), /* For two-phase in PS Session */
+ PROTECT_CH_CCCH_ULSB = (PROTECT_CH_CCCH | PROTECT_CH_ULSB), /* For two-phase acesss */
+ PROTECT_CH_CCCH_ULSB_POLLRESP = (PROTECT_CH_CCCH | PROTECT_CH_ULSB | PROTECT_CH_POLLRESP) /* For acesss */
+} protect_channel_enum;
+/* end of __GEMINI__ */
+#endif /* __GEMINI__ */
+
+typedef enum
+{
+ RR_SPARE_BIT_L,
+ RR_SPARE_BIT_H
+}
+rr_spare_bit_enum;
+
+typedef enum
+{
+ RR_MSG_DECODE_SUCCESS,
+ RR_NO_ERROR,
+ RR_IGNORE_MSG,
+ RR_UNKNOWN_MSG_IN_ACK,
+ RR_MSG_IN_INCOMPATIBLE_STATE,
+ RR_SYNT_INCORRECT_MSG,
+ RR_UNKNOWN_IE_COMP_REQD,
+ RR_OUT_SEQ_IE_COMP_REQD,
+ RR_CONDITIONAL_IE_ERROR,
+ RR_SEM_INCORRECT_IE
+ /* brwang, 06/03/16, [MAUI_00179775] { */
+#ifdef __AMR_SUPPORT__
+ ,RR_INCONSISTENT_MULTIRATE
+#endif
+ /* brwang, 06/03/16, [MAUI_00179775] } */
+ /* brwang, 06/03/25, [MAUI_00182129] { */
+ ,RR_CH_MODE_NOT_SUPPORT
+ /* brwang, 06/03/25, [MAUI_00182129] } */
+ /* brwang, 20070205, [error handling of HO from UTRAN] { */
+ ,RR_CA_NOT_AVAILABLE
+ /* brwang, 20070205, [error handling of HO from UTRAN] } */
+ /* brwang, 20070408, to check if cipher mode setting is contained in HO from UTRAN */
+ ,RR_CIPHER_MODE_IE_NOT_RECEIVED
+ ,RR_CIPHER_STATUS_INCONSISTENT
+ ,RR_FREQ_NOT_IMPLEMENTED
+}
+rr_gsm_ret_code;
+
+#ifdef __NBR_CELL_INFO__
+typedef enum
+{
+ RR_NBR_CELL_INFO_IND,
+ RR_NBR_CELL_INFO_CNF
+}
+rr_nbr_cell_info_report_type;
+#endif /* __NBR_CELL_INFO__ */
+
+typedef enum
+{
+ TO_SRV_CELL_SI_CNTX = 0,
+ TO_NBR_TARGET_CELL_SI_CNTX = 1,
+ TO_SRV_CELL_PSI_CNTX = 2,
+ TO_MEAS_CNTX = 3,
+ TO_RMC_CNTX = 4
+} target_context_enum;
+
+typedef enum
+{
+ RMPC_OLD_CELL,
+ RMPC_NEW_CELL,
+ RMPC_INVALID_CELL
+} RMPC_CELL_SELECTION_TYPE;
+
+typedef enum
+{
+ RMPC_HPLMN_START,
+ RMPC_HPLMN_STOP
+} HPLMN_SRCH_TYPE;
+
+typedef enum
+{
+ SI_INFO_INVALID = 0,
+ SI_INFO_VALID
+}
+SI_INFO_TYPE;
+
+/* Claire 040407 change: Store SI13 row data when SI1 is not received yet */
+typedef enum
+{
+ SI_GROUP_NONE = 0,
+ SI_GROUP_SERVING_CELL,
+ SI_GROUP_TARGET_CELL
+}
+SI_GROUP_ID;
+
+typedef enum
+{
+ BA_STATE_NOT_COMPLETE,
+ BA_STATE_COMPLETE,
+ BA_STATE_FULL,
+ BA_STATE_FULL_PLUS_BSIC_INFO
+} BA_STATE_ENUM;
+
+#ifdef __GERAN_R6__
+typedef enum
+{
+ SI2N_NOT_SUPPORTED,
+ SI2N_ON_PACCH,
+ SI2N_ON_PACCH_AND_BCCH_NORM,
+ SI2N_ON_PACCH_AND_BCCH_EXT
+} SI2N_SUPPORT;
+#endif /* __GERAN_R6__ */
+
+typedef enum
+{
+ SERVICE_TYPE_GSM,
+ SERVICE_TYPE_GPRS
+} service_type_enum;
+
+typedef enum
+{
+ SI_DECODE_FAIL = 0,
+ SI_DECODE_SUCC = 1,
+ SI_NOT_COMPLETE = 2, /* only for SI2q and SI2n */
+ SI_QUEUED = 3 /* queued for waiting SI1 or SI2 */
+} SI_DECODE_STATUS_ENUM;
+
+typedef enum
+{
+ TC0,
+ TC1,
+ TC2,
+ TC3,
+ TC4,
+ TC5,
+ TC6,
+ TC7,
+ TC_NONE
+}
+tc_on_bcch_enum;
+
+typedef enum
+{
+ CBCH_CHAN_DESC = 0x64,
+ CBCH_MOBILE_ALLOC = 0x72
+} iei_enum_type;
+
+typedef enum
+{
+ BAR_REMOVE_NONE,
+ BAR_REMOVE_OTHER,
+ BAR_REMOVE_TIMEOUT,
+}
+bar_remove_enum;
+
+
+typedef enum
+{
+ BAR_TYPE_NONE,
+ BAR_TYPE_TEST,
+ BAR_TYPE_AUTHFAIL,
+ BAR_TYPE_REJ,
+ BAR_TYPE_RACHFAIL,
+ BAR_TYPE_FOREVER,
+}
+bar_type_enum;
+
+#if (defined(__MODEM_EM_MODE__) || defined(__SLIM_MODEM_EM_MODE__))
+typedef enum
+{
+ EM_TO_ELT, //replace EM_FROM_CATCHER
+ EM_TO_RMMI, /* tommy add for RMMI EM support */
+ EM_TO_BOTH,
+ EM_TO_NONE
+} em_dest_enum;
+#endif /* (defined(__MODEM_EM_MODE__) || defined(__SLIM_MODEM_EM_MODE__)) */
+
+typedef enum
+{
+ RRM_APC_FEATURE_TYPE_0, /*disable APC feature*/
+ RRM_APC_FEATURE_TYPE_MODE_I, /*APC feature mode I*/
+ RRM_APC_FEATURE_TYPE_MODE_II, /*APC feature mode II*/
+ RRM_APC_FEATURE_TYPE_MODE_III /*APC feature mode III for HW*/
+
+}apc_feature_type_enum;
+typedef enum
+{
+ RSSI_timer_STOP,
+ RSSI_timer_START,
+ RSSI_timer_EXPIRY
+}MD_only_elevator_mode_timer_status_enum;
+
+typedef enum
+{
+ LTE_timer_STOP,
+ LTE_timer_START,
+ LTE_timer_EXPIRY
+}MD_only_elevator_mode_LTE_cell_camping_check_timer_status_enum;
+
+#if defined(__NR_RAT__)
+typedef enum
+{
+ NR_timer_STOP,
+ NR_timer_START,
+ NR_timer_EXPIRY
+}MD_only_elevator_mode_NR_cell_camping_check_timer_status_enum;
+#endif
+
+typedef enum
+{
+ ELEVATOR_SEARCH_RAT_NONE,
+ ELEVATOR_SEARCH_RAT_NR,
+ ELEVATOR_SEARCH_RAT_LTE
+}elevator_search_rat_enum;
+
+
+#endif /* _RR_COMMON_ENUMS_H */
diff --git a/mcu/protocol/interface/general/rr_common_headers.h b/mcu/protocol/interface/general/rr_common_headers.h
new file mode 100644
index 0000000..f0587dd
--- /dev/null
+++ b/mcu/protocol/interface/general/rr_common_headers.h
@@ -0,0 +1,165 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * rr_common_headers.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *------------------------------------------------------------------------------
+ * $Log$
+ *
+ * 12 14 2010 nancy.chang
+ * removed!
+ * .
+ *
+ * 09 03 2010 sherry.kuo
+ * removed!
+ * disable fast resume
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ * add to source control recursely
+ *
+ * removed!
+ * removed!
+ * Change rr to rr2.
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ * created by clearfsimport
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ * remove compile option: TARGET_BUILD in MPAL and RMP
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ ******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _RR_COMMON_HEADERS_H
+#define _RR_COMMON_HEADERS_H
+
+/* Lucien 2006/01/08: Add definition while __UMTS_RAT__ is not defined */
+#ifndef __UMTS_RAT__
+#define U8 kal_uint8
+#define S8 kal_int8
+#define U16 kal_uint16
+#define S16 kal_int16
+#define U32 kal_uint32
+#define S32 kal_int32
+#endif /* __UMTS_RAT__ */
+
+#endif /* _RR_COMMON_HEADERS_H */
+
diff --git a/mcu/protocol/interface/general/rr_fdd.h b/mcu/protocol/interface/general/rr_fdd.h
new file mode 100644
index 0000000..595b47a
--- /dev/null
+++ b/mcu/protocol/interface/general/rr_fdd.h
@@ -0,0 +1,78 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/******************************************************************************
+ * Filename:
+ * ---------
+ * rr_fdd.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *=============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *=============================================================================
+ ******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _RR_FDD_H
+#define _RR_FDD_H
+
+#define mGAS(x) FDD_##x
+
+#endif /* _RR_FDD_H */
+
diff --git a/mcu/protocol/interface/general/rr_mpal_interface.h b/mcu/protocol/interface/general/rr_mpal_interface.h
new file mode 100644
index 0000000..54cd5b4
--- /dev/null
+++ b/mcu/protocol/interface/general/rr_mpal_interface.h
@@ -0,0 +1,359 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+ /*******************************************************************************
+ * Copyright Statement:
+ * --------------------
+ * This software is protected by Copyright and the information contained
+ * herein is confidential. The software may not be copied and the information
+ * contained herein may not be used or disclosed except with the written
+ * permission of MediaTek Inc. (C) 2002
+ *
+ *******************************************************************************/
+
+ /*******************************************************************************
+ * Filename:
+ * ---------
+ * rr_mpal_interface.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * MPAL-RR interface definition
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *------------------------------------------------------------------------------
+ * $Log$
+ *
+ * 01 22 2014 chi-chung.lin
+ * [MOLY00049161] [LTE Gemini] GAS code sync from Byron CBr to Dev
+ * .
+ *
+ * 11 06 2013 hamann.chang
+ * [MOLY00036515] [gas] design change for RLC/ MPAL flush
+ * .
+ *
+ * 01 23 2013 henry.lai
+ * [MOLY00009222] [GAS][Multi-Mode Development] Merge GAS multi-mode development to MOLY
+ * .
+ *
+ * 01 11 2013 henry.lai
+ * [Henry][Multi-Mode Development] GAS Development and R8 CR Sync
+ *
+ * 12 12 2012 ty.wang
+ * [MOLY00006932] Fix MoDIS build warning in WR8/MOLY
+ * .
+ *
+ * 12 03 2012 ty.wang
+ * [MOLY00006932] Fix MoDIS build warning in WR8/MOLY
+ * .
+ *
+ * 11 30 2012 ty.wang
+ * [MOLY00006932] Fix MoDIS build warning in WR8/MOLY
+ * .
+ *
+ * 11 30 2012 ty.wang
+ * [MOLY00006932] Fix MoDIS build warning in WR8/MOLY
+ * .
+ *
+ * 09 10 2012 ty.wang
+ * [MOLY00003373] [MAC/RLC/MPAL] Remove __NEW_TBF_ARCH__ from 2G RR on MOLY
+ * .
+ *
+ * 11 09 2011 stanleyhy.chen
+ * removed!
+ * .
+ *
+ * 06 09 2011 peter.chien
+ * removed!
+ * .
+ *
+ * 05 12 2011 henry.lai
+ * removed!
+ * .
+ *
+ * 03 02 2011 stanleyhy.chen
+ * removed!
+ * GEMINI2.0] ACS and MEAS parts
+ *
+ * 12 20 2010 rachel.liu
+ * removed!
+ * .
+ *
+ * 12 14 2010 nancy.chang
+ * removed!
+ * .
+ *
+ * 12 14 2010 sherry.kuo
+ * removed!
+ * .
+ *
+ * 12 02 2010 sherry.kuo
+ * removed!
+ * .
+ *
+ * 10 16 2010 nancy.chang
+ * removed!
+ * .
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ * add to source control recursely
+ *
+ * removed!
+ * removed!
+ * Change rr to rr2.
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ * created by clearfsimport
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ *******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _RR_MPAL_INTERFACE_H
+#define _RR_MPAL_INTERFACE_H
+
+/* Nancy 20101005: Suggest Add for RHR */
+#include "kal_general_types.h"
+
+#ifndef __MTK_TARGET__
+#include "kal_public_defs.h"
+#endif
+
+//#ifndef _RR_INTERFACE_H
+//#error "rr_interface.h should be included first"
+//#endif
+
+/******************************************************************************
+ * Constant
+ ******************************************************************************/
+#define ALGORITHM_A5_1 (1)
+#define ALGORITHM_A5_2 (2)
+#define ALGORITHM_A5_3 (3)
+#define ALGORITHM_A5_4 (4)
+#define ALGORITHM_A5_5 (5)
+#define ALGORITHM_A5_6 (6)
+#define ALGORITHM_A5_7 (7)
+
+#define TCH_LOOP_A (0)
+#define TCH_LOOP_B (1)
+#define TCH_LOOP_C (2)
+#define TCH_LOOP_D (3)
+#define TCH_LOOP_E (4)
+#define TCH_LOOP_F (5)
+#define TCH_LOOP_I (6)
+
+#define DAI_TEST_NORMAL (0)
+#define DAI_TEST_SPEECH_DEC_DTX (1)
+#define DAI_TEST_SPEECH_ENC_DTX (2)
+#define DAI_TEST_ACOUTIC_AD_DA (4)
+
+#define HANDOVER_L1_NO_ERROR (0)
+#define HANDOVER_L1_TA_OUT_OF_RANGE (1)
+
+#define HANDOVER_TYPE_PRE_SYNC (0)
+#define HANDOVER_TYPE_PSEUDO_SYNC (1)
+#define HANDOVER_TYPE_FINELY_SYNC (2)
+#define HANDOVER_TYPE_NON_SYNC (3)
+
+#define GSM_BLK_SIZE (23)
+#define MAX_NUM_OF_HOPPING_FREQ (64)
+#define MAX_BA_LIST_LEN (32)
+#define MAX_NEIGHBOR_ACUISITION_LIST_LEN (7)
+#define MAX_POWER_SCAN_RESULTS_LEN (200)
+#define MANUAL_SEL_SCAN_ID (128)
+
+#define BAND_PGSM900 (0x01)
+#define BAND_EGSM900 (0x02)
+#define BAND_RGSM900 (0x04)
+#define BAND_DCS1800 (0x08)
+#define BAND_PCS1900 (0x10)
+#define BAND_GSM450 (0x20)
+#define BAND_GSM480 (0x40)
+#define BAND_GSM850 (0x80)
+
+#define POWER_CLASS_1 (0)
+#define POWER_CLASS_2 (1)
+#define POWER_CLASS_3 (2)
+#define POWER_CLASS_4 (3)
+#define POWER_CLASS_5 (4)
+#define POWER_CLASS_INVALID (-1)
+
+#ifdef __PS_SERVICE__
+#define MPAL_MAX_UL_SLOTS (4)
+#define MPAL_MAX_DL_SLOTS (4)
+#define MPAL_DATA_Q_SIZE (2*MPAL_MAX_UL_SLOTS)
+#define MAX_EXT_MEAS_ARFCNS (32)
+#define MAX_ALLOC_BITMAP_LENGTH (36)
+#define MPAL_INVALID_FRAME_NO (0xffffffff)
+#endif /* __PS_SERVICE__ */
+
+#define MAX_TBF_NUM (1) //support 1 TBFs
+
+/******************************************************************************
+ * Enum Value
+ ******************************************************************************/
+
+/******************************************************************************
+ * Functional prototype
+ ******************************************************************************/
+
+#ifdef __PS_SERVICE__
+/******************************************************************************
+ * Function Name:
+ * mpal_rlc_flush_proc
+ * DESCRIPTION
+ * This function is provided by MPAL, and RR will call this function when the
+ * flush procedure starts. MPAL will flush the data blocks in its data queue,
+ * and transmit uplink dummy block before new data request is received from RR.
+ * In addition, MPAL will pass the necessary parameters to RR.
+*******************************************************************************/
+#ifdef __MTK_TARGET__
+extern void mpal_rlc_flush_proc(kal_uint8 *no_rts_sent, kal_uint8 *total_blks_sent, kal_uint8 tbf_index, kal_uint16 *frame_no_of_last_txed);
+extern void rlc_mpal_rlc_flush_proc(kal_uint8 *no_rts_sent, kal_uint8 *total_blks_sent, kal_uint16 *frame_no_of_last_txed);
+#else
+extern void mpal_rlc_flush_proc(ilm_struct *ilm_ptr);
+#endif
+
+
+
+#endif /* __PS_SERVICE__ */
+
+/******************************************************************************
+ * Structures generated by ASN files
+ ******************************************************************************/
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+#ifdef TEST_TOOL
+#include "tt_defs.h"
+#else
+#include "kal_public_api.h"
+#endif /* TEST_TOOL */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* _RR_MPAL_INTERFACE_H */
+
diff --git a/mcu/protocol/interface/general/rr_spare_bit.h b/mcu/protocol/interface/general/rr_spare_bit.h
new file mode 100644
index 0000000..9aef761
--- /dev/null
+++ b/mcu/protocol/interface/general/rr_spare_bit.h
@@ -0,0 +1,160 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * rr_spare_bit.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *------------------------------------------------------------------------------
+ * $Log$
+ *
+ * 11 13 2014 ming.lee
+ * [MOLY00080211] [MT6291_DEV][MT6291_UESIM_DEV] Check in low power to MT6291_DEV, MT6291_UESIM_DEV
+ * GISE Paging.
+ *
+ * 12 14 2010 nancy.chang
+ * removed!
+ * .
+ *
+ * 10 16 2010 nancy.chang
+ * removed!
+ * .
+ *
+ * 08 03 2010 nancy.chang
+ * removed!
+ * .
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ * add to source control recursely
+ *
+ * removed!
+ * removed!
+ * Change rr to rr2.
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ ******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _RR_SPARE_BIT_H
+#define _RR_SPARE_BIT_H
+
+/* Nancy 20101005: Suggest Add for RHR */
+#include "bitstream.h"
+#include "kal_general_types.h"
+#include "gas_gise_def.h"
+
+/************************
+Macros Without Parameters
+*************************/
+
+/*
+ * Description: The padding sequence is the repetition of octet 00101011,
+ * starting on an octet boundary.
+ *
+ * 3G TS 24.007 V3.3.1 sec: B.1.2.2
+ */
+
+/*****************
+Enums Without Tags
+******************/
+
+/*********************
+Macros With Parameters
+**********************/
+
+/* Macros used by pack and unpack functions */
+#define RR_SPARE_BIT_H_VALUE( bit_offset) \
+ (( ~S_RR_SPARE_OCTET_CNST >> (7-bit_offset)) & 0x01)
+#define RR_SPARE_BIT_L_VALUE( bit_offset) \
+ (( S_RR_SPARE_OCTET_CNST >> (7-bit_offset)) & 0x01)
+
+/***************************
+Exported Function Prototypes
+****************************/
+
+/* Functions to be used in code where pack and unpack is not used */
+extern kal_uint8 rr_get_spare_bit(bit_stream *bit_stream_ptr);
+
+#endif /* _RR_SPARE_BIT_H */
+
diff --git a/mcu/protocol/interface/general/rr_tdd.h b/mcu/protocol/interface/general/rr_tdd.h
new file mode 100644
index 0000000..9df4a0f
--- /dev/null
+++ b/mcu/protocol/interface/general/rr_tdd.h
@@ -0,0 +1,78 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/******************************************************************************
+ * Filename:
+ * ---------
+ * rr_tdd.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *=============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *=============================================================================
+ ******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _RR_TDD_H
+#define _RR_TDD_H
+
+#define mGAS(x) TDD_##x
+
+#endif /* _RR_TDD_H */
+
diff --git a/mcu/protocol/interface/general/rrm2rmpc_struct.h b/mcu/protocol/interface/general/rrm2rmpc_struct.h
new file mode 100644
index 0000000..ca213aa
--- /dev/null
+++ b/mcu/protocol/interface/general/rrm2rmpc_struct.h
@@ -0,0 +1,118 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * rrm2rmpc_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *============================================================================
+ ****************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _RRM2RMPC_STRUCT_H
+#define _RRM2RMPC_STRUCT_H
+
+#include "mcd_l3_inc_struct.h"
+
+typedef struct {
+ kal_uint8 valid;
+ kal_uint8 pb;
+ kal_uint8 tsc;
+ kal_uint8 tn;
+ kal_uint8 hopp_or_non_hopp;
+ kal_uint16 arfcn;
+ kal_uint8 maio;
+} pbcch_desc_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 access_type;
+ kal_uint16 arfcn;
+ pbcch_desc_struct pbcch_desc;
+ kal_uint8 is_hplmn_srch_reqd;
+ kal_uint8 old_or_new_cell;
+ kal_int16 serving_power_in_qdbm;
+ kal_uint8 ms_plmn_search_mode; /*Byron: 2005-03: for rmc to know the current ms plmn selection mode*/
+ kal_bool is_any_plmn; /*Byron: 2005-03: for rmc to know that if the ms should be in any plmn selection*/
+ kal_uint8 is_rplmn_valid; /*Byron: 2005-03: for rmc to know the if rplmn is valid for manual mode*/
+ plmn_id_struct rplmn; /*Byron: 2005-03: for rmc to know the current rplmn for manual mode*/
+} rrm_rmpc_cell_sel_done_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+} rrm_rmpc_start_hplmn_srch_timer_req_struct;
+#endif
+
diff --git a/mcu/protocol/interface/general/rrm_enums.h b/mcu/protocol/interface/general/rrm_enums.h
new file mode 100644
index 0000000..06797c6
--- /dev/null
+++ b/mcu/protocol/interface/general/rrm_enums.h
@@ -0,0 +1,1854 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/******************************************************************************
+ * Filename:
+ * ---------
+ * rrm_enums.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *=============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *=============================================================================
+ ******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _RRM_ENUMS_H
+#define _RRM_ENUMS_H
+
+/* new add RMC_TIMER enum */
+typedef enum
+{
+ RMC_T3162_TIMER_EXPIRY = 0,
+ RMC_T3178_TIMER_EXPIRY,
+ RMC_T3186_TIMER_EXPIRY,
+ RMC_T3170_TIMER_EXPIRY,
+ RMC_T3172_TIMER_EXPIRY,
+ RMC_T3174_TIMER_EXPIRY,
+ RMC_T3176_TIMER_EXPIRY,
+ RMC_SERV_CELL_SI_TIMER_EXPIRY,
+ RMC_PSI_SI_TIMER_EXPIRY,
+ /* Austin 040402: attempt to receive all PSI before packet access */
+ RMC_PSI_READING_TIMER_EXPIRY,
+ RMC_RESEL_PROCESS_TIMER_EXPIRY,
+
+ /* Adeline 2008.11.12 */
+#ifndef __GERAN_R5__
+ RMC_ABNOR_RESEL_PROCESS_TIMER_EXPIRY,
+#endif /* __GERAN_R5__ */
+ RMC_OLD_CELL_TIMER_EXPIRY,
+ RMC_MAC_TIMER_EXPIRY,
+ RMC_PENALTY_BASE_TIMER_EXPIRY,
+ RMC_LAST_RESEL_TIMER_EXPIRY,
+ RMC_NON_DRX_TIMER_EXPIRY,
+ RMC_NC_NON_DRX_TIMER_EXPIRY,
+ RMC_MM_NON_DRX_TIMER_EXPIRY,
+ RMC_T3200_TIMER_EXPIRY,
+ RMC_EMO_TIMER_EXPIRY,
+ RMC_T3142_TIMER_EXPIRY,
+ RMC_T3146_TIMER_EXPIRY,
+ RMC_TMA_TIMER_EXPIRY,
+
+#if defined(__UMTS_RAT__) || defined(__LTE_RAT__)
+ RMC_CCO_TIMER_EXPIRY,
+ RMC_WAITTIME_TIMER_EXPIRY,
+ RMC_STANDBY_GSM_EVAL_TIMER_EXPIRY,
+#endif /* defined(__UMTS_RAT__) || defined(__LTE_RAT__) */
+#ifdef __UMTS_RAT__
+ RMC_ACTIVATIOM_TIME_TIMER_EXPIRY,
+#if defined(__PREFER_HIGH_PRIO_3G_IN_23G_MODE__)
+ RMC_WAITTIME_TIMER2_EXPIRY,
+#endif /* __WCDMA_PREFERRED__ || __PREFER_HIGH_PRIO_3G_IN_23G_MODE__ */
+#endif /* __UMTS_RAT__ */
+#if defined(__LTE_RAT__) || defined(__23G_PRI_RESEL_SUPPORT__)
+ RMC_T3230_TIMER_EXPIRY,
+#endif /* defined(__LTE_RAT__) || defined(__23G_PRI_RESEL_SUPPORT__) */
+
+#ifdef __3G_CSG_SUPPORT__
+ RRM_UMTS_CSG_AUTO_SEARCH_TIMER_EXPIRY,
+ RRM_UMTS_CSG_CELL_EVALUATION_TIMER_EXPIRY,
+#endif /* __3G_CSG_SUPPORT__ */
+
+#ifdef __LTE_RAT__
+ RRM_LTE_CSG_AUTO_SEARCH_TIMER_EXPIRY,
+ RRM_LTE_CSG_CELL_EVALUATION_TIMER_EXPIRY,
+#endif /* __LTE_RAT__ */
+
+ /* __AUTH_FAIL_BAR_CELL__ */
+ RRM_BAR_CELL_TIMER_ID,
+
+ /* REDIRECTION */
+#if defined(__GERAN_R6__) || defined (__FDD_REDIRECTION__)
+ RCS_REDIRECTION_LIST_SEARCH_TIMER_ID,
+#endif /* defined(__GERAN_R6__) || defined (__FDD_REDIRECTION__) */
+ RCS_FULL_BAND_SEARCH_SEGMENTATION_TIMER_ID,
+#ifdef __GERAN_R6__
+ RMC_SI2N_TIMER_EXPIRY,
+#endif /* __GERAN_R6__ */
+
+ /* FAST RECOVERY */
+ RRM_FAST_RECOVERY_TIMER_ID,
+
+ /* ================ RMC-CSRR Part =============== */
+ RMC_T3122_TIMER_EXPIRY,
+ RMC_T3126_TIMER_EXPIRY,
+ RMC_REEST_TIMER_EXPIRY,
+
+#ifdef __AGPS_CONTROL_PLANE__
+ RMC_APDU_CHECK_TIMER_EXPIRY,
+#endif /* __AGPS_CONTROL_PLANE__ */
+
+#ifdef __ETWS_SUPPORT__
+ RMC_T3232_TIMER_EXPIRY,
+#endif /* __ETWS_SUPPORT__ */
+
+ /* William :20070619 : Add timer for NACC */
+#ifdef __GERAN_R4__
+ RMC_T3206_EXPIRY,
+ RMC_T3208_EXPIRY,
+ RMC_T3210_EXPIRY,
+ RMC_PSS_TIMER_EXPIRY,
+ RMC_PNCD0_TIMER_EXPIRY,
+ RMC_PNCD1_TIMER_EXPIRY,
+ RMC_PNCD2_TIMER_EXPIRY,
+ RMC_PNCD3_TIMER_EXPIRY,
+ // Chris, nacc_coding
+ RMC_PPS_TIMER_EXPIRY,
+#endif /* __GERAN_R4__ */
+
+#if defined(__LTE_RAT__) || defined(__UMTS_RAT__)
+ /* Event scheduler timer ID for IR barred info. */
+ RMC_IR_BARRED_BASE_TIMER_ID,
+#endif /* defined(__LTE_RAT__) || defined(__UMTS_RAT__) */
+
+#if defined(__LTE_RAT__) || defined(__NR_RAT__)
+/* __4G_BACKGROUND_SEARCH__ || __5G_BACKGROUND_SEARCH__ begin */
+ RMC_BG_SEARCH_RESEL_TIMER_EXPIRY,
+ RMC_BG_SEARCH_AVOID_IR_MEAS_TIMER_EXPIRY,
+/* __4G_BACKGROUND_SEARCH__ || __5G_BACKGROUND_SEARCH__ end */
+#endif /* defined(__LTE_RAT__) || defined(__NR_RAT__) */
+
+#ifdef __LTE_RAT__
+ RMC_T325_TIMER_EXPIRY,
+#endif /* __LTE_RAT__ */
+
+#if defined(__UMTS_RAT__) || defined(__LTE_RAT__)
+ RMC_RAU_PROTECT_TIMER_EXPIRY,
+ RMC_ATP_GUARD_TIMER_EXPIRY,
+#endif
+
+#ifdef __LTE_RAT__
+ RMC_DELAY_HPS_TIMER_EXPIRY,
+#endif
+
+#ifdef __CMCC_23G_PINGPONG_RESTRAIN__
+ RMC_2G3CR_PING_PONG_TIMER_EXPIRY,
+ RMC_VIRTUAL_PING_PONG_TIMER_EXPIRY,
+#endif
+
+/* should add new timer before TDD only timer below */
+#ifdef __2G_PS_REJ_BAR_CELL__
+ RMC_PS_BAR_TIMER_EXPIRY,
+#endif
+#ifdef __2G_CS_REJ_BAR_CELL__
+ RMC_CS_BAR_TIMER_EXPIRY,
+#endif
+
+#if defined(__TC01__) && defined(__MODEM_EM_MODE__)
+ RRM_EM_GAS_SEARCH_INFO_TIMER_ID,
+#endif /*__TC01__ && __MODEM_EM_MODE__*/
+
+ RRM_FAKE_CELL_AUTO_REPORT_TIMER_EXPIRY,
+
+ RMC_PAGING_RETRY_TIMER_EXPIRY,
+ /* Should add new timer before RRM_BASE_TIMER_ID */
+ RRM_ELEVATOR_MODE_TIMER_ID,
+
+ RRM_ELEVATOR_MODE_TIMER_EXPIRY,
+ RRM_MD_ONLY_ELEVATOR_MODE_TIMER_ID,
+ RRM_MD_ONLY_ELEVATOR_MODE_TIMER_EXPIRY,
+ RRM_MD_ONLY_ELEVATOR_MODE_LTE_CAMPING_TIMER_ID,
+ RRM_MD_ONLY_ELEVATOR_MODE_LTE_CAMPING_TIMER_EXPIRY,
+
+#if defined(__NR_RAT__)
+ RRM_MD_ONLY_ELEVATOR_MODE_NR_CAMPING_TIMER_ID,
+ RRM_MD_ONLY_ELEVATOR_MODE_NR_CAMPING_TIMER_EXPIRY,
+#endif
+
+#if defined(__MTK_TARGET__) && defined( __MD97__)
+ RRM_EFUSE_TIMER_ID,
+#endif /* defined(__MTK_TARGET__) && defined( __MD97__) */
+
+#ifdef __NR_RAT__
+ RMC_5G_BG_SEARCH_RESEL_TIMER_EXPIRY,
+#endif /* __NR_RAT__ */
+
+ /* total number of TIMER */
+ RRM_BASE_TIMER_ID
+} rmpc_timer_id_enum;
+
+typedef enum {
+ UMTS_TECH_FDD = 0,
+ UMTS_TECH_TDD = 1
+} umts_tech_enum;
+
+/* the camped on cell type */
+typedef enum
+{
+ RRM_SUITABLE_CELL = 0,
+ RRM_ACCEPTABLE_CELL = 1,
+ RRM_NO_CELL = 2
+} rrm_cell_type_enum;
+
+/* rrm_la_type_enum should match forbidden_la_type_enum */
+typedef enum
+{
+ RRM_FORBID_LA_FOR_REG_PROV_OF_SERV = 0,
+ RRM_FORBID_LA_FOR_ROAMING = 1,
+ RRM_UNKNOWN_LA = 2,
+ RRM_ALLOWED_LA = 3
+/* __ARA_FOR_CELL_SELECTION__ begin */
+ ,RRM_FORBID_LA_FOR_NOT_ARA = 4
+/* __ARA_FOR_CELL_SELECTION__ end */
+} rrm_la_type_enum;
+
+typedef enum
+{
+ PLMN_LEVEL = 0,
+ LA_LEVEL = 1,
+ CELL_LEVEL = 2
+} rrm_match_cell_level_enum;
+
+
+typedef enum
+{
+ RRM_NO_PENDING_ACTION = 0,
+ RRM_RATCM_RF_ON_ACTION = 1,
+ RRM_RATCM_RF_OFF_ACTION = 2,
+ RRM_RATCM_DEACTIVATE_ACTION = 3,
+ RRM_RATCM_PLMN_SEARCH_ACTION = 4,
+ RRM_RATCM_PLMN_LIST_ACTION = 5,
+ RRM_RATCM_PLMN_LIST_STOP_ACTION = 6,
+ RRM_RATCM_PLMN_LIST_AFTER_SEARCH_ACTION = 7,
+ RRM_RATCM_PLMN_LIST_STOP_AFTER_SEARCH_ACTION = 8,
+ RRM_RATCM_REL_SEMA_BEFORE_DEACTIVATE_ACTION = 9, /* __GEMINI__ */
+ RRM_RSVA_FREQ_SCAN_PREEMPT_ACTION = 10, /* for RSVA */
+ RRM_RSVA_PREEMPT_SERVICE_ACTION = 11, /* for RSVA */
+ RRM_RCS_REDIRECTION_LIST_TIMEOUT = 12, /* R5R6 */
+ RRM_RCS_SUSPEND_FULL_BAND_PLMN_SEARCH = 13, /* __FAST_ROAMING_SEARCH__ */
+ RRM_RATCM_GAS_SET_ACTIVE_RAT_ACTION = 14, /* for Fast recovery */
+ RRM_RATCM_CONN_ABORT_ACTION = 15,
+ RRM_RATCM_PLMNLIST_ABORT_ACTION = 16, /*Manually report currently recorded PLMNs*/
+} rrm_pending_action_enum;
+
+typedef enum
+{
+ RRM_WAIT_FOR_SIM_POWER_ON_READY = 0,
+ RRM_SIM_IS_READY = 1,
+ RRM_WAIT_FOR_SIM_READY_IND = 2,
+ RRM_PENDING_SIM_READY_IND = 3
+} rrm_sim_ready_status_enum;
+
+/* ZY: purpose for composing ucell list */
+typedef enum
+{
+ IR_LIST_NBR_CELL_LIST,
+ IR_LIST_NBR_CELL_LIST_PLUS_RESEL_LIST_EXCLUDE_2TER_FOR_IR_MEAS,
+ IR_LIST_NBR_CELL_LIST_PLUS_RESEL_LIST_INCLUDE_2TER_FOR_IR_MEAS,
+ IR_LIST_NBR_CELL_LIST_PLUS_RESEL_LIST_INCLUDE_2TER_FOR_UPDATE_SCSI,
+ IR_LIST_REDIRECTION_LIST /* ZY : R6 redirection */
+} compose_ucell_list_purpose_enum;
+
+#ifdef __BAND_BLOCK__
+/* For LG band block feature */
+
+typedef enum
+{
+ BLOCK_GSM_BAND_850 = 0,
+ BLOCK_GSM_BAND_900 = 1,
+ BLOCK_GSM_BAND_1800 = 2,
+ BLOCK_GSM_BAND_1900 = 3
+} blocked_band_enum;
+
+typedef enum
+{
+ RRM_BARRED_CELL_FOR_BAND_BLOCK,
+ RRM_ACCEPTABLE_CELL_FOR_BAND_BLOCK,
+ RRM_SUITABLE_CELL_FOR_BAND_BLOCK
+} rrm_cell_type_for_band_block_enum;
+
+typedef enum
+{
+ RRM_BAND_BLOCK_INVALID = 0,
+ RRM_BAND_BLOCK_SPECIFIC_MNC = 1,
+ RRM_BAND_BLOCK_ALL_MNC_IN_SPECIFIC_MCC = 2,
+ RRM_BAND_BLOCK_ALL_MCC = 3
+} rrm_band_block_type_enum;
+
+#endif /* __BAND_BLOCK__ */
+
+typedef enum
+{
+ BG_PLMN_LIST_NULL_STATE = 0,
+ BG_PLMN_LIST_POWER_SCAN_STATE = 1,
+ BG_PLMN_LIST_BEGIN_SEARCH_STATE = 2,
+ BG_PLMN_LIST_NBR_BURST_ACCESS_STATE = 3,
+ BG_PLMN_LIST_SYNC_FIRST_CELL_BSIC_STATE = 4,
+ BG_PLMN_LIST_BURST_ACCESS_STATE = 5,
+ BG_PLMN_LIST_REACH_LAST_ARFCN_STATE = 6,
+ BG_PLMN_LIST_SUSPEND_STATE = 7,
+ BG_PLMN_LIST_PENDING_TO_WAIT_MSG_STATE = 8 /* for RSVA */
+} rcs_bg_plmn_list_state_enum;
+
+typedef enum
+{
+ RCS_UNKNOWN_FREQ = 0,
+ RCS_JUST_GET_BSIC = 1,
+ RCS_WAIT_SI3 = 2,
+ RCS_INVALID_CELL = 3,
+ RCS_BARRED_CELL = 4,
+ RCS_LOW_PRIO_CELL = 5,
+ RCS_NORM_PRIO_CELL = 6,
+ RCS_EXCEED_BAND_LIMIT_CELL = 7
+} rcs_arfcn_type_enum;
+
+typedef enum
+{
+ RCS_UNKNOWN = 0,
+ RCS_LOW_QUALITY = 1,
+ RCS_HIGH_QUALITY = 2
+} rcs_plmn_quality_enum;
+
+typedef enum
+{
+ RCS_NO_POWER_SCAN = 0,
+ RCS_STORED_LIST_POWER_SCAN = 1,
+ RCS_FULL_BAND_POWER_SCAN = 2,
+ RCS_WORKING_BAND_POWER_SCAN = 3,
+ RCS_BG_FULL_BAND_POWER_SCAN = 4,
+ RCS_CGI_REPORTING_POWER_SCAN = 5
+} rcs_power_scan_mode_enum;
+
+typedef enum
+{
+ RCS_MODE_NULL = 0,
+ RCS_MODE_I_SEQ_ACCESS_MODE = 1,
+ RCS_MODE_II_BURST_ACCESS_MODE = 2,
+ RCS_MODE_III_BG_BURST_ACCESS_MODE = 3,
+ RCS_MODE_IV_BG_NBR_BURST_ACCESS_MODE = 4,
+ RCS_MODE_V_CAMP_ORIG_CELL_MODE = 5 /* __FAST_RESUME__ */
+} rcs_cell_sel_mode_enum;
+
+typedef enum
+{
+ ANY_PRIORITY_CELL = 0,
+ HIGH_PRIORITY_CELL = 1,
+ LOW_PRIORITY_CELL = 2
+} rcs_cell_priority_enum;
+
+typedef enum
+{
+ /* the PLMN index less than RCS_MAX_PLMN_INDEX is a valid value */
+ RCS_MAX_PLMN_INDEX = MAX_NUM_PLMN_PER_RAT,
+ RCS_INVALID_PLMN_INDEX = 0xfe,
+ RCS_PLMN_UNKNOWN_INDEX = 0xff
+} rcs_plmn_index_enum;
+
+typedef enum
+{
+ RCS_TRIG_NULL = 0,
+ RCS_TRIG_BY_RATCM_PLMN_SEARCH = 1,
+ RCS_TRIG_BY_RATCM_PLMN_LIST = 2, /* Refer to PLMN list trig source */
+ /* cell reselection failure triggers cell selection */
+ RCS_TRIG_BY_CELL_RESEL_FAIL = 3,
+ RCS_TRIG_BY_PLMN_LIST_AND_CELL_RESEL_FAIL = 4,
+ /* redirection: 3G->2G, or 4G->2G, ..., etc. */
+ RCS_TRIG_BY_IR_REDIRECTION = 5,
+ RCS_TRIG_BY_PLMN_LIST_AND_IR_REDIRECTION = 6,
+ /* redirection 2G->2G */
+ RCS_TRIG_BY_2G_REDIRECTION = 7,
+ RCS_TRIG_BY_PLMN_LIST_AND_2G_REDIRECTION = 8,
+ /* fast recovery */
+ RCS_TRIG_BY_FAST_RECOVERY_TIMER_EXPIRED = 9
+} rcs_trig_source_enum;
+
+typedef enum
+{
+ RCS_PLMN_LIST_TRIG_NULL = 0x00,
+ RCS_PLMN_LIST_TRIG_BY_NAS = 0x01, /* User PLMN list or MM list*/
+ RCS_PLMN_LIST_TRIG_BY_AS = 0x02, /* CSG fingerprint collection */
+ RCS_PLMN_LIST_TRIG_BY_NAS_AND_AS = 0x03
+} rcs_plmn_list_trig_source_enum;
+
+#ifdef __GEMINI__
+typedef enum
+{
+ /* after resuming, RRM(RCS) should ... */
+ RCS_QUEUE_NULL_EVENT = 0, /* do nothing */
+ RCS_QUEUE_PLMN_SEARCH_EVENT = 1, /* do PLMN search in cell selection state */
+ RCS_QUEUE_FG_PLMN_LIST_EVENT = 2, /* do PLMN list in cell seleciton state */
+ RCS_QUEUE_BG_PLMN_LIST_EVENT = 3 /* do PLMN list in inactive state */
+} rcs_queued_plmn_event_enum;
+
+/* __GEMINI_IMPROVE__ */
+typedef enum
+{
+ RCS_SHARE_NO_SHARING = 0x0000,
+ RCS_SHARE_USING_PEER_SIM1_RESULT = 0x0001, /* the bit map of sharing SIM1 result, i.e., 0x 0000 0000 0000 0001 */
+ RCS_SHARE_USING_PEER_SIM2_RESULT = 0x0002, /* the bit map of sharing SIM2 result, i.e., 0x 0000 0000 0000 0010 */
+ RCS_SHARE_USING_PEER_SIM3_RESULT = 0x0004, /* the bit map of sharing SIM3 result, i.e., 0x 0000 0000 0000 0100 */
+ RCS_SHARE_USING_PEER_SIM4_RESULT = 0x0008, /* the bit map of sharing SIM4 result, i.e., 0x 0000 0000 0000 1000 */
+ RCS_SHARE_WILL_SHARE_TO_PEER = 0x8000 /* the bit map for sharing to peer, i.e., 0x 1000 0000 0000 0000 */
+} rcs_share_scan_status_enum;
+
+#ifdef __UMTS_RAT__
+typedef enum
+{
+ RCS_CELL_SRCH_NULL = 0, /* there is no RCS procedure shall process */
+ RCS_CELL_SRCH_REQUESTING = 1, /* some RCS procedure shall process, asking RSVA for reserv resource */
+ RCS_CELL_SRCH_WAITING = 2, /* the RCS procedure can't process, it must wait the L1 resource */
+ RCS_CELL_SRCH_RUNNING = 3, /* the RCS procedure is processing */
+ RCS_CELL_SRCH_STOPPING = 4 /* the RCS procedure is stopping for release the L1 resource */
+} rcs_rsva_cell_srch_status_enum;
+#endif /* __UMTS_RAT__ */
+
+#endif /* __GEMINI__ */
+
+typedef enum
+{
+ RCS_WAIT_NULL = 0,
+ RCS_WAIT_SET_RAT_SERVICE_CNF = 1, /* for DEACTIVATE_REQ and PLMN_List_stop action !!! */
+ RCS_WAIT_CELL_SELECTION_INIT_CNF = 2,
+ RCS_WAIT_SEARCH_RF_CNF = 3, /* pending to wait SEARCH_RF_CNF */
+ RCS_WAIT_BSIC_SYNC_CNF = 4, /* pending to wait BSIC_SYNC_CNF */
+
+/* for RSVA */
+ RCS_WAIT_FS_START_CNF = 5, /* pending to wait FREQ_SCAN_START_CNF */
+ RCS_WAIT_FS_ACCEPT_IND = 6, /* pending to wait FREQ_SCAN_ACCEPT_IND */
+
+ RCS_WAIT_OTHERS = 7 /* reserve for feature use */
+} rcs_wait_cnf_type_enum;
+
+typedef enum
+{
+ RCS_PLMN_LIST_NONE = 0,
+ RCS_PLMN_LIST_STORED = 1,
+ RCS_PLMN_LIST_NORMAL = 2
+} rcs_list_type_enum;
+
+typedef enum
+{
+ RCS_FULL_BAND_SCAN_INVALID,
+ RCS_FULL_BAND_SCAN_IN_PROGRESS,
+ RCS_FULL_BAND_SCAN_SUSPENDED,
+ RCS_FULL_BAND_SCAN_FINISHED,
+} rcs_full_band_scan_status_enum;
+
+typedef enum
+{
+ APP_UPLINK_SENDING_NOT_ALLOWED = 0, /* initial value or RR connection is released */
+ APP_UPLINK_SENDING_ALLOWED = 1, /* when receiving first DL app data */
+ APP_UPLINK_SENDING_SUSPEND = 2 /* when receiving RR manage. mesg */
+} app_uplink_sending_status_enum;
+
+typedef enum
+{
+ GSM_MODE,
+ GPRS_CCCH_MODE,
+ GPRS_PMO_CCCH_MODE,
+ GPRS_PCCCH_MODE
+} meas_mode_enum;
+
+typedef enum
+{
+ GPRS_NC_MEAS,
+ GPRS_EXT_MEAS,
+ GPRS_ENH_MEAS
+} meas_type_enum;
+
+typedef enum
+{
+ ENH_MR,
+ NORMAL_MR
+} meas_rp_enum;
+
+#define _ENH_PARAMS_SRC_ENUM
+typedef enum
+{
+ SRC_INVALID,
+ SRC_SI,
+ SRC_MI,
+ SRC_PSI,
+ SRC_PMO,
+ SRC_DEFAULT
+} enh_params_src_enum;
+
+typedef enum
+{
+ LAYER_DEFAULT,
+ LAYER_BROADCAST,
+ LAYER_INDIVIDUAL
+} meas_params_layer_enum;
+
+typedef enum
+{
+ CS_CONTEXT = 0,
+ PS_CONTEXT,
+ CS_AND_PS_CONTEXT
+} DES_CONTEXT; /* destination context */
+
+typedef enum NC_MODE
+{
+ NC0 = 0,
+ NC1,
+ NC2,
+ NC_RESET,
+
+ /* StanleyHY: the initial value of SI2Q (only used by SI2Q) */
+ NC_NULL
+} NC_MODE;
+
+typedef enum NC_PARAM_SRC
+{
+ NC_DAFAULT_VALUE = 0,
+ NC_SI2Q,
+ NC_SI13,
+ NC_PSI5,
+ NC_PMO_PCCO
+} NC_PARAM_SRC;
+
+typedef enum EM_MODE
+{
+ EM0 = 0,
+ EM1,
+ EM_RESERV,
+ EM_RESET
+} EM_MODE;
+
+typedef enum BSIC_MODE /* 03-29-2003, add */
+{
+ PRIORITY_MODE = 0,
+ REASSERT_MODE,
+ SECOND_PRIORITY_MODE
+} BSIC_MODE;
+
+typedef enum
+{
+ SORT_PURPOSE_BSIC_GENERAL = 0,
+ SORT_PURPOSE_MEAS_REP,
+ SORT_PURPOSE_ENH_MEAS_REP,
+ SORT_PURPOSE_BSIC_DEDI_RECONFIRM
+ /*QJZH:[D][2010.05.22] redundant code*/
+ //SORT_PURPOSE_ATTEMP_COUNTER
+} SORT_PURPOSE;
+
+typedef enum RMC_INDIV_PARA_SRC
+{
+ RMC_INDIV_PARA_SRC_PMO,
+ RMC_INDIV_PARA_SRC_PCCO
+} RMC_INDIV_PARA_SRC;
+
+typedef enum INDIV_PARA_HDL_STATUS
+{
+ INDIV_PARA_HDL_NOT_DECODE = 0,
+ INDIV_PARA_HDL_NOT_APPLIED,
+ INDIV_PARA_HDL_PARTIAL_APPLIED_WO_SI2T,
+ INDIV_PARA_HDL_PARTIAL_APPLIED_WITH_SI2T,
+ INDIV_PARA_HDL_ALL_APPLIED
+} INDIV_PARA_HDL_STATUS;
+
+typedef enum RMPC_MEAS_TRANS_ID
+{
+ RMPC_TRANSACTION_ID_0 = 0,
+ RMPC_TRANSACTION_ID_1
+} RMPC_MEAS_TRANS_ID;
+
+typedef enum EXT_REPORTING_TYPE
+{
+ EXT_REPORTING_TYPE1 = 0,
+ EXT_REPORTING_TYPE2,
+ EXT_REPORTING_TYPE3,
+ EXT_REPORTING_TYPE_RESERV
+} EXT_REPORTING_TYPE;
+
+typedef enum RMPC_IS_HOPPING
+{
+ RMPC_NOT_HOPPING = 0,
+ RMPC_HOPPING
+} RMPC_IS_HOPPING;
+
+typedef enum BA_UPDATE_TYPE
+{
+ RESEL_START,
+ RESEL_END,
+ NORM_BA_UPDATE
+} BA_UPDATE_TYPE;
+
+typedef enum
+{
+ UMTS_PARA_FROM_SI2T = 0,
+ UMTS_PARA_FROM_SI2Q = 1,
+ UMTS_PARA_FROM_PSI3Q = 2,
+ UMTS_PARA_FROM_PSI5 = 3,
+ UMTS_PARA_FROM_MI = 4,
+ UMTS_PARA_FROM_PMO = 5,
+ UMTS_PARA_FROM_PCCO = 6
+} umts_para_src_enum;
+
+#if defined(__LTE_RAT__) || defined(__23G_PRI_RESEL_SUPPORT__)
+typedef enum
+{
+ PRIO_COMPARISON_INVALID,
+ PRIO_COMPARISON_LOWER,
+ PRIO_COMPARISON_HIGHER
+} prio_comparison_enum;
+
+#endif /* defined(__LTE_RAT__) || defined(__23G_PRI_RESEL_SUPPORT__) */
+
+typedef enum
+{
+ EMR_CAUSE_NULL,
+ EMR_CAUSE_NO_BSIC_INFO,
+ EMR_CAUSE_BSIC_INFO_NOT_COMPLETE,
+ EMR_CAUSE_BA_NOT_FULL,
+ EMR_CAUSE_BA_IND_NOT_MATCH
+} emr_not_allow_cause_enum;
+
+typedef enum NBR_RESET_CAUSE
+{
+ BSIC_CHANGE,
+ BSIC_DECODE_FAILURE,
+ BSIC_EXCEEDING_ATTEMPT_COUNTER,
+ NBCCH_DECODE_FAILURE
+} NBR_RESET_CAUSE;
+
+typedef enum
+{
+ NCELL_SRC_INVALID,
+ NCELL_SRC_SI2, /* SEL_PARAM: 0 */
+ NCELL_SRC_SI5, /* SEL_PARAM: 0 */
+ NCELL_SRC_SI2N, /* SEL_PARAM: 1 */
+ NCELL_SRC_PSI, /* SEL_PARAM: 1 */
+ NCELL_SRC_PMO_PCCO /* SEL_PARAM: 1 */
+} NCELL_PARAM_SRC;
+
+#if defined(__GAS_INTERNAL_IT__) || (defined(__MODEM_EM_MODE__) && defined(__CHANNEL_LOCK__))
+typedef enum
+{
+ RR_REDIRECTION_OFF,
+ RR_REDIRECTION_GSM,
+ RR_REDIRECTION_FDD,
+ RR_REDIRECTION_TDD, /* TDD current is not supported */
+ RR_REDIRECTION_LTE
+} redirection_it_test_enum;
+
+typedef enum
+{
+ RR_CCO_OFF = 0,
+ RR_CCO_GSM_WITH_IM_REL = 1,
+ RR_CCO_GSM_WO_IM_REL = 2,
+ RR_CCO_FDD_WITH_IM_REL = 3,
+ RR_CCO_FDD_WO_IM_REL = 4,
+ RR_CCO_TDD_WITH_IM_REL = 5, /* TDD current is not supported */
+ RR_CCO_TDD_WO_IM_REL = 6, /* TDD current is not supported */
+ RR_CCO_LTE_WITH_IM_REL = 7,
+ RR_CCO_LTE_WO_IM_REL = 8
+} cco_it_test_enum;
+#endif /* defined(__GAS_INTERNAL_IT__) || (defined(__MODEM_EM_MODE__) && defined(__CHANNEL_LOCK__)) */
+
+typedef enum
+{
+ REPORT_TYPE_VALID_BSIC_GSM_CELL
+ , REPORT_TYPE_INVALID_BSIC_GSM_CELL
+#ifdef __UMTS_RAT__
+ , REPORT_TYPE_UMTS_CELL
+ , REPORT_TYPE_UMTS_FREQ
+#endif /* __UMTS_RAT__ */
+#ifdef __LTE_RAT__
+ , REPORT_TYPE_LTE_CELL
+#endif /* __LTE_RAT__ */
+} report_candidate_type_enum;
+
+typedef enum
+{
+ MEAS_REPORT_INFO_TYPE_INVALID
+ , MEAS_REPORT_INFO_TYPE_MR
+ , MEAS_REPORT_INFO_TYPE_EMR
+#ifdef __PS_SERVICE__
+ , MEAS_REPORT_INFO_TYPE_PMR
+ , MEAS_REPORT_INFO_TYPE_PEMR
+ , MEAS_REPORT_INFO_TYPE_PCCN
+#endif /* __PS_SERVICE__ */
+} meas_report_info_type_enum;
+
+typedef enum
+{
+ PCCN_TARGET_CELL_INVALID
+ , PCCN_GSM_TARGET_CELL
+#ifdef __UMTS_RAT__
+ , PCCN_UMTS_NORMAL_TARGET_CELL
+#endif /* __UMTS_RAT__ */
+#ifdef __LTE_RAT__
+ , PCCN_LTE_NORMAL_TARGET_CELL
+#endif /* __LTE_RAT__ */
+} pccn_target_cell_type_enum;
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif /* 0 */
+
+typedef enum
+{
+ RMC_TBF_UPLINK_ASSIGN,
+ RMC_TBF_DOWNLINK_ASSIGN
+}
+rmc_assign_type;
+
+typedef enum
+{
+ RMC_INVALID_CHANNEL,
+ RMC_FIRST_HR_CHANNEL,
+ RMC_SEC_HR_CHANNEL
+}
+rmc_partial_rel_chan_enum;
+
+typedef enum
+{
+ CS_CONN_NONE,
+ CS_CONN_L2_REL_IND,
+ CS_CONN_RR_REL_REQ,
+ CS_CONN_T3110_EXP,
+ CS_CONN_L2_ERROR_REEST,
+ CS_CONN_NW_REL,
+ /* ZY, revise RR rel/abort scheme in access state */
+ CS_CONN_ABORT_REQ,
+ /* Adeline 2009.4.24: for PCCO procedure */
+ T3174_TIMER_EXPIRY,
+ CCO_TIMER_EXPIRY,
+ DEACTIVATE_REQ,
+ PLMN_SEARCH_REQ,
+ PEER_AS_ABORT_REQ
+} cs_conn_disc_cause_enum;
+
+#if defined(__CS_SERVICE__) && defined(__PS_SERVICE__)
+typedef enum
+{
+ RMC_EMERGENCY_CALL = 0,
+ RMC_MO_CALL = 0,
+ RMC_CALL_RE_ESTABLISHMENT = 0,
+ RMC_LOCATION_AREA_UPDATE,
+ RMC_MO_SMS,
+ RMC_OTHER_PROCEDURE_ON_SDCCH,
+ RMC_MO_VOICE_BROADCAST_OR_GROUP_CALL,
+ RMC_MT_CS_CONNECTION,
+ RMC_DTM_NO_SUPPORTED
+} gprs_suspension_cause_enum;
+#endif /* defined(__CS_SERVICE__) && defined(__PS_SERVICE__) */
+
+typedef enum
+{
+ RMC_DL,
+ RMC_BI
+}
+DIRECTION;
+
+typedef enum
+{
+ S_RMC_CIPHERING_OFF = 0,
+ S_RMC_CIPHER_ALGO_5_1,
+ S_RMC_CIPHER_ALGO_5_2,
+ S_RMC_CIPHER_ALGO_5_3,
+ S_RMC_CIPHER_ALGO_5_4,
+ S_RMC_CIPHER_ALGO_5_5,
+ S_RMC_CIPHER_ALGO_5_6,
+ S_RMC_CIPHER_ALGO_5_7
+}
+CIPHER_ALGO_TYPE;
+
+typedef enum
+{
+ RMC_NOT_CIPHERED_MODE = 0,
+ RMC_CIPHERED_MODE
+}
+MS_CIPHER_MODE_ENUM;
+
+/* Use channel_mode_enum in mpal_common_interface.h */
+#if 0 /* Claire del */
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif /* 0 */
+
+typedef enum
+{
+ RMC_FIRST_CHANNEL,
+ RMC_SECOND_CHANNEL,
+ RMC_BOTH_CHANNELS
+}
+CHAN_NUMBER_ENUM;
+
+/* End Claire add */
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#ifndef __GERAN_R5__
+/* under construction !*/
+#endif /* __GERAN_R5__ */
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#ifdef __UMTS_RAT__
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#ifdef __23G_PRI_RESEL_SUPPORT__
+/* under construction !*/
+#endif /* __23G_PRI_RESEL_SUPPORT__ */
+/* under construction !*/
+#endif /* __UMTS_RAT__ */
+/* under construction !*/
+#ifdef __3G_CSG_SUPPORT__
+/* under construction !*/
+/* under construction !*/
+#endif /* __3G_CSG_SUPPORT__ */
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#ifdef __GERAN_R6__
+/* under construction !*/
+/* under construction !*/
+#endif /* __GERAN_R6__ */
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#ifdef __AGPS_CONTROL_PLANE__
+/* under construction !*/
+#endif /* __AGPS_CONTROL_PLANE__ */
+/* under construction !*/
+#ifdef __ETWS_SUPPORT__
+/* under construction !*/
+#endif /* __ETWS_SUPPORT__ */
+/* under construction !*/
+/* under construction !*/
+#ifdef __GERAN_R4__
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif /* __GERAN_R4__ */
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+/* Adeline 2008.12.30 */
+typedef enum
+{
+ CC_NULL,
+ CC_NORMAL_BEGIN = CC_NULL,
+ CC_NORMAL_C1_BASED,
+ CC_NORMAL_C2_BASED,
+ CC_NORMAL_C32_BASED,
+ CC_NORMAL_RLC_TRIGGER,
+ CC_NORMAL_END,
+ CC_ABNORMAL_BEGIN = CC_NORMAL_END,
+ CC_ABNORMAL_DSF_TRIGGER,
+ CC_ABNORMAL_CBA_TRIGGER,
+ CC_ABNORMAL_SI_TRIGGER,
+ CC_ABNORMAL__T3126_TRIGGER,
+ CC_ABNORMAL_RLC_TRIGGER,
+ CC_ABNORMAL_END,
+ CC_NW_CTRL_BEGIN = CC_ABNORMAL_END,
+ CC_NW_CTRL_PCCO,
+ CC_NW_CTRL_PS_HO,
+ CC_NW_CTRL_END,
+ CC_CALL_RE_EST_TRIGGER
+ /* ZY : R6 redirection */
+#if defined(__FDD_REDIRECTION__) || defined(__UMTS_R6__)
+ , CC_NW_CTRL_REDIRECTION
+#endif /* defined(__FDD_REDIRECTION__) || defined(__UMTS_R6__) */
+#if defined(__UMTS_RAT__)&& defined(__CMCC_STD_FR__)
+ ,CC_NW_CTRL_STD_FR
+#endif
+#ifdef __LTE_RAT__
+ , CC_MS_CTRL_LTE_AUTO_FAST_RETURN
+ , CC_NW_CTRL_REDIRECTION_AFTER_CSFB
+ , CC_MS_CTRL_LTE_BG_SRCH
+ , CC_IR_HSR_CR
+#endif /* __LTE_RAT__ */
+#if defined(__UMTS_RAT__) && defined(__TC7__CS__SUPPORT__)
+ , CC_MS_CTRL_UMTS_FAST_RETURN
+#endif
+#ifdef __NR_RAT__
+ , CC_MS_CTRL_NR_BG_SRCH
+ , CC_MS_CTRL_NR_AUTO_FAST_RETURN
+#endif /* __NR_RAT__ */
+
+} CELL_CHANGE_TYPE_ENUM;
+
+typedef enum
+{
+ CELL_CHANGE_NULL_PHASE = 0,
+ CELL_CHANGE_SERV_BSIC_REQ_PHASE,
+ CELL_CHANGE_ABORTING_PHASE,
+ CELL_CHANGE_NEIGHBOUR_BSIC_REQ_PHASE,
+ CELL_CHANGE_NEIGHBOUR_SI_COLLECTION_PHASE,
+ /* for PCCO only */
+ CELL_CHANGE_SERV_SI_COLLECTION_PHASE,
+ CELL_CHANGE_WAIT_FOR_CONTENTION_PHASE
+} CELL_CHANGE_PHASE_ENUM;
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+#ifdef __CB__
+
+/* 040116 , we need to isolate the enum value from
+ RR to MPAL for bug fix: error memory write ( CB data
+ for CBCH_MODE_NORMAL and CBCH_MODE_EXTENDED */
+enum
+{
+ CBCH_MODE_NORMAL = 0,
+ CBCH_MODE_EXTENDED,
+ CBCH_MODE_INVALID
+}; /* CBCh mode */
+
+enum
+{
+ CBCH_MODE_INVALID_TO_MPAL = 0,
+ CBCH_MODE_NORMAL_TO_MPAL,
+ CBCH_MODE_EXTENDED_TO_MPAL
+}; /* CBCh mode */
+
+enum
+{
+ CBCH_START = 0,
+ CBCH_STOP
+}; /* The definition of cb action */
+
+enum
+{
+ CBCH_ACCEPT = 0,
+ CBCH_IGNORE
+};
+
+enum
+{
+ CB_STATE_OFF = 0,
+ CB_STATE_ON
+}; /* The definition of cbchState */
+
+enum
+{
+ CB_NO_DRX_MODE = 0,
+ CB_DRX_MODE,
+ /* Peter:[CB] The following two enum is not used ?? */
+ CB_FIRST_DRX_MODE,
+ CB_SECOND_DRX_MODE
+}; /* The definition of scheduleMode */
+
+enum
+{
+ CB_1CB = 0,
+ CB_2B,
+ CB_3B,
+ CB_4B,
+ CB_1SB = 8,
+ CB_NB = 15
+}; /* The definition of sequence number coding */
+
+enum
+{
+ CB_CB_MESSAGE = 0,
+ CB_SCHEDULE_MESSAGE
+}; /* CBS Message Type1 */
+
+enum
+{
+ CB_DWNLD = 0,
+ CB_DISPLAY
+}; /* CBS Message Type2 */
+
+/* Byron: 2005/12/14: For schedule CB message handling */
+typedef enum
+{
+ CB_NO_SCB_RECEIVED = 0,
+ CB_FIRST_SCB_RECEIVED,
+ CB_SCB_CAN_BE_USED
+} scb_enum; /* CBS Message Type2 */
+
+#endif /* __CB__ */
+
+/* ZY: add for AMR-WB */
+typedef enum
+{
+ AMR_NON = 0, /* for non-AMR channel mode */
+ AMR_NB /* for AMR narrow band channel mode */
+#ifdef __AMRWB_LINK_SUPPORT__
+ , AMR_WB /* for AMR wide band channel mode */
+#endif
+} channel_mode_status_enum; /* it is used for checking multirate configuration */
+
+/* ZY : R6 redirection */
+#if defined(__GERAN_R6__) || defined(__UMTS_R6__) || defined (__FDD_REDIRECTION__) || defined(__LTE_RAT__)
+typedef enum
+{
+ REDIRECT_TO_GSM = 0,
+ REDIRECT_TO_UTRAN_FDD = 1,
+ REDIRECT_TO_UTRAN_TDD = 2,
+ REDIRECT_TO_LTE = 3
+} redirection_enum;
+#endif /* defined(__GERAN_R6__) || defined(__UMTS_R6__) || defined (__FDD_REDIRECTION__) || defined(__LTE_RAT__) */
+
+typedef enum
+{
+ IMM_ASGN_VALID_SUCCESS,
+ IMM_ASGN_VALID_FAIL,
+ IMM_ASGN_VALID_IGNORE
+} imm_asgn_valid_enum;
+
+/* ACS refactoring: trace with enum */
+typedef enum
+{
+ /* Ignore Message */
+ ACS_IGNORE_MSG_FOR_SUBSTATE_NOT_MATCH,
+ ACS_IGNORE_IA_FOR_TBF_DEDI_NOT_MATCH,
+ ACS_IGNORE_IA_FOR_ALLOC_TYPE_NOT_MATCH,
+ ACS_IGNORE_IA_FOR_MEAS_MODE_NOT_MATCH,
+ ACS_IGNORE_IA_FOR_REQ_REF_NOT_MATCH,
+ ACS_IGNORE_IA_FOR_EXT_RA_NOT_MATCH,
+ ACS_IGNORE_IA_FOR_PKT_CHANNEL_DESC_NOT_VALID,
+ ACS_IGNORE_IA_FOR_MA_NOT_VALID,
+ ACS_IGNORE_IA_FOR_1ST_TMA_NOT_VALID,
+ ACS_IGNORE_IA_FOR_2ND_TMA_NOT_VALID,
+ ACS_IGNORE_IA_FOR_FREQ_PARM_NOT_VALID,
+ ACS_IGNORE_IA_FOR_ESSENTIAL_SI_ACQUIRING,
+ ACS_IGNORE_PAR_FOR_PUAS_RECEIVED,
+ ACS_IGNORE_PUAS_FOR_PERSISTANCE_LEVEL_NOT_VALID,
+ ACS_IGNORE_PUAS_FOR_MSG_LEN_NOT_VALID,
+
+ /* Abort Access Proc */
+ ACS_ABORT_ACS_PROC_FOR_FREQUENCY_NOT_VALID,
+
+ /* Deny Access Request */
+ ACS_DENY_ACS_REQ_FOR_WAIT_IND_TIMER_IS_RUNNING,
+ ACS_DENY_ACS_REQ_FOR_RP_OR_CTRL_CLASS_NOT_ALLOW,
+
+ /* Error */
+ ACS_ERROR_RACH_MAX_RETRANS,
+
+ /* Other Info */
+ ACS_CMP_EXT_RA_MATCH,
+ ACS_CMP_EXT_RA_NOT_MATCH,
+ ACS_STORE_1ST_TMA,
+ ACS_RECEIVE_DL_IA,
+ ACS_RECEIVE_EGPRS_PUAS
+} acs_trace_cause_enum;
+
+#ifdef __ETWS_SUPPORT__
+typedef enum
+{
+ ETWS_EARTHQUAKE = 0,
+ ETWS_TSUNAMI = 1,
+ ETWS_BOTH = 2,
+ ETWS_TEST = 3,
+ ETWS_OTHERS = 4,
+ ETWS_RESERVED
+} warning_type_enum;
+
+typedef enum
+{
+ ETWS_STOP = 0,
+ ETWS_START
+} etws_recv_status_enum;
+
+#endif /* __ETWS_SUPPORT__ */
+
+typedef enum
+{
+ RMC_NORMAL_MEASUREMENT,
+ RMC_EXT_MEASUREMENT
+}
+rmc_measurement_type;
+
+typedef enum
+{
+ RMC_RR_NORMAL_EVENT,
+ RMC_ABNORM_REL_UNSPECIFIED,
+ RMC_ABNORM_REL_CHL_UNACCEPTABLE,
+ RMC_ABNORM_REL_TIMER_EXPIRED,
+ RMC_ABNORM_REL_NO_ACTIVITY_ON_RADIO_PATH,
+ RMC_PREEMPTVE_REL,
+ RMC_UTRAN_PRECONF_UNKNOWN,
+ RMC_HO_IMPOS_TIM_ADV_OUT_OF_RANGE = 0x08,
+ RMC_CH_MODE_UNACCEP,
+ RMC_FREQ_NOT_IMPLEMENTED,
+ RMC_LOWER_LAYER_FAILURE = 0x0c,
+ RMC_CALL_ALREADY_CLEARED = 0x41,
+ RMC_SEMANTIC_INCORR_MSG = 0x5f,
+ RMC_INVALID_MAND_INF = 0x60,
+ RMC_MT_NON_EXIS_OR_NOT_IMP,
+ RMC_MT_NOT_COMPAT_WITH_PROT_STATE,
+ RMC_COND_IE_ERROR = 0x64,
+ RMC_NO_CELL_ALLOC_AVAILABLE,
+ RMC_PROTOCOL_ERROR_UNSPECIFIED = 0x6f
+} rmc_rr_cause;
+
+typedef enum
+{
+ RMC_ASGN_CMD,
+ RMC_PDCH_ASGN,
+ RMC_IMM_ASGN,
+ RMC_IMM_ASGN_EXT,
+ RMC_ADDTNL_ASGN,
+ //RMC_PRTL_REL,
+ RMC_HO_CMD,
+ RMC_FREQ_REDEF,
+ RMC_CHMODE_CHNG,
+ RMC_CIPHER_MODE,
+ RMC_HO_CMD_FROM_UTRAN,
+ RMC_HO_CMD_TO_UTRAN,
+ RMC_HO_CMD_FROM_EUTRAN
+} rmc_ded_asgn_type;
+
+#if (defined(__MODEM_EM_MODE__) || defined(__SLIM_MODEM_EM_MODE__))
+typedef enum
+{
+ EM_ASSGN_CMD_MSG_TYPE,
+ EM_CHANNEL_RELEASE_MSG_TYPE,
+ EM_ADDTNL_ASSGN_MSG_TYPE,
+ EM_CLASSMARK_ENQUIRY_MSG_TYPE,
+ EM_CIPHER_MODE_CMD_MSG_TYPE,
+ EM_CONFIG_CHANGE_MSG_TYPE,
+ EM_HANDOVER_CMD_MSG_TYPE,
+ EM_FREQ_REDEF_MSG_TYPE,
+ EM_CHAN_MODE_MOD_MSG_TYPE,
+ EM_CELL_SELECTION
+}
+rr_em_ded_asgn_type;
+#endif /* (defined(__MODEM_EM_MODE__) || defined(__SLIM_MODEM_EM_MODE__)) */
+
+/* info type 5 codes used in scheduling info of SI 9 */
+typedef enum
+{
+ SI_1_SCHEDULE,
+ SI_2_SCHEDULE,
+ SI_2_BIS_SCHEDULE,
+ SI_2_TER_SCHEDULE,
+ SI_3_SCHEDULE,
+ SI_4_SCHEDULE,
+ SI_7_SCHEDULE,
+ SI_8_SCHEDULE,
+ SI_9_SCHEDULE,
+ SI_13_SCHEDULE
+}
+rr_info_type_5_schd_type;
+
+typedef enum
+{
+ RR_MEAS_INFO_MSG_TYPE = 0x05,
+ RR_ENH_MEAS_REP_MSG_TYPE = 0x04
+} rr_short_peer_msg_type;
+
+typedef enum
+{
+ TEST_CLOSE_TCH_LOOP_MSG_TYPE = 0x0,
+ TEST_CLOSE_TCH_LOOP_ACK_MSG_TYPE = 0x01,
+ TEST_CLOSE_MULTI_LOOP_MSG_TYPE = 0x20,
+ TEST_CLOSE_MULTI_LOOP_ACK_MSG_TYPE = 0x21,
+ TEST_OPEN_LOOP_MSG_TYPE = 0x06,
+ TEST_OPEN_MULTI_LOOP_MSG_TYPE = 0x22,
+ TEST_OPEN_MULTI_LOOP_ACK_MSG_TYPE = 0x23,
+ TEST_DAI_TEST_MSG_TYPE = 0x14,
+ TEST_RESET_MS_POSITIONING_STORED_INFO_MSG_TYPE = 0x26,
+ TEST_RESET_UE_POSITIONING_STORED_INFO_MSG_TYPE = 0x48
+}
+rr_test_peer_msg_type;
+
+typedef enum
+{
+ rr_single_slot_cmd,
+ rr_multi_slot_cmd
+}
+rr_loop_cmd_type;
+
+typedef enum
+{
+ RR_PAGE_RESPONSE_LEN = 16,
+ RR_CLASSMARK_CHANGE_LEN = 10,
+ RR_GPRS_SUSPEND_REQUEST_LEN = 13,
+ RR_CLASSMARK_IE_LEN = 5
+}
+rr_peer_ie_len_type;
+
+typedef enum
+{
+ /* MS->NW */
+ RR__CIPHER_MODE_COMPLETE,
+ RR__ASSIGNMENT_COMPLETE,
+ RR__ASSIGNMENT_FAILURE,
+ RR__HANDOVER_COMPLETE,
+ RR__HANDOVER_FAILURE,
+ RR__EXTENDED_MEASUREMENT_REPORT,
+ RR__MEASUREMENT_REPORT,
+ RR__ENHANCED_MEASUREMENT_REPORT,
+ RR__CHANNEL_MODE_MODIFY_ACKNOWLEDGE,
+ RR__CHANNEL_REQUEST,
+ RR__CLASSMARK_CHANGE,
+ RR__UTRAN_CLASSMARK_CHANGE,
+ RR__RR_STATUS,
+ RR__GPRS_SUSPEND_REQUEST,
+ RR__PAGING_RESPONSE,
+
+ /* NW->MS */
+ RR__ADDITIONAL_ASSIGNMENT,
+ RR__IMMEDIATE_ASSIGNMENT,
+ RR__IMMEDIATE_ASSIGNMENT_EXTENDED,
+ RR__IMMEDIATE_ASSIGNMENT_REJ,
+ RR__CIPHER_MODE_COMMAND,
+ RR__ASSIGNMENT_COMMAND,
+ RR__PDCH_ASSIGNMENT_COMMAND,
+ RR__HANDOVER_COMMAND,
+ RR__PHYSICAL_INFORMATION,
+ RR__CHANNEL_RELEASE,
+ RR__PAGING_REQUEST_TYPE_1,
+ RR__PAGING_REQUEST_TYPE_2,
+ RR__PAGING_REQUEST_TYPE_3,
+ RR__EXTENDED_MEASUREMENT_ORDER,
+ RR__MEASUREMENT_INFORMATION,
+ RR__CHANNEL_MODE_MODIFY,
+ RR__CLASSMARK_ENQUIRY,
+ RR__FREQUENCY_REDEFINITION,
+ RR__INTER_SYSTEM_TO_UTRAN_HANDOVER_COMMAND,
+ /* NW->MS, system information */
+ RR__SI_1,
+ RR__SI_2,
+ RR__SI_2BIS,
+ RR__SI_2TER,
+ RR__SI_2QUATER,
+ RR__SI_2N,
+ RR__SI_3,
+ RR__SI_4,
+ RR__SI_5,
+ RR__SI_5BIS,
+ RR__SI_5TER,
+ RR__SI_6,
+ RR__SI_7,
+ RR__SI_8,
+ RR__SI_9,
+ RR__SI_13,
+
+ /* Both Direction */
+ RR__APPLICATION_INFO
+} rr_peer_msg_name_enum;
+
+typedef enum
+{
+ NO_VAL,
+ SI_NO_MSG,
+ SI_INVALID_LEN,
+ SI_CELL_ALLOC,
+ SI_RACH_CTRL_PARAMS,
+ SI_NEIGHBOR_CELL_LIST,
+ SI_NCC_PERMITTED,
+ SI_EXT_NEIGHBOR_CELL_LIST,
+ SI_CELL_ID,
+ SI_LA_ID,
+ SI_CTRL_CHAN_PARAMS,
+ SI_BCCH_CELL_OPTIONS,
+ SI_CELL_SEL_PARAMS,
+ SI_3_REST_OCTETS,
+ SI_CBCH_PARAMS,
+ SI_4_REST_OCTETS,
+ SI_SACCH_CELL_OPTIONS,
+ SI_SKIP_IND,
+ SI_PROTOCOL_DISCRIMINATOR,
+ SI_GPRS_MA_IE,
+ SI_NC_MEAS_ORDER,
+ SI_GPRS_CELL_OPTIONS,
+ SI_GPRS_PWR_CTRL_PARAMS,
+ SI_PBCCH_DESCR,
+ SI_FLD_ZERO_LEN,
+ SI_SCHED_INFO,
+ SI_9_REST_OCTETS
+}
+si_msg_fld_enum;
+
+typedef enum
+{
+ MSG_ALREADY_DECODED,
+ MSG_DECODED_SUCCESS
+}
+si_msg_decode_status_enum;
+
+typedef enum
+{
+ RMC_TMA_NO_MEANING = 0,
+ RMC_TMA_FIRST_MESSAGE
+}
+rmc_tma_value;
+
+typedef enum
+{
+ RMC_IAR_NONE = 0,
+ RMC_IAR_EGPRS_UL_ASGN,
+ RMC_IAR_BEF_TIME_FREQ_PRESENT,
+ RMC_IAR_UL_ASGN
+}
+rmc_iar_first_two_bit_value;
+
+typedef enum
+{
+ RMC_IAR_PKT_UL_ASGN = 0xc,
+ RMC_IAR_PKT_DL_ASGN,
+
+ /* Lanslo 20060413: fix Phx29 R99 phone fail in 41.2.3.1 and 41.2.3.2 (2nd part will be dropped) */
+#ifdef __EGPRS_MODE__
+ RMC_IAR_SEC_PART_PKT_ASGN2 =0xf,
+ RMC_IAR_PKT_EGPRS_UL_ASGN = 0x4,
+#else /* __EGPRS_MODE__ */
+ RMC_IAR_SEC_PART_PKT_ASGN2 =0xf,
+#endif /* __EGPRS_MODE__ */
+
+ RMC_IAR_SEC_PART_PKT_ASGN =0xe
+
+#if 0
+#ifdef __EGPRS_MODE__
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#else /* __EGPRS_MODE__ */
+/* under construction !*/
+#endif /* __EGPRS_MODE__ */
+#endif /* 0 */
+ /* eo Lanslo 20060413 */
+}
+rmc_iar_pkt_asgn_type;
+
+typedef enum
+{
+ /* Only reset the serving cell parameters. Neighbor cell meas info and PCCO raw data are not reset */
+ MEAS_RESET_SERV_PARAM,
+
+ /* Reset all meas parameters including the serving cell parameters, neighbor cell meas info, and PCCO raw data */
+ MEAS_RESET_ALL_PARAM,
+
+ /* Used for UT to reset parameters but not send MSG_ID_RR_MPAL_SET_GISE_CONTEXT_REQ to MPAL. */
+ MEAS_UNIT_TEST_RESET
+} meas_reset_scope_enum;
+
+typedef enum
+{
+ GAS_AGPS_RESET,
+ GAS_AGNSS_RESET
+}
+gas_reset_ms_positioning_tech;
+
+typedef enum
+{
+ RR_TIMER_NOT_RUNNING,
+ RR_TIMER_TIME_OUT
+}TIMER_STATE;
+
+#ifdef __CMCC_23G_PINGPONG_RESTRAIN__
+typedef enum
+{
+ RRM_PING_PONG_INIT,
+ RRM_PING_PONG_STAGE_1,
+ RRM_PING_PONG_STAGE_2
+}ping_pong_stage_enum;
+
+/*virtual pp exit*/
+typedef enum
+{
+ IR_VIRTUAL_INIT,
+ IR_VIRTUAL_FROM_2G_TO_3G,
+ IR_VIRTUAL_FROM_3G_TO_2G
+}virtual_ir_status_enum;
+#endif
+
+#if defined(__MTK_TARGET__) && defined( __MD97__)
+typedef enum
+{
+ RRM_SET_RAT_MODE,
+ RRM_PLMN_SEARCH,
+ RRM_STANDBY_MEAS,
+ RRM_NONE
+}rrm_efuse_enum;
+#endif /* defined(__MTK_TARGET__) && defined( __MD97__) */
+
+#endif /* _RRM_ENUMS_H */
diff --git a/mcu/protocol/interface/general/rsvak_public_enum.h b/mcu/protocol/interface/general/rsvak_public_enum.h
new file mode 100644
index 0000000..6d72558
--- /dev/null
+++ b/mcu/protocol/interface/general/rsvak_public_enum.h
@@ -0,0 +1,132 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/****************************************************************************
+ * PARTS OF THIS FILE ARE AUTOGENERATED
+ * DO NOT EDIT EXCEPT BETWEEN LINES MARKED !BEGIN MANUAL CODE and !END MANUAL CODE
+ * Assignment :
+ * CONFIDENTIAL
+ * Copyright (c) 2000-2005, UbiNetics Ltd. All rights reserved.
+ * Cambridge Technology Centre
+ * Melbourn Royston
+ * Herts SG8 6DP UK
+ * Tel: +44 1763 262222
+ *
+ ****************************************************************************
+ * !BEGIN MANUAL CODE! (HEADERS)
+ *
+ * COMPONENT: (Insert Component Name)
+ * MODULE: $RCSfile: rsvak_public_enum.h,v $
+ * VERSION: $Revision: 1.0 $
+ * DATED: $Date: 2019/01/28 14:22:29 $
+ * AUTHOR:
+ * DESCRIPTION: Check Header for full description
+ *
+ ****************************************************************************/
+/* !END MANUAL CODE! (HEADERS) */
+
+
+#if !defined(_RSVAK_PUBLIC_ENUM_H)
+#define _RSVAK_PUBLIC_ENUM_H
+
+typedef enum
+{
+ RSVAK_MSPM_RFDB_CONFIG, //0, MSPM specific
+ RSVAK_PLMN_SEARCH_STORED_DCH_IDLE_LIST_IN_CONNECTED, //50, UAS specific
+ RSVAK_USER_PLMN_LIST_IN_NO_SERVICE_IN_CONNECTED, //200, UAS specific
+ RSVAK_USER_PLMN_SEARCH_IN_CONNECTED, //200, UAS specific
+ RSVAK_USER_PLMN_SEARCH_EMERGENCY_CALL_IN_CONNECTED, //200, UAS specific
+ RSVAK_USER_PLMN_LIST_IN_NO_SERVICE_FULL_BAND_IN_CONNECTED,//250, UAS specific
+ RSVAK_USER_PLMN_SEARCH_FULL_BAND_IN_CONNECTED, //250, UAS specific
+ RSVAK_USER_PLMN_SEARCH_EMERGENCY_CALL_FULL_BAND_IN_CONNECTED, //250, UAS specific
+ RSVAK_USER_PLMN_LIST_STORED_LIST_IN_CONNECTED, //400, UAS specific
+ RSVAK_USER_PLMN_LIST_STORED_LIST_FULL_BAND_IN_CONNECTED, //450, UAS specific
+ RSVAK_MM_PLMN_SEARCH_POWERON_IN_CONNECTED, //520, UAS specific
+ RSVAK_MM_PLMN_SEARCH_POWERON_FULL_BAND_IN_CONNECTED, //560, UAS specific
+ RSVAK_MM_PLMN_SEARCH_IN_CONNECTED, //600, UAS specific
+ RSVAK_AS_CELL_SELECTION_IN_CONNECTED, //600, UAS specific
+ RSVAK_EVALUATE_CSG_CELL_IN_CONNECTED, //600, UAS specific
+ RSVAK_MM_PLMN_SEARCH_FULL_BAND_IN_CONNECTED, //650, UAS specific
+ RSVAK_AS_CELL_SELECTION_FULL_BAND_IN_CONNECTED, //650, UAS specific
+ RSVAK_EVALUATE_CSG_CELL_FULL_BAND_IN_CONNECTED, //650, UAS specific
+ RSVAK_MM_PLMN_LIST_IN_CONNECTED, //800, UAS specific
+ RSVAK_MM_PLMN_LIST_FULL_BAND_CONNECTED, //850, UAS specific
+ RSVAK_SIM_PROTECTION, //2000, EAS specific
+ RSVAK_SIM_PROTECTION_FULL_BAND, //2050, EAS specific
+ RSVAK_MM_PLMN_SEARCH_STORED_DCH_IDLE_LIST, //2050, UAS specific
+ RSVAK_AS_AFR, //2100
+ RSVAK_AUTO_GAP, //2100
+ RSVAK_GEMINI_RESUME, //2150
+ RSVAK_GEMINI_ABORT_SEARCH, //2150, NAS specific
+ RSVAK_EMC_SESSION, //2200
+ RSVAK_USER_PLMN_SEARCH, //2200
+ RSVAK_USER_PLMN_LIST_IN_NO_SERVICE, //2200
+ RSVAK_GAS_RSIM_VC_RESUME, //2200
+ RSVAK_EMC_SESSION_FULL_BAND, //2250
+ RSVAK_USER_PLMN_SEARCH_FULL_BAND, //2250
+ RSVAK_USER_PLMN_LIST_IN_NO_SERVICE_FULL_BAND, //2250
+ RSVAK_GAS_RSIM_VC_RESUME_FULL_BAND, //2250
+ RSVAK_USER_PLMN_LIST_IN_SERVICE, //2400
+ RSVAK_USER_PLMN_LIST_IN_SERVICE_FULL_BAND, //2450
+ RSVAK_MM_PLMN_SEARCH_IN_POWER_ON, //2520
+ RSVAK_AS_AFR_FULL_BAND, //2550
+ RSVAK_MM_PLMN_SEARCH_IN_POWER_ON_FULL_BAND, //2560
+ RSVAK_AS_CELL_SELECTION_CALL, //2590, EAS/NAS specific, used when there is call ongoing
+ RSVAK_MM_PLMN_SEARCH, //2600
+ RSVAK_AS_CELL_SELECTION, //2600
+ RSVAK_AS_CSG_CELL_EVALUATION, //2600
+ RSVAK_AS_CELL_SELECTION_CALL_FULL_BAND, //2640, EAS/NAS specific, used when there is call ongoing
+ RSVAK_MM_PLMN_SEARCH_FULL_BAND, //2650
+ RSVAK_AS_CELL_SELECTION_FULL_BAND, //2650
+ RSVAK_AS_CSG_CELL_EVALUATION_FULL_BAND, //2650
+ RSVAK_GEMINI_RESUME_FULL_BAND, //2650, EAS specific
+ RSVAK_AS_BACKGROUND_SEARCH, //2700
+ RSVAK_AS_BACKGROUND_SEARCH_FULL_BAND, //2750
+ RSVAK_AS_REPORT_CGI, //2800
+ RSVAK_MM_PLMN_LIST, //2800
+ RSVAK_AS_CSG_AUTONOMOUS_SEARCH, //2800
+ RSVAK_AS_REPORT_CGI_FULL_BAND, //2850
+ RSVAK_MM_PLMN_LIST_FULL_BAND, //2850
+ RSVAK_AS_CSG_AUTONOMOUS_SEARCH_FULL_BAND, //2850
+ RSVAK_AS_FINGERPRINT, //3000
+ RSVAK_AS_FINGERPRINT_FULL_BAND, //3050
+ RSVAK_AS_MCC_LEARNING, //3400
+ RSVAK_AS_MCC_LEARNING_FULL_BAND, //3450
+ RSVAK_FAST_RECOVERY, //9000, GAS specific
+ RSVAK_FAST_RECOVERY_FULLBAND, //9050, GAS specific
+ RSVAK_FREQ_SCAN_TYPE_ENUM_NUM
+}freq_scan_type_enum;
+
+#endif /* _RSVAK_PUBLIC_ENUM_H */
diff --git a/mcu/protocol/interface/general/rsvas_enum.h b/mcu/protocol/interface/general/rsvas_enum.h
new file mode 100644
index 0000000..e95d8e2
--- /dev/null
+++ b/mcu/protocol/interface/general/rsvas_enum.h
@@ -0,0 +1,326 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/****************************************************************************
+ * PARTS OF THIS FILE ARE AUTOGENERATED
+ * DO NOT EDIT EXCEPT BETWEEN LINES MARKED !BEGIN MANUAL CODE and !END MANUAL CODE
+ * Assignment :
+ * CONFIDENTIAL
+ * Copyright (c) 2000-2005, UbiNetics Ltd. All rights reserved.
+ * Cambridge Technology Centre
+ * Melbourn Royston
+ * Herts SG8 6DP UK
+ * Tel: +44 1763 262222
+ *
+ ****************************************************************************
+ * !BEGIN MANUAL CODE! (HEADERS)
+ *
+ * COMPONENT: (Insert Component Name)
+ * MODULE: $RCSfile: rsvas_enum.h,v $
+ * VERSION: $Revision: 1.0 $
+ * DATED: $Date: 2009/06/12 14:22:29 $
+ * AUTHOR:
+ * DESCRIPTION: Check Header for full description
+ *
+ ****************************************************************************/
+/* !END MANUAL CODE! (HEADERS) */
+/*****************************************************************************
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ ****************************************************************************/
+
+#if !defined(_RSVAS_ENUM_H)
+#define _RSVAS_ENUM_H
+
+#include <c2k_rsva_enums.h>
+
+#define RSVAS_GET_BYTE1_FROM_ENUM(x) ((((kal_uint32)(x))>>24) & 0x000000FF)
+#define RSVAS_GET_BYTE2_FROM_ENUM(x) ((((kal_uint32)(x))>>16) & 0x000000FF)
+#define RSVAS_GET_BYTE3_FROM_ENUM(x) ((((kal_uint32)(x))>> 8) & 0x000000FF)
+#define RSVAS_GET_BYTE4_FROM_ENUM(x) (((kal_uint32)(x)) & 0x000000FF)
+
+
+#define RSVAS_INVALID_SIM_INDEX 0x000000FF
+#define RSVAS_INVALID_RAT_INDEX 0x000000FF
+
+/* Dennis Weng 2010/02/26: [SIM_ADD_HERE] if support tri-SIM in the future, just add as following code. */
+/* Dennis Weng 2010/02/26: [RAT_ADD_HERE] if support another RAT in the future, just add as following code. */
+/* Dennis Weng 2010/03/05: for effective, rsvas_id_enum is designed as a bit structure
+ 1st byte is unique in this enum, start from 0,
+ 2nd byte is SIM index, start from 0, otherwise fill 0xFF.
+ 3rd byte is RAT index, start from 0, otherwise fill 0xFF.
+ 4th byte is FORCE PREEMPT index, start from 0, otherwise fill 0xFF.
+ FORCE PREEMP index is the index of modules which may send RESOURCE_RES_OCCUPY_REQ with OCCUPY_FORCE_PREEMPT. */
+#define RSVAS_GET_SIM_INDEX_FROM_ENUM(x) RSVAS_GET_BYTE2_FROM_ENUM(x)
+#define RSVAS_GET_RAT_INDEX_FROM_ENUM(x) RSVAS_GET_BYTE3_FROM_ENUM(x)
+
+/* Dennis Weng 2010/10/15: mapping SIM index and RAT index to rsvas_id_enum
+ only for AS
+ PS. cannot not input RSVAS_INVALID_SIM_INDEX or RSVAS_INVALID_RAT_INDEX */
+#define RSVAS_GET_RSVAS_ID_ENUM_FROM_INDEX(sim_index, rat_index) ((rsvas_id_enum)(((((((((sim_index)*7)+(rat_index+1)) << 8)+sim_index) << 8) + rat_index) << 8) + 0xFF))
+
+/* Dennis Weng 2010/10/15: shift rsvas_id_enum by SIM index */
+#define RSVAS_SHIFT_RSVAS_ID_ENUM(x, sim_index) ((rsvas_id_enum)((x)+(((((sim_index)*7) << 8)+(sim_index)) << 16)))
+
+/* From Gen93, EL2 is devided into 3 task and each task need to send suspend_req individually
+ In order to send suspend_req in correct sequence, RSVAS ask EL2 to set sending sequence firstly by calling rsvas_update_el2_suspend_sequence
+ The LSB 2 bit represent first module to send suspend_req, and so on : */
+#define el2_first_module(x) ((x) & 0x03)
+#define el2_second_module(x) ((x>>2) & 0x03)
+#define el2_third_module(x) ((x>>4) & 0x03)
+
+typedef enum
+{
+ RSVAS_MODE_SWITCH_INIT = 0,
+ RSVAS_MODE_SWITCH_START = 1,
+ RSVAS_MODE_SWITCH_CNF_SEND = 2,
+} rsvas_mode_switch_status;
+
+typedef enum
+{
+ RSVAS_GEMINI_CONFIG_NEEDED = 0,
+ RSVAS_GEMINI_CONFIG_START = 1,
+ RSVAS_GEMINI_CONFIG_END = 2,
+} rsvas_gemini_config_status;
+
+
+typedef enum {
+ RSVAS_SIM_CONNECTED = 0,
+ RSVAS_SIM_LIMITED_CONNECTED = 1,
+ RSVAS_SIM_VIRTUAL_CONNECTED = 2,
+ RSVAS_SIM_IDLE_WITH_SERVICE = 3,
+ RSVAS_SIM_IDLE = 4,
+ RSVAS_SIM_VIRTUAL = 5,
+ RSVAS_SIM_LIMITED_VIRTUAL = 6,
+ RSVAS_SIM_SUSPENDED = 7,
+ RSVAS_SIM_STATUS_NUM = 8
+} rsvas_sim_status;
+
+typedef enum {
+ RSVAS_SIM_INVALID_TRANSITION = 0,
+
+ RSVAS_SIM_STEADY_CONNECTED = 1,
+ RSVAS_SIM_CONNECTED2IDLE = 2,
+
+ RSVAS_SIM_STEADY_IDLE_WITH_SERVICE = 3,
+
+ RSVAS_SIM_STEADY_IDLE = 4,
+ RSVAS_SIM_IDLE2CONNECTED = 5,
+ RSVAS_SIM_IDLE2VIRTUAL = 6,
+ RSVAS_SIM_IDLE2SUSPENDED = 7,
+
+ RSVAS_SIM_STEADY_VIRTUAL = 8,
+ RSVAS_SIM_VIRTUAL2CONNECTED = 9,
+ RSVAS_SIM_VIRTUAL2SUSPENDED = 10,
+
+ RSVAS_SIM_STEADY_SUSPENDED = 11,
+
+ RSVAS_SIM_STEADY_VIRTUAL_CONNECTED = 12,
+ RSVAS_SIM_VIRTUALCONNECTED2CONNECTED = 13,
+ RSVAS_SIM_CONNECTED2VIRTUALCONNECTED = 14,
+ RSVAS_SIM_VIRTUALCONNECTED2SUSPENED = 15,
+ RSVAS_SIM_VIRTUALCONNECTED2VIRTUAL = 16,
+ RSVAS_SIM_SUSPENDED2CONNECTED = 17,
+ RSVAS_SIM_SUSPENDED2IDLE = 18,
+ RSVAS_SIM_VIRTUAL2IDLE = 19,
+ RSVAS_SIM_SUSPENDED2VIRTUAL = 20,
+
+ RSVAS_SIM_STEADY_LIMITED_CONNECTED = 21,
+ RSVAS_SIM_LIMITEDCONNECTED2CONNECTED = 22,
+ RSVAS_SIM_CONNECTED2LIMITEDCONNECTED = 23,
+ RSVAS_SIM_LIMITEDCONNECTED2VIRTUALCONNECTED = 24,
+ RSVAS_SIM_VIRTUALCONNECTED2LIMITEDCONNECTED = 25,
+ RSVAS_SIM_LIMITEDCONNECTED2IDLE = 26,
+ RSVAS_SIM_LIMITEDCONNECTED2SUSPENDED = 27,
+ RSVAS_SIM_LIMITEDCONNECTED2VIRTUAL = 28,
+ RSVAS_SIM_LIMITEDCONNECTED2LIMITEDVIRTUAL = 29,
+
+ RSVAS_SIM_STEADY_LIMITED_VIRTUAL = 30,
+ RSVAS_SIM_LIMITEDVIRTUAL2LIMITEDCONNECTED = 31,
+ RSVAS_SIM_LIMITEDVIRTUAL2CONNECTED = 32,
+ RSVAS_SIM_LIMITEDVIRTUAL2IDLE = 33,
+ RSVAS_SIM_LIMITEDVIRTUAL2VIRTUAL = 34,
+ RSVAS_SIM_LIMITEDVIRTUAL2SUSPENDED = 35,
+ RSVAS_SIM_CONNECTED2LIMITEDVIRTUAL = 36,
+ RSVAS_SIM_VIRTUALCONNECTED2LIMITEDVIRTUAL = 37,
+ RSVAS_SIM_IDLE2LIMITEDVIRTUAL = 38,
+ RSVAS_SIM_VIRTUAL2LIMITEDVIRTUAL = 39,
+ RSVAS_SIM_SUSPENDED2LIMITEDVIRTUAL = 40,
+
+ RSVAS_SIM_TRANSITION_NUM = 41
+} rsvas_sim_transition;
+
+typedef enum
+{
+ RSVAS_REQUEST_SOURCE_RSIM_ACCESS = 0
+ ,RSVAS_REQUEST_SOURCE_SRLTE_ENHANCEMENT = 1
+ ,RSVAS_REQUEST_SOURCE_SRLTE_ENHANCEMENT_TOLERENT = 2
+} rsvas_virtual_connect_request_type_enum;
+
+/**
+ * For GEN97
+ */
+typedef enum {
+ RSVAS_CONNECTED_AFTER_VC_RESUME,
+ RSVAS_SUSPEND_AFTER_VC_RESUME, //for race condition, AS release service before return VC_suspend_cnf
+ RSVAS_VIRTUAL_IDLE_AFTER_VC_RESUME, //for race condition, AS release service before return VC_suspend_cnf
+ RSVAS_ABORT_SUSPEND_AFTER_VC_RESUME, //AS release connection in VC
+ RSVAS_ABORT_VIRTUAL_IDLE_AFTER_VC_RESUME, //AS release connection in VC
+ RSVAS_ABORT_IDLE_AFTER_VC_RESUME, //AS release connection in VC
+} rsvas_virtual_connected_resume_action_enum;
+
+
+/**
+ * For DR-DSDS/DSDA
+ */
+typedef enum {
+ RSVAS_GEMINI_GAP_ALLOWED = 0
+ ,RSVAS_GEMINI_GAP_NOT_ALLOWED = 1
+} rsvas_gemini_gap_status_enum;
+
+#endif /* _RSVAS_ENUM_H */
+
diff --git a/mcu/protocol/interface/general/rsvas_struct.h b/mcu/protocol/interface/general/rsvas_struct.h
new file mode 100644
index 0000000..57e0679
--- /dev/null
+++ b/mcu/protocol/interface/general/rsvas_struct.h
@@ -0,0 +1,533 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/****************************************************************************
+ * PARTS OF THIS FILE ARE AUTOGENERATED
+ * DO NOT EDIT EXCEPT BETWEEN LINES MARKED !BEGIN MANUAL CODE and !END MANUAL CODE
+ * Assignment :
+ * CONFIDENTIAL
+ * Copyright (c) 2000-2005, UbiNetics Ltd. All rights reserved.
+ * Cambridge Technology Centre
+ * Melbourn Royston
+ * Herts SG8 6DP UK
+ * Tel: +44 1763 262222
+ *
+ ****************************************************************************
+ * !BEGIN MANUAL CODE! (HEADERS)
+ *
+ * COMPONENT: (Insert Component Name)
+ * MODULE: $RCSfile: rsvas_struct.h,v $
+ * VERSION: $Revision: 1.0 $
+ * DATED: $Date: 2009/06/12 14:22:29 $
+ * AUTHOR:
+ * DESCRIPTION: Check Header for full description
+ *
+ ****************************************************************************/
+/* !END MANUAL CODE! (HEADERS) */
+/*****************************************************************************
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ ****************************************************************************/
+
+#if !defined(_RSVAS_STRUCT_H)
+#define _RSVAS_STRUCT_H
+
+#include "rsvas_enum.h"
+#include "kal_public_api.h"
+#include "kal_general_types.h"
+#include "l3_inc_enums.h"
+#include "c2k_rsva_struct.h"
+
+#define RSVA_MAX_USER_CALLER 32
+
+extern kal_uint32 rsva_ack_bitmask;
+extern kal_eventgrpid rsva_evg;
+
+extern kal_uint32 rsva_evg_get_available_ack_slot(void);
+extern void rsva_evg_ack_slot(kal_uint32 ack);
+extern void rsva_evg_free_slot(kal_uint32 ack);
+
+
+
+#ifdef UNIT_TEST
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool result;
+} rsvas_ut_result_ind_struct;
+
+#if defined(__ETWS_SUPPORT__) || defined(__LTE_RAT__)
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool success;
+} rsvas_as_update_etws_priority_cnf_struct;
+#endif /* __ETWS_SUPPORT__ || __LTE_RAT__ */
+#endif /* UNIT_TEST */
+
+typedef struct {
+ LOCAL_PARA_HDR
+ rsvas_id_enum id;
+ kal_uint32 event_ack; /* bitmap for event group*/
+} rsvas_service_common_struct;
+
+#if defined(__GSM_RAT__)
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 peer_service_priority;
+} rsvas_gas_suspend_service_req_struct;
+#endif /* __GSM_RAT__ */
+
+#if defined(__UMTS_RAT__)
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 peer_service_priority;
+} rsvas_uas_suspend_service_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 peer_service_priority;
+} rsvas_ul2_suspend_service_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 peer_service_priority;
+} rsvas_ul2d_suspend_service_req_struct;
+#endif /* __UMTS_RAT__ */
+
+#if defined(__LTE_RAT__)
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 peer_service_priority;
+} rsvas_eas_suspend_service_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ rsvas_sim_enum target_sim;
+ kal_uint8 peer_service_priority;
+} rsvas_el2hportal_suspend_service_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ rsvas_sim_enum target_sim;
+ kal_uint8 peer_service_priority;
+} rsvas_emacdlportal_suspend_service_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ rsvas_sim_enum target_sim;
+ kal_uint8 peer_service_priority;
+} rsvas_el2portal_suspend_service_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool enter_meta_mode;
+} rsvas_el1_suspend_req_struct;
+
+
+#endif /* __LTE_RAT__ */
+
+#if defined(__NR_RAT__)
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 peer_service_priority;
+} rsvas_nrrc_suspend_service_req_struct;
+#endif /* __NR_RAT__ */
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 peer_service_priority;
+ rsvas_sim_enum target_sim;
+} rsvas_las_suspend_service_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ rsvas_sim_enum target_sim;
+} rsvas_las_suspend_service_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ rsvas_sim_enum target_sim;
+} rsvas_las_resume_service_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ rsvas_sim_enum target_sim;
+} rsvas_las_resume_service_cnf_struct;
+
+#if defined(__LTE_RAT__)
+typedef struct {
+ LOCAL_PARA_HDR
+ rsvas_gemini_gap_status_enum gemini_gap_status;
+} rsvas_eas_resume_service_req_struct;
+#endif
+
+#if defined(__NR_RAT__)
+typedef struct {
+ LOCAL_PARA_HDR
+ rsvas_gemini_gap_status_enum gemini_gap_status;
+} rsvas_nrrc_resume_service_req_struct;
+#endif
+
+
+#if defined(__GSM_RAT__)
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 peer_service_priority;
+ rsvas_abort_action_enum action;
+} rsvas_gas_abort_service_req_struct;
+#endif /* __GSM_RAT__ */
+
+#if defined(__UMTS_RAT__)
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 peer_service_priority;
+ rsvas_abort_action_enum action;
+} rsvas_uas_abort_service_req_struct;
+#endif /* __UMTS_RAT__ */
+
+#if defined(__LTE_RAT__)
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 peer_service_priority;
+ rsvas_abort_action_enum action;
+} rsvas_eas_abort_service_req_struct;
+#endif /* __LTE_RAT__ */
+
+#if defined(__NR_RAT__)
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 peer_service_priority;
+ rsvas_abort_action_enum action;
+} rsvas_nrrc_abort_service_req_struct;
+#endif /* __NR_RAT__ */
+
+#if defined(__GSM_RAT__)
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 peer_service_priority;
+ rsvas_sim_enum sim_in_transfer;
+} rsvas_gas_virtual_suspend_service_req_struct;
+#endif /* __GSM_RAT__ */
+
+#if defined(__UMTS_RAT__)
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 peer_service_priority;
+} rsvas_uas_virtual_suspend_service_req_struct;
+#endif /* __UMTS_RAT__ */
+
+#if defined(__LTE_RAT__)
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 peer_service_priority;
+} rsvas_eas_virtual_suspend_service_req_struct;
+#endif /* __LTE_RAT__ */
+
+#if defined(__NR_RAT__)
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 peer_service_priority;
+} rsvas_nrrc_virtual_suspend_service_req_struct;
+#endif /* __NR_RAT__ */
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 peer_service_priority;
+ rsvas_sim_enum target_sim;
+} rsvas_las_virtual_suspend_service_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ rsvas_sim_enum target_sim;
+} rsvas_las_virtual_suspend_service_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ rsvas_sim_enum target_sim;
+} rsvas_las_virtual_resume_service_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ rsvas_id_enum id;
+ kal_bool is_call_prefer;
+} rsvas_as_preference_mode_req_struct;
+
+
+typedef struct {
+ LOCAL_PARA_HDR
+ rsvas_sim_enum target_sim;
+} rsvas_las_virtual_resume_service_cnf_struct;
+
+#if defined(__LTE_RAT__)
+typedef struct {
+ LOCAL_PARA_HDR
+ rsvas_gemini_gap_status_enum gemini_gap_status;
+} rsvas_eas_virtual_resume_service_req_struct;
+#endif
+
+#if defined(__NR_RAT__)
+typedef struct {
+ LOCAL_PARA_HDR
+ rsvas_gemini_gap_status_enum gemini_gap_status;
+} rsvas_nrrc_virtual_resume_service_req_struct;
+#endif
+
+
+/* Dennis Weng 2011/05/26: move to as2l4c_struct.h */
+//typedef struct {
+// LOCAL_PARA_HDR
+// kal_bool is_turn_on;
+//} rsvas_monitor_peer_pch_switch_req_struct;
+
+#if defined(__ETWS_SUPPORT__) || defined(__LTE_RAT__)
+typedef struct {
+ LOCAL_PARA_HDR
+ rsvas_id_enum id;
+ kal_uint32 event_ack; /* bitmap for event group*/
+ kal_bool is_protect_req;
+} rsvas_as_update_etws_priority_req_struct;
+#endif /* __ETWS_SUPPORT__ || __LTE_RAT__ */
+
+typedef struct {
+ LOCAL_PARA_HDR
+ rat_enum rat_mode;
+} rac_rsvas_set_rat_mode_req_struct;
+
+
+#if defined(__GSM_RAT__)
+typedef struct {
+ LOCAL_PARA_HDR
+ rsvas_sim_enum sim_in_transfer;
+ rsvas_virtual_connect_request_type_enum request_source;
+} rsvas_gas_virtual_connected_suspend_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_abort;
+ rsvas_virtual_connected_resume_action_enum resume_action;
+} rsvas_gas_virtual_connected_resume_req_struct;
+#endif /* __GSM_RAT__ */
+
+#if defined(__UMTS_RAT__)
+typedef struct {
+ LOCAL_PARA_HDR
+ rsvas_sim_enum sim_in_transfer;
+ rsvas_virtual_connect_request_type_enum request_source;
+} rsvas_uas_virtual_connected_suspend_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_abort;
+ rsvas_virtual_connected_resume_action_enum resume_action;
+} rsvas_uas_virtual_connected_resume_req_struct;
+#endif /* __UMTS_RAT__ */
+
+#if defined(__LTE_RAT__)
+typedef struct {
+ LOCAL_PARA_HDR
+ rsvas_sim_enum sim_in_transfer;
+ rsvas_virtual_connect_request_type_enum request_source;
+} rsvas_eas_virtual_connected_suspend_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_abort;
+ rsvas_virtual_connected_resume_action_enum resume_action;
+} rsvas_eas_virtual_connected_resume_req_struct;
+#endif /* __LTE_RAT__ */
+
+#if defined(__NR_RAT__)
+typedef struct {
+ LOCAL_PARA_HDR
+ rsvas_sim_enum sim_in_transfer;
+ rsvas_virtual_connect_request_type_enum request_source;
+} rsvas_nrrc_virtual_connected_suspend_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_abort;
+ rsvas_virtual_connected_resume_action_enum resume_action;
+} rsvas_nrrc_virtual_connected_resume_req_struct;
+#endif /* __NR_RAT__ */
+
+#if defined(__LTE_RAT__)
+typedef struct {
+ LOCAL_PARA_HDR
+ rsvas_gemini_gap_status_enum gemini_gap_status;
+} rsvas_eas_virtual_mode_update_req_struct;
+#endif
+
+#if defined(__NR_RAT__)
+typedef struct {
+ LOCAL_PARA_HDR
+ rsvas_gemini_gap_status_enum gemini_gap_status;
+} rsvas_nrrc_virtual_mode_update_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_enter_dsda;
+} rsvas_nrrc_gemini_mode_update_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+} rsvas_nrrc_gemini_mode_update_cnf_struct;
+#endif
+
+#endif /* _RSVAS_STRUCT_H */
+
diff --git a/mcu/protocol/interface/general/rsvas_utils.h b/mcu/protocol/interface/general/rsvas_utils.h
new file mode 100644
index 0000000..29758a2
--- /dev/null
+++ b/mcu/protocol/interface/general/rsvas_utils.h
@@ -0,0 +1,184 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/****************************************************************************
+ * PARTS OF THIS FILE ARE AUTOGENERATED
+ * DO NOT EDIT EXCEPT BETWEEN LINES MARKED !BEGIN MANUAL CODE and !END MANUAL CODE
+ * Assignment :
+ * CONFIDENTIAL
+ * Copyright (c) 2000-2005, UbiNetics Ltd. All rights reserved.
+ * Cambridge Technology Centre
+ * Melbourn Royston
+ * Herts SG8 6DP UK
+ * Tel: +44 1763 262222
+ *
+ ****************************************************************************
+ * !BEGIN MANUAL CODE! (HEADERS)
+ *
+ * COMPONENT: (Insert Component Name)
+ * MODULE: $RCSfile: rsvas_utils.h,v $
+ * VERSION: $Revision: 1.0 $
+ * DATED: $Date: 2009/06/12 14:22:29 $
+ * AUTHOR:
+ * DESCRIPTION: Check Header for full description
+ *
+ ****************************************************************************/
+/* !END MANUAL CODE! (HEADERS) */
+/*****************************************************************************
+ * $Log:$
+ *
+ * 10 31 2018 yuhhwang.yu
+ * [MOLY00361478] [Gen97] Gemini Compile Option Clean Up
+ * .
+ *
+ * 05 15 2018 chester-zd.huang
+ * [MOLY00326014] [Gen95][MSPM] SW changes check in UMOLYE
+ * RSVAS Main Code.
+ *
+ * 08 18 2017 yuhhwang.yu
+ * [MOLY00271925] [SRLTE Enhancement][UMOLYA] RSVA code sync
+ * .
+ *
+ * 02 24 2017 farming.tseng
+ * [MOLY00228414] RSVAS dispatch suspend_req to EL2 in sequence.
+ *
+ * 11 19 2015 yuhhwang.yu
+ * [MOLY00148584] [RSVAS] add debug info for trace confirm primitive bitmask
+ * . add callback function to trace cnf bitmask
+ *
+ * 01 22 2014 nicky.chou
+ * [MOLY00052913] [RSVA][CSE] LTE Gemini modification
+ * .
+ *
+ * 11 21 2013 nicky.chou
+ * [MOLY00045854] [PS1267 HG+WG] Check-in Gemini HG+WG modification
+ * .
+ *
+ * 06 13 2012 justin.li
+ * removed!
+ * .
+ *
+ * 05 25 2012 justin.li
+ * removed!
+ * .
+ *
+ * 04 24 2012 wcpuser_integrator
+ * removed!
+ * .
+ *
+ * 11 06 2011 justin.li
+ * removed!
+ * .
+ *
+ * 10 06 2011 justin.li
+ * removed!
+ * .
+ *
+ * 10 05 2011 justin.li
+ * removed!
+ * .
+ *
+ * 06 24 2011 dennis.weng
+ * removed!
+ * .
+ *
+ * 04 25 2011 dennis.weng
+ * removed!
+ * .
+ *
+ * 03 16 2011 dennis.weng
+ * removed!
+ * .
+ *
+ * 02 22 2011 dennis.weng
+ * removed!
+ * .
+ *
+ * 01 26 2011 dennis.weng
+ * removed!
+ * .
+ *
+ * 12 14 2010 dennis.weng
+ * removed!
+ * .
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ ****************************************************************************/
+
+#if !defined(_RSVAS_UTILS_H)
+#define _RSVAS_UTILS_H
+
+#include "rsvas_enum.h"
+#include "kal_general_types.h"
+#include "kal_public_defs.h" //MSBB change #include "stack_config.h"
+#include "kal_public_defs.h" //MSBB change #include "stack_msgs.h"
+
+/* Nicky Chou 2012/10/19: Request by GAS so that they can query whether other SIMs is in Virtual Mode. */
+extern kal_bool is_rsvas_virtual_mode_query_by_sim(const rsvas_sim_enum sim_index);
+
+extern void rsvas_check_cnf_bitmask(void);
+
+#if defined(__ETWS_SUPPORT__) || defined(__LTE_RAT__)
+extern kal_bool rsvas_update_etws_channel_priority(const module_type mod_src, const rsvas_id_enum id, const kal_bool is_protect_req);
+
+extern rsvas_id_enum rsvas_etws_owner_query(void);
+#endif /* __ETWS_SUPPORT__ || __LTE_RAT__ */
+
+extern void rsvas_update_el2_suspend_sequence(const kal_uint32 rsvas_send_el2_suspend_sequence);
+
+/* Dennis Weng 2010/03/08: this function is used in RSVAS internel.
+ other module should not use it. */
+ /* Dennis Weng 2010/06/30: it should use ALLOC_SEND_ILM proposed by system service */
+extern void rsvas_alloc_send_ilm(const module_type mod_src, const module_type mod_dest, const sap_type sap, const msg_type msg, void const * local_para_ptr);
+
+#endif /* _RSVAS_UTILS_H */
diff --git a/mcu/protocol/interface/general/scsi.h b/mcu/protocol/interface/general/scsi.h
new file mode 100644
index 0000000..16f7409
--- /dev/null
+++ b/mcu/protocol/interface/general/scsi.h
@@ -0,0 +1,1031 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+/******************************************************************************
+ * Filename:
+ * --------------------------------------------------------
+ * scsi.h
+ *
+ * Project:
+ * --------------------------------------------------------
+ * MONZA
+ *
+ * Description:
+ * --------------------------------------------------------
+ * Implementation of Scsi class.
+ *
+ * Author:
+ * --------------------------------------------------------
+ * -------
+ *
+ * --------------------------------------------------------
+ * $Log$
+ *
+ * 10 22 2021 peter.chiang
+ * [MOLY00624048] [AT&T] CDR-FVG-3900 FirstNet-5G Device Radio Requirements - Phase 1b
+ *
+ * [SCSI] disable N5
+ *
+ * 09 28 2020 esko.oikarinen
+ * [MOLY00557246] [P200803-00845] [MTK][5G][A326B] AT+EPBSEH ?í??´í? ue capa info ?? nr41,79 ?¬ë¼ê°??? ?ì?
+ *
+ * 06 14 2019 harish.reddy
+ * [MOLY00413294] [CODE SYNC] ?TOP??NL-BD236??FT??T-Mobile??Free_test?Manual search and register KPN 4G?appear modemCrash?3/5?
+ *
+ * 05 22 2019 vinayak.bandagi
+ * [MOLY00400913] [CODE SYNC][MH4ATT_P][Protocol][10776] cannot find 348-300-3G(1900) during LTE-BTR-1-1150
+ *
+ * 03 07 2019 shreya.raizada
+ * [MOLY00367497] [CODE SYNC] [MT3967][Eiger][O1][MD Static Test][CMW Cards][China][Auto] Incorrect UTRAN FDD bands are filled in the utra UE-CapabilityRAT-Container
+ * .
+ *
+ * 11 29 2018 peter.chiang
+ * [MOLY00366835] [Gen97] Dedicated Priority and Deprioritization SCSI Interface Change
+ * SCSI interface changes for NR
+ *
+ * 10 31 2018 vend_mtb_aritha002
+ * [MOLY00361478] [Gen97] Gemini Compile Option Clean Up
+ *
+ * Compile Option change for __GEMINI_MONITOR_PAGE_DURING_TRANSFER__ , __GEMINI_PREEMPT_PEER_SERVICE__ , __REMOTE_SIM__ and __PLMN_LIST_IN_VIRTUAL_MODE__
+ *
+ * 08 29 2018 peter.chiang
+ * [MOLY00348756] [VMOLY]SCSI Patchback
+ * .
+ *
+ * 08 28 2018 peter.chiang
+ * [MOLY00348756] [VMOLY]SCSI Patchback
+ * [SCSI] patchback for NR supportband Bitmask
+ *
+ * 12 14 2017 vend_mtb_aritha001
+ * [MOLY00296081] [OPPO_FT][1151630] DUT fail to show own ( Vodafone 3G) RAT during MPLMN search for Vodafone operator.
+ * ALPS03622290 [[1155800]?17310-IN??FT-Free_Test? Observed DUT fails to show IDEA(3G) RAT while performing PLMN on Airtel operator when mode set as LWG(Auto).]
+ *
+ * 04 12 2017 rajasekhar.gade
+ * [MOLY00240270] [6293][Gemini][T+W] Phase 1: Common Interface Changes Check in
+ *
+ * .
+ *
+ * 01 06 2017 rajasekhar.gade
+ * [MOLY00215599] [B160916-164]?1??+?2????1?????????????1????2????,??2???2G
+ *
+ * .
+ *
+ * 10 24 2016 vend_mtb_mobiveil003
+ * [MOLY00209293] Band 66 support
+ * Band 66 support
+ *
+ * 07 09 2015 peter.chiang
+ * [MOLY00125851] SCSI compile warning remove and index bug fix
+ * remove compile warning and fix index error of SCSI
+ *
+ * 06 01 2015 henry.lai
+ * [MOLY00092508] [MT6291][LTE-C2K] AS Inter RAT feature
+ * .
+ *
+ * 05 20 2015 nicky.chou
+ * [MOLY00089131] [MT6291 Gemini] L+W+W+W code revision check in
+ * .
+ *
+ * 04 14 2015 nicky.chou
+ * [MOLY00106888] [USIME]FDD/TDD set band problem when init
+ * .
+ *
+ * 12 11 2014 nicky.chou
+ * [MOLY00084935] [SCSI][LCSCE] sync to UMOLY from MT6291_DEV
+ * .
+ *
+ * 11 19 2014 nicky.chou
+ * [MOLY00084935] [SCSI][LCSCE] sync to UMOLY from MT6291_DEV
+ * .
+ *
+ * 06 04 2014 nicky.chou
+ * [MOLY00067600] [CMCC][CSFB] 5.2.1 HZ FT workaournd - add scsi GSMLatestServingCell for 4G measurement
+ * .
+ *
+ * 12 20 2013 nicky.chou
+ * [MOLY00050587] [SCSI][Gemini] remove APIs without sim_index
+ * .
+ *
+ * 11 21 2013 nicky.chou
+ * [MOLY00045854] [PS1267 HG+WG] Check-in Gemini HG+WG modification
+ * .
+ *
+ * 04 09 2013 nicky.chou
+ * [MOLY00011685] [CSE][SCSI][USIME] UMTS Band Priority Search
+ * .
+ *
+ * 03 14 2013 nicky.chou
+ * [MOLY00009229] [CSE][SCSI] Merge Multimode modification back to MOLY
+ * .
+ *
+ * 01 23 2013 nicky.chou
+ * [MOLY00009229] [CSE][SCSI] Merge Multimode modification back to MOLY
+ * .
+ *
+ * 09 26 2012 ye.yuan
+ * [MOLY00004173] [3G TDD][CISE]R9 code merge back to MOLY
+ * CSCE CODE Interface part .
+ *
+ * 07 02 2012 nicky.chou
+ * [MOLY00000149] [SCSI][CSE][USIME][MEME] Performance optimization for Auto-Band & Stored Info Freq List
+ * .
+ *
+ * 04 16 2012 nicky.chou
+ * removed!
+ * .
+ *
+ * 01 15 2012 nicky.chou
+ * removed!
+ * .
+ *
+ * 11 08 2011 nicky.chou
+ * removed!
+ * .
+ *
+ * 05 31 2011 nicky.chou
+ * removed!
+ * .
+ *
+ * 12 14 2010 nicky.chou
+ * removed!
+ * .
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ * UARFCN validation function refactor (from URR to SCSI)
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ * add to source control recursely
+ *
+ * removed!
+ * removed!
+ * Add copyright header.
+ *
+ * removed!
+ * removed!
+ * add to source control recursely
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ *****************************************************************************/
+/**
+ * scsi.h
+ *
+ * # @COPYLEFT 2005 Jethro E. Lee
+ * ALL WRONGS RESERVED
+ *
+ * [Useage]
+ *
+ * [SYNOPSIS]
+ *
+ * [Example]
+ */
+
+#ifndef __SCSI_H__ /* _(!@$ `scsi.h' $@!)_ */
+#define __SCSI_H__
+
+/* Nicky 20101008: include header files for redundant header file removal */
+#include "kal_general_types.h"
+#include "scsi_asn.h"
+#include "csi_asn.h"
+#include "mcd_l3_inc_struct.h"
+#ifdef __GSM_RAT__
+#include "csi_gsm_asn.h"
+#endif
+#ifdef __UMTS_RAT__
+#include "csi_umts_asn.h"
+#endif
+#ifdef __LTE_RAT__
+#include "csi_lte_asn.h"
+#endif
+
+
+#define SCSI_SIM_EF_LOCI_LEN (11)
+#define SCSI_USIM_EF_LOCI_LEN (11)
+#define SCSI_USIM_EF_PSLOCI_LEN (14)
+
+/**
+ * UTRAN Absolute Radio Frequency Channel Number
+ *
+ * UTRAFDD is designed to operatein either of the
+ * following paired bands:
+ * 1920-1980 MHz Uplink
+ * 2110-2170 MHz Downlink
+ *
+ * UARFCN Uplink: 9612- 9888
+ * UARFCN Downlink: 10562-10838
+ */
+#ifdef __LTE_RAT__
+#define SCSI_MAX_EARFCN (262143)
+#endif /* __LTE_RAT__ */
+#define SCSI_MAX_UARFCN (16383)
+#define SCSI_PRIMARY_SCRAMBLING_CODE_MAX (511) //UMTS FDD
+#define SCSI_CELL_PARAMETERS_ID_MAX (127) //UMTS TDD
+
+/* Clause 2 of SPEC 05.05 */
+#define SCSI_MAX_GSM_ARFCN (1024)
+
+#define SCSI_GSM_CELL_INFORMATION_TAG (0xA0)
+#define SCSI_FDD_CELL_INFORMATION_TAG (0xA1)
+#define SCSI_TDD_CELL_INFORMATION_TAG (0xA2)
+#define SCSI_GSM_CAMPED_BCCH_FREQUENCY_TAG (0x80)
+#define SCSI_GSM_NEIGHBOUR_BCCH_FREQUENCY_TAG (0x81)
+#define SCSI_INTRA_FREQUENCY_INFORMATION_TAG (0x80)
+#define SCSI_INTER_FREQUENCY_INFORMATION_TAG (0x81)
+#define SCSI_UNITIALIZED_USIM_DATA (0xFF)
+
+typedef enum {
+ SCSI_SIM1 = 0,
+ SCSI_SIM2,
+ SCSI_SIM3,
+ SCSI_SIM4,
+ SCSI_SIM_INVALID
+}SCSI_SIM_INDEX;
+
+#ifdef __UMTS_RAT__
+
+/**
+ * Lucien Huang 20081218:
+ * Please be sure that the following definition shall be matched with
+ * those in rrc_utils.h (same definition could be seen there)
+ **/
+
+#define SCSI_TOTAL_NUMBER_OF_UMTS_FDD_BAND_DEFINED (26)
+#define SCSI_TOTAL_NUMBER_OF_UMTS_TDD_BAND_DEFINED (6)
+#define SCSI_TOTAL_NUMBER_OF_UMTS_BAND_DEFINED ((SCSI_TOTAL_NUMBER_OF_UMTS_FDD_BAND_DEFINED>SCSI_TOTAL_NUMBER_OF_UMTS_TDD_BAND_DEFINED)? SCSI_TOTAL_NUMBER_OF_UMTS_FDD_BAND_DEFINED: SCSI_TOTAL_NUMBER_OF_UMTS_TDD_BAND_DEFINED)
+
+#define SCSI_MAX_NUM_OF_UMTS_BAND_SUPPORTED (26)
+#define SCSI_MAX_NUM_OF_UMTS_BAND_ADDITION_INFO (11) /* For UMTS FDD BAND V(Num:6) and XXVI(Num:11) */
+
+enum SCSI_UMTS_BAND_UARFCN_IDENTIFIER_TAG
+{
+ SCSI_UMTS_FDD_UARFCN_BAND_I_Identifier = 0,
+ SCSI_UMTS_FDD_UARFCN_BAND_II_Identifier,
+ SCSI_UMTS_FDD_UARFCN_BAND_III_Identifier,
+ SCSI_UMTS_FDD_UARFCN_BAND_IV_Identifier,
+ SCSI_UMTS_FDD_UARFCN_BAND_V_Identifier,
+ SCSI_UMTS_FDD_UARFCN_BAND_VI_Identifier,
+ SCSI_UMTS_FDD_UARFCN_BAND_VII_Identifier,
+ SCSI_UMTS_FDD_UARFCN_BAND_VIII_Identifier,
+ SCSI_UMTS_FDD_UARFCN_BAND_IX_Identifier,
+ SCSI_UMTS_FDD_UARFCN_BAND_X_Identifier,
+ SCSI_UMTS_FDD_UARFCN_BAND_XI_Identifier,
+ SCSI_UMTS_FDD_UARFCN_BAND_XII_Identifier,
+ SCSI_UMTS_FDD_UARFCN_BAND_XIII_Identifier,
+ SCSI_UMTS_FDD_UARFCN_BAND_XIV_Identifier,
+ SCSI_UMTS_FDD_UARFCN_BAND_XV_Identifier,
+ SCSI_UMTS_FDD_UARFCN_BAND_XVI_Identifier,
+ SCSI_UMTS_FDD_UARFCN_BAND_XVII_Identifier,
+ SCSI_UMTS_FDD_UARFCN_BAND_XVIII_Identifier,
+ SCSI_UMTS_FDD_UARFCN_BAND_XIX_Identifier,
+ SCSI_UMTS_FDD_UARFCN_BAND_XX_Identifier,
+ SCSI_UMTS_FDD_UARFCN_BAND_XXI_Identifier,
+ SCSI_UMTS_FDD_UARFCN_BAND_XXII_Identifier,
+ SCSI_UMTS_FDD_UARFCN_BAND_XXIII_Identifier,
+ SCSI_UMTS_FDD_UARFCN_BAND_XXIV_Identifier,
+ SCSI_UMTS_FDD_UARFCN_BAND_XXV_Identifier,
+ SCSI_UMTS_FDD_UARFCN_BAND_XXVI_Identifier,
+ SCSI_UMTS_FDD_UARFCN_BAND_INVALID,
+ SCSI_UMTS_TDD_UARFCN_BAND_A_Identifier = 0,
+ SCSI_UMTS_TDD_UARFCN_BAND_B_Identifier = 1,
+ SCSI_UMTS_TDD_UARFCN_BAND_C_Identifier = 2,
+ SCSI_UMTS_TDD_UARFCN_BAND_D_Identifier = 3,
+ SCSI_UMTS_TDD_UARFCN_BAND_E_Identifier = 4,
+ SCSI_UMTS_TDD_UARFCN_BAND_F_Identifier = 5,
+ SCSI_UMTS_TDD_UARFCN_BAND_INVALID = 6
+};
+
+typedef enum SCSI_UMTS_BAND_UARFCN_IDENTIFIER_TAG SCSI_UMTS_Band_UARFCN_Identifier;
+
+#define SCSI_MAX_OVERLAPPING_BANDS (4)
+
+typedef struct {
+ kal_uint8 numUarfcn;
+ CsiUarfcn overlappingUarfcn[SCSI_MAX_OVERLAPPING_BANDS];
+ SCSI_UMTS_Band_UARFCN_Identifier overlappingBand[SCSI_MAX_OVERLAPPING_BANDS];
+} SCSI_UMTS_overlapping_band_info_struct;
+
+typedef enum
+{
+ SCSI_RRC_UE_PowerClassExt_class1,
+ SCSI_RRC_UE_PowerClassExt_class2,
+ SCSI_RRC_UE_PowerClassExt_class3,
+ SCSI_RRC_UE_PowerClassExt_class4,
+ SCSI_RRC_UE_PowerClassExt_spare4,
+ SCSI_RRC_UE_PowerClassExt_spare3,
+ SCSI_RRC_UE_PowerClassExt_spare2,
+ SCSI_RRC_UE_PowerClassExt_spare1
+}
+SCSI_RRC_UE_PowerClassExt;
+
+typedef enum
+{
+ SCSI_UMTS_UARFCN_DL,
+ SCSI_UMTS_UARFCN_UL
+}SCSI_UMTS_UarfcnDirectionType;
+
+typedef struct SCSI_UMTS_BAND_UARFCN_ADDITION_SPECIAL_INFO_TAG SCSI_UMTS_Band_UARFCN_Addition_Special;
+
+struct SCSI_UMTS_BAND_UARFCN_ADDITION_SPECIAL_INFO_TAG
+{
+ kal_uint8 addition_number;
+ kal_uint16 uarfcn[SCSI_MAX_NUM_OF_UMTS_BAND_ADDITION_INFO];
+};
+
+typedef struct SCSI_UMTS_BAND_UARFCN_ADDITION_GENERAL_INFO_TAG SCSI_UMTS_Band_UARFCN_Addition_General;
+
+struct SCSI_UMTS_BAND_UARFCN_ADDITION_GENERAL_INFO_TAG
+{
+ kal_uint16 addition_start;
+ kal_uint8 addition_number;
+};
+
+enum SCSI_UMTS_BAND_UARFCN_ADDITION_TYPE_TAG
+{
+ SCSI_UMTS_BAND_UARFCN_ADDITION_None_Selector,
+ SCSI_UMTS_BAND_UARFCN_ADDITION_GENERAL_Selector,
+ SCSI_UMTS_BAND_UARFCN_ADDITION_SPECIAL_Selector
+};
+
+typedef enum SCSI_UMTS_BAND_UARFCN_ADDITION_TYPE_TAG SCSI_UMTS_Band_UARFCN_AdditionType;
+
+typedef struct SCSI_UMTS_BAND_UARFCN_CHECK_INFO_TAG SCSI_UMTS_BandCheckInfo;
+
+#if 0 /*__3GPP_25102_DEFINITION__*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+struct SCSI_UMTS_BAND_UARFCN_CHECK_INFO_TAG
+{
+#if 0 /*__3GPP_25102_DEFINITION__*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+ kal_uint16 low_bound;
+ kal_uint16 upper_bound;
+ SCSI_UMTS_Band_UARFCN_AdditionType selection;
+ union
+ {
+ kal_uint8 none;
+ SCSI_UMTS_Band_UARFCN_Addition_General general;
+ SCSI_UMTS_Band_UARFCN_Addition_Special special;
+ }choice;
+};
+
+struct SCSI_UMTS_BAND_INFO_TAG
+{
+ SCSI_UMTS_Band_UARFCN_Identifier radioFrequencyBand;
+ SCSI_RRC_UE_PowerClassExt ue_PowerClass;
+ kal_uint16 txRxFrequencySeparation; /* in UARFCN */
+ SCSI_UMTS_BandCheckInfo uarfcn_check_info;
+};
+
+typedef struct SCSI_UMTS_BAND_INFO_TAG SCSI_UMTS_BandInfo;
+
+typedef struct SCSI_UMTS_BAND_INFO_LIST_TAG SCSI_UMTS_BandInfoList;
+
+struct SCSI_UMTS_BAND_INFO_LIST_TAG
+{
+ kal_uint8 band_number; /* number of UMTS FDD working band */
+ SCSI_UMTS_Band_UARFCN_Identifier band_index[SCSI_TOTAL_NUMBER_OF_UMTS_BAND_DEFINED]; /* list of enum of UMTS FDD working band */
+};
+
+typedef struct SCSI_UMTS_BAND_INFO_DEFINED_TAG SCSI_UMTS_BandInfoDefinedList;
+
+struct SCSI_UMTS_BAND_INFO_DEFINED_TAG
+{
+ kal_uint8 band_number;
+ SCSI_UMTS_BandInfo band_info[SCSI_TOTAL_NUMBER_OF_UMTS_BAND_DEFINED];
+};
+
+
+/*
+ * Chi-Chung 20090715:
+ * Code revised for frequencyRepository. This is the structure for user to get the uarfcn in a MCC
+ */
+#define MAX_UARFCN_PER_MCC 32
+
+/* the uarfcn in a Mcc*/
+typedef struct SCSI_UMTS_UarfcnPerMcc
+{
+ ScsiMccValue mcc;
+ kal_uint8 count;
+ CsiUarfcn uarfcn[MAX_UARFCN_PER_MCC];
+}
+SCSI_UMTS_UarfcnPerMcc;
+
+#ifdef __NR_RAT__
+
+#define SCSI_GEMINI_STATUS_NUM 3
+
+typedef enum {
+ SCSI_GEMINI_STATUS_FULL_CAP = 0,
+ SCSI_GEMINI_STATUS_DATA_SIM,
+ SCSI_GEMINI_STATUS_NON_DATA_SIM,
+ SCSI_GEMINI_STATUS_INVALID
+} SCSI_GEMINI_STATUS;
+#endif /* __NR_RAT__ */
+
+extern void Scsi_ComposeUmtsBandDefinitionInfo(void);
+
+extern void Scsi_SE_retrieveUmtsBandListInfo(SCSI_SIM_INDEX sim_index, SCSI_UMTS_BandInfoList **ppScsi_StoredUmtsFddBandListInfo);
+
+extern void Scsi_SE_retrieveFddUmtsBandListInfo(SCSI_SIM_INDEX sim_index, SCSI_UMTS_BandInfoList **ppScsi_StoredUmtsFddBandListInfo);
+
+extern void Scsi_retrieveUmtsFddAndTddBandDefinedInfo(SCSI_UMTS_BandInfoDefinedList **ppScsi_StoreUmtsFddBandDefinedInfo, SCSI_UMTS_BandInfoDefinedList **ppScsi_StoreUmtsTddBandDefinedInfo);
+
+extern kal_bool Scsi_SE_ensureUarfcnValid(SCSI_SIM_INDEX sim_index, kal_uint16 uarfcn);
+
+/****************************************************************************
+ * Function: Scsi_UarfcnValidateInAllUmtsBand
+ *
+ * parameter:
+ * a. uarfcn - uarfcn which we want to check the validation
+ * b. type - indicate to perform DL or UL UARFCN validation
+ * c. band_id - store which band the input uarfcn locates if return KAL_TRUE
+ * meaningless if return KAL_FALSE or input band_id is NULL pointer
+ * Returns:
+ * a. return KAL_TRUE means input uarfcn is in valid range
+ * b. *band_id will store the band number which this uarfcn locates if band_id is not NULL pointer
+ *
+ * Description:
+ * Envoked for check whether the input uarfcn is in the valid value range which 3GPP defines for
+ * whole UMTS FDD bands. Currently it will check Band I - X.
+ *
+ *****************************************************************************/
+
+extern kal_bool Scsi_UarfcnValidateInAllUmtsBand(SCSI_SIM_INDEX sim_index, kal_uint16 uarfcn, SCSI_UMTS_UarfcnDirectionType type, SCSI_UMTS_Band_UARFCN_Identifier *band_id);
+
+extern kal_bool Scsi_SE_UarfcnValidateInAllSupportUmtsBand(SCSI_SIM_INDEX sim_index, kal_uint16 uarfcn, SCSI_UMTS_UarfcnDirectionType type, SCSI_UMTS_Band_UARFCN_Identifier *band_id);
+
+extern kal_bool Scsi_UarfcnValidateInOneSupportUmtsBand(SCSI_SIM_INDEX sim_index, kal_uint16 uarfcn, SCSI_UMTS_UarfcnDirectionType type, SCSI_UMTS_Band_UARFCN_Identifier band_id);
+
+extern kal_bool Scsi_SE_UarfcnValidateInAllSupportUmtsBandExt(SCSI_SIM_INDEX sim_index, kal_uint16 uarfcn, SCSI_UMTS_UarfcnDirectionType type, SCSI_UMTS_Band_UARFCN_Identifier *band_id, kal_uint8 *indexInBandFDDList);
+
+extern kal_uint8 Scsi_SE_GetNumOfUmtsSupportBand(SCSI_SIM_INDEX sim_index);
+
+extern void Scsi_SE_GetUmtsSupportBandInfo(SCSI_SIM_INDEX sim_index, SCSI_UMTS_BandInfoList const **workBandInfo);
+
+extern void Scsi_SE_GetUmtsFddAndTddSupportBandInfo(SCSI_SIM_INDEX sim_index, SCSI_UMTS_BandInfoList **fddWorkBandInfo, SCSI_UMTS_BandInfoList **tddWorkBandInfo);
+
+extern void Scsi_SE_RequiredUmtsBandListQuery(SCSI_SIM_INDEX sim_index, kal_uint8 *query_array);
+
+extern kal_bool Scsi_SE_IsUmtsSupportBand(SCSI_SIM_INDEX sim_index, SCSI_UMTS_Band_UARFCN_Identifier band_id);
+
+#endif /* __UMTS_RAT__ */
+
+#define SCSI_SET_BMP(_bitmap, _ofst, _type) ((_bitmap) |= (_type)((_type)1 << (_ofst)))
+#define SCSI_CLR_BMP(_bitmap, _ofst, _type) ((_bitmap) &= (_type)(~((_type)1 << (_ofst))))
+#define SCSI_CHK_BMP(_bitmap, _ofst, _type) ((_bitmap) & (_type)((_type)1 << (_ofst)))
+#define SCSI_BYTE_BITMASK 7
+/* Because LSB is for Band 1, so if we want to access Band x , we should access bitmask[x-1] */
+#define SCSI_BAND_BIT_MASK_GET_BYTE_OFFSET(_band) ((_band - (1)) >> (3))
+#define SCSI_BAND_BIT_MASK_GET_BIT_OFFSET(_band) ((_band - (1)) & (SCSI_BYTE_BITMASK))
+
+#ifdef __LTE_RAT__
+#define MAX_BYTE_LTE_BAND_BITMASK 8
+
+typedef struct SCSI_LTE_Band_Bitmask
+{
+ kal_uint8 oneByteBandBitmask[MAX_BYTE_LTE_BAND_BITMASK];
+}
+SCSI_LTE_Band_Bitmask;
+
+/* Extended supported LTE bitmask size in bits (256) / bits in one byte (8)
+ */
+#define MAX_BYTE_LTE_BAND_BITMASK_EXTENDED ( 256 / 8 )
+
+typedef struct SCSI_LTE_Band_Bitmask_Extended
+{
+ kal_uint8 oneByteBandBitmask[MAX_BYTE_LTE_BAND_BITMASK_EXTENDED];
+}
+SCSI_LTE_Band_Bitmask_Extended;
+
+#endif /* __LTE_RAT__ */
+
+#ifdef __NR_RAT__
+
+#define MAX_BYTE_NR_BAND_BITMASK 128
+
+typedef struct SCSI_NR_Band_Bitmask
+{
+ kal_uint8 oneByteBandBitmask[MAX_BYTE_NR_BAND_BITMASK];
+}
+SCSI_NR_Band_Bitmask;
+
+#endif /* __NR_RAT__ */
+
+#if (defined(__23G_PRI_RESEL_SUPPORT__) || defined(__3G_CSG_SUPPORT__) || defined(__LTE_RAT__) || defined(__CDMA2000_RAT__) || defined(__NR_RAT__))
+#define SCSI_MAX_TICKS 0xFFFFFFFF
+
+typedef enum {
+ SCSI_GSM_RAT,
+ SCSI_UMTSFDD_RAT,
+ SCSI_UMTSTDD_RAT,
+ SCSI_LTE_RAT,
+ SCSI_C2K_RAT,
+ SCSI_NR_RAT
+}SCSI_RAT_MODE_TYPE;
+#endif /* defined(__23G_PRI_RESEL_SUPPORT__) || defined(__3G_CSG_SUPPORT__) || defined(__LTE_RAT__) || defined(__CDMA2000_RAT__) || defined(__NR_RAT__) */
+
+#if (defined(__23G_PRI_RESEL_SUPPORT__) || defined(__LTE_RAT__) || defined(__CDMA2000_RAT__) || defined(__NR_RAT__))
+//Dedicated Priority Info
+#define SCSI_MAX_NUM_OF_PRIO_INFO 40
+#define SCSI_MAX_BYTE_OF_GSM_PRIO_ARFCN 128 // bitmask, total 128 bytes.
+#define SCSI_MAX_NUM_OF_UMTSFDD_PRIO_UARFCN 32 // 32 frequency.
+#define SCSI_MAX_NUM_OF_UMTSTDD_PRIO_UARFCN 32 // 32 frequency.
+#define SCSI_MAX_NUM_OF_LTE_PRIO_EARFCN 32 // 32 frequency
+#define SCSI_MAX_NUM_OF_C2K_PRIO_BAND 32 // 32 band
+#define SCSI_MAX_NUM_OF_NR_PRIO_NARFCN 8 //32 frequency
+
+typedef struct{
+ kal_int8 priority;
+ kal_int8 sub_priority; // please check this equal to 0, 2, 4, 6 or 8
+ SCSI_RAT_MODE_TYPE rat_choice;
+ kal_uint8 freq_count; // only used in 3G or LTE type, it keeps the frequency count
+ kal_uint8 gsm_band_indicator; //refer to te_gsm_band_indicator in uas_gas_enums.h
+ /**
+ * for GSM RAT, every bit represenet a ARFCN (from 0~1023); LSB of octet 1 represent arfcn = 0, MSB of octet 1 represent arfcn = 7
+ * for UMTSFDD, every U16 element represent an UARFCN.
+ * for LTE, every U32 element represent an EARFCN.
+ * for C2K, every U8 element represent an Band.
+ * for NR, every U32 element represent an NARFCN.
+ **/
+ union{
+ kal_uint8 *ARFCN_bitmap; // SCSI_MAX_BYTE_OF_GSM_PRIO_ARFCN
+ kal_uint16 *UARFCN_list; // SCSI_MAX_NUM_OF_UMTSFDD_PRIO_UARFCN <== each of them is two bytes.
+ kal_uint32 *EARFCN_list; // SCSI_MAX_NUM_OF_LTE_PRIO_EARFCN <== each of them is four bytes.
+ kal_uint8 *C2K_Band_list; // SCSI_MAX_NUM_OF_C2K_PRIO_BAND <== each of them is one byte
+ kal_uint32 *NARFCN_list; // SCSI_MAX_NUM_OF_NR_PRIO_NARFCN <== each of them is four bytes.
+ }choice;
+} SCSI_layer_prio_struct;
+
+typedef struct{
+ plmn_id_struct rplmn;
+ SCSI_RAT_MODE_TYPE dedi_prio_info_src;
+ kal_uint8 layer_prio_count;
+ SCSI_layer_prio_struct layer_prio_list[SCSI_MAX_NUM_OF_PRIO_INFO];
+
+ kal_uint32 tick_previous; // SCSI internal use
+ kal_uint32 tick_left; // SCSI internal use
+} SCSI_dedi_prio_info;
+
+#define SCSI_MAX_NUM_OF_DEPRIORITIZATION_INFO 8
+#define SCSI_MAX_DEPRIORITIZATION_PLMN_NUM 8
+
+typedef struct{
+ plmn_id_struct rplmn;
+ kal_uint8 earfcn_info_num;
+ kal_uint32 earfcn_info_list[SCSI_MAX_NUM_OF_DEPRIORITIZATION_INFO]; // frequency list, if earfcn == 0xffffffff => all LTE RAT
+
+ kal_uint8 narfcn_info_num;
+ kal_uint32 narfcn_info_list[SCSI_MAX_NUM_OF_DEPRIORITIZATION_INFO]; // frequency list, if narfcn == 0xffffffff => all NR RAT
+
+ kal_uint32 tick_previous; // SCSI internal use
+ kal_uint32 tick_left; // SCSI internal use
+} SCSI_deprioritization_info_struct;
+
+// for VzW request
+typedef struct{
+ kal_uint8 plmn_num;
+ SCSI_deprioritization_info_struct *deprioritization_info_list[SCSI_MAX_DEPRIORITIZATION_PLMN_NUM];
+} SCSI_deprioritization_info_tbl_struct;
+#endif /* __23G_PRI_RESEL_SUPPORT__ || __LTE_RAT__ || __CDMA2000_RAT__ || __NR_RAT__ */
+
+
+#if (defined(__3G_CSG_SUPPORT__) || defined(__LTE_RAT__))
+//CSG Split Info
+#define SCSI_MAX_NUM_OF_CSG_SPLIT_INFO 3 //the value cannot be equal to zero which 'wrap around' will happen in SCSI_newCSGSplitInfo().
+#define SCSI_MAX_BYTE_OF_PHY_CELL_ID 64 // bitmask, total 64 bytes.
+#define SCSI_MAX_NUM_OF_MULTI_PLMN 6
+
+#ifdef __3G_CSG_SUPPORT__
+typedef struct{
+ kal_uint8 plmn_count;
+ plmn_id_struct plmn[SCSI_MAX_NUM_OF_MULTI_PLMN];
+ CsiUarfcn uarfcn;
+ kal_uint8 phyCellId_bitmap[SCSI_MAX_BYTE_OF_PHY_CELL_ID]; //every bit represenet a PSC (from 0~512); LSB of octet 1 represent psc = 0, MSB of octet 1 represent psc = 7
+
+ kal_uint32 tick_previous; // SCSI internal use
+ kal_uint32 tick_left; // SCSI internal use
+} SCSI_umts_csg_split_info;
+#endif /* __3G_CSG_SUPPORT__ */
+
+#ifdef __LTE_RAT__
+typedef struct{
+ kal_uint8 plmn_count;
+ plmn_id_struct plmn[SCSI_MAX_NUM_OF_MULTI_PLMN];
+ CsiEarfcn earfcn;
+ kal_uint8 phyCellId_bitmap[SCSI_MAX_BYTE_OF_PHY_CELL_ID]; //every bit represenet a PSC (from 0~512); LSB of octet 1 represent psc = 0, MSB of octet 1 represent psc = 7
+
+ kal_uint32 tick_previous; // SCSI internal use
+ kal_uint32 tick_left; // SCSI internal use
+} SCSI_lte_csg_split_info;
+#endif /* __LTE_RAT__ */
+
+#ifdef __3G_CSG_SUPPORT__
+typedef struct{
+ kal_uint8 list_count;
+ SCSI_umts_csg_split_info split_info_list[SCSI_MAX_NUM_OF_CSG_SPLIT_INFO];
+}SCSI_umts_csg_split_info_list;
+#endif /* __3G_CSG_SUPPORT__ */
+
+#ifdef __LTE_RAT__
+typedef struct{
+ kal_uint8 list_count;
+ SCSI_lte_csg_split_info split_info_list[SCSI_MAX_NUM_OF_CSG_SPLIT_INFO];
+}SCSI_lte_csg_split_info_list;
+#endif /* __LTE_RAT__ */
+
+#endif /* __3G_CSG_SUPPORT__ || __LTE_RAT__ */
+
+
+// Constructor
+extern void Scsi_Scsi(void);
+extern void Scsi_reset(void);
+
+
+// Initializer
+extern void Scsi_initFromNVRAM(kal_uint8* nvramEfNetparBufPtr, kal_uint16 const nvramEfNetparBufLen);
+
+extern kal_bool Scsi_isNvramInitialized(void);
+
+#ifdef __GSM_RAT__
+/* Jethro: Suppose SIM is able to be handled in all cases, regardless the load is dual mode or single mode. */
+extern void Scsi_initFromSIM(plmn_id_struct const* const rPlmnId,
+ CsiGsmCellList const* const gsmCellList);
+#endif /* __GSM_RAT__ */
+
+#ifdef __UMTS_RAT__ /* 3G is to be built-in */
+extern void Scsi_initFromUSIM(SCSI_SIM_INDEX sim_index,
+ plmn_id_struct const* const rPlmnId,
+ CsiUmtsCellList* const umtsCellList
+#ifdef __GSM_RAT__
+ ,
+ CsiGsmCellList const* const gsmCellList
+#endif
+ );
+
+extern void Scsi_FreqRepositoryInitFromNVRAM(kal_uint8* nvramEfNetparBufPtr, kal_uint16 const nvramEfNetparBufLen);
+extern kal_uint16 Scsi_getNvramEFUmtsFreq(kal_uint8* const nvramEfNetparBufPtr, kal_uint16 const nvramEfNetparBufLen);
+extern void Scsi_freqPurge(void);
+extern void Scsi_freqPurge3GTDDOnly(void);
+#endif /* #ifdef __UMTS_RAT__ */
+
+extern void Scsi_purge(void);
+extern void Scsi_purge3GTDDOnly(void);
+
+// Destructor
+extern void Scsi_destruct(void);
+
+
+#ifdef __GSM_RAT__ /* 2G is to be built-in */
+// GSM
+// Setter
+extern void Scsi_newGsmFreqRange(plmn_id_struct const* const plmnID, CsiGsmBaRangeAndBand* const BARangeList);
+extern void Scsi_newGsmNeighborCells(plmn_id_struct const* const plmnID, CsiGsmCellList* const cellList);
+#ifdef __LTE_RAT__
+extern void Scsi_newGsmLatestServingCell(plmn_id_struct const* const plmnID, CsiGsmCell const* const cell);
+
+//Just for UT currently, not release publicly
+#ifdef UNIT_TEST
+extern void Scsi_delGsmLatestServingCell(plmn_id_struct const* const plmnID);
+#endif /* UNIT_TEST */
+#endif /* __LTE_RAT__ */
+
+// Getter
+extern void Scsi_getGsmFreqRange(plmn_id_struct const* const plmnID, CsiGsmBaRangeAndBand* const BARangeList);
+extern void Scsi_getGsmNeighborCells(plmn_id_struct const* const plmnID, CsiGsmCellList* const cellList);
+#ifdef __LTE_RAT__
+extern kal_bool Scsi_getGsmLatestServingCell(plmn_id_struct const* const plmnID, CsiGsmCell* const cell);
+#endif /* __LTE_RAT__ */
+#endif /* #ifdef __GSM_RAT__ */
+
+
+#ifdef __UMTS_RAT__ /* 3G is to be built-in */
+// UMTS
+/* David 20081107:
+ * Added for auto band mechanism.
+ */
+#ifdef __3G_AUTO_BAND_MECHANISM__
+extern void Scsi_newUmtsWorkingBand(SCSI_SIM_INDEX sim_index, plmn_id_struct const* const plmnID, SCSI_UMTS_Band_UARFCN_Identifier bandID);
+extern void Scsi_delUmtsWorkingBand(SCSI_SIM_INDEX sim_index, plmn_id_struct const* const plmnID, SCSI_UMTS_Band_UARFCN_Identifier bandID);
+#endif
+// Setter
+extern void Scsi_newUmtsFreqRange(SCSI_SIM_INDEX sim_index, plmn_id_struct const* const plmnID, CsiUmtsFrequnecyList* const freqRange);
+
+extern void Scsi_newUmtsFreqList(SCSI_SIM_INDEX sim_index, plmn_id_struct const* const plmnID, CsiUmtsFrequnecyList* const freqList, kal_bool correctOverlappingUarfcn);
+
+extern void Scsi_newUmtsNeighborCells(SCSI_SIM_INDEX sim_index, plmn_id_struct const* const plmnID, CsiUmtsCellList* const cellList);
+#ifdef __LTE_RAT__
+extern void Scsi_newUmtsLatestServingCell(SCSI_SIM_INDEX sim_index, plmn_id_struct const* const plmnID, CsiUmtsCellWithUarfcn const* const cell);
+
+//Just for UT currently, not release publicly
+#ifdef UNIT_TEST
+extern void Scsi_delUmtsLatestServingCell(SCSI_SIM_INDEX sim_index, plmn_id_struct const* const plmnID);
+#endif /* UNIT_TEST */
+#endif /* __LTE_RAT__ */
+
+extern void Scsi_newUmtsUarfcnList(SCSI_SIM_INDEX sim_index, plmn_id_struct const* const plmnID , CsiUmtsUarfcnList *uarfcnList);
+
+// Getter
+extern void Scsi_getUmtsFreqRange(SCSI_SIM_INDEX sim_index, plmn_id_struct const* const plmnID, CsiUmtsFrequnecyList* const freqRange);
+extern void Scsi_getUmtsFreqList(SCSI_SIM_INDEX sim_index, plmn_id_struct const* const plmnID, CsiUmtsFrequnecyList* const freqList);
+/* Nicky 20141007: Stored 3G Cell List is not used. Remove the get function. */
+#if 0
+/* under construction !*/
+#endif
+#ifdef __LTE_RAT__
+extern kal_bool Scsi_getUmtsLatestServingCell(SCSI_SIM_INDEX sim_index, plmn_id_struct const* const plmnID, CsiUmtsCellWithUarfcn* const cell);
+#endif /* __LTE_RAT__ */
+extern void Scsi_getUmtsUarcnList(SCSI_SIM_INDEX sim_index, plmn_id_struct const* const plmnID, CsiUmtsUarfcnList *uarfcnList);
+extern void Scsi_getUmtsUarfcnByMcc(SCSI_SIM_INDEX sim_index, kal_uint32 const countOfMccs , SCSI_UMTS_UarfcnPerMcc* uarfcnByMccs);
+extern kal_bool Scsi_isUarfcnSharedInCurrentPlmn(SCSI_SIM_INDEX sim_index, plmn_id_struct const* const plmn_found ,kal_uint16 uarfn_to_be_checked );
+
+/* Nicky 20110103: Added for Gemini 2.0 */
+#ifdef __GEMINI__
+extern kal_uint16 Scsi_getUmtsUarfcnUpperBound(SCSI_SIM_INDEX sim_index, SCSI_UMTS_Band_UARFCN_Identifier bandID);
+extern kal_uint16 Scsi_getUmtsUarfcnLowerBound(SCSI_SIM_INDEX sim_index, SCSI_UMTS_Band_UARFCN_Identifier bandID);
+extern kal_uint8 Scsi_getUmtsAdditionalFreqList(SCSI_SIM_INDEX sim_index, SCSI_UMTS_Band_UARFCN_Identifier bandID, kal_uint8 const sizeOfList, kal_uint16 * const additionalFreqList);
+#endif /* #ifdef __GEMINI__ */
+
+/* Nicky 20111028: Added for UMTS Band Extension, which will be used by RRCE module. */
+extern kal_uint16 Scsi_getBandTxRxFreqSeparation(SCSI_SIM_INDEX sim_index, SCSI_UMTS_Band_UARFCN_Identifier bandID);
+
+extern kal_bool Scsi_convertUarfcnForOverlappedFreqBands(SCSI_SIM_INDEX sim_index, kal_uint16 uarfcn, SCSI_UMTS_Band_UARFCN_Identifier bandId, SCSI_UMTS_Band_UARFCN_Identifier otherBandId, kal_uint16 *convertedUarfcn);
+#endif /* #ifdef __UMTS_RAT__ */
+
+extern kal_uint8 Scsi_getPlmns(plmn_id_struct* plmns);
+
+// Retrieve encoded data for saving to non-volatile storages, i.e., NVRAM and USIM/SIM.
+extern kal_uint16 Scsi_getNvramEFNetpar(kal_uint8* const nvramEfNetparBufPtr, kal_uint16 const nvramEfNetparBufLen);
+
+#if (defined(__23G_PRI_RESEL_SUPPORT__) || defined(__LTE_RAT__))
+// SCSI need to provide the following functions:
+
+// Before use any API of DediPrioInfo, please call this function to acquire mutext.
+extern void SCSI_acquirePrioMutex(SCSI_SIM_INDEX sim_index);
+
+// return the pointer of pDediPrioInfo.
+// user can operate on SCSI_dedi_prio_info, but user shall not operate on tick_previous. tick_previous would be updated by SCSI.
+extern SCSI_dedi_prio_info *SCSI_getDediPrioInfo(SCSI_SIM_INDEX sim_index);
+
+// free the memory of pDediPrioInfo, after user call this function, please never use the previous-got memory...So please be careful.
+extern void SCSI_freeDediPrioInfo(SCSI_SIM_INDEX sim_index);
+
+// call SCSI_FreeDediPrioInfo to free previous-put memory in pDediPrioInfo, and then put the point address in pDediPrioInfo.
+// please never use the previous-got memory...So please careful.
+// Besides, update the tick_previous by SCSI. User would not update it.
+extern void SCSI_setDediPrioInfo(SCSI_SIM_INDEX sim_index, kal_uint32 tick_left, SCSI_dedi_prio_info *pDediPrio);
+
+// In this function, please check the left_tick and do correct computing. If expired, please free the pDediPrioInfo and set it NULL.
+extern void SCSI_releasePrioMutex(SCSI_SIM_INDEX sim_index);
+
+
+// Before use any API of DeprioritizationInfo, please call this function to acquire mutext.
+extern void SCSI_acquireDeprioritizationMutex(SCSI_SIM_INDEX sim_index);
+
+// return the pointer of pDeprioritizationInfo.
+// user can operate on SCSI_deprioritization_info_struct, but user shall not operate on tick_previous. tick_previous would be updated by SCSI.
+extern SCSI_deprioritization_info_struct *SCSI_getDeprioritizationInfo(SCSI_SIM_INDEX sim_index, plmn_id_struct const* const rplmn);
+
+// free the memory of specific PLMN of pDeprioritizationInfo.
+extern void SCSI_freeDeprioritizationInfo(SCSI_SIM_INDEX sim_index, plmn_id_struct const* const rplmn);
+
+// call SCSI_freeDeprioritizationInfo to free previous-put memory of pDeprioritizationInfo, and then put the point address to pDeprioritizationInfo.
+// please never use the previous-got memory...So please careful.
+// Besides, update the tick_previous by SCSI. User would not update it.
+extern void SCSI_setDeprioritizationInfo(SCSI_SIM_INDEX sim_index, kal_uint32 tick_left, SCSI_deprioritization_info_struct *pDeprioritizationInfo);
+
+// In this function, please check the left_tick and do correct computing. If expired, please free the pDeprioritizationInfo and set it NULL.
+extern void SCSI_releaseDeprioritizationMutex(SCSI_SIM_INDEX sim_index);
+#endif /* __23G_PRI_RESEL_SUPPORT__ || __LTE_RAT__ */
+
+#if (defined(__3G_CSG_SUPPORT__) || defined(__LTE_RAT__))
+// put the pSlitInfo which contain this arfcn in pSplitInfo according to rat_type, if not found, set content of pSplitInfo all zero.
+// besides, according to tick_left tick_previous to delete the expired split info.
+#ifdef __3G_CSG_SUPPORT__
+extern void SCSI_getUmtsCSGSplitInfo(SCSI_SIM_INDEX sim_index, CsiUarfcn uarfcn, plmn_id_struct const* const plmnID, SCSI_umts_csg_split_info * const pSplitInfo);
+#endif /* __3G_CSG_SUPPORT__ */
+
+#ifdef __LTE_RAT__
+extern void SCSI_getLteCSGSplitInfo(SCSI_SIM_INDEX sim_index, CsiEarfcn earfcn, plmn_id_struct const* const plmnID, SCSI_lte_csg_split_info * const pSplitInfo);
+#endif /* __LTE_RAT__ */
+
+// put the content of pCSGSplitInfoList in SCSI to pSplitInfoList according to rat_type, if pCSGSplitInfoList is null, set content of pSplitInfoList all zero.
+// besides, according to tick_left tick_previous to delete the expired split info.
+#ifdef __3G_CSG_SUPPORT__
+extern void SCSI_getUmtsCSGSplitInfoList(SCSI_SIM_INDEX sim_index, SCSI_umts_csg_split_info_list * const pSplitInfoList);
+#endif /* __3G_CSG_SUPPORT__ */
+
+#ifdef __LTE_RAT__
+extern void SCSI_getLteCSGSplitInfoList(SCSI_SIM_INDEX sim_index, SCSI_lte_csg_split_info_list * const pSplitInfoList);
+#endif /* __LTE_RAT__ */
+
+// If found the same frequecny replace it, else allocate one memory and put the SCSI_csg_split_info in the CSGSplitInfo according to rat_type.
+// besides, according to tick_left tick_previous to delete the expired split info.
+#ifdef __3G_CSG_SUPPORT__
+extern void SCSI_newUmtsCSGSplitInfo(SCSI_SIM_INDEX sim_index, kal_uint32 tick_left, SCSI_umts_csg_split_info const * const pSplitInfo);
+#endif /* __3G_CSG_SUPPORT__ */
+
+#ifdef __LTE_RAT__
+extern void SCSI_newLteCSGSplitInfo(SCSI_SIM_INDEX sim_index, kal_uint32 tick_left, SCSI_lte_csg_split_info const * const pSplitInfo);
+#endif /* __LTE_RAT__ */
+
+#endif /* __3G_CSG_SUPPORT__ || __LTE_RAT__ */
+
+/*Multi-Mode******************************************************************/
+#ifdef __GSM_RAT__
+extern void Scsi_SE_ComposeGsmBandBitmask(SCSI_SIM_INDEX sim_index, kal_uint8 GBandBitmask);
+
+extern void Scsi_SE_retrieveGsmBandBitmask(SCSI_SIM_INDEX sim_index, kal_uint8 *pGBandBitmask);
+#endif /* __GSM_RAT__ */
+#ifdef __UMTS_RAT__
+extern void Scsi_SE_ComposeUmtsBandBitmask(SCSI_SIM_INDEX sim_index, kal_uint32 UBandBitmask);
+
+extern void Scsi_SE_retrieveUmtsBandBitmask(SCSI_SIM_INDEX sim_index, kal_uint32 *pUBandBitmask);
+
+extern void Scsi_SE_retrieveUmtsFddBandBitmask(SCSI_SIM_INDEX sim_index, kal_uint32 *pUFddBandBitmask);
+
+extern void Scsi_SE_ComposeUmtsFddAndTddBandBitmask(SCSI_SIM_INDEX sim_index, kal_uint32 UFddBandBitmask, kal_uint32 UTddBandBitmask);
+
+extern void Scsi_SE_retrieveUmtsFddAndTddBandBitmask(SCSI_SIM_INDEX sim_index, kal_uint32 *pUFddBandBitmask, kal_uint32 *pUTddBandBitmask);
+#endif /* __UTMS_RAT__ */
+#ifdef __LTE_RAT__
+extern void Scsi_SE_ComposeLteBandBitmask(SCSI_SIM_INDEX sim_index, SCSI_LTE_Band_Bitmask LBandBitmask);
+
+extern void Scsi_SE_retrieveLteBandBitmask(SCSI_SIM_INDEX sim_index, SCSI_LTE_Band_Bitmask *pLBandBitmask);
+
+extern void Scsi_SE_ComposeLteBandBitmask_extended( SCSI_SIM_INDEX sim_index, const SCSI_LTE_Band_Bitmask_Extended* LBandBitmask );
+
+extern void Scsi_SE_retrieveLteBandBitmask_extended( SCSI_SIM_INDEX sim_index, SCSI_LTE_Band_Bitmask_Extended* pLBandBitmask );
+#endif /* __LTE_RAT__ */
+
+#ifdef __NR_RAT__
+
+extern void Scsi_SE_ComposeNRBandBitmask(SCSI_SIM_INDEX sim_index, const SCSI_NR_Band_Bitmask* pNRBandBitmask);
+extern void Scsi_SE_retrieveNRBandBitmask(SCSI_SIM_INDEX sim_index, SCSI_NR_Band_Bitmask* pNRBandBitmask);
+extern void Scsi_SE_ComposeNR_ENDCBandBitmask(SCSI_SIM_INDEX sim_index,
+ SCSI_GEMINI_STATUS gemini_status,
+ const SCSI_NR_Band_Bitmask* pNR_ENDCBandBitmask);
+extern void Scsi_SE_retrieveNR_ENDCBandBitmask(SCSI_SIM_INDEX sim_index,
+ SCSI_GEMINI_STATUS gemini_status,
+ SCSI_NR_Band_Bitmask* pNR_ENDCBandBitmask);
+#endif /* __NR_RAT__ */
+
+#ifdef __LTE_RAT__
+extern void Scsi_newLteFreqList(plmn_id_struct const* const plmnID, CsiLteFrequencyList* const freqList);
+
+extern void Scsi_getLteFreqList(plmn_id_struct const* const plmnID, CsiLteFrequencyList* const freqList);
+#endif /* __LTE_RAT__ */
+
+#if (defined(__3G_CSG_SUPPORT__) || defined(__LTE_RAT__))
+extern void Scsi_prevVisitedCellInitFromNVRAM(kal_uint8* nvramEfPrevVisitedCellBufPtr, kal_uint16 const nvramEfPrevVisitedCellBufLen);
+
+extern kal_uint16 Scsi_getNvramEFPrevVisitedCell(kal_uint8* const nvramEfPrevVisitedCellBufPtr, kal_uint16 const nvramEfPrevVisitedCellBufLen);
+
+extern void Scsi_prevVisitedCellPurge(void);
+
+extern void Scsi_newPrevVisitedCell(SCSI_SIM_INDEX const simIdx, plmn_id_struct const* const plmnID, ScsiPrevVisitedCell * prevVisitedCell);
+
+extern void Scsi_delPrevVisitedCellGivenPlmnAndCsg(SCSI_SIM_INDEX const simIdx, plmn_id_struct const* const plmnID, CsiCsgId const csgID);
+
+extern void Scsi_getPrevVisitedCellListByPlmn(SCSI_SIM_INDEX const simIdx, plmn_id_struct const* const plmnID, ScsiPrevVisitedCellList * const prevVisitedCellList);
+
+extern kal_bool Scsi_isPrevVisitedCellExistedGivenPlmnAndCsg(SCSI_SIM_INDEX const simIdx, plmn_id_struct const* const plmnID, CsiCsgId const csgID);
+
+#endif /* __3G_CSG_SUPPORT__ || __LTE_RAT__ */
+/*Multi-Mode******************************************************************/
+
+#ifdef UNIT_TEST
+extern void Scsi_initFromNvramUnitTesting(SCSI_SIM_INDEX sim_index);
+extern void Scsi_initFromNvramUnitTesting1(SCSI_SIM_INDEX sim_index);
+extern void Scsi_initFromNvramUnitTesting2(SCSI_SIM_INDEX sim_index);
+extern void Scsi_initFromNvramUnitTesting3(SCSI_SIM_INDEX sim_index);
+extern void Scsi_initFromNvramUnitTesting4(SCSI_SIM_INDEX sim_index);
+extern void Scsi_initFromNvramUnitTestingForRplmnInfo(SCSI_SIM_INDEX sim_index);
+//#ifdef __BAND_PRIORITY_SEARCH__
+extern void Scsi_initFromNvramUnitTestingForBandPrioSearch(SCSI_SIM_INDEX sim_index);
+//#endif /* __BAND_PRIORITY_SEARCH__ */
+extern void Scsi_te(SCSI_SIM_INDEX sim_index);
+#endif
+
+
+#endif /* _(!@$ `scsi.h' $@!)_ */
diff --git a/mcu/protocol/interface/general/sdm_external_lib.h b/mcu/protocol/interface/general/sdm_external_lib.h
new file mode 100644
index 0000000..a297df9
--- /dev/null
+++ b/mcu/protocol/interface/general/sdm_external_lib.h
@@ -0,0 +1,84 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2014
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ * Filename:
+ * ------------
+ * sdm_external_lib.h
+ *
+ * Project:
+ * ------------
+ * MOLY
+ *
+ * Description:
+ * ------------
+ * This file defines functions for external module usage.
+ *
+ * Author:
+ * -----------
+ * -------
+ *
+ *===========================================================
+ * $Log$
+ *
+ * 01 03 2019 hsuanchang.chen
+ * [MOLY00376426] [VzW][Gen93][Gen95] SMS to 911 and SCBM feature - SDM part
+ * . T911 SDM code
+ *
+ *****************************************************************************/
+
+#ifndef _SDM_EXTERNAL_LIB_H_
+#define _SDM_EXTERNAL_LIB_H_
+
+#include "kal_general_types.h"
+#include "l3_inc_enums.h"
+#include "ims_nvram_def.h"
+
+
+
+/******************************************************************************
+ * Function
+ *****************************************************************************/
+/******************************************************************************
+ * @brief ask sdm to leave scbm mode
+ *
+ * @param[in] void
+ *
+ * @return void
+ *
+ *****************************************************************************/
+void sdm_external_exit_scbm_mode (exit_scbm_reason_enum exit_reason, protocol_id_enum ps_id);
+
+#endif // _SDM_EXTERNAL_LIB_H_
diff --git a/mcu/protocol/interface/general/security_keys_enums.h b/mcu/protocol/interface/general/security_keys_enums.h
new file mode 100644
index 0000000..71cdf2f
--- /dev/null
+++ b/mcu/protocol/interface/general/security_keys_enums.h
@@ -0,0 +1,94 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * security_keys_enums.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file is intends for enum definition about security key.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *==============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+
+
+#ifndef _SECURITY_KEYS_ENUMS_H
+#define _SECURITY_KEYS_ENUMS_H
+
+typedef enum {
+ GSM_CK_PRESENT,
+ GPRS_CK_PRESENT,
+ UMTS_CK_PRESENT,
+ UMTS_IK_PRESENT,
+ UMTS_PS_IK_PRESENT,
+ UMTS_PS_CK_PRESENT
+}is_key_present_enum;
+
+typedef enum {
+ SRES_PRESENT,
+ RES_PRESENT
+}result_present_enum;
+
+#endif
+
+
diff --git a/mcu/protocol/interface/general/security_keys_struct.h b/mcu/protocol/interface/general/security_keys_struct.h
new file mode 100644
index 0000000..e2d5cf4
--- /dev/null
+++ b/mcu/protocol/interface/general/security_keys_struct.h
@@ -0,0 +1,142 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * security_keys_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file is intends for structure definition about security key.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *==============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+
+/*******************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2002
+*
+*******************************************************************************
+ * FILENAME : security_keys_struct.h
+ * SYNOPSIS : Functions for encoding/decoding.
+ *
+ * R E V I S I O N H I S T O R Y
+ *
+ */
+#ifndef _SECURITY_KEYS_STRUCT_H
+#define _SECURITY_KEYS_STRUCT_H
+
+#include "kal_general_types.h"
+#include "security_keys_enums.h"
+#include "irat_common_enums.h"
+
+
+typedef struct {
+ kal_uint8 is_gsm_cipher_key_info_present; /* if GSM cipher key present */
+ kal_uint8 gsm_cipher_key_info[KC_LEN]; /* GSM cipher key (Kc) */
+ kal_uint8 is_gprs_cipher_key_info_present; /* if GPRS cipher key present */
+ kal_uint8 gprs_cipher_key_info[KC_LEN]; /* GPRS cipher key (Kc) */
+ kal_uint8 is_gprs_cipher_key128_info_present; /* if GPRS cipher key128 present */
+ kal_uint8 gprs_cipher_key128_info[KC128_LEN]; /* GPRS cipher key128 (Kc) */
+} key_struct;
+
+typedef struct {
+ kal_uint32 res; /* if result is of 4 bytes*/
+ kal_uint8 res_ext_len; /* if result is > 4 bytes*/
+ kal_uint8 res_extP;
+ kal_uint8 res_ext[12];
+} result_ext_struct;
+
+typedef struct {
+ result_present_enum result_type_tag;
+ union {
+ kal_uint32 sres;
+ result_ext_struct res;
+ } result_type_value;
+} result_struct;
+#endif
+
+
diff --git a/mcu/protocol/interface/general/sm2data_plane_struct.h b/mcu/protocol/interface/general/sm2data_plane_struct.h
new file mode 100644
index 0000000..a826391
--- /dev/null
+++ b/mcu/protocol/interface/general/sm2data_plane_struct.h
@@ -0,0 +1,144 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * sm2data_plane_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file describes the common structure of SM and data plane.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _SM2DATA_PLANE_STRUCT_H
+#define _SM2DATA_PLANE_STRUCT_H
+
+#include "kal_public_defs.h"
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 nsapi;
+ qos_struct qos_negotiated;
+ kal_uint8 p_comp_algo;
+ kal_uint8 d_comp_algo;
+ kal_uint8 pdp_addr_type;
+ kal_uint8 llc_sapi;
+ kal_uint8 mmi_id;
+ kal_uint8 radio_priority;
+ kal_uint8 pkt_flow_id;
+ kal_uint16 req_n201u; //erica 20070112
+ kal_uint8 dl_pool_id; /* flc2_pool_id_enum */ //mtk00714 20080910 for __MULTIPLE_PPP_DIALUP_SUPPORT__
+} snsm_activate_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 nsapi;
+ qos_struct qos_negotiated;
+ kal_uint8 llc_sapi;
+ kal_uint8 radio_priority;
+ kal_uint8 pkt_flow_id;
+} snsm_modify_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 no_of_valid_entries;
+ kal_uint8 nsapi_list[11];
+ kal_uint8 cause;
+} snsm_deactivate_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 no_of_valid_entries;
+ kal_uint8 nsapi_list[11];
+ kal_uint8 sequence_list[11];
+} snsm_sequence_ind_struct;
+
+/* erica 20051229: for egprs */
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 cell_support_egprs;
+} snsm_cell_info_update_ind_struct;
+
+#endif
+
+
diff --git a/mcu/protocol/interface/general/sm2mm_struct.h b/mcu/protocol/interface/general/sm2mm_struct.h
new file mode 100644
index 0000000..6dd4cf9
--- /dev/null
+++ b/mcu/protocol/interface/general/sm2mm_struct.h
@@ -0,0 +1,296 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * sm2mm_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file describes the common structure of SM and MM.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _SM2MM_STRUCT_H
+#define _SM2MM_STRUCT_H
+
+#include "kal_general_types.h"
+#include "kal_public_defs.h"
+#include "l3_inc_enums.h"
+#include "mcd_l3_inc_gprs_struct.h"
+#include "as2nas_struct.h"
+#include "irat_common_struct.h"
+#include "smmm_enums.h"
+
+typedef struct {
+ LOCAL_PARA_HDR
+ qos_struct qos;
+ kal_uint32 tlli;
+ rp_enum radio_priority;
+ est_cause_enum cause;
+ kal_uint8 pkt_flow_identifier;
+ peer_msg_id_struct peer_msg_id;
+} gmmsm_unitdata_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint16 nsapi_status;
+ traffic_class_enum max_traffic_class; // the highest quality traffic class among all active PDP context
+} gmmsm_nsapi_status_req_struct;
+
+typedef struct {
+ /** ILM specific header. */
+ LOCAL_PARA_HDR
+
+ /** used to indicate nas priority config, used if __MTC_SUPPORT__ */
+ nas_priority_config_enum nas_priority_config ;
+
+ /** used to indicate eab override, used if __MTC_SUPPORT__ */
+ eab_override_config_enum eab_override_config ;
+} gmmsm_dual_priority_config_req_struct;
+
+#ifdef __GEMINI__
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 retry_count;
+ gmmsm_pdp_session_procedure_type_enum session_proc_type;
+} gmmsm_session_begin_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ gmmsm_pdp_session_procedure_type_enum session_proc_type;
+} gmmsm_session_end_req_struct;
+#endif
+
+typedef struct {
+ LOCAL_PARA_HDR
+ est_cause_enum cause;
+} gmmsm_attach_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ est_cause_enum cause;
+} gmmsm_est_req_struct;
+
+#ifdef __SM_UT__
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 sm_calculate_mt_procedure_pdp_number_result;
+ kal_uint8 sm_calculate_mo_procedure_pdp_number_result;
+ kal_uint32 sm_calculate_how_many_pdp_are_used_result;
+} sm_test_sm_calculate_how_many_pdp_are_used_struct;
+
+#endif // ~ #ifdef __SM_UT__
+
+/**
+ * According to Multimode interRAT message processing rules,
+ * the receiving module, said... the MOD_A, need to process this message in the following way
+ * - (1) Relay this interRAT message to next module, said... the MOD_B, first
+ * - (2) then MOD_A can start to do processing of this message
+ * because when a RD designs a new MM iRAT feature, he/she will assume others process these messages in this way
+ * this rules make sures the interRAT message flow is as expected
+ */
+typedef struct {
+ LOCAL_PARA_HDR
+ irat_type_enum irat_type; //Indicates the inter-RAT type
+ rat_type_enum source_rat; //Source RAT
+ rat_type_enum target_rat; //Target RAT
+ irat_result_enum irat_result; //The result of inter-RAT change
+ void* as_info_ptr; //The pointer of AS container information
+} gmmsm_rat_change_rsp_struct; // (23G4 finish)
+
+/**
+ * According to Multimode interRAT message processing rules,
+ * the receiving module, said... the MOD_A, need to process this message in the following way
+ * - (1) Relay this interRAT message to next module, said... the MOD_B, first
+ * - (2) then MOD_A can start to do processing of this message
+ * because when a RD designs a new MM iRAT feature, he/she will assume others process these messages in this way
+ * this rules make sures the interRAT message flow is as expected
+ */
+typedef struct {
+ LOCAL_PARA_HDR
+ irat_type_enum irat_type; //Indicates the inter-RAT type
+ rat_type_enum source_rat; //Source RAT (GAS or UAS)
+ rat_type_enum target_rat; //Target RAT (Should be EAS)
+ kal_bool esm_deactivate_isr; //ESM sets this flag if ESM bearer has been added or modified after ISR was activated
+ kal_uint16 nsapi_status; //PDP context status
+
+ /** Bit-array of nas-priority for all nsapi.
+ * - Bit sequence: (high)nsapi-15 - (low)nsapi-0
+ * - 0: Already or ready-to use "low priority"
+ * - 1: Already or ready-to use "normal priority"
+ * - If not specified by user: Use 1 (normal priority) by default
+ */
+ kal_uint16 nas_priority_status;
+
+ /** Bit-array of eab-override for all nsapi.
+ * - Bit sequence: (high)nsapi-15 - (low)nsapi-0
+ * - 0: Already or ready-to use "not override"
+ * - 1: Already or ready-to use "can override"
+ * - If not specified by user: Use 0 (not override) by default
+ */
+ kal_uint16 eab_override_status;
+
+ traffic_class_enum max_traffic_class; // the highest quality traffic class among all active PDP context
+
+ emm2mm_irat_info_struct emm_info;
+
+ void* as_info_ptr; //Indicates the address of the activation request for RAT change to LTE, the information is dedicated for AS.
+ //The buffer will be freed by soure or target AS
+} gmmsm_rat_change_req_struct; // (4G23 start)
+
+typedef struct {
+ LOCAL_PARA_HDR
+ // check L4_NAS_RAT_CHANGE_SAP.docx for detail
+} gmmsm_isr_deactivate_req_struct;
+
+
+typedef struct {
+ LOCAL_PARA_HDR
+ gmmsm_event_report_type_enum event;
+} gmmsm_event_report_req_struct;
+
+#endif
+
+
diff --git a/mcu/protocol/interface/general/sm_esm_struct.h b/mcu/protocol/interface/general/sm_esm_struct.h
new file mode 100644
index 0000000..52c032e
--- /dev/null
+++ b/mcu/protocol/interface/general/sm_esm_struct.h
@@ -0,0 +1,200 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * sm_emm_struct.h
+ *
+ * Project:
+ * --------
+ * MOLY
+ *
+ * Description:
+ * ------------
+ * This file describes the common structure of SM and eSM
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _SM_ESM_STRUCT_H
+#define _SM_ESM_STRUCT_H
+
+#include "kal_general_types.h"
+#include "irat_common_struct.h"
+#include "kal_public_defs.h"
+
+/**
+ * 3GPP spec version: x.y.z
+ * x => NAS_MAJOR_VERSION
+ * y => NAS_MINOR_VERSION
+ * z => NAS_RELEASE_VERSION
+*/
+
+typedef enum{
+ NAS_MAJOR_VERSION = 15
+}NAS_MAJOR_VERSION_INFO;
+
+typedef enum{
+ NAS_MINOR_VERSION = 5
+}NAS_MINOR_VERSION_INFO;
+
+typedef enum{
+ NAS_RELEASE_VERSION = 0
+} NAS_RELEASE_VERSION_INFO;
+
+typedef struct {
+ kal_uint8 bearer_id;
+ bearer_mapping_result_enum mapping_result;
+}sm_esm_transferred_context_struct;
+
+typedef struct {
+ kal_uint8 total_number; // Total number of PDP context/EPS bearer which transfered to target RAT
+ sm_esm_transferred_context_struct bearers[MAX_TRANSFERRED_BEARER_NUM];
+}sm_esm_context_status_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ // no need to include irat_type, source_rat, target_rat, irat_result. because ESM will send this msg to SM only when 4G23 success
+ //bearer_ctxt_transfer_struct epsb_info;
+ kal_uint8 total_number; // Total number of PDP context/EPS bearer which will transfer to target RAT
+ bearer_ctxt_struct epsb_context[MAX_TRANSFERRED_BEARER_NUM]; // bearer context which will transfer to target RAT
+} sm_esm_epsb_context_transfer_ind_struct; // 4G23 success context transfer: ESM --> SM
+
+typedef sm_esm_epsb_context_transfer_ind_struct sm_esm_epsb_context_transfer_ind_for_sm_ut_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ sm_esm_context_status_struct pdp_ctxt_sts;
+} sm_esm_epsb_context_transfer_rsp_struct; // 4G23 success context transfer: SM --> ESM
+
+typedef struct {
+ LOCAL_PARA_HDR
+ // no need to include irat_type, source_rat, target_rat, irat_result. because ESM will send this msg to SM only when 4G23 success
+ //bearer_ctxt_transfer_struct pdp_info;
+ kal_uint8 total_number; // Total number of PDP context/EPS bearer which will transfer to target RAT
+ bearer_ctxt_struct pdp_context[MAX_TRANSFERRED_BEARER_NUM]; // bearer context which will transfer to target RAT
+} sm_pdp_context_transfer_req_struct; // iRAT success context transfer: Source RAT --> Target RAT
+
+typedef sm_pdp_context_transfer_req_struct sm_esm_pdp_context_transfer_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ sm_esm_context_status_struct epsb_ctxt_sts;
+} sm_esm_pdp_context_transfer_cnf_struct; // 23G4 success context transfer : ESM --> SM
+
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 total_number; // Total number of PDP context/EPS bearer which will transfer to target RAT
+ bearer_ctxt_struct epsb_context[MAX_TRANSFERRED_BEARER_NUM]; // bearer context which will transfer to target RAT
+ kal_bool is_deactivate_isr; // whether ISR has to be deactivated after iRAT
+} esm_sm_irat_info_transfer_req_struct; // 4G23 context transfer: ESM --> SM
+
+typedef esm_sm_irat_info_transfer_req_struct esm_sm_irat_info_transfer_req_for_sm_ut_struct;
+typedef sm_esm_epsb_context_transfer_rsp_struct esm_sm_irat_info_transfer_cnf_struct; // 4G23 context transfer: SM --> ESM
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 total_number; // Total number of PDP context/EPS bearer which will transfer to target RAT
+ bearer_ctxt_struct pdp_context[MAX_TRANSFERRED_BEARER_NUM]; // bearer context which will transfer to target RAT
+ kal_bool is_deactivate_isr; // whether ISR has to be deactivated after iRAT
+} sm_esm_irat_info_transfer_req_struct; // 23G4 context transfer: SM --> ESM
+
+typedef sm_esm_pdp_context_transfer_cnf_struct sm_esm_irat_info_transfer_cnf_struct; // 23G4 context transfer: ESM --> SM
+
+#endif // ~ _SM_ESM_STRUCT_H
+
+
diff --git a/mcu/protocol/interface/general/sm_ratdm_struct.h b/mcu/protocol/interface/general/sm_ratdm_struct.h
new file mode 100644
index 0000000..e4f5dc7
--- /dev/null
+++ b/mcu/protocol/interface/general/sm_ratdm_struct.h
@@ -0,0 +1,173 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * sm_ratdm_struct.h
+ *
+ * Project:
+ * --------
+ * MONZA
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ ******************************************************************************/
+
+#ifndef SM_RATDM_STRUCT_H
+#define SM_RATDM_STRUCT_H
+
+#include "kal_general_types.h"
+#include "mcd_l3_inc_gprs_struct.h"
+#include "l3_inc_local.h"
+#include "esm_ratdm_struct.h"
+#include "kal_public_defs.h"
+
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 no_of_nsapis;
+ kal_uint8 nsapi_list[11];
+ kal_bool need_sm_modify;
+} sm_ratdm_rab_activate_ind_struct;
+
+typedef struct {
+ NSAPI_STRUCT_HDR // LOCAL_PARA_HDR + kal_uint8 nsapi (SM code assume nsapi is the first parameter of some primitive)
+ kal_uint8 is_successful;
+} sm_ratdm_rab_activate_rsp_struct;
+
+typedef struct {
+ NSAPI_STRUCT_HDR // LOCAL_PARA_HDR + kal_uint8 nsapi (SM code assume nsapi is the first parameter of some primitive)
+ /* 23G ralated parameters */
+ kal_uint8 llc_sapi;
+ qos_struct qos_negotiated;
+ kal_uint8 radio_priority;
+ kal_uint8 pfi;
+
+ /* 4G ralated parameters */
+ esm_qci_enum qci;
+} sm_ratdm_activate_req_struct;
+
+typedef struct {
+ NSAPI_STRUCT_HDR // LOCAL_PARA_HDR + kal_uint8 nsapi (SM code assume nsapi is the first parameter of some primitive)
+} sm_ratdm_activate_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 no_of_nsapis;
+ kal_uint8 nsapi_list[11];
+ kal_uint8 cause;
+ kal_bool xid_neg_indicator[11];
+ kal_bool MMiRAT[11]; // This parameter is used by SM to inform RATDM the reason to establish this context:
+ // if TRUE, means this context is transferred from 4G,
+ // if FALSE, means this context is established by user trigger
+} sm_ratdm_deactivate_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 no_of_nsapis;
+ kal_uint8 nsapi_list[11];
+#ifdef __DIALUP_GPRS_COUNTER_SUPPORT__
+ kal_uint64 tx_data_amount[11]; // new field for gprs call history
+ kal_uint64 rx_data_amount[11]; // new field for gprs call history
+#endif
+} sm_ratdm_deactivate_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 no_of_nsapis;
+ kal_uint8 nsapi_list[11];
+} sm_ratdm_rab_deactivate_ind_struct;
+
+typedef struct {
+ NSAPI_STRUCT_HDR // LOCAL_PARA_HDR + kal_uint8 nsapi (SM code assume nsapi is the first parameter of some primitive)
+ /* 23G ralated parameters */
+ kal_bool is_radio_priority_present;
+ kal_uint8 radio_priority;
+
+ kal_bool is_llc_sapi_present;
+ kal_uint8 llc_sapi;
+
+ kal_bool is_qos_negotiated_present;
+ qos_struct qos_negotiated;
+
+ kal_bool is_pfi_present;
+ kal_uint8 pfi;
+
+ /* 4G ralated parameters */
+ esm_qci_enum qci;
+} sm_ratdm_modify_req_struct;
+
+typedef struct {
+ NSAPI_STRUCT_HDR // LOCAL_PARA_HDR + kal_uint8 nsapi (SM code assume nsapi is the first parameter of some primitive)
+} sm_ratdm_modify_cnf_struct;
+
+typedef struct {
+ NSAPI_STRUCT_HDR // LOCAL_PARA_HDR + kal_uint8 nsapi (SM code assume nsapi is the first parameter of some primitive)
+ kal_uint8 cause;
+} sm_ratdm_status_ind_struct;
+
+// The primitive is used to indicate RATDM that upper layer (UPCM, IPCore¡Ketc) configuration is done,
+// and downlink packet data can now route to upper layer if they were queued in RATDM or lower layer.
+// Although current RATDM does not queue any DL data,
+// we decide to align 4G design and still send this primitive for future possible usage
+typedef struct {
+ NSAPI_STRUCT_HDR // LOCAL_PARA_HDR + kal_uint8 nsapi (SM code assume nsapi is the first parameter of some primitive)
+} sm_ratdm_allow_dl_packet_ind_struct;
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif // ~ #if 0
+
+
+#endif /* SM_RATDM_STRUCT_H */
diff --git a/mcu/protocol/interface/general/smic_ratdm_struct.h b/mcu/protocol/interface/general/smic_ratdm_struct.h
new file mode 100644
index 0000000..6ae303e
--- /dev/null
+++ b/mcu/protocol/interface/general/smic_ratdm_struct.h
@@ -0,0 +1,71 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * smic_ratdm_struct.h
+ *
+ * Project:
+ * --------
+ *
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ ******************************************************************************
+ * $Log$
+ *
+ *
+ *
+ ******************************************************************************/
+
+#ifndef SMIC_RATDM_STRUCT_H
+#define SMIC_RATDM_STRUCT_H
+
+#include "kal_general_types.h"
+#include "kal_public_defs.h"
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_with_n26_support;
+}smic_ratdm_n26_capability_update_req_struct;
+
+#endif /* SMIC_RATDM_STRUCT_H */
diff --git a/mcu/protocol/interface/general/smmm_enums.h b/mcu/protocol/interface/general/smmm_enums.h
new file mode 100644
index 0000000..09b61ad
--- /dev/null
+++ b/mcu/protocol/interface/general/smmm_enums.h
@@ -0,0 +1,204 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * smmm_enums.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file contains enum definition between SM and MM.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *============================================================================
+ ****************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _SMMM_ENUMS_H
+#define _SMMM_ENUMS_H
+
+/* Protocol Discriminator Values to be used */
+#define SM_MSG 0x0A
+#define MAX_NPDU_LIST 11
+#define RECEIVE_NPDU_LIST_IEI 0x26
+
+// Carlson 2013.07.22 please check the gmmsm_cause_enum and the DC_Status together
+// 1. For suspend due to CM/MM/GMM procedure, GMM will send GMMSM_SUSPEND_REQ to SM, using only one of the 2 causes: PS_SUSPEND_LR / PS_SUSPEND_CM
+// 2. For Gemini suspend, GMM will not relay UNITDATA_REQ if other SIM is busy, and GMM will send UNITDATA_CNF.DC_Status_Gemini_Suspend_Discard to SM
+// 3. For gmmsm_cause_enum: GMMSM_INSUFFICIENT_RESOURCE, it is only used in GMMSM_ATTACH_REJ due to Gemini
+typedef enum
+{
+ NORM_DETACH,
+ POWER_OFF_DETACH,
+ REATTACH_REQ,
+ SIM_REMOVAL,
+ RAU_START,
+ PS_SERVICE_SUSPEND,
+ GMMSM_GMM_IN_INCOMPATIBLE_STATE,
+ UN_SPECIFIED,
+ DETACH_ONGOING, //erica 20070522
+ PS_SUSPEND_LR, /* PS is suspended because of LU, IMSI detach */
+ PS_SUSPEND_CM, /* PS is suspended because of CM connection(other than Call) */
+ PS_SUSPEND_CM_CALL /* PS is suspended because of CM connection due to Call in GSM */
+#ifdef __GEMINI__
+ , GMMSM_INSUFFICIENT_RESOURCE /* mtk00714: RR in suspend mode or the otherside is attached already */
+#endif
+ ,SETUP_RAB_START /*ps is suspend because of SETUP RAB*/
+ ,GMMSM_T3346_RUNNING
+ ,GEMINI_RSVA
+} gmmsm_cause_enum;
+
+typedef enum
+{
+ MS_IDLE,
+ MS_CONNECTED
+} gmmsm_state_enum;
+
+typedef enum
+{
+ NW_FOP_INFO_INVALID, /* Field follow_on_status in gmmsm_attach_cnf shall not be referenced */
+ NW_FOP_OFF, /* NW did not specified follow-on-proceed in attach accept, 3G PS signaling connection shall not be reused */
+ NW_FOP_ON /* NW sepcified follow-on-proceed in attach accept, 3G PS signaling connection can be reused */
+} gmmsm_fop_status_enum;
+
+typedef enum
+{
+ SM_EVENT_NULL,
+ SM_EVENT_PDP_ACT_REJ_RCVD_FROM_NW
+} gmmsm_event_report_type_enum;
+
+typedef enum
+{
+ SM_PDP_SESSION_NONE_PROCEDURE,
+ SM_PDP_SESSION_ACTIVATION_TOP_PROCEDURE,
+ SM_PDP_SESSION_ACTIVATION_PROCEDURE,
+ SM_PDP_SESSION_ACTIVATION_RETRY_PROCEDURE,
+ SM_PDP_SESSION_MODIFICATION_PROCEDURE,
+ SM_PDP_SESSION_DEACTIVATION_PROCEDURE,
+ SM_PDP_SESSION_DEACTIVATION_RETRY_PROCEDURE
+} gmmsm_pdp_session_procedure_type_enum;
+
+#endif
+
+/* End of file smmm_interface.h */
+
+
diff --git a/mcu/protocol/interface/general/sms2mm_struct.h b/mcu/protocol/interface/general/sms2mm_struct.h
new file mode 100644
index 0000000..3faaaaf
--- /dev/null
+++ b/mcu/protocol/interface/general/sms2mm_struct.h
@@ -0,0 +1,115 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * sms2mm_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file describes the common structure of SMS and MM.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _SMS2MM_STRUCT_H
+#define _SMS2MM_STRUCT_H
+
+#include "mcd_l3_inc_gprs_struct.h"
+#include "kal_general_types.h"
+#include "kal_public_defs.h"
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 sapi;
+ concise_qos_struct qos;
+ rp_enum radio_priority;
+} gmmsms_unitdata_req_struct;
+
+#endif
diff --git a/mcu/protocol/interface/general/smsal_as_struct.h b/mcu/protocol/interface/general/smsal_as_struct.h
new file mode 100644
index 0000000..8e5ff7d
--- /dev/null
+++ b/mcu/protocol/interface/general/smsal_as_struct.h
@@ -0,0 +1,163 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * smsal_as_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *============================================================================
+ ****************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+/*******************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2002
+*
+*******************************************************************************
+ * FILENAME : smsal_as_struct.h
+ * SYNOPSIS : Functions for encoding/decoding.
+ *
+ * R E V I S I O N H I S T O R Y
+ *
+ */
+#ifndef _SMSAL_AS_STRUCT_H
+#define _SMSAL_AS_STRUCT_H
+
+#include "kal_general_types.h"
+#include "kal_public_defs.h"
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 cbch_req;
+} smsal_as_cbch_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint16 mids[60]; // = [SMSAL_PS_CBMI_MAX_ENTRY]
+ kal_uint16 midd[30]; // = [SMSAL_CB_MAX_ENTRY]
+ kal_uint16 midr[60]; // = [SMSAL_CB_MAX_ENTRY*2]
+ kal_uint16 dcss[30]; // = [SMSAL_CB_MAX_ENTRY]
+ kal_bool is_all_language_on;
+} smsal_as_cb_update_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint16 sn;
+ kal_uint16 mi;
+ kal_uint8 dcs;
+ kal_uint8 page;
+ kal_uint8 pages;
+ kal_uint8 is_mids;
+ kal_uint8 mi_index;
+ kal_uint8 page_data[88];
+
+ kal_uint8 valid_blk_num;
+
+} smsal_as_cb_page_ind_struct;
+
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 geography_type;
+} smsal_as_cb_gs_change_ind_struct;
+
+#endif
+
+
diff --git a/mcu/protocol/interface/general/snd2llc_struct.h b/mcu/protocol/interface/general/snd2llc_struct.h
new file mode 100644
index 0000000..7fc6964
--- /dev/null
+++ b/mcu/protocol/interface/general/snd2llc_struct.h
@@ -0,0 +1,178 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * snd2llc_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file describes the common structure of SNDCP and LLC.
+ *
+ * Author:
+ * -------
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+// Poying: 20101105. RHR.
+//------------------------------ suggest Add ------------------------------
+#include "kal_general_types.h"
+#include "kal_public_defs.h"
+#include "mcd_l3_inc_gprs_struct.h"
+#include "flc2_config.h"
+
+#ifndef _SND2LLC_STRUCT_H
+#define _SND2LLC_STRUCT_H
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 sapi;
+ kal_uint8 local; /* LOCAL*/
+ kal_uint32 tlli; /* TLLI*/
+} ll_release_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 sapi;
+ kal_uint32 tlli; /* TLLI*/
+ kal_uint16 req_n201u; //erica 20070112
+} ll_xid_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 sapi;
+ kal_uint32 tlli; /* TLLI*/
+} ll_xid_res_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 sapi;
+ kal_uint32 tlli; /* TLLI*/
+} ll_establish_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 sapi;
+ kal_uint32 tlli; /* TLLI*/
+} ll_establish_res_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 sapi;
+ kal_uint8 radio_priority; /* RADIO PRIORITY*/
+ kal_uint16 reference; /* SNDLLC REFERENCE TYPE*/
+ flc2_pool_id_enum pspdu_ul_pool_id ;
+ kal_uint32 tlli; /* TLLI*/
+ kal_uint8 pfi; /* PFI */
+ concise_qos_struct qos_param; /* QOS STRUCTURE*/
+} ll_data_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 sapi;
+ kal_uint8 is_ack_mode;
+} ll_sapi_act_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 sapi;
+} ll_sapi_deact_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_all_flush;
+ kal_bool are_two_pdp_same_qos;
+ kal_uint8 radio_priority; /* LLC shall decrement by onw when sent to RLC. */
+ concise_qos_struct qos_param;
+ kal_bool is_need_cnf;
+} llsnd_flush_req_struct;
+
+typedef ll_release_req_struct llsnd_release_req_struct;
+typedef ll_xid_req_struct llsnd_xid_req_struct;
+typedef ll_xid_res_struct llsnd_xid_res_struct;
+typedef ll_establish_req_struct llsnd_establish_req_struct;
+typedef ll_establish_res_struct llsnd_establish_res_struct;
+typedef ll_data_req_struct llsnd_data_req_struct;
+typedef ll_sapi_act_req_struct llsnd_sapi_act_req_struct;
+typedef ll_sapi_deact_req_struct llsnd_sapi_deact_req_struct;
+
+#endif
+
+
diff --git a/mcu/protocol/interface/general/snd2tcm_struct.h b/mcu/protocol/interface/general/snd2tcm_struct.h
new file mode 100644
index 0000000..4753426
--- /dev/null
+++ b/mcu/protocol/interface/general/snd2tcm_struct.h
@@ -0,0 +1,102 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * SND2TCM_STRUCT.H
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file describes the common enums of TCM and SNDCP.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *============================================================================
+ ****************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _SND2TCM_STRUCT_H
+#define _SND2TCM_STRUCT_H
+
+#include "kal_public_defs.h"
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 nsapi; /* NSAPI data plane index to the PDP context*/
+ kal_uint8 flc_pool_type; //FLC1 only
+ kal_uint8 pool_id;
+} sn_data_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 nsapi; /* NSAPI data plane index to the PDP context*/
+ kal_uint8 flc_pool_type; //FLC1 only
+ kal_uint8 pool_id;
+} sn_unitdata_ind_struct;
+#endif
+
+
diff --git a/mcu/protocol/interface/general/sndllc_enums.h b/mcu/protocol/interface/general/sndllc_enums.h
new file mode 100644
index 0000000..873e5c0
--- /dev/null
+++ b/mcu/protocol/interface/general/sndllc_enums.h
@@ -0,0 +1,106 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * sndllc_enums.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file contains enum definition between SNDCP and LLC.
+ *
+ * Author:
+ * -------
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+
+
+#ifndef _SNDLLC_INTERFACE_H
+#define _SNDLLC_INTERFACE_H
+
+/* Value used in LL_DATA_REQ and LL_DATA_CNF between SNDCP and LLC */
+typedef kal_uint16 SNDLLC_REFERENCE_TYPE;
+
+/* Sapi's defined b/w SNDCP and LLC */
+
+typedef enum {
+ LLC_SNDCP_3_SAP=3,
+ LLC_SNDCP_5_SAP=5,
+ LLC_SNDCP_9_SAP=9,
+ LLC_SNDCP_11_SAP=11
+ } LLC_SND_SAP_TYPE ;
+
+typedef enum {
+ LLSND_NORMAL_RELEASE,
+ LLSND_PEER_NO_RESPONSE,
+ LLSND_DM_RECEIVED,
+ LLSND_INVALID_XID_RES,
+ LLSND_NO_MEMORY_FOR_ARQ,
+ LLSND_LOCAL_RELEASE,
+ LLSND_CREATE_REGION_FAILED,
+ LLSND_INSUFFICIENT_XID_RESOURCE,
+ LLSND_LOWER_LAYER_FAILURE
+} llsnd_cause_enum;
+
+
+#endif /* End of snd2llc_interface.h */
+
diff --git a/mcu/protocol/interface/general/t302fa_struct.h b/mcu/protocol/interface/general/t302fa_struct.h
new file mode 100644
index 0000000..305c793
--- /dev/null
+++ b/mcu/protocol/interface/general/t302fa_struct.h
@@ -0,0 +1,209 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+/*****************************************************************************
+ * Copyright Statement:
+ * --------------------
+ * This software is protected by Copyright and the information contained
+ * herein is confidential. The software may not be copied and the information
+ * contained herein may not be used or disclosed except with the written
+ * permission of MediaTek Inc. (C) 2003
+ *
+ ****************************************************************************/
+
+/*****************************************************************************
+ * Filename:
+ * ---------
+ * t302fa_struct.h
+ *
+ * Project:
+ * --------
+ * Fax Over GSM
+ *
+ * Description:
+ * ------------
+ * This file contains the data structures for messages between FA and T30
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *==============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *============================================================================
+ *******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+
+
+
+#ifndef T302FA_STRUCT_H
+#define T302FA_STRUCT_H
+
+#include "kal_general_types.h"
+#include "kal_public_defs.h"
+
+/* DATA REQ local param struct */
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool is_final;
+ kal_uint8 length;
+ kal_uint8 is_next_followed;
+}t30_fa_data_req_struct;
+
+
+
+
+//Robert
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 access_rate;
+ kal_uint8 is_FR ;
+}t30_fa_activate_req_struct;
+
+/* FA Command request local param struct */
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool is_final;
+ kal_uint8 length;
+}t30_fa_cmd_req_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 fax_rate;
+ kal_uint8 data_type;
+}t30_fa_tx_data_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 fax_rate;
+ kal_uint8 data_type;
+}t30_fa_rx_data_req_struct;
+
+
+
+
+/***************************************************************************
+ T32 <- FA *
+***************************************************************************/
+
+/* FA Command indication local param struct */
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool is_final;
+ kal_uint8 length;
+}fa_t30_cmd_ind_struct;
+
+/* FA Data indication local param struct */
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 length;
+ kal_bool is_final;
+}fa_t30_data_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 gsm_rate;
+ kal_uint8 is_FR;
+ kal_uint16 byte_cnt;
+}fa_t30_rate_change_struct;
+
+
+/* FA Activate Confirm message local param structure */
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool is_successful;
+ kal_uint8 gsm_rate;
+ kal_uint8 is_FR;
+ kal_uint16 byte_cnt;
+}fa_t30_activate_cnf_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool is_successful;
+}fa_t30_tx_data_cnf_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool is_successful;
+}fa_t30_rx_data_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 allowed_frame_num;
+} fa_t30_get_data_ind_struct;
+
+
+
+#endif /* T302FA_STRUCT_H */
+
+
diff --git a/mcu/protocol/interface/general/tcm2snd_struct.h b/mcu/protocol/interface/general/tcm2snd_struct.h
new file mode 100644
index 0000000..eee2505
--- /dev/null
+++ b/mcu/protocol/interface/general/tcm2snd_struct.h
@@ -0,0 +1,104 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ *
+ * Filename:
+ * ---------
+ * TCM2SND_STRUCT.H
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file describes the common enums of TCM and SNDCP.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *============================================================================
+ ****************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+
+#ifndef _TCM2SND_STRUCT_H
+#define _TCM2SND_STRUCT_H
+
+#include "kal_public_defs.h"
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 nsapi; /* NSAPI*/
+ kal_uint8 npdu_number; /* NPDU Number*/
+ kal_uint8 data_type; //only for FLC1
+ kal_uint8 pool_id;
+
+} sn_data_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 nsapi; /* NSAPI*/
+ kal_uint8 data_type; //only for FLC1
+ kal_uint8 pool_id;
+} sn_unitdata_req_struct;
+#endif
+
+
diff --git a/mcu/protocol/interface/general/tcm_smic_struct.h b/mcu/protocol/interface/general/tcm_smic_struct.h
new file mode 100644
index 0000000..67f8ac9
--- /dev/null
+++ b/mcu/protocol/interface/general/tcm_smic_struct.h
@@ -0,0 +1,73 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * tcm_smic_struct.h
+ *
+ * Project:
+ * --------
+ * VMOLY
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ ******************************************************************************/
+
+#ifndef TCM_SMIC_STRUCT_H
+#define TCM_SMIC_STRUCT_H
+
+#include "kal_general_types.h"
+#include "kal_public_defs.h"
+#include "ps_public_enum.h"
+
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 psi;
+ kal_bool is_always_on_pdu_session_req_present;
+ always_on_pdu_session_req_enum always_on_pdu_session_req;
+ kal_bool rqos_support;
+ kal_bool mh6_support;
+
+} tcm_smic_5g_ue_info_define_req_struct;
+
+#endif /* TCM_SMIC_STRUCT_H */
diff --git a/mcu/protocol/interface/general/tft_pf_stats.h b/mcu/protocol/interface/general/tft_pf_stats.h
new file mode 100644
index 0000000..0e9f045
--- /dev/null
+++ b/mcu/protocol/interface/general/tft_pf_stats.h
@@ -0,0 +1,101 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2012
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * tft_pf_stats.h
+ *
+ * Project:
+ * --------
+ * MOLY
+ *
+ * Description:
+ * ------------
+ * TFT PF statistics
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 05 27 2013 moja.hsu
+ * [MOLY00007625] Maintain code
+ * add UPCM EM stats.
+ ****************************************************************************/
+/*
+ * =====================================================================================
+ *
+ * Filename: tft_pf.h
+ *
+ * Description: tft interface.
+ *
+ * Created: 2013/05/21 03:39:10
+ * Author: mtk01641 (moja)
+ * =====================================================================================
+ */
+
+#ifndef TFT_PF_STATS_INC
+#define TFT_PF_STATS_INC
+
+typedef struct
+{
+ kal_uint32 pkt_filter_alloc;
+ kal_uint32 pkt_filter_release;
+
+ kal_uint32 pkt_filter_add_v4;
+ kal_uint32 pkt_filter_add_v6;
+ kal_uint32 pkt_filter_remove_v4;
+ kal_uint32 pkt_filter_remove_v6;
+
+ kal_uint32 empty_tck_ack;
+
+ kal_uint32 actv_epsb;
+ kal_uint32 actv_epsb_err;
+
+ kal_uint32 deactv_epsb;
+ kal_uint32 deactv_epsb_err;
+
+ kal_uint32 pkt_filter_add_fail;
+ kal_uint32 pkt_filter_replace_fail;
+ kal_uint32 pkt_filter_del_fail;
+ kal_uint32 pkt_filter_del_all_fail;
+}tft_pf_stats_t;
+#endif /* ----- #ifndef TFT_PF_STATS_INC ----- */
+
diff --git a/mcu/protocol/interface/general/tftlib_api.h b/mcu/protocol/interface/general/tftlib_api.h
new file mode 100644
index 0000000..8f5954f
--- /dev/null
+++ b/mcu/protocol/interface/general/tftlib_api.h
@@ -0,0 +1,431 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2012
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * tftlib_api.h
+ *
+ * Project:
+ * --------
+ * MOLY
+ *
+ * Description:
+ * ------------
+ * TFT library API header file
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 08 12 2020 terence.kuo
+ * [MOLY00557318] [MT6875][Margaux][Q0][R3][MP6][SQC][Internal][WW FT][China][Quzhou][5GMM][MDST][SWIFT][S][CMCC+Invalid][Error times:1]System API Dump,1165,29,99,/data/vendor/core/,1,,mtkrild:AT command pending too long. assert!!! AT cmd: EAPNACT.timer: 900000ms
+ * . Provide a new API which constructs context for default bearer without tft to TCM.
+ *
+ * 03 09 2020 terence.kuo
+ * [MOLY00503923] [MT6885][Petrus][MP2][Ericsson][IODT][SA FullStack][Kista][5G] UE crash: [1][core1,vpe0,tc0(vpe3)] Fatal Error (0x823, 0x100, 0xcccccccc) - URR
+ *
+ * . Create a uniform api to free control buffers allocated for packet filter action list.
+ *
+ * 09 04 2019 terence.kuo
+ * [MOLY00434754] Upgrade CGTFT to support 5GC
+ *
+ * . Update CGTFT behaviors in tftlib.
+ *
+ * 03 26 2019 jeffery.chen
+ * [MOLY00393456] [Gen97][VMOLY] 45G InterRAT & interSystem feature
+ *
+ * [TFTLIB] interface part.
+ *
+ * 03 26 2019 jeffery.chen
+ * [MOLY00393456] [Gen97][VMOLY] 45G InterRAT & interSystem feature
+ *
+ * [TFTLIB] interface part.
+ *
+ * 12 14 2018 jeffery.chen
+ * [MOLY00372635] [VMOLY] L4/TCM/TFTLIB/VGSM phase2 check-in
+ *
+ * [TFTLIB] phase2 check-in.
+ *
+ * 09 14 2018 jeffery.chen
+ * [MOLY00306148] [NAS] pangu giant CR
+ *
+ * [TFTLIB] pass 1st NAS MoDIS IT.
+ *
+ * 08 17 2018 jeffery.chen
+ * [MOLY00306148] [NAS] pangu giant CR
+ * [TFTLIB] re-architecture.
+ *
+ * 08 17 2018 jeffery.chen
+ * [MOLY00306148] [NAS] pangu giant CR
+ *
+ * [TFTLIB] re-architecture.
+ *
+ * 10 17 2016 renhuang.liu
+ * [MOLY00205035] [TFTLIB] Memory management in TFT internal
+ * Resolve build error
+ * pcore/modem/interface/general/../../l4/tcm/tftlib/../common/tcm_context.h:559:29: fatal error: tcm_ugtcm_timer.h: No such file or directory
+ *
+ * 10 17 2016 renhuang.liu
+ * [MOLY00205035] [TFTLIB] Memory management in TFT internal
+ * Resolve the build error:
+ * pcore/modem/interface/general/../../l4/tcm/tftlib/../common/tcm_context.h:559:29: fatal error: tcm_ugtcm_timer.h: No such file or directory
+ *
+ * 10 16 2016 renhuang.liu
+ * [MOLY00205035] [TFTLIB] Memory management in TFT internal
+ * Resolve the error:
+ * pcore/modem/interface/general/tftlib_api.h:118:33:
+ * fatal error: tftlib_internal_api.h: No such file or directory
+ *
+ * 10 16 2016 renhuang.liu
+ * [MOLY00205035][TFTLIB] Memory management in TFT internal
+ *
+ * 09 26 2016 vera.yeh
+ * [MOLY00205116] [6293][ESM][TFTLIB] new feature/re-arch item porting to UMOLYA trunk
+ * [TFTLIB][OA] PS.DEV porting to UMOLYA.Trunk.
+ * 1. TFTLIB UT enhancement
+ * 2. UL_PF_CHECK
+ *
+ * 11 17 2014 jeffery.chen
+ * [MOLY00084634] [UMOLY][R10][R11] NAS check-in from 6291_DEV to UMOLY
+ * [R10][R11] NAS check-in from 6291_DEV to UMOLY
+ *
+ * 09 10 2014 jeffery.chen
+ * [MOLY00078264] [UMOLY][R10][R11] NAS check-in from CBr to 6291_DEV
+ * [R10][R11] NAS check-in from CBr to 6291_DEV
+ *
+ * 01 29 2014 joe.chang
+ * [MOLY00055334] [MT6290][SGLTE DSDS] New feature check-in MOLY
+ * TFTLIB check-in related interface
+ *
+ * 01 21 2014 wcpuser_integrator
+ * [MOLY00054475] SGLTE option rename
+ * .
+ *
+ * 12 25 2013 joe.chang
+ * [MOLY00051497] [MOLY][NRSPCA] NRSPCA phase 2 implementation
+ * [TFTLIB] Check-in related changes
+ *
+ * 11 18 2013 joe.chang
+ * [MOLY00045033] [MOLY][SM][ESM][TCM][TFT][Custom] NRSPCA(NISPCA) Network Requested/Initiated Secondary PDP Context Activation
+ * Check-in TFTLIB part
+ *
+ * 11 06 2013 joe.chang
+ * [MOLY00045302] [MT6290][LTE] TFTLIB API update for multi-context project
+ * Check-in TFTLIB part
+ *
+ * 10 31 2013 joe.chang
+ * [MOLY00044423] [MT6290] New TFT AT command development merge back to MOLY
+ * check in TFTLIB related change
+ *
+ * 07 19 2013 joe.chang
+ * [MOLY00030496] [MT6290][LTE MM][TFTLIB] ASSERT review trace & work around
+ * add trace error/warning & work around
+ *
+ * 06 10 2013 joe.chang
+ * [MOLY00025286] [MT7208][NW-UE SIM] [TC 10.8.1] AT+CGCMOD Error due to TFT compose issue
+ * TFTLIB modification for AT+CGTFT interpretation (support both difference set & full set)
+ *
+ * 11 07 2012 joe.chang
+ * [MOLY00005322] TATAKA merge to MOLY
+ * [Joe] TFTLIB part is check in done.
+ ****************************************************************************/
+
+#ifndef TFTLIB_API_H
+#define TFTLIB_API_H
+
+#include "l3_inc_enums.h"
+#include "ps_public_utility.h" //for SBP __UL_PF_CHECK__
+
+#include "tftlib_common_struct.h"
+#include "tftlib_common_enum.h"
+
+
+/* TFT Library API for VGSM */
+tft_validate_result_enum tftlib_qr_length_decode( kal_uint32 aSimIndx_r,
+ tft_pdu_struct *apTftRaw_r,
+ kal_uint32 *p_qos_rule_length,
+ kal_uint8 *p_qfi);
+
+tft_validate_result_enum tftlib_qr_decode( kal_uint32 aSimIndx_r,
+ kal_uint8 aPduSessionId_r, /* 5G=PSI */
+ kal_uint8 aQosRuleId_r, /* 5G=QRI */
+ tft_info_struct *apTft_w, /* OUT */
+ tft_fail_action_enum *apFailAction_w, /* OUT */
+ tft_pdu_struct *apTftRaw_r, /* IN */
+ bearer_type_enum aBearerType_r,
+ tft_proc_dir_enum aProcDir_r,
+ tft_bearer_act_enum aBearerAct_r,
+ etft_enum aEtft_r);
+
+kal_bool tftlib_set_applied_qr( kal_uint32 aSimIndx_r,
+ kal_uint8 aPduSessionId_r, /* 5G=PSI */
+ kal_uint8 aQosFlowId_r, /* 5G=QFI */
+ kal_uint8 aQosRuleId_r, /* 5G=QRI */
+ tft_info_struct *apQosRule_r, /* IN */
+ bearer_type_enum aBearerType_r,
+ tft_proc_dir_enum aProcDir_r,
+ tft_bearer_act_enum aBearerAct_r,
+ pkt_filter_act_list_struct *apPfActList_w, /* OUT */
+ tft_deact_qr_list_struct *apDeactQrList_rw /* INOUT */
+ );
+
+tftlib_qf_has_rule_enum tftlib_qf_has_any_rule( kal_uint32 aSimIndx_r,
+ kal_uint8 aPduSessionId_r, /* 5G=PSI */
+ kal_uint8 aQosFlowId_r /* 5G=QFI */
+ );
+
+tft_validate_result_enum tftlib_qrs_precheck( kal_uint32 aSimIndx_r,
+ tft_bearer_act_enum aBearerAct_r,
+ kal_uint16 no_auth_qos_rules,
+ kal_uint8 *auth_qos_rules,
+ tft_fail_action_enum *apFailAction_w /* OUT */
+ );
+
+kal_bool tftlib_set_rq_timer( kal_uint32 aSimIndx_r,
+ kal_uint8 aPduSessionId_r, /* 5G=PSI */
+ kal_uint32 t3583);
+
+kal_bool tftlib_rqos_set_applied_qr(kal_uint32 aSimIndx_r,
+ kal_uint8 psi, /* IN */
+ kal_uint8 qfi, /* IN */
+ kal_uint8 rule_idx, /* IN */
+ pkt_filter_act_enum action, /* IN */
+ pkt_filter_struct* p_pf, /* IN */
+ pkt_filter_act_list_struct *apPfActList_w /* OUT */
+ );
+
+kal_bool tftlib_qr_get_pf_act_list( kal_uint32 aSimIndx_r,
+ kal_uint8 aPduSessionId_r, /* 5G=PSI */
+ pkt_filter_act_list_struct *apPfActList_w, /* OUT */
+ kal_uint8 *pNextQri /* INOUT */
+ );
+
+kal_bool tftlib_tft_get_pf_act_list(kal_uint32 aSimIndx_r,
+ kal_uint8 aBearerId_r, /* OUT */
+ pkt_filter_act_list_struct *apPfActList_w /* OUT */
+ );
+
+kal_bool tftlib_set_applied_tft_by_ebi( kal_uint32 aSimIndx_r,
+ kal_uint8 aBearerId_r,
+ tft_info_struct *apTft_r,
+ bearer_type_enum aBearerType_r,
+ tft_proc_dir_enum aProcDir_r,
+ tft_bearer_act_enum aBearerAct_r,
+ pkt_filter_act_list_struct *apPfActList_w,
+ tft_deact_bearer_list_struct *apDeactBearerList_w,
+ rat_ind_enum aRat_r);
+
+kal_bool tftlib_update_deact_qr_list_to_del_qf( kal_uint32 aSimIndx_r,
+ kal_uint8 aPduSessionId_r, /* 5G=PSI */
+ kal_uint8 aQosFlowId_r, /* 5G=QFI */
+ tft_deact_qr_list_struct *apDeactQrList_rw /* INOUT */
+ );
+
+/* TFT Library API for SM/ESM */
+tft_validate_result_enum tftlib_tft_decode( kal_uint32 aSimIndx_r,
+ kal_uint8 aBearerId_r,
+ tft_info_struct *apTft_w, /*dst*/
+ tft_pdu_struct *apTftRaw_r, /*src*/
+ bearer_type_enum aBearerType_r,
+ tft_proc_dir_enum aProcDir_r,
+ tft_bearer_act_enum aBearerAct_r,
+ bcm_enum aBcm_r,
+ etft_enum aEtft_r,
+ rat_ind_enum aRat_r);
+
+kal_bool tftlib_tft_encode( kal_uint32 aSimIndx_r,
+ tft_pdu_struct *apTftRaw_w, /*dst*/
+ tft_info_struct *apTft_r, /*src*/
+ etft_enum aEtft_r);
+
+kal_bool tftlib_tft_validate(kal_uint32 aSimIndx_r,
+ kal_uint8 aBearerId_r,
+ bearer_type_enum aBearerType_r,
+ bcm_enum aBcm_r, // 20131106_Joe: Added to support 2/3G 'MS/NW'
+ rat_ind_enum aRat_r);
+
+kal_bool tftlib_tft_dir_extract( kal_uint32 aSimIndx_r,
+ tft_info_struct *apSrcTft_r,
+ tft_info_struct *apDstTft_w,
+ pf_direction_enum aPfDir_r);
+
+kal_bool tftlib_tft_own_enty_exst_chk( kal_uint32 aSimIndx_r,
+ kal_uint8 aBearerId_r,
+ pf_own_entity_enum aPfOwnEntity_r);
+
+
+kal_bool tftlib_del_applied_qr_by_psi( kal_uint32 aSimIndx_r,
+ kal_uint8 aPduSessionId_r /* IN */
+ );
+
+/**
+ * OUTPUT: *qfi = QFI which QRI belong to.
+ * = QFI_NOT_FOUND when QRI is already deleted.
+ */
+kal_bool tftlib_del_applied_qr_by_psi_qri( kal_uint32 aSimIndx_r,
+ kal_uint8 aPduSessionId_r, /* IN */
+ kal_uint8 qri, /* IN */
+ kal_uint8 *qfi /* OUT */
+ );
+
+/**
+ * pNextQri: as INPUT, SM set NULL_QRI when start to get_pf_act_list
+ * as OUTPUT, TFTLIB set NULL_QRI when finish get_pf_act_list.
+ */
+kal_bool tftlib_del_applied_qr_by_psi_qfi( kal_uint32 aSimIndx_r,
+ kal_uint8 aPduSessionId_r, /* IN */
+ kal_uint8 qfi, /* IN */
+ pkt_filter_act_list_struct *apPfActList_w, /* OUT */
+ kal_uint8 *pNextQri /* INOUT */
+ );
+
+kal_bool tftlib_del_applied_tft_by_ebi( kal_uint32 aSimIndx_r,
+ kal_uint8 aBearerId_r /* IN */
+ );
+
+void tftlib_backup_applied_qr(kal_uint32 aSimIndx_r);
+
+void tftlib_restore_applied_qr(kal_uint32 aSimIndx_r);
+
+
+/* TFT Library API for TCM */
+kal_bool tftlib_compose_and_encode_qrs_to_nw( kal_uint32 aSimIndx_r,
+ kal_uint8 aPduSessionId_r,
+ kal_uint8 aQosFlowId_r,
+ kal_uint8 aCid_r,
+ qrs_raw_struct *apQrsRaw_w, /* OUT */
+ tft_compose_type_enum aTftComposeType_r,
+ bearer_type_enum aBearerType_r,
+ vg_act_enum vgAction);
+
+kal_bool tftlib_set_applied_tft( kal_uint32 aSimIndx_r,
+ kal_uint8 aCid_r,
+ tft_info_struct *apTft_r,
+ tft_proc_dir_enum aProcDir_r,
+ tft_bearer_act_enum aBearerAct_r,
+ pkt_filter_act_list_struct *apPfActList_w,
+ tft_deact_bearer_list_struct *apDeactBearerList_w,
+ rat_ind_enum aRat_r);
+
+kal_bool tftlib_compose_tft_to_nw( kal_uint32 aSimIndx_r,
+ kal_uint8 aCid_r,
+ tft_info_struct *apTft_w,
+ tft_compose_type_enum aTftComposeType_r,
+ bearer_type_enum aBearerType_r,
+ tft_bearer_act_enum aBearerAct_r,
+ bcm_enum aBcm_r,
+ rat_ind_enum aRat_r);
+
+void tftlib_del_tft( kal_uint32 aSimIndx_r,
+ kal_uint8 aCid_r,
+ tft_ctxt_type_enum aTftCtxtType_r);
+
+kal_bool tftlib_chk_bearer_reusability(kal_uint32 aSimIndx_r,
+ kal_uint8 cid,
+ bearer_type_enum bearer_type,
+ rat_ind_enum rat);
+
+kal_bool tftlib_compose_and_encode_deact_qr_list_to_nw( kal_uint32 aSimIndx_r,
+ kal_uint8 aPduSessionId_r,
+ tft_deact_qr_list_struct *deact_qr_list, /* IN */
+ qrs_raw_struct *apQrsRaw_w /* OUT */
+ );
+kal_bool tftlib_set_cid_for_applied_qr( kal_uint32 aSimIndx_r,
+ kal_uint8 aPduSessionId_r,
+ kal_uint8 aQosFlowId_r,
+ kal_uint8 aCid_r);
+
+kal_bool tftlib_set_cid_for_applied_tft( kal_uint32 sim_idx, kal_uint8 ebi, kal_uint8 cid);
+
+kal_bool tftlib_construct_context_for_default_bearer_wo_tft(kal_uint32 sim_idx, kal_uint8 ebi);
+
+/* TFT Library API for L4C */
+
+kal_bool tftlib_set_user_defined_tft(kal_uint32 aSimIndx_r,
+ kal_uint8 aCid_r,
+ tft_info_struct *apTft_r,
+ rat_ind_enum aRat_r,
+ etft_enum aEtft_r); // +CGTFT (set-mode)
+
+kal_bool tftlib_get_user_defined_tft(kal_uint32 aSimIndx_r,
+ kal_uint8 aCid_r,
+ tft_info_list_struct *p_tft_list); // +CGTFT (read-mode)
+
+kal_bool tftlib_get_applied_tft(kal_uint32 aSimIndx_r,
+ kal_uint8 aCid_r,
+ tft_info_list_struct *p_tft_list); // +CGTFTRDP
+
+kal_bool tftlib_get_applied_qr (kal_uint32 aSimIndx_r,
+ kal_uint8 aCid_r,
+ tft_info_list_struct *p_tft_list); // +CGTFTRDP
+// TODO: OPTIMIZE stack size
+
+kal_bool tftlib_set_usr_delpf(kal_uint32 aSimIndx_r,
+ kal_uint8 aCid_r,
+ kal_bool qri_present,
+ kal_uint8 qri,
+ kal_uint8 aPfId_r,
+ rat_ind_enum aRat_r); // +EGDELPF (set-mode)
+
+kal_int32 tftlib_get_usr_delpf(kal_uint32 aSimIndx_r,
+ kal_uint8 aCid_r,
+ kal_bool qri_present,
+ kal_uint8 qri,
+ kal_uint8 *apPfLst_w); // +EGDELPF (read-mode)
+
+void tftlib_clear_usr_delpf(kal_uint32 aSimIndx_r,
+ kal_uint8 aCid_r); // +EGDELPF (undefine-mode)
+
+kal_bool tftlib_set_usr_lnkpf(kal_uint32 aSimIndx_r,
+ kal_uint8 aCid_r,
+ kal_uint8 aLnkPfId_r,
+ rat_ind_enum aRat_r); // +EGLNKPF (set-mode)
+
+kal_int32 tftlib_get_usr_lnkpf(kal_uint32 aSimIndx_r,
+ kal_uint8 aCid_r,
+ kal_uint8 *apLnkPfLst_w); // +EGLNKPF (read-mode)
+
+void tftlib_clear_usr_lnkpf(kal_uint32 aSimIndx_r,
+ kal_uint8 aCid_r); // +EGLNKPF (undefine-mode)
+
+void tftlib_free_pf_act_list_ctrl_buff(pkt_filter_act_list_struct *apPfActList_w);
+
+kal_bool tftlib_tft_context_init(void);
+kal_bool tftlib_tft_context_reset(void);
+#endif /* TFTLIB_API_H */
diff --git a/mcu/protocol/interface/general/tftlib_common_enum.h b/mcu/protocol/interface/general/tftlib_common_enum.h
new file mode 100644
index 0000000..509a3cd
--- /dev/null
+++ b/mcu/protocol/interface/general/tftlib_common_enum.h
@@ -0,0 +1,601 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2012
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * tftlib_common_enum.h
+ *
+ * Project:
+ * --------
+ * MOLY
+ *
+ * Description:
+ * ------------
+ * TFT library common enum & define constants
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 08 12 2020 terence.kuo
+ * [MOLY00557318] [MT6875][Margaux][Q0][R3][MP6][SQC][Internal][WW FT][China][Quzhou][5GMM][MDST][SWIFT][S][CMCC+Invalid][Error times:1]System API Dump,1165,29,99,/data/vendor/core/,1,,mtkrild:AT command pending too long. assert!!! AT cmd: EAPNACT.timer: 900000ms
+ * . Provide a new API which constructs context for default bearer without tft to TCM.
+ *
+ * 04 15 2020 terence.kuo
+ * [MOLY00508241] Memory reduction - l4 ps cid reduction and reduce maximum number of support flow
+ * 1. Support setting null for pf_act_list parameter.
+ * 2. Support qos flow deactivation.
+ * 3. Record qr's precedence into context in tftlib_set_user_defined_tft() if rate is 5g.
+ * 4. Add primitive traces to record current applied qr/ tft status for analysis.
+ * 5. trace enhancement
+ *
+ * 04 11 2020 terence.kuo
+ * [MOLY00508241] Memory reduction - l4 ps cid reduction and reduce maximum number of support flow
+ *
+ * . trace enhancement
+ *
+ * 04 06 2020 terence.kuo
+ * [MOLY00508241] Memory reduction - l4 ps cid reduction and reduce maximum number of support flow
+ * . Add primitive traces to record current applied qr/ tft status for analysis.
+ *
+ * 09 23 2019 terence.kuo
+ * [MOLY00442505] Update for March CR and trace enhancements.
+ *
+ * . Update for March CR and trace enhancements.
+ *
+ * 09 04 2019 terence.kuo
+ * [MOLY00434754] Upgrade CGTFT to support 5GC
+ *
+ * . Update CGTFT behaviors in tftlib.
+ *
+ * 06 26 2019 terence.kuo
+ * [MOLY00416314] Fix UTMD trace API setting error
+ *
+ * . Fix UTMD API setting error.
+ *
+ * 04 19 2019 jeffery.chen
+ * [MOLY00399993] [Gen97][VMOLY] interworking withN26 features
+ *
+ * [TFTLIB] two params development.
+ *
+ * 03 26 2019 jeffery.chen
+ * [MOLY00393456] [Gen97][VMOLY] 45G InterRAT & interSystem feature
+ *
+ * [TFTLIB] interface part.
+ *
+ * 03 26 2019 jeffery.chen
+ * [MOLY00393456] [Gen97][VMOLY] 45G InterRAT & interSystem feature
+ *
+ * [TFTLIB] interface part.
+ *
+ * 12 14 2018 jeffery.chen
+ * [MOLY00372635] [VMOLY] L4/TCM/TFTLIB/VGSM phase2 check-in
+ *
+ * [TFTLIB] phase2 check-in.
+ *
+ * 09 14 2018 jeffery.chen
+ * [MOLY00306148] [NAS] pangu giant CR
+ *
+ * [TFTLIB] pass 1st NAS MoDIS IT.
+ *
+ * 08 28 2018 jeffery.chen
+ * [MOLY00306148] [NAS] pangu giant CR
+ * [TFTLIB] fix non-gemini build error.
+ *
+ * 08 17 2018 jeffery.chen
+ * [MOLY00306148] [NAS] pangu giant CR
+ * [TFTLIB] re-architecture.
+ *
+ * 08 17 2018 jeffery.chen
+ * [MOLY00306148] [NAS] pangu giant CR
+ *
+ * [TFTLIB] re-architecture.
+ *
+ * 06 27 2018 willy-wj.chen
+ * [MOLY00330676][SE8 Internal Test][MT3967][UMOLYE][Pre-MTBF][2018/06/01-06/04][ASSERT] file:mcu/protocol/nas_multimode/tft_pf/tft_pf.c line:2078.
+ *
+ * 10 16 2016 renhuang.liu
+ * [MOLY00205035][TFTLIB] Memory management in TFT internal
+ *
+ * 11 17 2014 jeffery.chen
+ * [MOLY00084634] [UMOLY][R10][R11] NAS check-in from 6291_DEV to UMOLY
+ * [R10][R11] NAS check-in from 6291_DEV to UMOLY
+ *
+ * 03 06 2014 joe.chang
+ * [MOLY00058412] [MOLY] TFT validate revision
+ * [ESM/TFTLIB] Modification fot "TFT validate" and "PS init deactivation"
+ *
+ * 01 29 2014 joe.chang
+ * [MOLY00055334] [MT6290][SGLTE DSDS] New feature check-in MOLY
+ * [TFTLIB] Modify compile options for GEMINI (tweak)
+ *
+ * 01 29 2014 joe.chang
+ * [MOLY00055334] [MT6290][SGLTE DSDS] New feature check-in MOLY
+ * [TFTLIB] Modify compile options for GEMINI
+ *
+ * 01 29 2014 joe.chang
+ * [MOLY00055334] [MT6290][SGLTE DSDS] New feature check-in MOLY
+ * TFTLIB check-in related interface
+ *
+ * 01 21 2014 wcpuser_integrator
+ * [MOLY00054475] SGLTE option rename
+ * .
+ *
+ * 12 31 2013 joe.chang
+ * [MOLY00052135] [MT6290] TFT packet filter number handling improvement
+ * [TFTLIB] Check-in related changes
+ *
+ * 12 25 2013 joe.chang
+ * [MOLY00051497] [MOLY][NRSPCA] NRSPCA phase 2 implementation
+ * [TFTLIB] Check-in related changes
+ *
+ * 11 18 2013 joe.chang
+ * [MOLY00045033] [MOLY][SM][ESM][TCM][TFT][Custom] NRSPCA(NISPCA) Network Requested/Initiated Secondary PDP Context Activation
+ * Check-in TFTLIB part
+ *
+ * 11 06 2013 joe.chang
+ * [MOLY00045302] [MT6290][LTE] TFTLIB API update for multi-context project
+ * Check-in TFTLIB part
+ *
+ * 10 31 2013 joe.chang
+ * [MOLY00044423] [MT6290] New TFT AT command development merge back to MOLY
+ * check in TFTLIB related change
+ *
+ * 10 23 2013 joe.chang
+ * [MOLY00042307] [klocwork_95][LTE] in tftlib_internal_api.c, line 413
+ * [TFTLIB] checkin missing header file
+ *
+ * 10 01 2013 moja.hsu
+ * [MOLY00039686] [MT6290E1][Ericsson][Pre-IOT][MM] TC 7.2.3.4.30 Assert at tft_pf#719
+ * drop corrupted fragment v6 packet.
+ *
+ * 07 19 2013 joe.chang
+ * [MOLY00030496] [MT6290][LTE MM][TFTLIB] ASSERT review trace & work around
+ * add trace error/warning & work around
+ *
+ * 06 10 2013 joe.chang
+ * [MOLY00025286] [MT7208][NW-UE SIM] [TC 10.8.1] AT+CGCMOD Error due to TFT compose issue
+ * TFTLIB modification for AT+CGTFT interpretation (support both difference set & full set)
+ *
+ * 05 27 2013 joe.chang
+ * [MOLY00023789] [MT6290][TFTLIB] New architecture & EM support
+ * TFTLIB part check-in
+ *
+ * 05 06 2013 joe.chang
+ * [MOLY00021542] Trace revision merge back to MOLY
+ * [TFTLIB] revise trace
+ *
+ * 04 12 2013 joe.chang
+ * [MOLY00014197] TFTLIB new feature
+ * [MT6290][TFTLIB] update TFT parameter list with new structure
+ *
+ * 02 05 2013 benjamin.kuo
+ * [MOLY00009163] LTE Multimode merge back to MOLY
+ * Rename MT7208 to MT6290 in CR title.
+ *
+ * 01 24 2013 joe.chang
+ * [MOLY00009163] LTE Multimode merge back to MOLY
+ * TFTLIB merge from PreIT to MOLY trunk
+ *
+ * 12 04 2012 joe.chang
+ * [MOLY00007051] [MT6290][LTE Single Mode] enum rename & memory allocation mechansim change
+ *
+ * 11 07 2012 joe.chang
+ * [MOLY00005322] TATAKA merge to MOLY
+ * [Joe] TFTLIB part is check in done.
+ ****************************************************************************/
+
+#ifndef TFTLIB_COMMON_ENUM_H_
+#define TFTLIB_COMMON_ENUM_H_
+
+#include "ps_public_enum_public.h"
+
+#define TFTLIB_MAX(x, y) ((x) > (y) ? (x) : (y))
+
+/* TFT global setting */
+#define TFTLIB_MAX_FIC_NUM MAX_NUM_OF_SUPPORTED_QOS_FLOW
+#define TFTLIB_MAX_QR_NUM_PER_PDUS MAX_NUM_OF_SUPPORTED_QOS_RULE_PER_PDUS
+#define TFTLIB_MAX_QR_NUM MAX_NUM_OF_SUPPORTED_QOS_RULE
+#define TFTLIB_MAX_RQOS_NUM MAX_NUM_OF_SUPPORTED_RQOS_RULE
+//#define TFTLIB_MAX_EPSB_NUM MAX_NUM_OF_SUPPORTED_EPSB
+
+/* Common define constant */
+#define MAX_PACKET_FILTER_NUM 16 // This number is defined in 3GPP, TS 24.008, 10.5.6.12
+#define MAX_PACKET_FILTER_NUM_IN_TRANSACTION 15 // This number is defined in 3GPP, TS 24.008, 10.5.6.12
+#define MAX_PACKET_FILTER_NUM_SUPPORT_BY_NW 16 // TODO: Modify this to global variable, which can be run-time adjusted
+#define MIN_PACKET_FILTER_ID 0
+#define MAX_PACKET_FILTER_ID 15
+
+#define MAX_PACKET_FILTER_PRECED_NUM 256
+#define MIN_PACKET_FILTER_PRECED_IDX 0
+#define MAX_PACKET_FILTER_PRECED_IDX 255
+
+#define QFI_NOT_FOUND 0xBE
+#define NULL_EBI 0
+#define NULL_QRI 0
+
+#define TOTAL_QRI_NUM 256
+#define MIN_QRI 0
+#define MAX_QRI 255
+
+#define MAX_REMOTE_ADDR_AND_MASK_LEN 32
+#define MAX_LOCAL_ADDR_AND_MASK_LEN 32
+#define MAX_LOCAL_ADDR_AND_PREFIX_LEN 17
+#define MAX_TFT_LEN 255
+#define PACKET_FILTER_ID_LEN 1
+
+#define MAX_QOS_RULES_LEN MAX_TFT_LEN * MAX_NUM_OF_SUPPORTED_QOS_RULE_PER_PDUS // 255*8
+
+#define TFTLIB_MIN_BEARER_ID 5
+#define TFTLIB_MAX_BEARER_ID 15
+#define TFTLIB_MAX_BEARER_ID_TOTAL_NUM 16
+#define TFTLIB_MAX_BEARER_CTXT_NUM 11
+
+#define TFTLIB_MAX_DEACT_LIST_NUM TFTLIB_MAX(TFTLIB_MAX_BEARER_CTXT_NUM, TFTLIB_MAX_QR_NUM)
+#define TFTLIB_DEACT_LIST_TOTAL_NUM TFTLIB_MAX(TFTLIB_MAX_BEARER_ID_TOTAL_NUM, TOTAL_QRI_NUM)
+
+#define TFTLIB_SIM_DONT_CARE 0xFF
+
+#define TFTLIB_SIM1 0
+#if defined(__GEMINI__)
+#define TFTLIB_SIM2 1
+#if (GEMINI_PLUS >= 3)
+#define TFTLIB_SIM3 2
+#endif /* GEMINI_PLUS >= 3 */
+#if (GEMINI_PLUS >= 4)
+#define TFTLIB_SIM4 3
+#endif /* GEMINI_PLUS >= 4 */
+#endif /* __GEMINI__ */
+
+#define TFTLIB_MAX_PF_NUM_IN_POOL 64 //max 8 bearer simultaneously and assume 8 pf for each bearer.
+#define TFTLIB_MAX_PF_NUM 256 //max 8 bearer simultaneously and each bearer has 2 TFT (user defined and applied), each TFT has 16 pf; 8*2*16=256 PF
+#define TFTLIB_RESERVED_PF_NUM 16 //in tftlib_set_applied_tft(), a new tft_info_struct is duplicated, and extra pf space is required.
+#define TFTLIB_MAX_PF_IN_CTRL_BUF_NUM (TFTLIB_MAX_PF_NUM - TFTLIB_MAX_PF_NUM_IN_POOL + TFTLIB_RESERVED_PF_NUM)
+#define TFTLIB_MAX_NON_PF_IN_CTRL_BUF_NUM 16 //allocate memory from ctrl buf for other purpose (not PF)
+
+#define TFTLIB_PF_BITMAP_UNIT 32 //because type of pf_is_occupied is kal_uint32, which is 32 bit
+
+#define TFTLIB_QOS_RULE_PRECEDENCE_RESERVED 80
+
+#define TFTLIB_RQOS_TSTAMP_UINT 200 //ms (time stamp unit)
+
+/* Packet filter component length (octet) define */
+#define IPV4_REMOTE_ADDR_AND_MASK_LEN 8
+#define IPV4_LOCAL_ADDR_AND_MASK_LEN 8
+#define IPV6_REMOTE_ADDR_AND_MASK_LEN 32
+#define IPV6_REMOTE_ADDR_AND_PREFIX_LEN 17
+#define IPV6_LOCAL_ADDR_AND_MASK_LEN 32
+#define IPV6_LOCAL_ADDR_AND_PREFIX_LEN 17
+#define IPV6_LOCAL_ADDR_LEN 16
+#define IPV6_LOCAL_MASK_LEN 16
+#define IPV6_LOCAL_PREFIX_LEN 1
+#define PROTOCOL_ID_NEXT_HEADER_LEN 1
+#define SINGLE_LOCAL_PORT_LEN 2
+#define LOCAL_PORT_RANGE_LEN 4
+#define SINGLE_REMOTE_PORT_LEN 2
+#define REMOTE_PORT_RANGE_LEN 4
+#define SECURITY_PARAMETER_ID_LEN 4
+#define TYPE_OF_SERVICE_TRAFFIC_CLASS_AND_MASK_LEN 2
+#define FLOW_LABEL_LEN 3
+#define MATCH_ALL_LEN 0
+
+/* Parameter list define */
+#define MAX_AUTHTOKEN_FLOWID_NUM 4 // temp max num (TS 24.008 10.5.162 does not restrict its max number...)
+#define MAX_PARAMETER_LIST_NUM 16
+#define MAX_PARAMETER_LIST_SIZE 255
+#define MAX_AUTHORIZATION_TOKEN_LEN 16 // temp max length (it could be very long...)
+#define MAX_FLOW_IDENTIFIER_NUM 4 // temp max num (TS 24.008 10.5.162 does not restrict its max number...)
+#define FLOW_IDENTIFIER_LEN 4
+
+/* Temp define constant */
+#define MAX_PF_COMP_TYPE_NUM 15
+#define MAX_PACKET_FILTER_CONTENT_LEN 47
+#define MAX_TFT_PDU_ENCODE_LEN 1500
+
+/* define constants for BITMAP */
+#define BMP_NONE 0x00000000
+#define BMP_V4_ADDR 0x00000001
+#define BMP_V6_ADDR 0x00000002
+#define BMP_PROTOCOL 0x00000004
+#define BMP_LOCAL_PORT_SINGLE 0x00000008
+#define BMP_LOCAL_PORT_RANGE 0x00000010
+#define BMP_REMOTE_PORT_SINGLE 0x00000020
+#define BMP_REMOTE_PORT_RANGE 0x00000040
+#define BMP_SPI 0x00000080
+#define BMP_TOS 0x00000100
+#define BMP_FLOW_LABEL 0x00000200
+#define BMP_V4_LOCAL_ADDR 0x00000400
+#define BMP_V6_LOCAL_ADDR 0x00000800
+#define BMP_MATCH_ALL 0x00001000
+#define BMP_EMPTY_TCP_ACK 0x80000000
+#define BMP_IP_FRAGMENT 0x40000000
+#define BMP_IP_FRAGMENT_FIRST 0x01000000
+#define BMP_IP_FRAGMENT_MID 0x02000000
+#define BMP_IP_FRAGMENT_LAST 0x04000000
+#define BMP_IP_FRAGMENT_NOT 0x08000000
+#define BMP_CORRUPTED 0x20000000
+
+/* enum declaration */
+typedef enum {
+ TFT_CTXT_TYPE_DEFINED_TFT = 0,
+ TFT_CTXT_TYPE_APPLIED_TFT,
+ TFT_CTXT_TYPE_APPLIED_QR,
+ TFT_CTXT_TYPE_APPLIED_RQOS,
+ TFT_CTXT_TYPE_DEFINED_QR,
+ TFT_CTXT_TYPE_ALL
+} tft_ctxt_type_enum;
+
+typedef enum {
+ TFT_PROC_DIR_NONE = 0, // 0x00
+ TFT_PROC_DIR_MO, // 0x01
+ TFT_PROC_DIR_MT, // 0x02
+} tft_proc_dir_enum;
+
+typedef enum {
+ TFT_BEARER_NO_ACTION = 0, // 0x00
+ TFT_BEARER_ACTIVATION, // 0x01
+ TFT_BEARER_MODIFICATION, // 0x02
+ TFT_BEARER_DEACTIVATION // 0x03
+} tft_bearer_act_enum;
+
+// pdus mod
+// flow act/ deact
+typedef enum {
+ VG_ACT_NO_ACTION = 0,
+ VG_ACT_PDUS_MOD,
+ VG_ACT_QOS_FLOW_ACTIVATION,
+ VG_ACT_QOS_FLOW_DEACTIVATION
+} vg_act_enum;
+
+typedef enum {
+ TFT_CHECK_PASS = 1, // (0x01) Validate pass
+ TFT_CHECK_FAILED_SEMANTIC_ERROR_IN_TFT, // (0x02) Validate error, SM/ESM should reject the procedure with cause "Semantic errors in TFT operations (#41)"
+ TFT_CHECK_FAILED_SYNTACTICAL_ERROR_IN_TFT, // (0x03) Validate error, SM/ESM should reject the procedure with cause "Syntactical errors in TFT operations (#42)"
+ TFT_CHECK_FAILED_SEMANTIC_ERROR_IN_PF, // (0x04) Validate error, SM/ESM should reject the procedure with cause "Semantic errors in packet filters (#44)"
+ TFT_CHECK_FAILED_SYNTACTICAL_ERROR_IN_PF, // (0x05) Validate error, SM/ESM should reject the procedure with cause "Syntactical errors in packet filters (#45)"
+ TFT_CHECK_FAILED_BCM_VIOLATION, // (0x06) Validate error, SM should reject the procedure with cause "Bearer Control Mode violation (#48)"
+
+ TFT_CHECK_FAILED_SEMANTIC_ERROR_IN_QOS_OPERATION, //#83
+ TFT_CHECK_FAILED_SYNTACTICAL_ERROR_IN_QOS_OPERATION, //#84
+
+ TFT_CHECK_FAILED_INSUFFICIENT_RESOURCES,
+ TFT_CHECK_FAILED_SERIOUS_ERROR,
+
+} tft_validate_result_enum;
+
+typedef enum {
+ TFT_FAIL_ACTION_NONE = 0,
+ TFT_FAIL_ACTION_RELEASE_PDUS,
+ TFT_FAIL_ACTION_MODIFICATION_REJECT,
+ TFT_FAIL_ACTION_DELETE_QR,
+
+} tft_fail_action_enum;
+
+typedef enum
+{
+ PF_ACT_NONE = 0,
+ PF_ACT_ADD = 1,
+ PF_ACT_MOD = 2,
+ PF_ACT_DEL = 3,
+ PF_ACT_DEL_ALL = 4,
+ PF_ACT_DEL_BEARER = 5,
+ PF_ACT_REPLACE_QFI = 6
+}pkt_filter_act_enum;
+
+typedef enum
+{
+ PF_DIRECTION_PRE_REL7_TFT = 0x00,
+ PF_DIRECTION_DL_ONLY = 0x01,
+ PF_DIRECTION_UL_ONLY = 0x02,
+ PF_DIRECTION_BIDIRECTION = 0x03,
+}pf_direction_enum;
+
+typedef enum
+{
+ PF_OWN_ENTITY_NONE = 0,
+ PF_OWN_ENTITY_UE,
+ PF_OWN_ENTITY_NW
+}pf_own_entity_enum;
+
+typedef enum {
+ TFT_OPCODE_SPARE = 0, // (0x00) Spare = (5G) Reserved
+ TFT_OPCODE_CREATE_NEW_TFT, // (0x01) Create new TFT = (5G) Create new QoS rule
+ TFT_OPCODE_DELETE_TFT, // (0x02) Delete existing TFT = (5G) Delete existing QoS rule
+ TFT_OPCODE_ADD_PF, // (0x03) Add packet filters to existing TFT = (5G) Modify existing QoS rule and add packet filters
+ TFT_OPCODE_REPLACE_PF, // (0x04) Replace packet filters in existing TFT = (5G) Modify existing QoS rule and replace all packet filters
+ TFT_OPCODE_DELETE_PF, // (0x05) Delete packet filters from existing TFT = (5G) Modify existing QoS rule and delete packet filters
+ TFT_OPCODE_NOTFT_OP, // (0x06) No TFT operation = (5G) Modify existing QoS rule without modifying packtet filters
+ TFT_OPCODE_RESERVED // (0x07) Reserved
+} tft_operation_enum;
+
+typedef enum {
+ PF_COMP_ID_MATCH_ALL = 0x01, // new for 5G
+ PF_COMP_ID_IPV4_REMOTE_ADDR = 0x10,
+ PF_COMP_ID_IPV4_LOCAL_ADDR = 0x11,
+ PF_COMP_ID_IPV6_REMOTE_ADDR = 0x20,
+ PF_COMP_ID_IPV6_REMOTE_ADDR_PREFIX_LENGTH = 0x21,
+ PF_COMP_ID_IPV6_LOCAL_ADDR_PREFIX_LENGTH = 0x23,
+ PF_COMP_ID_PROTOCOL_ID_NEXT_HEADER = 0x30,
+ PF_COMP_ID_SINGLE_LOCAL_PORT = 0x40,
+ PF_COMP_ID_LOCAL_PORT_RANGE = 0x41,
+ PF_COMP_ID_SINGLE_REMOTE_PORT = 0x50,
+ PF_COMP_ID_REMOTE_PORT_RANGE = 0x51,
+ PF_COMP_ID_SECURITY_PARAMETER_ID = 0x60,
+ PF_COMP_ID_TYPE_OF_SERVICE_TRAFFIC_CLASS = 0x70,
+ PF_COMP_ID_FLOW_LABEL = 0x80,
+ PF_COMP_ID_DESTINATION_MAC_ADDR = 0x81, // new for 5G, however, Not supported now
+ PF_COMP_ID_SOURCE_MAC_ADDR = 0x82, // new for 5G, however, Not supported now
+ PF_COMP_ID_802_1Q_C_TAG_VID = 0x83, // new for 5G, however, Not supported now
+ PF_COMP_ID_802_1Q_S_TAG_VID = 0x84, // new for 5G, however, Not supported now
+ PF_COMP_ID_802_1Q_C_TAG_PCP_DEI = 0x85, // new for 5G, however, Not supported now
+ PF_COMP_ID_802_1Q_S_TAG_PCP_DEI = 0x86, // new for 5G, however, Not supported now
+ PF_COMP_ID_ETHERTYPE = 0x87, // new for 5G, however, Not supported now
+} pf_comp_id_enum;
+
+typedef enum {
+ TFT_PARA_LIST_ID_UNDEFINED = 0x00, // (0x00) Undefined (not defined in spec 24.008)
+ TFT_PARA_LIST_ID_AUTH_TOKEN = 0x01, // (0x01) Authorization token
+ TFT_PARA_LIST_ID_FLOW_ID = 0x02, // (0x02) Flow identifier
+ TFT_PARA_LIST_ID_PF_ID = 0x03 // (0x03) Packet filter identifier
+} tft_para_list_id_enum;
+
+typedef enum {
+ BEARER_TYPE_UNKNOWN = 0,
+ BEARER_TYPE_PRIMARY_PDP, // (2G/3G) PRIMARY PDP CONTEXT
+ BEARER_TYPE_SECONDARY_PDP, // (2G/3G) SECONDARY PDP CONTEXT
+ BEARER_TYPE_DEFAULT_BEARER, // (LTE) DEFAULT EPS BEARER
+ BEARER_TYPE_DEDICATED_BEARER, // (LTE) DEDICATED EPS BEARER
+ BEARER_TYPE_QOS_FLOW // (5G) QoS Flow
+} bearer_type_enum;
+
+typedef enum {
+ RAT_IND_2G3G = 1, // 0x01
+ RAT_IND_LTE, // 0x02
+ RAT_IND_234G, // 0x03
+ RAT_IND_5G // 0x04
+} rat_ind_enum;
+
+typedef enum {
+ TFT_COMPOSE_TYPE_NONE = 0, // Reserved value
+ TFT_COMPOSE_TYPE_MOD_TFT, // Only TFT is requested to be modified
+ TFT_COMPOSE_TYPE_MOD_QOS, // Only QoS is requested to be modified
+ TFT_COMPOSE_TYPE_MOD_TFT_QOS, // Both TFT and QoS are requested to be modified
+ TFT_COMPOSE_TYPE_UNDEFINE_TFT, // TFT is requested to be undefined (deleted)
+ TFT_COMPOSE_TYPE_DEL_EPSB // [LTE only] Dedicated EPS bearer is requested to be deactivated
+} tft_compose_type_enum;
+
+/* DHL trace use */
+typedef enum {
+ TFTLIB_TFT_DECODE = 0,
+ TFTLIB_TFT_ENCODE,
+ TFTLIB_TFT_DIR_EXTRACT,
+ TFTLIB_SET_APPLIED_TFT,
+ TFTLIB_SET_APPLIED_QR,
+ TFTLIB_COMPOSE_TFT_TO_NW,
+ TFTLIB_DEL_TFT,
+ TFTLIB_DEL_QR,
+ TFTLIB_GET_USER_DEFINED_TFT,
+ TFTLIB_GET_APPLIED_TFT,
+ TFTLIB_SET_USER_DEFINED_TFT,
+ TFTLIB_SET_USR_DELPF,
+ TFTLIB_GET_USR_DELPF,
+ TFTLIB_CLEAR_USR_DELPF,
+ TFTLIB_SET_USR_LNKPF,
+ TFTLIB_GET_USR_LNKPF,
+ TFTLIB_CLEAR_USR_LNKPF,
+ TFTLIB_REL_PF,
+ UPDATE_TFT,
+ TFT_DECODE,
+ TFT_ENCODE,
+ PF_CONTENT_DECODE,
+ TFT_COMPOSE,
+ PF_FIELD_CHECK,
+ PF_COMP_CHECK,
+ TFT_EMPTY_COLLISION_CHECK,
+ PF_PRECEDENCE_COLLISION_CHECK,
+ COMPOSE_PF_ACT_LIST,
+ COMPOSE_BEARER_DEACT_LIST,
+ BCM_RESTRICT_CHK,
+ TFTLIB_TFT_GET_PC_ACT_LIST,
+ TFTLIB_GET_APPLIED_QR,
+
+ TFTLIB_QRS_PRECHECK,
+ TFTLIB_QR_LENGTH_DECODE,
+ TFTLIB_BACKUP_APPLIED_QR,
+ TFTLIB_RESOTRE_APPLIED_QR,
+ TFTLIB_DEL_APPLIED_QR_BY_PSI,
+ TFTLIB_DEL_APPLIED_QR_BY_PSI_QRI,
+ TFTLIB_DEL_APPLIED_QR_BY_PSI_QFI,
+ TFTLIB_DEL_APPLIED_TFT_BY_EBI,
+ TFTLIB_SET_CID_FOR_APPLIED_QR,
+
+ TFTLIB_SET_APPLIED_TFT_BY_EBI,
+ TFTLIB_SET_CID_FOR_APPLIED_TFT,
+ TFTLIB_UPDATE_DEACT_QR_LIST_TO_DEL_QF,
+ TFTLIB_CONSTRUCT_CONTEXT_FOR_DEFAULT_BEARER_WO_TFT,
+
+} tftlib_trc_func_name_enum;
+
+typedef enum {
+ TFT_PTR = 0,
+ TFT_RAW_PTR,
+ PF_ACT_LIST,
+ PF_PTR,
+ DEACT_BEARER_LIST,
+ COMPOSED_TFT_PTR
+} tftlib_trc_func_arg_name_enum;
+
+typedef enum {
+ SOURCE_TFT = 0,
+ SOURCE_TFT_RAW,
+ DECODED_TFT,
+ ENCODED_TFT_RAW,
+ ENCODED_QRS_RAW,
+ COMPOSED_TFT,
+ EXTRACTED_TFT,
+ CURRENT_USER_DEFINED_TFT,
+ UPDATED_USER_DEFINED_TFT,
+ CURRENT_APPLIED_TFT,
+ UPDATED_APPLIED_TFT,
+ USER_REQUEST_CGTFT,
+ CURRENT_APPLIED_QR,
+ CURRENT_APPLIED_RQOS
+} tftlib_trc_tft_type_enum;
+
+typedef enum {
+ TFTLIB_TRC_PARA_TYPE_NONE = 0,
+ TFTLIB_TRC_PARA_TYPE_FUNC_ARG_IN,
+ TFTLIB_TRC_PARA_TYPE_FUNC_ARG_OUT,
+ TFTLIB_TRC_PARA_TYPE_INTERNAL_FUNC_ARG_OUT,
+ TFTLIB_TRC_PARA_TYPE_TFT_CONTEXT
+} tftlib_trc_para_type_enum;
+
+typedef enum {
+ QF_HAS_NO_RULE = 0,
+ QF_HAS_DEFAULT_RULE = 1,
+ QF_HAS_ONLY_NON_DEFAULT_RULE = 2
+} tftlib_qf_has_rule_enum;
+
+typedef enum {
+ QOS_RULE_LEN_TYPE_NO_PRECEDENCE_QFI,
+ QOS_RULE_LEN_TYPE_WITH_PRECEDENCE_QFI,
+ QOS_RULE_LEN_TYPE_WITH_PRECEDENCE,
+} qos_rule_len_type;
+
+#endif /* TFTLIB_COMMON_ENUM_H_ */
diff --git a/mcu/protocol/interface/general/tftlib_common_struct.h b/mcu/protocol/interface/general/tftlib_common_struct.h
new file mode 100644
index 0000000..3e819f3
--- /dev/null
+++ b/mcu/protocol/interface/general/tftlib_common_struct.h
@@ -0,0 +1,427 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2012
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * tftlib_common_struct.h
+ *
+ * Project:
+ * --------
+ * MOLY
+ *
+ * Description:
+ * ------------
+ * TFT library common structure
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 09 18 2020 terence.kuo
+ * [MOLY00560403] [Mouton][R0][operator_IOT] Both active and hold call gets disconnected.
+ * . Further error handling for pf precedence conflict without dedicated bearer deactivation.
+ *
+ * 04 15 2020 terence.kuo
+ * [MOLY00508241] Memory reduction - l4 ps cid reduction and reduce maximum number of support flow
+ * 1. Support setting null for pf_act_list parameter.
+ * 2. Support qos flow deactivation.
+ * 3. Record qr's precedence into context in tftlib_set_user_defined_tft() if rate is 5g.
+ * 4. Add primitive traces to record current applied qr/ tft status for analysis.
+ * 5. trace enhancement
+ *
+ * 04 06 2020 terence.kuo
+ * [MOLY00508241] Memory reduction - l4 ps cid reduction and reduce maximum number of support flow
+ * . Add primitive traces to record current applied qr/ tft status for analysis.
+ *
+ * 01 02 2020 terence.kuo
+ * [MOLY00468375] [IODT][MT6885][Petrus][MP1][ZTE][Lab][5GSM][China][Xian][F60][N41][core1,vpe0,tc0(vpe3)] Fatal Error (0x823, 0x2000, 0xcccccccc) - NAS
+ *
+ * . Reduce the control buffer size when handling packet filter action list.
+ *
+ * 09 23 2019 terence.kuo
+ * [MOLY00442505] Update for March CR and trace enhancements.
+ *
+ * . Update for March CR and trace enhancements.
+ *
+ * 09 04 2019 terence.kuo
+ * [MOLY00434754] Upgrade CGTFT to support 5GC
+ *
+ * . Update CGTFT behaviors in tftlib.
+ *
+ * 03 26 2019 jeffery.chen
+ * [MOLY00393456] [Gen97][VMOLY] 45G InterRAT & interSystem feature
+ *
+ * [TFTLIB] interface part.
+ *
+ * 03 26 2019 jeffery.chen
+ * [MOLY00393456] [Gen97][VMOLY] 45G InterRAT & interSystem feature
+ *
+ * [TFTLIB] interface part.
+ *
+ * 12 14 2018 jeffery.chen
+ * [MOLY00372635] [VMOLY] L4/TCM/TFTLIB/VGSM phase2 check-in
+ *
+ * [TFTLIB] phase2 check-in.
+ *
+ * 09 14 2018 jeffery.chen
+ * [MOLY00306148] [NAS] pangu giant CR
+ *
+ * [TFTLIB] pass 1st NAS MoDIS IT.
+ *
+ * 08 17 2018 jeffery.chen
+ * [MOLY00306148] [NAS] pangu giant CR
+ * [TFTLIB] re-architecture.
+ *
+ * 08 17 2018 max.mo
+ * [MOLY00306148] [NAS] pangu giant CR
+ * .changes from Norman's CBr
+ *
+ * 07 20 2018 max.mo
+ * [MOLY00339905] [Gen97] porting of MOD_VGSM
+ * [Protocol build tag]
+ * [Is CL self testable: YES]
+ * [Group CL list: NO]
+ *
+ * 10 16 2016 renhuang.liu
+ * [MOLY00205035][TFTLIB] Memory management in TFT internal
+ *
+ * 11 17 2014 jeffery.chen
+ * [MOLY00084634] [UMOLY][R10][R11] NAS check-in from 6291_DEV to UMOLY
+ * [R10][R11] NAS check-in from 6291_DEV to UMOLY
+ *
+ * 09 10 2014 jeffery.chen
+ * [MOLY00078264] [UMOLY][R10][R11] NAS check-in from CBr to 6291_DEV
+ * [R10][R11] NAS check-in from CBr to 6291_DEV
+ *
+ * 12 25 2013 joe.chang
+ * [MOLY00051497] [MOLY][NRSPCA] NRSPCA phase 2 implementation
+ * [TFTLIB] Check-in related changes
+ *
+ * 04 12 2013 joe.chang
+ * [MOLY00014197] TFTLIB new feature
+ * [MT6290][TFTLIB] update TFT parameter list with new structure
+ *
+ * 12 04 2012 joe.chang
+ * [MOLY00007051] [MT7208][LTE Single Mode] enum rename & memory allocation mechansim change
+ *
+ * 11 07 2012 joe.chang
+ * [MOLY00005322] TATAKA merge to MOLY
+ * [Joe] TFTLIB part is check in done.
+ ****************************************************************************/
+
+
+#ifndef TFTLIB_COMMON_STRUCT_H_
+#define TFTLIB_COMMON_STRUCT_H_
+
+
+#include "kal_general_types.h"
+#include "tftlib_common_enum.h"
+
+
+/*struct declaration */
+
+
+/* IPv4 remote address and subnet mask struct (WORD(4-byte) array, used by UPCM only) */
+typedef struct
+{
+ kal_uint32 addr;
+ kal_uint32 mask;
+}remote_v4addr_struct;
+
+
+/* IPv6 remote address and subnet mask struct (WORD(4-byte) array, used by UPCM only) */
+typedef struct
+{
+ kal_uint32 addr[4];
+ kal_uint32 mask[4];
+}remote_v6addr_struct;
+
+typedef remote_v4addr_struct local_v4addr_struct;
+typedef remote_v6addr_struct local_v6addr_struct;
+
+/* Packet filter struct for SM/ESM, TCM, L4C, & UPCM */
+typedef struct
+{
+ pf_own_entity_enum pf_own_entity; // Indicate UE or NW owns this PF
+ kal_uint8 qri; // QuS Rule ID where the packet filter belongs to
+ kal_uint8 id; // Packet filter index
+ kal_uint8 precedence; // Packet filter evaluation precedence index
+ pf_direction_enum direction; // Direction of the packet filter
+
+ kal_uint32 bitmap; // Used to indicate which of the following field exist
+
+ kal_bool match_all_type;
+
+ union
+ {
+ remote_v4addr_struct v4;
+ remote_v6addr_struct v6;
+ }remote_addr; // Remote address and subnet mask (WORD(4-byte) array, used by UPCM only)
+
+ union
+ {
+ local_v4addr_struct v4;
+ local_v6addr_struct v6;
+ }local_addr; // Local address and subnet mask (WORD(4-byte) array, used by UPCM only)
+
+ kal_uint8 remote_addr_and_mask[MAX_REMOTE_ADDR_AND_MASK_LEN]; /* ----------------- Remote address and subnet mask (byte array) ----------------*
+ * *
+ * IPv4: addr = 0 ~ 3 *
+ * mask = 4 ~ 7 *
+ * <NOTE1: Length of IPv4 addr + mask = IPV4_REMOTE_ADDR_AND_MASK_LEN(8)> *
+ * *
+ * IPv6: addr = 0 ~ 15 *
+ * mask = 16 ~ 31 *
+ * <NOTE2: Length of IPv6 addr + mask = IPV6_REMOTE_ADDR_AND_MASK_LEN(32)> *
+ * *
+ * <NOTE3: MAX_REMOTE_ADDR_AND_MASK_LEN is set as IPV6_REMOTE_ADDR_AND_MASK_LEN> *
+ * *
+ * ------------------------------------------------------------------------------*
+ */
+
+ kal_uint8 local_addr_and_mask[MAX_LOCAL_ADDR_AND_MASK_LEN]; /* ----------------- Local address and subnet mask (byte array) -----------------*
+ * *
+ * IPv4: addr = 0 ~ 3 *
+ * mask = 4 ~ 7 *
+ * <NOTE1: Length of IPv4 addr + mask = IPV4_LOCAL_ADDR_AND_MASK_LEN(8)> *
+ * *
+ * IPv6: addr = 0 ~ 15 *
+ * mask = 16 ~ 31 *
+ * <NOTE2: Length of IPv6 addr + mask = IPV6_LOCAL_ADDR_AND_MASK_LEN(32)> *
+ * *
+ * <NOTE3: MAX_LOCAL_ADDR_AND_MASK_LEN is set as IPV6_LOCAL_ADDR_AND_MASK_LEN> *
+ * *
+ * ------------------------------------------------------------------------------*
+ */
+
+ kal_uint8 protocol_nxt_hdr; // Protocol number (IPv4) / Next header (IPv6)
+
+ kal_uint16 local_port_low; // Single local port / Local port range (low)
+ kal_uint16 local_port_high; // (N/A) / Local port range (high)
+
+ kal_uint16 remote_port_low; // Single remote port / Remote port range (low)
+ kal_uint16 remote_port_high; // (N/A) / Remote port range (high)
+
+ kal_uint32 spi; // IPsec security parameter index
+
+ kal_uint8 tos; // Type of service (IPv4) / Traffic class (IPv6)
+ kal_uint8 tos_msk; // Type of service mask (IPv4) / Traffic class mask (IPv6)
+
+ kal_uint32 flow_label; // Flow label (IPv6)
+}pkt_filter_struct;
+
+/* Common deact list: union of deact_bearer_list_struct and deact_qr_list_sturct */
+typedef struct {
+ kal_uint8 deact_num;
+ kal_uint8 deact_list[TFTLIB_MAX_DEACT_LIST_NUM];
+ kal_bool has_dqr;
+ tft_validate_result_enum cause;
+} tft_deact_list_struct;
+
+/* PDP/EPS bearer context deactivation list for SM/ESM */
+typedef struct {
+ kal_uint8 deact_num; // Number of deactivated bearer due to packet filter conflict
+ kal_uint8 deact_list[TFTLIB_MAX_BEARER_CTXT_NUM]; // Deactivated bearer context list
+} tft_deact_bearer_list_struct;
+
+/* QoS Rule deactivation list for VGSM */
+typedef struct {
+ kal_uint8 deact_num; // Number of deactivated QoS Rule due to packet filter conflict
+ kal_uint8 deact_list[TFTLIB_MAX_QR_NUM]; // Deactivated QoS Rule context list
+ kal_bool has_dqr; // TRUE if there is Default QR in deact list.
+ tft_validate_result_enum cause;
+} tft_deact_qr_list_struct;
+
+/* Packet filter action struct for UPCM */
+typedef struct
+{
+ kal_uint8 bearer_id; // EPS bearer ID/NSAPI where the packet filter belongs to
+ kal_uint8 qri; // QuS Rule ID where the packet filter belongs to
+ kal_uint8 old_qfi; // Old QoS Flow ID where the Qos Rule belongs to
+ kal_uint8 qfi; // New QoS Flow ID
+ pkt_filter_act_enum action; // Update action for the packet filter
+ pkt_filter_struct pkt_filter; // Content of the new packet filter
+} pkt_filter_act_struct;
+
+
+/* Packet filter action list struct for TCM, UPCM */
+typedef struct
+{
+ kal_uint8 pkt_filter_num; // Number of packet filters to be update in the following list
+ pkt_filter_act_struct *pkt_filter_list[MAX_PACKET_FILTER_NUM * 2]; // List of packet filters to be update and each with specific EPS bearer ID/NSAPI & action
+} pkt_filter_act_list_struct;
+
+/* Packet filter action list link-list node for VGSM, TCM, UPCM */
+typedef struct _pkt_filters_act_list_node_struct {
+ pkt_filter_act_list_struct pkt_filters; // Packet filters Action in a QoS Rule
+ struct _pkt_filters_act_list_node_struct *next; // Point to the next pkt_filters act list in the next QoS Rule
+} pkt_filters_act_list_node_struct;
+
+/* TFT PDU struct for SM/ESM, TCM */
+typedef struct {
+ kal_uint16 length; // length of the TFT raw data: upgrade to uint16 for 5G
+ kal_uint8 *data; // TFT raw data
+} tft_pdu_struct;
+
+
+typedef struct {
+ kal_uint8 auth_token_len; // length of authorization token
+ kal_uint8 auth_token[MAX_AUTHORIZATION_TOKEN_LEN]; // authorization token
+ kal_uint8 flow_id_num; // number of flow identifiers
+ kal_uint8 flow_id_list[MAX_FLOW_IDENTIFIER_NUM][FLOW_IDENTIFIER_LEN]; /* flow identifier list
+ * (NOTE: an authtoken can follow one or more flow identifiers,
+ * and each flow identifier is FLOW_IDENTIFIER_LEN (4 byte) long)
+ */
+} tft_authtoken_flowid_struct;
+
+
+typedef struct {
+ kal_uint8 linked_pf_id_num; // Number of linked packet filter IDs carried in linked_pf_id_list[]
+ kal_uint8 linked_pf_id_list[MAX_PACKET_FILTER_NUM]; /* Linked packet filter ID list
+ * (NOTE1: Used to indicate to NW the change for which service applies to)
+ * (NOTE2: Will appear when, 1. GBR changes, 2. TFT operation = 'Add packet filters to existing TFT')
+ */
+
+ kal_uint8 authtoken_flowid_num; // Number of authtoken_flowid group in authtoken_flowid_list[]
+ tft_authtoken_flowid_struct authtoken_flowid_list[MAX_AUTHTOKEN_FLOWID_NUM]; // Authorization and flow identifier group list
+
+} tft_parameter_list_struct;
+
+/* TFT struct for SM/ESM, TCM, L4C */
+typedef struct {
+ kal_uint8 cid; // context id
+ kal_bool est_wo_tft; // indicate whether TFT is established without TFT
+ tft_operation_enum tft_opcode; // TFT operation code
+ kal_bool ebit; // Indicate whether parameter list exists
+ kal_bool is_default_bearer; // (234G) Indicate whether it's primary pdp/ default bearer
+
+ kal_bool dqr_bit; // (5G)Indicate whether the QoS rule is the default QoS rule
+ kal_bool qri_present; // (5G)
+ kal_uint8 qri; // (5G) QoS rule id
+ kal_bool qr_precedence_present; // (5G)
+ kal_uint8 qr_precedence; // (5G) precedence value of QoS rule
+ kal_bool qfi_present; // (5G)
+ kal_uint8 qfi; // (5G) QoS Flow Id
+ kal_bool psi_present; // (5G)
+ kal_uint8 psi; // (5G) PDU session id
+
+ kal_uint8 pf_num; // Number of packet filter carried in pf_list[]
+ pkt_filter_struct pf_list[MAX_PACKET_FILTER_NUM]; // Packet filter list
+ tft_parameter_list_struct parameter_list; // (234G)Parameter list
+
+} tft_info_struct;
+
+typedef struct {
+ kal_uint16 length; // length of the QoS Rules raw data
+ kal_uint8 *data; // raw data of QoS Rules
+} qrs_raw_struct;
+
+/* A memory reduction version of tft_info_struct struct.
+ * The type of pf_list is change from pkt_filter_struct to pkt_filter_struct* (pointer) */
+typedef struct {
+ kal_uint8 cid; // context id
+ kal_bool est_wo_tft; // indicate whether TFT is established without TFT
+ tft_operation_enum tft_opcode; // TFT operation code
+ kal_bool ebit; // Indicate whether parameter list exists
+ kal_bool is_default_bearer; // (234G) Indicate whether it's primary pdp/ default bearer
+
+ kal_bool dqr_bit; // (5G)Indicate whether the QoS rule is the default QoS rule
+ kal_bool qri_present; // (5G)
+ kal_uint8 qri; // (5G) QoS rule id
+ kal_bool qr_precedence_present; // (5G)
+ kal_uint8 qr_precedence; // (5G) precedence value of QoS rule
+ kal_bool qfi_present; // (5G)
+ kal_uint8 qfi; // (5G) QoS Flow Id
+ kal_bool psi_present; // (5G)
+ kal_uint8 psi; // (5G) PDU session id
+
+ kal_uint8 pf_num; // Number of packet filter carried in pf_list[]
+ pkt_filter_struct *pf_list[MAX_PACKET_FILTER_NUM]; // Pointers to packet filter list
+ tft_parameter_list_struct parameter_list; // (234G)Parameter list
+} tft_info_w_pf_ptr_struct;
+
+/* TFT info list */
+typedef struct {
+ kal_uint8 tft_num;
+ tft_info_struct tft_info[ 1 + TFTLIB_MAX_QR_NUM_PER_PDUS]; // +1 for 234G TFT
+} tft_info_list_struct;
+
+/* rqos rule struct */
+typedef struct {
+ kal_bool rule_in_use; //
+ kal_uint8 rule_idx; // = pf idx
+ kal_uint8 qri; // (5G) QoS rule id
+ kal_uint8 qr_precedence; // (5G) precedence value of QoS rule
+ kal_uint8 psi; // (5G) PDU session id
+ kal_uint8 qfi; // (5G) QoS Flow Id
+ kal_uint32 t3583;
+ pkt_filter_struct pf; // packet filter
+
+} tftlib_rqos_rule_struct;
+
+
+// pdus info
+typedef struct {
+ kal_uint8 cid; // context id
+ kal_uint8 qos_flow_id; // (5G) QoS Flow Id
+ kal_uint8 qos_rule_id; // (5G) QoS Rule Id
+ kal_uint8 qr_precedence; // (5G) precedence value of QoS rule
+ kal_bool dqr_bit; // (5G)Indicate whether the QoS rule is the default QoS rule
+} qos_rule_info_struct;
+
+typedef struct {
+ kal_uint8 psi; // (5G) pdu session id
+ kal_uint8 qos_flow_count;
+ kal_uint8 qos_rule_list_len;
+
+ // psi's info
+ qos_rule_info_struct qos_rule_list[TFTLIB_MAX_QR_NUM_PER_PDUS]; // (5G) QoS Rule Id List
+} pdus_info_struct;
+
+
+// bearer info
+typedef struct {
+ kal_uint8 ebi; // in 23G: nsapi
+
+ // ebi's info
+ kal_uint8 cid;
+ // kal_uint8 link_ebi; // in 23G: nsapi of primary cid
+} bearer_info_struct;
+
+#endif /* TFTLIB_COMMON_STRUCT_H_ */
diff --git a/mcu/protocol/interface/general/tftlib_msg_struct.h b/mcu/protocol/interface/general/tftlib_msg_struct.h
new file mode 100644
index 0000000..d0820c7
--- /dev/null
+++ b/mcu/protocol/interface/general/tftlib_msg_struct.h
@@ -0,0 +1,1106 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2012
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * tftlib_msg_struct.h
+ *
+ * Project:
+ * --------
+ * MOLY
+ *
+ * Description:
+ * ------------
+ * message and common structure definition for TFTLIB (for UT/IT only)
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 08 12 2020 terence.kuo
+ * [MOLY00557318] [MT6875][Margaux][Q0][R3][MP6][SQC][Internal][WW FT][China][Quzhou][5GMM][MDST][SWIFT][S][CMCC+Invalid][Error times:1]System API Dump,1165,29,99,/data/vendor/core/,1,,mtkrild:AT command pending too long. assert!!! AT cmd: EAPNACT.timer: 900000ms
+ * . Provide a new API which constructs context for default bearer without tft to TCM.
+ *
+ * 04 15 2020 terence.kuo
+ * [MOLY00508241] Memory reduction - l4 ps cid reduction and reduce maximum number of support flow
+ * 1. Support setting null for pf_act_list parameter.
+ * 2. Support qos flow deactivation.
+ * 3. Record qr's precedence into context in tftlib_set_user_defined_tft() if rate is 5g.
+ * 4. Add primitive traces to record current applied qr/ tft status for analysis.
+ * 5. trace enhancement
+ *
+ * 04 06 2020 terence.kuo
+ * [MOLY00508241] Memory reduction - l4 ps cid reduction and reduce maximum number of support flow
+ * . Add primitive traces to record current applied qr/ tft status for analysis.
+ *
+ * 03 31 2020 terence.kuo
+ * [MOLY00508241] Memory reduction - l4 ps cid reduction and reduce maximum number of support flow
+ * 1. Support setting null for pf_act_list parameter.
+ * 2. Support qos flow deactivation.
+ * 3. Record qr's precedence into context in tftlib_set_user_defined_tft() if rate is 5g.
+ * 4. Add the trace to record the number of pdus/ qos flow/ qos rule/ packet filter.
+ *
+ * 11 22 2019 terence.kuo
+ * [MOLY00460830] [MT6885][Petrus][MP1][Ericsson][IODT][SA FullStack][Kista][5G] Fatal Error (0x823, 0x1000, 0xcccccccc) - (LISR)PHY LTMR Inst1
+ *
+ * . Claer the header and next of applied/ defined qrs correctly.
+ *
+ * 09 23 2019 terence.kuo
+ * [MOLY00442505] Update for March CR and trace enhancements.
+ *
+ * . Update for March CR and trace enhancements.
+ *
+ * 09 04 2019 terence.kuo
+ * [MOLY00434754] Upgrade CGTFT to support 5GC
+ *
+ * . Update CGTFT behaviors in tftlib.
+ *
+ * 03 26 2019 jeffery.chen
+ * [MOLY00393456] [Gen97][VMOLY] 45G InterRAT & interSystem feature
+ *
+ * [TFTLIB] interface part.
+ *
+ * 03 26 2019 jeffery.chen
+ * [MOLY00393456] [Gen97][VMOLY] 45G InterRAT & interSystem feature
+ *
+ * [TFTLIB] interface part.
+ *
+ * 12 14 2018 jeffery.chen
+ * [MOLY00372635] [VMOLY] L4/TCM/TFTLIB/VGSM phase2 check-in
+ *
+ * [TFTLIB] phase2 check-in.
+ *
+ * 09 14 2018 jeffery.chen
+ * [MOLY00306148] [NAS] pangu giant CR
+ *
+ * [TFTLIB] pass 1st NAS MoDIS IT.
+ *
+ * 08 17 2018 jeffery.chen
+ * [MOLY00306148] [NAS] pangu giant CR
+ * [TFTLIB] re-architecture.
+ *
+ * 08 17 2018 jeffery.chen
+ * [MOLY00306148] [NAS] pangu giant CR
+ *
+ * [TFTLIB] re-architecture.
+ *
+ * 10 19 2016 renhuang.liu
+ * [MOLY00203260] [TFTLIB] Logging mechanism refinement
+ * 93 TFTLIB re-arch 4
+ *
+ * 10 17 2016 renhuang.liu
+ * [MOLY00205035] [TFTLIB] Memory management in TFT internal
+ * Resolve build error:
+ * pcore/modem/interface/general/../../l4/tcm/tftlib/../common/tcm_context.h:559:29: fatal error: tcm_ugtcm_timer.h: No such file or directory
+ *
+ * 10 17 2016 renhuang.liu
+ * [MOLY00205035] [TFTLIB] Memory management in TFT internal
+ * Resolve the build error:
+ * pcore/modem/interface/general/../../l4/tcm/tftlib/../common/tcm_context.h:559:29: fatal error: tcm_ugtcm_timer.h: No such file or directory
+ *
+ * 10 16 2016 renhuang.liu
+ * [MOLY00205035][TFTLIB] Memory management in TFT internal
+ *
+ * 09 26 2016 vera.yeh
+ * [MOLY00205116] [6293][ESM][TFTLIB] new feature/re-arch item porting to UMOLYA trunk
+ * [TFTLIB][OA] PS.DEV porting to UMOLYA.Trunk.
+ * 1. TFTLIB UT enhancement
+ * 2. UL_PF_CHECK
+ *
+ * 11 17 2014 jeffery.chen
+ * [MOLY00084634] [UMOLY][R10][R11] NAS check-in from 6291_DEV to UMOLY
+ * [R10][R11] NAS check-in from 6291_DEV to UMOLY
+ *
+ * 09 10 2014 jeffery.chen
+ * [MOLY00078264] [UMOLY][R10][R11] NAS check-in from CBr to 6291_DEV
+ * [R10][R11] NAS check-in from CBr to 6291_DEV
+ *
+ * 01 29 2014 joe.chang
+ * [MOLY00055334] [MT6290][SGLTE DSDS] New feature check-in MOLY
+ * TFTLIB check-in related interface
+ *
+ * 01 21 2014 wcpuser_integrator
+ * [MOLY00054475] SGLTE option rename
+ * .
+ *
+ * 11 18 2013 joe.chang
+ * [MOLY00045033] [MOLY][SM][ESM][TCM][TFT][Custom] NRSPCA(NISPCA) Network Requested/Initiated Secondary PDP Context Activation
+ * Check-in TFTLIB part
+ *
+ * 11 06 2013 joe.chang
+ * [MOLY00045302] [MT6290][LTE] TFTLIB API update for multi-context project
+ * Check-in TFTLIB part
+ *
+ * 10 31 2013 joe.chang
+ * [MOLY00044423] [MT6290] New TFT AT command development merge back to MOLY
+ * check in TFTLIB related change
+ *
+ * 08 12 2013 joe.chang
+ * [MOLY00033348] [MT6290][MMDC] MMDC type 2 single load feature for TFTLIB
+ * code check in
+ *
+ * 06 10 2013 joe.chang
+ * [MOLY00025286] [MT7208][NW-UE SIM] [TC 10.8.1] AT+CGCMOD Error due to TFT compose issue
+ * TFTLIB modification for AT+CGTFT interpretation (support both difference set & full set)
+ *
+ * 05 27 2013 joe.chang
+ * [MOLY00023789] [MT6290][TFTLIB] New architecture & EM support
+ * TFTLIB part check-in
+ *
+ * 11 07 2012 joe.chang
+ * [MOLY00005322] TATAKA merge to MOLY
+ * [Joe] TFTLIB part is check in done.
+ ****************************************************************************/
+
+
+#ifndef TFTLIB_MSG_STRUCT_H_
+#define TFTLIB_MSG_STRUCT_H_
+
+#include "kal_public_defs.h"
+#include "l3_inc_enums.h"
+
+//#include "tftlib_timer.h"
+#include "tftlib_common_struct.h"
+#include "ipfc_export_plugin_rqos.h"
+
+/***** message structure definition *****/
+
+/* MSG_ID_TFTLIB_VGSM_RQOS_UPDATE_REQ */
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 psi;
+ kal_uint8 qfi;
+ kal_uint8 rule_idx;
+ pkt_filter_act_enum action;
+ pkt_filter_struct pf;
+
+} tftlib_vgsm_rqos_update_req_struct;
+
+
+//#ifdef __TFTLIB_UT__
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 sim_indx;
+ tft_bearer_act_enum bearer_act;
+ kal_uint16 no_auth_qos_rules;
+ kal_uint8 auth_qos_rules[MAX_QOS_RULES_LEN];
+
+} tftlib_qrs_precheck_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 sim_indx;
+ kal_uint8 psi;
+ kal_uint8 qfi;
+ kal_uint8 qri;
+ kal_uint16 qr_raw_len;
+ kal_uint8 qr_raw[MAX_TFT_LEN];
+ bearer_type_enum bearer_type;
+ tft_proc_dir_enum proc_dir;
+ tft_bearer_act_enum bearer_act;
+ etft_enum etft;
+ kal_uint8 precedence;
+
+} tftlib_qr_decode_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 sim_indx;
+ kal_uint8 bearer_id;
+ kal_uint16 tft_raw_len;
+ kal_uint8 tft_raw[MAX_TFT_LEN];
+ bearer_type_enum bearer_type;
+ tft_proc_dir_enum proc_dir;
+ tft_bearer_act_enum bearer_act;
+ bcm_enum bcm;
+ etft_enum etft;
+ rat_ind_enum rat;
+
+} tftlib_tft_decode_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 sim_indx;
+ tft_info_struct tft;
+ etft_enum etft;
+
+} tftlib_tft_encode_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 sim_indx;
+ kal_uint8 bearer_id;
+ bearer_type_enum bearer_type;
+ bcm_enum bcm; // 20131106_Joe: Added to support 2/3G 'MS/NW'
+ rat_ind_enum rat;
+
+} tftlib_tft_validate_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 sim_indx;
+ tft_info_struct src_tft;
+ pf_direction_enum pf_dir;
+
+} tftlib_tft_dir_extract_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 sim_indx;
+ kal_uint8 cid;
+ tft_info_struct tft;
+ tft_proc_dir_enum proc_dir;
+ tft_bearer_act_enum bearer_act;
+ rat_ind_enum rat;
+ kal_bool is_pf_act_list_null;
+} tftlib_set_applied_tft_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 sim_indx;
+ kal_uint8 ebi;
+ tft_info_struct tft;
+ bearer_type_enum bearer_type;
+ tft_proc_dir_enum proc_dir;
+ tft_bearer_act_enum bearer_act;
+ rat_ind_enum rat;
+ kal_bool is_pf_act_list_null;
+} tftlib_set_applied_tft_by_ebi_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 sim_indx;
+ kal_uint8 psi;
+ kal_uint8 qfi;
+ kal_uint8 qri;
+ tft_info_struct qr;
+ bearer_type_enum bearer_type;
+ tft_proc_dir_enum proc_dir;
+ tft_bearer_act_enum bearer_act;
+ kal_bool is_pf_act_list_null;
+} tftlib_set_applied_qr_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 sim_indx;
+ kal_uint8 psi;
+ kal_uint8 qfi;
+
+} tftlib_update_deact_qr_list_to_del_qf_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 sim_indx;
+ tftlib_trc_func_name_enum tftlib_api;
+
+} tftlib_generic_api_req_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 sim_indx;
+ kal_uint8 psi;
+ kal_uint8 qfi;
+ kal_uint8 rule_idx;
+ pkt_filter_act_enum action;
+ pkt_filter_struct pf;
+ kal_bool is_pf_act_list_null;
+
+} tftlib_rqos_set_applied_qr_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 sim_indx;
+ kal_uint8 psi;
+ kal_uint8 NextQri;
+
+} tftlib_qr_get_pf_act_list_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 sim_indx;
+ kal_uint8 ebi;
+
+} tftlib_tft_get_pf_act_list_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 sim_indx;
+ kal_uint8 psi;
+ kal_uint8 qfi;
+
+} tftlib_qf_has_any_rule_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 sim_indx;
+ kal_uint8 cid;
+ tft_compose_type_enum tft_compose_type;
+ bearer_type_enum bearer_type;
+ tft_bearer_act_enum bearer_act;
+ bcm_enum bcm;
+ rat_ind_enum rat;
+
+} tftlib_compose_tft_to_nw_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 sim_indx;
+ kal_uint8 psi;
+ kal_uint8 qfi;
+ kal_uint8 cid;
+ tft_compose_type_enum tft_compose_type;
+ bearer_type_enum bearer_type;
+ vg_act_enum vg_act;
+
+} tftlib_compose_and_encode_qrs_to_nw_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 sim_indx;
+ kal_uint8 psi;
+ tft_deact_qr_list_struct deact_qr_list;
+
+} tftlib_compose_and_encode_deact_qr_list_to_nw_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 sim_indx;
+ kal_uint8 psi;
+ kal_uint8 qfi;
+ kal_uint8 cid;
+
+} tftlib_set_cid_for_applied_qr_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 sim_indx;
+ kal_uint8 ebi;
+ kal_uint8 cid;
+
+} tftlib_set_cid_for_applied_tft_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 sim_indx;
+ kal_uint8 ebi;
+
+} tftlib_construct_context_for_default_bearer_wo_tft_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 sim_indx;
+ kal_uint8 cid;
+ tft_ctxt_type_enum tft_ctxt_type;
+
+} tftlib_del_tft_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 sim_indx;
+ tftlib_trc_func_name_enum del_api;
+ kal_uint8 psi; // valid for TFTLIB_DEL_APPLIED_QR_BY_PSI, TFTLIB_DEL_APPLIED_QR_BY_PSI_QFI, TFTLIB_DEL_APPLIED_QR_BY_PSI_QRI
+ kal_uint8 qfi; // valid for TFTLIB_DEL_APPLIED_QR_BY_PSI_QFI
+ kal_uint8 qri; // valid for TFTLIB_DEL_APPLIED_QR_BY_PSI_QRI
+ kal_uint8 ebi; // valid for TFTLIB_DEL_APPLIED_TFT_BY_EBI
+ tft_ctxt_type_enum tft_ctxt_type;
+ kal_bool is_pf_act_list_null;
+} tftlib_del_applied_tft_or_qr_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 sim_indx;
+
+} tftlib_del_all_tft_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 sim_indx;
+ kal_uint8 cid;
+ tft_info_list_struct tft_list;
+
+} tftlib_get_user_defined_tft_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 sim_indx;
+ kal_uint8 cid;
+
+} tftlib_get_applied_tft_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 sim_indx;
+ kal_uint8 cid;
+
+} tftlib_get_applied_qr_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 sim_indx;
+ kal_uint8 cid;
+ tft_info_struct tft;
+ rat_ind_enum rat;
+ etft_enum etft;
+
+} tftlib_set_user_defined_tft_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 sim_indx;
+ kal_uint8 cid;
+ kal_bool qri_present;
+ kal_uint8 qri;
+ kal_uint8 delpf_id;
+ rat_ind_enum rat;
+} tftlib_set_usr_delpf_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 sim_indx;
+ kal_uint8 cid;
+ kal_bool qri_present;
+ kal_uint8 qri;
+} tftlib_get_usr_delpf_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 sim_indx;
+ kal_uint8 cid;
+} tftlib_clear_usr_delpf_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 sim_indx;
+ kal_uint8 cid;
+ kal_uint8 lnkpf_id;
+ rat_ind_enum rat;
+} tftlib_set_usr_lnkpf_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 sim_indx;
+ kal_uint8 cid;
+} tftlib_get_usr_lnkpf_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 sim_indx;
+ kal_uint8 cid;
+} tftlib_clear_usr_lnkpf_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 sim_indx;
+ kal_uint8 cid;
+ kal_uint8 primary_cid;
+ bearer_type_enum bearer_type;
+ tft_info_struct tcm_user_defined_tft;
+
+} tftlib_define_epsb_context_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 sim_indx;
+ kal_uint8 cid;
+ kal_uint8 bearer_id;
+ kal_uint8 linked_bearer_id;
+ bearer_type_enum bearer_type;
+ tft_info_struct tcm_applied_tft;
+ tft_info_struct tcm_user_defined_tft;
+} tftlib_act_epsb_context_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 sim_idx;
+ kal_uint8 rule_idx;
+} tftlib_get_rqos_rule_struct;
+
+
+
+
+//#endif /* #ifdef __TFTLIB_UT__ */
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ tft_validate_result_enum tftlib_ret_decode_result;
+ tft_info_struct tftlib_ret_tft;
+ tft_fail_action_enum fail_action;
+
+} tftlib_tft_decode_exec_result_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool tftlib_ret_func_result;
+ kal_uint16 tft_raw_len;
+ kal_uint8 tftlib_ret_tft_raw[MAX_TFT_LEN];
+
+} tftlib_tft_encode_exec_result_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool tftlib_ret_func_result;
+ kal_uint16 qrs_raw_len;
+ kal_uint8 qrs_raw[MAX_QOS_RULES_LEN];
+
+} tftlib_qrs_encode_exec_result_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ pkt_filter_act_list_struct tftlib_ret_pf_act_list;
+ tft_deact_bearer_list_struct tftlib_ret_deact_bearer_list;
+ tft_info_struct tcm_applied_tft;
+
+} tftlib_set_applied_tft_exec_result_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool result;
+ pkt_filter_act_list_struct tftlib_ret_pf_act_list;
+ tft_deact_qr_list_struct tftlib_ret_deact_qr_list;
+ tft_info_struct tcm_applied_qr;
+
+} tftlib_set_applied_qr_exec_result_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool result;
+ pkt_filter_act_list_struct tftlib_ret_pf_act_list;
+ tftlib_rqos_rule_struct rqos_applied_qr;
+
+} tftlib_rqos_set_applied_qr_exec_result_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool tftlib_ret_func_result;
+ tft_info_struct tftlib_ret_tft;
+
+} tftlib_compose_tft_to_nw_exec_result_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ tft_info_struct tcm_applied_tft;
+ tft_info_struct tcm_user_defined_tft;
+
+} tftlib_current_tft_context_status_struct; // used when tftlib_del_tft / tftlib_get_user_defined_tft / tftlib_get_applied_tft is called
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ tftlib_trc_func_name_enum tftlib_api;
+ kal_bool tftlib_exec_result;
+ tft_validate_result_enum tftlib_validate_result;
+ tft_fail_action_enum fail_action;
+
+} tftlib_generic_exec_result_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ tftlib_qf_has_rule_enum result;
+
+} tftlib_qf_has_any_rule_exec_result_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool result;
+} tftlib_rqos_set_timer_exec_result_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool result;
+ pkt_filter_struct pf;
+} tftlib_rqos_add_rule_exec_result_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool result;
+ tft_deact_qr_list_struct tftlib_ret_deact_qr_list;
+
+} tftlib_update_deact_qr_list_to_del_qf_exec_result_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool tftlib_ret_func_result;
+ tft_info_struct tcm_user_defined_tft;
+
+} tftlib_set_user_defined_tft_exec_result_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool tftlib_ret_func_result;
+ tft_info_struct defined_tft_qr;
+ kal_uint8 defined_tft_qr_len;
+} tftlib_get_user_defined_tft_exec_result_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool tftlib_ret_func_result;
+ tft_info_struct applied_tft_qr;
+ tft_info_struct next_applied_tft_qr;
+ kal_uint8 applied_tft_qr_len;
+
+} tftlib_get_applied_tft_qr_exec_result_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool tftlib_ret_func_result;
+ tft_info_struct applied_tft_qr;
+ tft_info_struct next_applied_tft_qr;
+
+} tftlib_set_cid_for_applied_tft_qr_exec_result_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool tftlib_ret_func_result;
+ tft_info_struct applied_tft;
+
+} tftlib_construct_context_for_default_bearer_wo_tft_exec_result_struct;
+
+/* Set TFTLIB context structure */
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool is_mtk_ap_exist;
+
+} tftlib_set_mtk_ap_status_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool is_prim_log_enable;
+
+} tftlib_enable_prim_log_req_struct;
+
+
+
+/* EM message structure */
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_bool is_em_enable;
+
+} tftlib_enable_em_info_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 sim_indx;
+ kal_bool bearer_status_from_TCM_view;
+ bearer_type_enum bearer_type;
+ tft_proc_dir_enum proc_dir;
+ tft_bearer_act_enum bearer_action;
+ kal_uint8 cid;
+ kal_uint8 ebi;
+ kal_uint8 primary_cid;
+ kal_uint8 linked_ebi;
+
+ kal_bool applied_tft_status; // TRUE: active, FALSE: inactive or invalid
+ tft_info_struct applied_tft;
+
+ kal_uint8 tft_conflict_bearer_deact_num;
+ kal_uint8 tft_conflict_bearer_deact_list[TFTLIB_MAX_BEARER_CTXT_NUM];
+
+} em_tftlib_applied_tft_update_ind_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 sim_indx;
+ kal_bool bearer_status_from_TCM_view;
+ bearer_type_enum bearer_type;
+ kal_uint8 cid;
+ kal_uint8 ebi;
+ kal_uint8 primary_cid;
+ kal_uint8 linked_ebi;
+
+ kal_bool is_cgtft_set;
+ kal_bool cgtft_result;
+ pkt_filter_struct cgtft_content;
+
+ kal_bool is_egdelpf_set;
+ kal_bool egdelpf_result;
+ kal_uint8 delpf_id;
+
+ kal_bool is_eglnkpf_set;
+ kal_bool eglnkpf_result;
+ kal_uint8 lnkpf_id;
+
+ kal_bool user_defined_tft_status;
+ tft_info_struct user_defined_tft;
+
+} em_tftlib_user_defined_tft_update_ind_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 sim_indx;
+ kal_bool bearer_status_from_TCM_view;
+ bearer_type_enum bearer_type;
+ tft_proc_dir_enum proc_dir;
+ tft_bearer_act_enum bearer_action;
+ kal_uint8 cid;
+ kal_uint8 ebi;
+ kal_uint8 primary_cid;
+ kal_uint8 linked_ebi;
+
+ tft_validate_result_enum nw_assigned_tad_validate_result;
+ tft_info_struct nw_assigned_tad;
+
+} em_tftlib_nw_assigned_tad_update_ind_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 sim_indx;
+ kal_bool bearer_status_from_TCM_view;
+ bearer_type_enum bearer_type;
+ tft_bearer_act_enum bearer_action;
+ kal_uint8 cid;
+ kal_uint8 ebi;
+ kal_uint8 primary_cid;
+ kal_uint8 linked_ebi;
+
+ tft_compose_type_enum compose_type;
+ kal_bool ue_composed_tad_validate_result;
+ tft_info_struct ue_composed_tad;
+
+} em_tftlib_ue_composed_tad_update_ind_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 sim_indx;
+ kal_uint8 psi;
+ kal_uint32 t3583;
+} tftlib_rqos_set_timer_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 t3583;
+} tftlib_ipfc_rqos_enable_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 info_cnt;
+ ipc_rq_info_t rq_info;
+} tftlib_ipcore_nas_rq_info_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+} tftlib_usir_handle_struct;
+
+typedef struct {
+
+ LOCAL_PARA_HDR
+ tftlib_trc_func_name_enum tftlib_api;
+
+ // count info
+ kal_uint8 total_qos_flow_count;
+ kal_uint8 total_qos_rule_count;
+ kal_uint16 total_pkt_filter_count;
+ kal_uint8 pdus_info_len;
+
+ // pdu session info
+ pdus_info_struct pdus_info[MAX_NUM_OF_SUPPORTED_PDUS];
+} tftlib_pdu_session_info_struct;
+
+
+typedef struct {
+
+ LOCAL_PARA_HDR
+ tftlib_trc_func_name_enum tftlib_api;
+
+ // count info
+ kal_uint16 total_pkt_filter_count;
+ kal_uint8 bearer_info_len;
+
+ // pdu session info
+ bearer_info_struct bearer_info[TFTLIB_MAX_BEARER_CTXT_NUM];
+} tftlib_bearer_info_struct;
+
+
+/* Packet filter struct for debug */
+typedef struct
+{
+ kal_uint8 id; // Packet filter index
+ kal_uint8 precedence; // Packet filter evaluation precedence index
+ kal_bool pf_is_occupied; // This packet filter is used or not
+}pkt_filter_dbg_struct;
+
+typedef struct
+{
+ kal_uint16 mem_alloc_num;
+ kal_uint16 mem_free_num;
+}tftlib_ctrl_buf_statistics_struct;
+
+typedef struct
+{
+ void *buf_addr;
+ pkt_filter_struct **pf_ptr;
+}tftlib_pf_in_ctrl_buff_struct;
+
+typedef struct
+{
+ void *buf_addr;
+ kal_char *file_name;
+ kal_uint32 line;
+}tftlib_non_pf_in_ctrl_buff_struct;
+
+typedef struct
+{
+ tftlib_pf_in_ctrl_buff_struct pf_alloc_mem[TFTLIB_MAX_PF_IN_CTRL_BUF_NUM];
+ kal_uint16 pf_alloc_mem_cnt;
+ tftlib_non_pf_in_ctrl_buff_struct non_pf_alloc_mem[TFTLIB_MAX_NON_PF_IN_CTRL_BUF_NUM];
+ tftlib_ctrl_buf_statistics_struct tftlib_ctrl_buf_statistics;
+}tftlib_ctrl_buff_dbg_struct;
+
+typedef struct{
+ kal_uint8 pf_occupied_num_in_pool;
+ pkt_filter_dbg_struct pf_dbg_pool[TFTLIB_MAX_PF_NUM_IN_POOL];
+ kal_uint8 pf_alloc_num_in_ctrl_buf;
+}pf_alloc_dbg_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 sim_indx;
+ pf_alloc_dbg_struct tftlib_pf_alloc;
+ tftlib_ctrl_buff_dbg_struct tftlib_ctrl_buf;
+} tftlib_pf_and_mem_alloc_update_status_struct;
+
+typedef em_tftlib_applied_tft_update_ind_struct em_tftlib_ebi5_applied_tft_update_ind_struct;
+typedef em_tftlib_applied_tft_update_ind_struct em_tftlib_ebi6_applied_tft_update_ind_struct;
+typedef em_tftlib_applied_tft_update_ind_struct em_tftlib_ebi7_applied_tft_update_ind_struct;
+typedef em_tftlib_applied_tft_update_ind_struct em_tftlib_ebi8_applied_tft_update_ind_struct;
+typedef em_tftlib_applied_tft_update_ind_struct em_tftlib_ebi9_applied_tft_update_ind_struct;
+typedef em_tftlib_applied_tft_update_ind_struct em_tftlib_ebi10_applied_tft_update_ind_struct;
+typedef em_tftlib_applied_tft_update_ind_struct em_tftlib_ebi11_applied_tft_update_ind_struct;
+typedef em_tftlib_applied_tft_update_ind_struct em_tftlib_ebi12_applied_tft_update_ind_struct;
+typedef em_tftlib_applied_tft_update_ind_struct em_tftlib_ebi13_applied_tft_update_ind_struct;
+typedef em_tftlib_applied_tft_update_ind_struct em_tftlib_ebi14_applied_tft_update_ind_struct;
+typedef em_tftlib_applied_tft_update_ind_struct em_tftlib_ebi15_applied_tft_update_ind_struct;
+
+
+typedef em_tftlib_user_defined_tft_update_ind_struct em_tftlib_cid0_user_defined_tft_update_ind_struct;
+typedef em_tftlib_user_defined_tft_update_ind_struct em_tftlib_cid1_user_defined_tft_update_ind_struct;
+typedef em_tftlib_user_defined_tft_update_ind_struct em_tftlib_cid2_user_defined_tft_update_ind_struct;
+typedef em_tftlib_user_defined_tft_update_ind_struct em_tftlib_cid3_user_defined_tft_update_ind_struct;
+typedef em_tftlib_user_defined_tft_update_ind_struct em_tftlib_cid4_user_defined_tft_update_ind_struct;
+typedef em_tftlib_user_defined_tft_update_ind_struct em_tftlib_cid5_user_defined_tft_update_ind_struct;
+typedef em_tftlib_user_defined_tft_update_ind_struct em_tftlib_cid6_user_defined_tft_update_ind_struct;
+typedef em_tftlib_user_defined_tft_update_ind_struct em_tftlib_cid7_user_defined_tft_update_ind_struct;
+typedef em_tftlib_user_defined_tft_update_ind_struct em_tftlib_cid8_user_defined_tft_update_ind_struct;
+typedef em_tftlib_user_defined_tft_update_ind_struct em_tftlib_cid9_user_defined_tft_update_ind_struct;
+typedef em_tftlib_user_defined_tft_update_ind_struct em_tftlib_cid10_user_defined_tft_update_ind_struct;
+typedef em_tftlib_user_defined_tft_update_ind_struct em_tftlib_cid11_user_defined_tft_update_ind_struct;
+
+
+typedef em_tftlib_ue_composed_tad_update_ind_struct em_tftlib_cid0_ue_composed_tad_update_ind_struct;
+typedef em_tftlib_ue_composed_tad_update_ind_struct em_tftlib_cid1_ue_composed_tad_update_ind_struct;
+typedef em_tftlib_ue_composed_tad_update_ind_struct em_tftlib_cid2_ue_composed_tad_update_ind_struct;
+typedef em_tftlib_ue_composed_tad_update_ind_struct em_tftlib_cid3_ue_composed_tad_update_ind_struct;
+typedef em_tftlib_ue_composed_tad_update_ind_struct em_tftlib_cid4_ue_composed_tad_update_ind_struct;
+typedef em_tftlib_ue_composed_tad_update_ind_struct em_tftlib_cid5_ue_composed_tad_update_ind_struct;
+typedef em_tftlib_ue_composed_tad_update_ind_struct em_tftlib_cid6_ue_composed_tad_update_ind_struct;
+typedef em_tftlib_ue_composed_tad_update_ind_struct em_tftlib_cid7_ue_composed_tad_update_ind_struct;
+typedef em_tftlib_ue_composed_tad_update_ind_struct em_tftlib_cid8_ue_composed_tad_update_ind_struct;
+typedef em_tftlib_ue_composed_tad_update_ind_struct em_tftlib_cid9_ue_composed_tad_update_ind_struct;
+typedef em_tftlib_ue_composed_tad_update_ind_struct em_tftlib_cid10_ue_composed_tad_update_ind_struct;
+typedef em_tftlib_ue_composed_tad_update_ind_struct em_tftlib_cid11_ue_composed_tad_update_ind_struct;
+
+
+typedef em_tftlib_nw_assigned_tad_update_ind_struct em_tftlib_ebi5_nw_assigned_tad_update_ind_struct;
+typedef em_tftlib_nw_assigned_tad_update_ind_struct em_tftlib_ebi6_nw_assigned_tad_update_ind_struct;
+typedef em_tftlib_nw_assigned_tad_update_ind_struct em_tftlib_ebi7_nw_assigned_tad_update_ind_struct;
+typedef em_tftlib_nw_assigned_tad_update_ind_struct em_tftlib_ebi8_nw_assigned_tad_update_ind_struct;
+typedef em_tftlib_nw_assigned_tad_update_ind_struct em_tftlib_ebi9_nw_assigned_tad_update_ind_struct;
+typedef em_tftlib_nw_assigned_tad_update_ind_struct em_tftlib_ebi10_nw_assigned_tad_update_ind_struct;
+typedef em_tftlib_nw_assigned_tad_update_ind_struct em_tftlib_ebi11_nw_assigned_tad_update_ind_struct;
+typedef em_tftlib_nw_assigned_tad_update_ind_struct em_tftlib_ebi12_nw_assigned_tad_update_ind_struct;
+typedef em_tftlib_nw_assigned_tad_update_ind_struct em_tftlib_ebi13_nw_assigned_tad_update_ind_struct;
+typedef em_tftlib_nw_assigned_tad_update_ind_struct em_tftlib_ebi14_nw_assigned_tad_update_ind_struct;
+typedef em_tftlib_nw_assigned_tad_update_ind_struct em_tftlib_ebi15_nw_assigned_tad_update_ind_struct;
+
+typedef em_tftlib_applied_tft_update_ind_struct tftlib_ebi5_applied_tft_update_ind_struct;
+typedef em_tftlib_applied_tft_update_ind_struct tftlib_ebi6_applied_tft_update_ind_struct;
+typedef em_tftlib_applied_tft_update_ind_struct tftlib_ebi7_applied_tft_update_ind_struct;
+typedef em_tftlib_applied_tft_update_ind_struct tftlib_ebi8_applied_tft_update_ind_struct;
+typedef em_tftlib_applied_tft_update_ind_struct tftlib_ebi9_applied_tft_update_ind_struct;
+typedef em_tftlib_applied_tft_update_ind_struct tftlib_ebi10_applied_tft_update_ind_struct;
+typedef em_tftlib_applied_tft_update_ind_struct tftlib_ebi11_applied_tft_update_ind_struct;
+typedef em_tftlib_applied_tft_update_ind_struct tftlib_ebi12_applied_tft_update_ind_struct;
+typedef em_tftlib_applied_tft_update_ind_struct tftlib_ebi13_applied_tft_update_ind_struct;
+typedef em_tftlib_applied_tft_update_ind_struct tftlib_ebi14_applied_tft_update_ind_struct;
+typedef em_tftlib_applied_tft_update_ind_struct tftlib_ebi15_applied_tft_update_ind_struct;
+typedef em_tftlib_applied_tft_update_ind_struct tftlib_applied_tft_update_ind_struct;
+
+
+typedef em_tftlib_user_defined_tft_update_ind_struct tftlib_cid0_user_defined_tft_update_ind_struct;
+typedef em_tftlib_user_defined_tft_update_ind_struct tftlib_cid1_user_defined_tft_update_ind_struct;
+typedef em_tftlib_user_defined_tft_update_ind_struct tftlib_cid2_user_defined_tft_update_ind_struct;
+typedef em_tftlib_user_defined_tft_update_ind_struct tftlib_cid3_user_defined_tft_update_ind_struct;
+typedef em_tftlib_user_defined_tft_update_ind_struct tftlib_cid4_user_defined_tft_update_ind_struct;
+typedef em_tftlib_user_defined_tft_update_ind_struct tftlib_cid5_user_defined_tft_update_ind_struct;
+typedef em_tftlib_user_defined_tft_update_ind_struct tftlib_cid6_user_defined_tft_update_ind_struct;
+typedef em_tftlib_user_defined_tft_update_ind_struct tftlib_cid7_user_defined_tft_update_ind_struct;
+typedef em_tftlib_user_defined_tft_update_ind_struct tftlib_cid8_user_defined_tft_update_ind_struct;
+typedef em_tftlib_user_defined_tft_update_ind_struct tftlib_cid9_user_defined_tft_update_ind_struct;
+typedef em_tftlib_user_defined_tft_update_ind_struct tftlib_cid10_user_defined_tft_update_ind_struct;
+typedef em_tftlib_user_defined_tft_update_ind_struct tftlib_cid11_user_defined_tft_update_ind_struct;
+typedef em_tftlib_user_defined_tft_update_ind_struct tftlib_user_defined_tft_update_ind_struct;
+
+
+typedef em_tftlib_ue_composed_tad_update_ind_struct tftlib_cid0_ue_composed_tad_update_ind_struct;
+typedef em_tftlib_ue_composed_tad_update_ind_struct tftlib_cid1_ue_composed_tad_update_ind_struct;
+typedef em_tftlib_ue_composed_tad_update_ind_struct tftlib_cid2_ue_composed_tad_update_ind_struct;
+typedef em_tftlib_ue_composed_tad_update_ind_struct tftlib_cid3_ue_composed_tad_update_ind_struct;
+typedef em_tftlib_ue_composed_tad_update_ind_struct tftlib_cid4_ue_composed_tad_update_ind_struct;
+typedef em_tftlib_ue_composed_tad_update_ind_struct tftlib_cid5_ue_composed_tad_update_ind_struct;
+typedef em_tftlib_ue_composed_tad_update_ind_struct tftlib_cid6_ue_composed_tad_update_ind_struct;
+typedef em_tftlib_ue_composed_tad_update_ind_struct tftlib_cid7_ue_composed_tad_update_ind_struct;
+typedef em_tftlib_ue_composed_tad_update_ind_struct tftlib_cid8_ue_composed_tad_update_ind_struct;
+typedef em_tftlib_ue_composed_tad_update_ind_struct tftlib_cid9_ue_composed_tad_update_ind_struct;
+typedef em_tftlib_ue_composed_tad_update_ind_struct tftlib_cid10_ue_composed_tad_update_ind_struct;
+typedef em_tftlib_ue_composed_tad_update_ind_struct tftlib_cid11_ue_composed_tad_update_ind_struct;
+typedef em_tftlib_ue_composed_tad_update_ind_struct tftlib_ue_composed_tad_update_ind_struct;
+
+
+typedef em_tftlib_nw_assigned_tad_update_ind_struct tftlib_ebi5_nw_assigned_tad_update_ind_struct;
+typedef em_tftlib_nw_assigned_tad_update_ind_struct tftlib_ebi6_nw_assigned_tad_update_ind_struct;
+typedef em_tftlib_nw_assigned_tad_update_ind_struct tftlib_ebi7_nw_assigned_tad_update_ind_struct;
+typedef em_tftlib_nw_assigned_tad_update_ind_struct tftlib_ebi8_nw_assigned_tad_update_ind_struct;
+typedef em_tftlib_nw_assigned_tad_update_ind_struct tftlib_ebi9_nw_assigned_tad_update_ind_struct;
+typedef em_tftlib_nw_assigned_tad_update_ind_struct tftlib_ebi10_nw_assigned_tad_update_ind_struct;
+typedef em_tftlib_nw_assigned_tad_update_ind_struct tftlib_ebi11_nw_assigned_tad_update_ind_struct;
+typedef em_tftlib_nw_assigned_tad_update_ind_struct tftlib_ebi12_nw_assigned_tad_update_ind_struct;
+typedef em_tftlib_nw_assigned_tad_update_ind_struct tftlib_ebi13_nw_assigned_tad_update_ind_struct;
+typedef em_tftlib_nw_assigned_tad_update_ind_struct tftlib_ebi14_nw_assigned_tad_update_ind_struct;
+typedef em_tftlib_nw_assigned_tad_update_ind_struct tftlib_ebi15_nw_assigned_tad_update_ind_struct;
+typedef em_tftlib_nw_assigned_tad_update_ind_struct tftlib_nw_assigned_tad_update_ind_struct;
+
+#endif /* ----- #ifndef TFTLIB_MSG_STRUCT_H_ ----- */
diff --git a/mcu/protocol/interface/general/uagps_cp_csce_struct.h b/mcu/protocol/interface/general/uagps_cp_csce_struct.h
new file mode 100644
index 0000000..6957668
--- /dev/null
+++ b/mcu/protocol/interface/general/uagps_cp_csce_struct.h
@@ -0,0 +1,169 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * uagps_cp_csce_struct.h
+ *
+ * Project:
+ * --------
+ * AGPS
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log:$
+ *
+ * 06 12 2015 roland.li
+ * [MOLY00109917] [6291][LBS]MDT check in to UMOLY TRUNK
+ * .[LPP][UMOLY] Add EMI BW contril API.
+ *
+ * 10 02 2012 adeline.chang
+ * [MOLY00004236] [interface][service][kal]remove stack_ltlcom.h
+ * 20120928_MOLY00004236_Adeline_Remove_stack_ltlcom.h_AGPS.xls.
+ *
+ * 11 08 2011 doug.shih
+ * removed!
+ * .
+ *
+ * 12 14 2010 c-hua.yang
+ * removed!
+ * ULCS RHR
+ *
+ * removed!
+ * removed!
+ * add to source control recursely
+ *
+ ****************************************************************************/
+
+#ifndef _UAGPS_CP_CSCE_STRUCT_H
+#define _UAGPS_CP_CSCE_STRUCT_H
+#include "kal_general_types.h"
+#include "kal_public_api.h"
+typedef struct _plmn_id_internal_struct
+{
+ kal_uint8 mcc1;
+ kal_uint8 mcc2;
+ kal_uint8 mcc3;
+ kal_uint8 mnc1;
+ kal_uint8 mnc2;
+ kal_uint8 mnc3;
+} plmn_id_internal_struct;
+
+typedef enum
+{
+ UAS_NO_SERVICE,
+ UAS_NORMAL_SERVICE,
+ UAS_LIMITED_SERVICE
+
+} uas_service_state;
+
+typedef enum
+{
+ SIB15_START_REQ_ENABLE,
+ SIB15_START_REQ_ONE_SHOT
+
+} sib15_start_req;
+
+/**************************************************************
+ * UAGPS_CP_CSCE_START_SIB15_COLLECTION_REQ
+ *
+ *
+ ***************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ sib15_start_req start_req;
+
+} fdd_uagps_cp_csce_start_sib15_collection_req_struct;
+
+/**************************************************************
+ * UAGPS_CP_CSCE_STOP_SIB15_COLLECTION_REQ
+ *
+ *
+ ***************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+} fdd_uagps_cp_csce_stop_sib15_collection_req_struct;
+
+/**************************************************************
+ * UAGPS_CP_CSCE_START_SIB15_COLLECTION_CNF
+ *
+ *
+ ***************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+} fdd_uagps_cp_csce_start_sib15_collection_cnf_struct;
+
+/**************************************************************
+ * UAGPS_CP_CSCE_STOP_SIB15_COLLECTION_CNF
+ *
+ *
+ ***************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+} fdd_uagps_cp_csce_stop_sib15_collection_cnf_struct;
+
+/**************************************************************
+ * UAGPS_CP_CSCE_CELL_CHANGE_IND
+ *
+ *
+ ***************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ uas_service_state service_state;
+ plmn_id_internal_struct plmn_id;
+ kal_uint16 uarfcn;
+ kal_uint16 phyCellId;
+
+} fdd_uagps_cp_csce_cell_change_ind_struct;
+
+#endif /* _UAGPS_CP_CSCE_STRUCT_H */
diff --git a/mcu/protocol/interface/general/uagps_cp_meme_struct.h b/mcu/protocol/interface/general/uagps_cp_meme_struct.h
new file mode 100644
index 0000000..526b124
--- /dev/null
+++ b/mcu/protocol/interface/general/uagps_cp_meme_struct.h
@@ -0,0 +1,204 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * uagps_cp_meme_struct.h
+ *
+ * Project:
+ * --------
+ * AGPS
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log:$
+ *
+ * 02 26 2016 george.chang
+ * [MOLY00153397] [MT6755][L+W][Overnight][FDD][HK] Modem Warning,795,813,99,/data/core/,2,,Modem Warning: [6][353] uagps_cp_msg_hdler.c #4537
+ *
+ * .
+ *
+ * 12 16 2014 claud.li
+ * [MOLY00087795] [MEME] universal bin check in
+ * [Universal bin] [FDD][MEME/RRCE/CSCE/CSE/AGPS] interface and message id
+ *
+ * 10 02 2012 adeline.chang
+ * [MOLY00004236] [interface][service][kal]remove stack_ltlcom.h
+ * 20120928_MOLY00004236_Adeline_Remove_stack_ltlcom.h_AGPS.xls.
+ *
+ * 11 08 2011 doug.shih
+ * removed!
+ * .
+ *
+ * 02 25 2011 c-hua.yang
+ * removed!
+ * .
+ *
+ * 12 14 2010 c-hua.yang
+ * removed!
+ * ULCS RHR
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ * add to source control recursely
+ *
+ ****************************************************************************/
+
+#ifndef _UAGPS_CP_MEME_STRUCT_H
+#define _UAGPS_CP_MEME_STRUCT_H
+#include "kal_public_api.h"
+#include "kal_general_types.h"
+
+#define FDD_ACTIVE_SET_CELL_NUM 8
+
+typedef enum
+{
+ FDD_RRC_STATE_INACTIVE,
+ FDD_RRC_STATE_IDLE,
+ FDD_RRC_STATE_CELL_DCH,
+ FDD_RRC_STATE_CELL_FACH,
+ FDD_RRC_STATE_CELL_PCH,
+ FDD_RRC_STATE_URA_PCH
+} FDD_rrc_state_enum;
+
+typedef enum
+{
+ FDD_RRC_MESSAGE_TYPE_MEASUREMENT_REPORT,
+ FDD_RRC_MESSAGE_TYPE_MEASUREMENT_CONTROL_FAILURE
+} FDD_rrc_message_type;
+
+typedef enum
+{
+ FDD_RRC_MESSAGE_REPORT_RLC_AM,
+ FDD_RRC_MESSAGE_REPORT_RLC_UM
+} FDD_rrc_message_report_rlc_type;
+
+/**************************************************************
+ * UAGPS_CP_MEME_MOVE_TO_STATE_IND
+ *
+ *
+ ***************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ FDD_rrc_state_enum rrc_state;
+ kal_bool isSteadyState;
+
+ /* Fill these parameters to update the active set information if and only if the new state is FDD_CELL_DCH state */
+ kal_uint16 uarfcn;
+ kal_uint8 numOfCell;
+ kal_uint16 phyCellId[FDD_ACTIVE_SET_CELL_NUM];
+
+} fdd_uagps_cp_meme_move_to_state_ind_struct;
+
+/**************************************************************
+ * UAGPS_CP_MEME_POSITIONING_DATA_IND
+ *
+ * data in pdu buffer by ASN encoded format
+ ***************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ kal_uint16 transaction_id;
+
+} fdd_uagps_cp_meme_positioning_data_ind_struct;
+
+/**************************************************************
+ * UAGPS_CP_MEME_RELEASE_MEASUREMENT_IND
+ *
+ *
+ ***************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ kal_uint16 transaction_id;
+
+} fdd_uagps_cp_meme_release_measurement_ind_struct;
+
+/**************************************************************
+ * UAGPS_CP_MEME_POSITIONING_DATA_REQ
+ *
+ *
+ ***************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ kal_uint16 transaction_id;
+ //RRC_MeasurementValidity validity_state; // use ASN decoded type
+ FDD_rrc_message_type message_type;
+ kal_uint8 *message_pdu; // Measurement report or Measurement control failure
+
+ FDD_rrc_message_report_rlc_type rlc_type;
+
+} fdd_uagps_cp_meme_positioning_data_req_struct;
+
+/**************************************************************
+ * UAGPS_CP_MEME_RELEASE_MEASUREMENT_REQ
+ *
+ *
+ ***************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ kal_uint16 transaction_id;
+
+} fdd_uagps_cp_meme_release_measurement_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ kal_uint16 transaction_id;
+ kal_bool isSent;
+} fdd_uagps_cp_meme_measurement_report_cnf_struct;
+
+#endif /* _UAGPS_CP_MEME_STRUCT_H */
diff --git a/mcu/protocol/interface/general/uagps_cp_sibe_struct.h b/mcu/protocol/interface/general/uagps_cp_sibe_struct.h
new file mode 100644
index 0000000..6dee5ae
--- /dev/null
+++ b/mcu/protocol/interface/general/uagps_cp_sibe_struct.h
@@ -0,0 +1,104 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * uagps_cp_sibe_struct.h
+ *
+ * Project:
+ * --------
+ * AGPS
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log:$
+ *
+ * 06 12 2015 roland.li
+ * [MOLY00109917] [6291][LBS]MDT check in to UMOLY TRUNK
+ * .[LPP][UMOLY] Add EMI BW contril API.
+ *
+ * 10 02 2012 adeline.chang
+ * [MOLY00004236] [interface][service][kal]remove stack_ltlcom.h
+ * 20120928_MOLY00004236_Adeline_Remove_stack_ltlcom.h_AGPS.xls.
+ *
+ * 11 08 2011 doug.shih
+ * removed!
+ * .
+ *
+ * 12 14 2010 c-hua.yang
+ * removed!
+ * ULCS RHR
+ *
+ * removed!
+ * removed!
+ * add to source control recursely
+ *
+ ****************************************************************************/
+
+#ifndef _UAGPS_CP_SIBE_STRUCT_H
+#define _UAGPS_CP_SIBE_STRUCT_H
+#include "kal_public_api.h"
+#include "kal_general_types.h"
+typedef enum
+{
+ SIB_15,
+ SIB_15_1,
+ SIB_15_2,
+ SIB_15_3
+} sib15_type_enum;
+
+/**************************************************************
+ * UAGPS_CP_SIBE_SIB15_CHANGE_IND
+ *
+ * data in pdu buffer by ASN format, sib already assembled
+ ***************************************************************/
+typedef struct
+{
+ LOCAL_PARA_HDR
+
+ sib15_type_enum sib15_type;
+ kal_uint8 occurIdentity;
+
+} fdd_uagps_cp_sibe_sib15_change_ind_struct;
+
+#endif /* _UAGPS_CP_SIBE_STRUCT_H */
diff --git a/mcu/protocol/interface/general/uas_common_enums.h b/mcu/protocol/interface/general/uas_common_enums.h
new file mode 100644
index 0000000..2d28618
--- /dev/null
+++ b/mcu/protocol/interface/general/uas_common_enums.h
@@ -0,0 +1,556 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * uas_common_enums.h
+ *
+ * Project:
+ * --------
+ * MONZA
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ----------------------------------------------------------------------------
+ * $Log:$
+ *
+ * 04 20 2018 vend_mtb_bpt002
+ * [MOLY00321207] eFuse invoke protection from UL2
+ * .
+ *
+ * 07 28 2017 hamilton.liang
+ * [MOLY00266853] [Bianco/Zion] gmn sw check-in
+ *
+ * GMN SW for 3G L2 part
+ *
+ * 04 12 2017 cen.chen
+ * [MOLY00240270] [6293][Gemini][T+W] Phase 1: Common Interface Changes Check in.
+ * UAS_TDD_RRCE part.
+ *
+ * 04 12 2017 jen-de.lai
+ * [MOLY00240270] [6293][Gemini][T+W] Phase 1: Common Interface Changes Check in
+ *
+ * 03 31 2017 jen-de.lai
+ * [MOLY00195317] [URLC][TX] - Gen93 URLC TX code modification for new HW and MCU Archi
+ *
+ * [UL2] - FDD T+W ubin share memory
+ *
+ * 01 12 2016 charlescm.wu
+ * [MOLY00156239] [UMOLY][LR11] 3G FDD/TDD L2 big size memory union
+ * [FDD|TDD common] UBin 3G L2 memory reduction by union
+ *
+ * 08 21 2015 jen-de.lai
+ * [MOLY00136103] [COPY CR][WW FT][Mexico-Mexico][Denali-1][MT6735][Telcel][E-RACH] ][ASSERT] Fatal Error (0x840, 0xf25e3c30)
+ *
+ * 12 31 2014 nancy.chang
+ * [MOLY00087510] [Universal Bin] FDD DBME & LDBME development
+ * .
+ *
+ * 12 30 2014 charlescm.wu
+ * [MOLY00087679] [UMOLY][FDD][UAS COMMON][UL2 COMMON/URLC/BMC/SEQ]U-Bin CBr to UMOLY TRUNCK.
+ *
+ * 12 26 2014 chi-chung.lin
+ * [MOLY00089131] [MT6291 Gemini] L+W+W+W code revision check in
+ * .
+ *
+ * 12 24 2014 tc.chang
+ * [MOLY00087434] [Universal Bin] Check in.
+ *
+ * 12 16 2014 charlescm.wu
+ * [MOLY00087679] [UMOLY][FDD][UAS COMMON][UL2 COMMON/URLC/BMC/SEQ]U-Bin CBr to UMOLY TRUNCK.
+ *
+ * 12 15 2014 charlescm.wu
+ * [MOLY00087679] [UMOLY][FDD][UAS COMMON][UL2 COMMON/URLC/BMC/SEQ]U-Bin CBr to UMOLY TRUNCK.
+ *
+ * 12 12 2014 chin-chia.chang
+ * [MOLY00087443] [Universal Bin] [FDD] [UAS] [URR/Common] Check-in
+ * [UniBin] [FDD] [UMOLY] uas_common_enums.h
+ *
+ * 12 12 2014 tc.chang
+ * [MOLY00087434] [Universal Bin] Check in.
+ * PDCP and CSR exported APIs.
+ *
+ * 11 14 2014 yenchih.yang
+ * [MOLY00084256] [MEME] sync MT6291 to UMOLY
+ * URR/MEME.
+ *
+ * 11 13 2014 claud.li
+ * [MOLY00084256] [MEME] sync MT6291 to UMOLY
+ * [MEME] interface check in
+ *
+ * 06 20 2014 jinpeng.hu
+ * [MOLY00067841] [Klocwork] in //MOLY/TRUNK/MOLY/mcu/modem/uas_tdd128/ul2/urlc/src/crlc_fsm.c, line 7636.
+ *
+ * 06 05 2014 head.hsu
+ * [MOLY00068511] [WW FT][Singapore][MT6595][M1] Assert: rabm_fsm.c line:663
+ * .
+ *
+ * 01 22 2014 yanjuan.feng
+ * [MOLY00054324] [4G Gemini][Merge] MOLY.MM.GEMINI.DEV Merge back to MOLY
+ * .
+ *
+ * 11 21 2013 rachel.liu
+ * [MOLY00045854] [PS1267 HG+WG] Check-in Gemini HG+WG modification
+ * Common files.
+ *
+ * 11 05 2013 johnson.liu
+ * [MOLY00042658] [SHAQ] UAS related header split
+ * .
+ *
+ * 11 05 2013 andrew.wu
+ * [MOLY00042658] [SHAQ] UAS related header split
+ * <saved by Perforce>
+ *
+ * 08 26 2013 tereasa.huang
+ * [MOLY00034869] [HG+WG] PS6 code check in MOLY
+ * [HG WG] Common macro defination and modification.
+ *
+ * 06 26 2013 hsiu-chi.hsu
+ * [MOLY00027582] [R7R8][URLC] Stop Timer_Poll_Periodic in PCH state if no un-acked PDU to reduce standby power consumption
+ * .
+ *
+ * 04 26 2013 huifeng.jing
+ * MOLY00013224 moly
+ *
+ * 04 09 2013 yungfu.chen
+ * [MOLY00013224] ??�q????��???��?��
+ * .
+ *
+ * 10 10 2012 young.zhou
+ * [MOLY00004148] [3G TDD][URLC]TDD R9 Dev Patch back to Moly
+ * Sync uas_common_enums.h
+ *
+ * 06 21 2012 hsiu-chi.hsu
+ * removed!
+ * .
+ *
+ * 04 17 2012 yiting.cheng
+ * removed!
+ * .
+ *
+ * 04 16 2012 yiting.cheng
+ * removed!
+ * .
+ *
+ * 04 11 2012 yiting.cheng
+ * removed!
+ * .
+ *
+ * 01 12 2012 peng-an.chen
+ * removed!
+ * .
+ *
+ * 01 09 2012 kathie.ho
+ * removed!
+ * Migrate RLC RX part of make file, sap, urlc\inc.
+ *
+ * 11 08 2011 weimin.zeng
+ * removed!
+ * merge MSBB.
+ *
+ * 08 30 2011 mengsung.wu
+ * removed!
+ * .
+ *
+ * 02 24 2011 tc.chang
+ * removed!
+ * .
+ *
+ * 02 14 2011 tc.chang
+ * removed!
+ * .
+ *
+ * 01 26 2011 max.yin
+ * removed!
+ * .
+ *
+ * 12 31 2010 max.yin
+ * removed!
+ * .
+ *
+ * 12 16 2010 peng-an.chen
+ * removed!
+ * .
+ *
+ * 12 14 2010 nicky.chou
+ * removed!
+ * .
+ *
+ * 10 25 2010 max.yin
+ * removed!
+ * .
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ * constant values modification for test loop mode & BMC
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ * Add copyright header.
+ ******************************************************************************/
+
+#ifndef _UAS_COMMON_ENUMS_H
+#define _UAS_COMMON_ENUMS_H
+
+/* Nicky 20101008: include header files for redundant header file removal */
+#include "as_common.h"
+#include "kal_general_types.h"
+#include "global_def.h"
+
+/* Universal Bin: merge TDD and FDD UAS/URR: begin */
+
+/* [H/G + W/G] Used by URR, UL2, UL2D context declaration */
+#define MAXIMUM_UAS_CNTX (MAX_UMTS_NUM)
+
+/* [H/G + W/G] Used by URR, UL2, UL2D context indication */
+typedef enum {
+ UAS1 = 0,
+ UAS2 = 1,
+ UAS3 = 2,
+ UAS4 = 3
+} UAS_CURRENT_CNTX_PTR_enum;
+
+typedef enum {
+ TDD_UAS_SIM1 = 0,
+ TDD_UAS_MAX_SIM_NUM
+} TDD_UAS_SIM_INDEX_enum;
+
+
+/* Offset in uplink DRLC PDU */
+#define NUM_DRLC_OFFSET (8)
+
+/* Max Yin 2009-10-19: Safe space for RLC header space
+ * sizeof(pdcp_ps_data_req_struct) - sizeof(PEER_BUFF_HDR) + 4 (reserved for ReTx from RATDM)
+ */
+#define DRLC_SAFE_HEADER_SPACE_OFFSET 24
+
+// Used by SAP_RRCE_SIBE, SAP_MEME_SIBE.
+#define FDD_MAX_MEAS_CELLS (32)
+#define TDD_MAX_MEAS_CELLS (32)
+
+
+/* Description: Maximum number of scrambling code per frequency. The
+ frequency carrier information may contain up to 32 scrambling codes
+ (m) [ref:31.102;270] */
+/* John Tang 2005/10/24. */
+#define MAX_NUM_SCRAMBLING_CODE 32
+
+#define MAX_NUM_TRCH 8
+
+
+/**
+* Database indexor
+*/
+#define FDD_DBIdx RRC_FDD_DB_Cell_Idx
+#define TDD_DBIdx RRC_TDD_DB_Cell_Idx
+#define DB_INVALID_INDEX (-1)
+
+#define MAX_RBS_IN_RAB (3)
+
+#ifdef __UMTS_R5__
+#define MAX_RB_LOOPED_BACK (5) /* refer to 34.109 V5.5.0 section 6.2, the maximum number of loopback RB is 5 */
+#else /* __UMTS_R5__ */
+#define MAX_RB_LOOPED_BACK (4) /* refer to 34.109 V3.a.0 section 6.2, the maximum number of loopback RB is 4 */
+#endif /* __UMTS_R5__ */
+
+// UniBin modify: FDD(1800), TDD(1560), TDD align to FDD
+#define MAX_L2_EXTERNAL_SDU_SIZE (1800)
+
+/*
+ * Theoretically Max SDU size for TM mode in SRB is Max MAC-ehs PDU size. This is possible in e-FACH BCCH/PCCH mapped onto ehs.
+ */
+#define MAX_L2_TM_SDU_SIZE (2048)
+
+#ifdef __CSHSPA_SUPPORT__
+#define MAX_CS_UL_MEM_NUM (40) /* 5+1 for RLC discard timer, 32 for UMAC HARQ process, 2 for internal delay */
+/*
+ * HARQ worst case
+ * 1. [10ms TTI] Max time for one process is 16 * 40ms (duration for the same process to transmit) = 640ms ==> 32 pieces
+ *
+ * 2. [2ms TTI] Max time for one process is 16 * 16ms (duration for the same process to transmit) = 256ms ==> 13 pieces
+ */
+#define MAX_CS_DL_HSPA_DATA_SIZE (84) /* 1 byte for PDCP header, 3 bytes alignment*/
+#endif
+
+#define MAX_CS_DATA_SIZE (160) /* don't need to leave 8 bytes for RLC and 1byte for PDCP because they would allocated in free header*/
+#define MAX_RLC_CS_DATA_SIZE (NUM_DRLC_OFFSET + MAX_CS_DATA_SIZE) /* RLC needs to reserve NUM_DRLC_OFFSET(8) bytes for extra info in csr_tm_data_req */
+
+/* definition for HP8960 LBM: extra CRC bytes - 3. */
+#define MAX_CS_DL_DATA_SIZE (480+4)
+
+#define FIRST_EXTENDED_USER_RB_ID (EXT_RB_ID_DCCH_RB4 + 1)
+#define EXTENDED_RB_ID_NONE (FIRST_EXTENDED_RB_ID-1)
+#define IS_VALID_EXTENDED_RB_ID(id) IS_INRANGE((id), FIRST_EXTENDED_RB_ID, LAST_EXTENDED_RB_ID)
+
+#define INRANGE_RB1_RB32(id) IS_INRANGE((id), EXT_RB_ID_DCCH_RB1, EXT_RB_ID_RB32)
+
+#define INVALID_T308_DURATION 0xFFFF
+
+/* Eric: Moved here since it's shared by MEME & UMAC */
+#define FDD_INVALID_MEASUREMENT_ID 33
+#define TDD_INVALID_MEASUREMENT_ID 17
+
+#define FDD_MAX_NUM_TVM_CFG 32
+#define TDD_MAX_NUM_TVM_CFG 16
+
+/* Macro for information extracted above */
+typedef enum tTxRxTag
+{
+ TX,
+ RX
+} tTxRx;
+
+typedef enum tRLCEntityModeTag
+{
+ RLC_TM = 1,
+ RLC_UM,
+ RLC_AM
+} tRLCEntityMode;
+
+/* Jeff Wu */
+#define RABM_MAX_NSAPI 11
+#define MIN_NSAPI 5
+#define MAX_NSAPI 15
+
+/* 2011.02.14: Set 5 for passing GCF TC 7.1.5.2 */
+#define MAX_VAL(VAL_A, VAL_B) (((VAL_A) > (VAL_B)) ? (VAL_A):(VAL_B))
+#define NUM_OF_NSAPI MAX_VAL(GPRS_MAX_PDP_SUPPORT, 5)
+
+// UniBin modify: FDD
+// FDD: #define RABM_MAX_PS_RABS (11)
+// TDD: #define RABM_MAX_PS_RABS MAX_VAL(GPRS_MAX_PDP_SUPPORT, 5)
+#define RABM_MAX_PS_RABS (11)
+
+/* CN domain embedded in MUI. */
+#define MUI_PS_DOMAIN 0x00000100 /* mask to get CN Domain. */
+#define MUI_DOMAIN_POS 8 /* the position to indicate CN Domain is at bit MUI_DOMAIN_POS+1. */
+/* BMC level 2 DRX bitmap size. */
+#define UAS_BMC_MAX_BITMAP_SIZE (32)
+#define MAX_AM_DATA_CNF (8)
+
+/* Max Yin */
+#define PDCP_DL_PDU_FREE_HEADER_SPACE 4
+
+#define SHAQ_PDCP_NO_HDR_PDU_HDR_LEN 0
+
+#define FACH_BCH_AICH_SUPPORTED KAL_TRUE
+
+typedef enum
+{
+ /* Extended Bearer IDs */
+ /* IDs 4..31 for user plane (DTCH), routed to/from UUS SAP */
+
+ /* Broadcast control channel */
+ EXT_RB_ID_ALL = -6,
+ FIRST_EXTENDED_RB_ID = -5,
+ EXT_RB_ID_CTCH = FIRST_EXTENDED_RB_ID, /* -5 allocated to CTCH */
+ EXT_RB_ID_BCCH_FACH, /* -4 allocated to BCCH/FACH */
+ EXT_RB_ID_BCCH_BCH0, /* -3 allocated to BCCH' for SFN timing measurement */
+ EXT_RB_ID_BCCH_BCH1, /* -2 allocated to BCCH/BCH */
+ EXT_RB_ID_PCCH, /* -1 Paging control channel */
+ EXT_RB_ID_CCCH, /* 0 Common control channel */
+ EXT_RB_ID_DCCH_RB1, /* 1 Dedicated control channel, UM bearer */
+ EXT_RB_ID_DCCH_RB2, /* 2 Dedicated control channel, AM bearer */
+ EXT_RB_ID_DCCH_RB3, /* 3 For high priority SAPI 0 NAS DT messages */
+ EXT_RB_ID_DCCH_RB4, /* 4 For low priority SAPI 3 NAS DT messages */
+ EXT_RB_ID_RB5,
+ EXT_RB_ID_RB6,
+ EXT_RB_ID_RB7,
+ EXT_RB_ID_RB8,
+ EXT_RB_ID_RB9,
+ EXT_RB_ID_RB10,
+ EXT_RB_ID_RB11,
+ EXT_RB_ID_RB12,
+ EXT_RB_ID_RB13,
+ EXT_RB_ID_RB14,
+ EXT_RB_ID_RB15,
+ EXT_RB_ID_RB16,
+ EXT_RB_ID_RB17,
+ EXT_RB_ID_RB18,
+ EXT_RB_ID_RB19,
+ EXT_RB_ID_RB20,
+ EXT_RB_ID_RB21,
+ EXT_RB_ID_RB22,
+ EXT_RB_ID_RB23,
+ EXT_RB_ID_RB24,
+ EXT_RB_ID_RB25,
+ EXT_RB_ID_RB26,
+ EXT_RB_ID_RB27,
+ EXT_RB_ID_RB28,
+ EXT_RB_ID_RB29,
+ EXT_RB_ID_RB30,
+ EXT_RB_ID_RB31,
+ EXT_RB_ID_RB32,
+ LAST_EXTENDED_RB_ID = EXT_RB_ID_RB32
+// DUMMY_EXTENDED_RB_ID = 0x7FFFFFFF /* frost: remove it */
+} ExtendedRbId;
+
+/* Jeff Wu */
+typedef enum
+{
+ RAB_RELEASE_BY_NW,
+ RAB_RELEASE_BY_RRC_CONN_RELEASE,
+ RAB_RELEASE_BY_LOST_COVERAGE,
+ RAB_RELEASE_BY_INTER_RAT,
+ RAB_RELEASE_BY_UNSPECIFIED
+} rab_release_cause_enum;
+
+typedef enum
+{
+ L2_RRC_IDLE,
+ L2_RRC_CELL_DCH,
+ L2_RRC_CELL_FACH,
+ L2_RRC_CELL_PCH,
+ L2_RRC_URA_PCH,
+ L2_RRC_INVALID_STATE
+} L2_RRC_STATE;
+
+typedef enum CMAC_TrafficVolumeEventType {
+ e4a = 0,
+ e4b = 1,
+ eInvalid=3
+} CMAC_TrafficVolumeEventType;
+
+
+typedef enum
+{
+ FIRST_LOGICAL_CHANNEL_PDU_TYPE,
+ PDU_TYPE_CONTROL = FIRST_LOGICAL_CHANNEL_PDU_TYPE,
+ PDU_TYPE_DATA,
+ PDU_TYPE_NA,
+ LAST_LOGICAL_CHANNEL_PDU_TYPE = PDU_TYPE_NA
+}tRlcPduType ;
+
+
+typedef kal_uint16 RLCEntityID;
+
+/* [MODIFICATION] Kathie */
+typedef enum{
+ REASM_CAUSE_NORMAL,
+ REASM_CAUSE_MRW,
+ /* REASM_CAUSE_RESET, */
+ REASM_CAUSE_NUM
+}tReasmCause;
+
+
+typedef enum
+{
+ AM_RLC_SDU_ACK = 0,
+ AM_RLC_SDU_ALL_TX,
+ AM_RLC_SDU_NOT_ALL_TX
+} tAmRlcSduTxResult;
+
+typedef enum
+{
+ UAS_DL_ADM = 0,
+ GRLC_DL_ADM_FIRST_PART,
+ GRLC_DL_ADM_SECOND_PART,
+ UAS_DL_IDLE_ADM
+} uas_dl_adm_index_enum;
+
+
+
+typedef kal_uint16 RLCEntityID;
+
+/* UMAC R7 */
+/* Author : David */
+/* Temp Enum. After code merge with RLC, i need to replace it with RLC-SLCE interface.*/
+typedef enum
+{
+ Flexible = 0,
+ Fixed = 1
+} tRlcFixedFlexible;
+
+
+typedef enum
+{
+ swF8AlgoUea0 = 0/* No Cipher */
+ ,swF8AlgoUea1
+ ,swF8AlgoUea2
+} swF8Algo;
+
+
+/* Enum to indicate the ubin memory is initialized to None / FDD / TDD.*/
+typedef enum
+{
+ UL2_UBIN_MEM_INIT_IN_NONE = 0, /* Initialization state, ul2 ubin memory doesn't init to FDD or TDD */
+ UL2_UBIN_MEM_INIT_IN_FDD, /* ul2 ubin memory is initialized to FDD */
+ UL2_UBIN_MEM_INIT_IN_TDD, /* ul2 ubin memory is initialized to TDD */
+ UL2_UBIN_MEM_TASK_IN_NONE,
+ UL2_UBIN_MEM_TASK_IN_FDD, /* ul2 ubin memory is initialized to FDD */
+ UL2_UBIN_MEM_TASK_IN_TDD /* ul2 ubin memory is initialized to TDD */
+} ul2_ubin_mem_init_state_e;
+
+#endif /* _UAS_COMMON_ENUMS_H */
+
diff --git a/mcu/protocol/interface/general/uas_eas_enums.h b/mcu/protocol/interface/general/uas_eas_enums.h
new file mode 100644
index 0000000..57dbee3
--- /dev/null
+++ b/mcu/protocol/interface/general/uas_eas_enums.h
@@ -0,0 +1,22 @@
+#ifndef _UAS_EAS_ENUMS_H
+#define _UAS_EAS_ENUMS_H
+
+#include "irat_common_enums.h"
+
+/* MACRO goes here */
+#define MAX_NUM_CELL_INFO_UTRA (16)
+#define MAX_NUM_REDIRECTION_FREQ_UTRA (6)
+
+typedef enum {
+ CGI_INFO_NOT_CSG_CELL = 0x00,
+ CGI_INFO_CSG_CLOSED_CELL = 0x01,
+ CGI_INFO_HYBRID_CELL = 0x02,
+} cell_type_enum;
+
+typedef enum {
+ FDD_MOB_MEME_MEAS_STOP_CAUSE_REGULAR, /*normal stop*/
+ FDD_MOB_MEME_MEAS_STOP_CAUSE_4G3IRHO /*stop triggered by 4G3 IRHO*/
+}FDD_MOB_MEME_MEASUREMENT_STOP_CAUSE;
+
+
+#endif /* UAS_EAS_ENUMS_H */
diff --git a/mcu/protocol/interface/general/uas_eas_struct.h b/mcu/protocol/interface/general/uas_eas_struct.h
new file mode 100644
index 0000000..c32414f
--- /dev/null
+++ b/mcu/protocol/interface/general/uas_eas_struct.h
@@ -0,0 +1,465 @@
+#ifndef _UAS_EAS_STRUCT_H
+#define _UAS_EAS_STRUCT_H
+
+#include "irat_common_enums.h"
+#include "irat_common_struct.h"
+#include "uas_eas_enums.h"
+#include "mcd_l3_inc_struct.h"
+#include "csi_umts_asn.h"
+#include "uas_eas_inter_core_struct.h"
+#include "global_type.h"
+
+/* Measurement results related: UAS to/from EAS */
+
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+/* Measurement request/confirm related: UAS to/from EAS */
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 tid;
+ kal_bool hps_flag;
+ kal_uint8 prio_meas_period;
+ kal_uint8 freq_num;
+ eas_meas_freq_info_struct freq[MAX_MEAS_IRAT_FREQ];
+
+//#ifdef __LTE_R11__
+ kal_uint8 rach_report_freq_num;
+//#endif
+ kal_bool rsrq_meas_on_all_symbols;
+} uas_eas_lte_measurement_req_struct;
+
+
+typedef struct {
+ LOCAL_PARA_HDR
+} uas_eas_lte_measurement_cnf_struct;
+
+/* Measurement request/confirm related: EAS to UAS */
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 list_ref;
+ kal_int16 prio_meas_period;
+ FDD_meas_UmtsCellList umts_cell_list;
+ kal_int8 fdd_rscp_min_in_dbm; //TBC with LTE
+ kal_uint16 first_meas_uarfcn; // invalid value = -1
+ kal_bool is_detected_cell_meas[FDD_MAX_NUM_MEASURED_UMTS_CARRIERS];
+ meas_scale_factor_enum meas_scale_factor;
+ FDD_MOB_MEME_MEASUREMENT_STOP_CAUSE stop_cause;
+} eas_fdd_uas_config_ucell_prio_meas_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 list_ref;
+ kal_int16 prio_meas_period;
+ TDD_meas_UmtsCellList umts_cell_list;//numElements in CsiUmtsCellListOnTheCarrier must be 0
+// kal_int8 fdd_rscp_min_in_dbm; //TBC with LTE, FDD only
+ kal_uint16 first_meas_uarfcn; // invalid value = -1//TBD, for CSFB, whether report meas result per freq?
+ kal_bool is_detected_cell_meas[TDD_MAX_NUM_MEASURED_UMTS_CARRIERS];
+ meas_scale_factor_enum meas_scale_factor;
+} eas_tdd_uas_config_ucell_prio_meas_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 list_ref;
+ FDD_meas_UmtsCellList umts_cell_list;
+ kal_int8 fdd_rscp_min_in_dbm; //TBC with LTE
+ kal_uint16 first_meas_uarfcn; // invalid value = -1
+ kal_bool is_detected_cell_meas[FDD_MAX_NUM_MEASURED_UMTS_CARRIERS];
+ /* This flag is used to indicate whether measurement period should be reset
+ * immediately. (TRUE: meas is performed in the first DRX.
+ * FALSE: meas is performed in the first T-meas occasion)
+ * In current design, the following rules should be followed.
+ * (1)If number of ARFCN != 0, this flag will be set as FALSE only if tmeasure measurement
+ * is triggered when priority measurement is on-going (i.e., at least
+ * one of UMTS cells hits priority reselection criteria for priority
+ * based measurement reselection). For other case, this flag should
+ * be set as TRUE. If any improvement is needed, the usage limitation
+ * for this flag should be confirmed with UL1's colleague.
+ * (2) If number of ARFCN == 0, this flag will alwyas be set as FALSE;
+ */
+ kal_bool is_meas_period_reset;
+
+ /* When this flag is set to TRUE, the standby measurement will be performed every T-meas without */
+ /* multiplying by N layers. So that there will be 2 measurement results within 10s OOS period, which */
+ /* increases the successful rate of finding a candidate during OOS */
+ kal_bool prohibit_apply_n_layer;
+ meas_scale_factor_enum meas_scale_factor;
+ FDD_MOB_MEME_MEASUREMENT_STOP_CAUSE stop_cause;
+} eas_fdd_uas_config_ucell_meas_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 list_ref;
+ TDD_meas_UmtsCellList umts_cell_list;
+ //kal_int8 fdd_rscp_min_in_dbm; //TBC with LTE, FDD only
+ kal_uint16 first_meas_uarfcn; // invalid value = -1//TBD, for CSFB, whether report meas result per freq?
+ kal_bool is_detected_cell_meas[TDD_MAX_NUM_MEASURED_UMTS_CARRIERS];
+ kal_bool is_meas_period_reset;
+
+ /* When this flag is set to TRUE, the standby measurement will be performed every T-meas without */
+ /* multiplying by N layers. So that there will be 2 measurement results within 10s OOS period, which */
+ /* increases the successful rate of finding a candidate during OOS */
+ kal_bool prohibit_apply_n_layer;
+ meas_scale_factor_enum meas_scale_factor;
+} eas_tdd_uas_config_ucell_meas_req_struct;
+
+
+typedef struct {
+ LOCAL_PARA_HDR
+} eas_fdd_uas_config_ucell_prio_meas_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+} eas_fdd_uas_config_ucell_meas_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+} eas_tdd_uas_config_ucell_prio_meas_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+} eas_tdd_uas_config_ucell_meas_cnf_struct;
+
+typedef struct{
+ kal_bool is_lac_valid;
+ kal_uint16 lac;
+ kal_bool is_rac_valid;
+ kal_uint8 rac;
+} ucell_cgi_info_optional_struct;
+
+typedef struct{
+ cgi_info_status_enum cgi_info_status;
+ kal_uint32 cell_id;
+ kal_uint8 num_plmn_id_list;
+ plmn_id_struct plmn_id_list[6]; //MAX_NUM_PLMN_ID
+ csg_access_mode_enum ucell_type;
+ kal_uint32 csg_id;
+ ucell_cgi_info_optional_struct optional_field;
+} ucell_cgi_info_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ plmn_search_type_enum plmn_search_type;
+ auto_search_cmd_enum auto_search_cmd;
+ kal_uint8 num_carriers;
+ kal_uint16 csg_uarfcn[MAX_NUM_CSG_CARRIERS];
+} eas_uas_search_csg_ucell_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ search_status_enum search_status;
+ kal_uint8 num_carriers;
+ ts_3G_csg_ucell_evluation_result csg_ucell_evluation_result_list[MAX_NUM_CSG_CARRIERS];
+} eas_uas_search_csg_ucell_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ plmn_search_type_enum plmn_search_type;
+ auto_search_cmd_enum auto_search_cmd;
+ kal_uint8 num_carriers;
+ kal_uint16 csg_uarfcn[MAX_NUM_CSG_CARRIERS];
+} eas_uas_evaluate_csg_ucell_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ search_status_enum search_status;
+ kal_uint8 num_carriers;
+ ts_3G_csg_ucell_evluation_result csg_ucell_evluation_result_list[MAX_NUM_CSG_CARRIERS];
+} eas_uas_evaluate_csg_ucell_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ plmn_search_type_enum plmn_search_type;
+ auto_search_cmd_enum auto_search_cmd;
+ kal_uint8 num_freq;
+ EARFCN freq_list[MAX_NUM_CSG_FREQ];
+} uas_eas_search_csg_ecell_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ search_status_enum search_status;
+ kal_uint8 num_csg_freq_search_result;
+ csg_freq_search_result_struct csg_freq_search_result_list[MAX_NUM_CSG_FREQ];
+} uas_eas_search_csg_ecell_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ plmn_search_type_enum plmn_search_type;
+ auto_search_cmd_enum auto_search_cmd;
+ kal_uint8 num_freq;
+ EARFCN freq_list[MAX_NUM_CSG_FREQ];
+} uas_eas_evaluate_csg_ecell_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ search_status_enum search_status;
+ kal_uint8 num_csg_freq_search_result;
+ csg_freq_search_result_struct csg_freq_search_result_list[MAX_NUM_CSG_FREQ];
+} uas_eas_evaluate_csg_ecell_cnf_struct;
+
+/*3G4 CSG FINGERPRINT */
+typedef struct {
+ LOCAL_PARA_HDR
+ plmn_id_struct csg_plmn;
+ kal_uint32 csg_id;
+ kal_uint32 csg_cell_id;
+ EARFCN csg_frequency;
+ kal_uint16 csg_physical_cell_id;
+} uas_eas_build_fingerprint_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+} uas_eas_build_fingerprint_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+} uas_eas_abort_fingerprint_ind_struct;
+
+/*4G3 CSG FINGERPRINT */
+typedef uas_eas_build_fingerprint_req_struct eas_uas_build_fingerprint_req_struct;
+
+typedef uas_eas_build_fingerprint_cnf_struct eas_uas_build_fingerprint_cnf_struct;
+
+typedef uas_eas_abort_fingerprint_ind_struct eas_uas_abort_fingerprint_ind_struct;
+
+/*END OF CSG FINGERPRINT */
+
+typedef struct{
+ LOCAL_PARA_HDR
+ kal_uint8 tid;
+ report_cgi_req_type_enum report_cgi_req_type;
+ kal_uint16 uarfcn;
+ kal_uint16 physical_cell_id;
+} eas_uas_report_cgi_req_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ kal_uint8 tid;
+ kal_uint16 uarfcn;
+ kal_uint16 physical_cell_id;
+ ucell_cgi_info_struct ucell_cgi_info;
+} eas_uas_report_cgi_cnf_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ te_ir_cell_change_trigger ir_cell_change_trigger;
+ plmn_search_type_enum plmn_search_type;
+ te_umts_mode target_cell_mode;
+ ts_umts_target_cell_union target_cell;
+ eas_cell_info serv_cell;
+} eas_uas_evaluate_ucell_req_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ te_ir_cell_reselection_status ir_cell_eval_status;
+ ts_eval_activate_fail_handle Eval_activate_fail_handle;
+ eas_cell_info serv_cell;
+} eas_uas_evaluate_ucell_cnf_struct;
+
+typedef struct {
+ kal_uint16 phys_cell_id;
+ kal_uint16 BCCH_Container_size; // 0 ~ max_size
+ kal_uint8 *BCCH_container; /* note: remember to Free the memory here*/
+} ts_ir_utra_cell_info;
+
+typedef struct {
+ kal_uint16 uarfcn;
+ kal_uint8 cell_info_num;
+ ts_ir_utra_cell_info cell_info[MAX_NUM_CELL_INFO_UTRA];
+} ts_ir_utra_cell_info_list;
+
+typedef struct {
+ kal_uint8 numElements;
+ ts_ir_utra_cell_info_list element[MAX_NUM_REDIRECTION_FREQ_UTRA];
+} eas_uas_redirectInfo;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ te_ir_cell_change_trigger ir_cell_change_trigger;
+ plmn_search_type_enum plmn_search;
+ te_umts_mode target_cell_mode;
+ ts_umts_target_cell_union target_cell;
+ kal_uint16 ircco_time;
+ eas_uas_redirectInfo redirection;
+ ir_lte_scell_struct lte_scell_inf; /* cell info of the source LTE cell */
+} eas_uas_activate_ucell_req_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ te_ir_cell_reselection_status ir_cell_activation_status;
+ ts_eval_activate_fail_handle eval_activate_fail_handle;
+ te_ir_cell_change_fail_reason_enum ir_cell_change_failed_reason;
+} eas_uas_activate_ucell_cnf_struct;
+
+//#ifdef __LTE_R11__
+typedef struct {
+ kal_bool is_plmn_id_valid;
+ plmn_id_struct plmn_id;
+ kal_uint32 cell_id;
+ kal_uint16 uarfcn;
+ kal_uint16 psc;
+} ucell_info_before_ho_struct;
+//#endif
+
+/* For 3G4 IRHO */
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_limited_service;
+ plmn_search_type_enum plmn_search_type;
+//#ifdef __LTE_R11__
+ ucell_info_before_ho_struct ucell_info;
+//#endif
+} uas_eas_handover_ecell_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ /* No parameters here */
+} uas_eas_ho_activate_ecell_req_struct;
+
+/* For 3G4 IRCR or IR Redirection */
+typedef struct {
+ LOCAL_PARA_HDR
+ eas_target_cell_info target_cell;
+ plmn_search_type_enum plmn_search_type;
+ /*3G4 background search parameter*/
+ kal_bool is_background_search_trigger;
+ uas_cell_info serving_cell_info;
+} uas_eas_evaluate_ecell_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ /* No parameters here */
+} uas_eas_evaluate_ecell_stop_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ te_ir_cell_change_trigger trigger;
+ kal_uint32 wait_time;
+ eas_target_cell_info target_cell;
+ plmn_search_type_enum plmn_search_type;
+ kal_uint8 redirect_freq_num;
+ lte_redirect_info redirect_freq_info[MAX_UAS_EAS_REDIRECT_FREQ_NUM];
+ kal_uint32 remaining_time_afr;
+ kal_bool is_elevator_mode;
+ kal_bool is_custom_threshold_need;
+} uas_eas_activate_ecell_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ te_ir_handover_status ho_to_eas_status;
+ kal_uint8 nas_sec_param_to_eutra[NAS_SECURITY_PARAM_LEN];
+} uas_eas_handover_ecell_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ te_ir_handover_status ho_to_eas_status;
+} uas_eas_ho_activate_ecell_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ te_ir_cell_reselection_status eval_status;
+ ts_eval_activate_fail_handle eval_activate_fail_handle;
+} uas_eas_evaluate_ecell_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ /* No parameters here */
+} uas_eas_evaluate_ecell_stop_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ te_ir_cell_reselection_status active_status;
+ ts_eval_activate_fail_handle eval_activate_fail_handle;
+} uas_eas_activate_ecell_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ /* No parameters here */
+} uas_eas_abort_ho_ecell_req_struct;
+
+/* For 4G3 IRHO */
+typedef struct {
+ LOCAL_PARA_HDR
+ plmn_search_type_enum plmn_search_type;
+} eas_uas_handover_ucell_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ /* No parameters here */
+} eas_uas_ho_activate_ucell_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ /* No parameters here */
+} eas_uas_abort_ho_ucell_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ ho_from_lte_type_enum lte_ho_type;
+ te_ir_handover_status ir_ho_eval_status;
+ kal_uint16 uarfcn_DL;
+#ifdef __SRVCC_CELL_INFO__
+ kal_uint16 psc;
+#endif
+} eas_uas_handover_ucell_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ te_ir_handover_status ir_ho_activate_status;
+ #ifdef __SRVCC_CELL_INFO__
+ te_ir_handover_phy_fail_subcause ir_handover_to_umts_phy_fail_subcause;
+ #endif /*__SRVCC_CELL_INFO__*/
+} eas_uas_ho_activate_ucell_cnf_struct;
+
+/*3G4 background search*/
+typedef struct {
+ LOCAL_PARA_HDR
+ /* No parameters here */
+} uas_eas_background_search_start_req_struct;
+
+/*3G4 background search*/
+typedef struct {
+ LOCAL_PARA_HDR
+ /* No parameters here */
+} uas_eas_background_search_start_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ /* No parameters here */
+} uas_eas_background_search_stop_req_struct;
+
+/* __4G_BACKGROUND_SEARCH__ */
+typedef struct {
+ LOCAL_PARA_HDR
+ /* LTE detected cell info */
+ EARFCN earfcn;
+ kal_uint16 pci;
+} eas_uas_background_search_found_ind_struct;
+
+/* HSR_SNIFF_SEARCH */
+typedef struct {
+ LOCAL_PARA_HDR
+ /* LTE detected cell info */
+ EARFCN earfcn;
+ kal_uint16 pci;
+} eas_uas_hsr_cell_found_ind_struct;
+
+#endif /* UAS_EAS_STRUCT_H */
diff --git a/mcu/protocol/interface/general/uas_export_api.h b/mcu/protocol/interface/general/uas_export_api.h
new file mode 100644
index 0000000..cef8406
--- /dev/null
+++ b/mcu/protocol/interface/general/uas_export_api.h
@@ -0,0 +1,319 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * uas_export_api.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ *
+ *
+ * ==========================================================================
+ * $Log:$
+ *
+ * 09 28 2018 pawan.singh
+ * [MOLY00353395] [MT6297] Modify code for MPD.
+ *
+ * 04 26 2017 mengmeng.sun
+ * [MOLY00244013] [Gen93][TDD 3G] RATDM Code SMP
+ * TL2D part
+ *
+ * 04 12 2017 chi-chung.lin
+ * [MOLY00240270] [6293][Gemini][T+W] Phase 1: Common Interface Changes Check in
+ *
+ * .
+ *
+ * 04 12 2017 chi-chung.lin
+ * [MOLY00240270] [6293][Gemini][T+W] Phase 1: Common Interface Changes Check in
+ *
+ * .
+ *
+ * 01 12 2016 charlescm.wu
+ * [MOLY00156239] [UMOLY][LR11] 3G FDD/TDD L2 big size memory union
+ * [FDD|TDD common] UBin 3G L2 memory reduction by union
+ *
+ * 05 20 2015 jen-de.lai
+ * [MOLY00089131] [MT6291 Gemini] L+W+W+W code revision check in
+ * L+W
+ *
+ * 05 20 2015 tereasa.huang
+ * [MOLY00089131] [MT6291 Gemini] L+W+W+W code revision check in
+ * [RRCE]L+W+W+W development.
+ *
+ * 04 16 2015 head.hsu
+ * [MOLY00087434] [Universal Bin] Check in
+ * ;[UBIN][Phase 2] RATDM and CSR
+ *
+ * 01 20 2015 tc.chang
+ * [MOLY00087434] [Universal Bin] Check in.
+ *
+ * 12 30 2014 tc.chang
+ * [MOLY00087434] [Universal Bin] Check in.
+ *
+ * 12 30 2014 charlescm.wu
+ * [MOLY00087679] [UMOLY][FDD][UAS COMMON][UL2 COMMON/URLC/BMC/SEQ]U-Bin CBr to UMOLY TRUNCK.
+ *
+ * 12 29 2014 tc.chang
+ * [MOLY00087434] [Universal Bin] Check in.
+ *
+ * 12 24 2014 tc.chang
+ * [MOLY00087434] [Universal Bin] Check in.
+ *
+ * 12 16 2014 tc.chang
+ * [MOLY00087434] [Universal Bin] Check in.
+ *
+ * 12 15 2014 charlescm.wu
+ * [MOLY00087679] [UMOLY][FDD][UAS COMMON][UL2 COMMON/URLC/BMC/SEQ]U-Bin CBr to UMOLY TRUNCK.
+ *
+ * 12 12 2014 tc.chang
+ * [MOLY00087434] [Universal Bin] Check in.
+ * PDCP and CSR exported APIs.
+ *
+ * 11 13 2013 ethan.han
+ * [MOLY00046258] [LGE smart phone project] 2G protocol release package survey, handle the dependancy for MM
+ * .
+ *
+ * 11 13 2013 derek.cho
+ * [MOLY00046228] [SHAQ]Uas related header split
+ * <saved by Perforce>
+ *
+ * 11 05 2013 johnson.liu
+ * [MOLY00042658] [SHAQ] UAS related header split
+ * .
+ *
+ * 11 05 2013 andrew.wu
+ * [MOLY00042658] [SHAQ] UAS related header split
+ * <saved by Perforce>
+ *
+ * 10 02 2012 ij.liao
+ * [MOLY00004236] [interface][service][kal]remove stack_ltlcom.h
+ *
+ * 05 23 2012 ij.liao
+ * removed!
+ * .
+ *
+ * 04 17 2012 yiting.cheng
+ * removed!
+ * .
+ *
+ * 04 16 2012 yiting.cheng
+ * removed!
+ * .
+ *
+ * 04 11 2012 yiting.cheng
+ * removed!
+ * .
+ *
+ * 11 08 2011 yuting.chen
+ * removed!
+ * .
+ *
+ * 10 15 2011 mengsung.wu
+ * removed!
+ * .
+ *
+ * 09 27 2011 yuting.chen
+ * removed!
+ * .
+ *
+ * Add copyright header.
+ ****************************************************************************/
+
+#ifndef _UAS_EXPORT_API_H
+#define _UAS_EXPORT_API_H
+
+#include "kal_general_types.h"
+#include "kal_public_api.h"
+#include "kal_public_defs.h"
+
+#include "uas_common_enums.h"
+#include "ratdm_shaq_api.h"
+
+#include "l1audio.h"
+
+#include "gmss_public.h"
+#include "csr_export_api.h"
+
+
+#if defined(__SYNC_HDLC_CSD__)
+#include "ratcm_csd_interface.h"
+#endif
+
+#include "sim_exported_enum.h" //[LG+WG] protocol_id_enum
+
+#ifdef __UMTS_FDD_MODE__
+
+/* For Gemini T+W feature, PDU in RRC IDLE state will use this pool, */
+#define FDD_UAS_DL_IDLE_ADM_ALLOC(mem_ptr, alloc_size) \
+do{ \
+ mem_ptr = FDD_UAS_DL_ADM_ALLOC_int(UAS_DL_IDLE_ADM, alloc_size, __FILE__, __LINE__); \
+}while(0)
+
+/* for DL ADM pool, the users shall be in the same task! */
+#define FDD_UAS_DL_ADM_ALLOC(mem_ptr, alloc_size) \
+do{ \
+ mem_ptr = FDD_UAS_DL_ADM_ALLOC_int(UAS_DL_ADM, alloc_size, __FILE__, __LINE__); \
+}while(0)
+
+#define FDD_UAS_DL_ADM_FREE(mem_ptr) FDD_UAS_DL_ADM_FREE_int(UAS_DL_ADM, mem_ptr, __FILE__, __LINE__)
+
+
+
+/* For 2G RLC DL block first half memory use */
+#define GRLC_DL_ADM_ALLOC_FIRST_PART(mem_ptr, alloc_size) \
+do{ \
+ mem_ptr = FDD_UAS_DL_ADM_ALLOC_int(GRLC_DL_ADM_FIRST_PART, alloc_size, __FILE__, __LINE__); \
+}while(0)
+
+#define GRLC_DL_ADM_FREE_FIRST_PART(mem_ptr) FDD_UAS_DL_ADM_FREE_int(GRLC_DL_ADM_FIRST_PART, mem_ptr, __FILE__, __LINE__)
+
+
+/* For 2G RLC DL block second half memory use */
+#define GRLC_DL_ADM_ALLOC_SECOND_PART(mem_ptr, alloc_size) \
+do{ \
+ mem_ptr = FDD_UAS_DL_ADM_ALLOC_int(GRLC_DL_ADM_SECOND_PART, alloc_size, __FILE__, __LINE__); \
+}while(0)
+
+#define GRLC_DL_ADM_FREE_SECOND_PART(mem_ptr) FDD_UAS_DL_ADM_FREE_int(GRLC_DL_ADM_SECOND_PART, mem_ptr, __FILE__, __LINE__)
+
+
+extern void* FDD_UAS_DL_ADM_ALLOC_int(uas_dl_adm_index_enum alloc_idx, kal_uint32 alloc_size, char* filename, kal_uint32 line);
+extern void FDD_UAS_DL_ADM_FREE_int(uas_dl_adm_index_enum free_idx, void* mem_ptr, char* filename, kal_uint32 line);
+#endif /* __UMTS_FDD_MODE__ */
+
+#if defined(__RATDM_UL_SHAQ__) || defined(__UMTS_TDD128_MODE__)
+extern kal_bool urlc_realtime_shaq_query_if_need_kick_urlc(ExtendedRbId RbId, SHAQ_LLQUEUE_IDX packet_type, UAS_CURRENT_CNTX_PTR_enum curr_idx);
+#endif /* defined(__RATDM_UL_SHAQ__) || defined(__UMTS_TDD128_MODE__) */
+
+#ifdef __RATDM_UL_SHAQ__
+extern kal_bool PdcpCheckShaqStatus(kal_uint8 nsapi, ExtendedRbId *RbId, kal_uint16 npdu_num, UAS_CURRENT_CNTX_PTR_enum SimIdx);
+extern void PdcpUpdateSendSN(ExtendedRbId RbId, kal_uint16 npdu_num, UAS_CURRENT_CNTX_PTR_enum SimIdx);
+extern kal_bool mMacIsTickAvailable(UAS_CURRENT_CNTX_PTR_enum sim_idx);
+#endif /* __RATDM_UL_SHAQ__ */
+
+#if defined(__SYNC_HDLC_CSD__)
+extern void ratcm_csr_activate_req(CSD_MODE_ENUM csd_mode,CSD_USER_RATE_ENUM user_rate, UAS_CURRENT_CNTX_PTR_enum sim_idx);
+extern void ratcm_csr_deactivate_req(UAS_CURRENT_CNTX_PTR_enum sim_idx);
+extern void ratcm_csr_csd_put_uplinkdata(kal_uint8 *data, kal_uint16 length, CSD_V24_STATUS_STRUCT csd_v24status, UAS_CURRENT_CNTX_PTR_enum sim_idx);
+extern kal_uint16 ratcm_csr_csd_get_downlinkdata(kal_uint16 sduLength, kal_uint8 *data, CSD_V24_STATUS_STRUCT *csd_v24status, UAS_CURRENT_CNTX_PTR_enum sim_idx);
+#endif /* defined(__SYNC_HDLC_CSD__) || defined(__CSD_NT__) */
+
+extern void UAS_CSR_SP3G_Callback(SP3G_Event event, void *data, UAS_CURRENT_CNTX_PTR_enum sim_idx);
+
+
+/****************************************************************************
+ * RRCE Call Back Function (Provide to NAS/L4):
+ *
+ * - Assign UAS index :
+ * protocol_id_enum protocol_id ( mcu\common\interface\modem\sim\sim_exported_enum.h)
+ *
+ * - Function list :
+ * 1. FDD_RRC_CPCSupport : Return TRUE if UE supports CPC.
+ * 2. FDD_RRC_NW_R8_FD_Support : Return TRUE if NW supports T323.
+ * 3. FDD_RRC_IsConnectedState : Return TRUE if RRC is connected state.
+ * 4. FDD_RRCE_Is_Capability_Enable : Return TRUE if the query capability bit is ON.
+ *****************************************************************************/
+
+#if defined(__FAST_DORMANCY__) || defined(__NO_PSDATA_SEND_SCRI__)
+/****************************************************************************
+ * Function: FDD_RRC_CPCSupport
+ *
+ * Description: Return TRUE if UE supports CPC.
+ *****************************************************************************/
+extern kal_bool FDD_RRC_CPCSupport(protocol_id_enum protocol_id);
+
+#ifdef __FAST_DORMANCY__
+/****************************************************************************
+ * Function: FDD_RRC_NW_R8_FD_Support
+ *
+ * Description: Return TRUE if NW supports T323.
+ *****************************************************************************/
+extern kal_bool FDD_RRC_NW_R8_FD_Support(protocol_id_enum protocol_id);
+#endif /* __FAST_DORMANCY__ */
+#endif /* __FAST_DORMANCY__ || __NO_PSDATA_SEND_SCRI__ */
+
+#if defined(__LTE_RAT__) || defined(__PPACR_SUPPORT__)
+/****************************************************************************
+* Function: FDD_RRC_IsConnectedState
+*
+* Description: Called by NAS to check if currently RRCE is in connected state.
+* If the RRC Connection Release procedure is ongoing, this function will
+* return KAL_FALSE
+*****************************************************************************/
+extern kal_bool FDD_RRC_IsConnectedState(protocol_id_enum protocol_id);
+#endif
+
+/****************************************************************************
+ * Function: FDD_RRCE_Is_Capability_Enable
+ *
+ * Description: Return TRUE if the query capability bit is ON.
+ *****************************************************************************/
+#define ENABLE_MT_NO_RESTRICT 0x01 /* [ALPS00289798][Softbank IOT][RAN-13-01-04] Allow MT call while all AC blocked. */
+extern kal_bool FDD_RRCE_Is_Capability_Enable(kal_uint8 capability_bit, protocol_id_enum protocol_id);
+
+// TDD RRCE Function
+extern kal_bool TDD_RRC_CPCSupport();
+extern kal_bool TDD_RRC_NW_R8_FD_Support();
+
+/*****************************************************************************/
+
+/****************************************************************************
+ * Function: FDD_uas_adm_deinit
+ *
+ * Description: UL2 UBIN FDD/TDD memory union together. When FDD mode switch
+ * to TDD, this function will be invoked.
+ *****************************************************************************/
+extern void FDD_uas_adm_deinit(void);
+
+/****************************************************************************
+ * Function: TDD_uas_adm_deinit
+ *
+ * Description: UL2 UBIN FDD/TDD memory union together. When TDD mode switch
+ * to FDD, this function will be invoked.
+ *****************************************************************************/
+extern void TDD_uas_adm_deinit(void);
+
+#endif /* _UAS_EXPORT_API_H */
+
diff --git a/mcu/protocol/interface/general/uas_gas_enums.h b/mcu/protocol/interface/general/uas_gas_enums.h
new file mode 100644
index 0000000..631853e
--- /dev/null
+++ b/mcu/protocol/interface/general/uas_gas_enums.h
@@ -0,0 +1,280 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * uas_gas_enums.h
+ *
+ * Project:
+ * --------
+ * MONZA
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ----------------------------------------------------------------------------
+ * $Log:$
+ *
+ * 03 31 2021 ot_shubham-sk.kumar
+ * [MOLY00605927] modem EE INVALID
+ *
+ * <saved by Perforce>
+ *
+ * 10 26 2017 nalin.chovatia
+ * [MOLY00284483] [CODE SYNC] 2G -3G??? ?????
+ * .umola
+ *
+ * 11 14 2014 yenchih.yang
+ * [MOLY00084256] [MEME] sync MT6291 to UMOLY
+ * URR/MEME.
+ *
+ * 11 12 2014 tsung-wei.tu
+ * [MOLY00080211] [MT6291_DEV][MT6291_UESIM_DEV] Check in low power to MT6291_DEV, MT6291_UESIM_DEV
+ * Merging GISE low power to UMOLY trunk
+ *
+ * 07 03 2013 ming.lee
+ * [MOLY00026501] [GAS_UAS] Cipher status mismatch error handling
+ * .
+ *
+ * 06 25 2013 henry.lai
+ * [MOLY00027253] [MT6290] Bug fix for GAS multi-mode development
+ * .
+ *
+ * 03 13 2013 c-hua.yang
+ * [MOLY00009184] [URR] Multimode Merge to MOLY
+ * .
+ *
+ * 01 22 2013 c-hua.yang
+ * [MOLY00009184] [URR] Multimode Merge to MOLY
+ * .
+ *
+ * 01 11 2013 henry.lai
+ * [Henry][Multi-Mode Development] GAS Development and R8 CR Sync
+ *
+ * 09 09 2012 yong.su
+ * [MOLY00003321] [3G TDD][RRCE][InterRAT]modified code for MAX_TARGET_GSM_CELLS_NUM
+ * .
+ *
+ * 08 14 2012 peter.chien
+ * [MOLY00002118] [PS1][GAS] Internal inject message test for MEAS IT
+ * .
+ *
+ * 08 14 2012 peter.chien
+ * [MOLY00002118] [PS1][GAS] Internal inject message test for MEAS IT
+ * .
+ *
+ * 08 14 2012 peter.chien
+ * [MOLY00002118] [PS1][GAS] Internal inject message test for MEAS IT
+ * .
+ *
+ * 05 25 2012 haizhou.liu
+ * removed!
+ * .
+ *
+ * 05 17 2012 c-hua.yang
+ * removed!
+ * .
+ *
+ * 05 02 2012 adeline.chang
+ * removed!
+ * .
+ *
+ * 01 11 2012 shunwen.hsiao
+ * removed!
+ * Check in TK6280_DVT_DEV to MT6280_DVT_DEV
+ *
+ * 11 08 2011 junzhen.qin
+ * removed!
+ * .
+ *
+ * 10 28 2010 adeline.chang
+ * removed!
+ * .
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ * Supported 3rd criteria for InterRAT cell reselection to UTRAN.
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ * Add copyright header.
+ ******************************************************************************/
+
+#ifndef _UAS_GAS_ENUMS_H
+#define _UAS_GAS_ENUMS_H
+
+#include "irat_common_enums.h"
+#include "uas_gas_inter_core_enum.h"
+
+/* MACROS ******************************************************************/
+/* MAX Values */
+#define MAX_LEN_HO_TO_GSM_MSG (251) /* Octets */
+#define MAX_LEN_TLV_CLASSMARK_2 (5) /* Octets */
+#define MAX_LEN_V_CLASSMARK_3 (32) /* Octets */
+#define MAX_LEN_HO_TO_UTRAN_MSG (251) /* Octets */
+#define MAX_LEN_UTRAN_HANDOVER_INFO_MSG (251) /* Octets*/
+#define MAX_LEN_UTRAN_HANDOVER_INFO_EUTRAN_MSG (350) /* Octets*/
+#define MAX_NUM_MEASURED_UMTS_FDD_CELL 64
+
+
+#define UAS_GAS_INVALID_UARFCN (0xffff)
+
+#if defined(__UMTS_TDD128_MODE__)
+#define MAX_NUM_MEASURED_UMTS_TDD_CELL (64)
+#endif //defined(__UMTS_TDD128_MODE__)
+
+/*Other constants*/
+#define INTER_RRC_GSM_CIPHERING_KEY_LENGTH 8
+#define INTER_RRC_UMTS_CIPHERING_KEY_LENGTH 16
+#define INTER_RRC_UMTS_INTEGRITY_KEY_LENGTH 16
+#define TEMP_FAILURE_PENALTY_TIME 30 /*Haizhou 20100819 Time penalty for convert temp failure to initial_value after resel to ucell fai*/
+
+#define INTER_RRC_LEN_PLMN_IDENTITY 3
+
+/* MAX/MIN values */
+#define MAX_UARFCN_RSSI_VAL (-100)
+#define MIN_UARFCN_RSSI_VAL (-480)
+#define MAX_UCELL_RSCP_VAL (-100)
+#define MIN_UCELL_RSCP_VAL (-480)
+#define MAX_UCELL_EC_NO_VAL 0
+#define MIN_UCELL_EC_NO_VAL (-100)
+
+#define MAX_UMTS_UARFCN 16383
+#define MIN_UMTS_UARFCN 0
+#if 0
+/* under construction !*/
+/* under construction !*/
+#endif
+#define INVALID_NC_MODE (0xFF)
+
+
+
+#ifdef __PREFER_HIGH_PRIO_3G_IN_23G_MODE__
+#define INTER_DEFAULT_RSCP_THRESHOLD_PRIO (21) /* -95 dBm */
+#endif /* __PREFER_HIGH_PRIO_3G_IN_23G_MODE__ */
+
+/* TYPES DEFINITIONS ********************************************************/
+
+typedef enum
+{
+ UMTS_SIGNALLING_KEYS_FOR_CS_DOMAIN,
+ UMTS_SIGNALLING_KEYS_FOR_PS_DOMAIN
+}te_umts_signalling_connection_keys;
+
+typedef enum {
+ L1_AVAILIBILITY_STATUS_VACANT, /* During Cell selection*/
+ L1_AVAILIBILITY_STATUS_SHARED, /* IDLE camped,URA_PCH,CELL_PCH */
+ L1_AVAILIBILITY_STATUS_OCCUPIED /* PTM,DEDICATED,CELL_FACH,CELL_DCH*/
+}te_l1_availibility_status;
+
+typedef enum {
+ IR_CELL_CHANGE_COMPLETE_SUCCESS,
+ IR_CELL_CHANGE_COMPLETE_FAIL,
+ IR_CELL_CHANGE_COMPLETE_FAIL_BY_NAS_COMMAND
+}te_ir_cell_change_complete_status;
+
+typedef enum {
+ IR_CELL_RESELECTION_TYPE_NORMAL,
+ IR_CELL_RESELECTION_TYPE_LIMITED_SERVICE
+}te_ir_cell_reselection_type;
+
+#if 0 //__UMTS_TDD128_MODE__
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif //__UMTS_TDD128_MODE__
+
+#endif /* UAS_GAS_ENUMS_H */
diff --git a/mcu/protocol/interface/general/uas_gas_struct.h b/mcu/protocol/interface/general/uas_gas_struct.h
new file mode 100644
index 0000000..bfd49d0
--- /dev/null
+++ b/mcu/protocol/interface/general/uas_gas_struct.h
@@ -0,0 +1,792 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * uas_gas_struct.h
+ *
+ * Project:
+ * --------
+ * MONZA
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log:$
+ *
+ * 10 24 2016 abhinav.agarwal
+ * [MOLY00209200] [Feature Request] [UMOLYA] CS Support during 3G call connection
+ * .
+ *
+ * 10 21 2016 richa.gupta
+ * [MOLY00208335] [MT6293] [B66] GAS code porting (interface part)
+ * .
+ *
+ * 02 26 2016 srihari.maddipati
+ * [MOLY00162461] ¦bAndroid???Modem??Logªº»Ý¨D
+ * .
+ *
+ * 09 02 2015 bruce.li
+ * [MOLY00125291] 23G PingPong Reselection Restrain - GAS
+ * .
+ *
+ * 07 08 2015 ming.lee
+ * [MOLY00087470] [Universal Bin] FDD GAS developement
+ * 3G CSG remove SAP option.
+ *
+ * 01 07 2015 yenchih.yang
+ * [MOLY00084256] [MEME] sync MT6291 to UMOLY
+ * Fix build error.
+ *
+ * 12 19 2014 birui.li
+ * [MOLY00087677] [U3G][TDD][UAS RRCE] modifications for U3G
+ * merge.
+ *
+ * 12 16 2014 claud.li
+ * [MOLY00087795] [MEME] universal bin check in
+ * [Universal bin][FDD][MEME/EAS/GAS] interface
+ *
+ * 12 15 2014 henry.lai
+ * [MOLY00087668] [MT6291][UBIN] Check in ERRC/CEL modifications
+ * .
+ *
+ * 11 14 2014 yenchih.yang
+ * [MOLY00084256] [MEME] sync MT6291 to UMOLY
+ * URR/MEME.
+ *
+ * 11 05 2014 ming.lee
+ * [MOLY00081154] [ATT_TMO_DEV] AT&T requirement merge back
+ * CSG fingerprint GAS part.
+ *
+ * 01 21 2014 wcpuser_integrator
+ * [MOLY00054475] SGLTE option rename
+ * .
+ *
+ * 11 13 2013 bo.wu
+ * [MOLY00046027] [MT6290E1][MMDS_DC] MMDC feature patch back to MOLY trunk
+ * .
+ *
+ * 07 24 2013 rujing.zhao
+ * [MOLY00031020] [MMDS_DC] Merge MMDC interface to MOLY
+ * .2->34G NBR transfer
+ *
+ * 07 23 2013 rujing.zhao
+ * [MOLY00023935] [MT6290E1][W/G][Target IT] Meas result is received so frequently when priority measurement and drx measurement are on-going
+ * .
+ *
+ * 07 23 2013 dongqing.qi
+ * [MOLY00023935] [MT6290E1][W/G][Target IT] Meas result is received so frequently when priority measurement and drx measurement are on-going
+ * .
+ *
+ * 07 23 2013 henry.lai
+ * [MOLY00023935] [MT6290E1][W/G][Target IT] Meas result is received so frequently when priority measurement and drx measurement are on-going
+ * .
+ *
+ * 07 03 2013 ming.lee
+ * [MOLY00026501] [GAS_UAS] Cipher status mismatch error handling
+ * .
+ *
+ * 05 09 2013 henry.lai
+ * [MOLY00009222] [GAS][Multi-Mode Development] Merge GAS multi-mode development to MOLY
+ * .
+ *
+ * 03 13 2013 c-hua.yang
+ * [MOLY00009184] [URR] Multimode Merge to MOLY
+ * .
+ *
+ * 01 22 2013 c-hua.yang
+ * [MOLY00009184] [URR] Multimode Merge to MOLY
+ * .
+ *
+ * 01 11 2013 henry.lai
+ * [Henry][Multi-Mode Development] GAS Development and R8 CR Sync
+ *
+ * 10 25 2012 ming.lee
+ * [MOLY00004236] [interface][service][kal]remove stack_ltlcom.h
+ * .
+ *
+ * 09 27 2012 yong.su
+ * [MOLY00004236] [interface][service][kal]remove stack_ltlcom.h
+ * <saved by Perforce>
+ *
+ * 09 26 2012 ye.yuan
+ * [MOLY00004173] [3G TDD][CISE]R9 code merge back to MOLY
+ * CSCE CODE Interface part .
+ *
+ * 06 29 2012 henry.lai
+ * [MOLY00000128] [MT6280][GAS] SI2Q/MEAS/RESEL improvement check-in
+ * .
+ *
+ * 05 25 2012 haizhou.liu
+ * removed!
+ * .
+ *
+ * 05 25 2012 yong.su
+ * removed!
+ * .
+ *
+ * 05 17 2012 peter.chien
+ * removed!
+ * .
+ *
+ * 05 02 2012 adeline.chang
+ * removed!
+ * .
+ *
+ * 01 11 2012 shunwen.hsiao
+ * removed!
+ * Check in TK6280_DVT_DEV to MT6280_DVT_DEV
+ *
+ * 01 06 2012 chi-chung.lin
+ * removed!
+ * .
+ *
+ * 11 14 2011 zengyu.hao
+ * removed!
+ * merge interface: uas_gas_struct.h
+ *
+ * 11 11 2011 evelyn.wang
+ * removed!
+ * .
+ *
+ * 11 09 2011 ryan.ou
+ * removed!
+ * .
+ *
+ * 12 17 2010 shunwen.hsiao
+ * removed!
+ * .
+ *
+ * 10 28 2010 maruco.tu
+ * removed!
+ * .
+ *
+ * 08 04 2010 william.chang
+ * removed!
+ * .
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ * Supported 3rd criteria for InterRAT cell reselection to UTRAN.
+ *
+ * removed!
+ * removed!
+ *
+ *
+ * removed!
+ * removed!
+ * Add copyright header.
+ ****************************************************************************/
+
+#ifndef _UAS_GAS_STRUCT_H
+#define _UAS_GAS_STRUCT_H
+
+#include "uas_gas_enums.h"
+#include "kal_general_types.h"
+#include "kal_public_api.h"
+#include "csi_umts_asn.h"
+#include "l3_inc_enums.h"
+#include "mcd_l3_inc_struct.h"
+#include "csi_gsm_asn.h"
+#include "irat_common_enums.h"
+#include "irat_common_struct.h"
+#include "uas_gas_inter_core_struct.h"
+#include "as_inter_core_enum.h"
+
+#ifdef __CMCC_STD_FR__
+#define MAX_CELL_NUM 27
+#endif
+
+//Common structure
+
+typedef struct {
+ kal_uint8 t3212_timer_val;
+ kal_bool att_flag;
+} ts_cs_specific_cn_info;
+
+
+//Dual mode MEME SAP start
+/*
+typedef struct
+{
+ LOCAL_PARA_HDR
+}uas_gas_config_gcell_meas_cnf_struct;*/
+
+/*
+typedef struct
+{
+ LOCAL_PARA_HDR
+ ts_ir_gsm_cell_rssi_info gsm_cell_rssi_info;
+}uas_gas_gcell_meas_ind_struct;*/
+
+/*
+typedef struct
+{
+ LOCAL_PARA_HDR
+ ts_ir_gsm_cell_bsic_info gsm_cell_bsic_info;
+}uas_gas_gcell_bsic_ind_struct;*/
+
+/*
+typedef struct {
+ LOCAL_PARA_HDR
+ ts_ir_umts_cell_list ir_umts_cell_list;
+}gas_uas_config_ucell_meas_req_struct;*/
+//Dual mode MEME SAP end
+
+typedef struct
+{
+ kal_uint32 cell_change_timeout;
+ /* MH: Added for informing GAS the CCO activation time (20070511) */
+ kal_uint32 cell_change_activation_time;
+ kal_uint32 wait_time;
+} IR3G2TimerStruct;
+
+typedef struct
+{
+ kal_uint8 numElements;
+ GSM_TargetCellInfo element[MAX_TARGET_GSM_CELLS_NUM]; /* Only the first numElements are valid */
+} GSM_TargetCellInfoList;
+
+//From GAS to UAS
+typedef struct
+{
+ LOCAL_PARA_HDR
+}uas_gas_config_gcell_meas_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 list_ref;
+ FDD_meas_UmtsCellList umts_cell_list;
+#if defined(__GERAN_R5__) && defined(__UMTS_R5__)
+ kal_int8 fdd_rscp_min_in_dbm;
+#endif /* defined(__GERAN_R5__) && defined(__UMTS_R5__)*/
+ kal_uint16 first_meas_uarfcn; // invalid value = UAS_GAS_INVALID_UARFCN
+ kal_bool is_detected_cell_meas[FDD_MAX_NUM_MEASURED_UMTS_CARRIERS];
+ /* This flag is used to indicate whether measurement period should be reset
+ * immediately. (TRUE: meas is performed in the first DRX.
+ * FALSE: meas is performed in the first T-meas occasion)
+ * In current design, the following rules should be followed.
+ * (1)If number of ARFCN != 0, this flag will be set as FALSE only if tmeasure measurement
+ * is triggered when priority measurement is on-going (i.e., at
+ * least one of UMTS cells hits priority reselection criteria for priority
+ * based measurement reselection). For other case, this flag should
+ * be set as TRUE. If any improvement is needed, the usage limitation
+ * for this flag should be confirmed with UL1's colleague.
+ * (2) If number of ARFCN == 0, this flag will alwyas be set as FALSE;
+ */
+ kal_bool is_meas_period_reset;
+}fdd_gas_uas_config_ucell_meas_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 list_ref;
+ TDD_meas_UmtsCellList umts_cell_list;
+ kal_uint16 first_meas_uarfcn; //in tdd, it is unused, invalid value = UAS_GAS_INVALID_UARFCN
+ kal_bool is_detected_cell_meas[TDD_MAX_NUM_MEASURED_UMTS_CARRIERS];
+ /* This flag is used to indicate whether measurement period should be reset
+ * immediately. (TRUE: meas is performed in the first DRX.
+ * FALSE: meas is performed in the first T-meas occasion)
+ * In current design, the following rules should be followed.
+ * (1)If number of ARFCN != 0, this flag will be set as FALSE only if tmeasure measurement
+ * is triggered when priority measurement is on-going (i.e., at
+ * least one of UMTS cells hits priority reselection criteria for priority
+ * based measurement reselection). For other case, this flag should
+ * be set as TRUE. If any improvement is needed, the usage limitation
+ * for this flag should be confirmed with UL1's colleague.
+ * (2) If number of ARFCN == 0, this flag will alwyas be set as FALSE;
+ */
+ kal_bool is_meas_period_reset;
+}tdd_gas_uas_config_ucell_meas_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ te_l1_availibility_status l1_availibility_status;
+}gas_uas_lower_layer_availability_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ te_ir_handover_status ir_handover_to_gsm_status;
+}uas_gas_ho_activate_gcell_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ te_ir_handover_status ir_handover_to_gsm_status;
+}uas_gas_handover_gcell_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ ts_ciphering_info ciphering_info;
+ plmn_search_type_enum plmn_search_type;
+}gas_uas_handover_ucell_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ lai_struct lai;
+ ts_cs_specific_cn_info gas_cs_cn_info;
+ /* __ALPS02506878_SUPPORT__ */
+ te_ir_call_type call_type;
+}gas_uas_ho_activate_ucell_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ te_ir_cell_reselection_status ir_cell_eval_status;
+ ts_eval_activate_fail_handle eval_activate_fail_handle;
+}uas_gas_evaluate_gcell_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ te_ir_cell_reselection_status ir_cell_activation_status;
+ ts_eval_activate_fail_handle eval_activate_fail_handle;
+ te_ir_cell_change_fail_reason_enum ir_cell_change_failed_reason;
+}uas_gas_activate_gcell_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+}uas_gas_evaluate_gcell_stop_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ te_ir_cell_change_complete_status ir_cell_change_complete_status;
+ /*Byron: 2007/05/08: Add for real CCO fail cause*/
+ te_ir_cell_change_fail_reason_enum ir_cell_change_failed_reason;
+}uas_gas_gcell_change_complete_ind_struct;
+
+#ifdef __CMCC_STD_FR__
+typedef struct{
+ U16 cellId;
+ CsiUarfcn uarfcn;
+}CellPara;
+typedef struct{
+ LOCAL_PARA_HDR
+ U8 numElements;
+ CellPara elements[MAX_CELL_NUM];
+}std_fr_cell_list;
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 frThreshold;
+ kal_uint8 numElements;
+ CsiUarfcn element[9];
+}gas_uas_std_fr_info_ind_struct;
+#endif
+
+#ifdef __CMCC_23G_PINGPONG_RESTRAIN__
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool is_2G_start_resel_restrain;
+} gas_uas_resel_restrain_status_ind;
+#endif
+
+
+/* for R6 redirection feature */
+#if (defined(__GERAN_R6__) || defined(__CMCC_FR__) || defined(__CMCC_STD_FR__))
+
+/* Request to evaluate a cell
+ because of inter RAT cell reselection or network ordered cell change */
+typedef struct {
+ LOCAL_PARA_HDR
+ /* te_ir_cell_reselection_type ir_cell_reselection_type; depreted */
+ te_ir_cell_change_trigger ir_cell_change_trigger;
+ kal_bool notToCheck3rdCriterion; /* KAL_FALSE: check 3rd Criterion
+ KAL_TRUE: don't check, i.e., if IRCR candidate is from APBCR/CSG, 3rd criterion will not be checked */
+ plmn_search_type_enum plmn_search_type;
+ te_umts_mode target_cell_mode;
+ ts_umts_target_cell_union target_cell;
+} gas_uas_evaluate_ucell_req_struct;
+
+/* Request to activate a cell without an evaluation phase */
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint32 cell_change_timeout; /* value in milli seconds or zero when not required */
+ /* te_ir_cell_reselection_type ir_cell_reselection_type; depreted */
+ te_ir_cell_change_trigger ir_cell_change_trigger;
+ kal_bool notToCheck3rdCriterion; /* KAL_FALSE: check 3rd Criterion
+ KAL_TRUE: don't check, i.e., if IRCR candidate is from APBCR/CSG, 3rd criterion will not be checked */
+ plmn_search_type_enum plmn_search_type;
+ te_umts_mode target_cell_mode;
+ ts_umts_target_cell_union target_cell; /* For IR_CELL_CHANGE_ORDER */
+#if (defined(__GERAN_R6__) || defined(__CMCC_FR__))
+ CsiUmtsCellList redirection_list; /* For IR_REDIRECTION */
+#endif
+#ifdef __CMCC_STD_FR__
+ std_fr_cell_list std_fr_cell_list;
+#endif
+} gas_uas_activate_ucell_req_struct;
+
+#else
+
+/* Request to evaluate a cell
+ because of inter RAT cell reselection or network ordered cell change */
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint16 cell_change_timeout; /* value in seconds or zero when not required */
+ /* te_ir_cell_reselection_type ir_cell_reselection_type; depreted */
+ te_ir_cell_change_trigger ir_cell_change_trigger;
+ kal_bool notToCheck3rdCriterion; /* KAL_FALSE: check 3rd Criterion
+ KAL_TRUE: don't check, i.e., if IRCR candidate is from APBCR/CSG, 3rd criterion will not be checked */
+ plmn_search_type_enum plmn_search_type;
+ te_umts_mode target_cell_mode;
+ ts_umts_target_cell_union target_cell;
+} gas_uas_evaluate_ucell_req_struct;
+
+/* Request to activate a cell without an evaluation phase */
+typedef gas_uas_evaluate_ucell_req_struct gas_uas_activate_ucell_req_struct;
+#endif /* (defined(__GERAN_R6__) && defined(__UMTS_R6__)) || defined (__FDD_REDIRECTION__) */
+
+/* Request to stop an ongoing evaluation */
+typedef struct {
+ LOCAL_PARA_HDR
+} gas_uas_evaluate_ucell_stop_req_struct;
+
+#ifdef __LTE_RAT__
+typedef struct {
+ LOCAL_PARA_HDR
+ eutran_cap_enum eutran_cap;
+} gas_uas_eutran_cap_update_ind_struct;
+#endif /* __LTE_RAT__ */
+
+//From UAS to GAS
+typedef struct {
+ LOCAL_PARA_HDR
+ ts_ciphering_info ciphering_info;
+ plmn_search_type_enum plmn_search_type;
+ te_gsm_band_indicator band_indicator;
+ kal_uint16 message_length;
+#ifdef __TC7__CS__SUPPORT__
+ kal_bool is_fast_return_to_umts;
+#endif
+} uas_gas_handover_gcell_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 t3212_timer_val;
+ kal_bool att_flag;
+ kal_uint32 wait_time;
+ /* __ALPS02506878_SUPPORT__ */
+ te_ir_call_type call_type;
+} uas_gas_ho_activate_gcell_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ te_ir_handover_status ir_handover_to_utran_status;
+} gas_uas_handover_ucell_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ te_ir_handover_status ir_handover_to_utran_status;
+} gas_uas_ho_activate_ucell_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 list_ref;
+#ifdef __TDD_DM_GAP_OPTIMIZATION__
+ kal_bool is_bsic_gap_valid;
+#endif
+ te_ir_urrc_state urrc_state;
+ ts_ir_gsm_cell_list gsm_cell_list;
+ /* This flag is used to indicate whether measurement period should be reset
+ * immediately. (TRUE: meas is performed in the first DRX.
+ * FALSE: meas is performed in the first T-meas occasion)
+ * In current design, the following rules should be followed.
+ * (1)If num of GSM cells != 0, this flag will be set as FALSE only if tmeas,gsm measurement
+ * is triggered when priority measurement is on-going (i.e., at
+ * least one of GSM cells hits priority reselection criteria for priority
+ * based measurement reselection). For other case, this flag should
+ * be set as TRUE. If any improvement is needed, the usage limitation
+ * for this flag should be confirmed with GL1's colleague.
+ * (2) If num of GSM cells == 0, this flag will alwyas be set as FALSE;
+ */
+ kal_bool is_meas_period_reset;
+}uas_gas_config_gcell_meas_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+}fdd_gas_uas_config_ucell_meas_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+}tdd_gas_uas_config_ucell_meas_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ te_l1_availibility_status l1_availibility_status;
+}uas_gas_lower_layer_availability_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ te_ir_cell_reselection_status ir_cell_eval_status;
+ ts_eval_activate_fail_handle eval_activate_fail_handle;
+}gas_uas_evaluate_ucell_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ te_ir_cell_reselection_status ir_cell_activation_status;
+ ts_eval_activate_fail_handle eval_activate_fail_handle;
+ /*Byron: 2007/05/08: Add for real CCO fail cause*/
+ te_ir_cell_change_fail_reason_enum ir_cell_change_failed_reason;
+}gas_uas_activate_ucell_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+}gas_uas_evaluate_ucell_stop_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ te_ir_cell_change_complete_status ir_cell_change_complete_status;
+ /*Byron: 2007/05/08: Add for real CCO fail cause*/
+ te_ir_cell_change_fail_reason_enum ir_cell_change_failed_reason;
+}gas_uas_ucell_change_complete_ind_struct;
+
+
+typedef struct {
+ LOCAL_PARA_HDR
+ te_ir_cell_change_trigger ir_cell_change_trigger;
+ plmn_search_type_enum plmn_search_type;
+ GSM_TargetCellInfo target_gcell_info;
+} uas_gas_evaluate_gcell_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ te_ir_cell_change_trigger ir_cell_change_trigger;
+ plmn_search_type_enum plmn_search_type;
+ GSM_TargetCell_Info_union target_gcell_info;
+ GSM_TargetCell_SI_Info_union target_gcell_si_info;
+ kal_uint32 cell_change_activation_time; /* milli-seconds, */
+ kal_uint32 cell_change_timeout; /* value in milli-seconds or zero when not required */
+ kal_uint32 wait_time; /* milli-seconds: 0~15000 ms, GAS should not reselect back to UMTS/LTE within "wait_time" period */
+ kal_bool nc_mode_present; /* if TRUE nc_mode is present */
+ kal_uint8 nc_mode; /* Optional, present if nc_mode_present is TRUE */
+} uas_gas_activate_gcell_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+}uas_gas_evaluate_gcell_stop_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_int8 q_rxlev_min; /* Range -115 to -25 dBm */
+ kal_uint8 p_compensation; /* Range 0 to 12 dBm */
+}uas_gas_cell_reselection_params_req_struct;
+#if 0 /*brwang, 20080830, this definition should be placed before uas_gas_evaluate_gcell_req_struct*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+
+#if (defined(__UMTS_R5__) && defined(__GERAN_R5__))
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool isCompressedVersion;
+} gas_uas_ho_umts_info_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_bool isCompressedVersion;
+} gas_uas_ho_umts_info_rsp_struct;
+#endif
+
+typedef struct{
+ LOCAL_PARA_HDR
+ plmn_search_type_enum plmn_search_type;
+ auto_search_cmd_enum auto_search_cmd;
+ kal_uint8 num_carriers;
+ kal_uint16 csg_uarfcn[MAX_NUM_CSG_CARRIERS];
+} gas_uas_search_csg_ucell_req_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ search_status_enum search_status;
+ kal_uint8 num_carriers;
+ ts_3G_csg_ucell_evluation_result csg_ucell_evluation_result_list[MAX_NUM_CSG_CARRIERS];
+} gas_uas_search_csg_ucell_cnf_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ plmn_search_type_enum plmn_search_type;
+ auto_search_cmd_enum auto_search_cmd;
+ kal_uint8 num_carriers;
+ kal_uint16 csg_uarfcn[MAX_NUM_CSG_CARRIERS];
+} gas_uas_evaluate_csg_ucell_req_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ search_status_enum search_status;
+ kal_uint8 num_carriers;
+ ts_3G_csg_ucell_evluation_result csg_ucell_evluation_result_list[MAX_NUM_CSG_CARRIERS];
+} gas_uas_evaluate_csg_ucell_cnf_struct;
+
+typedef struct{
+ LOCAL_PARA_HDR
+ plmn_id_struct csg_plmn;
+ kal_uint32 csg_id;
+ kal_uint32 csg_cell_id;
+ kal_uint32 csg_frequency;
+ kal_uint16 csg_physical_cell_id;
+} uas_gas_build_fingerprint_req_struct;
+
+#if defined(__LTE_RAT__) || defined(__23G_PRI_RESEL_SUPPORT__)
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 list_ref;
+ te_ir_urrc_state urrc_state;
+ kal_int16 prio_meas_period;
+ ts_ir_gsm_cell_list gsm_cell_list;
+}uas_gas_config_gcell_prio_meas_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+}fdd_gas_uas_config_ucell_prio_meas_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+}tdd_gas_uas_config_ucell_prio_meas_cnf_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+}uas_gas_config_gcell_prio_meas_cnf_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 list_ref;
+ kal_int16 prio_meas_period;
+ FDD_meas_UmtsCellList umts_cell_list;
+ kal_int8 fdd_rscp_min_in_dbm;
+ kal_uint16 first_meas_uarfcn; // invalid value = UAS_GAS_INVALID_UARFCN
+ kal_bool is_detected_cell_meas[FDD_MAX_NUM_MEASURED_UMTS_CARRIERS];
+}fdd_gas_uas_config_ucell_prio_meas_req_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ kal_uint8 list_ref;
+ kal_int16 prio_meas_period;
+ TDD_meas_UmtsCellList umts_cell_list;
+ //kal_int8 fdd_rscp_min_in_dbm;
+ kal_int8 tdd_rscp_min_in_dbm;
+ kal_uint16 first_meas_uarfcn; // invalid value = UAS_GAS_INVALID_UARFCN
+ kal_bool is_detected_cell_meas[TDD_MAX_NUM_MEASURED_UMTS_CARRIERS];
+}tdd_gas_uas_config_ucell_prio_meas_req_struct;
+#endif /* defined(__LTE_RAT__) || defined(__23G_PRI_RESEL_SUPPORT__) */
+
+
+#ifdef __LTE_RAT__
+typedef struct {
+ LOCAL_PARA_HDR
+ eutran_cap_enum eutran_cap;
+} uas_gas_eutran_cap_update_ind_struct;
+#endif /* __LTE_RAT__ */
+
+
+#endif /* _UAS_GAS_STRUCT_H */
+
+
diff --git a/mcu/protocol/interface/general/upcm_em_struct.h b/mcu/protocol/interface/general/upcm_em_struct.h
new file mode 100644
index 0000000..524d2f8
--- /dev/null
+++ b/mcu/protocol/interface/general/upcm_em_struct.h
@@ -0,0 +1,110 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2012
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * upcm_em_struct.h
+ *
+ * Project:
+ * --------
+ * MOLY
+ *
+ * Description:
+ * ------------
+ * Now we use UPCM to send EM parameters to tool
+ * This Header file is used for the ILM.
+ * UPCM will help to send tft_pf, ratadp EM
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 04 09 2018 chin-wei.hsu
+ * [MOLY00318641] [MT6295][EL2] EM info structure refine
+ * [UMOLYE] EM info structure refine.
+ *
+ * 03 12 2015 stan.chen
+ * [MOLY00098774] [UPCM] EM Info for 91
+ * Checkin New EM info and struct.
+ *
+ * 05 27 2013 moja.hsu
+ * [MOLY00007625] Maintain code
+ * add ratadp EM stats.
+ ****************************************************************************/
+/*
+ * =====================================================================================
+ *
+ * Filename: upcm_em_struct.h
+ *
+ * Description: EM ILM of UPCM
+ *
+ * Created: 2013/05/27 03:39:19
+ * Author: mtk01641 (moja)
+ * =====================================================================================
+ */
+
+#ifndef UPCM_EM_STRUCT_INC
+#define UPCM_EM_STRUCT_INC
+
+#include "kal_public_api.h"
+#include "em_public_struct.h"
+#include "upcm_stats.h"
+#include "tft_pf_stats.h"
+#include "ratadp_stats.h"
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ em_info_enum em_info;
+ upcm_stats_t upcm;
+ tft_pf_stats_t tft_pf;
+ ratadp_stats_t ratadp;
+}em_upcm_status_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ em_info_enum em_info;
+ kal_uint32 total_rx_byte_per_second;
+ kal_uint32 total_tx_byte_per_second;
+}em_upcm_ps_tput_info_ind_struct;
+
+#endif /* ----- #ifndef UPCM_EM_STRUCT_INC ----- */
+
diff --git a/mcu/protocol/interface/general/upcm_stats.h b/mcu/protocol/interface/general/upcm_stats.h
new file mode 100644
index 0000000..e2a02df
--- /dev/null
+++ b/mcu/protocol/interface/general/upcm_stats.h
@@ -0,0 +1,176 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2012
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * upcm_stats.h
+ *
+ * Project:
+ * --------
+ * MOLY
+ *
+ * Description:
+ * ------------
+ * UPCM statistics
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 11 16 2020 stun.wu
+ * [MOLY00591799] [MT6880][Colgin][New feature] Add New ICDs CM_IP_DL_STATs/CM_IP_UL_STATs
+ *
+ * .
+ *
+ * 09 06 2019 chin-wei.hsu
+ * [MOLY00437199] [MT6297][ICD][EM] fix wrong values of PDCP throughput and IP throughput
+ *
+ * [ICD][EM] UT.
+ *
+ * 09 18 2018 tc.chang
+ * [MOLY00345990] [VMOLY] Code sync.
+ *
+ * 09 14 2018 tc.chang
+ * [MOLY00345990] [VMOLY] Code sync
+ * Rollback first. Fix build error locally
+ *
+ * 06 15 2017 i-feng.chen
+ * [MOLY00257684] [MT6763][Bianco][N1][EM] No info in EL2 PDCP UL Tput/PDU size
+ * [TRUNK][EM]EPDCP UL Statistics
+ *
+ * 02 22 2017 timothy.yao
+ * [MOLY00231561] [6293][EL2][UPCM] log refine & code flow refine
+ * UPCM log refine.
+ *
+ * 09 26 2016 cammie.yang
+ * [MOLY00195563] [6293][EL2][UPCM][RATDM][EPDCP] Initial feature integrations
+ * [TRUNK] UPCM/RATDM/EPDCP feature integrations from PS.DEV
+ *
+ * 07 17 2013 moja.hsu
+ * [MOLY00030111] Add UPCM Tx/Rx statistics query API
+ * .
+ ****************************************************************************/
+/*
+ * =====================================================================================
+ *
+ * Filename: upcm_stats.h
+ *
+ * Description: Statistics of UPCM
+ *
+ * Created: 2013/05/24 03:39:10
+ * Author: mtk01641 (moja)
+ * =====================================================================================
+ */
+
+#ifndef UPCM_STATS_INC
+#define UPCM_STATS_INC
+
+#include <upcm_enum.h>
+
+typedef struct
+{
+ /* For Default EPSB */
+ kal_uint32 dft_rcv_ul_burst_v4v6;
+ kal_uint32 dft_rcv_ul_burst_v4;
+ kal_uint32 dft_rcv_ul_burst_v6;
+ kal_uint32 dft_ul_no_match_tft_drop;
+ kal_uint32 dft_ul_suspend_queue;
+
+ kal_uint32 ul_bytes;
+ kal_uint32 ul_gpds; // ul_pkts
+ kal_uint32 ul_bytes_pri;
+ kal_uint32 ul_gpds_pri; //ul_pkts_pri
+ kal_uint16 ul_max;
+
+ kal_uint16 dl_max;
+ kal_uint32 dl_bytes;
+ kal_uint32 dl_nums;
+
+ kal_uint32 rollback_ul_times;
+ kal_uint32 rcv_by_ebi_times;
+
+ kal_uint32 pkt_filter_add;
+ kal_uint32 pkt_filter_mod;
+ kal_uint32 pkt_filter_del;
+ kal_uint32 pkt_filter_delall;
+ kal_uint32 pkt_filter_del_bearer;
+}upcm_epsb_stats_t;
+
+typedef struct
+{
+ kal_uint32 loopback_sdus;
+ kal_uint32 buffered_sdus;
+ kal_uint32 delay_sdus;
+}upcm_test_mode_stats_t;
+
+typedef struct
+{
+
+#ifdef __FIVEG_NAS__
+ // TODO: 5G part. 9XX bearers make structure size > 2^16
+ upcm_epsb_stats_t epsb[MAX_234G_EPSB_NUM];
+ /* The backup for previous activation */
+ upcm_epsb_stats_t pre_epsb[MAX_234G_EPSB_NUM];
+ upcm_epsb_stats_t nr_psi[NUM_5G_PDU_SESSION];
+ /* The backup for previous activation */
+ upcm_epsb_stats_t pre_nr_psi[NUM_5G_PDU_SESSION];
+#else
+ upcm_epsb_stats_t epsb[MAX_EPSB_NUM];
+ /* The backup for previous activation */
+ upcm_epsb_stats_t pre_epsb[MAX_EPSB_NUM];
+#endif
+
+ upcm_test_mode_stats_t test_mode;
+ kal_uint32 suspend_total;
+ kal_uint32 resume_total;
+
+ kal_uint32 actv_testmode;
+ kal_uint32 deactv_testmode;
+ kal_uint32 close_testloop;
+ kal_uint32 open_testloop;
+}upcm_stats_t;
+
+/*
+ * This pointer will be inited in upcm_init
+ */
+extern upcm_stats_t *p_upcm_stats_g;
+#endif /* ----- #ifndef UPCM_STATS_INC ----- */
+
diff --git a/mcu/protocol/interface/general/upds_vgmm_struct.h b/mcu/protocol/interface/general/upds_vgmm_struct.h
new file mode 100644
index 0000000..2b40aaf
--- /dev/null
+++ b/mcu/protocol/interface/general/upds_vgmm_struct.h
@@ -0,0 +1,84 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2019
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+#ifndef UPDS_VGMM_STRUCT_H
+#define UPDS_VGMM_STRUCT_H
+
+#include "mcd_l3_inc_struct.h"
+
+typedef enum
+{
+ UPDS_VGMM_DATA_CNF_RESULT_OK,
+ UPDS_VGMM_DATA_CNF_RESULT_FAIL,
+
+} upds_vgmm_data_cnf_result_enum;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ /* raw_data carried in peer_buff */
+} upds_vgmm_data_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 seq_num;
+ /* raw_data carried in peer_buff */
+} upds_vgmm_data_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 seq_num;
+ upds_vgmm_data_cnf_result_enum cause;
+} upds_vgmm_data_cnf_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 seq_num;
+ plmn_id_struct selected_plmn;
+} upds_vgmm_get_ue_state_indication_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 seq_num;
+ kal_bool ue_state_indication_needed; // Identify whether UE_STATE_INDICATION is needed to be sent
+ /* raw_data carried in peer_buff */
+} upds_vgmm_get_ue_state_indication_rsp_struct;
+
+
+#endif /* UPDS_VGMM_STRUCT_H */
\ No newline at end of file
diff --git a/mcu/protocol/interface/general/urlc_common_enums.h b/mcu/protocol/interface/general/urlc_common_enums.h
new file mode 100644
index 0000000..673d616
--- /dev/null
+++ b/mcu/protocol/interface/general/urlc_common_enums.h
@@ -0,0 +1,115 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2014
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * urlc_common_enums.h
+ *
+ * Project:
+ * --------
+ * UMOLY
+ *
+ * Description:
+ * ------------
+ *
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ----------------------------------------------------------------------------
+ * $Log:$
+ *
+ * 07 28 2017 hamilton.liang
+ * [MOLY00266853] [Bianco/Zion] gmn sw check-in
+ *
+ * GMN SW for 3G L2 part
+ *
+ * 05 19 2017 ming.lee
+ * [MOLY00251142] [BIANCO][MT6763][RDIT][PHONE][Overnight][HQ][MTBF][Lab][Ericsson]Fatal error(task)] err_code1:0x00001637 err_code2:0x00000003 err_code3:0xCCCCCCCC
+ * Rollback delay free VRB
+ *
+ * 09 26 2016 jen-de.lai
+ * [MOLY00195317] [URLC][TX] - Gen93 URLC TX code modification for new HW and MCU Archi
+ *
+ * 09 02 2015 jen-de.lai
+ * [MOLY00099053] [UMOLY][URLC] - check in for URLC EM for AT&T
+ *
+ * 03 15 2015 jen-de.lai
+ * [MOLY00099053] [UMOLY][URLC] - check in for URLC EM- URLC status and URLC layer tput
+ *
+
+ ******************************************************************************/
+
+#ifndef _URLC_COMMON_ENUMS_H
+#define _URLC_COMMON_ENUMS_H
+
+/* Universal Bin: merge TDD and FDD urlc_timer_id_enum */
+typedef enum
+{
+ URLC_TIMER_DISCARD_EXPIRY, /* 0 */
+ URLC_TIMER_POLL_EXPIRY,
+ URLC_TIMER_POLL_PROHIBIT_EXPIRY,
+ URLC_TIMER_POLL_PERIODIC_EXPIRY,
+ URLC_TIMER_RST_EXPIRY,
+ URLC_TIMER_MRW_EXPIRY,
+ URLC_TIMER_STATUS_PROHIBIT_EXPIRY,
+ URLC_TIMER_STATUS_PERIODIC_EXPIRY,
+#if defined(FDD_RLC_TX_NOACK_GUARD_TIMER) || defined(TDD_RLC_TX_NOACK_GUARD_TIMER)
+ URLC_TIMER_TX_NOACK_GUARD_EXPIRY,
+#endif
+ TDD_URLC_TIMER_MAX_NUM,
+ URLC_TIMER_PROCESS_ACK_EXPIRY = TDD_URLC_TIMER_MAX_NUM,
+ URLC_TIMER_LONG_POLL_PROHIBIT_EXPIRY,
+#ifdef __URLC_EM__
+ URLC_TIMER_EM_UPDATE_EXPIRY,
+#endif
+ URLC_TIMER_PROCESS_END_GUARD_EXPIRY,
+ URLC_TIMER_RANDOM_FATAL_EXPIRY,
+ FDD_URLC_TIMER_NUM_MSGS /* number of timer msgs */
+} urlc_timer_id_enum;
+#ifdef __URLC_EM__
+typedef enum
+{
+ FDD_URLC_EM_NONE = 0,
+ FDD_URLC_EM_AMAZON_RLC_STATUS = 0x1,
+ FDD_URLC_EM_NEMOLIKE_RLC_TPUT = 0x2,
+ FDD_URLC_EM_ATT_RLC_STATISTICS = 0x4,
+ FDD_URLC_EM_ATT_RLC_RESET = 0x8,
+} urlc_em_type_enum;
+#endif
+#endif /* _URLC_COMMON_ENUMS_H */
+
diff --git a/mcu/protocol/interface/general/urlc_export_api.h b/mcu/protocol/interface/general/urlc_export_api.h
new file mode 100644
index 0000000..1679b21
--- /dev/null
+++ b/mcu/protocol/interface/general/urlc_export_api.h
@@ -0,0 +1,90 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2005
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/******************************************************************************
+ * Filename:
+ * ---------
+ * rlc_export_api.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *=============================================================================
+ * HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *=============================================================================
+ ******************************************************************************/
+
+/********************************************************************************
+* Copyright Statement:
+* --------------------
+*
+* This product has been developed using a protocol stack
+* developed by Sasken Communication Technologies Limited.
+*
+********************************************************************************/
+#ifndef __URLC_EXPORT_API_H__
+#define __URLC_EXPORT_API_H__
+
+#include "uas_common_enums.h"
+
+
+/********************************************************************************
+* API Interfaces
+********************************************************************************/
+extern ExtendedRbId FDD_urlc_rx_lookup_rbid(kal_uint8 RbIdx);
+extern kal_uint8 FDD_urlc_rx_lookup_rbidx(ExtendedRbId RbId,kal_uint8 sim_idx);
+#endif
diff --git a/mcu/protocol/interface/general/ursp_upds_struct.h b/mcu/protocol/interface/general/ursp_upds_struct.h
new file mode 100644
index 0000000..143cd55
--- /dev/null
+++ b/mcu/protocol/interface/general/ursp_upds_struct.h
@@ -0,0 +1,127 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2019
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+#ifndef URSP_UPDS_STRUCT_H
+#define URSP_UPDS_STRUCT_H
+
+#include "mcd_l3_inc_struct.h"
+
+typedef enum
+{
+ UPDS_TYPE_RESERVED = 0x00,
+ UPDS_TYPE_URSP = 0x01,
+ UPDS_TYPE_ANDSP = 0x02
+} ue_policy_part_type_enum;
+
+typedef struct
+{
+ ue_policy_part_type_enum ue_policy_part_type; //No need to read by destination module due to only send URSP to MOD_URSP
+ kal_uint16 ue_policy_part_content_len; // Length of content in UE policy part
+ kal_uint8 *ue_policy_part_content; // Contents of UE policy part
+} ue_policy_part_struct;
+
+typedef struct
+{
+ kal_uint16 upsc;
+ kal_uint16 instruction_order;
+ kal_uint8 ue_policy_part_num; // num of UE policy part included in instruction
+ ue_policy_part_struct *ue_policy_part; // Array of UE policy part
+} ue_policy_instruction_struct;
+
+typedef struct
+{
+ plmn_id_struct plmn_id;
+ kal_uint8 instruction_num; // num of instruction included in 1 sublist
+ ue_policy_instruction_struct *instruction; // Array of instruction
+} ue_policy_sublist_struct;
+
+typedef struct
+{
+ kal_uint16 upsc;
+ kal_uint16 fail_instruction_order;
+ kal_uint8 cause;
+
+} ue_policy_result_struct;
+
+typedef struct
+{
+ plmn_id_struct plmn_id;
+ kal_uint8 result_num; // num of result included in subresult
+ ue_policy_result_struct *result; // Array of result
+} ue_policy_subresult_struct;
+
+typedef struct
+{
+ plmn_id_struct plmn_id;
+ kal_uint8 upsc_num;
+ kal_uint16 *upsc;
+} upsi_sublist_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 seq_num;
+ kal_uint8 ue_policy_sublist_num; // num of sublist included
+ ue_policy_sublist_struct *ue_policy_sublist; // Array of sublist
+} ursp_upds_ue_policy_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 seq_num;
+ kal_bool result_success; // If all UE policy execute successfully, then retrun KAL_TRUE
+ kal_uint8 ue_policy_subresult_num; // num of subresult included
+ ue_policy_subresult_struct *ue_policy_subresult; // Array of subresult
+} ursp_upds_ue_policy_rsp_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 seq_num;
+} ursp_upds_get_ue_policy_info_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 seq_num;
+ kal_uint8 upsi_sublist_num; // If this value is 0, no need to create UE_STATE_INDICATION
+ upsi_sublist_struct *upsi_sublist;
+/*
+kal_uint8 os_id_num;
+os_id_struct *os_id
+*/
+} ursp_upds_get_ue_policy_info_rsp_struct;
+
+#endif /* URSP_UPDS_STRUCT_H */
\ No newline at end of file
diff --git a/mcu/protocol/interface/general/ursp_vgmm_struct.h b/mcu/protocol/interface/general/ursp_vgmm_struct.h
new file mode 100644
index 0000000..17a3a1c
--- /dev/null
+++ b/mcu/protocol/interface/general/ursp_vgmm_struct.h
@@ -0,0 +1,69 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2019
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+#ifndef URSP_VGMM_STRUCT_H
+#define URSP_VGMM_STRUCT_H
+
+
+#define VGMM_SINGLE_NSSAI_LENGTH 4
+#define VGMM_MAX_SINGLE_NSSAI_IN_LIST 8
+
+typedef enum
+{
+ VGMM_SINGLE_NSSAI_TYPE_SST = 1, // SINGLE_NSSAI contains Slice/Service Type only
+ VGMM_SINGLE_NSSAI_TYPE_SST_SD, // SINGLE_NSSAI contains also Slice Differentiator
+ VGMM_SINGLE_NSSAI_TYPE_SST_SST_MAPPED,// SINGLE_NSSAI SST has mapping to HPLMN
+ VGMM_SINGLE_NSSAI_TYPE_SST_SD_SST_MAPPED,// SINGLE_NSSAI SST+SD SST has mapping to HPLMN
+ VGMM_SINGLE_NSSAI_TYPE_SST_SD_SST_MAPPED_SD_MAPPED,// SINGLE_NSSAI SST and SD have mapping to HPLMN
+ VGMM_SINGLE_NSSAI_TYPE_EMPTY = 0xFF
+} vgmm_single_nssai_type_enum;
+
+typedef struct
+{
+ vgmm_single_nssai_type_enum single_nssai_type;
+ kal_uint8 single_nssai[VGMM_SINGLE_NSSAI_LENGTH];
+ kal_uint8 single_nssai_mapped_hplmn[VGMM_SINGLE_NSSAI_LENGTH];
+ plmn_id_struct associated_plmn;
+}vgmm_single_nssai_struct;
+
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 single_nssai_number;
+ vgmm_single_nssai_struct nssai_list[VGMM_MAX_SINGLE_NSSAI_IN_LIST];
+} ursp_vgmm_nssai_configuration_ind_struct;
+
+#endif /* URSP_VGMM_STRUCT_H */
\ No newline at end of file
diff --git a/mcu/protocol/interface/general/vdm_external_lib.h b/mcu/protocol/interface/general/vdm_external_lib.h
new file mode 100644
index 0000000..db787a2
--- /dev/null
+++ b/mcu/protocol/interface/general/vdm_external_lib.h
@@ -0,0 +1,378 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2014
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ * Filename:
+ * ------------
+ * vdm_external_lib.h
+ *
+ * Project:
+ * ------------
+ * MOLY
+ *
+ * Description:
+ * ------------
+ * This file defines functions for external module usage.
+ *
+ * Author:
+ * -----------
+ * -------
+ *
+ *===========================================================
+ * $Log$
+ *
+ * 09 18 2020 chen-wei.lan
+ * [MOLY00568087] [Gen97] Support 5g t911
+ * 5G-911
+ *
+ * 09 11 2020 chen-wei.lan
+ * [MOLY00568087] [Gen97] Support 5g t911
+ *
+ * [MPD]t911
+ *
+ * 12 09 2019 chen-wei.lan
+ * [MOLY00463337] ¡i5G-LH¡j Hvolte feature ?Õu®I?»Ý¨D (Following ALPS04766900)
+ * DMF
+ *
+ * 12 02 2019 chen-wei.lan
+ * [MOLY00346647] [MT6297][VDM/L4] changes for 97
+ * [patch back]8519908,8519818,8915296,9086988,9086148,9085815,9318206,9357101
+ *
+ * 07 15 2019 chen-wei.lan
+ * [MOLY00346647] [MT6297][VDM/L4] changes for 97
+ * [SDM,VDM patch back]8237474,7844918,7758571
+ *
+ * 11 01 2018 kuan-wei.chen
+ * [MOLY00346647] [MT6297][VDM/L4] changes for 97
+ * [VMOLY][VDM][MPD]
+ *
+ * 08 17 2018 kuan-wei.chen
+ * [MOLY00346647] [MT6297][VDM/L4] changes for 97
+ * [VMOLY] vdm related others
+ *
+ * 02 27 2018 yulong.chang
+ * [MOLY00309602] [UMOLYE][Cervino][MT6765][O1][MP1.5][TDD][CMCC FT][Beijing][VoLTE FT][4.4]UE A drop to G when call UE B_Nongzhanqiao_15:03:40
+ * Add public function for query if any call is ongoing
+ *
+ * 12 11 2017 renhuang.liu
+ * [MOLY00295152] [Rose][sylvia][BSP+][O1]The ECC call will can't be dial out success.(2/5)
+ * provide external API for ATP to query if emergency call is ongoing
+ *
+ * 10 12 2017 jerry.cheng
+ * [MOLY00280364] [PVT must resolve]¡i³q?¡j?¥´?«æ??112³q?¤¤??«H?
+ * .[R3] .public api for is_e911_flow_applied
+ *
+ * 07 26 2017 jerry.cheng
+ * [MOLY00266646] [VDM][LR11.MP3] ´£«e?¥ÍSRVCCªº?²z¡Avolte?µ ©M vilte?? ¬O§_¥i¥H¤À?°t¸m¡H
+ * .provide external API for ERRC to know VoLTE/ViLTE - fix input parameter for L+L
+ *
+ * 07 25 2017 jerry.cheng
+ * [MOLY00266646] [VDM][LR11.MP3] ´£«e?¥ÍSRVCCªº?²z¡Avolte?µ ©M vilte?? ¬O§_¥i¥H¤À?°t¸m¡H
+ * .provide external API for ERRC to know VoLTE/ViLTE
+ *
+ * 04 18 2017 jerry.cheng
+ * [MOLY00242146] [93][VDM] bug fix
+ * .block AT+EMCS to L4 if emc_scan is not enable
+ *
+ * 12 19 2016 jerry.cheng
+ * [MOLY00210061] [93][VDM] UMOLY sync to UMOLYA
+ * .sync [MOLY00213518] [TCL_TF][VzW][E911][2.17] 911 call not connected
+ *
+ * note: VDM provide vdm_external_wfc_switch for l4c
+ *
+ * 12 14 2016 jerry.cheng
+ * [MOLY00210061] [93][VDM] UMOLY sync to UMOLYA
+ * .sync [MOLY00204150] TK vzw hVoLTE/E911 implementation
+ *
+ * TK hVoLTE.
+ *
+ * 11 11 2016 jerry.cheng
+ * [MOLY00210061] [93][VDM] UMOLY sync to UMOLYA
+ * [MOLY00191944] [CL: 3000545]multiple IMS : VDM part
+ *
+ * MIMS : add new arg : ps_id in vdm external functions.
+ *
+ * 10 28 2016 jerry.cheng
+ * [MOLY00210061] [93][VDM] UMOLY sync to UMOLYA
+ * rollback.
+ *
+ * 07 11 2016 jerry.cheng
+ * [MOLY00185907] [MT6293] [ENAS] UMOLY merge to UMOLYA
+ * [VDM] [sync UMOLY to UMOLYA] MOLY00183611.
+ *
+ * 03 01 2016 ian-yw.chen
+ * [MOLY00147454] VZW 3GPP2 SMS over IMS
+ * interfaces part to build pass
+ *
+ * 02 24 2016 chinte.chen
+ * [MOLY00154806] [MT6755][VzW][chipset][RDIT][InHouse][HQ][DEVeHRPD] MO 3GPP SMS not sent
+ * SDM build fail, add vdm_external_is_c2k_cs_voice_call_ongoing()to build pass
+ *
+ * 09 14 2015 lexel.yu
+ * [MOLY00141573] [UMOLY][LR11][TMO][IMS] bCSFB
+ * .
+ *
+ * 03 12 2015 lexel.yu
+ * [MOLY00085703] [VDM][MT6291] Sync MOLY to UMOLY
+ * [MOLY00085856] [CMCC VoLTE] Provide an interface for EMM to query IMS call status
+ *
+ * 12 05 2014 lexel.yu
+ * [MOLY00085703] [VDM][MT6291] Sync MOLY to UMOLY
+ * [MOLY00085856] [CMCC VoLTE] Provide an interface for EMM to query IMS call status
+ *****************************************************************************/
+
+#ifndef _VDM_EXTERNAL_LIB_H_
+#define _VDM_EXTERNAL_LIB_H_
+
+#include "kal_general_types.h"
+#include "l3_inc_enums.h"
+#include "ims_nvram_def.h"
+
+/******************************************************************************
+ * Function
+ *****************************************************************************/
+/******************************************************************************
+ * @brief Get current RAT
+ *
+ * @param[in] void
+ *
+ * @return rat_enum
+ *
+ *****************************************************************************/
+rat_enum vdm_external_get_current_rat(protocol_id_enum ps_id);
+
+/******************************************************************************
+ * @brief Check if any CS voice call is ongoing
+ *
+ * @param[in] void
+ *
+ * @return kal_bool: TRUE or FALSE
+ *
+ *****************************************************************************/
+kal_bool vdm_external_is_cs_voice_call_ongoing(protocol_id_enum ps_id);
+
+/******************************************************************************
+ * @brief Check if any IMS voice call is ongoing
+ *
+ * @param[in] void
+ *
+ * @return kal_bool: TRUE or FALSE
+ *
+ *****************************************************************************/
+kal_bool vdm_external_is_ims_voice_call_ongoing(protocol_id_enum ps_id);
+
+/******************************************************************************
+ * @brief Check if any VoWIFI call is ongoing
+ *
+ * @param[in] void
+ *
+ * @return kal_bool: TRUE or FALSE
+ *
+ *****************************************************************************/
+kal_bool vdm_external_is_ims_over_wifi_call_ongoing(protocol_id_enum ps_id);
+
+/******************************************************************************
+ * @brief Check if any VoLTE call exists
+ *
+ * @param[in] void
+ *
+ * @return kal_bool: TRUE or FALSE
+ *
+ *****************************************************************************/
+kal_bool vdm_external_is_volte_call_exist(protocol_id_enum ps_id);
+
+/******************************************************************************
+ * @brief Check if any ViLTE call exists
+ *
+ * @param[in] void
+ *
+ * @return kal_bool: TRUE or FALSE
+ *
+ *****************************************************************************/
+kal_bool vdm_external_is_vilte_call_exist(protocol_id_enum ps_id);
+
+/******************************************************************************
+ * @brief Check if IMS call failed before domain selection end
+ *
+ * @param[in] void
+ *
+ * @return kal_bool: TRUE or FALSE
+ *
+ *****************************************************************************/
+kal_bool vdm_external_check_history_ims_failed(protocol_id_enum ps_id);
+
+/******************************************************************************
+ * @brief Check if any C2K CS voice call is ongoing
+ *
+ * @param[in] void
+ *
+ * @return kal_bool: TRUE or FALSE
+ *
+ *****************************************************************************/
+kal_bool vdm_external_is_c2k_cs_voice_call_ongoing(protocol_id_enum ps_id);
+
+/******************************************************************************
+ * @brief Check if C2K CS registered
+ *
+ * @param[in] void
+ *
+ * @return kal_bool: TRUE or FALSE
+ *
+ *****************************************************************************/
+kal_bool vdm_external_is_c2k_cs_registered(protocol_id_enum ps_id);
+
+/******************************************************************************
+ * @brief Check if C2K PS registered
+ *
+ * @param[in] void
+ *
+ * @return kal_bool: TRUE or FALSE
+ *
+ *****************************************************************************/
+kal_bool vdm_external_is_c2k_ps_registered(protocol_id_enum ps_id);
+
+/******************************************************************************
+ * @brief Check if need to delay SRLTE mode switch (only used for OP12 hVoLTE feature)
+ *
+ * @param[in] void
+ *
+ * @return kal_bool: TRUE or FALSE
+ *
+ *****************************************************************************/
+kal_bool vdm_external_is_delay_SRLTE_switch_needed(protocol_id_enum ps_id);
+
+/******************************************************************************
+ * @brief let VDM to write nvram parameters
+ * this function should be called only for test purpose
+ *
+ * @param[in]
+ *
+ * @return
+ *
+ *****************************************************************************/
+void vdm_external_write_nvram(nvram_lid_ims_enum vdm_lid, kal_uint8* pdu_ptr, kal_uint32 vdm_nvram_size, protocol_id_enum ps_id);
+
+/******************************************************************************
+ * @brief let VDM to read nvram parameters
+ * this function should be called only for test purpose
+ *
+ * @param[in]
+ *
+ * @return
+ *
+ *****************************************************************************/
+void vdm_external_read_nvram(nvram_lid_ims_enum vdm_lid, kal_uint8* pdu_ptr, kal_uint32 vdm_nvram_size, protocol_id_enum ps_id);
+
+/******************************************************************************
+ * @To check whether wcf is turned-on or off. This info comes from AT+EIMSWFC
+ *
+ * @param[in]
+ *
+ * @return
+ *
+ *****************************************************************************/
+kal_bool vdm_external_wfc_switch(protocol_id_enum ps_id);
+
+/******************************************************************************
+ * @brief Check if any call is ongoing
+ *
+ * @param[in] ps_id
+ *
+ * @return kal_bool: TRUE or FALSE
+ *
+ *****************************************************************************/
+kal_bool vdm_external_is_call_ongoing(protocol_id_enum ps_id);
+
+/******************************************************************************
+ * @ Assign the free call id to CSMCC
+ *
+ * @param[in] call_id_ptr
+ *
+ * @return kal_bool
+ *
+ *****************************************************************************/
+kal_bool vdm_external_alloc_call_context(kal_bool is_mo_dir, kal_uint8* call_id_ptr, kal_uint8 ps_id);
+
+/******************************************************************************
+ * @ release the free call id to CSMCC
+ *
+ * @param[in] call_id_ptr
+ *
+ * @return
+ *
+ *****************************************************************************/
+void vdm_external_dealloc_call_context(kal_uint8 call_id, kal_uint8 ps_id);
+
+/******************************************************************************
+ * @brief Check if ads nv allow emerg volte
+ *
+ * @param[in] ps_id
+ *
+ * @return kal_bool: TRUE or FALSE
+ *
+ *****************************************************************************/
+kal_bool vdm_external_is_emerg_volte_support_by_ads_nv(protocol_id_enum ps_id);
+
+/******************************************************************************
+ * @brief Check if ads nv allow emerg vowifi
+ *
+ * @param[in] ps_id
+ *
+ * @return kal_bool: TRUE or FALSE
+ *
+ *****************************************************************************/
+kal_bool vdm_external_is_emerg_vowifi_support_by_ads_nv(protocol_id_enum ps_id);
+
+/******************************************************************************
+ * @brief update silent_redial_enable setting
+ *
+ * @param[in] new silent_redial_enable value
+ *
+ * @return void
+ *
+ *****************************************************************************/
+void vdm_external_update_silent_redial_enable_value(protocol_id_enum ps_id, kal_bool silent_redial_enable);
+
+/******************************************************************************
+ * @brief check current camping info
+ *
+ * @param[in] protocol_id_enum ps_id,rat_enum rat, kal_bool is_registered
+ *
+ * @return kal_bool: TRUE or FALSE
+ *
+ *****************************************************************************/
+kal_bool vdm_external_check_camping_info(protocol_id_enum ps_id,rat_enum rat, kal_bool is_registered);
+
+#endif // _VDM_EXTERNAL_LIB_H_
diff --git a/mcu/protocol/interface/general/vdm_gmss_struct.h b/mcu/protocol/interface/general/vdm_gmss_struct.h
new file mode 100644
index 0000000..b3db2b7
--- /dev/null
+++ b/mcu/protocol/interface/general/vdm_gmss_struct.h
@@ -0,0 +1,129 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2018
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*****************************************************************************
+ * Filename:
+ * ------------
+ * vdm_gmss_struct.h
+ *
+ * Project:
+ * ------------
+ * MOLY
+ *
+ * Description:
+ * ------------
+ * This file declares the structures for VDM/GMSS interface
+ *
+ * Author:
+ * -----------
+ * -------
+ *****************************************************************************/
+
+#ifndef _VDM_GMSS_STRUCT_H_
+#define _VDM_GMSS_STRUCT_H_
+
+#include "kal_public_defs.h"
+#include "kal_general_types.h"
+#include "l3_inc_enums_public.h"
+#include "l3_inc_enums.h"
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 trx_id;
+ rat_enum available_rat; /* rat need to be searched */
+ rat_enum prefer_rat; /* subset of available rat, search those RAT first */
+ kal_bool reset_srch_list; /* if true, gmss need to reset search list and barred list */
+ kal_uint16 camping_info_id; /* indicate the camping info used from VDM, only for 3GPP */
+} vdm_gmss_emc_service_scan_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint8 trx_id;
+ rat_enum available_rat;
+ vdm_gmss_failure_cause_enum failure_cause;
+} vdm_gmss_emc_service_ind_struct;
+
+typedef struct {
+ LOCAL_PARA_HDR
+ rat_enum rat;
+ plmn_id_struct plmn_id; /* used for rat is 3GPP only */
+ kal_uint16 band;
+ kal_uint16 channel; /* used for rat is 3GPP2 only */
+} vdm_gmss_emc_bar_network_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ rat_enum rat;
+ kal_uint16 band;
+ plmn_id_struct plmn_id; /* used for rat is 3GPP only */
+ kal_uint16 channel; /* used for rat is 3GPP2 only */
+ kal_bool is_registered; /*indicate if the record is registered or not*/
+ kal_bool is_ims_emergency_support; /*indicate if the cell support ims emergency call, only applicable when LTE cell*/
+ kal_uint16 camping_info_id; /*indicate the camping info id, only used for 3GPP */
+} vdm_gmss_camping_info_ind_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 trx_id; /* Transaction ID */
+ rat_enum available_rat; /* rat need to be searched */
+ rat_enum prefer_rat; /* subset of available rat, search those RAT first. RATN_NONE if no preference */
+ module_type source; /* The source module of this service scan */
+} vdm_gmss_service_scan_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ kal_uint32 trx_id; /* Transaction ID */
+ proc_status_enum status; /* PROC_SUCCESS, PROC_FAILED or PROC_REJECTED */
+ module_type source; /* The source module of this service scan */
+} vdm_gmss_service_scan_cnf_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ vdm_call_domain_enum ecbm_domain;
+} vdm_gmss_ecbm_mode_start_req_struct;
+
+typedef struct
+{
+ LOCAL_PARA_HDR
+ vdm_call_domain_enum ecbm_domain;
+} vdm_gmss_ecbm_mode_stop_req_struct;
+
+#endif // _VDM_GMSS_STRUCT_H_
diff --git a/mcu/protocol/interface/general/vt2csr_struct.h b/mcu/protocol/interface/general/vt2csr_struct.h
new file mode 100644
index 0000000..e774aa6
--- /dev/null
+++ b/mcu/protocol/interface/general/vt2csr_struct.h
@@ -0,0 +1,66 @@
+/*****************************************************************************
+* Copyright Statement:
+* --------------------
+* This software is protected by Copyright and the information contained
+* herein is confidential. The software may not be copied and the information
+* contained herein may not be used or disclosed except with the written
+* permission of MediaTek Inc. (C) 2007
+*
+* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
+*
+* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ * vt2csr_struct.h
+ *
+ * Project:
+ * --------
+ * MAUI
+ *
+ * Description:
+ * ------------
+ * This file is intends for structure definition between VT and CSR.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *=============================================================*/
+#ifndef _VT2CSR_STRUCT_H
+#define _VT2CSR_STRUCT_H
+
+#include "kal_general_types.h"
+#include "kal_public_defs.h"
+
+typedef struct vt_test_req_struct{
+ LOCAL_PARA_HDR
+ kal_uint32 data_size;
+ kal_uint8 raw_data [8000];
+}vt_test_req_struct;
+
+#endif