[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/middleware/hif/interface/cdcecm_data_path_trace_utmd.json b/mcu/middleware/hif/interface/cdcecm_data_path_trace_utmd.json
new file mode 100644
index 0000000..2348404
--- /dev/null
+++ b/mcu/middleware/hif/interface/cdcecm_data_path_trace_utmd.json
@@ -0,0 +1,106 @@
+{
+  "legacyParameters": {
+    "codeSection": "TCMFORCE", 
+    "l2BufferSetting": "L2_BUFFER_HIF", 
+    "l2MaxArg": 7, 
+    "modemType": "Generic"
+  }, 
+  "module": "CDCECM_L2", 
+  "stringTranslationDefs": [], 
+  "startGen": "Legacy",
+  "endGen": "Legacy",
+  "traceClassDefs": [
+    {
+      "ECM_L": {
+        "debugLevel": "Low", 
+        "filterDefaultValue": "ON", 
+        "tag": [
+          "Baseline"
+        ], 
+        "traceType": "InternalDesign"
+      }
+    }, 
+    {
+      "ECM_M": {
+        "debugLevel": "Medium", 
+        "filterDefaultValue": "ON", 
+        "tag": [
+          "Baseline"
+        ], 
+        "traceType": "InternalDesign"
+      }
+    }, 
+    {
+      "ECM_H": {
+        "debugLevel": "High", 
+        "filterDefaultValue": "ON", 
+        "tag": [
+          "Baseline"
+        ], 
+        "traceType": "InternalDesign"
+      }
+    }, 
+    {
+      "ECM_UH": {
+        "debugLevel": "Ultra-High", 
+        "filterDefaultValue": "ON", 
+        "tag": [
+          "Baseline"
+        ], 
+        "traceType": "DesignInfo"
+      }
+    }
+  ], 
+  "traceDefs": [
+    {
+      "CDCECM_BUF_DOWNLINK": {
+        "format": "[ECM] cdcecm_buf_downlink(): queue_no(%d), payload(%xl), payload_len(%d)", 
+        "traceClass": "ECM_M"
+      }
+    }, 
+    {
+      "CDCECM_BUF_DL_MSG_INFO": {
+        "format": "[ECM] cdcecm_buf_downlink(): td_drb_idx(%d), payload_drb_idx(%d), payload_prb(%xl), payload_len(%d)", 
+        "traceClass": "ECM_M"
+      }
+    }, 
+    {
+      "CDCECM_RB_DOWNLINK": {
+        "format": "[ECM] cdcecm_rb_downlink(): queue_no(%d), did(%xl), pkt_num(%d), seg_num(%d), state(%d), is_usb_suspend(%d)", 
+        "traceClass": "ECM_M"
+      }
+    }, 
+    {
+      "CDCECM_RB_DL_ENUMERATION": {
+        "format": "[ECM] cdcecm_rb_downlink(): dl enumeration: i(%d), did(%xl), curr_sit(%xl), hif_type(%d), handled_seg_cnt(%d), seg_num(%d), total_len(%d)", 
+        "traceClass": "ECM_M"
+      }
+    }, 
+    {
+      "CDCECM_RB_DL_PACKET": {
+        "format": "[ECM] cdcecm_rb_downlink(): dl packet: i(%d), data_addr(%xl), data_len(%ul)", 
+        "traceClass": "ECM_M"
+      }
+    }, 
+    {
+      "CDCECM_RB_PWR_FILTER_NUM": {
+        "format": "[ECM] cdcecm_rb_downlink(): power management pattern filter check: filter_idx(%d)", 
+        "traceClass": "ECM_M"
+      }
+    }, 
+    {
+      "CDCECM_RB_PWR_FILTER_DROP": {
+        "format": "[ECM] cdcecm_rb_downlink(): power management pattern filter drop: xmit_frames(%d)", 
+        "traceClass": "ECM_M"
+      }
+    }, 
+    {
+      "CDCECM_RB_BULK_OUT_COMPLT": {
+        "format": "[ECM] cdcecm_rb_bulk_out_complete(): ul enumeration: curr_idx(%d), ul_meta(%xl), qtype(%d), net_type(%d), next_idx(%d), end_of_list(%d)", 
+        "traceClass": "ECM_M"
+      }
+    }
+  ], 
+  "traceFamily": "L2", 
+  "userModule": "MOD_ECM"
+}
\ No newline at end of file
diff --git a/mcu/middleware/hif/interface/dhcp4c_common.h b/mcu/middleware/hif/interface/dhcp4c_common.h
new file mode 100644
index 0000000..d7d132c
--- /dev/null
+++ b/mcu/middleware/hif/interface/dhcp4c_common.h
@@ -0,0 +1,58 @@
+/*!
+ *  @file dhcp4c_common.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 dhcp4c ( DHCPv4 Client )
+ */
+
+#ifndef _DHCP4C_COMMON_H
+#define _DHCP4C_COMMON_H
+
+
+/*!
+ *  @brief  dhcp4c init function
+ */
+void dhcp4c_init(void);
+
+
+/*!
+ *  @brief  dhcp4c main function
+ */
+void dhcp4c_main(ilm_struct* ilm);
+
+
+#endif  // _DHCP4C_COMMON_H
+
diff --git a/mcu/middleware/hif/interface/dpfm_data_path_trace_utmd.json b/mcu/middleware/hif/interface/dpfm_data_path_trace_utmd.json
new file mode 100644
index 0000000..9c61dfc
--- /dev/null
+++ b/mcu/middleware/hif/interface/dpfm_data_path_trace_utmd.json
@@ -0,0 +1,124 @@
+{
+  "legacyParameters": {
+    "codeSection": "TCMFORCE", 
+    "l2BufferSetting": "L2_BUFFER_HIF", 
+    "l2MaxArg": 7, 
+    "modemType": "Generic"
+  }, 
+  "module": "DPFM_L2", 
+  "stringTranslationDefs": [], 
+  "startGen": "Legacy",
+  "endGen": "-",
+  "traceClassDefs": [
+    {
+      "DPFM_L": {
+        "debugLevel": "Low", 
+        "filterDefaultValue": "ON", 
+        "tag": [
+          "Baseline"
+        ], 
+        "traceType": "InternalDesign"
+      }
+    }, 
+    {
+      "DPFM_M": {
+        "debugLevel": "Medium", 
+        "filterDefaultValue": "ON", 
+        "tag": [
+          "Baseline"
+        ], 
+        "traceType": "InternalDesign"
+      }
+    }, 
+    {
+      "DPFM_H": {
+        "debugLevel": "High", 
+        "filterDefaultValue": "ON", 
+        "tag": [
+          "Baseline"
+        ], 
+        "traceType": "InternalDesign"
+      }
+    }, 
+    {
+      "DPFM_UH": {
+        "debugLevel": "Ultra-High", 
+        "filterDefaultValue": "ON", 
+        "tag": [
+          "Baseline"
+        ], 
+        "traceType": "DesignInfo"
+      }
+    }
+  ], 
+  "traceDefs": [
+    {
+      "DPFM_START_FILTER_EXPIRED_TIMER": {
+        "format": "[DPFM] dpfm_start_filter_expired_timer(): Start filter expired timer, current_tick(%xl), elapse_time(%xl)", 
+        "traceClass": "DPFM_L"
+      }
+    }, 
+    {
+      "DPFM_CHECK_FILTER_VALID": {
+        "format": "[DPFM] dpfm_check_filter_valid_period(): Timer expired! Remaining filter number[%xl], expired filter number[%xl], timeout filter number[%xl]", 
+        "traceClass": "DPFM_H"
+      }
+    }, 
+    {
+      "DPFM_START_TRACK_TABLE_EXPIRED_TIMER": {
+        "format": "[DPFM] dpfm_start_track_table_expired_timer(): Start track table expired timer, current_tick(%xl), elapse_time(%xl)", 
+        "traceClass": "DPFM_L"
+      }
+    }, 
+    {
+      "DPFM_SET_GLOBAL_ALERT": {
+        "format": "[DPFM] dpfm_set_global_alert_value(): Set global alert value[%xl %xl]", 
+        "traceClass": "DPFM_UH"
+      }
+    }, 
+    {
+      "DPFM_SET_IQUOTA_LIMIT": {
+        "format": "[DPFM] dpfm_set_iquota_value(): Set limit iquota dpfm_netif_id[%d], value[%xl %xl]", 
+        "traceClass": "DPFM_UH"
+      }
+    }, 
+    {
+      "DPFM_DEL_IQUOTA_LIMIT": {
+        "format": "[DPFM] dpfm_del_iquota_value(): Del limit iquota dpfm_netif_id[%d]", 
+        "traceClass": "DPFM_UH"
+      }
+    }, 
+    {
+      "DPFM_ALERT_GLOBAL_ALERT": {
+        "format": "[DPFM] dpfm_update_global_alert_data_usage(): Send global alert to AP, remaining value[%xl %xl]", 
+        "traceClass": "DPFM_M"
+      }
+    }, 
+    {
+      "DPFM_ALERT_IQUOTA_LIMIT": {
+        "format": "[DPFM] dpfm_update_iquota_data_usage_of_netif(): dpfm_netif_id[%d] reaches iquota limit", 
+        "traceClass": "DPFM_UH"
+      }
+    }, 
+    {
+      "DPFM_DO_DL_FILTER_INVALID_MATCH_FILTER": {
+        "format": "[DPFM] dpfm_check_route_by_dl_filter(): matched_filter is NULL!! No need to do filter", 
+        "traceClass": "DPFM_H"
+      }
+    }, 
+    {
+      "DPFM_CHECK_ROUTE_RESULT_META": {
+        "format": "[DPFM] dpfm_check_route(): Check route with meta, result[%d], uplink[%d], match_result[%d], match_index[%d], filter_id[%d], out_netif_id[%xl]", 
+        "traceClass": "DPFM_H"
+      }
+    }, 
+    {
+      "DPFM_CHECK_ROUTE_RESULT_DID": {
+        "format": "[DPFM] dpfm_check_route(): Check route with DID, result[%d], uplink[%d], filter_id[%d], out_netif_id[%xl]", 
+        "traceClass": "DPFM_H"
+      }
+    }
+  ], 
+  "traceFamily": "L2", 
+  "userModule": "MOD_DPFM"
+}
\ No newline at end of file
diff --git a/mcu/middleware/hif/interface/ethercore_common.h b/mcu/middleware/hif/interface/ethercore_common.h
new file mode 100644
index 0000000..572c766
--- /dev/null
+++ b/mcu/middleware/hif/interface/ethercore_common.h
@@ -0,0 +1,259 @@
+/*!
+ *  @file ethercore_common.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 common definitions of ethercore
+ */
+
+#ifndef _ETHERCORE_COMMON_H
+#define _ETHERCORE_COMMON_H
+
+#include "kal_public_api.h"
+#include "ethercore_struct.h"
+#include "lhif_if.h"
+
+#if !defined(__MTK_TARGET__) && defined(_MSC_VER) && (_MSC_VER >= 1500)
+#pragma warning( disable : 4214 )
+#endif
+
+#define ETHC_ETHER_TYPE_IP          0x0800
+#define ETHC_ETHER_TYPE_ARP         0x0806
+#define ETHC_ETHER_TYPE_VLAN        0x8100
+#define ETHC_ETHER_TYPE_IPV6        0x86dd
+
+#define ETHC_SWAP16(_x)             ((_x & 0xff00) >> 8 | (_x & 0x00ff) << 8)
+#define ETHC_SWAP32(_x)             ((_x & 0xff000000) >> 24 |  \
+                                     (_x & 0x00ff0000) >> 8  |  \
+                                     (_x & 0x0000ff00) << 8  |  \
+                                     (_x & 0x000000ff) << 24)
+
+#define ETHC_HTONS(_x)              ETHC_SWAP16(_x)
+#define ETHC_HTONL(_x)              ETHC_SWAP32(_x)
+#define ETHC_NTOHS(_x)              ETHC_SWAP16(_x)
+#define ETHC_NTOHL(_x)              ETHC_SWAP32(_x)
+
+#define ETHC_ETHER_ADDR_SIZE        6
+
+typedef kal_uint8 ethc_mac_addr_t[ETHC_ETHER_ADDR_SIZE];
+
+
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _ethc_ether_header {
+    ethc_mac_addr_t dst_mac;
+    ethc_mac_addr_t src_mac;
+    kal_uint16      ether_type;
+} ethc_ether_header_t;
+PRAGMA_END_PACK_STRUCT
+
+
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _ethc_vlan_tag {
+    kal_uint16      tpid;               /* Tag Protocol Identifier */
+    struct ethc_tci {   /* Tag Control Identifier */
+        kal_uint16  pcp:3;              /* Priority Code Point */
+        kal_uint16  cfi:1;              /* Canonical Format Indicator */
+        kal_uint16  vid:12;             /* VLAN Identifier */
+    } tci;
+} ethc_vlan_tag_t;
+PRAGMA_END_PACK_STRUCT
+
+
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _ethc_vlan_ether_header {
+    ethc_mac_addr_t dst_mac;
+    ethc_mac_addr_t src_mac;
+    ethc_vlan_tag_t vlan_tag;
+    kal_uint16      ether_type;
+} ethc_vlan_ether_header_t;
+PRAGMA_END_PACK_STRUCT
+
+
+#define ETHC_ARP_HRD_ETHERNET           1
+#define ETHC_ARP_HRD_IEEE802            6
+#define ETHC_ARP_HRD_ARCNET             7
+#define ETHC_ARP_HRD_FRAMERELAY         15
+#define ETHC_ARP_HRD_ATM                16
+#define ETHC_ARP_HRD_HDLC               17
+#define ETHC_ARP_HRD_FIBRE_CHANNEL      18
+#define ETHC_ARP_HRD_SERIAL_LINE        20
+
+#define ETHC_ARP_PRO_IPV4               0x0800
+#define ETHC_ARP_HLN_IEEE802_MAC        6
+#define ETHC_ARP_PLN_IPV4               4
+
+#define ETHC_ARP_OP_ARP_REQUEST         1
+#define ETHC_ARP_OP_ARP_REPLY           2
+#define ETHC_ARP_OP_ARP_RARP_REQUEST    3
+#define ETHC_ARP_OP_ARP_RARP_REPLY      4
+#define ETHC_ARP_OP_ARP_DRARP_REQUEST   5
+#define ETHC_ARP_OP_ARP_DRARP_REPLY     6
+#define ETHC_ARP_OP_ARP_DRARP_ERROR     7
+#define ETHC_ARP_OP_ARP_INARP_REQUEST   8
+#define ETHC_ARP_OP_ARP_INARP_REPLY     9
+
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _ethc_arp_packet {
+    kal_uint16      arp_hrd;        /* hardware type */
+    kal_uint16      arp_pro;        /* protocol type */
+    kal_uint8       arp_hln;        /* hardware address length */
+    kal_uint8       arp_pln;        /* protocol address length */
+    kal_uint16      arp_op;         /* opcode */
+    ethc_mac_addr_t arp_sha;        /* sender hardware address */
+    kal_uint8       arp_spa[4];     /* sender protocol address */
+    ethc_mac_addr_t arp_tha;        /* target hardware address */
+    kal_uint8       arp_tpa[4];     /* target protocol address */
+} ethc_arp_packet_t;
+PRAGMA_END_PACK_STRUCT
+
+
+/*!
+ *  @brief ethc_device_instance_t describe register information of a
+ *         generic ether device
+ */
+typedef struct _ethc_device_info {
+    /*!
+     *  @brief module id used to send ilm
+     */
+    module_type module_id;
+
+    /*!
+     *  @brief context to be passed in context function
+     */
+    void       *context;
+
+    /*!
+     *  @brief index the identify which network interface it is.
+     */
+    kal_uint32  netif_id;
+
+    /*!
+     *  @brief callback function to reload uplink buffers
+     *         Running Level: TASK
+     */
+    kal_bool    (*ul_reload)(void *context);
+
+    /*!
+     *  @brief callback function to submit io request to ether device
+     *         Running Level: TASK
+     */
+    void    (*tx_submit)(ethc_device_instance_t* instance, hif_io_request_t* ior);
+
+    /*!
+     *  @brief callback function to submit DID to ether device
+     *         Running Level: TASK
+     */
+    kal_bool (*rb_tx_submit)(ethc_device_instance_t *instance, void *did, kal_uint8 *ethc_drb_fh_idx, kal_uint32 *ethc_drb_fh_len);
+
+    /*!
+     *  @brief callback function to submit buffer to ether device
+     *         Running Level: TASK
+     */
+    kal_bool (*buf_tx_submit)(ethc_device_instance_t *instance, void *buf, kal_uint16 buf_len);
+
+    /*!
+     *  @used for SPD
+     */
+    kal_uint8                       tx_header_offset;//SPD use
+    kal_uint8                       tx_header_padding_align;//SPD use
+} ethc_device_info_t;
+
+
+/*!
+ *  @brief  attach new ether device to ethercore
+ *          Running Level: HISR/TASK
+ *  @param  device_info ether device information used to register
+ *  @return new instance of ether device if success, NULL if fail
+ */
+ethc_device_instance_t* ethc_device_attach(ethc_device_info_t* device_info);
+
+
+/*!
+ *  @brief  detach ether device from ethecore
+ *          Running Level: HISR/TASK
+ *  @param  instance  device instance obtained while attach 
+ */
+void ethc_device_detach(ethc_device_instance_t* instance);
+
+
+/*!
+ *  @brief  indicate received io request to ethecore
+ *          Running Level: TASK
+ *  @param  instance  device instance obtained while attach
+ *  @param  ior io request list to be indicated
+ */
+void ethc_device_rx_complete(ethc_device_instance_t* instance, hif_io_request_t* ior);
+
+
+/*!
+ *  @brief  indicate received ring-buffer data to ethecore
+ *          Running Level: TASK
+ *  @param  instance  device instance obtained while attach
+ *  @param  index  entry index
+ *  @param  queue_no  queue number of usb
+ *  @param  header_len  total header length
+ *  @param  net_type  LHIF network type
+ *  @param  pkt_cnt  total packet count
+ *  @param  byte_cnt  total byte count
+ *  @param  drop_pkt_cnt  total dropped packet count
+ *  @param  is_packet_handled  whether the packet has been handled
+ */
+void ethc_rb_rx_complete(ethc_device_instance_t* instance, kal_uint32 index, kal_uint8 queue_no, kal_uint32* header_len, LHIF_NET_TYPE* net_type, kal_uint32* pkt_cnt, kal_uint32* byte_cnt, kal_uint32* drop_pkt_cnt, kal_bool* is_packet_handled, kal_uint32* cjq_len);
+
+
+/*!
+ *  @brief  indicate the underlying device needs to reload UL buffers
+ *          Running Level: TASK
+ *  @param  instance  device instance obtained while attach
+ */
+void ethc_device_rx_need_reload(ethc_device_instance_t* instance);
+
+
+/*!
+ *  @brief  notify ethercore to handle packets if needed
+ *          Running Level: TASK
+ *  @param  instance  device instance obtained while attach
+ */
+void ethc_send_handle_packet_req(ethc_device_instance_t* instance);
+
+void ethc_get_host_mac(kal_uint32 netid_if, kal_uint8* mac_addr);
+
+extern void *ethc_vir_dev_attach(kal_uint32 id);
+extern int   ethc_vir_dev_detach(void);
+extern void *ethc_multiple_vir_dev_attach(kal_uint32 id);
+extern int ethc_multiple_vir_dev_detach(void);
+
+#endif  // _ETHERCORE_COMMON_H
+
diff --git a/mcu/middleware/hif/interface/ethercore_data_path_trace_utmd.json b/mcu/middleware/hif/interface/ethercore_data_path_trace_utmd.json
new file mode 100644
index 0000000..f299103
--- /dev/null
+++ b/mcu/middleware/hif/interface/ethercore_data_path_trace_utmd.json
@@ -0,0 +1,263 @@
+{
+  "legacyParameters": {
+    "codeSection": "TCMFORCE", 
+    "l2BufferSetting": "L2_BUFFER_HIF", 
+    "l2MaxArg": 7, 
+    "modemType": "Generic"
+  }, 
+  "module": "ETHERCORE_L2", 
+  "stringTranslationDefs": [], 
+  "startGen": "Legacy",
+  "endGen": "-",
+  "traceClassDefs": [
+    {
+      "ETHC_L": {
+        "debugLevel": "Low", 
+        "filterDefaultValue": "ON", 
+        "tag": [
+          "Baseline", 
+          "Sensitive"
+        ], 
+        "traceType": "InternalDesign"
+      }
+    }, 
+    {
+      "ETHC_M": {
+        "debugLevel": "Medium", 
+        "filterDefaultValue": "ON", 
+        "tag": [
+          "Baseline"
+        ], 
+        "traceType": "InternalDesign"
+      }
+    }, 
+    {
+      "ETHC_H": {
+        "debugLevel": "High", 
+        "filterDefaultValue": "ON", 
+        "tag": [
+          "Baseline"
+        ], 
+        "traceType": "InternalDesign"
+      }
+    }, 
+    {
+      "ETHC_UH": {
+        "debugLevel": "Ultra-High", 
+        "filterDefaultValue": "ON", 
+        "tag": [
+          "Baseline"
+        ], 
+        "traceType": "DesignInfo"
+      }
+    }
+  ], 
+  "traceDefs": [
+    {
+      "ETHC_HANDLE_ARP": {
+        "format": "[ETHERCORE] handle_arp_packet(): hrd(%d), pro(%ul), hln(%ul), pln(%ul), op(%ul)", 
+        "traceClass": "ETHC_H"
+      }
+    }, 
+    {
+      "ETHC_HANDLE_ARP_SHA_NOT_MATCH_NG": {
+        "format": "[ETHERCORE] handle_arp_packet(): eth%d, sha 0-1(%xl) 2-5(%xl) not match", 
+        "traceClass": "ETHC_L"
+      }
+    }, 
+    {
+      "ETHC_HANDLE_ARP_THA_NOT_MATCH_NG": {
+        "format": "[ETHERCORE] handle_arp_packet(): eth%d, tha 0-1(%xl) 2-5(%xl) not match", 
+        "traceClass": "ETHC_L"
+      }
+    }, 
+    {
+      "ETHC_HANDLE_ARP_GRATUITOUS_NG": {
+        "format": "[ETHERCORE] handle_arp_packet(): eth%d, spa(%ul %ul %ul %ul) is gratuitous", 
+        "traceClass": "ETHC_L"
+      }
+    }, 
+    {
+      "ETHC_HANDLE_ARP_ZERO_IP_NG": {
+        "format": "[ETHERCORE] handle_arp_packet(): eth%d, spa(%ul %ul %ul %ul) is zero ip", 
+        "traceClass": "ETHC_L"
+      }
+    }, 
+    {
+      "ETHC_HANDLE_ARP_ALLOC_NET_DL_NG": {
+        "format": "[ETHERCORE] handle_arp_packet(): failed to allocate NET_DL to handle ARP request(%xl), drop it!", 
+        "traceClass": "ETHC_UH"
+      }
+    }, 
+    {
+      "ETHC_HANDLE_ARP_DONE": {
+        "format": "[ETHERCORE] handle_arp_packet(): eth%d, result(%ul), parse_arp_req(%ul), gpd(%xl), tx_gpd(%xl)", 
+        "traceClass": "ETHC_H"
+      }
+    }, 
+    {
+      "ETHC_PROC_RX_GPD": {
+        "format": "[ETHERCORE] [%d] process rx gpd(%xl), result(%l), ether_type(%xl), qos_priority(%l)", 
+        "traceClass": "ETHC_M"
+      }
+    }, 
+    {
+      "ETHC_PROC_RX_GPD_TYPE_IP": {
+        "format": "[ETHERCORE] [%d] process rx gpd(%xl) w/ ipv4, ip_proto_type(%l)", 
+        "traceClass": "ETHC_M"
+      }
+    }, 
+    {
+      "ETHC_PROC_RX_GPD_TYPE_ARP": {
+        "format": "[ETHERCORE] [%d] process rx gpd(%xl) w/ arp", 
+        "traceClass": "ETHC_H"
+      }
+    }, 
+    {
+      "ETHC_PROC_RX_GPD_TYPE_IPV6": {
+        "format": "[ETHERCORE] [%d] process rx gpd(%xl) w/ ipv6, next_header(%l)", 
+        "traceClass": "ETHC_M"
+      }
+    }, 
+    {
+      "ETHC_PROC_RX_GPD_TYPE_UNSUPPORTED": {
+        "format": "[ETHERCORE] [%d] process unsupported rx gpd(%xl)", 
+        "traceClass": "ETHC_H"
+      }
+    }, 
+    {
+      "ETHC_PROC_TX_TYPE_GPD_BD": {
+        "format": "[ETHERCORE] [%d] process_tx_gpd_list(): insert a header bd into tx gpd(%xl)", 
+        "traceClass": "ETHC_M"
+      }
+    }, 
+    {
+      "ETHC_PROC_TX_ALLOC_BD_NG": {
+        "format": "[ETHERCORE] [%d] process_tx_gpd_list(): fail to allocate a header bd, current_gpd(%xl), first_gpd(%xl), last_gpd(%xl)", 
+        "traceClass": "ETHC_UH"
+      }
+    }, 
+    {
+      "ETHC_RB_TX_FREE_ALL_VRB_ENUM": {
+        "format": "[ETHERCORE] ethc_rb_tx_free_all_vrb(): enumerate did_sit list, did(%xl), handled_seg_cnt(%ul), curr_sit(%xl), p_data(%xl), len(%ul)", 
+        "traceClass": "ETHC_H"
+      }
+    }, 
+    {
+      "ETHC_RB_TX_FREE_ALL_VRB_DONE": {
+        "format": "[ETHERCORE] ethc_rb_tx_free_all_vrb(): enumerate done, did(%xl), handled_seg_cnt(%ul)", 
+        "traceClass": "ETHC_H"
+      }
+    }, 
+    {
+      "ETHC_RB_TX_ENCAP_ETHER_HEADER_DONE": {
+        "format": "[ETHERCORE] ethc_rb_encap_ether_header(): ip_packet(%xl), ip_ver(%xl), ether_type_idx(%xl), vlan_enable_idx(%ul), fh_idx(%ul), fh_len(%ul)", 
+        "traceClass": "ETHC_L"
+      }
+    }, 
+    {
+      "ETHC_RB_PROC_TX_PKT": {
+        "format": "[ETHERCORE] ethc_rb_process_tx_pkt(): process TX packet, did(%xl), seg_num(%ul)", 
+        "traceClass": "ETHC_L"
+      }
+    }, 
+    {
+      "ETHC_RB_PROC_TX_PKT_INVALID_DID_FORMAT": {
+        "format": "[ETHERCORE] ethc_rb_process_tx_pkt(): invalid did format, curr_idx(%d), did(%xl)!", 
+        "traceClass": "ETHC_UH"
+      }
+    }, 
+    {
+      "ETHC_RB_PROC_TX_PKT_ENUM": {
+        "format": "[ETHERCORE] ethc_rb_process_tx_pkt(): enumerate did list, curr_idx(%d), sit(%xl), p_data(%xl), len(%xl), pkt_cnt(%ul), byte_cnt(%ul), is_first_gpd(%ul)", 
+        "traceClass": "ETHC_L"
+      }
+    }, 
+    {
+      "ETHC_BUF_ENCAP_ETHER_HEADER_DONE": {
+        "format": "[ETHERCORE] ethc_buf_encap_ether_header(): encap ether header done, type(%ul), out_data(%xl), out_data_len(%ul)", 
+        "traceClass": "ETHC_M"
+      }
+    }, 
+    {
+      "ETHC_RB_IPC_TX_SUBMIT_DONE": {
+        "format": "[ETHERCORE] ethc_rb_ipc_tx_submit(): ethcore tx submit done, ret(%d), did(%xl)", 
+        "traceClass": "ETHC_L"
+      }
+    }, 
+    {
+      "ETHC_RB_IPC_TX_SUBMIT_NOT_LINK_UP": {
+        "format": "[ETHERCORE] ethc_rb_ipc_tx_submit(): device state is not link up, did(%xl)", 
+        "traceClass": "ETHC_H"
+      }
+    }, 
+    {
+      "ETHC_RB_DECAP_ETHER_HEADER": {
+        "format": "[ETHERCORE] ethc_rb_decap_ether_header(): ether_type(%xl), eth_hdr(%xl), prb_addr(%xl), length(%ul)", 
+        "traceClass": "ETHC_L"
+      }
+    }, 
+    {
+      "ETHC_RB_DECAP_ETHER_HEADER_INVALID_VLAN_FORMAT": {
+        "format": "[ETHERCORE] ethc_rb_decap_ether_header(): invalid vlan format, vlan_cfi(%d)", 
+        "traceClass": "ETHC_H"
+      }
+    }, 
+    {
+      "ETHC_RB_DECAP_ETHER_HEADER_2": {
+        "format": "[ETHERCORE] ethc_rb_decap_ether_header(): decap ether header_2, data_addr(%xl), data_len(%ul), remove_len(%ul)", 
+        "traceClass": "ETHC_L"
+      }
+    }, 
+    {
+      "ETHC_RB_PROC_RX_PKT": {
+        "format": "[ETHERCORE] ethc_rb_process_rx_pkt(): result(%d), xit(%xl), ether_type(%xl), qos_priority(%ul)", 
+        "traceClass": "ETHC_L"
+      }
+    }, 
+    {
+      "ETHC_RB_PROC_RX_PKT_TYPE_IP": {
+        "format": "[ETHERCORE] ethc_rb_process_rx_pkt(): ipv4 type, xit(%xl), ip_pro(%ul)", 
+        "traceClass": "ETHC_L"
+      }
+    }, 
+    {
+      "ETHC_RB_PROC_RX_PKT_TYPE_ARP": {
+        "format": "[ETHERCORE] ethc_rb_process_rx_pkt(): arp type, xit(%xl)", 
+        "traceClass": "ETHC_H"
+      }
+    }, 
+    {
+      "ETHC_RB_PROC_RX_PKT_TYPE_IPV6": {
+        "format": "[ETHERCORE] ethc_rb_process_rx_pkt(): ipv6 type, xit(%xl), next_header(%ul)", 
+        "traceClass": "ETHC_L"
+      }
+    }, 
+    {
+      "ETHC_RB_PROC_RX_PKT_ALLOC_GPD_NG": {
+        "format": "[ETHERCORE] ethc_rb_rx_complete(): fail to allocate GPD, drop packet. xit(%xl), ether_type(%xl), qos_priority(%ul)", 
+        "traceClass": "ETHC_H"
+      }
+    }, 
+    {
+      "ETHC_PROC_RX_PKT_TYPE_UNSUPPORTED": {
+        "format": "[ETHERCORE] ethc_rb_process_rx_pkt(): unknown type, xit(%xl)", 
+        "traceClass": "ETHC_H"
+      }
+    }, 
+    {
+      "ETHC_RX_PKT_DROP": {
+        "format": "[ETHERCORE] ethc_rb_rx_complete(): drop packet, eth_id(%d), dev_state(%d), xit(%xl)", 
+        "traceClass": "ETHC_H"
+      }
+    },
+	{
+      "ETHC_FN_TX_SUBMIT_NONE": {
+        "format": "[ETHERCORE] ethc_rb_ipc_tx_submit(): tx_submit callback not register, dev_state(%d), tx_submit=(%xl)", 
+        "traceClass": "ETHC_H"
+      }
+    }
+  ], 
+  "traceFamily": "L2", 
+  "userModule": "MOD_ETHERCORE"
+}
\ No newline at end of file
diff --git a/mcu/middleware/hif/interface/hif_mw_cccidev_trace_utmd.json b/mcu/middleware/hif/interface/hif_mw_cccidev_trace_utmd.json
new file mode 100644
index 0000000..49d4c2c
--- /dev/null
+++ b/mcu/middleware/hif/interface/hif_mw_cccidev_trace_utmd.json
@@ -0,0 +1,204 @@
+{
+  "endGen": "-", 
+  "legacyParameters": {
+    "codeSection": "TCMFORCE", 
+    "l2BufferSetting": "L2_BUFFER_HIF", 
+    "l2MaxArg": 7, 
+    "modemType": "Generic"
+  }, 
+  "module": "HIF_MW_CCCIDEV", 
+  "startGen": "Legacy", 
+  "stringTranslationDefs": [], 
+  "traceClassDefs": [
+    {
+      "DL_UL": { 
+        "debugLevel": "Ultra-Low", 
+        "filterDefaultValue": "ON", 
+        "tag": [
+          "Baseline"
+        ], 
+        "traceType": "DesignInfo"
+      }
+    }, 
+    {
+      "CCMNI_UL": {
+        "debugLevel": "Ultra-Low", 
+        "filterDefaultValue": "ON", 
+        "tag": [
+          "Baseline"
+        ], 
+        "traceType": "DesignInfo"
+      }
+    }, 
+    {
+      "CCMNI_DL_UL": {
+        "debugLevel": "Ultra-Low", 
+        "filterDefaultValue": "ON", 
+        "tag": [
+          "Baseline"
+        ], 
+        "traceType": "DesignInfo"
+      }
+    }, 
+    {
+      "CCMNI_UL_UL": {
+        "debugLevel": "Ultra-Low", 
+        "filterDefaultValue": "ON", 
+        "tag": [
+          "Baseline"
+        ], 
+        "traceType": "DesignInfo"
+      }
+    }, 
+    {
+      "CCMNI_DUMP_UL": {
+        "debugLevel": "Ultra-Low", 
+        "filterDefaultValue": "ON", 
+        "tag": [
+          "Baseline"
+        ], 
+        "traceType": "DesignInfo"
+      }
+    }, 
+    {
+      "CCCITTY_DUMP_H": {
+        "debugLevel": "High", 
+        "filterDefaultValue": "ON", 
+        "tag": [
+          "Baseline"
+        ], 
+        "traceType": "DesignInfo"
+      }
+    }
+  ], 
+  "traceDefs": [
+    {
+      "CCMNI_DATA_DUMP_TRACE": {
+        "format": "[CCMNI DUMP] %b: %10xl %10xl %10xl %10xl", 
+        "traceClass": "CCMNI_DUMP_UL", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "CCMNI_DATA_DUMP_GPD_PTR": {
+        "format": "[CCMNI DL] CCMNI%b: GDP=%xl BD1=%xl BD2=%xl DATA=%xl", 
+        "traceClass": "CCMNI_DUMP_UL", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "CCMNI_DL_DATA_IPv6_PACKET_TRACE": {
+        "format": "[CCMNI DLv6] Protocol:%b GPD=%xl Checksum=%xl Src Addr=%10xl %10xl %10xl %10xl", 
+        "traceClass": "CCMNI_DL_UL", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "CCMNI_UL_DATA_IPv6_PACKET_TRACE": {
+        "format": "[CCMNI ULv6] Protocol:%b GPD=%xl Checksum=%xl Dst Addr=%10xl %10xl %10xl %10xl", 
+        "traceClass": "CCMNI_UL_UL", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "CCMNI_DL_DATA_PACKET_TRACE": {
+        "format": "[CCMNI DL] CCMNI%b: CCCIHDR=%xl SEQ=%xd IPID=%xd checksum=%xd", 
+        "traceClass": "CCMNI_DL_UL", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "CCMNI_DL_DATA_PACKET_NON_IPV4V6_TRACE": {
+        "format": "[CCMNI DL] CCMNI%b: CCCIHDR=%xl SEQ=%xd PAYLOAD=%xl PAYLOAD_LEN=%d", 
+        "traceClass": "CCMNI_DL_UL", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "CCMNI_UL_DATA_PACKET_TRACE": {
+        "format": "[CCMNI UL] CCMNI%b: GPD=%xl IPID=%xd checksum=%xd", 
+        "traceClass": "CCMNI_UL_UL", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "CCMNI_UL_GPD_IN_HIF": {
+        "format": "[CCMNI UL] CCMNI%b: Receive GPD=%d, Need Reload=%d, GPD in HIF=%d, Data_Q=%d, Ack_Q=%d", 
+        "traceClass": "CCMNI_UL_UL", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "CCMNI_UL_RELOAD_RGPD": {
+        "format": "[CCMNI UL_RELOAD] CCMNI%b: Reload RGPD Want=%d, Allocated=%d, in HIF=%d", 
+        "traceClass": "CCMNI_UL_UL", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "CCMNI_UL_RELOAD_RGPD_IN_HIF": {
+        "format": "[CCMNI UL_RELOAD] CCMNI%b: Nor_Q_before=%d, Nor_Q_after=%d, Nor_Q_MAX=%d, Ack_Q_before=%d, Ack_Q_after=%d, Ack_Q_MAX=%d", 
+        "traceClass": "CCMNI_UL_UL", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "CCMNI_MAX_RELOAD_RGPD_IN_HIF": {
+        "format": "[CCMNI MAX RGPD] Data_Q_MAX=%d Ack_Q_MAX=%d, Misc_Q_MAX=%d", 
+        "traceClass": "CCMNI_UL", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "CCMNI_DEVICE_STATUS": {
+        "format": "[CCMNI STATUS] CCMNI%b: event=%b status=%b -> %b", 
+        "traceClass": "CCMNI_UL", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "CCMNI_DL_DATA_FIRST_FAST_CCCI_HDR": {
+        "format": "[CCMNI DL] CCMNI%b: Rem_gpd(%d)", 
+        "traceClass": "CCMNI_UL", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "CCCITTY_DATA_DUMP_TRACE": {
+        "format": "[CCCITTY DUMP] %b: %10xl %10xl %10xl %10xl", 
+        "traceClass": "CCCITTY_DUMP_H", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "CCCIDEV_PROCESS_DL_SPD_TRACE": {
+        "format": "[CCCIDEV DL SPD] pkt_num:%d current_gpd:%xl", 
+        "traceClass": "DL_UL", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "CCCIDEV_PROCESS_DL_SPD_SET_IGR_TRACE": {
+        "format": "[CCCIDEV DL SPD] ignore bit set (%d) in pkt:%d pie:%xl", 
+        "traceClass": "DL_UL", 
+        "traceHighlightOption": "warn"
+      }
+    }, 
+    {
+      "CCCIDEV_SPD_RELAYOUT_SET_PKTNUM_TRACE": {
+        "format": "[CCCIDEV DL SPD] Get pkt_num:%d from pi:%xl and write to spd_ext:%xl", 
+        "traceClass": "DL_UL", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "CCCIDEV_SPD_RELAYOUT_GET_EOL_BREAK_TRACE": {
+        "format": "[CCCIDEV DL SPD] BREAK!!! total pkt_num:%d current pkt_num:%d spd_ph:%xl", 
+        "traceClass": "DL_UL", 
+        "traceHighlightOption": "warn"
+      }
+    }
+  ], 
+  "traceFamily": "L2", 
+  "userModule": "MOD_CCCIDEV"
+}
\ No newline at end of file
diff --git a/mcu/middleware/hif/interface/hif_mw_data_path_ipcore_trace_utmd.json b/mcu/middleware/hif/interface/hif_mw_data_path_ipcore_trace_utmd.json
new file mode 100755
index 0000000..d46d555
--- /dev/null
+++ b/mcu/middleware/hif/interface/hif_mw_data_path_ipcore_trace_utmd.json
@@ -0,0 +1,907 @@
+{
+  "legacyParameters": {
+    "codeSection": "TCMFORCE",
+    "l2BufferSetting": "L2_BUFFER_HIF",
+    "l2MaxArg": 7,
+    "modemType": "Generic"
+  },
+  "module": "HIF_MW_IPCORE",
+  "startGen": "Legacy",
+  "endGen": "-",
+  "stringTranslationDefs": [
+    {
+      "IPC_IP_TYPE": [
+        "IPC_IP_TYPE_MIXED",
+        "IPC_IP_TYPE_IPV4",
+        "IPC_IP_TYPE_IPV6"
+      ]
+    }
+  ],
+  "traceClassDefs": [
+    {
+      "UL_UH": {
+        "debugLevel": "Ultra-High",
+        "filterDefaultValue": "ON",
+        "tag": [
+          "Baseline"
+        ],
+        "traceType": "CoreDesign"
+      }
+    },
+    {
+      "DL_UH": {
+        "debugLevel": "Ultra-High",
+        "filterDefaultValue": "ON",
+        "tag": [
+          "Baseline"
+        ],
+        "traceType": "CoreDesign"
+      }
+    },
+    {
+      "GE_UH": {
+        "debugLevel": "Ultra-High",
+        "filterDefaultValue": "ON",
+        "tag": [
+          "Baseline"
+        ],
+        "traceType": "DesignInfo"
+      }
+    },
+    {
+      "UL_DETAIL_H": {
+        "debugLevel": "High",
+        "filterDefaultValue": "ON",
+        "tag": [
+          "Baseline"
+        ],
+        "traceType": "CoreDesign"
+      }
+    },
+    {
+      "DL_DETAIL_H": {
+        "debugLevel": "High",
+        "filterDefaultValue": "ON",
+        "tag": [
+          "Baseline"
+        ],
+        "traceType": "CoreDesign"
+      }
+    },
+    {
+      "GE_DETAIL_H": {
+        "debugLevel": "High",
+        "filterDefaultValue": "ON",
+        "tag": [
+          "Baseline"
+        ],
+        "traceType": "CoreDesign"
+      }
+    },
+    {
+      "DPFM_UH": {
+        "debugLevel": "Ultra-High",
+        "filterDefaultValue": "ON",
+        "tag": [
+          "Baseline"
+        ],
+        "traceType": "CoreDesign"
+      }
+    },
+    {
+      "DATA_PATH_SENSATIVE_L": {
+        "debugLevel": "Low",
+        "filterDefaultValue": "ON",
+        "tag": [
+          "Baseline"
+        ],
+        "traceType": "CoreDesign"
+      }
+    },
+    {
+      "DATA_PATH_M": {
+        "debugLevel": "Medium",
+        "filterDefaultValue": "ON",
+        "tag": [
+          "Baseline"
+        ],
+        "traceType": "CoreDesign"
+      }
+    }     
+  ],
+  "traceDefs": [
+    {
+      "IPC_UL_UPLINK_CALLBACK": {
+        "format": "[IPCORE] ipc_uplink() : [%ub] Callback with UL IP IOR[%xl] for netif[%xl], netif's features[%xl]",
+        "traceClass": "UL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UL_META_UPLINK_CALLBACK": {
+        "format": "[IPCORE] ipc_meta_uplink() : Callback with UL IP Meta start_idx[%xl], end_idx[%xl], q_type[%ub]",
+        "traceClass": "UL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UL_META_PN_MISS_MATCH": {
+        "format": "[IPCORE] ipc_check_and_fill_session_info() : UL IP Meta PDN info are different(mask with proto_idx). netif_id[%xl], ip_type[%xb], PDN_from_IPCORE[%xl], PDN_from_meta[%xl]",
+        "traceClass": "UL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UL_META_DPFM_CMD": {
+        "format": "[IPCORE] ipc_on_process_UL_UHpc_result() : UL DPFM CMD result [%xl], meta_idx[%xl]",
+        "traceClass": "UL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UL_DEQUEUE_UPLINK_PRIORITY_QUEUE": {
+        "format": "[IPCORE] ipc_on_process_ul_ior_list() : Pending IOR count[%d], Throttling state: blocking-latency-concern[%ub]/ims-emergency[%ub]. High priority IOR list head[%xl]",
+        "traceClass": "UL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UL_DEQUEUE_UPLINK_QUEUE": {
+        "format": "[IPCORE] ipc_on_process_ul_queue() : UL data throttled! Pending q_type[%ub], q_priority[%ub], cnt[%ul].",
+        "traceClass": "UL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UL_PROCESS_UPLINK_QUEUE": {
+        "format": "[IPCORE] ipc_on_process_ul_queue()",
+        "traceClass": "DATA_PATH_M",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UL_UPLINK_QUEUE_PENDING": {
+        "format": "[IPCORE] ipc_on_process_ul_queue() : Queue: type[%ub], priority[%ub] and Pending_cnt[%l]",
+        "traceClass": "UL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_IOR_CHANGE_GPD_TYPE": {
+        "format": "[IPCORE] ipc_ior_change_gpd_type() : Change to GPD type[%d], with origin IOR[%xl] and new IOR[%xl]",
+        "traceClass": "UL_DETAIL_H",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UL_ON_PROCESS_NORMAL_IOR": {
+        "format": "[IPCORE] ipc_on_process_ul_ior_list() : [%ub] Handle IOR[%xl] belongs to netif[%xl]",
+        "traceClass": "UL_DETAIL_H",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UL_FORWARD_META": {
+        "format": "[IPCORE] ipc_on_process_ul_meta_table() : Forward UL Meta: start_idx[%xl], end_idx[%xl], q_type[%ub]",
+        "traceClass": "UL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UL_THROTTLE_IMS_EMERGEMCY_IND": {
+        "format": "[IPCORE] ipc_ims_emergency_call_ind_handler(): VDM indication to change ims_block_flag from [%ub] to [%ub]",
+        "traceClass": "UL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_TR_TIMER_UL_THROTTLE_TIMEOUT": {
+        "format": "[IPCORE] ipc_ul_throttle_timeout(): UL throttle timer timeout, current_tick(%l), current_state(%ub), enable(%ub), active(%ub), suspend(%ub)",
+        "traceClass": "UL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_TR_START_UL_THROTTLE_TIMER": {
+        "format": "[IPCORE] ipc_start_ul_throttle_timer(): Start UL throttle timer, current_tick(%l), elapse_time(%l)",
+        "traceClass": "UL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UL_RELOAD_UPLINK": {
+        "format": "[IPCORE] ipc_reload_uplink() : [%ub] Reload uplink for netif[%xl], netif_id[%xl], callback[%xl]",
+        "traceClass": "UL_DETAIL_H",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UL_RELOAD_UPLINK_RESULT": {
+        "format": "[IPCORE] ipc_reload_uplink() : [%ub] Reload uplink result for for netif[%xl], netif_id[%xl] : %ub",
+        "traceClass": "UL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UL_RELOAD_RETRY": {
+        "format": "[IPCORE] ipc_set_netif_ul_reload_retry() : Update retry-reload flag [%ub] for netif[%xl], netif_id[%xl], callback[%xl] while set-need-reload bit-mask[%xl]",
+        "traceClass": "UL_DETAIL_H",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UL_RELOAD_RETRY_RACE_COND": {
+        "format": "[IPCORE] ipc_set_netif_ul_reload_retry() : [%ub] Update retry-reload race condition occurred with retry-reload flag [%ub], set-need-reload flag [%l] and reload retrial bit-mask[%xl]",
+        "traceClass": "UL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UL_RELOAD_RETRY_FLAG": {
+        "format": "[IPCORE] ipc_set_netif_ul_reload_retry() : [%ub] Uplink reload retrial bit-mask[%xl] while set-need-reload bit-mask[%xl]",
+        "traceClass": "UL_DETAIL_H",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UL_SET_NEED_RELOAD": {
+        "format": "[IPCORE] ipc_set_netif_ul_set_need_reload() : Update set-need-reload flag [%ub] for netif[%xl], netif_id[%xl], callback[%xl]",
+        "traceClass": "UL_DETAIL_H",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UL_SET_NEED_RELOAD_FLAG": {
+        "format": "[IPCORE] ipc_set_netif_ul_set_need_reload() : [%ub] Netif set need reload bit-mask[%xl]",
+        "traceClass": "UL_DETAIL_H",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UL_ON_RETRY_RELOAD": {
+        "format": "[IPCORE] ipc_on_retry_ul_reload() : [%ub] Current uplink reload retrial bit-mask[%xl]",
+        "traceClass": "UL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UL_ON_RETRY_RELOAD_FOR_NETIF": {
+        "format": "[IPCORE] ipc_on_retry_ul_reload() : [%ub] Reload network interface[%xl] for bit[%xl]",
+        "traceClass": "UL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UL_CHECK_UL_RELOAD_RETRY": {
+        "format": "[IPCORE] ipc_check_ul_reload_retry() : [%ub] Current uplink reload retrial bit-mask[%xl] : need retry reload !",
+        "traceClass": "UL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UL_DROP_UL_IOR": {
+        "format": "[IPCORE] ipc_forward_ul_ior() : [%ub] Drop UL IOR for netif[%xl], ior[%xl]",
+        "traceClass": "UL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UL_LOOPBACK_UL_IOR": {
+        "format": "[IPCORE] ipc_forward_ul_ior() : [%ub] Loopback UL IOR for netif[%xl], ior[%xl], DL callback[%xl]",
+        "traceClass": "UL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UL_LOOPBACK_UL_IOR_DROP": {
+        "format": "[IPCORE] ipc_forward_ul_ior() : [%ub] Drop loopback UL IOR due to invalid DL callback for netif[%xl], ior[%xl], DL callback[%xl]",
+        "traceClass": "UL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UL_HANDLE_UL_GPD_LIST": {
+        "format": "[IPCORE] ipc_forward_ul_ior() : IP-Type(%ub) - To handle UL GPD : netif_id[%xl], first_gpd[%xl], last_gpd[%xl]",
+        "traceClass": "UL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UL_FORWARD_UL_SDU": {
+        "format": "[IPCORE] ipc_forward_ul_ior() : IP-Type(%ub) - Forward UL GPD : pdn_id[%xl], first_gpd[%xl], last_gpd[%xl]",
+        "traceClass": "UL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UL_HANDLE_IPV4_UL_GPD_LIST": {
+        "format": "[IPCORE] ipc_forward_ul_ior() : IP-Type(%ub) - To handle IPv4 UL GPD : netif_id[%xl], first_gpd[%xl], last_gpd[%xl]",
+        "traceClass": "UL_DETAIL_H",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UL_FORWARD_IPV4_UL_SDU": {
+        "format": "[IPCORE] ipc_forward_ul_ior() : IP-Type(%ub) - Forward IPv4 UL GPD : pdn_id[%xl], first_gpd[%xl], last_gpd[%xl]",
+        "traceClass": "UL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UL_HANDLE_IPV6_UL_GPD_LIST": {
+        "format": "[IPCORE] ipc_forward_ul_ior() : IP-Type(%ub) - To handle IPv6 UL GPD : netif_id[%xl], first_gpd[%xl], last_gpd[%xl]",
+        "traceClass": "UL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UL_FORWARD_IPV6_UL_SDU": {
+        "format": "[IPCORE] ipc_forward_ul_ior() : IP-Type(%ub) - Forward IPv6 UL GPD : pdn_id[%xl], first_gpd[%xl], last_gpd[%xl]",
+        "traceClass": "UL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UL_FORWARD_UL_SDU_MULTI_PS": {
+        "format": "[IPCORE] IPC_FORWARD_UL_SDU() : Forward UL GPD with pdn_id[%l]",
+        "traceClass": "UL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UL_FORWARD_UL_SDU_BY_EBI_MULTI_PS": {
+        "format": "[IPCORE] IPC_FORWARD_UL_SDU_BY_EBI() : Forward GPD to UL with EBI(%l)",
+        "traceClass": "UL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UL_DHCP4C_PKT_SESSION": {
+        "format": "[IPCORE] ipc_on_dhcp4c_packet_ind() : [%ub] Send DHCPv4 gpd[%xl], ip_id[%ub], session[%xl]",
+        "traceClass": "UL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UL_DHCP4C_PKT_UPLINK": {
+        "format": "[IPCORE] ipc_on_dhcp4c_packet_ind() : [%ub] Send DHCPv4 gpd[%xl], session[%xl], netif_id[%xl]",
+        "traceClass": "UL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UL_SEND_PKT": {
+        "format": "[IPCORE] ipc_send_ul_pkt() : Receive GPD to UL with EBI(%l) : head[%xl] ~ tail[%xl]",
+        "traceClass": "UL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UL_SEND_PKT_BY_PDN": {
+        "format": "[IPCORE] ipc_send_ul_pkt_by_pdn() : Receive GPD to UL with PDN(%l), ip_type(%xb) : head[%xl] ~ tail[%xl], length (%xl)",
+        "traceClass": "UL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UL_SEND_PKT_MULTI_PS": {
+        "format": "[IPCORE] ipc_send_ul_pkt_multiple_ps() : Function be called with EBI(%l) and proto_idx(%l)",
+        "traceClass": "UL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UL_SEND_PKT_BY_PDN_MULTI_PS": {
+        "format": "[IPCORE] ipc_send_ul_pkt_by_pdn_multiple_ps() : Function be called with PDN(%l) and proto_idx(%l)",
+        "traceClass": "UL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UL_SEND_PKT_BY_NETIF_ID": {
+        "format": "[IPCORE] ipc_send_ul_pkt_by_netif_id() : Send GPD to UL with NETIF_ID(%xl), ip_tpye(%xb) : head[%xl] ~ tail[%xl], length(%xl)",
+        "traceClass": "UL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UL_SEND_PKT_FORWARD": {
+        "format": "[IPCORE] ipc_on_process_ul_ior_list() : Send GPD to UL with EBI(%l) : head[%xl] ~ tail[%xl]",
+        "traceClass": "UL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UL_CLUB_PKT_B4_FORWARD": {
+        "format": "[IPCORE] ipc_on_process_ul_ior_list() : Club curr UL GPD for EBI(%l) : head[%xl] ~ tail[%xl]",
+        "traceClass": "UL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UL_CLUB_PKT_BY_PDN_B4_FORWARD": {
+        "format": "[IPCORE] ipc_on_process_ul_ior_list() : Club curr UL GPD for PDN(%l), ip_type(%xb) : head[%xl] ~ tail[%xl]",
+        "traceClass": "UL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UL_SEND_PKT_BY_PDN_FORWARD": {
+        "format": "[IPCORE] ipc_on_process_ul_ior_list() : Send GPD to UL with PDN(%l), ip_type(%xb) : head[%xl] ~ tail[%xl]",
+        "traceClass": "UL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_DL_META_DROP_DID_ALLOC_NG": {
+        "format": "[IPCORE] ipc_ipf_meta_do_filter() : packet drop because DID allocation failed, out_netif[%xl]",
+        "traceClass": "DL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_DL_META_DOWNLINK_CALLBACK": {
+        "format": "[IPCORE] ipc_meta_downlink() : Callback with DL IPF Meta start_idx[%xl], end_idx[%xl], q_type[%ub]",
+        "traceClass": "DL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_DL_META_ON_PROC": {
+        "format": "[IPCORE] ipc_on_process_dl_meta() : Process DL IPF Meta read_idx[%xl], end_idx[%xl], q_type[%ub]",
+        "traceClass": "DL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_DL_META_ON_PROC_DONE": {
+        "format": "[IPCORE] ipc_on_process_dl_meta() : Free DL IPF Meta read_idx[%xl], end_idx[%xl], q_cnt[%xl], q_type[%ub]",
+        "traceClass": "DL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_DL_META_PROC_INFO": {
+        "format": "[IPCORE] ipc_meta_downlink_dequeue() : DL IPF Meta head_idx[%xl], tail_idx[%xl], q_cnt[%xl], Pending_cnt[%xl], tbl_size[%xl]",
+        "traceClass": "DL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_DL_META_MATCH_RESULT": {
+        "format": "[IPCORE] ipc_on_process_dl_meta() : read_idx[%xl], match_result[%xl]",
+        "traceClass": "DL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_DPFM_LAN_DIRECT_SEND_DL_IOR": {
+        "format": "[IPCORE] ipc_on_process_ul_ior_list() : [%ub] CCMNI-LAN directly send DL IOR from netif_id[%xl] to netif_id[%xl] - IOR[%xl]",
+        "traceClass": "DL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_DL_SEND_IPV4_PKT": {
+        "format": "[IPCORE] ipc_send_dl_pkt() : [%ub] Send IPv4 GPD to netif_id[%xl], first_gpd[%xl], last_gpd[%xl]",
+        "traceClass": "DL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_DL_SEND_IPV6_PKT": {
+        "format": "[IPCORE] ipc_send_dl_pkt() : [%ub] Send IPv6 GPD to netif_id[%xl], first_gpd[%xl], last_gpd[%xl]",
+        "traceClass": "DL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_DL_SEND_PKT_DID": {
+        "format": "[IPCORE] ipc_send_dl_pkt_in_did() : Send DID to netif_id[%xl], did[%xl], pkt_cnt[%d]",
+        "traceClass": "DL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_DL_SEND_PKT_DID_PENDING": {
+        "format": "[IPCORE] ipc_send_dl_pkt_in_did() : Netif refuse to receive DL DIDs, pending_head[%xl], pending_tail[%xl]",
+        "traceClass": "DL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_DL_ON_DOWNLINK": {
+        "format": "[IPCORE] ipc_on_downlink() : Downlink handle from pdn_id[%l], head[%xl], tail[%xl]",
+        "traceClass": "DL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_DL_ON_DOWNLINK_FILTER_OUT": {
+        "format": "[IPCORE] ipc_on_downlink() : [%ub] Filter out all downlink GPDs : session_type[%ub], netif_id[%xl]",
+        "traceClass": "DL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_DL_ON_DOWNLINK_CALLBACK_INFO": {
+        "format": "[IPCORE] ipc_on_downlink() : Send DL GPDs from pdn_id[%l] - Session/netif information : session_type[%ub], netif_id[%xl]",
+        "traceClass": "DL_DETAIL_H",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_DL_ON_DOWNLINK_CALLBACK_GPD": {
+        "format": "[IPCORE] ipc_on_downlink() : Send DL GPDs from pdn_id[%l] - GPD information : first_gpd[%xl], last_gpd[%xl]",
+        "traceClass": "DL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_DL_ON_DOWNLINK_MULTI_PS": {
+        "format": "[IPCORE] ipc_on_downlink_multiple_ps() : Downlink handle from pdn_id[%l], proto_idx[%ub]",
+        "traceClass": "DL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_DL_ON_DID_DOWNLINK": {
+        "format": "[IPCORE] ipc_did_downlink_enqueue() : Downlink handle from pdn_id[%xl] (mask with proto_idx), head[%xl], tail[%xl]",
+        "traceClass": "DL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_DL_PROCESS_DL_DID": {
+        "format": "[IPCORE][DL_PSN flow: %ub, from: %xd, to: %xd, seg_num: %ud] ipc_on_process_dl_did_list() : Process DL DID[%xl] from pdn_id[%l]",
+        "traceClass": "DL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_DL_FWD_DL_CALLBACK_DID": {
+        "format": "[IPCORE] ipc_forward_dl_did_default() : Send DL %ub packets to netif_id[%xl]",
+        "traceClass": "DL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_DL_DO_FILTER_DID_ZERO_SIT": {
+        "format": "[IPCORE] ipc_do_did_filter() : hif_type is ignore && legnth is zero, curr_id[%ub] bypass_seg[%ub] pkt_seg[%ub]",
+        "traceClass": "DL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_DL_FWD_DL_CALLBACK_DID_WO_FILTER": {
+        "format": "[IPCORE] ipc_forward_dl_did_default_wo_filter() : Send DL %ub packets to netif_id[%xl]",
+        "traceClass": "DL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_DL_ON_DID_DOWNLINK_PENDING": {
+        "format": "[IPCORE] ipc_on_process_dl_did_list() : Netif refuse to receive DL DIDs, pending_head[%xl], pending_tail[%xl]",
+        "traceClass": "DL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_DL_ON_DID_DOWNLINK_TEST_LOOPBACK": {
+        "format": "[IPCORE] ipc_on_did_downlink_test_mode() : Downlink handle from pdn_id[%l], head[%xl], tail[%xl], test_mode[%ub]",
+        "traceClass": "DL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_DL_DO_FILTER_WHEN_LINK_DOWN": {
+        "format": "[IPCORE] ipc_on_process_dl_did_list_when_link_down() : Do DL filter when link down did_head[%xl], did_tail[%xl], from pdn_id[%l]",
+        "traceClass": "DL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_DL_INVALID_LEN_CHK": {
+        "format": "[IPCORE] ipc_pkt_do_filter() : dl_invalid_len : cur_gpd[%xl], cur_bd[%xl], pkt_length[%xl], valid_length[%xl]",
+        "traceClass": "DL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_DL_INVALID_LEN_CHK_DID": {
+        "format": "[IPCORE][DL_PSN flow: %ub, psn: %xd] ipc_pkt_do_filter() : dl_invalid_len : pkt_length[%xl], valid_length[%xl]",
+        "traceClass": "DL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_DL_INVALID_LEN_PKT_IP_HDR": {
+        "format": "[IPCORE] ipc_pkt_do_filter() : dl_invalid_len ip_header[%ub] header data[%xl]",
+        "traceClass": "DL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_GE_FILTER_RULE_MATCHED": {
+        "format": "[IPCORE] ipc_pkt_do_filter() : [%ub] filter rule matched - filter rules: rules[%xl], features[%xb], valid_fields[%xl], matched[%xl]",
+        "traceClass": "GE_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_GE_SPD_DO_FILTER": {
+        "format": "[IPCORE] ipc_spd_do_filter() : [%ub] SPD[%xl] with length[%xl], pkt_num[%xb] is about to do filter",
+        "traceClass": "GE_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_GE_SPD_ENTRY_IGR_INFO": {
+        "format": "[IPCORE] ipc_spd_do_filter() : One of SPD entries has been ignored : uplink[%ub], curr_spd[%xl], idx[%l], payload_len[%l]",
+        "traceClass": "GE_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_GE_SPD_ALL_IGR_INFO": {
+        "format": "[IPCORE] ipc_do_filter() : All entry of the SPD have been ignored : uplink[%ub], curr_spd[%xl], packet_num[%l]",
+        "traceClass": "GE_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_GE_DO_FILTER_GPD_UPDATE": {
+        "format": "[IPCORE] ipc_do_filter() : GPD update after uniting : uplink[%ub], curr_gpd[%xl], united_gpd[%xl]/len[%l]",
+        "traceClass": "GE_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_GE_FILTER_OUT_INFO": {
+        "format": "[IPCORE] ipc_call_filter_cbk() : filter out and callback - General info : uplink[%ub], callback_context[%xl], filter_id[%xl]",
+        "traceClass": "GE_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_GE_FILTER_OUT_GPD": {
+        "format": "[IPCORE] ipc_call_filter_cbk() : filter out and callback - GPD info : uplink[%ub], gpd_head[%xl], gpd_tail[%xl], length[%l]",
+        "traceClass": "GE_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_GE_UNITE_FAIL_DROP": {
+        "format": "[IPCORE] ipc_do_filter() : Unite Failed ! Drop packet with length[%l], orgGPD[%lx]",
+        "traceClass": "GE_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_GE_UNITE_FAIL_DROP_INFO": {
+        "format": "[IPCORE] ipc_do_filter() : Dropped packet info : FilterID[%l], orgGPD[%lx], pdnID[%l], netifID[%l]",
+        "traceClass": "GE_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_GE_HANDLE_GPD": {
+        "format": "[IPCORE] ipc_pack_pkt() : [%ub] Handle GPD - head[%xl], tail[%xl]",
+        "traceClass": "GE_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_GE_SET_ALLOC_DATA": {
+        "format": "[IPCORE] ipc_pack_pkt() : Set and allocate GPD for data buffer - data_len[%l], data[%xl], ip_header_len[%l], udp_header_len[%l]",
+        "traceClass": "GE_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_GE_FILL_HEADER": {
+        "format": "[IPCORE] ipc_pack_pkt() : Fill header with total_le[%d] for GPD[%xl], ip_header_len[%l], udp_header_len[%l]",
+        "traceClass": "GE_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_GE_PACK_PACKET_PUBLIC": {
+        "format": "[IPCORE] ipc_pack_pkt_public() : [%ub] ipc_pack_pkt_public() is invoked.",
+        "traceClass": "GE_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_GE_UNITED_GPD": {
+        "format": "[IPCORE] ipc_gpd_unite() : GPD is united with new one : uplink[%ub], p_gpd_in[%xl], *pp_gpd_out[%xl]/len[%l]",
+        "traceClass": "GE_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UL_PKT_FILTER_RESULT_META": {
+        "format": "[IPCORE][UL_PSN: %xd] ipc_pkt_do_filter() : packet match result[%ub], dpfm_rule_id[%ub] (only valid when result=3)",
+        "traceClass": "UL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_DL_PKT_FILTER_RESULT_DID": {
+        "format": "[IPCORE][DL_PSN flow: %ub, psn: %xd] ipc_pkt_do_filter() : packet match result[%ub], dpfm_rule_id[%ub] (only valid when result=3)",
+        "traceClass": "DL_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_PKT_FILTER_RESULT_GPD": {
+        "format": "[IPCORE] ipc_pkt_do_filter() : uplink[%ub], gpd[%xl], packet match result[%ub], dpfm_rule_id[%ub] (only valid when result=3)",
+        "traceClass": "GE_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_PKT_FILTER_RESULT_SPD": {
+        "format": "[IPCORE] ipc_pkt_do_filter() : uplink[%ub], packet match result[%ub], dpfm_rule_id[%ub] (only valid when result=3)",
+        "traceClass": "GE_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_DL_TRANS_GPD_TO_DID": {
+        "format": "[IPCORE] ipc_send_dl_pkt_in_did_internal() : translate GPD[%xl] to DID head[%xl] and DID tail[%xl])",
+        "traceClass": "GE_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "PFM_GE_MATCHED_PACKET_INFO": {
+        "format": "[PFM] pfm_matched_packet_trace(): The matched packet ! EBI[%d], IPID[%xb], checksum[%xd]",
+        "traceClass": "GE_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "PFM_GE_MATCHED_PACKET_DUMP": {
+        "format": "[PFM DUMP] %3d: %10xl %10xl %10xl %10xl",
+        "traceClass": "DATA_PATH_SENSATIVE_L",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "PFM_DL_RECEIVED_FILTER_PACKET": {
+        "format": "[PFM] Received fin ack packet gpd_head (%xl) gpd_tail (%xl)",
+        "traceClass": "GE_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_DATA_DUMP_TRACE": {
+        "format": "[IPCORE] %b: %10xl %10xl %10xl %10xl",
+        "traceClass": "GE_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_GET_NETIF_FROM_META": {
+        "format": "[IPCORE] ipc_get_netif_id_from_meta() : net_type(%d), channl_id(%d), netif(0x%xl)",
+        "traceClass": "GE_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_DL_ENQ_BY_NETIF": {
+        "format": "[IPCORE] ipc_data_dl_enq_by_netif() : Send did_head(0x%xl), did_head(0x%xl) to netif_id(%d)",
+        "traceClass": "GE_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_DPFM_CHECK_ROUTE_MATCHED": {
+        "format": "[IPCORE] ipc_pkt_do_filter() : uplink[%ub] ip_type[%ub] DPFM check route matched to out_netif_id[%xl]",
+        "traceClass": "DPFM_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_DPFM_ON_DOWNLINK": {
+        "format": "[IPCORE] ipc_dpfm_on_downlink() : [%ub] DPFM DL direct path : first_gpd[%xl], last_gpd[%xl]",
+        "traceClass": "DPFM_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_DPFM_ON_DOWNLINK_PKT_IPV4": {
+        "format": "[IPCORE] ipc_dpfm_on_downlink() : DPFM DL direct path IPV4 : curr_gpd[%xl], IPID = %xb, checksum = %xd",
+        "traceClass": "DPFM_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_DPFM_ON_DOWNLINK_PKT_IPV6": {
+        "format": "[IPCORE] ipc_dpfm_on_downlink() : DPFM DL direct path IPV6 : protocol:%d, curr_gpd[%xl], checksum = %xl, Src Addr=%10xl %10xl %10xl %10xl",
+        "traceClass": "DATA_PATH_SENSATIVE_L",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_DPFM_ON_DOWNLINK_PKT_NON_IPV4V6": {
+        "format": "[IPCORE] ipc_dpfm_on_downlink() : DPFM DL direct path non IPv4 and IPv6 : curr_gpd[%xl], length = %d",
+        "traceClass": "DPFM_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_DPFM_FORWARD_UL_IOR": {
+        "format": "[IPCORE] ipc_dpfm_forward_ul_ior() : [%d] DPFM UL direct path : first_gpd[%xl], last_gpd[%xl]",
+        "traceClass": "DPFM_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_DPFM_FORWARD_UL_IOR_PKT_IPV4": {
+        "format": "[IPCORE] ipc_dpfm_forward_ul_ior() : DPFM UL direct path IPv4 : curr_gpd[%xl], IPID = %xl, checksum = %xl",
+        "traceClass": "DPFM_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_DPFM_FORWARD_UL_IOR_PKT_IPV6": {
+        "format": "[IPCORE] ipc_dpfm_forward_ul_ior() : DPFM UL direct path IPv6 : protocol:%d, curr_gpd[%xl], checksum = %xl, Src Addr=%10xl %10xl %10xl %10xl",
+        "traceClass": "DATA_PATH_SENSATIVE_L",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_DPFM_FORWARD_UL_IOR_PKT_NON_IPV4V6": {
+        "format": "[IPCORE] ipc_dpfm_forward_ul_ior() : DPFM UL direct path non IPv4 and IPv6 : curr_gpd[%xl], length = %d",
+        "traceClass": "DPFM_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_BIND_LAN_NETIF": {
+        "format": "[IPCORE] ipc_bind_lan_netif() : [%d] netif_1[%xl] id[%xl], netif_2[%xl] id[%xl]",
+        "traceClass": "DPFM_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_UNBIND_LAN_NETIF": {
+        "format": "[IPCORE] ipc_unbind_lan_netif() : [%d] netif_1[%xl], id[%xl], netif_2[%xl] id[%xl]",
+        "traceClass": "DPFM_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_DPFM_DETECT_FM_NOT_MATCH": {
+        "format": "[IPCORE] ipc_on_pdn_deact() : DPFM detect flight mode not match [%d] netif[%xl]",
+        "traceClass": "DPFM_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_TR_CUST_FILTER_CBK": {
+        "format": "[IPCORE] Filter matched and invoke cust filter cbk with pkt (0x%xl) pkt_len (0x%xl) filter_id (0x%xl) result (0x%xl)",
+        "traceClass": "GE_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "IPC_SEND_L2_UNK_INFO": {
+        "format": "[IPCORE] Send L2 unknown header info from meta (0x%xl) to meta (0x%xl) unk_cnt (0x%xl) begin_cntl (0x%xl) end_cntl (0x%xl) rb_idx (0x%xl) proto_idx (0x%xl)",
+        "traceClass": "GE_UH",
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "LTM_SIM_TPUT_ANALYSIS": {
+        "format": "[LTM_SIM] REAL_PKT_NUM : %d, EXPECTED_PKT_NUM : %l, TIME_DIFF : %l, Current_Time: %l, Last_Time : %l, RECYCLE_PKT_NUM : %l.",
+        "traceClass": "GE_UH",
+        "traceHighlightOption": "info"
+      }
+    }
+  ],
+  "traceFamily": "L2",
+  "userModule": "MOD_IPCORE"
+}
diff --git a/mcu/middleware/hif/interface/ipcore_dhcph.h b/mcu/middleware/hif/interface/ipcore_dhcph.h
new file mode 100644
index 0000000..a59222b
--- /dev/null
+++ b/mcu/middleware/hif/interface/ipcore_dhcph.h
@@ -0,0 +1,201 @@
+/*!
+ *  @file ipcore_dhcph.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 DHCP Header definitions of ipcore
+ */
+
+#ifndef _IPCORE_DHCPH_H
+#define _IPCORE_DHCPH_H
+
+#include "kal_public_api.h"
+
+#define IPC_BP_CHADDR_LEN           16
+#define IPC_BP_SNAME_LEN            64
+#define IPC_BP_FILE_LEN             128
+//#define IPC_BP_VEND_LEN             312+32
+
+#define IPC_BP_BOOT_REQUEST         1
+#define IPC_BP_BOOT_REPLY           2
+
+#define IPC_BP_HTYPE_ETHERNET       1
+#define IPC_BP_HTYPE_EXP_ETHERNET   2
+#define IPC_BP_HTYPE_AX25           3
+#define IPC_BP_HTYPE_PRONET         4
+#define IPC_BP_HTYPE_CHAOS          5
+#define IPC_BP_HTYPE_IEEE802        6
+#define IPC_BP_HTYPE_ARCNET         7
+
+#define IPC_BP_MAGIC_COOKIE         {0x63, 0x82, 0x53, 0x63}
+
+#define IPC_BP_OPTION_PAD                                   0
+#define IPC_BP_OPTION_SUBNET_MASK                           1
+#define IPC_BP_OPTION_ROUTER                                3
+#define IPC_BP_OPTION_DOMAIN_NAME_SERVER                    6
+#define IPC_BP_OPTION_HOST_NAME                             12
+#define IPC_BP_OPTION_INTERFACE_MTU                         26
+#define IPC_BP_OPTION_REQUESTED_IP_ADDRESS                  50
+#define IPC_BP_OPTION_IP_ADDRESS_LEASE_TIME                 51
+#define IPC_BP_OPTION_DHCP_MESSAGE_TYPE                     53
+#define IPC_BP_OPTION_SERVER_IDENTIFIER                     54
+#define IPC_BP_OPTION_PARAMETER_REQUEST_LIST                55
+#define IPC_BP_OPTION_MAXIMUM_DHCP_MESSAGE_SIZE             57
+#define IPC_BP_OPTION_RENEWAL_TIME_VALUE                    58
+#define IPC_BP_OPTION_REBINDING_TIME_VALUE                  59
+#define IPC_BP_OPTION_VENDOR_CLASS_IDENTIFIER               60
+#define IPC_BP_OPTION_CLIENT_IDENTIFIER                     61
+#define IPC_BP_OPTION_CLIENT_FULLY_QUALIFIED_DOMAIN_NAME    81
+#define IPC_BP_OPTION_END                                   255
+
+#define IPC_BP_DHCP_MESSAGE_TYPE_DHCP_DISCOVER              1
+#define IPC_BP_DHCP_MESSAGE_TYPE_DHCP_OFFER                 2
+#define IPC_BP_DHCP_MESSAGE_TYPE_DHCP_REQUEST               3
+#define IPC_BP_DHCP_MESSAGE_TYPE_DHCP_DECLINE               4
+#define IPC_BP_DHCP_MESSAGE_TYPE_DHCP_ACK                   5
+#define IPC_BP_DHCP_MESSAGE_TYPE_DHCP_NAK                   6
+#define IPC_BP_DHCP_MESSAGE_TYPE_DHCP_RELEASE               7
+#define IPC_BP_DHCP_MESSAGE_TYPE_DHCP_INFORM                8
+
+
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _ipc_bootp_header {
+    kal_uint8       bp_op;                  // packet opcode type
+    kal_uint8       bp_htype;               // hardware addr type
+    kal_uint8       bp_hlen;                // hardware addr length
+    kal_uint8       bp_hops;                // gateway hops
+    kal_uint32      bp_xid;                 // transaction ID
+    kal_uint16      bp_secs;                // seconds since boot began
+    kal_uint16      bp_flags;               // RFC1532 broadcazst, etc
+    ipc_ip4_addr_t  bp_ciaddr;              // client IP address
+    ipc_ip4_addr_t  bp_yiaddr;              // your IP address
+    ipc_ip4_addr_t  bp_siaddr;              // server IP address
+    ipc_ip4_addr_t  bp_giaddr;              // gateway IP address
+    kal_uint8       bp_chaddr[IPC_BP_CHADDR_LEN];   // client hardware address
+    kal_uint8       bp_sname[IPC_BP_SNAME_LEN];     // server host name
+    kal_uint8       bp_file[IPC_BP_FILE_LEN];       // boot file name
+} ipc_bootp_header_t;
+PRAGMA_END_PACK_STRUCT
+
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _ipc_bp_option_dhcp_message_type {
+    kal_uint8           code;
+    kal_uint8           len;
+    kal_uint8           type;
+} ipc_bp_option_dhcp_message_type_t;
+PRAGMA_END_PACK_STRUCT
+
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _ipc_bp_option_requested_ip_address {
+    kal_uint8           code;
+    kal_uint8           len;
+    ipc_ip4_addr_t      address;
+} ipc_bp_option_requested_ip_address_t;
+PRAGMA_END_PACK_STRUCT
+
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _ipc_bp_option_server_identifier {
+    kal_uint8           code;
+    kal_uint8           len;
+    ipc_ip4_addr_t      address;
+} ipc_bp_option_server_identifier_t;
+PRAGMA_END_PACK_STRUCT
+
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _ipc_bp_option_ip_address_lease_time {
+    kal_uint8           code;
+    kal_uint8           len;
+    kal_uint32          lease_time;
+} ipc_bp_option_ip_address_lease_time_t;
+PRAGMA_END_PACK_STRUCT
+
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _ipc_bp_option_maximum_dhcp_message_size {
+    kal_uint8           code;
+    kal_uint8           len;
+    kal_uint16          length;
+} ipc_bp_option_maximum_dhcp_message_size_t;
+PRAGMA_END_PACK_STRUCT
+
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _ipc_bp_option_subnet_mask {
+    kal_uint8           code;
+    kal_uint8           len;
+    ipc_ip4_addr_t      subnet_mask;
+} ipc_bp_option_subnet_mask_t;
+PRAGMA_END_PACK_STRUCT
+
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _ipc_bp_option_router {
+    kal_uint8           code;
+    kal_uint8           len;
+    ipc_ip4_addr_t      address;
+} ipc_bp_option_router_t;
+PRAGMA_END_PACK_STRUCT
+
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _ipc_bp_option_domain_name_server {
+    kal_uint8           code;
+    kal_uint8           len;
+    ipc_ip4_addr_t      address;
+} ipc_bp_option_domain_name_server_t;
+PRAGMA_END_PACK_STRUCT
+
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _ipc_bp_option_renewal_time_value {
+    kal_uint8           code;
+    kal_uint8           len;
+    kal_uint32          t1_interval;
+} ipc_bp_option_renewal_time_value_t;
+PRAGMA_END_PACK_STRUCT
+
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _ipc_bp_option_rebinding_time_value {
+    kal_uint8           code;
+    kal_uint8           len;
+    kal_uint32          t2_interval;
+} ipc_bp_option_rebinding_time_value_t;
+PRAGMA_END_PACK_STRUCT
+
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _ipc_bp_option_interface_mtu {
+    kal_uint8           code;
+    kal_uint8           len;
+    kal_uint16          mtu;
+} ipc_bp_option_interface_mtu_t;
+PRAGMA_END_PACK_STRUCT
+
+#endif  // _IPCORE_DHCPH_H
+
diff --git a/mcu/middleware/hif/interface/ipcore_icmph.h b/mcu/middleware/hif/interface/ipcore_icmph.h
new file mode 100644
index 0000000..50569b8
--- /dev/null
+++ b/mcu/middleware/hif/interface/ipcore_icmph.h
@@ -0,0 +1,311 @@
+/*!
+ *  @file ipcore_icmph.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 ICMP Header definitions of ipcore
+ */
+
+#ifndef _IPCORE_ICMPH_H
+#define _IPCORE_ICMPH_H
+
+#include "kal_public_api.h"
+
+#define IPC_ICMP_ECHO_REPLY             0       /* Echo Reply               */
+#define IPC_ICMP_ECHO_REQUEST           8       /* Echo Request             */
+
+
+#define IPC_ICMP6_ECHO_REQUEST          128     /* echo request             */
+#define IPC_ICMP6_ECHO_REPLY            129     /* echo reply               */
+#define IPC_ICMP6_NDP_ROUTER_SOLICIT    133     /* router solicitation      */
+#define IPC_ICMP6_NDP_ROUTER_ADVERT     134     /* router advertisment      */
+#define IPC_ICMP6_NDP_NEIGHBOR_SOLICIT  135     /* neighbor solicitation    */
+#define IPC_ICMP6_NDP_NEIGHBOR_ADVERT   136     /* neighbor advertisment    */
+#define IPC_ICMP6_NDP_REDIRECT          137     /* redirect                 */
+
+#define IPC_ICMP6_NDP_OPT_SOURCE_LINKADDR       1
+#define IPC_ICMP6_NDP_OPT_TARGET_LINKADDR       2
+#define IPC_ICMP6_NDP_OPT_PREFIX_INFORMATION    3
+#define IPC_ICMP6_NDP_OPT_REDIRECTED_HEADER     4
+#define IPC_ICMP6_NDP_OPT_MTU                   5
+#define IPC_ICMP6_NDP_OPT_RDNSS                 25
+
+
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _ipc_icmp_header {
+    kal_uint8   icmp_type;      // type field
+    kal_uint8   icmp_code;      // code field
+    kal_uint16  icmp_cksum;     // checksum field
+    union {
+        kal_uint32  icmp_un_data32[1];  // type-specific field
+        kal_uint16  icmp_un_data16[2];  // type-specific field
+        kal_uint8   icmp_un_data8[4];   // type-specific field
+   } icmp_dataun;
+} ipc_icmp_header_t;
+PRAGMA_END_PACK_STRUCT
+
+
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _ipc_icmp_echo_header {
+    kal_uint8   icmp_type;      // type field
+    kal_uint8   icmp_code;      // code field
+    kal_uint16  icmp_cksum;     // checksum field
+    kal_uint16  icmp_id;        // identifier
+    kal_uint16  icmp_seq;       // sequence
+} ipc_icmp_echo_header_t;
+PRAGMA_END_PACK_STRUCT
+
+
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _ipc_icmp6_header {
+    kal_uint8   icmp6_type;     // type field
+    kal_uint8   icmp6_code;     // code field
+    kal_uint16  icmp6_cksum;    // checksum field
+    union {
+        kal_uint32  icmp6_un_data32[1]; // type-specific field
+        kal_uint16  icmp6_un_data16[2]; // type-specific field
+        kal_uint8   icmp6_un_data8[4];  // type-specific field
+   } icmp6_dataun;
+} ipc_icmp6_header_t;
+PRAGMA_END_PACK_STRUCT
+
+
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _ipc_icmp6_echo_header {
+    kal_uint8   icmp6_type;     // type field
+    kal_uint8   icmp6_code;     // code field
+    kal_uint16  icmp6_cksum;    // checksum field
+    kal_uint16  icmp6_id;       // identifier
+    kal_uint16  icmp6_seq;      // sequence
+} ipc_icmp6_echo_header_t;
+PRAGMA_END_PACK_STRUCT
+
+
+/* router solicitation */
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _ipc_ndp_router_solicit {
+    kal_uint8   icmp6_type;         // type field
+    kal_uint8   icmp6_code;         // code field
+    kal_uint16  icmp6_cksum;        // checksum field
+    kal_uint32  reserve;            // reserved
+    /* could be followed by options */
+} ipc_ndp_router_solicit_t;
+PRAGMA_END_PACK_STRUCT
+
+
+/* router advertisement */
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _ipc_ndp_router_advert {
+    kal_uint8   icmp6_type;         // type field
+    kal_uint8   icmp6_code;         // code field
+    kal_uint16  icmp6_cksum;        // checksum field
+    kal_uint8   hop_limit;          // hop limit
+    kal_uint8   reserve:6,
+                is_other_stateful:1,// other stateful configuraiton flag
+                is_managed_addr:1;  // managed address configuration flag
+    kal_uint16  router_lifetime;    // router life time
+    kal_uint32  reachable_time;     // reachable time
+    kal_uint32  retransmit_time;    // retransmit timer
+    /* could be followed by options */
+} ipc_ndp_router_advert_t;
+PRAGMA_END_PACK_STRUCT
+
+
+/* neighbor solicitation */
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _ipc_ndp_neighbor_solicit {
+    kal_uint8       icmp6_type;         // type field
+    kal_uint8       icmp6_code;         // code field
+    kal_uint16      icmp6_cksum;        // checksum field
+    kal_uint32      reserve;            // reserved
+    ipc_ip6_addr_t  target_addr;        // target address
+    /* could be followed by options */
+} ipc_ndp_neighbor_solicit_t;
+PRAGMA_END_PACK_STRUCT
+
+
+/* neighbor advertisement */
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _ipc_ndp_neighbor_advert {
+    kal_uint8       icmp6_type;         // type field
+    kal_uint8       icmp6_code;         // code field
+    kal_uint16      icmp6_cksum;        // checksum field
+    kal_uint32      reserve:29,
+                    is_override:1,      // override flag
+                    is_solicited:1,     // solicited flag
+                    is_router:1;        // router flag
+    ipc_ip6_addr_t  target_addr;        // target address
+    /* could be followed by options */
+} ipc_ndp_neighbor_advert_t;
+PRAGMA_END_PACK_STRUCT
+
+
+/* redirect */
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _ipc_ndp_redirect {
+    kal_uint8       icmp6_type;         // type field
+    kal_uint8       icmp6_code;         // code field
+    kal_uint16      icmp6_cksum;        // checksum field
+    kal_uint32      reserve;            // reserved
+    ipc_ip6_addr_t  target_addr;        // target address
+    ipc_ip6_addr_t  dst_addr;           // destination address
+    /* could be followed by options */
+} ipc_ndp_redirect_t;
+PRAGMA_END_PACK_STRUCT
+
+
+/* Option Link-Layer Address */
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _ipc_ndp_opt_link_layer_addr {
+    kal_uint8               type;
+    kal_uint8               len;        // len = 1 for ieee 802 address
+    ipc_ieee_802_addr_t     addr;
+} ipc_ndp_opt_link_layer_addr_t;
+PRAGMA_END_PACK_STRUCT
+
+
+/* Option Prefix Information */
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _ipc_ndp_opt_prefix {
+    kal_uint8       type;
+    kal_uint8       len;                // len = 4
+    kal_uint8       prefix_len;
+    kal_uint8       reserve1:6,
+                    is_on_link:1,
+                    is_autonomous:1;
+    kal_uint32      valid_lifetime;
+    kal_uint32      preferred_lifetime;
+    kal_uint32      reserve2;
+    ipc_ip6_addr_t  prefix;
+} ipc_ndp_opt_prefix_t;
+PRAGMA_END_PACK_STRUCT
+
+
+/* Option MTU */
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _ipc_ndp_opt_mtu {
+    kal_uint8       type;
+    kal_uint8       len;                // len = 1
+    kal_uint16      reserve;
+    kal_uint32      mtu;
+} ipc_ndp_opt_mtu_t;
+PRAGMA_END_PACK_STRUCT
+
+
+/* Option RDNSS */
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _ipc_ndp_opt_rdnss {
+    kal_uint8       type;
+    kal_uint8       len;                // minimum 3
+    kal_uint16      reserve;
+    kal_uint32      life_time;
+    ipc_ip6_addr_t  dns_addr;
+} ipc_ndp_opt_rdnss_t;
+PRAGMA_END_PACK_STRUCT
+
+static INLINE kal_uint16 ipc_icmp_cksum(ipc_icmp_header_t* pIcmp, kal_uint16 len)
+{
+    kal_uint32 cksum    = 0;
+    kal_uint16 word     = 0;
+    kal_uint16 i        = 0;
+
+    for ( i=0; i<((len+1)&~1); i+=2 )
+    {
+        if ( i == (len -1) )
+        {
+            word = ((((kal_uint8*)pIcmp)[i] << 8) & 0xff00) + 0x00 ;
+        } else {
+            word = ((((kal_uint8*)pIcmp)[i] << 8) & 0xff00) + (((kal_uint8*)pIcmp)[i+1] & 0xff) ;
+        }
+        cksum = cksum + word;
+    }
+
+    while ( cksum >> 16 )
+        cksum = ( cksum & 0xffff ) + (cksum >> 16);
+
+    return (kal_uint16)~cksum;
+}
+
+
+static INLINE kal_uint16 ipc_icmp6_cksum(ipc_ip6_addr_t* src, ipc_ip6_addr_t* dst, kal_uint32 len, kal_uint16* data)
+{
+    kal_uint32 chksum = 0;
+    kal_uint32 i;
+    union {
+        kal_uint32 dword;
+        kal_uint16 word[2];
+        kal_uint8  byte[4];
+    } tmp;
+
+    for ( i=0; i<8; i++ )
+    {
+        chksum += src->s6_addr16[i];
+    }
+
+    for ( i=0; i<8; i++ )
+    {
+        chksum += dst->s6_addr16[i];
+    }
+
+    tmp.dword = IPC_NTOHL(len);
+    chksum += tmp.word[0];
+    chksum += tmp.word[1];
+
+    tmp.dword = 0;
+    tmp.byte[3] = IPC_IPPROTO_ICMP6;
+    chksum += tmp.word[0];
+    chksum += tmp.word[1];
+
+    for ( i=0; i<(len & ~1); i+=2 )
+    {
+        chksum += *data++;
+    }
+
+    if ( len & 1 )
+        chksum += *(kal_uint8*)data;
+
+    while ( chksum > 0xffff )
+    {
+        chksum = ( chksum & 0xffff ) + (chksum >> 16);
+    }
+
+    chksum = ~chksum & 0xffff;
+
+    return (kal_uint16)chksum;
+
+}
+
+#endif  // _IPCORE_ICMPH_H
+
diff --git a/mcu/middleware/hif/interface/ipcore_iph.h b/mcu/middleware/hif/interface/ipcore_iph.h
new file mode 100644
index 0000000..1b5569c
--- /dev/null
+++ b/mcu/middleware/hif/interface/ipcore_iph.h
@@ -0,0 +1,336 @@
+/*!
+ *  @file ipcore_iph.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 IP Header definitions of ipcore
+ */
+
+#ifndef _IPCORE_IPH_H
+#define _IPCORE_IPH_H
+
+#include "kal_public_api.h"
+
+#if !defined(__MTK_TARGET__) && defined(_MSC_VER) && (_MSC_VER >= 1500)
+#pragma warning( disable : 4214 )
+#endif
+
+#define IPC_IP4_VERSION         4
+#define IPC_IP6_VERSION         6
+
+#define IPC_IPPROTO_HOPOPTS     0       /* IP6 hop-by-hop options */
+#define IPC_IPPROTO_ICMP        1       /* ICMP */
+#define IPC_IPPROTO_TCP         6       /* TCP */
+#define IPC_IPPROTO_UDP         17      /* UDP */
+#define IPC_IPPROTO_ROUTING     43      /* IP6 routing header */
+#define IPC_IPPROTO_FRAGMENT    44      /* IP6 fragmentation header */
+#define IPC_IPPROTO_ESP         50      /* IP6 Encap Sec. Payload */
+#define IPC_IPPROTO_AH          51      /* IP6 Auth Header */
+#define IPC_IPPROTO_ICMP6       58      /* ICMP6 */
+#define IPC_IPPROTO_NONE        59      /* IP6 no next header */
+#define IPC_IPPROTO_DSTOPTS     60      /* IP6 destination option */
+
+#define IPC_IPPORT_BOOTPS       67      /* Bootstrap Protocol Server */
+#define IPC_IPPORT_BOOTPC       68      /* Bootstrap Protocol Client */
+
+#define IPC_EUI64_GBIT          0x01
+#define IPC_EUI64_UBIT          0x02
+
+#define IPC_IP6_IS_ADDR_UNSPECIFIED(_addr)  \
+    ((*(const kal_uint32 *)(const void *)(&(_addr)->s6_addr8[0]) == 0) &&   \
+     (*(const kal_uint32 *)(const void *)(&(_addr)->s6_addr8[4]) == 0) &&   \
+     (*(const kal_uint32 *)(const void *)(&(_addr)->s6_addr8[8]) == 0) &&   \
+     (*(const kal_uint32 *)(const void *)(&(_addr)->s6_addr8[12]) == 0))
+
+#define IPC_SWAP16(_x)          ((_x & 0xff00) >> 8 | (_x & 0x00ff) << 8)
+#define IPC_SWAP32(_x)          ((_x & 0xff000000) >> 24 |  \
+                                 (_x & 0x00ff0000) >> 8  |  \
+                                 (_x & 0x0000ff00) << 8  |  \
+                                 (_x & 0x000000ff) << 24)
+
+#define IPC_HTONS(_x)           IPC_SWAP16(_x)
+#define IPC_HTONL(_x)           IPC_SWAP32(_x)
+#define IPC_NTOHS(_x)           IPC_SWAP16(_x)
+#define IPC_NTOHL(_x)           IPC_SWAP32(_x)
+
+
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _ipc_ieee_802_addr {
+    kal_uint8   addr[6];
+} ipc_ieee_802_addr_t;
+PRAGMA_END_PACK_STRUCT
+
+
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _ipc_ip4_addr {
+    union {
+        kal_uint8   _u4_addr8[4];
+        kal_uint16  _u4_addr16[2];
+        kal_uint32  _u4_addr32;
+    } _u4_addr;
+} ipc_ip4_addr_t;
+PRAGMA_END_PACK_STRUCT
+#define s4_addr8  _u4_addr._u4_addr8
+#define s4_addr16 _u4_addr._u4_addr16
+#define s4_addr32 _u4_addr._u4_addr32
+
+
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _ipc_ip6_addr {
+    union {
+        kal_uint8   _u6_addr8[16];
+        kal_uint16  _u6_addr16[8];
+        kal_uint32  _u6_addr32[4];
+    } _u6_addr;
+} ipc_ip6_addr_t;
+PRAGMA_END_PACK_STRUCT
+#define s6_addr8  _u6_addr._u6_addr8
+#define s6_addr16 _u6_addr._u6_addr16
+#define s6_addr32 _u6_addr._u6_addr32
+
+
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _ipc_ip4_header {
+    kal_uint8       ip_hl:4,    // header length
+                    ip_ver:4;   // version
+    kal_uint8       ip_tos;     // type of service
+    kal_uint16      ip_len;     // total length
+    kal_uint16      ip_id;      // identification
+    kal_uint16      ip_off;     // fragment offset field
+    kal_uint8       ip_ttl;     // time to live
+    kal_uint8       ip_pro;     // protocol
+    kal_uint16      ip_sum;     // checksum
+    ipc_ip4_addr_t  ip_src;     // source address
+    ipc_ip4_addr_t  ip_dst;     // destination address
+} ipc_ip4_header_t;
+PRAGMA_END_PACK_STRUCT
+
+
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _ipc_ip6_header {
+    union {
+        kal_uint8   ip6_ver;                // 4 bits version
+        kal_uint32  ip6_flow;               // 20 bits of flow-ID
+    } ip6_un;
+    kal_uint16      ip6_plen;               // payload length
+    kal_uint8       ip6_nxt;                // next header
+    kal_uint8       ip6_hlim;               // hop limit
+    ipc_ip6_addr_t  ip6_src;                // source address
+    ipc_ip6_addr_t  ip6_dst;                // destionation address
+} ipc_ip6_header_t;
+PRAGMA_END_PACK_STRUCT
+#define IPC_IP6_VERSION_OFFSET      4
+#define ip6_verion                  ip6_un.ip6_ver
+#define ip6_flow                    ip6_un.ip6_flow
+
+
+static INLINE void ipc_eui64_to_link_local(ipc_ip6_addr_t* dst)
+{
+    /* Link Local Prefix */
+    dst->s6_addr8[0]    = 0xFE;
+    dst->s6_addr8[1]    = 0x80;
+    /* Admin Subnet */
+    dst->s6_addr8[2]    = 0x00;
+    dst->s6_addr8[3]    = 0x00;
+    dst->s6_addr8[4]    = 0x00;
+    dst->s6_addr8[5]    = 0x00;
+    dst->s6_addr8[6]    = 0x00;
+    dst->s6_addr8[7]    = 0x00;
+}
+
+
+static INLINE void ipc_mac_to_eui64(ipc_ieee_802_addr_t* src, ipc_ip6_addr_t* dst)
+{
+    /* Link Local Prefix */
+    dst->s6_addr8[0]    = 0x00;
+    dst->s6_addr8[1]    = 0x00;
+    /* Admin Subnet */
+    dst->s6_addr8[2]    = 0x00;
+    dst->s6_addr8[3]    = 0x00;
+    dst->s6_addr8[4]    = 0x00;
+    dst->s6_addr8[5]    = 0x00;
+    dst->s6_addr8[6]    = 0x00;
+    dst->s6_addr8[7]    = 0x00;
+    /* Interface ID */
+    dst->s6_addr8[8]    = src->addr[0];
+    dst->s6_addr8[8]   &= ~IPC_EUI64_GBIT;
+    dst->s6_addr8[8]   |= IPC_EUI64_UBIT;
+    dst->s6_addr8[9]    = src->addr[1];
+    dst->s6_addr8[10]   = src->addr[2];
+    dst->s6_addr8[11]   = 0xff;
+    dst->s6_addr8[12]   = 0xfe;
+    dst->s6_addr8[13]   = src->addr[3];
+    dst->s6_addr8[14]   = src->addr[4];
+    dst->s6_addr8[15]   = src->addr[5];
+}
+
+
+static INLINE void ipc_eui64_to_mac(ipc_ip6_addr_t* src, ipc_ieee_802_addr_t* dst)
+{
+    dst->addr[0]    = src->s6_addr8[8];
+    dst->addr[0]   &= ~IPC_EUI64_UBIT;
+    dst->addr[1]    = src->s6_addr8[9];
+    dst->addr[2]    = src->s6_addr8[10];
+    dst->addr[3]    = src->s6_addr8[13];
+    dst->addr[4]    = src->s6_addr8[14];
+    dst->addr[5]    = src->s6_addr8[15];
+}
+
+
+static INLINE void ipc_find_ipv4_data_header(ipc_ip4_header_t* pIp, kal_uint32* offset)
+{
+    *offset = pIp->ip_hl*4;
+}
+
+
+static INLINE void ipc_find_ipv6_data_header(ipc_ip6_header_t* pIp6, kal_uint8* next_header, kal_uint32* offset)
+{
+    kal_uint8 header_ext_len    = 0;
+
+    /* search all next header, and find the last one */
+    *next_header = pIp6->ip6_nxt;
+    *offset = sizeof(ipc_ip6_header_t);
+    do {
+        kal_bool is_exit = KAL_FALSE;
+
+        switch ( *next_header )
+        {
+            case IPC_IPPROTO_HOPOPTS:
+            case IPC_IPPROTO_ROUTING:
+            case IPC_IPPROTO_DSTOPTS:
+            {
+                *next_header = *((kal_uint8*)pIp6 + *offset);
+                header_ext_len = *((kal_uint8*)pIp6 + *offset+1);
+                *offset = 8 * ( 1 + header_ext_len );
+                break;
+            }
+            case IPC_IPPROTO_FRAGMENT:
+            {
+                *next_header = *((kal_uint8*)pIp6 + *offset);
+                header_ext_len = 0;
+                *offset = 8;
+                break;
+            }
+            case IPC_IPPROTO_AH:
+            {
+                *next_header = *((kal_uint8*)pIp6 + *offset);
+                header_ext_len = *((kal_uint8*)pIp6 + *offset+1);
+                *offset = 4 * ( 2 + header_ext_len );
+                break;
+            }
+            case IPC_IPPROTO_NONE:
+            case IPC_IPPROTO_ESP:
+            default:
+            {
+                is_exit = KAL_TRUE;
+                break;
+            }
+        }
+
+        if ( is_exit == KAL_TRUE ) break;
+
+    } while (1);
+
+}
+
+
+static INLINE kal_uint16 ipc_ip4_cksum(ipc_ip4_header_t* pIp, kal_uint16 len)
+{
+    kal_uint32 cksum    = 0;
+    kal_uint16 word     = 0;
+    kal_uint32 i        = 0;
+
+    for ( i=0; i<len; i+=2 )
+    {
+        word = ((((kal_uint8*)pIp)[i] << 8) & 0xff00) + (((kal_uint8*)pIp)[i+1] & 0xff) ;
+        cksum = cksum + word;
+    }
+
+    while ( cksum >> 16 )
+        cksum = ( cksum & 0xffff ) + (cksum >> 16);
+
+    return (kal_uint16)~cksum;
+}
+
+
+#define IPC_MASK_IP_VER         (0xF0)
+#define IPC_IPV4_VER            (0x40)
+#define IPC_IPV6_VER            (0x60)
+#define IPC_MIN_IPV4_HDR_LEN    (20)
+#define IPC_MIN_IPV6_HDR_LEN    (40)
+#define IPC_MIN_IP_HEADER_LEN   (40)
+
+#define IPC_IS_IPV4_PACKET(n) \
+            (((n) & IPC_MASK_IP_VER) == IPC_IPV4_VER)
+#define IPC_IS_IPV6_PACKET(n) \
+            (((n) & IPC_MASK_IP_VER) == IPC_IPV6_VER)
+static INLINE kal_bool ipc_swap_ip_addr(kal_uint8 *ip_hdr)
+{
+    kal_uint32 tmp;
+
+    if (IPC_IS_IPV4_PACKET(*ip_hdr)) {
+        ipc_ip4_header_t *ipv4 = (ipc_ip4_header_t *)ip_hdr;
+
+        tmp = ipv4->ip_src.s4_addr32;   
+        ipv4->ip_src.s4_addr32 = ipv4->ip_dst.s4_addr32;
+        ipv4->ip_dst.s4_addr32 = tmp;
+    } else if (IPC_IS_IPV6_PACKET(*ip_hdr)) {
+        ipc_ip6_header_t *ipv6 = (ipc_ip6_header_t *)ip_hdr;
+
+        tmp = ipv6->ip6_src.s6_addr32[0];
+        ipv6->ip6_src.s6_addr32[0] = ipv6->ip6_dst.s6_addr32[0];
+        ipv6->ip6_dst.s6_addr32[0] = tmp;
+
+        tmp = ipv6->ip6_src.s6_addr32[1];
+        ipv6->ip6_src.s6_addr32[1] = ipv6->ip6_dst.s6_addr32[1];
+        ipv6->ip6_dst.s6_addr32[1] = tmp;
+
+        tmp = ipv6->ip6_src.s6_addr32[2];
+        ipv6->ip6_src.s6_addr32[2] = ipv6->ip6_dst.s6_addr32[2];
+        ipv6->ip6_dst.s6_addr32[2] = tmp;
+
+        tmp = ipv6->ip6_src.s6_addr32[3];
+        ipv6->ip6_src.s6_addr32[3] = ipv6->ip6_dst.s6_addr32[3];
+        ipv6->ip6_dst.s6_addr32[3] = tmp;
+    } else {
+        return KAL_FALSE;
+    }
+
+    return KAL_TRUE;
+}
+
+
+#endif  // _IPCORE_IPH_H
+
diff --git a/mcu/middleware/hif/interface/ipcore_udph.h b/mcu/middleware/hif/interface/ipcore_udph.h
new file mode 100644
index 0000000..0ff957c
--- /dev/null
+++ b/mcu/middleware/hif/interface/ipcore_udph.h
@@ -0,0 +1,96 @@
+/*!
+ *  @file ipcore_udph.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 UDP Header definitions of ipcore
+ */
+
+#ifndef _IPCORE_UDPH_H
+#define _IPCORE_UDPH_H
+
+#include "kal_public_api.h"
+
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _ipc_udp_header {
+    kal_uint16      udp_src_port;           // udp source port
+    kal_uint16      udp_dst_port;           // udp destination port
+    kal_uint16      udp_len;                // udp length
+    kal_uint16      udp_sum;                // udp checksum
+} ipc_udp_header_t;
+PRAGMA_END_PACK_STRUCT
+
+
+
+static INLINE kal_uint16 ipc_udp_cksum(ipc_udp_header_t* pUdp, kal_uint16 len, ipc_ip4_addr_t* ip_src, ipc_ip4_addr_t* ip_dst)
+{
+    kal_uint32 cksum    = 0;
+    kal_uint16 word     = 0;
+    kal_uint16 i        = 0;
+
+    for (i=0; i< ((len+1)&~1); i=i+2)
+    {
+        if ( i == (len -1) )
+        {
+            word = ( (((kal_uint8*)pUdp)[i] << 8 ) & 0xff00 ) + 0x00;
+        } else {
+            word = ( (((kal_uint8*)pUdp)[i] << 8 ) & 0xff00 ) + (((kal_uint8*)pUdp)[i+1] & 0xff);
+        }
+        cksum = cksum + word;
+    }
+
+    for (i=0; i<sizeof(ipc_ip4_addr_t); i=i+2)
+    {
+        word = ( (((kal_uint8*)ip_src)[i] << 8 ) & 0xff00 ) + (((kal_uint8*)ip_src)[i+1] & 0xff);
+        cksum = cksum + word;
+    }
+
+    for (i=0; i<sizeof(ipc_ip4_addr_t); i=i+2)
+    {
+        word = ( (((kal_uint8*)ip_dst)[i] << 8 ) & 0xff00 ) + (((kal_uint8*)ip_dst)[i+1] & 0xff);
+        cksum = cksum + word;
+    }
+
+    cksum = cksum + IPC_IPPROTO_UDP +len;
+
+    while ( cksum >> 16 )
+        cksum = ( cksum & 0xffff ) + ( cksum >> 16 );
+
+    return (kal_uint16)~cksum;
+}
+
+
+#endif  // _IPCORE_UDPH_H
+
diff --git a/mcu/middleware/hif/interface/ipfc_export_plugin_dl_filter.h b/mcu/middleware/hif/interface/ipfc_export_plugin_dl_filter.h
new file mode 100644
index 0000000..9f9a387
--- /dev/null
+++ b/mcu/middleware/hif/interface/ipfc_export_plugin_dl_filter.h
@@ -0,0 +1,18 @@
+#ifndef __INC_IPFC_PLUGIN_DL_FILTER
+#define __INC_IPFC_PLUGIN_DL_FILTER
+
+#include "ipfc_export_plugin_dl_filter_type.h"
+#include "kal_public_api.h"
+
+kal_bool ipfc_plugin_dl_filter_enable();
+
+void ipfc_plugin_dl_filter_query_meta_info(void** base, kal_uint16* entry_num, kal_uint32 queue_type);
+void ipfc_plugin_dl_filter_release_meta_entry(kal_uint16 rel_num, kal_uint32 queue_type);
+
+void ipfc_plugin_dl_filter_set_pn_match(kal_uint8 pdn_sim_id, kal_uint16 nc_id, kal_uint8 ipv4, kal_uint8 ipv6);
+
+kal_int32 ipfc_plugin_dl_filter_query_id_by_index(kal_uint32 ipf_index);
+kal_bool ipfc_plugin_dl_filter_take_tlb(void** buff_base, kal_uint32* max_entry_num);
+kal_bool ipfc_plugin_dl_filter_submit_tlb(kal_uint32 filter_num, kal_uint32 v6_unknow_pro_ck);
+
+#endif  //__INC_IPFC_PLUGIN_DL_FILTER
diff --git a/mcu/middleware/hif/interface/ipfc_export_plugin_dl_filter_type.h b/mcu/middleware/hif/interface/ipfc_export_plugin_dl_filter_type.h
new file mode 100644
index 0000000..85f79d4
--- /dev/null
+++ b/mcu/middleware/hif/interface/ipfc_export_plugin_dl_filter_type.h
@@ -0,0 +1,13 @@
+#ifndef __INC_IPFC_PLUGIN_DL_FILTER_TYPE
+#define __INC_IPFC_PLUGIN_DL_FILTER_TYPE
+
+typedef enum _ipfc_dl_filter_queue_type
+{
+    IPFC_META_QUEUE_DL      = 0,
+#if (CUR_GEN >= MD_GEN97)
+    IPFC_META_QUEUE_DL_NR,
+#endif    
+    IPFC_META_QUEUE_MAX,
+} ipfc_dl_filter_queue_type;
+
+#endif  //__INC_IPFC_PLUGIN_DL_FILTER_TYPE
diff --git a/mcu/middleware/hif/interface/ipfc_export_plugin_nat.h b/mcu/middleware/hif/interface/ipfc_export_plugin_nat.h
new file mode 100644
index 0000000..00db360
--- /dev/null
+++ b/mcu/middleware/hif/interface/ipfc_export_plugin_nat.h
@@ -0,0 +1,19 @@
+#ifndef  __INC_IPFC_EXPORT_PLUGIN_NAT
+#define  __INC_IPFC_EXPORT_PLUGIN_NAT
+
+#include "kal_public_api.h"
+
+kal_bool    ipfc_plugin_nat_enable();
+
+void        ipfc_plugin_nat_set_config(kal_uint32 nat_enable);
+kal_uint32  ipfc_plugin_nat_get_config();
+
+void        ipfc_plugin_nat_set_public_ip(kal_uint32 ip_addr);
+kal_uint32  ipfc_plugin_nat_get_public_ip();
+
+void        ipfc_plugin_nat_set_private_ip(kal_uint32 ip_addr, kal_uint32 lan_type);
+kal_uint32  ipfc_plugin_nat_get_private_ip(kal_uint32 lan_type);
+
+kal_uint32  ipfc_plugin_nat_get_rule_num();
+
+#endif
diff --git a/mcu/middleware/hif/interface/lms_api.h b/mcu/middleware/hif/interface/lms_api.h
new file mode 100644
index 0000000..219c6fd
--- /dev/null
+++ b/mcu/middleware/hif/interface/lms_api.h
@@ -0,0 +1,135 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2005
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. 
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ *   lms_api.h
+ *
+ * Project:
+ * --------
+ *   TATAKA
+ *
+ * Description:
+ * ------------
+ *   LTM Simulation public structure and interface definition.
+ *   It is used as a fork implementation of ltm_if.h.
+ *
+ * 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!
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!! 
+ *==============================================================================
+ *******************************************************************************/
+#ifndef __INC_LMS_API_H
+#define __INC_LMS_API_H
+
+#include "upcm.h"
+#include "ipcore_upcm_struct.h"
+
+/*------------------------------------------------------------------------------
+ * Data structure defintion.
+ *----------------------------------------------------------------------------*/
+typedef void (*upcm_dlvr_dl_sdu_f)(kal_uint32 pdn_id, qbm_gpd* p_head, qbm_gpd* p_tail, kal_uint8 proto_id);
+
+/*------------------------------------------------------------------------------
+ * Public fucntions.
+ *----------------------------------------------------------------------------*/
+void lms_on_downlink(void* p_head, void* p_tail);
+
+void lms_rcv_ul_sdu_meta(kal_uint32 pit_start, kal_uint32 pit_end, LHIF_QUEUE_TYPE queue_type);
+
+void lms_rcv_ul_sdu(ip_type_e ip_type, kal_uint32 pdn_id, qbm_gpd *p_head, qbm_gpd *p_tail, kal_uint8 proto_id);
+
+void lms_rcv_ul_sdu_by_ebi(kal_uint32 ebi, qbm_gpd *p_head, qbm_gpd *p_tail, kal_uint8 proto_id);
+
+void lms_reg_cbk_notify_tick_source(upcm_nofify_lte_tick_f pf_notify);
+
+void lms_reg_cbk_dlvr_dl_sdu(upcm_dlvr_dl_sdu_93_f pf_dlvr_sdu);
+
+void lms_reg_cbk_dlvr_dl_sdu_legacy(upcm_dlvr_dl_sdu_f pf_dlvr_sdu);
+
+void lms_forced_sw_path_by_pdn(kal_uint8 _pdn_id_tmp, kal_bool KAL_TRUE, kal_uint8 _proto_idx);
+
+void lms_forced_sw_path_by_ebi(kal_uint8 _ebi_tmp, kal_bool KAL_TRUE, kal_uint8 _proto_idx);
+
+void lms_forced_sw_path_all(kal_bool option);
+
+#endif /* __INC_LMS_API_H */
diff --git a/mcu/middleware/hif/interface/mbim_common.h b/mcu/middleware/hif/interface/mbim_common.h
new file mode 100644
index 0000000..e4a747a
--- /dev/null
+++ b/mcu/middleware/hif/interface/mbim_common.h
@@ -0,0 +1,13 @@
+#ifndef _MBIM_COMMON_H
+#define _MBIM_COMMON_H
+
+#include "kal_public_api.h"
+
+#if !defined(__MTK_TARGET__) && defined(_MSC_VER) && (_MSC_VER >= 1500)
+#pragma warning( disable : 4214 )
+#endif
+
+
+void mbim_get_host_mac(kal_uint32 netid_if, kal_uint8* mac_addr);
+#endif  // _ETHERCORE_COMMON_H
+
diff --git a/mcu/middleware/hif/interface/mbim_data_path_trace_utmd.json b/mcu/middleware/hif/interface/mbim_data_path_trace_utmd.json
new file mode 100644
index 0000000..caae09a
--- /dev/null
+++ b/mcu/middleware/hif/interface/mbim_data_path_trace_utmd.json
@@ -0,0 +1,361 @@
+{
+  "legacyParameters": {
+    "codeSection": "TCMFORCE", 
+    "l2BufferSetting": "L2_BUFFER_HIF", 
+    "l2MaxArg": 7, 
+    "modemType": "Generic"
+  }, 
+  "module": "MBIM_L2", 
+  "stringTranslationDefs": [], 
+  "startGen": "Legacy",
+  "endGen": "Legacy",
+  "traceClassDefs": [
+    {
+      "MBIM_L": {
+        "debugLevel": "Low", 
+        "filterDefaultValue": "ON", 
+        "tag": [
+          "Baseline"
+        ], 
+        "traceType": "InternalDesign"
+      }
+    }, 
+    {
+      "MBIM_M": {
+        "debugLevel": "Medium", 
+        "filterDefaultValue": "ON", 
+        "tag": [
+          "Baseline"
+        ], 
+        "traceType": "InternalDesign"
+      }
+    }, 
+    {
+      "MBIM_H": {
+        "debugLevel": "High", 
+        "filterDefaultValue": "ON", 
+        "tag": [
+          "Baseline"
+        ], 
+        "traceType": "InternalDesign"
+      }
+    }, 
+    {
+      "MBIM_UH": {
+        "debugLevel": "Ultra-High", 
+        "filterDefaultValue": "ON", 
+        "tag": [
+          "Baseline"
+        ], 
+        "traceType": "DesignInfo"
+      }
+    }
+  ], 
+  "traceDefs": [
+    {
+      "MBIM_RB_DOWNLINK": {
+        "format": "[MBIM] mbim_rb_downlink(): queue_no(%d), did(%xl), pkt_num(%d), seg_num(%d)", 
+        "traceClass": "MBIM_M"
+      }
+    }, 
+    {
+      "MBIM_RB_DL_ENUMERATION": {
+        "format": "[MBIM] mbim_rb_downlink(): dl enumeration: i(%d), did(%xl), curr_sit(%xl), hif_type(%d), handled_seg_cnt(%d), seg_num(%d), agg_cnt(%d)", 
+        "traceClass": "MBIM_M"
+      }
+    }, 
+    {
+      "MBIM_RB_DL_MULTI_PACKET": {
+        "format": "[MBIM] mbim_rb_downlink(): dl multi-packet transfer in DID_SIT: i(%d), curr_sit(%ul), address(%xl), length(%ul)", 
+        "traceClass": "MBIM_M"
+      }
+    }, 
+    {
+      "MBIM_RB_DL_AGG_CONTINUE_1": {
+        "format": "[MBIM] mbim_rb_downlink(): add aggregation msg: i(%d), agg_cnt(%d), header_drb_idx(%d), header_len(%ul), curr_total_len(%ul)", 
+        "traceClass": "MBIM_M"
+      }
+    }, 
+    {
+      "MBIM_RB_DL_AGG_CONTINUE_2": {
+        "format": "[MBIM] mbim_rb_downlink(): end to add aggregation msg: i(%d), agg_cnt(%d), payload_len(%ul), header_addr(%xl), sit_cnt(%d), submit_drb_cnt(%d), last_total_len(%ul)", 
+        "traceClass": "MBIM_M"
+      }
+    }, 
+    {
+      "MBIM_RB_DL_AGG_FIRST_NDP_1": {
+        "format": "[MBIM] mbim_rb_downlink(): add first NDP header: i(%d), agg_cnt(%d), header_len(%ul), curr_total_len(%ul)", 
+        "traceClass": "MBIM_M"
+      }
+    }, 
+    {
+      "MBIM_RB_DL_AGG_FIRST_NDP_2": {
+        "format": "[MBIM] mbim_rb_downlink(): end to add first NDP header: i(%d), payload_len(%ul), ndp_drb_idx(%d), header_len(%ul), sit_cnt(%d), submit_drb_cnt(%d)", 
+        "traceClass": "MBIM_M"
+      }
+    }, 
+    {
+      "MBIM_RB_DL_AGG_END_EOL": {
+        "format": "[MBIM] mbim_rb_downlink(): aggregation done: i(%d), trans_cnt(%d), agg_cnt(%d), handled_seg_cnt(%d), submit_drb_cnt(%d)", 
+        "traceClass": "MBIM_M"
+      }
+    }, 
+    {
+      "MBIM_RB_UL_ENUMERATION": {
+        "format": "[MBIM] mbim_rb_bulk_out_complete(): ul enumeration: curr_idx(%d), ul_meta(%xl), qtype(%d), net_type(%d), next_idx(%d), end_of_list(%d)", 
+        "traceClass": "MBIM_M"
+      }
+    }, 
+    {
+      "MBIM_LOOPBACK_ENUMERATION": {
+        "format": "[MBIM] mbim_rb_process_loopback(): loopback enumeration: curr_idx(%d), ul_meta(%xl), net_type(%d), next_idx(%d), end_of_list(%d)", 
+        "traceClass": "MBIM_M"
+      }
+    }, 
+    {
+      "MBIM_LOOPBACK_DL_MSG_INFO": {
+        "format": "[MBIM] mbim_rb_loopback_downlink(): payload_drb_idx(%d), payload_prb(%xl), payload_len(%d)", 
+        "traceClass": "MBIM_M"
+      }
+    }, 
+    {
+      "MBIM_RB_START_DATA_PATH_SUCCESS": {
+        "format": "[MBIM][CLEAR STALL] mbim_on_bulk_stall success: class id = %ul, BULK type =%ul, queue num = %ul, is stall = %ul", 
+        "traceClass": "MBIM_UH", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "MBIM_RB_START_DATA_PATH_FAIL": {
+        "format": "[MBIM][CLEAR STALL] mbim_on_bulk_stall fail: class id = %ul, BULK type =%ul, queue num = %ul, is stall = %ul", 
+        "traceClass": "MBIM_UH", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "MBIM_RB_UL_ENUMERATION1": {
+        "format": "[MBIM] mbim_rb_bulk_out_complete(): ul enumeration 1: rel_idx(%ul), start_idx(%ul), end_idx(%ul)", 
+        "traceClass": "MBIM_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "MBIM_RB_UL_ENUMERATION2": {
+        "format": "[MBIM] mbim_rb_bulk_out_complete(): ul enumeration 2: curr_idx(%ul), xit(%xl), next_idx(%ul), end_of_list(%d)", 
+        "traceClass": "MBIM_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "MBIM_RB_UL_DISCARD_ON_INVALID_NTH": {
+        "format": "[MBIM] mbim_rb_cal_header_len(): NTB Header: signature(%ul), header_length(%ul), sequence(%ul),block_length(%ul),fp_index(%ul)", 
+        "traceClass": "MBIM_UH", 
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "MBIM_RB_UL_DISCARD_ON_INVALID_NDP": {
+        "format": "[MBIM] mbim_rb_cal_header_len(): NDP Header: signature(%ul), length(%ul), next_fp_index(%ul),datagrams[0].index(%ul),datagrams[0].length(%ul) ,block_length(%ul)", 
+        "traceClass": "MBIM_UH", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "MBIM_RB_UL_DISCARD_ON_UNALIGN_NDP": {
+        "format": "[MBIM] mbim_rb_cal_header_len(): NDP Header address: (%ul)", 
+        "traceClass": "MBIM_UH", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "MBIM_RB_UL_DISCARD_ON_UNALIGN_DATAGRAM": {
+        "format": "[MBIM] mbim_rb_cal_header_len(): DATAGRAM address: (%ul)", 
+        "traceClass": "MBIM_UH", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "MBIM_RB_UL_DISCARD_ON_INVALID_NDP_1": {
+        "format": "[MBIM] mbim_rb_cal_header_len(): NDP Header: next_fp_index(%ul),datagrams[1].index(%ul),datagrams[1].length(%ul)", 
+        "traceClass": "MBIM_UH", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "MBIM_RB_UL_ENQUEUE_EMPTY_DID": {
+        "format": "[MBIM][USB_UL] mbim_rb_ul_meta_enqueue_lhif_ul_queue_did(): DO NOT enqueue empty DID. start_idx(%d), end_idx(%d), rel_idx(%d), entry_num(%d)", 
+        "traceClass": "MBIM_L", 
+        "traceHighlightOption": "info"
+      }
+    },
+	{
+      "MBIM_RB_UL_BULKOUT_COMPLETE": {
+        "format": "[MBIM][USB_UL] mbim_rb_bulk_out_complete(): rel_idx=%ul, start_idx=%ul, end_idx=%ul, curr_net_type=%ul", 
+        "traceClass": "MBIM_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "MBIM_RB_UL_DONE": {
+        "format": "[MBIM] mbim_rb_bulk_out_complete(): ul process done. rel_idx(%ul), start_idx(%ul), end_idx(%ul), total_payload_len(%ul)", 
+        "traceClass": "MBIM_H", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+	{
+      "MBIM_RB_UL_PROCESS_PACKET": {
+        "format": "[MBIM] mbim_rb_cal_header_len(): ul process IP packet. NTB sequence(%ul), session ID(%ul),packet length(%ul)", 
+        "traceClass": "MBIM_H", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "MBIM_RB_AH_DOWNLINK": {
+        "format": "[MBIM] mbim_rb_downlink(): queue_no(%d), did(%xl), pkt_num(%d), seg_num(%d)", 
+        "traceClass": "MBIM_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "MBIM_RB_AH_DL_ENUMERATION": {
+        "format": "[MBIM] mbim_rb_downlink_auto_header(): dl enumeration: curr_idx(%ul), did(%xl), curr_sit(%xl), hif_type(%d), handled_seg_cnt(%d), seg_num(%d), total_len(%ul)", 
+        "traceClass": "MBIM_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "MBIM_RB_AH_DL_USB_PACKET": {
+        "format": "[MBIM] mbim_rb_downlink_auto_header(): usb dl packet: curr_idx(%ul), data_addr(%xl), data_len(%ul), is_first_pkt(%d), is_last_pkt(%d), ethc_drb_fh_idx(%d)", 
+        "traceClass": "MBIM_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "MBIM_RB_AH_DL_AGG_NO_ROOM_FOR_NEXT": {
+        "format": "[MBIM] mbim_rb_downlink_auto_header(): no room to aggregate next msg: total_len(%ul)+curr_msg_len(%ul)+next_msg_len(%ul)=%ul > dl_max_trans_size(%ul)", 
+        "traceClass": "MBIM_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "MBIM_RB_AH_DL_ADD_PACKET_HEADER_DRB": {
+        "format": "[MBIM] mbim_rb_add_payload_drb_auto_header(): add packet header drb, is_prb(%d), queue_no(%d), first_idx(%ul), additional_idx(%ul), padding_len(%ul), payload_len(%ul)", 
+        "traceClass": "MBIM_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "MBIM_RB_AH_DL_AGG_CONTINUE_1": {
+        "format": "[MBIM] mbim_rb_downlink_auto_header(): add aggregation msg(1): curr_msg_len(%ul), curr_payload_len(%ul), ethc_drb_fh_len(%ul), total_len(%ul)", 
+        "traceClass": "MBIM_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "MBIM_RB_AH_DL_AGG_CONTINUE_2": {
+        "format": "[MBIM] mbim_rb_downlink_auto_header(): add aggregation msg(2): agg_cnt(%d), sit_cnt(%d), submit_drb_cnt(%ul)", 
+        "traceClass": "MBIM_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "MBIM_RB_AH_DL_ADD_PAYLOAD_DRB_1": {
+        "format": "[MBIM] mbim_rb_add_payload_drb_auto_header(): add payload drb(1), is_prb(%d), queue_no(%d), first_idx(%ul), additional_idx(%ul), p_data(%xl), len(%ul), seg_num(%ul)", 
+        "traceClass": "MBIM_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "MBIM_RB_AH_DL_ADD_PAYLOAD_DRB_2": {
+        "format": "[MBIM] mbim_rb_add_payload_drb_auto_header(): add payload drb(2), create 1st drb, is_prb(%d), first_idx(%ul), additional_idx(%ul), payload_drb_idx(%ul), phyAddr(%xl), phyLen(%ul), submit_urb_cnt(%ul)", 
+        "traceClass": "MBIM_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "MBIM_RB_AH_DL_ADD_PAYLOAD_DRB_3": {
+        "format": "[MBIM] mbim_rb_add_payload_drb_auto_header(): add payload drb(3), 1st drb, set fixed header idx, is_prb(%d), first_idx(%ul), additional_idx(%ul), payload_drb_idx(%ul), ethc_drb_fh_idx(%ul)", 
+        "traceClass": "MBIM_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "MBIM_RB_AH_DL_ADD_PAYLOAD_DRB_4": {
+        "format": "[MBIM] mbim_rb_add_payload_drb_auto_header(): add payload drb(4), corss-page case, (%d)drb, first_idx(%ul), additional_idx(%ul), payload_drb_idx(%ul), phyAddr(%xl), phyLen(%ul), submit_urb_cnt(%ul)", 
+        "traceClass": "MBIM_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "MBIM_RB_AH_DL_ADD_PAYLOAD_DRB_5": {
+        "format": "[MBIM] mbim_rb_add_payload_drb_auto_header(): add payload drb(5), last drb, set padding len, is_prb(%d), first_idx(%ul), additional_idx(%ul), payload_drb_idx(%ul), padding_len(%ul)", 
+        "traceClass": "MBIM_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "MBIM_RB_AH_DL_ADD_PAYLOAD_DRB_6": {
+        "format": "[MBIM] mbim_rb_add_payload_drb_auto_header(): add payload drb(6), set EOT, first_idx(%ul), additional_idx(%ul), payload_drb_idx(%ul)", 
+        "traceClass": "MBIM_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "MBIM_RB_DL_ADD_HEADERS_BEGIN": {
+        "format": "[MBIM] mbim_rb_add_headers(): payload_len(%ul), is_first_pkt(%d), is_last_pkt(%d), last_padding(%ul)", 
+        "traceClass": "MBIM_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "MBIM_RB_DL_CAL_HEADER_PADDING": {
+        "format": "[MBIM] mbim_rb_calculate_header_padding(): payload_len(%ul), is_last_pkt(%d), curr_padding(%ul)", 
+        "traceClass": "MBIM_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "MBIM_RB_DL_CASE1": {
+        "format": "[MBIM] mbim_rb_add_headers(): Case 1", 
+        "traceClass": "MBIM_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "MBIM_RB_DL_CASE2": {
+        "format": "[MBIM] mbim_rb_add_headers(): Case 2: %d, curr_padding(%ul)", 
+        "traceClass": "MBIM_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "MBIM_RB_DL_ADD_MBIM_PKT_MSG": {
+        "format": "[MBIM] mbim_rb_add_headers(): MBIM_PACKET_MSG added: message_length(%d), data_offset(%ul), data_length(%ul), msg(%xl)", 
+        "traceClass": "MBIM_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "MBIM_RB_AH_DL_SUBMIT_DRB": {
+        "format": "[MBIM][USB_DL] mbim_rb_downlink_auto_header(): submit DRB to USBCore: queue_no(%d), submit_urb_cnt(%ul)", 
+        "traceClass": "MBIM_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "MBIM_RB_AH_DL_SUBMIT_DONE": {
+        "format": "[MBIM] mbim_rb_downlink_auto_header(): queue_no(%d), did(%xl), pkt_num(%d), seg_num(%d), submit_urb_cnt(%ul), total_payload_len(%ul)", 
+        "traceClass": "MBIM_H", 
+        "traceHighlightOption": "info"
+      }
+    },
+    {
+      "MBIM_LOOPBACK_DL_SUBMIT_DRB": {
+        "format": "[MBIM] mbim_rb_loopback_downlink(): submit DRB to USBCore: queue_no(%d), submit_urb_cnt(%d)", 
+        "traceClass": "MBIM_M"
+      }
+    }
+  ], 
+  "traceFamily": "L2", 
+  "userModule": "MOD_MBIM"
+}
\ No newline at end of file
diff --git a/mcu/middleware/hif/interface/ndpc_common.h b/mcu/middleware/hif/interface/ndpc_common.h
new file mode 100644
index 0000000..9bd67c0
--- /dev/null
+++ b/mcu/middleware/hif/interface/ndpc_common.h
@@ -0,0 +1,58 @@
+/*!
+ *  @file ndpc_common.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 ndpc ( NDP Client )
+ */
+
+#ifndef _NDPC_COMMON_H
+#define _NDPC_COMMON_H
+
+
+/*!
+ *  @brief  ndpc init function
+ */
+void ndpc_init(void);
+
+
+/*!
+ *  @brief  ndpc main function
+ */
+void ndpc_main(ilm_struct* ilm);
+
+
+#endif  // _NDPC_COMMON_H
+
diff --git a/mcu/middleware/hif/interface/nmu_data_path_trace_utmd.json b/mcu/middleware/hif/interface/nmu_data_path_trace_utmd.json
new file mode 100644
index 0000000..3b94f28
--- /dev/null
+++ b/mcu/middleware/hif/interface/nmu_data_path_trace_utmd.json
@@ -0,0 +1,257 @@
+{
+  "legacyParameters": {
+    "codeSection": "TCMFORCE", 
+    "l2BufferSetting": "L2_BUFFER_HIF", 
+    "l2MaxArg": 7, 
+    "modemType": "Generic"
+  }, 
+  "module": "NMU_L2", 
+  "stringTranslationDefs": [], 
+  "startGen": "Legacy",
+  "endGen": "-",
+  "traceClassDefs": [
+    {
+      "NMU_L": {
+        "debugLevel": "Low", 
+        "filterDefaultValue": "ON", 
+        "tag": [
+          "Baseline", 
+          "Sensitive"
+        ], 
+        "traceType": "InternalDesign"
+      }
+    }, 
+    {
+      "NMU_M": {
+        "debugLevel": "Medium", 
+        "filterDefaultValue": "ON", 
+        "tag": [
+          "Baseline"
+        ], 
+        "traceType": "InternalDesign"
+      }
+    }, 
+    {
+      "NMU_H": {
+        "debugLevel": "High", 
+        "filterDefaultValue": "ON", 
+        "tag": [
+          "Baseline"
+        ], 
+        "traceType": "InternalDesign"
+      }
+    }, 
+    {
+      "NMU_UH": {
+        "debugLevel": "Ultra-High", 
+        "filterDefaultValue": "ON", 
+        "tag": [
+          "Baseline"
+        ], 
+        "traceType": "DesignInfo"
+      }
+    }
+  ], 
+  "traceDefs": [
+    {
+      "NMU_SET_PROPERTY": {
+        "format": "[NMU] nmu_set_property(): set property %d, len(%ul).", 
+        "traceClass": "NMU_H"
+      }
+    }, 
+    {
+      "NMU_GET_PROPERTY": {
+        "format": "[NMU] nmu_get_property(): get property %d, len(%ul).", 
+        "traceClass": "NMU_H"
+      }
+    }, 
+    {
+      "NMU_UTIL_SET_HOST_MAC": {
+        "format": "[NMU] nmu_set_host_mac(): set eth%d host_mac to 0-1(%xl) 2-5(%xl)", 
+        "traceClass": "NMU_L"
+      }
+    }, 
+    {
+      "NMU_UTIL_GET_HOST_MAC": {
+        "format": "[NMU] nmu_get_host_mac(): get eth%d host_mac to 0-1(%xl) 2-5(%xl)", 
+        "traceClass": "NMU_L"
+      }
+    }, 
+    {
+      "NMU_UTIL_SET_GW_MAC": {
+        "format": "[NMU] nmu_set_gateway_mac(): set eth%d gateway_mac to 0-1(%xl) 2-5(%xl)", 
+        "traceClass": "NMU_L"
+      }
+    }, 
+    {
+      "NMU_UTIL_GET_GW_MAC": {
+        "format": "[NMU] nmu_get_gateway_mac(): get eth%d gateway_mac to 0-1(%xl) 2-5(%xl)", 
+        "traceClass": "NMU_L"
+      }
+    }, 
+    {
+      "NMU_UTIL_SET_ETH_TX_PKT_CNT": {
+        "format": "[NMU] nmu_set_eth_tx_pkt_cnt(): set eth %d tx_pkt_cnt to u64(%xl %xl).", 
+        "traceClass": "NMU_H"
+      }
+    }, 
+    {
+      "NMU_UTIL_ADD_ETH_TX_PKT_CNT": {
+        "format": "[NMU] nmu_add_eth_tx_pkt_cnt(): add eth %d tx_pkt_cnt to u64(%xl %xl).", 
+        "traceClass": "NMU_H"
+      }
+    }, 
+    {
+      "NMU_UTIL_GET_ETH_TX_PKT_CNT": {
+        "format": "[NMU] nmu_get_eth_tx_pkt_cnt(): get eth %d tx_pkt_cnt u64(%xl %xl).", 
+        "traceClass": "NMU_H"
+      }
+    }, 
+    {
+      "NMU_UTIL_SET_ETH_RX_PKT_CNT": {
+        "format": "[NMU] nmu_set_eth_rx_pkt_cnt(): set eth %d rx_pkt_cnt to u64(%xl %xl).", 
+        "traceClass": "NMU_H"
+      }
+    }, 
+    {
+      "NMU_UTIL_ADD_ETH_RX_PKT_CNT": {
+        "format": "[NMU] nmu_add_eth_rx_pkt_cnt(): add eth %d rx_pkt_cnt to u64(%xl %xl).", 
+        "traceClass": "NMU_H"
+      }
+    }, 
+    {
+      "NMU_UTIL_GET_ETH_RX_PKT_CNT": {
+        "format": "[NMU] nmu_get_eth_rx_pkt_cnt(): get eth %d rx_pkt_cnt u64(%xl %xl).", 
+        "traceClass": "NMU_H"
+      }
+    }, 
+    {
+      "NMU_UTIL_SET_ETH_TX_BYTE_CNT": {
+        "format": "[NMU] nmu_set_eth_tx_byte_cnt(): set eth%d tx_byte_cnt to u64(%xl %xl).", 
+        "traceClass": "NMU_H"
+      }
+    }, 
+    {
+      "NMU_UTIL_ADD_ETH_TX_BYTE_CNT": {
+        "format": "[NMU] nmu_add_eth_tx_byte_cnt(): add eth%d tx_byte_cnt to u64(%xl %xl).", 
+        "traceClass": "NMU_H"
+      }
+    }, 
+    {
+      "NMU_UTIL_GET_ETH_TX_BYTE_CNT": {
+        "format": "[NMU] nmu_get_eth_tx_byte_cnt(): get eth%d tx_byte_cnt u64(%xl %xl).", 
+        "traceClass": "NMU_H"
+      }
+    }, 
+    {
+      "NMU_UTIL_SET_ETH_RX_BYTE_CNT": {
+        "format": "[NMU] nmu_set_eth_rx_byte_cnt(): set eth%d rx_byte_cnt to u64(%xl %xl).", 
+        "traceClass": "NMU_H"
+      }
+    }, 
+    {
+      "NMU_UTIL_ADD_ETH_RX_BYTE_CNT": {
+        "format": "[NMU] nmu_add_eth_rx_byte_cnt(): add eth%d rx_byte_cnt to u64(%xl %xl).", 
+        "traceClass": "NMU_H"
+      }
+    }, 
+    {
+      "NMU_UTIL_GET_ETH_RX_BYTE_CNT": {
+        "format": "[NMU] nmu_get_eth_rx_byte_cnt(): get eth%d rx_byte_cnt u64(%xl %xl).", 
+        "traceClass": "NMU_H"
+      }
+    }, 
+    {
+      "NMU_UTIL_SET_ETH_TX_ERROR_PKT_CNT": {
+        "format": "[NMU] nmu_set_eth_tx_error_pkt_cnt(): set eth%d tx_error_pkt_cnt to u64(%xl %xl).", 
+        "traceClass": "NMU_H"
+      }
+    }, 
+    {
+      "NMU_UTIL_ADD_ETH_TX_ERROR_PKT_CNT": {
+        "format": "[NMU] nmu_add_eth_tx_error_pkt_cnt(): add eth%d tx_error_pkt_cnt to u64(%xl %xl).", 
+        "traceClass": "NMU_H"
+      }
+    }, 
+    {
+      "NMU_UTIL_GET_ETH_TX_ERROR_PKT_CNT": {
+        "format": "[NMU] nmu_get_eth_tx_error_pkt_cnt(): get eth%d tx_error_pkt_cnt u64(%xl %xl).", 
+        "traceClass": "NMU_H"
+      }
+    }, 
+    {
+      "NMU_UTIL_SET_ETH_RX_ERROR_PKT_CNT": {
+        "format": "[NMU] nmu_set_eth_rx_error_pkt_cnt(): set eth%d rx_error_pkt_cnt to u64(%xl %xl).", 
+        "traceClass": "NMU_H"
+      }
+    }, 
+    {
+      "NMU_UTIL_ADD_ETH_RX_ERROR_PKT_CNT": {
+        "format": "[NMU] nmu_add_eth_rx_error_pkt_cnt(): add eth%d rx_error_pkt_cnt to u64(%xl %xl).", 
+        "traceClass": "NMU_H"
+      }
+    }, 
+    {
+      "NMU_UTIL_GET_ETH_RX_ERROR_PKT_CNT": {
+        "format": "[NMU] nmu_get_eth_rx_error_pkt_cnt(): get eth%d rx_error_pkt_cnt u64(%xl %xl).", 
+        "traceClass": "NMU_H"
+      }
+    }, 
+    {
+      "NMU_UTIL_SET_ETH_TX_DROP_PKT_CNT": {
+        "format": "[NMU] nmu_set_eth_tx_drop_pkt_cnt(): set eth%d tx_drop_pkt_cnt to u64(%xl %xl).", 
+        "traceClass": "NMU_H"
+      }
+    }, 
+    {
+      "NMU_UTIL_ADD_ETH_TX_DROP_PKT_CNT": {
+        "format": "[NMU] nmu_add_eth_tx_drop_pkt_cnt(): add eth%d tx_drop_pkt_cnt to u64(%xl %xl).", 
+        "traceClass": "NMU_H"
+      }
+    }, 
+    {
+      "NMU_UTIL_GET_ETH_TX_DROP_PKT_CNT": {
+        "format": "[NMU] nmu_get_eth_tx_drop_pkt_cnt(): get eth%d tx_drop_pkt_cnt u64(%xl %xl).", 
+        "traceClass": "NMU_H"
+      }
+    }, 
+    {
+      "NMU_UTIL_SET_ETH_RX_DROP_PKT_CNT": {
+        "format": "[NMU] nmu_set_eth_rx_drop_pkt_cnt(): set eth%d rx_drop_pkt_cnt to u64(%xl %xl).", 
+        "traceClass": "NMU_H"
+      }
+    }, 
+    {
+      "NMU_UTIL_ADD_ETH_RX_DROP_PKT_CNT": {
+        "format": "[NMU] nmu_add_eth_rx_drop_pkt_cnt(): add eth%d rx_drop_pkt_cnt to u64(%xl %xl).", 
+        "traceClass": "NMU_H"
+      }
+    }, 
+    {
+      "NMU_UTIL_GET_ETH_RX_DROP_PKT_CNT": {
+        "format": "[NMU] nmu_get_eth_rx_drop_pkt_cnt(): get eth%d rx_drop_pkt_cnt u64(%xl %xl).", 
+        "traceClass": "NMU_H"
+      }
+    }, 
+    {
+      "NMU_UTIL_SET_ETH_RX_FRAME_ALIGN_ERROR_CNT": {
+        "format": "[NMU] nmu_set_eth_rx_frame_align_error_cnt(): set eth%d rx_frame_align_error_cnt to u64(%xl %xl).", 
+        "traceClass": "NMU_H"
+      }
+    }, 
+    {
+      "NMU_UTIL_ADD_ETH_RX_FRAME_ALIGN_ERROR_CNT": {
+        "format": "[NMU] nmu_add_eth_rx_frame_align_error_cnt(): add eth%d rx_frame_align_error_cnt to u64(%xl %xl).", 
+        "traceClass": "NMU_H"
+      }
+    }, 
+    {
+      "NMU_UTIL_GET_ETH_RX_FRAME_ALIGN_ERROR_CNT": {
+        "format": "[NMU] nmu_get_eth_rx_frame_align_error_cnt(): get eth%d rx_frame_align_error_cnt u64(%xl %xl).", 
+        "traceClass": "NMU_H"
+      }
+    }
+  ], 
+  "traceFamily": "L2", 
+  "userModule": "MOD_NMU"
+}
\ No newline at end of file
diff --git a/mcu/middleware/hif/interface/rndis_data_path_trace_utmd.json b/mcu/middleware/hif/interface/rndis_data_path_trace_utmd.json
new file mode 100644
index 0000000..79f08b4
--- /dev/null
+++ b/mcu/middleware/hif/interface/rndis_data_path_trace_utmd.json
@@ -0,0 +1,660 @@
+{
+  "legacyParameters": {
+    "codeSection": "TCMFORCE", 
+    "l2BufferSetting": "L2_BUFFER_HIF", 
+    "l2MaxArg": 7, 
+    "modemType": "Generic"
+  }, 
+  "module": "RNDIS_L2", 
+  "stringTranslationDefs": [], 
+  "startGen": "Legacy",
+  "endGen": "-",
+  "traceClassDefs": [
+    {
+      "RNDIS_L": {
+        "debugLevel": "Low", 
+        "filterDefaultValue": "ON", 
+        "tag": [
+          "Baseline"
+        ], 
+        "traceType": "InternalDesign"
+      }
+    }, 
+    {
+      "RNDIS_M": {
+        "debugLevel": "Medium", 
+        "filterDefaultValue": "ON", 
+        "tag": [
+          "Baseline"
+        ], 
+        "traceType": "InternalDesign"
+      }
+    }, 
+    {
+      "RNDIS_H": {
+        "debugLevel": "High", 
+        "filterDefaultValue": "ON", 
+        "tag": [
+          "Baseline"
+        ], 
+        "traceType": "InternalDesign"
+      }
+    }, 
+    {
+      "RNDIS_UH": {
+        "debugLevel": "Ultra-High", 
+        "filterDefaultValue": "ON", 
+        "tag": [
+          "Baseline"
+        ], 
+        "traceType": "DesignInfo"
+      }
+    }
+  ], 
+  "traceDefs": [
+    {
+      "RNDIS_DL_GPD_ADD_HEADERS_BEGIN": {
+        "format": "[RNDIS] rndis_add_headers(): eth_length(%d) is_first_gpd(%ul) is_last_gpd(%ul) last_padding(%ul) data_ptr(%xl)", 
+        "traceClass": "RNDIS_M", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_DL_GPD_WITH_VLAN_PRI": {
+        "format": "[RNDIS] rndis_add_headers(): eth_length(%d) with vlan_pri_info: %2xl %2xl %2xl %2xl", 
+        "traceClass": "RNDIS_M", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_DL_GPD_PPI_VLAN_PRI_ADDED": {
+        "format": "[RNDIS] rndis_add_headers(): eth_length(%d) add ppi for vid: %3xl pri: %xl", 
+        "traceClass": "RNDIS_M", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_DL_GPD_DATA_OFFSET": {
+        "format": "[RNDIS] rndis_add_headers(): data_offset: %d", 
+        "traceClass": "RNDIS_M", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_DL_GPD_CASE1": {
+        "format": "[RNDIS] rndis_add_headers(): Case 1, last_padding(%d)", 
+        "traceClass": "RNDIS_M", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_DL_GPD_CASE2": {
+        "format": "[RNDIS] rndis_add_headers(): Case 2.%d last_padding(%l)", 
+        "traceClass": "RNDIS_M", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_DL_GPD_ADD_RNDIS_PKT_MSG": {
+        "format": "[RNDIS] rndis_add_headers(): RNDIS_PACKET_MSG added: message_length: %d, data_offset: %ul, data_length: %ul, data_ptr: %xl", 
+        "traceClass": "RNDIS_M", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_DL_IOR_ENUMERATION": {
+        "format": "[RNDIS] rndis_on_downlink(): netif_id(%d) curr_ior(%xl) next_ior(%xl) first_ior(%xl)", 
+        "traceClass": "RNDIS_M", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_DL_GPD_ENUMERATION": {
+        "format": "[RNDIS] rndis_on_downlink(): netif_id(%d) curr_gpd: %xl, next_gpd: %xl, first_gpd: %xl, last_gpd: %xl", 
+        "traceClass": "RNDIS_M", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_DL_SPD_SINGLE_PKT_BEGIN": {
+        "format": "[RNDIS] rndis_process_tx_spd(): Begin DL single packet transfer in SPD: spd_entry_num(%d), spd1_header_len(%ul), curr_gpd(%xl)", 
+        "traceClass": "RNDIS_M", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_DL_SPD_SINGLE_PKT_END": {
+        "format": "[RNDIS] rndis_process_tx_spd(): End DL single packet transfer in SPD: spd_entry_num(%d), total_header_len(%ul), total_data_len(%ul), flush_len(%ul)", 
+        "traceClass": "RNDIS_M", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_DL_SPD_MULTI_PKT_BEGIN": {
+        "format": "[RNDIS] rndis_process_tx_spd(): Begin DL multi packet transfer in SPD: spd_entry_num(%d), total_payload_len(%ul), curr_gpd(%xl)", 
+        "traceClass": "RNDIS_M", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_DL_SPD_MULTI_PKT_END": {
+        "format": "[RNDIS] rndis_process_tx_spd(): End DL multi packet transfer in SPD: spd_entry_num(%d), total_header_len(%ul), total_data_len(%ul), flush_len(%ul)", 
+        "traceClass": "RNDIS_M", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_DL_SPD_ADD_RNDIS_PKT_MSG": {
+        "format": "[RNDIS] rndis_add_headers(): RNDIS_PACKET_MSG added: message_length: %d, data_length: %ul", 
+        "traceClass": "RNDIS_M", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_DL_AGG_CHECK_ROOM_FOR_NEXT": {
+        "format": "[RNDIS] rndis_on_downlink(): checking room for next msg: is_first_gpd: %d, is_last_gpd: %ul, last_padding: %ul, total_len: %ul", 
+        "traceClass": "RNDIS_M", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_DL_AGG_NO_ROOM_FOR_NEXT": {
+        "format": "[RNDIS] rndis_on_downlink(): no room to aggregate next msg: total_len(%d)+curr_msg_len(%ul)+next_msg_len(%ul)=%ul > dl_max_trans_size(%ul)", 
+        "traceClass": "RNDIS_M", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_DL_ADD_HEADER": {
+        "format": "[RNDIS] rndis_on_downlink(): add RNDIS headers => curr_msg_len: %d total_len: %ul", 
+        "traceClass": "RNDIS_M", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_DL_AGG_END_NORMAL": {
+        "format": "[RNDIS] rndis_on_downlink(): aggregation ends normally, netif_id(%d)", 
+        "traceClass": "RNDIS_M", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_DL_AGG_END_AND_RESTART": {
+        "format": "[RNDIS] rndis_on_downlink(): end this aggregation and restart it from next msg, netif_id(%d)", 
+        "traceClass": "RNDIS_M", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_DL_SUBMIT_IOR_NG": {
+        "format": "[RNDIS] rndis_on_downlink(): submit IOR, dl_gpd_num=%d, dl_pkt_num=%ul to usbcore because usb_state is not ready. ior=%xl, next_ior=%xl, first_gpd=%xl, last_gpd=%xl", 
+        "traceClass": "RNDIS_H", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_UL_START_DP_CONNECTED": {
+        "format": "[RNDIS] set start data path indicate CONNECTED, netif_id(%d)", 
+        "traceClass": "RNDIS_UH", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_UL_START_DP_RETRY_TIMEOUT": {
+        "format": "[RNDIS] start data path retry timer callback, netif_id(%d)", 
+        "traceClass": "RNDIS_H", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_UL_START_DP_RETRY_TIMER": {
+        "format": "[RNDIS] set start data path retry timer, netif_id(%d)", 
+        "traceClass": "RNDIS_H", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_PPI_IN_FIRST_BUF": {
+        "format": "[RNDIS] PPI case 1, ppi_offset: %d, ppi_length: %ul <= 1st buf length: %ul", 
+        "traceClass": "RNDIS_M", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_PPI_RECORD": {
+        "format": "[RNDIS] PPI size(%d), type(%ul), offset(%ul)", 
+        "traceClass": "RNDIS_M", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_PPI_MATCHED": {
+        "format": "[RNDIS] PPI matched, ppi_length(%d)", 
+        "traceClass": "RNDIS_M", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_PPI_VLAN_PRI_FOUND": {
+        "format": "[RNDIS] PPI vlan_pri_info: %d, vid: %3xl, pri:%xl", 
+        "traceClass": "RNDIS_M", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_PPI_NOT_MATCHED": {
+        "format": "[RNDIS] PPI NOT matched, ppi_type(%d)", 
+        "traceClass": "RNDIS_H", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_PPI_CROSS_BUF": {
+        "format": "[RNDIS] PPI case 2, ppi_offset: %d, ppi_length: %ul > 1st buf length: %ul", 
+        "traceClass": "RNDIS_M", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_UL_STRIP_PKT_MSG": {
+        "format": "[RNDIS] rndis_strip_off_headers(): msg_length:%d, data_offset:%ul, gpd:%xl", 
+        "traceClass": "RNDIS_M", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_UL_STRIP_PADDING_BD_CASE": {
+        "format": "[RNDIS] rndis_strip_off_headers(): BD list case, strip off pendding bytes:%d, curr desc is EOL:%ul", 
+        "traceClass": "RNDIS_M", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_UL_FREE_PADDING_BD": {
+        "format": "[RNDIS] rndis_strip_off_headers(): free padding BD, data_len:%d, is_eol:%ul", 
+        "traceClass": "RNDIS_M", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_UL_STRIP_PADDING_GPD_CASE": {
+        "format": "[RNDIS] rndis_strip_off_headers(): GPD case, strip off pendding bytes, MSG length:%d Previous GPD data length:%ul", 
+        "traceClass": "RNDIS_M", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_UL_RELOAD_BY_START_DATA_PATH_REQ": {
+        "format": "[RNDIS] rndis_reload_ul_buffers() called by MSG_ID_RNDIS_START_DATA_PATH_REQ, netif_id(%d)", 
+        "traceClass": "RNDIS_M", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_UL_GPD_SUBMITTED": {
+        "format": "[RNDIS] UL GPD submitted, in HIF: %d", 
+        "traceClass": "RNDIS_M", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_UL_BULKOUT_EMPTY_IOR": {
+        "format": "[RNDIS] rndis_on_bulk_out_complete(): empty IOR => drop it, num_gpd(%d)", 
+        "traceClass": "RNDIS_H", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_BUF_DOWNLINK": {
+        "format": "[RNDIS] rndis_buf_downlink(): queue_no(%d), payload(%xl), payload_len(%d)", 
+        "traceClass": "RNDIS_UH", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_BUF_DL_MSG_INFO": {
+        "format": "[RNDIS] rndis_buf_downlink(): header_drb_idx(%d), payload_drb_idx(%d), header_addr(%xl), msg_len(%d), payload_prb(%xl), payload_len(%d)", 
+        "traceClass": "RNDIS_UH", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_BUF_DL_SUBMIT_DRB": {
+        "format": "[RNDIS] rndis_buf_downlink(): submit DRB to USBCore: queue_no(%d), submit_urb_cnt(%ul)", 
+        "traceClass": "RNDIS_UH", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_RB_DOWNLINK": {
+        "format": "[RNDIS] rndis_rb_downlink(): queue_no(%d), did(%xl), pkt_num(%d), seg_num(%d)", 
+        "traceClass": "RNDIS_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_RB_DL_ENUMERATION": {
+        "format": "[RNDIS] rndis_rb_downlink(): dl enumeration: curr_idx(%d), did(%xl), curr_sit(%xl), hif_type(%d), handled_seg_cnt(%d), seg_num(%d), total_len(%d)", 
+        "traceClass": "RNDIS_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_RB_DL_USB_PACKET": {
+        "format": "[RNDIS] rndis_rb_downlink(): usb dl packet: curr_idx(%d), data_addr(%xl), data_len(%ul), is_first_pkt(%d), is_last_pkt(%d), last_padding(%d), ethc_drb_fh_idx(%d)", 
+        "traceClass": "RNDIS_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_RB_DL_AGG_NO_ROOM_FOR_NEXT": {
+        "format": "[RNDIS] rndis_rb_downlink(): no room to aggregate next msg: total_len(%d)+curr_msg_len(%ul)+next_msg_len(%ul)=%ul > dl_max_trans_size(%ul)", 
+        "traceClass": "RNDIS_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_RB_DL_AGG_CONTINUE_1": {
+        "format": "[RNDIS] rndis_rb_downlink(): add aggregation msg(1): header_drb_idx(%d), header_addr(%xl), curr_msg_len(%ul), curr_payload_len(%ul), ethc_drb_fh_len(%ul), total_len(%ul)", 
+        "traceClass": "RNDIS_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_RB_DL_AGG_CONTINUE_2": {
+        "format": "[RNDIS] rndis_rb_downlink(): add aggregation msg(2): header_drb_idx(%d), agg_cnt(%d), sit_cnt(%d), submit_drb_cnt(%ul)", 
+        "traceClass": "RNDIS_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_RB_DL_ADD_PAYLOAD_DRB_1": {
+        "format": "[RNDIS] rndis_rb_add_payload_drb(): add payload drb(1), queue_no(%d), first_idx(%ul), additional_idx(%ul), p_data(%xl), len(%ul), seg_num(%ul)", 
+        "traceClass": "RNDIS_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_RB_DL_ADD_PAYLOAD_DRB_2": {
+        "format": "[RNDIS] rndis_rb_add_payload_drb(): add payload drb(2), create 1st prb, first_idx(%ul), additional_idx(%ul), payload_drb_idx(%ul), phyAddr(%xl), phyLen(%ul), submit_urb_cnt(%ul)", 
+        "traceClass": "RNDIS_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_RB_DL_ADD_PAYLOAD_DRB_3": {
+        "format": "[RNDIS] rndis_rb_add_payload_drb(): add payload drb(3), 1st prb, set fixed header idx, first_idx(%ul), additional_idx(%ul), payload_drb_idx(%ul), ethc_drb_fh_idx(%ul)", 
+        "traceClass": "RNDIS_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_RB_DL_ADD_PAYLOAD_DRB_4": {
+        "format": "[RNDIS] rndis_rb_add_payload_drb(): add payload drb(4), corss-page case, 2nd prb, first_idx(%ul), additional_idx(%ul), payload_drb_idx(%ul), phyAddr(%xl), phyLen(%ul), submit_urb_cnt(%ul)", 
+        "traceClass": "RNDIS_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_RB_DL_ADD_PAYLOAD_DRB_5": {
+        "format": "[RNDIS] rndis_rb_add_payload_drb(): add payload drb(5), set EOT, first_idx(%ul), additional_idx(%ul), payload_drb_idx(%ul)", 
+        "traceClass": "RNDIS_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_BUF_AH_DOWNLINK": {
+        "format": "[RNDIS] rndis_buf_downlink_auto_header(): queue_no(%d), payload(%xl), payload_len(%d)", 
+        "traceClass": "RNDIS_UH", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_BUF_AH_DL_MSG_INFO": {
+        "format": "[RNDIS] rndis_buf_downlink_auto_header(): payload_drb_idx(%d), payload_prb(%xl), payload_len(%d)", 
+        "traceClass": "RNDIS_UH", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_BUF_AH_DL_SUBMIT_DRB": {
+        "format": "[RNDIS] rndis_buf_downlink_auto_header(): submit DRB to USBCore: queue_no(%d), submit_urb_cnt(%ul)", 
+        "traceClass": "RNDIS_UH", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_RB_AH_DOWNLINK": {
+        "format": "[RNDIS] rndis_rb_downlink_auto_header(): queue_no(%d), did(%xl), pkt_num(%d), seg_num(%d)", 
+        "traceClass": "RNDIS_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_RB_AH_DL_ENUMERATION": {
+        "format": "[RNDIS] rndis_rb_downlink_auto_header(): dl enumeration: curr_idx(%ul), did(%xl), curr_sit(%xl), hif_type(%d), handled_seg_cnt(%d), seg_num(%d), total_len(%ul)", 
+        "traceClass": "RNDIS_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_RB_AH_DL_USB_PACKET": {
+        "format": "[RNDIS] rndis_rb_downlink_auto_header(): usb dl packet: curr_idx(%ul), data_addr(%xl), data_len(%ul), is_first_pkt(%d), is_last_pkt(%d), ethc_drb_fh_idx(%d)", 
+        "traceClass": "RNDIS_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_RB_AH_DL_AGG_NO_ROOM_FOR_NEXT": {
+        "format": "[RNDIS] rndis_rb_downlink_auto_header(): no room to aggregate next msg: total_len(%ul)+curr_msg_len(%ul)+next_msg_len(%ul)=%ul > dl_max_trans_size(%ul)", 
+        "traceClass": "RNDIS_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_RB_AH_DL_ADD_PACKET_HEADER_DRB": {
+        "format": "[RNDIS] rndis_rb_add_payload_drb_auto_header(): add packet header drb, is_prb(%d), queue_no(%d), first_idx(%ul), additional_idx(%ul), padding_len(%ul), payload_len(%ul)", 
+        "traceClass": "RNDIS_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_RB_AH_DL_AGG_CONTINUE_1": {
+        "format": "[RNDIS] rndis_rb_downlink_auto_header(): add aggregation msg(1): curr_msg_len(%ul), curr_payload_len(%ul), ethc_drb_fh_len(%ul), total_len(%ul)", 
+        "traceClass": "RNDIS_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_RB_AH_DL_AGG_CONTINUE_2": {
+        "format": "[RNDIS] rndis_rb_downlink_auto_header(): add aggregation msg(2): agg_cnt(%d), sit_cnt(%d), submit_drb_cnt(%ul)", 
+        "traceClass": "RNDIS_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_RB_AH_DL_ADD_PAYLOAD_DRB_1": {
+        "format": "[RNDIS] rndis_rb_add_payload_drb_auto_header(): add payload drb(1), is_prb(%d), queue_no(%d), first_idx(%ul), additional_idx(%ul), p_data(%xl), len(%ul), seg_num(%ul)", 
+        "traceClass": "RNDIS_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_RB_AH_DL_ADD_PAYLOAD_DRB_2": {
+        "format": "[RNDIS] rndis_rb_add_payload_drb_auto_header(): add payload drb(2), create 1st drb, is_prb(%d), first_idx(%ul), additional_idx(%ul), payload_drb_idx(%ul), phyAddr(%xl), phyLen(%ul), submit_urb_cnt(%ul)", 
+        "traceClass": "RNDIS_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_RB_AH_DL_ADD_PAYLOAD_DRB_3": {
+        "format": "[RNDIS] rndis_rb_add_payload_drb_auto_header(): add payload drb(3), 1st drb, set fixed header idx, is_prb(%d), first_idx(%ul), additional_idx(%ul), payload_drb_idx(%ul), ethc_drb_fh_idx(%ul)", 
+        "traceClass": "RNDIS_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_RB_AH_DL_ADD_PAYLOAD_DRB_4": {
+        "format": "[RNDIS] rndis_rb_add_payload_drb_auto_header(): add payload drb(4), corss-page case, (%d)drb, first_idx(%ul), additional_idx(%ul), payload_drb_idx(%ul), phyAddr(%xl), phyLen(%ul), submit_urb_cnt(%ul)", 
+        "traceClass": "RNDIS_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_RB_AH_DL_ADD_PAYLOAD_DRB_5": {
+        "format": "[RNDIS] rndis_rb_add_payload_drb_auto_header(): add payload drb(5), last drb, set padding len, is_prb(%d), first_idx(%ul), additional_idx(%ul), payload_drb_idx(%ul), padding_len(%ul)", 
+        "traceClass": "RNDIS_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_RB_AH_DL_ADD_PAYLOAD_DRB_6": {
+        "format": "[RNDIS] rndis_rb_add_payload_drb_auto_header(): add payload drb(6), set EOT, first_idx(%ul), additional_idx(%ul), payload_drb_idx(%ul)", 
+        "traceClass": "RNDIS_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_RB_DL_ADD_HEADERS_BEGIN": {
+        "format": "[RNDIS] rndis_rb_add_headers(): payload_len(%ul), is_first_pkt(%d), is_last_pkt(%d), last_padding(%ul)", 
+        "traceClass": "RNDIS_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_RB_DL_CAL_HEADER_PADDING": {
+        "format": "[RNDIS] rndis_rb_calculate_header_padding(): payload_len(%ul), is_last_pkt(%d), curr_padding(%ul)", 
+        "traceClass": "RNDIS_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_RB_DL_CASE1": {
+        "format": "[RNDIS] rndis_rb_add_headers(): Case 1", 
+        "traceClass": "RNDIS_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_RB_DL_CASE2": {
+        "format": "[RNDIS] rndis_rb_add_headers(): Case 2: %d, curr_padding(%ul)", 
+        "traceClass": "RNDIS_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_RB_DL_ADD_RNDIS_PKT_MSG": {
+        "format": "[RNDIS] rndis_rb_add_headers(): RNDIS_PACKET_MSG added: message_length(%d), data_offset(%ul), data_length(%ul), msg(%xl)", 
+        "traceClass": "RNDIS_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_RB_UL_ENUMERATION1": {
+        "format": "[RNDIS] rndis_rb_bulk_out_complete(): ul enumeration 1: rel_idx(%ul), start_idx(%ul), end_idx(%ul)", 
+        "traceClass": "RNDIS_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_RB_UL_ENUMERATION2": {
+        "format": "[RNDIS] rndis_rb_bulk_out_complete(): ul enumeration 2: curr_idx(%ul), xit(%xl), next_idx(%ul), end_of_list(%d)", 
+        "traceClass": "RNDIS_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_RB_UL_DONE": {
+        "format": "[RNDIS] rndis_rb_bulk_out_complete(): ul process done. rel_idx(%ul), start_idx(%ul), end_idx(%ul), total_payload_len(%ul)", 
+        "traceClass": "RNDIS_H", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_RB_UL_STRIP_PKT_MSG": {
+        "format": "[RNDIS] rndis_rb_strip_off_headers(): msg_length(%d), data_length(%ul), data_offset(%ul)", 
+        "traceClass": "RNDIS_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_RB_UL_CAL_HEADER_LEN": {
+        "format": "[RNDIS] rndis_rb_cal_header_len(): msg_length(%d), data_length(%ul), data_offset(%ul)", 
+        "traceClass": "RNDIS_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_DL_SUBMIT_IOR": {
+        "format": "[RNDIS][USB_DL] rndis_on_downlink(): submit IOR, dl_gpd_num=%d, dl_pkt_num=%ul to usbcore. ior=%xl, next_ior=%xl, first_gpd=%xl, last_gpd=%xl", 
+        "traceClass": "RNDIS_M", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_UL_ALLOC_GPD": {
+        "format": "[RNDIS][USB_UL_RELOAD] rndis_reload_ul_buffers(): usb_ul_gpd_want_allocate=%d, usb_ul_gpd_to_allocate=%ul, usb_ul_gpd_in_hif=%ul", 
+        "traceClass": "RNDIS_M", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_UL_BULKOUT_COMPLETE": {
+        "format": "[RNDIS][USB_UL] rndis_on_bulk_out_complete(): usb_ul_gpd_received=%d, usb_ul_gpd_in_hif=%ul", 
+        "traceClass": "RNDIS_M", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_RB_DL_SUBMIT_DRB": {
+        "format": "[RNDIS][USB_DL] rndis_rb_downlink(): submit DRB to USBCore: queue_no(%d), submit_urb_cnt(%ul)", 
+        "traceClass": "RNDIS_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_RB_AH_DL_SUBMIT_DRB": {
+        "format": "[RNDIS][USB_DL] rndis_rb_downlink_auto_header(): submit DRB to USBCore: queue_no(%d), submit_urb_cnt(%ul)", 
+        "traceClass": "RNDIS_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_RB_AH_DL_SUBMIT_DONE": {
+        "format": "[RNDIS] rndis_rb_downlink_auto_header(): queue_no(%d), did(%xl), pkt_num(%d), seg_num(%d), submit_urb_cnt(%ul), total_payload_len(%ul)", 
+        "traceClass": "RNDIS_H", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_RB_UL_BULKOUT_COMPLETE": {
+        "format": "[RNDIS][USB_UL] rndis_rb_bulk_out_complete(): usb_ul_pkt_cnt=%ul, usb_ul_byte_cnt=%ul, usb_ul_error_pkt_cnt=%ul, usb_ul_drop_pkt_cnt=%ul", 
+        "traceClass": "RNDIS_L", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_RB_START_DATA_PATH_SUCCESS": {
+        "format": "[RNDIS][CLEAR STALL] rndis_on_bulk_stall success: class id = %ul, BULK type =%ul, queue num = %ul, is stall = %ul", 
+        "traceClass": "RNDIS_UH", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_RB_START_DATA_PATH_FAIL": {
+        "format": "[RNDIS][CLEAR STALL] rndis_on_bulk_stall fail: class id = %ul, BULK type =%ul, queue num = %ul, is stall = %ul", 
+        "traceClass": "RNDIS_UH", 
+        "traceHighlightOption": "info"
+      }
+    }, 
+    {
+      "RNDIS_RB_UL_ENQUEUE_EMPTY_DID": {
+        "format": "[RNDIS][USB_UL] rndis_rb_ul_meta_enqueue_lhif_ul_queue_did(): DO NOT enqueue empty DID. start_idx(%d), end_idx(%d), rel_idx(%d), entry_num(%d)", 
+        "traceClass": "RNDIS_L", 
+        "traceHighlightOption": "info"
+      }
+    }
+  ], 
+  "traceFamily": "L2", 
+  "userModule": "MOD_RNDIS"
+}
\ No newline at end of file
diff --git a/mcu/middleware/hif/interface/ufpm_usbclass.h b/mcu/middleware/hif/interface/ufpm_usbclass.h
new file mode 100644
index 0000000..b30d109
--- /dev/null
+++ b/mcu/middleware/hif/interface/ufpm_usbclass.h
@@ -0,0 +1,69 @@
+/*!
+ *  @file usbidle_main.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 main definitions of usbcore
+ */
+
+#ifndef _UFPM_USBCLASS_H
+#define _UFPM_USBCLASS_H
+
+#include "ufpm_usb_struct.h"
+
+/***************************************************
+ * UFPM Function Common API
+ ***************************************************/
+void usbc_direct_class_device_submit_control_request(ufpm_send_ap_ep0_msg_t* ep0_rsp_ptr, kal_bool isIndication);
+
+
+/***************************************************
+ * UFPM Tethering RNDIS API
+ ***************************************************/
+void ufpm_query_tethering_activation_info(tethering_activate_meta_info_t* tethering_meta_info);
+
+void ufpm_set_tethering_deactivation_info(tethering_deactivate_meta_info_t* deactInfo);
+
+kal_bool ufpm_dpfm_lan_dev_register(kal_uint32 netif_id, kal_uint8 net_type);
+
+/***************************************************
+ * UFPM LOGGING ACM API
+ ***************************************************/
+void ufpm_query_logging_activation_info(logging_activate_meta_info_t* logging_meta_info);
+
+void ufpm_set_logging_deactivation_info(logging_deactivate_meta_info_t* deactInfo);
+
+#endif  // _UFPM_USBCLASS_H
+
diff --git a/mcu/middleware/hif/interface/ufpm_usbcore.h b/mcu/middleware/hif/interface/ufpm_usbcore.h
new file mode 100644
index 0000000..3ff4829
--- /dev/null
+++ b/mcu/middleware/hif/interface/ufpm_usbcore.h
@@ -0,0 +1,59 @@
+/*!
+ *  @file usbidle_main.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 main definitions of usbcore
+ */
+
+#ifndef _UFPM_USBCORE_H
+#define _UFPM_USBCORE_H
+
+#include "hifusb_qmu.h"
+#include "ufpm_usb_struct.h"
+
+kal_bool ufpm_init(void);
+
+void ufpm_on_ilm(ilm_struct *current_ilm);
+
+kal_bool ufpm_check_func_support(ufpm_func_mode_e func_mode);
+
+kal_uint8 ufpm_query_ep_logic_to_phy(hif_queue_type_e queue_type, kal_uint8 logic_queue_no);
+
+void ufpm_set_control_request(ufpm_send_ap_ep0_msg_t* ep0_rsp_ptr, kal_bool isIndication);
+
+void ufpm_redirect_l4_ilm(ilm_struct *ilm);
+
+#endif  // _UFPM_USBCORE_H
diff --git a/mcu/middleware/hif/interface/usbcore_class_device.h b/mcu/middleware/hif/interface/usbcore_class_device.h
new file mode 100644
index 0000000..4c0d208
--- /dev/null
+++ b/mcu/middleware/hif/interface/usbcore_class_device.h
@@ -0,0 +1,351 @@
+/*!
+ *  @file usbcore_class_device.h
+ *  @author Roger Huang <chaomin.haung@mediatek.com>
+ *  @version 1.2
+ *  @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 application interface of usbcore for class device
+ */
+
+#ifndef _USBCORE_CLASS_DEVICE_H
+#define _USBCORE_CLASS_DEVICE_H
+
+#include "usbcore_common.h"
+#include "usbcore_usbstd.h"
+#include "usbc_custom.h"
+
+#define USBC_USBCLASS_DEVICE_DRV_DRB_MACRO(HIFUSB_DRB_MACRO, _class_device_id, _q, ...)       (HIFUSB_DRB_MACRO(usbc_class_device_get_phy_queue_num(_class_device_id, _q), __VA_ARGS__))
+
+/*!
+ *  @brief usbc_class_device_info_t describe register information of a
+ *         generic usb class device
+ */
+typedef struct _usbc_class_device_info {
+
+    /*!
+     *  @brief class type of this device
+     */
+    usb_class_type_e        class_type;
+    /*!
+     *  @brief total pipes of this device
+     */
+    kal_uint8               total_pipes;
+    /*!
+     *  @brief reserve for 4 bytes alignment
+     */
+    kal_uint8               reserve[2];
+    /*!
+     *  @brief per class device context
+     */
+    void                   *class_device_context;
+    /*!
+     *  @brief each pipe type of this device
+     */
+    usbc_pipe_type_e        pipe_type[MAX_USBCORE_CLASS_PIPE_NUM];
+    /*!
+     *  @brief callback function while usb state changed.
+     *         Running Level: TASK
+     */
+    void                    (*notify_usb_state)(kal_uint8 class_device_id, usbc_usb_state_e state);
+    /*!
+     *  @brief callback function while usb speed changed.
+     *         Running Level: TASK
+     */
+    void                    (*notify_usb_speed)(kal_uint8 class_device_id, usbc_usb_speed_e speed);
+    /*!
+     *  @brief callback function while control tranfer for this device
+     *         is received
+     *         Running Level: TASK
+     */
+    void                    (*notify_control_setup_packet)(kal_uint8 class_device_id, usbc_setup_packet_t* packet);
+    /*!
+     *  @brief callback function while control tranfer is complete
+     *         Running Level: TASK
+     */
+    void                    (*notify_control_complete)(kal_uint8 class_device_id);
+    /*!
+     *  @brief callback function while interface alternate setting is set
+     *         Running Level: TASK
+     */
+    void                    (*notify_alternate_setting)(kal_uint8 class_device_id, usbc_interface_type_e inteface, kal_uint8 alternate_setting);
+    /*!
+     *  @brief callback function while each pipe tranfer is complete (GPD/SPD)
+     *         Running Level: TASK
+     */
+    void                    (*notify_pipe_complete[MAX_USBCORE_CLASS_PIPE_NUM])(kal_uint8 class_device_id, usbc_io_request_t* io_request);
+    /*!
+     *  @brief callback function while each pipe tranfer is complete (UL META/DRB)
+     *         Running Level: TASK
+     */
+    void                    (*notify_rb_pipe_complete[MAX_USBCORE_CLASS_PIPE_NUM])(kal_uint8 class_device_id, kal_uint32 start_idx, kal_uint32 end_idx, kal_uint32 rel_idx);
+    /*!
+     *  @brief callback function to indicate pipe is stall or not
+     *         Running Level: TASK
+     */
+    void                    (*notify_pipe_stall[MAX_USBCORE_CLASS_PIPE_NUM])(kal_uint8 class_device_id, kal_bool stall);
+    /*!
+     *  @brief callback function to notify a function enable/disable function remote wakeup
+     */
+    void                    (*notify_func_wk_ability)(kal_uint8 class_device_id, kal_bool ability);
+    /*!
+     *  @brief callback function to query the status of class device
+     */
+    kal_uint16              (*query_func_wk_status)(kal_uint8 class_device_id);
+} usbc_class_device_info_t;
+
+typedef struct _usbc_class_device_esl_connect_parm {
+    LOCAL_PARA_HDR
+    kal_uint8   class_device_id;
+} usbc_class_device_esl_connect_parm;
+
+/*!
+ *  @brief  register new usb class device to usbcore
+ *          Running Level: TASK INIT/TASK 
+ *  @param  class_device_id  device instance id to register
+ *  @param  device_info class device information used to register
+ *  @param  class_device_id device instance id obtained while register 
+ *  @return new instance of usb class device if success, NULL if fail
+ */
+usbc_class_device_instance_t* usbc_class_device_register(kal_uint8 class_device_id, usbc_class_device_info_t* device_info);
+
+
+/*!
+ *  @brief  deregister usb class device from usbcore
+ *          Running Level: TASK INIT/TASK
+ *  @param  class_device_id  device instance id obtained while register
+ *  @return KAL_TRUE if success, otherwise KAL_FALSE if fail
+ */
+kal_bool usbc_class_device_deregister(kal_uint8 class_device_id);
+
+/*!
+ *  @brief  retrieve per usb class device context registed in usbc_class_device_register()
+ *          Running Level: ANY
+ *  @param  class_device_id  device instance id obtained while register
+ *  @return per usb class device context
+ */
+void* usbc_class_device_get_context(kal_uint8 class_device_id);
+
+/*!
+ *  @brief  submit control transfer request to usbcore
+ *          Running Level: TASK
+ *  @param  class_device_id     class device id obtained while register
+ *  @param  buffer              pointer to byte array to send or receive data
+ *  @param  length              length of buffer to send, or to receive
+ *  @param  type                send or receive or stall
+ *  @return KAL_TRUE if success, otherwise KAL_FALSE if fail
+ */
+kal_bool usbc_class_device_submit_control_request(kal_uint8 class_device_id, kal_uint8* buffer, kal_uint32 length, usbc_control_request_type_e type);
+
+
+/*!
+ *  @brief  submit io request to usbcore
+ *          Running Level: TASK
+ *  @param  class_device_id     device instance id obtained while register
+ *  @param  queue_no            QMU queue no
+ *  @param  io_request          io request submit to usbcore
+ *  @return KAL_TRUE if success, otherwise KAL_FALSE if fail
+ */
+kal_bool usbc_class_device_submit_io_request(kal_uint8 class_device_id, kal_uint8 queue_no, usbc_io_request_t* io_request);
+
+/*!
+ *  @brief  submit io request to usbcore with more configurations
+ *          Running Level: TASK
+ *  @param  class_device_id     device instance id obtained while register
+ *  @param  queue_no            QMU queue no
+ *  @param  io_request          io request submit to usbcore
+ *  @param  info                configurations apply to the requests
+ *  @return KAL_TRUE if success, otherwise KAL_FALSE if fail
+ */
+kal_bool usbc_class_device_submit_io_request_ext(kal_uint8 class_device_id, kal_uint8 queue_no, usbc_io_request_t *io_request, usbc_io_ext_info_t *info);
+
+/*!
+ *  @brief  flush io request already submitted to usbcore
+ *          Running Level: TASK
+ *  @param  class_device_id     device instance id obtained while register
+ *  @param  queue_no            QMU queue no
+ *  @return KAL_TRUE if success, otherwise KAL_FALSE if fail
+ */
+kal_bool usbc_class_device_flush_io_request(kal_uint8 class_device_id, kal_uint8 queue_no);
+
+
+/*!
+ *  @brief  flush DRB/XIT queue
+ *          Running Level: TASK
+ *  @param  class_device_id     device instance id obtained while register
+ *  @param  queue_no            QMU queue no
+ *  @return KAL_TRUE if success, otherwise KAL_FALSE if fail
+ */
+kal_bool usbc_class_device_flush_rb(kal_uint8 class_device_id, kal_uint8 queue_no);
+
+
+/*!
+ *  @brief  change notify complete function already registered to usbcore
+ *          Running Level: TASK
+ *  @param  class_device_id     device instance id obtained while register
+ *  @param  queue_no            QMU queue no
+ *  @param  notify_complete     notify complete callback function
+ *  @return KAL_TRUE if success, otherwise KAL_FALSE if fail
+ */
+kal_bool usbc_class_device_change_notify_complete(kal_uint8 class_device_id, kal_uint8 queue_no, void (*notify_complete)(kal_uint8 class_device_id, usbc_io_request_t* io_request));
+
+
+/*!
+ *  @brief  ask usbcore to detach from bus
+ *          Running Level: TASK
+ *  @param  class_device_id     device instance id obtained while register
+ *  @return KAL_TRUE if success, otherwise KAL_FALSE if fail
+ */
+kal_bool usbc_class_device_set_hif_disconnect(kal_uint8 class_device_id);
+
+/*!
+ *  @brief  submit DRB to usbcore
+ *          Running Level: TASK
+ *  @param  class_device_id     device instance id obtained while register
+ *  @param  queue_no            QMU queue no
+ *  @param  submit_drb_count    number of DRBs to be submitted
+ *  @return KAL_TRUE if success, otherwise KAL_FALSE if fail
+ */
+kal_bool usbc_class_device_submit_drb(kal_uint8 class_device_id, kal_uint8 queue_no,kal_uint32 submit_drb_count);
+
+kal_bool usbc_class_device_rst_ep_pipe(kal_uint8 class_device_id, kal_uint8 queue_no);
+
+
+kal_bool usbc_class_device_set_header_rule(kal_uint32 header_rule, void *ph_addr, void *xh_addr, kal_uint16 ph_length, kal_uint16 xh_length);
+
+void
+usbc_resource_reset(void);
+
+usbc_interface_info_t*
+usbc_get_interface_number(kal_uint8 config_num, kal_uint8 *if_num_p);
+
+kal_uint8
+usbc_get_string_number(void *string);
+
+usbc_interface_association_descriptor_t*
+usbc_get_iad_number(kal_uint8 config_num, kal_uint8 *iad_num_p);
+
+usbc_endpoint_info_t*
+usbc_get_endpoint_tx_number(kal_uint8 config_num, kal_uint8 *tx_ep_num_p);
+
+usbc_endpoint_info_t*
+usbc_get_endpoint_rx_number(kal_uint8 config_num, kal_uint8 *rx_ep_num_p);
+
+
+/*!
+ *  @brief  ask usbcore to send function remote wakeup notification to the host
+ *          Running Level: TASK
+ *  @param  class_device_id     device instance id obtained while register
+ *  @return KAL_TRUE if success, otherwise KAL_FALSE if fail
+ */
+kal_bool usbc_class_device_func_remote_wk(kal_uint8 class_device_id);
+
+/*!
+ *  @brief  the handler for function remote wakeup notification timeout
+ *  @param  class_device_id     device instance id obtained while register
+ *  @return
+ */
+void usbc_wk_notify_timeout();
+
+/*!
+ *  @brief  set timer for sending function remote wakeup notification
+ *  @param  class_device_id     device instance id obtained while register
+ *  @return
+ */
+void usbc_set_wk_notify_timer(kal_uint8 class_device_id);
+
+/*!
+ *  @brief  The netwotk USB function uses the API to notify L4 that it has been in suspending states
+ *  @param  class_device_id     device instance id obtained while register
+ *  @parm   suspend             the network USB funtion is going to suspending or resuming
+ *  @param  remote_wakeup       Is remote wakeup of the suspended function enabled
+ *  @return
+ */
+void usbc_class_device_netifx_suspend_notify(kal_uint8 class_device_id, kal_bool suspend, kal_bool remote_wakeup);
+
+kal_bool usbc_class_device_check_ep_empty(kal_uint8 class_device_id, kal_uint8 queue_no);
+/*!
+ *  @brief  Get physical USB queue number
+ *  @param  class_device_id     device instance id obtained while register
+ *  @param  queue_no            queue number maintained in USBCLASS internal structure
+ *  @return                     physical USB queuen umber
+ */
+kal_uint8 usbc_class_device_get_phy_queue_num(kal_uint8 class_device_id, kal_uint8 queue_no);
+
+/*!
+ *  @brief  halt USB queue
+ *  @param  class_device_id     device instance id obtained while register
+ *  @param  queue_no            queue number maintained in USBCLASS internal structure
+ *  @return
+ */
+kal_bool usbc_class_device_set_stall(kal_uint8 class_device_id, kal_uint8 queue_no);
+
+/*!
+ *  @brief  resume usb queue
+ *  @param  class_device_id     device instance id obtained while register
+ *  @param  queue_no            queue number maintained in USBCLASS internal structure
+ *  @return
+ */
+kal_bool usbc_class_device_clear_stall(kal_uint8 class_device_id, kal_uint8 queue_no);
+
+/*!
+ *  @brief  Start USB ULQ/DLQ
+ *  @param  class_device_id     device instance id obtained while register
+ *  @param  queue_no            queue number maintained in USBCLASS internal structure
+ *  @return
+ */
+kal_bool usbc_class_device_start_data_q(kal_uint8 class_device_id, kal_uint8 queue_no);
+
+/*!
+ *  @brief  Handle Invalid EP0
+ *  @return
+ */
+void usbc_class_device_stall_ep0(void);
+
+/*!
+ * @brief restore GPDs from SW to HW
+ * @return T or F
+ */
+kal_bool usbc_class_device_restore_gpd_pwrsave(kal_uint8 class_device_id, kal_uint8 queue_no);
+
+usb_class_owner_e usbc_class_get_class_device_owner(kal_uint8 class_device);
+/*!
+ *  @brief  Flush RX EP with GPD re-submit
+ *  @param  class_device_id     device instance id obtained while register
+ *  @param  queue_no            queue number maintained in USBCLASS internal structure
+ *  @return
+ */
+kal_bool usbc_class_device_flush_rx_io_with_submit(kal_uint8 class_device_id, kal_uint8 queue_no);
+
+#endif  // _USBCORE_CLASS_DEVICE_H
+
diff --git a/mcu/middleware/hif/interface/usbcore_common.h b/mcu/middleware/hif/interface/usbcore_common.h
new file mode 100644
index 0000000..a7eeb26
--- /dev/null
+++ b/mcu/middleware/hif/interface/usbcore_common.h
@@ -0,0 +1,682 @@
+/*!
+ *  @file usbcore_common.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 common definitions of usbcore
+ */
+
+#ifndef _USBCORE_COMMON_H
+#define _USBCORE_COMMON_H
+
+#include "qmu_bm.h"
+#include "usbc_custom_def.h"
+#include "usbc_custom.h"
+#include "hif_usb.h"
+#include "usbcore_usbstd.h"
+
+
+/*!
+ * @brief Swap the pointed-to 16-bit quantity from USB byte order
+ *        (little-endian) to host byte order, in an alignment-safe manner.
+ * @param _pData pointer (as unsigned char*)
+ * @return quantity in host byte order
+ */
+#define USBC_EF16P(_pData)  ((*(_pData+1) << 8) | *(_pData))
+
+
+/*!
+ * @brief Swap the pointed-to 24-bit quantity from USB byte order
+ *        (little-endian) to host byte order, in an alignment-safe manner.
+ * @param _pData pointer (as unsigned char*)
+ * @return quantity in host byte order
+ */
+#define USBC_EF24P(_pData)  ((*(_pData+2) << 16) | (*(_pData+1) << 8) | *(_pData))
+
+
+/*!
+ * @brief Swap the pointed-to 32-bit quantity from USB byte order
+ *        (little-endian) to host byte order, in an alignment-safe manner.
+ * @param _pData pointer (as unsigned char*)
+ * @return quantity in host byte order
+ */
+#define USBC_EF32P(_pData)  ((*(_pData+3) << 24) | (*(_pData+2) << 16) | (*(_pData+1) << 8) | *(_pData))
+
+
+/*!
+ *  @brief MAX_USBCORE_CLASS_INTERFACE_NUM defines the maximum value of
+ *         interface per class device that usbcore can support
+ */
+#define MAX_USBCORE_CLASS_INTERFACE_NUM     4
+
+
+/*!
+ *  @brief MAX_USBCORE_CLASS_PIPE_NUM defines the maximum value of pipe
+ *         per class device that usbcore can support
+ */
+#define MAX_USBCORE_CLASS_PIPE_NUM          8
+
+
+/*!
+ *  @brief MAX_USBCORE_CONFIG_NUM defines the maximum value of configuration
+ *         usbcore can handle
+ */
+#define MAX_USBCORE_CONFIG_NUM                      8
+
+
+/*!
+ *  @brief MAX_USBCORE_INTERFACE_NUM defines the maximum value of class
+ *         interface usbcore can handle
+ */
+#define MAX_USBCORE_INTERFACE_NUM                   16
+
+
+/*!
+ *  @brief MAX_USBCORE_QUEUE_NUM defines the maximum value of QMU queues
+ *         that usbcore can support
+ */
+#define MAX_USBCORE_QUEUE_NUM                       16
+
+
+/*!
+ *  @brief MAX_USBCORE_STRING_DESCRIPTOR_NUM defines the maximum value of string
+ *         descriptors usbcore can handle
+ */
+#define MAX_USBCORE_STRING_DESCRIPTOR_NUM           254
+
+
+/*!
+ *  @brief MAX_USBCORE_CONTROL_REQUEST_BUFFER_SIZE defines the maximum value
+ *         of control request buffer
+ */
+#define MAX_USBCORE_CONTROL_REQUEST_BUFFER_SIZE     64
+
+
+
+
+
+
+
+#define MAX_USBCORE_CLASS_EPDESC_LENGTH             12
+#define MAX_USBCORE_IFDESC_LENGTH                  258  // this will change depends on different class interface, refer to 6280
+#define MAX_USBCORE_EPNUM_PER_IF                     3
+#define MAX_USBCORE_IAD_NUM                          8
+
+
+
+/*!
+ *  @brief USBC_USB11_MAX_PACKET_SIZE define maximum packet size in USB SPEED 1.1
+ */
+#define USBC_USB11_MAX_PACKET_SIZE          64
+
+
+/*!
+ *  @brief USBC_USB20_MAX_PACKET_SIZE define maximum packet size in USB SPEED 2.0
+ */
+#define USBC_USB20_MAX_PACKET_SIZE          512
+
+
+/*!
+ *  @brief USBC_USB30_MAX_PACKET_SIZE define maximum packet size in USB SPEED 3.0
+ */
+#define USBC_USB30_MAX_PACKET_SIZE          1024
+
+
+
+/*!
+ *  @brief usbc_usb_state_e enumerate possible states of usb device
+ *  @param USBC_USB_STATE_MIN           pseudo state
+ *  @param USBC_USB_STATE_ATTACHING     start attaching to usb bus
+ *  @param USBC_USB_STATE_ATTACHED      attach to usb bus already
+ *  @param USBC_USB_STATE_DETACHING     start detaching from usb bus
+ *  @param USBC_USB_STATE_DETACHED      detach from usb bus already
+ *  @param USBC_USB_STATE_SUSPENDING    start suspending
+ *  @param USBC_USB_STATE_SUSPENDED     suspend already
+ *  @param USBC_USB_STATE_RESUME        recevie usb resume signal
+ *  @param USBC_USB_STATE_RESET         recevie usb bus reset
+ *  @param USBC_USB_STATE_MAX           pseudo state
+ */
+typedef enum _usbc_usb_state {
+    USBC_USB_STATE_MIN                  = 0,
+    USBC_USB_STATE_ATTACHING            = 1,
+    USBC_USB_STATE_ATTACHED             = 2,
+    USBC_USB_STATE_DETACHING            = 3,
+    USBC_USB_STATE_DETACHED             = 4,
+    USBC_USB_STATE_SUSPENDING           = 5,
+    USBC_USB_STATE_SUSPENDED            = 6,
+    USBC_USB_STATE_RESUME               = 7,
+    USBC_USB_STATE_RESET                = 8,
+    USBC_USB_STATE_PWRDOWN                = 9,
+    USBC_USB_STATE_MAX                  = 10,
+} usbc_usb_state_e;
+
+/*!
+ *  @brief usbc_func_state_e indicate possible states of class device for function suspend
+ *  @param USBC_FUNC_WK_ENABLE          to enable function remote wakeup
+ *  @param USBC_FUNC_WK_DISABLE         to disable function remote wakeup
+ *  @param USBC_FUNC_STATE_SUSPENDING   to suspend a class device
+ *  @param USBC_FUNC_STATE_RESUME       to resume a suspended class device
+ */
+typedef enum _usbc_func_state {
+    USBC_FUNC_WK_ENABLE                     = 0,
+    USBC_FUNC_WK_DISABLE                    = 1,
+    USBC_FUNC_STATE_SUSPENDING              = 5,
+    USBC_FUNC_STATE_RESUME                  = 7,
+    USBC_FUNC_WK_ENABLE_STATE_SUSPENDING    = 21,
+    USBC_FUNC_WK_ENABLE_STATE_RESUME        = 22,
+    USBC_FUNC_WK_DISABLE_STATE_SUSPENDING   = 23,
+    USBC_FUNC_WK_DISABLE_STATE_RESUME       = 24,
+    USBC_FUNC_SET_FEATURE_ERROR             = 25,
+} usbc_func_state_e;
+
+
+/*!
+ *  @brief usbc_op_mode_e USB Core operation mode
+ *  @param USBC_OP_MODE_UNKNOWN        unknown operation mode
+ *  @param USBC_OP_MODE_DETECTION      host and driver detection mode
+ *  @param USBC_OP_MODE_NORMAL         normal operation mode
+ *  @param USBC_OP_MODE_EXCEPTION      exception mode 
+ *  @param USBC_OP_MODE_MDONLY      DIPC only MD port
+ *  @param USBC_OP_MODE_NOLOGGING      DIPC no MD logging port
+ *  @param USBC_OP_MODE_METADEBUG      DIPC meta debug mode
+ *  @param USBC_OP_MODE_UNUSED      DIPC mode do not use USB
+ */
+typedef enum _usbc_op_mode {
+    USBC_OP_MODE_UNKNOWN                = 0,
+    USBC_OP_MODE_DETECTION              = 1,
+    USBC_OP_MODE_NORMAL                 = 2,
+    USBC_OP_MODE_EXCEPTION              = 3,    
+    USBC_OP_MODE_MDONLY                 =4,
+    USBC_OP_MODE_NOLOGGING          = 5,    
+    USBC_OP_MODE_METADEBUG          = 6,
+    USBC_OP_MODE_FACTORY               = 7,
+    USBC_OP_MODE_UNUSED                 =8,
+    USBC_OP_MODE_NUM,
+} usbc_op_mode_e;
+
+/*!
+ *  @brief usbc_usb_speed_e enumerate possible speed of usb device
+ *  @param USBC_USB_SPEED_MIN           pseudo speed
+ *  @param USBC_USB_SPEED_USB11         usb 1.1 full speed
+ *  @param USBC_USB_SPEED_USB20         usb 2.0 high speed
+ *  @param USBC_USB_SPEED_USB30         usb 3.0 super speed
+ *  @param USBC_USB_SPEED_MAX           pseudo speed
+ */
+typedef enum _usbc_usb_speed {
+    USBC_USB_SPEED_MIN                  = 0,
+    USBC_USB_SPEED_USB11                = 1,
+    USBC_USB_SPEED_USB20                = 2,
+    USBC_USB_SPEED_USB30                = 3,
+    USBC_USB_SPEED_MAX                  = 4,
+} usbc_usb_speed_e;
+
+
+/*!
+ *  @brief usbc_request_owner_e enumerate all possible types of usb control
+ *         request type
+ *  @param USBC_CONTROL_REQUEST_TYPE_MIN        pseudo type
+ *  @param USBC_CONTROL_REQUEST_TYPE_SEND       request to send
+ *  @param USBC_CONTROL_REQUEST_TYPE_RECEIVE    request to receive
+ *  @param USBC_CONTROL_REQUEST_TYPE_STALL      request to stall
+ *  @param USBC_CONTROL_REQUEST_TYPE_MAX        pseudo type
+ */
+typedef enum _usbc_control_request_type {
+    USBC_CONTROL_REQUEST_TYPE_MIN       = 0,
+    USBC_CONTROL_REQUEST_TYPE_SEND      = 1,
+    USBC_CONTROL_REQUEST_TYPE_RECEIVE   = 2,
+    USBC_CONTROL_REQUEST_TYPE_STALL     = 3,
+    USBC_CONTROL_REQUEST_TYPE_MAX       = 4,
+} usbc_control_request_type_e;
+
+
+/*!
+ *  @brief usbc_interface_type_e enumerate support list of interface types
+ *  @param USBC_INTERFACE_TYPE_MIN              pseudo interface
+ *  @param USBC_INTERFACE_TYPE_CDC_ACM_CONTROL  CDC ACM control interface
+ *  @param USBC_INTERFACE_TYPE_CDC_ACM_DATA     CDC ACM data interface
+ *  @param USBC_INTERFACE_TYPE_RNDIS_CONTROL    RNDIS control interface
+ *  @param USBC_INTERFACE_TYPE_RNDIS_DATA       RNDIS data interface
+ *  @param USBC_INTERFACE_TYPE_MAX              pseudo interface
+ */
+typedef enum _usbc_interface_type {
+    USBC_INTERFACE_TYPE_MIN                         = 0x0,
+    USBC_INTERFACE_TYPE_CDC_ACM_CONTROL             = 0x1,
+    USBC_INTERFACE_TYPE_CDC_ACM_DATA                = 0x2,
+    USBC_INTERFACE_TYPE_RNDIS_CONTROL               = 0x3,
+    USBC_INTERFACE_TYPE_RNDIS_DATA                  = 0x4,
+    USBC_INTERFACE_TYPE_MBIM_CONTROL                = 0x5,
+    USBC_INTERFACE_TYPE_MBIM_DATA                   = 0x6,
+    USBC_INTERFACE_TYPE_MSD_CONTROL                 = 0x7,
+    USBC_INTERFACE_TYPE_MSD_DATA                    = 0x8,
+    USBC_INTERFACE_TYPE_CDC_ECM_CONTROL               = 0x9,
+    USBC_INTERFACE_TYPE_CDC_ECM_DATA                  = 0xA,        
+    USBC_INTERFACE_TYPE_ADB_DATA                  = 0xB,    
+    USBC_INTERFACE_TYPE_MAX
+} usbc_interface_type_e;
+
+
+/*!
+ *  @brief usbc_pipe_type_e enumerate all possible types of usb classs
+ *         device pipe
+ *  @param USBC_PIPE_TYPE_MIN                   pseudo type
+ *  @param USBC_PIPE_TYPE_CDC_ACM_DATA_IN       CDC ACM data in pipe
+ *  @param USBC_PIPE_TYPE_CDC_ACM_COMM_IN       CDC ACM comm in pipe
+ *  @param USBC_PIPE_TYPE_CDC_ACM_DATA_OUT      CDC ACM data out pipe
+ *  @param USBC_PIPE_TYPE_GCOM_DATA_IN          Generic COM data in pipe
+ *  @param USBC_PIPE_TYPE_GCOM_DATA_OUT         Generic COM data out pipe
+ *  @param USBC_PIPE_TYPE_CDC_ECM_DATA_IN       CDC ECM data in pipe
+ *  @param USBC_PIPE_TYPE_CDC_ECM_COMM_IN       CDC ECM comm in pipe
+ *  @param USBC_PIPE_TYPE_CDC_ECM_DATA_OUT      CDC ECM data out pipe
+ *  @param USBC_PIPE_TYPE_RNDIS_DATA_IN         RNDIS data in pipe
+ *  @param USBC_PIPE_TYPE_RNDIS_COMM_IN         RNDIS comm in pipe
+ *  @param USBC_PIPE_TYPE_RNDIS_DATA_OUT        RNDIS data out pipe
+ *  @param USBC_PIPE_TYPE_MASS_STORAGE_DATA_IN  Mass Storage data in pipe
+ *  @param USBC_PIPE_TYPE_MASS_STORAGE_DATA_OUT Mass Storage data out pipe
+ *  @param USBC_PIPE_TYPE_MAX                   pseudo type
+ */
+typedef enum _usbc_pipe_type {
+    USBC_PIPE_TYPE_MIN                      = 0,
+    USBC_PIPE_TYPE_CDC_ACM_DATA_IN          = 1,
+    USBC_PIPE_TYPE_CDC_ACM_COMM_IN          = 2,
+    USBC_PIPE_TYPE_CDC_ACM_DATA_OUT         = 3,
+    USBC_PIPE_TYPE_GCOM_DATA_IN             = 4,
+    USBC_PIPE_TYPE_GCOM_DATA_OUT            = 5,
+    USBC_PIPE_TYPE_CDC_ECM_DATA_IN          = 6,
+    USBC_PIPE_TYPE_CDC_ECM_COMM_IN          = 7,
+    USBC_PIPE_TYPE_CDC_ECM_DATA_OUT         = 8,
+    USBC_PIPE_TYPE_RNDIS_DATA_IN            = 9,
+    USBC_PIPE_TYPE_RNDIS_COMM_IN            = 10,
+    USBC_PIPE_TYPE_RNDIS_DATA_OUT           = 11,
+    USBC_PIPE_TYPE_MASS_STORAGE_DATA_IN     = 12,
+    USBC_PIPE_TYPE_MASS_STORAGE_DATA_OUT    = 13,
+    USBC_PIPE_TYPE_MBIM_DATA_IN             = 14,
+    USBC_PIPE_TYPE_MBIM_COMM_IN             = 15,
+    USBC_PIPE_TYPE_MBIM_DATA_OUT            = 16,
+    USBC_PIPE_TYPE_ADB_DATA_IN             = 17,
+    USBC_PIPE_TYPE_ADB_DATA_OUT            = 18,
+    USBC_PIPE_TYPE_MAX
+} usbc_pipe_type_e;
+
+
+
+
+
+
+
+
+
+
+/*!
+ *  @brief usbc_core_class_device_state_e enumerate all possible states of
+ *         class device in USBCORE module
+ *  @param USBC_CORE_CLASS_DEVICE_STATE_MIN         pseudo state
+ *  @param USBC_CORE_CLASS_DEVICE_STATE_NOTEXIST    this device is not existed
+ *  @param USBC_CORE_CLASS_DEVICE_STATE_INITIATED   this device is initiated 
+ *  @param USBC_CORE_CLASS_DEVICE_STATE_REGISTERED  this device is registered
+ *  @param USBC_CORE_CLASS_DEVICE_STATE_MAX         pseudo state
+ */
+typedef enum _usbc_core_class_device_state {
+    USBC_CORE_CLASS_DEVICE_STATE_MIN        = 0,
+    USBC_CORE_CLASS_DEVICE_STATE_NOTEXIST   = 1,
+    USBC_CORE_CLASS_DEVICE_STATE_INITIATED  = 2,
+    USBC_CORE_CLASS_DEVICE_STATE_REGISTERED = 3,
+    USBC_CORE_CLASS_DEVICE_STATE_MAX        = 4,
+} usbc_core_class_device_state_e;
+
+
+/*!
+ *  @brief usbc_core_class_interface_state_e enumerate all possible states of
+ *         class interface in USBCORE module
+ *  @param USBC_CORE_CLASS_INTERFACE_STATE_MIN          pseudo state
+ *  @param USBC_CORE_CLASS_INTERFACE_STATE_DISABLE      this interface is disabled
+ *  @param USBC_CORE_CLASS_INTERFACE_STATE_INITIATED    this interface is initiated
+ *  @param USBC_CORE_CLASS_INTERFACE_STATE_ACTIVE       this interface is actived
+ *  @param USBC_CORE_CLASS_INTERFACE_STATE_MAX          pseudo state
+ */
+typedef enum _usbc_core_class_interface_state {
+    USBC_CORE_CLASS_INTERFACE_STATE_MIN         = 0,
+    USBC_CORE_CLASS_INTERFACE_STATE_DISABLE     = 1,
+    USBC_CORE_CLASS_INTERFACE_STATE_INITIATED   = 2,
+    USBC_CORE_CLASS_INTERFACE_STATE_ACTIVE      = 3,
+    USBC_CORE_CLASS_INTERFACE_STATE_MAX         = 4,
+} usbc_core_class_interface_state_e;
+
+
+/*!
+ *  @brief usbc_core_queue_state_e enumerate all possible states of QMU Queue
+ *         in USBCORE module
+ *  @param USBC_CORE_QUEUE_STATE_MIN        pseudo state
+ *  @param USBC_CORE_QUEUE_STATE_DISABLE    this queue is not used
+ *  @param USBC_CORE_QUEUE_STATE_INITIATED  this queue is initiated
+ *  @param USBC_CORE_QUEUE_STATE_ACTIVE     this queue is enabled,and used
+ *  @param USBC_CORE_QUEUE_STATE_STALL      this queue is enabled,but stalled
+ *  @param USBC_CORE_QUEUE_STATE_MAX        pseudo state
+ */
+typedef enum _usbc_core_queue_state {
+    USBC_CORE_QUEUE_STATE_MIN               = 0,
+    USBC_CORE_QUEUE_STATE_DISABLE           = 1,
+    USBC_CORE_QUEUE_STATE_INITIATED         = 2,
+    USBC_CORE_QUEUE_STATE_ACTIVE            = 3,
+    USBC_CORE_QUEUE_STATE_STALL             = 4,
+    USBC_CORE_QUEUE_STATE_MAX               = 5,
+} usbc_core_queue_state_e;
+
+/*!
+ *  @brief usbc_setup_packet_sm_e USBCORE setup state machine
+ *  @param USBC_CORE_SETUP_SM_INITIALIZE        initialize state
+ *  @param USBC_CORE_SETUP_SM_RECEIVED    usbcore received setup packet
+ *  @param USBC_CORE_SETUP_SM_MULTI_SETUP  received multiple setup packet
+ *  @param USBC_CORE_SETUP_SM_MAX        pseudo state
+ */
+typedef enum _usbc_setup_packet_sm{
+    USBC_CORE_SETUP_SM_INITIALIZE = 0,
+    USBC_CORE_SETUP_SM_RECEIVED = 1,
+    USBC_CORE_SETUP_SM_MULTI_SETUP = 2,
+    USBC_CORE_SETUP_SM_MAX = 3,
+}usbc_setup_packet_sm_e;
+
+/*!
+ *  @brief usbc_io_request_t is a typedef of struct _usbc_io_request
+ */
+typedef struct _usbc_io_request usbc_io_request_t;
+/*!
+ *  @brief struct _usbc_io_request describe usbc io request used to communicate
+ *         usb class device and usbcore
+ */
+struct _usbc_io_request {
+    /*!
+     *  @brief next io request
+     */
+    usbc_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 usbc_core_queue_t describe queue information maintain within usbcore
+ */
+typedef struct _usbc_core_queue {
+
+    /*!
+     *  @brief current queue state of this queue
+     */
+    usbc_core_queue_state_e     state;
+    /*!
+     *  @brief id of class device that own this queue
+     */
+    kal_uint8                   class_device_id;
+    /*!
+     *  @brief pipe type of this queue
+     */
+    usbc_pipe_type_e            pipe_type;
+    /*!
+     *  @brief usb transfer type of this queue
+     */
+    hifusb_usb_xfer_type_e      xfer_type;
+    /*!
+     *  @brief endpoint number of this queue
+     */
+    kal_uint8                   ep_no;
+    /*!
+     *  @brief maximum packet size of this queue
+     */
+    kal_uint16                  max_packet_size;
+    /*!
+     *  @brief fifo type is DOUBLE FIFO or not
+     */
+    kal_uint8                   fifo_n;
+    kal_uint8                   rsvd[3];
+    /*!
+     *  @brief queue configuration
+     */
+    kal_uint32                  config;
+    /*!
+     *  @brief queue owner
+     */
+    usb_class_owner_e       owner;
+    /*!
+     *  @brief complete function to notify class device (GPD/SPD)
+     */
+    void                        (*notify_complete)(kal_uint8 class_deivce_id, usbc_io_request_t* io_request);
+    /*!
+     *  @brief complete function to notify class device (UL META/DRB)
+     */
+    void                        (*notify_rb_complete)(kal_uint8 class_deivce_id, kal_uint32 start_idx, kal_uint32 end_idx, kal_uint32 rel_idx);
+    /*!
+     *  @brief callback function to notify class device queue is stall or not
+     */
+    void                        (*notify_stall)(kal_uint8 class_device_id, kal_bool stall);
+} usbc_core_queue_t;
+
+typedef struct _usbc_endpoint_info_t {
+
+    /*!
+     *  @brief Descriptor length
+     */
+    kal_uint16                             epdscr_size;
+    
+    /*!
+     *  @brief Endpoint descriptor
+     */
+    union {
+        usbc_endpoint_descriptor_t         stdep;
+        kal_uint8                          classep[MAX_USBCORE_CLASS_EPDESC_LENGTH];
+    } epdscr;
+
+    usbc_core_queue_t                      queue_info;
+} usbc_endpoint_info_t;
+
+typedef struct _usbc_alternate_interface_info_t {
+    /*!
+     *  @brief Descriptor length
+     */
+    kal_uint16                             ifdscr_size;
+
+    union {
+        usbc_interface_descriptor_t        stdif;
+        kal_uint8                          classif[MAX_USBCORE_IFDESC_LENGTH];
+    } ifdscr;
+
+    usbc_endpoint_info_t                   *ep_info[MAX_USBCORE_EPNUM_PER_IF];
+    
+} usbc_alternate_interface_info_t;
+
+/*!
+ *  @brief usbc_core_class_interface_t describe class interface information
+ *         maintain within usbcore
+ */
+typedef struct _usbc_core_class_interface_t {
+    /*!
+     *  @brief interace number of this interface
+     */
+    kal_uint8                           interface_no;
+    /*!
+     *  @brief interace type of this interface
+     */
+    usbc_interface_type_e               interface_type;
+    /*!
+     *  @brief id of class device that own this interface
+     */
+    kal_uint8                           class_device_id;
+    /*!
+     *  @brief current state of this interface
+     */
+    usbc_core_class_interface_state_e   state;
+    /*!
+     *  @brief bAlternateSetting of this interface
+     */
+    kal_uint8                           alternate_setting;
+    kal_uint8                           rsvd[3];
+    /*!
+     *  @brief callback function while control tranfer for this device
+     *         is received
+     */
+    void                                (*notify_control_setup_packet)(kal_uint8 class_device_id, usbc_setup_packet_t* packet);
+    /*!
+     *  @brief callback function while control tranfer is complete
+     */
+    void                                (*notify_control_complete)(kal_uint8 class_device_id);
+    /*!
+     *  @brief callback function while interface alternate setting is set
+     */
+    void                                (*notify_alternate_setting)(kal_uint8 class_device_id, usbc_interface_type_e inteface, kal_uint8 alternate_setting);
+
+} usbc_core_class_interface_t;
+
+/*!
+ *  @brief usbc_core_class_interface_t describe class interface information
+ *         maintain within usbcore
+ */
+typedef struct _usbc_interface_info_t {
+
+    usb_class_type_e                       type;
+
+    /*!
+     *  @brief Descriptor length
+     */
+    kal_uint16                             ifdscr_size;
+
+    /*!
+     *  @brief Interface descriptor
+     */
+    union {
+        usbc_interface_descriptor_t        stdif;
+        kal_uint8                          classif[MAX_USBCORE_IFDESC_LENGTH];
+    } ifdscr;
+
+    usbc_endpoint_info_t                   *ep_info[MAX_USBCORE_EPNUM_PER_IF];
+
+    kal_bool                               altn_surpport; // FALSE (no alternate setting) or TRUE (has alternate setting)
+    usbc_alternate_interface_info_t        altn_if_info;
+
+    usbc_core_class_interface_t            class_interface;
+
+} usbc_interface_info_t;
+
+/*!
+ *  @brief usbc_class_device_instance_t describe instance of a
+ *         generic usb class device
+ */
+typedef struct _usbc_class_device_instance {
+    /*!
+    *   @brief instance id of this device
+    */
+    kal_uint8               id;
+
+    /*!
+     *  @brief current usb speed of this device
+     */
+    kal_uint8               speed;
+    /*!
+     *  @brief total_interfaces for this class device
+     */
+    kal_uint8               total_interfaces;
+    kal_uint8               rsvd[1];
+    /*!
+     *  @brief per class device context
+     */
+    void                   *context;
+    /*!
+     *  @brief qmu queue no for each pipe
+     */
+    kal_uint8               queue_no_for_pipe[MAX_USBCORE_CLASS_PIPE_NUM];
+    /*!
+     *  @brief interface type of each interface for this class device
+     */
+    usbc_interface_type_e   interface_type[MAX_USBCORE_CLASS_INTERFACE_NUM];
+    /*!
+     *  @brief interface number of each interface for this class device
+     */
+    kal_uint8               interface_no[MAX_USBCORE_CLASS_INTERFACE_NUM];
+} usbc_class_device_instance_t;
+
+/*!
+ *  @brief usbc_io_req_type_e Type of operation to for requests to submit to USB HIF.
+ *  @param USBC_IO_TX_NO_FLUSH                  Transmit operation without GPD checksum calcuation and cache flush.
+ */
+typedef enum _usbc_io_req_type {
+     USBC_IO_TX_NO_FLUSH        = 0x00000010,
+     USBC_IO_TYPE_DUMMY         = 0x7fffffff
+} usbc_io_req_type_e;
+
+/*!
+ *  @brief usbc_io_ext_info_t Configurations apply to the requests to submit to USB HIF.
+ *  @param type               Type of operation.
+ */
+typedef struct _usbc_io_ext_info {
+     usbc_io_req_type_e   type;
+} usbc_io_ext_info_t;
+
+
+/*
+ * @brief Settings of each type of node to checkin.
+ */
+typedef struct {
+    void       *init_func; /* iniitialize descriptor function pointer. */
+    void       *set_config_func; /* initialize configuration function pointer */
+    void       *reinit_func; /* reinit function pointer */
+    void       *query_func_wk_capability;   /*  callback function to remote wakeup capability of class device */
+} usbc_node_reg_entry_t;
+
+typedef kal_int32 (*usbc_class_init_func_t)(kal_uint8 class_device_id, usb_mode_e mode, kal_uint32 config_index, void *context, kal_uint32 flag);
+typedef kal_int32 (*usbc_class_set_config_func_t)(kal_uint8 class_device_id, kal_uint32 config_index, void *context);
+typedef void (*usbc_class_reinit_func_t)(kal_bool need_check_in);
+typedef kal_uint16 (*usbc_class_query_func_wk_capability_func_t)(void);
+
+
+usbc_class_set_config_func_t usbc_get_class_set_config_func(usb_class_type_e type);
+
+/*!
+ *  @brief  Add a node into USB stack, the USB stack will start loading configuration,
+ *          initializing corresponding modules.
+ *          Running Level: TASK INIT
+ *  @param  node     Node of USB stack.
+ *  @param  reg_table An array of settings. The last entry is ended with type=USBC_NODE_REG_ENTRY_END_TYPE.
+ */
+void usbc_stack_checkin(usb_class_type_e func_type, usbc_node_reg_entry_t *reg_table);
+
+void usbc_mode_switch(usb_mode_e mode);
+
+void usbc_reinit_class(void);
+
+#endif  // _USBCORE_COMMON_H
+
diff --git a/mcu/middleware/hif/interface/usbcore_direct.h b/mcu/middleware/hif/interface/usbcore_direct.h
new file mode 100644
index 0000000..b22f344
--- /dev/null
+++ b/mcu/middleware/hif/interface/usbcore_direct.h
@@ -0,0 +1,102 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2005
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. 
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ *   usbcore_direct.h
+ *
+ * Project:
+ * --------
+ *   TATAKA
+ *
+ * Description:
+ * ------------
+ *   USB Core direct API.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *******************************************************************************/
+#ifndef _USBCORE_DIRECT_H
+#define _USBCORE_DIRECT_H
+
+#include "hifusb_qmu.h"
+#include "kal_public_api.h"
+#include "ufpm_usbcore.h"
+
+
+void usbc_direct_hif_usbcore_send_indication();
+
+void usbc_direct_hif_enable_poll_queue(kal_bool enable);
+
+void usbc_direct_hif_notify_usb_func_event(kal_uint8 class_device_id, usbc_usb_state_e state);
+
+void usbc_direct_hif_attach(usbc_usb_speed_e speed, kal_uint8 address, kal_uint8 configuration);
+
+void usbc_direct_hif_detach();
+
+void usbc_direct_set_config_class_device(kal_uint8 class_device_id, kal_uint8 configuration);
+
+void usbc_direct_core_set_config(kal_uint8 configuration);
+
+kal_bool usbc_direct_dispatch_control_setup_packet(kal_uint8 class_device_id, void* pkt_ptr);
+
+kal_bool usbc_direct_hif_usbq_set_gpd(hif_queue_type_e q_type, kal_uint8 logic_queue_no, qbm_gpd* first_gpd, qbm_gpd* last_gpd);
+
+kal_uint32 usbc_direct_hif_usbq_poll_gpd(hif_deq_info_t deq_info, void **first_gpd, void **last_gpd);
+
+kal_bool usbc_direct_hif_chk_newpkt(kal_bool isTx, kal_uint8 logic_queue_no);
+
+kal_bool usbc_direct_hif_usbq_chk_empty(hif_queue_type_e core_queue_hif_type, kal_uint8 q_num);
+
+kal_uint32 usbc_direct_hif_usbq_flush_gpd(hif_queue_type_e q_type, kal_uint8 logic_queue_no, hif_flush_type_e flush_type , void **pp_head, void **pp_tail);
+
+kal_uint32 usbc_direct_hif_sw_usbq_flush_gpd(hif_queue_type_e q_type, kal_uint8 logic_queue_no, hif_flush_type_e flush_type , void **pp_head, void **pp_tail);
+
+void usbc_direct_hifusb_set_usb_address_emulate(kal_uint8 address);
+
+void usbc_direct_init_ufpm_mapping_table(kal_uint8 config_no, kal_uint8 class_device_id, ufpm_usb_mapping_t* perClassMapTlb);
+
+kal_bool usbc_direct_hif_init(void);
+
+void usbc_direct_hif_notify_usb_core_event(usbc_usb_state_e state);
+
+kal_bool usbc_direct_hifusb_set_usbhif_connect_disconnect();
+
+void usbc_direct_set_usb_mapping(kal_bool isTx, kal_uint8 md_q_no, kal_uint8 ap_ep_no);
+
+#endif
diff --git a/mcu/middleware/hif/interface/usbcore_except.h b/mcu/middleware/hif/interface/usbcore_except.h
new file mode 100644
index 0000000..032d6da
--- /dev/null
+++ b/mcu/middleware/hif/interface/usbcore_except.h
@@ -0,0 +1,178 @@
+/*****************************************************************************
+*  Copyright Statement:
+*  --------------------
+*  This software is protected by Copyright and the information contained
+*  herein is confidential. The software may not be copied and the information
+*  contained herein may not be used or disclosed except with the written
+*  permission of MediaTek Inc. (C) 2005
+*
+*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
+*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
+*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
+*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
+*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
+*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
+*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
+*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
+*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
+*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
+*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
+*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
+*
+*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
+*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
+*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
+*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
+*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. 
+*
+*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
+*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
+*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
+*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
+*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
+*
+*****************************************************************************/
+
+/*******************************************************************************
+ * Filename:
+ * ---------
+ *   usbcore_except.h
+ *
+ * Project:
+ * --------
+ *   TATAKA
+ *
+ * Description:
+ * ------------
+ *   USB Core exception mode interface.
+ *
+ * Author:
+ * -------
+ * -------
+ *
+ *==============================================================================
+ *                 HISTORY
+ * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!! 
+ *------------------------------------------------------------------------------
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *
+ * removed!
+ * removed!
+ * removed!
+ *------------------------------------------------------------------------------
+ * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!! 
+ *==============================================================================
+ *******************************************************************************/
+#ifndef __INC_USBCORE_EXCEPT_H
+#define __INC_USBCORE_EXCEPT_H
+
+#include "usbcore_common.h"
+#include "usbcore_class_device.h"
+
+
+/*------------------------------------------------------------------------------
+ * Data structure defintion.
+ *----------------------------------------------------------------------------*/
+typedef enum _usbc_except_link_st {
+    USBC_LINK_NO_ERROR     = 0,
+    USBC_LINK_TX_TIMEOUT   = 1,
+} usbc_except_link_st_e;
+
+/*------------------------------------------------------------------------------
+ * Public fucntions.
+ *----------------------------------------------------------------------------*/
+
+/*!
+ *  @brief  Start exception mode HIF data path.
+ *          See also hif_except_initial() for more information.
+ *  @return KAL_TRUE if succeeded, KAL_FALSE otherwise.
+ */
+kal_bool usbc_except_init(void);
+
+/*!
+ *  @brief  Stop the queue and flush USB pipe FIFO. 
+ *          See also hif_except_clear_q() for more information.
+ *  @param  class_device_id USB class device id.
+ *  @param  queue_no QMU queue no.
+ *  @return KAL_TRUE if succeeded, KAL_FALSE otherwise.
+ */
+kal_bool usbc_except_clear_ch(kal_uint8 class_device_id, kal_uint8 queue_no);
+
+/*!
+ *  @brief  Register the device to be used in exception mode and then trigger USB enumeration.
+ *  @param  device_info class device information of the device.
+ *  @return new instance of usb class device if succeeded, NULL otherwise.
+ */
+usbc_class_device_instance_t *usbc_except_reset_ch(usbc_class_device_info_t *device_info);
+
+/*!
+ *  @brief  Perform USB enumeration. 
+ *          Note that, this function exist either the enumeration process is completed or timeout.
+ *  @return KAL_TRUE if the USB enumeration is completed, KAL_FALSE if timeout.
+ */
+kal_bool usbc_except_enum_loop(void);
+
+/*!
+ *  @brief Check and handle USB control transfers and other device state changes.
+ *         See also hifusb_except_poll_isr() for more information.
+ *  @param  class_device_id USB class device id.
+ *  @return KAL_TRUE if succeeded, KAL_FALSE otherwise.
+ */
+kal_bool usbc_except_hif_poll(kal_uint8 class_device_id);
+
+/*!
+ *  @brief  Submit a list of GPD to the specified queue of a USB class device instance.
+ *          See also hif_except_set_gpd() for more information.
+ *  @param  class_device_id USB class device id.
+ *  @param  queue_no QMU queue no.
+ *  @param  p_first_gpd head of the GPD list.
+ *  @param  p_last_gpd tail of the GPD list.
+ *  @return KAL_TRUE if succeeded, KAL_FALSE otherwise.
+ */
+kal_bool usbc_except_submit_gpd(kal_uint8 class_device_id, kal_uint8 queue_no, void *p_first_gpd, void *p_last_gpd);
+
+/*!
+ *  @brief  Check if any GPD submitted to specified queue of a USB class device instance has been completed.
+ *          See also hif_except_poll_queue() for more information.
+ *  @param  class_device_id USB class device id.
+ *  @param  queue_no QMU queue no.
+ *  @param  pp_first_gpd Caller allocated space for a pointer to head of the GPD list completed. Its value is invalid if this function returns KAL_FALSE.
+ *  @param  pp_last_gpd Caller allocated space for a pointer to tail of the GPD list copmleted. Its value is invalid if this function returns KAL_FALSE.
+ *  @param  gpd_num Number of GPD completed. Its value is invalid if this function returns KAL_FALSE.
+ *  @return KAL_TRUE if succeeded, KAL_FALSE otherwise.
+ */
+kal_bool usbc_except_poll_queue(kal_uint8 class_device_id, kal_uint8 queue_no, void **pp_first_gpd, void **pp_last_gpd, kal_uint32 *gpd_num);
+
+/*!
+ *  @brief  Check specified queue status.
+ *          See also hif_except_get_txq_timeout(() for more information.
+ *  @param  class_device_id USB class device id.
+ *  @param  queue_no QMU queue no.
+ *  @param  link_state Return status of the queue if succeeded.
+ *  @return KAL_TRUE if succeeded, KAL_FALSE otherwise.
+ */
+kal_bool usbc_except_hif_state(kal_uint8 class_device_id, kal_uint8 queue_no, usbc_except_link_st_e *link_state);
+
+/*!
+ *  @brief  flush Tx/Rx queue in exception reset.
+ *  @param  class_device_id USB class device id.
+ *  @param  queue_no QMU queue no.
+ *  @param  number of returned flushed GPDs.
+ *  @param  address of the returned GPD's head.
+ *  @param  address of the returned GPD's tail.
+ *  @return KAL_TRUE if succeeded, KAL_FALSE otherwise.
+ */
+kal_bool usbc_except_reset_flush(kal_uint8 class_device_id, kal_uint8 queue_no, void** first_gpd, void** last_gpd, kal_uint32* gpd_num);
+#endif /* __INC_USBCORE_EXCEPT_H */
+
diff --git a/mcu/middleware/hif/interface/usbcore_usbstd.h b/mcu/middleware/hif/interface/usbcore_usbstd.h
new file mode 100644
index 0000000..e23203d
--- /dev/null
+++ b/mcu/middleware/hif/interface/usbcore_usbstd.h
@@ -0,0 +1,517 @@
+/*!
+ *  @file usbcore_usbstd.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 standard definitions of usb-if specification
+ */
+
+#ifndef _USBCORE_USBSTD_H
+#define _USBCORE_USBSTD_H
+
+#include "kal_public_api.h"
+
+/*
+ * Helper routines.
+ */
+#define USBC_GET_UINT8(_buf, _offset) \
+            *((kal_uint8*)(_buf) + (_offset))
+
+#define USBC_GET_UINT16(_buf, _offset) \
+            (  ((kal_uint16)*((kal_uint8 *)(_buf) + (_offset))) | \
+              (((kal_uint16)*((kal_uint8 *)(_buf) + (_offset) + 1)) << 8) )
+
+#define USBC_GET_UINT32(_buf, _offset) \
+            (  ((kal_uint32)*((kal_uint8 *)(_buf) + (_offset))) | \
+              (((kal_uint32)*((kal_uint8 *)(_buf) + (_offset) + 1)) << 8) | \
+              (((kal_uint32)*((kal_uint8 *)(_buf) + (_offset) + 2)) << 16) | \
+              (((kal_uint32)*((kal_uint8 *)(_buf) + (_offset) + 3)) << 24) )
+
+#define USBC_SET_UINT8(_buf, _offset, _value) \
+            *((kal_uint8*)(_buf) + (_offset)) = (kal_uint8)(_value)
+
+#define USBC_SET_UINT16(_buf, _offset, _value) \
+            *((kal_uint8*)(_buf) + (_offset)) = (kal_uint8)(_value); \
+            *((kal_uint8*)(_buf) + (_offset) + 1) = (kal_uint8)((_value) >> 8)
+
+#define USBC_SET_UINT32(_buf, _offset, _value) \
+            *((kal_uint8*)(_buf) + (_offset)) = (kal_uint8)(_value); \
+            *((kal_uint8*)(_buf) + (_offset) + 1) = (kal_uint8)((_value) >> 8); \
+            *((kal_uint8*)(_buf) + (_offset) + 2) = (kal_uint8)((_value) >> 16); \
+            *((kal_uint8*)(_buf) + (_offset) + 3) = (kal_uint8)((_value) >> 24)
+
+#define USBC_GET_DESC_LENGTH(_desc) \
+            USBC_GET_UINT8(_desc, 0)
+
+#define USBC_SET_DESC_LENGTH(_desc, _value) \
+            USBC_SET_UINT8(_desc, 0, _value)
+
+#define USBC_GET_DESC_TYPE(_desc) \
+            USBC_GET_UINT8(_desc, 1)
+
+#define USBC_SET_DESC_TYPE(_desc, _value) \
+            USBC_SET_UINT8(_desc, 1, _value)
+
+
+/*!
+ * @brief USB Standard Requests
+ */
+#define USBC_REQ_GET_STATUS                 0x00
+#define USBC_REQ_CLEAR_FEATURE              0x01
+#define USBC_REQ_SET_FEATURE                0x03
+#define USBC_REQ_SET_ADDRESS                0x05
+#define USBC_REQ_GET_DESCRIPTOR             0x06
+#define USBC_REQ_SET_DESCRIPTOR             0x07
+#define USBC_REQ_GET_CONFIGURATION          0x08
+#define USBC_REQ_SET_CONFIGURATION          0x09
+#define USBC_REQ_GET_INTERFACE              0x0A
+#define USBC_REQ_SET_INTERFACE              0x0B
+#define USBC_REQ_SYNCH_FRAME                0x0C
+#define USBC_REQ_SET_SEL                    0x30
+#define USBC_REQ_SET_ISOCHRONOUS_DELAY      0x31
+
+/*!
+ * @brief Vendor Request Codes
+ */
+#define USBC_REQ_GET_MS_DESCRIPTOR          0xCC
+
+/*!
+ * @brief USB Request Types
+ */
+#define USBC_REQUEST_TYPE_MASK              (0x03 << 5)
+#define USBC_REQUEST_TYPE_STANDARD          (0x00 << 5)
+#define USBC_REQUEST_TYPE_CLASS             (0x01 << 5)
+#define USBC_REQUEST_TYPE_VENDOR            (0x02 << 5)
+#define USBC_REQUEST_TYPE_RESERVED          (0x03 << 5)
+
+
+/*!
+ * @brief USB Request Recipients
+ */
+#define USBC_REQUEST_RECIP_MASK             0x1f
+#define USBC_REQUEST_RECIP_DEVICE           0x00
+#define USBC_REQUEST_RECIP_INTERFACE        0x01
+#define USBC_REQUEST_RECIP_ENDPOINT         0x02
+#define USBC_REQUEST_RECIP_OTHER            0x03
+
+
+/*!
+ * @breif USB Request Directions
+ */
+#define USBC_REQUEST_DIR_OUT                0
+#define USBC_REQUEST_DIR_IN                 0x80
+
+/*!
+ * @brief USB Set Features
+ */
+#define USBC_FEATURE_ENDPOINT_HALT          0x00
+#define USBC_FEATURE_FUNCTION_SUSPEND       0x00
+#define USBC_FEATURE_DEVICE_REMOTE_WAKEUP   0x01
+#define USBC_FEATURE_TEST_MODE              0x02
+#define USBC_FEATURE_U1_ENABLE              0x30
+#define USBC_FEATURE_U2_ENABLE              0x31
+#define USBC_FEATURE_LTM_ENABLE             0x32
+
+
+/*!
+ *  @brief Device Descriptor Types
+ */
+#define USBC_DT_DEVICE                      0x01
+#define USBC_DT_CONFIG                      0x02
+#define USBC_DT_STRING                      0x03
+#define USBC_DT_INTERFACE                   0x04
+#define USBC_DT_ENDPOINT                    0x05
+#define USBC_DT_DEVICE_QUALIFIER            0x06
+#define USBC_DT_OTHER_SPEED                 0X07
+#define USBC_DT_INTERFACE_POWER             0x08
+#define USBC_DT_OTG                         0x09
+#define USBC_DT_IAD                         0x0B
+#define USBC_DT_BOS                         0x0F
+#define USBC_DT_DEVICE_CAPABILITY           0x10
+#define USBC_DT_ENDPOINT_COMPANION          0x30
+
+
+/*!
+ * @breif USB Request Directions
+ */
+#define USBC_EP_ADDR_DIR_IN                 0x80
+#define USBC_EP_ADDR_NUM_MASK               0x7F
+
+
+
+/*!
+ *  @brief usbc_setup_packet_t describe the detail field definition of
+ *         control setup packet
+ */
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _usbc_setup_packet {
+    /*!
+     *  @brief request type of setup packet
+     *         Bit 7: Request direction
+     *                (0=Host to device - Out, 1=Device to host - In)
+     *         Bits 5-6: Request type
+     *                (0=standard, 1=class, 2=vendor, 3=reserved)
+     *         Bits 0-4: Recipient
+     *                (0=device, 1=interface, 2=endpoint,3=other)
+     */
+    kal_uint8       bmRequestType;
+    /*!
+     *  @brief the actual request, see the Standard Device Request Codes table
+     */
+    kal_uint8       bRequest;
+    /*!
+     *  @brief a word-size value that varies according to the request
+     */
+    kal_uint16      wValue;
+    /*!
+     *  @brief a word-size value that varies according to the request,
+     *         the index is generally used to specify an endpoint or
+     *         an interface.
+     */
+    kal_uint16      wIndex;
+    /*!
+     *  @brief a word-size value that indicates the number of bytes to be
+     *         transferred if there is a data stage
+     */
+    kal_uint16      wLength;
+}  usbc_setup_packet_t;
+PRAGMA_END_PACK_STRUCT
+
+
+/*!
+ *  @brief Device Descriptor Structure
+ */
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _usbc_device_descriptor {
+    kal_uint8       bLength;
+    kal_uint8       bDescriptorType;
+    kal_uint16      bcdUSB;
+    kal_uint8       bDeviceClass;
+    kal_uint8       bDeviceSubClass;
+    kal_uint8       bDeviceProtocol;
+    kal_uint8       bMaxPacketSize0;
+    kal_uint16      idVendor;
+    kal_uint16      idProduct;
+    kal_uint16      bcdDevice;
+    kal_uint8       iManufacturer;
+    kal_uint8       iProduct;
+    kal_uint8       iSerialNumber;
+    kal_uint8       bNumConfigurations;
+} usbc_device_descriptor_t;
+PRAGMA_END_PACK_STRUCT
+
+#define USBC_DEVICE_DESC_SIZE sizeof(usbc_device_descriptor_t)
+
+/*!
+ *  @brief Configuration Descriptor Structure
+ */
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _usbc_configuration_descriptor {
+    kal_uint8       bLength;
+    kal_uint8       bDescriptorType;
+    kal_uint16      wTotalLength;
+    kal_uint8       bNumInterfaces;
+    kal_uint8       bConfigurationValue;
+    kal_uint8       iConfiguration;
+    kal_uint8       bmAttributes;
+    kal_uint8       bMaxPower;
+} usbc_configuration_descriptor_t;
+PRAGMA_END_PACK_STRUCT
+
+#define USBC_CONFIGURATION_DESC_SIZE sizeof(usbc_configuration_descriptor_t)
+#define USBC_MAX_CONF_SIZE 1024
+#define USBC_USB20_POWER_DESC_UINT 2 /* 2 mA unit */
+#define USBC_USB30_POWER_DESC_UINT 8 /* 8 mA unit */
+#define USBC_USB30_EP0_PACKET_SIZE 9 /* in power of 2 */
+
+#define USBC_GET_CONF_TOTAL_LENGTH(_desc) \
+            USBC_GET_UINT16(_desc, 2)
+#define USBC_SET_CONF_TOTAL_LENGTH(_desc, _value) \
+            USBC_SET_UINT16(_desc, 2, _value)
+
+#define USBC_GET_CONF_MAX_POWER(_desc) \
+            USBC_GET_UINT8(_desc, 8)
+#define USBC_SET_CONF_MAX_POWER(_desc, _value) \
+            USBC_SET_UINT8(_desc, 8, _value)
+
+
+/*!
+ *  @brief Interface Descriptor Structure
+ */
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _usbc_interface_descriptor {
+    kal_uint8       bLength;
+    kal_uint8       bDescriptorType;
+    kal_uint8       bInterfaceNumber;
+    kal_uint8       bAlternateSetting;
+    kal_uint8       bNumEndpoints;
+    kal_uint8       bInterfaceClass;
+    kal_uint8       bInterfaceSubClass;
+    kal_uint8       bInterfaceProtocol;
+    kal_uint8       iInterface;
+} usbc_interface_descriptor_t;
+PRAGMA_END_PACK_STRUCT
+
+
+/*!
+ *  @brief Interface Association Descriptor Structure
+ */
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _usbc_interface_association_descriptor {
+    kal_uint8       bLength;
+    kal_uint8       bDescriptorType;
+    kal_uint8       bFirstInterface;
+    kal_uint8       bInterfaceCount;
+    kal_uint8       bFunctionClass;
+    kal_uint8       bFunctionSubClass;
+    kal_uint8       bFunctionProtocol;
+    kal_uint8       iFunction;
+} usbc_interface_association_descriptor_t;
+PRAGMA_END_PACK_STRUCT
+
+
+/*!
+ *  @brief Endpoint Descriptor Structure
+ */
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _usbc_endpoint_descriptor {
+    kal_uint8       bLength;
+    kal_uint8       bDescriptorType;
+    kal_uint8       bEndpointAddress;
+    kal_uint8       bmAttributes;
+    kal_uint16      wMaxPacketSize;
+    kal_uint8       bInterval;
+} usbc_endpoint_descriptor_t;
+PRAGMA_END_PACK_STRUCT
+
+#define USBC_GET_EP_ATTRIBUTES(_desc) \
+            USBC_GET_UINT8(_desc, 3)
+#define USBC_SET_EP_ATTRIBUTES(_desc, _value) \
+            USBC_SET_UINT8(_desc, 3, _value)
+
+#define USBC_GET_EP_MAX_PACKET_SIZE(_desc) \
+            USBC_GET_UINT16(_desc, 4)
+#define USBC_SET_EP_MAX_PACKET_SIZE(_desc, _value) \
+            USBC_SET_UINT16(_desc, 4, _value)
+
+#define USBC_GET_EP_ADDR(_desc) \
+            USBC_GET_UINT16(_desc, 2)
+
+#define USBC_CONTROL_TRANSFER       0x00
+#define USBC_ISOCHRONOUS_TRANSFER   0x01
+#define USBC_BULK_TRANSFER          0x02
+#define USBC_INTERRUPT_TRANSFER     0x03
+
+#define USBC_GET_EP_TRANSFER_TYPE(_desc) \
+            (USBC_GET_EP_ATTRIBUTES(_desc) & 0x03)
+
+#define USBC_USB30_BULK_PACKET_SIZE 1024
+
+/*!
+ *  @brief String Descriptor Structure
+ */
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _usbc_string_descriptor {
+    kal_uint8       bLength;
+    kal_uint8       bDescriptorType;
+    kal_uint16      wData[1];
+} usbc_string_descriptor_t;
+PRAGMA_END_PACK_STRUCT
+
+
+/*!
+ *  @brief Qualifier Descriptor Structure
+ */
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _usbc_device_qualifier_descriptor {
+    kal_uint8       bLength;
+    kal_uint8       bDescriptorType;
+    kal_uint16      bcdUSB;
+    kal_uint8       bDeviceClass;
+    kal_uint8       bDeviceSubClass;
+    kal_uint8       bDeviceProtocol;
+    kal_uint8       bMaxPacketSize0;
+    kal_uint8       bNumConfigurations;
+    kal_uint8       bRESERVED;
+} usbc_device_qualifier_descriptor_t;
+PRAGMA_END_PACK_STRUCT
+
+
+/*!
+ *  @brief CS Header Descriptor Structure
+ */
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _usbc_cs_header_descriptor {
+    kal_uint8       bLength;
+    kal_uint8       bDescriptorType;
+    kal_uint8       bDescriptorSubType;
+    kal_uint16      bcdCDC;
+} usbc_cs_header_descriptor_t;
+PRAGMA_END_PACK_STRUCT
+
+
+/*!
+ *  @brief CS Call Manage Descriptor Structure
+ */
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _usbc_cs_call_manager_descriptor {
+    kal_uint8       bLength;
+    kal_uint8       bDescriptorType;
+    kal_uint8       bDescriptorSubType;
+    kal_uint8       bmCapabilities;
+    kal_uint8       bDataInterface;
+} usbc_cs_call_manage_descriptor_t;
+PRAGMA_END_PACK_STRUCT
+
+
+/*!
+ *  @brief CS Abstract Control Manage Descriptor Structure
+ */
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _usbc_cs_abstract_control_manage_descriptor {
+    kal_uint8       bLength;
+    kal_uint8       bDescriptorType;
+    kal_uint8       bDescriptorSubType;
+    kal_uint8       bmCapabilities;
+} usbc_cs_abstract_control_manage_descriptor_t;
+PRAGMA_END_PACK_STRUCT
+
+
+/*!
+ *  @brief CS Union Function Descriptor Structure
+ */
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _usbc_cs_union_function_descriptor {
+    kal_uint8       bLength;
+    kal_uint8       bDescriptorType;
+    kal_uint8       bDescriptorSubType;
+    kal_uint8       bMasterInterface;
+    kal_uint8       bSlaveInterface;
+} usbc_cs_union_function_descriptor_t;
+PRAGMA_END_PACK_STRUCT
+
+
+/*!
+ *  @brief CS Ethernet Networking Function Descriptor Structure
+ */
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _usbc_cs_ethernet_networking_function_descriptor {
+    kal_uint8       bLength;
+    kal_uint8       bDescriptorType;
+    kal_uint8       bDescriptorSubType;
+    kal_uint8       iMACAddress;
+    kal_uint32      bmEthernetStatistics;
+    kal_uint16      wMaxSegmentSize;
+    kal_uint16      wNumberMCFilters;
+    kal_uint8       bNumberPowerFilters;
+} usbc_cs_ethernet_networking_function_descriptor_t;
+PRAGMA_END_PACK_STRUCT
+
+/*!
+ *  @brief Microsoft OS String Descriptor Structure
+ */
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _usbc_os_string_descriptor {
+    kal_uint8       bLength;
+    kal_uint8       bDescriptorType;
+    kal_uint8       qwSignature[14];
+    kal_uint8       bMS_VendorCode;
+    kal_uint8       bPad;
+} usbc_os_string_descriptor_t;
+PRAGMA_END_PACK_STRUCT
+
+/*!
+ *  @brief Microsoft OS String Descriptor Structure
+ */
+PRAGMA_BEGIN_PACK_STRUCT
+typedef struct _usbc_ext_compat_id_os_feature_descriptor {
+    kal_uint32      dwLength;
+    kal_uint16      bcdVersion;
+    kal_uint16      wIndex;
+    kal_uint8       bCount;
+    kal_uint8       bPads_1[7];
+    kal_uint8       bFirstInterfaceNumber;
+    kal_uint8       bInterfaceCount;
+    kal_uint8       compatibleID[8];
+    kal_uint8       subcompatibleID[8];
+    kal_uint8       bPads_2[6];
+} usbc_ext_compat_id_os_feature_descriptor_t;
+PRAGMA_END_PACK_STRUCT
+
+/*
+ * USB 3.0 BOS descriptor.
+ */
+#define USBC_BOS_DESC_SIZE                          5
+#define USBC_MAX_BOS_SIZE \
+            ( USBC_BOS_DESC_SIZE + \
+              USBC_SUPERSPEED_USB_DEV_CAP_DESC_SIZE + \
+              USBC_USB20_EXT_DEV_CAP_DESC_SIZE )
+
+#define USBC_GET_BOS_TOTAL_LENGTH(_desc) \
+            USBC_GET_UINT16(_desc, 2)
+#define USBC_SET_BOS_TOTAL_LENGTH(_desc, _value) \
+            USBC_SET_UINT16(_desc, 2, _value)
+
+/*
+ * USB 2.0 Extension descriptor.
+ */
+#define USBC_USB20_EXT_DEV_CAP_DESC_SIZE            7
+
+/*
+ * SuperSpeed USB Device Capabilities descriptor.
+ */
+#define USBC_SUPERSPEED_USB_DEV_CAP_DESC_SIZE       10
+
+/*
+ * SuperSpeed Endpoint Companion descriptor.
+ */
+#define USBC_ENDPOINT_COMPANION_DESC_SIZE           6
+
+#define USBC_GET_EPC_MAX_BURST(_desc) \
+            USBC_GET_UINT8(_desc, 2)
+#define USBC_SET_EPC_MAX_BURST(_desc, _value) \
+            USBC_SET_UINT8(_desc, 2, _value)
+
+#define USBC_GET_EPC_ATTRIBUTES(_desc) \
+            USBC_GET_UINT8(_desc, 3)
+#define USBC_SET_EPC_ATTRIBUTES(_desc, _value) \
+            USBC_SET_UINT8(_desc, 3, _value)
+
+#define USBC_GET_EPC_BYTES_PER_INTERVAL(_desc) \
+            USBC_GET_UINT16(_desc, 4)
+#define USBC_SET_EPC_BYTES_PER_INTERVAL(_desc, _value) \
+            USBC_SET_UINT16(_desc, 4, _value)
+
+#endif  // _USBCORE_USBSTD_H
diff --git a/mcu/middleware/hif/interface/usbidle_if.h b/mcu/middleware/hif/interface/usbidle_if.h
new file mode 100644
index 0000000..9814f15
--- /dev/null
+++ b/mcu/middleware/hif/interface/usbidle_if.h
@@ -0,0 +1,57 @@
+/*!
+ *  @file usbidle_main.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 main definitions of usbcore
+ */
+
+#ifndef _USBIDLE_IF_H
+#define _USBIDLE_IF_H
+
+typedef struct {
+    LOCAL_PARA_HDR
+    kal_bool notify_suspend;
+    kal_bool notify_suspend_with_remote_wk;
+}usbcore_usbidle_l4_power_saving_req_struct;
+
+void usb_idle_set_clockGating(kal_bool);
+
+void usb_idle_set_l4_power_saving(kal_bool);
+
+void usb_idle_event_notify_to_l4(kal_bool, kal_bool);
+
+#endif  // _USBIDLE_IF_H
+