[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/interface/middleware/hif/aomgr_enums.h b/mcu/interface/middleware/hif/aomgr_enums.h
new file mode 100644
index 0000000..7824d0c
--- /dev/null
+++ b/mcu/interface/middleware/hif/aomgr_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) 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:
+ * ---------
+ *   aomgr_enums.h
+ *
+ * Project:
+ * --------
+ *   TATAKA
+ *
+ * Description:
+ * ------------
+ *   AOMGR public enumeration definition.
+ *
+ * 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 __INC_AOMGR_ENUMS_H
+#define __INC_AOMGR_ENUMS_H
+
+/*------------------------------------------------------------------------------
+ * Data structure defintion.
+ *----------------------------------------------------------------------------*/
+
+#define APMOD_DHCP              0x0402  /* AP side, DHCP module ID */
+#define IPC_NETIF_ID_CCMNI_2    1       /* CCMNI network interface ID */
+
+
+
+#endif /* __INC_AOMGR_ENUMS_H */
diff --git a/mcu/interface/middleware/hif/aomgr_struct.h b/mcu/interface/middleware/hif/aomgr_struct.h
new file mode 100644
index 0000000..719e9b6
--- /dev/null
+++ b/mcu/interface/middleware/hif/aomgr_struct.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:
+ * ---------
+ *   aomgr_struct.h
+ *
+ * Project:
+ * --------
+ *   TATAKA
+ *
+ * Description:
+ * ------------
+ *   AOMGR ILM structure and interface definition.
+ *
+ * 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 __INC_AOMGR_STRUCT_H
+#define __INC_AOMGR_STRUCT_H
+
+#include "hif_ior.h"
+#include "hif_mw_msgid.h"
+#include "ipc_struct.h"
+
+/*
+ * Local parameter structure for MSG_ID_AOMGR_LINK_DOWN_IND
+ */
+typedef struct _aomgr_ipc_ntfy_t {
+    LOCAL_PARA_HDR
+    ipc_ntfy_param_t ipc_ntfy_para;
+} aomgr_ipc_ntfy_t;
+
+/*------------------------------------------------------------------------------
+ * DHL logging structure
+ *----------------------------------------------------------------------------*/
+typedef aomgr_ipc_ntfy_t aomgr_link_down_ind_struct;    /* MSG_ID_AOMGR_LINK_DOWN_IND */
+
+#endif /* __INC_AOMGR_STRUCT_H */
diff --git a/mcu/interface/middleware/hif/ccci_tty_if.h b/mcu/interface/middleware/hif/ccci_tty_if.h
new file mode 100644
index 0000000..97797f0
--- /dev/null
+++ b/mcu/interface/middleware/hif/ccci_tty_if.h
@@ -0,0 +1,198 @@
+/*****************************************************************************
+*  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:
+ * ---------
+ *   ccci_tty_if.h
+ *
+ * Project:
+ * --------
+ *   UMOLYA
+ *
+ * Description:
+ * ------------
+ *   Move enum/struct to interface folder
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 01 25 2021 adel.liao
+ * [MOLY00607924] [Nokia][ODU][Module Startup blocking] mipc_init spend 30s
+ * 	
+ * 	add mipc 10-14 interface.
+ *
+ * 12 14 2020 adel.liao
+ * [MOLY00605776] support MBIM_CID_DSS_CONNECT
+ * 	
+ * 	add DSS channels.
+ *
+ * 09 18 2020 li-cheng.tsai
+ * [MOLY00569647] [MP7.PRECHECKIN.DEV][Code sync] sync code from T700
+ * [R3.MP][OA][CCCI]code sync from T700
+ *
+ * 09 15 2020 li-cheng.tsai
+ * [MOLY00569647] [MP7.PRECHECKIN.DEV][Code sync] sync code from T700
+ * [MP7.PRECHECKIN.DEV][OA][CCCI]code sync from T700
+ *
+ * 08 04 2020 actory.ou
+ * [MOLY00554534] [Colgin][Code sync] sync code from MT6880.MP
+ * [T700][OA] add epdg ports
+ *
+ * 08 04 2020 actory.ou
+ * [MOLY00554534] [Colgin][Code sync] sync code from MT6880.MP
+ * [T700][OA][CCCI] sync from MT6880
+ *
+ * 07 07 2020 actory.ou
+ * [MOLY00543186] [Colgin] code sync to NR15.R3.MT6880.MP
+ * [R3.MT6880.MP][OA][CCCI] sync from COLGIN.SB.SMT.DEV
+ *
+ * 05 19 2020 actory.ou
+ * [MOLY00525599] code sync for Colgin
+ * [NR15.R3.COLGIN.SB.SMT.DEV][OA][CCCI] code sync from 19NOV
+ *
+ * 04 14 2020 actory.ou
+ * [MOLY00510681] [Colgin] add MD meta port
+ * [19NOV][OA] add meta eap port
+ *
+ * 03 23 2020 actory.ou
+ * [MOLY00502858] [Gen97][Gen98] merge ccci channel id/runtime data id
+ * [19NOV][OA][NCCCIDEV] sync TTY/NCCMNI port table
+ *
+ * 02 26 2020 actory.ou
+ * [MOLY00502106] [CCCI] add mbim port
+ * [19NOV.DEV][OA] add MBIM port
+ *
+ * 12 18 2019 actory.ou
+ * [MOLY00465742] [Gen97] add L5 channels and change CCIF SHM layout
+ * [19NOV.DEV][OA] add L5 channels
+ *
+ * 12 03 2019 actory.ou
+ * [MOLY00457575] ¥Ó?patch¡G§âALPS04415220¤¤ªº?ªG²¾´Ó¨ìMT6885¥­¥x¤W
+ * [VMOLY][OA] add mipi port & sysmsg
+ *
+ * 11 12 2019 actory.ou
+ * [MOLY00457575] ¥Ó?patch¡G§âALPS04415220¤¤ªº?ªG²¾´Ó¨ìMT6885¥­¥x¤W
+ * [1001.DEV][OA] add mipi port & SYSMSG
+ *
+ * 07 25 2019 actory.ou
+ * [MOLY00422649] [Gen97][EMAC][Patch back from Gen95] change uart/ccci name for network latency optimization
+ * [VMOLY][OA] sync channel
+ *
+ * 06 25 2019 actory.ou
+ * [MOLY00415834] ¡iBingo¡jSCPºÝ?¨ú³q???
+ * [VMOLY][OA] add  new SCP channel for CC state
+ *
+ * 05 07 2019 actory.ou
+ * [MOLY00404239] [VMOLY] sync latest channel setting from UMOLYE
+ * [VMOLY][OA] sync tty channel from UMOLYE
+ *
+ * 07 24 2018 actory.ou
+ * [MOLY00341790] [MT6295] UDC feature patch back
+ * add UDC feature ID and tty channel / replace ccci spinlock with HWITC
+ *
+ ****************************************************************************/
+#ifndef _CCCI_TTY_IF_H
+#define _CCCI_TTY_IF_H
+
+/*!
+ *  @brief CCCI_TTY_DEV_CNT defines the total number of CCCI_TTY devices
+ */
+typedef enum _cccitty_device_id {
+    CCCI_TTY_DEV_MIN           = 0,
+    CCCI_TTY_DEV_DHL           = 0,  //4 <ccci ch> CCCI_DHL_CHANNEL
+    CCCI_TTY_DEV_TST           = 1,  //4 <ccci ch> CCCI_TST_CHANNEL
+    CCCI_TTY_DEV_AT            = 2,  //4 <ccci ch> CCCI_AT_CHANNEL_TX
+    CCCI_TTY_DEV_GPD           = 3,  //4 <ccci ch> CCCI_GPS_CHANNEL_TX
+    CCCI_TTY_DEV_SIM           = 4,  //4 <ccci ch> CCCI_SIM_CHANNEL_TX
+    CCCI_TTY_DEV_DHL2          = 5,  //4 <ccci ch> CCCI_DHL2_CHANNEL
+    CCCI_TTY_DEV_ATCP          = 6,
+    CCCI_TTY_DEV_C2K_PPP       = 7,
+    CCCI_TTY_DEV_C2K_AGPS      = 8,
+    CCCI_TTY_DEV_CELLINFO      = 9,  //  <ccci ch> CCCI_CELLINFO_CHANNEL
+    CCCI_TTY_DEV_IMSM          = 10,  //  <ccci ch> CCCI_IMSM_CHANNEL
+    CCCI_TTY_DEV_WOA           = 11,  //  <ccci ch> CCCI_WOA_CHANNEL
+    CCCI_TTY_DEV_XUI           = 12,  //  <ccci ch> CCCI_XUI_CHANNEL
+    CCCI_TTY_DEV_BIP           = 13,  //  <ccci ch> CCCI_BIP_CHANNEL
+    CCCI_TTY_DEV_UDC           = 14,  //  <ccci ch> CCCI_UDC_CHANNEL
+    CCCI_TTY_DEV_NLOPT         = 15, // <ccci ch> CCCI_NLOPT_CHANNEL
+    CCCI_TTY_DEV_NLOPP         = 16, // <ccci ch> CCCI_NLOPP_CHANNEL
+    CCCI_TTY_DEV_SAR           = 17,  //  <ccci ch> CCCI_SAR_CHANNEL
+    CCCI_TTY_DEV_CIQ           = 18,  //  <ccci ch> CCCI_CIQ_CHANNEL
+    CCCI_TTY_DEV_IKERAW        = 19,  //  <ccci ch> CCCI_IKERAW_CHANNEL
+    CCCI_TTY_DEV_RIL_IPC0      = 20,  //  <ccci ch> CCCI_RIL_IPC0_CHANNEL
+    CCCI_TTY_DEV_RIL_IPC1      = 21,  //  <ccci ch> CCCI_RIL_IPC1_CHANNEL
+    CCCI_TTY_DEV_3G_VT         = 22,  //  <ccci ch> CCCI_3G_VT_CHANNEL
+    CCCI_TTY_DEV_CC_STATE      = 23,  //  <ccci ch> CCCI_CC_STATE_CHANNEL
+    CCCI_TTY_DEV_MIPI          = 24,  //  <ccci ch> CCCI_MIPI_CHANNEL
+    CCCI_TTY_DEV_MIPC_AP0      = 25, //  <ccci ch> CCCI_MIPC_AP0_CHANNEL
+    CCCI_TTY_DEV_MIPC_AP1      = 26, //  <ccci ch> CCCI_MIPC_AP1_CHANNEL
+    CCCI_TTY_DEV_MIPC_AP2      = 27, //  <ccci ch> CCCI_MIPC_AP2_CHANNEL
+    CCCI_TTY_DEV_MIPC_AP3      = 28, //  <ccci ch> CCCI_MIPC_AP3_CHANNEL
+    CCCI_TTY_DEV_MIPC_AP4      = 29, //  <ccci ch> CCCI_MIPC_AP4_CHANNEL
+    CCCI_TTY_DEV_MIPC_AP5      = 30, //  <ccci ch> CCCI_MIPC_AP5_CHANNEL
+    CCCI_TTY_DEV_MIPC_AP6      = 31, //  <ccci ch> CCCI_MIPC_AP6_CHANNEL
+    CCCI_TTY_DEV_MIPC_AP7      = 32, //  <ccci ch> CCCI_MIPC_AP7_CHANNEL
+    CCCI_TTY_DEV_MIPC_AP8      = 33, //  <ccci ch> CCCI_MIPC_AP8_CHANNEL
+    CCCI_TTY_DEV_MIPC_AP9      = 34, //  <ccci ch> CCCI_MIPC_AP9_CHANNEL
+    CCCI_TTY_DEV_MIPC_EAP0     = 35, //  <ccci ch> CCCI_MIPC_EAP0_CHANNEL
+    CCCI_TTY_DEV_MBIM_EAP0     = 36, //  <ccci ch> CCCI_MBIM_EAP0_CHANNEL
+    CCCI_TTY_DEV_LOG_EAP       = 37, //  <ccci ch> CCCI_MD_LOG_EAP for MD LOG
+    CCCI_TTY_DEV_META_EAP      = 38, //  <ccci ch> CCCI_TST_CHANNEL_EAP for MD META
+    CCCI_TTY_DEV_EPDG          = 39,  // <ccci ch> CCCI_EPDG_CHANNEL
+    CCCI_TTY_DEV_EPDG2         = 40,  // <ccci ch> CCCI_EPDG2_CHANNEL
+    CCCI_TTY_DEV_EPDG3         = 41,  // <ccci ch> CCCI_EPDG3_CHANNEL
+    CCCI_TTY_DEV_EPDG4         = 42,  // <ccci ch> CCCI_EPDG4_CHANNEL
+	CCCI_TTY_DEV_MBIM_DSS0_EAP = 43,  // <ccci ch> CCCI_MBIM_DSS0_EAP_CHANNEL
+	CCCI_TTY_DEV_MBIM_DSS1_EAP = 44,  // <ccci ch> CCCI_MBIM_DSS1_EAP_CHANNEL
+	CCCI_TTY_DEV_MBIM_DSS2_EAP = 45,  // <ccci ch> CCCI_MBIM_DSS2_EAP_CHANNEL
+	CCCI_TTY_DEV_MBIM_DSS3_EAP = 46,  // <ccci ch> CCCI_MBIM_DSS3_EAP_CHANNEL
+	CCCI_TTY_DEV_MBIM_DSS4_EAP = 47,  // <ccci ch> CCCI_MBIM_DSS4_EAP_CHANNEL
+	CCCI_TTY_DEV_MBIM_DSS5_EAP = 48,  // <ccci ch> CCCI_MBIM_DSS5_EAP_CHANNEL
+	CCCI_TTY_DEV_MBIM_DSS6_EAP = 49,  // <ccci ch> CCCI_MBIM_DSS6_EAP_CHANNEL
+	CCCI_TTY_DEV_MBIM_DSS7_EAP = 50,  // <ccci ch> CCCI_MBIM_DSS7_EAP_CHANNEL
+	CCCI_TTY_DEV_MIPC_AP10	   = 51, //  <ccci ch> CCCI_MIPC_AP10_CHANNEL
+	CCCI_TTY_DEV_MIPC_AP11	   = 52, //  <ccci ch> CCCI_MIPC_AP11_CHANNEL
+	CCCI_TTY_DEV_MIPC_AP12	   = 53, //  <ccci ch> CCCI_MIPC_AP12_CHANNEL
+	CCCI_TTY_DEV_MIPC_AP13	   = 54, //  <ccci ch> CCCI_MIPC_AP13_CHANNEL
+	CCCI_TTY_DEV_MIPC_AP14	   = 55, //  <ccci ch> CCCI_MIPC_AP14_CHANNEL
+    CCCI_TTY_DEV_CNT           = 56
+}cccitty_device_id;
+
+#endif //#ifndef _CCCI_TTY_IF_H
diff --git a/mcu/interface/middleware/hif/cdcecm_struct.h b/mcu/interface/middleware/hif/cdcecm_struct.h
new file mode 100644
index 0000000..9a88bec
--- /dev/null
+++ b/mcu/interface/middleware/hif/cdcecm_struct.h
@@ -0,0 +1,96 @@
+/*****************************************************************************
+*  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:
+ * ---------
+ *   cdcecm_struct.h
+ *
+ * Project:
+ * --------
+ *   MOLY
+ *
+ * Description:
+ * ------------
+ *   CDCECM ILM structure definition.
+ *
+ * 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 __INC_CDCECM_STRUCT_H
+#define __INC_CDCECM_STRUCT_H
+
+#include "hif_ior.h"
+#include "hif_mw_msgid.h"
+
+/*
+ * Local parameter structure for MSG_ID_CDCECM_START_DATA_PATH_REQ
+ */
+typedef struct 
+{
+    LOCAL_PARA_HDR
+    kal_uint8 class_id;
+} cdcecm_start_data_path_req_struct;
+
+/*
+ * Local parameter structure for MSG_ID_CDCECM_STOP_DATA_PATH_REQ
+ */
+typedef struct 
+{
+    LOCAL_PARA_HDR
+    kal_uint8 class_id;
+} cdcecm_stop_data_path_req_struct;
+
+/*
+ * Local parameter structure for MSG_ID_CDCECM_RELOAD_UPLINK_REQ
+ */
+typedef struct 
+{
+    LOCAL_PARA_HDR
+    kal_uint8 class_id;
+} cdcecm_reload_uplink_req_struct;
+
+#endif /* __INC_CDCECM_STRUCT_H */
diff --git a/mcu/interface/middleware/hif/dhcp4c_struct.h b/mcu/interface/middleware/hif/dhcp4c_struct.h
new file mode 100644
index 0000000..04ae1e0
--- /dev/null
+++ b/mcu/interface/middleware/hif/dhcp4c_struct.h
@@ -0,0 +1,260 @@
+/*!
+ *  @file dhcp4c_struct.h
+ *  @author Roger Huang <chaomin.haung@mediatek.com>
+ *  @version 1.0
+ *  @section LICENSE
+ *
+ *  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).
+ *
+ *  @section DESCRIPTION
+ *  This file provides structure definition of dhcp4c ( DHCPv4 Client )
+ */
+
+#ifndef _DHCP4C_STRUCT_H
+#define _DHCP4C_STRUCT_H
+
+
+/*!
+ *  @brief dhcp4c_cause_e enumerate possible cause of DHCPv4 Client
+ *  @param DHCP4C_CAUSE_MIN                 pseudo state
+ *  @param DHCP4C_CAUSE_SUCCESS             success
+ *  @param DHCP4C_CAUSE_NO_INSTANCE         no instance available
+ *  @param DHCP4C_CAUSE_INVALID_PARAMETER   parameter is invalid
+ *  @param DHCP4C_CAUSE_INVALID_STATE       not allow in this state
+ *  @param DHCP4C_CAUSE_MAX                 pseudo state
+ */
+typedef enum _dhcp4c_cause {
+    DHCP4C_CAUSE_MIN                                = 0,
+    DHCP4C_CAUSE_SUCCESS                            = 1,
+    DHCP4C_CAUSE_NO_INSTANCE                        = 2,
+    DHCP4C_CAUSE_INVALID_PARAMETER                  = 3,
+    DHCP4C_CAUSE_INVALID_STATE                      = 4,
+    DHCP4C_CAUSE_MAX                                = 5,
+} dhcp4c_cause_e;
+
+
+/*!
+ *  @brief dhcp4c_hardware_address_type_e enumerate possible hardward address
+ *         type of DHCPv4 Client
+ *  @param DHCP4C_HTYPE_MIN                 pseudo state
+ *  @param DHCP4C_HTYPE_ETHERNET            ethernet type
+ *  @param DHCP4C_HTYPE_MAX                 pseudo state
+ */
+typedef enum _dhcp4c_hardware_address_type {
+    DHCP4C_HTYPE_MIN                                = 0,
+    DHCP4C_HTYPE_ETHERNET                           = 1,
+    DHCP4C_HTYPE_MAX                                = 2,
+} dhcp4c_hardware_address_type_e;
+
+
+#define DHCP4C_MAX_HARDWARE_ADDRESS_SIZE            16
+/*!
+ *  @brief dhcp4c_activagte_req_struct describe activate request information
+ *         of DHCPv4 Client
+ */
+typedef struct _dhcp4c_activate_req_struct {
+    /*!
+     *  @brief ILM local parameter header
+     */
+    LOCAL_PARA_HDR
+    /*!
+     *  @brief ip instance identifier
+     */
+    kal_uint8       ip_id;
+    /*!
+     *  @brief hardware address type
+     */
+    dhcp4c_hardware_address_type_e  hardware_address_type;
+    /*!
+     *  @brief hardware address
+     */
+    kal_uint8       hardware_address[DHCP4C_MAX_HARDWARE_ADDRESS_SIZE];
+} dhcp4c_activate_req_struct;
+
+
+/*!
+ *  @brief dhcp4c_activate_rsp_struct describe activate response information
+ *         of DHCPv4 Client
+ */
+typedef struct _dhcp4c_activate_rsp_struct {
+    /*!
+     *  @brief ILM local parameter header
+     */
+    LOCAL_PARA_HDR
+    /*!
+     *  @brief ip instance identifier
+     */
+    kal_uint8       ip_id;
+    /*!
+     *  @brief DHCPv4 Client instance identifier
+     */
+    kal_uint8       dhcp_id;
+    /*!
+     *  @brief response cause
+     */
+    dhcp4c_cause_e  cause;
+} dhcp4c_activate_rsp_struct;
+
+
+/*!
+ *  @brief dhcp4c_deactivate_req_struct describe deactivate request information
+ *         of DHCPv4 Client
+ */
+typedef struct _dhcp4c_deactivate_req_struct {
+    /*!
+     *  @brief ILM local parameter header
+     */
+    LOCAL_PARA_HDR
+    /*!
+     *  @brief ip instance identifier
+     */
+    kal_uint8       ip_id;
+    /*!
+     *  @brief DHCPv4 Client instance identifier
+     */
+    kal_uint8       dhcp_id;
+} dhcp4c_deactivate_req_struct;
+
+
+/*!
+ *  @brief dhcp4c_deactivate_rsp_struct describe deactivate response information
+ *         of DHCPv4 Client
+ */
+typedef struct _dhcp4c_deactivate_rsp_struct {
+    /*!
+     *  @brief ILM local parameter header
+     */
+    LOCAL_PARA_HDR
+    /*!
+     *  @brief ip instance identifier
+     */
+    kal_uint8       ip_id;
+    /*!
+     *  @brief DHCPv4 Client instance identifier
+     */
+    kal_uint8       dhcp_id;
+    /*!
+     *  @brief response cause
+     */
+    dhcp4c_cause_e  cause;
+} dhcp4c_deactivate_rsp_struct;
+
+
+/*!
+ *  @brief dhcp4c_packet_req_struct describe packet request information
+ *         of DHCPv4 Client
+ */
+typedef struct _dhcp4c_packet_req_struct {
+    /*!
+     *  @brief ILM local parameter header
+     */
+    LOCAL_PARA_HDR
+    /*!
+     *  @brief ip instance identifier
+     */
+    kal_uint8       ip_id;
+    /*!
+     *  @brief DHCPv4 Client instance identifier
+     */
+    kal_uint8       dhcp_id;
+    /*!
+     *  @brief request gpd packet buffer
+     */
+    void*           gpd;
+} dhcp4c_packet_req_struct;
+
+
+/*!
+ *  @brief dhcp4c_packet_ind_struct describe packet indicate information
+ *         of DHCPv4 Client
+ */
+typedef struct _dhcp4c_packet_ind_struct {
+    /*!
+     *  @brief ILM local parameter header
+     */
+    LOCAL_PARA_HDR
+    /*!
+     *  @brief ip instance identifier
+     */
+    kal_uint8       ip_id;
+    /*!
+     *  @brief DHCPv4 Client instance identifier
+     */
+    kal_uint8       dhcp_id;
+    /*!
+     *  @brief indicate gpd packet buffer
+     */
+    void*           gpd;
+} dhcp4c_packet_ind_struct;
+
+
+/*!
+ *  @brief dhcp4c_ip_up_ind_struct describe ip up indicate information
+ *         of DHCPv4 Client
+ */
+typedef struct _dhcp4c_ip_up_ind_struct {
+    /*!
+     *  @brief ILM local parameter header
+     */
+    LOCAL_PARA_HDR
+    /*!
+     *  @brief ip instance identifier
+     */
+    kal_uint8       ip_id;
+    /*!
+     *  @brief DHCPv4 Client instance identifier
+     */
+    kal_uint8       dhcp_id;
+} dhcp4c_ip_up_ind_struct;
+
+
+/*!
+ *  @brief dhcp4c_ip_down_ind_struct describe ip down indicate information
+ *         of DHCPv4 Client
+ */
+typedef struct _dhcp4c_ip_down_ind_struct {
+    /*!
+     *  @brief ILM local parameter header
+     */
+    LOCAL_PARA_HDR
+    /*!
+     *  @brief ip instance identifier
+     */
+    kal_uint8       ip_id;
+    /*!
+     *  @brief DHCPv4 Client instance identifier
+     */
+    kal_uint8       dhcp_id;
+} dhcp4c_ip_down_ind_struct;
+
+
+#endif  // _DHCP4C_STRUCT_H
+
diff --git a/mcu/interface/middleware/hif/dpfm_api.h b/mcu/interface/middleware/hif/dpfm_api.h
new file mode 100644
index 0000000..06fdc92
--- /dev/null
+++ b/mcu/interface/middleware/hif/dpfm_api.h
@@ -0,0 +1,266 @@
+/*****************************************************************************
+*  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:
+ * ---------
+ *   dpfm_api.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!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * 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 __DPFM_API_H
+#define __DPFM_API_H
+
+#include "hif_ior.h"
+#include "hif_mw_msgid.h"
+#include "ipc_api.h"
+#include "ipc_defs_public.h"
+#include "ipc_enums.h"
+
+#include "dpfm_enums.h"
+#include "dpfm_struct.h"
+
+/*------------------------------------------------------------------------------
+ * Constant definition.
+ *----------------------------------------------------------------------------*/
+#define DPFM_VERSION             2
+#define DPFM_MAX_CT_TABLE_NUM    64
+
+#define DPFM_PKT_TYPE_FILTER_DEL_ACK    0x1
+
+/*------------------------------------------------------------------------------
+ * Global variables.
+ *----------------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------------------
+ * Helper Macro.
+ *----------------------------------------------------------------------------*/
+#define DPFM_GET_PKT_TYPE_FROM_PSN(_psn) (((_psn) & 0x0F00) >> 8)
+
+/*------------------------------------------------------------------------------
+ * Public fucntions.
+ *----------------------------------------------------------------------------*/
+kal_bool dpfm_init(void);
+kal_bool dpfm_reset(void);
+void dpfm_on_ilm(ilm_struct *ilm);
+kal_int32 dpfm_enable(void *info);
+kal_int32 dpfm_disable(void *info);
+kal_int32 dpfm_activate(void *info);
+kal_int32 dpfm_deactivate(void *info);
+
+/*!
+ * Update global alert data usage base on the received packet.
+ *
+ * @param   packet_len [IN] Length of the packet
+ * @param   netif_id [IN] netif_id for the packet.
+ */
+void dpfm_update_global_alert_data_usage(kal_uint32 packet_len, kal_uint32 netif_id);
+
+/*!
+ * Update iquota data usage base on the received packet.
+ *
+ * @param   uplink [IN] Is uplink traffic. false for downlink traffic.
+ * @param   in_netif_id [IN] Source netif_id for the packet.
+ * @param   out_netif_id [IN] Destination netif_id for the packet.
+ * @param   protocol [IN] Protocol of the packet
+ * @param   packet_len [IN] Length of the packet
+ */
+void dpfm_update_iquota_data_usage(kal_bool uplink, kal_uint32 in_netif_id, kal_uint32 out_netif_id, kal_uint8 protocol, kal_uint32 packet_len);
+
+/*!
+ * Check the packet should be sent to which netif.
+ *
+ * @param   uplink [IN] Is uplink traffic. false for downlink traffic.
+ * @param   ip_type [IN] IP type of the packet.
+ * @param   pkt_des [IN] Descriptor of the packet.
+ * @param   in_netif_id [IN] Source netif_id for the packet.
+ * @param   out_netif_id [OUT] Destination netif_id for the packet.
+ *
+ * @return  KAL_TRUE if match DPFM SW filter. KAL_FALSE otherwise.
+ */
+kal_bool dpfm_check_route(kal_bool uplink, kal_uint8 ip_type, ipc_pkt_des_t *pkt_des, kal_uint32 in_netif_id, kal_uint32 *out_netif_id);
+
+/*!
+ * Check if the packet needed to add filter.
+ *
+ * @param   uplink [IN] Is uplink traffic. false for downlink traffic.
+ * @param   pkt_des [IN] Descriptor of the packet.
+ * @param   in_netif_id [IN] Source netif_id for the packet.
+ */
+void dpfm_track_packet(kal_bool uplink, ipc_pkt_des_t *pkt_des, kal_uint32 in_netif_id);
+
+/*!
+ * Process SW filter according to HW filter command result.
+ *
+ * @param   pkt_des [IN] Descriptor of the packet.
+ */
+void dpfm_process_filter_cmd_result(ipc_pkt_des_t *pkt_des);
+
+/*!
+ * Register to DPFM LAN device.
+ *
+ * @param   lan_dev_id [IN] DPFM LAN device id.
+ * @param   dev_info [IN] lan device information.
+ *
+ * @return  KAL_TRUE if register successfully. KAL_FALSE otherwise.
+ */
+kal_bool dpfm_lan_dev_register(kal_uint8 lan_dev_id, dpfm_lan_dev_info_t *dev_info);
+
+/*!
+ * Query DPFM is activated.
+ *
+ * @return  KAL_TRUE if DPFM is activated. KAL_FALSE otherwise.
+ */
+kal_bool dpfm_is_active(void);
+
+/*!
+ * Get DPFM SW filter according to filter id.
+ *
+ * @param   filter_id [IN] DPFM SW filter id.
+ *
+ * @return  SW filter if found. NULL otherwise.
+ */
+dpfm_filter_t* dpfm_find_filter_by_id(kal_int16 filter_id);
+
+/*!
+ * Remove DPFM sensitive data.
+ */
+void dpfm_module_clean(void);
+
+#endif
diff --git a/mcu/interface/middleware/hif/dpfm_enums.h b/mcu/interface/middleware/hif/dpfm_enums.h
new file mode 100644
index 0000000..6d69afc
--- /dev/null
+++ b/mcu/interface/middleware/hif/dpfm_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) 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:
+ * ---------
+ *   dpfm_enums.h
+ *
+ * Project:
+ * --------
+ *   UMOLYA
+ *
+ * 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!!
+ *==============================================================================
+ *******************************************************************************/
+#ifndef __DPFM_ENUMS_H
+#define __DPFM_ENUMS_H
+
+typedef enum _dpfm_action_e {
+    DPFM_ACTION_ADD,
+    DPFM_ACTION_DELETE,
+} dpfm_action_e;
+
+typedef enum _dpfm_rule_tag_info_e {
+    DPFM_RULE_TAG_NORMAL_PACKET = 0,
+    DPFM_RULE_TAG_FAKE_DL_NAT_PACKET,
+} dpfm_rule_tag_info_e;
+
+typedef enum _dpfm_lan_dev_e {
+    DPFM_LAN_DEV_USB   = 0,
+    DPFM_LAN_DEV_WIFI  = 1,
+    DPFM_LAN_DEV_CNT,
+    DPFM_LAN_DEV_DUMMY = 0xFF,
+} dpfm_lan_dev_e;
+
+typedef enum _dpfm_ct_protocol_e {
+    DPFM_CT_PROTOCOL_TCP = 0,
+    DPFM_CT_PROTOCOL_UDP,
+    DPFM_CT_PROTOCOL_CNT,
+} dpfm_ct_protocol_e;
+
+typedef enum _dpfm_filter_state_e {
+    DPFM_F_STATE_UNINIT             = 0,
+    DPFM_F_STATE_ACTIVE             = 1,
+    DPFM_F_STATE_LAN_DEV_DELETING   = 2,
+    DPFM_F_STATE_HW_DELETING        = 3,
+} dpfm_filter_state_e;
+
+#endif
+
diff --git a/mcu/interface/middleware/hif/dpfm_mdfpm_struct.h b/mcu/interface/middleware/hif/dpfm_mdfpm_struct.h
new file mode 100644
index 0000000..4c3f9c5
--- /dev/null
+++ b/mcu/interface/middleware/hif/dpfm_mdfpm_struct.h
@@ -0,0 +1,109 @@
+/*****************************************************************************
+*  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:
+ * ---------
+ *   dpfm_mdfpm_struct.h
+ *
+ * Project:
+ * --------
+ *   VMOLY
+ *
+ * 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!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+#ifndef __DPFM_MDFPM_STRUCT_H
+#define __DPFM_MDFPM_STRUCT_H
+
+#include "mdfpm_public_api.h"
+#include "dpfm_struct.h"
+
+/*------------------------------------------------------------------------------
+ * Constant definition.
+ *----------------------------------------------------------------------------*/
+#define DPFM_PARTIAL_CT_TABLE_NUM    ((MDFPM_TTY_BUF_SZ - 8) / sizeof(dpfm_ct_nat_table_entry_t))
+#define DPFM_MAX_CT_TABLE_NUM        64
+
+/*------------------------------------------------------------------------------
+ * Data Structure.
+ *----------------------------------------------------------------------------*/
+#ifdef __TEMP_MDDP_WH_SUPPORT__
+/* Partial CT NUM = (MDFPM_BUF_SZ - HDR) / sizeof(dpfm_ct_nat_table_entry_t) */
+typedef struct _dpfm_notify_ct_timeout_ind_struct {
+    LOCAL_PARA_HDR
+    kal_uint16 entry_num;
+    dpfm_ct_nat_table_entry_t ct_nat_table_entry[DPFM_PARTIAL_CT_TABLE_NUM];
+} dpfm_notify_ct_timeout_ind_struct;
+#else 
+typedef struct _dpfm_notify_ct_timeout_ind_struct {
+    LOCAL_PARA_HDR
+    kal_uint16 entry_num;
+    dpfm_ct_nat_table_entry_t ct_nat_table_entry[DPFM_MAX_CT_TABLE_NUM];
+} dpfm_notify_ct_timeout_ind_struct;
+#endif 
+
+typedef struct _dpfm_set_global_alert_req_struct {
+    LOCAL_PARA_HDR
+    kal_uint32 cmd;
+    dpfm_global_alert_t ga;
+} dpfm_set_global_alert_req_struct;
+
+#endif /* __DPFM_MDFPM_STRUCT_H */
diff --git a/mcu/interface/middleware/hif/dpfm_struct.h b/mcu/interface/middleware/hif/dpfm_struct.h
new file mode 100644
index 0000000..8c1716f
--- /dev/null
+++ b/mcu/interface/middleware/hif/dpfm_struct.h
@@ -0,0 +1,357 @@
+/*****************************************************************************
+*  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:
+ * ---------
+ *   dpfm_struct.h
+ *
+ * Project:
+ * --------
+ *   VMOLY
+ *
+ * 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!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+#ifndef __DPFM_STRUCT_H
+#define __DPFM_STRUCT_H
+
+#include "hif_lhif.h"
+
+/*------------------------------------------------------------------------------
+ * Constant definition.
+ *----------------------------------------------------------------------------*/
+#define DPFM_MAX_FILTER_CNT          128
+#define DPFM_MAX_LAN_DEV_USER_NUM    16
+#define DPFM_HASH_TABLE_SIZE         128
+#define DPFM_MAX_HW_FILTER_CNT       128
+#define DPFM_MAX_HW_CMD_CNT          128
+
+#define DPFM_DECLARE_OBJECT \
+            kal_int32       ref_count; \
+            kal_int32       reader_cnt; \
+            kal_int32       writer_cnt;
+/*------------------------------------------------------------------------------
+ * Data Structure.
+ *----------------------------------------------------------------------------*/
+typedef struct _dpfm_ipv4_rule_t {
+    kal_uint32      private_ip;
+    kal_uint32      public_ip;
+    kal_uint32      remote_ip;
+    kal_uint16      private_port;
+    kal_uint16      public_port;
+    kal_uint16      remote_port;
+    kal_uint8       protocol;
+    kal_uint8       reserved;
+    kal_uint32      lan_netif_id;
+    kal_uint32      wan_netif_id;
+} dpfm_ipv4_rule_t;
+
+typedef struct _dpfm_ipv6_rule_t {
+    kal_uint32      private_ip[4];
+    kal_uint32      remote_ip[4];
+    kal_uint16      private_port;
+    kal_uint16      remote_port;
+    kal_uint8       protocol;
+    kal_uint8       reserved[3];
+    kal_uint32      lan_netif_id;
+    kal_uint32      wan_netif_id;
+} dpfm_ipv6_rule_t;
+
+typedef struct _dpfm_tag_packet_t {
+    kal_uint16  guard_pattern;
+    kal_uint8   version;
+    kal_uint8   tag_len;
+    union {
+        struct {
+            kal_uint8   in_netif_id;
+            kal_uint8   out_netif_id;
+            kal_uint16  port;
+        } v1;
+        struct {
+            kal_uint8   tag_info;
+            kal_uint8   reserved;
+            kal_uint16  port;
+            kal_uint32  lan_netif_id;
+            kal_uint32  ip;
+        } v2;
+    } type;
+} dpfm_tag_packet_t;
+
+typedef struct _dpfm_lan_dev_info_t {
+    kal_uint32  netif_id;
+    kal_uint8   net_type;
+    kal_bool    (*notify_add_rule)(kal_int16 filter_id, kal_uint8 *tag);
+    kal_bool    (*notify_match_rule)(kal_bool is_uplink, kal_int16 filter_id);
+    kal_bool    (*notify_del_rule)(kal_int16 filter_id);
+} dpfm_lan_dev_info_t;
+
+typedef struct _dpfm_filter_t {
+    DPFM_DECLARE_OBJECT
+
+    kal_int16               id;
+    kal_uint8               ip_type;
+    kal_uint8               reserved;
+    union {
+        dpfm_ipv4_rule_t     ipv4_rule;
+        dpfm_ipv6_rule_t     ipv6_rule;
+    } rule;
+    kal_uint32              lan_netif_id;
+    kal_uint32              wan_netif_id;
+    struct _dpfm_filter_t   *next_filter[2];
+    kal_uint32              last_access_time;
+    dpfm_filter_state_e     state;
+} dpfm_filter_t;
+
+typedef struct _dpfm_ipv6_filter_t {
+    DPFM_DECLARE_OBJECT
+
+    kal_uint32      ip[4];
+    kal_uint8       is_valid;
+    kal_uint8       reserved[3];
+    kal_uint32      netif_id;
+} dpfm_ipv6_filter_t;
+
+typedef struct _dpfm_filter_list_t {
+    DPFM_DECLARE_OBJECT
+
+    dpfm_filter_t    *filter;
+} dpfm_filter_list_t;
+
+typedef struct _dpfm_ipv6_dl_filter_cbk_context_t {
+    kal_uint8       lan_dev_id;
+    kal_uint8       reserved[3];
+    kal_uint32      lan_dev_user_id;
+} dpfm_ipv6_dl_filter_cbk_context_t;
+
+typedef struct _dpfm_lan_dev_t {
+    kal_bool                            is_activated;
+    dpfm_lan_dev_info_t                  info;
+    kal_uint32                          private_ip;
+    kal_int32                           ipv6_dl_filter_id[DPFM_MAX_LAN_DEV_USER_NUM][DPFM_CT_PROTOCOL_CNT];
+    kal_uint32                          ipv6_dl_filter_cnt[DPFM_MAX_LAN_DEV_USER_NUM];
+    dpfm_ipv6_filter_t                   ipv6_dl_filters[DPFM_MAX_LAN_DEV_USER_NUM];
+    dpfm_ipv6_dl_filter_cbk_context_t    ipv6_dl_filter_cbk_context[DPFM_MAX_LAN_DEV_USER_NUM];
+} dpfm_lan_dev_t;
+
+typedef struct _dpfm_ct_timeout_t {
+    kal_uint32          value;
+    kal_uint32          cnt;
+} dpfm_ct_timeout_t;
+
+typedef struct _dpfm_hw_cmd_q_t {
+    kal_bool                    is_send_ilm;
+    kal_uint32                  read_idx;
+    kal_uint32                  write_idx;
+    kal_int16                   filter_id[DPFM_MAX_FILTER_CNT];
+    lhif_ul_nat_inband_data_t   cmd[DPFM_MAX_FILTER_CNT];
+} dpfm_hw_cmd_q_t;
+
+typedef struct _dpfm_t {
+    kal_bool            is_activated;
+    kal_uint32          user_cnt;
+    kal_uint32          ccmni_lan_netif_id;
+    kal_int16           filter_cmd_read_index;
+    kal_int16           filter_cmd_write_index;
+    kal_int16           filter_id_by_cmd_id[DPFM_MAX_HW_CMD_CNT];
+    kal_int16           filter_id_by_index[DPFM_MAX_HW_FILTER_CNT];
+    kal_uint32          filter_cnt;
+    dpfm_filter_t       filters[DPFM_MAX_FILTER_CNT];
+    dpfm_filter_list_t  hash_table[2][DPFM_HASH_TABLE_SIZE]; // uplink & downlink
+    dpfm_lan_dev_t      lan_dev[DPFM_LAN_DEV_CNT];
+    dpfm_ct_timeout_t   ct_timeout[DPFM_CT_PROTOCOL_CNT];
+    kal_bool            is_filter_send_hw_cmd[DPFM_MAX_FILTER_CNT];
+    dpfm_hw_cmd_q_t     hw_cmd_q;
+} dpfm_t;
+
+#ifdef __TEMP_MDDP_WH_SUPPORT__
+typedef struct _dpfm_ct_nat_table_entry_t {
+    kal_uint32      private_ip;
+    kal_uint32      target_ip;
+    kal_uint32      public_ip;
+    kal_uint16      private_port;
+    kal_uint16      target_port;
+    kal_uint16      public_port;
+    kal_uint8       protocol;
+    kal_uint8       reserved;
+    kal_uint32      timestamp;
+    kal_bool        dst_nat;
+} dpfm_ct_nat_table_entry_t;
+#else 
+typedef struct _dpfm_ct_nat_table_entry_t {
+    kal_uint32      private_ip;
+    kal_uint16      private_port;
+    kal_uint32      target_ip;
+    kal_uint16      target_port;
+    kal_uint32      public_ip;
+    kal_uint16      public_port;
+    kal_uint8       protocol;
+    kal_uint8       reserved;
+    kal_uint32      timestamp;
+    kal_bool        dst_nat;
+} dpfm_ct_nat_table_entry_t;
+#endif 
+
+/* ILM structures definition for Data Usage */
+typedef struct _dpfm_global_alert_t {
+    kal_uint32     trans_id;
+    kal_uint32     status;                 //unused
+    kal_uint64     measure_buffer_size;
+    kal_int8       dpfm_id;
+    kal_uint8      reserved[3];
+} dpfm_global_alert_t;
+
+typedef struct _dpfm_iquota_t {
+    kal_uint32     trans_id;
+    kal_uint32     status;                 //unused
+    kal_uint64     limit_buffer_size;
+    kal_int8       dpfm_id;
+    kal_uint8      reserved[3];
+} dpfm_iquota_t;
+
+typedef struct _dpfm_data_usage_cmd_struct {
+    LOCAL_PARA_HDR
+    kal_uint32 cmd;
+} dpfm_data_usage_cmd_struct;
+
+typedef struct _dpfm_alert_global_alert_ind_struct {
+    LOCAL_PARA_HDR
+    kal_uint32 cmd;
+    dpfm_global_alert_t ga;
+} dpfm_alert_global_alert_ind_struct;
+
+typedef struct _dpfm_set_iquota_req_struct {
+    LOCAL_PARA_HDR
+    kal_uint32 cmd;
+    dpfm_iquota_t iq;
+} dpfm_set_iquota_req_struct;
+
+typedef struct _dpfm_alert_iquota_ind_struct {
+    LOCAL_PARA_HDR
+    kal_uint32 cmd;
+    dpfm_iquota_t iq;
+} dpfm_alert_iquota_ind_struct;
+
+typedef struct _dpfm_del_iquota_req_struct {
+    LOCAL_PARA_HDR
+    kal_uint32 cmd;
+    dpfm_iquota_t iq;
+} dpfm_del_iquota_req_struct;
+
+#ifdef __TEMP_MDDP_WH_SUPPORT__
+typedef struct _dpfm_set_ct_timeout_req_struct {
+    LOCAL_PARA_HDR
+    kal_uint32 udp_timeout_value;
+    kal_uint32 tcp_timeout_value;
+    kal_uint8  reserved[4];
+} dpfm_set_ct_timeout_req_struct;
+
+typedef struct _dpfm_set_ct_timeout_rsp_struct {
+    LOCAL_PARA_HDR
+    kal_uint32 udp_timeout_value;
+    kal_uint32 tcp_timeout_value;
+    kal_uint8  result; //bool
+    kal_uint8  reserved[3];
+} dpfm_set_ct_timeout_rsp_struct;
+
+#else 
+typedef struct _dpfm_set_ct_timeout_req_struct {
+    LOCAL_PARA_HDR
+    kal_uint32 tcp_timeout_value;
+    kal_uint32 udp_timeout_value;
+    kal_uint8  reserved[4];
+} dpfm_set_ct_timeout_req_struct;
+
+typedef struct _dpfm_set_ct_timeout_rsp_struct {
+    LOCAL_PARA_HDR
+    kal_uint32 tcp_timeout_value;
+    kal_uint32 udp_timeout_value;
+    kal_uint8  result; //bool
+    kal_uint8  reserved[3];
+} dpfm_set_ct_timeout_rsp_struct;
+
+#endif 
+typedef struct _dpfm_lan_dev_del_filter_ind_struct {
+    LOCAL_PARA_HDR
+    kal_int16 filter_id;
+    kal_uint8 reserved[2];
+} dpfm_lan_dev_del_filter_ind_struct;
+
+#endif
+
diff --git a/mcu/interface/middleware/hif/ethercore_struct.h b/mcu/interface/middleware/hif/ethercore_struct.h
new file mode 100644
index 0000000..d008376
--- /dev/null
+++ b/mcu/interface/middleware/hif/ethercore_struct.h
@@ -0,0 +1,77 @@
+/*****************************************************************************
+*  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 _ETHERCORE_STRUCT_H
+#define _ETHERCORE_STRUCT_H
+
+
+/*!
+ *  @brief ethc_device_instance_t describe instance of a generic ether device
+ */
+typedef struct _ethc_device_instance {
+    /*!
+     *  @brief instance id of this device
+     */
+    kal_uint8   eth_id;
+} ethc_device_instance_t;
+
+/*!
+ * @brief ethc_link_req_type_e link request type
+ */
+typedef enum _ethc_link_req_type_e {
+    ETHC_LINK_REQ_TYPE_NORMAL,
+    ETHC_LINK_REQ_TYPE_DPFM,
+} ethc_link_req_type_e;
+
+/*!
+ *  @brief ethc_device_link_msg_t describe link message used to notify link up
+ *         and up to ether device
+ */
+typedef struct _ethc_device_link_msg {
+    LOCAL_PARA_HDR
+    /*!
+     *  @brief instance of ether device
+     */
+    ethc_device_instance_t* instance;
+    ethc_link_req_type_e req_type;
+} ethc_device_link_msg_t;
+
+
+/*------------------------------------------------------------------------------
+ * DHL logging structure
+ *----------------------------------------------------------------------------*/
+typedef ethc_device_link_msg_t ethercore_link_up_req_struct;
+typedef ethc_device_link_msg_t ethercore_link_down_req_struct;
+
+#endif /* _ETHERCORE_STRUCT_H */
diff --git a/mcu/interface/middleware/hif/hif_esl_common.h b/mcu/interface/middleware/hif/hif_esl_common.h
new file mode 100644
index 0000000..c0ff571
--- /dev/null
+++ b/mcu/interface/middleware/hif/hif_esl_common.h
@@ -0,0 +1,79 @@
+/*****************************************************************************
+*  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:
+ * ---------
+ *    hif_esl_common.h
+ *
+ * Project:
+ * --------
+ *   UMOLY
+ *
+ * Description:
+ * ------------
+ *    This file intends for ESL common definition
+ *
+ * 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 _HIF_ESL_COMMON_H_
+#define _HIF_ESL_COMMON_H_
+
+#include "kal_general_types.h"
+
+#define default_ccmni_netif 0x00
+#define default_mbim_netif  0x200
+#define default_rndis_netif 0x100
+#define default_ecm_netif   0x100
+
+typedef struct _hif_esl_netif_parm {
+    LOCAL_PARA_HDR
+    kal_uint32 netif_id;
+} hif_esl_netif_parm;
+
+#endif /* _HIF_ESL_COMMON_H_ */
+
diff --git a/mcu/interface/middleware/hif/hif_ior.h b/mcu/interface/middleware/hif/hif_ior.h
new file mode 100644
index 0000000..de49bb4
--- /dev/null
+++ b/mcu/interface/middleware/hif/hif_ior.h
@@ -0,0 +1,129 @@
+/*!
+ *  @file hif_ior.h
+ *  @author Roger Huang <chaomin.haung@mediatek.com>
+ *  @version 1.0
+ *  @section LICENSE
+ *
+ *  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).
+ *
+ *  @section DESCRIPTION
+ *  This file provides generic HIF IO Request interface of all HIF module
+ */
+
+#ifndef __HIF_IOR_H__
+#define __HIF_IOR_H__
+
+#include "qmu_bm.h"
+
+/*!
+ *  @brief hif_io_request_t is a typedef of struct _hif_io_request
+ */
+typedef struct _hif_io_request hif_io_request_t;
+/*!
+ *  @brief struct _hif_io_request describe io request used to communicate
+ *         between hif modules
+ */
+struct _hif_io_request {
+    /*!
+     *  @brief next io request
+     */
+    hif_io_request_t*       next_request;
+    /*!
+     *  @brief pointer to current gpd of this io request
+     */
+    qbm_gpd*                first_gpd;
+    /*!
+     *  @brief pointer to last gpd of this io request
+     */
+    qbm_gpd*                last_gpd;
+};
+
+
+/*!
+ *  @brief hif_io_request_list_t is a typedef of struct _hif_io_request_list
+ */
+typedef struct _hif_io_request_list hif_io_request_list_t;
+/*!
+ *  @brief struct _hif_io_request_list describe io request list used to
+ *                store io request
+ */
+struct _hif_io_request_list {
+    /*!
+     *  @brief pointer to head of this io request list
+     */
+    hif_io_request_t*       head;
+    /*!
+     *  @brief pointer to tail of this io request list
+     */
+    hif_io_request_t*       tail;
+};
+
+
+#define HIF_LIST_INIT(_list)                                \
+    ((_list)->head = (_list)->tail = NULL)
+
+
+#define HIF_LIST_IS_EMPTY(_list)                            \
+    ((_list)->head == NULL)
+
+
+#define HIF_LIST_GET_HEAD(_list)                            \
+    ((_list)->head)
+
+
+#define HIF_LIST_GET_TAIL(_list)                            \
+    ((_list)->tail)
+
+
+#define HIF_LIST_POP_HEAD(_list)                            \
+    ((_list)->head);                                        \
+    {                                                       \
+        void* next;                                         \
+        next = (_list)->head->next_request;                 \
+        (_list)->head = next;                               \
+        if (next == NULL) {                                 \
+            (_list)->tail = NULL;                           \
+        }                                                   \
+    }
+
+
+#define HIF_LIST_PUSH_TAIL(_list, _entry)                   \
+    {                                                       \
+        (_entry)->next_request = NULL;                      \
+        if ((_list)->tail) {                                \
+            (_list)->tail->next_request = (_entry);         \
+        } else {                                            \
+            (_list)->head = (_entry);                       \
+        }                                                   \
+        (_list)->tail = (_entry);                           \
+    }
+
+#endif  // __HIF_IOR_H__
diff --git a/mcu/interface/middleware/hif/ipc_api.h b/mcu/interface/middleware/hif/ipc_api.h
new file mode 100644
index 0000000..02a3237
--- /dev/null
+++ b/mcu/interface/middleware/hif/ipc_api.h
@@ -0,0 +1,1540 @@
+/*****************************************************************************
+*  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:
+ * ---------
+ *   ipc_api.h
+ *
+ * Project:
+ * --------
+ *   TATAKA
+ *
+ * Description:
+ * ------------
+ *   IP Core public structure and interface definition.
+ *
+ * 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!
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+#ifndef __INC_IPC_API_H
+#define __INC_IPC_API_H
+
+#include "hif_ior.h"
+#include "hif_mw_msgid.h" /*< expected to remove it when other other module include the header file */
+#include "lhif_if.h"
+
+#include "ipc_defs_public.h"
+#include "ipc_enums.h"
+#include "ipc_struct.h"
+
+/*------------------------------------------------------------------------------
+ * Data structure definition.
+ *----------------------------------------------------------------------------*/
+typedef struct _ipc_pkt_des_t {
+    ipc_pkt_des_type_e          des_type;
+    kal_uint8                  *packet;
+    kal_uint32                  packet_len;
+    union {
+        struct {
+            qbm_gpd            *gpd;
+            qbm_gpd            *bd;
+        };
+        struct {
+            upcm_did           *did;
+            kal_uint32          pkt_start_idx;
+            kal_uint16          psn;
+        };
+        struct {
+            lhif_meta_tbl_t    *meta;
+        };
+        struct {
+            void               *ipf_meta;
+        };
+    };
+    ipc_filter_t              **matched_filter;
+    ipc_filter_info_t          *filter_info;
+    kal_bool                    is_packet_info;     /**< KAL_TRUE : Already parsed packet_info, KAL_FALSE : Not parsed packet_info yet */
+    ipc_packet_info_t          *packet_info;
+    kal_uint8                   ip_type;
+} ipc_pkt_des_t;
+
+typedef struct _ipc_pkt_t {
+    union {
+        kal_bool            isGPD;      /**< KAL_TRUE : Describe GPD list (with head/tail), KAL_FALSE : Describe single data buffer (with pointer/length) */
+        ipc_pkt_des_type_e  buf_type;   /**< Buffer type */
+    };
+
+    union {
+        /* Used if buf_type == IPC_PKT_DES_TYPE_GPD */
+        /* Used if isGPD == KAL_FALSE */
+        struct {
+            qbm_gpd    *head;      /**< Head of GPD List. Used if isGPD == KAL_TRUE */
+            qbm_gpd    *tail;      /**< Tail of GPD List. Used if isGPD == KAL_TRUE */
+        };
+
+        /* Used if buf_type == IPC_PKT_DES_TYPE_DID */
+        struct {
+            upcm_did   *did_head;      /**< Head of DID List. Used if buf_type == IPC_PKT_DES_TYPE_DID */
+            upcm_did   *did_tail;      /**< Tail of DID List. Used if buf_type == IPC_PKT_DES_TYPE_DID */
+        };
+
+        /* Used if buf_type == IPC_PKT_DES_TYPE_META */
+        struct {
+            kal_uint32   start_idx;    /**< Start of meta List. Used if buf_type == IPC_PKT_DES_TYPE_META */
+            kal_uint32   end_idx;      /**< End of DID List. Used if buf_type == IPC_PKT_DES_TYPE_META */
+        };
+    };
+
+    /* Used if buf_type == IPC_PKT_DES_TYPE_NO_DESC */
+    /* Used if isGPD == KAL_FALSE */
+    kal_uint8   *data;      /**< Data pointer of buffer. Used if isGPD == KAL_FALSE */
+    kal_uint32  data_len;   /**< Data pointer of buffer. Used if isGPD == KAL_FALSE */
+
+} ipc_pkt_t;
+/*------------------------------------------------------------------------------
+ * Helper Macro.
+ *----------------------------------------------------------------------------*/
+/*
+ * IPv4/IPv6 common.
+ */
+#define IPC_NE_GET_1B(_buf) \
+            ((kal_uint8)*((kal_uint8 *)(_buf)))
+#define IPC_NE_SET_1B(_buf, _value) \
+            do { \
+                *((kal_uint8 *)(_buf)) = (kal_uint8)(_value); \
+            } while (0)
+
+#ifndef IPC_ON_BIG_ENDIAN_PLATFORM /* little-endian platform */
+    #define IPC_NE_GET_2B(_buf) \
+            ( (((kal_uint16)*((kal_uint8 *)(_buf) + 0)) << 8) | \
+              (((kal_uint16)*((kal_uint8 *)(_buf) + 1)) << 0) )
+
+    #define IPC_NE_SET_2B(_buf, _value) \
+            do { \
+                *((kal_uint8 *)(_buf) + 0) = (kal_uint8)((_value) >> 8); \
+                *((kal_uint8 *)(_buf) + 1) = (kal_uint8)((_value) >> 0); \
+            } while (0)
+
+    #define IPC_NE_GET_4B(_buf) \
+            ( (((kal_uint32)*((kal_uint8 *)(_buf) + 0)) << 24) | \
+              (((kal_uint32)*((kal_uint8 *)(_buf) + 1)) << 16) | \
+              (((kal_uint32)*((kal_uint8 *)(_buf) + 2)) << 8) | \
+              (((kal_uint32)*((kal_uint8 *)(_buf) + 3)) << 0) )
+
+    #define IPC_NE_SET_4B(_buf, _value) \
+            do { \
+                *((kal_uint8 *)(_buf) + 0) = (kal_uint8)((_value) >> 24); \
+                *((kal_uint8 *)(_buf) + 1) = (kal_uint8)((_value) >> 16); \
+                *((kal_uint8 *)(_buf) + 2) = (kal_uint8)((_value) >> 8); \
+                *((kal_uint8 *)(_buf) + 3) = (kal_uint8)((_value) >> 0); \
+            } while (0)
+
+    #define IPC_H2N_2B(_value) \
+            (((kal_uint16)(_value) >> 8) | (((kal_uint16)(_value) & 0xff) << 8))
+
+#else /* big-endian platform */
+    #define IPC_NE_GET_2B(_buf) \
+        ( (((kal_uint16)*((kal_uint8 *)(_buf) + 0)) << 0) | \
+          (((kal_uint16)*((kal_uint8 *)(_buf) + 1)) << 8) )
+
+    #define IPC_NE_SET_2B(_buf, _value) \
+        do { \
+            *((kal_uint8 *)(_buf) + 0) = (kal_uint8)((_value) >> 0); \
+            *((kal_uint8 *)(_buf) + 1) = (kal_uint8)((_value) >> 8); \
+        } while (0)
+
+    #define IPC_NE_GET_4B(_buf) \
+        ( (((kal_uint32)*((kal_uint8 *)(_buf) + 0)) << 0) | \
+          (((kal_uint32)*((kal_uint8 *)(_buf) + 1)) << 8) | \
+          (((kal_uint32)*((kal_uint8 *)(_buf) + 2)) << 16) | \
+          (((kal_uint32)*((kal_uint8 *)(_buf) + 3)) << 24) )
+
+    #define IPC_NE_SET_4B(_buf, _value) \
+            do { \
+                *((kal_uint8 *)(_buf) + 0) = (kal_uint8)((_value) >> 0); \
+                *((kal_uint8 *)(_buf) + 1) = (kal_uint8)((_value) >> 8); \
+                *((kal_uint8 *)(_buf) + 2) = (kal_uint8)((_value) >> 16); \
+                *((kal_uint8 *)(_buf) + 3) = (kal_uint8)((_value) >> 24); \
+            } while (0)
+
+    #define IPC_H2N_2B(_value) \
+            ((kal_uint16)(_value))
+#endif
+
+#define IPC_HDR_IS_V4(_ip_hdr) \
+        (0x40 == (*((kal_uint8 *)(_ip_hdr)) & 0xf0))
+
+#define IPC_HDR_IS_V6(_ip_hdr) \
+        (0x60 == (*((kal_uint8 *)(_ip_hdr)) & 0xf0))
+
+
+#define IPC_CP_ADDR(_dst, _src, _len) \
+        kal_mem_cpy((_dst), (_src), (_len))
+
+#define IPC_EQ_ADDR(_addr1, _addr2, _len) \
+        (0 == kal_mem_cmp((_addr1), (_addr2), (_len)))
+
+#define IPC_EQ_2BYTE(_ptr1, _ptr2) \
+        (   ((*(kal_uint8 *)(_ptr1)) == (*((kal_uint8 *)(_ptr2)))) && \
+            ((*((kal_uint8 *)(_ptr1) + 1)) == (*(((kal_uint8 *)(_ptr2) + 1))))    )
+
+#define IPC_EQ_1BYTE(_ptr1, _ptr2) \
+        ((*(kal_uint8 *)(_ptr1)) == (*((kal_uint8 *)(_ptr2))))
+
+
+/*
+ * IANA IP Protocol Numbers.
+ * Ref: http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xml
+ */
+#define IPC_HDR_PROT_IPV6_HOP           0 /* IPv6 Hop-by-Hop Option */
+#define IPC_HDR_PROT_ICMP               1 /* Internet Control Message */
+#define IPC_HDR_PROT_IGMP               2 /* Internet Group Message */
+#define IPC_HDR_PROT_IPV4_ENC           4 /* IPv4 encapsulation */
+#define IPC_HDR_PROT_TCP                6 /* Transmission Control */
+#define IPC_HDR_PROT_UDP                17 /* User Datagram */
+#define IPC_HDR_PROT_IPV6_ENC           41 /* IPv6 encapsulation */
+#define IPC_HDR_PROT_IPV6_ROUTE         43 /* Routing Header for IPv6 */
+#define IPC_HDR_PROT_IPV6_FRAG          44 /* Fragment Header for IPv6 */
+#define IPC_HDR_PROT_ESP                50 /* Encap Security Payload */
+#define IPC_HDR_PROT_AH                 51 /* Authentication Header */
+#define IPC_HDR_PROT_ICMPV6             58 /* ICMP for IPv6 */
+#define IPC_HDR_PROT_IPV6_NONEXT        59 /* No Next Header for IPv6 */
+#define IPC_HDR_PROT_IPV6_DEST          60 /* Destination Options for IPv6 */
+
+/*
+ * IPv4.
+ */
+#define IPC_HDR_V4_ADDR_SIZE        (4)
+#define IPC_HDR_V4_HEADER_SIZE      (20)
+
+#define IPC_HDR_V4_GET_IHL(_ip_header) \
+        ((IPC_NE_GET_1B(_ip_header) & 0x0f) << 2)
+
+#define IPC_HDR_V4_SET_IHL(_ip_header, _ihl) \
+        do { \
+            IPC_NE_SET_1B(_ip_header, (IPC_NE_GET_1B(_ip_header) & 0xF0) | (((kal_uint8)(_ihl)>>2) & 0x0F)); \
+        } while (0)
+
+/*
+ * 2016/02/24 Peter.Hsu
+ * To support ECN, we extend existing DSCP API to cover ECN due to backward compatibility.
+ */
+
+/* Get/Set both DSCP & ECN (total 8 bits) */
+#define IPC_HDR_V4_GET_DSCP(_ip_header) \
+        (IPC_NE_GET_1B(((kal_uint8*)(_ip_header)) + 1))
+
+#define IPC_HDR_V4_SET_DSCP(_ip_header, _dscp_ecn) \
+        do { \
+            IPC_NE_SET_1B(((kal_uint8*)(_ip_header)) + 1, IPC_NE_GET_1B(((kal_uint8*)(_ip_header)) + 1) | (kal_uint8)(_dscp_ecn)); \
+        } while (0)
+
+#define IPC_HDR_V4_RESET_VER_IHL_DSCP_ECN(_ip_header) \
+        do { \
+            IPC_NE_SET_1B(_ip_header, 0x45); \
+            IPC_NE_SET_1B(((kal_uint8 *)(_ip_header)) + 1, 0x00); \
+        } while (0)
+
+#define IPC_HDR_V4_GET_TOTAL_LENGTH(_ip_header) \
+        IPC_NE_GET_2B(((kal_uint8 *)(_ip_header)) + 2)
+
+#define IPC_HDR_V4_SET_TOTAL_LENGTH(_ip_header, _length) \
+        do { \
+            IPC_NE_SET_2B(((kal_uint8 *)(_ip_header)) + 2, _length); \
+        } while (0)
+
+#define IPC_HDR_V4_GET_IDENTITY(_ip_header) \
+        IPC_NE_GET_2B(((kal_uint8 *)(_ip_header)) + 4)
+
+#define IPC_HDR_V4_SET_IDENTITY(_ip_header, _id) \
+        do { \
+            IPC_NE_SET_2B(((kal_uint8 *)(_ip_header)) + 4, _id); \
+        } while (0)
+
+#define IPC_HDR_V4_GET_FLAGS(_ip_header) \
+        ((*(((kal_uint8 *)(_ip_header) + 6))) >> 5)
+
+#define IPC_HDR_V4_SET_FLAGS(_ip_header, _flags) \
+        do { \
+            IPC_NE_SET_1B(((kal_uint8*)(_ip_header)) + 6, (IPC_NE_GET_1B(((kal_uint8*)(_ip_header)) + 6) & 0x1F) | ((kal_uint8)(_flags) << 5));\
+        } while (0)
+
+#define IPC_HDR_V4_IS_MF(_ip_header) \
+        (IPC_HDR_V4_GET_FLAGS(_ip_header) & 0x04)
+
+#define IPC_HDR_V4_GET_FRAG_OFFSET(_ip_header) \
+        (IPC_NE_GET_2B(((kal_uint8 *)(_ip_header)) + 6) & 0x1fff)
+
+#define IPC_HDR_V4_SET_FRAG_OFFSET(_ip_header, _offset) \
+        do { \
+        IPC_NE_SET_2B((((kal_uint8 *)(_ip_header)) + 6), \
+                       ((IPC_NE_GET_2B(((kal_uint8 *)(_ip_header)) + 6) & 0xe000) | \
+                         ((kal_uint16)(_offset) & 0x1fff)) ); \
+        } while (0)
+
+#define IPC_HDR_V4_IS_FRAG(_ip_header) \
+        (IPC_HDR_V4_IS_MF(_ip_header) || (0 != IPC_HDR_V4_GET_FRAG_OFFSET(_ip_header)))
+
+#define IPC_HDR_V4_GET_TTL(_ip_header) \
+        IPC_NE_GET_1B(((kal_uint8 *)(_ip_header)) + 8)
+
+#define IPC_HDR_V4_SET_TTL(_ip_header, _ttl) \
+        do { \
+            IPC_NE_SET_1B(((kal_uint8 *)(_ip_header)) + 8, (kal_uint8)(_ttl)); \
+        } while (0)
+
+#define IPC_HDR_V4_GET_PROTOCOL(_ip_header) \
+        IPC_NE_GET_1B(((kal_uint8 *)(_ip_header)) + 9)
+
+#define IPC_HDR_V4_SET_PROTOCOL(_ip_header, _protocol) \
+        do { \
+            IPC_NE_SET_1B(((kal_uint8 *)(_ip_header)) + 9, (kal_uint8)(_protocol)); \
+        } while (0)
+
+#define IPC_HDR_V4_EQ_PROTOCOL(_ip_header, _protocol)   \
+        (IPC_HDR_V4_GET_PROTOCOL(_ip_header) == (_protocol))
+
+#define IPC_HDR_V4_GET_HEADER_CHECKSUM(_ip_header) \
+        IPC_NE_GET_2B((kal_uint8 *)(_ip_header) + 10)
+
+#define IPC_HDR_V4_SET_HEADER_CHECKSUM(_ip_header, _checksum) \
+        do { \
+            IPC_NE_SET_2B((kal_uint8 *)(_ip_header) + 10, _checksum); \
+        } while (0)
+
+#define IPC_HDR_V4_GET_SRC_ADDR(_ip_header) \
+        ((kal_uint8 *)(_ip_header) + 12)
+
+#define IPC_HDR_V4_SET_SRC_ADDR(_ip_header, _src_ip_addr) \
+        do { \
+            IPC_CP_V4_ADDR(IPC_HDR_V4_GET_SRC_ADDR(_ip_header), _src_ip_addr); \
+        } while (0)
+
+#define IPC_HDR_V4_GET_DST_ADDR(_ip_header) \
+        ((kal_uint8 *)(_ip_header) + 16)
+
+#define IPC_HDR_V4_SET_DST_ADDR(_ip_header, _dst_ip_addr) \
+        do { \
+            IPC_CP_V4_ADDR(IPC_HDR_V4_GET_DST_ADDR(_ip_header), _dst_ip_addr); \
+        } while (0)
+
+#define IPC_HDR_V4_GET_NHPTR(_ip_header) \
+        ((kal_uint8 *)(_ip_header) + IPC_HDR_V4_GET_IHL(_ip_header))
+
+#define IPC_CP_V4_ADDR(_dst, _src) \
+        do { \
+        IPC_CP_ADDR(_dst, _src, IPC_HDR_V4_ADDR_SIZE); \
+        } while (0)
+
+#define IPC_EQ_V4_ADDR(_addr1, _addr2) \
+        IPC_EQ_ADDR(_addr1, _addr2, IPC_HDR_V4_ADDR_SIZE)
+
+#define IPC_IS_V4_CLASSA_ADDR(_addr) \
+        ( 0x00 == (*((kal_uint8 *)(_addr)) & 0xf0) )
+
+#define IPC_IS_V4_CLASSB_ADDR(_addr) \
+        ( 0x80 == (*((kal_uint8 *)(_addr)) & 0xf0) )
+
+#define IPC_IS_V4_CLASSC_ADDR(_addr) \
+        ( 0xc0 == (*((kal_uint8 *)(_addr)) & 0xf0) )
+
+#define IPC_IS_V4_CLASSD_ADDR(_addr) \
+        ( 0xe0 == (*((kal_uint8 *)(_addr)) & 0xf0) )
+
+#define IPC_IS_V4_UNSPECIFIED_ADDR(_addr) \
+        ( 0 == *((kal_uint8*)(_addr)) && \
+          0 == *((kal_uint8*)(_addr)+1) && \
+          0 == *((kal_uint8*)(_addr)+2) && \
+          0 == *((kal_uint8*)(_addr)+3) )
+
+/*
+ * IPv6.
+ */
+#define IPC_HDR_V6_ADDR_SIZE        (16)
+#define IPC_HDR_V6_HEADER_SIZE      (40)
+#define IPC_HDR_V6_MAX_HOP          (255)
+
+#define IPC_HDR_V6_LENGTH_OFFSET    (4)
+#define IPC_HDR_V6_NH_TYPE_OFFSET   (6)
+#define IPC_HDR_V6_HOP_LIMIT_OFFSET (7)
+#define IPC_HDR_V6_SRC_ADDR_OFFSET  (8)
+#define IPC_HDR_V6_DST_ADDR_OFFSET  (24)
+
+#define IPC_HDR_V6_GET_TC(_ip_header) \
+        ((IPC_NE_GET_2B(_ip_header) >> 4) & 0xff)
+
+#define IPC_HDR_V6_SET_TC(_ip_header, _tc) \
+        do { \
+            IPC_NE_SET_2B(_ip_header, \
+                          ((IPC_NE_GET_2B(_ip_header) & 0xf00f) | (((kal_uint16)(_tc) & 0xff) << 4))); \
+        } while (0)
+
+#define IPC_HDR_V6_GET_FLOW_LABEL(_ip_header) \
+        (IPC_NE_GET_4B(_ip_header) & 0xfffff)
+
+#define IPC_HDR_V6_SET_FLOW_LABEL(_ip_header, _flow_label) \
+        do { \
+        IPC_NE_SET_4B(_ip_header, \
+                      ((IPC_NE_GET_4B(_ip_header) & 0xfff00000) | ((kal_uint32)(_flow_label) & 0xfffff))); \
+        } while (0)
+
+#define IPC_HDR_V6_RESET_VER_TC_FL(_ip_header) \
+        do { \
+            kal_mem_set((kal_uint8 *)(_ip_header), 0, 4); \
+            *((kal_uint8 *)(_ip_header)) |= 0x60; \
+        } while (0)
+
+#define IPC_HDR_V6_GET_LENGTH(_ip_header) \
+        IPC_NE_GET_2B((kal_uint8 *)(_ip_header) + IPC_HDR_V6_LENGTH_OFFSET)
+
+#define IPC_HDR_V6_SET_LENGTH(_ip_header, _length) \
+        do { \
+            IPC_NE_SET_2B((kal_uint8 *)(_ip_header) + IPC_HDR_V6_LENGTH_OFFSET, _length); \
+        } while (0)
+
+#define IPC_HDR_V6_GET_NH_TYPE(_ip_header) \
+        IPC_NE_GET_1B(((kal_uint8 *)(_ip_header)) + IPC_HDR_V6_NH_TYPE_OFFSET)
+
+#define IPC_HDR_V6_SET_NH_TYPE(_ip_header, _type) \
+        do { \
+            IPC_NE_SET_1B(((kal_uint8 *)(_ip_header)) + IPC_HDR_V6_NH_TYPE_OFFSET, (kal_uint8)(_type)); \
+        } while (0)
+
+#define IPC_HDR_V6_GET_HOP_LIMIT(_ip_header) \
+        IPC_NE_GET_1B((kal_uint8 *)(_ip_header) + IPC_HDR_V6_HOP_LIMIT_OFFSET)
+
+#define IPC_HDR_V6_SET_HOP_LIMIT(_ip_header, _hop_limit) \
+        do { \
+            IPC_NE_SET_1B(((kal_uint8 *)(_ip_header)) + IPC_HDR_V6_HOP_LIMIT_OFFSET, (kal_uint8)(_hop_limit)); \
+        } while (0)
+
+#define IPC_HDR_V6_GET_SRC_ADDR(_ip_header) \
+        ((kal_uint8 *)(_ip_header) + IPC_HDR_V6_SRC_ADDR_OFFSET)
+
+#define IPC_HDR_V6_SET_SRC_ADDR(_ip_header, _src_ip_addr) \
+        do { \
+            IPC_CP_V6_ADDR(IPC_HDR_V6_GET_SRC_ADDR(_ip_header), _src_ip_addr); \
+        } while (0)
+
+#define IPC_HDR_V6_GET_DST_ADDR(_ip_header) \
+        ((kal_uint8 *)(_ip_header) + IPC_HDR_V6_DST_ADDR_OFFSET)
+
+#define IPC_HDR_V6_SET_DST_ADDR(_ip_header, _dst_ip_addr) \
+        do { \
+            IPC_CP_V6_ADDR(IPC_HDR_V6_GET_DST_ADDR(_ip_header), _dst_ip_addr); \
+        } while (0)
+
+#define IPC_HDR_V6_GET_NHPTR(_ip_header) \
+        ((kal_uint8 *)(_ip_header) + IPC_HDR_V6_HEADER_SIZE)
+
+#define IPC_HDR_V6_SET_DST_SOL_MCST_ADDR(_ip_header, _dst_ip_addr) \
+        do { \
+            *(IPC_HDR_V6_GET_DST_ADDR(_ip_header)) = 0xff; \
+            *(IPC_HDR_V6_GET_DST_ADDR(_ip_header) + 1) = 0x02; \
+            kal_mem_set(IPC_HDR_V6_GET_DST_ADDR(_ip_header) + 2, 0, 9); \
+            *(IPC_HDR_V6_GET_DST_ADDR(_ip_header) + 11) = 0x01; \
+            *(IPC_HDR_V6_GET_DST_ADDR(_ip_header) + 12) = 0xff; \
+            kal_mem_cpy(IPC_HDR_V6_GET_DST_ADDR(_ip_header) + 13, (kal_uint8 *)(_dst_ip_addr) + 13, 3); \
+        } while (0)
+
+#define IPC_HDR_V6EXT_GET_NH_TYPE(_ext_header) \
+        IPC_NE_GET_1B(_ext_header)
+
+#define IPC_HDR_V6EXT_GET_HDR_EXT_LEN(_ext_header) \
+        ((IPC_NE_GET_1B(((kal_uint8*)(_ext_header))+1) + 1) << 3)
+
+#define IPC_IS_V6_LINK_LOCAL_ADDR(_addr) \
+        (   (0xfe == IPC_NE_GET_1B(_addr)) && \
+            (0x80 == IPC_NE_GET_1B(((kal_uint8*)(_addr)) + 1)))
+
+#define IPC_IS_V6_GLOBAL_ADDR(_addr) \
+        ( 0x20 == (IPC_NE_GET_1B(_addr) & 0xe0) )
+
+#define IPC_IS_V6_UNSPECIFIED_ADDR(_addr) \
+        ( 0x00 == *((kal_uint8 *)(_addr)) && \
+          0x00 == *((kal_uint8 *)(_addr) +  1) && \
+          0x00 == *((kal_uint8 *)(_addr) +  2) && \
+          0x00 == *((kal_uint8 *)(_addr) +  3) && \
+          0x00 == *((kal_uint8 *)(_addr) +  4) && \
+          0x00 == *((kal_uint8 *)(_addr) +  5) && \
+          0x00 == *((kal_uint8 *)(_addr) +  6) && \
+          0x00 == *((kal_uint8 *)(_addr) +  7) && \
+          0x00 == *((kal_uint8 *)(_addr) +  8) && \
+          0x00 == *((kal_uint8 *)(_addr) +  9) && \
+          0x00 == *((kal_uint8 *)(_addr) + 10) && \
+          0x00 == *((kal_uint8 *)(_addr) + 11) && \
+          0x00 == *((kal_uint8 *)(_addr) + 12) && \
+          0x00 == *((kal_uint8 *)(_addr) + 13) && \
+          0x00 == *((kal_uint8 *)(_addr) + 14) && \
+          0x00 == *((kal_uint8 *)(_addr) + 15))
+
+#define IPC_IS_V6_MCST_ADDR(_addr) \
+        ( 0xff == IPC_NE_GET_1B(_addr) )
+
+#define IPC_CP_V6_ADDR(_dst, _src) \
+        IPC_CP_ADDR(_dst, _src, IPC_HDR_V6_ADDR_SIZE)
+
+#define IPC_EQ_V6_ADDR(_addr1, _addr2) \
+        IPC_EQ_ADDR(_addr1, _addr2, IPC_HDR_V6_ADDR_SIZE)
+
+/*
+ * IPv6 fragment header
+ */
+#define IPC_HDR_V6_FRAGMENT_HEADER_SIZE (8)
+
+/*
+ * UDP.
+ */
+#define IPC_HDR_UDP_HEADER_SIZE     (8)
+
+#define IPC_HDR_UDP_GET_SRC_PORT(_udp) \
+        IPC_NE_GET_2B(_udp)
+
+#define IPC_HDR_UDP_SET_SRC_PORT(_udp, _src_port) \
+        IPC_NE_SET_2B((kal_uint8 *)(_udp), _src_port)
+
+#define IPC_HDR_UDP_EQ_SRC_PORT(_udp, _src_port)    \
+        (IPC_HDR_UDP_GET_SRC_PORT(_udp) == (_src_port))
+
+#define IPC_HDR_UDP_GET_DST_PORT(_udp) \
+        IPC_NE_GET_2B((kal_uint8 *)(_udp) + 2)
+
+#define IPC_HDR_UDP_SET_DST_PORT(_udp, _dst_port) \
+        IPC_NE_SET_2B((kal_uint8 *)(_udp) + 2, _dst_port)
+
+#define IPC_HDR_UDP_EQ_DST_PORT(_udp, _dst_port)    \
+        (IPC_HDR_UDP_GET_DST_PORT(_udp) == (_dst_port))
+
+#define IPC_HDR_UDP_GET_LENGTH(_udp) \
+        IPC_NE_GET_2B((kal_uint8 *)(_udp) + 4)
+
+#define IPC_HDR_UDP_SET_LENGTH(_udp, _length) \
+        IPC_NE_SET_2B((kal_uint8 *)(_udp) + 4, _length)
+
+#define IPC_HDR_UDP_GET_CHECKSUM(_udp) \
+        IPC_NE_GET_2B((kal_uint8 *)(_udp) + 6)
+
+#define IPC_HDR_UDP_SET_CHECKSUM(_udp, _checksum) \
+        IPC_NE_SET_2B((kal_uint8 *)(_udp) + 6, _checksum)
+
+/*
+ * TCP.
+ */
+#define IPC_HDR_TCP_FLAG_FIN    0x01
+#define IPC_HDR_TCP_FLAG_SYN    0x02
+#define IPC_HDR_TCP_FLAG_RST    0x04    // Reset
+#define IPC_HDR_TCP_FLAG_PUSH   0x08
+#define IPC_HDR_TCP_FLAG_ACK    0x10
+#define IPC_HDR_TCP_FLAG_URG    0x20    // Urgent
+#define IPC_HDR_TCP_FLAG_ECE    0x40    // ECN Echo
+#define IPC_HDR_TCP_FLAG_CWR    0x80    // Congestion Window Reduced
+#define IPC_HDR_TCP_FLAG_NS     0x100   // ECN-nonce concealment protection (added to header by RFC 3540)
+
+
+#define IPC_HDR_TCP_HEADER_SIZE     (20)
+
+#define IPC_HDR_TCP_GET_SRC_PORT(_tcp) \
+        IPC_NE_GET_2B(_tcp)
+
+#define IPC_HDR_TCP_SET_SRC_PORT(_tcp, _src_port) \
+        IPC_NE_SET_2B(_tcp, _src_port)
+
+#define IPC_HDR_TCP_EQ_SRC_PORT(_tcp, _src_port)    \
+        (IPC_HDR_TCP_GET_SRC_PORT(_tcp) == (_src_port))
+
+#define IPC_HDR_TCP_GET_DST_PORT(_tcp) \
+        IPC_NE_GET_2B((kal_uint8 *)(_tcp) + 2)
+
+#define IPC_HDR_TCP_SET_DST_PORT(_tcp, _dst_port) \
+        IPC_NE_SET_2B((kal_uint8 *)(_tcp) + 2, _dst_port)
+
+#define IPC_HDR_TCP_EQ_DST_PORT(_tcp, _dst_port)    \
+        (IPC_HDR_TCP_GET_DST_PORT(_tcp) == (_dst_port))
+
+#define IPC_HDR_TCP_GET_SEQ_NUM(_tcp) \
+        IPC_NE_GET_4B((kal_uint8 *)(_tcp) + 4)
+
+#define IPC_HDR_TCP_SET_SEQ_NUM(_tcp, _seq_num) \
+        IPC_NE_SET_4B((kal_uint8 *)(_tcp) + 4, _seq_num)
+
+#define IPC_HDR_TCP_EQ_SEQ_NUM(_tcp, _seq_num)    \
+        (IPC_HDR_TCP_GET_SEQ_NUM(_tcp) == (_seq_num))
+
+#define IPC_HDR_TCP_GET_ACK_NUM(_tcp) \
+        IPC_NE_GET_4B((kal_uint8 *)(_tcp) + 8)
+
+#define IPC_HDR_TCP_SET_ACK_NUM(_tcp, _ack_num) \
+        IPC_NE_SET_4B((kal_uint8 *)(_tcp) + 8, _ack_num)
+
+#define IPC_HDR_TCP_EQ_ACK_NUM(_tcp, _ack_num)    \
+        (IPC_HDR_TCP_GET_ACK_NUM(_tcp) == (_ack_num))
+
+#define IPC_HDR_TCP_GET_OFFSET(_tcp) \
+        ((IPC_NE_GET_1B((kal_uint8 *)(_tcp) + 12) & 0xF0) >> 2)
+
+#define IPC_HDR_TCP_SET_OFFSET(_tcp, _offset) \
+        do { \
+            IPC_NE_SET_1B((kal_uint8 *)(_tcp) + 12, (IPC_NE_GET_1B((kal_uint8 *)(_tcp) + 12) & 0x0F) | ((((kal_uint8)(_offset)>>2)<<4) & 0xF0)); \
+        } while (0)
+
+#define IPC_HDR_TCP_GET_RESERVED(_tcp) \
+        ((IPC_NE_GET_1B((kal_uint8 *)(_tcp) + 12) >> 1) & 0x07)
+
+#define IPC_HDR_TCP_SET_RESERVED(_tcp, _reserved) \
+        do { \
+            IPC_NE_SET_1B((kal_uint8 *)(_tcp) + 12, (IPC_NE_GET_1B((kal_uint8 *)(_tcp) + 12) & 0xF1) | (((kal_uint8)(_reserved) << 1) & 0x0E)); \
+        } while (0)
+
+#define IPC_HDR_TCP_GET_FLAGS(_tcp) \
+        (IPC_NE_GET_2B((kal_uint8 *)(_tcp) + 12) & 0x01FF)
+
+#define IPC_HDR_TCP_SET_FLAGS(_tcp, _flags) \
+        do { \
+            IPC_NE_SET_2B((kal_uint8 *)(_tcp) + 12, (IPC_NE_GET_2B((kal_uint8 *)(_tcp) + 12) & 0xFE00) | ((_flags) & 0x01FF)); \
+        } while (0)
+
+#define IPC_HDR_TCP_GET_WINDOW(_tcp) \
+        IPC_NE_GET_2B((kal_uint8 *)(_tcp) + 14)
+
+#define IPC_HDR_TCP_SET_WINDOW(_tcp, _window) \
+        IPC_NE_SET_2B((kal_uint8 *)(_tcp) + 14, _window)
+
+#define IPC_HDR_TCP_GET_CHECKSUM(_tcp) \
+        IPC_NE_GET_2B((kal_uint8 *)(_tcp) + 16)
+
+#define IPC_HDR_TCP_SET_CHECKSUM(_tcp, _checksum) \
+        IPC_NE_SET_2B((kal_uint8 *)(_tcp) + 16, _checksum)
+
+#define IPC_HDR_TCP_GET_URGENT_PTR(_tcp) \
+        IPC_NE_GET_2B((kal_uint8 *)(_tcp) + 18)
+
+#define IPC_HDR_TCP_SET_URGENT_PTR(_tcp, _urp) \
+        IPC_NE_SET_2B((kal_uint8 *)(_tcp) + 18, _urp)
+/*
+ * ICMP.
+ */
+#define IPC_HDR_ICMP_HEADER_SIZE     (8)
+
+#define IPC_HDR_ICMP_TYPE_ECHO_REQUEST    (8)
+#define IPC_HDR_ICMP_TYPE_ECHO_REPLY      (0)
+#define IPC_HDR_ICMP_TYPE_RS              (10)
+#define IPC_HDR_ICMP_TYPE_RA              (9)
+
+#define IPC_HDR_ICMPV6_TYPE_ECHO_REQUEST  (128)
+#define IPC_HDR_ICMPV6_TYPE_ECHO_REPLY    (129)
+#define IPC_HDR_ICMPV6_TYPE_RS            (133)
+#define IPC_HDR_ICMPV6_TYPE_RA            (134)
+
+#define IPC_HDR_ICMP_GET_TYPE(_icmp) \
+        IPC_NE_GET_1B(_icmp)
+
+#define IPC_HDR_ICMP_SET_TYPE(_icmp, _type) \
+        IPC_NE_SET_1B(_icmp, _type)
+
+#define IPC_HDR_ICMP_EQ_TYPE(_icmp, _type)  \
+        (IPC_HDR_ICMP_GET_TYPE(_icmp) == (_type))
+
+#define IPC_HDR_ICMP_GET_CODE(_icmp) \
+        IPC_NE_GET_1B((kal_uint8 *)(_icmp) + 1)
+
+#define IPC_HDR_ICMP_SET_CODE(_icmp, _code) \
+        IPC_NE_SET_1B((kal_uint8 *)(_icmp) + 1, (_code))
+
+#define IPC_HDR_ICMP_EQ_CODE(_icmp, _code)  \
+        (IPC_HDR_ICMP_GET_CODE(_icmp) == (_code))
+
+#define IPC_HDR_ICMP_GET_CHECKSUM(_icmp) \
+        IPC_NE_GET_2B((kal_uint8 *)(_icmp) + 2)
+
+#define IPC_HDR_ICMP_SET_CHECKSUM(_icmp, _checksum) \
+        IPC_NE_SET_2B((kal_uint8 *)(_icmp) + 2, _checksum)
+
+#define IPC_HDR_ICMP_SET_UNUSED(_icmp, _value) \
+        IPC_NE_SET_4B((kal_uint8 *)(_icmp) + 4, _value)
+/*
+ * Ports.
+ */
+#define IPC_PORT_BOOTPS (67)
+#define IPC_PORT_BOOTPC (68)
+
+/*
+ * Helper functions
+ */
+#define ipc_get_netif_id_from_l2p_chid(_ipc_l2p_enum, _chid) ((kal_uint32)(_ipc_l2p_enum | _chid))
+
+/*------------------------------------------------------------------------------
+ * Public functions.
+ *----------------------------------------------------------------------------*/
+/**
+ * Allow HIF side module, such as ethercore or ppp, to register callback functions,
+ * callback context, and module id for a network interface.
+ *
+ * @param   config [IN] The information required to regerster a network interface.
+ * @param   handle [OUT] Caller allocated space to store a handle to the network interface attached.
+ *                       It returns a IPC_INVALID_HANDLE if failed.
+ *
+ * @return KAL_TRUE if successful, KAL_FALSE otherwise.
+ */
+kal_bool ipc_attach(ipc_conf_t *config, ipc_handle_t *handle);
+
+/**
+ * Detach the network interface.
+ *
+ * @param   handle [IN] Handle to the network interface to detach.
+ *
+ * @return KAL_TRUE if successful, KAL_FALSE otherwise.
+ */
+kal_bool ipc_detach(ipc_handle_t handle);
+
+/**
+ * Send a list of IP datagrams to wireless network.
+ *
+ * @param   handle [IN] Handle to the network interface attached.
+ * @param   ior [IN] It wraps up a set of uplink GPD to send.
+ *
+ * @return KAL_TRUE if successful, KAL_FALSE otherwise.
+ */
+kal_bool ipc_uplink(ipc_handle_t handle, ipc_io_request_t *ior);
+
+/**
+ * Retrieve index of a set of IPv4/IPv6 addresses.
+ *
+ * @param   handle [IN] Handle to the network interface attached.
+ *
+ * @return Non-negtive value as a valid index, netgative value for an invalid one (e.g. before session established.).
+ */
+kal_int32 ipc_get_ip_id(ipc_handle_t handle);
+
+/**
+ * Force reloading buffers for the network interface to receive uplink traffic.
+ *
+ * @param   handle [IN] Handle to the network interface attached.
+ */
+void ipc_need_ul_reload(ipc_handle_t handle);
+
+/**
+ * Check if any network interfaces need uplink reload retry,
+ * if so, send an ILM to IPCORE to do uplink reload.
+ */
+void ipc_check_ul_reload_retry(void);
+
+/**
+ * Manually notify the HIF network interface link/IP status changed. (This API does NOT change IP Core internal FSM !)
+ *
+ * @param   netif_id [IN] The network interface ID.
+ * @param   ip_type [IN] Type of the PDN, IPC_IP_TYPE_IPV4, IPC_IP_TYPE_IPV6, or IPC_IP_TYPE_MIXED.
+ * @param   link_update[IN] KAL_TRUE if an IP session is established/deactived and link status is changed. KAL_FALSE if an IP information is updated for an activated IP session.
+ * @param   link_up [IN] (If link_update is KAL_TRUE) KAL_TRUE if an IP session is established, KAL_FALSE if an IP session is deactived ;
+                                    (If link_update is KAL_FALSE) KAL_TRUE if new IP information is available, KAL_FALSE if original IP information is obsoleted
+ */
+void ipc_notify_link_change(kal_uint32 netif_id, kal_uint8 ip_type, kal_bool link_update, kal_bool is_up);
+
+/**
+ * Install callback function and filtering rules for uplink traffic.
+ *
+ * @param   rules [IN] Rules to filter of uplink IP datagrams.
+ * @param   callback_func [IN] Callback function for a uplink IP datagram matched the rules.
+ * @param   callback_context [IN] Context to pass in the callback function.
+ *
+ * @return Zero or postive value as filter ID if registration succeeded, negative value if it failed.
+ */
+kal_int32 ipc_register_ul_filter_cbk(ipc_filter_rules_t *rules,
+                                     ipc_filter_callback_t callback_func,
+                                     void *callback_context);
+
+/**
+ * Install callback function and filtering rules for downlink traffic.
+ *
+ * @param   rules [IN] Rules to filter of downlink IP datagrams.
+ * @param   callback_func [IN] Callback function for a downlink IP datagram matched the rules.
+ * @param   callback_context [IN] Context to pass in the callback function.
+ *
+ * @return Zero or postive value as filter ID if registration succeeded, negative value if it failed.
+ */
+kal_int32 ipc_register_dl_filter_cbk(ipc_filter_rules_t *rules,
+                                     ipc_filter_callback_t callback_func,
+                                     void *callback_context);
+
+/**
+ * Install module ID and filtering rules for uplink traffic.
+ *
+ * @param   rules [IN] Rules to filter of uplink IP datagrams.
+ * @param   callback_module [IN] Destination module of the MSG MSG_ID_IPCORE_UL_PACKET_FILTERED_REQ for a uplink IP datagram matched the rules.
+ * @param   callback_context [IN] Context to pass in the callback function.
+ *
+ * @return Zero or postive value as filter ID if registration succeeded, negative value if it failed.
+ */
+kal_int32 ipc_register_ul_filter_msg(ipc_filter_rules_t *rules,
+                                     module_type callback_module,
+                                     void *callback_context);
+
+/**
+ * Install module ID and filtering rules for downlink traffic.
+ *
+ * @param   rules [IN] Rules to filter of downlink IP datagrams.
+ * @param   callback_module [IN] Destination module of the MSG MSG_ID_IPCORE_DL_PACKET_FILTERED_REQ for a downlink IP datagram matched the rules.
+ * @param   callback_context [IN] Context to pass in the callback function.
+ *
+ * @return Zero or postive value as filter ID if registration succeeded, negative value if it failed.
+ */
+kal_int32 ipc_register_dl_filter_msg(ipc_filter_rules_t *rules,
+                                     module_type callback_module,
+                                     void *callback_context);
+
+/**
+ * Install callback function and filtering rules for uplink traffic. (callback function with information as parameter)
+ *
+ * @param   rules [IN] Rules to filter of uplink IP datagrams.
+ * @param   callback_func [IN] Callback function for a uplink IP datagram matched the rules (with information as parameter).
+ * @param   callback_context [IN] Context to pass in the callback function.
+ *
+ * @return Zero or positive value as filter ID if registration succeeded, negative value if it failed.
+ */
+kal_int32 ipc_register_ul_filter_with_info_cbk(ipc_filter_rules_t *rules,
+                                               ipc_filter_with_info_callback_t callback_func,
+                                               void *callback_context);
+
+/**
+ * Install callback function and filtering rules for downlink traffic. (callback function with information as parameter)
+ *
+ * @param   rules [IN] Rules to filter of downlink IP datagrams.
+ * @param   callback_func [IN] Callback function for a downlink IP datagram matched the rules (with information as parameter).
+ * @param   callback_context [IN] Context to pass in the callback function.
+ *
+ * @return Zero or postive value as filter ID if registration succeeded, negative value if it failed.
+ */
+kal_int32 ipc_register_dl_filter_with_info_cbk(ipc_filter_rules_t *rules,
+                                               ipc_filter_with_info_callback_t callback_func,
+                                               void *callback_context);
+
+/**
+ * Install module ID and filtering rules for uplink traffic. (callback function with information as parameter)
+ *
+ * @param   rules [IN] Rules to filter of uplink IP datagrams.
+ * @param   callback_module [IN] Destination module of the MSG MSG_ID_IPCORE_UL_PACKET_FILTERED_WITH_INFO_REQ for a uplink IP datagram matched the rules.
+ * @param   callback_context [IN] Context to pass in the callback function.
+ *
+ * @return Zero or postive value as filter ID if registration succeeded, negative value if it failed.
+ */
+kal_int32 ipc_register_ul_filter_with_info_msg(ipc_filter_rules_t *rules,
+                                               module_type callback_module,
+                                               void *callback_context);
+
+/**
+ * Install module ID and filtering rules for downlink traffic. (callback function with information as parameter)
+ *
+ * @param   rules [IN] Rules to filter of downlink IP datagrams.
+ * @param   callback_module [IN] Destination module of the MSG MSG_ID_IPCORE_DL_PACKET_FILTERED_WITH_INFO_REQ for a downlink IP datagram matched the rules.
+ * @param   callback_context [IN] Context to pass in the callback function.
+ *
+ * @return Zero or postive value as filter ID if registration succeeded, negative value if it failed.
+ */
+kal_int32 ipc_register_dl_filter_with_info_msg(ipc_filter_rules_t *rules,
+                                               module_type callback_module,
+                                               void *callback_context);
+
+/**
+ * Uninstall the filter for uplink traffic.
+ *
+ * @param   filter_id [IN] filter ID to unregister.
+ */
+void ipc_deregister_ul_filter(kal_int32 filter_id);
+
+/**
+ * Uninstall the filter for donwlink traffic.
+ *
+ * @param   filter_id [IN] filter ID to unregister.
+ */
+void ipc_deregister_dl_filter(kal_int32 filter_id);
+
+/**
+ * Copy buffers in the GPD list to the buffer prepared by caller.
+ *
+ * @param   dst_buffer [OUT] Destination buffer to copy to, which is prepared by caller.
+ * @param   dst_max_len [IN] Size of the destination buffer prepared by caller in bytes.
+ * @param   dst_len_copied [OUT] Number of bytes copied to the destination buffer.
+ * @param   src_head_gpd [IN] Head of the GPD list with source buffers to copy from.
+ * @param   src_tail_gpd [IN] Tail of the GPD list with source buffers to copy from.
+ *
+ * @return  KAL_TRUE if succeeded, KAL_FALSE otherwise.
+ */
+kal_bool ipc_gpd_copy(kal_uint8 *dst_buffer, kal_uint32 dst_max_len, kal_uint32 *dst_len_copied, qbm_gpd *src_head_gpd, qbm_gpd *src_tail_gpd);
+
+/**
+ * Pack datagram in GPD format and selectively fill L4(UDP) and IP header.
+ *
+ * @param   uplink [IN] Uplink or downlink packet.
+ * @param   pkt [IN] Datagram or GPD list to sent.
+ * @param   hdr [IN] UDP/IP header information which will be filled to sent packet(s). NULL pointer means "No packet modification is needed"
+ * @param   head_gpd [OUT] Head of GPD list return
+ * @param   tail_gpd [OUT] Tail of GPD list return
+ *
+ * @return  KAL_TRUE if succeeded, KAL_FALSE otherwise.
+ */
+kal_bool ipc_pack_pkt_public(kal_bool uplink,
+                             ipc_pkt_t *pkt,
+                             ipc_hdr_t *hdr,
+                             qbm_gpd **head_gpd,
+                             qbm_gpd **tail_gpd);
+
+/**
+ * Send datagram in buffer or GPD list to the wireless netowrk and selectively fill L4(UDP) and IP header on each of them.
+ *
+ * @param   pkt [IN] Datagram or GPD list to sent.
+ * @param   hdr [IN] UDP/IP header information which will be filled to sent packet(s). NULL pointer means "No packet modification is needed"
+ * @param   ebi [IN] EBI/NSAPI.
+ *
+ * @return  KAL_TRUE if succeeded, KAL_FALSE otherwise.
+ */
+kal_bool ipc_send_ul_pkt(ipc_pkt_t *pkt, ipc_hdr_t *hdr, kal_uint32 ebi);
+
+/**
+ * Send datagram in buffer or GPD list to the wireless netowrk and selectively fill L4(UDP) and IP header on each of them.
+ *
+ * @param   pkt [IN] Datagram or GPD list to sent.
+ * @param   hdr [IN] UDP/IP header information which will be filled to sent packet(s). NULL pointer means "No packet modification is needed"
+ * @param   pdn [IN] PDN ID
+ * @param   ip_type [IN] Type of IP datagrams, see IPC_IP_TYPE_XXX defined for valid values. Note that only one of IPv4/IPv6 can be selected and MIX type is NOT allowed.
+ *
+ * @return  KAL_TRUE if succeeded, KAL_FALSE otherwise.
+ */
+kal_bool ipc_send_ul_pkt_by_pdn(ipc_pkt_t *pkt,
+                                ipc_hdr_t *hdr,
+                                kal_uint32 pdn,
+                                kal_uint8 ip_type);
+
+/**
+ * Send datagram in buffer or GPD list to the wireless netowrk and selectively fill L4(UDP) and IP header on each of them.
+ *
+ * @param   pkt [IN] Datagram or GPD list to sent.
+ * @param   hdr [IN] UDP/IP header information which will be filled to sent packet(s). NULL pointer means "No packet modification is needed"
+ * @param   netif_id [IN] Network interface ID
+ * @param   ip_type [IN] Type of IP datagrams, see IPC_IP_TYPE_XXX defined for valid values. Note that only one of IPv4/IPv6 can be selected and MIX type is NOT allowed.
+
+ *
+ * @return  KAL_TRUE if succeeded, KAL_FALSE otherwise.
+ */
+kal_bool ipc_send_ul_pkt_by_netif_id(ipc_pkt_t *pkt,
+                                     ipc_hdr_t *hdr,
+                                     kal_uint32 netif_id,
+                                     kal_uint8 ip_type);
+
+/**
+ * Send datagram in buffer or GPD list to the wireless netowrk and selectively fill L4(UDP) and IP header on each of them.
+ *
+ * @param   pkt [IN] Datagram or GPD list to sent.
+ * @param   hdr [IN] UDP/IP header information which will be filled to sent packet(s). NULL pointer means "No packet modification is needed"
+ * @param   ebi [IN] EBI/NSAPI.
+ * @param   proto_idx [IN] The index to distinquish from different SIM Card.
+ *
+ * @return  KAL_TRUE if succeeded, KAL_FALSE otherwise.
+ */
+kal_bool ipc_send_ul_pkt_multiple_ps(ipc_pkt_t *pkt,
+                                     ipc_hdr_t *hdr,
+                                     kal_uint32 ebi,
+                                     kal_uint8 proto_idx);
+
+/**
+ * Send datagram in buffer or GPD list to the wireless netowrk and selectively fill L4(UDP) and IP header on each of them.
+ *
+ * @param   pkt [IN] Datagram or GPD list to sent.
+ * @param   hdr [IN] UDP/IP header information which will be filled to sent packet(s). NULL pointer means "No packet modification is needed"
+ * @param   pdn [IN] PDN ID
+ * @param   ip_type [IN] Type of IP datagrams, see IPC_IP_TYPE_XXX defined for valid values. Note that only one of IPv4/IPv6 can be selected and MIX type is NOT allowed.
+ * @param   proto_idx [IN] The index to distinquish from different SIM Card.
+ *
+ * @return  KAL_TRUE if succeeded, KAL_FALSE otherwise.
+ */
+kal_bool ipc_send_ul_pkt_by_pdn_multiple_ps(ipc_pkt_t *pkt,
+                                            ipc_hdr_t *hdr,
+                                            kal_uint32 pdn,
+                                            kal_uint8 ip_type,
+                                            kal_uint8 proto_idx);
+
+/**
+* Send datagram in buffer or GPD list to the wireless netowrk after filtering and selectively fill L4(UDP) and IP header on each of them.
+*
+* @param pkt [IN] Datagram or GPD list to sent.
+* @param hdr [IN] UDP/IP header information which will be filled to sent packet(s). NULL pointer means "No packet modification is needed"
+* @param pdn [IN] PDN ID
+* @param ip_type [IN] Type of IP datagrams, see IPC_IP_TYPE_XXX defined for valid values. Note that only one of IPv4/IPv6 can be selected and MIX type is NOT allowed.
+* @param proto_idx [IN] The index to distinquish from different SIM Card.
+*
+* @return KAL_TRUE if succeeded, KAL_FALSE otherwise.
+*/
+kal_bool ipc_send_ul_pkt_on_normal_path_by_pdn_multiple_ps(ipc_pkt_t *pkt,
+                                                 ipc_hdr_t *hdr,
+                                                 kal_uint32 pdn,
+                                                 kal_uint8 ip_type,
+                                                 kal_uint8 proto_idx);
+                                            
+/**
+ * Send datagram in buffer or GPD list to the netowrk interface and selectively fill L4(UDP) and IP header on each of them.
+ *
+ * @param   pkt [IN] Datagram or GPD list to sent.
+ * @param   hdr [IN] UDP/IP header information which will be filled to sent packet(s). NULL pointer means "No packet modification is needed"
+ * @param   netif_id [IN] Network interface ID.
+ *
+ * @return  KAL_TRUE if succeeded, KAL_FALSE otherwise.
+ */
+kal_bool ipc_send_dl_pkt(ipc_pkt_t *pkt, ipc_hdr_t *hdr, kal_uint32 netif_id);
+
+/**
+ * Register a notification.
+ *
+ * @param   callback_func [IN] Callback function pointer.
+ * @param   callback_context [IN] Context to pass in the callback function.
+ *
+ * @return Zero or positive value as notification ID if registration succeeded, negative value otherwise.
+ */
+kal_int32 ipc_register_ntfy(ipc_ntfy_callback_t callback_func,
+                            void *callback_context);
+
+/**
+ * Uninstall the registered notification.
+ *
+ * @param   ntfy_id [IN] notification ID gotten from ipc_register_ntfy() to uninstall.
+ */
+void ipc_deregister_ntfy(kal_int32 ntfy_id);
+
+/**
+ * Register link up indication handler
+ *
+ * @param   module_id [IN]  Module ID to handle ILM MSG_ID_IPCORE_LINK_UP_IND.
+ *
+ * @return  KAL_TRUE if succeeded, KAL_FALSE otherwise.
+ */
+kal_bool ipc_register_link_up_ind_handler(module_type module_id);
+
+/**
+ * Uninstall the registered link up indication handler
+ */
+void ipc_deregister_link_up_ind_handler(void);
+
+/**
+ * Register IP up indication handler
+ *
+ * @param   module_id [IN]  Module ID to handle ILM MSG_ID_IPCORE_IP_UP_IND.
+ *
+ * @return  KAL_TRUE if succeeded, KAL_FALSE otherwise.
+ */
+kal_bool ipc_register_ip_up_ind_handler(module_type module_id);
+
+/**
+ * Uninstall the registered link up indication handler
+ */
+void ipc_deregister_ip_up_ind_handler(void);
+
+/**
+ * Bind two lan netif to one another (for MD Direct Tethering)
+ *
+ * @param   netif_id_1 [IN] lan netif ID.
+ * @param   netif_id_2 [IN] lan netif ID.
+ */
+void ipc_bind_lan_netif(kal_uint32 netif_id_1, kal_uint32 netif_id_2);
+
+/**
+ * Unbind two lan netif from one another (for MD Direct Tethering)
+ *
+ * @param   netif_id_1 [IN] lan netif ID.
+ * @param   netif_id_2 [IN] lan netif ID.
+ */
+void ipc_unbind_lan_netif(kal_uint32 netif_id_1, kal_uint32 netif_id_2);
+
+/**
+ * Send a list of IP datagrams to wireless network. (Gen93)
+ *
+ * @param   start_idx [IN] Start idx of the Meta list.
+ * @param   end_idx [IN] Start idx of the Meta list.
+ * @param   queue_type [IN] Type of the Meta queue.
+ *
+ * @return KAL_TRUE if successful, KAL_FALSE otherwise.
+ */
+kal_bool ipc_meta_uplink(kal_uint16 start_idx, kal_uint16 end_idx, LHIF_QUEUE_TYPE queue_type);
+
+/**
+ * Get pdn_id & protocol index by given netif ID
+ *
+ * @param   netif_id [IN] The network interface ID.
+ * @param   ip_type [IN] The IP type of the queried PDN.
+ * @param   p_pdn_id [OUT] The result of the PDN ID.
+ * @param   p_proto_idx [OUT] The result of the protocol index.
+ *
+ * @return KAL_TRUE if successful, KAL_FALSE otherwise.
+ */
+kal_bool ipc_find_pdn_id_by_netif_id(kal_uint32 netif_id, kal_uint8 ip_type, kal_uint32 *p_pdn_id, kal_uint8 *p_proto_idx);
+
+/**
+ * Send datagram in buffer or DID list to the netowrk interface and selectively fill L4(UDP) and IP header on each of them. (Gen93)
+ *
+ * @param   pkt [IN] Datagram or DID list to sent.
+ * @param   hdr [IN] UDP/IP header information which will be filled to sent packet(s). NULL pointer means "No packet modification is needed"
+ * @param   netif_id [IN] Network interface ID.
+ *
+ * @return  KAL_TRUE if succeeded, KAL_FALSE otherwise.
+ */
+kal_bool ipc_send_dl_pkt_in_did(ipc_pkt_t *pkt, ipc_hdr_t *hdr, kal_uint32 netif_id);
+
+/**
+ * Re-filtering API for ipc_fragment submoule to check the filtering result of the fragment packets. (Gen93)
+ *
+ * @param   ip_type [IN] Type of the packet, either IPC_IP_TYPE_IPV4 or IPC_IP_TYPE_IPV6.
+ * @param   info [IN] Information for re-filtering.
+ * @param   p_head [OUT] Head of GPD list return
+ * @param   p_tail [OUT] Tail of GPD list return
+ */
+void ipc_frag_refilter(kal_uint8 ip_type, ipc_frag_refilter_info_t *info, qbm_gpd *p_head, qbm_gpd *p_tail);
+
+/**
+ * Re-filtering API for ipc_fragment submoule to send fragment packets to AP when fragment collection timeout or exception. (Gen93)
+ *
+ * @param   ip_type [IN] Type of the packet, either IPC_IP_TYPE_IPV4 or IPC_IP_TYPE_IPV6.
+ * @param   info [IN] Information for re-filtering.
+ * @param   p_head [OUT] Head of GPD list return
+ * @param   p_tail [OUT] Tail of GPD list return
+ */
+void ipc_frag_send_pkt(kal_uint8 ip_type, ipc_frag_refilter_info_t *info, qbm_gpd *p_head, qbm_gpd *p_tail);
+
+/*
+ * Look into packet to gather necessary IP header & the upper layer protocol header information.
+ * Note that, for IPv6's packet, current implementation don't handle the following cases and take them  as not found:
+ *     #1. IPv6 packet with ESP header:
+ *        According to RFC 4303 section 3.1, everything after ESP header is encrypted.
+ *        Since we cannot decrypt it, we cannot acturally look into the upper layer protocol.
+ *
+ *     #2. IPv6 extension header not defined in RFC 2460:
+ *        If necessary, we will handle them here according to corresponding RFC.
+ *
+ *     #3. fragmentation:
+ *        No application needs IPv6 fragmentation on a modem platform so far.
+ *
+ * @param   ipv6_packet [IN] The packet.
+ * @param   packet_len [IN] Length of the packet.
+ * @param   p_info [OUT] The necessary information gathered for later packete filtering.
+ *
+ * @return KAL_TRUE if the packet's information was gathered sucessfully, KAL_FALSE otherwise.
+ */
+kal_bool ipc_get_packet_info(kal_uint8 *p_packet, kal_uint16 packet_len, ipc_packet_info_t *p_info);
+
+/**
+ * Send a list of IP datagrams filter-out by IPF. (Gen95)
+ *
+ * @param   start_idx [IN] Start idx of the Meta list.
+ * @param   end_idx [IN] Start idx of the Meta list.
+ * @param   queue_type [IN] Type of the Meta queue.
+ *
+ */
+void  ipc_meta_downlink(kal_uint16 start_idx, kal_uint16 end_idx, kal_uint32 queue_type);
+
+/**
+ * Query bound PDN id according to netif_id and ip_type
+ *
+ * @param   netif_id [IN] network interface ID.
+ * @param   ip_type [IN] IPC_IP_TYPE_IPV4 / IPC_IP_TYPE_IPV6. (ipc_enums.h)
+ * @param   pdn_id [OUT] return the bound PDN ID.
+ *
+ * @return KAL_TRUE if successful, KAL_FALSE otherwise.
+ */
+kal_bool ipc_query_pdn_by_netif(kal_uint32 netif_id, kal_uint8 ip_type, kal_int32 *pdn_id);
+
+/**
+ * calculate TCP checksum
+ *
+ * @param   is_ipv4    ipv4 or ipv6
+ * @param   src_addr   source address
+ * @param   dst_addr   destination address
+ * @param   tcp_header tcp header pointer
+ * @param   tcp_len    tcp length
+ */
+kal_uint16 ipc_calc_tcp_checksum(kal_bool is_ipv4,
+                                 kal_uint8 *src_addr,
+                                 kal_uint8 *dst_addr,
+                                 kal_uint8 *tcp_header,
+                                 kal_uint32 tcp_len);
+
+/**
+ * calculate UDP checksum
+ *
+ * @param   is_ipv4    ipv4 or ipv6
+ * @param   src_addr   source address
+ * @param   dst_addr   destination address
+ * @param   udp_header udp header pointer
+ * @param   udp_len    udp length
+ */
+kal_uint16 ipc_calc_udp_checksum(kal_bool is_ipv4,
+                                 kal_uint8 *src_addr,
+                                 kal_uint8 *dst_addr,
+                                 kal_uint8 *udp_header,
+                                 kal_uint32 udp_len);
+
+/**
+ * calculate IPv4 checksum
+ *
+ * @param   ip_header IP header pointer
+ */
+kal_uint16 ipc_calc_ipv4_checksum(kal_uint8 *ip_header);
+
+/**
+ * send DL did by channel_id
+ *
+ * @param   net_type    network type
+ * @param   ch_id       channel id
+ * @param   p_did_head  did head
+ * @param   p_did_tail  did tail
+ */
+kal_bool ipc_send_dl_did_by_ch_id(kal_uint8 net_type,
+                                  kal_uint8 ch_id,
+                                  upcm_did *p_did_head,
+                                  upcm_did *p_did_tail);
+
+
+/**
+ * Send datagram in QBM GPD to the netowrk interface after unwinding call stack
+ *
+ * @param   pkt           Packet GPD
+ * @param   netif_id      Network interface ID.
+ * @param   session_type  IPV4/V6 session type
+ */
+kal_bool ipc_send_dl_pkt_enqueue(qbm_gpd *pkt, kal_uint32 netif_id, kal_uint32 session_type);
+
+/**
+ * register ipc filter
+ *
+ * @param   data_path_direction  DL_DATA_PATH or UL_DATA_PATH
+ * @param   p_rules              filter rules
+ * @param   p_ntfy_ctxt          filter match notification context
+ *
+ * @return  non negative filter id for successful, otherwise IPC_INVALID_FILTER_ID
+ */
+kal_int32 ipc_reg_filter(ipc_data_path_direction_e data_path_direct,
+                         ipc_filter_rules_t *p_rules,
+                         ipc_filter_ntfy_ctxt_t *p_ntfy_ctxt);
+
+/**
+ * deregister ipc filter
+ *
+ * @param   filter_id  the filter_id which want to be deregistered
+ *
+ * @return  KAL_TRUE if successful, KAL_FALSE otherwise.
+ */
+kal_bool ipc_dereg_filter(kal_int32 filter_id);
+
+/**
+ * Get data usage by Netif_id
+ *
+ * @param netif_id [IN] the netif_id for which want to know data usgae
+ * @param data_usage [OUT] data usage of uplink and downlink path
+ *
+ * @return KAL_TRUE if successful, KAL_FALSE otherwise.
+ */
+kal_bool ipc_get_data_usage_by_netif_id(kal_uint32 netif_id, ipc_data_usage_info_t *data_usage);
+
+/**
+ * Get data usage by pdn_id
+ *
+ * @param  pdn_id [IN]  the pdn_id for which want to know data usgae
+ * @param  proto_idx [IN]  the sim_idx for which want to know data usgae
+ * @param  data_usage [OUT]  data usage of uplink and downlink path
+ *
+ * @return  KAL_TRUE if successful, KAL_FALSE otherwise.
+ */
+kal_bool ipc_get_data_usage_by_pdn_id(kal_uint32 pdn_id, kal_uint8 proto_idx, ipc_data_usage_info_t *data_usage);
+
+#endif /* __INC_IPC_API_H */
diff --git a/mcu/interface/middleware/hif/ipc_defs_public.h b/mcu/interface/middleware/hif/ipc_defs_public.h
new file mode 100644
index 0000000..89b401a
--- /dev/null
+++ b/mcu/interface/middleware/hif/ipc_defs_public.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:
+ * ---------
+ *   ipc_defs_public.h
+ *
+ * Project:
+ * --------
+ *   TATAKA
+ *
+ * Description:
+ * ------------
+ *   IP Core public definition.
+ *
+ * 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!! 
+ *==============================================================================
+ *******************************************************************************/
+#ifndef __INC_IPC_DEFS_PUBLIC_H
+#define __INC_IPC_DEFS_PUBLIC_H
+
+/* 2011/12/16: SD1/Moja guarantees pdn_id falls in [0,15]. */
+/* 2016/03/15: To support multi-PS, need to enlarge maximum netif/session number. */
+#define IPC_MAX_SESSION_CNT             256
+#define IPC_MAX_NETIF_CNT               64 /**< Maximal number of host network interfaces supported. Note that, it must <= 64. */
+#define IPC_MAX_IP_ID_CNT               IPC_MAX_NETIF_CNT
+#define IPC_IMS_FILTER_CNT              2
+#define IPC_AOMGR_FILTER_CNT            (IPC_MAX_NETIF_CNT * 2) /* DHCPv4 and DHCPv6 */
+#define IPC_MAX_DL_FILTER_CNT           (IPC_MAX_SESSION_CNT + IPC_IMS_FILTER_CNT)
+#define IPC_MAX_UL_FILTER_CNT           (IPC_AOMGR_FILTER_CNT)
+#define IPC_PFM_MAX_FILTER_CNT          256
+#define IPC_MAX_FILTER_CNT              (IPC_MAX_DL_FILTER_CNT + IPC_MAX_UL_FILTER_CNT + IPC_PFM_MAX_FILTER_CNT)
+#define IPC_DEL_OBJECT_SLEEP_TICKS      KAL_TICKS_10_MSEC
+#define IPC_W_LOCK_OBJECT_SLEEP_TICKS   1 
+#define IPC_DEF_TTL                     128
+#define IPC_MAX_NTFY_CNT                4
+
+#endif /* __INC_IPC_DEFS_PUBLIC_H */
diff --git a/mcu/interface/middleware/hif/ipc_enums.h b/mcu/interface/middleware/hif/ipc_enums.h
new file mode 100644
index 0000000..8e16596
--- /dev/null
+++ b/mcu/interface/middleware/hif/ipc_enums.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).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ *   ipc_enums.h
+ *
+ * Project:
+ * --------
+ *   TATAKA
+ *
+ * Description:
+ * ------------
+ *   IP Core public enumeration definition.
+ *
+ * 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!
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+#ifndef __INC_IPC_ENUMS_H
+#define __INC_IPC_ENUMS_H
+
+/*------------------------------------------------------------------------------
+ * Data structure definition.
+ *----------------------------------------------------------------------------*/
+#define IPC_IP_TYPE_MIXED           0
+#define IPC_IP_TYPE_IPV4            1
+#define IPC_IP_TYPE_IPV6            2
+#define IPC_IP_TYPE_INVALID         3
+
+/** extra flags */
+#define IPC_DRP_ALLW_PKT            (0x0001 << 0)
+
+/** Network interface configuration */
+#define IPC_F_DHCP4C                0x00000001  /** DHCPv4 Client */
+#define IPC_F_DYNAMIC_Q_MAPPING     0x00000008  /** CCMNI Dynamic Queue Mapping */
+#define IPC_F_TETHERING_ROUTE       0x00000002  /** Direct Tethering routing required */
+#define IPC_F_LAN                   0x00000004  /** LAN netif, which binds to other netif */
+#define IPC_F_LATENCY_CONCERN       0x00010000  /** Latency Concern Module */
+#define IPC_F_TEST_LOOPBACK_A       0x10000000  /** Test Loopback mode A */
+#define IPC_F_TEST_LOOPBACK_B       0x20000000  /** Test Loopback mode B */
+#define IPC_F_KEEP_PDN_MAPPING      0x00000010  /** Keep previous PDN mapping state */
+
+#define IPC_INVALID_HANDLE          NULL
+
+/** Filter feature option */
+#define IPC_FILTER_FEATURE_WC                   (0x01 << 0)  /** Wild card filter: report matched to all packets */
+#define IPC_FILTER_FEATURE_BWM                  (0x01 << 1)  /** Bypass when matched filter: bypass the matched packets */
+#define IPC_FILTER_FEATURE_IPV6_DPFM            (0x01 << 3)  /** Special feature for IPV6 MDT(no GPD callback) [Gen95 only]*/
+#define IPC_FILTER_FEATURE_FRAG                 (0x01 << 2)  /** Support to filter fragment packet */
+#define IPC_FILTER_FEATURE_CLONE                (0x01 << 6)  /** Matched filter action : clone it */
+#define IPC_FILTER_FEATURE_PFM_DL               (0x01 << 7)  /** Filter registered through PFM */
+#define IPC_FILTER_FEATURE_CUST_FILTER          (0x01 << 4)  /** Add customized filter flow */
+#define IPC_FILTER_FEATURE_CUST_FILTER_W_INFO   (0x01 << 5)  /** Add customized filter flow and callback with IPC_INFO instead of user arguments */
+#define IPC_FILTER_FEATURE_IG_PN                (0x01 << 8)  /** Ignore PDN & NETIF */
+
+/** Filter rule */
+#define IPC_FILTER_BY_PROTOCOL      (0x0001 << 0)
+#define IPC_FILTER_BY_SRC_PORT      (0x0001 << 1)
+#define IPC_FILTER_BY_DST_PORT      (0x0001 << 2)
+#define IPC_FILTER_BY_SRC_IPV4      (0x0001 << 3)
+#define IPC_FILTER_BY_DST_IPV4      (0x0001 << 4)
+#define IPC_FILTER_BY_SRC_IPV6      (0x0001 << 5)
+#define IPC_FILTER_BY_DST_IPV6      (0x0001 << 6)
+#define IPC_FILTER_BY_ICMPV4_TYPE   (0x0001 << 7)
+#define IPC_FILTER_BY_ICMPV6_TYPE   (0x0001 << 8)
+#define IPC_FILTER_BY_EBI           (0x0001 << 9)
+#define IPC_FILTER_BY_PDN_ID        (0x0001 << 10)
+#define IPC_FILTER_BY_NETIF_ID      (0x0001 << 11)
+#define IPC_FILTER_BY_TCP_FLAGS     (0x0001 << 12)
+#define IPC_FILTER_BY_SPI           (0x0001 << 13)
+
+/** Network interface ID. */
+typedef enum _ipc_netif_id_e {
+    IPC_NETIF_ID_CCMNI_BEGIN = 0x00000000,
+    IPC_NETIF_ID_CCMNI_END   = 0x000000ff,
+    IPC_NETIF_ID_ETH_BEGIN   = 0x00000100,
+    IPC_NETIF_ID_ETH_END     = 0x000001ff,
+    IPC_NETIF_ID_MBIM_BEGIN  = 0x00000200,
+    IPC_NETIF_ID_MBIM_END    = 0x000002ff,
+    IPC_NETIF_ID_PPP_BEGIN   = 0x00000300,
+    IPC_NETIF_ID_PPP_END     = 0x000003ff,
+    IPC_NETIF_ID_LHIF_BEGIN  = 0x00000400,
+    IPC_NETIF_ID_LHIF_END    = 0x000004ff,
+    IPC_NETIF_ID_MCIF_BEGIN  = 0x00000500,
+    IPC_NETIF_ID_MCIF_END    = 0x000005ff,
+    IPC_NETIF_ID_VNIF_BEGIN  = 0x00000600,
+    IPC_NETIF_ID_VNIF_END    = 0x000006ff,
+} ipc_netif_id_e;
+
+/** IPCore defines netif type for CCMNI Queue Mapping */
+typedef enum _ipc_netif_type_e {
+    IPC_NETIF_TYPE_NORMAL,
+    IPC_NETIF_TYPE_LATENCY_CONCERN,
+} ipc_netif_type_e;
+
+/** UL Data Throttling feature option */
+#define IPC_THROTTLE_FEATURE_BLOCK_LANTENCY_CONCERN 0x01
+
+/** Gen93 DL DID HIF Type Enum definition */
+typedef enum _ipc_si_hif_type_e {
+    IPC_SI_HIF_TYPE_LHIF = 0,
+    IPC_SI_HIF_TYPE_USB  = 1,
+    IPC_SI_HIF_TYPE_MCIF = 2,
+    IPC_SI_HIF_TYPE_VNIF = 3,
+    IPC_SI_HIF_TYPE_IGR  = 0x7,
+    IPC_SI_HIF_TYPE_MAX,
+} ipc_si_hif_type_e;
+
+/** Get Packet Info Error Code */
+typedef enum _ipc_packet_info_parser_error_code {
+    V4_IPV4_HDR_FAILED = 0,
+    V4_UDP_HDR_FAILED,
+    V4_TCP_HDR_FAILED,
+    V4_ICMP_HDR_FAILED,
+    V4_AH_HDR_FAILED,
+    V4_ESP_HDR_FAILED,
+    V6_IPV6_HDR_FAILED,
+    V6_UDP_HDR_FAILED,
+    V6_TCP_HDR_FAILED,
+    V6_ICMP_HDR_FAILED,
+    V6_EXT_HDR_FAILED,
+    V6_ESP_HDR_FAILED,
+    FIND_V6_EXT_HDR_FAILED,
+    FIND_V6_EXT_HDR_SHIFT_FAILED,
+    IPC_PACKET_INFO_PARSER_ERROR_CODE_MAX = 0x7fffffff,
+} ipc_packet_info_parser_error_code;
+
+/** IPCore filter_info source descriptor type */
+typedef enum _ipc_fi_desc_type_e {
+    IPC_FI_DESC_TYPE_DID,
+    IPC_FI_DESC_TYPE_NONE,
+    IPC_FI_DESC_TYPE_MAX = 0xffffffff,
+} ipc_fi_desc_type_e;
+
+/** IPCORE UL throttle state enum */
+typedef enum _ipc_ul_throttle_state_e {
+    IPC_UL_THROTTLE_STATE_NONE,
+    IPC_UL_THROTTLE_STATE_ACTIVE,
+    IPC_UL_THROTTLE_STATE_SUSPEND,
+} ipc_ul_throttle_state_e;
+
+/** IPCore notification type definition */
+typedef enum _ipc_ntfy_type_e {
+    IPC_NTFY_TYPE_INVALID,
+    IPC_NTFY_TYPE_MIN,
+    IPC_NTFY_TYPE_ATTACH,
+    IPC_NTFY_TYPE_DETACH,
+    IPC_NTFY_TYPE_IP_DOWN,
+    IPC_NTFY_TYPE_IP_UP,
+    IPC_NTFY_TYPE_LINK_DOWN,
+    IPC_NTFY_TYPE_LINK_UP,
+    IPC_NTFY_TYPE_MAX,
+} ipc_ntfy_type_e;
+
+/** IPCore io request type */
+typedef enum _ipc_io_req_data_path_e {
+    IPC_NORMAL_DATA_PATH = 0,
+    IPC_INTERNAL_DATA_PATH,
+} ipc_io_req_data_path_e;
+
+/**
+ * Backward compatible to kal_bool isGPD in ipc_pkt_t.
+ * Note that NO_DESC MUST be 0 and GPD MUST be 1.
+ */
+typedef enum _ipc_pkt_des_type_e {
+    IPC_PKT_DES_TYPE_NO_DESC = 0,
+    IPC_PKT_DES_TYPE_GPD = 1,
+    IPC_PKT_DES_TYPE_SPD,
+    IPC_PKT_DES_TYPE_META,
+    IPC_PKT_DES_TYPE_DID,
+    IPC_PKT_DES_TYPE_MAX,
+} ipc_pkt_des_type_e;
+
+/** IPCore link req type definition */
+typedef enum _ipc_link_req_type_e {
+    IPC_LINK_REQ_TYPE_NORMAL,
+    IPC_LINK_REQ_TYPE_DPFM,
+} ipc_link_req_type_e;
+
+/** IPCore data path definition */
+typedef enum _ipc_data_path_direction_e {
+    DL_DIRECT = 0,
+    UL_DIRECT
+} ipc_data_path_direction_e;
+
+/** IPCore filter notification type */
+typedef enum _ipc_filter_ntfy_type_e {
+    IPC_FILTER_NTFY_CBK_FUNC,
+    IPC_FILTER_NTFY_ILM,
+    IPC_FILTER_NTFY_CBK_FUNC_WITH_FILTER_INFO,
+    IPC_FILTER_NTFY_ILM_WITH_FILTER_INFO
+} ipc_filter_ntfy_type_e;
+
+typedef enum _ipc_data_enq_position_e {
+    IPC_DATA_DID_HEAD = 0,
+    IPC_DATA_DID_TAIL
+} ipc_data_enq_position_e;
+
+#endif /* __INC_IPC_ENUMS_H */
diff --git a/mcu/interface/middleware/hif/ipc_filter_priority.h b/mcu/interface/middleware/hif/ipc_filter_priority.h
new file mode 100644
index 0000000..9d0a7e9
--- /dev/null
+++ b/mcu/interface/middleware/hif/ipc_filter_priority.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) 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:
+ * ---------
+ *   ipc_filter_priority.h
+ *
+ * Project:
+ * --------
+ *   MOLY
+ *
+ * Description:
+ * ------------
+ *   IP Core filter priority definition.
+ *
+ * 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!!
+ *==============================================================================
+ *******************************************************************************/
+
+#ifndef __INC_IPC_FILTER_PRIORITY_H
+#define __INC_IPC_FILTER_PRIORITY_H
+
+#define IPC_UL_FILTER_PRIORITY(_name, _num) IPC_UL_FILTER_PRIORITY_ ## _name ## _BEGIN, \
+                                            IPC_UL_FILTER_PRIORITY_ ## _name ## _END = IPC_UL_FILTER_PRIORITY_ ## _name ## _BEGIN + _num,
+
+#define IPC_DL_FILTER_PRIORITY(_name, _num) IPC_DL_FILTER_PRIORITY_ ## _name ## _BEGIN, \
+                                            IPC_DL_FILTER_PRIORITY_ ## _name ## _END = IPC_DL_FILTER_PRIORITY_ ## _name ## _BEGIN + _num,
+
+/* Priority for UL filters */
+typedef enum {
+    IPC_UL_FILTER_PRIORITY_BEGIN = 0,
+
+    IPC_UL_FILTER_PRIORITY(AOMGR, 20)
+    IPC_UL_FILTER_PRIORITY(NDPC, 4)
+
+    MAX_IPC_UL_FILTER_PRIORITY,
+} IPC_UL_FILTER_PRIORITY;
+
+/* Priority for DL filters */
+typedef enum {
+    IPC_DL_FILTER_PRIORITY_BEGIN = 0,
+
+    IPC_DL_FILTER_PRIORITY(IPC_DHCP, 16)
+    IPC_DL_FILTER_PRIORITY(AOMGR, 4)
+    IPC_DL_FILTER_PRIORITY(LTECSR, 4)
+    IPC_DL_FILTER_PRIORITY(TCPIP_STACK, 1)
+
+    IPC_DL_FILTER_PRIORITY(PFM_GARBAGE_FILTER, 128)
+
+    MAX_IPC_DL_FILTER_PRIORITY,
+} IPC_DL_FILTER_PRIORITY;
+
+#endif /* __INC_IPC_FILTER_PRIORITY_H */
diff --git a/mcu/interface/middleware/hif/ipc_struct.h b/mcu/interface/middleware/hif/ipc_struct.h
new file mode 100644
index 0000000..ab3625b
--- /dev/null
+++ b/mcu/interface/middleware/hif/ipc_struct.h
@@ -0,0 +1,694 @@
+/******************************************************************************
+*  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:
+ * ---------
+ *   ipc_struct.h
+ *
+ * Project:
+ * --------
+ *   TATAKA
+ *
+ * Description:
+ * ------------
+ *   IP Core ILM structure and interface definition.
+ *
+ * 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!
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+#ifndef __INC_IPC_STRUCT_H
+#define __INC_IPC_STRUCT_H
+
+#include "kal_public_api.h"
+#include "ipcore_upcm_struct.h"
+#include "upcm_did.h"
+#include "ipc_defs_public.h"
+#include "ipc_enums.h"
+#include "qmu_bm_common.h"
+#include "hif_lhif.h"
+
+typedef struct _ipc_packet_info_t {
+    kal_uint32 info_valid_fields;
+    kal_uint32 src_addr[4];
+    kal_uint32 dst_addr[4];
+    kal_uint16 ipv4_checksum;
+    kal_uint16 src_port;
+    kal_uint16 dst_port;
+    kal_uint16 tcp_flags;
+    kal_uint16 l4_checksum;
+    kal_uint8 reserved[2];
+    kal_uint8 icmpv4_type;
+    kal_uint8 icmpv6_type;
+    kal_uint8 protocol;
+    /* The following are NOT included in valid_fields */
+    kal_bool fragment;
+    kal_bool need_reassemble;
+    kal_uint32 l4_offset;
+    kal_uint32 data_offset;
+    kal_uint32 netif_id;
+    kal_uint32 out_netif_id;
+    kal_uint32 ip_id;                       /**< IPv4/IPv6 IP ID */
+    kal_uint16 frag_payload_offset;         /**< fragment offset */
+    kal_uint16 frag_payload_len;            /**< Payload length: IPv4 frag payload lenght = total length - IPv4 HDR length, IPv6 frag payload lenght = payload length - all ext HDR lehgth before fragment   >> HDR - fragment HDR lenght */
+    kal_uint8 frag_flag;                    /**< fragment flag: more fragment */
+    kal_uint16 frag_buffer_payload_offset;  /**< buffer offset which is used to inidcate the start address of fragmented payload in GPD */
+    kal_uint32 spi;
+} ipc_packet_info_t;
+
+typedef struct _ipc_io_request_t {
+    struct _ipc_io_request_t    *next_request;
+    qbm_gpd*                    first_gpd;
+    qbm_gpd*                    last_gpd;
+    kal_uint8                   ip_type;        /**< Type of IP datagrams, see IPC_IP_TYPE_XXX defined for valid values. */
+    kal_uint8                   qos_priority;   /**< Priority, valid from 0~7. */
+    kal_uint8                   data_path_type; /**< reference ipc_io_req_data_path_e */
+    kal_uint8                   reserved;
+} ipc_io_request_t;
+
+typedef struct _ipc_conf_t {
+    module_type     module_id; /**< The module registering with IP CORE. */
+    kal_uint32      netif_id;  /**< An index to identify instance of a specific module. For example, if module_id is MOD_ETHERCORE, netif_id is 0, it reprents for eth0. */
+    kal_uint32      features;  /**< Each bit is set to enable an optional feature, see IPC_F_XXX for details. */
+
+    void           *ul_reload_context; /**< Context to be passed in the callback function ipc_ul_reload_callback_t. */
+    kal_bool        (*ipc_ul_reload_callback_t)(void *context); /**< Uplink reloading callback function. */
+
+    void           *callback_context; /**< Context to be passed in the follow callback functions. */
+    kal_bool        (*ipc_dlink_callback_t)(void *context, ipc_io_request_t *ior); /** Downlink callback function. */
+    kal_bool        (*ipc_dlink_did_cb_t)(void *context, upcm_did *did); /** [Gen93] Downlink callback function. */
+} ipc_conf_t;
+
+typedef struct _ipc_frag_refilter_info_t {
+    kal_bool                uplink;
+    kal_bool                is_pkt_info;
+    kal_uint32              netif_id;
+    kal_uint32              pdn_id;
+    ipc_packet_info_t      *packet_info;
+    kal_int32               filter_id;
+    kal_uint32              filter_magic_number;
+} ipc_frag_refilter_info_t;
+
+typedef struct _ipc_filter_info_t {
+    kal_uint32      netif_id;     /**< Source Network interface ID */
+    kal_int32       ip_id;        /**< ID to query corresponding NMU IP database */
+    kal_int16       ebi;          /**< EBI that the packets came from (only valid for DL) */
+    kal_uint8       proto_idx;    /**< Index for distinquish different SIM card (only valid when supporting Multiple PS feature */
+    kal_uint8       rsvd;
+    kal_uint32      data_offset;    /**< The data offset to payload. (The length of IP TCP/UDP header) Requirement from TH.Cheng LTECSR 2014/11/11 */
+    void           *src_desc_ptr;   /**< Descriptor pointer */
+    kal_uint32      src_desc_type;  /**< Descriptor type (please refer to ipc_fi_desc_type_e)*/
+    kal_uint32      src_desc_indx;  /**< Descriptor internal index, for one descriptor containing more than one packets case. */
+} ipc_filter_info_t;
+
+/*
+ * Callback function to process the IP datagram filtered.
+ *
+ * @param   context [IN] A context specified while registering the filter.
+ * @param   filter_id [IN] Corresponding registered filter ID.
+ * @param   head_gpd [IN] Pointer head of the GPD list for the IP datagram filtered.
+ * @param   tail_gpd [IN] Pointer tail of the GPD list for the IP datagram filtered.
+ * @param   length [IN] Bytes of buffers used in the GPD list.
+ */
+typedef void (*ipc_filter_callback_t)(void *context,
+                                      kal_int32 filter_id,
+                                      qbm_gpd *head_gpd,
+                                      qbm_gpd *tail_gpd,
+                                      kal_uint32 length);
+
+/*
+ * Callback function with packet information to process the IP datagram filtered.
+ *
+ * @param   info_p [IN] Related information of filtered out GPDs.
+ * @param   context [IN] A context specified while registering the filter.
+ * @param   filter_id [IN] Corresponding registered filter ID.
+ * @param   head_gpd [IN] Pointer head of the GPD list for the IP datagram filtered.
+ * @param   tail_gpd [IN] Pointer tail of the GPD list for the IP datagram filtered.
+ * @param   length [IN] Bytes of buffers used in the GPD list.
+ */
+typedef void (*ipc_filter_with_info_callback_t)(ipc_filter_info_t *info_p,
+                                                void *context,
+                                                kal_int32 filter_id,
+                                                qbm_gpd *head_gpd,
+                                                qbm_gpd *tail_gpd,
+                                                kal_uint32 length);
+
+/**
+ * Customized Callback function to process the IP datagram filtered.
+ *
+ * @param   p_pkt     matched filter packet content
+ * @param   pkt_len   packet length
+ * @param   filter_id the filter id which was registered before
+ * @param   p_args    customized filter callback function arguments
+ *
+ * @return  KAL_TRUE means packet was matched; otherwise KAL_FALSE
+ */
+
+typedef kal_bool (*ipc_filter_cust_cbk)(const kal_uint8 *p_pkt,
+                                        kal_int32        pkt_len,
+                                        kal_int32        filter_id,
+                                        void            *p_args);
+
+typedef struct _ipc_filter_rules_t {
+    kal_uint16      features;     /**< Union of  to indicate which type of filter it is. */
+    kal_uint16      priority;     /**< Priority will affect the order of filter rules when performing filtering. */
+    kal_uint32      valid_fields; /**< Union of IPC_FILTER_BY_XXX to indicate which fields in this structure are valid. */
+    kal_uint32      netif_id;     /**< Network interface ID to filter. */
+    kal_uint32      pdn_id;       /**< [downlink filter ONLY] PDN ID to filter. */
+    kal_uint32      ebi;          /**< [downlink filter ONLY] EBI/NSAPI to filter. */
+    kal_uint8       proto_idx;    /**< [downlink filter ONLY] Multiple PS use only. */
+    kal_uint8       protocol;     /**< The protocol used in the data portion of the IP datagram to filter. */
+
+    kal_uint16      src_port;     /**< Source port number to filter. */
+    kal_uint16      dst_port;     /**< Destination port number to filter. */
+    kal_uint16      tcp_flags;    /**< TCP flags of TCP to filter. */
+    kal_uint32      spi;          /**< Security Parameter Index. */
+
+    union {
+        kal_uint8 addr8[4];
+        kal_uint32 addr32;
+    } src_ipv4; /**< Source IPv4 address to filter. */
+    union {
+        kal_uint8 addr8[4];
+        kal_uint32 addr32;
+    } dst_ipv4; /**< Destination IPv4 address to filter. */
+
+    union {
+        kal_uint8 addr8[16];
+        kal_uint32 addr32[4];
+    } src_ipv6; /**< Source IPv6 address to filter. */
+    union {
+        kal_uint8 addr8[16];
+        kal_uint32 addr32[4];
+    } dst_ipv6; /**< Destination IPv6 address to filter. */
+
+    kal_uint8       ip_type;      /**< Type of IP traffic the filter to apply, see IPC_IP_TYPE_XXX defined for valid values. */
+    kal_uint8       icmpv4_type;    /**< Type field of ICMPv4 header to filter. */
+    kal_uint8       icmpv6_type;    /**< Type field of ICMPv6 header to filter. */
+    kal_uint8       reserved;
+    ipc_filter_cust_cbk  cust_cbk_func;
+    void                *p_cust_cbk_args;
+} ipc_filter_rules_t;
+
+#define IPC_NEXT_FILTER_MAP_SIZE    2
+typedef struct _ipc_filter_t ipc_filter_t;
+typedef struct _ipc_filter_t {
+    kal_int32               filter_id;
+    ipc_filter_rules_t      rules;
+    kal_bool                callback_with_info;
+    void                   *callback_func;
+    void                   *callback_context;
+    module_type             module_id;
+    kal_uint8               is_updated_to_list;
+    kal_uint8               rsvd[1];
+    void                   *module_context;
+    ipc_filter_t           *next_filter_map[IPC_NEXT_FILTER_MAP_SIZE];
+    ipc_filter_cust_cbk     cust_cbk_func;
+    void                   *p_cust_cbk_args;
+    kal_bool                is_bypass_sync_hw;
+} ipc_filter_t;
+
+typedef struct _ipc_hdr_t {
+    kal_uint8       ip_type;    /**< Type of IP datagrams, see IPC_IP_TYPE_XXX defined for valid values. Note that only one of IPv4/IPv6 can be selected and MIX type is NOT allowed */
+    kal_uint8      *src_addr;   /**< Source IP Address, length of this pointer is decided by ip_type field */
+    kal_uint8      *dst_addr;   /**< Destination IP Address, length of this pointer is decided by ip_type field */
+    kal_uint16      src_port;   /**< Source Port Number */
+    kal_uint16      dst_port;   /**< Destination Port Number */
+    kal_uint8       dscp_tc;    /**< DSCP & ECN(IPv4) or Traffic Class(IPv6) field */
+} ipc_hdr_t;
+
+typedef void * ipc_handle_t;
+
+/**
+ * UPCM will fill DL info only on head GPD's SW control Info.
+ * user use  QBM_DES_GET_SW_CTRL_FIELD(_p) to get this structure
+ */
+typedef struct
+{
+    kal_uint8       ebi;
+    kal_uint8       flow:4;
+    kal_uint8       reserved:4;
+    kal_uint16      psn;
+}ipc_gpd_extra_info_t;
+
+/** Local parameter structure for MSG_ID_IPCORE_LINK_UP_IND / MSG_ID_IPCORE_IP_UP_IND / MSG_ID_IPCORE_LINK_UP_RSP / MSG_ID_IPCORE_IP_UP_RSP. */
+typedef struct _ipc_link_handshake_msg_t {
+    LOCAL_PARA_HDR
+    kal_uint32      netif_id;   /**< Unique ID to identified corresponding host network interface */
+    kal_int32       ip_id;      /**< ID to query corresponding NMU IP database */
+    kal_uint8       ip_type;    /**< Type of IP datagrams, see IPC_IP_TYPE_XXX defined for valid values. */
+    kal_uint8       rsvd[3];
+} ipc_link_handshake_msg_t;
+
+/** Local parameter structure for MSG_ID_IPCORE_LINK_UP_REQ / MSG_ID_IPCORE_LINK_DOWN_REQ / MSG_ID_IPCORE_IP_UP_REQ / MSG_ID_IPCORE_IP_DOWN_REQ. */
+typedef struct _ipc_link_req_t {
+    LOCAL_PARA_HDR
+    void           *callback_context;   /**< Context registered in to ipc_attach(). */
+    kal_uint8       ip_type;            /**< Type of IP datagrams, see IPC_IP_TYPE_XXX defined for valid values. */
+    kal_uint8       rsvd[3];
+    ipc_link_req_type_e req_type;
+} ipc_link_req_t;
+
+/** Local parameter structure for MSG_ID_IPCORE_LHIFCORE_QUEUE_MAPPING_REQ/RSP. */
+typedef struct _ipc_lhifcore_q_mapping_msg_t {
+    LOCAL_PARA_HDR
+    ipcore_upcm_pdn_bind_ind_struct bind_ind;           /**< PDN binding information */
+    module_type                     bind_src_mod_id;    /**< PDN binding ILM src module ID */
+    kal_uint32                      netif_features;     /**< Binding netif features */
+    void                           *callback_context;   /**< Context registered in to ipc_attach(). */
+    ipc_netif_type_e                netif_type;         /**< Type of netif for ccmni queue mapping, see ipc_netif_type_e defined for valid values */
+    kal_bool                        result;             /**< The result of dynamic queue mapping */
+} ipc_lhifcore_q_mapping_msg_t;
+
+/** Local parameter structure for MSG_ID_IPCORE_DL_PACKET_FILTERED_REQ and MSG_ID_IPCORE_UL_PACKET_FILTERED_REQ. */
+typedef struct _ipc_packet_filtered_req_t
+{
+    LOCAL_PARA_HDR
+    void       *context;
+    kal_int32   filter_id;
+    void       *head_gpd;
+    void       *tail_gpd;
+    kal_uint32  length;
+} ipc_packet_filtered_req_t;
+
+/** Local parameter structure for MSG_ID_IPCORE_DL_PACKET_FILTERED_WITH_INFO_REQ and MSG_ID_IPCORE_UL_PACKET_FILTERED_WITH_INFO_REQ. */
+typedef struct _ipc_packet_filtered_with_info_req_t
+{
+    LOCAL_PARA_HDR
+    ipc_filter_info_t    info;
+    void                *context;
+    kal_int32             filter_id;
+    void                *head_gpd;
+    void                *tail_gpd;
+    kal_uint32           length;
+} ipc_packet_filtered_with_info_req_t;
+
+/** Local parameter structure for MSG_ID_IPCORE_QUERY_INFO_CNF. */
+typedef struct _ipc_netif_info_t
+{
+    kal_uint32 netif_id;    /** Unique ID for corresponding host network interface */
+} ipc_netif_info_t;
+
+typedef struct _ipc_netif_list_t
+{
+    kal_uint32 netif_cnt;                       /**< Attached netif count */
+    ipc_netif_info_t list[IPC_MAX_NETIF_CNT];   /**< Information of each attached netif */
+} ipc_netif_list_t;
+
+typedef struct _ipc_query_info_t
+{
+    LOCAL_PARA_HDR
+    ipc_netif_list_t netif; /** Network interface information */
+} ipc_query_info_t;
+
+/** Parameter for IP CORE status change notifications */
+typedef struct _ipc_ntfy_param_t
+{
+    ipc_ntfy_type_e ntfy_type;  /**< Notify type to indicate */
+    kal_int32       ntfy_id;    /**< Notify ID allocated in ipc_register_ntfy(). */
+    void            *context;   /**< Context registered in ipc_register_ntfy(). */
+    kal_uint32      netif_id;   /**< Unique ID to identified corresponding host network interface */
+    kal_int32       ip_id;      /**< ID to query corresponding NMU IP database */
+} ipc_ntfy_param_t;
+
+/** Local parameter structure for MSG_ID_LMS_NETIF_ATTACH */
+typedef struct _lms_ipc_ntfy_t {
+    LOCAL_PARA_HDR
+    ipc_ntfy_param_t ipc_ntfy_para;
+} lms_ipc_ntfy_t;
+
+/*
+ * Callback function to notify IPCore notification.
+ *
+ * @param   param [IN] Parameter to notify registered module.
+ */
+typedef void (*ipc_ntfy_callback_t)(ipc_ntfy_param_t *param);
+
+/** Parameter for IPCore UL throttle configuration */
+typedef struct _ipc_ul_throttle_conf_t
+{
+    kal_uint8       enabled;                    /**< 0 to disable IPCORE UL throttle mechanism; otherwise, others to enable. */
+    kal_uint8       active_period_100ms;        /**< active period of UL throttle, minimum unit: 100ms.*/
+    kal_uint8       suspend_period_100ms;       /**< suspend period of UL throttle, minimum unit: 100ms.*/
+    kal_uint8       features;                   /**< feature option of UL throttle, please refer IPC_THROTTLE_FEATURE_XX */
+} ipc_ul_throttle_conf_t;
+
+/** Local parameter structure for MSG_ID_IPCORE_SET_UL_THROTTLE */
+typedef struct _ipc_set_ul_throttle_param_t {
+    LOCAL_PARA_HDR
+    ipc_ul_throttle_conf_t conf;
+} ipc_set_ul_throttle_param_t;
+
+/** Local EM structure for MSG_ID_EM_IPC_UL_THROTTLE_STATUS_IND */
+typedef struct _em_ipc_ul_throttle_status_ind_struct_t
+{
+    LOCAL_PARA_HDR
+    ipc_ul_throttle_state_e throttle_state;
+    ipc_ul_throttle_conf_t throttle_conf;
+} em_ipc_ul_throttle_status_ind_struct_t;
+
+/** Local parameter structure for MSG_ID_IPCORE_VDM_IMS_EMERGENCY_CALL_IND */
+typedef struct _ipc_vdm_ims_emergency_call_ind_struct_t
+{
+    LOCAL_PARA_HDR
+    kal_bool is_calling;
+} ipc_vdm_ims_emergency_call_ind_struct_t;
+
+/** Local parameter structure for MSG_ID_IPCORE_REGISTER_FILTER_REQ */
+typedef struct _ipc_register_filter_req_struct_t
+{
+    LOCAL_PARA_HDR
+    kal_int32               filter_id;
+    kal_bool                data_path_direct;
+    kal_bool                callback_with_info;
+    ipc_filter_rules_t      rules;
+    void                   *callback_func;
+    void                   *callback_context;
+    module_type             module_id;
+} ipc_register_filter_req_struct_t;
+
+/** Local parameter structure for MSG_ID_IPCORE_DEREGISTER_FILTER_REQ */
+typedef struct _ipc_deregister_filter_req_struct_t
+{
+    LOCAL_PARA_HDR
+    kal_int32               filter_id;
+} ipc_deregister_filter_req_struct_t;
+
+/** RQ rules structure */
+typedef struct _ipc_rq_info_t {
+    kal_bool is_ipv4;
+    kal_uint16 src_port;
+    kal_uint16 dst_port;
+    kal_uint32 spi;
+
+#define IPC_RQ_INFO_3_TUPLE (0x1 << 0)
+#define IPC_RQ_INFO_5_TUPLE (0x1 << 1)
+#define IPC_RQ_INFO_SPI     (0x1 << 2)
+    kal_uint8 valid_field;
+    kal_uint8 qfi;
+    kal_uint8 protocol;
+    kal_uint8 psi;
+
+    union {
+        kal_uint8 addr8[4];
+        kal_uint32 addr32;
+    } src_ipv4;
+    union {
+        kal_uint8 addr8[4];
+        kal_uint32 addr32;
+    } dst_ipv4;
+
+    union {
+        kal_uint8 addr8[16];
+        kal_uint32 addr32[4];
+    } src_ipv6;
+    union {
+        kal_uint8 addr8[16];
+        kal_uint32 addr32[4];
+    } dst_ipv6;
+} ipc_rq_info_t;
+
+typedef struct _ipc_rq_info_ind_t {
+    PEER_BUFF_HDR
+    void *p_rq_info;
+} ipc_rq_info_ind_t;
+
+/* IPCore filter notification context */
+typedef struct _ipc_filter_ntfy_mode_t {
+    module_type                     cbk_mod;
+    ipc_filter_callback_t           cbk_func;
+    ipc_filter_with_info_callback_t with_info_cbk_func;
+} ipc_filter_ntfy_mode_t;
+
+/* IPCore filter notification context */
+typedef struct _ipc_filter_ntfy_ctxt_t {
+    ipc_filter_ntfy_type_e ntfy_type;
+    ipc_filter_ntfy_mode_t ntfy_mod;
+    void *p_ntfy_args;
+} ipc_filter_ntfy_ctxt_t;
+
+typedef struct _ipc_restore_netif_struct_t {
+    LOCAL_PARA_HDR
+
+    kal_uint32 netif_id;
+    kal_uint8 ip_type;
+    kal_bool is_link_update;
+    kal_bool is_up;
+} ipc_restore_netif_struct_t;
+
+typedef struct _d2cm_ipcore_info_ind_struct
+{
+    LOCAL_PARA_HDR
+    kal_int32 netif_id;
+    kal_bool keep_ra;
+} d2cm_ipcore_info_ind_struct;
+
+typedef struct _ipc_data_usage_info_t {
+    kal_uint32 uplink_bytes;
+    kal_uint32 downlink_bytes;
+    kal_uint32 uplink_packets;
+    kal_uint32 downlink_packets;
+} ipc_data_usage_info_t;
+
+/**------------------------------------------------------------------------------
+ * DHL logging structure
+ *----------------------------------------------------------------------------*/
+/** typedef void ipcore_code_begin_struct; */
+typedef ipc_link_req_t ipcore_link_up_req_struct;
+typedef ipc_link_req_t ipcore_link_down_req_struct;
+typedef ipc_lhifcore_q_mapping_msg_t ipcore_lhifcore_queue_mapping_req_struct;
+typedef ipc_lhifcore_q_mapping_msg_t ipcore_lhifcore_queue_mapping_rsp_struct;
+/** typedef void lms_dl_sdu_struct; */
+typedef lms_ipc_ntfy_t lms_netif_attach_struct;
+/** typedef void ipcore_process_ul_queue_req_struct; */
+/** typedef void ipcore_retry_ul_reload_req_struct; */
+typedef ipc_packet_filtered_req_t ipcore_dl_packet_filtered_req_struct;
+typedef ipc_packet_filtered_req_t ipcore_ul_packet_filtered_req_struct;
+typedef ipc_link_req_t ipcore_ip_up_req_struct;
+typedef ipc_link_req_t ipcore_ip_down_req_struct;
+typedef ipc_link_handshake_msg_t ipcore_link_up_ind_struct;
+typedef ipc_link_handshake_msg_t ipcore_ip_up_ind_struct;
+typedef ipc_link_handshake_msg_t ipcore_link_up_rsp_struct;
+typedef ipc_link_handshake_msg_t ipcore_ip_up_rsp_struct;
+/** typedef void ipcore_query_info_req_struct; */
+typedef ipc_query_info_t ipcore_query_info_cnf_struct;
+typedef ipc_packet_filtered_with_info_req_t ipcore_dl_packet_filtered_with_info_req_struct;
+typedef ipc_packet_filtered_with_info_req_t ipcore_ul_packet_filtered_with_info_req_struct;
+typedef ipc_set_ul_throttle_param_t ipcore_set_ul_throttle_struct;
+typedef em_ipc_ul_throttle_status_ind_struct_t em_ipc_ul_throttle_status_ind_struct;
+typedef ipc_vdm_ims_emergency_call_ind_struct_t ipcore_vdm_ims_emergency_call_ind_struct;
+typedef ipc_register_filter_req_struct_t ipcore_register_filter_req_struct;
+typedef ipc_deregister_filter_req_struct_t ipcore_deregister_filter_req_struct;
+
+#endif /* __INC_IPC_STRUCT_H */
diff --git a/mcu/interface/middleware/hif/ipfc_enums.h b/mcu/interface/middleware/hif/ipfc_enums.h
new file mode 100644
index 0000000..b5c9824
--- /dev/null
+++ b/mcu/interface/middleware/hif/ipfc_enums.h
@@ -0,0 +1,15 @@
+#ifndef __INC_IPFC_ENUMS_H
+#define __INC_IPFC_ENUMS_H
+
+typedef enum _ipfc_dbg_func_code {
+    IPFC_CORE_MAKE_RESERVATION = 0,
+    IPFC_CORE_CANCEL_RESERVATION,
+    IPFC_CORE_WAIT_IN_LINE,
+    IPFC_CORE_SERVE_ORDER,
+    IPFC_GOURMET_DL_FILTER_QUEST_TO_UPDATE_HW_FILTER,
+    IPFC_GOURMET_DL_FILTER_PEND_TO_UPDATE_HW_FILTER,
+    IPFC_GOURMET_DL_FILTER_UPDATE_HW_FILTER,
+    IPFC_DBG_FUNC_CODE_MAX = 0x7fffffff,
+} ipfc_dbg_func_code;
+
+#endif /* __INC_IPFC_ENUMS_H */
diff --git a/mcu/interface/middleware/hif/ipfc_export_core.h b/mcu/interface/middleware/hif/ipfc_export_core.h
new file mode 100644
index 0000000..01ab493
--- /dev/null
+++ b/mcu/interface/middleware/hif/ipfc_export_core.h
@@ -0,0 +1,10 @@
+#ifndef  _IPFCORE_EXPORT_INC
+#define  _IPFCORE_EXPORT_INC
+
+#include "kal_public_api.h"
+
+kal_bool    ipfc_core_enable_meta_check(kal_uint32 meta_id, void (*hdlr_p)(kal_uint16, kal_uint16, kal_uint32));
+void        ipfc_core_query_meta_info(void** base, kal_uint16* entry_num, kal_uint32 ipf_meta_q_type);
+void        ipfc_core_release_meta_entry(kal_uint16 rel_num, kal_uint32 ipf_meta_q_type);
+
+#endif //_IPFCORE_EXPORT_INC
diff --git a/mcu/interface/middleware/hif/ipfc_export_plugin_rqos.h b/mcu/interface/middleware/hif/ipfc_export_plugin_rqos.h
new file mode 100644
index 0000000..deeec1d
--- /dev/null
+++ b/mcu/interface/middleware/hif/ipfc_export_plugin_rqos.h
@@ -0,0 +1,10 @@
+#ifndef __INC_IPFC_PLUGIN_RQOS
+#define __INC_IPFC_PLUGIN_RQOS
+
+#include "kal_public_api.h"
+#include "ipfc_export_plugin_rqos_type.h"
+
+kal_bool ipfc_plugin_rqos_set_threshold(kal_uint8 pdn_sim_id, kal_bool to_enable, kal_uint16 threshold);
+kal_bool ipfc_gourmet_rqos_nas_enable(kal_uint16 t_unit);
+
+#endif //__INC_IPFC_PLUGIN_RQOS
diff --git a/mcu/interface/middleware/hif/ipfc_export_plugin_rqos_type.h b/mcu/interface/middleware/hif/ipfc_export_plugin_rqos_type.h
new file mode 100644
index 0000000..79914ef
--- /dev/null
+++ b/mcu/interface/middleware/hif/ipfc_export_plugin_rqos_type.h
@@ -0,0 +1,29 @@
+#ifndef __INC_IPFC_PLUGIN_RQOS_TYPE
+#define __INC_IPFC_PLUGIN_RQOS_TYPE
+
+#include "kal_public_api.h"
+#include "kal_public_defs.h"
+
+#include "ipc_struct.h"
+
+#define RQOS_PROTOCOL_TCP 0x06
+#define RQOS_PROTOCOL_UDP 0x11
+#define RQOS_PROTOCOL_ESP 0x32
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+    kal_uint8 rule_idx;
+
+    ipc_rq_info_t rq_info;
+
+} tftlib_rqos_add_rule_ind_struct;
+
+typedef struct
+{
+    LOCAL_PARA_HDR
+    kal_uint32 delete_bitmask;
+
+} tftlib_rqos_del_rules_ind_struct;
+
+#endif //__INC_IPFC_PLUGIN_RQOS_TYPE
diff --git a/mcu/interface/middleware/hif/lms_enums.h b/mcu/interface/middleware/hif/lms_enums.h
new file mode 100644
index 0000000..b00841d
--- /dev/null
+++ b/mcu/interface/middleware/hif/lms_enums.h
@@ -0,0 +1,70 @@
+/*****************************************************************************
+*  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:
+ * ---------
+ *   lms_enums.h
+ *
+ * Project:
+ * --------
+ *   TATAKA
+ *
+ * Description:
+ * ------------
+ *   LMS public enumeration definition.
+ *
+ * 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 __INC_LMS_ENUMS_H
+#define __INC_LMS_ENUMS_H
+
+/*------------------------------------------------------------------------------
+ * Data structure defintion.
+ *----------------------------------------------------------------------------*/
+
+#endif /* __INC_LMS_ENUMS_H */
diff --git a/mcu/interface/middleware/hif/lms_struct.h b/mcu/interface/middleware/hif/lms_struct.h
new file mode 100644
index 0000000..b642368
--- /dev/null
+++ b/mcu/interface/middleware/hif/lms_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:
+ * ---------
+ *   lms_struct.h
+ *
+ * Project:
+ * --------
+ *   TATAKA
+ *
+ * Description:
+ * ------------
+ *   LMS ILM structure and interface definition.
+ *
+ * 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 __INC_LMS_STRUCT_H
+#define __INC_LMS_STRUCT_H
+
+#include "hif_ior.h"
+#include "hif_mw_msgid.h"
+#include "ipc_struct.h"
+
+
+/*------------------------------------------------------------------------------
+ * DHL logging structure
+ *----------------------------------------------------------------------------*/
+
+#endif /* __INC_LMS_STRUCT_H */
diff --git a/mcu/interface/middleware/hif/mbim_defs_public.h b/mcu/interface/middleware/hif/mbim_defs_public.h
new file mode 100644
index 0000000..fa82349
--- /dev/null
+++ b/mcu/interface/middleware/hif/mbim_defs_public.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. 
+*
+*  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:
+ * ---------
+ *   mbim_defs_public.h
+ *
+ * Project:
+ * --------
+ * 
+ *
+ * Description:
+ * ------------
+ *   MBIM public definition.
+ *
+ * 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 __INC_MBIM_DEFS_PUBLIC_H
+#define __INC_MBIM_DEFS_PUBLIC_H
+
+typedef struct{
+	LOCAL_PARA_HDR
+	kal_uint32 remote_wakeup_type;
+} usb_l5io_remote_wakeup_ind_struct;
+
+typedef int (*mbim_suspend_callback)(void *param);
+void mbim_register_suspend_callback(mbim_suspend_callback callback, void *param);
+
+#endif /* __INC_MBIM_DEFS_PUBLIC_H */
diff --git a/mcu/interface/middleware/hif/ms_adapter.h b/mcu/interface/middleware/hif/ms_adapter.h
new file mode 100644
index 0000000..d9d7b3b
--- /dev/null
+++ b/mcu/interface/middleware/hif/ms_adapter.h
@@ -0,0 +1,83 @@
+#ifndef __MS_ADAPTER_H
+#define __MS_ADAPTER_H
+
+#include "fs_func.h"
+
+#define MAX_DISK_DRVER              	4
+#define	USBMS_INVALID_MAX_LUN			0xFF
+#define DEFAULT_MAX_GPD_OF_LUN			64
+#define NAND_READ_SZ					(1024*16)
+#define NAND_WRITE_SZ					(1024*32)
+
+typedef enum 
+{
+	USB_STORAGE_DEV_STATUS_OK = 0,
+	USB_STORAGE_DEV_STATUS_MEDIA_CHANGE,
+	USB_STORAGE_DEV_STATUS_NOMEDIA,
+	USB_STORAGE_DEV_STATUS_WP,
+	USB_STORAGE_DEV_STATUS_MAX
+} USB_STORAGE_DEV_STATUS;
+
+
+typedef enum
+{
+	USB_STORAGE_DEV_NOR,
+	USB_STORAGE_DEV_NAND,
+	USB_STORAGE_DEV_CARD,
+	USB_STORAGE_DEV_CDROM,
+	USB_STORAGE_DEV_NONE
+}USB_STORAGE_DEV_TYPE;
+
+/* read capacity command structure */
+typedef struct
+{
+	kal_uint32 LastBA;	/*depend on the target*/
+	kal_uint32 BlkLen;	/*512*/
+} Read_Capacity_Info;     
+
+typedef struct
+{
+	kal_bool (* usbms_read)(void *data, kal_uint32 lba, kal_uint16 lba_num);
+	kal_bool (* usbms_write)(void *data, kal_uint32 lba, kal_uint16 lba_num);
+	kal_bool (* usbms_read_gpd)(qbm_gpd *head,qbm_gpd *tail, kal_uint32 lba, kal_uint16 lba_num); //read with GPD
+	kal_bool (* usbms_write_gpd)(qbm_gpd *head,qbm_gpd *tail, kal_uint32 lba, kal_uint16 lba_num); //write with GPD
+	kal_bool (* usbms_query_max_bd_num)(kal_uint16  *max_bd_num); //query the max BD number, the driver can receive
+	kal_bool (* usbms_format)(void);
+	USB_STORAGE_DEV_STATUS (* usbms_checkmedia_exist)(void);
+	kal_bool (* usbms_prevmedia_removal)(kal_bool enable);
+	kal_bool (* usbms_read_capacity)(kal_uint32 *max_lba, kal_uint32 *lba_len);
+//	kal_bool (* usbms_read_formatcapacity)(kal_uint32 *no_of_blks, kal_uint32 *blk_len);
+	USB_STORAGE_DEV_TYPE	(* usbms_dev_type)(void);
+}USB_DiskDriver_STRUCT;
+
+typedef enum 
+{
+	MS_READ = 0,
+	MS_WRITE
+} MS_DIRECTION;
+
+extern FS_HANDLE			g_cdrom_drive_handle;
+/* translate fd type to usb dev type*/
+extern USB_STORAGE_DEV_TYPE MS_Trans_Fs_Type(FS_DEVICE_TYPE_ENUM type);
+extern kal_uint8 MS_Get_Max_LUN(void);
+extern void MS_DeRegister_DiskDriver(kal_uint8 disk_index);
+extern void MS_Change_Register_DiskDriver(kal_uint8 disk_index, USB_DiskDriver_STRUCT *disk_api);
+extern USB_STORAGE_DEV_STATUS MS_Checkmedia_Exist(kal_uint8 LUN);
+extern kal_bool MS_Format(kal_uint8 LUN);
+extern kal_bool MS_Read_Capacity(kal_uint8 LUN, kal_uint32 *max_lba, kal_uint32 *lba_len);
+//extern kal_bool MS_Read_FormatCapacity(kal_uint8 LUN, kal_uint32 *max_lba, kal_uint32 *sec_len);
+extern kal_bool MS_Read_Write(MS_DIRECTION direct, void *dev_t,qbm_gpd *head,qbm_gpd *tail, kal_uint16 lba_num);
+extern kal_bool MS_Prevmedia_Removal(kal_uint8 LUN, kal_bool enable);
+extern USB_STORAGE_DEV_TYPE MS_Dev_Type(kal_uint8 LUN);
+extern kal_uint8 MS_Register_DiskDriver(USB_DiskDriver_STRUCT *disk_api);
+extern kal_uint8 MS_Set_Current_Driver(kal_uint32 drv);
+extern kal_uint32 MS_Get_Current_Driver(void);
+extern void MS_Adapter_Deinit(void);
+extern void MS_Init_Normal_Mode(void);
+extern void MS_End_Normal_Mode(void);
+extern kal_uint16 MS_Query_Max_BD_Num(kal_uint8 LUN);
+extern void FAT_Init(void);
+
+#endif
+
+
diff --git a/mcu/interface/middleware/hif/nccmni_if.h b/mcu/interface/middleware/hif/nccmni_if.h
new file mode 100644
index 0000000..0ff8d38
--- /dev/null
+++ b/mcu/interface/middleware/hif/nccmni_if.h
@@ -0,0 +1,275 @@
+/*****************************************************************************
+*  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:
+ * ---------
+ *   nccmni.h
+ *
+ * Project:
+ * --------
+ *   VMOLY
+ *
+ * Description:
+ * ------------
+ *   NCCMNI interface header file
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ * ==========================================================================
+ * $Log$
+ *
+ * 03 23 2020 actory.ou
+ * [MOLY00502858] [Gen97][Gen98] merge ccci channel id/runtime data id
+ * [19NOV][OA][NCCCIDEV] sync TTY/NCCMNI port table
+ *
+ * 02 24 2020 actory.ou
+ * [MOLY00474576] [Gen97] NCCMNI development
+ * [19NOV.DEV][OA] add sending API for proxy to send packet to sAP
+ *
+ *
+ ****************************************************************************/
+#ifndef _NCCMNI_IF_H
+#define _NCCMNI_IF_H
+
+#include "tcpip_struct.h"
+#include "iwlan_public_defs.h"
+
+typedef enum{
+    NCCMNI_NET_IF_MIN = 0,
+    NCCMNI_NET_IF_0 = NCCMNI_NET_IF_MIN,
+    NCCMNI_NET_IF_1,
+    NCCMNI_NET_IF_2,
+    NCCMNI_NET_IF_3,
+    NCCMNI_NET_IF_4,
+    NCCMNI_NET_IF_5,
+    NCCMNI_NET_IF_6,
+    NCCMNI_NET_IF_7,
+    NCCMNI_NET_IF_8,
+    NCCMNI_NET_IF_9,
+    NCCMNI_NET_IF_10,
+    NCCMNI_NET_IF_11,
+    NCCMNI_NET_IF_12,
+    NCCMNI_NET_IF_13,
+    NCCMNI_NET_IF_14,
+    NCCMNI_NET_IF_15,
+    NCCMNI_NET_IF_16,
+    NCCMNI_NET_IF_17,
+    NCCMNI_NET_IF_18,
+    NCCMNI_NET_IF_19,
+    NCCMNI_NET_IF_20,
+    NCCMNI_NET_IF_MAX,
+    NCCMNI_NET_IF_MAXBIT = 0xFF,
+} NCCMNI_NET_IF_E;
+
+typedef enum{
+    NCCMNI_PACKET_TYPE_BUFFER = 0, //support buffer mode only
+    NCCMNI_PACKET_TYPE_MAX,
+} NCCMNI_PACKET_TYPE_E;
+
+typedef struct{
+    NCCMNI_PACKET_TYPE_E pkt_type;
+    
+    //if pkt type==NCCMNI_PACKET_TYPE_BUFFER
+    kal_uint8 *p_data;
+    kal_uint32 data_len;
+} NCCMNI_SEND_PACKET_T;
+
+kal_bool nccmni_send_dl_pkt(NCCMNI_SEND_PACKET_T *p_pkt, NCCMNI_NET_IF_E netif_id);
+
+//L5 -> NCCMNI
+
+#pragma pack(push)
+#pragma pack(4)
+// MSG_ID_L5_NCCMNI_REGFILTER_REQ
+typedef struct{
+    NCCMNI_NET_IF_E nccmni_net_if; //kal_uint8
+    kal_uint16 nccmni_seq;
+    kal_uint8 reserve1;
+    kal_uint32 valid_field; //mandatory, a bitmap, refer to IPC_FILTER_BY_XXX
+    kal_uint8 ip_type; //IPC_IP_TYPE_IPV4 or IPC_IP_TYPE_IPV6
+    kal_uint8 ctrl_protocol; //IPC_HDR_PROT_XXX
+    kal_uint16 src_port;
+    kal_uint16 dst_port;
+    kal_uint16 tcp_flags; //IPC_HDR_TCP_FLAG_XXX
+    kal_uint32 spi; //
+    union{
+        kal_uint8 addr8[4];
+        kal_uint32 addr32;
+    } src_ipv4; // Source IPv4 address to filter.
+    union{
+        kal_uint8 addr8[4];
+        kal_uint32 addr32;
+    } dst_ipv4; // Destination IPv4 address to filter.
+
+    union{
+        kal_uint8 addr8[16];
+        kal_uint32 addr32[4];
+    } src_ipv6; // Source IPv6 address to filter.
+    union{
+        kal_uint8 addr8[16];
+        kal_uint32 addr32[4];
+    } dst_ipv6; // Destination IPv6 address to filter. 
+    
+    kal_uint8 icmpv4_type;    // Type field of ICMPv4 header to filter.
+    kal_uint8 icmpv6_type;    // Type field of ICMPv6 header to filter.
+    kal_uint16 reserve2;
+} l5_nccmni_regfilter_req_struct;
+#pragma pack(pop)
+
+
+#pragma pack(push)
+#pragma pack(4)
+// MSG_ID_L5_NCCMNI_REGFILTER_CNF
+typedef struct{
+    NCCMNI_NET_IF_E nccmni_net_if; //kal_uint8
+    kal_uint16 nccmni_seq;
+    kal_uint8 reserve;
+    kal_int32 filter_id; //>=0: filter id, <0: set failed
+} l5_nccmni_regfilter_cnf_struct;
+#pragma pack(pop)
+
+
+#pragma pack(push)
+#pragma pack(4)
+// MSG_ID_L5_NCCMNI_DEREGFILTER_REQ
+typedef struct{
+    NCCMNI_NET_IF_E nccmni_net_if; //kal_uint8
+    kal_uint16 nccmni_seq;
+    kal_uint8 reserve;
+    kal_int32 is_deregister_all_filter; //0: deregister the filter id only, 1: deregister all filter
+    kal_int32 filter_id; //filter id to deregister
+} l5_nccmni_deregfilter_req_struct;
+#pragma pack(pop)
+
+
+#pragma pack(push)
+#pragma pack(4)
+// MSG_ID_L5_NCCMNI_DEREGFILTER_CNF
+typedef struct{
+    NCCMNI_NET_IF_E nccmni_net_if; //kal_uint8
+    kal_uint16 nccmni_seq;
+    kal_uint8 reserve;
+    kal_int32 is_success; //1: success
+} l5_nccmni_deregfilter_cnf_struct;
+#pragma pack(pop)
+
+
+// D2 --> NCCMNI
+
+#define D2_NCCMNI_REQ_LOCAL_PARA_HDR \
+    LOCAL_PARA_HDR \
+    kal_uint32      interface_id; /* transaction id + channel id */ \
+    iwlan_ran_e     ran_type;     /* iwlan_ran_e */
+
+// MSG_ID_D2_NCCMNI_ESTABLISHPDN_REQ
+typedef struct
+{
+    D2_NCCMNI_REQ_LOCAL_PARA_HDR
+
+    kal_uint32              netif_id;     /* network_interface_id in net_info */
+    new_ip_info_struct      ip_info;
+    kal_bool                net_info_present;
+    tcpip_net_info_struct_t net_info;
+} d2_nccmni_establishpdn_req_struct;
+
+// MSG_ID_D2_NCCMNI_DISCONNECTPDN_REQ
+typedef struct
+{
+    D2_NCCMNI_REQ_LOCAL_PARA_HDR
+} d2_nccmni_disconnectpdn_req_struct;
+
+// MSG_ID_D2_NCCMNI_IFCHANGE_REQ
+typedef struct
+{
+    D2_NCCMNI_REQ_LOCAL_PARA_HDR
+
+    kal_uint32              event;
+    new_ip_info_struct      ip_info;
+    kal_bool                net_info_present;
+    tcpip_net_info_struct_t net_info;
+} d2_nccmni_ifchange_req_struct;
+
+
+// NCCMNI --> D2
+typedef enum
+{
+    NCCMNI_RES_SUCC = 0,
+    NCCMNI_RES_NONE = 1,
+    NCCMNI_RES_FAIL = 2,
+    NCCMNI_RES_MAX  = 0x7FFFFFFF,
+} nccmni_res_enum;
+
+
+#define D2_NCCMNI_CNF_LOCAL_PARA_HDR \
+    LOCAL_PARA_HDR \
+    kal_uint32      interface_id; \
+    nccmni_res_enum res;
+
+typedef struct
+{
+    D2_NCCMNI_CNF_LOCAL_PARA_HDR
+} d2_nccmni_cnf_struct;
+
+
+// MSG_ID_D2_NCCMNI_ESTABLISHPDN_CNF
+typedef struct
+{
+    D2_NCCMNI_CNF_LOCAL_PARA_HDR
+
+    // kal_uint32              stkif_id;
+    // ipstk_ip_info_struct    ipstk_ip_info;
+} d2_nccmni_establishpdn_cnf_struct;
+
+// MSG_ID_D2_NCCMNI_DISCONNECTPDN_CNF
+typedef struct
+{
+    D2_NCCMNI_CNF_LOCAL_PARA_HDR
+
+    // kal_uint32              stkif_id;
+} d2_nccmni_disconnectpdn_cnf_struct;
+
+// MSG_ID_D2_NCCMNI_IFCHANGE_CNF
+typedef struct
+{
+    D2_NCCMNI_CNF_LOCAL_PARA_HDR
+
+    // kal_uint32              stkif_id;
+    // ipstk_ip_info_struct    ipstk_ip_info;
+} d2_nccmni_ifchange_cnf_struct;
+
+#endif //#ifndef _NCCMNI_IF_H
diff --git a/mcu/interface/middleware/hif/ndpc_struct.h b/mcu/interface/middleware/hif/ndpc_struct.h
new file mode 100644
index 0000000..a40228c
--- /dev/null
+++ b/mcu/interface/middleware/hif/ndpc_struct.h
@@ -0,0 +1,258 @@
+/*!
+ *  @file ndpc_struct.h
+ *  @author Roger Huang <chaomin.haung@mediatek.com>
+ *  @version 1.0
+ *  @section LICENSE
+ *
+ *  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).
+ *
+ *  @section DESCRIPTION
+ *  This file provides structure definition of ndpc ( NDP Client )
+ */
+
+#ifndef _NDPC_STRUCT_H
+#define _NDPC_STRUCT_H
+
+/*!
+ *  @brief ndpc_cause_e enumerate possible cause of NDP Client
+ *  @param NDPC_CAUSE_MIN                   pseudo state
+ *  @param NDPC_CAUSE_SUCCESS               success
+ *  @param NDPC_CAUSE_NO_INSTANCE           no instance available
+ *  @param NDPC_CAUSE_INVALID_PARAMETER     parameter is invalid
+ *  @param NDPC_CAUSE_MAX                   pseudo state
+ */
+typedef enum _ndpc_cause {
+    NDPC_CAUSE_MIN                                  = 0,
+    NDPC_CAUSE_SUCCESS                              = 1,
+    NDPC_CAUSE_NO_INSTANCE                          = 2,
+    NDPC_CAUSE_INVALID_PARAMETER                    = 3,
+    NDPC_CAUSE_INVALID_STATE                        = 4,
+    NDPC_CAUSE_MAX                                  = 5,
+} ndpc_cause_e;
+
+
+/*!
+ *  @brief ndpc_link_layer_type_e enumerate possible link layer type of
+ *         NDP Client
+ *  @param NDPC_LINK_MIN                    pseudo state
+ *  @param NDPC_LINK_ETHERNET               ethernet type
+ *  @param NDPC_LINK_MAX                    pseudo state
+ */
+typedef enum _ndpc_link_layer_type {
+    NDPC_LINK_MIN                                   = 0,
+    NDPC_LINK_ETHERNET                              = 1,
+    NDPC_LINK_MAX                                   = 2,
+} ndpc_link_layer_type_e;
+
+
+#define NDPC_MAX_LINK_ADDRESS_SIZE                  8
+/*!
+ *  @brief ndpc_activagte_req_struct describe activate request information
+ *         of NDP Client
+ */
+typedef struct _ndpc_activate_req_struct {
+    /*!
+     *  @brief ILM local parameter header
+     */
+    LOCAL_PARA_HDR
+    /*!
+     *  @brief ip instance identifier
+     */
+    kal_uint8       ip_id;
+    /*!
+     *  @brief link layer type
+     */
+    ndpc_link_layer_type_e      link_layer_type;
+    /*!
+     *  @brief link layer address
+     */
+    kal_uint8                   link_layer_address[NDPC_MAX_LINK_ADDRESS_SIZE];
+} ndpc_activate_req_struct;
+
+
+/*!
+ *  @brief ndpc_activate_rsp_struct describe activate response information
+ *         of NDP Client
+ */
+typedef struct _ndpc_activate_rsp_struct {
+    /*!
+     *  @brief ILM local parameter header
+     */
+    LOCAL_PARA_HDR
+    /*!
+     *  @brief ip instance identifier
+     */
+    kal_uint8       ip_id;
+    /*!
+     *  @brief NDP Client instance identifier
+     */
+    kal_uint8       ndp_id;
+    /*!
+     *  @brief response cause
+     */
+    ndpc_cause_e    cause;
+} ndpc_activate_rsp_struct;
+
+
+/*!
+ *  @brief ndpc_deactivate_req_struct describe deactivate request information
+ *         of NDP Client
+ */
+typedef struct _ndpc_deactivate_req_struct {
+    /*!
+     *  @brief ILM local parameter header
+     */
+    LOCAL_PARA_HDR
+    /*!
+     *  @brief ip instance identifier
+     */
+    kal_uint8       ip_id;
+    /*!
+     *  @brief NDP Client instance identifier
+     */
+    kal_uint8       ndp_id;
+} ndpc_deactivate_req_struct;
+
+
+/*!
+ *  @brief ndpc_deactivate_rsp_struct describe deactivate response information
+ *         of NDP Client
+ */
+typedef struct _ndpc_deactivate_rsp_struct {
+    /*!
+     *  @brief ILM local parameter header
+     */
+    LOCAL_PARA_HDR
+    /*!
+     *  @brief ip instance identifier
+     */
+    kal_uint8       ip_id;
+    /*!
+     *  @brief NDP Client instance identifier
+     */
+    kal_uint8       ndp_id;
+    /*!
+     *  @brief response cause
+     */
+    ndpc_cause_e    cause;
+} ndpc_deactivate_rsp_struct;
+
+
+/*!
+ *  @brief ndpc_packet_req_struct describe packet request information
+ *         of NDP Client
+ */
+typedef struct _ndpc_packet_req_struct {
+    /*!
+     *  @brief ILM local parameter header
+     */
+    LOCAL_PARA_HDR
+    /*!
+     *  @brief ip instance identifier
+     */
+    kal_uint8       ip_id;
+    /*!
+     *  @brief NDP Client instance identifier
+     */
+    kal_uint8       ndp_id;
+    /*!
+     *  @brief request gpd packet buffer
+     */
+    void*           gpd;
+} ndpc_packet_req_struct;
+
+
+/*!
+ *  @brief ndpc_packet_ind_struct describe packet indicate information
+ *         of NDP Client
+ */
+typedef struct _ndpc_packet_ind_struct {
+    /*!
+     *  @brief ILM local parameter header
+     */
+    LOCAL_PARA_HDR
+    /*!
+     *  @brief ip instance identifier
+     */
+    kal_uint8       ip_id;
+    /*!
+     *  @brief NDP Client instance identifier
+     */
+    kal_uint8       ndp_id;
+    /*!
+     *  @brief indicate gpd packet buffer
+     */
+    void*           gpd;
+} ndpc_packet_ind_struct;
+
+
+/*!
+ *  @brief ndpc_ip_up_ind_struct describe ip up indicate information
+ *         of NDP Client
+ */
+typedef struct _ndpc_ip_up_ind_struct {
+    /*!
+     *  @brief ILM local parameter header
+     */
+    LOCAL_PARA_HDR
+    /*!
+     *  @brief ip instance identifier
+     */
+    kal_uint8       ip_id;
+    /*!
+     *  @brief NDP Client instance identifier
+     */
+    kal_uint8       ndp_id;
+} ndpc_ip_up_ind_struct;
+
+
+/*!
+ *  @brief ndpc_ip_down_ind_struct describe ip down indicate information
+ *         of NDP Client
+ */
+typedef struct _ndpc_ip_down_ind_struct {
+    /*!
+     *  @brief ILM local parameter header
+     */
+    LOCAL_PARA_HDR
+    /*!
+     *  @brief ip instance identifier
+     */
+    kal_uint8       ip_id;
+    /*!
+     *  @brief NDP Client instance identifier
+     */
+    kal_uint8       ndp_id;
+} ndpc_ip_down_ind_struct;
+
+
+#endif  // _NDPC_STRUCT_H
+
diff --git a/mcu/interface/middleware/hif/nmu.h b/mcu/interface/middleware/hif/nmu.h
new file mode 100644
index 0000000..772a4e8
--- /dev/null
+++ b/mcu/interface/middleware/hif/nmu.h
@@ -0,0 +1,177 @@
+/*!
+ *  @file nmu.h
+ *  @author Roger Huang <chaomin.haung@mediatek.com>
+ *  @version 1.0
+ *  @section LICENSE
+ *
+ *  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).
+ *
+ *  @section DESCRIPTION
+ *  This file provides interface of nmu ( network management unit )
+ */
+
+#ifndef _NMU_H
+#define _NMU_H
+
+#define DECLARE_NMU_ETH_ENUM(_prefix) \
+    NMU_ ## _prefix ## _UP, \
+    NMU_ ## _prefix ## _HOST_MAC, \
+    NMU_ ## _prefix ## _GATEWAY_MAC, \
+    NMU_ ## _prefix ## _TX_PKT_CNT, \
+    NMU_ ## _prefix ## _RX_PKT_CNT, \
+    NMU_ ## _prefix ## _TX_BYTE_CNT, \
+    NMU_ ## _prefix ## _RX_BYTE_CNT, \
+    NMU_ ## _prefix ## _TX_ERROR_PKT_CNT, \
+    NMU_ ## _prefix ## _RX_ERROR_PKT_CNT, \
+    NMU_ ## _prefix ## _TX_DROP_PKT_CNT, \
+    NMU_ ## _prefix ## _RX_DROP_PKT_CNT, \
+    NMU_ ## _prefix ## _RX_FRAME_ALIGN_ERROR_CNT,
+
+#define DECLARE_NMU_IP_ENUM(_prefix) \
+    NMU_ ## _prefix ## _UP, \
+    NMU_ ## _prefix ## _ADDR, \
+    NMU_ ## _prefix ## _MASK, \
+    NMU_ ## _prefix ## _GATEWAY, \
+    NMU_ ## _prefix ## _MTU_SIZE, \
+    NMU_ ## _prefix ## _DNS_NUM, \
+    NMU_ ## _prefix ## _DNS1, \
+    NMU_ ## _prefix ## _DNS2, \
+    NMU_ ## _prefix ## _IP6_UP, \
+    NMU_ ## _prefix ## _IP6_PREFIX, \
+    NMU_ ## _prefix ## _IP6_PREFIX_LEN, \
+    NMU_ ## _prefix ## _IP6_IID, \
+    NMU_ ## _prefix ## _IP6_IID_LEN, \
+    NMU_ ## _prefix ## _IP6_MTU_SIZE, \
+    NMU_ ## _prefix ## _IP6_DNS_NUM, \
+    NMU_ ## _prefix ## _IP6_DNS1, \
+    NMU_ ## _prefix ## _IP6_DNS2,
+
+/*!
+ *  @brief nmu_entry_e enumberate all information entry support in nmu
+ */
+typedef enum _nmu_entry_e {
+    NMU_MTU_SIZE,           /* Maximal transmission unit in bytes. "Downlink = host Rx = device Tx"
+                               Default value is 9000. Original value is 1500. */
+    NMU_MRU_SIZE,           /* Maximal receive unit in bytes. "Uplink = host Tx = device Rx"
+                               Default value is 1500. */
+    NMU_UL_SPEED,           /* Uplink speed in unit of bps. */
+    NMU_DL_SPEED,           /* Downlink speed in unit of bps. */
+
+    DECLARE_NMU_ETH_ENUM(ETH0)
+    DECLARE_NMU_ETH_ENUM(ETH1)
+    DECLARE_NMU_ETH_ENUM(ETH2)
+    DECLARE_NMU_ETH_ENUM(ETH3)
+    DECLARE_NMU_ETH_ENUM(ETH4)
+    DECLARE_NMU_ETH_ENUM(ETH5)
+    DECLARE_NMU_ETH_ENUM(ETH6)
+    DECLARE_NMU_ETH_ENUM(ETH7)
+    DECLARE_NMU_ETH_ENUM(ETH8)
+    DECLARE_NMU_ETH_ENUM(ETH9)
+    DECLARE_NMU_ETH_ENUM(ETH10)
+    DECLARE_NMU_ETH_ENUM(ETH11)
+    DECLARE_NMU_ETH_ENUM(ETH12)
+    DECLARE_NMU_ETH_ENUM(ETH13)
+    DECLARE_NMU_ETH_ENUM(ETH14)
+    DECLARE_NMU_ETH_ENUM(ETH15)
+
+    DECLARE_NMU_IP_ENUM(IP0)
+    DECLARE_NMU_IP_ENUM(IP1)
+    DECLARE_NMU_IP_ENUM(IP2)
+    DECLARE_NMU_IP_ENUM(IP3)
+    DECLARE_NMU_IP_ENUM(IP4)
+    DECLARE_NMU_IP_ENUM(IP5)
+    DECLARE_NMU_IP_ENUM(IP6)
+    DECLARE_NMU_IP_ENUM(IP7)
+    DECLARE_NMU_IP_ENUM(IP8)
+    DECLARE_NMU_IP_ENUM(IP9)
+    DECLARE_NMU_IP_ENUM(IP10)
+    DECLARE_NMU_IP_ENUM(IP11)
+    DECLARE_NMU_IP_ENUM(IP12)
+    DECLARE_NMU_IP_ENUM(IP13)
+    DECLARE_NMU_IP_ENUM(IP14)
+    DECLARE_NMU_IP_ENUM(IP15)
+
+    /* always be the last line */
+    NMU_MAX_ENTRY,
+} nmu_entry_e;
+
+typedef kal_uint8                   nmu_eth_addr_t[6];
+typedef kal_uint32                  nmu_in_addr_t;
+typedef kal_uint32                  nmu_in6_addr_t[4];
+typedef kal_uint8                   nmu_status_t;
+typedef kal_uint64                  nmu_stat_t;
+
+/*!
+ *  @brief nmu_nvram_table_t is a collection of network information stored
+ *                           in nvram
+ */
+typedef struct _nmu_nvram_table {
+    kal_uint32              compiler_resv;
+    nmu_eth_addr_t          eth0_host_mac;
+
+} nmu_nvram_table_t;
+
+/*!
+ *  @brief  nmu init function
+ */
+void nmu_init(void);
+
+
+/*!
+ *  @brief  write entry value to nmu
+ *  @param  entry entry enum value
+ *  @param  len   the length to write
+ *  @param  data  pointer to the start address of entry data
+ *  @return KAL_TRUE if success, KAL_FALSE if entry not exist, or Read Only
+ *          attribute is set
+ */
+kal_bool nmu_set_property(nmu_entry_e entry, kal_uint32 len, void* data);
+
+
+/*!
+ *  @brief  read entry value from nmu
+ *  @param  entry entry enum value
+ *  @param  len   the length to read
+ *  @param  data  pointer to the start address of entry data
+ *  @return KAL_TRUE if success, KAL_FALSE if entry not exist, or
+ *          data buffer is not big enough
+ */
+kal_bool nmu_get_property(nmu_entry_e entry, kal_uint32 len, void* data);
+
+
+/*!
+ *  @brief  clean all entry value
+ */
+void nmu_clean_db(void);
+
+
+#endif  // _NMU_H
+
diff --git a/mcu/interface/middleware/hif/nmu_util.h b/mcu/interface/middleware/hif/nmu_util.h
new file mode 100644
index 0000000..2f80937
--- /dev/null
+++ b/mcu/interface/middleware/hif/nmu_util.h
@@ -0,0 +1,582 @@
+/*!
+ *  @file nmu_util.h
+ *  @author Roger Huang <chaomin.haung@mediatek.com>
+ *  @version 1.0
+ *  @section LICENSE
+ *
+ *  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).
+ *
+ *  @section DESCRIPTION
+ *  This file provides utility interface of nmu ( network management unit )
+ */
+
+#ifndef _NMU_UTIL_H
+#define _NMU_UTIL_H
+
+#include "nmu.h"
+
+
+/*!
+ *  @brief  set ethernet interface up
+ *  @param  eth_id ethernet interface id
+ */
+void nmu_set_eth_up(kal_uint8 eth_id);
+
+
+/*
+ *  @brief  set ethernet interface down
+ *  @param  eth_id ethernet interface id
+ */
+void nmu_set_eth_down(kal_uint8 eth_id);
+
+
+/*
+ *  @brief  check if ethernet interface is up or not
+ *  @param  eth_id ethernet interface id
+ *  @return KAL_TRUE if ethernet interface is up, KAL_FALSE if it's down
+ *          attribute is set
+ */
+kal_bool nmu_check_eth_up(kal_uint8 eth_id);
+
+
+/*
+ *  @brief  set host mac address of ethernet interface
+ *  @param  eth_id ethernet interface id
+ *  @param  mac_address mac address to be written
+ */
+void nmu_set_host_mac(kal_uint8 eth_id, void* mac_address);
+
+
+/*
+ *  @brief  get host mac address of ethernet interface
+ *  @param  eth_id ethernet interface id
+ *  @param  mac_address mac address to be read
+ */
+void nmu_get_host_mac(kal_uint8 eth_id, void* mac_address);
+
+
+/*
+ *  @brief  set gateway mac address of ethernet interface
+ *  @param  eth_id ethernet interface id
+ *  @param  mac_address mac address to be written
+ */
+void nmu_set_gateway_mac(kal_uint8 eth_id, void* mac_address);
+
+
+/*
+ *  @brief  get gateway mac address of ethernet interface
+ *  @param  eth_id ethernet interface id
+ *  @param  mac_address mac address to be read
+ */
+void nmu_get_gateway_mac(kal_uint8 eth_id, void* mac_address);
+
+
+/*
+ *  @brief  set transmit packet counts of ethernet interface
+ *  @param  eth_id ethernet interface id
+ *  @param  value value to be written
+ */
+void nmu_set_eth_tx_pkt_cnt(kal_uint8 eth_id, nmu_stat_t value);
+
+
+/*
+ *  @brief  add transmit packet counts of ethernet interface
+ *  @param  eth_id ethernet interface id
+ *  @param  value value to be added
+ */
+void nmu_add_eth_tx_pkt_cnt(kal_uint8 eth_id, nmu_stat_t value);
+
+
+/*
+ *  @brief  get transmit packet counts of ethernet interface
+ *  @param  eth_id ethernet interface id
+ *  @param  value value to be read
+ */
+void nmu_get_eth_tx_pkt_cnt(kal_uint8 eth_id, nmu_stat_t* value);
+
+
+/*
+ *  @brief  set receive packet counts of ethernet interface
+ *  @param  eth_id ethernet interface id
+ *  @param  value value to be written
+ */
+void nmu_set_eth_rx_pkt_cnt(kal_uint8 eth_id, nmu_stat_t value);
+
+
+/*
+ *  @brief  add receive packet counts of ethernet interface
+ *  @param  eth_id ethernet interface id
+ *  @param  value value to be added
+ */
+void nmu_add_eth_rx_pkt_cnt(kal_uint8 eth_id, nmu_stat_t value);
+
+
+/*
+ *  @brief  get receive packet counts of ethernet interface
+ *  @param  eth_id ethernet interface id
+ *  @param  value value to be read
+ */
+void nmu_get_eth_rx_pkt_cnt(kal_uint8 eth_id, nmu_stat_t* value);
+
+
+/*
+ *  @brief  set transmit packet bytes of ethernet interface
+ *  @param  eth_id ethernet interface id
+ *  @param  value value to be written
+ */
+void nmu_set_eth_tx_byte_cnt(kal_uint8 eth_id, nmu_stat_t value);
+
+
+/*
+ *  @brief  add transmit packet bytes of ethernet interface
+ *  @param  eth_id ethernet interface id
+ *  @param  value value to be added
+ */
+void nmu_add_eth_tx_byte_cnt(kal_uint8 eth_id, nmu_stat_t value);
+
+
+/*
+ *  @brief  get transmit packet bytes of ethernet interface
+ *  @param  eth_id ethernet interface id
+ *  @param  value value to be read
+ */
+void nmu_get_eth_tx_byte_cnt(kal_uint8 eth_id, nmu_stat_t* value);
+
+
+/*
+ *  @brief  set receive packet bytes of ethernet interface
+ *  @param  eth_id ethernet interface id
+ *  @param  value value to be written
+ */
+void nmu_set_eth_rx_byte_cnt(kal_uint8 eth_id, nmu_stat_t value);
+
+
+/*
+ *  @brief  add receive packet bytes of ethernet interface
+ *  @param  eth_id ethernet interface id
+ *  @param  value value to be added
+ */
+void nmu_add_eth_rx_byte_cnt(kal_uint8 eth_id, nmu_stat_t value);
+
+
+/*
+ *  @brief  get receive packet bytes of ethernet interface
+ *  @param  eth_id ethernet interface id
+ *  @param  value value to be read
+ */
+void nmu_get_eth_rx_byte_cnt(kal_uint8 eth_id, nmu_stat_t* value);
+
+
+/*
+ *  @brief  set receive packet bytes of ethernet interface
+ *  @param  eth_id ethernet interface id
+ *  @param  value value to be written
+ */
+void nmu_set_eth_tx_error_pkt_cnt(kal_uint8 eth_id, nmu_stat_t value);
+
+
+/*
+ *  @brief  add receive packet bytes of ethernet interface
+ *  @param  eth_id ethernet interface id
+ *  @param  value value to be added
+ */
+void nmu_add_eth_tx_error_pkt_cnt(kal_uint8 eth_id, nmu_stat_t value);
+
+
+/*
+ *  @brief  get receive packet bytes of ethernet interface
+ *  @param  eth_id ethernet interface id
+ *  @param  value value to be read
+ */
+void nmu_get_eth_tx_error_pkt_cnt(kal_uint8 eth_id, nmu_stat_t* value);
+
+
+/*
+ *  @brief  set receive packet bytes of ethernet interface
+ *  @param  eth_id ethernet interface id
+ *  @param  value value to be written
+ */
+void nmu_set_eth_rx_error_pkt_cnt(kal_uint8 eth_id, nmu_stat_t value);
+
+
+/*
+ *  @brief  add receive packet bytes of ethernet interface
+ *  @param  eth_id ethernet interface id
+ *  @param  value value to be added
+ */
+void nmu_add_eth_rx_error_pkt_cnt(kal_uint8 eth_id, nmu_stat_t value);
+
+
+/*
+ *  @brief  get receive packet bytes of ethernet interface
+ *  @param  eth_id ethernet interface id
+ *  @param  value value to be read
+ */
+void nmu_get_eth_rx_error_pkt_cnt(kal_uint8 eth_id, nmu_stat_t* value);
+
+/*
+ *  @brief  set transmit dropped packet counts of ethernet interface
+ *  @param  eth_id ethernet interface id
+ *  @param  value value to be written
+ */
+void nmu_set_eth_tx_drop_pkt_cnt(kal_uint8 eth_id, nmu_stat_t value);
+
+
+/*
+ *  @brief  add transmit dropped packet counts of ethernet interface
+ *  @param  eth_id ethernet interface id
+ *  @param  value value to be added
+ */
+void nmu_add_eth_tx_drop_pkt_cnt(kal_uint8 eth_id, nmu_stat_t value);
+
+
+/*
+ *  @brief  get transmit dropped packet counts of ethernet interface
+ *  @param  eth_id ethernet interface id
+ *  @param  value value to be read
+ */
+void nmu_get_eth_tx_drop_pkt_cnt(kal_uint8 eth_id, nmu_stat_t* value);
+
+
+/*
+ *  @brief  set receive dropped packet counts of ethernet interface
+ *  @param  eth_id ethernet interface id
+ *  @param  value value to be written
+ */
+void nmu_set_eth_rx_drop_pkt_cnt(kal_uint8 eth_id, nmu_stat_t value);
+
+
+/*
+ *  @brief  add receive dropped packet counts of ethernet interface
+ *  @param  eth_id ethernet interface id
+ *  @param  value value to be added
+ */
+void nmu_add_eth_rx_drop_pkt_cnt(kal_uint8 eth_id, nmu_stat_t value);
+
+
+/*
+ *  @brief  get receive dropped packet counts of ethernet interface
+ *  @param  eth_id ethernet interface id
+ *  @param  value value to be read
+ */
+void nmu_get_eth_rx_drop_pkt_cnt(kal_uint8 eth_id, nmu_stat_t* value);
+
+
+/*
+ *  @brief  set receive dropped packet counts of ethernet interface
+ *  @param  eth_id ethernet interface id
+ *  @param  value value to be written
+ */
+void nmu_set_eth_rx_frame_align_error_cnt(kal_uint8 eth_id, nmu_stat_t value);
+
+
+/*
+ *  @brief  add receive dropped packet counts of ethernet interface
+ *  @param  eth_id ethernet interface id
+ *  @param  value value to be added
+ */
+void nmu_add_eth_rx_frame_align_error_cnt(kal_uint8 eth_id, nmu_stat_t value);
+
+
+/*
+ *  @brief  get receive packet bytes of ethernet interface
+ *  @param  eth_id ethernet interface id
+ *  @param  value value to be read
+ */
+void nmu_get_eth_rx_frame_align_error_cnt(kal_uint8 eth_id, nmu_stat_t* value);
+
+
+/*
+ *  @brief  set ipv4 instance IPv4 up
+ *  @param  ip_id ip instance id
+ */
+void nmu_set_ip4_up(kal_uint8 ip_id);
+
+
+/*
+ *  @brief  set ip instance IPv4 down
+ *  @param  ip_id ip instance id
+ */
+void nmu_set_ip4_down(kal_uint8 ip_id);
+
+
+/*
+ *  @brief  check ip instance IPv4 is up or not
+ *  @param  ip_id ip instance id
+ *  @return KAL_TRUE if IPv4 is up, KAL_FALSE if not
+ */
+kal_bool nmu_check_ip4_up(kal_uint8 ip_id);
+
+
+/*
+ *  @brief  set IPv4 address of ip instance
+ *  @param  ip_id ip instance id
+ *  @param  ip_address IPv4 address to be written
+ */
+void nmu_set_ip4_ip(kal_uint8 ip_id, void* ip_address);
+
+
+/*
+ *  @brief  get IPv4 address of ip instance
+ *  @param  ip_id ip instance id
+ *  @param  ip_address IPv4 address to be read
+ */
+void nmu_get_ip4_ip(kal_uint8 ip_id, void* ip_address);
+
+
+/*
+ *  @brief  set IPv4 netmask of ip instance
+ *  @param  ip_id ip instance id
+ *  @param  mask IPv4 netmask to be written
+ */
+void nmu_set_ip4_mask(kal_uint8 ip_id, void* mask);
+
+
+/*
+ *  @brief  set IPv4 netmask of ip instance
+ *  @param  ip_id ip instance id
+ *  @param  mask IPv4 netmask to be written
+ */
+void nmu_get_ip4_mask(kal_uint8 ip_id, void* mask);
+
+
+/*
+ *  @brief  set IPv4 gateway address of ip instance
+ *  @param  ip_id ip instance id
+ *  @param  gateway IPv4 address to be written
+ */
+void nmu_set_ip4_gateway(kal_uint8 ip_id, void* gateway);
+
+
+/*
+ *  @brief  get IPv4 gateway address of ip instance
+ *  @param  ip_id ip instance id
+ *  @param  gateway IPv4 address to be read
+ */
+void nmu_get_ip4_gateway(kal_uint8 ip_id, void* gateway);
+
+
+/*
+ *  @brief  set IPv4 mtu size of ip instance
+ *  @param  ip_id ip instance id
+ *  @param  mtu_size mtu size to be written
+ */
+void nmu_set_ip4_mtu_size(kal_uint8 ip_id, kal_uint16 mtu_size);
+
+
+/*
+ *  @brief  get IPv4 mtu size of ip instance
+ *  @param  ip_id ip instance id
+ *  @param  mtu_size mtu size to be read
+ */
+void nmu_get_ip4_mtu_size(kal_uint8 ip_id, kal_uint16* mtu_size);
+
+
+/*
+ *  @brief  set total number of IPv4 DNS servers of ip instance
+ *  @param  ip_id ip instance id
+ *  @param  dns_num total number to be written
+ */
+void nmu_set_ip4_dns_num(kal_uint8 ip_id, kal_uint8 dns_num);
+
+
+/*
+ *  @brief  get total number of IPv4 DNS servers of ip instance
+ *  @param  ip_id ip instance id
+ *  @param  dns_num total number to be read
+ */
+void nmu_get_ip4_dns_num(kal_uint8 ip_id, kal_uint8* dns_num);
+
+
+/*
+ *  @brief  set DNS server IPv4 address of ip instance
+ *  @param  ip_id ip instance id
+ *  @param  dns_id dns server no
+ *  @param  dns IPv4 address to be written
+ */
+void nmu_set_ip4_dns(kal_uint8 ip_id, kal_uint8 dns_id, void* dns);
+
+
+/*
+ *  @brief  get DNS server IPv4 address of ip instance
+ *  @param  ip_id ip instance id
+ *  @param  dns_id dns server no
+ *  @param  dns IPv4 address to be read
+ */
+void nmu_get_ip4_dns(kal_uint8 ip_id, kal_uint8 dns_id, void* dns);
+
+
+/*
+ *  @brief  set ip instance IPv6 up
+ *  @param  ip_id ip instance id
+ */
+void nmu_set_ip6_up(kal_uint8 ip_id);
+
+
+/*
+ *  @brief  set ip instance IPv6 down
+ *  @param  ip_id ip instance id
+ */
+void nmu_set_ip6_down(kal_uint8 ip_id);
+
+
+/*
+ *  @brief  check ip instance IPv6 is up or not
+ *  @param  ip_id ip instance id
+ *  @return KAL_TRUE if IPv6 is up, KAL_FALSE if not
+ */
+kal_bool nmu_check_ip6_up(kal_uint8 ip_id);
+
+
+/*
+ *  @brief  set IPv6 mtu size of ip instance
+ *  @param  ip_id ip instance id
+ *  @param  mtu_size mtu size to be written
+ */
+void nmu_set_ip6_mtu_size(kal_uint8 ip_id, kal_uint32 mtu_size);
+
+
+/*
+ *  @brief  get IPv6 mtu size of ip instance
+ *  @param  ip_id ip instance id
+ *  @param  mtu_size mtu size to be read
+ */
+void nmu_get_ip6_mtu_size(kal_uint8 ip_id, kal_uint32* mtu_size);
+
+
+/*
+ *  @brief  set IPv6 prefix length of ip instance
+ *  @param  ip_id ip instance id
+ *  @param  prefix_len prefix length to be written
+ */
+void nmu_set_ip6_prefix_len(kal_uint8 ip_id, kal_uint8 prefix_len);
+
+
+/*
+ *  @brief  get IPv6 prefix length of ip instance
+ *  @param  ip_id ip instance id
+ *  @param  prefix_len prefix length to be read
+ */
+void nmu_get_ip6_prefix_len(kal_uint8 ip_id, kal_uint8* prefix_len);
+
+
+/*
+ *  @brief  set IPv6 prefix of ip instance
+ *  @param  ip_id ip instance id
+ *  @param  prefix_len prefix to be written
+ */
+void nmu_set_ip6_prefix(kal_uint8 ip_id, void* prefix);
+
+
+/*
+ *  @brief  get IPv6 prefix of ip instance
+ *  @param  ip_id ip instance id
+ *  @param  prefix_len prefix to be read
+ */
+void nmu_get_ip6_prefix(kal_uint8 ip_id, void* prefix);
+
+
+/*
+ *  @brief  set IPv6 interface identifier length of ip instance
+ *  @param  ip_id ip instance id
+ *  @param  iid_len interface identifier length to be written
+ */
+void nmu_set_ip6_iid_len(kal_uint8 ip_id, kal_uint8 iid_len);
+
+
+/*
+ *  @brief  get IPv6 interface identifier length of ip instance
+ *  @param  ip_id ip instance id
+ *  @param  iid_len interface identifier length to be read
+ */
+void nmu_get_ip6_iid_len(kal_uint8 ip_id, kal_uint8* iid_len);
+
+
+/*
+ *  @brief  set IPv6 interface identifier of ip instance
+ *  @param  ip_id ip instance id
+ *  @param  iid_len interface identifier to be written
+ */
+void nmu_set_ip6_iid(kal_uint8 ip_id, void* iid);
+
+
+/*
+ *  @brief  get IPv6 interface identifier of ip instance
+ *  @param  ip_id ip instance id
+ *  @param  iid_len interface identifier to be read
+ */
+void nmu_get_ip6_iid(kal_uint8 ip_id, void* iid);
+
+
+/*
+ *  @brief  set total number of IPv6 DNS servers of ip instance
+ *  @param  ip_id ip instance id
+ *  @param  dns_num total number to be written
+ */
+void nmu_set_ip6_dns_num(kal_uint8 ip_id, kal_uint8 dns_num);
+
+
+/*
+ *  @brief  get total number of IPv6 DNS servers of ip instance
+ *  @param  ip_id ip instance id
+ *  @param  dns_num total number to be read
+ */
+void nmu_get_ip6_dns_num(kal_uint8 ip_id, kal_uint8* dns_num);
+
+
+/*
+ *  @brief  set DNS server IPv6 address of ip instance
+ *  @param  ip_id ip instance id
+ *  @param  dns_id dns server no
+ *  @param  dns IPv6 address to be written
+ */
+void nmu_set_ip6_dns(kal_uint8 ip_id, kal_uint8 dns_id, void* dns);
+
+
+/*
+ *  @brief  get DNS server IPv6 address of ip instance
+ *  @param  ip_id ip instance id
+ *  @param  dns_id dns server no
+ *  @param  dns IPv6 address to be read
+ */
+void nmu_get_ip6_dns(kal_uint8 ip_id, kal_uint8 dns_id, void* dns);
+
+
+/*
+ *  @brief  set fake netmask and gateway through real ip address
+ *  @param  ip_id ip instance id
+ *  @param  ip_address IPv4 address used to calculated fake netmask and gateway
+ */
+void nmu_set_ip4_fake_mask_and_gateway(kal_uint8 ip_id, void *ip_address);
+
+
+#endif  // _NMU_UTIL_H
+
diff --git a/mcu/interface/middleware/hif/pfm_api.h b/mcu/interface/middleware/hif/pfm_api.h
new file mode 100644
index 0000000..f0d2144
--- /dev/null
+++ b/mcu/interface/middleware/hif/pfm_api.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) 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:
+ * ---------
+ *   pfm_api.h
+ *
+ * Project:
+ * --------
+ *   MOLY
+ *
+ * Description:
+ * ------------
+ *   Packet Filter Manager public structure and interface definition.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *==============================================================================
+ *                 HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
+ *==============================================================================
+ *******************************************************************************/
+
+#ifndef __INC_PFM_API_H
+#define __INC_PFM_API_H
+
+#include "pfm_struct.h"
+
+/*------------------------------------------------------------------------------
+ * Public fucntions.
+ *----------------------------------------------------------------------------*/
+
+/*!
+ * Handle ILM message.
+ *
+ * @param   ilm [IN]  ILM data structure
+ */
+void pfm_on_ilm(ilm_struct *ilm);
+
+/*!
+ * Packet Filter Manager init function.
+ *
+ * @return  KAL_TRUE if succeeded, KAL_FALSE otherwise.
+ */
+kal_bool pfm_init(void);
+
+/*!
+ * Packet Filter Manager reset function.
+ *
+ * @return  KAL_TRUE if succeeded, KAL_FALSE otherwise.
+ */
+kal_bool pfm_reset(void);
+
+/*!
+ * @brief pfm_reg_cbk_wake_type_pkt
+ * Register callback for MBIM WAKE REASON wake type pkt
+ *
+ * @param [IN]pf_wake_type_pkt
+ *        [IN]priv_data
+ */
+void pfm_reg_cbk_wake_type_pkt(pfm_garbage_str_wake_type_pkt_f pf_wake_type_pkt, void* priv_data);
+
+/*!
+ * @brief pfm_dereg_cbk_wake_type_pkt
+ * De-register callback for MBIM WAKE REASON wake type pkt
+ *
+ */
+void pfm_dereg_cbk_wake_type_pkt();
+
+#endif /* __INC_PFM_API_H */
diff --git a/mcu/interface/middleware/hif/pfm_config.h b/mcu/interface/middleware/hif/pfm_config.h
new file mode 100644
index 0000000..f282fff
--- /dev/null
+++ b/mcu/interface/middleware/hif/pfm_config.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) 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:
+ * ---------
+ *   pfm_config.h
+ *
+ * Project:
+ * --------
+ *   MOLY
+ *
+ * Description:
+ * ------------
+ *   This file provides the filter set index for different features.
+ *
+ * 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!!
+ *==============================================================================
+ *******************************************************************************/
+
+/* PFM_FILTER_SET_PREFIX(prefix)            Filter Set ID */
+PFM_FILTER_SET_FEATURE_NAME(GARBAGE_FILTER)  /* 0 */
+PFM_FILTER_SET_PREFIX(garbage_filter)        /* 0 */
+PFM_FILTER_SET_FEATURE_NAME(FIN_ACK_FILTER)  /* 1 */
+PFM_FILTER_SET_PREFIX(fin_ack_filter)        /* 1 */
+PFM_FILTER_SET_FEATURE_NAME(UDP_IGMP_FILTER) /* 2 */
+PFM_FILTER_SET_PREFIX(udp_igmp_filter)       /* 2 */
+PFM_FILTER_SET_FEATURE_NAME(GARBAGE_STR_FILTER) /* 3 */
+PFM_FILTER_SET_PREFIX(garbage_str_filter)       /* 3 */
+PFM_FILTER_SET_FEATURE_NAME(ICMP_PING_FILTER) /* 4 */
+PFM_FILTER_SET_PREFIX(icmp_ping_filter)       /* 4 */
+PFM_FILTER_SET_FEATURE_NAME(UL_DISABLE_ALL_PACKETS_FILTER) /* 5 */
+PFM_FILTER_SET_PREFIX(ul_disable_all_packets_filter)       /* 5 */
+PFM_FILTER_SET_FEATURE_NAME(UL_ICMP_PING_WHITELIST_FILTER) /* 6 */
+PFM_FILTER_SET_PREFIX(ul_icmp_ping_whitelist_filter)       /* 6 */
diff --git a/mcu/interface/middleware/hif/pfm_enums.h b/mcu/interface/middleware/hif/pfm_enums.h
new file mode 100644
index 0000000..4d0652b
--- /dev/null
+++ b/mcu/interface/middleware/hif/pfm_enums.h
@@ -0,0 +1,77 @@
+/*****************************************************************************
+*  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:
+ * ---------
+ *   pfm_enums.h
+ *
+ * Project:
+ * --------
+ *   MOLY
+ *
+ * Description:
+ * ------------
+ *   Packet Filter Manager public enumeration definition.
+ *
+ * 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 __INC_PFM_ENUMS_H
+#define __INC_PFM_ENUMS_H
+
+typedef enum _pfm_filter_set_id_e {
+    #undef PFM_FILTER_SET_FEATURE_NAME
+    #undef PFM_FILTER_SET_PREFIX
+    #define PFM_FILTER_SET_FEATURE_NAME(_name) PFM_ ## _name ## _SET_ID,
+    #define PFM_FILTER_SET_PREFIX(_prefix) 
+    #include "pfm_config.h"
+
+    NUM_OF_PFM_FILTER_SET_ID,
+} pfm_filter_set_id_e;
+
+#endif /* __INC_PFM_ENUMS_H */
diff --git a/mcu/interface/middleware/hif/pfm_struct.h b/mcu/interface/middleware/hif/pfm_struct.h
new file mode 100644
index 0000000..546b1ec
--- /dev/null
+++ b/mcu/interface/middleware/hif/pfm_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) 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:
+ * ---------
+ *   pfm_struct.h
+ *
+ * Project:
+ * --------
+ *   MOLY
+ *
+ * Description:
+ * ------------
+ *   Packet Filter Manager ILM structure and interface definition.
+ *
+ * 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!!
+ *==============================================================================
+ *******************************************************************************/
+#ifndef __INC_PFM_STRUCT_H
+#define __INC_PFM_STRUCT_H
+
+#include "hif_ior.h"
+
+/*
+ * Callback function to process the IP datagram filtered.
+ *
+ * @param   packet [IN] Packet buffer.
+ * @param   packet_len [IN] Packet len.
+ * @param   pfm_filter_id [IN] PFM Filter id of matched packet.
+ * @param   priv_data [IN] optional data.
+ */
+typedef void (*pfm_garbage_str_wake_type_pkt_f)(const kal_uint8 *packet,
+                                                kal_int32 packet_len,
+                                                kal_int32 pfm_filter_id,
+                                                void* priv_data);
+
+/*
+ * Local parameter structure for MSG_ID_PFM_REGISTER_FILTER_REQ & MSG_ID_PFM_DEREGISTER_FILTER_REQ
+ */
+typedef struct _pfm_filter_set_t {
+    LOCAL_PARA_HDR
+
+    kal_uint32  filter_set_id;
+    kal_int32   filter_cnt;
+    kal_uint32  uplink;
+} pfm_filter_set_t;
+
+#define PFM_STR_FILTER_MAX_SIZE     192
+#define PFM_STR_FILTER_MAX_NUM      16
+
+typedef struct _pfm_str_filter_t {
+    kal_int32   filter_id;
+    kal_uint32  netif_id;
+    kal_uint16  filter_len;
+    kal_uint16  mask_len;
+    kal_uint8   filter[PFM_STR_FILTER_MAX_SIZE];
+    kal_uint8   mask[PFM_STR_FILTER_MAX_SIZE];
+    kal_uint32  magic_code;
+} pfm_str_filter_t;
+
+typedef struct _pfm_pcie_state_change_ind_t {
+    LOCAL_PARA_HDR
+    kal_uint32  is_suspend;
+} pfm_pcie_state_change_ind_struct;
+
+/*------------------------------------------------------------------------------
+ * DHL logging structure
+ *----------------------------------------------------------------------------*/
+typedef pfm_filter_set_t pfm_register_filter_req_struct;
+typedef pfm_filter_set_t pfm_deregister_filter_req_struct;
+
+#endif /* __INC_PFM_STRUCT_H */
diff --git a/mcu/interface/middleware/hif/sys_test.h b/mcu/interface/middleware/hif/sys_test.h
new file mode 100644
index 0000000..0d6a560
--- /dev/null
+++ b/mcu/interface/middleware/hif/sys_test.h
@@ -0,0 +1,89 @@
+/*!
+ *  @file sys_test.h
+ *  @author TJ Chang <tj.chang@mediatek.com>
+ *  @version 1.0
+ *  @section LICENSE
+ *
+ *  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).
+ *
+ *  @section DESCRIPTION
+ *  
+ */
+#ifndef _SYS_TEST_H
+#define _SYS_TEST_H
+
+#include "kal_general_types.h"
+
+
+// ==========================================================
+// Data Structure Definition
+// ==========================================================
+/*!
+ *  struct _ST_TCASE_T
+ *  
+ *  @brief register information of a test module.
+ *
+ *  @param  p_param           the parameter of test function.
+ *  @param  p_ret_err_str     returned string of error description.
+ *                            This string buffer is allocated by caller (sys_test) module,
+ *                            and the callee module fills in error description in this buffer.
+ *                   
+ *  @param  p_ret_err_str_sz  The caller (sys_test) module use this parameter to define the max size of error string buffer,
+ *                            and the callee module fills in the actual size of error string buffer when returning.
+ *                            Note: The callee module CAN NOT fill into 'p_ret_err_str' with exceeding size limit.
+ */
+typedef kal_bool (*st_fn)(void *p_param, kal_char *p_ret_err_str, kal_uint32 *p_ret_err_str_sz);
+typedef struct _ST_TCASE_T {
+    kal_char    *test_func_name; /* string description of test function */ 
+    st_fn       test_func; /* entry point of test function */
+    void        *test_param; /* parameter of test function */
+} ST_TCASE_T;
+
+
+// ==========================================================
+// SYS_TEST API
+// ==========================================================
+/*!
+ *  st_reg_test
+ *  
+ *  @brief register test function to SYS_TEST module.
+ *
+ *  @param  p_mod_name        test module naming.
+ *  @param  p_tcase           test function information used to register.
+ *  @param  tcase_num         number of test function struct.
+ *
+ *  @return kal_bool          KAL_TRUE if success, otherwise KAL_FALSE if fail.
+ */
+kal_bool st_reg_test(kal_char *p_mod_name, ST_TCASE_T *p_tcase, kal_uint32 tcase_num);
+
+
+#endif  /* _SYS_TEST_H */
+
diff --git a/mcu/interface/middleware/hif/tmc_api.h b/mcu/interface/middleware/hif/tmc_api.h
new file mode 100644
index 0000000..35a903b
--- /dev/null
+++ b/mcu/interface/middleware/hif/tmc_api.h
@@ -0,0 +1,95 @@
+/*****************************************************************************
+*  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).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ *   tmc_api.h
+ *
+ * Project:
+ * --------
+ *   VMOLY
+ *
+ * Description:
+ * ------------
+ *   Thermal Management Controller public application interface.
+ *
+ * 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!!
+ *==============================================================================
+ *******************************************************************************/
+
+#ifndef __INC_TMC_API_H__
+#define __INC_TMC_API_H__
+
+/**
+ * Registered module ID to TMC
+ *
+ * @param module_id  TMC will send thermal session notification to the mod_id.
+ *
+ * @return KAL_TRUE if successful, KAL_FALSE otherwise.
+ *
+ */
+kal_bool tmc_reg_mod_id(module_type module_id);
+
+/**
+ * Deregistered module ID to TMC
+ *
+ * @param module_id  TMC will stop send thermal notification to the mod_id.
+ *
+ * @return KAL_TRUE if successful, KAL_FALSE otherwise.
+ *
+ */
+kal_bool tmc_dereg_mod_id(module_type module_id);
+
+#endif /* __INC_TMC_API_H__ */
diff --git a/mcu/interface/middleware/hif/tmc_enums.h b/mcu/interface/middleware/hif/tmc_enums.h
new file mode 100644
index 0000000..00f2e61
--- /dev/null
+++ b/mcu/interface/middleware/hif/tmc_enums.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) 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:
+ * ---------
+ *   tmc_enums.h
+ *
+ * Project:
+ * --------
+ *   UMOLY
+ *
+ * Description:
+ * ------------
+ *   Thermal Management Controller public enumeration definition.
+ *
+ * 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 __INC_TMC_ENUMS_H
+#define __INC_TMC_ENUMS_H
+
+#endif /* __INC_TMC_ENUMS_H */
diff --git a/mcu/interface/middleware/hif/tmc_l1_struct.h b/mcu/interface/middleware/hif/tmc_l1_struct.h
new file mode 100644
index 0000000..5bbd257
--- /dev/null
+++ b/mcu/interface/middleware/hif/tmc_l1_struct.h
@@ -0,0 +1,63 @@
+/*****************************************************************************
+*  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 TMC_L1_STRUCT_H
+#define TMC_L1_STRUCT_H
+
+#include "kal_general_types.h"
+#include "kal_public_defs.h"
+
+#define NR_MAX_TX_PWR_REQ_ANT_NUM 16
+
+/* reference structure el1_lte_max_tx_pwr_red_req_struct */
+typedef struct
+{
+    LOCAL_PARA_HDR
+    /*
+     *  op 1: for all band, op 3,5: only for band, op 4: reset, n = 1
+     *  op 9: for all band (2 antennas), op 10: one band (2 antennas), n = 2
+     *  op 11: for all band (n antennas), op 12: one band (n antennas), 1 < n <= NR_MAX_TX_PWR_REQ_ANT_NUM
+     */
+    kal_uint8   op;
+    kal_uint16  band;  /*< Band in integer format (1 - 255) */
+
+    kal_uint8   para1; /*< 0~255, unit: 1/8 dB, (0~32 dB) */
+    kal_uint8   para2; /*< reserved */
+    kal_uint8   para3; /*< reserved */
+    kal_uint8   n;     /*< 1~NR_MAX_TX_PWR_REQ_ANT_NUM, number of valid parameters in param[] */
+    kal_uint8   param[NR_MAX_TX_PWR_REQ_ANT_NUM]; /*< 0~255, unit: 1/8 dB, (0~32 dB) */
+} nl1_nr_max_tx_pwr_red_req_struct;
+
+#endif /* TMC_L1_STRUCT_H */
diff --git a/mcu/interface/middleware/hif/tmc_l5_struct.h b/mcu/interface/middleware/hif/tmc_l5_struct.h
new file mode 100644
index 0000000..df00efc
--- /dev/null
+++ b/mcu/interface/middleware/hif/tmc_l5_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) 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:
+ * ---------
+ *   tmc_l5_struct.h
+ *
+ * Project:
+ * --------
+ *   VMOLY
+ *
+ * Description:
+ * ------------
+ *   Thermal Management Controller ILM structure and interface definition.
+ *
+ * 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!!
+ *==============================================================================
+ *******************************************************************************/
+#ifndef __INC_TMC_L5_STRUCT_H
+#define __INC_TMC_L5_STRUCT_H
+
+#include "kal_public_defs.h"
+#include "tmc_struct.h"
+
+/* Macro & Enum definition */
+#define TMC_ACTUATOR_NAME_LEN           40
+#define TMC_ACTUATOR_UL_THROTTLE        "UL Throttle\0"
+#define TMC_ACTUATOR_REDUCE_TX_POWER    "3G4G PA\0"
+#define TMC_ACTUATOR_REDUCE_NR_TX_POWER "NR PA\0"
+#define TMC_ACTUATOR_CC_CONTROL         "CC Control\0"
+#define TMC_ACTUATOR_SW_SHUTDOWN        "SW Shutdown\0"
+#define TMC_ACTUATOR_FLIGHT_MODE        "Flight Mode\0"
+
+typedef struct l5io_tmc_actuator_num_req_struct {
+    LOCAL_PARA_HDR
+    kal_uint32 status_id;
+} l5io_tmc_actuator_num_req_struct;
+
+typedef struct l5io_tmc_actuator_num_cnf_struct {
+    LOCAL_PARA_HDR
+    kal_uint32 status_id;
+    kal_uint32 actuator_num;
+    tmc_req_result_enum result;
+} l5io_tmc_actuator_num_cnf_struct;
+
+typedef struct l5io_tmc_actuator_state_query_req_struct {
+    LOCAL_PARA_HDR
+    kal_uint32 status_id;
+    kal_uint32 actuator_id;
+} l5io_tmc_actuator_state_query_req_struct;
+
+typedef struct l5io_tmc_actuator_state_query_cnf_struct {
+    LOCAL_PARA_HDR
+    kal_uint32 status_id;
+    kal_uint32 actuator_id;
+    kal_char   actuator_name[TMC_ACTUATOR_NAME_LEN];
+    kal_uint32 zone_id;
+    kal_uint32 max_lv;
+    kal_uint32 current_lv;
+    kal_uint32 user_impact;
+    kal_uint32 efficiency;
+    tmc_req_result_enum result;
+} l5io_tmc_actuator_state_query_cnf_struct;
+
+typedef tmc_ctrl_req_struct l5io_tmc_actuator_set_req_struct;
+typedef tmc_ctrl_rsp_struct l5io_tmc_actuator_set_cnf_struct;
+
+#endif /* __INC_TMC_L5_STRUCT_H */
diff --git a/mcu/interface/middleware/hif/tmc_nrrc_struct.h b/mcu/interface/middleware/hif/tmc_nrrc_struct.h
new file mode 100644
index 0000000..118bef5
--- /dev/null
+++ b/mcu/interface/middleware/hif/tmc_nrrc_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) 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 TMC_NRRC_STRUCT_H
+#define TMC_NRRC_STRUCT_H
+
+#include "kal_general_types.h"
+#include "kal_public_defs.h"
+
+/********************************************
+ *                  MACROS                  *
+ ********************************************/
+
+
+/********************************************
+ *         TYPE DEFINITIONS & ENUMS         *
+ ********************************************/
+
+/**
+ * Enumeration identifies maximum number of downlink MIMO layers values.
+ */
+typedef enum
+{
+    NRRC_MAX_MIMO_LAYERS_DL2       = 0,
+    NRRC_MAX_MIMO_LAYERS_DL4       = 1,
+    NRRC_MAX_MIMO_LAYERS_DL8       = 2
+} nrrc_max_mimo_layers_dl_enum;
+
+/**
+ * Enumeration identifies maximum number of uplink MIMO layers values.
+ */
+typedef enum
+{
+    NRRC_MAX_MIMO_LAYERS_UL1       = 0,
+    NRRC_MAX_MIMO_LAYERS_UL2       = 1,
+    NRRC_MAX_MIMO_LAYERS_UL4       = 2
+} nrrc_max_mimo_layers_ul_enum;
+
+/* MSG_ID_TMC_NRRC_ASSISTANCE_INFO_SUPPORT_IND */
+typedef struct
+{
+    LOCAL_PARA_HDR
+
+    kal_bool                       is_supported;
+} tmc_nrrc_assistance_info_support_ind_struct;
+
+/* MSG_ID_TMC_NRRC_ASSISTANCE_INFO_SEND_REQ */
+typedef struct
+{
+    LOCAL_PARA_HDR
+
+    kal_bool                       is_scells_reduction_preferred;
+    kal_uint8                      max_scells_dl;
+    kal_uint8                      max_scells_ul;
+
+    kal_bool                       is_aggregated_bw_fr1_reduction_preferred;
+    kal_uint16                     max_aggregated_bw_fr1_dl;
+    kal_uint16                     max_aggregated_bw_fr1_ul;
+
+    kal_bool                       is_aggregated_bw_fr2_reduction_preferred;
+    kal_uint16                     max_aggregated_bw_fr2_dl;
+    kal_uint16                     max_aggregated_bw_fr2_ul;
+
+    kal_bool                       is_mimo_layers_fr1_reduction_preferred;
+    nrrc_max_mimo_layers_dl_enum   max_mimo_layers_bw_fr1_dl;
+    nrrc_max_mimo_layers_ul_enum   max_mimo_layers_bw_fr1_ul;
+
+    kal_bool                       is_mimo_layers_fr2_reduction_preferred;
+    nrrc_max_mimo_layers_dl_enum   max_mimo_layers_bw_fr2_dl;
+    nrrc_max_mimo_layers_ul_enum   max_mimo_layers_bw_fr2_ul;
+} tmc_nrrc_assistance_info_send_req_struct;
+
+/* MSG_ID_TMC_NRRC_ASSISTANCE_INFO_SEND_CNF */
+typedef struct
+{
+    LOCAL_PARA_HDR
+
+    kal_bool                       success;
+} tmc_nrrc_assistance_info_send_cnf_struct;
+
+/* MSG_ID_TMC_NRRC_ASSISTANCE_INFO_SENDING_ALLOWED_IND */
+typedef struct
+{
+    LOCAL_PARA_HDR
+} tmc_nrrc_assistance_info_sending_allowed_ind_struct;
+
+/* MSG_ID_NRRC_TMC_NO_OVERHEATING_IND */
+typedef struct
+{
+    LOCAL_PARA_HDR
+} nrrc_tmc_no_overheating_ind_struct;
+
+/********************************************
+ *                VARIABLES                 *
+ ********************************************/
+
+
+/********************************************
+ *           FUNCTION DECLARATIONS          *
+ ********************************************/
+
+
+#endif /* TMC_NRRC_STRUCT_H */
diff --git a/mcu/interface/middleware/hif/tmc_struct.h b/mcu/interface/middleware/hif/tmc_struct.h
new file mode 100644
index 0000000..c7cbaed
--- /dev/null
+++ b/mcu/interface/middleware/hif/tmc_struct.h
@@ -0,0 +1,504 @@
+/*****************************************************************************
+*  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:
+ * ---------
+ *   tmc_struct.h
+ *
+ * Project:
+ * --------
+ *   UMOLY
+ *
+ * Description:
+ * ------------
+ *   Thermal Management Controller ILM structure and interface definition.
+ *
+ * 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!!
+ *==============================================================================
+ *******************************************************************************/
+#ifndef __INC_TMC_STRUCT_H
+#define __INC_TMC_STRUCT_H
+
+#include "kal_public_defs.h"
+
+/* Macro & Enum definition for Gen97 */
+#define MAX_SUPPORTED_CC_NB  5
+#define MAX_BAND_NB          MAX_SUPPORTED_CC_NB /* max. supported band number at same time should be algin max supported CC number */
+#define MAX_CELL_NB          8
+#define TMC_CTRL_MAX_CG_NUM  2
+
+/* Define invalid value */
+#define INVALID_SUPPORTED_CC_INDEX  MAX_SUPPORTED_CC_NB
+#define INVALID_CELL_INDEX          0xFF
+#define INVALID_BAND_INDEX          0
+#define TMC_INVALID_NW_STATUS_ID    0xFF
+
+typedef enum tmc_ctrl_cg_enum {
+    TMC_CTRL_CG_NA,     /* none */
+    TMC_CTRL_CG_MCG,    /* refer as MCG */
+    TMC_CTRL_CG_SCG     /* refer as SCG */
+} tmc_ctrl_cg_enum;
+
+typedef enum tmc_ctrl_cmd_enum {
+    TMC_CTRL_CMD_THROTTLING = 0,
+    TMC_CTRL_CMD_CA_CTRL,
+    TMC_CTRL_CMD_PA_CTRL,
+    TMC_CTRL_CMD_COOLER_LV,
+    TMC_CTRL_CMD_CELL,            /* MD internal use : refer as del_cell */
+    TMC_CTRL_CMD_BAND,            /* MD internal use : refer as del_band */
+    TMC_CTRL_CMD_INTER_BAND_OFF,  /* MD internal use : similar to PA_OFF on Gen95 */
+    TMC_CTRL_CMD_CA_OFF,          /* MD internal use : similar to CA_OFF on Gen95 */
+    TMC_CTRL_CMD_SCG_OFF,         /* Fall back to 4G */
+    TMC_CTRL_CMD_SCG_ON,          /* Enabled 5G */
+    TMC_CTRL_CMD_TX_POWER,
+    TMC_CTRL_CMD_LOW_POWER_IND,
+    TMC_CTRL_CMD_SELF_CC_CTRL,
+    TMC_CTRL_CMD_DEFAULT
+} tmc_ctrl_cmd_enum;
+
+typedef enum tmc_ctrl_result_enum {
+    TMC_CTRL_RESULT_SUCCESS = 0,
+    TMC_CTRL_RESULT_STATUS_IND_ID_MISMATCH,
+    TMC_CTRL_RESULT_MAC_RESET_ONGOING,
+    TMC_CTRL_RESULT_FAIL_INCORRECT_CMD,
+    TMC_CTRL_RESULT_REJECT,
+    TMC_CTRL_RESULT_OTHERS
+} tmc_ctrl_result_enum;
+
+typedef enum tmc_ctrl_nw_status_enum {
+    TMC_CTRL_STATUS_SESSION_ESTABLISH = 0,
+    TMC_CTRL_STATUS_UPDATE,
+    TMC_CTRL_STATUS_SPCELL_CHANGE,
+    TMC_CTRL_STATUS_OTHERS
+} tmc_ctrl_nw_status_enum;
+
+typedef enum tmc_throt_ctrl_enum {
+    TMC_THROT_ENABLE_IMS_ENABLE = 0,
+    TMC_THROT_ENABLE_IMS_DISABLE,
+    TMC_THROT_DISABLE,
+} tmc_throt_ctrl_enum;
+
+typedef enum tmc_ca_ctrl_enum {
+    TMC_CA_ON = 0, /* leave thermal control */
+    TMC_CA_OFF,
+} tmc_ca_ctrl_enum;
+
+typedef enum tmc_pa_ctrl_enum {
+    TMC_PA_ALL_ON = 0, /* leave thermal control */
+    TMC_PA_OFF_1PA,
+} tmc_pa_ctrl_enum;
+
+typedef enum tmc_cc_ctrl_enum {
+    TMC_SELF_CC_CTRL_ENABLED = 0, /* step by step remove cc */
+    TMC_SELF_CC_CTRL_ENABLED_MCG_CA_OFF,
+    TMC_SELF_CC_CTRL_ENABLED_SCG_CA_OFF,
+    TMC_SELF_CC_CTRL_ENABLED_ALL_CA_OFF,
+    TMC_SELF_CC_CTRL_ENABLED_SCG_OFF,
+    TMC_SELF_CC_CTRL_ENABLED_MCG_CA_OFF_SCG_OFF,
+    TMC_SELF_CC_CTRL_ENABLED_LTE_ONLY,
+    TMC_SELF_CC_CTRL_DISABLED,
+} tmc_cc_ctrl_enum;
+
+typedef enum tmc_cooler_lv_ctrl_enum {
+    TMC_COOLER_LV_ENABLE = 0,
+    TMC_COOLER_LV_DISABLE,
+} tmc_cooler_lv_ctrl_enum;
+
+typedef enum tmc_cooler_lv_enum {
+    TMC_COOLER_LV0 = 0,
+    TMC_COOLER_LV1,
+    TMC_COOLER_LV2,
+    TMC_COOLER_LV3,
+    TMC_COOLER_LV4,
+    TMC_COOLER_LV5,
+    TMC_COOLER_LV6,
+    TMC_COOLER_LV7,
+    TMC_COOLER_LV8,
+    TMC_COOLER_MAX
+} tmc_cooler_lv_enum;
+
+typedef enum tmc_nw_stat_enum {
+    TMC_NW_STAT_MCG = 0,
+    TMC_NW_STAT_SCG,
+    TMC_NW_STAT_MAX_NUM
+} tmc_nw_stat_enum;
+
+typedef enum tmc_ctrl_nl1_frq_enum {
+    TMC_NR_FRE_FR1 = 0,
+    TMC_NR_FRE_FR2,
+    TMC_NR_FRE_MAX_NUM
+} tmc_ctrl_nl1_frq_enum;
+
+typedef enum tmc_tx_pwr_event_enum {
+    TMC_TW_PWR_VOLTAGE_LOW_EVENT = 0,
+    TMC_TW_PWR_LOW_BATTERY_EVENT,
+    TMC_TW_PWR_OVER_CURRENT_EVENT,
+    TMC_TW_PWR_REDUCE_OTHER_MAX_TX_EVENT, /* reserved for reduce 2G/3G/4G/C2K max TX power for certain value */
+    TMC_TW_PWR_REDUCE_NR_MAX_TX_EVENT,    /* reserved for reduce 5G max TX power for certain value */
+    TMC_TW_PWR_EVENT_MAX_NUM
+} tmc_lpower_event_enum;
+
+typedef enum tmc_tx_pwr_status_lv_enum {
+    TMC_TX_PWR_STATUS_LV0 = 0,
+    TMC_TX_PWR_STATUS_LV1,
+    TMC_TX_PWR_STATUS_LV2,
+    TMC_TX_PWR_STATUS_MAX
+} tmc_tx_pwr_status_lv_enum;
+
+typedef enum tmc_overheated_rat_enum {
+    TMC_OVERHEATED_LTE = 0,
+    TMC_OVERHEATED_NR,
+    TMC_OVERHEATED_NA,
+    TMC_OVERHEATED_MAX
+} tmc_overheated_rat_enum;
+
+typedef enum tmc_cooler_tbl_enum {
+    TMC_UL_THROTTLE_COOLER = 0,
+    TMC_OTHER_RAT_REDUCE_TX_COOLER,
+    TMC_NR_REDUCE_TX_COOLER,
+    TMC_CC_CONTROL_COOLER,
+    TMC_SW_SHUTDOWN_COOLER,
+    TMC_FLIHT_MODE_COOLER,
+    TMC_MAX_COOLER
+} tmc_cooler_tbl_enum;
+
+typedef enum tmc_ctrl_req_enum {
+    TMC_CTRL_REQ_SET_ACTUATOR = 0,
+    TMC_CTRL_REQ_SET_COOLER,
+    TMC_CTRL_REQ_MAX_NUM
+} tmc_ctrl_req_enum;
+
+typedef enum tmc_req_result_enum {
+    TMC_RESULT_SUCCESS,
+    TMC_RESULT_FAILED,
+    TMC_RESULT_UNSUPPORTED_LV,
+    TMC_RESULT_UNSUPPORTED_ACTUATOR_ID,
+    TMC_RESULT_L5_ACTION_SW_SHUTDOWN_ENABLED,
+    TMC_RESULT_L5_ACTION_SW_SHUTDOWN_DISABLED,
+    TMC_RESULT_L5_ACTION_FLIGHT_MODE_ENABLED,
+    TMC_RESULT_L5_ACTION_FLIGHT_MODE_DISABLED,
+    TMC_RESULT_MAX
+} tmc_req_result_enum;
+
+typedef enum tmc_ctrl_low_pwr_enum {
+    TMC_CTRL_LOW_POWER_LOW_BATTERY_EVENT = 0,  /* battery less than threshold (ex : 20%) */
+    TMC_CTRL_LOW_POWER_RECHARGE_BATTERY_EVENT, /* battery recharge over threshold (ex : 25%) */
+    TMC_CTRL_LOW_POWER_MAX
+} tmc_ctrl_low_pwr_enum;
+
+typedef enum tmc_req_reason_enum {
+    TMC_OVERHEATED_START = 0,
+    TMC_OVERHEATED_END,
+    TMC_LOW_POWER,
+    TMC_RECHARGE,
+    TMC_REQ_REASON_MAX
+} tmc_req_reason_enum;
+
+/* Structure definition */
+typedef struct tmc_ctrl_cell_rt_info_struct {
+    kal_uint32                      dl_throughput;
+    kal_uint32                      ul_throughput;
+    kal_uint8                       dl_bandwidth;
+    kal_uint8                       ul_bandwidth;
+} tmc_ctrl_cell_rt_info_struct;
+
+typedef struct tmc_ctrl_cell_info_struct {
+    kal_uint8                       cell_idx;
+    kal_bool                        is_specll;
+    kal_bool                        is_DLonly;
+} tmc_ctrl_cell_info_struct;
+
+typedef struct tmc_ctrl_band_info_struct {
+    kal_uint8                       band_id;
+    kal_uint8                       cell_info_idx[MAX_SUPPORTED_CC_NB];
+} tmc_ctrl_band_info_struct;
+
+typedef struct tmc_ctrl_cg_info_struct {
+    tmc_ctrl_cg_enum                cg_type;
+    kal_uint8                       band_num;
+    tmc_ctrl_band_info_struct       band[MAX_BAND_NB];
+    tmc_ctrl_cell_info_struct       cell[MAX_SUPPORTED_CC_NB];
+    tmc_ctrl_cell_rt_info_struct    cell_info[MAX_CELL_NB];
+} tmc_ctrl_cg_info_struct;
+
+typedef struct tmc_emac_nw_status_struct {
+    kal_uint8                       status_ind_id;
+    tmc_ctrl_nw_status_enum         status_cause;
+    tmc_ctrl_cg_info_struct         cell_group[TMC_CTRL_MAX_CG_NUM];
+    kal_uint8                       total_cell;
+    kal_uint8                       sim_idx;
+} tmc_emac_nw_status_struct;
+
+typedef struct tmc_emac_nw_status_ind_struct {
+    LOCAL_PARA_HDR
+    tmc_emac_nw_status_struct       nw_status;
+} tmc_emac_nw_status_ind_struct;
+
+typedef struct tmc_emac_thermal_control_req_struct {
+    LOCAL_PARA_HDR
+    kal_uint8                       status_ind_id;
+    tmc_ctrl_cmd_enum               ctrl_cmd;
+    tmc_ctrl_cg_enum                cg_type;
+    kal_uint8                       band_num;
+    kal_uint8                       forbidden_band[MAX_BAND_NB];
+    kal_uint8                       cell_num;
+    kal_uint32                      forbidden_cell_bitmap;
+} tmc_emac_thermal_control_req_struct;
+
+typedef struct tmc_emac_thermal_control_cnf_struct {
+    LOCAL_PARA_HDR
+    tmc_ctrl_result_enum            result;
+    tmc_emac_nw_status_struct       nw_status;
+} tmc_emac_thermal_control_cnf_struct;
+
+typedef struct tmc_nmac_nw_status_struct{
+    kal_uint8                       status_ind_id;
+    tmc_ctrl_nw_status_enum         status_cause;
+    tmc_ctrl_cg_info_struct         cell_group[TMC_CTRL_MAX_CG_NUM];
+    kal_uint8                       total_cell;
+    kal_uint8                       sim_idx;
+}tmc_nmac_nw_status_struct;
+
+typedef struct tmc_nmac_nw_status_ind_struct{
+    LOCAL_PARA_HDR
+    tmc_nmac_nw_status_struct       nw_status;
+} tmc_nmac_nw_status_ind_struct;
+
+typedef struct tmc_nmac_thermal_control_req_struct {
+    LOCAL_PARA_HDR
+    kal_uint8                       status_ind_id;
+    tmc_ctrl_cmd_enum               ctrl_cmd;
+    tmc_ctrl_cg_enum                cg_type;
+    kal_uint8                       band_num;
+    kal_uint8                       forbidden_band[MAX_BAND_NB];
+    kal_uint8                       cell_num;
+    kal_uint32                      forbidden_cell_bitmap;
+} tmc_nmac_thermal_control_req_struct;
+
+typedef struct tmc_nmac_thermal_control_cnf_struct {
+    LOCAL_PARA_HDR
+    tmc_ctrl_result_enum            result;
+    tmc_nmac_nw_status_struct       nw_status;
+} tmc_nmac_thermal_control_cnf_struct;
+
+typedef struct tmc_ctrl_config
+{
+    kal_uint8  ctrl_cmd;  /* tmc_ctrl_cmd_enum */
+    union {
+        struct tmc_throttling {
+            kal_uint8  thrott_ctrl; /* tmc_throt_ctrl_enum */
+            kal_uint8  active_period_100ms;
+            kal_uint8  suspend_period_100ms;
+        } tmc_throttling;
+
+        struct tmc_ca_ctrl {
+            kal_uint8  ca_ctrl;    /* tmc_ca_ctrl_enum */
+            kal_uint8  reserved1;
+            kal_uint8  reserved2;
+        } tmc_ca_ctrl;
+
+        struct tmc_pa_ctrl {
+            kal_uint8  pa_ctrl;    /* tmc_pa_ctrl_enum */
+            kal_uint8  reserved1;
+            kal_uint8  reserved2;
+        } tmc_pa_ctrl;
+
+        struct tmc_cooler_lv {
+            kal_uint8  enable;         /* tmc_cooler_lv_ctrl_enum */
+            kal_uint8  cooler_lv;      /* tmc_cooler_lv_enum */
+            kal_uint8  overheated_rat; /* tmc_overheated_rat_enum */
+        } tmc_cooler_lv;
+
+        struct tmc_tx_power {
+            kal_uint8  status;            /* tmc_tx_pwr_status_lv_enum */
+            kal_uint8  event;             /* tmc_tx_pwr_event_enum */
+            kal_uint8  reduce_max_tx_pwr; /* reserved for reduce max tx_pwer value (unit : 1/8 db) */
+        } tmc_tx_power;
+
+        struct tmc_cc_ctrl {
+            kal_uint8  cc_ctrl;         /* tmc_cc_ctrl_enum */
+            kal_uint8  overheated_rat;  /* tmc_overheated_rat_enum */
+            kal_uint8  reserved1;
+        } tmc_cc_ctrl;
+
+        struct tmc_low_power {
+            kal_uint8  event;	/* tmc_ctrl_low_pwr_enum */
+            kal_uint8  reserved1;
+            kal_uint8  reserved2;
+        } tmc_low_power;
+    } u;
+} tmc_ctrl_config;
+
+typedef struct tmc_nw_stat_struct {
+    module_type               mod_id;
+    tmc_emac_nw_status_struct nw_stat;
+} tmc_nw_stat_struct;
+
+typedef struct tmc_control_req_struct {
+    LOCAL_PARA_HDR
+    kal_uint32 ap_req_cmd;
+} tmc_control_req_struct;
+
+typedef struct tmc_nl1_nw_status_ind_struct {
+    LOCAL_PARA_HDR
+    kal_uint32 max_dl_bw[TMC_NR_FRE_MAX_NUM];
+    kal_uint32 max_dl_mimo_layer[TMC_NR_FRE_MAX_NUM];
+    kal_uint32 max_ul_bw[TMC_NR_FRE_MAX_NUM];
+    kal_uint32 max_ul_mimo_layer [TMC_NR_FRE_MAX_NUM];
+} tmc_nl1_nw_status_ind_struct;
+
+typedef struct tmc_lv_cfg {
+    kal_uint32 zone_id;
+    kal_uint32 user_impact;
+    kal_uint32 efficiency;
+    kal_uint32 value1;
+    kal_uint32 value2;
+} tmc_lv_cfg;
+
+typedef struct tmc_lv_tbl {
+    tmc_lv_cfg lv_cfg[TMC_COOLER_MAX];
+} tmc_lv_tbl;
+
+typedef struct tmc_ctrl_req_struct {
+    LOCAL_PARA_HDR
+    kal_uint32 status_id;
+    tmc_ctrl_req_enum ctrl_cmd;
+    union {
+        struct {
+            kal_uint32 actuator_id;
+            kal_uint32 lv;
+        } tmc_actuator_cfg;
+
+        struct {
+            tmc_ctrl_config tmc_ctrl_req;
+        } tmc_cooler_cfg;
+    } u;
+} tmc_ctrl_req_struct;
+
+typedef struct tmc_ctrl_rsp_struct {
+    LOCAL_PARA_HDR
+    kal_uint32 status_id;
+    tmc_req_result_enum result;
+} tmc_ctrl_rsp_struct;
+
+typedef struct tmc_l4bpwr_battery_status_req_struct {
+    LOCAL_PARA_HDR
+    kal_bool is_low_battery;
+} tmc_l4bpwr_battery_status_req_struct;
+
+/*
+ * Bitmap for tmc_emac_thermal_control_req enhance functions.
+ * Need to sync with WCT/SE3/PS2 YK.Liu before modification.
+ */
+#define TMC_ENHANCE_FUNC_DISABLE_CA             0x00000001
+#define TMC_ENHANCE_FUNC_TX_POWER_BACKOFF       0x00000002
+
+/*
+ * Local parameter structure for MSG_ID_TMC_EMAC_THERMAL_CONTROL_REQ for Gen93
+ */
+typedef struct
+{
+    LOCAL_PARA_HDR
+#if defined(__MD93__)
+    kal_bool     overheat_flg;    /* TMC notify mobile phone temperature is too high, need to cool down */
+    kal_uint8    enhance_func_bitmap;
+#else
+    tmc_ctrl_config tmc_ctrl_cfg;
+#endif
+} tmc_emac_thermal_control_req;
+
+/*------------------------------------------------------------------------------
+ * DHL logging structure
+ *----------------------------------------------------------------------------*/
+//typedef tmc_emac_thermal_control_req tmc_emac_thermal_control_req_struct;
+
+#endif /* __INC_TMC_STRUCT_H */
diff --git a/mcu/interface/middleware/hif/ufpm_em_struct.h b/mcu/interface/middleware/hif/ufpm_em_struct.h
new file mode 100644
index 0000000..6f2a4b5
--- /dev/null
+++ b/mcu/interface/middleware/hif/ufpm_em_struct.h
@@ -0,0 +1,72 @@
+/*!
+ *  @file ufpm_struct.h
+ *  @author Bo-Kai Huang <bo-kai.haung@mediatek.com>
+ *  @version 1.0
+ *  @section LICENSE
+ *
+ *  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).
+ *
+ *  @section DESCRIPTION
+ *  This file provides main definitions of usbcore
+ */
+
+#ifndef _UFPM_EM_STRUCT_H
+#define _UFPM_EM_STRUCT_H
+
+#include "ufpm_struct.h"
+
+/**************************************
+ * UFPM ENUM and Types
+ **************************************/
+
+typedef ufpm_enable_md_func_req_t       ufpm_enable_md_fast_path_req_struct;
+typedef ufpm_md_fast_path_common_req_t  ufpm_disable_md_fast_path_req_struct;
+typedef ufpm_md_fast_path_common_req_t  ufpm_deactivate_md_fast_path_req_struct;
+typedef ufpm_activate_md_func_req_t     ufpm_activate_md_fast_path_req_struct;
+typedef ufpm_md_fast_path_common_rsp_t  ufpm_enable_md_fast_path_rsp_struct;
+typedef ufpm_md_fast_path_common_rsp_t  ufpm_disable_md_fast_path_rsp_struct;
+typedef ufpm_deactivate_md_func_rsp_t   ufpm_deactivate_md_fast_path_rsp_struct;
+typedef ufpm_md_fast_path_common_rsp_t  ufpm_activate_md_fast_path_rsp_struct;
+typedef ufpm_notify_md_bus_event_req_t  ufpm_notify_md_bus_event_req_struct;
+typedef ufpm_md_fast_path_common_rsp_t  ufpm_notify_md_bus_event_rsp_struct;
+typedef ufpm_send_md_ep0_msg_t          ufpm_send_md_usb_ep0_req_struct;
+typedef ufpm_send_ap_ep0_msg_t          ufpm_send_md_usb_ep0_rsp_struct;
+typedef ufpm_send_md_ep0_msg_t          ufpm_send_md_usb_ep0_ind_struct;
+typedef ufpm_send_ap_ep0_msg_t          ufpm_send_ap_usb_ep0_ind_struct;
+
+
+typedef struct _ufpm_em_dump_ctx_struct {
+    LOCAL_PARA_HDR
+    ufpm_t ufpm_task_ctx;
+} ufpm_em_dump_ctx_struct;
+
+#endif  // _UFPM_MAIN_H
+
diff --git a/mcu/interface/middleware/hif/ufpm_enum.h b/mcu/interface/middleware/hif/ufpm_enum.h
new file mode 100644
index 0000000..d32d3dd
--- /dev/null
+++ b/mcu/interface/middleware/hif/ufpm_enum.h
@@ -0,0 +1,84 @@
+/*!
+ *  @file ufpm_enum.h
+ *  @author Bo-Kai Huang <bo-kai.haung@mediatek.com>
+ *  @version 1.0
+ *  @section LICENSE
+ *
+ *  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).
+ *
+ *  @section DESCRIPTION
+ *  This file provides main definitions of usbcore
+ */
+
+#ifndef _UFPM_ENUM_H
+#define _UFPM_ENUM_H
+
+#include "hif_mw_msgid.h"
+#include "kal_public_api.h"
+
+/**************************************
+ * UFPM ENUM and Types
+ **************************************/
+
+// UFPM state machine 
+typedef enum _ufpm_func_state {
+    UFPM_FUNC_SM_UNINIT    =   0,
+    UFPM_FUNC_SM_DEACTIVATE,
+    UFPM_FUNC_SM_ACTIVATE,
+} ufpm_func_state_e;
+
+typedef enum _ufpm_usb_state {
+    UFPM_USB_SM_RESET   =   0,
+    UFPM_USB_SM_CONFIG,
+} ufpm_usb_state_e;
+
+// UFPM function events
+typedef enum ufpm_usbclass_notify {
+    UFPM_USBCLASS_NOTIFY_NONEED =   0,
+    UFPM_USBCLASS_NOTIFY_TO_RESET,
+    UFPM_USBCLASS_NOTIFY_TO_DETACHED,
+    UFPM_USBCLASS_NOTIFY_TO_CONFIG,
+} ufpm_usbclass_notify_e;
+
+typedef enum _ufpm_func_mode {
+    UFPM_FUNC_MODE_TETHER   =   0,
+    UFPM_FUNC_MODE_LOG,
+    UFPM_FUNC_MODE_MAX_NUM,
+} ufpm_func_mode_e;
+
+typedef enum _ufpm_bus_state {
+    UFPM_BUS_STATE_SUSPEND  =   0,
+    UFPM_BUS_STATE_RESUME,
+    UFPM_BUS_STATE_RESET,
+} ufpm_bus_state_e;
+
+#endif  // _UFPM_ENUM_H
+
diff --git a/mcu/interface/middleware/hif/ufpm_if.h b/mcu/interface/middleware/hif/ufpm_if.h
new file mode 100644
index 0000000..e6db9b3
--- /dev/null
+++ b/mcu/interface/middleware/hif/ufpm_if.h
@@ -0,0 +1,47 @@
+/*!
+ *  @file ufpm_if.h
+ *  @author Bo-Kai Huang <bo-kai.haung@mediatek.com>
+ *  @version 1.0
+ *  @section LICENSE
+ *
+ *  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).
+ *
+ *  @section DESCRIPTION
+ *  This file provides interface of nmu ( network management unit )
+ */
+
+#ifndef _UFPM_IF_H
+#define _UFPM_IF_H
+
+kal_bool ufpm_dhl_query_support();
+
+#endif  // _UFPM_IF_H
+
diff --git a/mcu/interface/middleware/hif/ufpm_struct.h b/mcu/interface/middleware/hif/ufpm_struct.h
new file mode 100644
index 0000000..59354eb
--- /dev/null
+++ b/mcu/interface/middleware/hif/ufpm_struct.h
@@ -0,0 +1,241 @@
+/*!
+ *  @file ufpm_struct.h
+ *  @author Bo-Kai Huang <bo-kai.haung@mediatek.com>
+ *  @version 1.0
+ *  @section LICENSE
+ *
+ *  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).
+ *
+ *  @section DESCRIPTION
+ *  This file provides main definitions of usbcore
+ */
+
+#ifndef _UFPM_STRUCT_H
+#define _UFPM_STRUCT_H
+
+#include "hif_mw_msgid.h"
+#include "kal_public_api.h"
+#include "ufpm_enum.h"
+#include "ipc_msgsvc_msgid.h"
+#include "ccci_ipc_if.h"
+#include "mw_sap.h"
+#include "ufpm_usb_struct.h"
+
+#define UFPM_USB_MAP_MAX_SIZE 8
+
+/**************************************
+ * UFPM ENUM and Types
+ **************************************/
+typedef union _ufpm_func_activation_info {
+    tethering_activate_meta_info_t tethering_info;
+    logging_activate_meta_info_t logging_info;
+} ufpm_func_activation_info_t;
+
+typedef union _ufpm_func_deactivation_info {
+    tethering_deactivate_meta_info_t tethering_info;
+    logging_deactivate_meta_info_t logging_info;
+} ufpm_func_deactivation_info_t;
+
+typedef struct _ufpm_usb_property {
+    kal_bool isSupport;
+    ufpm_func_state_e state;
+    ufpm_usb_mapping_t mapTable[UFPM_USB_MAP_MAX_SIZE];
+    ufpm_func_activation_info_t activate_meta_info;
+    ufpm_func_deactivation_info_t deactivate_meta_info;
+} ufpm_usb_property_t;
+
+typedef struct _ufpm_mpu_info {
+    kal_uint8 apUsbDomain;                                      // AP USB MPU domain ID
+    kal_uint8 mdCldmaDomain;                                    // MD CLDMA MPU domain ID
+    kal_uint8 reserved[6];
+    kal_uint64 memBank0BaseAddr;                                // Memory bank0 base address
+    kal_uint64 memBank0Size;                                    // Memory bank0 size
+    kal_uint64 memBank4BaseAddr;                                // Memory bank4 base address
+    kal_uint64 memBank4Size;                                    // Memory bank4 size
+} ufpm_mpu_info_t;
+
+typedef struct _ufpm_md_fast_path_common_req {
+    LOCAL_PARA_HDR
+    kal_uint8 mode;
+    kal_uint8 reserved[3];
+} ufpm_md_fast_path_common_req_t;
+
+typedef struct _ufpm_md_fast_path_common_rsp {
+    LOCAL_PARA_HDR
+    kal_uint8 mode;
+    kal_uint8 result; // bool
+    kal_uint8 reserved[2];
+} ufpm_md_fast_path_common_rsp_t;
+
+typedef struct _ufpm_md_fast_path_common_ind {
+    LOCAL_PARA_HDR
+    kal_uint8 mode;
+    kal_uint8 reserved[3];
+} ufpm_md_fast_path_common_ind_t;
+
+typedef struct _ufpm_notify_md_bus_event_req {
+    LOCAL_PARA_HDR
+    kal_uint8 state;
+    kal_uint8 reserved[3];
+} ufpm_notify_md_bus_event_req_t;
+
+typedef struct _ufpm_activate_md_func_req {
+    LOCAL_PARA_HDR
+    kal_uint8 mode;
+    kal_uint8 address;                                          // USB address
+    kal_uint8 configuration;                                    // USB configuraton number
+    kal_uint8 speed;                                            // USB 2.0/3.0
+    ufpm_usb_mapping_t ap_usb_map[UFPM_USB_MAP_MAX_SIZE];       // AP released IF/EP
+    tethering_activate_meta_info_t tethering_meta_info;         // tethering meta data
+    logging_activate_meta_info_t logging_meta_info;             // logging meta data
+} ufpm_activate_md_func_req_t;
+
+typedef struct _ufpm_enable_md_func_req {
+    LOCAL_PARA_HDR
+    kal_uint8 mode;
+    kal_uint8 version;
+    kal_uint8 reserved[2];
+    ufpm_mpu_info_t mpuInfo;
+} ufpm_enable_md_func_req_t;
+
+typedef struct _ufpm_send_md_ep0_msg {
+    LOCAL_PARA_HDR
+    kal_uint8 mode;
+    kal_uint8 reserved[3];
+    kal_uint8 pBuffer[1024]; //hifusb_setup_packet_t packet;
+} ufpm_send_md_ep0_msg_t;
+
+typedef struct _ufpm_enable_md_func_rsp {
+    LOCAL_PARA_HDR
+    kal_uint8 mode;
+    kal_uint8 result; // bool
+    kal_uint8 version;
+    kal_uint8 reserved;
+} ufpm_enable_md_func_rsp_t;
+
+typedef struct _ufpm_deactivate_md_func_rsp {
+    LOCAL_PARA_HDR
+    kal_uint8 mode;
+    kal_uint8 result; // bool
+    kal_uint8 reserved[2];
+    tethering_deactivate_meta_info_t tethering_meta_info;
+    logging_deactivate_meta_info_t logging_meta_info;
+} ufpm_deactivate_md_func_rsp_t;
+
+typedef struct _ufpm_t {
+    // USB properties
+    ufpm_usb_property_t ufpm_usb_property[UFPM_FUNC_MODE_MAX_NUM];
+
+    // FSM for USB data path
+    ufpm_usb_state_e ufpm_usb_sm;
+
+    // USB bus state
+    ufpm_bus_state_e ufpm_bus_state;
+
+    // MPU information
+    ufpm_mpu_info_t ufpm_mpu_info;
+
+    // USB EP cache table for mapping speed-up. ufpm_ep_mapping_cache_tlb[0][i] for EP IN, ufpm_ep_mapping_cache_tlb[1][i] for EP OUT
+    kal_uint8 ufpm_ep_mapping_cache_tlb[2][UFPM_USB_MAP_MAX_SIZE];
+
+    // L4C MSG flag
+    kal_bool is_l4c_msg;
+
+    // L4C MSG source ID
+    kal_uint8 l4c_src_id;
+
+} ufpm_t;
+
+/**************************************
+ * L4C and UFPM Structure
+ **************************************/
+typedef struct _l4c_ufpm_activate_md_fast_path_req {
+    LOCAL_PARA_HDR
+    kal_uint8 mode;
+    kal_uint8 src_id; // l4c source ID
+    kal_uint8 reserved[2];
+} l4c_ufpm_activate_md_fast_path_req_struct;
+
+typedef struct _l4c_ufpm_enable_md_fast_path_req {
+    LOCAL_PARA_HDR
+    kal_uint8 mode;
+    kal_uint8 src_id; // l4c source ID
+    kal_uint8 reserved[2];
+} l4c_ufpm_enable_md_fast_path_req_struct;
+
+typedef struct _l4c_ufpm_deactivate_md_fast_path_req {
+    LOCAL_PARA_HDR
+    kal_uint8 mode;
+    kal_uint8 src_id; // l4c source ID
+    kal_uint8 reserved[2];
+} l4c_ufpm_deactivate_md_fast_path_req_struct;
+
+typedef struct _l4c_ufpm_disable_md_fast_path_req {
+    LOCAL_PARA_HDR
+    kal_uint8 mode;
+    kal_uint8 src_id; // l4c source ID
+    kal_uint8 reserved[2];
+} l4c_ufpm_disable_md_fast_path_req_struct;
+
+typedef struct _l4c_ufpm_deactivate_md_fast_path_cnf{
+    LOCAL_PARA_HDR
+    kal_uint8 mode;
+    kal_uint8 result; // bool
+    kal_uint8 src_id; // l4c source ID
+    kal_uint8 reserved[1];
+} l4c_ufpm_deactivate_md_fast_path_cnf_struct;
+
+typedef struct _l4c_ufpm_activate_md_fast_path_cnf{
+    LOCAL_PARA_HDR
+    kal_uint8 mode;
+    kal_uint8 result; // bool
+    kal_uint8 src_id; // l4c source ID
+    kal_uint8 reserved[1];
+} l4c_ufpm_activate_md_fast_path_cnf_struct;
+
+typedef struct _l4c_ufpm_disable_md_fast_path_cnf{
+    LOCAL_PARA_HDR
+    kal_uint8 mode;
+    kal_uint8 result; // bool
+    kal_uint8 src_id; // l4c source ID
+    kal_uint8 reserved[1];
+} l4c_ufpm_disable_md_fast_path_cnf_struct;
+
+typedef struct _l4c_ufpm_enable_md_fast_path_cnf{
+    LOCAL_PARA_HDR
+    kal_uint8 mode;
+    kal_uint8 result; // bool
+    kal_uint8 src_id; // l4c source ID
+    kal_uint8 reserved[1];
+} l4c_ufpm_enable_md_fast_path_cnf_struct;
+
+#endif  // _UFPM_STRUCT_H
+
diff --git a/mcu/interface/middleware/hif/ufpm_usb_struct.h b/mcu/interface/middleware/hif/ufpm_usb_struct.h
new file mode 100644
index 0000000..f0bf6e6
--- /dev/null
+++ b/mcu/interface/middleware/hif/ufpm_usb_struct.h
@@ -0,0 +1,124 @@
+/*!
+ *  @file ufpm_struct.h
+ *  @author Bo-Kai Huang <bo-kai.haung@mediatek.com>
+ *  @version 1.0
+ *  @section LICENSE
+ *
+ *  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).
+ *
+ *  @section DESCRIPTION
+ *  This file provides main definitions of usbcore
+ */
+
+#ifndef _UFPM_USB_STRUCT_H
+#define _UFPM_USB_STRUCT_H
+
+#include "hif_mw_msgid.h"
+#include "kal_public_api.h"
+#include "ipc_msgsvc_msgid.h"
+#include "mw_sap.h"
+#include "ufpm_enum.h"
+
+/**************************************************
+ * Tehtering RNDIS Data Structure
+ **************************************************/
+typedef struct _tethering_net_stats_s {
+    kal_uint64 rx_packets;      // Total packets received
+    kal_uint64 tx_packets;      // Total packets transmitted
+    kal_uint64 rx_errors;       // Bad packets received
+    kal_uint64 tx_errors;       // Packet transmit problems
+    kal_uint64 rx_dropped;      // No space in Linux buffers
+    kal_uint64 tx_dropped;      // No space available in Linux
+    kal_uint64 rx_frame_errors; // Recv'd frame alignment error
+} tethering_net_stats_t;
+
+typedef struct _tethering_activate_meta_info {
+    kal_uint32 init_msg_max_transfer_size;
+    kal_uint32 init_cmplt_max_packets_per_transfer;
+    kal_uint32 init_cmplt_max_transfer_size;
+    kal_uint32 init_cmplt_packet_alignment_factor;
+    kal_uint8 host_mac_addr[6];
+    kal_uint8 reserved1[2];
+    kal_uint8 device_mac_addr[6];
+    kal_uint8 reserved2[2];
+    tethering_net_stats_t net_stats;
+} tethering_activate_meta_info_t;
+
+typedef struct _tethering_deactivate_meta_info_t {
+    tethering_net_stats_t net_stats;
+} tethering_deactivate_meta_info_t;
+
+/**************************************************
+ * Logging ACM Data Structure
+ **************************************************/
+
+typedef struct _logging_activate_meta_info {
+    kal_uint8 reserved1[8];  
+} logging_activate_meta_info_t;
+
+typedef struct _logging_deactivate_meta_info_t {
+    kal_uint8 reserved1[8];
+} logging_deactivate_meta_info_t;
+
+
+/***************************************************
+ * UFPM Function Common Data Structure
+ ***************************************************/
+#if 0 
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+#define EP0_MSG_DATA_BUF_SIZE  1024
+#define EP0_MSG_INTR_BUF_SIZE  64
+typedef struct _ufpm_send_ap_ep0_msg {
+    LOCAL_PARA_HDR
+    kal_uint8 mode;
+    kal_uint8 reserved[3];
+    kal_uint32 ep0_data_len;
+    kal_uint8 ep0Buffer[EP0_MSG_DATA_BUF_SIZE];
+    kal_uint32 int_data_len;
+    kal_uint8 intBuffer[EP0_MSG_INTR_BUF_SIZE];
+} ufpm_send_ap_ep0_msg_t;
+
+typedef struct _ufpm_usb_mapping {
+    kal_uint8 type;
+    kal_uint8 map;
+    kal_uint16 maxPktSize;  // Max packet size of the endpoint
+    kal_uint32 queue_config;    // QMU queue configuration for MD USB driver
+    kal_uint8 fifo_n;
+} ufpm_usb_mapping_t;
+
+#endif  // _UFPM_USB_H
+
diff --git a/mcu/interface/middleware/hif/usbc_custom.h b/mcu/interface/middleware/hif/usbc_custom.h
new file mode 100644
index 0000000..24e9291
--- /dev/null
+++ b/mcu/interface/middleware/hif/usbc_custom.h
@@ -0,0 +1,344 @@
+/*****************************************************************************
+*  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:
+ * ---------
+ *    usbc_custom.h
+ *
+ * Project:
+ * --------
+ *   MOLY
+ *
+ * Description:
+ * ------------
+ *    This file intends for usb customization parameter definition
+ *
+ * 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 _USBC_CUSTOM_H_
+#define _USBC_CUSTOM_H_
+
+#include "usbc_custom_def.h"
+#include "kal_general_types.h"
+
+/*     
+       Sample Diagram to illustrate the combination of USB Dev Param
+
+       USB Dev Param
+             |
+             |-- USB Mode 1 (MSD)
+             |      |
+             |      |-- USB Cfg1
+             |             |
+             |             |-- USB class 1 (MS)
+             |
+             |-- USB Mode 2
+             |     ...
+             |
+             |-- USB Mode 3
+             |      |
+             |      |-- USB Cfg 1
+             |      |      |
+             |      |      |-- USB class 1 (MS)
+             |      |      |         
+             |      |      |-- USB class 2 (ACM2)
+             |      |      |
+             |      |      |-- USB class 3 (RNDIS)
+             |      |
+             |      |-- USB Cfg 2
+             |      |
+             |      |-- USB Cfg 3
+             |
+             |-- USB Mode 4
+             |
+             |-- USB Mode 5
+             ...
+                     
+ */
+
+#define USB_MAX_CLASS_NUM          16
+#define USB_MAX_CFG_NUM            8
+
+
+typedef enum {
+    USB_OS_WIN8 = 0,
+    USB_OS_WIN,  // non-win8 windows
+    USB_OS_LINUX,
+    USB_OS_MAC,
+    USB_OS_OTHERS,
+
+    USB_OS_NUM
+} usb_os_type_e;
+
+typedef enum {
+    USB_CLASS_MS = 0,
+#ifdef __USB_ACM_SUPPORT__
+    USB_CLASS_ACM1,  /* 1T1R, 1 interface */
+    USB_CLASS_ACM2,  /* 2T1R, 2 interface, IAD */
+    USB_CLASS_ACM3,  /* 2T1R, 1 interface */
+#endif
+#ifdef __USB_MBIM_SUPPORT__
+    USB_CLASS_MBIM,
+#endif
+#ifdef __USB_RNDIS_SUPPORT__
+    USB_CLASS_RNDIS,
+#endif
+#ifdef __USB_ECM_SUPPORT__
+    USB_CLASS_ECM,
+#endif
+    USB_CLASS_ADB,
+    USB_CLASS_NUM
+} usb_class_type_e;
+
+typedef enum{
+	USB_CLASS_OWNER_MD = 0,
+	USB_CLASS_OWNER_AP,
+	USB_CLASS_OWNER_NONE,
+	USB_CLASS_OWNER_NUM
+}usb_class_owner_e;
+
+typedef enum{
+    USB_NETWORK_CLASS_RNDIS = 0,
+    USB_NETWORK_CLASS_MBIM,
+    USB_NETWORK_CLASS_ECM,
+    USB_NETWORK_CLASS_MAX
+}usb_network_class_type_e;
+
+// definition for double FIFO enabling of bulk endpoint
+#define USB_CLASS_GET_DATA_IN_FIFO_N(n) (n & 0xf)
+#define USB_CLASS_GET_DATA_OUT_FIFO_N(n) ((n & 0xf0) >> 4)
+
+#define USB_MODE_MORPHING_CFG1	1
+#define USB_MODE_MORPHING_CFG2	2
+
+typedef struct {
+    kal_uint32             class_num;
+    usb_class_type_e       class_type[USB_MAX_CLASS_NUM];
+    /* device mapping for each function. ex. ACM->port, RNDIS/MBIM->network interface id */
+    void                   *class_ctxt[USB_MAX_CLASS_NUM];
+
+    /* The 8-bit is used to describe the num of Bulk FIFO, [0...3]IN, [4..7]OUT. */
+    kal_uint8              bulk_fifo_n[USB_MAX_CLASS_NUM];
+	/*usb port ownership, 0 for modem, 1 for AP, ...*/
+	usb_class_owner_e      class_owner[USB_MAX_CLASS_NUM];
+} usb_cfg_param_t;
+
+typedef struct {
+    kal_uint16             vendor_id;          /* idVendor */
+    kal_uint16             product_id;         /* idProduct */
+    kal_uint8              device_class;       /* bDeviceClass */
+    kal_uint8              device_sub_class;   /* bDeviceSubClass */
+    kal_uint8              device_protocol;    /* bDeviceProtocol */
+    kal_uint8              cfg_num;
+    usb_cfg_param_t        cfg_param[USB_MAX_CFG_NUM];
+    usb_mode_owner_e       mode_owner;
+    kal_uint32             mode_index;
+} usb_mode_param_t;
+
+/* custom parameter for usb device */
+typedef struct {
+    kal_uint16             bcd_device;         /* bcdDevice */
+    kal_uint16             *manufacture_string;
+    kal_uint8              manufacture_string_size;
+    kal_uint16             *product_string;
+    kal_uint8              product_string_size;
+    kal_uint16             *serial_number;
+    kal_uint8              serial_number_size;
+    kal_uint8              morphing_sub_id;
+    usb_mode_param_t       mode_param[USB_MODE_MAX];
+    /* USB Mode which each USB OS corresponds to */
+    usb_mode_e             usb_mode[USB_OS_NUM];
+} usb_dev_param_t;
+
+typedef struct {
+    usb_class_type_e class_type;
+    kal_uint32 uart_port;
+    kal_uint32 bulk_fifo_n;
+    usb_class_owner_e  class_owner;
+} usb_current_cfg_param_t;
+
+/* custom parameter for each class type */
+typedef struct
+{
+    kal_uint16             *interface_string;
+    kal_uint8              interface_string_size;
+} usb_class_acm1_param_t;
+
+typedef struct
+{
+    kal_uint16             *comm_interface_string;
+    kal_uint8              comm_interface_string_size;
+    kal_uint16             *data_interface_string;
+    kal_uint8              data_interface_string_size;
+    kal_uint16             *iad_string;
+    kal_uint8              iad_string_size;
+} usb_class_acm2_param_t;
+
+typedef struct
+{
+    kal_uint16             *interface_string;
+    kal_uint8              interface_string_size;
+} usb_class_acm3_param_t;
+
+typedef struct
+{
+    kal_uint16             *comm_interface_string;
+    kal_uint8              comm_interface_string_size;
+    kal_uint16             *null_data_interface_string;
+    kal_uint8              null_data_interface_string_size;
+    kal_uint16             *data_interface_string;
+    kal_uint8              data_interface_string_size;
+    kal_uint16             *iad_string;
+    kal_uint8              iad_string_size;
+} usb_class_mbim_param_t;
+
+typedef struct
+{
+    kal_uint16             *comm_interface_string;
+    kal_uint8              comm_interface_string_size;
+    kal_uint16             *data_interface_string;
+    kal_uint8              data_interface_string_size;
+    kal_uint16             *iad_string;
+    kal_uint8              iad_string_size;
+} usb_class_rndis_param_t;
+
+typedef struct
+{
+    kal_uint16             *comm_interface_string;
+    kal_uint8              comm_interface_string_size;
+    kal_uint16             *null_data_interface_string;
+    kal_uint8              null_data_interface_string_size;    
+    kal_uint16             *data_interface_string;
+    kal_uint8              data_interface_string_size;
+    kal_uint16             *iad_string;
+    kal_uint8              iad_string_size;
+    kal_uint16             *mac_addr_string[3];// max is 3
+    kal_uint8              mac_addr_string_size[3];// max is 3
+} usb_class_ecm_param_t;
+
+typedef struct
+{
+    kal_uint16             *interface_string;
+    kal_uint8              interface_string_size;
+} usb_class_adb_param_t;
+
+typedef struct
+{
+    kal_uint16             *interface_string;
+    kal_uint8              interface_string_size;
+} usb_class_ms_param_t;
+
+#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 !*/
+#endif
+
+/* get parameter function pointer */
+typedef const usb_dev_param_t*           (*usb_get_device_param_f)(void);
+
+#if 0
+/* under construction !*/
+#endif
+typedef const usb_class_ms_param_t*     (*usb_get_ms_param_f)(void);
+
+typedef const usb_class_acm1_param_t*    (*usb_get_acm1_param_f)(void);
+typedef const usb_class_acm2_param_t*    (*usb_get_acm2_param_f)(void);
+typedef const usb_class_acm3_param_t*    (*usb_get_acm3_param_f)(void);
+typedef const usb_class_mbim_param_t*    (*usb_get_mbim_param_f)(void);
+typedef const usb_class_rndis_param_t*   (*usb_get_rndis_param_f)(void);
+typedef const usb_class_ecm_param_t*     (*usb_get_ecm_param_f)(void);
+typedef const usb_class_adb_param_t*     (*usb_get_adb_param_f)(void);
+
+/* get parameter functions*/
+typedef struct 
+{
+    usb_get_device_param_f       get_device_param_func;
+    usb_get_ms_param_f           get_ms_param_func;
+    usb_get_acm1_param_f         get_acm1_param_func;
+    usb_get_acm2_param_f         get_acm2_param_func;
+    usb_get_acm3_param_f         get_acm3_param_func;
+    usb_get_mbim_param_f         get_mbim_param_func;
+    usb_get_rndis_param_f        get_rndis_param_func;
+    usb_get_ecm_param_f          get_ecm_param_func;    
+    usb_get_adb_param_f          get_adb_param_func;
+} usb_custom_func_t;
+
+
+extern const usb_custom_func_t* usb_get_custom_func(void);
+void usb_register_mode_param(usb_mode_param_t *mode_param);
+void usb_replace_mode_param(usb_mode_param_t *mode_param, kal_uint8 index);
+void usb_mode_qeznk_register();
+void usb_mode_inusj_register();
+void usb_mode_ufpm_register();
+void usb_mode_base_register();
+void usb_mode_customization_register();
+void usb_mode_replace_metadbg_mode(kal_uint8 index);
+void usb_mode_factory_register();
+kal_uint16 usb_get_factory_mode_pid();
+kal_bool usb_get_factory_mode_support();
+usb_network_class_type_e usbc_get_network_type();
+
+
+#endif /* _USBC_CUSTOM_H_ */
+
diff --git a/mcu/interface/middleware/hif/usbosd.h b/mcu/interface/middleware/hif/usbosd.h
new file mode 100644
index 0000000..39b98bf
--- /dev/null
+++ b/mcu/interface/middleware/hif/usbosd.h
@@ -0,0 +1,66 @@
+/*!
+ *  @file usbosd.h
+ *  @author Quentin Li <quentin.li@mediatek.com>
+ *  @version 1.0
+ *  @section LICENSE
+ *
+ *  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).
+ *
+ *  @section DESCRIPTION
+ *  This file provides definitions of osd API
+ */
+
+#ifndef _USBOSD_H
+#define _USBOSD_H
+
+#define VENDOR_CODE_1	0x66
+#define VENDOR_CODE_2	0x99
+
+enum {
+	OSD_UNKNOWN = 0,	// Unknown OS, retry OSD until max. retry count
+	OSD_WIN_XP_WO_DRV,	// Win XP OS with host driver
+	OSD_WIN_XP_W_DRV,	// Win XP OS without host driver
+	OSD_WIN_VISTA,		// Win Vista OS
+	OSD_WIN_7,			// Win 7 OS
+	OSD_WIN_8,			// Win 8/8.1 OS
+	OSD_LINUX,			// Linux OS
+	OSD_MAC,			// Mac OS
+};
+
+kal_uint32 get_host_os_type(void);
+
+void osd_retry_require_check(void);
+
+void update_host_os_type(kal_uint32 new_os_type);
+
+kal_bool osd_setup(void);
+
+#endif  // _USBIDLE_MAIN_H