[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/l4/smic_struct.h b/mcu/protocol/interface/l4/smic_struct.h
new file mode 100644
index 0000000..ff1b51a
--- /dev/null
+++ b/mcu/protocol/interface/l4/smic_struct.h
@@ -0,0 +1,373 @@
+/*****************************************************************************
+*  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:
+* ---------
+* smic_struct.h
+*
+* Project:
+* --------
+*   VMOLY
+*
+* Description:
+* ------------
+*
+* Author:
+* -------
+ * -------
+******************************************************************************/
+
+#ifndef _SMIC_STRUCT_H_
+#define _SMIC_STRUCT_H_
+
+
+#include "kal_general_types.h"
+#include "kal_public_defs.h"
+#include "nas_sv_struct.h"
+#include "irat_common_enums.h"
+#include "irat_common_struct.h"
+#include "ps_public_enum.h"
+#include "ps_public_struct.h"
+#include "l3_inc_local.h"
+#include "tcm_eval_struct.h"
+
+/********************************************
+ *                  MACROS                  *
+ ********************************************/
+#define SMIC_MAX_NUM_OF_5G_IE_IN_PCO 10
+
+#define SMIC_5G_PCO_IE_S_NSSAI 0x001B
+#define SMIC_5G_PCO_IE_QOS_RULES 0x001C
+#define SMIC_5G_PCO_IE_SESSION_AMBR 0x001D
+#define SMIC_5G_PCO_IE_PDUS_ADDR_LIFETIME 0x001E
+#define SMIC_5G_PCO_IE_QOS_FLOW_DESCRIPTION 0x001F
+#define SMIC_5G_PCO_IE_ETHERNET_FRAME_PAYLOAD_MTU 0x0020
+#define SMIC_5G_PCO_IE_UNSTRUCTURED_LINK_MTU 0x0021
+
+#define SMIC_5G_PCO_IE_2_OCTET_QOS_RULES 0x0023
+#define SMIC_5G_PCO_IE_2_OCTET_QOS_FLOW_DESCRIPTION 0x0024
+
+
+
+/********************************************
+ *         TYPE DEFINITIONS & ENUMS         *
+ ********************************************/
+
+typedef enum {
+    SMIC_4G_BEARER_TYPE_DEFAULT,
+    SMIC_4G_BEARER_TYPE_DEDICATED,
+} smic_4g_bearer_type_enum;
+
+typedef enum {
+    SMIC_ACTIVE_SM_NONE, /* only exist in boot-up case */
+    SMIC_ACTIVE_SM_23G,
+    SMIC_ACTIVE_SM_4G,
+    SMIC_ACTIVE_SM_5G,
+    SMIC_ACTIVE_SM_MAX,
+} smic_active_sm_enum;
+
+typedef enum {
+    SMIC_CAMP_ON_AS_2G,
+    SMIC_CAMP_ON_AS_3G,
+    SMIC_CAMP_ON_AS_4G,
+    SMIC_CAMP_ON_AS_5G,
+    SMIC_CAMP_ON_AS_MAX,
+} smic_camp_on_as_rat_enum;
+
+typedef enum {
+    SMIC_5G_SET_RESULT_OK,
+    SMIC_5G_SET_RESULT_OK_BUT_NEED_ERR_ACTION,
+    SMIC_5G_SET_RESULT_MAX,
+} smic_5g_set_result_enum;
+
+
+typedef enum {
+    SMIC_4G_SET_RESULT_OK,
+    SMIC_4G_SET_RESULT_ERROR_SEND_CAUSE_TO_NW,
+    SMIC_4G_SET_RESULT_INVALID_INPUT_ARG,
+    SMIC_4G_SET_RESULT_MAX,
+} smic_4g_set_result_enum;
+
+
+typedef enum {
+    SMIC_REQ_ACTION_NONE, /* boot-up case */
+    SMIC_REQ_ACTION_FREE_CONTEXT, /* 3G5, 5G3 */
+    SMIC_REQ_ACTION_DO_CONTEXT_TRANSFER, /* 3G4, 4G3, 4G5 with N26, 5G4 with N26 */
+    SMIC_REQ_ACTION_FREE_CONTEXT_WITH_HANDOVER_CAUSE, /* 4G5 w/o N26, 5G4 w/o N26 */
+    SMIC_REQ_ACTION_MAX,
+} smic_req_action_enum;
+
+typedef struct {
+    kal_uint8 ebi;
+    kal_uint8 linked_ebi;
+    kal_uint8 mapped_psi;
+} smic_esm_active_ebi_info_struct;
+
+typedef struct {
+    kal_uint8 num_of_active_ebi;
+    smic_esm_active_ebi_info_struct active_ebi[MAX_L4_PS_EBI_NUM];
+} smic_esm_peer_msg_precheck_info_struct;
+
+typedef struct {
+    kal_uint8 num_of_to_del_epsb_ebi;
+    kal_uint8 to_del_epsb_ebi[MAX_L4_PS_EBI_NUM];
+    kal_bool need_sync_cause_to_nw;
+    ps_cause_enum cause;
+} smic_return_error_struct;
+
+
+typedef struct {
+    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;
+
+} smic_5g_ue_requested_context_struct;
+
+typedef struct {
+    kal_bool                        is_pdu_address_present;
+    ip_addr_struct                  pdu_address;
+    kal_bool                        is_dnn_present;
+    apn_struct                      dnn;
+    kal_bool                        is_emergency;
+    kal_bool                        is_ims;
+} smic_common_pdn_pdu_info_struct;
+
+typedef struct {
+    pdp_addr_type_enum              selected_pdu_session_type;
+    
+    kal_bool                        is_s_nssai_present;
+    pdus_s_nssai_struct             s_nssai;
+
+    kal_bool                        is_session_ambr_present;
+    pdus_session_ambr_struct        session_ambr;
+
+    kal_bool                        is_rq_timer_value_in_sec_present;
+    kal_uint32                      rq_timer_value_in_sec;
+
+    kal_bool                        is_pdu_session_release_time_present;
+    kal_uint32                      pdu_session_release_time;   
+
+    kal_bool                        is_always_on_pdu_session_ind_present;
+    always_on_pdu_session_ind_enum  always_on_pdu_session_ind;
+
+    pdus_qos_flow_struct qos_flow;
+
+    kal_bool is_capability_updated_to_nw;
+
+} smic_5g_nw_applied_context_struct;
+
+typedef enum {
+    SMIC_PDUS_CTX_STATUS_NOT_EXIST,
+    SMIC_PDUS_CTX_STATUS_EXIST_BY_5G_ASSOCIATED,
+    SMIC_PDUS_CTX_STATUS_EXIST_BY_4G_PROVIDED,
+    SMIC_PDUS_CTX_STATUS_MAX,
+} smic_pdus_ctx_status_enum;
+
+typedef struct {
+    /* maintained by VGSM owner */
+    smic_pdus_ctx_status_enum pdus_ctx_status;
+    
+    smic_5g_ue_requested_context_struct ue_requested_info;
+    smic_5g_nw_applied_context_struct   nw_applied_info;
+
+} smic_pdus_context_struct;
+
+
+typedef struct {
+    /* maintained by ESM owner */
+
+    //----Meta Data ; Do not directly access these items ; Use methods provided by smic_epsb.c -------------
+    kal_bool                        is_context_valid; // Whether this EPS Bearer is active. Only when EPS Bearer is active, is it's context valid
+    kal_uint8                       ebi; // The index in epsb_context[MAX_L4_PS_EBI_NUM] array.
+    kal_bool                        is_alloc_by_esm; 
+    kal_uint8                      ps_idx; 
+    // -------------------------
+
+
+
+
+    kal_uint8                       psi; // ID of PDU Session where this EPS bearer is established or its context is last modified.
+
+
+    irat_transfer_bearer_type_enum  bearer_type;
+
+    // Defined in TS 24.501 Mapped EPS Bearer Context IE
+    kal_bool                        is_apn_ambr_present;
+    eps_apn_ambr_struct             apn_ambr;
+
+    kal_bool                        is_eps_qos_present;
+    eps_qos_struct                  eps_qos;
+
+
+
+    struct
+    {
+        // 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;
+    } legacy_ctxt; // 23G Param.
+
+    
+} smic_ebi_context_struct;
+
+/* SM/ESM */
+typedef struct {
+    LOCAL_PARA_HDR
+    irat_type_enum irat_type;
+    rat_type_enum source_rat;
+    rat_type_enum target_rat;
+    ho_from_lte_type_enum ir_ho_type;
+} smic_active_sm_change_start_ind_struct;
+
+/* SM/ESM */
+typedef struct {
+    LOCAL_PARA_HDR
+    irat_type_enum irat_type;
+    irat_result_enum irat_result;
+    rat_type_enum source_rat;
+    rat_type_enum target_rat;
+    ho_from_lte_type_enum ir_ho_type;
+    smic_req_action_enum action; /* new for with/without N26 */
+} smic_active_sm_change_finish_ind_struct;
+
+/* ESM */
+typedef struct {
+    LOCAL_PARA_HDR
+    enasas_add_epsbearer_list_struct add_list;
+} smic_esm_as_para_update_ntf_req_struct;
+
+typedef struct {
+    LOCAL_PARA_HDR
+    kal_bool is_active_rat_4g;
+} smic_esm_active_rat_ind_struct;
+
+/* VGSM/RAT_TCM/RATDM */
+typedef struct {
+    LOCAL_PARA_HDR
+    smic_active_sm_enum source_sm;
+    smic_active_sm_enum target_sm;
+    smic_req_action_enum xsm_action;
+    smic_camp_on_as_rat_enum camp_on_as_rat;
+} smic_active_sm_change_ind_struct;
+
+typedef struct {
+    kal_uint16 protocol_id;
+    kal_uint16 protocol_config_len;
+    kal_uint8 *protocol_config;
+} smic_5g_config_option_struct;
+
+typedef struct {
+    smic_common_pdn_pdu_info_struct common_pdus_info;
+    smic_pdus_context_struct pdus_info;
+} smic_get_vgsm_context_struct;
+
+/* ESM<>SMIC */
+typedef struct {
+    smic_common_pdn_pdu_info_struct common_pdus_info;
+    smic_5g_nw_applied_context_struct pdus_info;
+} smic_vgsm_associated_ctx_struct;
+
+
+typedef struct
+{
+    bearer_ctxt_struct pdp_context; // Common struct to store 5G Mapped EPS Bearer / 4G EPS Bearer / 23G PDP Context
+
+    // Additional Params. used for 4G<>5G
+    kal_uint8            psi;
+    // Only valid when this is a Default EPS Bearer in 4G or 5G 
+    kal_bool             is_apn_ambr_present;
+    eps_apn_ambr_struct  apn_ambr;
+
+    kal_bool is_ims_bearer;
+
+
+} esm_smic_epsb_context_struct;
+
+typedef struct
+{
+  
+    // NSAPI / EBI (range is 5~15)
+    kal_uint8                       bearer_id;
+   
+    // 5G4 default/dedicated bearer would 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;
+            
+    bearer_service_type_enum				bearer_service_type;
+
+}esm_smic_precheck_epsb_context_struct;
+
+
+/********************************************
+ *                VARIABLES                 *
+ ********************************************/
+
+/********************************************
+ *           FUNCTION DECLARATIONS          *
+ ********************************************/
+
+
+#endif /* _SMIC_STRUCT_H_ */
+
+