diff --git a/recipes-devtools/switch/files/src/an8855_sdk/api/inc/air.h b/recipes-devtools/switch/files/src/an8855_sdk/api/inc/air.h
index c62174f..bedfaf9 100644
--- a/recipes-devtools/switch/files/src/an8855_sdk/api/inc/air.h
+++ b/recipes-devtools/switch/files/src/an8855_sdk/api/inc/air.h
@@ -1,216 +1,216 @@
-/* FILE NAME:   air.h
- * PURPOSE:
- *      Define the initialization in AIR SDK.
- * NOTES:
- */
-
-#ifndef AIR_H
-#define AIR_H
-
-/* INCLUDE FILE DECLARATIONS
- */
-#include <stdio.h>
-#include <string.h>
-#include "air_types.h"
-#include "air_error.h"
-#include "air_reg.h"
-#include "air_aml.h"
-#include "air_port.h"
-#include "air_vlan.h"
-#include "air_lag.h"
-#include "air_l2.h"
-#include "air_stp.h"
-#include "air_mirror.h"
-#include "air_mib.h"
-#include "air_diag.h"
-#include "air_led.h"
-#include "air_cmd.h"
-#include "air_qos.h"
-#include "air_switch.h"
-#include "air_ver.h"
-#include "air_sec.h"
-#include "air_acl.h"
-#include "air_sptag.h"
-
-/* NAMING CONSTANT DECLARATIONS
- */
-
-/* MACRO FUNCTION DECLARATIONS
- */
-#define AIR_CHECK_PTR(__ptr__) do                                          \
-{                                                                           \
-    if (NULL == (__ptr__))                                                  \
-    {                                                                       \
-        return  AIR_E_BAD_PARAMETER;                                       \
-    }                                                                       \
-} while (0)
-
-#define AIR_PARAM_CHK(expr, errCode) do                                    \
-{                                                                           \
-    if ((I32_T)(expr))                                                      \
-    {                                                                       \
-        return errCode;                                                     \
-    }                                                                       \
-} while (0)
-
-#define AIR_PRINT(fmt,...) do                                              \
-{                                                                           \
-    if (_ext_printf)                                                        \
-    {                                                                       \
-        _ext_printf(fmt, ##__VA_ARGS__);                                    \
-    }                                                                       \
-}while (0)
-
-#define AIR_UDELAY(us) do                                                  \
-{                                                                           \
-    if (_ext_udelay)                                                        \
-    {                                                                       \
-        _ext_udelay(us);                                                    \
-    }                                                                       \
-}while (0)
-
-#define AIR_MALLOC(size) (_ext_malloc ? _ext_malloc(size) : NULL)
-
-#define AIR_FREE(ptr) do                                                   \
-    {                                                                       \
-        if (ptr && _ext_free)                                               \
-        {                                                                   \
-            _ext_free(ptr);                                                 \
-        }                                                                   \
-    }while (0)
-
-#ifndef BIT
-#define BIT(nr) (1UL << (nr))
-#endif	/* End of BIT */
-
-/* bits range: for example BITS(16,23) = 0xFF0000*/
-#ifndef BITS
-#define BITS(m, n)   (~(BIT(m) - 1) & ((BIT(n) - 1) | BIT(n)))
-#endif	/* End of BITS */
-
-/* bits range: for example BITS_RANGE(16,4) = 0x0F0000*/
-#ifndef BITS_RANGE
-#define BITS_RANGE(offset, range)   BITS(offset, ((offset)+(range)-1))
-#endif	/* End of BITS_RANGE */
-
-/* bits offset right: for example BITS_OFF_R(0x1234, 8, 4) = 0x2 */
-#ifndef BITS_OFF_R
-#define BITS_OFF_R(val, offset, range)   ((val >> offset) & (BIT(range) - 1))
-#endif	/* End of BITS_OFF_R */
-
-/* bits offset left: for example BITS_OFF_L(0x1234, 8, 4) = 0x400 */
-#ifndef BITS_OFF_L
-#define BITS_OFF_L(val, offset, range)   ((val & (BIT(range) - 1)) << offset)
-#endif	/* End of BITS_OFF_L */
-
-#ifndef MAX
-#define MAX(a, b)   (((a)>(b))?(a):(b))
-#endif	/* End of MAX */
-
-#ifndef MIN
-#define MIN(a, b)   (((a)<(b))?(a):(b))
-#endif	/* End of MIN */
-
-/* DATA TYPE DECLARATIONS
- */
-typedef AIR_ERROR_NO_T
-(*AIR_PRINTF)(
-    C8_T* fmt,
-    ...);
-
-typedef void
-(*AIR_UDELAY)(
-    UI32_T us);
-
-typedef void*
-(*AIR_MALLOC)(
-    UI32_T size);
-
-typedef void
-(*AIR_FREE)(
-    void *ptr);
-
-typedef struct
-{
-    AML_DEV_ACCESS_T    dev_access;
-    AIR_PRINTF         printf;
-    AIR_UDELAY         udelay;
-    AIR_MALLOC         malloc;
-    AIR_FREE           free;
-}AIR_INIT_PARAM_T;
-
-/* EXPORTED SUBPROGRAM SPECIFICATIONS
- */
-extern AIR_PRINTF _ext_printf;
-extern AIR_UDELAY _ext_udelay;
-extern AIR_MALLOC _ext_malloc;
-extern AIR_FREE   _ext_free;
-
-
-/* FUNCTION NAME:   air_init
- * PURPOSE:
- *      This API is used to initialize the SDK.
- *
- * INPUT:
- *      unit            --  The device unit
- *      ptr_init_param  --  The sdk callback functions.
- *
- * OUTPUT:
- *      None
- *
- * RETURN:
- *      AIR_E_OK
- *      AIR_E_OTHERS
- *
- * NOTES:
- *      None
- */
-AIR_ERROR_NO_T
-air_init(
-    const UI32_T unit,
-    AIR_INIT_PARAM_T *ptr_init_param);
-
-/* FUNCTION NAME:   air_hw_reset
- * PURPOSE:
- *      This API is used to reset hardware.
- *
- * INPUT:
- *      unit            --  The device unit
- *
- * OUTPUT:
- *      None
- *
- * RETURN:
- *      AIR_E_OK
- *      AIR_E_OTHERS
- *
- * NOTES:
- *      None
- */
-AIR_ERROR_NO_T
-air_hw_reset(
-    const UI32_T unit);
-
-/* FUNCTION NAME:   air_set_gpio_pin_mux
- * PURPOSE:
- *      This API is used to set gpio pin mux.
- *
- * INPUT:
- *      unit            --  The device unit
- *
- * OUTPUT:
- *      None
- *
- * RETURN:
- *      AIR_E_OK
- *      AIR_E_OTHERS
- *
- * NOTES:
- *      None
- */
-AIR_ERROR_NO_T
-air_set_gpio_pin_mux(
-    const UI32_T unit);
-
-#endif  /* AIR_H */
-
+/* FILE NAME:   air.h
+ * PURPOSE:
+ *      Define the initialization in AIR SDK.
+ * NOTES:
+ */
+
+#ifndef AIR_H
+#define AIR_H
+
+/* INCLUDE FILE DECLARATIONS
+ */
+#include <stdio.h>
+#include <string.h>
+#include "air_types.h"
+#include "air_error.h"
+#include "air_reg.h"
+#include "air_aml.h"
+#include "air_port.h"
+#include "air_vlan.h"
+#include "air_lag.h"
+#include "air_l2.h"
+#include "air_stp.h"
+#include "air_mirror.h"
+#include "air_mib.h"
+#include "air_diag.h"
+#include "air_led.h"
+#include "air_cmd.h"
+#include "air_qos.h"
+#include "air_switch.h"
+#include "air_ver.h"
+#include "air_sec.h"
+#include "air_acl.h"
+#include "air_sptag.h"
+
+/* NAMING CONSTANT DECLARATIONS
+ */
+
+/* MACRO FUNCTION DECLARATIONS
+ */
+#define AIR_CHECK_PTR(__ptr__) do                                          \
+{                                                                           \
+    if (NULL == (__ptr__))                                                  \
+    {                                                                       \
+        return  AIR_E_BAD_PARAMETER;                                       \
+    }                                                                       \
+} while (0)
+
+#define AIR_PARAM_CHK(expr, errCode) do                                    \
+{                                                                           \
+    if ((I32_T)(expr))                                                      \
+    {                                                                       \
+        return errCode;                                                     \
+    }                                                                       \
+} while (0)
+
+#define AIR_PRINT(fmt,...) do                                              \
+{                                                                           \
+    if (_ext_printf)                                                        \
+    {                                                                       \
+        _ext_printf(fmt, ##__VA_ARGS__);                                    \
+    }                                                                       \
+}while (0)
+
+#define AIR_UDELAY(us) do                                                  \
+{                                                                           \
+    if (_ext_udelay)                                                        \
+    {                                                                       \
+        _ext_udelay(us);                                                    \
+    }                                                                       \
+}while (0)
+
+#define AIR_MALLOC(size) (_ext_malloc ? _ext_malloc(size) : NULL)
+
+#define AIR_FREE(ptr) do                                                   \
+    {                                                                       \
+        if (ptr && _ext_free)                                               \
+        {                                                                   \
+            _ext_free(ptr);                                                 \
+        }                                                                   \
+    }while (0)
+
+#ifndef BIT
+#define BIT(nr) (1UL << (nr))
+#endif	/* End of BIT */
+
+/* bits range: for example BITS(16,23) = 0xFF0000*/
+#ifndef BITS
+#define BITS(m, n)   (~(BIT(m) - 1) & ((BIT(n) - 1) | BIT(n)))
+#endif	/* End of BITS */
+
+/* bits range: for example BITS_RANGE(16,4) = 0x0F0000*/
+#ifndef BITS_RANGE
+#define BITS_RANGE(offset, range)   BITS(offset, ((offset)+(range)-1))
+#endif	/* End of BITS_RANGE */
+
+/* bits offset right: for example BITS_OFF_R(0x1234, 8, 4) = 0x2 */
+#ifndef BITS_OFF_R
+#define BITS_OFF_R(val, offset, range)   ((val >> offset) & (BIT(range) - 1))
+#endif	/* End of BITS_OFF_R */
+
+/* bits offset left: for example BITS_OFF_L(0x1234, 8, 4) = 0x400 */
+#ifndef BITS_OFF_L
+#define BITS_OFF_L(val, offset, range)   ((val & (BIT(range) - 1)) << offset)
+#endif	/* End of BITS_OFF_L */
+
+#ifndef MAX
+#define MAX(a, b)   (((a)>(b))?(a):(b))
+#endif	/* End of MAX */
+
+#ifndef MIN
+#define MIN(a, b)   (((a)<(b))?(a):(b))
+#endif	/* End of MIN */
+
+/* DATA TYPE DECLARATIONS
+ */
+typedef int
+(*AIR_PRINTF)(
+    const C8_T* fmt,
+    ...);
+
+typedef int
+(*AIR_UDELAY)(
+    UI32_T us);
+
+typedef void*
+(*AIR_MALLOC)(
+    long unsigned int size);
+
+typedef void
+(*AIR_FREE)(
+    void *ptr);
+
+typedef struct
+{
+    AML_DEV_ACCESS_T    dev_access;
+    AIR_PRINTF         printf;
+    AIR_UDELAY         udelay;
+    AIR_MALLOC         malloc;
+    AIR_FREE           free;
+}AIR_INIT_PARAM_T;
+
+/* EXPORTED SUBPROGRAM SPECIFICATIONS
+ */
+extern AIR_PRINTF _ext_printf;
+extern AIR_UDELAY _ext_udelay;
+extern AIR_MALLOC _ext_malloc;
+extern AIR_FREE   _ext_free;
+
+
+/* FUNCTION NAME:   air_init
+ * PURPOSE:
+ *      This API is used to initialize the SDK.
+ *
+ * INPUT:
+ *      unit            --  The device unit
+ *      ptr_init_param  --  The sdk callback functions.
+ *
+ * OUTPUT:
+ *      None
+ *
+ * RETURN:
+ *      AIR_E_OK
+ *      AIR_E_OTHERS
+ *
+ * NOTES:
+ *      None
+ */
+AIR_ERROR_NO_T
+air_init(
+    const UI32_T unit,
+    AIR_INIT_PARAM_T *ptr_init_param);
+
+/* FUNCTION NAME:   air_hw_reset
+ * PURPOSE:
+ *      This API is used to reset hardware.
+ *
+ * INPUT:
+ *      unit            --  The device unit
+ *
+ * OUTPUT:
+ *      None
+ *
+ * RETURN:
+ *      AIR_E_OK
+ *      AIR_E_OTHERS
+ *
+ * NOTES:
+ *      None
+ */
+AIR_ERROR_NO_T
+air_hw_reset(
+    const UI32_T unit);
+
+/* FUNCTION NAME:   air_set_gpio_pin_mux
+ * PURPOSE:
+ *      This API is used to set gpio pin mux.
+ *
+ * INPUT:
+ *      unit            --  The device unit
+ *
+ * OUTPUT:
+ *      None
+ *
+ * RETURN:
+ *      AIR_E_OK
+ *      AIR_E_OTHERS
+ *
+ * NOTES:
+ *      None
+ */
+AIR_ERROR_NO_T
+air_set_gpio_pin_mux(
+    const UI32_T unit);
+
+#endif  /* AIR_H */
+
diff --git a/recipes-devtools/switch/files/src/an8855_sdk/api/inc/air_aml.h b/recipes-devtools/switch/files/src/an8855_sdk/api/inc/air_aml.h
index 49a38b6..8d40bee 100644
--- a/recipes-devtools/switch/files/src/an8855_sdk/api/inc/air_aml.h
+++ b/recipes-devtools/switch/files/src/an8855_sdk/api/inc/air_aml.h
@@ -1,214 +1,214 @@
-/* FILE NAME:   air_aml.h
- * PURPOSE:
- *      Define the access management layer function in AIR SDK.
- * NOTES:
- */
-
-#ifndef AIR_AML_H
-#define AIR_AML_H
-
-/* INCLUDE FILE DECLARATIONS
- */
-
-/* NAMING CONSTANT DECLARATIONS
- */
-
-/* MACRO FUNCTION DECLARATIONS
- */
-
-/* DATA TYPE DECLARATIONS
- */
-typedef AIR_ERROR_NO_T
-(*AML_DEV_READ_FUNC_T)(
-    const UI32_T    unit,
-    const UI32_T    addr_offset,
-    UI32_T          *ptr_data);
-
-typedef AIR_ERROR_NO_T
-(*AML_DEV_WRITE_FUNC_T)(
-    const UI32_T    unit,
-    const UI32_T    addr_offset,
-    const UI32_T    data);
-
-typedef AIR_ERROR_NO_T
-(*AML_DEV_PHY_READ_FUNC_T)(
-    const UI32_T    unit,
-    const UI32_T    port_id,
-    const UI32_T    addr_offset,
-    UI32_T          *ptr_data);
-
-typedef AIR_ERROR_NO_T
-(*AML_DEV_PHY_WRITE_FUNC_T)(
-    const UI32_T    unit,
-    const UI32_T    port_id,
-    const UI32_T    addr_offset,
-    const UI32_T    data);
-
-typedef AIR_ERROR_NO_T
-(*AML_DEV_PHY_READ_CL45_FUNC_T)(
-    const UI32_T    unit,
-    const UI32_T    port_id,
-    const UI32_T    dev_type,
-    const UI32_T    addr_offset,
-    UI32_T          *ptr_data);
-
-typedef AIR_ERROR_NO_T
-(*AML_DEV_PHY_WRITE_CL45_FUNC_T)(
-    const UI32_T    unit,
-    const UI32_T    port_id,
-    const UI32_T    dev_type,
-    const UI32_T    addr_offset,
-    const UI32_T    data);
-
-/* To read or write the HW-intf registers. */
-typedef struct
-{
-    AML_DEV_READ_FUNC_T             read_callback;
-    AML_DEV_WRITE_FUNC_T            write_callback;
-    AML_DEV_PHY_READ_FUNC_T         phy_read_callback;
-    AML_DEV_PHY_WRITE_FUNC_T        phy_write_callback;
-    AML_DEV_PHY_READ_CL45_FUNC_T    phy_cl45_read_callback;
-    AML_DEV_PHY_WRITE_CL45_FUNC_T   phy_cl45_write_callback;
-}AML_DEV_ACCESS_T;
-
-/* EXPORTED SUBPROGRAM SPECIFICATIONS
- */
-extern AML_DEV_ACCESS_T _ext_dev_access;
-
-/* FUNCTION NAME:   aml_readReg
- * PURPOSE:
- *      To read data from the register of the specified chip unit.
- * INPUT:
- *      unit        -- the device unit
- *      addr_offset -- the address of register
- * OUTPUT:
- *      ptr_data    -- pointer for the register data
- * RETURN:
- *      NPS_E_OK     -- Successfully read the data.
- *      NPS_E_OTHERS -- Failed to read the data.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-aml_readReg(
-    const UI32_T    unit,
-    const UI32_T    addr_offset,
-    UI32_T          *ptr_data);
-
-/* FUNCTION NAME:   aml_writeReg
- * PURPOSE:
- *      To write data to the register of the specified chip unit.
- * INPUT:
- *      unit        -- the device unit
- *      addr_offset -- the address of register
- *      data        -- written data
- * OUTPUT:
- *      none
- * RETURN:
- *      NPS_E_OK     -- Successfully write the data.
- *      NPS_E_OTHERS -- Failed to write the data.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-aml_writeReg(
-    const UI32_T    unit,
-    const UI32_T    addr_offset,
-    const UI32_T    data);
-
-/* FUNCTION NAME:   aml_readPhyReg
- * PURPOSE:
- *      To read data from the phy register of the specified chip unit in Clause22.
- * INPUT:
- *      unit        -- the device unit
- *      port_id     -- physical port number
- *      addr_offset -- the address of phy register
- * OUTPUT:
- *      ptr_data    -- pointer for the register data
- * RETURN:
- *      NPS_E_OK     -- Successfully read the data.
- *      NPS_E_OTHERS -- Failed to read the data.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-aml_readPhyReg(
-    const UI32_T    unit,
-    const UI32_T    port_id,
-    const UI32_T    addr_offset,
-    UI32_T          *ptr_data);
-
-/* FUNCTION NAME:   aml_writePhyReg
- * PURPOSE:
- *      To write data to the phy register of the specified chip unit in Clause22.
- * INPUT:
- *      unit        -- the device unit
- *      port_id     -- physical port number
- *      addr_offset -- the address of phy register
- *      data        -- written data
- * OUTPUT:
- *      none
- * RETURN:
- *      NPS_E_OK     -- Successfully write the data.
- *      NPS_E_OTHERS -- Failed to write the data.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-aml_writePhyReg(
-    const UI32_T    unit,
-    const UI32_T    port_id,
-    const UI32_T    addr_offset,
-    const UI32_T    ptr_data);
-
-/* FUNCTION NAME:   aml_readPhyRegCL45
- * PURPOSE:
- *      To read data from the phy register of the specified chip unit in Clause45.
- * INPUT:
- *      unit        -- the device unit
- *      port_id     -- physical port number
- *      dev_type    -- phy register type
- *      addr_offset -- the address of phy register
- * OUTPUT:
- *      ptr_data    -- pointer for the register data
- * RETURN:
- *      NPS_E_OK     -- Successfully read the data.
- *      NPS_E_OTHERS -- Failed to read the data.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-aml_readPhyRegCL45(
-    const UI32_T    unit,
-    const UI32_T    port_id,
-    const UI32_T    dev_type,
-    const UI32_T    addr_offset,
-    UI32_T          *ptr_data);
-
-/* FUNCTION NAME:   aml_writePhyRegCL45
- * PURPOSE:
- *      To write data to the phy register of the specified chip unit in Clause45.
- * INPUT:
- *      unit        -- the device unit
- *      port_id     -- physical port number
- *      dev_type    -- phy register offset
- *      addr_offset -- the address of phy register
- *      data        -- written data
- * OUTPUT:
- *      none
- * RETURN:
- *      NPS_E_OK     -- Successfully write the data.
- *      NPS_E_OTHERS -- Failed to write the data.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-aml_writePhyRegCL45(
-    const UI32_T    unit,
-    const UI32_T    port_id,
-    const UI32_T    dev_type,
-    const UI32_T    addr_offset,
-    const UI32_T    data);
-
-#endif  /* AIR_AML_H */
-
+/* FILE NAME:   air_aml.h
+ * PURPOSE:
+ *      Define the access management layer function in AIR SDK.
+ * NOTES:
+ */
+
+#ifndef AIR_AML_H
+#define AIR_AML_H
+
+/* INCLUDE FILE DECLARATIONS
+ */
+
+/* NAMING CONSTANT DECLARATIONS
+ */
+
+/* MACRO FUNCTION DECLARATIONS
+ */
+
+/* DATA TYPE DECLARATIONS
+ */
+typedef AIR_ERROR_NO_T
+(*AML_DEV_READ_FUNC_T)(
+    const UI32_T    unit,
+    const UI32_T    addr_offset,
+    UI32_T          *ptr_data);
+
+typedef AIR_ERROR_NO_T
+(*AML_DEV_WRITE_FUNC_T)(
+    const UI32_T    unit,
+    const UI32_T    addr_offset,
+    const UI32_T    data);
+
+typedef AIR_ERROR_NO_T
+(*AML_DEV_PHY_READ_FUNC_T)(
+    const UI32_T    unit,
+    const UI32_T    port_id,
+    const UI32_T    addr_offset,
+    UI32_T          *ptr_data);
+
+typedef AIR_ERROR_NO_T
+(*AML_DEV_PHY_WRITE_FUNC_T)(
+    const UI32_T    unit,
+    const UI32_T    port_id,
+    const UI32_T    addr_offset,
+    const UI32_T    data);
+
+typedef AIR_ERROR_NO_T
+(*AML_DEV_PHY_READ_CL45_FUNC_T)(
+    const UI32_T    unit,
+    const UI32_T    port_id,
+    const UI32_T    dev_type,
+    const UI32_T    addr_offset,
+    UI32_T          *ptr_data);
+
+typedef AIR_ERROR_NO_T
+(*AML_DEV_PHY_WRITE_CL45_FUNC_T)(
+    const UI32_T    unit,
+    const UI32_T    port_id,
+    const UI32_T    dev_type,
+    const UI32_T    addr_offset,
+    const UI32_T    data);
+
+/* To read or write the HW-intf registers. */
+typedef struct
+{
+    AML_DEV_READ_FUNC_T             read_callback;
+    AML_DEV_WRITE_FUNC_T            write_callback;
+    AML_DEV_PHY_READ_FUNC_T         phy_read_callback;
+    AML_DEV_PHY_WRITE_FUNC_T        phy_write_callback;
+    AML_DEV_PHY_READ_CL45_FUNC_T    phy_cl45_read_callback;
+    AML_DEV_PHY_WRITE_CL45_FUNC_T   phy_cl45_write_callback;
+}AML_DEV_ACCESS_T;
+
+/* EXPORTED SUBPROGRAM SPECIFICATIONS
+ */
+extern AML_DEV_ACCESS_T _ext_dev_access;
+
+/* FUNCTION NAME:   aml_readReg
+ * PURPOSE:
+ *      To read data from the register of the specified chip unit.
+ * INPUT:
+ *      unit        -- the device unit
+ *      addr_offset -- the address of register
+ * OUTPUT:
+ *      ptr_data    -- pointer for the register data
+ * RETURN:
+ *      NPS_E_OK     -- Successfully read the data.
+ *      NPS_E_OTHERS -- Failed to read the data.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+aml_readReg(
+    const UI32_T    unit,
+    const UI32_T    addr_offset,
+    UI32_T          *ptr_data);
+
+/* FUNCTION NAME:   aml_writeReg
+ * PURPOSE:
+ *      To write data to the register of the specified chip unit.
+ * INPUT:
+ *      unit        -- the device unit
+ *      addr_offset -- the address of register
+ *      data        -- written data
+ * OUTPUT:
+ *      none
+ * RETURN:
+ *      NPS_E_OK     -- Successfully write the data.
+ *      NPS_E_OTHERS -- Failed to write the data.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+aml_writeReg(
+    const UI32_T    unit,
+    const UI32_T    addr_offset,
+    const UI32_T    data);
+
+/* FUNCTION NAME:   aml_readPhyReg
+ * PURPOSE:
+ *      To read data from the phy register of the specified chip unit in Clause22.
+ * INPUT:
+ *      unit        -- the device unit
+ *      port_id     -- physical port number
+ *      addr_offset -- the address of phy register
+ * OUTPUT:
+ *      ptr_data    -- pointer for the register data
+ * RETURN:
+ *      NPS_E_OK     -- Successfully read the data.
+ *      NPS_E_OTHERS -- Failed to read the data.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+aml_readPhyReg(
+    const UI32_T    unit,
+    const UI32_T    port_id,
+    const UI32_T    addr_offset,
+    UI32_T          *ptr_data);
+
+/* FUNCTION NAME:   aml_writePhyReg
+ * PURPOSE:
+ *      To write data to the phy register of the specified chip unit in Clause22.
+ * INPUT:
+ *      unit        -- the device unit
+ *      port_id     -- physical port number
+ *      addr_offset -- the address of phy register
+ *      data        -- written data
+ * OUTPUT:
+ *      none
+ * RETURN:
+ *      NPS_E_OK     -- Successfully write the data.
+ *      NPS_E_OTHERS -- Failed to write the data.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+aml_writePhyReg(
+    const UI32_T    unit,
+    const UI32_T    port_id,
+    const UI32_T    addr_offset,
+    const UI32_T    ptr_data);
+
+/* FUNCTION NAME:   aml_readPhyRegCL45
+ * PURPOSE:
+ *      To read data from the phy register of the specified chip unit in Clause45.
+ * INPUT:
+ *      unit        -- the device unit
+ *      port_id     -- physical port number
+ *      dev_type    -- phy register type
+ *      addr_offset -- the address of phy register
+ * OUTPUT:
+ *      ptr_data    -- pointer for the register data
+ * RETURN:
+ *      NPS_E_OK     -- Successfully read the data.
+ *      NPS_E_OTHERS -- Failed to read the data.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+aml_readPhyRegCL45(
+    const UI32_T    unit,
+    const UI32_T    port_id,
+    const UI32_T    dev_type,
+    const UI32_T    addr_offset,
+    UI32_T          *ptr_data);
+
+/* FUNCTION NAME:   aml_writePhyRegCL45
+ * PURPOSE:
+ *      To write data to the phy register of the specified chip unit in Clause45.
+ * INPUT:
+ *      unit        -- the device unit
+ *      port_id     -- physical port number
+ *      dev_type    -- phy register offset
+ *      addr_offset -- the address of phy register
+ *      data        -- written data
+ * OUTPUT:
+ *      none
+ * RETURN:
+ *      NPS_E_OK     -- Successfully write the data.
+ *      NPS_E_OTHERS -- Failed to write the data.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+aml_writePhyRegCL45(
+    const UI32_T    unit,
+    const UI32_T    port_id,
+    const UI32_T    dev_type,
+    const UI32_T    addr_offset,
+    const UI32_T    data);
+
+#endif  /* AIR_AML_H */
+
diff --git a/recipes-devtools/switch/files/src/an8855_sdk/api/inc/air_cmd.h b/recipes-devtools/switch/files/src/an8855_sdk/api/inc/air_cmd.h
index 071d063..766a9a3 100644
--- a/recipes-devtools/switch/files/src/an8855_sdk/api/inc/air_cmd.h
+++ b/recipes-devtools/switch/files/src/an8855_sdk/api/inc/air_cmd.h
@@ -1,50 +1,50 @@
-/* FILE NAME:   air_cmd.h
- * PURPOSE:
- *      Define the command line function in AIR SDK.
- * NOTES:
- */
-
-#ifndef AIR_CMD_H
-#define AIR_CMD_H
-
-/* INCLUDE FILE DECLARATIONS
- */
-
-/* NAMING CONSTANT DECLARATIONS
- */
-
-/* MACRO FUNCTION DECLARATIONS
- */
-
-/* DATA TYPE DECLARATIONS
- */
-
-/* EXPORTED SUBPROGRAM SPECIFICATIONS
- */
-/* FUNCTION NAME:   air_parse_cmd
- * PURPOSE:
- *      This function is used process diagnostic cmd
- * INPUT:
- *      argc         -- parameter number
- *      argv         -- parameter strings
- * OUTPUT:
- *      None
- * RETURN:
- *      NPS_E_OK     -- Successfully read the data.
- *      NPS_E_OTHERS -- Failed to read the data.
- * NOTES:
- *
- */
-AIR_ERROR_NO_T
-air_parse_cmd(
-    const UI32_T argc,
-    const C8_T **argv);
-
-UI32_T
-_strtoul(
-    const C8_T *cp,
-    C8_T **endp,
-    UI32_T base);
-
-#endif  /* AIR_CMD_H */
-
+/* FILE NAME:   air_cmd.h
+ * PURPOSE:
+ *      Define the command line function in AIR SDK.
+ * NOTES:
+ */
+
+#ifndef AIR_CMD_H
+#define AIR_CMD_H
+
+/* INCLUDE FILE DECLARATIONS
+ */
+
+/* NAMING CONSTANT DECLARATIONS
+ */
+
+/* MACRO FUNCTION DECLARATIONS
+ */
+
+/* DATA TYPE DECLARATIONS
+ */
+
+/* EXPORTED SUBPROGRAM SPECIFICATIONS
+ */
+/* FUNCTION NAME:   air_parse_cmd
+ * PURPOSE:
+ *      This function is used process diagnostic cmd
+ * INPUT:
+ *      argc         -- parameter number
+ *      argv         -- parameter strings
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      NPS_E_OK     -- Successfully read the data.
+ *      NPS_E_OTHERS -- Failed to read the data.
+ * NOTES:
+ *
+ */
+AIR_ERROR_NO_T
+air_parse_cmd(
+    const UI32_T argc,
+    const C8_T **argv);
+
+UI32_T
+_strtoul(
+    const C8_T *cp,
+    C8_T **endp,
+    UI32_T base);
+
+#endif  /* AIR_CMD_H */
+
diff --git a/recipes-devtools/switch/files/src/an8855_sdk/api/inc/air_error.h b/recipes-devtools/switch/files/src/an8855_sdk/api/inc/air_error.h
index 836d400..a8852ca 100644
--- a/recipes-devtools/switch/files/src/an8855_sdk/api/inc/air_error.h
+++ b/recipes-devtools/switch/files/src/an8855_sdk/api/inc/air_error.h
@@ -1,56 +1,56 @@
-/* FILE NAME:   air_error.h
- * PURPOSE:
- *      Define the error code in AIR SDK.
- * NOTES:
- */
-
-#ifndef AIR_ERROR_H
-#define AIR_ERROR_H
-
-/* INCLUDE FILE DECLARATIONS
- */
-
-/* NAMING CONSTANT DECLARATIONS
- */
-
-/* MACRO FUNCTION DECLARATIONS
- */
-
-/* DATA TYPE DECLARATIONS
- */
-typedef enum
-{
-    AIR_E_OK = 0,              /* Ok and no error */
-    AIR_E_OTHERS,              /* Operation is unsuccessful */
-    AIR_E_BAD_PARAMETER,       /* Parameter is wrong */
-    AIR_E_TABLE_FULL,          /* Table is full */
-    AIR_E_ENTRY_NOT_FOUND,     /* Entry is not found */
-    AIR_E_ENTRY_EXISTS,        /* Entry already exists */
-    AIR_E_NOT_SUPPORT,         /* Feature is not supported */
-    AIR_E_TIMEOUT,             /* Time out error */
-    AIR_E_LAST
-} AIR_ERROR_NO_T;
-
-/* EXPORTED SUBPROGRAM SPECIFICATIONS
- */
-/* FUNCTION NAME:   air_error_getString
- * PURPOSE:
- *      To obtain the error string of the specified error code
- *
- * INPUT:
- *      cause  -- The specified error code
- * OUTPUT:
- *      None
- * RETURN:
- *      Pointer to the target error string
- *
- * NOTES:
- *
- *
- */
-C8_T *
-air_error_getString(
-    const AIR_ERROR_NO_T cause );
-
-#endif  /* AIR_ERROR_H */
-
+/* FILE NAME:   air_error.h
+ * PURPOSE:
+ *      Define the error code in AIR SDK.
+ * NOTES:
+ */
+
+#ifndef AIR_ERROR_H
+#define AIR_ERROR_H
+
+/* INCLUDE FILE DECLARATIONS
+ */
+
+/* NAMING CONSTANT DECLARATIONS
+ */
+
+/* MACRO FUNCTION DECLARATIONS
+ */
+
+/* DATA TYPE DECLARATIONS
+ */
+typedef enum
+{
+    AIR_E_OK = 0,              /* Ok and no error */
+    AIR_E_OTHERS,              /* Operation is unsuccessful */
+    AIR_E_BAD_PARAMETER,       /* Parameter is wrong */
+    AIR_E_TABLE_FULL,          /* Table is full */
+    AIR_E_ENTRY_NOT_FOUND,     /* Entry is not found */
+    AIR_E_ENTRY_EXISTS,        /* Entry already exists */
+    AIR_E_NOT_SUPPORT,         /* Feature is not supported */
+    AIR_E_TIMEOUT,             /* Time out error */
+    AIR_E_LAST
+} AIR_ERROR_NO_T;
+
+/* EXPORTED SUBPROGRAM SPECIFICATIONS
+ */
+/* FUNCTION NAME:   air_error_getString
+ * PURPOSE:
+ *      To obtain the error string of the specified error code
+ *
+ * INPUT:
+ *      cause  -- The specified error code
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      Pointer to the target error string
+ *
+ * NOTES:
+ *
+ *
+ */
+C8_T *
+air_error_getString(
+    const AIR_ERROR_NO_T cause );
+
+#endif  /* AIR_ERROR_H */
+
diff --git a/recipes-devtools/switch/files/src/an8855_sdk/api/inc/air_port.h b/recipes-devtools/switch/files/src/an8855_sdk/api/inc/air_port.h
index a8745eb..3a39d9b 100644
--- a/recipes-devtools/switch/files/src/an8855_sdk/api/inc/air_port.h
+++ b/recipes-devtools/switch/files/src/an8855_sdk/api/inc/air_port.h
@@ -1,963 +1,963 @@
-/* FILE NAME:   air_port.h
- * PURPOSE:
- *      Define port function in AIR SDK.
- *
- * NOTES:
- *      None
- */
-
-#ifndef AIR_PORT_H
-#define AIR_PORT_H
-
-/* INCLUDE FILE DECLARATIONS
- */
-
-/* NAMING CONSTANT DECLARATIONS
- */
-#define AIR_MAX_NUM_OF_UNIT            (1)
-#define AIR_DST_DEFAULT_PORT           (31)
-#define AIR_PORT_TX                    (0x00)
-#define AIR_PORT_RX                    (0x01)
-#define AIR_MAX_NUM_OF_PORTS           (7)
-#define AIR_MAX_NUM_OF_GIGA_PORTS      (5)
-#define AIR_SGMII_PORT_OFFSET_BEGIN    (5)
-#define AIR_SGMII_PORT_OFFSET_END      (6)
-#define AIR_ALL_PORT_BITMAP            (0x7F)
-
-/* Definition of Power Saving mode */
-#define AIR_PORT_PS_LINKSTATUS         (0x1 << 0)
-#define AIR_PORT_PS_EEE                (0x1 << 1)
-#define AIR_PORT_PS_MASK               (0x3)
-
-/* MACRO FUNCTION DECLARATIONS
- */
-
-/* DATA TYPE DECLARATIONS
- */
-/* AIR_PORT_BITMAP_T is the data type for physical port bitmap. */
-#define AIR_BITMAP_SIZE(bit_num)                    ((((bit_num) - 1) / AIR_MAX_NUM_OF_PORTS) + 1)
-#define AIR_PORT_BITMAP_SIZE           AIR_BITMAP_SIZE(AIR_MAX_NUM_OF_PORTS)
-typedef UI32_T   AIR_PORT_BITMAP_T[AIR_PORT_BITMAP_SIZE];
-
-#define AIR_INVALID_ID      (0xFFFFFFFF)
-#define AIR_PORT_INVALID    (AIR_INVALID_ID)
-
-/* Definition of SGMII mode */
-typedef enum
-{
-    AIR_PORT_SGMII_MODE_AN,
-    AIR_PORT_SGMII_MODE_FORCE,
-    AIR_PORT_SGMII_MODE_LAST
-}AIR_PORT_SGMII_MODE_T;
-
-/* Definition of port speed */
-typedef enum
-{
-    AIR_PORT_SPEED_10M,
-    AIR_PORT_SPEED_100M,
-    AIR_PORT_SPEED_1000M,
-    AIR_PORT_SPEED_2500M,
-    AIR_PORT_SPEED_LAST
-}AIR_PORT_SPEED_T;
-
-typedef enum
-{
-    AIR_PORT_DUPLEX_HALF,
-    AIR_PORT_DUPLEX_FULL,
-    AIR_PORT_DUPLEX_LAST
-}AIR_PORT_DUPLEX_T;
-
-typedef enum
-{
-    AIR_PORT_LINK_DOWN,
-    AIR_PORT_LINK_UP,
-    AIR_PORT_LINK_LAST
-}AIR_PORT_LINK_T;
-
-/* Definition of Smart speed down will occur after AN failed how many times */
-typedef enum
-{
-    AIR_PORT_SSD_2T,
-    AIR_PORT_SSD_3T,
-    AIR_PORT_SSD_4T,
-    AIR_PORT_SSD_5T,
-    AIR_PORT_SSD_LAST
-}AIR_PORT_SSD_T;
-
-typedef enum
-{
-    AIR_PORT_VLAN_MODE_PORT_MATRIX = 0,    /* Port matrix mode  */
-    AIR_PORT_VLAN_MODE_FALLBACK,           /* Fallback mode  */
-    AIR_PORT_VLAN_MODE_CHECK,              /* Check mode  */
-    AIR_PORT_VLAN_MODE_SECURITY,           /* Security mode  */
-    AIR_PORT_VLAN_MODE_LAST
-} AIR_PORT_VLAN_MODE_T;
-
-/* Definition of AN Advertisement Register */
-typedef struct AIR_AN_ADV_S
-{
-    BOOL_T advCap10HDX;         /* Advertises 10 BASE-T HDX */
-    BOOL_T advCap10FDX;         /* Advertises 10 BASE-T FDX */
-    BOOL_T advCap100HDX;        /* Advertises 100 BASE-T HDX */
-    BOOL_T advCap100FDX;        /* Advertises 100 BASE-T FDX */
-    BOOL_T advCap1000FDX;       /* Advertises 1000 BASE-T FDX */
-    BOOL_T advPause;            /* Advertieses Asynchronous Pause */
-}AIR_AN_ADV_T;
-
-/* Definition of Link Status of a specific port */
-typedef struct AIR_PORT_STATUS_S
-{
-    BOOL_T link;
-    BOOL_T duplex;
-    UI32_T speed;
-}AIR_PORT_STATUS_T;
-
-/* EXPORTED SUBPROGRAM SPECIFICATIONS
- */
-/* FUNCTION NAME: air_port_setPortMatrix
- * PURPOSE:
- *      Set port matrix from the specified device.
- *
- * INPUT:
- *      unit            --  Unit id
- *      port            --  Port id
- *      port_bitmap     --  Matrix port bitmap
- *
- * OUTPUT:
- *      None
- *
- * RETURN:
- *      AIR_E_OK
- *      AIR_E_OTHERS
- *      AIR_E_BAD_PARAMETER
- *
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_port_setPortMatrix(
-    const UI32_T    unit,
-    const UI32_T    port,
-    const UI32_T    port_bitmap);
-
-/* FUNCTION NAME: air_port_getPortMatrix
- * PURPOSE:
- *      Get port matrix from the specified device.
- *
- * INPUT:
- *      unit            --  Unit id
- *      port            --  Port id
- *
- * OUTPUT:
- *      p_port_bitmap   --  Matrix port bitmap
- *
- * RETURN:
- *      AIR_E_OK
- *      AIR_E_OTHERS
- *      AIR_E_BAD_PARAMETER
- *
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_port_getPortMatrix(
-    const UI32_T    unit,
-    const UI32_T    port,
-    UI32_T          *p_port_bitmap);
-
-/* FUNCTION NAME: air_port_setVlanMode
- * PURPOSE:
- *      Set port-based vlan mechanism from the specified device.
- *
- * INPUT:
- *      unit            --  Unit id
- *      port            --  Port id
- *      mode            --  Port vlan mode
- *
- * OUTPUT:
- *      None
- *
- * RETURN:
- *      AIR_E_OK
- *      AIR_E_OTHERS
- *      AIR_E_BAD_PARAMETER
- *
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_port_setVlanMode(
-    const UI32_T    unit,
-    const UI32_T    port,
-    const AIR_PORT_VLAN_MODE_T mode);
-
-/* FUNCTION NAME: air_port_getVlanMode
- * PURPOSE:
- *      Get port-based vlan mechanism from the specified device.
- *
- * INPUT:
- *      unit            --  Unit id
- *      port            --  Port id
- *
- * OUTPUT:
- *      p_mode          --  Port vlan mode
- *
- * RETURN:
- *      AIR_E_OK
- *      AIR_E_OTHERS
- *      AIR_E_BAD_PARAMETER
- *
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_port_getVlanMode(
-    const UI32_T    unit,
-    const UI32_T    port,
-    AIR_PORT_VLAN_MODE_T *p_mode);
-
-/* FUNCTION NAME: air_port_setAnMode
- * PURPOSE:
- *      Set the auto-negotiation mode for a specific port.(Auto or Forced)
- *
- * INPUT:
- *      unit            --  Device ID
- *      port            --  Index of port number
- *      state           --  FALSE:Disable
- *                          TRUE: Enable
- * OUTPUT:
- *      None
- *
- * RETURN:
- *      AIR_E_OK
- *      AIR_E_BAD_PARAMETER
- *
- * NOTES:
- *      None
- */
-AIR_ERROR_NO_T
-air_port_setAnMode(
-    const UI32_T unit,
-    const UI32_T port,
-    const BOOL_T state);
-
-/* FUNCTION NAME: air_port_getAnMode
- * PURPOSE:
- *      Get the auto-negotiation mode for a specific port.
- *
- * INPUT:
- *      unit            --  Device ID
- *      port            --  Index of port number
- *
- * OUTPUT:
- *      state           --  FALSE:Disable
- *                          TRUE: Enable
- * RETURN:
- *      AIR_E_OK
- *      AIR_E_BAD_PARAMETER
- *
- * NOTES:
- *      None
- */
-AIR_ERROR_NO_T
-air_port_getAnMode(
-    const UI32_T unit,
-    const UI32_T port,
-    BOOL_T *ptr_state);
-
-/* FUNCTION NAME: air_port_setLocalAdvAbility
- * PURPOSE:
- *      Set the auto-negotiation advertisement for a
- *      specific port.
- *
- * INPUT:
- *      unit            --  Device ID
- *      port            --  Index of port number
- *      adv             --  AN advertisement setting
- *
- * OUTPUT:
- *      None
- *
- * RETURN:
- *      AIR_E_OK
- *      AIR_E_BAD_PARAMETER
- *
- * NOTES:
- *      None
- */
-AIR_ERROR_NO_T
-air_port_setLocalAdvAbility(
-    const UI32_T unit,
-    const UI32_T port,
-    const AIR_AN_ADV_T adv);
-
-/* FUNCTION NAME: air_port_getLocalAdvAbility
- * PURPOSE:
- *      Get the auto-negotiation advertisement for a
- *      specific port.
- *
- * INPUT:
- *      unit            --  Device ID
- *      port            --  Index of port number
- *
- * OUTPUT:
- *      ptr_adv         --  AN advertisement setting
- *
- * RETURN:
- *      AIR_E_OK
- *      AIR_E_BAD_PARAMETER
- *
- * NOTES:
- *      None
- */
-AIR_ERROR_NO_T
-air_port_getLocalAdvAbility(
-    const UI32_T unit,
-    const UI32_T port,
-    AIR_AN_ADV_T *ptr_adv);
-
-/* FUNCTION NAME: air_port_getRemoteAdvAbility
- * PURPOSE:
- *      Get the auto-negotiation remote advertisement for a
- *      specific port.
- *
- * INPUT:
- *      unit            --  Device ID
- *      port            --  Index of port number
- *
- * OUTPUT:
- *      ptr_lp_adv      --  AN advertisement of link partner
- *
- * RETURN:
- *      AIR_E_OK
- *      AIR_E_BAD_PARAMETER
- *
- * NOTES:
- *      None
- */
-AIR_ERROR_NO_T
-air_port_getRemoteAdvAbility(
-    const UI32_T unit,
-    const UI32_T port,
-    AIR_AN_ADV_T *ptr_lp_adv);
-
-/* FUNCTION NAME: air_port_setSpeed
- * PURPOSE:
- *      Set the speed for a specific port.
- *      This setting is used on force mode only.
- *
- * INPUT:
- *      unit            --  Device ID
- *      port            --  Index of port number
- *      speed           --  AIR_PORT_SPEED_10M:  10Mbps
- *                          AIR_PORT_SPEED_100M: 100Mbps
- *                          AIR_PORT_SPEED_1000M:1Gbps
- *                          AIR_PORT_SPEED_2500M:2.5Gbps (Port5, Port6)
- * OUTPUT:
- *      None
- *
- * RETURN:
- *      AIR_E_OK
- *      AIR_E_BAD_PARAMETER
- *
- * NOTES:
- *      None
- */
-AIR_ERROR_NO_T
-air_port_setSpeed(
-    const UI32_T unit,
-    const UI32_T port,
-    const UI32_T speed);
-
-/* FUNCTION NAME: air_port_getSpeed
- * PURPOSE:
- *      Get the speed for a specific port.
- *
- * INPUT:
- *      unit            --  Device ID
- *      port            --  Index of port number
- *
- * OUTPUT:
- *      ptr_speed       --  AIR_PORT_SPEED_10M:  10Mbps
- *                          AIR_PORT_SPEED_100M: 100Mbps
- *                          AIR_PORT_SPEED_1000M:1Gbps
- * RETURN:
- *      AIR_E_OK
- *      AIR_E_BAD_PARAMETER
- *
- * NOTES:
- *      None
- */
-AIR_ERROR_NO_T
-air_port_getSpeed(
-    const UI32_T unit,
-    const UI32_T port,
-    UI32_T *ptr_speed);
-
-/* FUNCTION NAME: air_port_setDuplex
- * PURPOSE:
- *      Get the duplex for a specific port.
- *      This setting is used on force mode only.
- *
- * INPUT:
- *      unit            --  Device ID
- *      port            --  Index of port number
- *      duplex          --  AIR_PORT_DUPLEX_HALF
- *                          AIR_PORT_DUPLEX_FULL
- * OUTPUT:
- *      None
- *
- * RETURN:
- *      AIR_E_OK
- *      AIR_E_BAD_PARAMETER
- *
- * NOTES:
- *      None
- */
-AIR_ERROR_NO_T
-air_port_setDuplex(
-    const UI32_T unit,
-    const UI32_T port,
-    const BOOL_T duplex);
-
-/* FUNCTION NAME: air_port_getDuplex
- * PURPOSE:
- *      Get the duplex for a specific port.
- *
- * INPUT:
- *      unit            --  Device ID
- *      port            --  Index of port number
- *
- * OUTPUT:
- *      ptr_duplex      --  AIR_PORT_DUPLEX_HALF
- *                          AIR_PORT_DUPLEX_FULL
- * RETURN:
- *      AIR_E_OK
- *      AIR_E_BAD_PARAMETER
- *
- * NOTES:
- *      None
- */
-AIR_ERROR_NO_T
-air_port_getDuplex(
-    const UI32_T unit,
-    const UI32_T port,
-    BOOL_T *ptr_duplex);
-
-/* FUNCTION NAME: air_port_getLink
- * PURPOSE:
- *      Get the physical link status for a specific port.
- *
- * INPUT:
- *      unit            --  Device ID
- *      port            --  Index of port number
- *
- * OUTPUT:
- *      ptr_ps          --  AIR_PORT_STATUS_T
- *
- * RETURN:
- *      AIR_E_OK
- *      AIR_E_BAD_PARAMETER
- *
- * NOTES:
- *      None
- */
-AIR_ERROR_NO_T
-air_port_getLink(
-    const UI32_T unit,
-    const UI32_T port,
-    AIR_PORT_STATUS_T *ptr_ps);
-
-/* FUNCTION NAME: air_port_setBckPres
- * PURPOSE:
- *      Set the back pressure configuration for a specific port.
- *
- * INPUT:
- *      unit            --  Device ID
- *      port            --  Index of port number
- *      bckPres         --  FALSE:Disable
- *                          TRUE: Enable
- * OUTPUT:
- *      None
- *
- * RETURN:
- *      AIR_E_OK
- *      AIR_E_BAD_PARAMETER
- *
- * NOTES:
- *      None
- */
-AIR_ERROR_NO_T
-air_port_setBckPres(
-    const UI32_T unit,
-    const UI32_T port,
-    const BOOL_T bckPres);
-
-/* FUNCTION NAME: air_port_getBckPres
- * PURPOSE:
- *      Get the back pressure configuration for a specific port.
- *
- * INPUT:
- *      unit            --  Device ID
- *      port            --  Index of port number
- *
- * OUTPUT:
- *      ptr_bckPres     --  FALSE:Disable
- *                          TRUE: Enable
- * RETURN:
- *      AIR_E_OK
- *      AIR_E_BAD_PARAMETER
- *
- * NOTES:
- *      None
- */
-AIR_ERROR_NO_T
-air_port_getBckPres(
-    const UI32_T unit,
-    const UI32_T port,
-    BOOL_T *ptr_bckPres);
-
-/* FUNCTION NAME: air_port_setFlowCtrl
- * PURPOSE:
- *      Set the flow control configuration for specific port.
- *
- * INPUT:
- *      unit            --  Select device ID
- *      port            --  Select port number (0 - 6)
- *      dir             --  Directions of AIR_PORT_TX or AIR_PORT_RX
- *      fc_en           --  TRUE: Enable select port flow control
- *                          FALSE:Disable select port flow control
- * OUTPUT:
- *      None
- *
- * RETURN:
- *      AIR_E_OK
- *      AIR_E_BAD_PARAMETER
- *
- * NOTES:
- *      None
- */
-AIR_ERROR_NO_T
-air_port_setFlowCtrl(
-    const UI32_T unit,
-    const UI32_T port,
-    const BOOL_T dir,
-    const BOOL_T fc_en);
-
-/* FUNCTION NAME: air_port_getFlowCtrl
- * PURPOSE:
- *      Get the flow control configuration for specific port.
- *
- * INPUT:
- *      unit            --  Select device ID
- *      port            --  Select port number (0..6)
- *      dir             --  AIR_PORT_TX
- *                          AIR_PORT_RX
- * OUTPUT:
- *      ptr_fc_en       --  FALSE: Port flow control disable
- *                          TRUE: Port flow control enable
- * RETURN:
- *      AIR_E_OK
- *      AIR_E_BAD_PARAMETER
- *
- * NOTES:
- *      None
- */
-AIR_ERROR_NO_T
-air_port_getFlowCtrl(
-    const UI32_T unit,
-    const UI32_T port,
-    const BOOL_T dir,
-    BOOL_T *ptr_fc_en);
-
-/* FUNCTION NAME: air_port_setJumbo
- * PURPOSE:
- *      Set accepting jumbo frmes with specificied size.
- *
- * INPUT:
- *      unit            --  Select device ID
- *      pkt_len         --  Select max packet length
- *                          RX_PKT_LEN_1518
- *                          RX_PKT_LEN_1536
- *                          RX_PKT_LEN_1552
- *                          RX_PKT_LEN_MAX_JUMBO
- *      frame_len       --  Select max lenght of jumbo frames
- *                          Range : 2 - 15
- *                          Units : K Bytes
- * OUTPUT:
- *      None
- *
- * RETURN:
- *      AIR_E_OK
- *      AIR_E_BAD_PARAMETER
- *
- * NOTES:
- *      None
- */
-AIR_ERROR_NO_T
-air_port_setJumbo(
-    const UI32_T unit,
-    const UI32_T pkt_len,
-    const UI32_T frame_len);
-
-/* FUNCTION NAME: air_port_getJumbo
- * PURPOSE:
- *      Get accepting jumbo frmes with specificied size.
- *
- * INPUT:
- *      unit            --  Select device ID
- *
- * OUTPUT:
- *      ptr_pkt_len     --  Select max packet length
- *                          RX_PKT_LEN_1518
- *                          RX_PKT_LEN_1536
- *                          RX_PKT_LEN_1552
- *                          RX_PKT_LEN_MAX_JUMBO
- *      ptr_frame_len   --  Select max lenght of jumbo frames
- *                          Range : 2 - 15
- *                          Units : K Bytes
- * RETURN:
- *      AIR_E_OK
- *      AIR_E_BAD_PARAMETER
- *
- * NOTES:
- *      None
- */
-AIR_ERROR_NO_T
-air_port_getJumbo(
-    const UI32_T unit,
-    UI32_T *ptr_pkt_len,
-    UI32_T *ptr_frame_len);
-
-
-/* FUNCTION NAME: air_port_setPsMode
- * PURPOSE:
- *      Set the power saving mode for a specific port.
- *
- * INPUT:
- *      unit            --  Device ID
- *      port            --  Index of port number
- *      mode            --  Bit-map:
- *                          AIR_PORT_PS_LINKSTATUS
- *                          AIR_PORT_PS_EEE
- *                          FALSE: Disable / TRUE: Enable
- * OUTPUT:
- *      None
- *
- * RETURN:
- *      AIR_E_OK
- *      AIR_E_BAD_PARAMETER
- *
- * NOTES:
- *      None
- */
-AIR_ERROR_NO_T
-air_port_setPsMode(
-    const UI32_T unit,
-    const UI32_T port,
-    const UI32_T mode);
-
-/* FUNCTION NAME: air_port_getPsMode
- * PURPOSE:
- *      Get the power saving mode for a specific port.
- *
- * INPUT:
- *      unit            --  Device ID
- *      port            --  Index of port number
- * OUTPUT:
- *      ptr_mode        --  Bit-map:
- *                          AIR_PORT_PS_LINKSTATUS
- *                          AIR_PORT_PS_EEE
- *                          FALSE: Disable / TRUE: Enable
- * RETURN:
- *      AIR_E_OK
- *      AIR_E_BAD_PARAMETER
- *
- * NOTES:
- *      None
- */
-AIR_ERROR_NO_T
-air_port_getPsMode(
-    const UI32_T unit,
-    const UI32_T port,
-    UI32_T *ptr_mode);
-
-/* FUNCTION NAME: air_port_setSmtSpdDwn
- * PURPOSE:
- *      Set Smart speed down feature for a specific port.
- *
- * INPUT:
- *      unit            --  Device ID
- *      port            --  Index of port number
- *      state           --  FALSE:Disable
- *                          TRUE: Enable
- *      time            --  AIR_PORT_SSD_2T
- *                          AIR_PORT_SSD_3T
- *                          AIR_PORT_SSD_4T
- *                          AIR_PORT_SSD_5T
- * OUTPUT:
- *      None
- *
- * RETURN:
- *      AIR_E_OK
- *      AIR_E_BAD_PARAMETER
- *
- * NOTES:
- *      None
- */
-AIR_ERROR_NO_T
-air_port_setSmtSpdDwn(
-    const UI32_T unit,
-    const UI32_T port,
-    const BOOL_T state,
-    const UI32_T time);
-
-/* FUNCTION NAME: air_port_getSmtSpdDwn
- * PURPOSE:
- *      Get Smart speed down feature for a specific port.
- *
- * INPUT:
- *      unit            --  Device ID
- *      port            --  Index of port number
- *
- * OUTPUT:
- *      ptr_state       --  FALSE:Disable
- *                          TRUE: Enable
- *      ptr_time        --  AIR_PORT_SSD_2T
- *                          AIR_PORT_SSD_3T
- *                          AIR_PORT_SSD_4T
- *                          AIR_PORT_SSD_5T
- * RETURN:
- *      AIR_E_OK
- *      AIR_E_BAD_PARAMETER
- *
- * NOTES:
- *      None
- */
-AIR_ERROR_NO_T
-air_port_getSmtSpdDwn(
-    const UI32_T unit,
-    const UI32_T port,
-    UI32_T *ptr_state,
-    UI32_T *ptr_time);
-
-/* FUNCTION NAME: air_port_setEnable
- * PURPOSE:
- *      Set powerdown state for a specific port.
- *
- * INPUT:
- *      unit            --  Device ID
- *      port            --  Index of port number
- *      state           --  FALSE:Disable
- *                          TRUE: Enable
- * OUTPUT:
- *      None
- *
- * RETURN:
- *      AIR_E_OK
- *      AIR_E_BAD_PARAMETER
- *
- * NOTES:
- *      None
- */
-AIR_ERROR_NO_T
-air_port_setEnable(
-    const UI32_T unit,
-    const UI32_T port,
-    const BOOL_T state);
-
-/* FUNCTION NAME: air_port_getEnable
- * PURPOSE:
- *      Get powerdown state for a specific port.
- *
- * INPUT:
- *      unit            --  Device ID
- *      port            --  Index of port number
- *
- * OUTPUT:
- *      ptr_state       --  FALSE:Disable
- *                          TRUE: Enable
- * RETURN:
- *      AIR_E_OK
- *      AIR_E_BAD_PARAMETER
- *
- * NOTES:
- *      None
- */
-AIR_ERROR_NO_T
-air_port_getEnable(
-    const UI32_T unit,
-    const UI32_T port,
-    UI32_T *ptr_state);
-
-/* FUNCTION NAME: air_port_setSpTag
- * PURPOSE:
- *      Set special tag state of a specific port.
- *
- * INPUT:
- *      unit            --  Device ID
- *      port            --  Index of port number
- *      sptag_en        --  TRUE:  Enable special tag
- *                          FALSE: Disable special tag
- * OUTPUT:
- *        None
- *
- * RETURN:
- *        AIR_E_OK
- *        AIR_E_BAD_PARAMETER
- *
- * NOTES:
- *      None
- */
-AIR_ERROR_NO_T
-air_port_setSpTag(
-    const UI32_T unit,
-    const UI32_T port,
-    const BOOL_T sptag_en);
-
-/* FUNCTION NAME: air_port_getSpTag
- * PURPOSE:
- *      Get special tag state of a specific port.
- *
- * INPUT:
- *      unit            --  Device ID
- *      port            --  Index of port number
- * OUTPUT:
- *      ptr_sptag_en    --  TRUE:  Special tag enable
- *                          FALSE: Special tag disable
- *
- * RETURN:
- *        AIR_E_OK
- *        AIR_E_BAD_PARAMETER
- *
- * NOTES:
- *      None
- */
-AIR_ERROR_NO_T
-air_port_getSpTag(
-    const UI32_T unit,
-    const UI32_T port,
-    BOOL_T *ptr_sptag_en);
-
-/* FUNCTION NAME: air_port_set5GBaseRModeEnable
- * PURPOSE:
- *      Set the port5 5GBase-R mode enable
- *
- * INPUT:
- *      unit            --  Device ID
- *
- * OUTPUT:
- *      None
- *
- * RETURN:
- *      AIR_E_OK
- *      AIR_E_BAD_PARAMETER
- *
- * NOTES:
- *      None
- */
-AIR_ERROR_NO_T
-air_port_set5GBaseRModeEn(
-    const UI32_T unit);
-
-/* FUNCTION NAME: air_port_setHsgmiiModeEnable
- * PURPOSE:
- *      Set the port5 HSGMII mode enable
- *
- * INPUT:
- *      unit            --  Device ID
- *
- * OUTPUT:
- *      None
- *
- * RETURN:
- *      AIR_E_OK
- *      AIR_E_BAD_PARAMETER
- *
- * NOTES:
- *      None
- */
-AIR_ERROR_NO_T
-air_port_setHsgmiiModeEn(
-    const UI32_T unit);
-
-/* FUNCTION NAME: air_port_setSgmiiMode
- * PURPOSE:
- *      Set the port5 SGMII mode for AN or force
- *
- * INPUT:
- *      unit            --  Device ID
- *      mode            --  AIR_PORT_SGMII_MODE_AN
- *                          AIR_PORT_SGMII_MODE_FORCE
- *      speed           --  AIR_PORT_SPEED_10M:   10Mbps
- *                          AIR_PORT_SPEED_100M:  100Mbps
- *                          AIR_PORT_SPEED_1000M: 1Gbps
- *
- * OUTPUT:
- *      None
- *
- * RETURN:
- *      AIR_E_OK
- *      AIR_E_BAD_PARAMETER
- *
- * NOTES:
- *      None
- */
-AIR_ERROR_NO_T
-air_port_setSgmiiMode(
-    const UI32_T unit,
-    const UI32_T mode,
-    const UI32_T speed);
-
-
-/* FUNCTION NAME: air_port_setRmiiMode
- * PURPOSE:
- *      Set the port5 RMII mode for 100Mbps or 10Mbps
- *
- * INPUT:
- *      unit            --  Device ID
- *      speed           --  AIR_PORT_SPEED_10M:  10Mbps
- *                          AIR_PORT_SPEED_100M: 100Mbps
- *
- * OUTPUT:
- *      None
- *
- * RETURN:
- *      AIR_E_OK
- *      AIR_E_BAD_PARAMETER
- *
- * NOTES:
- *      None
- */
-AIR_ERROR_NO_T
-air_port_setRmiiMode(
-    const UI32_T unit,
-    const UI32_T speed);
-
-/* FUNCTION NAME: air_port_setRgmiiMode
- * PURPOSE:
- *      Set the port5 RGMII mode for 1Gbps or 100Mbps or 10Mbps
- *
- * INPUT:
- *      unit            --  Device ID
- *      speed           --  AIR_PORT_SPEED_10M:   10Mbps
- *                          AIR_PORT_SPEED_100M:  100Mbps
- *                          AIR_PORT_SPEED_1000M: 1Gbps
- *
- * OUTPUT:
- *      None
- *
- * RETURN:
- *      AIR_E_OK
- *      AIR_E_BAD_PARAMETER
- *
- * NOTES:
- *      None
- */
-AIR_ERROR_NO_T
-air_port_setRgmiiMode(
-    const UI32_T unit,
-    const UI32_T speed);
-
-#endif  /* AIR_PORT_H */
-
+/* FILE NAME:   air_port.h
+ * PURPOSE:
+ *      Define port function in AIR SDK.
+ *
+ * NOTES:
+ *      None
+ */
+
+#ifndef AIR_PORT_H
+#define AIR_PORT_H
+
+/* INCLUDE FILE DECLARATIONS
+ */
+
+/* NAMING CONSTANT DECLARATIONS
+ */
+#define AIR_MAX_NUM_OF_UNIT            (1)
+#define AIR_DST_DEFAULT_PORT           (31)
+#define AIR_PORT_TX                    (0x00)
+#define AIR_PORT_RX                    (0x01)
+#define AIR_MAX_NUM_OF_PORTS           (7)
+#define AIR_MAX_NUM_OF_GIGA_PORTS      (5)
+#define AIR_SGMII_PORT_OFFSET_BEGIN    (5)
+#define AIR_SGMII_PORT_OFFSET_END      (6)
+#define AIR_ALL_PORT_BITMAP            (0x7F)
+
+/* Definition of Power Saving mode */
+#define AIR_PORT_PS_LINKSTATUS         (0x1 << 0)
+#define AIR_PORT_PS_EEE                (0x1 << 1)
+#define AIR_PORT_PS_MASK               (0x3)
+
+/* MACRO FUNCTION DECLARATIONS
+ */
+
+/* DATA TYPE DECLARATIONS
+ */
+/* AIR_PORT_BITMAP_T is the data type for physical port bitmap. */
+#define AIR_BITMAP_SIZE(bit_num)                    ((((bit_num) - 1) / AIR_MAX_NUM_OF_PORTS) + 1)
+#define AIR_PORT_BITMAP_SIZE           AIR_BITMAP_SIZE(AIR_MAX_NUM_OF_PORTS)
+typedef UI32_T   AIR_PORT_BITMAP_T[AIR_PORT_BITMAP_SIZE];
+
+#define AIR_INVALID_ID      (0xFFFFFFFF)
+#define AIR_PORT_INVALID    (AIR_INVALID_ID)
+
+/* Definition of SGMII mode */
+typedef enum
+{
+    AIR_PORT_SGMII_MODE_AN,
+    AIR_PORT_SGMII_MODE_FORCE,
+    AIR_PORT_SGMII_MODE_LAST
+}AIR_PORT_SGMII_MODE_T;
+
+/* Definition of port speed */
+typedef enum
+{
+    AIR_PORT_SPEED_10M,
+    AIR_PORT_SPEED_100M,
+    AIR_PORT_SPEED_1000M,
+    AIR_PORT_SPEED_2500M,
+    AIR_PORT_SPEED_LAST
+}AIR_PORT_SPEED_T;
+
+typedef enum
+{
+    AIR_PORT_DUPLEX_HALF,
+    AIR_PORT_DUPLEX_FULL,
+    AIR_PORT_DUPLEX_LAST
+}AIR_PORT_DUPLEX_T;
+
+typedef enum
+{
+    AIR_PORT_LINK_DOWN,
+    AIR_PORT_LINK_UP,
+    AIR_PORT_LINK_LAST
+}AIR_PORT_LINK_T;
+
+/* Definition of Smart speed down will occur after AN failed how many times */
+typedef enum
+{
+    AIR_PORT_SSD_2T,
+    AIR_PORT_SSD_3T,
+    AIR_PORT_SSD_4T,
+    AIR_PORT_SSD_5T,
+    AIR_PORT_SSD_LAST
+}AIR_PORT_SSD_T;
+
+typedef enum
+{
+    AIR_PORT_VLAN_MODE_PORT_MATRIX = 0,    /* Port matrix mode  */
+    AIR_PORT_VLAN_MODE_FALLBACK,           /* Fallback mode  */
+    AIR_PORT_VLAN_MODE_CHECK,              /* Check mode  */
+    AIR_PORT_VLAN_MODE_SECURITY,           /* Security mode  */
+    AIR_PORT_VLAN_MODE_LAST
+} AIR_PORT_VLAN_MODE_T;
+
+/* Definition of AN Advertisement Register */
+typedef struct AIR_AN_ADV_S
+{
+    BOOL_T advCap10HDX;         /* Advertises 10 BASE-T HDX */
+    BOOL_T advCap10FDX;         /* Advertises 10 BASE-T FDX */
+    BOOL_T advCap100HDX;        /* Advertises 100 BASE-T HDX */
+    BOOL_T advCap100FDX;        /* Advertises 100 BASE-T FDX */
+    BOOL_T advCap1000FDX;       /* Advertises 1000 BASE-T FDX */
+    BOOL_T advPause;            /* Advertieses Asynchronous Pause */
+}AIR_AN_ADV_T;
+
+/* Definition of Link Status of a specific port */
+typedef struct AIR_PORT_STATUS_S
+{
+    BOOL_T link;
+    BOOL_T duplex;
+    UI32_T speed;
+}AIR_PORT_STATUS_T;
+
+/* EXPORTED SUBPROGRAM SPECIFICATIONS
+ */
+/* FUNCTION NAME: air_port_setPortMatrix
+ * PURPOSE:
+ *      Set port matrix from the specified device.
+ *
+ * INPUT:
+ *      unit            --  Unit id
+ *      port            --  Port id
+ *      port_bitmap     --  Matrix port bitmap
+ *
+ * OUTPUT:
+ *      None
+ *
+ * RETURN:
+ *      AIR_E_OK
+ *      AIR_E_OTHERS
+ *      AIR_E_BAD_PARAMETER
+ *
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_port_setPortMatrix(
+    const UI32_T    unit,
+    const UI32_T    port,
+    const UI32_T    port_bitmap);
+
+/* FUNCTION NAME: air_port_getPortMatrix
+ * PURPOSE:
+ *      Get port matrix from the specified device.
+ *
+ * INPUT:
+ *      unit            --  Unit id
+ *      port            --  Port id
+ *
+ * OUTPUT:
+ *      p_port_bitmap   --  Matrix port bitmap
+ *
+ * RETURN:
+ *      AIR_E_OK
+ *      AIR_E_OTHERS
+ *      AIR_E_BAD_PARAMETER
+ *
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_port_getPortMatrix(
+    const UI32_T    unit,
+    const UI32_T    port,
+    UI32_T          *p_port_bitmap);
+
+/* FUNCTION NAME: air_port_setVlanMode
+ * PURPOSE:
+ *      Set port-based vlan mechanism from the specified device.
+ *
+ * INPUT:
+ *      unit            --  Unit id
+ *      port            --  Port id
+ *      mode            --  Port vlan mode
+ *
+ * OUTPUT:
+ *      None
+ *
+ * RETURN:
+ *      AIR_E_OK
+ *      AIR_E_OTHERS
+ *      AIR_E_BAD_PARAMETER
+ *
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_port_setVlanMode(
+    const UI32_T    unit,
+    const UI32_T    port,
+    const AIR_PORT_VLAN_MODE_T mode);
+
+/* FUNCTION NAME: air_port_getVlanMode
+ * PURPOSE:
+ *      Get port-based vlan mechanism from the specified device.
+ *
+ * INPUT:
+ *      unit            --  Unit id
+ *      port            --  Port id
+ *
+ * OUTPUT:
+ *      p_mode          --  Port vlan mode
+ *
+ * RETURN:
+ *      AIR_E_OK
+ *      AIR_E_OTHERS
+ *      AIR_E_BAD_PARAMETER
+ *
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_port_getVlanMode(
+    const UI32_T    unit,
+    const UI32_T    port,
+    AIR_PORT_VLAN_MODE_T *p_mode);
+
+/* FUNCTION NAME: air_port_setAnMode
+ * PURPOSE:
+ *      Set the auto-negotiation mode for a specific port.(Auto or Forced)
+ *
+ * INPUT:
+ *      unit            --  Device ID
+ *      port            --  Index of port number
+ *      state           --  FALSE:Disable
+ *                          TRUE: Enable
+ * OUTPUT:
+ *      None
+ *
+ * RETURN:
+ *      AIR_E_OK
+ *      AIR_E_BAD_PARAMETER
+ *
+ * NOTES:
+ *      None
+ */
+AIR_ERROR_NO_T
+air_port_setAnMode(
+    const UI32_T unit,
+    const UI32_T port,
+    const BOOL_T state);
+
+/* FUNCTION NAME: air_port_getAnMode
+ * PURPOSE:
+ *      Get the auto-negotiation mode for a specific port.
+ *
+ * INPUT:
+ *      unit            --  Device ID
+ *      port            --  Index of port number
+ *
+ * OUTPUT:
+ *      state           --  FALSE:Disable
+ *                          TRUE: Enable
+ * RETURN:
+ *      AIR_E_OK
+ *      AIR_E_BAD_PARAMETER
+ *
+ * NOTES:
+ *      None
+ */
+AIR_ERROR_NO_T
+air_port_getAnMode(
+    const UI32_T unit,
+    const UI32_T port,
+    BOOL_T *ptr_state);
+
+/* FUNCTION NAME: air_port_setLocalAdvAbility
+ * PURPOSE:
+ *      Set the auto-negotiation advertisement for a
+ *      specific port.
+ *
+ * INPUT:
+ *      unit            --  Device ID
+ *      port            --  Index of port number
+ *      adv             --  AN advertisement setting
+ *
+ * OUTPUT:
+ *      None
+ *
+ * RETURN:
+ *      AIR_E_OK
+ *      AIR_E_BAD_PARAMETER
+ *
+ * NOTES:
+ *      None
+ */
+AIR_ERROR_NO_T
+air_port_setLocalAdvAbility(
+    const UI32_T unit,
+    const UI32_T port,
+    const AIR_AN_ADV_T adv);
+
+/* FUNCTION NAME: air_port_getLocalAdvAbility
+ * PURPOSE:
+ *      Get the auto-negotiation advertisement for a
+ *      specific port.
+ *
+ * INPUT:
+ *      unit            --  Device ID
+ *      port            --  Index of port number
+ *
+ * OUTPUT:
+ *      ptr_adv         --  AN advertisement setting
+ *
+ * RETURN:
+ *      AIR_E_OK
+ *      AIR_E_BAD_PARAMETER
+ *
+ * NOTES:
+ *      None
+ */
+AIR_ERROR_NO_T
+air_port_getLocalAdvAbility(
+    const UI32_T unit,
+    const UI32_T port,
+    AIR_AN_ADV_T *ptr_adv);
+
+/* FUNCTION NAME: air_port_getRemoteAdvAbility
+ * PURPOSE:
+ *      Get the auto-negotiation remote advertisement for a
+ *      specific port.
+ *
+ * INPUT:
+ *      unit            --  Device ID
+ *      port            --  Index of port number
+ *
+ * OUTPUT:
+ *      ptr_lp_adv      --  AN advertisement of link partner
+ *
+ * RETURN:
+ *      AIR_E_OK
+ *      AIR_E_BAD_PARAMETER
+ *
+ * NOTES:
+ *      None
+ */
+AIR_ERROR_NO_T
+air_port_getRemoteAdvAbility(
+    const UI32_T unit,
+    const UI32_T port,
+    AIR_AN_ADV_T *ptr_lp_adv);
+
+/* FUNCTION NAME: air_port_setSpeed
+ * PURPOSE:
+ *      Set the speed for a specific port.
+ *      This setting is used on force mode only.
+ *
+ * INPUT:
+ *      unit            --  Device ID
+ *      port            --  Index of port number
+ *      speed           --  AIR_PORT_SPEED_10M:  10Mbps
+ *                          AIR_PORT_SPEED_100M: 100Mbps
+ *                          AIR_PORT_SPEED_1000M:1Gbps
+ *                          AIR_PORT_SPEED_2500M:2.5Gbps (Port5, Port6)
+ * OUTPUT:
+ *      None
+ *
+ * RETURN:
+ *      AIR_E_OK
+ *      AIR_E_BAD_PARAMETER
+ *
+ * NOTES:
+ *      None
+ */
+AIR_ERROR_NO_T
+air_port_setSpeed(
+    const UI32_T unit,
+    const UI32_T port,
+    const UI32_T speed);
+
+/* FUNCTION NAME: air_port_getSpeed
+ * PURPOSE:
+ *      Get the speed for a specific port.
+ *
+ * INPUT:
+ *      unit            --  Device ID
+ *      port            --  Index of port number
+ *
+ * OUTPUT:
+ *      ptr_speed       --  AIR_PORT_SPEED_10M:  10Mbps
+ *                          AIR_PORT_SPEED_100M: 100Mbps
+ *                          AIR_PORT_SPEED_1000M:1Gbps
+ * RETURN:
+ *      AIR_E_OK
+ *      AIR_E_BAD_PARAMETER
+ *
+ * NOTES:
+ *      None
+ */
+AIR_ERROR_NO_T
+air_port_getSpeed(
+    const UI32_T unit,
+    const UI32_T port,
+    UI32_T *ptr_speed);
+
+/* FUNCTION NAME: air_port_setDuplex
+ * PURPOSE:
+ *      Get the duplex for a specific port.
+ *      This setting is used on force mode only.
+ *
+ * INPUT:
+ *      unit            --  Device ID
+ *      port            --  Index of port number
+ *      duplex          --  AIR_PORT_DUPLEX_HALF
+ *                          AIR_PORT_DUPLEX_FULL
+ * OUTPUT:
+ *      None
+ *
+ * RETURN:
+ *      AIR_E_OK
+ *      AIR_E_BAD_PARAMETER
+ *
+ * NOTES:
+ *      None
+ */
+AIR_ERROR_NO_T
+air_port_setDuplex(
+    const UI32_T unit,
+    const UI32_T port,
+    const BOOL_T duplex);
+
+/* FUNCTION NAME: air_port_getDuplex
+ * PURPOSE:
+ *      Get the duplex for a specific port.
+ *
+ * INPUT:
+ *      unit            --  Device ID
+ *      port            --  Index of port number
+ *
+ * OUTPUT:
+ *      ptr_duplex      --  AIR_PORT_DUPLEX_HALF
+ *                          AIR_PORT_DUPLEX_FULL
+ * RETURN:
+ *      AIR_E_OK
+ *      AIR_E_BAD_PARAMETER
+ *
+ * NOTES:
+ *      None
+ */
+AIR_ERROR_NO_T
+air_port_getDuplex(
+    const UI32_T unit,
+    const UI32_T port,
+    BOOL_T *ptr_duplex);
+
+/* FUNCTION NAME: air_port_getLink
+ * PURPOSE:
+ *      Get the physical link status for a specific port.
+ *
+ * INPUT:
+ *      unit            --  Device ID
+ *      port            --  Index of port number
+ *
+ * OUTPUT:
+ *      ptr_ps          --  AIR_PORT_STATUS_T
+ *
+ * RETURN:
+ *      AIR_E_OK
+ *      AIR_E_BAD_PARAMETER
+ *
+ * NOTES:
+ *      None
+ */
+AIR_ERROR_NO_T
+air_port_getLink(
+    const UI32_T unit,
+    const UI32_T port,
+    AIR_PORT_STATUS_T *ptr_ps);
+
+/* FUNCTION NAME: air_port_setBckPres
+ * PURPOSE:
+ *      Set the back pressure configuration for a specific port.
+ *
+ * INPUT:
+ *      unit            --  Device ID
+ *      port            --  Index of port number
+ *      bckPres         --  FALSE:Disable
+ *                          TRUE: Enable
+ * OUTPUT:
+ *      None
+ *
+ * RETURN:
+ *      AIR_E_OK
+ *      AIR_E_BAD_PARAMETER
+ *
+ * NOTES:
+ *      None
+ */
+AIR_ERROR_NO_T
+air_port_setBckPres(
+    const UI32_T unit,
+    const UI32_T port,
+    const BOOL_T bckPres);
+
+/* FUNCTION NAME: air_port_getBckPres
+ * PURPOSE:
+ *      Get the back pressure configuration for a specific port.
+ *
+ * INPUT:
+ *      unit            --  Device ID
+ *      port            --  Index of port number
+ *
+ * OUTPUT:
+ *      ptr_bckPres     --  FALSE:Disable
+ *                          TRUE: Enable
+ * RETURN:
+ *      AIR_E_OK
+ *      AIR_E_BAD_PARAMETER
+ *
+ * NOTES:
+ *      None
+ */
+AIR_ERROR_NO_T
+air_port_getBckPres(
+    const UI32_T unit,
+    const UI32_T port,
+    BOOL_T *ptr_bckPres);
+
+/* FUNCTION NAME: air_port_setFlowCtrl
+ * PURPOSE:
+ *      Set the flow control configuration for specific port.
+ *
+ * INPUT:
+ *      unit            --  Select device ID
+ *      port            --  Select port number (0 - 6)
+ *      dir             --  Directions of AIR_PORT_TX or AIR_PORT_RX
+ *      fc_en           --  TRUE: Enable select port flow control
+ *                          FALSE:Disable select port flow control
+ * OUTPUT:
+ *      None
+ *
+ * RETURN:
+ *      AIR_E_OK
+ *      AIR_E_BAD_PARAMETER
+ *
+ * NOTES:
+ *      None
+ */
+AIR_ERROR_NO_T
+air_port_setFlowCtrl(
+    const UI32_T unit,
+    const UI32_T port,
+    const BOOL_T dir,
+    const BOOL_T fc_en);
+
+/* FUNCTION NAME: air_port_getFlowCtrl
+ * PURPOSE:
+ *      Get the flow control configuration for specific port.
+ *
+ * INPUT:
+ *      unit            --  Select device ID
+ *      port            --  Select port number (0..6)
+ *      dir             --  AIR_PORT_TX
+ *                          AIR_PORT_RX
+ * OUTPUT:
+ *      ptr_fc_en       --  FALSE: Port flow control disable
+ *                          TRUE: Port flow control enable
+ * RETURN:
+ *      AIR_E_OK
+ *      AIR_E_BAD_PARAMETER
+ *
+ * NOTES:
+ *      None
+ */
+AIR_ERROR_NO_T
+air_port_getFlowCtrl(
+    const UI32_T unit,
+    const UI32_T port,
+    const BOOL_T dir,
+    BOOL_T *ptr_fc_en);
+
+/* FUNCTION NAME: air_port_setJumbo
+ * PURPOSE:
+ *      Set accepting jumbo frmes with specificied size.
+ *
+ * INPUT:
+ *      unit            --  Select device ID
+ *      pkt_len         --  Select max packet length
+ *                          RX_PKT_LEN_1518
+ *                          RX_PKT_LEN_1536
+ *                          RX_PKT_LEN_1552
+ *                          RX_PKT_LEN_MAX_JUMBO
+ *      frame_len       --  Select max lenght of jumbo frames
+ *                          Range : 2 - 15
+ *                          Units : K Bytes
+ * OUTPUT:
+ *      None
+ *
+ * RETURN:
+ *      AIR_E_OK
+ *      AIR_E_BAD_PARAMETER
+ *
+ * NOTES:
+ *      None
+ */
+AIR_ERROR_NO_T
+air_port_setJumbo(
+    const UI32_T unit,
+    const UI32_T pkt_len,
+    const UI32_T frame_len);
+
+/* FUNCTION NAME: air_port_getJumbo
+ * PURPOSE:
+ *      Get accepting jumbo frmes with specificied size.
+ *
+ * INPUT:
+ *      unit            --  Select device ID
+ *
+ * OUTPUT:
+ *      ptr_pkt_len     --  Select max packet length
+ *                          RX_PKT_LEN_1518
+ *                          RX_PKT_LEN_1536
+ *                          RX_PKT_LEN_1552
+ *                          RX_PKT_LEN_MAX_JUMBO
+ *      ptr_frame_len   --  Select max lenght of jumbo frames
+ *                          Range : 2 - 15
+ *                          Units : K Bytes
+ * RETURN:
+ *      AIR_E_OK
+ *      AIR_E_BAD_PARAMETER
+ *
+ * NOTES:
+ *      None
+ */
+AIR_ERROR_NO_T
+air_port_getJumbo(
+    const UI32_T unit,
+    UI32_T *ptr_pkt_len,
+    UI32_T *ptr_frame_len);
+
+
+/* FUNCTION NAME: air_port_setPsMode
+ * PURPOSE:
+ *      Set the power saving mode for a specific port.
+ *
+ * INPUT:
+ *      unit            --  Device ID
+ *      port            --  Index of port number
+ *      mode            --  Bit-map:
+ *                          AIR_PORT_PS_LINKSTATUS
+ *                          AIR_PORT_PS_EEE
+ *                          FALSE: Disable / TRUE: Enable
+ * OUTPUT:
+ *      None
+ *
+ * RETURN:
+ *      AIR_E_OK
+ *      AIR_E_BAD_PARAMETER
+ *
+ * NOTES:
+ *      None
+ */
+AIR_ERROR_NO_T
+air_port_setPsMode(
+    const UI32_T unit,
+    const UI32_T port,
+    const UI32_T mode);
+
+/* FUNCTION NAME: air_port_getPsMode
+ * PURPOSE:
+ *      Get the power saving mode for a specific port.
+ *
+ * INPUT:
+ *      unit            --  Device ID
+ *      port            --  Index of port number
+ * OUTPUT:
+ *      ptr_mode        --  Bit-map:
+ *                          AIR_PORT_PS_LINKSTATUS
+ *                          AIR_PORT_PS_EEE
+ *                          FALSE: Disable / TRUE: Enable
+ * RETURN:
+ *      AIR_E_OK
+ *      AIR_E_BAD_PARAMETER
+ *
+ * NOTES:
+ *      None
+ */
+AIR_ERROR_NO_T
+air_port_getPsMode(
+    const UI32_T unit,
+    const UI32_T port,
+    UI32_T *ptr_mode);
+
+/* FUNCTION NAME: air_port_setSmtSpdDwn
+ * PURPOSE:
+ *      Set Smart speed down feature for a specific port.
+ *
+ * INPUT:
+ *      unit            --  Device ID
+ *      port            --  Index of port number
+ *      state           --  FALSE:Disable
+ *                          TRUE: Enable
+ *      time            --  AIR_PORT_SSD_2T
+ *                          AIR_PORT_SSD_3T
+ *                          AIR_PORT_SSD_4T
+ *                          AIR_PORT_SSD_5T
+ * OUTPUT:
+ *      None
+ *
+ * RETURN:
+ *      AIR_E_OK
+ *      AIR_E_BAD_PARAMETER
+ *
+ * NOTES:
+ *      None
+ */
+AIR_ERROR_NO_T
+air_port_setSmtSpdDwn(
+    const UI32_T unit,
+    const UI32_T port,
+    const BOOL_T state,
+    const UI32_T time);
+
+/* FUNCTION NAME: air_port_getSmtSpdDwn
+ * PURPOSE:
+ *      Get Smart speed down feature for a specific port.
+ *
+ * INPUT:
+ *      unit            --  Device ID
+ *      port            --  Index of port number
+ *
+ * OUTPUT:
+ *      ptr_state       --  FALSE:Disable
+ *                          TRUE: Enable
+ *      ptr_time        --  AIR_PORT_SSD_2T
+ *                          AIR_PORT_SSD_3T
+ *                          AIR_PORT_SSD_4T
+ *                          AIR_PORT_SSD_5T
+ * RETURN:
+ *      AIR_E_OK
+ *      AIR_E_BAD_PARAMETER
+ *
+ * NOTES:
+ *      None
+ */
+AIR_ERROR_NO_T
+air_port_getSmtSpdDwn(
+    const UI32_T unit,
+    const UI32_T port,
+    UI32_T *ptr_state,
+    UI32_T *ptr_time);
+
+/* FUNCTION NAME: air_port_setEnable
+ * PURPOSE:
+ *      Set powerdown state for a specific port.
+ *
+ * INPUT:
+ *      unit            --  Device ID
+ *      port            --  Index of port number
+ *      state           --  FALSE:Disable
+ *                          TRUE: Enable
+ * OUTPUT:
+ *      None
+ *
+ * RETURN:
+ *      AIR_E_OK
+ *      AIR_E_BAD_PARAMETER
+ *
+ * NOTES:
+ *      None
+ */
+AIR_ERROR_NO_T
+air_port_setEnable(
+    const UI32_T unit,
+    const UI32_T port,
+    const BOOL_T state);
+
+/* FUNCTION NAME: air_port_getEnable
+ * PURPOSE:
+ *      Get powerdown state for a specific port.
+ *
+ * INPUT:
+ *      unit            --  Device ID
+ *      port            --  Index of port number
+ *
+ * OUTPUT:
+ *      ptr_state       --  FALSE:Disable
+ *                          TRUE: Enable
+ * RETURN:
+ *      AIR_E_OK
+ *      AIR_E_BAD_PARAMETER
+ *
+ * NOTES:
+ *      None
+ */
+AIR_ERROR_NO_T
+air_port_getEnable(
+    const UI32_T unit,
+    const UI32_T port,
+    UI32_T *ptr_state);
+
+/* FUNCTION NAME: air_port_setSpTag
+ * PURPOSE:
+ *      Set special tag state of a specific port.
+ *
+ * INPUT:
+ *      unit            --  Device ID
+ *      port            --  Index of port number
+ *      sptag_en        --  TRUE:  Enable special tag
+ *                          FALSE: Disable special tag
+ * OUTPUT:
+ *        None
+ *
+ * RETURN:
+ *        AIR_E_OK
+ *        AIR_E_BAD_PARAMETER
+ *
+ * NOTES:
+ *      None
+ */
+AIR_ERROR_NO_T
+air_port_setSpTag(
+    const UI32_T unit,
+    const UI32_T port,
+    const BOOL_T sptag_en);
+
+/* FUNCTION NAME: air_port_getSpTag
+ * PURPOSE:
+ *      Get special tag state of a specific port.
+ *
+ * INPUT:
+ *      unit            --  Device ID
+ *      port            --  Index of port number
+ * OUTPUT:
+ *      ptr_sptag_en    --  TRUE:  Special tag enable
+ *                          FALSE: Special tag disable
+ *
+ * RETURN:
+ *        AIR_E_OK
+ *        AIR_E_BAD_PARAMETER
+ *
+ * NOTES:
+ *      None
+ */
+AIR_ERROR_NO_T
+air_port_getSpTag(
+    const UI32_T unit,
+    const UI32_T port,
+    BOOL_T *ptr_sptag_en);
+
+/* FUNCTION NAME: air_port_set5GBaseRModeEnable
+ * PURPOSE:
+ *      Set the port5 5GBase-R mode enable
+ *
+ * INPUT:
+ *      unit            --  Device ID
+ *
+ * OUTPUT:
+ *      None
+ *
+ * RETURN:
+ *      AIR_E_OK
+ *      AIR_E_BAD_PARAMETER
+ *
+ * NOTES:
+ *      None
+ */
+AIR_ERROR_NO_T
+air_port_set5GBaseRModeEn(
+    const UI32_T unit);
+
+/* FUNCTION NAME: air_port_setHsgmiiModeEnable
+ * PURPOSE:
+ *      Set the port5 HSGMII mode enable
+ *
+ * INPUT:
+ *      unit            --  Device ID
+ *
+ * OUTPUT:
+ *      None
+ *
+ * RETURN:
+ *      AIR_E_OK
+ *      AIR_E_BAD_PARAMETER
+ *
+ * NOTES:
+ *      None
+ */
+AIR_ERROR_NO_T
+air_port_setHsgmiiModeEn(
+    const UI32_T unit);
+
+/* FUNCTION NAME: air_port_setSgmiiMode
+ * PURPOSE:
+ *      Set the port5 SGMII mode for AN or force
+ *
+ * INPUT:
+ *      unit            --  Device ID
+ *      mode            --  AIR_PORT_SGMII_MODE_AN
+ *                          AIR_PORT_SGMII_MODE_FORCE
+ *      speed           --  AIR_PORT_SPEED_10M:   10Mbps
+ *                          AIR_PORT_SPEED_100M:  100Mbps
+ *                          AIR_PORT_SPEED_1000M: 1Gbps
+ *
+ * OUTPUT:
+ *      None
+ *
+ * RETURN:
+ *      AIR_E_OK
+ *      AIR_E_BAD_PARAMETER
+ *
+ * NOTES:
+ *      None
+ */
+AIR_ERROR_NO_T
+air_port_setSgmiiMode(
+    const UI32_T unit,
+    const UI32_T mode,
+    const UI32_T speed);
+
+
+/* FUNCTION NAME: air_port_setRmiiMode
+ * PURPOSE:
+ *      Set the port5 RMII mode for 100Mbps or 10Mbps
+ *
+ * INPUT:
+ *      unit            --  Device ID
+ *      speed           --  AIR_PORT_SPEED_10M:  10Mbps
+ *                          AIR_PORT_SPEED_100M: 100Mbps
+ *
+ * OUTPUT:
+ *      None
+ *
+ * RETURN:
+ *      AIR_E_OK
+ *      AIR_E_BAD_PARAMETER
+ *
+ * NOTES:
+ *      None
+ */
+AIR_ERROR_NO_T
+air_port_setRmiiMode(
+    const UI32_T unit,
+    const UI32_T speed);
+
+/* FUNCTION NAME: air_port_setRgmiiMode
+ * PURPOSE:
+ *      Set the port5 RGMII mode for 1Gbps or 100Mbps or 10Mbps
+ *
+ * INPUT:
+ *      unit            --  Device ID
+ *      speed           --  AIR_PORT_SPEED_10M:   10Mbps
+ *                          AIR_PORT_SPEED_100M:  100Mbps
+ *                          AIR_PORT_SPEED_1000M: 1Gbps
+ *
+ * OUTPUT:
+ *      None
+ *
+ * RETURN:
+ *      AIR_E_OK
+ *      AIR_E_BAD_PARAMETER
+ *
+ * NOTES:
+ *      None
+ */
+AIR_ERROR_NO_T
+air_port_setRgmiiMode(
+    const UI32_T unit,
+    const UI32_T speed);
+
+#endif  /* AIR_PORT_H */
+
diff --git a/recipes-devtools/switch/files/src/an8855_sdk/api/inc/air_ver.h b/recipes-devtools/switch/files/src/an8855_sdk/api/inc/air_ver.h
index 0681b6c..d702769 100644
--- a/recipes-devtools/switch/files/src/an8855_sdk/api/inc/air_ver.h
+++ b/recipes-devtools/switch/files/src/an8855_sdk/api/inc/air_ver.h
@@ -1,29 +1,29 @@
-/* FILE NAME: air_ver.h
- * PURPOSE:
- *      Define the version for AIR SDK.
- *
- * NOTES:
- *      None
- */
-
-#ifndef AIR_VER_H
-#define AIR_VER_H
-
-/* INCLUDE FILE DECLARATIONS
- */
-
-/* NAMING CONSTANT DECLARATIONS
- */
-#define AIR_VER_SDK    "v1.0.1"
-
-/* MACRO FUNCTION DECLARATIONS
- */
-
-/* DATA TYPE DECLARATIONS
- */
-
-/* EXPORTED SUBPROGRAM SPECIFICATIONS
- */
-
-#endif  /* AIR_VER_H */
-
+/* FILE NAME: air_ver.h
+ * PURPOSE:
+ *      Define the version for AIR SDK.
+ *
+ * NOTES:
+ *      None
+ */
+
+#ifndef AIR_VER_H
+#define AIR_VER_H
+
+/* INCLUDE FILE DECLARATIONS
+ */
+
+/* NAMING CONSTANT DECLARATIONS
+ */
+#define AIR_VER_SDK    "v1.0.1"
+
+/* MACRO FUNCTION DECLARATIONS
+ */
+
+/* DATA TYPE DECLARATIONS
+ */
+
+/* EXPORTED SUBPROGRAM SPECIFICATIONS
+ */
+
+#endif  /* AIR_VER_H */
+
diff --git a/recipes-devtools/switch/files/src/an8855_sdk/api/inc/air_vlan.h b/recipes-devtools/switch/files/src/an8855_sdk/api/inc/air_vlan.h
index 1ae6237..3db12e2 100644
--- a/recipes-devtools/switch/files/src/an8855_sdk/api/inc/air_vlan.h
+++ b/recipes-devtools/switch/files/src/an8855_sdk/api/inc/air_vlan.h
@@ -1,977 +1,977 @@
-/* FILE NAME:   air_vlan.h
- * PURPOSE:
- *      Define the vlan functions in AIR SDK.
- * NOTES:
- */
-
-#ifndef AIR_VLAN_H
-#define AIR_VLAN_H
-
-/* INCLUDE FILE DECLARATIONS
- */
-
-/* NAMING CONSTANT DECLARATIONS
- */
-#define AIR_VLAN_ID_MIN                             0
-#define AIR_VLAN_ID_MAX                             4095
-#define AIR_DEFAULT_VLAN_ID                         1
-
-#define AIR_FILTER_ID_MAX                           7
-
-/* MACRO FUNCTION DECLARATIONS
- */
-
-/* DATA TYPE DECLARATIONS
- */
-typedef enum
-{
-    AIR_VLAN_PORT_EGS_TAG_CTL_TYPE_UNTAGGED = 0,
-    AIR_VLAN_PORT_EGS_TAG_CTL_TYPE_TAGGED = 2,
-    AIR_VLAN_PORT_EGS_TAG_CTL_TYPE_LAST,
-} AIR_VLAN_PORT_EGS_TAG_CTL_TYPE_T;
-
-typedef enum
-{
-    AIR_PORT_EGS_TAG_ATTR_UNTAGGED = 0,
-    AIR_PORT_EGS_TAG_ATTR_SWAP,
-    AIR_PORT_EGS_TAG_ATTR_TAGGED,
-    AIR_PORT_EGS_TAG_ATTR_STACK,
-    AIR_PORT_EGS_TAG_ATTR_LAST
-} AIR_PORT_EGS_TAG_ATTR_T;
-
-typedef enum
-{
-    AIR_VLAN_ACCEPT_FRAME_TYPE_ALL = 0,            /* untagged, priority-tagged and tagged  */
-    AIR_VLAN_ACCEPT_FRAME_TYPE_TAG_ONLY,           /* tagged                                */
-    AIR_VLAN_ACCEPT_FRAME_TYPE_UNTAG_ONLY,         /* untagged and priority-tagged          */
-    AIR_VLAN_ACCEPT_FRAME_TYPE_RESERVED,           /* reserved                              */
-    AIR_VLAN_ACCEPT_FRAME_TYPE_LAST
-} AIR_VLAN_ACCEPT_FRAME_TYPE_T;
-
-typedef enum
-{
-    AIR_LEAKY_PKT_TYPE_UNICAST = 0,                /* unicast pkt      */
-    AIR_LEAKY_PKT_TYPE_MULTICAST,                  /* multicast pkt    */
-    AIR_LEAKY_PKT_TYPE_BROADCAST,                  /* broadcast pkt    */
-    AIR_LEAKY_PKT_TYPE_LAST
-} AIR_LEAKY_PKT_TYPE_T;
-
-typedef enum
-{
-    AIR_VLAN_PORT_ATTR_USER_PORT = 0,              /* user port        */
-    AIR_VLAN_PORT_ATTR_STACK_PORT,                 /* stack port       */
-    AIR_VLAN_PORT_ATTR_TRANSLATION_PORT,           /* translation port */
-    AIR_VLAN_PORT_ATTR_TRANSPARENT_PORT,           /* transparent port */
-    AIR_VLAN_PORT_ATTR_LAST
-} AIR_VLAN_PORT_ATTR_T;
-
-typedef enum
-{
-    AIR_IGR_PORT_EG_TAG_ATTR_DISABLE = 0,
-    AIR_IGR_PORT_EG_TAG_ATTR_CONSISTENT,
-    AIR_IGR_PORT_EG_TAG_ATTR_UNTAGGED = 4,
-    AIR_IGR_PORT_EG_TAG_ATTR_SWAP,
-    AIR_IGR_PORT_EG_TAG_ATTR_TAGGED,
-    AIR_IGR_PORT_EG_TAG_ATTR_STACK,
-    AIR_IGR_PORT_EG_TAG_ATTR_LAST
-} AIR_IGR_PORT_EG_TAG_ATTR_T;
-
-typedef union AIR_VLAN_ENTRY_S
-{
-    UI8_T valid : 1;
-    struct
-    {
-        UI32_T  vlan_table0;
-        UI32_T  vlan_table1;
-    } vlan_table;
-    struct
-    {
-        UI64_T   valid             : 1;
-        UI64_T   fid               : 4;
-        UI64_T   ivl               : 1;
-        UI64_T   copy_pri          : 1;
-        UI64_T   user_pri          : 3;
-        UI64_T   eg_ctrl_en        : 1;
-        UI64_T   eg_con            : 1;
-        UI64_T   eg_ctrl           : 14;
-        UI64_T   port_mem          : 7;
-        UI64_T   port_stag         : 1;
-        UI64_T   stag              : 12;
-        UI64_T   unm_vlan_drop     : 1;
-    } vlan_entry_format;
-} AIR_VLAN_ENTRY_T;
-
-typedef union AIR_VLAN_ENTRY_ATTR_S
-{
-    UI8_T valid : 1;
-    struct
-    {
-        UI32_T  vlan_table0;
-        UI32_T  vlan_table1;
-        UI32_T  vlan_table2;
-        UI32_T  vlan_table3;
-        UI32_T  vlan_table4;
-    } vlan_table;
-    struct
-    {
-        UI64_T   valid             : 1;
-        UI64_T   fid               : 4;
-        UI64_T   ivl               : 1;
-        UI64_T   copy_pri          : 1;
-        UI64_T   user_pri          : 3;
-        UI64_T   eg_ctrl_en        : 1;
-        UI64_T   eg_con            : 1;
-        UI64_T   eg_ctrl           : 14;
-        UI64_T   port_mem          : 7;
-        UI64_T   port_stag         : 1;
-        UI64_T   stag              : 12;
-        UI64_T   unm_vlan_drop     : 1;
-    } vlan_entry_format;
-#if 0
-    struct
-    {
-        UI64_T   valid             : 1;
-        UI64_T   type              : 3;
-        UI64_T   mac_addr          : 48;
-        UI64_T   mac_mask_len      : 6;
-        UI64_T   priority          : 3;
-        UI64_T   :0;
-        UI64_T   vid               : 12;
-    } mac_based_vlan_entry_format;
-    struct
-    {
-        UI64_T   valid             : 1;
-        UI64_T   type              : 3;
-        UI64_T   check_field       : 36;
-        UI64_T   :0;
-        UI64_T   check_field_mask  : 36;
-        UI64_T   untagged_packet   : 1;
-        UI64_T   vlan_priority     : 3;
-        UI64_T   svid              : 12;
-    } qinq_based_vlan_entry_format;
-    struct
-    {
-        UI64_T   valid             : 1;
-        UI64_T   type              : 3;
-        UI64_T   ipv4              : 32;
-        UI64_T   :0;
-        UI64_T   subnetmask        : 32;
-        UI64_T   priority          : 3;
-        UI64_T   cvid              : 12;
-    } ipv4_based_vlan_entry_format;
-    struct
-    {
-        UI64_T   valid             : 1;
-        UI64_T   :0;
-        UI64_T   ipv6_high         : 64;
-        UI64_T   ipv6_low          : 64;
-        UI64_T   subnetmask        : 8;
-        UI64_T   priority          : 3;
-        UI64_T   cvid              : 12;
-    } ipv6_based_vlan_entry_format;
-#endif
-} AIR_VLAN_ENTRY_ATTR_T;
-
-void
-_air_vlan_readEntry(
-    const UI32_T unit,
-    const UI16_T vid,
-    AIR_VLAN_ENTRY_T* vlan_entry);
-
-void
-_air_vlan_writeEntry(
-    const UI32_T unit,
-    const UI16_T vid,
-    AIR_VLAN_ENTRY_T* vlan_entry);
-
-void
-_air_untagged_vlan_readEntry(
-    const UI32_T unit,
-    const UI16_T vid,
-    AIR_VLAN_ENTRY_ATTR_T* vlan_entry);
-
-void
-_air_untagged_vlan_writeEntry(
-    const UI32_T unit,
-    const UI16_T vid,
-    AIR_VLAN_ENTRY_ATTR_T* vlan_entry);
-
-/* EXPORTED SUBPROGRAM SPECIFICATIONS
- */
-/* FUNCTION NAME:   air_vlan_create
- * PURPOSE:
- *      Create the vlan in the specified device.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id
- *      p_attr      -- vlan attr
- * OUTPUT:
- *      None
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Vlan creation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_create(
-    const UI32_T    unit,
-    const UI16_T    vid,
-    AIR_VLAN_ENTRY_ATTR_T *p_attr);
-
-/* FUNCTION NAME:   air_vlan_destroy
- * PURPOSE:
- *      Destroy the vlan in the specified device.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id
- * OUTPUT:
- *      None
- * RETURN:
- *      AIR_E_OK     -- Successfully read the data.
- *      AIR_E_OTHERS -- Vlan destroy failed.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_destroy(
-    const UI32_T    unit,
-    const UI16_T    vid);
-
-/* FUNCTION NAME:   air_vlan_destroyAll
- * PURPOSE:
- *      Destroy the vlan in the specified device.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id
- * OUTPUT:
- *      None
- * RETURN:
- *      AIR_E_OK     -- Successfully read the data.
- *      AIR_E_OTHERS -- Vlan destroy failed.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_destroyAll(
-    const UI32_T    unit,
-    const UI32_T    keep_and_restore_default_vlan);
-
-/* FUNCTION NAME:   air_vlan_reset
- * PURPOSE:
- *      Destroy the vlan in the specified device.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id
- * OUTPUT:
- *      None
- * RETURN:
- *      AIR_E_OK     -- Successfully reset the data.
- *      AIR_E_OTHERS -- Vlan reset failed.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_reset(
-    const UI32_T    unit,
-    const UI16_T    vid);
-
-/* FUNCTION NAME:   air_vlan_setFid
- * PURPOSE:
- *      Set the filter id of the vlan to the specified device.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id
- *      fid         -- filter id
- * OUTPUT:
- *      None
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_setFid(
-    const UI32_T    unit,
-    const UI16_T    vid,
-    const UI8_T     fid);
-
-/* FUNCTION NAME:   air_vlan_getFid
- * PURPOSE:
- *      Get the filter id of the vlan from the specified device.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id to be created
- * OUTPUT:
- *      p_fid       -- filter id
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_getFid(
-    const UI32_T    unit,
-    const UI16_T    vid,
-    UI8_T           *p_fid);
-
-/* FUNCTION NAME:   air_vlan_addMemberPort
- * PURPOSE:
- *      Add one vlan member to the specified device.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id
- *      port        -- port id
- * OUTPUT:
- *      None
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_addMemberPort(
-    const UI32_T    unit,
-    const UI16_T    vid,
-    const UI32_T    port);
-
-/* FUNCTION NAME:   air_vlan_delMemberPort
- * PURPOSE:
- *      Delete one vlan member from the specified device.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id
- *      port        -- port id
- * OUTPUT:
- *      None
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_delMemberPort(
-    const UI32_T    unit,
-    const UI16_T    vid,
-    const UI32_T    port);
-
-/* FUNCTION NAME:   air_vlan_setMemberPort
- * PURPOSE:
- *      Replace the vlan members in the specified device.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id
- *      port_bitmap -- member port bitmap
- * OUTPUT:
- *      None
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_setMemberPort(
-    const UI32_T    unit,
-    const UI16_T    vid,
-    const UI32_T    port_bitmap);
-
-/* FUNCTION NAME:   air_vlan_getMemberPort
- * PURPOSE:
- *      Get the vlan members from the specified device.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id
- * OUTPUT:
- *      port_bitmap -- member port bitmap
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_getMemberPort(
-    const UI32_T    unit,
-    const UI16_T    vid,
-    UI32_T          *p_port_bitmap);
-
-/* FUNCTION NAME:   air_vlan_setIVL
- * PURPOSE:
- *      Set L2 lookup mode IVL/SVL for L2 traffic.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id
- *      enable      -- enable IVL
- * OUTPUT:
- *      None
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_setIVL(
-    const UI32_T    unit,
-    const UI16_T    vid,
-    const BOOL_T    enable);
-
-/* FUNCTION NAME:   air_vlan_getIVL
- * PURPOSE:
- *      Get L2 lookup mode IVL/SVL for L2 traffic.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id
- * OUTPUT:
- *      p_enable    -- enable IVL
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_getIVL(
-    const UI32_T    unit,
-    const UI16_T    vid,
-    BOOL_T          *p_enable);
-
-/* FUNCTION NAME:   air_vlan_setPortAcceptFrameType
- * PURPOSE:
- *      Set vlan accept frame type of the port from the specified device.
- * INPUT:
- *      unit        -- unit id
- *      port        -- port id
- *      type        -- accept frame type
- * OUTPUT:
- *      None
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_setPortAcceptFrameType(
-    const UI32_T    unit,
-    const UI32_T    port,
-    const AIR_VLAN_ACCEPT_FRAME_TYPE_T type);
-
-/* FUNCTION NAME:   air_vlan_getPortAcceptFrameType
- * PURPOSE:
- *      Get vlan accept frame type of the port from the specified device.
- * INPUT:
- *      unit        -- unit id
- *      port        -- port id
- * OUTPUT:
- *      p_type      -- accept frame type
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_getPortAcceptFrameType(
-    const UI32_T    unit,
-    const UI32_T    port,
-    AIR_VLAN_ACCEPT_FRAME_TYPE_T *p_type);
-
-/* FUNCTION NAME:   air_vlan_setPortLeakyVlanEnable
- * PURPOSE:
- *      Set leaky vlan enable of the port from the specified device.
- * INPUT:
- *      unit        -- unit id
- *      port        -- port id
- *      pkt_type    -- packet type
- *      enable      -- enable leaky
- * OUTPUT:
- *      None
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_setPortLeakyVlanEnable(
-    const UI32_T    unit,
-    const UI32_T    port,
-    AIR_LEAKY_PKT_TYPE_T   pkt_type,
-    const BOOL_T    enable);
-
-/* FUNCTION NAME:   air_vlan_getPortLeakyVlanEnable
- * PURPOSE:
- *      Get leaky vlan enable of the port from the specified device.
- * INPUT:
- *      unit        -- unit id
- *      port        -- port id
- *      pkt_type    -- packet type
- * OUTPUT:
- *      p_enable    -- enable leaky
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_getPortLeakyVlanEnable(
-    const UI32_T    unit,
-    const UI32_T    port,
-    AIR_LEAKY_PKT_TYPE_T   pkt_type,
-    BOOL_T          *p_enable);
-
-/* FUNCTION NAME:   air_vlan_setPortAttr
- * PURPOSE:
- *      Set vlan port attribute from the specified device.
- * INPUT:
- *      unit        -- unit id
- *      port        -- port id
- *      attr        -- vlan port attr
- * OUTPUT:
- *      None
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_setPortAttr(
-    const UI32_T    unit,
-    const UI32_T    port,
-    const AIR_VLAN_PORT_ATTR_T attr);
-
-/* FUNCTION NAME:   air_vlan_getPortAttr
- * PURPOSE:
- *      Get vlan port attribute from the specified device.
- * INPUT:
- *      unit        -- unit id
- *      port        -- port id
- * OUTPUT:
- *      p_attr      -- vlan port attr
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_getPortAttr(
-    const UI32_T    unit,
-    const UI32_T    port,
-    AIR_VLAN_PORT_ATTR_T *p_attr);
-
-/* FUNCTION NAME:   air_vlan_setIgrPortTagAttr
- * PURPOSE:
- *      Set vlan incoming port egress tag attribute from the specified device.
- * INPUT:
- *      unit        -- unit id
- *      port        -- port id
- *      attr        -- egress tag attr
- * OUTPUT:
- *      None
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_setIgrPortTagAttr(
-    const UI32_T    unit,
-    const UI32_T    port,
-    const AIR_IGR_PORT_EG_TAG_ATTR_T attr);
-
-/* FUNCTION NAME:   air_vlan_getIgrPortTagAttr
- * PURPOSE:
- *      Get vlan incoming port egress tag attribute from the specified device.
- * INPUT:
- *      unit        -- unit id
- *      port        -- port id
- * OUTPUT:
- *      p_attr      -- egress tag attr
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_getIgrPortTagAttr(
-    const UI32_T    unit,
-    const UI32_T    port,
-    AIR_IGR_PORT_EG_TAG_ATTR_T *p_attr);
-
-/* FUNCTION NAME:   air_vlan_setPortEgsTagAttr
- * PURPOSE:
- *      Set vlan port egress tag attribute from the specified device.
- * INPUT:
- *      unit        -- unit id
- *      port        -- port id
- *      attr        -- egress tag attr
- * OUTPUT:
- *      None
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_setPortEgsTagAttr(
-    const UI32_T    unit,
-    const UI32_T    port,
-    const AIR_PORT_EGS_TAG_ATTR_T attr);
-
-/* FUNCTION NAME:   air_vlan_getPortEgsTagAttr
- * PURPOSE:
- *      Get vlan port egress tag attribute from the specified device.
- * INPUT:
- *      unit        -- unit id
- *      port        -- port id
- * OUTPUT:
- *      p_attr      -- egress tag attr
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_getPortEgsTagAttr(
-    const UI32_T    unit,
-    const UI32_T    port,
-    AIR_PORT_EGS_TAG_ATTR_T *p_attr);
-
-/* FUNCTION NAME:   air_vlan_setPortOuterTPID
- * PURPOSE:
- *      Set stack tag TPID of the port from the specified device.
- * INPUT:
- *      unit        -- unit id
- *      port        -- port id
- *      tpid        -- TPID
- * OUTPUT:
- *      None
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_setPortOuterTPID(
-    const UI32_T    unit,
-    const UI32_T    port,
-    const UI16_T    tpid);
-
-/* FUNCTION NAME:   air_vlan_getPortOuterTPID
- * PURPOSE:
- *      Get stack tag TPID of the port from the specified device.
- * INPUT:
- *      unit        -- unit id
- *      port        -- port id
- * OUTPUT:
- *      p_tpid        -- TPID
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_getPortOuterTPID(
-    const UI32_T    unit,
-    const UI32_T    port,
-    UI16_T          *p_tpid);
-
-/* FUNCTION NAME:   air_vlan_setPortPVID
- * PURPOSE:
- *      Set PVID of the port from the specified device.
- * INPUT:
- *      unit        -- unit id
- *      port        -- port id
- *      pvid        -- native vlan id
- * OUTPUT:
- *      None
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_setPortPVID(
-    const UI32_T    unit,
-    const UI32_T    port,
-    const UI16_T    pvid);
-
-/* FUNCTION NAME:   air_vlan_getPortPVID
- * PURPOSE:
- *      Get PVID of the port from the specified device.
- * INPUT:
- *      unit        -- unit id
- *      port        -- port id
- * OUTPUT:
- *      p_pvid      -- native vlan id
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_getPortPVID(
-    const UI32_T    unit,
-    const UI32_T    port,
-    UI16_T          *p_pvid);
-
-/* FUNCTION NAME:   air_vlan_setServiceTag
- * PURPOSE:
- *      Set Vlan service tag.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id
- *      stag        -- service stag
- * OUTPUT:
- *      None
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_setServiceTag(
-    const UI32_T    unit,
-    const UI16_T    vid,
-    const UI16_T    stag);
-
-/* FUNCTION NAME:   air_vlan_getServiceTag
- * PURPOSE:
- *      Get Vlan service tag.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id
- * OUTPUT:
- *      p_stag      -- service stag
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_getServiceTag(
-    const UI32_T    unit,
-    const UI16_T    vid,
-    UI16_T          *p_stag);
-
-/* FUNCTION NAME:   air_vlan_setEgsTagCtlEnable
- * PURPOSE:
- *      Set per vlan egress tag control.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id
- *      enable      -- enable vlan egress tag control
- * OUTPUT:
- *      None
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_setEgsTagCtlEnable(
-    const UI32_T    unit,
-    const UI16_T    vid,
-    const BOOL_T    enable);
-
-/* FUNCTION NAME:   air_vlan_getEgsTagCtlEnable
- * PURPOSE:
- *      Get per vlan egress tag control.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id
- * OUTPUT:
- *      p_enable    -- enable vlan egress tag control
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_getEgsTagCtlEnable(
-    const UI32_T    unit,
-    const UI16_T    vid,
-    BOOL_T          *p_enable);
-
-/* FUNCTION NAME:   air_vlan_setEgsTagConsistent
- * PURPOSE:
- *      Set per vlan egress tag consistent.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id
- *      enable      -- enable vlan egress tag consistent
- * OUTPUT:
- *      None
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_setEgsTagConsistent(
-    const UI32_T    unit,
-    const UI16_T    vid,
-    const BOOL_T    enable);
-
-/* FUNCTION NAME:   air_vlan_getEgsTagConsistent
- * PURPOSE:
- *      Get per vlan egress tag consistent.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id
- * OUTPUT:
- *      p_enable    -- enable vlan egress tag consistent
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_getEgsTagConsistent(
-    const UI32_T    unit,
-    const UI16_T    vid,
-    BOOL_T          *p_enable);
-
-/* FUNCTION NAME:   air_vlan_setPortBasedStag
- * PURPOSE:
- *      Set vlan port based stag enable.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id
- *      enable      -- vlan port based stag enable
- * OUTPUT:
- *      None
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_setPortBasedStag(
-    const UI32_T    unit,
-    const UI16_T    vid,
-    const BOOL_T    enable);
-
-/* FUNCTION NAME:   air_vlan_getPortBasedStag
- * PURPOSE:
- *      Get vlan port based stag enable.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id
- * OUTPUT:
- *      p_enable    -- vlan port based stag enable
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_getPortBasedStag(
-    const UI32_T    unit,
-    const UI16_T    vid,
-    BOOL_T          *p_enable);
-
-/* FUNCTION NAME:   air_vlan_setPortEgsTagCtl
- * PURPOSE:
- *      Set vlan port egress tag control.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id
- *      port        -- port id
- *      tag_ctl     -- egress tag control
- * OUTPUT:
- *      None
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_setPortEgsTagCtl(
-    const UI32_T    unit,
-    const UI16_T    vid,
-    const UI32_T    port,
-    const AIR_VLAN_PORT_EGS_TAG_CTL_TYPE_T    tag_ctl);
-
-/* FUNCTION NAME:   air_vlan_getPortEgsTagCtl
- * PURPOSE:
- *      Get vlan port egress tag control.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id
- * OUTPUT:
- *      p_tag_ctl   -- egress tag control
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_getPortEgsTagCtl(
-    const UI32_T    unit,
-    const UI16_T    vid,
-    const UI32_T    port,
-    AIR_VLAN_PORT_EGS_TAG_CTL_TYPE_T   *ptr_tag_ctl);
-
-#endif  /* AIR_VLAN_H */
-
+/* FILE NAME:   air_vlan.h
+ * PURPOSE:
+ *      Define the vlan functions in AIR SDK.
+ * NOTES:
+ */
+
+#ifndef AIR_VLAN_H
+#define AIR_VLAN_H
+
+/* INCLUDE FILE DECLARATIONS
+ */
+
+/* NAMING CONSTANT DECLARATIONS
+ */
+#define AIR_VLAN_ID_MIN                             0
+#define AIR_VLAN_ID_MAX                             4095
+#define AIR_DEFAULT_VLAN_ID                         1
+
+#define AIR_FILTER_ID_MAX                           7
+
+/* MACRO FUNCTION DECLARATIONS
+ */
+
+/* DATA TYPE DECLARATIONS
+ */
+typedef enum
+{
+    AIR_VLAN_PORT_EGS_TAG_CTL_TYPE_UNTAGGED = 0,
+    AIR_VLAN_PORT_EGS_TAG_CTL_TYPE_TAGGED = 2,
+    AIR_VLAN_PORT_EGS_TAG_CTL_TYPE_LAST,
+} AIR_VLAN_PORT_EGS_TAG_CTL_TYPE_T;
+
+typedef enum
+{
+    AIR_PORT_EGS_TAG_ATTR_UNTAGGED = 0,
+    AIR_PORT_EGS_TAG_ATTR_SWAP,
+    AIR_PORT_EGS_TAG_ATTR_TAGGED,
+    AIR_PORT_EGS_TAG_ATTR_STACK,
+    AIR_PORT_EGS_TAG_ATTR_LAST
+} AIR_PORT_EGS_TAG_ATTR_T;
+
+typedef enum
+{
+    AIR_VLAN_ACCEPT_FRAME_TYPE_ALL = 0,            /* untagged, priority-tagged and tagged  */
+    AIR_VLAN_ACCEPT_FRAME_TYPE_TAG_ONLY,           /* tagged                                */
+    AIR_VLAN_ACCEPT_FRAME_TYPE_UNTAG_ONLY,         /* untagged and priority-tagged          */
+    AIR_VLAN_ACCEPT_FRAME_TYPE_RESERVED,           /* reserved                              */
+    AIR_VLAN_ACCEPT_FRAME_TYPE_LAST
+} AIR_VLAN_ACCEPT_FRAME_TYPE_T;
+
+typedef enum
+{
+    AIR_LEAKY_PKT_TYPE_UNICAST = 0,                /* unicast pkt      */
+    AIR_LEAKY_PKT_TYPE_MULTICAST,                  /* multicast pkt    */
+    AIR_LEAKY_PKT_TYPE_BROADCAST,                  /* broadcast pkt    */
+    AIR_LEAKY_PKT_TYPE_LAST
+} AIR_LEAKY_PKT_TYPE_T;
+
+typedef enum
+{
+    AIR_VLAN_PORT_ATTR_USER_PORT = 0,              /* user port        */
+    AIR_VLAN_PORT_ATTR_STACK_PORT,                 /* stack port       */
+    AIR_VLAN_PORT_ATTR_TRANSLATION_PORT,           /* translation port */
+    AIR_VLAN_PORT_ATTR_TRANSPARENT_PORT,           /* transparent port */
+    AIR_VLAN_PORT_ATTR_LAST
+} AIR_VLAN_PORT_ATTR_T;
+
+typedef enum
+{
+    AIR_IGR_PORT_EG_TAG_ATTR_DISABLE = 0,
+    AIR_IGR_PORT_EG_TAG_ATTR_CONSISTENT,
+    AIR_IGR_PORT_EG_TAG_ATTR_UNTAGGED = 4,
+    AIR_IGR_PORT_EG_TAG_ATTR_SWAP,
+    AIR_IGR_PORT_EG_TAG_ATTR_TAGGED,
+    AIR_IGR_PORT_EG_TAG_ATTR_STACK,
+    AIR_IGR_PORT_EG_TAG_ATTR_LAST
+} AIR_IGR_PORT_EG_TAG_ATTR_T;
+
+typedef union AIR_VLAN_ENTRY_S
+{
+    UI8_T valid : 1;
+    struct
+    {
+        UI32_T  vlan_table0;
+        UI32_T  vlan_table1;
+    } vlan_table;
+    struct
+    {
+        UI64_T   valid             : 1;
+        UI64_T   fid               : 4;
+        UI64_T   ivl               : 1;
+        UI64_T   copy_pri          : 1;
+        UI64_T   user_pri          : 3;
+        UI64_T   eg_ctrl_en        : 1;
+        UI64_T   eg_con            : 1;
+        UI64_T   eg_ctrl           : 14;
+        UI64_T   port_mem          : 7;
+        UI64_T   port_stag         : 1;
+        UI64_T   stag              : 12;
+        UI64_T   unm_vlan_drop     : 1;
+    } vlan_entry_format;
+} AIR_VLAN_ENTRY_T;
+
+typedef union AIR_VLAN_ENTRY_ATTR_S
+{
+    UI8_T valid : 1;
+    struct
+    {
+        UI32_T  vlan_table0;
+        UI32_T  vlan_table1;
+        UI32_T  vlan_table2;
+        UI32_T  vlan_table3;
+        UI32_T  vlan_table4;
+    } vlan_table;
+    struct
+    {
+        UI64_T   valid             : 1;
+        UI64_T   fid               : 4;
+        UI64_T   ivl               : 1;
+        UI64_T   copy_pri          : 1;
+        UI64_T   user_pri          : 3;
+        UI64_T   eg_ctrl_en        : 1;
+        UI64_T   eg_con            : 1;
+        UI64_T   eg_ctrl           : 14;
+        UI64_T   port_mem          : 7;
+        UI64_T   port_stag         : 1;
+        UI64_T   stag              : 12;
+        UI64_T   unm_vlan_drop     : 1;
+    } vlan_entry_format;
+#if 0
+    struct
+    {
+        UI64_T   valid             : 1;
+        UI64_T   type              : 3;
+        UI64_T   mac_addr          : 48;
+        UI64_T   mac_mask_len      : 6;
+        UI64_T   priority          : 3;
+        UI64_T   :0;
+        UI64_T   vid               : 12;
+    } mac_based_vlan_entry_format;
+    struct
+    {
+        UI64_T   valid             : 1;
+        UI64_T   type              : 3;
+        UI64_T   check_field       : 36;
+        UI64_T   :0;
+        UI64_T   check_field_mask  : 36;
+        UI64_T   untagged_packet   : 1;
+        UI64_T   vlan_priority     : 3;
+        UI64_T   svid              : 12;
+    } qinq_based_vlan_entry_format;
+    struct
+    {
+        UI64_T   valid             : 1;
+        UI64_T   type              : 3;
+        UI64_T   ipv4              : 32;
+        UI64_T   :0;
+        UI64_T   subnetmask        : 32;
+        UI64_T   priority          : 3;
+        UI64_T   cvid              : 12;
+    } ipv4_based_vlan_entry_format;
+    struct
+    {
+        UI64_T   valid             : 1;
+        UI64_T   :0;
+        UI64_T   ipv6_high         : 64;
+        UI64_T   ipv6_low          : 64;
+        UI64_T   subnetmask        : 8;
+        UI64_T   priority          : 3;
+        UI64_T   cvid              : 12;
+    } ipv6_based_vlan_entry_format;
+#endif
+} AIR_VLAN_ENTRY_ATTR_T;
+
+void
+_air_vlan_readEntry(
+    const UI32_T unit,
+    const UI16_T vid,
+    AIR_VLAN_ENTRY_T* vlan_entry);
+
+void
+_air_vlan_writeEntry(
+    const UI32_T unit,
+    const UI16_T vid,
+    AIR_VLAN_ENTRY_T* vlan_entry);
+
+void
+_air_untagged_vlan_readEntry(
+    const UI32_T unit,
+    const UI16_T vid,
+    AIR_VLAN_ENTRY_ATTR_T* vlan_entry);
+
+void
+_air_untagged_vlan_writeEntry(
+    const UI32_T unit,
+    const UI16_T vid,
+    AIR_VLAN_ENTRY_ATTR_T* vlan_entry);
+
+/* EXPORTED SUBPROGRAM SPECIFICATIONS
+ */
+/* FUNCTION NAME:   air_vlan_create
+ * PURPOSE:
+ *      Create the vlan in the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id
+ *      p_attr      -- vlan attr
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Vlan creation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_create(
+    const UI32_T    unit,
+    const UI16_T    vid,
+    AIR_VLAN_ENTRY_ATTR_T *p_attr);
+
+/* FUNCTION NAME:   air_vlan_destroy
+ * PURPOSE:
+ *      Destroy the vlan in the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      AIR_E_OK     -- Successfully read the data.
+ *      AIR_E_OTHERS -- Vlan destroy failed.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_destroy(
+    const UI32_T    unit,
+    const UI16_T    vid);
+
+/* FUNCTION NAME:   air_vlan_destroyAll
+ * PURPOSE:
+ *      Destroy the vlan in the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      AIR_E_OK     -- Successfully read the data.
+ *      AIR_E_OTHERS -- Vlan destroy failed.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_destroyAll(
+    const UI32_T    unit,
+    const UI32_T    keep_and_restore_default_vlan);
+
+/* FUNCTION NAME:   air_vlan_reset
+ * PURPOSE:
+ *      Destroy the vlan in the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      AIR_E_OK     -- Successfully reset the data.
+ *      AIR_E_OTHERS -- Vlan reset failed.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_reset(
+    const UI32_T    unit,
+    const UI16_T    vid);
+
+/* FUNCTION NAME:   air_vlan_setFid
+ * PURPOSE:
+ *      Set the filter id of the vlan to the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id
+ *      fid         -- filter id
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_setFid(
+    const UI32_T    unit,
+    const UI16_T    vid,
+    const UI8_T     fid);
+
+/* FUNCTION NAME:   air_vlan_getFid
+ * PURPOSE:
+ *      Get the filter id of the vlan from the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id to be created
+ * OUTPUT:
+ *      p_fid       -- filter id
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_getFid(
+    const UI32_T    unit,
+    const UI16_T    vid,
+    UI8_T           *p_fid);
+
+/* FUNCTION NAME:   air_vlan_addMemberPort
+ * PURPOSE:
+ *      Add one vlan member to the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id
+ *      port        -- port id
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_addMemberPort(
+    const UI32_T    unit,
+    const UI16_T    vid,
+    const UI32_T    port);
+
+/* FUNCTION NAME:   air_vlan_delMemberPort
+ * PURPOSE:
+ *      Delete one vlan member from the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id
+ *      port        -- port id
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_delMemberPort(
+    const UI32_T    unit,
+    const UI16_T    vid,
+    const UI32_T    port);
+
+/* FUNCTION NAME:   air_vlan_setMemberPort
+ * PURPOSE:
+ *      Replace the vlan members in the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id
+ *      port_bitmap -- member port bitmap
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_setMemberPort(
+    const UI32_T    unit,
+    const UI16_T    vid,
+    const UI32_T    port_bitmap);
+
+/* FUNCTION NAME:   air_vlan_getMemberPort
+ * PURPOSE:
+ *      Get the vlan members from the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id
+ * OUTPUT:
+ *      port_bitmap -- member port bitmap
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_getMemberPort(
+    const UI32_T    unit,
+    const UI16_T    vid,
+    UI32_T          *p_port_bitmap);
+
+/* FUNCTION NAME:   air_vlan_setIVL
+ * PURPOSE:
+ *      Set L2 lookup mode IVL/SVL for L2 traffic.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id
+ *      enable      -- enable IVL
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_setIVL(
+    const UI32_T    unit,
+    const UI16_T    vid,
+    const BOOL_T    enable);
+
+/* FUNCTION NAME:   air_vlan_getIVL
+ * PURPOSE:
+ *      Get L2 lookup mode IVL/SVL for L2 traffic.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id
+ * OUTPUT:
+ *      p_enable    -- enable IVL
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_getIVL(
+    const UI32_T    unit,
+    const UI16_T    vid,
+    BOOL_T          *p_enable);
+
+/* FUNCTION NAME:   air_vlan_setPortAcceptFrameType
+ * PURPOSE:
+ *      Set vlan accept frame type of the port from the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      port        -- port id
+ *      type        -- accept frame type
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_setPortAcceptFrameType(
+    const UI32_T    unit,
+    const UI32_T    port,
+    const AIR_VLAN_ACCEPT_FRAME_TYPE_T type);
+
+/* FUNCTION NAME:   air_vlan_getPortAcceptFrameType
+ * PURPOSE:
+ *      Get vlan accept frame type of the port from the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      port        -- port id
+ * OUTPUT:
+ *      p_type      -- accept frame type
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_getPortAcceptFrameType(
+    const UI32_T    unit,
+    const UI32_T    port,
+    AIR_VLAN_ACCEPT_FRAME_TYPE_T *p_type);
+
+/* FUNCTION NAME:   air_vlan_setPortLeakyVlanEnable
+ * PURPOSE:
+ *      Set leaky vlan enable of the port from the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      port        -- port id
+ *      pkt_type    -- packet type
+ *      enable      -- enable leaky
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_setPortLeakyVlanEnable(
+    const UI32_T    unit,
+    const UI32_T    port,
+    AIR_LEAKY_PKT_TYPE_T   pkt_type,
+    const BOOL_T    enable);
+
+/* FUNCTION NAME:   air_vlan_getPortLeakyVlanEnable
+ * PURPOSE:
+ *      Get leaky vlan enable of the port from the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      port        -- port id
+ *      pkt_type    -- packet type
+ * OUTPUT:
+ *      p_enable    -- enable leaky
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_getPortLeakyVlanEnable(
+    const UI32_T    unit,
+    const UI32_T    port,
+    AIR_LEAKY_PKT_TYPE_T   pkt_type,
+    BOOL_T          *p_enable);
+
+/* FUNCTION NAME:   air_vlan_setPortAttr
+ * PURPOSE:
+ *      Set vlan port attribute from the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      port        -- port id
+ *      attr        -- vlan port attr
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_setPortAttr(
+    const UI32_T    unit,
+    const UI32_T    port,
+    const AIR_VLAN_PORT_ATTR_T attr);
+
+/* FUNCTION NAME:   air_vlan_getPortAttr
+ * PURPOSE:
+ *      Get vlan port attribute from the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      port        -- port id
+ * OUTPUT:
+ *      p_attr      -- vlan port attr
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_getPortAttr(
+    const UI32_T    unit,
+    const UI32_T    port,
+    AIR_VLAN_PORT_ATTR_T *p_attr);
+
+/* FUNCTION NAME:   air_vlan_setIgrPortTagAttr
+ * PURPOSE:
+ *      Set vlan incoming port egress tag attribute from the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      port        -- port id
+ *      attr        -- egress tag attr
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_setIgrPortTagAttr(
+    const UI32_T    unit,
+    const UI32_T    port,
+    const AIR_IGR_PORT_EG_TAG_ATTR_T attr);
+
+/* FUNCTION NAME:   air_vlan_getIgrPortTagAttr
+ * PURPOSE:
+ *      Get vlan incoming port egress tag attribute from the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      port        -- port id
+ * OUTPUT:
+ *      p_attr      -- egress tag attr
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_getIgrPortTagAttr(
+    const UI32_T    unit,
+    const UI32_T    port,
+    AIR_IGR_PORT_EG_TAG_ATTR_T *p_attr);
+
+/* FUNCTION NAME:   air_vlan_setPortEgsTagAttr
+ * PURPOSE:
+ *      Set vlan port egress tag attribute from the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      port        -- port id
+ *      attr        -- egress tag attr
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_setPortEgsTagAttr(
+    const UI32_T    unit,
+    const UI32_T    port,
+    const AIR_PORT_EGS_TAG_ATTR_T attr);
+
+/* FUNCTION NAME:   air_vlan_getPortEgsTagAttr
+ * PURPOSE:
+ *      Get vlan port egress tag attribute from the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      port        -- port id
+ * OUTPUT:
+ *      p_attr      -- egress tag attr
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_getPortEgsTagAttr(
+    const UI32_T    unit,
+    const UI32_T    port,
+    AIR_PORT_EGS_TAG_ATTR_T *p_attr);
+
+/* FUNCTION NAME:   air_vlan_setPortOuterTPID
+ * PURPOSE:
+ *      Set stack tag TPID of the port from the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      port        -- port id
+ *      tpid        -- TPID
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_setPortOuterTPID(
+    const UI32_T    unit,
+    const UI32_T    port,
+    const UI16_T    tpid);
+
+/* FUNCTION NAME:   air_vlan_getPortOuterTPID
+ * PURPOSE:
+ *      Get stack tag TPID of the port from the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      port        -- port id
+ * OUTPUT:
+ *      p_tpid        -- TPID
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_getPortOuterTPID(
+    const UI32_T    unit,
+    const UI32_T    port,
+    UI16_T          *p_tpid);
+
+/* FUNCTION NAME:   air_vlan_setPortPVID
+ * PURPOSE:
+ *      Set PVID of the port from the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      port        -- port id
+ *      pvid        -- native vlan id
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_setPortPVID(
+    const UI32_T    unit,
+    const UI32_T    port,
+    const UI16_T    pvid);
+
+/* FUNCTION NAME:   air_vlan_getPortPVID
+ * PURPOSE:
+ *      Get PVID of the port from the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      port        -- port id
+ * OUTPUT:
+ *      p_pvid      -- native vlan id
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_getPortPVID(
+    const UI32_T    unit,
+    const UI32_T    port,
+    UI16_T          *p_pvid);
+
+/* FUNCTION NAME:   air_vlan_setServiceTag
+ * PURPOSE:
+ *      Set Vlan service tag.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id
+ *      stag        -- service stag
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_setServiceTag(
+    const UI32_T    unit,
+    const UI16_T    vid,
+    const UI16_T    stag);
+
+/* FUNCTION NAME:   air_vlan_getServiceTag
+ * PURPOSE:
+ *      Get Vlan service tag.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id
+ * OUTPUT:
+ *      p_stag      -- service stag
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_getServiceTag(
+    const UI32_T    unit,
+    const UI16_T    vid,
+    UI16_T          *p_stag);
+
+/* FUNCTION NAME:   air_vlan_setEgsTagCtlEnable
+ * PURPOSE:
+ *      Set per vlan egress tag control.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id
+ *      enable      -- enable vlan egress tag control
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_setEgsTagCtlEnable(
+    const UI32_T    unit,
+    const UI16_T    vid,
+    const BOOL_T    enable);
+
+/* FUNCTION NAME:   air_vlan_getEgsTagCtlEnable
+ * PURPOSE:
+ *      Get per vlan egress tag control.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id
+ * OUTPUT:
+ *      p_enable    -- enable vlan egress tag control
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_getEgsTagCtlEnable(
+    const UI32_T    unit,
+    const UI16_T    vid,
+    BOOL_T          *p_enable);
+
+/* FUNCTION NAME:   air_vlan_setEgsTagConsistent
+ * PURPOSE:
+ *      Set per vlan egress tag consistent.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id
+ *      enable      -- enable vlan egress tag consistent
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_setEgsTagConsistent(
+    const UI32_T    unit,
+    const UI16_T    vid,
+    const BOOL_T    enable);
+
+/* FUNCTION NAME:   air_vlan_getEgsTagConsistent
+ * PURPOSE:
+ *      Get per vlan egress tag consistent.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id
+ * OUTPUT:
+ *      p_enable    -- enable vlan egress tag consistent
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_getEgsTagConsistent(
+    const UI32_T    unit,
+    const UI16_T    vid,
+    BOOL_T          *p_enable);
+
+/* FUNCTION NAME:   air_vlan_setPortBasedStag
+ * PURPOSE:
+ *      Set vlan port based stag enable.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id
+ *      enable      -- vlan port based stag enable
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_setPortBasedStag(
+    const UI32_T    unit,
+    const UI16_T    vid,
+    const BOOL_T    enable);
+
+/* FUNCTION NAME:   air_vlan_getPortBasedStag
+ * PURPOSE:
+ *      Get vlan port based stag enable.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id
+ * OUTPUT:
+ *      p_enable    -- vlan port based stag enable
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_getPortBasedStag(
+    const UI32_T    unit,
+    const UI16_T    vid,
+    BOOL_T          *p_enable);
+
+/* FUNCTION NAME:   air_vlan_setPortEgsTagCtl
+ * PURPOSE:
+ *      Set vlan port egress tag control.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id
+ *      port        -- port id
+ *      tag_ctl     -- egress tag control
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_setPortEgsTagCtl(
+    const UI32_T    unit,
+    const UI16_T    vid,
+    const UI32_T    port,
+    const AIR_VLAN_PORT_EGS_TAG_CTL_TYPE_T    tag_ctl);
+
+/* FUNCTION NAME:   air_vlan_getPortEgsTagCtl
+ * PURPOSE:
+ *      Get vlan port egress tag control.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id
+ * OUTPUT:
+ *      p_tag_ctl   -- egress tag control
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_getPortEgsTagCtl(
+    const UI32_T    unit,
+    const UI16_T    vid,
+    const UI32_T    port,
+    AIR_VLAN_PORT_EGS_TAG_CTL_TYPE_T   *ptr_tag_ctl);
+
+#endif  /* AIR_VLAN_H */
+
diff --git a/recipes-devtools/switch/files/src/an8855_sdk/api/src/air_aml.c b/recipes-devtools/switch/files/src/an8855_sdk/api/src/air_aml.c
index 38b85a4..2e4119c 100644
--- a/recipes-devtools/switch/files/src/an8855_sdk/api/src/air_aml.c
+++ b/recipes-devtools/switch/files/src/an8855_sdk/api/src/air_aml.c
@@ -1,218 +1,218 @@
-/* FILE NAME:  air_aml.c
- * PURPOSE:
- *      It provides access management layer function.
- * NOTES:
- *
- */
-
-/* INCLUDE FILE DECLARATIONS
- */
-#include "air.h"
-
-/* NAMING CONSTANT DECLARATIONS
- */
-
-/* MACRO FUNCTION DECLARATIONS
- */
-
-/* DATA TYPE DECLARATIONS
- */
-
-/* GLOBAL VARIABLE DECLARATIONS
- */
-AML_DEV_ACCESS_T _ext_dev_access;
-
-/* EXPORTED SUBPROGRAM BODIES
- */
-
-/* LOCAL SUBPROGRAM BODIES
- */
-/* FUNCTION NAME:   aml_readReg
- * PURPOSE:
- *      To read data from the register of the specified chip unit.
- * INPUT:
- *      unit        -- the device unit
- *      addr_offset -- the address of register
- * OUTPUT:
- *      ptr_data    -- pointer for the register data
- * RETURN:
- *      NPS_E_OK     -- Successfully read the data.
- *      NPS_E_OTHERS -- Failed to read the data.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-aml_readReg(
-    const UI32_T    unit,
-    const UI32_T    addr_offset,
-    UI32_T          *ptr_data)
-{
-    AIR_CHECK_PTR(ptr_data);
-
-    if (!_ext_dev_access.read_callback)
-    {
-        return AIR_E_OTHERS;
-    }
-
-    return _ext_dev_access.read_callback(unit, addr_offset, ptr_data);
-}
-
-/* FUNCTION NAME:   aml_writeReg
- * PURPOSE:
- *      To write data to the register of the specified chip unit.
- * INPUT:
- *      unit        -- the device unit
- *      addr_offset -- the address of register
- *      data        -- written data
- * OUTPUT:
- *      none
- * RETURN:
- *      NPS_E_OK     -- Successfully write the data.
- *      NPS_E_OTHERS -- Failed to write the data.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-aml_writeReg(
-    const UI32_T    unit,
-    const UI32_T    addr_offset,
-    const UI32_T    data)
-{
-    if (!_ext_dev_access.write_callback)
-    {
-        return AIR_E_OTHERS;
-    }
-
-    return _ext_dev_access.write_callback(unit, addr_offset, data);
-}
-
-/* FUNCTION NAME:   aml_readPhyReg
- * PURPOSE:
- *      To read data from the phy register of the specified chip unit in Clause22.
- * INPUT:
- *      unit        -- the device unit
- *      port_id     -- physical port number
- *      addr_offset -- the address of phy register
- * OUTPUT:
- *      ptr_data    -- pointer for the register data
- * RETURN:
- *      NPS_E_OK     -- Successfully read the data.
- *      NPS_E_OTHERS -- Failed to read the data.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-aml_readPhyReg(
-    const UI32_T    unit,
-    const UI32_T    port_id,
-    const UI32_T    addr_offset,
-    UI32_T          *ptr_data)
-{
-    AIR_CHECK_PTR(ptr_data);
-
-    if (!_ext_dev_access.phy_read_callback)
-    {
-        return AIR_E_OTHERS;
-    }
-
-    return _ext_dev_access.phy_read_callback(unit, port_id, addr_offset, ptr_data);
-}
-
-/* FUNCTION NAME:   aml_writePhyReg
- * PURPOSE:
- *      To write data to the phy register of the specified chip unit in Clause22.
- * INPUT:
- *      unit        -- the device unit
- *      port_id     -- physical port number
- *      addr_offset -- the address of phy register
- *      data        -- written data
- * OUTPUT:
- *      none
- * RETURN:
- *      NPS_E_OK     -- Successfully write the data.
- *      NPS_E_OTHERS -- Failed to write the data.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-aml_writePhyReg(
-    const UI32_T    unit,
-    const UI32_T    port_id,
-    const UI32_T    addr_offset,
-    const UI32_T    data)
-{
-    if (!_ext_dev_access.phy_write_callback)
-    {
-        return AIR_E_OTHERS;
-    }
-
-    return _ext_dev_access.phy_write_callback(unit, port_id, addr_offset, data);
-}
-
-/* FUNCTION NAME:   aml_readPhyRegCL45
- * PURPOSE:
- *      To read data from the phy register of the specified chip unit in Clause45.
- * INPUT:
- *      unit        -- the device unit
- *      port_id     -- physical port number
- *      dev_type    -- phy register type
- *      addr_offset -- the address of phy register
- * OUTPUT:
- *      ptr_data    -- pointer for the register data
- * RETURN:
- *      NPS_E_OK     -- Successfully read the data.
- *      NPS_E_OTHERS -- Failed to read the data.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-aml_readPhyRegCL45(
-    const UI32_T    unit,
-    const UI32_T    port_id,
-    const UI32_T    dev_type,
-    const UI32_T    addr_offset,
-    UI32_T          *ptr_data)
-{
-    AIR_CHECK_PTR(ptr_data);
-
-    if (!_ext_dev_access.phy_cl45_read_callback)
-    {
-        return AIR_E_OTHERS;
-    }
-
-    return _ext_dev_access.phy_cl45_read_callback(unit, port_id, dev_type, addr_offset, ptr_data);
-}
-
-/* FUNCTION NAME:   aml_writePhyRegCL45
- * PURPOSE:
- *      To write data to the phy register of the specified chip unit in Clause45.
- * INPUT:
- *      unit        -- the device unit
- *      port_id     -- physical port number
- *      dev_type    -- phy register offset
- *      addr_offset -- the address of phy register
- *      data        -- written data
- * OUTPUT:
- *      none
- * RETURN:
- *      NPS_E_OK     -- Successfully write the data.
- *      NPS_E_OTHERS -- Failed to write the data.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-aml_writePhyRegCL45(
-    const UI32_T    unit,
-    const UI32_T    port_id,
-    const UI32_T    dev_type,
-    const UI32_T    addr_offset,
-    const UI32_T    data)
-{
-    if (!_ext_dev_access.phy_cl45_write_callback)
-    {
-        return AIR_E_OTHERS;
-    }
-
-    return _ext_dev_access.phy_cl45_write_callback(unit, port_id, dev_type, addr_offset, data);
-}
-
+/* FILE NAME:  air_aml.c
+ * PURPOSE:
+ *      It provides access management layer function.
+ * NOTES:
+ *
+ */
+
+/* INCLUDE FILE DECLARATIONS
+ */
+#include "air.h"
+
+/* NAMING CONSTANT DECLARATIONS
+ */
+
+/* MACRO FUNCTION DECLARATIONS
+ */
+
+/* DATA TYPE DECLARATIONS
+ */
+
+/* GLOBAL VARIABLE DECLARATIONS
+ */
+AML_DEV_ACCESS_T _ext_dev_access;
+
+/* EXPORTED SUBPROGRAM BODIES
+ */
+
+/* LOCAL SUBPROGRAM BODIES
+ */
+/* FUNCTION NAME:   aml_readReg
+ * PURPOSE:
+ *      To read data from the register of the specified chip unit.
+ * INPUT:
+ *      unit        -- the device unit
+ *      addr_offset -- the address of register
+ * OUTPUT:
+ *      ptr_data    -- pointer for the register data
+ * RETURN:
+ *      NPS_E_OK     -- Successfully read the data.
+ *      NPS_E_OTHERS -- Failed to read the data.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+aml_readReg(
+    const UI32_T    unit,
+    const UI32_T    addr_offset,
+    UI32_T          *ptr_data)
+{
+    AIR_CHECK_PTR(ptr_data);
+
+    if (!_ext_dev_access.read_callback)
+    {
+        return AIR_E_OTHERS;
+    }
+
+    return _ext_dev_access.read_callback(unit, addr_offset, ptr_data);
+}
+
+/* FUNCTION NAME:   aml_writeReg
+ * PURPOSE:
+ *      To write data to the register of the specified chip unit.
+ * INPUT:
+ *      unit        -- the device unit
+ *      addr_offset -- the address of register
+ *      data        -- written data
+ * OUTPUT:
+ *      none
+ * RETURN:
+ *      NPS_E_OK     -- Successfully write the data.
+ *      NPS_E_OTHERS -- Failed to write the data.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+aml_writeReg(
+    const UI32_T    unit,
+    const UI32_T    addr_offset,
+    const UI32_T    data)
+{
+    if (!_ext_dev_access.write_callback)
+    {
+        return AIR_E_OTHERS;
+    }
+
+    return _ext_dev_access.write_callback(unit, addr_offset, data);
+}
+
+/* FUNCTION NAME:   aml_readPhyReg
+ * PURPOSE:
+ *      To read data from the phy register of the specified chip unit in Clause22.
+ * INPUT:
+ *      unit        -- the device unit
+ *      port_id     -- physical port number
+ *      addr_offset -- the address of phy register
+ * OUTPUT:
+ *      ptr_data    -- pointer for the register data
+ * RETURN:
+ *      NPS_E_OK     -- Successfully read the data.
+ *      NPS_E_OTHERS -- Failed to read the data.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+aml_readPhyReg(
+    const UI32_T    unit,
+    const UI32_T    port_id,
+    const UI32_T    addr_offset,
+    UI32_T          *ptr_data)
+{
+    AIR_CHECK_PTR(ptr_data);
+
+    if (!_ext_dev_access.phy_read_callback)
+    {
+        return AIR_E_OTHERS;
+    }
+
+    return _ext_dev_access.phy_read_callback(unit, port_id, addr_offset, ptr_data);
+}
+
+/* FUNCTION NAME:   aml_writePhyReg
+ * PURPOSE:
+ *      To write data to the phy register of the specified chip unit in Clause22.
+ * INPUT:
+ *      unit        -- the device unit
+ *      port_id     -- physical port number
+ *      addr_offset -- the address of phy register
+ *      data        -- written data
+ * OUTPUT:
+ *      none
+ * RETURN:
+ *      NPS_E_OK     -- Successfully write the data.
+ *      NPS_E_OTHERS -- Failed to write the data.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+aml_writePhyReg(
+    const UI32_T    unit,
+    const UI32_T    port_id,
+    const UI32_T    addr_offset,
+    const UI32_T    data)
+{
+    if (!_ext_dev_access.phy_write_callback)
+    {
+        return AIR_E_OTHERS;
+    }
+
+    return _ext_dev_access.phy_write_callback(unit, port_id, addr_offset, data);
+}
+
+/* FUNCTION NAME:   aml_readPhyRegCL45
+ * PURPOSE:
+ *      To read data from the phy register of the specified chip unit in Clause45.
+ * INPUT:
+ *      unit        -- the device unit
+ *      port_id     -- physical port number
+ *      dev_type    -- phy register type
+ *      addr_offset -- the address of phy register
+ * OUTPUT:
+ *      ptr_data    -- pointer for the register data
+ * RETURN:
+ *      NPS_E_OK     -- Successfully read the data.
+ *      NPS_E_OTHERS -- Failed to read the data.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+aml_readPhyRegCL45(
+    const UI32_T    unit,
+    const UI32_T    port_id,
+    const UI32_T    dev_type,
+    const UI32_T    addr_offset,
+    UI32_T          *ptr_data)
+{
+    AIR_CHECK_PTR(ptr_data);
+
+    if (!_ext_dev_access.phy_cl45_read_callback)
+    {
+        return AIR_E_OTHERS;
+    }
+
+    return _ext_dev_access.phy_cl45_read_callback(unit, port_id, dev_type, addr_offset, ptr_data);
+}
+
+/* FUNCTION NAME:   aml_writePhyRegCL45
+ * PURPOSE:
+ *      To write data to the phy register of the specified chip unit in Clause45.
+ * INPUT:
+ *      unit        -- the device unit
+ *      port_id     -- physical port number
+ *      dev_type    -- phy register offset
+ *      addr_offset -- the address of phy register
+ *      data        -- written data
+ * OUTPUT:
+ *      none
+ * RETURN:
+ *      NPS_E_OK     -- Successfully write the data.
+ *      NPS_E_OTHERS -- Failed to write the data.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+aml_writePhyRegCL45(
+    const UI32_T    unit,
+    const UI32_T    port_id,
+    const UI32_T    dev_type,
+    const UI32_T    addr_offset,
+    const UI32_T    data)
+{
+    if (!_ext_dev_access.phy_cl45_write_callback)
+    {
+        return AIR_E_OTHERS;
+    }
+
+    return _ext_dev_access.phy_cl45_write_callback(unit, port_id, dev_type, addr_offset, data);
+}
+
diff --git a/recipes-devtools/switch/files/src/an8855_sdk/api/src/air_cmd.c b/recipes-devtools/switch/files/src/an8855_sdk/api/src/air_cmd.c
index 95c11e8..6dfe416 100644
--- a/recipes-devtools/switch/files/src/an8855_sdk/api/src/air_cmd.c
+++ b/recipes-devtools/switch/files/src/an8855_sdk/api/src/air_cmd.c
@@ -1,8022 +1,8046 @@
-/* FILE NAME:   air_cmd.c
- * PURPOSE:
- *      Define the command line function in AIR SDK.
- * NOTES:
- */
-
-/* INCLUDE FILE DECLARATIONS
-*/
-#include "air.h"
-
-/* NAMING CONSTANT DECLARATIONS
-*/
-
-/* MACRO FUNCTION DECLARATIONS
-*/
-#define MAC_STR         "%02X%02X%02X%02X%02X%02X"
-#define MAC2STR(m)      (m)[0],(m)[1],(m)[2],(m)[3],(m)[4],(m)[5]
-#define AIR_MAC_LEN    (12)
-#define CMD_NO_PARA     (0xFFFFFFFF)
-#define CMD_VARIABLE_PARA (0xFFFFFFFE)
-#define L2_WDOG_KICK_NUM            (100)
-
-#define TOLOWER(x)      ((x) | 0x20)
-#define isxdigit(c)     (('0' <= (c) && (c) <= '9') || ('a' <= (c) && (c) <= 'f') || ('A' <= (c) && (c) <= 'F'))
-#define isdigit(c)      ('0' <= (c) && (c) <= '9')
-#define CMD_CHECK_PARA(__shift__, __op__, __size__) do          \
-{                                                               \
-    if ((__shift__) __op__ (__size__))                          \
-    {                                                           \
-        ;                                                       \
-    }                                                           \
-    else                                                        \
-    {                                                           \
-        return (AIR_E_BAD_PARAMETER);                           \
-    }                                                           \
-} while(0)
-
-/* DATA TYPE DECLARATIONS
-*/
-typedef struct {
-    C8_T*               name;
-    AIR_ERROR_NO_T     (*func)(UI32_T argc, C8_T *argv[]);
-    UI32_T              argc_min;
-    C8_T*               argc_errmsg;
-} AIR_CMD_T;
-
-/* GLOBAL VARIABLE DECLARATIONS
-*/
-
-/* LOCAL SUBPROGRAM DECLARATIONS
-*/
-/* String Utility */
-static BOOL_T _strcmp(const char *s1, const char *s2);
-static C8_T * _strtok_r(C8_T *s, const C8_T *delim, C8_T **last);
-static C8_T * _strtok(C8_T *s, const C8_T *delim, C8_T **last);
-UI32_T _strtoul(const C8_T *cp, C8_T **endp, UI32_T base);
-static I32_T _strtol(const C8_T *cp, C8_T **endp, UI32_T base);
-
-/* Type Converter */
-static AIR_ERROR_NO_T _str2mac(C8_T *str, C8_T *mac);
-static AIR_ERROR_NO_T _hex2bit(const UI32_T hex, UI32_T *ptr_bit);
-static AIR_ERROR_NO_T _hex2bitstr(const UI32_T hex, C8_T *ptr_bit_str, UI32_T str_len);
-static AIR_ERROR_NO_T _portListStr2Ary(const C8_T *str, UI32_T *ary, const UI32_T ary_num);
-
-/* Register Operation */
-static AIR_ERROR_NO_T doRegRead(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doRegWrite(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doReg(UI32_T argc, C8_T *argv[]);
-
-/* PHY Operation */
-static AIR_ERROR_NO_T doPhyCL22Read(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doPhyCL22Write(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doPhyCL22(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doPhyCL45Read(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doPhyCL45Write(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doPhyCL45(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doPhy(UI32_T argc, C8_T *argv[]);
-
-/* Porting setting */
-static AIR_ERROR_NO_T doPortSetMatrix(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doPortSetVlanMode(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doPortSet(UI32_T argc, C8_T *argv[]);
-
-static AIR_ERROR_NO_T doPortGetMatrix(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doPortGetVlanMode(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doPortGet(UI32_T argc, C8_T *argv[]);
-
-static AIR_ERROR_NO_T doPort(UI32_T argc, C8_T *argv[]);
-
-/* Vlan setting */
-static AIR_ERROR_NO_T doVlanInitiate(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doVlanCreate(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doVlanDestroy(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doVlanDestroyAll(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doVlanDump(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doVlanAddPortMem(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doVlanDelPortMem(UI32_T argc, C8_T *argv[]);
-
-static AIR_ERROR_NO_T doVlanSetFid(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doVlanSetMemPort(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doVlanSetIVL(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doVlanSetPortBaseStag(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doVlanSetStag(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doVlanSetEgsTagCtlEn(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doVlanSetEgsTagCtlCon(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doVlanSetEgsTagCtl(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doVlanSetPortActFrame(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doVlanSetLeakyVlanEn(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doVlanSetPortVlanAttr(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doVlanSetIgsPortETagAttr(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doVlanSetPortETagAttr(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doVlanSetPortOuterTPID(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doVlanSetPvid(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doVlanSet(UI32_T argc, C8_T *argv[]);
-
-static AIR_ERROR_NO_T doVlanGetPortActFrame(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doVlanGetLeakyVlanEn(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doVlanGetPortVlanAttr(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doVlanGetIgsPortETagAttr(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doVlanGetPortETagAttr(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doVlanGetPortOuterTPID(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doVlanGetPvid(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doVlanGet(UI32_T argc, C8_T *argv[]);
-
-static AIR_ERROR_NO_T doVlan(UI32_T argc, C8_T *argv[]);
-
-static AIR_ERROR_NO_T doFlowCtrl(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doJumbo(UI32_T argc, C8_T *argv[]);
-
-static AIR_ERROR_NO_T doL2Add(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doL2Del(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doL2Clear(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doL2Get(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doL2Set(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doL2Dump(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doL2(UI32_T argc, C8_T *argv[]);
-
-static AIR_ERROR_NO_T doAnMode(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doLocalAdv(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doRemoteAdv(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doPortSpeed(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doPortDuplex(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doPortStatus(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doPortBckPres(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doPortPsMode(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doPortSmtSpdDwn(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doPortSpTag(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doPortEnable(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doPort5GBaseRMode(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doPortHsgmiiMode(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doPortSgmiiMode(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doPortRmiiMode(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doPortRgmiiMode(UI32_T argc, C8_T *argv[]);
-
-static AIR_ERROR_NO_T doSptagEn(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doSptagMode(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doSptagDecode(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doSptagEncode(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doSptag(UI32_T argc, C8_T *argv[]);
-
-static AIR_ERROR_NO_T doMacAddr(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T _printMacEntry(AIR_MAC_ENTRY_T * mt, UI32_T age_unit, UI8_T count, UI8_T title);
-static AIR_ERROR_NO_T doGetMacAddr(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doMacAddrAgeOut(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doDumpMacAddr(UI32_T argc, C8_T *argv[]);
-
-static AIR_ERROR_NO_T doLagMember(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doLagMemberCnt(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doLagPtseed(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doLagHashtype(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doLagDstInfo(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doLagState(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doLagSpsel(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doLagGet(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doLagSet(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doLag(UI32_T argc, C8_T *argv[]);
-
-static AIR_ERROR_NO_T doStpPortstate(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doStpGet(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doStpSet(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doStp(UI32_T argc, C8_T *argv[]);
-
-static AIR_ERROR_NO_T doMirrorGetSid(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doMirrorDelSid(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doMirrorAddRlist(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doMirrorAddTlist(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doMirrorSetSessionEnable(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doMirrorSetSession(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doMirrorSet(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doMirrorAdd(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doMirrorGet(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doMirrorDel(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doMirror(UI32_T argc,C8_T *argv[]);
-
-static AIR_ERROR_NO_T doMibClearPort(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doMibClearAcl(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doMibGetPort(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doMibGetAcl(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doMibClear(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doMibGet(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doMib(UI32_T argc, C8_T *argv[]);
-
-static AIR_ERROR_NO_T doQosScheduleAlgo(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doQosTrustMode(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doQosPri2Queue(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doQosDscp2Pri(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doQosRateLimitEnable(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doQosRateLimit(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doQosPortPriority(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doQosRateLimitExMngFrm(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doQosGet(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doQosSet(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doQos(UI32_T argc, C8_T *argv[]);
-
-static AIR_ERROR_NO_T doDiagTxComply(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doDiagSet(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doDiagGet(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doDiag(UI32_T argc, C8_T *argv[]);
-
-static AIR_ERROR_NO_T doLedMode(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doLedState(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doLedUsrDef(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doLedBlkTime(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doLedSet(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doLedGet(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doLed(UI32_T argc, C8_T *argv[]);
-
-static AIR_ERROR_NO_T doSwitchCpuPortEn(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doSwitchCpuPort(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doSwitchPhyLCIntrEn(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doSwitchPhyLCIntrSts(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doSwitchSet(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doSwitchGet(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doSwitch(UI32_T argc, C8_T *argv[]);
-
-static AIR_ERROR_NO_T doShowVersion(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doShow(UI32_T argc, C8_T *argv[]);
-
-static AIR_ERROR_NO_T doStormEnable(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doStormRate(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doFldMode(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doSaLearning(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doSaLimit(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doSecGet(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doSecSet(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doSec(UI32_T argc, C8_T *argv[]);
-
-static void _air_acl_printRuleMap(UI32_T *rule_map, UI32_T ary_num);
-static AIR_ERROR_NO_T doAclEn(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doAclRule(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doAclUdfRule(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doAclRmvRule(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doAclRmvUdfRule(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doAclAction(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doAclRmvAction(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doAclDumpAction(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doAclTrtcm(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doAclTrtcmEn(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doAclRmvTrtcm(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doAclPortEn(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doAclDropEn(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doAclDropThrsh(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doAclDropPbb(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doAclMeter(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doAclDump(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doAclSet(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doAclGet(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doAclDel(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doAclClear(UI32_T argc, C8_T *argv[]);
-static AIR_ERROR_NO_T doAcl(UI32_T argc, C8_T *argv[]);
-
-static AIR_ERROR_NO_T subcmd(const AIR_CMD_T tab[], UI32_T argc, C8_T *argv[]);
-
-/* STATIC VARIABLE DECLARATIONS
-*/
-const static C8_T *_sptag_vpm[] =
-{
-    "untagged",
-    "8100",
-    "predefined",
-    "unknown"
-};
-
-const static C8_T *_sptag_pt[] =
-{
-    "disable pass through",
-    "enable pass through"
-};
-
-const static C8_T *_air_mac_address_forward_control_string [] =
-{
-    "Default",
-    "CPU include",
-    "CPU exclude",
-    "CPU only",
-    "Drop"
-};
-
-static AIR_CMD_T regCmds[] =
-{
-    {"r",           doRegRead,      1,      "reg r <reg(4'hex)>"},
-    {"w",           doRegWrite,     2,      "reg w <reg(4'hex)> <value(8'hex)>"},
-
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T phyCL22Cmds[] =
-{
-    {"r",           doPhyCL22Read,  2,      "phy cl22 r <port(0..4)> <reg(2'hex)>"},
-    {"w",           doPhyCL22Write, 3,      "phy cl22 w <port(0..4)> <reg(2'hex)> <value(4'hex)>"},
-
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T phyCL45Cmds[] =
-{
-    {"r",           doPhyCL45Read,  3,      "phy cl45 r <port(0..4)> <dev(2'hex)> <reg(3'hex)>"},
-    {"w",           doPhyCL45Write, 4,      "phy cl45 w <port(0..4)> <dev(2'hex)> <reg(3'hex)> <value(4'hex)>"},
-
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T phyCmds[] =
-{
-    {"cl22",         doPhyCL22,     0,      NULL},
-    {"cl45",         doPhyCL45,     0,      NULL},
-
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T portSetCmds[] =
-{
-    {"matrix",      doPortSetMatrix,        2,                "port set matrix <port(0..6)> <matrix(6:0)>"},
-    {"vlanMode",    doPortSetVlanMode,      2,                "port set vlanMode <port(0..6)> <vlanMode(0:matrix,1:fallback,2:check,3:security)>"},
-    {"flowCtrl",    doFlowCtrl,             3,                "port set flowCtrl <port(0..6)> <dir(0:Tx,1:Rx)> <fc_en(1:En,0:Dis)>"},
-    {"jumbo",       doJumbo,                2,                "port set jumbo <pkt_len(0:1518,1:1536,2:1552,3:max)> <frame_len(2..15)>"},
-    {"anMode",      doAnMode,               2,                "port set anMode <port(0..4)> <en(0:force,1:AN)>"},
-    {"localAdv",    doLocalAdv,             7,                "port set localAdv <port(0..4)> <10H(1:En,0:Dis)> <10F(1:En,0:Dis)> <100H(1:En,0:Dis)> <100F(1:En,0:Dis)> <1000F(1:En,0:Dis)> <pause(1:En,0:Dis)>"},
-    {"speed",       doPortSpeed,            2,                "port set speed <port(0..4)> <speed(0:10M,1:100M,2:1G,3:2.5G)>"},
-    {"duplex",      doPortDuplex,           2,                "port set duplex <port(0..4)> <duplex(0:half,1:full)>"},
-    {"bckPres",     doPortBckPres,          2,                "port set bckPres <port(0..6)> <bckPres(1:En,0:Dis)>"},
-    {"psMode",      doPortPsMode,           3,                "port set psMode <port(0..4)> <ls(1:En,0:Dis)> <eee(1:En,0:Dis)>"},
-    {"smtSpdDwn",   doPortSmtSpdDwn,        3,                "port set smtSpdDwn <port(0..4)> <en(1:En,0:Dis)> <retry(2..5)>"},
-    {"spTag",       doPortSpTag,            2,                "port set spTag <port(0..6)> <en(1:En,0:Dis)>"},
-    {"enable",      doPortEnable,           2,                "port set enable <port(0..4)> <en(1:En,0:Dis)>"},
-    {"5GBaseRMode", doPort5GBaseRMode,      CMD_NO_PARA,      "port set 5GBaseRMode"},
-    {"hsgmiiMode",  doPortHsgmiiMode,       CMD_NO_PARA,      "port set hsgmiiMode"},
-    {"sgmiiMode",   doPortSgmiiMode,        2,                "port set sgmiiMode <mode(0:AN,1:Force)> <speed(0:10M,1:100M,2:1G)>"},
-    {"rmiiMode",    doPortRmiiMode,         1,                "port set rmiiMode <speed(0:10M,1:100M)>"},
-    {"rgmiiMode",   doPortRgmiiMode,        1,                "port set rgmiiMode <speed(0:10M,1:100M,2:1G)>"},
-
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T portGetCmds[] =
-{
-    {"matrix",      doPortGetMatrix,        1,                "port get matrix <port(0..6)>"},
-    {"vlanMode",    doPortGetVlanMode,      1,                "port get vlanMode <port(0..6)>"},
-    {"flowCtrl",    doFlowCtrl,             2,                "port get flowCtrl <port(0..6)> <dir(0:Tx,1:Rx)>"},
-    {"jumbo",       doJumbo,                CMD_NO_PARA,      "port get jumbo"},
-    {"anMode",      doAnMode,               1,                "port get anMode <port(0..4)>"},
-    {"localAdv",    doLocalAdv,             1,                "port get localAdv <port(0..4)>"},
-    {"remoteAdv",   doRemoteAdv,            1,                "port get remoteAdv <port(0..4)>"},
-    {"speed",       doPortSpeed,            1,                "port get speed <port(0..4)>"},
-    {"duplex",      doPortDuplex,           1,                "port get duplex <port(0..4)>"},
-    {"status",      doPortStatus,           1,                "port get status <port(0..4)>"},
-    {"bckPres",     doPortBckPres,          1,                "port get bckPres <port(0..6)>"},
-    {"psMode",      doPortPsMode,           1,                "port get psMode <port(0..4)>"},
-    {"smtSpdDwn",   doPortSmtSpdDwn,        1,                "port get smtSpdDwn <port(0..4)>"},
-    {"spTag",       doPortSpTag,            1,                "port get spTag <port(0..6)>"},
-    {"enable",      doPortEnable,           1,                "port get enable <port(0..4)>"},
-
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T portCmds[] =
-{
-    {"set",         doPortSet,      0,      NULL},
-    {"get",         doPortGet,      0,      NULL},
-
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T sptagCmds[] =
-{
-    {"setEnable",       doSptagEn,          2,      "sptag setEnable port<port(0..6)> enable<1:enable 0:disable>"},
-    {"getEnable",       doSptagEn,          1,      "sptag getEnable port<port(0..6)>"},
-    {"setmode",         doSptagMode,        2,      "sptag setmode port<port(0..6)> mode<0:inset 1:replace>"},
-    {"getmode",         doSptagMode,        1,      "sptag getmode port<port(0..6)>"},
-    {"encode",          doSptagEncode,      7,      "sptag encode mode={ insert | replace } opc={ portmap | portid | lookup } dp={bitimap hex} vpm={ untagged | 8100 | 88a8 } pri=<UINT> cfi=<UINT> vid=<UINT> "},
-    {"decode",          doSptagDecode,      4,      "sptag decode <byte(hex)> <byte(hex)> <byte(hex)> <byte(hex)>"},
-
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T vlanSetCmds[] =
-{
-    {"fid",                 doVlanSetFid,               2,      "vlan set fid <vid(0..4095)> <fid(0..7)>"},
-    {"memPort",             doVlanSetMemPort,           2,      "vlan set memPort <vid(0..4095)> <bitmap(6:0)>"},
-    {"ivl",                 doVlanSetIVL,               2,      "vlan set ivl <vid(0..4095)> <(1:En,0:Dis)>"},
-    {"portBaseStag",        doVlanSetPortBaseStag,      2,      "vlan set portBaseStag <vid(0..4095)> <(1:En,0:Dis)>"},
-    {"stag",                doVlanSetStag,              2,      "vlan set stag <vid(0..4095)> <stag(0..4095)>"},
-    {"egsTagCtlEn",         doVlanSetEgsTagCtlEn,       2,      "vlan set egsTagCtlEn <vid(0..4095)> <(1:En,0:Dis)>"},
-    {"egsTagCtlCon",        doVlanSetEgsTagCtlCon,      2,      "vlan set egsTagCtlCon <vid(0..4095)> <(1:En,0:Dis)>"},
-    {"egsTagCtl",           doVlanSetEgsTagCtl,         3,      "vlan set egsTagCtl <vid(0..4095)> <port(0..6)> <ctlType(0:untag,2:tagged)>"},
-
-    {"portActFrame",        doVlanSetPortActFrame,      2,      "vlan set portActFrame <port(0..6)> <frameType(0:all,1:tagged,2:untagged)>"},
-    {"leakyVlanEn",         doVlanSetLeakyVlanEn,       3,      "vlan set LeakyVlanEn <port(0..6)> <pktType(0:uc,1:mc,2:bc,3:ipmc)> <(1:En,0:Dis)>"},
-    {"portVlanAttr",        doVlanSetPortVlanAttr,      2,      "vlan set portVlanAttr <port(0..6)> <vlanAttr(0:user,1:stack,2:translation,3:transparent)>"},
-    {"igsPortETagAttr",     doVlanSetIgsPortETagAttr,   2,      "vlan set igsPortETagAttr <port(0..6)> <egsTagAttr(0:disable,1:consistent,4:untagged,5:swap,6:tagged,7:stack)>"},
-    {"portEgsTagAttr",      doVlanSetPortETagAttr,      2,      "vlan set portEgsTagAttr <port(0..6)> <egsTagAttr(0:untagged,1:swap,2:tagged,3:stack)>"},
-    {"portOuterTPID",       doVlanSetPortOuterTPID,     2,      "vlan set portOuterTPID <port(0..6)> <TPID(hex)>"},
-    {"pvid",                doVlanSetPvid,              2,      "vlan set pvid <port(0..6)> <vid(0..4095)>"},
-
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T vlanGetCmds[] =
-{
-    {"portActFrame",        doVlanGetPortActFrame,      1,      "vlan get portActFrame <port(0..6)>"},
-    {"leakyVlanEn",         doVlanGetLeakyVlanEn,       1,      "vlan get leakyVlanEn <port(0..6)>"},
-    {"portVlanAttr",        doVlanGetPortVlanAttr,      1,      "vlan get portVlanAttr <port(0..6)>"},
-    {"igsPortETagAttr",     doVlanGetIgsPortETagAttr,   1,      "vlan get igsPortETagAttr <port(0..6)>"},
-    {"portEgsTagAttr",      doVlanGetPortETagAttr,      1,      "vlan get portEgsTagAttr <port(0..6)>"},
-    {"portOuterTPID",       doVlanGetPortOuterTPID,     1,      "vlan get portOuterTPID <port(0..6)>"},
-    {"pvid",                doVlanGetPvid,              1,      "vlan get pvid <port(0..6)>"},
-
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T vlanCmds[] =
-{
-    {"initiate",        doVlanInitiate,         9,      "vlan initiate <vid(0..4095)> <fid(0..7)> <bitmap(6:0)> <ivl(1:En,0:Dis)> <portbasestag(1:En,0:Dis)> <stag(0..4095)> <egstagctlen(1:En,0:Dis)> <egstagcon(1:En,0:Dis)> <taggedbitmap(6:0)>"},
-    {"create",          doVlanCreate,           1,      "vlan create <vid(0..4095)>"},
-    {"destroy",         doVlanDestroy,          1,      "vlan destroy [ <vid(0..4095)> | <vidRange(vid0-vid1)> ]"},
-    {"destroyAll",      doVlanDestroyAll,       0,      "vlan destroyAll [ <restoreDefVlan(0:false,1:true)> | ]"},
-    {"dump",            doVlanDump,             0,      "vlan dump [ <vid(0..4095)> | <vidRange(vid0-vid1)> | ]"},
-    {"addPortMem",      doVlanAddPortMem,       2,      "vlan addPortMem <vid(0..4095)> <port(0..6)>"},
-    {"delPortMem",      doVlanDelPortMem,       2,      "vlan addPortMem <vid(0..4095)> <port(0..6)>"},
-    {"set",             doVlanSet,              0,      NULL},
-    {"get",             doVlanGet,              0,      NULL},
-
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T l2ClearCmds[] =
-{
-    {"mac",              doMacAddr,          CMD_NO_PARA,    "l2 clear mac"},
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T l2DelCmds[] =
-{
-    {"mac",             doMacAddr,           3,    "l2 del mac <mac(12'hex)> [ vid <vid(0..4095)> | fid <fid(0..15)> ]"},
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T l2AddCmds[] =
-{
-    {"mac",             doMacAddr,           7,    "l2 add mac <static(0:dynamic,1:static)> <unauth(0:auth,1:unauth)> <mac(12'hex)> <portlist(uintlist)> [ vid <vid(0..4095)> | fid <fid(0..15)> ] <src_mac_forward=(0:default,1:cpu-exclude,2:cpu-include,3:cpu-only,4:drop)>"},
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T l2SetCmds[] =
-{
-    {"macAddrAgeOut",   doMacAddrAgeOut,    1,    "l2 set macAddrAgeOut <time(1, 1000000)>"},
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T l2GetCmds[] =
-{
-    {"mac",             doGetMacAddr,       3,              "l2 get mac <mac(12'hex)> [ vid <vid(0..4095)> | fid <fid(0..15)> ]"},
-    {"macAddrAgeOut",   doMacAddrAgeOut,    CMD_NO_PARA,    "l2 get macAddrAgeOut"},
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T l2DumpCmds[] =
-{
-    {"mac",                doDumpMacAddr,        0,    "l2 dump mac"},
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T l2Cmds[] =
-{
-    {"add",         doL2Add,        0,        NULL},
-    {"del",         doL2Del,        0,        NULL},
-    {"clear",       doL2Clear,      0,        NULL},
-    {"get",         doL2Get,        0,        NULL},
-    {"set",         doL2Set,        0,        NULL},
-    {"dump",        doL2Dump,       0,        NULL},
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T lagGetCmds[] =
-{
-    {"member",      doLagMember,    1,              "lag get member group_id(0 or 1)"},
-    {"dstInfo",     doLagDstInfo,   CMD_NO_PARA,    "lag get dstInfo"},
-    {"ptseed",      doLagPtseed,    CMD_NO_PARA,    "lag get ptseed"},
-    {"hashtype",    doLagHashtype,  CMD_NO_PARA,    "lag get hashtype"},
-    {"state",       doLagState,     CMD_NO_PARA,    "lag get state"},
-    {"spsel",       doLagSpsel,     CMD_NO_PARA,    "lag get spsel"},
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T lagSetCmds[] =
-{
-    {"member",       doLagMember,        4,    "lag set member <group_id(0 or 1)> <member_index(0..3)> <enable(0,1)> <port index(0..6)>"},
-    {"dstInfo",      doLagDstInfo,       7,    "lag set dstInfo <sp(1:En,0:Dis)> <sa(1:En,0:Dis)> <da(1:En,0:Dis)> <sip(1:En,0:Dis)> <dip(1:En,0:Dis)> <sport(1:En,0:Dis)> <dport(1:En,0:Dis)>"},
-    {"ptseed",       doLagPtseed,        1,    "lag set ptseed <hex32>"},
-    {"hashtype",     doLagHashtype,      1,    "lag set hashtype <0-crc32lsb;1-crc32msb;2-crc16;3-xor4>"},
-    {"state",        doLagState,         1,    "lag set state <state(1:En,0:Dis)>"},
-    {"spsel",        doLagSpsel,         1,    "lag set spsel <soure port enable(1:En,0:Dis)>"},
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T lagCmds[] =
-{
-    {"get",          doLagGet,        0,        NULL},
-    {"set",          doLagSet,        0,        NULL},
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T stpGetCmds[] =
-{
-    {"portstate",    doStpPortstate,  2,    "stp get portstate <port(0..6)> <fid(0..15)>"},
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T stpSetCmds[] =
-{
-    {"portstate",    doStpPortstate,  3,    "stp set portstate <port(0..6)> <fid(0..15)> <state(0:disable,1:listen,2:learn,3:forward)>"},
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T stpCmds[] =
-{
-    {"get",         doStpGet,           0,      NULL},
-    {"set",         doStpSet,           0,      NULL},
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T mirrorSetCmds[] =
-{
-    {"session",        doMirrorSetSession,       6,      "mirror set session <sid(0,1)> <dst_port(UINT)> <state(1:En,0:Dis)> <tag(1:on, 0:off)> <list(UINTLIST)> <dir(0:none,1:tx,2:rx,3:both)>"},
-    {"session-enable", doMirrorSetSessionEnable, 2,      "mirror set session-enable <sid(0,1)> <state(1:En,0:Dis)>"},
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T mirrorAddCmds[] =
-{
-    {"session-rlist",  doMirrorAddRlist,       2,      "mirror add session-rlist <sid(0,1)> <list(UINTLIST)>"},
-    {"session-tlist",  doMirrorAddTlist,       2,      "mirror add session-tlist <sid(0,1)> <list(UINTLIST)>"},
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T mirrorGetCmds[] =
-{
-    {"session",        doMirrorGetSid,       1,      "mirror get session <sid(0,1)>"},
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T mirrorDelCmds[] =
-{
-    {"session",        doMirrorDelSid,       1,      "mirror del session <sid(0,1)>"},
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T mirrorCmds[] =
-{
-    {"set",         doMirrorSet,        0,      NULL},
-    {"add",         doMirrorAdd,        0,      NULL},
-    {"get",         doMirrorGet,        0,      NULL},
-    {"del",         doMirrorDel,        0,      NULL},
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T mibClearCmds[] =
-{
-    {"port",        doMibClearPort,     1,      "mib clear port <port(0..6)>"},
-    {"all",         doMibClearPort,     0,      "mib clear all"},
-    {"acl",         doMibClearAcl,      0,      "mib clear acl"},
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T mibGetCmds[] =
-{
-    {"port",        doMibGetPort,       1,      "mib get port <port(0..6)>"},
-    {"acl",         doMibGetAcl,        1,      "mib get acl <event(0..7)>"},
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T mibCmds[] =
-{
-    {"clear",       doMibClear,         0,      NULL},
-    {"get",         doMibGet,           0,      NULL},
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T qosGetCmds[] =
-{
-    {"scheduleAlgo",    doQosScheduleAlgo,      2,  "qos get scheduleAlgo <portlist(UINTLIST)> <queue(UINT)>"},
-    {"trustMode",       doQosTrustMode,         1,  "qos get trustMode <portlist(UINTLIST)>"},
-    {"pri2Queue",       doQosPri2Queue,         0,  "qos get pri2Queue"},
-    {"dscp2Pri",        doQosDscp2Pri,          1,  "qos get dscp2Pri <dscp(0..63)>"},
-    {"rateLimitEnable", doQosRateLimitEnable,   1,  "qos get rateLimitEnable <portlist(UINTLIST)>"},
-    {"rateLimit",       doQosRateLimit,         1,  "qos get rateLimit <portlist(UINTLIST)>"},
-    {"portPriority",    doQosPortPriority,      1,  "qos get portPriority <portlist(UINTLIST)>"},
-    {"rateLmtExMngFrm", doQosRateLimitExMngFrm, 0,  "qos get rateLmtExMngFrm"},
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T qosSetCmds[] =
-{
-    {"scheduleAlgo",    doQosScheduleAlgo,      4,  "qos set scheduleAlgo <portlist(UINTLIST)> <queue(UINT)> <scheduler(0:SP,1:WRR,2:WFQ)> <weight(0..128)>, weight 0 is valid only on sp mode"},
-    {"trustMode",       doQosTrustMode,         2,  "qos set trustMode <portlist(UINTLIST)> <mode(0:port,1:1p-port,2:dscp-port,3:dscp-1p-port>"},
-    {"pri2Queue",       doQosPri2Queue,         2,  "qos set pri2Queue <priority(0..7)> <queue(0..7)>"},
-    {"dscp2Pri",        doQosDscp2Pri,          2,  "qos set dscp2Pri <dscp(0..63)> <priority(0..7)>"},
-    {"rateLimitEnable", doQosRateLimitEnable,   3,  "qos set rateLimitEnable <portlist(UINTLIST)> <dir(0:egress,1:ingress)> <rate_en(1:En,0:Dis)>"},
-    {"rateLimit",       doQosRateLimit,         5,  "qos set rateLimit <portlist(UINTLIST)> <I_CIR(0..80000)> <I_CBS(0..127)> <E_CIR(0..80000)> <E_CBS(0..127)>"},
-    {"portPriority",    doQosPortPriority,      2,  "qos set portPriority <portlist(UINTLIST)> <priority(0..7)>"},
-    {"rateLmtExMngFrm", doQosRateLimitExMngFrm, 2,  "qos set rateLmtExMngFrm <dir(0:egress)> <en(0:include,1:exclude)>"},
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T qosCmds[] =
-{
-    {"get",          doQosGet,        0,        NULL},
-    {"set",          doQosSet,        0,        NULL},
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T diagSetCmds[] =
-{
-    {"txComply",    doDiagTxComply,     2,      "diag set txComply <phy(0..5)> <mode(0..8)>"},
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T diagGetCmds[] =
-{
-    {"txComply",    doDiagTxComply,     1,      "diag get txComply <phy(0..5)>"},
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T diagCmds[] =
-{
-    {"set",         doDiagSet,          0,      NULL},
-    {"get",         doDiagGet,          0,      NULL},
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T ledSetCmds[] =
-{
-    {"mode",        doLedMode,          1,      "led set mode <mode(0:disable, 1..3:2 LED, 4:user-define)>"},
-    {"state",       doLedState,         2,      "led set state <led(0..1)> <state(1:En,0:Dis)>"},
-    {"usr",         doLedUsrDef,        4,      "led set usr <led(0..1)> <polarity(0:low, 1:high)> <on_evt(7'bin)> <blink_evt(10'bin)>"},
-    {"time",        doLedBlkTime,       1,      "led set time <time(0..5:32ms~1024ms)>"},
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T ledGetCmds[] =
-{
-    {"mode",        doLedMode,          CMD_NO_PARA,      "led get mode"},
-    {"state",       doLedState,         1,                "led get state <led(0..1)>"},
-    {"usr",         doLedUsrDef,        1,                "led get usr <led(0..1)>"},
-    {"time",        doLedBlkTime,       CMD_NO_PARA,      "led get time"},
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T ledCmds[] =
-{
-    {"set",         doLedSet,           0,      NULL},
-    {"get",         doLedGet,           0,      NULL},
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T showCmds[] =
-{
-    {"version",     doShowVersion,        0,        NULL},
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T secGetCmds[] =
-{
-    {"stormEnable",     doStormEnable,   2,  "sec get stormEnable <port(0..6)> <type(0:bcst,1:mcst,2:ucst)>"},
-    {"stormRate",       doStormRate,     2,  "sec get stormRate <port(0..6)> <type(0:bcst,1:mcst,2:ucst)>"},
-    {"fldMode",         doFldMode,       2,  "sec get fldMode <port(0..6)> <type(0:bcst,1:mcst,2:ucst,3:qury>"},
-    {"saLearning",      doSaLearning,    1,  "sec get saLearning <port(0..6)>"},
-    {"saLimit",         doSaLimit,       1,  "sec get saLimit <port(0..6)>"},
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T secSetCmds[] =
-{
-    {"stormEnable",     doStormEnable,   3,  "sec set stormEnable <port(0..6)> <type(0:bcst,1:mcst,2:ucst)> <en(1:En,0:Dis)>"},
-    {"stormRate",       doStormRate,     4,  "sec set stormRate <port(0..6)> <type(0:bcst,1:mcst,2:ucst)> <count(0..255)> <unit(0:64k,1:256k,2:1M,3:4M,4:16M)>"},
-    {"fldMode",         doFldMode,       3,  "sec set fldMode <port(0..6)> <type(0:bcst,1:mcst,2:ucst,3:qury> <en(1:En,0:Dis)>"},
-    {"saLearning",      doSaLearning,    2,  "sec set saLearning <port(0..6)> <learn(0:disable,1:enable)>"},
-    {"saLimit",         doSaLimit,       3,  "sec set saLimit <port(0..6)> <mode(0:disable,1:enable)> <count(0..4095)>"},
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T secCmds[] =
-{
-    {"get",          doSecGet,        0,        NULL},
-    {"set",          doSecSet,        0,        NULL},
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T switchSetCmds[] =
-{
-    {"cpuPortEn",   doSwitchCpuPortEn,   1,              "switch set cpuPortEn <cpu_en(1:En,0:Dis)>"},
-    {"cpuPort",     doSwitchCpuPort,     1,              "switch set cpuPort <port_number>"},
-    {"phyLCIntrEn",     doSwitchPhyLCIntrEn,     2,      "switch set phyLCIntrEn <phy(0..6)> <(1:En,0:Dis)>"},
-    {"phyLCIntrSts",    doSwitchPhyLCIntrSts,    2,      "switch set phyLCIntrSts <phy(0..6)> <(1:Clear)>"},
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T switchGetCmds[] =
-{
-    {"cpuPortEn",   doSwitchCpuPortEn,   CMD_NO_PARA,      "switch get cpuPortEn"},
-    {"cpuPort",     doSwitchCpuPort,     CMD_NO_PARA,      "switch get cpuPort"},
-    {"phyLCIntrEn",     doSwitchPhyLCIntrEn,     1,        "switch get phyLCIntrEn <phy(0..6)>"},
-    {"phyLCIntrSts",    doSwitchPhyLCIntrSts,    1,        "switch get phyLCIntrSts <phy(0..6)>"},
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T switchCmds[] =
-{
-    {"set",         doSwitchSet,        0,      NULL},
-    {"get",         doSwitchGet,        0,      NULL},
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T aclSetCmds[] =
-{
-    {"en",              doAclEn,            1,                     "acl set en <en(1:En,0:Dis)>"},
-    {"rule",            doAclRule,          CMD_VARIABLE_PARA,     "acl set rule <idx(0..127)>\n <state(0:Dis,1:En)> <reverse(0:Dis,1:En)> <end(0:Dis,1:En)>\n <portmap(7'bin)><ipv6(0:Dis,1:En,2:Not care)>\n[ dmac <dmac(12'hex)> <dmac_mask(12'hex)> ]\n[ smac <smac(12'hex)> <smac_mask(12'hex)> ]\n[ stag <stag(4'hex)> <stag_mask(4'hex)> ]\n[ ctag <ctag(4'hex)> <ctag_mask(4'hex)> ]\n[ etype <etype(4'hex)> <etype_mask(4'hex)> ]\n[ dip <dip(IPADDR)> <dip_mask(IPADDR)> ]\n[ sip <sip(IPADDR)> <sip_mask(IPADDR)> ]\n[ dscp <dscp(2'hex)> <dscp_mask(2'hex)> ]\n[ protocol <protocol(12'hex)> <protocol_mask(12'hex)> ]\n[ dport <dport(4'hex)> <dport_mask(4'hex)> ]\n[ sport <sport(4'hex)> <sport_mask(4'hex)> ]\n[ flow_label <flow_label(4'hex)> <flow_label_mask(4'hex)> ]\n[ udf <udf(4'hex)> <udf_mask(4'hex)> ] "},
-    {"udfRule",         doAclUdfRule,       7,                     "acl set udfRule <idx(0..15)> <mode(0:pattern, 1:threshold)> [ <pat(4'hex)> <mask(4'hex)> | <low(4'hex)> <high(4'hex)> ] <start(0:MAC header, 1:L2 payload, 2:IPv4 header, 3:IPv6 header, 4:L3 payload, 5:TCP header, 6:UDP header, 7: L4 payload)> <offset(0..127,unit:2 bytes)> <portmap(7'bin)>"},
-    {"action",          doAclAction,        CMD_VARIABLE_PARA,     "acl set action <idx(0..127)> \n[ forward <forward(0:Default,4:Exclude CPU,5:Include CPU,6:CPU only,7:Drop)> ]\n[ egtag <egtag(0:Default,1:Consistent,4:Untag,5:Swap,6:Tag,7:Stack)> ]\n[ mirrormap <mirrormap(2'bin)> ]\n[ priority <priority(0..7)> ]\n[ redirect <redirect(0:Dst,1:Vlan)> <portmap(7'bin)> ]\n[ leaky_vlan <leaky_vlan(1:En,0:Dis)> ]\n[ cnt_idx <cnt_idx(0..63)> ]\n[ rate_idx <rate_idx(0..31)> ] \n[ attack_idx <attack_idx(0..95)> ] \n[ vid <vid(0..4095)> ] \n[ manage <manage(1:En,0:Dis)> ] \n[ bpdu <bpdu(1:En,0:Dis)> ]\n[ class <class(0:Original,1:Defined)>[0..7] ]\n[ drop_pcd <drop_pcd(0:Original,1:Defined)> [red <red(0..7)>][yellow <yellow(0..7)>][green <green(0..7)>] ]\n[ color <color(0:Defined,1:Trtcm)> [ <defined_color(0:Dis,1:Green,2:Yellow,3:Red)> | <trtcm_idx(0..31)> ] ]"},
-    {"trtcm",           doAclTrtcm,         5,                     "acl set trtcm <idx(1..31)> <cir(4'hex)> <pir(4'hex)> <cbs(4'hex)> <pbs(4'hex)>"},
-    {"trtcmEn",         doAclTrtcmEn,       1,                     "acl set trtcmEn <en(1:En,0:Dis)>"},
-    {"portEn",          doAclPortEn,        2,                     "acl set portEn <port(0..6)> <en(1:En,0:Dis)>"},
-    {"dropEn",          doAclDropEn,        2,                     "acl set dropEn <port(0..6)> <en(1:En,0:Dis)>"},
-    {"dropThrsh",       doAclDropThrsh,     5,                     "acl set dropThrsh <port(0..6)> <color(0:green,1:yellow,2:red)> <queue(0..7)> <high(0..2047)> <low(0..2047)>"},
-    {"dropPbb",         doAclDropPbb,       4,                     "acl set dropPbb <port(0..6)> <color(0:green,1:yellow,2:red)> <queue(0..7)> <probability(0..1023)>"},
-    {"meter",           doAclMeter,         3,                     "acl set meter <idx(0..31)> <en(1:En,0:Dis)> <rate(0..65535)>\n Note: Limit rate = rate * 64Kbps"},
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T aclGetCmds[] =
-{
-    {"en",              doAclEn,            CMD_NO_PARA,    "acl get en"},
-    {"rule",            doAclRule,          1,              "acl get rule <idx(0..127)> "},
-    {"udfRule",         doAclUdfRule,       1,              "acl get udfRule <idx(0..15)>"},
-    {"action",          doAclAction,        1,              "acl get action <idx(0..127)>"},
-    {"trtcm",           doAclTrtcm,         1,              "acl get trtcm <idx(1..31)>"},
-    {"trtcmEn",         doAclTrtcmEn,       CMD_NO_PARA,    "acl get trtcmEn"},
-    {"portEn",          doAclPortEn,        1,              "acl get portEn <port(0..6)>"},
-    {"dropEn",          doAclDropEn,        1,              "acl get dropEn <port(0..6)>"},
-    {"dropThrsh",       doAclDropThrsh,     3,              "acl get dropThrsh <port(0..6)> <color(0:green,1:yellow,2:red)> <queue(0..7)>"},
-    {"dropPbb",         doAclDropPbb,       3,              "acl get dropPbb <port(0..6)> <color(0:green,1:yellow,2:red)> <queue(0..7)>"},
-    {"meter",           doAclMeter,         1,              "acl get meter <idx(0..31)>"},
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T aclDelCmds[] =
-{
-    {"rule",        doAclRmvRule,          1,         "acl del rule <idx(0..127)>"},
-    {"udfRule",     doAclRmvUdfRule,       1,         "acl del udfRule <idx(0..15)>"},
-    {"action",      doAclRmvAction,        1,         "acl del action <idx(0..127)>"},
-    {"trtcm",       doAclRmvTrtcm,         1,         "acl del trtcm <idx(0..31)>"},
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T aclClearCmds[] =
-{
-    {"rule",        doAclRmvRule,          CMD_NO_PARA,       "acl clear rule"},
-    {"udfRule",     doAclRmvUdfRule,       CMD_NO_PARA,       "acl clear udfRule"},
-    {"action",      doAclRmvAction,        CMD_NO_PARA,       "acl clear action"},
-    {"trtcm",       doAclRmvTrtcm,         CMD_NO_PARA,       "acl clear trtcm"},
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T aclCmds[] =
-{
-    {"set",         doAclSet,           0,      NULL},
-    {"get",         doAclGet,           0,      NULL},
-    {"del",         doAclDel,           0,      NULL},
-    {"clear",       doAclClear,         0,      NULL},
-    {"dump",        doAclDump,          0,      NULL},
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-static AIR_CMD_T Cmds[] =
-{
-    {"reg",         doReg,          0,      NULL},
-    {"phy",         doPhy,          0,      NULL},
-    {"port",        doPort,         0,      NULL},
-    {"vlan",        doVlan,         0,      NULL},
-    {"l2",          doL2,           0,      NULL},
-    {"lag",         doLag,          0,      NULL},
-    {"stp",         doStp,          0,      NULL},
-    {"mirror",      doMirror,       0,      NULL},
-    {"mib",         doMib,          0,      NULL},
-    {"qos",         doQos,          0,      NULL},
-    {"diag",        doDiag,         0,      NULL},
-    {"led",         doLed,          0,      NULL},
-    {"switch",      doSwitch,       0,      NULL},
-    {"show",        doShow,         0,      NULL},
-    {"sec",         doSec,          0,      NULL},
-    {"acl",         doAcl,          0,      NULL},
-    {"sptag",       doSptag,        0,      NULL},
-
-    /* last entry, do not modify this entry */
-    {NULL, NULL, 0, NULL},
-};
-
-/* EXPORTED SUBPROGRAM BODIES
-*/
-
-/* LOCAL SUBPROGRAM BODIES
-*/
-static BOOL_T
-_strcmp(const char *s1, const char *s2)
-{
-    while(*s1 == *s2++)
-        if (*s1++ == '\0')
-            return (0);
-    return (*(const unsigned char *)s1 - *(const unsigned char *)(s2 -1));
-}
-
-static C8_T *
-_strtok_r(
-    C8_T *s,
-    const C8_T *delim,
-    C8_T **last)
-{
-    char *spanp;
-    int c = 0, sc = 0;
-    char *tok;
-
-    if (s == NULL && (s = *last) == NULL)
-    {
-        return (NULL);
-    }
-
-    /*
-     * Skip (span) leading delimiters (s += strspn(s, delim), sort of).
-     */
-    for (;;)
-    {
-        c = *s++;
-        spanp = (char *)delim;
-        do
-        {
-            if (c == (sc = *spanp++))
-            {
-                break;
-            }
-        } while (sc != 0);
-        if (sc == 0)
-        {
-            break;
-        }
-    }
-
-    if (c == 0)
-    {   /* no non-delimiter characters */
-        *last = NULL;
-        return (NULL);
-    }
-    tok = s - 1;
-
-    /*
-     * Scan token (scan for delimiters: s += strcspn(s, delim), sort of).
-     * Note that delim must have one NUL; we stop if we see that, too.
-     */
-    for (;;)
-    {
-        c = *s++;
-        spanp = (char *)delim;
-        do
-        {
-            if ((sc = *spanp++) == c)
-            {
-                if (c == 0)
-                {
-                    s = NULL;
-                }
-                else
-                {
-                    s[-1] = 0;
-                }
-                *last = s;
-                return (tok);
-            }
-        } while (sc != 0);
-    }
-    /* NOTREACHED */
-}
-
-static C8_T *
-_strtok(
-    C8_T *s,
-    const C8_T *delim,
-    C8_T **last)
-{
-    return _strtok_r(s, delim, last);
-}
-
-UI32_T
-_strtoul(
-    const C8_T *cp,
-    C8_T **endp,
-    UI32_T base)
-{
-    UI32_T result = 0, value = 0;
-
-    if (!base)
-    {
-        base = 10;
-        if (*cp == '0')
-        {
-            base = 8;
-            cp++;
-            if ((TOLOWER(*cp) == 'x') && isxdigit(cp[1]))
-            {
-                cp++;
-                base = 16;
-            }
-        }
-    }
-    else if (base == 16)
-    {
-        if (cp[0] == '0' && TOLOWER(cp[1]) == 'x')
-        {
-            cp += 2;
-        }
-    }
-    while (isxdigit(*cp) &&
-           (value = isdigit(*cp) ? *cp-'0' : TOLOWER(*cp)-'a'+10) < base)
-    {
-        result = result*base + value;
-        cp++;
-    }
-    if (endp)
-    {
-        *endp = (char *)cp;
-    }
-    return result;
-}
-
-static I32_T
-_strtol(
-    const C8_T *cp,
-    C8_T **endp,
-    UI32_T base)
-{
-    if(*cp=='-')
-    {
-        return -_strtoul(cp + 1, endp, base);
-    }
-    return _strtoul(cp, endp, base);
-}
-
-static AIR_ERROR_NO_T
-_str2mac(
-        C8_T *str,
-        C8_T *mac)
-{
-    UI32_T i = 0;
-    C8_T tmpstr[3];
-
-    /* check str */
-    AIR_CHECK_PTR(str);
-    AIR_PARAM_CHK(strlen(str) != AIR_MAC_LEN, AIR_E_BAD_PARAMETER);
-    AIR_CHECK_PTR(mac);
-
-    for(i=0; i<6; i++)
-    {
-        strncpy(tmpstr, str+(i*2), 2);
-        tmpstr[2] = '\0';
-        mac[i] = _strtoul(tmpstr, NULL, 16);
-    }
-
-    return AIR_E_OK;
-}
-
-static AIR_ERROR_NO_T
-_str2ipv4(
-    const C8_T *ptr_str,
-    UI32_T     *ptr_addr)
-{
-    UI32_T value = 0, idx = 0, shift = 0;
-
-    AIR_CHECK_PTR(ptr_str);
-    AIR_CHECK_PTR(ptr_addr);
-
-    /* e.g. 192.168.1.2, strlen = 11 */
-    for (idx = 0; idx < strlen(ptr_str); idx++)
-    {
-        if (('0' <= ptr_str[idx]) && ('9' >= ptr_str[idx]))
-        {
-            value = (value * 10) + (ptr_str[idx] - '0');
-        }
-        else if ('.' == ptr_str[idx])
-        {
-            CMD_CHECK_PARA(value, <, 256); /* Error: invalid value */
-            CMD_CHECK_PARA(shift, <, 4);   /* Error: mem-overwrite */
-            *ptr_addr |= value << (24 - shift * 8);
-            shift += 1;
-            value = 0;
-        }
-        else
-        {
-            return AIR_E_BAD_PARAMETER; /* Error: not a digit number or dot */
-        }
-    }
-    CMD_CHECK_PARA(value, <, 256); /* Error: invalid value */
-    CMD_CHECK_PARA(shift, ==, 3);  /* Error: not an ipv4 addr */
-    *ptr_addr |= value << (24 - shift * 8);
-
-    return AIR_E_OK;
-}
-
-AIR_ERROR_NO_T
-_str2ipv6(
-    const C8_T  *ptr_str,
-    UI8_T       *ptr_addr)
-{
-    UI32_T              hex_value = 0, dec_value = 0, idx = 0;
-    BOOL_T              double_colon = FALSE, ipv4_compatible = FALSE;
-    UI32_T              double_colon_pos = 0, last_pos = 0;
-    UI8_T               tmp_ipv6[16] = {0};
-
-    AIR_CHECK_PTR(ptr_str);
-    AIR_CHECK_PTR(ptr_addr);
-
-    /* e.g. invalid:
-     * 3ffe::c0a8:0:      last cannot be colon except double-colon
-     * 3ffe:::c0a8:0      triple-colon
-     * 3ffe::c0a8::0      two double-colons
-     */
-
-    /* e.g. valid:
-     * 3ffe::c0a8:0       strlen = 12 (double-colon in middle)
-     * 3ffe:c0a8:0::      strlen = 13 (double-colon in last)
-     * ::3ffe:c0a8:0      strlen = 13 (double-colon in first)
-     * 3ffe::192.168.0.0  strlen = 17 (IPv4-compatible address)
-     */
-    for (idx = 0; idx < strlen(ptr_str); idx++)
-    {
-        if (('0' <= ptr_str[idx]) && ('9' >= ptr_str[idx]))
-        {
-            hex_value = (hex_value << 4) + (ptr_str[idx] - '0');
-            dec_value = (dec_value * 10) + (ptr_str[idx] - '0');
-        }
-        else if (('a' <= ptr_str[idx]) && ('f' >= ptr_str[idx]))
-        {
-            hex_value = (hex_value << 4) + (ptr_str[idx] - 'a') + 10;
-        }
-        else if (('A' <= ptr_str[idx]) && ('F' >= ptr_str[idx]))
-        {
-            hex_value = (hex_value << 4) + (ptr_str[idx] - 'A') + 10;
-        }
-        else if (':' == ptr_str[idx])
-        {
-            /* must belong to double-colon, calculate from last */
-            if (0 == idx)
-            {
-                continue;
-            }
-            /* not the first ch but a double-colon */
-            else if (':' == ptr_str[idx - 1])
-            {
-                CMD_CHECK_PARA(double_colon, ==, FALSE); /* Error: triple-colon or two double-colons */
-                double_colon = TRUE;
-            }
-            /* not the first ch and a double-colon */
-            else
-            {
-                CMD_CHECK_PARA(double_colon_pos, <, 15); /* Error: only 16 units for UI8_T  */
-                CMD_CHECK_PARA(last_pos,         <, 15); /* Error: only 16 units for UI8_T  */
-                tmp_ipv6[last_pos]     = (UI8_T)((hex_value >> 8) & 0xff);
-                tmp_ipv6[last_pos + 1] = (UI8_T)((hex_value >> 0) & 0xff);
-                double_colon_pos += (FALSE == double_colon)? 2 : 0;
-                last_pos += 2;
-                hex_value = 0;
-                dec_value = 0;
-            }
-        }
-        else if ('.' == ptr_str[idx])
-        {
-            CMD_CHECK_PARA(last_pos, <, 16); /* Error: only 16 units for UI8_T  */
-            tmp_ipv6[last_pos] = dec_value;
-            last_pos += 1;
-            dec_value = 0;
-            ipv4_compatible = TRUE;
-        }
-        else
-        {
-            return AIR_E_BAD_PARAMETER; /* Error: not a hex number or colon */
-        }
-    }
-
-    /* last data */
-    if (':' != ptr_str[idx - 1])
-    {
-        if (FALSE == ipv4_compatible)
-        {
-            CMD_CHECK_PARA(last_pos, <, 15); /* Error: only 16 units for UI8_T  */
-            tmp_ipv6[last_pos]     = (UI8_T)((hex_value >> 8) & 0xff);
-            tmp_ipv6[last_pos + 1] = (UI8_T)((hex_value >> 0) & 0xff);
-            last_pos += 2;
-        }
-        else
-        {
-            CMD_CHECK_PARA(last_pos, <, 16); /* Error: only 16 units for UI8_T  */
-            tmp_ipv6[last_pos] = dec_value;
-            last_pos += 1;
-        }
-    }
-    else
-    {
-        if (':' != ptr_str[idx - 2])
-        {
-            return AIR_E_BAD_PARAMETER; /* Error: last cannot be colon except double-colon */
-        }
-    }
-
-    /* move tmp_ipv6 to ptr_value */
-    if (TRUE == double_colon)
-    {
-        /* e.g.
-         * 3ffe::c0a8:0       double_colon_pos = 2, last_pos = 4+2, tmp_ipv6 = {3f,fe,c0,a8,00,00,...}
-         * 3ffe:c0a8:0::      double_colon_pos = 6, last_pos = 6,   tmp_ipv6 = {3f,fe,c0,a8,00,00,...}
-         * ::3ffe:c0a8:0      double_colon_pos = 0, last_pos = 4+2, tmp_ipv6 = {3f,fe,c0,a8,00,00,...}
-         * 3ffe::192.168.0.0  double_colon_pos = 2, last_pos = 5+1, tmp_ipv6 = {3f,fe,c0,a8,00,00,...}
-         *
-         *                                 0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
-         * 3ffe::c0a8:0       ptr_value = {3f,fe,--,--,--,--,--,--,--,--,--,--,--,--,--,--}
-         * 3ffe:c0a8:0::      ptr_value = {3f,fe,c0,a8,00,00,--,--,--,--,--,--,--,--,--,--}
-         * ::3ffe:c0a8:0      ptr_value = {--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--}
-         * 3ffe::192.168.0.0  ptr_value = {3f,fe,--,--,--,--,--,--,--,--,--,--,--,--,--,--}
-         */
-        for (idx = 0; idx < double_colon_pos; idx++)
-        {
-            ptr_addr[idx] = tmp_ipv6[idx];
-        }
-        /* e.g.
-         *                                 0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
-         * 3ffe::c0a8:0       ptr_value = {3f,fe,--,--,--,--,--,--,--,--,--,--,c0,a8,00,00}
-         * 3ffe:c0a8:0::      ptr_value = {3f,fe,c0,a8,00,00,--,--,--,--,--,--,--,--,--,--}
-         * ::3ffe:c0a8:0      ptr_value = {--,--,--,--,--,--,--,--,--,--,3f,fe,c0,a8,00,00}
-         * 3ffe::192.168.0.0  ptr_value = {3f,fe,--,--,--,--,--,--,--,--,--,--,c0,a8,00,00}
-         */
-        for (idx = double_colon_pos; idx < last_pos; idx++)
-        {
-            ptr_addr[16 - (last_pos - idx)] = tmp_ipv6[idx];
-        }
-    }
-    else
-    {
-        for (idx = 0; idx < 16; idx++)
-        {
-            ptr_addr[idx] = tmp_ipv6[idx];
-        }
-    }
-
-    return AIR_E_OK;
-}
-
-void
-_showIpv6Str(
-    const UI8_T *ptr_ipv6,
-    C8_T *ptr_str)
-{
-    UI32_T idx = 0, next = 0, last = 16;
-    UI32_T cont_zero = 0;
-
-    while (idx < last)
-    {
-        if ((0 == cont_zero) && (0 == ptr_ipv6[idx]) && (0 == ptr_ipv6[idx + 1]))
-        {
-            next = idx + 2;
-
-            while (next < last)
-            {
-                if ((ptr_ipv6[next]) || (ptr_ipv6[next + 1]))
-                {
-                    AIR_PRINT(
-                            ptr_str + strlen(ptr_str),
-                            40 - strlen(ptr_str),
-                            "%s", (cont_zero) ? (":") : (":0"));
-                    break;
-                }
-
-                if (0 == cont_zero)
-                {
-                    cont_zero = 1;
-                }
-                next += 2;
-            }
-
-            if (next == last)
-            {
-
-                AIR_PRINT(
-                        ptr_str + strlen(ptr_str),
-                        40 - strlen(ptr_str),
-                        "%s", (cont_zero) ? ("::") : (":0"));
-            }
-
-            idx = next;
-        }
-        else
-        {
-            if (idx)
-            {
-                AIR_PRINT(
-                    ptr_str + strlen(ptr_str),
-                    40 - strlen(ptr_str),
-                    ":");
-            }
-
-            if (ptr_ipv6[idx])
-            {
-                AIR_PRINT(
-                    ptr_str + strlen(ptr_str),
-                    40 - strlen(ptr_str),
-                    "%0x%02x", ptr_ipv6[idx], ptr_ipv6[idx + 1]);
-            }
-            else
-            {
-                AIR_PRINT(
-                    ptr_str + strlen(ptr_str),
-                    40 - strlen(ptr_str),
-                    "%0x", ptr_ipv6[idx + 1]);
-            }
-
-            idx += 2;
-        }
-    }
-}
-
-static AIR_ERROR_NO_T
-_hex2bit(
-        const UI32_T hex,
-        UI32_T *ptr_bit)
-{
-    UI32_T i = 0;
-
-    /* Mistake proofing */
-    AIR_CHECK_PTR(ptr_bit);
-
-    (*ptr_bit) = 0;
-    for(i=0; i<AIR_MAX_NUM_OF_PORTS; i++)
-    {
-        if(hex & BIT(i))
-        {
-            (*ptr_bit) |= BITS_OFF_L(1UL, 4*(AIR_MAX_NUM_OF_PORTS - i - 1), 4);
-        }
-    }
-    return AIR_E_OK;
-}
-
-static AIR_ERROR_NO_T
-_hex2bitstr(
-        const UI32_T hex,
-        C8_T *ptr_bit_str,
-        UI32_T str_len)
-{
-    UI32_T i = 0;
-    C8_T str_bitmap[AIR_MAX_NUM_OF_PORTS+1];
-
-    /* Mistake proofing */
-    AIR_CHECK_PTR(ptr_bit_str);
-    AIR_PARAM_CHK(str_len <= AIR_MAX_NUM_OF_PORTS, AIR_E_BAD_PARAMETER);
-
-    memset(str_bitmap, 0, AIR_MAX_NUM_OF_PORTS+1);
-
-    for(i=0; i<AIR_MAX_NUM_OF_PORTS; i++)
-    {
-        if(hex & BIT(i))
-        {
-            str_bitmap[i] = '1';
-        }
-        else
-        {
-            str_bitmap[i] = '-';
-        }
-    }
-    str_bitmap[i] = '\0';
-    strncpy(ptr_bit_str, str_bitmap, i+1);
-
-    return AIR_E_OK;
-}
-
-static AIR_ERROR_NO_T
-_portListStr2Ary(
-    const C8_T *str,
-    UI32_T *ary,
-    const UI32_T ary_num)
-{
-    UI32_T i = 0;
-    UI32_T str_len = 0;
-    UI32_T val = 0;
-    C8_T *str2;
-    C8_T *pch;
-    C8_T *last;
-
-    /* Mistake proofing */
-    AIR_CHECK_PTR(str);
-    AIR_CHECK_PTR(ary);
-    AIR_PARAM_CHK(0 == ary_num, AIR_E_BAD_PARAMETER);
-
-    /* Allocate new string */
-    str_len = strlen(str);
-    str2 = AIR_MALLOC(str_len+1);
-    AIR_CHECK_PTR(str2);
-    memset(str2, 0, str_len+1);
-    strncpy(str2, str, str_len+1);
-
-    /* clear array */
-    memset(ary, 0, ary_num*4);
-
-    /* split string by ',' */
-    pch = _strtok(str2, ",", &last);
-    while(NULL != pch)
-    {
-        val = _strtoul(pch, NULL, 0);
-        ary[val/32] |= BIT(val%32);
-        pch = _strtok(NULL, ",", &last);
-    }
-
-    AIR_FREE(str2);
-    return AIR_E_OK;
-}
-
-static AIR_ERROR_NO_T
-doRegRead(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    UI32_T reg = 0, val = 0;
-
-    reg = _strtoul(argv[0], NULL, 16);
-    aml_readReg(0, reg, &val);
-    AIR_PRINT("Read reg=0x%x, value=0x%x\n", reg, val);
-
-    return AIR_E_OK;
-}
-
-static AIR_ERROR_NO_T
-doRegWrite(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    UI32_T reg = 0, val = 0;
-
-    reg = _strtoul(argv[0], NULL, 16);
-    val = _strtoul(argv[1], NULL, 16);
-    aml_writeReg(0, reg, val);
-    AIR_PRINT("Write reg=0x%x, value=0x%x\n", reg, val);
-
-    return AIR_E_OK;
-}
-
-static AIR_ERROR_NO_T
-doReg(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(regCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doPhyCL22Read(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    UI32_T port = 0, reg = 0, val = 0;
-
-    port = _strtoul(argv[0], NULL, 0);
-    reg  = _strtoul(argv[1], NULL, 16);
-    aml_readPhyReg(0, port, reg, &val);
-    AIR_PRINT("Phy read port=%d, reg=0x%x, value=0x%x\n", port, reg, val);
-
-    return AIR_E_OK;
-}
-
-static AIR_ERROR_NO_T
-doPhyCL22Write(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    UI32_T port = 0, reg = 0, val = 0;
-
-    port = _strtoul(argv[0], NULL, 0);
-    reg  = _strtoul(argv[1], NULL, 16);
-    val  = _strtoul(argv[2], NULL, 16);
-    aml_writePhyReg(0, port, reg, val);
-    AIR_PRINT("Phy write port=%d, reg=0x%x, value=0x%x\n", port, reg, val);
-
-    return AIR_E_OK;
-}
-
-static AIR_ERROR_NO_T
-doPhyCL22(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(phyCL22Cmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doPhyCL45Read(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    UI32_T port = 0, dev = 0, reg = 0, val = 0;
-
-    port = _strtoul(argv[0], NULL, 0);
-    dev  = _strtoul(argv[1], NULL, 16);
-    reg  = _strtoul(argv[2], NULL, 16);
-    aml_readPhyRegCL45(0, port, dev, reg, &val);
-    AIR_PRINT("Phy read port=%d, dev=0x%x, reg=0x%x, value=0x%x\n", port, dev, reg, val);
-
-    return AIR_E_OK;
-}
-
-static AIR_ERROR_NO_T
-doPhyCL45Write(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    UI32_T port = 0, dev = 0, reg = 0, val = 0;
-
-    port = _strtoul(argv[0], NULL, 0);
-    dev  = _strtoul(argv[1], NULL, 16);
-    reg  = _strtoul(argv[2], NULL, 16);
-    val  = _strtoul(argv[3], NULL, 16);
-    aml_writePhyRegCL45(0, port, dev, reg, val);
-    AIR_PRINT("Phy write port=%d, dev=0x%x, reg=0x%x, value=0x%x\n", port, dev, reg, val);
-
-    return AIR_E_OK;
-}
-
-static AIR_ERROR_NO_T
-doPhyCL45(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(phyCL45Cmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doPhy(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(phyCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doPortSetMatrix(UI32_T argc, C8_T *argv[])
-{
-    UI32_T port = 0;
-    UI32_T matrix = 0;
-    AIR_ERROR_NO_T rc = AIR_E_OK;
-
-    port   = _strtoul(argv[0], NULL, 0);
-    matrix = _strtoul(argv[1], NULL, 16);
-    rc = air_port_setPortMatrix(0, port, matrix);
-    if (rc != AIR_E_OK)
-    {
-        AIR_PRINT("Error: Operation failed!\n");
-    }
-    return rc;
-}
-
-static AIR_ERROR_NO_T
-doPortSetVlanMode(UI32_T argc, C8_T *argv[])
-{
-    UI32_T port = 0;
-    AIR_PORT_VLAN_MODE_T vlan_mode;
-    AIR_ERROR_NO_T rc = AIR_E_OK;
-
-    port      = _strtoul(argv[0], NULL, 0);
-    vlan_mode = _strtoul(argv[1], NULL, 0);
-    rc = air_port_setVlanMode(0, port, vlan_mode);
-    if (rc != AIR_E_OK)
-    {
-        AIR_PRINT("Error: Operation failed!\n");
-    }
-    return rc;
-}
-
-static AIR_ERROR_NO_T
-doPortSet(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(portSetCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doPortGetMatrix(UI32_T argc, C8_T *argv[])
-{
-    UI32_T port = 0;
-    UI32_T matrix = 0;
-    AIR_ERROR_NO_T rc = AIR_E_OK;
-
-    port = _strtoul(argv[0], NULL, 0);
-    rc = air_port_getPortMatrix(0, port, &matrix);
-    if (rc != AIR_E_OK)
-    {
-        AIR_PRINT("Error: Operation failed!\n");
-        return rc;
-    }
-    AIR_PRINT("Port %d Matrix: %2x\n", port, matrix);
-    return rc;
-}
-
-static AIR_ERROR_NO_T
-doPortGetVlanMode(UI32_T argc, C8_T *argv[])
-{
-    UI32_T port = 0;
-    AIR_PORT_VLAN_MODE_T vlan_mode;
-    AIR_ERROR_NO_T rc = AIR_E_OK;
-
-    port = _strtoul(argv[0], NULL, 0);
-    rc = air_port_getVlanMode(0, port, &vlan_mode);
-    if (rc != AIR_E_OK)
-    {
-        AIR_PRINT("Error: Operation failed!\n");
-        return rc;
-    }
-    AIR_PRINT("Port %d Vlan Mode: ", port);
-    switch(vlan_mode)
-    {
-        case AIR_PORT_VLAN_MODE_PORT_MATRIX:
-            AIR_PRINT("matrix(%d)\n", vlan_mode);
-            break;
-        case AIR_PORT_VLAN_MODE_FALLBACK:
-            AIR_PRINT("fallback(%d)\n", vlan_mode);
-            break;
-        case AIR_PORT_VLAN_MODE_CHECK:
-            AIR_PRINT("check(%d)\n", vlan_mode);
-            break;
-        case AIR_PORT_VLAN_MODE_SECURITY:
-            AIR_PRINT("security(%d)\n", vlan_mode);
-            break;
-        default:
-            AIR_PRINT("unknown(%d)\n", vlan_mode);
-            break;
-    };
-    return rc;
-}
-
-static AIR_ERROR_NO_T
-doPortGet(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(portGetCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doPort(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(portCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doVlanInitiate(UI32_T argc, C8_T *argv[])
-{
-    UI16_T vid = 0;
-    AIR_VLAN_ENTRY_ATTR_T vlan_entry = {0};
-    AIR_ERROR_NO_T rc = AIR_E_OK;
-
-    vid = _strtoul(argv[0], NULL, 0);
-    if (9 == argc)
-    {
-        vlan_entry.vlan_entry_format.fid           = _strtoul(argv[1], NULL, 0);
-        vlan_entry.vlan_entry_format.port_mem      = _strtoul(argv[2], NULL, 0);
-        vlan_entry.vlan_entry_format.ivl           = _strtoul(argv[3], NULL, 0);
-        vlan_entry.vlan_entry_format.port_stag     = _strtoul(argv[4], NULL, 0);
-        vlan_entry.vlan_entry_format.stag          = _strtoul(argv[5], NULL, 0);
-        vlan_entry.vlan_entry_format.eg_ctrl_en    = _strtoul(argv[6], NULL, 0);
-        vlan_entry.vlan_entry_format.eg_con        = _strtoul(argv[7], NULL, 0);
-        vlan_entry.vlan_entry_format.eg_ctrl       = _strtoul(argv[8], NULL, 0);
-
-        rc = air_vlan_create(0, vid, &vlan_entry);
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        rc = AIR_E_BAD_PARAMETER;
-    }
-
-    switch (rc)
-    {
-        case     AIR_E_OK:                                                            break;
-        case     AIR_E_ENTRY_EXISTS:  AIR_PRINT("VLAN already exist!\n");             break;
-        default:                      AIR_PRINT("Error %d: Operation failed!\n", rc); break;
-    }
-    return rc;
-}
-
-static AIR_ERROR_NO_T
-doVlanCreate(UI32_T argc, C8_T *argv[])
-{
-    UI16_T vid = 0;
-    AIR_ERROR_NO_T rc = AIR_E_OK;
-
-    vid = _strtoul(argv[0], NULL, 0);
-    rc  = air_vlan_create(0, vid, NULL);
-
-    switch (rc)
-    {
-        case     AIR_E_OK:                                                            break;
-        case     AIR_E_ENTRY_EXISTS:  AIR_PRINT("VLAN already exist!\n");             break;
-        default:                      AIR_PRINT("Error %d: Operation failed!\n", rc); break;
-    }
-    return rc;
-}
-
-static AIR_ERROR_NO_T
-doVlanDestroy(UI32_T argc, C8_T *argv[])
-{
-    C8_T *token = NULL;
-    UI16_T vid = 0, vid_limit = AIR_VLAN_ID_MAX;
-    AIR_ERROR_NO_T rc = AIR_E_OK;
-
-    if (argc > 0)
-    {
-        if (isdigit(argv[0][0]))
-        {
-            token = _strtok(argv[0], "-", &argv[0]);
-            vid = _strtoul(token, NULL, 0);
-            if ((token = _strtok(argv[0], "-", &argv[0])))
-                vid_limit = _strtoul(token, NULL, 0);
-            else
-                vid_limit = vid;
-            if (AIR_VLAN_ID_MAX < vid_limit)
-            {
-                AIR_PRINT("vid number should less than %d!\n", AIR_VLAN_ID_MAX);
-                return AIR_E_BAD_PARAMETER;
-            }
-            if (vid > vid_limit)
-            {
-                AIR_PRINT("vid0 should less than vid1!\n");
-                return AIR_E_BAD_PARAMETER;
-            }
-        }
-        else
-        {
-            AIR_PRINT("Bad parameter!\n");
-            return AIR_E_BAD_PARAMETER;
-        }
-    }
-
-    for (; vid <= vid_limit; vid++)
-    {
-        rc = air_vlan_destroy(0, vid);
-    }
-    return rc;
-}
-
-static AIR_ERROR_NO_T
-doVlanDestroyAll(UI32_T argc, C8_T *argv[])
-{
-    UI32_T restore_def_vlan = 0;
-    AIR_ERROR_NO_T rc = AIR_E_OK;
-
-    if (argc > 0)
-    {
-        restore_def_vlan = _strtoul(argv[0], NULL, 0);
-    }
-
-    rc = air_vlan_destroyAll(0, restore_def_vlan);
-    if (rc != AIR_E_OK)
-    {
-        AIR_PRINT("Error: Operation failed!\n");
-    }
-    return rc;
-}
-
-static AIR_ERROR_NO_T
-doVlanDump(UI32_T argc, C8_T *argv[])
-{
-    C8_T *token = NULL;
-    UI16_T port = 0, valid_count = 0, vid = 0, vid_limit = AIR_VLAN_ID_MAX;
-    AIR_PORT_EGS_TAG_ATTR_T tag_ctl[AIR_MAX_NUM_OF_PORTS] = {0};
-    AIR_VLAN_ENTRY_T vlan_entry = {0};
-
-    if (argc > 0)
-    {
-        if (isdigit(argv[0][0]))
-        {
-            token = _strtok(argv[0], "-", &argv[0]);
-            vid = _strtoul(token, NULL, 0);
-            if ((token = _strtok(argv[0], "-", &argv[0])))
-                vid_limit = _strtoul(token, NULL, 0);
-            else
-                vid_limit = vid;
-            if (AIR_VLAN_ID_MAX < vid_limit)
-            {
-                AIR_PRINT("vid number should less than %d!\n", AIR_VLAN_ID_MAX);
-                return AIR_E_BAD_PARAMETER;
-            }
-            if (vid > vid_limit)
-            {
-                AIR_PRINT("vid0 should less than vid1!\n");
-                return AIR_E_BAD_PARAMETER;
-            }
-        }
-        else
-        {
-            AIR_PRINT("Bad parameter!\n");
-            return AIR_E_BAD_PARAMETER;
-        }
-    }
-
-    for (valid_count = 0; vid <= vid_limit; vid++)
-    {
-        _air_vlan_readEntry(0, vid, &vlan_entry);
-        if (vlan_entry.valid)
-        {
-            valid_count++;
-            if (1 == valid_count)
-                AIR_PRINT(" Vid Fid MemPort Ivl PortBaseStag Stag EgsTagCtlEn EgsTagCon EgsTagCtl\n======================================================================\n");
-            for (port = 0; port < AIR_MAX_NUM_OF_PORTS; port++)
-                tag_ctl[port] = (vlan_entry.vlan_entry_format.eg_ctrl >> (port * 2)) & 0x3;
-            AIR_PRINT("%4d %3d      %2x %3d %12d %4d %11d %9d   %1x%1x%1x%1x%1x%1x%1x\n",
-                vid, vlan_entry.vlan_entry_format.fid, vlan_entry.vlan_entry_format.port_mem, vlan_entry.vlan_entry_format.ivl,
-                vlan_entry.vlan_entry_format.port_stag, vlan_entry.vlan_entry_format.stag, vlan_entry.vlan_entry_format.eg_ctrl_en, vlan_entry.vlan_entry_format.eg_con,
-                tag_ctl[6], tag_ctl[5], tag_ctl[4], tag_ctl[3], tag_ctl[2], tag_ctl[1], tag_ctl[0]);
-        }
-    }
-
-    if (!valid_count)
-        AIR_PRINT("not found!\n");
-    else
-        AIR_PRINT("Found %d valid entries!\n", valid_count);
-
-    return AIR_E_OK;
-}
-
-static AIR_ERROR_NO_T
-doVlanAddPortMem(UI32_T argc, C8_T *argv[])
-{
-    UI16_T vid = 0, port = 0;
-    AIR_ERROR_NO_T rc = AIR_E_OK;
-
-    vid  = _strtoul(argv[0], NULL, 0);
-    port = _strtoul(argv[1], NULL, 0);
-    rc = air_vlan_addMemberPort(0, vid, port);
-    switch (rc)
-    {
-        case     AIR_E_OK:                                                               break;
-        case     AIR_E_ENTRY_NOT_FOUND:  AIR_PRINT("VLAN not found!\n");                 break;
-        default:                         AIR_PRINT("Error %d: Operation failed!\n", rc); break;
-    }
-    return rc;
-}
-
-static AIR_ERROR_NO_T
-doVlanDelPortMem(UI32_T argc, C8_T *argv[])
-{
-    UI16_T vid = 0, port = 0;
-    AIR_ERROR_NO_T rc = AIR_E_OK;
-
-    vid  = _strtoul(argv[0], NULL, 0);
-    port = _strtoul(argv[1], NULL, 0);
-    rc = air_vlan_delMemberPort(0, vid, port);
-    switch (rc)
-    {
-        case     AIR_E_OK:                                                               break;
-        case     AIR_E_ENTRY_NOT_FOUND:  AIR_PRINT("VLAN not found!\n");                 break;
-        default:                         AIR_PRINT("Error %d: Operation failed!\n", rc); break;
-    }
-    return rc;
-}
-
-static AIR_ERROR_NO_T
-doVlanSetFid(UI32_T argc, C8_T *argv[])
-{
-    UI16_T vid = 0;
-    UI8_T  fid = 0;
-    AIR_ERROR_NO_T rc = AIR_E_OK;
-
-    vid = _strtoul(argv[0], NULL, 0);
-    fid = _strtoul(argv[1], NULL, 0);
-    rc = air_vlan_setFid(0, vid, fid);
-    switch (rc)
-    {
-        case     AIR_E_OK:                                                               break;
-        case     AIR_E_ENTRY_NOT_FOUND:  AIR_PRINT("VLAN not found!\n");                 break;
-        default:                         AIR_PRINT("Error %d: Operation failed!\n", rc); break;
-    }
-    return rc;
-}
-
-static AIR_ERROR_NO_T
-doVlanSetMemPort(UI32_T argc, C8_T *argv[])
-{
-    UI16_T vid = 0, port_bitmap = 0;
-    AIR_ERROR_NO_T rc = AIR_E_OK;
-
-    vid         = _strtoul(argv[0], NULL, 0);
-    port_bitmap = _strtoul(argv[1], NULL, 16);
-    rc = air_vlan_setMemberPort(0, vid, port_bitmap);
-    switch (rc)
-    {
-        case     AIR_E_OK:                                                               break;
-        case     AIR_E_ENTRY_NOT_FOUND:  AIR_PRINT("VLAN not found!\n");                 break;
-        default:                         AIR_PRINT("Error %d: Operation failed!\n", rc); break;
-    }
-    return rc;
-}
-
-static AIR_ERROR_NO_T
-doVlanSetIVL(UI32_T argc, C8_T *argv[])
-{
-    UI16_T vid = 0;
-    BOOL_T enable = TRUE;
-    AIR_ERROR_NO_T rc = AIR_E_OK;
-
-    vid    = _strtoul(argv[0], NULL, 0);
-    enable = _strtoul(argv[1], NULL, 0);
-    rc = air_vlan_setIVL(0, vid, enable);
-    switch (rc)
-    {
-        case     AIR_E_OK:                                                               break;
-        case     AIR_E_ENTRY_NOT_FOUND:  AIR_PRINT("VLAN not found!\n");                 break;
-        default:                         AIR_PRINT("Error %d: Operation failed!\n", rc); break;
-    }
-    return rc;
-}
-
-static AIR_ERROR_NO_T
-doVlanSetPortBaseStag(UI32_T argc, C8_T *argv[])
-{
-    UI16_T vid = 0;
-    BOOL_T enable = TRUE;
-    AIR_ERROR_NO_T rc = AIR_E_OK;
-
-    vid    = _strtoul(argv[0], NULL, 0);
-    enable = _strtoul(argv[1], NULL, 0);
-    rc = air_vlan_setPortBasedStag(0, vid, enable);
-    switch (rc)
-    {
-        case     AIR_E_OK:                                                               break;
-        case     AIR_E_ENTRY_NOT_FOUND:  AIR_PRINT("VLAN not found!\n");                 break;
-        default:                         AIR_PRINT("Error %d: Operation failed!\n", rc); break;
-    }
-    return rc;
-}
-
-static AIR_ERROR_NO_T
-doVlanSetStag(UI32_T argc, C8_T *argv[])
-{
-    UI16_T vid = 0, stag = 0;
-    AIR_ERROR_NO_T rc = AIR_E_OK;
-
-    vid  = _strtoul(argv[0], NULL, 0);
-    stag = _strtoul(argv[1], NULL, 0);
-    rc = air_vlan_setServiceTag(0, vid, stag);
-    switch (rc)
-    {
-        case     AIR_E_OK:                                                               break;
-        case     AIR_E_ENTRY_NOT_FOUND:  AIR_PRINT("VLAN not found!\n");                 break;
-        default:                         AIR_PRINT("Error %d: Operation failed!\n", rc); break;
-    }
-    return rc;
-}
-
-static AIR_ERROR_NO_T
-doVlanSetEgsTagCtlEn(UI32_T argc, C8_T *argv[])
-{
-    UI16_T vid = 0;
-    BOOL_T enable = TRUE;
-    AIR_ERROR_NO_T rc = AIR_E_OK;
-
-    vid    = _strtoul(argv[0], NULL, 0);
-    enable = _strtoul(argv[1], NULL, 0);
-    rc = air_vlan_setEgsTagCtlEnable(0, vid, enable);
-    switch (rc)
-    {
-        case     AIR_E_OK:                                                               break;
-        case     AIR_E_ENTRY_NOT_FOUND:  AIR_PRINT("VLAN not found!\n");                 break;
-        default:                         AIR_PRINT("Error %d: Operation failed!\n", rc); break;
-    }
-    return rc;
-}
-
-static AIR_ERROR_NO_T
-doVlanSetEgsTagCtlCon(UI32_T argc, C8_T *argv[])
-{
-    UI16_T vid = 0;
-    BOOL_T enable = TRUE;
-    AIR_ERROR_NO_T rc = AIR_E_OK;
-
-    vid    = _strtoul(argv[0], NULL, 0);
-    enable = _strtoul(argv[1], NULL, 0);
-    rc = air_vlan_setEgsTagConsistent(0, vid, enable);
-    switch (rc)
-    {
-        case     AIR_E_OK:                                                               break;
-        case     AIR_E_ENTRY_NOT_FOUND:  AIR_PRINT("VLAN not found!\n");                 break;
-        default:                         AIR_PRINT("Error %d: Operation failed!\n", rc); break;
-    }
-    return rc;
-}
-
-static AIR_ERROR_NO_T
-doVlanSetEgsTagCtl(UI32_T argc, C8_T *argv[])
-{
-    UI16_T vid = 0, port = 0;
-    AIR_PORT_EGS_TAG_ATTR_T tag_ctl = AIR_PORT_EGS_TAG_ATTR_UNTAGGED;
-    AIR_ERROR_NO_T rc = AIR_E_OK;
-
-    vid     = _strtoul(argv[0], NULL, 0);
-    port    = _strtoul(argv[1], NULL, 0);
-    tag_ctl = _strtoul(argv[2], NULL, 0);
-    rc = air_vlan_setPortEgsTagCtl(0, vid, port, tag_ctl);
-    switch (rc)
-    {
-        case     AIR_E_OK:                                                               break;
-        case     AIR_E_ENTRY_NOT_FOUND:  AIR_PRINT("VLAN not found!\n");                 break;
-        default:                         AIR_PRINT("Error %d: Operation failed!\n", rc); break;
-    }
-    return rc;
-}
-
-static AIR_ERROR_NO_T
-doVlanSetPortActFrame(UI32_T argc, C8_T *argv[])
-{
-    UI16_T port = 0;
-    AIR_VLAN_ACCEPT_FRAME_TYPE_T type = AIR_VLAN_ACCEPT_FRAME_TYPE_ALL;
-    AIR_ERROR_NO_T rc = AIR_E_OK;
-
-    port = _strtoul(argv[0], NULL, 0);
-    type = _strtoul(argv[1], NULL, 0);
-    rc = air_vlan_setPortAcceptFrameType(0, port, type);
-    if (rc != AIR_E_OK)
-    {
-        AIR_PRINT("Error: Operation failed!\n");
-    }
-    return rc;
-}
-
-static AIR_ERROR_NO_T
-doVlanSetLeakyVlanEn(UI32_T argc, C8_T *argv[])
-{
-    UI16_T port = 0;
-    AIR_LEAKY_PKT_TYPE_T pkt_type = AIR_LEAKY_PKT_TYPE_UNICAST;
-    BOOL_T enable = TRUE;
-    AIR_ERROR_NO_T rc = AIR_E_OK;
-
-    port     = _strtoul(argv[0], NULL, 0);
-    pkt_type = _strtoul(argv[1], NULL, 0);
-    enable   = _strtoul(argv[2], NULL, 0);
-    rc = air_vlan_setPortLeakyVlanEnable(0, port, pkt_type, enable);
-    if (rc != AIR_E_OK)
-    {
-        AIR_PRINT("Error: Operation failed!\n");
-    }
-    return rc;
-}
-
-static AIR_ERROR_NO_T
-doVlanSetPortVlanAttr(UI32_T argc, C8_T *argv[])
-{
-    UI16_T port = 0;
-    AIR_VLAN_PORT_ATTR_T attr = AIR_VLAN_PORT_ATTR_USER_PORT;
-    AIR_ERROR_NO_T rc = AIR_E_OK;
-
-    port = _strtoul(argv[0], NULL, 0);
-    attr = _strtoul(argv[1], NULL, 0);
-    rc = air_vlan_setPortAttr(0, port, attr);
-    if (rc != AIR_E_OK)
-    {
-        AIR_PRINT("Error: Operation failed!\n");
-    }
-    return rc;
-}
-
-static AIR_ERROR_NO_T
-doVlanSetIgsPortETagAttr(UI32_T argc, C8_T *argv[])
-{
-    UI16_T port = 0;
-    AIR_IGR_PORT_EG_TAG_ATTR_T attr = AIR_IGR_PORT_EG_TAG_ATTR_DISABLE;
-    AIR_ERROR_NO_T rc = AIR_E_OK;
-
-    port = _strtoul(argv[0], NULL, 0);
-    attr = _strtoul(argv[1], NULL, 0);
-    rc = air_vlan_setIgrPortTagAttr(0, port, attr);
-    if (rc != AIR_E_OK)
-    {
-        AIR_PRINT("Error: Operation failed!\n");
-    }
-    return rc;
-}
-
-static AIR_ERROR_NO_T
-doVlanSetPortETagAttr(UI32_T argc, C8_T *argv[])
-{
-    UI16_T port = 0;
-    AIR_PORT_EGS_TAG_ATTR_T attr = AIR_PORT_EGS_TAG_ATTR_UNTAGGED;
-    AIR_ERROR_NO_T rc = AIR_E_OK;
-
-    port = _strtoul(argv[0], NULL, 0);
-    attr = _strtoul(argv[1], NULL, 0);
-    rc = air_vlan_setPortEgsTagAttr(0, port, attr);
-    if (rc != AIR_E_OK)
-    {
-        AIR_PRINT("Error: Operation failed!\n");
-    }
-    return rc;
-}
-
-static AIR_ERROR_NO_T
-doVlanSetPortOuterTPID(UI32_T argc, C8_T *argv[])
-{
-    UI16_T port = 0, tpid = 0;
-    AIR_ERROR_NO_T rc = AIR_E_OK;
-
-    port = _strtoul(argv[0], NULL, 0);
-    tpid = _strtoul(argv[1], NULL, 16);
-    rc = air_vlan_setPortOuterTPID(0, port, tpid);
-    if (rc != AIR_E_OK)
-    {
-        AIR_PRINT("Error: Operation failed!\n");
-    }
-    return rc;
-}
-
-static AIR_ERROR_NO_T
-doVlanSetPvid(UI32_T argc, C8_T *argv[])
-{
-    UI16_T port = 0, pvid = 0;
-    AIR_ERROR_NO_T rc = AIR_E_OK;
-
-    port = _strtoul(argv[0], NULL, 0);
-    pvid = _strtoul(argv[1], NULL, 0);
-    rc = air_vlan_setPortPVID(0, port, pvid);
-    if (rc != AIR_E_OK)
-    {
-        AIR_PRINT("Error: Operation failed!\n");
-    }
-    return rc;
-}
-
-static AIR_ERROR_NO_T
-doVlanSet(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(vlanSetCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doVlanGetPortActFrame(UI32_T argc, C8_T *argv[])
-{
-    UI32_T port = 0;
-    AIR_VLAN_ACCEPT_FRAME_TYPE_T type;
-    AIR_ERROR_NO_T rc = AIR_E_OK;
-
-    port = _strtoul(argv[0], NULL, 0);
-    rc = air_vlan_getPortAcceptFrameType(0, port, &type);
-    if (rc != AIR_E_OK)
-    {
-        AIR_PRINT("Error: Operation failed!\n");
-        return rc;
-    }
-    AIR_PRINT("Port %d Acceptable Frame Type: ", port);
-    switch(type)
-    {
-        case AIR_VLAN_ACCEPT_FRAME_TYPE_ALL:
-            AIR_PRINT("all(%d)\n", type);
-            break;
-        case AIR_VLAN_ACCEPT_FRAME_TYPE_TAG_ONLY:
-            AIR_PRINT("tagged-only(%d)\n", type);
-            break;
-        case AIR_VLAN_ACCEPT_FRAME_TYPE_UNTAG_ONLY:
-            AIR_PRINT("untagged-only(%d)\n", type);
-            break;
-        default:
-            AIR_PRINT("unknown(%d)\n", type);
-            break;
-    };
-    return rc;
-}
-
-static AIR_ERROR_NO_T
-doVlanGetLeakyVlanEn(UI32_T argc, C8_T *argv[])
-{
-    UI32_T port = 0;
-    BOOL_T uc = FALSE, mc = FALSE, bc = FALSE;
-    AIR_ERROR_NO_T rc = AIR_E_OK;
-
-    port = _strtoul(argv[0], NULL, 0);
-    rc += air_vlan_getPortLeakyVlanEnable(0, port, AIR_LEAKY_PKT_TYPE_UNICAST, &uc);
-    rc += air_vlan_getPortLeakyVlanEnable(0, port, AIR_LEAKY_PKT_TYPE_MULTICAST, &mc);
-    rc += air_vlan_getPortLeakyVlanEnable(0, port, AIR_LEAKY_PKT_TYPE_BROADCAST, &bc);
-    if (rc != AIR_E_OK)
-    {
-        AIR_PRINT("Error: Operation failed!\n");
-        return rc;
-    }
-
-    AIR_PRINT("Port %d Leaky Vlan Enable\n", port);
-    AIR_PRINT("Unicast     : %s\n", uc ? "TRUE" : "FALSE");
-    AIR_PRINT("Multicast   : %s\n", mc ? "TRUE" : "FALSE");
-    AIR_PRINT("Broadcast   : %s\n", bc ? "TRUE" : "FALSE");
-    return rc;
-}
-
-static AIR_ERROR_NO_T
-doVlanGetPortVlanAttr(UI32_T argc, C8_T *argv[])
-{
-    UI32_T port = 0;
-    AIR_VLAN_PORT_ATTR_T attr;
-    AIR_ERROR_NO_T rc = AIR_E_OK;
-
-    port = _strtoul(argv[0], NULL, 0);
-    rc = air_vlan_getPortAttr(0, port, &attr);
-    if (rc != AIR_E_OK)
-    {
-        AIR_PRINT("Error: Operation failed!\n");
-        return rc;
-    }
-    AIR_PRINT("Port %d Vlan Attr: ", port);
-    switch(attr)
-    {
-        case AIR_VLAN_PORT_ATTR_USER_PORT:
-            AIR_PRINT("user port(%d)\n", attr);
-            break;
-        case AIR_VLAN_PORT_ATTR_STACK_PORT:
-            AIR_PRINT("stack port(%d)\n", attr);
-            break;
-        case AIR_VLAN_PORT_ATTR_TRANSLATION_PORT:
-            AIR_PRINT("translation port(%d)\n", attr);
-            break;
-        case AIR_VLAN_PORT_ATTR_TRANSPARENT_PORT:
-            AIR_PRINT("transparent port(%d)\n", attr);
-            break;
-        default:
-            AIR_PRINT("unknown(%d)\n", attr);
-            break;
-    };
-    return rc;
-}
-
-static AIR_ERROR_NO_T
-doVlanGetIgsPortETagAttr(UI32_T argc, C8_T *argv[])
-{
-    UI32_T port = 0;
-    AIR_IGR_PORT_EG_TAG_ATTR_T attr;
-    AIR_ERROR_NO_T rc = AIR_E_OK;
-
-    port = _strtoul(argv[0], NULL, 0);
-    rc = air_vlan_getIgrPortTagAttr(0, port, &attr);
-    if (rc != AIR_E_OK)
-    {
-        AIR_PRINT("Error: Operation failed!\n");
-        return rc;
-    }
-    AIR_PRINT("Port %d Incomming Port Egress Tag Attr: ", port);
-    switch(attr)
-    {
-        case AIR_IGR_PORT_EG_TAG_ATTR_DISABLE:
-            AIR_PRINT("disable(%d)\n", attr);
-            break;
-        case AIR_IGR_PORT_EG_TAG_ATTR_CONSISTENT:
-            AIR_PRINT("consistent(%d)\n", attr);
-            break;
-        case AIR_IGR_PORT_EG_TAG_ATTR_UNTAGGED:
-            AIR_PRINT("untagged(%d)\n", attr);
-            break;
-        case AIR_IGR_PORT_EG_TAG_ATTR_SWAP:
-            AIR_PRINT("swap(%d)\n", attr);
-            break;
-        case AIR_IGR_PORT_EG_TAG_ATTR_TAGGED:
-            AIR_PRINT("tagged(%d)\n", attr);
-            break;
-        case AIR_IGR_PORT_EG_TAG_ATTR_STACK:
-            AIR_PRINT("stack(%d)\n", attr);
-            break;
-        default:
-            AIR_PRINT("unknown(%d)\n", attr);
-            break;
-    };
-    return rc;
-}
-
-static AIR_ERROR_NO_T
-doVlanGetPortETagAttr(UI32_T argc, C8_T *argv[])
-{
-    UI32_T port = 0;
-    AIR_PORT_EGS_TAG_ATTR_T attr;
-    AIR_ERROR_NO_T rc = AIR_E_OK;
-
-    port = _strtoul(argv[0], NULL, 0);
-    rc = air_vlan_getPortEgsTagAttr(0, port, &attr);
-    if (rc != AIR_E_OK)
-    {
-        AIR_PRINT("Error: Operation failed!\n");
-        return rc;
-    }
-    AIR_PRINT("Port %d Egress Tag Attr: ", port);
-    switch(attr)
-    {
-        case AIR_PORT_EGS_TAG_ATTR_UNTAGGED:
-            AIR_PRINT("untagged(%d)\n", attr);
-            break;
-        case AIR_PORT_EGS_TAG_ATTR_SWAP:
-            AIR_PRINT("swap(%d)\n", attr);
-            break;
-        case AIR_PORT_EGS_TAG_ATTR_TAGGED:
-            AIR_PRINT("tagged(%d)\n", attr);
-            break;
-        case AIR_PORT_EGS_TAG_ATTR_STACK:
-            AIR_PRINT("stack(%d)\n", attr);
-            break;
-        default:
-            AIR_PRINT("unknown(%d)\n", attr);
-            break;
-    };
-    return rc;
-}
-
-static AIR_ERROR_NO_T
-doVlanGetPortOuterTPID(UI32_T argc, C8_T *argv[])
-{
-    UI32_T port = 0;
-    UI16_T tpid = 0;
-    AIR_ERROR_NO_T rc = AIR_E_OK;
-
-    port = _strtoul(argv[0], NULL, 0);
-    rc = air_vlan_getPortOuterTPID(0, port, &tpid);
-    if (rc != AIR_E_OK)
-    {
-        AIR_PRINT("Error: Operation failed!\n");
-        return rc;
-    }
-    AIR_PRINT("Port %d Outer TPID: %4x\n", port, tpid);
-    return rc;
-}
-
-static AIR_ERROR_NO_T
-doVlanGetPvid(UI32_T argc, C8_T *argv[])
-{
-    UI32_T port = 0;
-    UI16_T pvid = 0;
-    AIR_ERROR_NO_T rc = AIR_E_OK;
-
-    port = _strtoul(argv[0], NULL, 0);
-    rc = air_vlan_getPortPVID(0, port, &pvid);
-    if (rc != AIR_E_OK)
-    {
-        AIR_PRINT("Error: Operation failed!\n");
-        return rc;
-    }
-    AIR_PRINT("Port %d PVID: %d\n", port, pvid);
-    return rc;
-}
-
-static AIR_ERROR_NO_T
-doVlanGet(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(vlanGetCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doVlan(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(vlanCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doJumbo(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    I32_T pkt_len = 0, frame_len = 0;
-
-    if(0 == argc)
-    {
-        /* get command */
-        ret = air_port_getJumbo(0, &pkt_len, &frame_len);
-        if(ret == AIR_E_OK)
-        {
-            AIR_PRINT("Get ");
-            switch(pkt_len)
-            {
-                case 0:
-                    AIR_PRINT("RX_1518 ");
-                    break;
-                case 1:
-                    AIR_PRINT("RX_1536 ");
-                    break;
-                case 2:
-                    AIR_PRINT("RX_1552 ");
-                    break;
-                case 3:
-                    AIR_PRINT("RX_JUMBO ");
-                    break;
-            }
-            AIR_PRINT("frames lengths %d KBytes\n", frame_len);
-        }
-        else
-        {
-            AIR_PRINT("Get Jumbo Fail.\n");
-        }
-    }
-    else
-    {
-        /* set command */
-        pkt_len = _strtol(argv[0], NULL, 10);
-        frame_len = _strtol(argv[1], NULL, 10);
-
-        ret = air_port_setJumbo(0, pkt_len, frame_len);
-        if(ret == AIR_E_OK)
-        {
-            AIR_PRINT("Set ");
-            switch(pkt_len)
-            {
-                case 0:
-                    AIR_PRINT("RX_1518 ");
-                    break;
-                case 1:
-                    AIR_PRINT("RX_1536 ");
-                    break;
-                case 2:
-                    AIR_PRINT("RX_1552 ");
-                    break;
-                case 3:
-                    AIR_PRINT("RX_JUMBO ");
-                    break;
-            }
-            AIR_PRINT("frames lengths %d KBytes\n", frame_len);
-        }
-        else
-            AIR_PRINT("Set Jumbo Fail.\n");
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doFlowCtrl(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    BOOL_T fc_en = 0, dir = 0;
-    I32_T port = 0;
-
-    port = _strtol(argv[0], NULL, 10);
-    dir = _strtol(argv[1], NULL, 10);
-
-    if(2 == argc)
-    {
-        /* get command */
-        ret = air_port_getFlowCtrl(0, port, dir, &fc_en);
-        if(ret == AIR_E_OK)
-            AIR_PRINT("Get Port%02d %s Flow Control %s\n", port, ((dir)?"RX":"TX"), ((fc_en)?"Enable":"Disable"));
-        else
-            AIR_PRINT("Get Flow Control Fail.\n");
-    }
-    else
-    {
-        /* set command */
-        fc_en = _strtol(argv[2], NULL, 10);
-
-        ret = air_port_setFlowCtrl(0, port, dir, fc_en);
-        if(ret == AIR_E_OK)
-            AIR_PRINT("Set Port%02d %s Flow Control %s\n", port, ((dir)?"RX":"TX"), ((fc_en)?"Enable":"Disable"));
-        else
-            AIR_PRINT("Set Flow Control Fail.\n");
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doL2Set(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(l2SetCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doL2Get(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(l2GetCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doL2Clear(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(l2ClearCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doL2Del(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(l2DelCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doL2Add(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(l2AddCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doL2(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(l2Cmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doAnMode(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T port = 0;
-    BOOL_T en = 0;
-
-    port = _strtol(argv[0], NULL, 10);
-
-    if(1 == argc)
-    {
-        /* port get anCap <port> */
-        ret = air_port_getAnMode(0, port, &en);
-        if(ret == AIR_E_OK)
-            AIR_PRINT("Get Port%02d Auto-Negotiation %s\n", port, ((en)?"Enabled":"Disabled"));
-        else
-            AIR_PRINT("Get Port%02d Auto-Negotiation Fail.\n", port);
-    }
-    else if(2 == argc)
-    {
-        /* "port set anMode <port> <en> */
-        en = _strtol(argv[1], NULL, 10);
-        ret = air_port_setAnMode(0, port, en);
-        if(ret == AIR_E_OK)
-            AIR_PRINT("Set Port%02d Auto-Negotiation Mode:%s\n", port, ((en)?"Enabled":"Disabled"));
-        else
-            AIR_PRINT("Set Port%02d Auto-Negotiation Fail.\n", port);
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doLocalAdv(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T port = 0;
-    AIR_AN_ADV_T adv;
-
-    memset(&adv, 0, sizeof(AIR_AN_ADV_T));
-    port = _strtol(argv[0], NULL, 10);
-
-    if(1 == argc)
-    {
-        /* port get localAdv <port> */
-        ret = air_port_getLocalAdvAbility(0, port, &adv);
-        AIR_PRINT("Get Port%02d Local Auto-Negotiation Advertisement: ", port);
-        if(AIR_E_OK != ret)
-        {
-            AIR_PRINT("Fail!\n");
-        }
-    }
-    else if(7 == argc)
-    {
-        /* port set localAdv <port> <10H> <10F> <100H> <100F> <1000F> <pause> */
-        adv.advCap10HDX = _strtol(argv[1], NULL, 0) & BIT(0);
-        adv.advCap10FDX = _strtol(argv[2], NULL, 0) & BIT(0);
-        adv.advCap100HDX = _strtol(argv[3], NULL, 0) & BIT(0);
-        adv.advCap100FDX = _strtol(argv[4], NULL, 0) & BIT(0);
-        adv.advCap1000FDX = _strtol(argv[5], NULL, 0) & BIT(0);
-        adv.advPause = _strtol(argv[6], NULL, 0) & BIT(0);
-        ret = air_port_setLocalAdvAbility(0, port, adv);
-        AIR_PRINT("Set Port%02d Local Auto-Negotiation Advertisement: ", port);
-        if(AIR_E_OK != ret)
-        {
-            AIR_PRINT("Fail!\n");
-        }
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    if(ret == AIR_E_OK)
-    {
-        AIR_PRINT("\n");
-        AIR_PRINT("\tAdvertise 10BASE-T Half Duplex: %s\n", (adv.advCap10HDX)?"Effective":"Not Effective" );
-        AIR_PRINT("\tAdvertise 10BASE-T Full Duplex: %s\n", (adv.advCap10FDX)?"Effective":"Not Effective" );
-        AIR_PRINT("\tAdvertise 100BASE-T Half Duplex: %s\n", (adv.advCap100HDX)?"Effective":"Not Effective" );
-        AIR_PRINT("\tAdvertise 100BASE-T Full Duplex: %s\n", (adv.advCap100FDX)?"Effective":"Not Effective" );
-        AIR_PRINT("\tAdvertise 1000BASE-T Full Duplex: %s\n", (adv.advCap1000FDX)?"Effective":"Not Effective" );
-        AIR_PRINT("\tAdvertise Asynchronous Pause: %s\n", (adv.advPause)?"Effective":"Not Effective" );
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doRemoteAdv(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T port = 0;
-    AIR_AN_ADV_T lp_adv;
-
-    memset(&lp_adv, 0, sizeof(AIR_AN_ADV_T));
-    port = _strtol(argv[0], NULL, 10);
-
-    if(1 == argc)
-    {
-        /* port get remoteAdv <port> */
-        ret = air_port_getRemoteAdvAbility(0, port, &lp_adv);
-        AIR_PRINT("Get Port%02d Remote Auto-Negotiation Advertisement: ", port);
-        if(AIR_E_OK != ret)
-        {
-            AIR_PRINT("Fail!\n");
-        }
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    if(ret == AIR_E_OK)
-    {
-        AIR_PRINT("\n");
-        AIR_PRINT("\tAdvertise 10BASE-T Half Duplex: %s\n", lp_adv.advCap10HDX?"Effective":"Not Effective" );
-        AIR_PRINT("\tAdvertise 10BASE-T Full Duplex: %s\n", lp_adv.advCap10FDX?"Effective":"Not Effective" );
-        AIR_PRINT("\tAdvertise 100BASE-T Half Duplex: %s\n", lp_adv.advCap100HDX?"Effective":"Not Effective" );
-        AIR_PRINT("\tAdvertise 100BASE-T Full Duplex: %s\n", lp_adv.advCap100FDX?"Effective":"Not Effective" );
-        AIR_PRINT("\tAdvertise 1000BASE-T Full Duplex: %s\n", (lp_adv.advCap1000FDX)?"Effective":"Not Effective" );
-        AIR_PRINT("\tAdvertise Asynchronous Pause: %s\n", (lp_adv.advPause)?"Effective":"Not Effective" );
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doPortSpeed(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T port = 0;
-    UI32_T speed = 0;
-
-    port = _strtol(argv[0], NULL, 10);
-
-    if(1 == argc)
-    {
-        /* port get speed <port> */
-        ret = air_port_getSpeed(0, port, &speed);
-        if(ret == AIR_E_OK)
-        {
-            AIR_PRINT("Get Port%02d Speed:", port);
-        }
-        else
-        {
-            AIR_PRINT("Get Port%02d Speed Fail!\n", port);
-        }
-    }
-    else if(2 == argc)
-    {
-        /* port set speed <port> <speed> */
-        speed = _strtol(argv[1], NULL, 10);
-        ret = air_port_setSpeed(0, port, speed);
-        if(ret == AIR_E_OK)
-        {
-            AIR_PRINT("Set Port%02d Speed:", port);
-        }
-        else
-        {
-            AIR_PRINT("Set Port%02d Speed Fail!\n", port);
-        }
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    if(ret == AIR_E_OK)
-    {
-        switch(speed)
-        {
-            case AIR_PORT_SPEED_10M:
-                AIR_PRINT(" 10 Mbps\n");
-                break;
-            case AIR_PORT_SPEED_100M:
-                AIR_PRINT(" 100 Mbps\n");
-                break;
-            case AIR_PORT_SPEED_1000M:
-                AIR_PRINT(" 1 Gbps\n");
-                break;
-            case AIR_PORT_SPEED_2500M:
-                AIR_PRINT(" 2.5 Gbps\n");
-                break;
-            default:
-                AIR_PRINT(" Reserved\n");
-                break;
-        }
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doPortDuplex(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T port = 0;
-    UI32_T duplex = 0;
-
-    port = _strtol(argv[0], NULL, 10);
-
-    if(1 == argc)
-    {
-        /* port get duplex <port> */
-        ret = air_port_getDuplex(0, port, &duplex);
-        if(ret == AIR_E_OK)
-        {
-            AIR_PRINT("Get Port%02d Duplex:%s\n", port, duplex?"Full":"Half");
-        }
-        else
-        {
-            AIR_PRINT("Get Port%02d Duplex Fail!\n", port);
-        }
-    }
-    else if(2 == argc)
-    {
-        /* port set duplex <port> <duplex> */
-        duplex = _strtol(argv[1], NULL, 10);
-        ret = air_port_setDuplex(0, port, duplex);
-        if(ret == AIR_E_OK)
-        {
-            AIR_PRINT("Set Port%02d Duplex:%s\n", port, duplex?"Full":"Half");
-        }
-        else
-        {
-            AIR_PRINT("Set Port%02d Duplex Fail!\n", port);
-        }
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doPortStatus(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T port = 0;
-    AIR_PORT_STATUS_T ps;
-
-    memset(&ps, 0, sizeof(AIR_PORT_STATUS_T));
-    port = _strtol(argv[0], NULL, 10);
-
-    if(1 == argc)
-    {
-        /* port get status <port> */
-        ret = air_port_getLink(0, port, &ps);
-        if(ret == AIR_E_OK)
-        {
-            AIR_PRINT("Get Port%02d Link-Status\n", port);
-            AIR_PRINT("\tLink: %s\n", ps.link?"Up":"Down");
-            AIR_PRINT("\tDuplex: %s\n", ps.duplex?"Full":"Half");
-            AIR_PRINT("\tSpeed: ");
-            switch(ps.speed)
-            {
-                case AIR_PORT_SPEED_10M:
-                    AIR_PRINT("10 Mbps\n");
-                    break;
-                case AIR_PORT_SPEED_100M:
-                    AIR_PRINT("100 Mbps\n");
-                    break;
-                case AIR_PORT_SPEED_1000M:
-                    AIR_PRINT("1 Gbps\n");
-                    break;
-                case AIR_PORT_SPEED_2500M:
-                    AIR_PRINT("2.5 Gbps\n");
-                    break;
-                default:
-                    AIR_PRINT("Reserved\n");
-                    break;
-            }
-        }
-        else
-            AIR_PRINT("Get Port%02d Link-Status Fail!", port);
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doPortBckPres(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T port = 0;
-    UI32_T bckPres = 0;
-
-    port = _strtol(argv[0], NULL, 10);
-
-    if(1 == argc)
-    {
-        /* port get bckPres <port> */
-        ret = air_port_getBckPres(0, port, &bckPres);
-        if(ret == AIR_E_OK)
-            AIR_PRINT("Get Port%02d BckPres:%s\n", port, bckPres?"Enabled":"Disabled");
-        else
-            AIR_PRINT("Get Port%02d BckPres Fail!\n", port);
-    }
-    else if(2 == argc)
-    {
-        /* port set bckPres <port> <bckPres> */
-        bckPres = _strtol(argv[1], NULL, 10);
-        ret = air_port_setBckPres(0, port, bckPres);
-        if(ret == AIR_E_OK)
-            AIR_PRINT("Set Port%02d BckPres:%s\n", port, bckPres?"Enabled":"Disabled");
-        else
-            AIR_PRINT("Set Port%02d BckPres Fail!\n", port);
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doPortPsMode(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T port = 0;
-    UI32_T mode = 0;
-    BOOL_T ls_en = 0;
-    BOOL_T eee_en = 0;
-
-    port = _strtol(argv[0], NULL, 10);
-
-    if(1 == argc)
-    {
-        /* port get psMode <port> */
-        ret = air_port_getPsMode(0, port, &mode);
-        AIR_PRINT("Get Port%02d Power-Saving: ", port);
-        if(ret == AIR_E_OK)
-        {
-            AIR_PRINT("Done\n");
-        }
-        else
-        {
-            AIR_PRINT("Fail!\n");
-        }
-    }
-    else if(3 == argc)
-    {
-        /* port set psMode <port> <ls> <eee> */
-        ls_en = _strtol(argv[1], NULL, 0);
-        eee_en = _strtol(argv[2], NULL, 0);
-        if(TRUE == ls_en)
-        {
-            mode |= AIR_PORT_PS_LINKSTATUS;
-        }
-        if(TRUE == eee_en)
-        {
-            mode |= AIR_PORT_PS_EEE;
-        }
-        ret = air_port_setPsMode(0, port, mode);
-        AIR_PRINT("Set Port%02d Power-Saving: ", port);
-        if(ret == AIR_E_OK)
-        {
-            AIR_PRINT("Done\n");
-        }
-        else
-        {
-            AIR_PRINT("Fail!\n");
-        }
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-    if(ret == AIR_E_OK)
-    {
-        AIR_PRINT("\tLink status:%s\n", (mode & AIR_PORT_PS_LINKSTATUS)?"Enable":"Disable");
-        AIR_PRINT("\tEEE:%s\n", (mode & AIR_PORT_PS_EEE)?"Enable":"Disable");
-    }
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doPortSmtSpdDwn(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T port = 0;
-    UI32_T state = 0;
-    UI32_T retry = 0;
-
-    port = _strtol(argv[0], NULL, 10);
-
-    if(1 == argc)
-    {
-        /* port get smtSpdDwn <port> */
-        ret = air_port_getSmtSpdDwn(0, port, &state, &retry);
-        if(ret == AIR_E_OK)
-        {
-            AIR_PRINT("Get Port%02d Smart Speed Down: %s\n", port, state?"Enabled":"Disabled");
-            AIR_PRINT("Get Port%02d Retry Time: %d\n", port, retry + 2);
-        }
-        else
-            AIR_PRINT("Get Port%02d Smart-SpeedDown Fail!\n", port);
-    }
-    else if(3 == argc)
-    {
-        /* port set smtSpdDwn <port> <en> <retry> */
-        state = _strtol(argv[1], NULL, 10);
-        retry = _strtol(argv[2], NULL, 10);
-        if(retry >= 2)
-        {
-            ret = air_port_setSmtSpdDwn(0, port, state, retry - 2);
-            if(ret == AIR_E_OK)
-            {
-                AIR_PRINT("Set Port%02d Smart Speed Down: %s\n", port, state?"Enabled":"Disabled");
-                AIR_PRINT("Set Port%02d Retry Time: %d\n", port, retry);
-            }
-            else
-                AIR_PRINT("Set Port%02d Smart-SpeedDown Fail!\n", port);
-        }
-        else
-        {
-            ret = AIR_E_BAD_PARAMETER;
-        }
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doPortSpTag(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T port = 0;
-    BOOL_T sptag_en = FALSE;
-
-    port = _strtol(argv[0], NULL, 10);
-
-    if(1 == argc)
-    {
-        /* port get spTag <port> */
-        ret = air_port_getSpTag(0, port, &sptag_en);
-        if(AIR_E_OK == ret)
-        {
-            AIR_PRINT("Get Port%02d Special Tag %s\n", port, ((sptag_en)?"Enabled":"Disabled"));
-        }
-        else
-        {
-            AIR_PRINT("Get Port%02d Special Tag Fail.\n", port);
-        }
-    }
-    else if(2 == argc)
-    {
-        /* port set spTag <port> <en> */
-        sptag_en = _strtol(argv[1], NULL, 10);
-        ret = air_port_setSpTag(0, port, sptag_en);
-        if(AIR_E_OK == ret)
-        {
-            AIR_PRINT("Set Port%02d Special Tag:%s\n", port, ((sptag_en)?"Enabled":"Disabled"));
-        }
-        else
-        {
-            AIR_PRINT("Set Port%02d Special Tag Fail.\n", port);
-        }
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doPortEnable(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T port = 0;
-    UI32_T state = 0;
-
-    port = _strtol(argv[0], NULL, 10);
-
-    if(1 == argc)
-    {
-        /* port get enable <port> */
-        ret = air_port_getEnable(0, port, &state);
-        if(ret == AIR_E_OK)
-            AIR_PRINT("Get Port%02d State:%s\n", port, state?"Enable":"Disable");
-        else
-            AIR_PRINT("Get Port%02d State Fail!\n", port);
-    }
-    else if(2 == argc)
-    {
-        /* port set enable <port> <en> */
-        state = _strtol(argv[1], NULL, 10);
-        ret = air_port_setEnable(0, port, state);
-        if(ret == AIR_E_OK)
-            AIR_PRINT("Set Port%02d State:%s\n", port, state?"Enable":"Disable");
-        else
-            AIR_PRINT("Set Port%02d State Fail!\n", port);
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doPort5GBaseRMode(
-    UI32_T argc,
-    C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-
-    if(0 == argc)
-    {
-        /* port set 5GBaseRMode */
-        ret = air_port_set5GBaseRModeEn(0);
-        if(ret == AIR_E_OK)
-            AIR_PRINT("Set Port05 Mode: 5GBase-R\n");
-        else
-            AIR_PRINT("Set Port05 HSGMII Mode Fail.\n");
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doPortHsgmiiMode(
-    UI32_T argc,
-    C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-
-    if(0 == argc)
-    {
-        /* port set hsgmiiMode */
-        ret = air_port_setHsgmiiModeEn(0);
-        if(ret == AIR_E_OK)
-            AIR_PRINT("Set Port05 Mode: HSGMII\n");
-        else
-            AIR_PRINT("Set Port05 HSGMII Mode Fail.\n");
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doPortSgmiiMode(
-    UI32_T argc,
-    C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T mode = 0;
-    UI32_T speed = 0;
-
-    if(2 == argc)
-    {
-        /* port set sgmiiMode <mode(0:AN,1:Force)> <speed> */
-        mode = _strtol(argv[0], NULL, 10);
-        speed = _strtol(argv[1], NULL, 10);
-        ret = air_port_setSgmiiMode(0, mode, speed);
-        if(ret == AIR_E_OK)
-            AIR_PRINT("Set Port05 SGMII Mode:%s\nIf in Force Mode, speed:", mode?"Force":"AN");
-        else
-            AIR_PRINT("Set Port05 SGMII Mode Fail.\n");
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    if(ret == AIR_E_OK)
-    {
-        switch(speed)
-        {
-            case AIR_PORT_SPEED_10M:
-                AIR_PRINT(" 10 Mbps\n");
-                break;
-            case AIR_PORT_SPEED_100M:
-                AIR_PRINT(" 100 Mbps\n");
-                break;
-            case AIR_PORT_SPEED_1000M:
-                AIR_PRINT(" 1 Gbps\n");
-                break;
-            default:
-                AIR_PRINT(" Reserved\n");
-                break;
-        }
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doPortRmiiMode(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T speed = 0;
-
-    if(1 == argc)
-    {
-        /* port set rmiiMode <speed> */
-        speed = _strtol(argv[0], NULL, 10);
-        ret = air_port_setRmiiMode(0, speed);
-        if(ret == AIR_E_OK)
-        {
-            AIR_PRINT("Set Port05 RMII Mode Speed:");
-        }
-        else
-        {
-            AIR_PRINT("Set Port05 RMII Mode Fail!\n");
-        }
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    if(ret == AIR_E_OK)
-    {
-        switch(speed)
-        {
-            case AIR_PORT_SPEED_10M:
-                AIR_PRINT(" 10 Mbps\n");
-                break;
-            case AIR_PORT_SPEED_100M:
-                AIR_PRINT(" 100 Mbps\n");
-                break;
-            default:
-                AIR_PRINT(" Reserved\n");
-                break;
-        }
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doPortRgmiiMode(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T speed = 0;
-
-    if(1 == argc)
-    {
-        /* port set rgmiiMode <speed> */
-        speed = _strtol(argv[0], NULL, 10);
-        ret = air_port_setRgmiiMode(0, speed);
-        if(ret == AIR_E_OK)
-        {
-            AIR_PRINT("Set Port05 RGMII Mode Speed:");
-        }
-        else
-        {
-            AIR_PRINT("Set Port05 RGMII Mode Fail!\n");
-        }
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    if(ret == AIR_E_OK)
-    {
-        switch(speed)
-        {
-            case AIR_PORT_SPEED_10M:
-                AIR_PRINT(" 10 Mbps\n");
-                break;
-            case AIR_PORT_SPEED_100M:
-                AIR_PRINT(" 100 Mbps\n");
-                break;
-            case AIR_PORT_SPEED_1000M:
-                AIR_PRINT(" 1 Gbps\n");
-                break;
-            default:
-                AIR_PRINT(" Reserved\n");
-                break;
-        }
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doSptagEn(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T port = 0;
-    BOOL_T sp_en = FALSE;
-
-    port =  _strtol(argv[0], NULL, 10);
-    if (2 == argc)
-    {
-        sp_en =  _strtol(argv[1], NULL, 10);
-        ret = air_sptag_setState(0,port,sp_en);
-        if(AIR_E_OK == ret)
-        {
-            AIR_PRINT("set port %d SpTag state %s sucess\n", port,sp_en?"Enable":"Disable");
-        }
-        else
-        {
-            AIR_PRINT("set port %d SpTag state %s fail\n", port,sp_en?"Enable":"Disable");
-        }
-    }
-    else if(1 == argc)
-    {
-        air_sptag_getState(0,port,&sp_en);
-        AIR_PRINT("get port %d SpTag state: %s \n", port,sp_en?"Enable":"Disable");
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doSptagMode(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T port = 0;
-    BOOL_T sp_mode = FALSE;
-
-
-    port =  _strtol(argv[0], NULL, 10);
-    if (2 == argc)
-    {
-        sp_mode  =  _strtol(argv[1], NULL, 10);
-        ret = air_sptag_setMode(0,port,sp_mode);
-        if(AIR_E_OK == ret)
-        {
-            AIR_PRINT("set port %d SpTag Mode  %s sucess\n", port,sp_mode?"replace":"insert");
-        }
-        else
-        {
-            AIR_PRINT("set port %d SpTag state %s fail\n", port,sp_mode?"replace":"insert");
-        }
-    }
-    else if(1 == argc)
-    {
-        air_sptag_getMode(0,port,&sp_mode);
-        AIR_PRINT("get port %d SpTag state: %s \n", port,sp_mode?"replace":"insert");
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doSptagDecode(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    AIR_SPTAG_RX_PARA_T sptag_rx = {0};
-    UI8_T buf[AIR_STAG_BUF_LEN] = {0};
-    UI32_T len = AIR_STAG_BUF_LEN, i = 0;
-
-    if (4 == argc)
-    {
-        for(i = 0; i < len; i++)
-        {
-            buf[i] = _strtoul(argv[i], NULL, 16);
-        }
-
-        ret = air_sptag_decodeRx(0, buf, len, &sptag_rx);
-        if (AIR_E_OK != ret)
-        {
-            AIR_PRINT("SpTag decode fail\n");
-            return ret;
-        }
-
-        AIR_PRINT("SpTag decode success:\n");
-        AIR_PRINT("RSN : %s\n", _sptag_pt[sptag_rx.rsn]);
-        AIR_PRINT("VPM : %s\n", _sptag_vpm[sptag_rx.vpm]);
-        AIR_PRINT("SPN : %d\n", sptag_rx.spn);
-        AIR_PRINT("PRI : %d\n", sptag_rx.pri);
-        AIR_PRINT("CFI : %d\n", sptag_rx.cfi);
-        AIR_PRINT("VID : %d\n", sptag_rx.vid);
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doSptagEncode(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    AIR_STAG_TX_PARA_T sptag_tx = {0};
-    UI8_T buf[AIR_STAG_BUF_LEN] = {0};
-    UI32_T len = AIR_STAG_BUF_LEN;
-    char str[128] = {'\0'};
-    UI32_T data = 0;
-    AIR_STAG_MODE_T mode = AIR_STAG_MODE_LAST;
-
-    if (7 == argc)
-    {
-        if(_strcmp(argv[0],"mode=replace") == 0)
-            mode = AIR_STAG_MODE_REPLACE;
-        else if(_strcmp(argv[0],"mode=insert") == 0)
-            mode = AIR_STAG_MODE_INSERT;
-        else
-            printf("mode is wrong!!");
-
-        if(_strcmp(argv[1],"opc=portmap") == 0)
-            sptag_tx.opc = AIR_STAG_OPC_PORTMAP;
-        else if(_strcmp(argv[1],"opc=portid") == 0)
-            sptag_tx.opc = AIR_STAG_OPC_PORTID;
-        else if(_strcmp(argv[1],"opc=lookup") == 0)
-            sptag_tx.opc = AIR_STAG_OPC_LOOKUP;
-        else
-            printf("opc is wrong!!");
-
-        if(sscanf(argv[2],"dp=%x",&data) != -1)
-        {
-            sptag_tx.pbm = data;
-            AIR_PRINT("sptag_tx.pbm %x\n",sptag_tx.pbm);
-        }
-
-        if(_strcmp(argv[3],"vpm=untagged") == 0)
-            sptag_tx.vpm = AIR_STAG_VPM_UNTAG;
-        else if(_strcmp(argv[3],"vpm=8100") == 0)
-            sptag_tx.vpm = AIR_STAG_VPM_TPID_8100;
-        else if(_strcmp(argv[3],"vpm=88a8") == 0)
-            sptag_tx.vpm = AIR_STAG_VPM_TPID_88A8;
-        else
-            printf("vpm is wrong!!");
-
-        if(sscanf(argv[4],"pri=%d",&data) != -1)
-        {
-            sptag_tx.pri = data;
-            AIR_PRINT("sptag_tx.pri %d\n",sptag_tx.pri);
-        }
-
-        if(sscanf(argv[5],"cfi=%d",&data) != -1)
-        {
-            sptag_tx.cfi  = data;
-            AIR_PRINT("sptag_tx.cfi %d\n",sptag_tx.cfi);
-        }
-
-        if(sscanf(argv[6],"vid=%d",&data) != -1)
-        {
-            sptag_tx.vid = data;
-            AIR_PRINT("sptag_tx.vid %d\n",sptag_tx.vid);
-        }
-
-        ret = air_sptag_encodeTx(0,mode, &sptag_tx, (UI8_T *)&buf, &len);
-        if(AIR_E_OK == ret)
-        {
-            AIR_PRINT("SpTag encode sucess, returned len=%d\n", len);
-            AIR_PRINT("Encoded SpTag: %02x %02x %02x %02x\n", buf[0], buf[1], buf[2], buf[3]);
-        }
-        else
-        {
-            AIR_PRINT("SpTag encode fail\n");
-        }
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doSptag(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(sptagCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doL2Dump(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(l2DumpCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doMacAddr(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    AIR_MAC_ENTRY_T mt;
-    UI32_T fwd = 0;
-
-    memset(&mt, 0, sizeof(AIR_MAC_ENTRY_T));
-
-    if(0 == argc)
-    {
-        /* l2 clear mac */
-        ret = air_l2_clearMacAddr(0);
-        if(ret == AIR_E_OK)
-            AIR_PRINT("Clear MAC Address Table Done.\n");
-        else
-            AIR_PRINT("Clear MAC Address Table Fail.\n");
-    }
-    else if(3 == argc)
-    {
-        /* l2 del mac <mac(12'hex)> { vid <vid(0..4095)> | fid <fid(0..15)> } */
-        ret = _str2mac(argv[0], (C8_T *)mt.mac);
-        if(ret != AIR_E_OK)
-        {
-            AIR_PRINT("Unrecognized command.\n");
-            return ret;
-        }
-
-        /* check argument 1 */
-        if(FALSE == _strcmp(argv[1], "vid"))
-        {
-            /* get mac entry by MAC address & vid */
-            mt.cvid = _strtoul(argv[2], NULL, 0);
-            mt.flags |= AIR_L2_MAC_ENTRY_FLAGS_IVL;
-            AIR_PRINT("Get MAC Address:" MAC_STR " with vid:%u", MAC2STR(mt.mac), mt.cvid);
-        }
-        else if(FALSE == _strcmp(argv[1], "fid"))
-        {
-            /* get mac entry by MAC address & fid */
-            mt.fid = _strtoul(argv[2], NULL, 0);
-            AIR_PRINT("Get MAC Address:" MAC_STR " with fid:%u", MAC2STR(mt.mac), mt.fid);
-        }
-        else
-        {
-            AIR_PRINT("Unrecognized command.\n");
-            return AIR_E_BAD_PARAMETER;
-        }
-        ret = air_l2_delMacAddr(0, &mt);
-        if(ret == AIR_E_OK)
-        {
-            AIR_PRINT(" Done.\n");
-        }
-        else
-            AIR_PRINT("\n Fail!\n");
-    }
-    else if(7 == argc)
-    {
-        /* l2 add mac <static(0:dynamic,1:static)> <unauth(0:auth,1:unauth)> <mac(12'hex)> <portlist(uintlist)> [ vid <vid(0..4095)> | fid <fid(0..15)> ] <src_mac_forward=(0:default,1:cpu-include,2:cpu-exclude,3:cpu-only,4:drop)> */
-        if(argv[0])
-            mt.flags |= AIR_L2_MAC_ENTRY_FLAGS_STATIC;
-
-        if(argv[1])
-            mt.flags |= AIR_L2_MAC_ENTRY_FLAGS_UNAUTH;
-
-        ret = _str2mac(argv[2], (C8_T *)mt.mac);
-        if(ret != AIR_E_OK)
-        {
-            AIR_PRINT("Unrecognized command.\n");
-            return ret;
-        }
-
-        ret = _portListStr2Ary(argv[3], mt.port_bitmap, 1);
-        if(ret != AIR_E_OK)
-        {
-            AIR_PRINT("Unrecognized command.\n");
-            return ret;
-        }
-
-        /* check argument fid or vid */
-        if(FALSE == _strcmp(argv[4], "vid"))
-        {
-            /* get mac entry by MAC address & vid */
-            mt.cvid = _strtoul(argv[5], NULL, 0);
-            mt.flags |= AIR_L2_MAC_ENTRY_FLAGS_IVL;
-        }
-        else if(FALSE == _strcmp(argv[4], "fid"))
-        {
-            /* get mac entry by MAC address & fid */
-            mt.fid = _strtoul(argv[5], NULL, 0);
-        }
-        else
-        {
-            AIR_PRINT("Unrecognized command.\n");
-            return AIR_E_BAD_PARAMETER;
-        }
-        fwd = _strtoul(argv[6], NULL, 0);
-        if(0 == fwd)
-            mt.sa_fwd = AIR_L2_FWD_CTRL_DEFAULT;
-        else if(1 == fwd)
-            mt.sa_fwd = AIR_L2_FWD_CTRL_CPU_INCLUDE;
-        else if(2 == fwd)
-            mt.sa_fwd = AIR_L2_FWD_CTRL_CPU_EXCLUDE;
-        else if(3 == fwd)
-            mt.sa_fwd = AIR_L2_FWD_CTRL_CPU_ONLY;
-        else if(4 == fwd)
-            mt.sa_fwd = AIR_L2_FWD_CTRL_DROP;
-        else
-        {
-            AIR_PRINT("Unrecognized command.\n");
-            return AIR_E_BAD_PARAMETER;
-        }
-        ret = air_l2_addMacAddr(0, &mt);
-        AIR_PRINT("Add MAC Address:" MAC_STR, MAC2STR(mt.mac));
-        if(ret == AIR_E_OK)
-            AIR_PRINT(" Done.\n");
-        else
-            AIR_PRINT(" Fail.\n");
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-_printMacEntry(
-        AIR_MAC_ENTRY_T *mt,
-        UI32_T age_unit,
-        UI8_T count,
-        UI8_T title)
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    I32_T i = 0, j = 0;
-    UI8_T first = 0;
-    UI8_T find = 0;
-    if(title)
-    {
-        AIR_PRINT("%-6s%-15s%-5s%-5s%-5s%-10s%-10s%-6s\n",
-                "unit",
-                "mac",
-                "ivl",
-                "vid",
-                "fid",
-                "age-time",
-                "forward",
-                "port");
-        return ret;
-    }
-    for(i = 0; i < count; i++)
-    {
-        AIR_PRINT("%-6d", age_unit);
-        AIR_PRINT(MAC_STR, MAC2STR(mt[i].mac));
-        AIR_PRINT("...");
-        if(mt[i].flags & AIR_L2_MAC_ENTRY_FLAGS_IVL)
-        {
-            AIR_PRINT("%-3s..", "ivl");
-            AIR_PRINT("%-5d", mt[i].cvid);
-            AIR_PRINT("%-5s", ".....");
-        }
-        else
-        {
-            AIR_PRINT("%-3s..", "svl");
-            AIR_PRINT("%-5s", ".....");
-            AIR_PRINT("%-5d", mt[i].fid);
-        }
-        if(mt[i].flags & AIR_L2_MAC_ENTRY_FLAGS_STATIC)
-        {
-            AIR_PRINT("%-10s.", "static");
-        }
-        else
-        {
-            AIR_PRINT("%d sec..", mt[i].timer);
-        }
-        AIR_PRINT("%-10s", _air_mac_address_forward_control_string[mt[i].sa_fwd]);
-        first = 0;
-        find = 0;
-        for (j = (AIR_MAX_NUM_OF_PORTS - 1); j >= 0; j--)
-        {
-            if((mt[i].port_bitmap[0]) & (1 << j))
-            {
-                first = j;
-                find = 1;
-                break;
-            }
-        }
-        if(find)
-        {
-            for (j = 0; j < AIR_MAX_NUM_OF_PORTS; j++)
-            {
-                if((mt[i].port_bitmap[0]) & (1 << j))
-                {
-                    if(j == first)
-                        AIR_PRINT("%-2d", j);
-                    else
-                        AIR_PRINT("%-2d,", j);
-                }
-            }
-        }
-        else
-            AIR_PRINT("no dst port");
-        AIR_PRINT("\n");
-    }
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doGetMacAddr(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI8_T count = 0;
-    AIR_MAC_ENTRY_T * ptr_mt;
-
-    if(3 == argc)
-    {
-        ptr_mt = AIR_MALLOC(sizeof(AIR_MAC_ENTRY_T));
-        if (NULL == ptr_mt)
-        {
-            AIR_PRINT("***Error***, allocate memory fail\n");
-            return AIR_E_OTHERS;
-        }
-        memset(ptr_mt, 0, sizeof(AIR_MAC_ENTRY_T));
-        /* l2 get mac <mac(12'hex)> { vid <vid(0..4095)> | fid <fid(0..15)> } */
-        ret = _str2mac(argv[0], (C8_T *)ptr_mt->mac);
-        if(ret != AIR_E_OK)
-        {
-            AIR_PRINT("Unrecognized command.\n");
-            AIR_FREE(ptr_mt);
-            return ret;
-        }
-
-        /* check argument 1 */
-        if(FALSE == _strcmp(argv[1], "vid"))
-        {
-            /* get mac entry by MAC address & vid */
-            ptr_mt->cvid = _strtoul(argv[2], NULL, 0);
-            ptr_mt->flags |= AIR_L2_MAC_ENTRY_FLAGS_IVL;
-            AIR_PRINT("Get MAC Address:" MAC_STR " with vid:%u", MAC2STR(ptr_mt->mac), ptr_mt->cvid);
-        }
-        else if(FALSE == _strcmp(argv[1], "fid"))
-        {
-            /* get mac entry by MAC address & fid */
-            ptr_mt->fid = _strtoul(argv[2], NULL, 0);
-            AIR_PRINT("Get MAC Address:" MAC_STR " with fid:%u", MAC2STR(ptr_mt->mac), ptr_mt->fid);
-        }
-        else
-        {
-            AIR_PRINT("Unrecognized command.\n");
-            AIR_FREE(ptr_mt);
-            return AIR_E_BAD_PARAMETER;
-        }
-        ret = air_l2_getMacAddr(0, &count, ptr_mt);
-        if(ret == AIR_E_OK)
-        {
-            AIR_PRINT(" Done.\n");
-            _printMacEntry(ptr_mt, 0, 1, TRUE);
-            _printMacEntry(ptr_mt, 0, 1, FALSE);
-        }
-        else
-            AIR_PRINT("\n Not found!\n");
-        AIR_FREE(ptr_mt);
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doMacAddrAgeOut(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T time = 0;
-    if(0 == argc)
-    {
-        /* l2 get macAddrAgeOut */
-        ret = air_l2_getMacAddrAgeOut(0, &time);
-        if(ret == AIR_E_OK)
-        {
-            AIR_PRINT("Get MAC Address Age Out Time Done.\n");
-        }
-        else
-        {
-            AIR_PRINT("Get MAC Address Age Out Time Fail.\n");
-        }
-    }
-    else if(1 == argc)
-    {
-        /* l2 set macAddrAgeOut <time(1, 1000000)> */
-        time = _strtoul(argv[0], NULL, 0);
-        if(time < 1 || time > 1000000)
-        {
-            AIR_PRINT("Unrecognized command.\n");
-            return AIR_E_BAD_PARAMETER;
-        }
-        ret = air_l2_setMacAddrAgeOut(0, time);
-        if(ret == AIR_E_OK)
-        {
-            AIR_PRINT("Set MAC Address Age Out Time Done.\n");
-        }
-        else
-        {
-            AIR_PRINT("Set MAC Address Age Out Time Fail.\n");
-        }
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    if(ret == AIR_E_OK)
-    {
-        AIR_PRINT("MAC Address Age Out Time: %u seconds.\n", time);
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doDumpMacAddr(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    AIR_MAC_ENTRY_T *ptr_mt;
-    UI8_T count = 0;
-    UI32_T bucket_size = 0;
-    UI32_T total_count = 0;
-
-    if(0 != argc)
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        return AIR_E_BAD_PARAMETER;
-    }
-    /* get unit of aging time */
-    ret = air_l2_getMacBucketSize(0, &bucket_size);
-    if(ret != AIR_E_OK)
-    {
-        AIR_PRINT("Get MAC Age Time Fail!\n");
-        return ret;
-    }
-    ptr_mt = AIR_MALLOC(sizeof(AIR_MAC_ENTRY_T) * bucket_size);
-    if (NULL == ptr_mt)
-    {
-        AIR_PRINT("***Error***, allocate memory fail\n");
-        return AIR_E_OTHERS;
-    }
-    memset(ptr_mt, 0, sizeof(AIR_MAC_ENTRY_T) * bucket_size);
-    _printMacEntry(ptr_mt, 0, count, TRUE);
-    /* get 1st entry of MAC table */
-    ret = air_l2_getMacAddr(0, &count, ptr_mt);
-    switch(ret)
-    {
-        case AIR_E_ENTRY_NOT_FOUND:
-            AIR_FREE(ptr_mt);
-            AIR_PRINT("Not Found!\n");
-            return ret;
-        case AIR_E_TIMEOUT:
-            AIR_FREE(ptr_mt);
-            AIR_PRINT("Time Out!\n");
-            return ret;
-        case AIR_E_BAD_PARAMETER:
-            AIR_FREE(ptr_mt);
-            AIR_PRINT("Bad Parameter!\n");
-            return ret;
-        default:
-            break;
-    }
-    total_count += count;
-    _printMacEntry(ptr_mt, 0, count, FALSE);
-
-    /* get other entries of MAC table */
-    while(1)
-    {
-        memset(ptr_mt, 0, sizeof(AIR_MAC_ENTRY_T) * bucket_size);
-        ret = air_l2_getNextMacAddr(0, &count, ptr_mt);
-        if(AIR_E_OK != ret)
-        {
-            break;
-        }
-        total_count += count;
-        _printMacEntry(ptr_mt, 0, count, FALSE);
-    }
-    switch(ret)
-    {
-        case AIR_E_TIMEOUT:
-            AIR_PRINT("Time Out!\n");
-            break;
-        case AIR_E_BAD_PARAMETER:
-            AIR_PRINT("Bad Parameter!\n");
-            break;
-        default:
-            AIR_PRINT("Found %u %s\n", total_count, (total_count>1)?"entries":"entry");
-            break;
-    }
-    AIR_FREE(ptr_mt);
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doLagMember(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T portrunk_index = 0, member_index = 0, member_enable = 0, port_index = 0, i = 0;
-    AIR_LAG_PTGINFO_T  member;
-    memset(&member,0,sizeof(AIR_LAG_PTGINFO_T));
-
-    if(4 == argc)
-    {
-        /* lag set member <port trunk index> <member index> <member enable> <port_index>*/
-        portrunk_index  = _strtol(argv[0], NULL, 10);
-        member_index    = _strtol(argv[1], NULL, 10);
-        member_enable   = _strtol(argv[2], NULL, 10);
-        port_index      = _strtol(argv[3], NULL, 10);
-        ret = air_lag_setMember(0, portrunk_index, member_index, member_enable,port_index);
-        if(ret == AIR_E_OK)
-        {
-            AIR_PRINT("Set port trunk index %d member_index:%d member_enable:%d, port_index:%d ok.\n", portrunk_index, member_index, member_enable,port_index);
-        }
-        else
-        {
-            AIR_PRINT("Set port trunk index %d member_index:%d member_enable:%d, port_index:%d fail.\n", portrunk_index, member_index, member_enable,port_index);
-        }
-        memset(&member,0,sizeof(member));
-        air_lag_getMember(0, portrunk_index, &member);
-        if(! member.csr_gp_enable[0])
-        {
-            AIR_PRINT("\r\n!!!!!!!!!Port trunk index %d member_index:0 must be set,or else have taffic issues.\n", portrunk_index);
-        }
-    }
-    else if(1 == argc)
-    {
-        portrunk_index = _strtol(argv[0], NULL, 10);
-
-        /* lag get member <port> */
-        memset(&member,0,sizeof(member));
-        ret = air_lag_getMember(0, portrunk_index, &member);
-        if(ret == AIR_E_OK)
-        {
-            AIR_PRINT("Get port trunk %u member:\n", portrunk_index);
-            for(i = 0; i < AIR_LAG_MAX_MEM_NUM; i++)
-            {
-                if(member.csr_gp_enable[i])
-                    AIR_PRINT("port %d \r\n", member.csr_gp_port[i]);
-            }
-            AIR_PRINT("\r\n");
-        }
-        else
-        {
-            AIR_PRINT("Get port trunk:%u Member Fail.\n", portrunk_index);
-        }
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    return ret;
-}
-
-
-static AIR_ERROR_NO_T
-doLagDstInfo(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    AIR_LAG_DISTINFO_T dstInfo;
-
-    memset(&dstInfo, 0, sizeof(AIR_LAG_DISTINFO_T));
-    if(7 == argc)
-    {
-        /* lag set dstInfo <sp> <sa> <da> <sip> <dip> <sport> <dport> */
-        dstInfo.sp = _strtol(argv[0], NULL, 10) & BIT(0);
-        dstInfo.sa = _strtol(argv[1], NULL, 10) & BIT(0);
-        dstInfo.da = _strtol(argv[2], NULL, 10) & BIT(0);
-        dstInfo.sip = _strtol(argv[3], NULL, 10) & BIT(0);
-        dstInfo.dip = _strtol(argv[4], NULL, 10) & BIT(0);
-        dstInfo.sport = _strtol(argv[5], NULL, 10) & BIT(0);
-        dstInfo.dport = _strtol(argv[6], NULL, 10) & BIT(0);
-        ret = air_lag_setDstInfo(0, dstInfo);
-        if(ret == AIR_E_OK)
-        {
-            AIR_PRINT("Set LAG packet distrubution.\n");
-        }
-        else
-        {
-            AIR_PRINT("Set LAG packet distrubution Fail.\n");
-        }
-    }
-    else if(0 == argc)
-    {
-        /* lag get dstInfo */
-        ret = air_lag_getDstInfo(0, &dstInfo);
-        if(ret == AIR_E_OK)
-        {
-            AIR_PRINT("Get LAG packet distrubution:\n");
-        }
-        else
-        {
-            AIR_PRINT("Get LAG packet distrubution Fail.\n");
-        }
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-    if(ret == AIR_E_OK)
-    {
-        AIR_PRINT("%-5s|%-5s|%-5s|%-5s|%-5s|%-5s|%-5s\n",
-                "SP", "SA", "DA", "SIP", "DIP", "SPORT", "DPORT");
-        AIR_PRINT("%-5s|%-5s|%-5s|%-5s|%-5s|%-5s|%-5s\n",
-                (dstInfo.sp)?"En":"Dis",
-                (dstInfo.sa)?"En":"Dis",
-                (dstInfo.da)?"En":"Dis",
-                (dstInfo.sip)?"En":"Dis",
-                (dstInfo.dip)?"En":"Dis",
-                (dstInfo.sport)?"En":"Dis",
-                (dstInfo.dport)?"En":"Dis");
-    }
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doLagHashtype(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T hashtype = 0;
-
-    if(1 == argc)
-    {
-        hashtype = _strtol(argv[0], NULL, 10);
-        ret = air_lag_sethashtype(0, hashtype);
-        if(ret == AIR_E_OK)
-        {
-            AIR_PRINT("Set LAG hashtype Ok.\n");
-        }
-        else
-        {
-            AIR_PRINT("Set LAG hashtype Fail.\n");
-        }
-    }
-    else if(0 == argc)
-    {
-        /* lag get dstInfo */
-        ret = air_lag_gethashtype(0, &hashtype);
-        if(ret == AIR_E_OK)
-        {
-            AIR_PRINT("Get LAG hashtype:\n");
-        }
-        else
-        {
-            AIR_PRINT("Get LLAG hashtype Fail.\n");
-        }
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-    if(ret == AIR_E_OK)
-    {
-        switch (hashtype)
-        {
-            case 0:
-                AIR_PRINT("hashtype:crc32lsb.\n");
-                break;
-            case 1:
-                AIR_PRINT("hashtype:crc32msb.\n");
-                break;
-            case 2:
-                AIR_PRINT("hashtype:crc16.\n");
-                break;
-            case 3:
-                AIR_PRINT("hashtype:xor4.\n");
-                break;
-            default:
-                AIR_PRINT("wrong hashtype:%d.\n",hashtype);
-        }
-
-    }
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doLagPtseed(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T ptseed = 0;
-
-    if(1 == argc)
-    {
-        ptseed = _strtol(argv[0], NULL, 16);
-        ret = air_lag_setPTSeed(0, ptseed);
-        if(ret == AIR_E_OK)
-        {
-            AIR_PRINT("Set LAG Port Seed:%x(hex) ok\n",ptseed);
-        }
-        else
-        {
-            AIR_PRINT("Set LAG Port Seed:%x(hex) fail\n",ptseed);
-        }
-    }
-    else if(0 == argc)
-    {
-        /* lag get seed */
-        ret = air_lag_getPTSeed(0, &ptseed);
-        if(ret == AIR_E_OK)
-        {
-            AIR_PRINT("Get port trunk seed: %x(hex)\n",ptseed);
-        }
-        else
-        {
-            AIR_PRINT("Get port trunk seed Fail.\n");
-        }
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doLagSpsel(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T port = 0;
-    UI32_T state = 0;
-
-    if(1 == argc)
-    {
-        /* lag set spsel <state> */
-        state = _strtol(argv[0], NULL, 10);
-        ret = air_lag_setSpSel(0,state);
-        if(ret == AIR_E_OK)
-        {
-            AIR_PRINT("Set source port compare function:%s.\n", (state)?"Enabled":"Disabled");
-        }
-        else
-        {
-            AIR_PRINT("Set source port compare function Fail.\n");
-        }
-    }
-    else if(0 == argc)
-    {
-        /* lag get spsel*/
-        ret = air_lag_getSpSel(0, &state);
-        if(ret == AIR_E_OK)
-        {
-            AIR_PRINT("Get source port compare function:%s.\n", (state)?"Enabled":"Disabled");
-        }
-        else
-        {
-            AIR_PRINT("Get source port compare function Fail.\n");
-        }
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    return ret;
-}
-
-
-static AIR_ERROR_NO_T
-doLagState(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T port = 0;
-    UI32_T state = 0;
-
-    if(1 == argc)
-    {
-        /* lag set state <state> */
-        state = _strtol(argv[0], NULL, 10);
-        ret = air_lag_set_ptgc_state(0,state);
-        if(ret == AIR_E_OK)
-        {
-            AIR_PRINT("Set LAG Port Trunk State:%s.\n", (state)?"Enabled":"Disabled");
-        }
-        else
-        {
-            AIR_PRINT("Set LAG Port Trunk State Fail.\n");
-        }
-    }
-    else if(0 == argc)
-    {
-        /* lag get state*/
-        ret = air_lag_get_ptgc_state(0, &state);
-        if(ret == AIR_E_OK)
-        {
-            AIR_PRINT("Get LAG Port Trunk State:%s.\n", (state)?"Enabled":"Disabled");
-        }
-        else
-        {
-            AIR_PRINT("Get LAG Port Trunk State Fail.\n");
-        }
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doLagGet(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(lagGetCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doLagSet(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(lagSetCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doLag(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(lagCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doStpPortstate(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T port = 0;
-    UI32_T fid = 0;
-    UI32_T state = 0;
-
-    port = _strtol(argv[0], NULL, 10);
-    fid = _strtol(argv[1], NULL, 10);
-    if(3 == argc)
-    {
-        /* stp set portstate <port> <fid(0..15)> <state> */
-        state = _strtol(argv[2], NULL, 10);
-        ret = air_stp_setPortstate(0, port, fid, state);
-        if(ret == AIR_E_OK)
-        {
-            AIR_PRINT("Set STP Port:%u FID:%u State:", port, fid);
-            switch(state)
-            {
-                case AIR_STP_STATE_DISABLE:
-                    AIR_PRINT("Disable(STP) / Discard(RSTP).\n");
-                    break;
-                case AIR_STP_STATE_LISTEN:
-                    AIR_PRINT("Listening(STP) / Discard(RSTP).\n");
-                    break;
-                case AIR_STP_STATE_LEARN:
-                    AIR_PRINT("Learning(STP) / Learning(RSTP).\n");
-                    break;
-                case AIR_STP_STATE_FORWARD:
-                    AIR_PRINT("Forwarding(STP) / Forwarding(RSTP).\n");
-                    break;
-                default:
-                    break;
-            }
-        }
-        else
-        {
-            AIR_PRINT("Set STP Port:%u FID:%u State Fail.", port, fid);
-        }
-    }
-    else if(2 == argc)
-    {
-        /* stp get portstate <port> <fid(0..15)> */
-        ret = air_stp_getPortstate(0, port, fid, &state);
-        if(ret == AIR_E_OK)
-        {
-            AIR_PRINT("Get STP Port:%u FID:%u State:", port, fid);
-            switch(state)
-            {
-                case AIR_STP_STATE_DISABLE:
-                    AIR_PRINT("Disable(STP) / Discard(RSTP).\n");
-                    break;
-                case AIR_STP_STATE_LISTEN:
-                    AIR_PRINT("Listening(STP) / Discard(RSTP).\n");
-                    break;
-                case AIR_STP_STATE_LEARN:
-                    AIR_PRINT("Learning(STP) / Learning(RSTP).\n");
-                    break;
-                case AIR_STP_STATE_FORWARD:
-                    AIR_PRINT("Forwarding(STP) / Forwarding(RSTP).\n");
-                    break;
-                default:
-                    break;
-            }
-        }
-        else
-        {
-            AIR_PRINT("Get STP Port:%u FID:%u State Fail.", port, fid);
-        }
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doStpGet(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(stpGetCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doStpSet(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(stpSetCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doStp(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(stpCmds, argc, argv);
-}
-
-static void
-_mir_printPortList(UI32_T * mt)
-{
-    I8_T j = 0;
-    UI8_T first = 0;
-    UI8_T find = 0;
-    for(j = (AIR_MAX_NUM_OF_PORTS - 1); j >= 0; j--)
-    {
-        if((*mt) & (1 << j))
-        {
-            first = j;
-            find = 1;
-            break;
-        }
-    }
-    if(find)
-    {
-        for(j = 0; j < AIR_MAX_NUM_OF_PORTS; j++)
-        {
-            if((*mt) & (1 << j))
-            {
-                if(j == first)
-                    AIR_PRINT("%-2d", j);
-                else
-                    AIR_PRINT("%-2d,", j);
-            }
-        }
-    }
-    else
-        AIR_PRINT("NULL");
-    AIR_PRINT("\n");
-}
-
-static void
-_mir_printSrcPortList(
-    const UI32_T         unit,
-    const UI32_T         sessionid)
-{
-
-    I8_T i = 0;
-    AIR_MIR_SESSION_T   session;
-    AIR_PORT_BITMAP_T txPbm = {0}, rxPbm = {0};
-
-    for(i = 0; i < AIR_MAX_NUM_OF_PORTS; i++)
-    {
-         memset(&session, 0, sizeof(session));
-         session.src_port = i;
-         air_mir_getMirrorPort(unit, sessionid, &session);
-
-         if(session.flags & AIR_MIR_SESSION_FLAGS_DIR_TX)
-         {
-            txPbm[0] |= (1 << i);
-         }
-         if(session.flags & AIR_MIR_SESSION_FLAGS_DIR_RX)
-         {
-            rxPbm[0] |= (1 << i);
-         }
-    }
-    AIR_PRINT("Src PortList\n");
-    AIR_PRINT(" - Rx portlist = ");
-    _mir_printPortList(rxPbm);
-    AIR_PRINT(" - Tx portlist = ");
-    _mir_printPortList(txPbm);
-}
-
-static void
-_mir_printSession(
-    const UI32_T            unit,
-    const UI32_T            session_id,
-    const AIR_MIR_SESSION_T *ptr_session)
-{
-
-    AIR_PRINT("Session id: %d\n", session_id);
-    AIR_PRINT("State: %s \n", (ptr_session->flags & AIR_MIR_SESSION_FLAGS_ENABLE)? "enable": "disable");
-    AIR_PRINT("Tx tag: %s \n", (ptr_session->flags & AIR_MIR_SESSION_FLAGS_TX_TAG_OBEY_CFG)? "On": "Off");
-    AIR_PRINT("Dst port: %d \n", ptr_session->dst_port);
-    _mir_printSrcPortList(unit,session_id);
-}
-
-static AIR_ERROR_NO_T
-doMirrorGetSid(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T      rc = AIR_E_OK;
-    UI32_T              session_id = 0;
-    AIR_MIR_SESSION_T   session = {0};
-    I8_T i = 0;
-
-    session_id = _strtoul(argv[0], NULL, 0);
-    rc = air_mir_getSession(0, session_id, &session);
-    if (AIR_E_OK != rc)
-    {
-        AIR_PRINT("***Error***, get mirror session fail\n");
-        return rc;
-    }
-    /* print session information */
-    if(session.dst_port == AIR_PORT_INVALID)
-    {
-        AIR_PRINT("Session id %d not found\n", session_id);
-    }
-    else
-    {
-        _mir_printSession(0, session_id, &session);
-    }
-    return rc;
-}
-
-static AIR_ERROR_NO_T
-doMirrorDelSid(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T      rc = AIR_E_OK;
-    UI32_T              session_id = 0;
-    AIR_MIR_SESSION_T   session = {0};
-    UI8_T i = 0;
-
-    session_id = _strtoul(argv[0], NULL, 0);
-    rc = air_mir_delSession(0, session_id);
-    if (AIR_E_OK != rc)
-    {
-        AIR_PRINT("***Error***, del mirror session fail\n");
-        return rc;
-    }
-    for(i = 0; i < AIR_MAX_NUM_OF_PORTS; i++)
-    {
-        session.src_port = i;
-        rc = air_mir_setMirrorPort(0, session_id, &session);
-        if (AIR_E_OK != rc)
-        {
-            AIR_PRINT("***Error***,port=%u error\n", i);
-            return rc;
-        }
-    }
-    if (rc != AIR_E_OK)
-    {
-        AIR_PRINT("***Error***, delete mirror session fail\n");
-    }
-    else
-        AIR_PRINT("***OK***, delete mirror session success\n");
-
-    return rc;
-}
-
-static AIR_ERROR_NO_T
-doMirrorAddRlist(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T      rc = AIR_E_OK;
-    UI32_T              session_id = 0;
-    AIR_MIR_SESSION_T   session = {0};
-    AIR_PORT_BITMAP_T rxPbm = {0};
-    UI8_T i = 0;
-
-    /*mirror add session-rlist <sid(0..3)> <list(UINTLIST)>*/
-    session_id = _strtoul(argv[0], NULL, 0);
-    rc = _portListStr2Ary(argv[1], rxPbm, 1);
-    if(rc != AIR_E_OK)
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        return rc;
-    }
-    if(!rxPbm[0])
-    {
-        for(i = 0; i < AIR_MAX_NUM_OF_PORTS; i++)
-        {
-            memset(&session, 0, sizeof(AIR_MIR_SESSION_T));
-            session.src_port = i;
-            rc = air_mir_getMirrorPort(0, session_id, &session);
-            if (AIR_E_OK != rc)
-            {
-                AIR_PRINT("***Error***,get port=%u error\n", i);
-                return rc;
-            }
-
-            session.flags &= ~AIR_MIR_SESSION_FLAGS_DIR_RX;
-            session.src_port = i;
-            rc = air_mir_setMirrorPort(0, session_id, &session);
-            if (AIR_E_OK != rc)
-            {
-                AIR_PRINT("***Error***,set rx port=%u error\n", i);
-                return rc;
-            }
-        }
-    }
-    else
-    {
-        for(i = 0; i < AIR_MAX_NUM_OF_PORTS; i++)
-        {
-            if(rxPbm[0] & (1 << i))
-            {
-                memset(&session, 0, sizeof(AIR_MIR_SESSION_T));
-                session.src_port = i;
-                rc = air_mir_getMirrorPort(0, session_id, &session);
-                if (AIR_E_OK != rc)
-                {
-                    AIR_PRINT("***Error***,get port=%u error\n", i);
-                    return rc;
-                }
-
-                session.flags |= AIR_MIR_SESSION_FLAGS_DIR_RX;
-                session.src_port = i;
-                rc = air_mir_setMirrorPort(0, session_id, &session);
-                if (AIR_E_OK != rc)
-                {
-                    AIR_PRINT("***Error***,port=%u error\n", i);
-                    return rc;
-                }
-            }
-        }
-    }
-
-    return rc;
-}
-
-static AIR_ERROR_NO_T
-doMirrorAddTlist(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T      rc = AIR_E_OK;
-    UI32_T              session_id = 0;
-    AIR_MIR_SESSION_T   session = {0};
-    AIR_PORT_BITMAP_T txPbm = {0};
-    UI8_T i = 0;
-
-    /*mirror add session-tlist <sid(0..3)> <list(UINTLIST)>*/
-    session_id = _strtoul(argv[0], NULL, 0);
-    rc = _portListStr2Ary(argv[1], txPbm, 1);
-    if(rc != AIR_E_OK)
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        return rc;
-    }
-    if(!txPbm[0])
-    {
-        for(i = 0; i < AIR_MAX_NUM_OF_PORTS; i++)
-        {
-            memset(&session, 0, sizeof(AIR_MIR_SESSION_T));
-            session.src_port = i;
-            rc = air_mir_getMirrorPort(0, session_id, &session);
-            if (AIR_E_OK != rc)
-            {
-                AIR_PRINT("***Error***,get port=%u error\n", i);
-                return rc;
-            }
-
-            session.flags &= ~AIR_MIR_SESSION_FLAGS_DIR_TX;
-            session.src_port = i;
-            rc = air_mir_setMirrorPort(0, session_id, &session);
-            if (AIR_E_OK != rc)
-            {
-                AIR_PRINT("***Error***,set rx port=%u error\n", i);
-                return rc;
-            }
-        }
-    }
-    else
-    {
-        for(i = 0; i < AIR_MAX_NUM_OF_PORTS; i++)
-        {
-            if(txPbm[0] & (1 << i))
-            {
-                memset(&session, 0, sizeof(AIR_MIR_SESSION_T));
-                session.src_port = i;
-                rc = air_mir_getMirrorPort(0, session_id, &session);
-                if (AIR_E_OK != rc)
-                {
-                    AIR_PRINT("***Error***,get port=%u error\n", i);
-                    return rc;
-                }
-
-                session.flags |= AIR_MIR_SESSION_FLAGS_DIR_TX;
-                session.src_port = i;
-                rc = air_mir_setMirrorPort(0, session_id, &session);
-                if (AIR_E_OK != rc)
-                {
-                    AIR_PRINT("***Error***,port=%u error\n", i);
-                    return rc;
-                }
-            }
-        }
-    }
-
-    return rc;
-}
-
-static AIR_ERROR_NO_T
-doMirrorSetSessionEnable(
-    UI32_T argc,
-    C8_T *argv[])
-
-{
-    AIR_ERROR_NO_T      rc = AIR_E_OK;
-    UI32_T              session_id = 0;
-    UI32_T              enable = 0;
-    BOOL_T              tmp_en = FALSE;
-
-    /*mirror set session-enable <sid(0..3)> <state(1:En,0:Dis)>*/
-    session_id = _strtoul(argv[0], NULL, 0);
-    enable = _strtoul(argv[1], NULL, 0);
-    if(enable)
-        tmp_en = TRUE;
-    /* set port mirror state */
-    rc = air_mir_setSessionAdminMode(0, session_id, tmp_en);
-    if(AIR_E_OK!=rc)
-    {
-        AIR_PRINT("***Error***\n");
-    }
-    return rc;
-}
-
-static AIR_ERROR_NO_T
-doMirrorSetSession(
-    UI32_T argc,
-    C8_T *argv[])
-{
-    AIR_ERROR_NO_T      rc = AIR_E_OK;
-    UI32_T              session_id = 0;
-    UI32_T              dst_port = 0;
-    UI8_T               enable = 0;
-    UI8_T               tag_en = 0;
-    UI8_T               dir = 0;
-    AIR_MIR_SESSION_T  session = {0};
-    AIR_PORT_BITMAP_T   rxPbm = {0};
-    I8_T               i = 0;
-
-    /*mirror set session <sid(0..3)> <dst_port(UINT)> <state(1:En,0:Dis)> <tag(1:on, 0:off)> <list(UINTLIST)> <dir(0:none,1:tx,2:rx,3:both)>*/
-    session_id = _strtoul(argv[0], NULL, 0);
-    dst_port = _strtoul(argv[1], NULL, 0);
-    AIR_PRINT("session id %d dst port %d.\n", session_id, dst_port);
-    session.dst_port = dst_port;
-    enable = _strtoul(argv[2], NULL, 0);
-    if(enable)
-    {
-        session.flags |= AIR_MIR_SESSION_FLAGS_ENABLE;
-    }
-    else
-    {
-        session.flags &= ~AIR_MIR_SESSION_FLAGS_ENABLE;
-    }
-    tag_en = _strtoul(argv[3], NULL, 0);
-    if(tag_en)
-    {
-        session.flags |= AIR_MIR_SESSION_FLAGS_TX_TAG_OBEY_CFG;
-    }
-    else
-    {
-        session.flags &= ~AIR_MIR_SESSION_FLAGS_TX_TAG_OBEY_CFG;
-    }
-    rc = _portListStr2Ary(argv[4], rxPbm, 1);
-    if(rc != AIR_E_OK)
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        return rc;
-    }
-    AIR_PRINT("pbm %x.\n", rxPbm);
-    dir = _strtoul(argv[5], NULL, 0);
-    if(dir == 1)
-    {
-        session.flags |= AIR_MIR_SESSION_FLAGS_DIR_TX;
-    }
-    else if(dir == 2)
-    {
-        session.flags |= AIR_MIR_SESSION_FLAGS_DIR_RX;
-    }
-    else if(dir == 3)
-    {
-        session.flags |= AIR_MIR_SESSION_FLAGS_DIR_TX;
-        session.flags |= AIR_MIR_SESSION_FLAGS_DIR_RX;
-    }
-    else if (!dir)
-    {
-        session.flags &= ~AIR_MIR_SESSION_FLAGS_DIR_TX;
-        session.flags &= ~AIR_MIR_SESSION_FLAGS_DIR_RX;
-    }
-    else
-    {
-        return AIR_E_BAD_PARAMETER;
-    }
-    for(i = 0; i < AIR_MAX_NUM_OF_PORTS; i++)
-    {
-        if(rxPbm[0] & (1 << i))
-        {
-            session.src_port = i;
-            /* set port mirror session */
-            rc = air_mir_addSession(0, session_id, &session);
-
-            if(AIR_E_OK!=rc)
-            {
-                AIR_PRINT("***Error***,dst-port=%u, src-port=%u error\n", session.dst_port, session.src_port);
-                return rc;
-            }
-            else
-                AIR_PRINT("add session %d,dst-port=%u, src-port=%u\n", session_id, session.dst_port, session.src_port);
-        }
-    }
-
-    return rc;
-}
-
-
-
-static AIR_ERROR_NO_T
-doMirrorSet(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(mirrorSetCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doMirrorAdd(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(mirrorAddCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doMirrorGet(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(mirrorGetCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doMirrorDel(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(mirrorDelCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doMirror(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(mirrorCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doMibClearPort(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T port = 0;
-
-    if(1 == argc)
-    {
-        /* mib clear port */
-        port = _strtoul(argv[0], NULL, 0);
-        ret = air_mib_clear_by_port(0,port);
-        AIR_PRINT("Clear port %d mib stats",port);
-        if(AIR_E_OK == ret)
-        {
-            AIR_PRINT("Done.\n");
-        }
-        else
-        {
-            AIR_PRINT("Fail.\n");
-        }
-    }
-    else if(0 == argc)
-    {
-        /*restart mib counter*/
-        air_mib_clear(0);
-        AIR_PRINT("Clear all mib stats",port);
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doMibClearAcl(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T port = 0;
-
-    if(0 == argc)
-    {
-        /* mib clear acl */
-        ret = air_mib_clearAclEvent(0);
-        AIR_PRINT("Clear ACL Event Counter ");
-        if(AIR_E_OK == ret)
-        {
-            AIR_PRINT("Done.\n");
-        }
-        else
-        {
-            AIR_PRINT("Fail.\n");
-        }
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doMibGetPort(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T port = 0;
-    UI32_T tmp32 = 0xffffffff;
-    AIR_MIB_CNT_RX_T rx_mib = {0};
-    AIR_MIB_CNT_TX_T tx_mib = {0};
-
-    port = _strtoul(argv[0], NULL, 0);
-    if(1 == argc)
-    {
-        /* mib get <port(0..6)> */
-        ret = air_mib_get(0, port, &rx_mib, &tx_mib);
-        AIR_PRINT("Get MIB Counter of Port %u ", port);
-        if(AIR_E_OK == ret)
-        {
-            AIR_PRINT("Done.\n");
-            AIR_PRINT("RX Drop Packet                    : %u\n", rx_mib.RDPC);
-            AIR_PRINT("RX filtering Packet               : %u\n", rx_mib.RFPC);
-            AIR_PRINT("RX Unicast Packet                 : %u\n", rx_mib.RUPC);
-            AIR_PRINT("RX Multicast Packet               : %u\n", rx_mib.RMPC);
-            AIR_PRINT("RX Broadcast Packet               : %u\n", rx_mib.RBPC);
-            AIR_PRINT("RX Alignment Error Packet         : %u\n", rx_mib.RAEPC);
-            AIR_PRINT("RX CRC Packet                     : %u\n", rx_mib.RCEPC);
-            AIR_PRINT("RX Undersize Packet               : %u\n", rx_mib.RUSPC);
-            AIR_PRINT("RX Fragment Error Packet          : %u\n", rx_mib.RFEPC);
-            AIR_PRINT("RX Oversize Packet                : %u\n", rx_mib.ROSPC);
-            AIR_PRINT("RX Jabber Error Packet            : %u\n", rx_mib.RJEPC);
-            AIR_PRINT("RX Pause Packet                   : %u\n", rx_mib.RPPC);
-            AIR_PRINT("RX Packet Length 64 bytes         : %u\n", rx_mib.RL64PC);
-            AIR_PRINT("RX Packet Length 65 ~ 127 bytes   : %u\n", rx_mib.RL65PC);
-            AIR_PRINT("RX Packet Length 128 ~ 255 bytes  : %u\n", rx_mib.RL128PC);
-            AIR_PRINT("RX Packet Length 256 ~ 511 bytes  : %u\n", rx_mib.RL256PC);
-            AIR_PRINT("RX Packet Length 512 ~ 1023 bytes : %u\n", rx_mib.RL512PC);
-            AIR_PRINT("RX Packet Length 1024 ~ 1518 bytes: %u\n", rx_mib.RL1024PC);
-            AIR_PRINT("RX Packet Length 1519 ~ max bytes : %u\n", rx_mib.RL1519PC);
-            AIR_PRINT("RX_CTRL Drop Packet               : %u\n", rx_mib.RCDPC);
-            AIR_PRINT("RX Ingress Drop Packet            : %u\n", rx_mib.RIDPC);
-            AIR_PRINT("RX ARL Drop Packet                : %u\n", rx_mib.RADPC);
-            AIR_PRINT("FLow Control Drop Packet          : %u\n", rx_mib.FCDPC);
-            AIR_PRINT("WRED Drop Packtet                 : %u\n", rx_mib.WRDPC);
-            AIR_PRINT("Mirror Drop Packet                : %u\n", rx_mib.MRDPC);
-            AIR_PRINT("RX  sFlow Sampling Packet         : %u\n", rx_mib.SFSPC);
-            AIR_PRINT("Rx sFlow Total Packet             : %u\n", rx_mib.SFTPC);
-            AIR_PRINT("Port Control Drop Packet          : %u\n", rx_mib.RXC_DPC);
-            AIR_PRINT("RX Octets good or bad packtes l32 : %u\n", (UI32_T)(rx_mib.ROC & tmp32));
-            AIR_PRINT("RX Octets good or bad packtes h32 : %u\n", (UI32_T)((rx_mib.ROC >> 32) & tmp32));
-            AIR_PRINT("RX Octets bad packets l32         : %u\n", (UI32_T)(rx_mib.ROC2 & tmp32));
-            AIR_PRINT("RX Octets bad packets h32         : %u\n", (UI32_T)((rx_mib.ROC2 >> 32) & tmp32));
-            AIR_PRINT("\n");
-            AIR_PRINT("TX Drop Packet                    : %u\n", tx_mib.TDPC);
-            AIR_PRINT("TX CRC Packet                     : %u\n", tx_mib.TCRC);
-            AIR_PRINT("TX Unicast Packet                 : %u\n", tx_mib.TUPC);
-            AIR_PRINT("TX Multicast Packet               : %u\n", tx_mib.TMPC);
-            AIR_PRINT("TX Broadcast Packet               : %u\n", tx_mib.TBPC);
-            AIR_PRINT("TX Collision Event Count          : %u\n", tx_mib.TCEC);
-            AIR_PRINT("TX Single Collision Event Count   : %u\n", tx_mib.TSCEC);
-            AIR_PRINT("TX Multiple Conllision Event Count: %u\n", tx_mib.TMCEC);
-            AIR_PRINT("TX Deferred Event Count           : %u\n", tx_mib.TDEC);
-            AIR_PRINT("TX Late Collision Event Count     : %u\n", tx_mib.TLCEC);
-            AIR_PRINT("TX Excessive Collision Event Count: %u\n", tx_mib.TXCEC);
-            AIR_PRINT("TX Pause Packet                   : %u\n", tx_mib.TPPC);
-            AIR_PRINT("TX Packet Length 64 bytes         : %u\n", tx_mib.TL64PC);
-            AIR_PRINT("TX Packet Length 65 ~ 127 bytes   : %u\n", tx_mib.TL65PC);
-            AIR_PRINT("TX Packet Length 128 ~ 255 bytes  : %u\n", tx_mib.TL128PC);
-            AIR_PRINT("TX Packet Length 256 ~ 511 bytes  : %u\n", tx_mib.TL256PC);
-            AIR_PRINT("TX Packet Length 512 ~ 1023 bytes : %u\n", tx_mib.TL512PC);
-            AIR_PRINT("TX Packet Length 1024 ~ 1518 bytes: %u\n", tx_mib.TL1024PC);
-            AIR_PRINT("TX Packet Length 1519 ~ max bytes : %u\n", tx_mib.TL1519PC);
-            AIR_PRINT("TX Oversize Drop Packet           : %u\n", tx_mib.TODPC);
-            AIR_PRINT("TX Octets good or bad packtes l32 : %u\n", (UI32_T)(tx_mib.TOC & tmp32));
-            AIR_PRINT("TX Octets good or bad packtes h32 : %u\n", (UI32_T)((tx_mib.TOC >> 32) & tmp32));
-            AIR_PRINT("TX Octets bad packets l32         : %u\n", (UI32_T)(tx_mib.TOC2 & tmp32));
-            AIR_PRINT("TX Octets bad packets h32         : %u\n", (UI32_T)((tx_mib.TOC2 >> 32) & tmp32));
-        }
-        else
-        {
-            AIR_PRINT("Fail.\n");
-        }
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doMibGetAcl(
-    UI32_T argc,
-    C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T event = 0;
-    UI32_T cnt = 0;
-
-    if(1 == argc)
-    {
-        /* mib get acl <event(0..7)> */
-        event = _strtoul(argv[0], NULL, 0);
-        ret = air_mib_getAclEvent(0, event, &cnt);
-        AIR_PRINT("Get counter of ACL event %u ", event);
-        if(AIR_E_OK == ret)
-        {
-            AIR_PRINT("Done.\n");
-            AIR_PRINT("ACL Event Counter:%u\n", cnt);
-        }
-        else
-        {
-            AIR_PRINT("Fail.\n");
-        }
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doMibClear(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(mibClearCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doMibGet(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(mibGetCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doMib(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(mibCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doQosRateLimitExMngFrm(
-    UI32_T argc,
-    C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T dir = 0;
-    BOOL_T enable = FALSE;
-
-    dir = _strtoul(argv[0], NULL, 0);
-    if(2 == argc)
-    {
-        if(dir == 0)
-            dir = AIR_QOS_RATE_DIR_EGRESS;
-        else if(dir == 1)
-            dir = AIR_QOS_RATE_DIR_INGRESS;
-        else
-        {
-            AIR_PRINT("Unrecognized command.\n");
-            ret = AIR_E_BAD_PARAMETER;
-            return ret;
-        }
-        enable = _strtoul(argv[1], NULL, 0);
-        ret = air_qos_setRateLimitExMngFrm(0, dir, enable);
-        if(ret == AIR_E_OK)
-        {
-            AIR_PRINT("Success.\n");
-            AIR_PRINT("Set %s Rate Limit Control %s management frame.\n",
-                    (AIR_QOS_RATE_DIR_INGRESS == dir)?"Ingress":"Egress",
-                    (TRUE == enable)?"exclude":"include");
-        }
-        else
-        {
-            AIR_PRINT("Fail.\n");
-            return ret;
-        }
-    }
-    else if(0 == argc)
-    {
-        dir = AIR_QOS_RATE_DIR_EGRESS;
-        ret = air_qos_getRateLimitExMngFrm(0, dir, &enable);
-        if(ret == AIR_E_OK)
-        {
-            AIR_PRINT("Success.\n");
-            AIR_PRINT("Get %s Rate Limit Control %s management frame.\n",
-                    (AIR_QOS_RATE_DIR_INGRESS == dir)?"Ingress":"Egress",
-                    (TRUE == enable)?"exclude":"include");
-        }
-        else
-        {
-            AIR_PRINT("Fail.\n");
-            return ret;
-        }
-        dir = AIR_QOS_RATE_DIR_INGRESS;
-        ret = air_qos_getRateLimitExMngFrm(0, dir, &enable);
-        if(ret == AIR_E_OK)
-        {
-            AIR_PRINT("Success.\n");
-            AIR_PRINT("Get %s Rate Limit Control %s management frame.\n",
-                    (AIR_QOS_RATE_DIR_INGRESS == dir)?"Ingress":"Egress",
-                    (TRUE == enable)?"exclude":"include");
-        }
-        else
-        {
-            AIR_PRINT("Fail.\n");
-            return ret;
-        }
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    return ret;
-
-}
-
-static AIR_ERROR_NO_T
-doQosPortPriority(
-    UI32_T argc,
-    C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    AIR_PORT_BITMAP_T portlist = {0};
-    UI32_T priority = 0;
-    UI8_T i = 0;
-
-    ret = _portListStr2Ary(argv[0], portlist, 1);
-    if(ret != AIR_E_OK)
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        return ret;
-    }
-    if(2 == argc)
-    {
-        priority = _strtoul(argv[1], NULL, 0);
-        for(i = 0; i < AIR_MAX_NUM_OF_PORTS; i++)
-        {
-            if(portlist[0] & (1 << i))
-            {
-                ret = air_qos_setPortPriority(0, i, priority);
-                if(ret == AIR_E_OK)
-                {
-                    AIR_PRINT("Set Port%02d port based priority %d Success.\n", i, priority);
-                }
-                else
-                {
-                    AIR_PRINT("Set Port%02d port based priority %d Fail.\n", i, priority);
-                }
-            }
-        }
-    }
-    else if(1 == argc)
-    {
-        for(i = 0; i < AIR_MAX_NUM_OF_PORTS; i++)
-        {
-            if(portlist[0] & (1 << i))
-            {
-                ret = air_qos_getPortPriority(0, i, &priority);
-                if(ret == AIR_E_OK)
-                {
-                    AIR_PRINT("Get Port%d port based priority %d.\n", i, priority);
-                }
-                else
-                {
-                    AIR_PRINT("Get Port%d port based priority Fail.\n", i);
-                }
-            }
-        }
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doQosRateLimit(
-    UI32_T argc,
-    C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    AIR_PORT_BITMAP_T portlist = {0};
-    AIR_QOS_RATE_LIMIT_CFG_T rl = {0};
-    UI8_T i = 0;
-
-    ret = _portListStr2Ary(argv[0], portlist, 1);
-    if(ret != AIR_E_OK)
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        return ret;
-    }
-    if(5 == argc)
-    {
-        rl.ingress_cir = _strtoul(argv[1], NULL, 0);
-        rl.ingress_cbs = _strtoul(argv[2], NULL, 0);
-        rl.egress_cir = _strtoul(argv[3], NULL, 0);
-        rl.egress_cbs = _strtoul(argv[4], NULL, 0);
-        rl.flags |= AIR_QOS_RATE_LIMIT_CFG_FLAGS_ENABLE_INGRESS;
-        rl.flags |= AIR_QOS_RATE_LIMIT_CFG_FLAGS_ENABLE_EGRESS;
-        for(i = 0; i < AIR_MAX_NUM_OF_PORTS; i++)
-        {
-            if(portlist[0] & (1 << i))
-            {
-                ret = air_qos_setRateLimit(0, i, &rl);
-                if(ret == AIR_E_OK)
-                {
-                    AIR_PRINT("Set Port%02d Ingress CIR %d CBS %d Egress CIR %d CBS %d Success.\n", i, rl.ingress_cir, rl.ingress_cbs, rl.egress_cir, rl.egress_cbs);
-                }
-                else
-                {
-                    AIR_PRINT("Set Port%02d Ingress CIR %d CBS %d Egress CIR %d CBS %d Fail.\n", i, rl.ingress_cir, rl.ingress_cbs, rl.egress_cir, rl.egress_cbs);
-                }
-            }
-        }
-    }
-    else if(1 == argc)
-    {
-        for(i = 0; i < AIR_MAX_NUM_OF_PORTS; i++)
-        {
-            if(portlist[0] & (1 << i))
-            {
-                ret = air_qos_getRateLimit(0, i, &rl);
-                if(ret == AIR_E_OK)
-                {
-                    AIR_PRINT("Get Port%02d Ingress CIR %d CBS %d Egress CIR %d CBS %d\n", i, rl.ingress_cir, rl.ingress_cbs, rl.egress_cir, rl.egress_cbs);
-                }
-                else
-                {
-                    AIR_PRINT("Get Port%02d Rate Info Fail.\n", i);
-                }
-            }
-        }
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doQosRateLimitEnable(
-    UI32_T argc,
-    C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    AIR_PORT_BITMAP_T portlist = {0};
-    C8_T sten[2][10] = {"Disable", "Enable"};
-    C8_T stdir[2][10] = {"Egress", "Ingress"};
-    UI32_T dir = 0, en = 0;
-    AIR_QOS_RATE_DIR_T tmp_dir = AIR_QOS_RATE_DIR_LAST;
-    BOOL_T state = FALSE;
-    UI8_T i = 0;
-
-    ret = _portListStr2Ary(argv[0], portlist, 1);
-    if(ret != AIR_E_OK)
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        return ret;
-    }
-    if(3 == argc)
-    {
-        dir = _strtoul(argv[1], NULL, 0);
-        en = _strtoul(argv[2], NULL, 0);
-        if(dir == 0)
-            tmp_dir = AIR_QOS_RATE_DIR_EGRESS;
-        else if(dir == 1)
-            tmp_dir = AIR_QOS_RATE_DIR_INGRESS;
-        else
-        {
-            AIR_PRINT("Unrecognized command.\n");
-            return AIR_E_BAD_PARAMETER;
-        }
-        if(en)
-            state= TRUE;
-        else
-            state = FALSE;
-
-        for(i = 0; i < AIR_MAX_NUM_OF_PORTS; i++)
-        {
-            if(portlist[0] & (1 << i))
-            {
-                ret = air_qos_setRateLimitEnable(0, i, tmp_dir, state);
-                if(AIR_E_OK == ret)
-                {
-                    AIR_PRINT("Set Port%02d %s rate %s Success.\n", i, stdir[dir], sten[en]);
-                }
-                else
-                {
-                    AIR_PRINT("Set Port%02d %s rate %s Fail.\n", i, stdir[dir], sten[en]);
-                }
-            }
-        }
-    }
-    else if(1 == argc)
-    {
-        for(i = 0; i < AIR_MAX_NUM_OF_PORTS; i++)
-        {
-            if(portlist[0] & (1 << i))
-            {
-                tmp_dir = AIR_QOS_RATE_DIR_EGRESS;
-                dir = 0;
-                ret = air_qos_getRateLimitEnable(0, i, tmp_dir, &state);
-                if(AIR_E_OK == ret)
-                {
-                    AIR_PRINT("Get Port%02d %s rate %s Success.\n", i, stdir[dir], sten[state]);
-                }
-                else
-                {
-                    AIR_PRINT("Get Port%02d %s rate state Fail.\n", i, stdir[dir]);
-                }
-                tmp_dir = AIR_QOS_RATE_DIR_INGRESS;
-                dir = 1;
-                ret = air_qos_getRateLimitEnable(0, i, tmp_dir, &state);
-                if(AIR_E_OK == ret)
-                {
-                    AIR_PRINT("Get Port%02d %s rate %s Success.\n", i, stdir[dir], sten[state]);
-                }
-                else
-                {
-                    AIR_PRINT("Get Port%02d %s rate state Fail.\n", i, stdir[dir]);
-                }
-            }
-        }
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    return ret;
-
-}
-
-static AIR_ERROR_NO_T
-doQosDscp2Pri(
-    UI32_T argc,
-    C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T dscp = 0, priority = 0;
-
-    dscp = _strtoul(argv[0], NULL, 0);
-    if(2 == argc)
-    {
-        priority = _strtoul(argv[1], NULL, 0);
-        ret = air_qos_setDscp2Pri(0, dscp, priority);
-        if(AIR_E_OK == ret)
-        {
-            AIR_PRINT("Set DSCP %d to priority %d Success.\n", dscp, priority);
-        }
-        else
-        {
-            AIR_PRINT("Set DSCP %d to priority %d Fail.\n", dscp, priority);
-        }
-    }
-    else if(1 == argc)
-    {
-        ret = air_qos_getDscp2Pri(0, dscp, &priority);
-        if(AIR_E_OK == ret)
-        {
-            AIR_PRINT("Get DSCP %d to priority %d\n", dscp, priority);
-        }
-        else
-        {
-            AIR_PRINT("Get DSCP %d to priority Fail.\n", dscp);
-        }
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doQosPri2Queue(
-    UI32_T argc,
-    C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T priority = 0, queue = 0;
-
-    priority = _strtoul(argv[1], NULL, 0);
-
-    if(2 == argc)
-    {
-        priority = _strtoul(argv[0], NULL, 0);
-        queue = _strtoul(argv[1], NULL, 0);
-        ret = air_qos_setPri2Queue(0, priority, queue);
-        if(AIR_E_OK == ret)
-        {
-            AIR_PRINT("Set priority %d to queue %d Success.\n", priority, queue);
-        }
-        else
-        {
-            AIR_PRINT("Set priority %d to queue %d Fail.\n", priority, queue);
-        }
-    }
-    else
-    {
-        for(; priority < AIR_QOS_QUEUE_MAX_NUM; priority++)
-        {
-            ret = air_qos_getPri2Queue(0, priority, &queue);
-            if(AIR_E_OK == ret)
-            {
-                AIR_PRINT("Get priority %d to queue %d\n", priority, queue);
-            }
-            else
-            {
-                AIR_PRINT("Get priority %d to queue Fail.\n", priority);
-            }
-        }
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doQosTrustMode(
-    UI32_T argc,
-    C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T mode = 0;
-    C8_T bs[4][13] = {"port", "1p_port", "dscp_port", "dscp_1p_port"};
-    AIR_QOS_TRUST_MODE_T mode_t = AIR_QOS_TRUST_MODE_LAST;
-    AIR_PORT_BITMAP_T portlist = {0};
-    UI8_T i = 0;
-
-    ret = _portListStr2Ary(argv[0], portlist, 1);
-    if(ret != AIR_E_OK)
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        return ret;
-    }
-    if(2 == argc)
-    {
-        mode = _strtoul(argv[1], NULL, 0);
-        if(mode == 0)
-            mode_t = AIR_QOS_TRUST_MODE_PORT;
-        else if(mode == 1)
-            mode_t = AIR_QOS_TRUST_MODE_1P_PORT;
-        else if(mode == 2)
-            mode_t = AIR_QOS_TRUST_MODE_DSCP_PORT;
-        else if(mode == 3)
-            mode_t = AIR_QOS_TRUST_MODE_DSCP_1P_PORT;
-        else
-        {
-            AIR_PRINT("Unrecognized command.\n");
-            return AIR_E_BAD_PARAMETER;
-        }
-        for(i = 0; i < AIR_MAX_NUM_OF_PORTS; i++)
-        {
-            if(portlist[0] & (1 << i))
-            {
-                ret = air_qos_setTrustMode(0, i, mode_t);
-                if(AIR_E_OK == ret)
-                {
-                    AIR_PRINT("port %d Set Trust mode %s Success.\n", i, bs[mode]);
-                }
-                else
-                {
-                    AIR_PRINT("port %d Set Trust mode %s Fail.\n", i, bs[mode]);
-                }
-            }
-        }
-    }
-    else if(1 == argc)
-    {
-        for(i = 0; i < AIR_MAX_NUM_OF_PORTS; i++)
-        {
-            if(portlist[0] & (1 << i))
-            {
-                mode_t = AIR_QOS_TRUST_MODE_LAST;
-                ret = air_qos_getTrustMode(0, i, &mode_t);
-                if(AIR_E_OK == ret)
-                {
-                    if(mode_t == AIR_QOS_TRUST_MODE_PORT)
-                        mode = 0;
-                    else if(mode_t == AIR_QOS_TRUST_MODE_1P_PORT)
-                        mode = 1;
-                    else if(mode_t == AIR_QOS_TRUST_MODE_DSCP_PORT)
-                        mode = 2;
-                    else if(mode_t == AIR_QOS_TRUST_MODE_DSCP_1P_PORT)
-                        mode = 3;
-                    else
-                    {
-                        AIR_PRINT("port %d Get Trust mode Fail.\n", i);
-                        return AIR_E_OTHERS;
-                    }
-                    AIR_PRINT("port %d Get Trust mode %s\n", i, bs[mode]);
-                }
-                else
-                {
-                    AIR_PRINT("port %d Get Trust mode Fail.\n", i);
-                }
-            }
-        }
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doQosScheduleAlgo(
-    UI32_T argc,
-    C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    AIR_PORT_BITMAP_T portlist = {0};
-    AIR_QOS_SCH_MODE_T sch_mode = AIR_QOS_SCH_MODE_LAST;
-    UI32_T scheduler = 0;
-    UI8_T queue = 0;
-    C8_T sche[3][5] = {"SP", "WRR", "WFQ"};
-    UI32_T weight = AIR_QOS_SHAPER_NOSETTING;
-    UI8_T i = 0;
-
-    ret = _portListStr2Ary(argv[0], portlist, 1);
-    if(ret != AIR_E_OK)
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        return ret;
-    }
-    AIR_PRINT("port list is %d\n", portlist[0]);
-    if(4 == argc)
-    {
-        queue = _strtoul(argv[1], NULL, 0);
-        AIR_PRINT("queue is %d\n", queue);
-        scheduler = _strtoul(argv[2], NULL, 0);
-        AIR_PRINT("scheduler is %d\n", scheduler);
-        weight = _strtoul(argv[3], NULL, 0);
-        AIR_PRINT("weight is %d\n", weight);
-        if(scheduler == 0)
-        {
-            sch_mode = AIR_QOS_SCH_MODE_SP;
-            weight = AIR_QOS_SHAPER_NOSETTING;
-            if(weight != AIR_QOS_SHAPER_NOSETTING)
-                AIR_PRINT("[Warning] SP schedule mode no need weight\n");
-        }
-        else if(scheduler == 1)
-        {
-            sch_mode = AIR_QOS_SCH_MODE_WRR;
-            if(weight == AIR_QOS_SHAPER_NOSETTING)
-            {
-                AIR_PRINT("[Warning] No weight value input , plz check\n");
-                return AIR_E_BAD_PARAMETER;
-            }
-            AIR_PRINT("sch_mode is 1\n");
-        }
-        else if(scheduler == 2)
-        {
-            sch_mode = AIR_QOS_SCH_MODE_WFQ;
-            if(weight == AIR_QOS_SHAPER_NOSETTING)
-            {
-                AIR_PRINT("[Warning] No weight value input , plz check\n");
-                return AIR_E_BAD_PARAMETER;
-            }
-        }
-        else
-        {
-            AIR_PRINT("Unknown schedule mode, plz check again\n");
-            return AIR_E_BAD_PARAMETER;
-        }
-        for(i = 0; i < AIR_MAX_NUM_OF_PORTS; i++)
-        {
-            if(portlist[0] & (1 << i))
-            {
-                AIR_PRINT("port %d\n", i);
-                ret = air_qos_setScheduleAlgo(0, i, queue, sch_mode, weight);
-                if(AIR_E_OK == ret)
-                {
-                    AIR_PRINT("Set Port%02d Scheduler %s Success.\n", i, sche[scheduler]);
-                }
-                else
-                {
-                    AIR_PRINT("Set Port%02d Scheduler %s Fail.\n", i, sche[scheduler]);
-                }
-            }
-        }
-    }
-    else if(2 == argc)
-    {
-        queue = _strtoul(argv[1], NULL, 0);
-        for(i = 0; i < AIR_MAX_NUM_OF_PORTS; i++)
-        {
-            if(portlist[0] & (1 << i))
-            {
-                ret = air_qos_getScheduleAlgo(0, i, queue, &sch_mode, &weight);
-                if(AIR_E_OK == ret)
-                {
-                    if(sch_mode == AIR_QOS_SCH_MODE_SP)
-                        AIR_PRINT("Get Port%02d queue %d Scheduler %s\n", i, queue, sche[sch_mode]);
-                    else if((sch_mode == AIR_QOS_SCH_MODE_WRR) || (sch_mode == AIR_QOS_SCH_MODE_WFQ))
-                        AIR_PRINT("Get Port%02d queue %d Scheduler %s weight %d\n", i, queue, sche[sch_mode], weight);
-                    else
-                        AIR_PRINT("Get Port%02d queue %d Scheduler unknown\n", i, queue);
-                }
-                else
-                {
-                    AIR_PRINT("Get Port%02d queue %d Scheduler Fail.\n", i, queue);
-                }
-            }
-        }
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doQosGet(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(qosGetCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doQosSet(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(qosSetCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doQos(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(qosCmds, argc, argv);
-}
-static AIR_ERROR_NO_T
-doDiagTxComply(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T phy = 0;
-    UI32_T mode = 0;
-
-    phy = _strtoul(argv[0], NULL, 0);
-    if(2 == argc)
-    {
-        /* diag set txComply <phy(0~5)> <mode(0~8)> */
-        mode = _strtoul(argv[1], NULL, 0);
-        ret = air_diag_setTxComplyMode(0, phy, mode);
-        AIR_PRINT("Set diagnostic function: PHY %u Tx Compliance mode = %u ", phy, mode);
-    }
-    else if(1 == argc)
-    {
-        /* diag get txComply <phy(0~5)> */
-        ret = air_diag_getTxComplyMode(0, phy, &mode);
-        AIR_PRINT("Get diagnostic function: PHY %u Tx Compliance mode ", phy);
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        return AIR_E_BAD_PARAMETER;
-    }
-
-    if(AIR_E_OK == ret)
-    {
-        AIR_PRINT("Done.\n\tMode=");
-        switch(mode)
-        {
-            case AIR_DIAG_TXCOMPLY_MODE_10M_NLP:
-                AIR_PRINT("%s\n", "10M_NLP");
-                break;
-            case AIR_DIAG_TXCOMPLY_MODE_10M_RANDOM:
-                AIR_PRINT("%s\n", "10M_Random");
-                break;
-            case AIR_DIAG_TXCOMPLY_MODE_10M_SINE:
-                AIR_PRINT("%s\n", "10M_Sine");
-                break;
-            case AIR_DIAG_TXCOMPLY_MODE_100M_PAIR_A:
-                AIR_PRINT("%s\n", "100M_Pair_a");
-                break;
-            case AIR_DIAG_TXCOMPLY_MODE_100M_PAIR_B:
-                AIR_PRINT("%s\n", "100M_Pair_b");
-                break;
-            case AIR_DIAG_TXCOMPLY_MODE_1000M_TM1:
-                AIR_PRINT("%s\n", "1000M_TM1");
-                break;
-            case AIR_DIAG_TXCOMPLY_MODE_1000M_TM2:
-                AIR_PRINT("%s\n", "1000M_TM2");
-                break;
-            case AIR_DIAG_TXCOMPLY_MODE_1000M_TM3:
-                AIR_PRINT("%s\n", "1000M_TM3");
-                break;
-            case AIR_DIAG_TXCOMPLY_MODE_1000M_TM4:
-                AIR_PRINT("%s\n", "1000M_TM4");
-                break;
-            default:
-                break;
-        }
-    }
-    else
-    if(AIR_E_OTHERS == ret)
-    {
-        AIR_PRINT("isn't setting.\n");
-    }
-    else
-    {
-        AIR_PRINT("Fail.\n");
-    }
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doDiagSet(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(diagSetCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doDiagGet(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(diagGetCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doDiag(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(diagCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doLedMode(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T mode = 0;
-
-    if(1 == argc)
-    {
-        /* led set mode <mode(0:disable, 1~3:2 LED, 4:User-Define)> */
-        mode = _strtoul(argv[0], NULL, 0);
-        ret = air_led_setMode(0, 0, mode);
-        AIR_PRINT("Set LED mode ");
-    }
-    else if(0 == argc)
-    {
-        /* led get mode */
-        ret = air_led_getMode(0, 0, &mode);
-        AIR_PRINT("Get LED mode ");
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        return AIR_E_BAD_PARAMETER;
-    }
-
-    if(AIR_E_OK == ret)
-    {
-        switch(mode)
-        {
-            case AIR_LED_MODE_DISABLE:
-                AIR_PRINT(": Disabled.\n");
-                break;
-            case AIR_LED_MODE_2LED_MODE0:
-                AIR_PRINT(": LED 0:Link / LED 1:Activity.\n");
-                break;
-            case AIR_LED_MODE_2LED_MODE1:
-                AIR_PRINT(": LED 0:1000M Activity / LED 1:100M Activity.\n");
-                break;
-            case AIR_LED_MODE_2LED_MODE2:
-                AIR_PRINT(": LED 0:1000M Activity / LED 1:10&100M Activity.\n");
-                break;
-            case AIR_LED_MODE_USER_DEFINE:
-                AIR_PRINT(": User-Defined.\n");
-                break;
-            default:
-                AIR_PRINT(": Fail.\n");
-                break;
-        }
-    }
-    else
-    if(AIR_E_OTHERS == ret)
-    {
-        AIR_PRINT(": Unrecognized.\n");
-    }
-    else
-    {
-        AIR_PRINT("Fail.\n");
-    }
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doLedState(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI8_T entity = 0;
-    BOOL_T state = FALSE;
-
-    entity = _strtoul(argv[0], NULL, 0);
-    if(2 == argc)
-    {
-        /* led set state <led(0..1)> <state(1:En 0:Dis)> */
-        state = _strtoul(argv[1], NULL, 0);
-        ret = air_led_setState(0, 0, entity, state);
-        AIR_PRINT("Set LED %u state ", entity);
-    }
-    else if(1 == argc)
-    {
-        /* led get state <led(0..1)> */
-        ret = air_led_getState(0, 0, entity, &state);
-        AIR_PRINT("Get LED %u state ", entity );
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        return AIR_E_BAD_PARAMETER;
-    }
-
-    if(AIR_E_OK == ret)
-    {
-        AIR_PRINT(": %s.\n", (state)?"Enable":"Disabled");
-    }
-    else
-    if(AIR_E_OTHERS == ret)
-    {
-        AIR_PRINT(": Unrecognized.\n");
-    }
-    else
-    {
-        AIR_PRINT("Fail.\n");
-    }
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doLedUsrDef(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T i = 0;
-    UI8_T entity = 0;
-    BOOL_T polarity = LOW;
-    UI32_T on_evt_map = 0;
-    UI32_T blk_evt_map = 0;
-    AIR_LED_ON_EVT_T on_evt;
-    AIR_LED_BLK_EVT_T blk_evt;
-
-    entity = _strtoul(argv[0], NULL, 0);
-    if(4 == argc)
-    {
-        /* led set usr <led(0..1)> <polarity(0:low, 1:high)> <on_evt(7'bin)> <blink_evt(10'bin)> */
-        polarity = _strtoul(argv[1], NULL, 0);
-        on_evt_map = _strtoul(argv[2], NULL, 2);
-        blk_evt_map = _strtoul(argv[3], NULL, 2);
-
-        memset(&on_evt, 0, sizeof(AIR_LED_ON_EVT_T));
-        if(on_evt_map & BIT(0))
-        {
-            on_evt.link_1000m = TRUE;
-        }
-        if(on_evt_map & BIT(1))
-        {
-            on_evt.link_100m = TRUE;
-        }
-        if(on_evt_map & BIT(2))
-        {
-            on_evt.link_10m = TRUE;
-        }
-        if(on_evt_map & BIT(3))
-        {
-            on_evt.link_dn = TRUE;
-        }
-        if(on_evt_map & BIT(4))
-        {
-            on_evt.fdx = TRUE;
-        }
-        if(on_evt_map & BIT(5))
-        {
-            on_evt.hdx = TRUE;
-        }
-        if(on_evt_map & BIT(6))
-        {
-            on_evt.force = TRUE;
-        }
-
-        memset(&blk_evt, 0, sizeof(AIR_LED_BLK_EVT_T));
-        if(blk_evt_map & BIT(0))
-        {
-            blk_evt.tx_act_1000m = TRUE;
-        }
-        if(blk_evt_map & BIT(1))
-        {
-            blk_evt.rx_act_1000m = TRUE;
-        }
-        if(blk_evt_map & BIT(2))
-        {
-            blk_evt.tx_act_100m = TRUE;
-        }
-        if(blk_evt_map & BIT(3))
-        {
-            blk_evt.rx_act_100m = TRUE;
-        }
-        if(blk_evt_map & BIT(4))
-        {
-            blk_evt.tx_act_10m = TRUE;
-        }
-        if(blk_evt_map & BIT(5))
-        {
-            blk_evt.rx_act_10m = TRUE;
-        }
-        if(blk_evt_map & BIT(6))
-        {
-            blk_evt.cls = TRUE;
-        }
-        if(blk_evt_map & BIT(7))
-        {
-            blk_evt.rx_crc = TRUE;
-        }
-        if(blk_evt_map & BIT(8))
-        {
-            blk_evt.rx_idle = TRUE;
-        }
-        if(blk_evt_map & BIT(9))
-        {
-            blk_evt.force = TRUE;
-        }
-        ret = air_led_setUsrDef(0, 0, entity, polarity, on_evt, blk_evt);
-        AIR_PRINT("Set LED %u User-define ", entity);
-    }
-    else if(1 == argc)
-    {
-        /* led get usr <led(0..1)> */
-        ret = air_led_getUsrDef(0, 0, entity, &polarity, &on_evt, &blk_evt);
-        AIR_PRINT("Get LED %u User-define ", entity );
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        return AIR_E_BAD_PARAMETER;
-    }
-
-    if(AIR_E_OK == ret)
-    {
-        AIR_PRINT("Done.\n");
-        AIR_PRINT("Polarity:%u.\n", polarity);
-        AIR_PRINT("On Event:\n");
-        i = 6;
-        AIR_PRINT("\t(%u)Force on :%s\n", i--, (on_evt.force)?"On":"Off");
-        AIR_PRINT("\t(%u)Half Duplex :%s\n", i--, (on_evt.hdx)?"On":"Off");
-        AIR_PRINT("\t(%u)Full Duplex :%s\n", i--, (on_evt.fdx)?"On":"Off");
-        AIR_PRINT("\t(%u)Link Down :%s\n", i--, (on_evt.link_dn)?"On":"Off");
-        AIR_PRINT("\t(%u)Link 10M :%s\n", i--, (on_evt.link_10m)?"On":"Off");
-        AIR_PRINT("\t(%u)Link 100M :%s\n", i--, (on_evt.link_100m)?"On":"Off");
-        AIR_PRINT("\t(%u)Link 1000M :%s\n", i--, (on_evt.link_1000m)?"On":"Off");
-
-        AIR_PRINT("Blinking Event:\n");
-        i = 9;
-        AIR_PRINT("\t(%u)Force blinks :%s\n", i--, (blk_evt.force)?"On":"Off");
-        AIR_PRINT("\t(%u)Rx Idle Error :%s\n", i--, (blk_evt.rx_idle)?"On":"Off");
-        AIR_PRINT("\t(%u)Rx CRC Error :%s\n", i--, (blk_evt.rx_crc)?"On":"Off");
-        AIR_PRINT("\t(%u)Collision :%s\n", i--, (blk_evt.cls)?"On":"Off");
-        AIR_PRINT("\t(%u)10Mbps RX Activity :%s\n", i--, (blk_evt.rx_act_10m)?"On":"Off");
-        AIR_PRINT("\t(%u)10Mbps TX Activity :%s\n", i--, (blk_evt.tx_act_10m)?"On":"Off");
-        AIR_PRINT("\t(%u)100Mbps RX Activity :%s\n", i--, (blk_evt.rx_act_100m)?"On":"Off");
-        AIR_PRINT("\t(%u)100Mbps TX Activity :%s\n", i--, (blk_evt.tx_act_100m)?"On":"Off");
-        AIR_PRINT("\t(%u)1000Mbps RX Activity :%s\n", i--, (blk_evt.rx_act_1000m)?"On":"Off");
-        AIR_PRINT("\t(%u)1000Mbps TX Activity :%s\n", i--, (blk_evt.tx_act_1000m)?"On":"Off");
-    }
-    else
-    {
-        AIR_PRINT("Fail.\n");
-    }
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doLedBlkTime(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    AIR_LED_BLK_DUR_T time = 0;
-
-    if(1 == argc)
-    {
-        /* led set time <time(0~5)> */
-        time = _strtoul(argv[0], NULL, 0);
-        ret = air_led_setBlkTime(0, 0, time);
-        AIR_PRINT("Set Blinking Duration ");
-    }
-    else if(0 == argc)
-    {
-        /* led get time */
-        ret = air_led_getBlkTime(0, 0, &time);
-        AIR_PRINT("Get Blinking Duration ");
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        return AIR_E_BAD_PARAMETER;
-    }
-
-    if(AIR_E_OK == ret)
-    {
-        AIR_PRINT("Done.\n");
-        AIR_PRINT("\tBlinking duration : %u (ms)\n", (32 << time) );
-    }
-    else
-    {
-        AIR_PRINT("Fail.\n");
-    }
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doLedSet(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(ledSetCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doLedGet(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(ledGetCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doLed(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(ledCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doShowVersion(
-    UI32_T argc,
-    C8_T *argv[])
-{
-    AIR_PRINT("VERSION: %s\n", AIR_VER_SDK);
-
-    return AIR_E_OK;
-}
-
-static AIR_ERROR_NO_T
-doShow(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(showCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doStormRate(
-    UI32_T argc,
-    C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T port = 0, type = 0;
-    UI32_T unit = 0, count = 0;
-    C8_T stype[3][5] = {"Bcst", "Mcst", "Ucst"};
-    UI32_T kb = 0;
-
-    port = _strtol(argv[0], NULL, 10);
-    type = _strtol(argv[1], NULL, 10);
-    if(4 == argc)
-    {
-        count = _strtol(argv[2], NULL, 10);
-        unit = _strtol(argv[3], NULL, 10);
-
-        if(0 == unit)
-            kb = 64;
-        else if(1 == unit)
-            kb = 256;
-        else if(2 == unit)
-            kb = 1024;
-        else if(3 == unit)
-            kb = 4096;
-        else
-            kb = 16384;
-        ret = air_sec_setStormRate(0, port, type, count, unit);
-        if(AIR_E_OK == ret)
-        {
-            AIR_PRINT("Set Port%02d %s storm rate (%d * %d) = %d Kbps\n", port, stype[type], count, kb, (count*kb));
-        }
-        else
-        {
-            AIR_PRINT("Set Port%02d %s storm rate Fail.\n", port, stype[type]);
-            AIR_PRINT("Note: Port(0..4) can only select unit(0..3), port(5..6) can only select unit(4)\n");
-        }
-    }
-    else if(2 == argc)
-    {
-        ret = air_sec_getStormRate(0, port, type, &count, &unit);
-        if(AIR_E_OK == ret)
-        {
-            if(0 == unit)
-                kb = 64;
-            else if(1 == unit)
-                kb = 256;
-            else if(2 == unit)
-                kb = 1024;
-            else if(3 == unit)
-                kb = 4096;
-            else
-                kb = 16384;
-            AIR_PRINT("Port%02d %s storm rate (%d * %d) = %d Kbps\n", port, stype[type], count, kb, (count*kb));
-        }
-        else
-        {
-            AIR_PRINT("Get Port%02d %s storm rate Fail\n", port, stype[type]);
-        }
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doFldMode(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T port = 0, type = 0;
-    BOOL_T fld_en = 0;
-    C8_T stype[4][5] = {"Bcst", "Mcst", "Ucst", "Qury"};
-    C8_T sen[2][10] = {"Disable", "Enable"};
-
-    port = _strtol(argv[0], NULL, 10);
-    type = _strtol(argv[1], NULL, 10);
-
-    if(2 == argc)
-    {
-        ret = air_sec_getFldMode(0, port, type, &fld_en);
-        if(AIR_E_OK == ret)
-        {
-            AIR_PRINT("Get Port%02d flooding %s frame %s\n", port, stype[type], sen[fld_en]);
-        }
-        else
-        {
-            AIR_PRINT("Get Port%02d flooding %s frame Fail\n", port, stype[type]);
-        }
-    }
-    else if(3 == argc)
-    {
-        fld_en = _strtol(argv[2], NULL, 10);
-        ret = air_sec_setFldMode(0, port, type, fld_en);
-        if(AIR_E_OK == ret)
-        {
-            AIR_PRINT("Set Port%02d flooding %s frame %s Success\n", port, stype[type], sen[fld_en]);
-        }
-        else
-        {
-            AIR_PRINT("Set Port%02d flooding %s frame %s Fail\n", port, stype[type], sen[fld_en]);
-        }
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doStormEnable(
-    UI32_T argc,
-    C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T port = 0, type = 0;
-    BOOL_T en = 0;
-    C8_T sen[2][10] = {"Disable", "Enable"};
-    C8_T stype[3][5] = {"Bcst", "Mcst", "Ucst"};
-
-    port = _strtol(argv[0], NULL, 10);
-    type = _strtol(argv[1], NULL, 10);
-    if(3 == argc)
-    {
-        en = _strtol(argv[2], NULL, 10);
-        ret = air_sec_setStormEnable(0, port, type, en);
-        if(AIR_E_OK == ret)
-        {
-            AIR_PRINT("Set Port%02d %s storm %s Success.\n", port, stype[type], sen[en]);
-        }
-        else
-        {
-            AIR_PRINT("Set Port%02d %s storm %s Fail.\n", port, stype[type], sen[en]);
-        }
-    }
-    else if(2 == argc)
-    {
-        ret = air_sec_getStormEnable(0, port, type, &en);
-        if(AIR_E_OK == ret)
-        {
-            AIR_PRINT("Port%02d %s storm %s\n", port, stype[type], sen[en]);
-        }
-        else
-        {
-            AIR_PRINT("Get Port%02d %s storm Fail\n", port, stype[type]);
-        }
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doSaLearning(UI32_T argc, C8_T *argv[])
-{
-    UI32_T port = 0;
-    AIR_SEC_PORTSEC_PORT_CONFIG_T port_config;
-    AIR_ERROR_NO_T rc = AIR_E_OK;
-
-    port = _strtoul(argv[0], NULL, 0);
-    if(2 == argc)
-    {
-        memset(&port_config, 0, sizeof(AIR_SEC_PORTSEC_PORT_CONFIG_T));
-        rc = air_sec_getPortSecPortCfg(0, port, &port_config);
-        port_config.sa_lrn_en = _strtoul(argv[1], NULL, 0);
-        rc = air_sec_setPortSecPortCfg(0, port, port_config);
-        if(AIR_E_OK == rc)
-        {
-            AIR_PRINT("Set Port%02d sa learn %s Success.\n", port, port_config.sa_lrn_en?"Enable":"Disable");
-        }
-        else
-        {
-            AIR_PRINT("Set Port%02d sa learn %s Fail.\n", port, port_config.sa_lrn_en?"Enable":"Disable");
-        }
-    }
-    else if(1 == argc)
-    {
-        rc = air_sec_getPortSecPortCfg(0, port, &port_config);
-        if(AIR_E_OK == rc)
-        {
-            AIR_PRINT("Port%02d sa learn: %s\n", port, port_config.sa_lrn_en?"Enable":"Disable");
-        }
-        else
-        {
-            AIR_PRINT("Get Port%02d sa learn Fail\n", port);
-        }
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        rc = AIR_E_BAD_PARAMETER;
-    }
-    return rc;
-}
-
-static AIR_ERROR_NO_T
-doSaLimit(UI32_T argc, C8_T *argv[])
-{
-    UI32_T port = 0;
-    AIR_SEC_PORTSEC_PORT_CONFIG_T port_config;
-    AIR_ERROR_NO_T rc = AIR_E_OK;
-
-    port = _strtoul(argv[0], NULL, 0);
-    if(3 == argc)
-    {
-        memset(&port_config, 0, sizeof(AIR_SEC_PORTSEC_PORT_CONFIG_T));
-        rc = air_sec_getPortSecPortCfg(0, port, &port_config);
-        port_config.sa_lmt_en = _strtoul(argv[1], NULL, 0);
-        port_config.sa_lmt_cnt = _strtoul(argv[2], NULL, 0);
-        rc = air_sec_setPortSecPortCfg(0, port, port_config);
-        if(AIR_E_OK == rc)
-        {
-            AIR_PRINT("Set Port%02d sa limit %s Success.\n", port, port_config.sa_lmt_en?"Enable":"Disable");
-        }
-        else
-        {
-            AIR_PRINT("Set Port%02d sa limit %s Fail.\n", port, port_config.sa_lmt_en?"Enable":"Disable");
-        }
-    }
-    else if(1 == argc)
-    {
-        rc = air_sec_getPortSecPortCfg(0, port, &port_config);
-        if(AIR_E_OK == rc)
-        {
-            AIR_PRINT("Port%02d ", port);
-            AIR_PRINT("sa limit: %s\n", port_config.sa_lmt_en?"Enable":"Disable");
-            if(TRUE == (port_config.sa_lmt_en && (AIR_MAX_NUM_OF_MAC ==  port_config.sa_lmt_cnt)))
-            {
-                AIR_PRINT("Sa learning without limitation\n");
-            }
-            else if(TRUE == (port_config.sa_lmt_en && (AIR_MAX_NUM_OF_MAC >  port_config.sa_lmt_cnt)))
-            {
-                AIR_PRINT("Rx sa allowable learning number: %d\n", port_config.sa_lmt_cnt);
-            }
-        }
-        else
-        {
-            AIR_PRINT("Get Port%02d sa limit Fail\n", port);
-        }
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        rc = AIR_E_BAD_PARAMETER;
-    }
-
-    return rc;
-}
-
-static AIR_ERROR_NO_T
-doSecGet(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(secGetCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doSecSet(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(secSetCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doSec(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(secCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doSwitchCpuPortEn(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    BOOL_T cpu_en = FALSE;
-
-    if(0 == argc)
-    {
-        /* switch get sysPhyEn */
-        ret = air_switch_getCpuPortEn(0, &cpu_en);
-        AIR_PRINT("Get Cpu Port State ");
-        if(ret == AIR_E_OK)
-        {
-            AIR_PRINT(": %s\n", cpu_en?"Enable":"Disable");
-        }
-        else
-        {
-            AIR_PRINT("Fail!\n");
-        }
-    }
-    else if(1 == argc)
-    {
-        /* switch set sysPhyEn <phy_en> */
-        cpu_en = _strtol(argv[0], NULL, 0);
-        ret = air_switch_setCpuPortEn(0, cpu_en);
-        AIR_PRINT("Set CPU port State ");
-        if(ret == AIR_E_OK)
-        {
-            AIR_PRINT(": %s\n", cpu_en?"Enable":"Disable");
-        }
-        else
-        {
-            AIR_PRINT("Fail!\n");
-        }
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doSwitchCpuPort(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    BOOL_T cpu_en = FALSE;
-    UI32_T port = 0;
-    C8_T str_temp[AIR_MAX_NUM_OF_PORTS+1];
-
-    if(1 == argc)
-    {
-        /* switch set cpuPort <portnumber> */
-        port = _strtol(argv[0], NULL, 10);
-        ret = air_switch_setCpuPort(0, port);
-        AIR_PRINT("Set CPU Port ");
-    }
-    else if(0 == argc)
-    {
-        /* switch get cpuPort */
-        ret = air_switch_getCpuPort(0, &port);
-        AIR_PRINT("Get CPU Port ");
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    if(AIR_E_OK == ret)
-    {
-        AIR_PRINT(": %d\n", port);
-    }
-    else
-    {
-        AIR_PRINT("Fail!\n");
-    }
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doSwitchPhyLCIntrEn(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T phy = 0;
-    BOOL_T enable = FALSE;
-
-    if(2 == argc)
-    {
-        /* switch set phyLCIntrEn <phy(0..6)> <(1:En,0:Dis)> */
-        phy    = _strtol(argv[0], NULL, 10);
-        enable = _strtol(argv[1], NULL, 10);
-        ret    = air_switch_setSysIntrEn(0, (phy + AIR_SYS_INTR_TYPE_PHY0_LC), enable);
-    }
-    else if(1 == argc)
-    {
-        /* switch get phyLCIntrEn <phy(0..6)> */
-        phy = _strtol(argv[0], NULL, 10);
-        ret = air_switch_getSysIntrEn(0, (phy + AIR_SYS_INTR_TYPE_PHY0_LC), &enable);
-        AIR_PRINT("PHY(%d) LinkChange interrupt : %s\n", phy, (TRUE == enable) ? "enable" : "disable");
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doSwitchPhyLCIntrSts(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T phy = 0;
-    BOOL_T enable = FALSE;
-
-    if(2 == argc)
-    {
-        /* switch set phyLCIntrSts <phy(0..6)> <(1:En)> */
-        phy    = _strtol(argv[0], NULL, 10);
-        enable = _strtol(argv[1], NULL, 10);
-        ret    = air_switch_setSysIntrStatus(0, (phy + AIR_SYS_INTR_TYPE_PHY0_LC), enable);
-    }
-    else if(1 == argc)
-    {
-        /* switch get phyLCIntrSts <phy(0..6)> */
-        phy = _strtol(argv[0], NULL, 10);
-        ret = air_switch_getSysIntrStatus(0, (phy + AIR_SYS_INTR_TYPE_PHY0_LC), &enable);
-        AIR_PRINT("PHY(%d) LinkChange interrupt state : %s\n", phy, (TRUE == enable) ? "set" : "unset");
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        ret = AIR_E_BAD_PARAMETER;
-    }
-
-    return ret;
-}
-
-
-static AIR_ERROR_NO_T
-doSwitchSet(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(switchSetCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doSwitchGet(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(switchGetCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doSwitch(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(switchCmds, argc, argv);
-}
-
-static void _air_acl_printRuleMap(UI32_T *rule_map, UI32_T ary_num)
-{
-    UI32_T i;
-    BOOL_T first;
-
-    first = TRUE;
-    for(i=0; i<ary_num*32; i++)
-    {
-        if(rule_map[i/32] & BIT(i%32))
-        {
-            if(TRUE == first)
-            {
-                AIR_PRINT("%u", i);
-                first = FALSE;
-            }
-            else
-            {
-                AIR_PRINT(",%u", i);
-            }
-        }
-    }
-    AIR_PRINT("\n");
-}
-
-static AIR_ERROR_NO_T
-doAclEn(
-    UI32_T argc,
-    C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T argi=0;
-    UI32_T port = 0;
-    BOOL_T en = FALSE;
-
-    if(1 == argc)
-    {
-        /* acl set en <en(1:En,0:Dis)> */
-        en = _strtoul(argv[argi++], NULL, 2);
-        ret = air_acl_setGlobalState(0, en);
-        AIR_PRINT("Set Global ACL function ");
-    }
-    else if(0 == argc)
-    {
-        /* acl get en */
-        ret = air_acl_getGlobalState(0, &en);
-        AIR_PRINT("Get Global ACL function ");
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        return AIR_E_BAD_PARAMETER;
-    }
-
-    if(ret == AIR_E_OK)
-    {
-        AIR_PRINT(": %s\n", (TRUE == en)?"Enable":"Disable");
-    }
-    else
-    {
-        AIR_PRINT("Fail!\n");
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doAclRule(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T rule_idx = 0;
-    BOOL_T state = FALSE, reverse = FALSE, end = FALSE;
-    UI32_T argi = 0, ipv6 = 0, i = 0;
-    AIR_ACL_RULE_T rule;
-    UI8_T tmp_ip[16] = {0};
-    C8_T str_temp[AIR_MAX_NUM_OF_PORTS+1];
-    C8_T str[40];
-
-    memset(&rule, 0, sizeof(AIR_ACL_RULE_T));
-    if(argc >= 6)
-    {
-        /* acl set rule <idx(0..255)> <state(0:Dis,1:En)> <reverse(0:Dis,1:En)> <end(0:Dis,1:En)> <portmap(7'bin)>
-        <ipv6(0:Dis,1:En,2:Not care)>
-        [ dmac <dmac(12'hex)> <dmac_mask(12'hex)> ]
-        [ smac <smac(12'hex)> <smac_mask(12'hex)> ]
-        [ stag <stag(4'hex)> <stag_mask(4'hex)> ]
-        [ ctag <ctag(4'hex)> <ctag_mask(4'hex)> ]
-        [ etype <etype(4'hex)> <etype_mask(4'hex)> ]
-        [ dip <dip(IPADDR)> <dip_mask(IPADDR)> ]
-        [ sip <sip(IPADDR)> <sip_mask(IPADDR)> ]
-        [ dscp <dscp(2'hex)> <dscp_mask(2'hex)> ]
-        [ protocol <protocol(2'hex)> <protocol_mask(2'hex)> ]
-        [ dport <dport(4'hex)> <dport_mask(4'hex)> ]
-        [ sport <sport(4'hex)> <sport_mask(4'hex)> ]
-        [ flow_label <flow_label(4'hex)> <flow_label_mask(4'hex)> ]
-        [ udf <udf(4'hex)> <udf_mask(4'hex)> ] */
-
-        rule_idx = _strtoul(argv[argi++], NULL, 0);
-
-        rule.ctrl.rule_en = _strtoul(argv[argi++], NULL, 0);
-        rule.ctrl.reverse = _strtoul(argv[argi++], NULL, 0);
-        rule.ctrl.end = _strtoul(argv[argi++], NULL, 0);
-
-        rule.key.portmap = _strtoul(argv[argi++], NULL, 2);
-        rule.mask.portmap = (~rule.key.portmap) & AIR_ALL_PORT_BITMAP;
-
-        ipv6 = _strtoul(argv[argi++], NULL, 0);
-        if(0 == ipv6)
-        {
-            rule.key.isipv6 = FALSE;
-            rule.mask.isipv6 = TRUE;
-        }
-        else if(1 == ipv6)
-        {
-            rule.key.isipv6 = TRUE;
-            rule.mask.isipv6 = TRUE;
-        }
-        else
-        {
-            rule.mask.isipv6 = FALSE;
-        }
-
-        if(0 == _strcmp(argv[argi], "dmac"))
-        {
-            argi++;
-            _str2mac(argv[argi++], rule.key.dmac);
-            _str2mac(argv[argi++], rule.mask.dmac);
-            rule.key.fieldmap |= 1 << AIR_ACL_DMAC;
-        }
-
-        if(0 == _strcmp(argv[argi], "smac"))
-        {
-            argi++;
-            _str2mac(argv[argi++], rule.key.smac);
-            _str2mac(argv[argi++], rule.mask.smac);
-            rule.key.fieldmap |= 1 << AIR_ACL_SMAC;
-        }
-
-        if(0 == _strcmp(argv[argi], "stag"))
-        {
-            argi++;
-            rule.key.stag = _strtoul(argv[argi++], NULL, 16);
-            rule.mask.stag = _strtoul(argv[argi++], NULL, 16);
-            rule.key.fieldmap |= 1 << AIR_ACL_STAG;
-        }
-
-        if(0 == _strcmp(argv[argi], "ctag"))
-        {
-            argi++;
-            rule.key.ctag = _strtoul(argv[argi++], NULL, 16);
-            rule.mask.ctag = _strtoul(argv[argi++], NULL, 16);
-            rule.key.fieldmap |= 1 << AIR_ACL_CTAG;
-        }
-
-        if(0 == _strcmp(argv[argi], "etype"))
-        {
-            argi++;
-            rule.key.etype= _strtoul(argv[argi++], NULL, 16);
-            rule.mask.etype = _strtoul(argv[argi++], NULL, 16);
-            rule.key.fieldmap |= 1 << AIR_ACL_ETYPE;
-        }
-
-        if(0 == _strcmp(argv[argi], "dip"))
-        {
-            argi++;
-            if(0 == ipv6)
-            {
-                _str2ipv4(argv[argi++], rule.key.dip);
-                _str2ipv4(argv[argi++], rule.mask.dip);
-            }
-            else if(1 == ipv6)
-            {
-                _str2ipv6(argv[argi++], tmp_ip);
-                rule.key.dip[3] = (tmp_ip[0]<<24) | (tmp_ip[1]<<16) | (tmp_ip[2]<<8) | tmp_ip[3];
-                rule.key.dip[2] = (tmp_ip[4]<<24) | (tmp_ip[5]<<16) | (tmp_ip[6]<<8) | tmp_ip[7];
-                rule.key.dip[1] = (tmp_ip[8]<<24) | (tmp_ip[9]<<16) | (tmp_ip[10]<<8) | tmp_ip[11];
-                rule.key.dip[0] = (tmp_ip[12]<<24) | (tmp_ip[13]<<16) | (tmp_ip[14]<<8) | tmp_ip[15];
-                _str2ipv6(argv[argi++], tmp_ip);
-                rule.mask.dip[3] = (tmp_ip[0]<<24) | (tmp_ip[1]<<16) | (tmp_ip[2]<<8) | tmp_ip[3];
-                rule.mask.dip[2] = (tmp_ip[4]<<24) | (tmp_ip[5]<<16) | (tmp_ip[6]<<8) | tmp_ip[7];
-                rule.mask.dip[1] = (tmp_ip[8]<<24) | (tmp_ip[9]<<16) | (tmp_ip[10]<<8) | tmp_ip[11];
-                rule.mask.dip[0] = (tmp_ip[12]<<24) | (tmp_ip[13]<<16) | (tmp_ip[14]<<8) | tmp_ip[15];
-            }
-            rule.key.fieldmap |= 1 << AIR_ACL_DIP;
-        }
-
-        if(0 == _strcmp(argv[argi], "sip"))
-        {
-            argi++;
-            if(0 == ipv6)
-            {
-                _str2ipv4(argv[argi++], rule.key.sip);
-                _str2ipv4(argv[argi++], rule.mask.sip);
-            }
-            else if(1 == ipv6)
-            {
-                _str2ipv6(argv[argi++], tmp_ip);
-                rule.key.sip[3] = (tmp_ip[0]<<24) | (tmp_ip[1]<<16) | (tmp_ip[2]<<8) | tmp_ip[3];
-                rule.key.sip[2] = (tmp_ip[4]<<24) | (tmp_ip[5]<<16) | (tmp_ip[6]<<8) | tmp_ip[7];
-                rule.key.sip[1] = (tmp_ip[8]<<24) | (tmp_ip[9]<<16) | (tmp_ip[10]<<8) | tmp_ip[11];
-                rule.key.sip[0] = (tmp_ip[12]<<24) | (tmp_ip[13]<<16) | (tmp_ip[14]<<8) | tmp_ip[15];
-                _str2ipv6(argv[argi++], tmp_ip);
-                rule.mask.sip[3] = (tmp_ip[0]<<24) | (tmp_ip[1]<<16) | (tmp_ip[2]<<8) | tmp_ip[3];
-                rule.mask.sip[2] = (tmp_ip[4]<<24) | (tmp_ip[5]<<16) | (tmp_ip[6]<<8) | tmp_ip[7];
-                rule.mask.sip[1] = (tmp_ip[8]<<24) | (tmp_ip[9]<<16) | (tmp_ip[10]<<8) | tmp_ip[11];
-                rule.mask.sip[0] = (tmp_ip[12]<<24) | (tmp_ip[13]<<16) | (tmp_ip[14]<<8) | tmp_ip[15];
-            }
-            rule.key.fieldmap |= 1 << AIR_ACL_SIP;
-        }
-
-        if(0 == _strcmp(argv[argi], "dscp"))
-        {
-            argi++;
-            rule.key.dscp = _strtoul(argv[argi++], NULL, 16);
-            rule.mask.dscp = _strtoul(argv[argi++], NULL, 16);
-            rule.key.fieldmap |= 1 << AIR_ACL_DSCP;
-        }
-
-        if(0 == _strcmp(argv[argi], "protocol"))
-        {
-            argi++;
-            rule.key.protocol = _strtoul(argv[argi++], NULL, 16);
-            rule.mask.protocol = _strtoul(argv[argi++], NULL, 16);
-            rule.key.fieldmap |= 1 << AIR_ACL_PROTOCOL;
-        }
-
-        if(0 == _strcmp(argv[argi], "dport"))
-        {
-            argi++;
-            rule.key.dport = _strtoul(argv[argi++], NULL, 16);
-            rule.mask.dport = _strtoul(argv[argi++], NULL, 16);
-            rule.key.fieldmap |= 1 << AIR_ACL_DPORT;
-        }
-
-        if(0 == _strcmp(argv[argi], "sport"))
-        {
-            argi++;
-            rule.key.sport = _strtoul(argv[argi++], NULL, 16);
-            rule.mask.sport = _strtoul(argv[argi++], NULL, 16);
-            rule.key.fieldmap |= 1 << AIR_ACL_SPORT;
-        }
-
-        if(0 == _strcmp(argv[argi], "flow_label"))
-        {
-            argi++;
-            rule.key.flow_label= _strtoul(argv[argi++], NULL, 16);
-            rule.mask.flow_label= _strtoul(argv[argi++], NULL, 16);
-            rule.key.fieldmap |= 1 << AIR_ACL_FLOW_LABEL;
-        }
-
-        if(0 == _strcmp(argv[argi], "udf"))
-        {
-            argi++;
-            rule.key.udf = _strtoul(argv[argi++], NULL, 16);
-            rule.mask.udf = _strtoul(argv[argi++], NULL, 16);
-            rule.key.fieldmap |= 1 << AIR_ACL_UDF;
-        }
-
-        rule.mask.fieldmap = rule.key.fieldmap;
-        ret = air_acl_setRule(0, rule_idx, &rule);
-        if(ret < AIR_E_LAST)
-            AIR_PRINT("Set ACL Rule(%u): %s\n", rule_idx, air_error_getString(ret));
-    }
-    else if(1 == argc)
-    {
-        rule_idx = _strtoul(argv[0], NULL, 0);
-        ret = air_acl_getRule(0, rule_idx, &rule);
-        if(ret < AIR_E_LAST)
-            AIR_PRINT("Get ACL Rule(%u): %s\n", rule_idx, air_error_getString(ret));
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        return AIR_E_BAD_PARAMETER;
-    }
-
-    if(AIR_E_OK == ret)
-    {
-        if(TRUE == rule.ctrl.rule_en)
-        {
-            AIR_PRINT("\t Rule end          : %s\n", (TRUE == rule.ctrl.end)?"Enable":"Disable");
-            AIR_PRINT("\t Rule reverse      : %s\n", (TRUE == rule.ctrl.reverse)?"Enable":"Disable");
-            _hex2bitstr((~rule.mask.portmap) & AIR_ALL_PORT_BITMAP, str_temp, AIR_MAX_NUM_OF_PORTS+1);
-            AIR_PRINT("\t Portmap[0:6]      : %s\n", str_temp);
-            for(i = AIR_ACL_DMAC; i < AIR_ACL_FIELD_TYPE_LAST; i++)
-            {
-                if((1 << i) & rule.mask.fieldmap)
-                {
-                    switch (i)
-                    {
-                        case AIR_ACL_DMAC:
-                            AIR_PRINT("\t dmac: ");
-                            AIR_PRINT("%02x-%02x-%02x-%02x-%02x-%02x",
-                            rule.key.dmac[0], rule.key.dmac[1], rule.key.dmac[2],
-                            rule.key.dmac[3], rule.key.dmac[4], rule.key.dmac[5]);
-                            AIR_PRINT(", dmac-mask: ");
-                            AIR_PRINT("%02x-%02x-%02x-%02x-%02x-%02x\n",
-                            rule.mask.dmac[0], rule.mask.dmac[1], rule.mask.dmac[2],
-                            rule.mask.dmac[3], rule.mask.dmac[4], rule.mask.dmac[5]);
-                            break;
-                        case AIR_ACL_SMAC:
-                            AIR_PRINT("\t smac: ");
-                            AIR_PRINT("%02x-%02x-%02x-%02x-%02x-%02x",
-                            rule.key.smac[0], rule.key.smac[1], rule.key.smac[2],
-                            rule.key.smac[3], rule.key.smac[4], rule.key.smac[5]);
-                            AIR_PRINT(", smac-mask: ");
-                            AIR_PRINT("%02x-%02x-%02x-%02x-%02x-%02x\n",
-                            rule.mask.smac[0], rule.mask.smac[1], rule.mask.smac[2],
-                            rule.mask.smac[3], rule.mask.smac[4], rule.mask.smac[5]);
-                            break;
-                        case AIR_ACL_ETYPE:
-                            AIR_PRINT("\t etype: 0x%x, etype-mask: 0x%x\n", rule.key.etype, rule.mask.etype);
-                            break;
-                        case AIR_ACL_STAG:
-                            AIR_PRINT("\t stag: 0x%x, stag-mask: 0x%x\n", rule.key.stag, rule.mask.stag);
-                            break;
-                        case AIR_ACL_CTAG:
-                            AIR_PRINT("\t ctag: 0x%x, ctag-mask: 0x%x\n", rule.key.ctag, rule.mask.ctag);
-                            break;
-                        case AIR_ACL_DPORT:
-                            AIR_PRINT("\t dport: 0x%x, dport-mask: 0x%x\n", rule.key.dport, rule.mask.dport);
-                            break;
-                        case AIR_ACL_SPORT:
-                            AIR_PRINT("\t sport: 0x%x, sport-mask: 0x%x\n", rule.key.sport, rule.mask.sport);
-                            break;
-                        case AIR_ACL_UDF:
-                            AIR_PRINT("\t udf: 0x%x, udf-mask: 0x%x\n", rule.key.udf, rule.mask.udf);
-                            break;
-                        case AIR_ACL_DIP:
-                            if (0 == rule.key.isipv6)
-                            {
-                                AIR_PRINT("\t dip: ");
-                                AIR_PRINT("%d.%d.%d.%d",
-                                ((rule.key.dip[0])&0xFF000000)>>24,((rule.key.dip[0])&0x00FF0000)>>16,
-                                ((rule.key.dip[0])&0x0000FF00)>>8, ((rule.key.dip[0])&0x000000FF));
-                                AIR_PRINT(", dip-mask: ");
-                                AIR_PRINT("%d.%d.%d.%d\n ",
-                                ((rule.mask.dip[0])&0xFF000000)>>24,((rule.mask.dip[0])&0x00FF0000)>>16,
-                                ((rule.mask.dip[0])&0x0000FF00)>>8, ((rule.mask.dip[0])&0x000000FF));
-                            }
-                            else
-                            {
-                                for(i=0; i<4; i++){
-                                    tmp_ip[i] = (rule.key.dip[3] >> (8*(3-i))) & 0xff;
-                                    AIR_PRINT("get tmp_ip[%d]=0x%x\n", i, tmp_ip[i]);
-                                }
-                                for(i=4; i<8; i++){
-                                    tmp_ip[i] = (rule.key.dip[2] >> (8*(7-i))) & 0xff;
-                                }
-                                for(i=8; i<12; i++){
-                                    tmp_ip[i] = (rule.key.dip[1] >> (8*(11-i))) & 0xff;
-                                }
-                                for(i=12; i<16; i++){
-                                    tmp_ip[i] = (rule.key.dip[0] >> (8*(15-i))) & 0xff;
-                                }
-
-                                AIR_PRINT("\t dip: ");
-                                AIR_PRINT("%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x",
-                                    tmp_ip[0], tmp_ip[1],tmp_ip[2], tmp_ip[3],tmp_ip[4], tmp_ip[5],tmp_ip[6], tmp_ip[7],
-                                    tmp_ip[8], tmp_ip[9],tmp_ip[10], tmp_ip[11],tmp_ip[12], tmp_ip[13],tmp_ip[14], tmp_ip[15]);
-                                for(i=0; i<4; i++){
-                                    tmp_ip[i] = (rule.mask.dip[3] >> (8*(3-i))) & 0xff;
-                                }
-                                for(i=4; i<8; i++){
-                                    tmp_ip[i] = (rule.mask.dip[2] >> (8*(7-i))) & 0xff;
-                                }
-                                for(i=8; i<12; i++){
-                                    tmp_ip[i] = (rule.mask.dip[1] >> (8*(11-i))) & 0xff;
-                                }
-                                for(i=12; i<16; i++){
-                                    tmp_ip[i] = (rule.mask.dip[0] >> (8*(15-i))) & 0xff;
-                                }
-                                AIR_PRINT(", dip-mask: ");
-                                AIR_PRINT("%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x\n",
-                                    tmp_ip[0], tmp_ip[1],tmp_ip[2], tmp_ip[3],tmp_ip[4], tmp_ip[5],tmp_ip[6], tmp_ip[7],
-                                    tmp_ip[8], tmp_ip[9],tmp_ip[10], tmp_ip[11],tmp_ip[12], tmp_ip[13],tmp_ip[14], tmp_ip[15]);
-                            }
-                            break;
-                        case AIR_ACL_SIP:
-                            if (0 == rule.key.isipv6)
-                            {
-                                AIR_PRINT("\t sip: ");
-                                AIR_PRINT("%d.%d.%d.%d ",
-                                ((rule.key.sip[0])&0xFF000000)>>24,((rule.key.sip[0])&0x00FF0000)>>16,
-                                ((rule.key.sip[0])&0x0000FF00)>>8, ((rule.key.sip[0])&0x000000FF));
-                                AIR_PRINT(", sip-mask: ");
-                                AIR_PRINT("%d.%d.%d.%d\n ",
-                                ((rule.mask.sip[0])&0xFF000000)>>24,((rule.mask.sip[0])&0x00FF0000)>>16,
-                                ((rule.mask.sip[0])&0x0000FF00)>>8, ((rule.mask.sip[0])&0x000000FF));
-                            }
-                            else
-                            {
-                                for(i=0; i<4; i++){
-                                    tmp_ip[i] = (rule.key.sip[3] >> (8*(3-i))) & 0xff;
-                                }
-                                for(i=4; i<8; i++){
-                                    tmp_ip[i] = (rule.key.sip[2] >> (8*(7-i))) & 0xff;
-                                }
-                                for(i=8; i<12; i++){
-                                    tmp_ip[i] = (rule.key.sip[1] >> (8*(11-i))) & 0xff;
-                                }
-                                for(i=12; i<16; i++){
-                                    tmp_ip[i] = (rule.key.sip[0] >> (8*(15-i))) & 0xff;
-                                }
-                                AIR_PRINT("\t sip: ");
-                                AIR_PRINT("%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x",
-                                    tmp_ip[0], tmp_ip[1],tmp_ip[2], tmp_ip[3],tmp_ip[4], tmp_ip[5],tmp_ip[6], tmp_ip[7],
-                                    tmp_ip[8], tmp_ip[9],tmp_ip[10], tmp_ip[11],tmp_ip[12], tmp_ip[13],tmp_ip[14], tmp_ip[15]);
-                                for(i=0; i<4; i++){
-                                    tmp_ip[i] = (rule.mask.sip[3] >> (8*(3-i))) & 0xff;
-                                }
-                                for(i=4; i<8; i++){
-                                    tmp_ip[i] = (rule.mask.sip[2] >> (8*(7-i))) & 0xff;
-                                }
-                                for(i=8; i<12; i++){
-                                    tmp_ip[i] = (rule.mask.sip[1] >> (8*(11-i))) & 0xff;
-                                }
-                                for(i=12; i<16; i++){
-                                    tmp_ip[i] = (rule.mask.sip[0] >> (8*(15-i))) & 0xff;
-                                }
-                                AIR_PRINT(", sip-mask: ");
-                                AIR_PRINT("%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x\n",
-                                    tmp_ip[0], tmp_ip[1],tmp_ip[2], tmp_ip[3],tmp_ip[4], tmp_ip[5],tmp_ip[6], tmp_ip[7],
-                                    tmp_ip[8], tmp_ip[9],tmp_ip[10], tmp_ip[11],tmp_ip[12], tmp_ip[13],tmp_ip[14], tmp_ip[15]);
-                            }
-                            break;
-                        case AIR_ACL_DSCP:
-                            AIR_PRINT("\t dscp: 0x%x, dscp-mask: 0x%x\n", rule.key.dscp, rule.mask.dscp);
-                            break;
-                        case AIR_ACL_PROTOCOL:
-                            AIR_PRINT("\t protocol: 0x%x, protocol-mask: 0x%x\n", rule.key.protocol, rule.mask.protocol);
-                            break;
-                        case AIR_ACL_FLOW_LABEL:
-                            AIR_PRINT("\t flow-label: 0x%x, flow-label-mask: 0x%x\n", rule.key.flow_label, rule.mask.flow_label);
-                            break;
-                        default:
-                            AIR_PRINT("error\n");
-                            break;
-                    }
-                }
-            }
-        }
-        else
-        {
-            AIR_PRINT("Entry is Invalid.\n");
-        }
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doAclRmvRule(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T rule_idx = 0;
-
-    if(1 == argc)
-    {
-        /* acl del rule <idx(0..127)> */
-        rule_idx = _strtoul(argv[0], NULL, 0);
-        ret = air_acl_delRule(0, rule_idx);
-        if(ret < AIR_E_LAST)
-            AIR_PRINT("Delete ACL Rule(%u): %s\n", rule_idx, air_error_getString(ret));
-    }
-    else if(0 == argc)
-    {
-        /* acl clear rule */
-        ret = air_acl_clearRule(0);
-        if(ret < AIR_E_LAST)
-            AIR_PRINT("Clear ACL Rule: %s\n", air_error_getString(ret));
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        return AIR_E_BAD_PARAMETER;
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doAclUdfRule(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T rule_idx;
-    AIR_ACL_UDF_RULE_T rule;
-    C8_T start_addr[8][12]=
-    {
-        "MAC header",
-        "L2 payload",
-        "IPv4 header",
-        "IPv6 header",
-        "L3 payload",
-        "TCP header",
-        "UDP header",
-        "L4 payload"
-    };
-    C8_T str_temp[AIR_MAX_NUM_OF_PORTS+1];
-
-    memset(&rule, 0, sizeof(AIR_ACL_UDF_RULE_T));
-    if(7 == argc)
-    {
-        /* acl set rule <idx(0..255)> <mode(0:pattern, 1:threshold)> [ <pat(4'hex)> <mask(4'hex)> | <low(4'hex)> <high(4'hex)> ] <start(0:MAC,1:ether,2:IP,3:IP_data,4:TCP/UDP,5:TCP/UDP data,6:IPv6)> <offset(0..62,unit:2 bytes)> <portmap(7'bin)> */
-        rule_idx = _strtoul(argv[0], NULL, 0);
-        rule.cmp_sel = _strtoul(argv[1], NULL, 2);
-        if(AIR_ACL_RULE_CMP_SEL_PATTERN == rule.cmp_sel)
-        {
-            rule.pattern = _strtoul(argv[2], NULL, 16);
-            rule.mask = _strtoul(argv[3], NULL, 16);
-        }
-        else
-        {
-            rule.low_threshold = _strtoul(argv[2], NULL, 16);
-            rule.high_threshold = _strtoul(argv[3], NULL, 16);
-        }
-        rule.offset_format = _strtoul(argv[4], NULL, 0);
-        rule.offset = _strtoul(argv[5], NULL, 0);
-        rule.portmap = _strtoul(argv[6], NULL, 2);
-        rule.valid = TRUE;
-        ret = air_acl_setUdfRule(0, rule_idx, rule);
-        if(ret < AIR_E_LAST)
-            AIR_PRINT("Set ACL UDF Rule(%u): %s\n", rule_idx, air_error_getString(ret));
-    }
-    else if(1 == argc)
-    {
-        rule_idx = _strtoul(argv[0], NULL, 0);
-        ret = air_acl_getUdfRule(0, rule_idx, &rule);
-        if(ret < AIR_E_LAST)
-            AIR_PRINT("Get ACL UDF Rule(%u): %s\n", rule_idx, air_error_getString(ret));
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        return AIR_E_BAD_PARAMETER;
-    }
-
-    if(AIR_E_OK == ret)
-    {
-        if(TRUE == rule.valid)
-        {
-            AIR_PRINT("\tMode          : %s\n", (AIR_ACL_RULE_CMP_SEL_PATTERN == rule.cmp_sel)?"Pattern":"Threshold");
-            if(AIR_ACL_RULE_CMP_SEL_PATTERN == rule.cmp_sel)
-            {
-                AIR_PRINT("\tPattern       : 0x%04X\n", rule.pattern);
-                AIR_PRINT("\tMask          : 0x%04X\n", rule.mask);
-            }
-            else
-            {
-                AIR_PRINT("\tLow Threshold : 0x%04X\n", rule.low_threshold);
-                AIR_PRINT("\tHigh Threshold: 0x%04X\n", rule.high_threshold);
-            }
-            AIR_PRINT("\tOffset Start  : %s\n", start_addr[rule.offset_format]);
-            AIR_PRINT("\tOffset        : %u %s\n", rule.offset*2, (0==rule.offset)?"Byte":"Bytes");
-            _hex2bitstr(rule.portmap, str_temp, AIR_MAX_NUM_OF_PORTS+1);
-            AIR_PRINT("\tPortmap[0:6]  : %s\n", str_temp);
-        }
-        else
-        {
-            AIR_PRINT("Entry is Invalid.\n");
-        }
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doAclRmvUdfRule(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T rule_idx;
-
-    if(1 == argc)
-    {
-        /* acl del udfRule <idx(0..15)> */
-        rule_idx = _strtoul(argv[0], NULL, 0);
-        ret = air_acl_delUdfRule(0, rule_idx);
-        if(ret < AIR_E_LAST)
-            AIR_PRINT("Delete ACL UDF Rule(%u): %s\n", rule_idx, air_error_getString(ret));
-    }
-    else if(0 == argc)
-    {
-        /* acl clear udfRule */
-        ret = air_acl_clearUdfRule(0);
-        if(ret < AIR_E_LAST)
-            AIR_PRINT("Clear ACL UDF Rule: %s\n", air_error_getString(ret));
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        return AIR_E_BAD_PARAMETER;
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doAclAction(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T argi = 0;
-    UI32_T act_idx;
-    AIR_ACL_ACTION_T act;
-    UI32_T redirect, trtcm, fwd;
-    C8_T fwding[AIR_ACL_ACT_FWD_LAST][25] =
-    {
-        "Default",
-        "Default",
-        "Default",
-        "Default",
-        "Default & CPU excluded",
-        "Default & CPU included",
-        "CPU only",
-        "Drop"
-    };
-    C8_T trtcm_usr[AIR_ACL_ACT_USR_TCM_LAST][8] =
-    {
-        "Default",
-        "Green",
-        "Yellow",
-        "Red"
-    };
-    C8_T egtag[AIR_ACL_ACT_EGTAG_LAST][11] =
-    {
-        "Default",
-        "Consistent",
-        "",
-        "",
-        "Untag",
-        "Swap",
-        "Tag",
-        "Stack"
-    };
-    C8_T str_temp[20];
-
-    memset(&act, 0, sizeof(AIR_ACL_ACTION_T));
-    if(2 < argc)
-    {
-        /* acl set action <idx(0..127)>
-        [ forward <forward(0:Default,4:Exclude CPU,5:Include CPU,6:CPU only,7:Drop)> ]
-        [ egtag <egtag(0:Default,1:Consistent,4:Untag,5:Swap,6:Tag,7:Stack)> ]
-        [ mirrormap <mirrormap(2'bin)> ]
-        [ priority <priority(0..7)> ]
-        [ redirect <redirect(0:Dst,1:Vlan)> <portmap(7'bin)> ]
-        [ leaky_vlan <leaky_vlan(1:En,0:Dis)> ]
-        [ cnt_idx <cnt_idx(0..63)> ]
-        [ rate_idx <rate_idx(0..31)> ]
-        [ attack_idx <attack_idx(0..95)> ]
-        [ vid <vid(0..4095)> ]
-        [ manage <manage(1:En,0:Dis)> ]
-        [ bpdu <bpdu(1:En,0:Dis)> ]
-        [ class <class(0:Original,1:Defined)>[0..7] ]
-        [ drop_pcd <drop_pcd(0:Original,1:Defined)> [red <red(0..7)>][yellow <yellow(0..7)>][green <green(0..7)>] ]
-        [ color <color(0:Defined,1:Trtcm)> [ <defined_color(0:Dis,1:Green,2:Yellow,3:Red)> | <trtcm_idx(0..31)> ] ]*/
-
-        act_idx = _strtoul(argv[argi++], NULL, 0);
-        if(0 == _strcmp(argv[argi], "forward"))
-        {
-            argi++;
-            fwd = _strtoul(argv[argi++], NULL, 0);
-            act.fwd_en = TRUE;
-            act.fwd = fwd;
-        }
-
-        if(0 == _strcmp(argv[argi], "egtag"))
-        {
-            argi++;
-            act.egtag_en = TRUE;
-            act.egtag = _strtoul(argv[argi++], NULL, 0);
-        }
-
-        if(0 == _strcmp(argv[argi], "mirrormap"))
-        {
-            argi++;
-            act.mirrormap = _strtoul(argv[argi++], NULL, 2);
-        }
-
-        if(0 == _strcmp(argv[argi], "priority"))
-        {
-            argi++;
-            act.pri_user_en = TRUE;
-            act.pri_user= _strtoul(argv[argi++], NULL, 0);
-        }
-
-        if(0 == _strcmp(argv[argi], "redirect"))
-        {
-            argi++;
-            redirect = _strtoul(argv[argi++], NULL, 0);
-            if(0 ==  redirect)
-            {
-                act.port_en = TRUE;
-                act.dest_port_sel = TRUE;
-                act.portmap = _strtoul(argv[argi++], NULL, 2);
-            }
-            else
-            {
-                act.port_en = TRUE;
-                act.vlan_port_sel = TRUE;
-                act.portmap = _strtoul(argv[argi++], NULL, 2);
-            }
-        }
-
-        if(0 == _strcmp(argv[argi], "leaky_vlan"))
-        {
-            argi++;
-            act.lyvlan_en = TRUE;
-            act.lyvlan = _strtoul(argv[argi++], NULL, 0);
-        }
-
-        /* ACL event counter */
-        if(0 == _strcmp(argv[argi], "cnt_idx"))
-        {
-            argi++;
-            act.cnt_en = TRUE;
-            act.cnt_idx = _strtol(argv[argi++], NULL, 0);
-        }
-
-        if(0 == _strcmp(argv[argi], "rate_idx"))
-        {
-            argi++;
-            act.rate_en = TRUE;
-            act.rate_idx = _strtol(argv[argi++], NULL, 0);
-        }
-
-        if(0 == _strcmp(argv[argi], "attack_idx"))
-        {
-            argi++;
-            act.attack_en = TRUE;
-            act.attack_idx = _strtol(argv[argi++], NULL, 0);
-        }
-
-        if(0 == _strcmp(argv[argi], "vid"))
-        {
-            argi++;
-            act.vlan_en = TRUE;
-            act.vlan_idx = _strtol(argv[argi++], NULL, 0);
-        }
-
-        /* Management frame */
-        if(0 == _strcmp(argv[argi], "manage"))
-        {
-            argi++;
-            act.mang = _strtoul(argv[argi++], NULL, 2);
-        }
-
-        if(0 == _strcmp(argv[argi], "bpdu"))
-        {
-            argi++;
-            act.bpdu = _strtoul(argv[argi++], NULL, 2);
-        }
-
-        /* DSCP class remap */
-        if(0 == _strcmp(argv[argi], "class"))
-        {
-            argi++;
-            act.trtcm_en = TRUE;
-            act.trtcm.cls_slr_sel = _strtoul(argv[argi++], NULL, 2);
-            if(TRUE == act.trtcm.cls_slr_sel)
-            {
-                act.trtcm.cls_slr = _strtoul(argv[argi++], NULL, 0);
-            }
-        }
-        if(0 == _strcmp(argv[argi], "drop_pcd"))
-        {
-            argi++;
-            act.trtcm_en = TRUE;
-            act.trtcm.drop_pcd_sel = _strtoul(argv[argi++], NULL, 2);
-            if(TRUE == act.trtcm.drop_pcd_sel)
-            {
-                if(0 == _strcmp(argv[argi], "red"))
-                {
-                    argi++;
-                    act.trtcm.drop_pcd_r= _strtoul(argv[argi++], NULL, 0);
-                }
-                if(0 == _strcmp(argv[argi], "yellow"))
-                {
-                    argi++;
-                    act.trtcm.drop_pcd_y= _strtoul(argv[argi++], NULL, 0);
-                }
-                if(0 == _strcmp(argv[argi], "green"))
-                {
-                    argi++;
-                    act.trtcm.drop_pcd_g= _strtoul(argv[argi++], NULL, 0);
-                }
-            }
-        }
-
-        /* trTCM */
-        if(0 == _strcmp(argv[argi], "color"))
-        {
-            argi++;
-            act.trtcm_en = TRUE;
-            act.trtcm.tcm_sel = _strtoul(argv[argi++], NULL, 2);
-            trtcm = _strtoul(argv[argi++], NULL, 0);
-            if(FALSE == act.trtcm.tcm_sel)
-            {
-                act.trtcm.usr_tcm = trtcm;
-            }
-            else
-            {
-                act.trtcm.tcm_idx = trtcm;
-            }
-        }
-        ret = air_acl_setAction(0, act_idx, act);
-        AIR_PRINT("Set ACL Action(%u): %s\n", act_idx, air_error_getString(ret));
-    }
-    else if(1 == argc)
-    {
-        /* acl get action <idx(0..127)> */
-        act_idx = _strtoul(argv[argi++], NULL, 0);
-        ret = air_acl_getAction(0, act_idx, &act);
-        AIR_PRINT("Get ACL Action(%u): %s\n", act_idx, air_error_getString(ret));
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        return AIR_E_BAD_PARAMETER;
-    }
-
-    if(AIR_E_OK == ret)
-    {
-        if(TRUE == act.fwd_en)
-        {
-            AIR_PRINT("\t Forwarding           : %s\n", fwding[act.fwd]);
-        }
-
-        if(TRUE == act.egtag_en)
-        {
-            AIR_PRINT("\t Egress tag           : %s\n", egtag[act.egtag]);
-        }
-
-        if(act.mirrormap)
-        {
-            AIR_PRINT("\t Mirror Session Map   : %u\n", act.mirrormap);
-        }
-
-        if(TRUE == act.pri_user_en)
-        {
-            AIR_PRINT("\t User Priority        : %u\n", act.pri_user);
-        }
-
-        if(TRUE == act.port_en)
-        {
-            _hex2bitstr(act.portmap, str_temp, AIR_MAX_NUM_OF_PORTS+1);
-            if(TRUE == act.dest_port_sel)
-            {
-                AIR_PRINT("\t Destination Port[0:6]: %s\n", str_temp);
-            }
-            else
-            {
-                AIR_PRINT("\t VLAN Port[0:6]       : %s\n", str_temp);
-            }
-        }
-
-        if(TRUE == act.lyvlan_en)
-        {
-            AIR_PRINT("\t Leaky VLAN           : %s\n", (TRUE == act.lyvlan)?"Enable":"Disable");
-        }
-        AIR_PRINT("\t Management Frame     : %s\n", (TRUE == act.mang)?"Enable":"Disable");
-        AIR_PRINT("\t BPDU Frame           : %s\n", (TRUE == act.bpdu)?"Enable":"Disable");
-
-        if(TRUE == act.cnt_en)
-        {
-            AIR_PRINT("\t Event Index          : %u\n", act.cnt_idx);
-        }
-
-        /* trTCM*/
-        if(TRUE == act.trtcm_en)
-        {
-            if(TRUE == act.trtcm.cls_slr_sel)
-            {
-                AIR_PRINT("\t Class Selector Remap : %u\n", act.trtcm.cls_slr);
-            }
-            else
-            {
-                AIR_PRINT("\t Class Selector Remap : %s\n", "Disable");
-            }
-            if(TRUE == act.trtcm.drop_pcd_sel)
-            {
-                AIR_PRINT("\t Drop Precedence Remap(Red): %u\n", act.trtcm.drop_pcd_r);
-                AIR_PRINT("\t Drop Precedence Remap(Yel): %u\n", act.trtcm.drop_pcd_y);
-                AIR_PRINT("\t Drop Precedence Remap(Gre): %u\n", act.trtcm.drop_pcd_g);
-            }
-            else
-            {
-                AIR_PRINT("\t Drop Precedence Remap: %s\n", "Disable");
-            }
-
-            if(TRUE == act.trtcm.tcm_sel)
-            {
-                AIR_PRINT("\t trTCM Meter Index    : %u\n", act.trtcm.tcm_idx);
-            }
-            else
-            {
-                AIR_PRINT("\t trTCM User Defined   : %s\n", trtcm_usr[act.trtcm.usr_tcm]);
-            }
-        }
-        /* rate control */
-        if(TRUE == act.rate_en)
-        {
-            AIR_PRINT("\t Rate Control Index   : %u\n", act.rate_idx);
-        }
-
-        if(TRUE == act.attack_en)
-        {
-            AIR_PRINT("\t Attack Rate Control Index: %u\n", act.attack_idx);
-        }
-
-        if(TRUE == act.vlan_en)
-        {
-            AIR_PRINT("\t ACL VLAN Index       : %u\n", act.vlan_idx);
-        }
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doAclRmvAction(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T act_idx;
-
-    if(1 == argc)
-    {
-        /* acl del action <idx(0..127)> */
-        act_idx = _strtoul(argv[0], NULL, 0);
-        ret = air_acl_delAction(0, act_idx);
-        if(ret < AIR_E_LAST)
-            AIR_PRINT("Delete ACL Action(%u): %s\n", act_idx, air_error_getString(ret));
-    }
-    else if(0 == argc)
-    {
-        /* acl clear action */
-        ret = air_acl_clearAction(0);
-        if(ret < AIR_E_LAST)
-            AIR_PRINT("Clear ACL Action: %s\n", air_error_getString(ret));
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        return AIR_E_BAD_PARAMETER;
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doAclTrtcm(
-    UI32_T argc,
-    C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T argi = 0;
-    UI32_T tcm_idx;
-    AIR_ACL_TRTCM_T tcm;
-
-    memset(&tcm, 0, sizeof(AIR_ACL_TRTCM_T));
-    if(5 == argc)
-    {
-        /* acl set trtcm <idx(0..31)> <cir(4'hex)> <pir(4'hex)> <cbs(4'hex)> <pbs(4'hex)> */
-        tcm_idx = _strtoul(argv[argi++], NULL, 0);
-        tcm.cir = _strtoul(argv[argi++], NULL, 16);
-        tcm.pir = _strtoul(argv[argi++], NULL, 16);
-        tcm.cbs = _strtoul(argv[argi++], NULL, 16);
-        tcm.pbs = _strtoul(argv[argi++], NULL, 16);
-
-        ret = air_acl_setTrtcm(0, tcm_idx, tcm);
-        if(ret < AIR_E_LAST)
-            AIR_PRINT("Set ACL trTCM(%u): %s\n", tcm_idx, air_error_getString(ret));
-    }
-    else if(1 == argc)
-    {
-        /* acl get trtcm <idx(1..31)> */
-        tcm_idx = _strtoul(argv[argi++], NULL, 0);
-        ret = air_acl_getTrtcm(0, tcm_idx, &tcm);
-        if(ret < AIR_E_LAST)
-            AIR_PRINT("Get ACL trTCM(%u): %s\n", tcm_idx, air_error_getString(ret));
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        return AIR_E_BAD_PARAMETER;
-    }
-
-    if(AIR_E_OK == ret)
-    {
-        AIR_PRINT("\t CIR: 0x%04X(unit:64Kbps)\n", tcm.cir);
-        AIR_PRINT("\t PIR: 0x%04X(unit:64Kbps)\n", tcm.pir);
-        AIR_PRINT("\t CBS: 0x%04X(unit:Byte)\n", tcm.cbs);
-        AIR_PRINT("\t PBS: 0x%04X(unit:Byte)\n", tcm.pbs);
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doAclTrtcmEn(
-    UI32_T argc,
-    C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    BOOL_T state = FALSE;
-
-    if (1 == argc)
-    {
-        /* acl set trtcmEn <en(1:En,0:Dis)> */
-        state = _strtol(argv[0], NULL, 10);
-        ret = air_acl_setTrtcmEnable(0, state);
-        AIR_PRINT("Set trTCM State ");
-    }
-    else if (0 == argc)
-    {
-        /* acl get trtcmEn */
-        ret = air_acl_getTrtcmEnable(0, &state);
-        AIR_PRINT("Get trTCM State ");
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        return AIR_E_BAD_PARAMETER;
-    }
-
-    if (ret == AIR_E_OK)
-    {
-        AIR_PRINT(": %s\n", (TRUE == state) ? "Enable" : "Disable");
-    }
-    else
-    {
-        AIR_PRINT("Fail!\n");
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doAclRmvTrtcm(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T tcm_idx;
-
-    if(1 == argc)
-    {
-        /* acl del trtcm <idx(1..31)> */
-        tcm_idx = _strtoul(argv[0], NULL, 0);
-        ret = air_acl_delTrtcm(0, tcm_idx);
-        if(ret < AIR_E_LAST)
-            AIR_PRINT("Delete ACL TRTCM(%u): %s\n", tcm_idx, air_error_getString(ret));
-    }
-    else if(0 == argc)
-    {
-        /* acl clear trtcm */
-        ret = air_acl_clearTrtcm(0);
-        if(ret < AIR_E_LAST)
-            AIR_PRINT("Clear ACL TRTCM: %s\n", air_error_getString(ret));
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        return AIR_E_BAD_PARAMETER;
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doAclPortEn(
-    UI32_T argc,
-    C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T argi=0;
-    UI32_T port = 0;
-    BOOL_T en;
-
-    if(2 == argc)
-    {
-        /* acl set portEn <port(0..6)> <en(1:En,0:Dis)> */
-        port = _strtoul(argv[argi++], NULL, 0);
-        en = _strtoul(argv[argi++], NULL, 2);
-        ret = air_acl_setPortEnable(0, port, en);
-        AIR_PRINT("Set Port:%u ACL function ", port);
-    }
-    else if(1 == argc)
-    {
-        /* acl get portEn <port(0..6)> */
-        port = _strtoul(argv[argi++], NULL, 0);
-        ret = air_acl_getPortEnable(0, port, &en);
-        AIR_PRINT("Get Port:%u ACL function ", port);
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        return AIR_E_BAD_PARAMETER;
-    }
-
-    if(ret == AIR_E_OK)
-    {
-        AIR_PRINT(": %s\n", (TRUE == en)?"Enable":"Disable");
-    }
-    else
-    {
-        AIR_PRINT("Fail!\n");
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doAclDropEn(
-    UI32_T argc,
-    C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T argi=0;
-    UI32_T port = 0;
-    BOOL_T en;
-
-    if(2 == argc)
-    {
-        /* acl set dropEn <port(0..6)> <en(1:En,0:Dis)> */
-        port = _strtoul(argv[argi++], NULL, 0);
-        en = _strtoul(argv[argi++], NULL, 2);
-        ret = air_acl_setDropEnable(0, port, en);
-        AIR_PRINT("Set ACL Drop precedence ");
-    }
-    else if(1 == argc)
-    {
-        /* acl set dropEn <port(0..6)> */
-        port = _strtoul(argv[argi++], NULL, 0);
-        ret = air_acl_getDropEnable(0, port, &en);
-        AIR_PRINT("Get ACL Drop precedence ");
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        return AIR_E_BAD_PARAMETER;
-    }
-
-    if(ret == AIR_E_OK)
-    {
-        AIR_PRINT("(Port %u):%s\n",
-                port,
-                (TRUE == en)?"Enable":"Disable");
-    }
-    else
-    {
-        AIR_PRINT("Fail!\n");
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doAclDropThrsh(
-    UI32_T argc,
-    C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T argi=0;
-    UI32_T port = 0;
-    AIR_ACL_DP_COLOR_T color;
-    UI8_T queue;
-    UI32_T high, low;
-    C8_T dp_color[AIR_ACL_DP_COLOR_LAST][7] =
-    {
-        "Green",
-        "Yellow",
-        "Red"
-    };
-
-    if(5 == argc)
-    {
-        /* acl set dropThrsh <port(0..6)> <color(0:green,1:yellow,2:red)> <queue(0..7)> <high(0..2047)> <low(0..2047) */
-        port = _strtoul(argv[argi++], NULL, 0);
-        color = _strtoul(argv[argi++], NULL, 0);
-        queue = _strtoul(argv[argi++], NULL, 0);
-        high = _strtoul(argv[argi++], NULL, 0);
-        low = _strtoul(argv[argi++], NULL, 0);
-        ret = air_acl_setDropThreshold(0, port, color, queue, high, low);
-        AIR_PRINT("Set ACL Drop precedence ");
-    }
-    else if(3 == argc)
-    {
-        /* acl get dropThrsh <port(0..6)> <color(0:green,1:yellow,2:red)> <queue(0..7)> */
-        port = _strtoul(argv[argi++], NULL, 0);
-        color = _strtoul(argv[argi++], NULL, 0);
-        queue = _strtoul(argv[argi++], NULL, 0);
-        ret = air_acl_getDropThreshold(0, port, color, queue, &high, &low);
-        AIR_PRINT("Get ACL Drop precedence ");
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        return AIR_E_BAD_PARAMETER;
-    }
-
-    if(ret == AIR_E_OK)
-    {
-        AIR_PRINT("(Port %u, color:%s, queue:%u):\n",
-                port,
-                dp_color[color],
-                queue);
-        AIR_PRINT("\tHigh Threshold :%u\n", high);
-        AIR_PRINT("\tLow Threshold  :%u\n", low);
-    }
-    else
-    {
-        AIR_PRINT("Fail!\n");
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doAclDropPbb(
-    UI32_T argc,
-    C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T argi=0;
-    UI32_T port = 0;
-    AIR_ACL_DP_COLOR_T color;
-    UI8_T queue;
-    UI32_T pbb;
-    C8_T dp_color[AIR_ACL_DP_COLOR_LAST][7] =
-    {
-        "Green",
-        "Yellow",
-        "Red"
-    };
-
-    if(4 == argc)
-    {
-        /* acl set dropPbb <port(0..6)> <color(0:green,1:yellow,2:red)> <queue(0..7)> <probability(0..1023) */
-        port = _strtoul(argv[argi++], NULL, 0);
-        color = _strtoul(argv[argi++], NULL, 0);
-        queue = _strtoul(argv[argi++], NULL, 0);
-        pbb = _strtoul(argv[argi++], NULL, 0);
-        ret = air_acl_setDropProbability(0, port, color, queue, pbb);
-        AIR_PRINT("Set ACL Drop precedence ");
-    }
-    else if(3 == argc)
-    {
-        /* acl get dropPbb <port(0..6)> <color(0:green,1:yellow,2:red)> <queue(0..7)> */
-        port = _strtoul(argv[argi++], NULL, 0);
-        color = _strtoul(argv[argi++], NULL, 0);
-        queue = _strtoul(argv[argi++], NULL, 0);
-        ret = air_acl_getDropProbability(0, port, color, queue, &pbb);
-        AIR_PRINT("Get ACL Drop precedence ");
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        return AIR_E_BAD_PARAMETER;
-    }
-
-    if(ret == AIR_E_OK)
-    {
-        AIR_PRINT("(Port %u, color:%s, queue %u):\n",
-                port,
-                dp_color[color],
-                queue);
-        AIR_PRINT("\tDrop probability:%u(unit=1/1023)\n", pbb);
-    }
-    else
-    {
-        AIR_PRINT("Fail!\n");
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doAclMeter(
-    UI32_T argc,
-    C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T argi = 0;
-    UI32_T meter_idx, state, rate;
-
-    if(3 == argc)
-    {
-        /* acl set meter <idx(0..31)> <en(1:En,0:Dis)> <rate(0..65535)>
-           Note: Limit rate = rate * 64Kbps */
-        meter_idx = _strtoul(argv[argi++], NULL, 0);
-        state = _strtoul(argv[argi++], NULL, 2);
-        rate = _strtoul(argv[argi++], NULL, 0);
-
-        ret = air_acl_setMeterTable(0, meter_idx, state, rate);
-        if(ret < AIR_E_LAST)
-            AIR_PRINT("Set ACL Meter(%u): %s\n", meter_idx, air_error_getString(ret));
-    }
-    else if(1 == argc)
-    {
-        /* acl get meter <idx(0..31)> */
-        meter_idx = _strtoul(argv[argi++], NULL, 0);
-        ret = air_acl_getMeterTable(0, meter_idx, &state, &rate);
-        if(ret < AIR_E_LAST)
-            AIR_PRINT("Get ACL Meter(%u): %s\n", meter_idx, air_error_getString(ret));
-    }
-    else
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        return AIR_E_BAD_PARAMETER;
-    }
-
-    if(AIR_E_OK == ret)
-    {
-        AIR_PRINT("\t State: %s\n", (TRUE == state)?"Enable":"Disable");
-        if(TRUE == state)
-        {
-            AIR_PRINT("\t Rate : %u(unit:64Kbps)\n", rate);
-        }
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doAclDump(
-    UI32_T argc,
-    C8_T *argv[])
-{
-    AIR_ERROR_NO_T ret = AIR_E_OK;
-    UI32_T i, cnt = 0;
-    AIR_ACL_CTRL_T ctrl;
-
-    if(0 != argc)
-    {
-        AIR_PRINT("Unrecognized command.\n");
-        return AIR_E_BAD_PARAMETER;
-    }
-
-    for(i=0; i<ACL_MAX_RULE_NUM; i++)
-    {
-        memset(&ctrl, 0, sizeof(AIR_ACL_CTRL_T));
-        ret = air_acl_getRuleCtrl(0, i, &ctrl);
-        if(AIR_E_OK == ret)
-        {
-            if(TRUE == ctrl.rule_en)
-            {
-                cnt++;
-                AIR_PRINT("\t Entry-%d vaild\n", i);
-            }
-        }
-    }
-    if(0 == cnt)
-    {
-        AIR_PRINT("\t No entry vaild\n");
-    }
-
-    return ret;
-}
-
-static AIR_ERROR_NO_T
-doAclSet(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(aclSetCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doAclGet(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(aclGetCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doAclDel(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(aclDelCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doAclClear(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(aclClearCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-doAcl(
-        UI32_T argc,
-        C8_T *argv[])
-{
-    return subcmd(aclCmds, argc, argv);
-}
-
-static AIR_ERROR_NO_T
-subcmd(
-        const AIR_CMD_T tab[],
-        UI32_T argc,
-        C8_T *argv[])
-{
-    const AIR_CMD_T *cmdp;
-    I32_T found = 0;
-    I32_T i, len;
-
-    if (argc < 1)
-    {
-        goto print_out_cmds;
-    }
-
-    for (cmdp = tab; cmdp->name != NULL; cmdp++)
-    {
-        if (strlen(argv[0]) == strlen(cmdp->name))
-        {
-            if (strncmp(argv[0], cmdp->name, strlen(argv[0])) == 0)
-            {
-                found = 1;
-                break;
-            }
-        }
-    }
-
-    if(!found)
-    {
-        C8_T buf[66];
-
-print_out_cmds:
-        AIR_PRINT("valid subcommands:\n");
-        memset(buf, ' ', sizeof(buf));
-        buf[64] = '\n';
-        buf[65] = '\0';
-
-        for (i=0, cmdp = tab; cmdp->name != NULL; cmdp++)
-        {
-            len = strlen(cmdp->name);
-            strncpy(&buf[i*16], cmdp->name, (len > 16) ? 16 : len);
-            if(3 == i)
-            {
-                AIR_PRINT("%s\n", buf);
-                memset(buf, ' ', sizeof(buf));
-                buf[64] = '\n';
-                buf[65] = '\0';
-            }
-            i = (i + 1) % 4;
-        }
-
-        if (0 != i)
-            AIR_PRINT("%s\n", buf);
-
-        return AIR_E_BAD_PARAMETER;
-    }
-
-    if (CMD_NO_PARA == cmdp->argc_min)
-    {
-        if (argc != 1)
-        {
-            if (cmdp->argc_errmsg != NULL)
-            {
-                AIR_PRINT("Usage: %s\n", cmdp->argc_errmsg);
-            }
-
-            return AIR_E_BAD_PARAMETER;
-        }
-    }
-    else if (CMD_VARIABLE_PARA == cmdp->argc_min)
-    {
-        if (argc < 3)
-        {
-            if (cmdp->argc_errmsg != NULL)
-            {
-                AIR_PRINT("Usage: %s\n", cmdp->argc_errmsg);
-            }
-
-            return AIR_E_BAD_PARAMETER;
-        }
-    }
-    else
-    {
-        if ((argc <= cmdp->argc_min) || ((cmdp->argc_min != 0) && (argc != (cmdp->argc_min + 1))))
-        {
-            if (cmdp->argc_errmsg != NULL)
-            {
-                AIR_PRINT("Usage: %s\n", cmdp->argc_errmsg);
-            }
-
-            return AIR_E_BAD_PARAMETER;
-        }
-    }
-
-    if (cmdp->func)
-    {
-        argc--;
-        argv++;
-        return (*cmdp->func)(argc, argv);
-    }
-    return AIR_E_OK;
-}
-
-/* FUNCTION NAME:   air_parse_cmd
- * PURPOSE:
- *      This function is used process diagnostic cmd
- * INPUT:
- *      argc         -- parameter number
- *      argv         -- parameter strings
- * OUTPUT:
- *      None
- * RETURN:
- *      NPS_E_OK     -- Successfully read the data.
- *      NPS_E_OTHERS -- Failed to read the data.
- * NOTES:
- *
- */
-AIR_ERROR_NO_T
-air_parse_cmd(
-        const UI32_T argc,
-        const C8_T **argv)
-{
-    return subcmd(Cmds, argc, (C8_T **)argv);
-}
-
+/* FILE NAME:   air_cmd.c
+ * PURPOSE:
+ *      Define the command line function in AIR SDK.
+ * NOTES:
+ */
+
+/* INCLUDE FILE DECLARATIONS
+*/
+#include "air.h"
+
+/* NAMING CONSTANT DECLARATIONS
+*/
+
+/* MACRO FUNCTION DECLARATIONS
+*/
+#define MAC_STR         "%02X%02X%02X%02X%02X%02X"
+#define MAC2STR(m)      (m)[0],(m)[1],(m)[2],(m)[3],(m)[4],(m)[5]
+#define AIR_MAC_LEN    (12)
+#define CMD_NO_PARA     (0xFFFFFFFF)
+#define CMD_VARIABLE_PARA (0xFFFFFFFE)
+#define L2_WDOG_KICK_NUM            (100)
+
+#define TOLOWER(x)      ((x) | 0x20)
+#define isxdigit(c)     (('0' <= (c) && (c) <= '9') || ('a' <= (c) && (c) <= 'f') || ('A' <= (c) && (c) <= 'F'))
+#define isdigit(c)      ('0' <= (c) && (c) <= '9')
+#define CMD_CHECK_PARA(__shift__, __op__, __size__) do          \
+{                                                               \
+    if ((__shift__) __op__ (__size__))                          \
+    {                                                           \
+        ;                                                       \
+    }                                                           \
+    else                                                        \
+    {                                                           \
+        return (AIR_E_BAD_PARAMETER);                           \
+    }                                                           \
+} while(0)
+
+/* DATA TYPE DECLARATIONS
+*/
+typedef struct {
+    C8_T*               name;
+    AIR_ERROR_NO_T     (*func)(UI32_T argc, C8_T *argv[]);
+    UI32_T              argc_min;
+    C8_T*               argc_errmsg;
+} AIR_CMD_T;
+
+/* GLOBAL VARIABLE DECLARATIONS
+*/
+
+/* LOCAL SUBPROGRAM DECLARATIONS
+*/
+/* String Utility */
+static BOOL_T _strcmp(const char *s1, const char *s2);
+static C8_T * _strtok_r(C8_T *s, const C8_T *delim, C8_T **last);
+static C8_T * _strtok(C8_T *s, const C8_T *delim, C8_T **last);
+UI32_T _strtoul(const C8_T *cp, C8_T **endp, UI32_T base);
+static I32_T _strtol(const C8_T *cp, C8_T **endp, UI32_T base);
+
+/* Type Converter */
+static AIR_ERROR_NO_T _str2mac(C8_T *str, C8_T *mac);
+static AIR_ERROR_NO_T _hex2bit(const UI32_T hex, UI32_T *ptr_bit);
+static AIR_ERROR_NO_T _hex2bitstr(const UI32_T hex, C8_T *ptr_bit_str, UI32_T str_len);
+static AIR_ERROR_NO_T _portListStr2Ary(const C8_T *str, UI32_T *ary, const UI32_T ary_num);
+
+/* Register Operation */
+static AIR_ERROR_NO_T doRegRead(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doRegWrite(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doReg(UI32_T argc, C8_T *argv[]);
+
+/* PHY Operation */
+static AIR_ERROR_NO_T doPhyCL22Read(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doPhyCL22Write(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doPhyCL22(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doPhyCL45Read(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doPhyCL45Write(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doPhyCL45(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doPhy(UI32_T argc, C8_T *argv[]);
+
+/* Porting setting */
+static AIR_ERROR_NO_T doPortSetMatrix(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doPortSetVlanMode(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doPortSet(UI32_T argc, C8_T *argv[]);
+
+static AIR_ERROR_NO_T doPortGetMatrix(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doPortGetVlanMode(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doPortGet(UI32_T argc, C8_T *argv[]);
+
+static AIR_ERROR_NO_T doPort(UI32_T argc, C8_T *argv[]);
+
+/* Vlan setting */
+static AIR_ERROR_NO_T doVlanInitiate(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doVlanCreate(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doVlanDestroy(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doVlanDestroyAll(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doVlanDump(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doVlanAddPortMem(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doVlanDelPortMem(UI32_T argc, C8_T *argv[]);
+
+static AIR_ERROR_NO_T doVlanSetFid(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doVlanSetMemPort(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doVlanSetIVL(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doVlanSetPortBaseStag(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doVlanSetStag(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doVlanSetEgsTagCtlEn(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doVlanSetEgsTagCtlCon(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doVlanSetEgsTagCtl(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doVlanSetPortActFrame(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doVlanSetLeakyVlanEn(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doVlanSetPortVlanAttr(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doVlanSetIgsPortETagAttr(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doVlanSetPortETagAttr(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doVlanSetPortOuterTPID(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doVlanSetPvid(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doVlanSet(UI32_T argc, C8_T *argv[]);
+
+static AIR_ERROR_NO_T doVlanGetPortActFrame(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doVlanGetLeakyVlanEn(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doVlanGetPortVlanAttr(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doVlanGetIgsPortETagAttr(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doVlanGetPortETagAttr(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doVlanGetPortOuterTPID(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doVlanGetPvid(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doVlanGet(UI32_T argc, C8_T *argv[]);
+
+static AIR_ERROR_NO_T doVlan(UI32_T argc, C8_T *argv[]);
+
+static AIR_ERROR_NO_T doFlowCtrl(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doJumbo(UI32_T argc, C8_T *argv[]);
+
+static AIR_ERROR_NO_T doL2Add(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doL2Del(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doL2Clear(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doL2Get(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doL2Set(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doL2Dump(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doL2(UI32_T argc, C8_T *argv[]);
+
+static AIR_ERROR_NO_T doAnMode(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doLocalAdv(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doRemoteAdv(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doPortSpeed(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doPortDuplex(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doPortStatus(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doPortBckPres(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doPortPsMode(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doPortSmtSpdDwn(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doPortSpTag(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doPortEnable(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doPort5GBaseRMode(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doPortHsgmiiMode(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doPortSgmiiMode(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doPortRmiiMode(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doPortRgmiiMode(UI32_T argc, C8_T *argv[]);
+
+static AIR_ERROR_NO_T doSptagEn(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doSptagMode(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doSptagDecode(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doSptagEncode(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doSptag(UI32_T argc, C8_T *argv[]);
+
+static AIR_ERROR_NO_T doMacAddr(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T _printMacEntry(AIR_MAC_ENTRY_T * mt, UI32_T age_unit, UI8_T count, UI8_T title);
+static AIR_ERROR_NO_T doGetMacAddr(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doMacAddrAgeOut(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doDumpMacAddr(UI32_T argc, C8_T *argv[]);
+
+static AIR_ERROR_NO_T doLagMember(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doLagMemberCnt(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doLagPtseed(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doLagHashtype(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doLagDstInfo(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doLagState(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doLagSpsel(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doLagGet(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doLagSet(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doLag(UI32_T argc, C8_T *argv[]);
+
+static AIR_ERROR_NO_T doStpPortstate(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doStpGet(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doStpSet(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doStp(UI32_T argc, C8_T *argv[]);
+
+static AIR_ERROR_NO_T doMirrorGetSid(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doMirrorDelSid(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doMirrorAddRlist(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doMirrorAddTlist(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doMirrorSetSessionEnable(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doMirrorSetSession(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doMirrorSet(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doMirrorAdd(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doMirrorGet(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doMirrorDel(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doMirror(UI32_T argc,C8_T *argv[]);
+
+static AIR_ERROR_NO_T doMibClearPort(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doMibClearAcl(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doMibGetPort(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doMibGetAcl(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doMibClear(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doMibGet(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doMib(UI32_T argc, C8_T *argv[]);
+
+static AIR_ERROR_NO_T doQosScheduleAlgo(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doQosTrustMode(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doQosPri2Queue(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doQosDscp2Pri(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doQosRateLimitEnable(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doQosRateLimit(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doQosPortPriority(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doQosRateLimitExMngFrm(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doQosGet(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doQosSet(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doQos(UI32_T argc, C8_T *argv[]);
+
+static AIR_ERROR_NO_T doDiagTxComply(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doDiagSet(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doDiagGet(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doDiag(UI32_T argc, C8_T *argv[]);
+
+static AIR_ERROR_NO_T doLedMode(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doLedState(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doLedUsrDef(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doLedBlkTime(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doLedSet(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doLedGet(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doLed(UI32_T argc, C8_T *argv[]);
+
+static AIR_ERROR_NO_T doSwitchCpuPortEn(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doSwitchCpuPort(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doSwitchPhyLCIntrEn(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doSwitchPhyLCIntrSts(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doSwitchSet(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doSwitchGet(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doSwitch(UI32_T argc, C8_T *argv[]);
+
+static AIR_ERROR_NO_T doShowVersion(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doShow(UI32_T argc, C8_T *argv[]);
+
+static AIR_ERROR_NO_T doStormEnable(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doStormRate(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doFldMode(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doSaLearning(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doSaLimit(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doSecGet(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doSecSet(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doSec(UI32_T argc, C8_T *argv[]);
+
+static void _air_acl_printRuleMap(UI32_T *rule_map, UI32_T ary_num);
+static AIR_ERROR_NO_T doAclEn(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doAclRule(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doAclUdfRule(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doAclRmvRule(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doAclRmvUdfRule(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doAclAction(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doAclRmvAction(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doAclDumpAction(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doAclTrtcm(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doAclTrtcmEn(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doAclRmvTrtcm(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doAclPortEn(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doAclDropEn(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doAclDropThrsh(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doAclDropPbb(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doAclMeter(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doAclDump(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doAclSet(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doAclGet(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doAclDel(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doAclClear(UI32_T argc, C8_T *argv[]);
+static AIR_ERROR_NO_T doAcl(UI32_T argc, C8_T *argv[]);
+
+static AIR_ERROR_NO_T subcmd(const AIR_CMD_T tab[], UI32_T argc, C8_T *argv[]);
+
+/* STATIC VARIABLE DECLARATIONS
+*/
+const static C8_T *_sptag_vpm[] =
+{
+    "untagged",
+    "8100",
+    "predefined",
+    "unknown"
+};
+
+const static C8_T *_sptag_pt[] =
+{
+    "disable pass through",
+    "enable pass through"
+};
+
+const static C8_T *_air_mac_address_forward_control_string [] =
+{
+    "Default",
+    "CPU include",
+    "CPU exclude",
+    "CPU only",
+    "Drop"
+};
+
+static AIR_CMD_T regCmds[] =
+{
+    {"r",           doRegRead,      1,      "reg r <reg(4'hex)>"},
+    {"w",           doRegWrite,     2,      "reg w <reg(4'hex)> <value(8'hex)>"},
+
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T phyCL22Cmds[] =
+{
+    {"r",           doPhyCL22Read,  2,      "phy cl22 r <port(0..4)> <reg(2'hex)>"},
+    {"w",           doPhyCL22Write, 3,      "phy cl22 w <port(0..4)> <reg(2'hex)> <value(4'hex)>"},
+
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T phyCL45Cmds[] =
+{
+    {"r",           doPhyCL45Read,  3,      "phy cl45 r <port(0..4)> <dev(2'hex)> <reg(3'hex)>"},
+    {"w",           doPhyCL45Write, 4,      "phy cl45 w <port(0..4)> <dev(2'hex)> <reg(3'hex)> <value(4'hex)>"},
+
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T phyCmds[] =
+{
+    {"cl22",         doPhyCL22,     0,      NULL},
+    {"cl45",         doPhyCL45,     0,      NULL},
+
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T portSetCmds[] =
+{
+    {"matrix",      doPortSetMatrix,        2,                "port set matrix <port(0..6)> <matrix(6:0)>"},
+    {"vlanMode",    doPortSetVlanMode,      2,                "port set vlanMode <port(0..6)> <vlanMode(0:matrix,1:fallback,2:check,3:security)>"},
+    {"flowCtrl",    doFlowCtrl,             3,                "port set flowCtrl <port(0..6)> <dir(0:Tx,1:Rx)> <fc_en(1:En,0:Dis)>"},
+    {"jumbo",       doJumbo,                2,                "port set jumbo <pkt_len(0:1518,1:1536,2:1552,3:max)> <frame_len(2..15)>"},
+    {"anMode",      doAnMode,               2,                "port set anMode <port(0..4)> <en(0:force,1:AN)>"},
+    {"localAdv",    doLocalAdv,             7,                "port set localAdv <port(0..4)> <10H(1:En,0:Dis)> <10F(1:En,0:Dis)> <100H(1:En,0:Dis)> <100F(1:En,0:Dis)> <1000F(1:En,0:Dis)> <pause(1:En,0:Dis)>"},
+    {"speed",       doPortSpeed,            2,                "port set speed <port(0..4)> <speed(0:10M,1:100M,2:1G,3:2.5G)>"},
+    {"duplex",      doPortDuplex,           2,                "port set duplex <port(0..4)> <duplex(0:half,1:full)>"},
+    {"bckPres",     doPortBckPres,          2,                "port set bckPres <port(0..6)> <bckPres(1:En,0:Dis)>"},
+    {"psMode",      doPortPsMode,           3,                "port set psMode <port(0..4)> <ls(1:En,0:Dis)> <eee(1:En,0:Dis)>"},
+    {"smtSpdDwn",   doPortSmtSpdDwn,        3,                "port set smtSpdDwn <port(0..4)> <en(1:En,0:Dis)> <retry(2..5)>"},
+    {"spTag",       doPortSpTag,            2,                "port set spTag <port(0..6)> <en(1:En,0:Dis)>"},
+    {"enable",      doPortEnable,           2,                "port set enable <port(0..4)> <en(1:En,0:Dis)>"},
+    {"5GBaseRMode", doPort5GBaseRMode,      CMD_NO_PARA,      "port set 5GBaseRMode"},
+    {"hsgmiiMode",  doPortHsgmiiMode,       CMD_NO_PARA,      "port set hsgmiiMode"},
+    {"sgmiiMode",   doPortSgmiiMode,        2,                "port set sgmiiMode <mode(0:AN,1:Force)> <speed(0:10M,1:100M,2:1G)>"},
+    {"rmiiMode",    doPortRmiiMode,         1,                "port set rmiiMode <speed(0:10M,1:100M)>"},
+    {"rgmiiMode",   doPortRgmiiMode,        1,                "port set rgmiiMode <speed(0:10M,1:100M,2:1G)>"},
+
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T portGetCmds[] =
+{
+    {"matrix",      doPortGetMatrix,        1,                "port get matrix <port(0..6)>"},
+    {"vlanMode",    doPortGetVlanMode,      1,                "port get vlanMode <port(0..6)>"},
+    {"flowCtrl",    doFlowCtrl,             2,                "port get flowCtrl <port(0..6)> <dir(0:Tx,1:Rx)>"},
+    {"jumbo",       doJumbo,                CMD_NO_PARA,      "port get jumbo"},
+    {"anMode",      doAnMode,               1,                "port get anMode <port(0..4)>"},
+    {"localAdv",    doLocalAdv,             1,                "port get localAdv <port(0..4)>"},
+    {"remoteAdv",   doRemoteAdv,            1,                "port get remoteAdv <port(0..4)>"},
+    {"speed",       doPortSpeed,            1,                "port get speed <port(0..4)>"},
+    {"duplex",      doPortDuplex,           1,                "port get duplex <port(0..4)>"},
+    {"status",      doPortStatus,           1,                "port get status <port(0..4)>"},
+    {"bckPres",     doPortBckPres,          1,                "port get bckPres <port(0..6)>"},
+    {"psMode",      doPortPsMode,           1,                "port get psMode <port(0..4)>"},
+    {"smtSpdDwn",   doPortSmtSpdDwn,        1,                "port get smtSpdDwn <port(0..4)>"},
+    {"spTag",       doPortSpTag,            1,                "port get spTag <port(0..6)>"},
+    {"enable",      doPortEnable,           1,                "port get enable <port(0..4)>"},
+
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T portCmds[] =
+{
+    {"set",         doPortSet,      0,      NULL},
+    {"get",         doPortGet,      0,      NULL},
+
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T sptagCmds[] =
+{
+    {"setEnable",       doSptagEn,          2,      "sptag setEnable port<port(0..6)> enable<1:enable 0:disable>"},
+    {"getEnable",       doSptagEn,          1,      "sptag getEnable port<port(0..6)>"},
+    {"setmode",         doSptagMode,        2,      "sptag setmode port<port(0..6)> mode<0:inset 1:replace>"},
+    {"getmode",         doSptagMode,        1,      "sptag getmode port<port(0..6)>"},
+    {"encode",          doSptagEncode,      7,      "sptag encode mode={ insert | replace } opc={ portmap | portid | lookup } dp={bitimap hex} vpm={ untagged | 8100 | 88a8 } pri=<UINT> cfi=<UINT> vid=<UINT> "},
+    {"decode",          doSptagDecode,      4,      "sptag decode <byte(hex)> <byte(hex)> <byte(hex)> <byte(hex)>"},
+
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T vlanSetCmds[] =
+{
+    {"fid",                 doVlanSetFid,               2,      "vlan set fid <vid(0..4095)> <fid(0..7)>"},
+    {"memPort",             doVlanSetMemPort,           2,      "vlan set memPort <vid(0..4095)> <bitmap(6:0)>"},
+    {"ivl",                 doVlanSetIVL,               2,      "vlan set ivl <vid(0..4095)> <(1:En,0:Dis)>"},
+    {"portBaseStag",        doVlanSetPortBaseStag,      2,      "vlan set portBaseStag <vid(0..4095)> <(1:En,0:Dis)>"},
+    {"stag",                doVlanSetStag,              2,      "vlan set stag <vid(0..4095)> <stag(0..4095)>"},
+    {"egsTagCtlEn",         doVlanSetEgsTagCtlEn,       2,      "vlan set egsTagCtlEn <vid(0..4095)> <(1:En,0:Dis)>"},
+    {"egsTagCtlCon",        doVlanSetEgsTagCtlCon,      2,      "vlan set egsTagCtlCon <vid(0..4095)> <(1:En,0:Dis)>"},
+    {"egsTagCtl",           doVlanSetEgsTagCtl,         3,      "vlan set egsTagCtl <vid(0..4095)> <port(0..6)> <ctlType(0:untag,2:tagged)>"},
+
+    {"portActFrame",        doVlanSetPortActFrame,      2,      "vlan set portActFrame <port(0..6)> <frameType(0:all,1:tagged,2:untagged)>"},
+    {"leakyVlanEn",         doVlanSetLeakyVlanEn,       3,      "vlan set LeakyVlanEn <port(0..6)> <pktType(0:uc,1:mc,2:bc,3:ipmc)> <(1:En,0:Dis)>"},
+    {"portVlanAttr",        doVlanSetPortVlanAttr,      2,      "vlan set portVlanAttr <port(0..6)> <vlanAttr(0:user,1:stack,2:translation,3:transparent)>"},
+    {"igsPortETagAttr",     doVlanSetIgsPortETagAttr,   2,      "vlan set igsPortETagAttr <port(0..6)> <egsTagAttr(0:disable,1:consistent,4:untagged,5:swap,6:tagged,7:stack)>"},
+    {"portEgsTagAttr",      doVlanSetPortETagAttr,      2,      "vlan set portEgsTagAttr <port(0..6)> <egsTagAttr(0:untagged,1:swap,2:tagged,3:stack)>"},
+    {"portOuterTPID",       doVlanSetPortOuterTPID,     2,      "vlan set portOuterTPID <port(0..6)> <TPID(hex)>"},
+    {"pvid",                doVlanSetPvid,              2,      "vlan set pvid <port(0..6)> <vid(0..4095)>"},
+
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T vlanGetCmds[] =
+{
+    {"portActFrame",        doVlanGetPortActFrame,      1,      "vlan get portActFrame <port(0..6)>"},
+    {"leakyVlanEn",         doVlanGetLeakyVlanEn,       1,      "vlan get leakyVlanEn <port(0..6)>"},
+    {"portVlanAttr",        doVlanGetPortVlanAttr,      1,      "vlan get portVlanAttr <port(0..6)>"},
+    {"igsPortETagAttr",     doVlanGetIgsPortETagAttr,   1,      "vlan get igsPortETagAttr <port(0..6)>"},
+    {"portEgsTagAttr",      doVlanGetPortETagAttr,      1,      "vlan get portEgsTagAttr <port(0..6)>"},
+    {"portOuterTPID",       doVlanGetPortOuterTPID,     1,      "vlan get portOuterTPID <port(0..6)>"},
+    {"pvid",                doVlanGetPvid,              1,      "vlan get pvid <port(0..6)>"},
+
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T vlanCmds[] =
+{
+    {"initiate",        doVlanInitiate,         9,      "vlan initiate <vid(0..4095)> <fid(0..7)> <bitmap(6:0)> <ivl(1:En,0:Dis)> <portbasestag(1:En,0:Dis)> <stag(0..4095)> <egstagctlen(1:En,0:Dis)> <egstagcon(1:En,0:Dis)> <taggedbitmap(6:0)>"},
+    {"create",          doVlanCreate,           1,      "vlan create <vid(0..4095)>"},
+    {"destroy",         doVlanDestroy,          1,      "vlan destroy [ <vid(0..4095)> | <vidRange(vid0-vid1)> ]"},
+    {"destroyAll",      doVlanDestroyAll,       0,      "vlan destroyAll [ <restoreDefVlan(0:false,1:true)> | ]"},
+    {"dump",            doVlanDump,             0,      "vlan dump [ <vid(0..4095)> | <vidRange(vid0-vid1)> | ]"},
+    {"addPortMem",      doVlanAddPortMem,       2,      "vlan addPortMem <vid(0..4095)> <port(0..6)>"},
+    {"delPortMem",      doVlanDelPortMem,       2,      "vlan addPortMem <vid(0..4095)> <port(0..6)>"},
+    {"set",             doVlanSet,              0,      NULL},
+    {"get",             doVlanGet,              0,      NULL},
+
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T l2ClearCmds[] =
+{
+    {"mac",              doMacAddr,          CMD_NO_PARA,    "l2 clear mac"},
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T l2DelCmds[] =
+{
+    {"mac",             doMacAddr,           3,    "l2 del mac <mac(12'hex)> [ vid <vid(0..4095)> | fid <fid(0..15)> ]"},
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T l2AddCmds[] =
+{
+    {"mac",             doMacAddr,           7,    "l2 add mac <static(0:dynamic,1:static)> <unauth(0:auth,1:unauth)> <mac(12'hex)> <portlist(uintlist)> [ vid <vid(0..4095)> | fid <fid(0..15)> ] <src_mac_forward=(0:default,1:cpu-exclude,2:cpu-include,3:cpu-only,4:drop)>"},
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T l2SetCmds[] =
+{
+    {"macAddrAgeOut",   doMacAddrAgeOut,    1,    "l2 set macAddrAgeOut <time(1, 1000000)>"},
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T l2GetCmds[] =
+{
+    {"mac",             doGetMacAddr,       3,              "l2 get mac <mac(12'hex)> [ vid <vid(0..4095)> | fid <fid(0..15)> ]"},
+    {"macAddrAgeOut",   doMacAddrAgeOut,    CMD_NO_PARA,    "l2 get macAddrAgeOut"},
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T l2DumpCmds[] =
+{
+    {"mac",                doDumpMacAddr,        0,    "l2 dump mac"},
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T l2Cmds[] =
+{
+    {"add",         doL2Add,        0,        NULL},
+    {"del",         doL2Del,        0,        NULL},
+    {"clear",       doL2Clear,      0,        NULL},
+    {"get",         doL2Get,        0,        NULL},
+    {"set",         doL2Set,        0,        NULL},
+    {"dump",        doL2Dump,       0,        NULL},
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T lagGetCmds[] =
+{
+    {"member",      doLagMember,    1,              "lag get member group_id(0 or 1)"},
+    {"dstInfo",     doLagDstInfo,   CMD_NO_PARA,    "lag get dstInfo"},
+    {"ptseed",      doLagPtseed,    CMD_NO_PARA,    "lag get ptseed"},
+    {"hashtype",    doLagHashtype,  CMD_NO_PARA,    "lag get hashtype"},
+    {"state",       doLagState,     CMD_NO_PARA,    "lag get state"},
+    {"spsel",       doLagSpsel,     CMD_NO_PARA,    "lag get spsel"},
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T lagSetCmds[] =
+{
+    {"member",       doLagMember,        4,    "lag set member <group_id(0 or 1)> <member_index(0..3)> <enable(0,1)> <port index(0..6)>"},
+    {"dstInfo",      doLagDstInfo,       7,    "lag set dstInfo <sp(1:En,0:Dis)> <sa(1:En,0:Dis)> <da(1:En,0:Dis)> <sip(1:En,0:Dis)> <dip(1:En,0:Dis)> <sport(1:En,0:Dis)> <dport(1:En,0:Dis)>"},
+    {"ptseed",       doLagPtseed,        1,    "lag set ptseed <hex32>"},
+    {"hashtype",     doLagHashtype,      1,    "lag set hashtype <0-crc32lsb;1-crc32msb;2-crc16;3-xor4>"},
+    {"state",        doLagState,         1,    "lag set state <state(1:En,0:Dis)>"},
+    {"spsel",        doLagSpsel,         1,    "lag set spsel <soure port enable(1:En,0:Dis)>"},
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T lagCmds[] =
+{
+    {"get",          doLagGet,        0,        NULL},
+    {"set",          doLagSet,        0,        NULL},
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T stpGetCmds[] =
+{
+    {"portstate",    doStpPortstate,  2,    "stp get portstate <port(0..6)> <fid(0..15)>"},
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T stpSetCmds[] =
+{
+    {"portstate",    doStpPortstate,  3,    "stp set portstate <port(0..6)> <fid(0..15)> <state(0:disable,1:listen,2:learn,3:forward)>"},
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T stpCmds[] =
+{
+    {"get",         doStpGet,           0,      NULL},
+    {"set",         doStpSet,           0,      NULL},
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T mirrorSetCmds[] =
+{
+    {"session",        doMirrorSetSession,       6,      "mirror set session <sid(0,1)> <dst_port(UINT)> <state(1:En,0:Dis)> <tag(1:on, 0:off)> <list(UINTLIST)> <dir(0:none,1:tx,2:rx,3:both)>"},
+    {"session-enable", doMirrorSetSessionEnable, 2,      "mirror set session-enable <sid(0,1)> <state(1:En,0:Dis)>"},
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T mirrorAddCmds[] =
+{
+    {"session-rlist",  doMirrorAddRlist,       2,      "mirror add session-rlist <sid(0,1)> <list(UINTLIST)>"},
+    {"session-tlist",  doMirrorAddTlist,       2,      "mirror add session-tlist <sid(0,1)> <list(UINTLIST)>"},
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T mirrorGetCmds[] =
+{
+    {"session",        doMirrorGetSid,       1,      "mirror get session <sid(0,1)>"},
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T mirrorDelCmds[] =
+{
+    {"session",        doMirrorDelSid,       1,      "mirror del session <sid(0,1)>"},
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T mirrorCmds[] =
+{
+    {"set",         doMirrorSet,        0,      NULL},
+    {"add",         doMirrorAdd,        0,      NULL},
+    {"get",         doMirrorGet,        0,      NULL},
+    {"del",         doMirrorDel,        0,      NULL},
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T mibClearCmds[] =
+{
+    {"port",        doMibClearPort,     1,      "mib clear port <port(0..6)>"},
+    {"all",         doMibClearPort,     0,      "mib clear all"},
+    {"acl",         doMibClearAcl,      0,      "mib clear acl"},
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T mibGetCmds[] =
+{
+    {"port",        doMibGetPort,       1,      "mib get port <port(0..6)>"},
+    {"acl",         doMibGetAcl,        1,      "mib get acl <event(0..7)>"},
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T mibCmds[] =
+{
+    {"clear",       doMibClear,         0,      NULL},
+    {"get",         doMibGet,           0,      NULL},
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T qosGetCmds[] =
+{
+    {"scheduleAlgo",    doQosScheduleAlgo,      2,  "qos get scheduleAlgo <portlist(UINTLIST)> <queue(UINT)>"},
+    {"trustMode",       doQosTrustMode,         1,  "qos get trustMode <portlist(UINTLIST)>"},
+    {"pri2Queue",       doQosPri2Queue,         0,  "qos get pri2Queue"},
+    {"dscp2Pri",        doQosDscp2Pri,          1,  "qos get dscp2Pri <dscp(0..63)>"},
+    {"rateLimitEnable", doQosRateLimitEnable,   1,  "qos get rateLimitEnable <portlist(UINTLIST)>"},
+    {"rateLimit",       doQosRateLimit,         1,  "qos get rateLimit <portlist(UINTLIST)>"},
+    {"portPriority",    doQosPortPriority,      1,  "qos get portPriority <portlist(UINTLIST)>"},
+    {"rateLmtExMngFrm", doQosRateLimitExMngFrm, 0,  "qos get rateLmtExMngFrm"},
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T qosSetCmds[] =
+{
+    {"scheduleAlgo",    doQosScheduleAlgo,      4,  "qos set scheduleAlgo <portlist(UINTLIST)> <queue(UINT)> <scheduler(0:SP,1:WRR,2:WFQ)> <weight(0..128)>, weight 0 is valid only on sp mode"},
+    {"trustMode",       doQosTrustMode,         2,  "qos set trustMode <portlist(UINTLIST)> <mode(0:port,1:1p-port,2:dscp-port,3:dscp-1p-port>"},
+    {"pri2Queue",       doQosPri2Queue,         2,  "qos set pri2Queue <priority(0..7)> <queue(0..7)>"},
+    {"dscp2Pri",        doQosDscp2Pri,          2,  "qos set dscp2Pri <dscp(0..63)> <priority(0..7)>"},
+    {"rateLimitEnable", doQosRateLimitEnable,   3,  "qos set rateLimitEnable <portlist(UINTLIST)> <dir(0:egress,1:ingress)> <rate_en(1:En,0:Dis)>"},
+    {"rateLimit",       doQosRateLimit,         5,  "qos set rateLimit <portlist(UINTLIST)> <I_CIR(0..80000)> <I_CBS(0..127)> <E_CIR(0..80000)> <E_CBS(0..127)>"},
+    {"portPriority",    doQosPortPriority,      2,  "qos set portPriority <portlist(UINTLIST)> <priority(0..7)>"},
+    {"rateLmtExMngFrm", doQosRateLimitExMngFrm, 2,  "qos set rateLmtExMngFrm <dir(0:egress)> <en(0:include,1:exclude)>"},
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T qosCmds[] =
+{
+    {"get",          doQosGet,        0,        NULL},
+    {"set",          doQosSet,        0,        NULL},
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T diagSetCmds[] =
+{
+    {"txComply",    doDiagTxComply,     2,      "diag set txComply <phy(0..5)> <mode(0..8)>"},
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T diagGetCmds[] =
+{
+    {"txComply",    doDiagTxComply,     1,      "diag get txComply <phy(0..5)>"},
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T diagCmds[] =
+{
+    {"set",         doDiagSet,          0,      NULL},
+    {"get",         doDiagGet,          0,      NULL},
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T ledSetCmds[] =
+{
+    {"mode",        doLedMode,          1,      "led set mode <mode(0:disable, 1..3:2 LED, 4:user-define)>"},
+    {"state",       doLedState,         2,      "led set state <led(0..1)> <state(1:En,0:Dis)>"},
+    {"usr",         doLedUsrDef,        4,      "led set usr <led(0..1)> <polarity(0:low, 1:high)> <on_evt(7'bin)> <blink_evt(10'bin)>"},
+    {"time",        doLedBlkTime,       1,      "led set time <time(0..5:32ms~1024ms)>"},
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T ledGetCmds[] =
+{
+    {"mode",        doLedMode,          CMD_NO_PARA,      "led get mode"},
+    {"state",       doLedState,         1,                "led get state <led(0..1)>"},
+    {"usr",         doLedUsrDef,        1,                "led get usr <led(0..1)>"},
+    {"time",        doLedBlkTime,       CMD_NO_PARA,      "led get time"},
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T ledCmds[] =
+{
+    {"set",         doLedSet,           0,      NULL},
+    {"get",         doLedGet,           0,      NULL},
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T showCmds[] =
+{
+    {"version",     doShowVersion,        0,        NULL},
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T secGetCmds[] =
+{
+    {"stormEnable",     doStormEnable,   2,  "sec get stormEnable <port(0..6)> <type(0:bcst,1:mcst,2:ucst)>"},
+    {"stormRate",       doStormRate,     2,  "sec get stormRate <port(0..6)> <type(0:bcst,1:mcst,2:ucst)>"},
+    {"fldMode",         doFldMode,       2,  "sec get fldMode <port(0..6)> <type(0:bcst,1:mcst,2:ucst,3:qury>"},
+    {"saLearning",      doSaLearning,    1,  "sec get saLearning <port(0..6)>"},
+    {"saLimit",         doSaLimit,       1,  "sec get saLimit <port(0..6)>"},
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T secSetCmds[] =
+{
+    {"stormEnable",     doStormEnable,   3,  "sec set stormEnable <port(0..6)> <type(0:bcst,1:mcst,2:ucst)> <en(1:En,0:Dis)>"},
+    {"stormRate",       doStormRate,     4,  "sec set stormRate <port(0..6)> <type(0:bcst,1:mcst,2:ucst)> <count(0..255)> <unit(0:64k,1:256k,2:1M,3:4M,4:16M)>"},
+    {"fldMode",         doFldMode,       3,  "sec set fldMode <port(0..6)> <type(0:bcst,1:mcst,2:ucst,3:qury> <en(1:En,0:Dis)>"},
+    {"saLearning",      doSaLearning,    2,  "sec set saLearning <port(0..6)> <learn(0:disable,1:enable)>"},
+    {"saLimit",         doSaLimit,       3,  "sec set saLimit <port(0..6)> <mode(0:disable,1:enable)> <count(0..4095)>"},
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T secCmds[] =
+{
+    {"get",          doSecGet,        0,        NULL},
+    {"set",          doSecSet,        0,        NULL},
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T switchSetCmds[] =
+{
+    {"cpuPortEn",   doSwitchCpuPortEn,   1,              "switch set cpuPortEn <cpu_en(1:En,0:Dis)>"},
+    {"cpuPort",     doSwitchCpuPort,     1,              "switch set cpuPort <port_number>"},
+    {"phyLCIntrEn",     doSwitchPhyLCIntrEn,     2,      "switch set phyLCIntrEn <phy(0..6)> <(1:En,0:Dis)>"},
+    {"phyLCIntrSts",    doSwitchPhyLCIntrSts,    2,      "switch set phyLCIntrSts <phy(0..6)> <(1:Clear)>"},
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T switchGetCmds[] =
+{
+    {"cpuPortEn",   doSwitchCpuPortEn,   CMD_NO_PARA,      "switch get cpuPortEn"},
+    {"cpuPort",     doSwitchCpuPort,     CMD_NO_PARA,      "switch get cpuPort"},
+    {"phyLCIntrEn",     doSwitchPhyLCIntrEn,     1,        "switch get phyLCIntrEn <phy(0..6)>"},
+    {"phyLCIntrSts",    doSwitchPhyLCIntrSts,    1,        "switch get phyLCIntrSts <phy(0..6)>"},
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T switchCmds[] =
+{
+    {"set",         doSwitchSet,        0,      NULL},
+    {"get",         doSwitchGet,        0,      NULL},
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T aclSetCmds[] =
+{
+    {"en",              doAclEn,            1,                     "acl set en <en(1:En,0:Dis)>"},
+    {"rule",            doAclRule,          CMD_VARIABLE_PARA,     "acl set rule <idx(0..127)>\n <state(0:Dis,1:En)> <reverse(0:Dis,1:En)> <end(0:Dis,1:En)>\n <portmap(7'bin)><ipv6(0:Dis,1:En,2:Not care)>\n[ dmac <dmac(12'hex)> <dmac_mask(12'hex)> ]\n[ smac <smac(12'hex)> <smac_mask(12'hex)> ]\n[ stag <stag(4'hex)> <stag_mask(4'hex)> ]\n[ ctag <ctag(4'hex)> <ctag_mask(4'hex)> ]\n[ etype <etype(4'hex)> <etype_mask(4'hex)> ]\n[ dip <dip(IPADDR)> <dip_mask(IPADDR)> ]\n[ sip <sip(IPADDR)> <sip_mask(IPADDR)> ]\n[ dscp <dscp(2'hex)> <dscp_mask(2'hex)> ]\n[ protocol <protocol(12'hex)> <protocol_mask(12'hex)> ]\n[ dport <dport(4'hex)> <dport_mask(4'hex)> ]\n[ sport <sport(4'hex)> <sport_mask(4'hex)> ]\n[ flow_label <flow_label(4'hex)> <flow_label_mask(4'hex)> ]\n[ udf <udf(4'hex)> <udf_mask(4'hex)> ] "},
+    {"udfRule",         doAclUdfRule,       7,                     "acl set udfRule <idx(0..15)> <mode(0:pattern, 1:threshold)> [ <pat(4'hex)> <mask(4'hex)> | <low(4'hex)> <high(4'hex)> ] <start(0:MAC header, 1:L2 payload, 2:IPv4 header, 3:IPv6 header, 4:L3 payload, 5:TCP header, 6:UDP header, 7: L4 payload)> <offset(0..127,unit:2 bytes)> <portmap(7'bin)>"},
+    {"action",          doAclAction,        CMD_VARIABLE_PARA,     "acl set action <idx(0..127)> \n[ forward <forward(0:Default,4:Exclude CPU,5:Include CPU,6:CPU only,7:Drop)> ]\n[ egtag <egtag(0:Default,1:Consistent,4:Untag,5:Swap,6:Tag,7:Stack)> ]\n[ mirrormap <mirrormap(2'bin)> ]\n[ priority <priority(0..7)> ]\n[ redirect <redirect(0:Dst,1:Vlan)> <portmap(7'bin)> ]\n[ leaky_vlan <leaky_vlan(1:En,0:Dis)> ]\n[ cnt_idx <cnt_idx(0..63)> ]\n[ rate_idx <rate_idx(0..31)> ] \n[ attack_idx <attack_idx(0..95)> ] \n[ vid <vid(0..4095)> ] \n[ manage <manage(1:En,0:Dis)> ] \n[ bpdu <bpdu(1:En,0:Dis)> ]\n[ class <class(0:Original,1:Defined)>[0..7] ]\n[ drop_pcd <drop_pcd(0:Original,1:Defined)> [red <red(0..7)>][yellow <yellow(0..7)>][green <green(0..7)>] ]\n[ color <color(0:Defined,1:Trtcm)> [ <defined_color(0:Dis,1:Green,2:Yellow,3:Red)> | <trtcm_idx(0..31)> ] ]"},
+    {"trtcm",           doAclTrtcm,         5,                     "acl set trtcm <idx(1..31)> <cir(4'hex)> <pir(4'hex)> <cbs(4'hex)> <pbs(4'hex)>"},
+    {"trtcmEn",         doAclTrtcmEn,       1,                     "acl set trtcmEn <en(1:En,0:Dis)>"},
+    {"portEn",          doAclPortEn,        2,                     "acl set portEn <port(0..6)> <en(1:En,0:Dis)>"},
+    {"dropEn",          doAclDropEn,        2,                     "acl set dropEn <port(0..6)> <en(1:En,0:Dis)>"},
+    {"dropThrsh",       doAclDropThrsh,     5,                     "acl set dropThrsh <port(0..6)> <color(0:green,1:yellow,2:red)> <queue(0..7)> <high(0..2047)> <low(0..2047)>"},
+    {"dropPbb",         doAclDropPbb,       4,                     "acl set dropPbb <port(0..6)> <color(0:green,1:yellow,2:red)> <queue(0..7)> <probability(0..1023)>"},
+    {"meter",           doAclMeter,         3,                     "acl set meter <idx(0..31)> <en(1:En,0:Dis)> <rate(0..65535)>\n Note: Limit rate = rate * 64Kbps"},
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T aclGetCmds[] =
+{
+    {"en",              doAclEn,            CMD_NO_PARA,    "acl get en"},
+    {"rule",            doAclRule,          1,              "acl get rule <idx(0..127)> "},
+    {"udfRule",         doAclUdfRule,       1,              "acl get udfRule <idx(0..15)>"},
+    {"action",          doAclAction,        1,              "acl get action <idx(0..127)>"},
+    {"trtcm",           doAclTrtcm,         1,              "acl get trtcm <idx(1..31)>"},
+    {"trtcmEn",         doAclTrtcmEn,       CMD_NO_PARA,    "acl get trtcmEn"},
+    {"portEn",          doAclPortEn,        1,              "acl get portEn <port(0..6)>"},
+    {"dropEn",          doAclDropEn,        1,              "acl get dropEn <port(0..6)>"},
+    {"dropThrsh",       doAclDropThrsh,     3,              "acl get dropThrsh <port(0..6)> <color(0:green,1:yellow,2:red)> <queue(0..7)>"},
+    {"dropPbb",         doAclDropPbb,       3,              "acl get dropPbb <port(0..6)> <color(0:green,1:yellow,2:red)> <queue(0..7)>"},
+    {"meter",           doAclMeter,         1,              "acl get meter <idx(0..31)>"},
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T aclDelCmds[] =
+{
+    {"rule",        doAclRmvRule,          1,         "acl del rule <idx(0..127)>"},
+    {"udfRule",     doAclRmvUdfRule,       1,         "acl del udfRule <idx(0..15)>"},
+    {"action",      doAclRmvAction,        1,         "acl del action <idx(0..127)>"},
+    {"trtcm",       doAclRmvTrtcm,         1,         "acl del trtcm <idx(0..31)>"},
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T aclClearCmds[] =
+{
+    {"rule",        doAclRmvRule,          CMD_NO_PARA,       "acl clear rule"},
+    {"udfRule",     doAclRmvUdfRule,       CMD_NO_PARA,       "acl clear udfRule"},
+    {"action",      doAclRmvAction,        CMD_NO_PARA,       "acl clear action"},
+    {"trtcm",       doAclRmvTrtcm,         CMD_NO_PARA,       "acl clear trtcm"},
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T aclCmds[] =
+{
+    {"set",         doAclSet,           0,      NULL},
+    {"get",         doAclGet,           0,      NULL},
+    {"del",         doAclDel,           0,      NULL},
+    {"clear",       doAclClear,         0,      NULL},
+    {"dump",        doAclDump,          0,      NULL},
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+static AIR_CMD_T Cmds[] =
+{
+    {"reg",         doReg,          0,      NULL},
+    {"phy",         doPhy,          0,      NULL},
+    {"port",        doPort,         0,      NULL},
+    {"vlan",        doVlan,         0,      NULL},
+    {"l2",          doL2,           0,      NULL},
+    {"lag",         doLag,          0,      NULL},
+    {"stp",         doStp,          0,      NULL},
+    {"mirror",      doMirror,       0,      NULL},
+    {"mib",         doMib,          0,      NULL},
+    {"qos",         doQos,          0,      NULL},
+    {"diag",        doDiag,         0,      NULL},
+    {"led",         doLed,          0,      NULL},
+    {"switch",      doSwitch,       0,      NULL},
+    {"show",        doShow,         0,      NULL},
+    {"sec",         doSec,          0,      NULL},
+    {"acl",         doAcl,          0,      NULL},
+    {"sptag",       doSptag,        0,      NULL},
+
+    /* last entry, do not modify this entry */
+    {NULL, NULL, 0, NULL},
+};
+
+/* EXPORTED SUBPROGRAM BODIES
+*/
+
+/* LOCAL SUBPROGRAM BODIES
+*/
+static BOOL_T
+_strcmp(const char *s1, const char *s2)
+{
+    while(*s1 == *s2++)
+        if (*s1++ == '\0')
+            return (0);
+    return (*(const unsigned char *)s1 - *(const unsigned char *)(s2 -1));
+}
+
+static C8_T *
+_strtok_r(
+    C8_T *s,
+    const C8_T *delim,
+    C8_T **last)
+{
+    char *spanp;
+    int c = 0, sc = 0;
+    char *tok;
+
+    if (s == NULL && (s = *last) == NULL)
+    {
+        return (NULL);
+    }
+
+    /*
+     * Skip (span) leading delimiters (s += strspn(s, delim), sort of).
+     */
+    for (;;)
+    {
+        c = *s++;
+        spanp = (char *)delim;
+        do
+        {
+            if (c == (sc = *spanp++))
+            {
+                break;
+            }
+        } while (sc != 0);
+        if (sc == 0)
+        {
+            break;
+        }
+    }
+
+    if (c == 0)
+    {   /* no non-delimiter characters */
+        *last = NULL;
+        return (NULL);
+    }
+    tok = s - 1;
+
+    /*
+     * Scan token (scan for delimiters: s += strcspn(s, delim), sort of).
+     * Note that delim must have one NUL; we stop if we see that, too.
+     */
+    for (;;)
+    {
+        c = *s++;
+        spanp = (char *)delim;
+        do
+        {
+            if ((sc = *spanp++) == c)
+            {
+                if (c == 0)
+                {
+                    s = NULL;
+                }
+                else
+                {
+                    s[-1] = 0;
+                }
+                *last = s;
+                return (tok);
+            }
+        } while (sc != 0);
+    }
+    /* NOTREACHED */
+}
+
+static C8_T *
+_strtok(
+    C8_T *s,
+    const C8_T *delim,
+    C8_T **last)
+{
+    return _strtok_r(s, delim, last);
+}
+
+UI32_T
+_strtoul(
+    const C8_T *cp,
+    C8_T **endp,
+    UI32_T base)
+{
+    UI32_T result = 0, value = 0;
+
+    if (!base)
+    {
+        base = 10;
+        if (*cp == '0')
+        {
+            base = 8;
+            cp++;
+            if ((TOLOWER(*cp) == 'x') && isxdigit(cp[1]))
+            {
+                cp++;
+                base = 16;
+            }
+        }
+    }
+    else if (base == 16)
+    {
+        if (cp[0] == '0' && TOLOWER(cp[1]) == 'x')
+        {
+            cp += 2;
+        }
+    }
+    while (isxdigit(*cp) &&
+           (value = isdigit(*cp) ? *cp-'0' : TOLOWER(*cp)-'a'+10) < base)
+    {
+        result = result*base + value;
+        cp++;
+    }
+    if (endp)
+    {
+        *endp = (char *)cp;
+    }
+    return result;
+}
+
+static I32_T
+_strtol(
+    const C8_T *cp,
+    C8_T **endp,
+    UI32_T base)
+{
+    if(*cp=='-')
+    {
+        return -_strtoul(cp + 1, endp, base);
+    }
+    return _strtoul(cp, endp, base);
+}
+
+static AIR_ERROR_NO_T
+_str2mac(
+        C8_T *str,
+        C8_T *mac)
+{
+    UI32_T i = 0;
+    C8_T tmpstr[3];
+
+    /* check str */
+    AIR_CHECK_PTR(str);
+    AIR_PARAM_CHK(strlen(str) != AIR_MAC_LEN, AIR_E_BAD_PARAMETER);
+    AIR_CHECK_PTR(mac);
+
+    for(i=0; i<6; i++)
+    {
+        strncpy(tmpstr, str+(i*2), 2);
+        tmpstr[2] = '\0';
+        mac[i] = _strtoul(tmpstr, NULL, 16);
+    }
+
+    return AIR_E_OK;
+}
+
+static AIR_ERROR_NO_T
+_str2ipv4(
+    const C8_T *ptr_str,
+    UI32_T     *ptr_addr)
+{
+    UI32_T value = 0, idx = 0, shift = 0;
+
+    AIR_CHECK_PTR(ptr_str);
+    AIR_CHECK_PTR(ptr_addr);
+
+    /* e.g. 192.168.1.2, strlen = 11 */
+    for (idx = 0; idx < strlen(ptr_str); idx++)
+    {
+        if (('0' <= ptr_str[idx]) && ('9' >= ptr_str[idx]))
+        {
+            value = (value * 10) + (ptr_str[idx] - '0');
+        }
+        else if ('.' == ptr_str[idx])
+        {
+            CMD_CHECK_PARA(value, <, 256); /* Error: invalid value */
+            CMD_CHECK_PARA(shift, <, 4);   /* Error: mem-overwrite */
+            *ptr_addr |= value << (24 - shift * 8);
+            shift += 1;
+            value = 0;
+        }
+        else
+        {
+            return AIR_E_BAD_PARAMETER; /* Error: not a digit number or dot */
+        }
+    }
+    CMD_CHECK_PARA(value, <, 256); /* Error: invalid value */
+    CMD_CHECK_PARA(shift, ==, 3);  /* Error: not an ipv4 addr */
+    *ptr_addr |= value << (24 - shift * 8);
+
+    return AIR_E_OK;
+}
+
+AIR_ERROR_NO_T
+_str2ipv6(
+    const C8_T  *ptr_str,
+    UI8_T       *ptr_addr)
+{
+    UI32_T              hex_value = 0, dec_value = 0, idx = 0;
+    BOOL_T              double_colon = FALSE, ipv4_compatible = FALSE;
+    UI32_T              double_colon_pos = 0, last_pos = 0;
+    UI8_T               tmp_ipv6[16] = {0};
+
+    AIR_CHECK_PTR(ptr_str);
+    AIR_CHECK_PTR(ptr_addr);
+
+    /* e.g. invalid:
+     * 3ffe::c0a8:0:      last cannot be colon except double-colon
+     * 3ffe:::c0a8:0      triple-colon
+     * 3ffe::c0a8::0      two double-colons
+     */
+
+    /* e.g. valid:
+     * 3ffe::c0a8:0       strlen = 12 (double-colon in middle)
+     * 3ffe:c0a8:0::      strlen = 13 (double-colon in last)
+     * ::3ffe:c0a8:0      strlen = 13 (double-colon in first)
+     * 3ffe::192.168.0.0  strlen = 17 (IPv4-compatible address)
+     */
+    for (idx = 0; idx < strlen(ptr_str); idx++)
+    {
+        if (('0' <= ptr_str[idx]) && ('9' >= ptr_str[idx]))
+        {
+            hex_value = (hex_value << 4) + (ptr_str[idx] - '0');
+            dec_value = (dec_value * 10) + (ptr_str[idx] - '0');
+        }
+        else if (('a' <= ptr_str[idx]) && ('f' >= ptr_str[idx]))
+        {
+            hex_value = (hex_value << 4) + (ptr_str[idx] - 'a') + 10;
+        }
+        else if (('A' <= ptr_str[idx]) && ('F' >= ptr_str[idx]))
+        {
+            hex_value = (hex_value << 4) + (ptr_str[idx] - 'A') + 10;
+        }
+        else if (':' == ptr_str[idx])
+        {
+            /* must belong to double-colon, calculate from last */
+            if (0 == idx)
+            {
+                continue;
+            }
+            /* not the first ch but a double-colon */
+            else if (':' == ptr_str[idx - 1])
+            {
+                CMD_CHECK_PARA(double_colon, ==, FALSE); /* Error: triple-colon or two double-colons */
+                double_colon = TRUE;
+            }
+            /* not the first ch and a double-colon */
+            else
+            {
+                CMD_CHECK_PARA(double_colon_pos, <, 15); /* Error: only 16 units for UI8_T  */
+                CMD_CHECK_PARA(last_pos,         <, 15); /* Error: only 16 units for UI8_T  */
+                tmp_ipv6[last_pos]     = (UI8_T)((hex_value >> 8) & 0xff);
+                tmp_ipv6[last_pos + 1] = (UI8_T)((hex_value >> 0) & 0xff);
+                double_colon_pos += (FALSE == double_colon)? 2 : 0;
+                last_pos += 2;
+                hex_value = 0;
+                dec_value = 0;
+            }
+        }
+        else if ('.' == ptr_str[idx])
+        {
+            CMD_CHECK_PARA(last_pos, <, 16); /* Error: only 16 units for UI8_T  */
+            tmp_ipv6[last_pos] = dec_value;
+            last_pos += 1;
+            dec_value = 0;
+            ipv4_compatible = TRUE;
+        }
+        else
+        {
+            return AIR_E_BAD_PARAMETER; /* Error: not a hex number or colon */
+        }
+    }
+
+    /* last data */
+    if ((idx != 0) && (':' != ptr_str[idx - 1]))
+    {
+        if (FALSE == ipv4_compatible)
+        {
+            CMD_CHECK_PARA(last_pos, <, 15); /* Error: only 16 units for UI8_T  */
+            tmp_ipv6[last_pos]     = (UI8_T)((hex_value >> 8) & 0xff);
+            tmp_ipv6[last_pos + 1] = (UI8_T)((hex_value >> 0) & 0xff);
+            last_pos += 2;
+        }
+        else
+        {
+            CMD_CHECK_PARA(last_pos, <, 16); /* Error: only 16 units for UI8_T  */
+            tmp_ipv6[last_pos] = dec_value;
+            last_pos += 1;
+        }
+    }
+    else
+    {
+        if ((idx >= 2) && (':' != ptr_str[idx - 2]))
+        {
+            return AIR_E_BAD_PARAMETER; /* Error: last cannot be colon except double-colon */
+        }
+    }
+
+    /* move tmp_ipv6 to ptr_value */
+    if (TRUE == double_colon)
+    {
+        /* e.g.
+         * 3ffe::c0a8:0       double_colon_pos = 2, last_pos = 4+2, tmp_ipv6 = {3f,fe,c0,a8,00,00,...}
+         * 3ffe:c0a8:0::      double_colon_pos = 6, last_pos = 6,   tmp_ipv6 = {3f,fe,c0,a8,00,00,...}
+         * ::3ffe:c0a8:0      double_colon_pos = 0, last_pos = 4+2, tmp_ipv6 = {3f,fe,c0,a8,00,00,...}
+         * 3ffe::192.168.0.0  double_colon_pos = 2, last_pos = 5+1, tmp_ipv6 = {3f,fe,c0,a8,00,00,...}
+         *
+         *                                 0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
+         * 3ffe::c0a8:0       ptr_value = {3f,fe,--,--,--,--,--,--,--,--,--,--,--,--,--,--}
+         * 3ffe:c0a8:0::      ptr_value = {3f,fe,c0,a8,00,00,--,--,--,--,--,--,--,--,--,--}
+         * ::3ffe:c0a8:0      ptr_value = {--,--,--,--,--,--,--,--,--,--,--,--,--,--,--,--}
+         * 3ffe::192.168.0.0  ptr_value = {3f,fe,--,--,--,--,--,--,--,--,--,--,--,--,--,--}
+         */
+        for (idx = 0; idx < double_colon_pos; idx++)
+        {
+            ptr_addr[idx] = tmp_ipv6[idx];
+        }
+        /* e.g.
+         *                                 0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
+         * 3ffe::c0a8:0       ptr_value = {3f,fe,--,--,--,--,--,--,--,--,--,--,c0,a8,00,00}
+         * 3ffe:c0a8:0::      ptr_value = {3f,fe,c0,a8,00,00,--,--,--,--,--,--,--,--,--,--}
+         * ::3ffe:c0a8:0      ptr_value = {--,--,--,--,--,--,--,--,--,--,3f,fe,c0,a8,00,00}
+         * 3ffe::192.168.0.0  ptr_value = {3f,fe,--,--,--,--,--,--,--,--,--,--,c0,a8,00,00}
+         */
+        for (idx = double_colon_pos; idx < last_pos; idx++)
+        {
+            ptr_addr[16 - (last_pos - idx)] = tmp_ipv6[idx];
+        }
+    }
+    else
+    {
+        for (idx = 0; idx < 16; idx++)
+        {
+            ptr_addr[idx] = tmp_ipv6[idx];
+        }
+    }
+
+    return AIR_E_OK;
+}
+
+void
+_showIpv6Str(
+    const UI8_T *ptr_ipv6,
+    C8_T *ptr_str)
+{
+    UI32_T idx = 0, next = 0, last = 16;
+    UI32_T cont_zero = 0;
+
+    while (idx < last)
+    {
+        if ((0 == cont_zero) && (0 == ptr_ipv6[idx]) && (0 == ptr_ipv6[idx + 1]))
+        {
+            next = idx + 2;
+
+            while (next < last)
+            {
+                if ((ptr_ipv6[next]) || (ptr_ipv6[next + 1]))
+                {
+                    AIR_PRINT(
+                            ptr_str + strlen(ptr_str),
+                            40 - strlen(ptr_str),
+                            "%s", (cont_zero) ? (":") : (":0"));
+                    break;
+                }
+
+                if (0 == cont_zero)
+                {
+                    cont_zero = 1;
+                }
+                next += 2;
+            }
+
+            if (next == last)
+            {
+
+                AIR_PRINT(
+                        ptr_str + strlen(ptr_str),
+                        40 - strlen(ptr_str),
+                        "%s", (cont_zero) ? ("::") : (":0"));
+            }
+
+            idx = next;
+        }
+        else
+        {
+            if (idx)
+            {
+                AIR_PRINT(
+                    ptr_str + strlen(ptr_str),
+                    40 - strlen(ptr_str),
+                    ":");
+            }
+
+            if (ptr_ipv6[idx])
+            {
+                AIR_PRINT(
+                    ptr_str + strlen(ptr_str),
+                    40 - strlen(ptr_str),
+                    "%0x%02x", ptr_ipv6[idx], ptr_ipv6[idx + 1]);
+            }
+            else
+            {
+                AIR_PRINT(
+                    ptr_str + strlen(ptr_str),
+                    40 - strlen(ptr_str),
+                    "%0x", ptr_ipv6[idx + 1]);
+            }
+
+            idx += 2;
+        }
+    }
+}
+
+static AIR_ERROR_NO_T
+_hex2bit(
+        const UI32_T hex,
+        UI32_T *ptr_bit)
+{
+    UI32_T i = 0;
+
+    /* Mistake proofing */
+    AIR_CHECK_PTR(ptr_bit);
+
+    (*ptr_bit) = 0;
+    for(i=0; i<AIR_MAX_NUM_OF_PORTS; i++)
+    {
+        if(hex & BIT(i))
+        {
+            (*ptr_bit) |= BITS_OFF_L(1UL, 4*(AIR_MAX_NUM_OF_PORTS - i - 1), 4);
+        }
+    }
+    return AIR_E_OK;
+}
+
+static AIR_ERROR_NO_T
+_hex2bitstr(
+        const UI32_T hex,
+        C8_T *ptr_bit_str,
+        UI32_T str_len)
+{
+    UI32_T i = 0;
+    C8_T str_bitmap[AIR_MAX_NUM_OF_PORTS+1];
+
+    /* Mistake proofing */
+    AIR_CHECK_PTR(ptr_bit_str);
+    AIR_PARAM_CHK(str_len <= AIR_MAX_NUM_OF_PORTS, AIR_E_BAD_PARAMETER);
+
+    memset(str_bitmap, 0, AIR_MAX_NUM_OF_PORTS+1);
+
+    for(i=0; i<AIR_MAX_NUM_OF_PORTS; i++)
+    {
+        if(hex & BIT(i))
+        {
+            str_bitmap[i] = '1';
+        }
+        else
+        {
+            str_bitmap[i] = '-';
+        }
+    }
+    str_bitmap[i] = '\0';
+    strncpy(ptr_bit_str, str_bitmap, i+1);
+
+    return AIR_E_OK;
+}
+
+static AIR_ERROR_NO_T
+_portListStr2Ary(
+    const C8_T *str,
+    UI32_T *ary,
+    const UI32_T ary_num)
+{
+    UI32_T i = 0;
+    UI32_T str_len = 0;
+    UI32_T val = 0;
+    C8_T *str2;
+    C8_T *pch;
+    C8_T *last;
+
+    /* Mistake proofing */
+    AIR_CHECK_PTR(str);
+    AIR_CHECK_PTR(ary);
+    AIR_PARAM_CHK(0 == ary_num, AIR_E_BAD_PARAMETER);
+
+    /* Allocate new string */
+    str_len = strlen(str);
+    str2 = AIR_MALLOC(str_len+1);
+    AIR_CHECK_PTR(str2);
+    memset(str2, 0, str_len+1);
+    strncpy(str2, str, str_len+1);
+
+    /* clear array */
+    memset(ary, 0, ary_num*4);
+
+    /* split string by ',' */
+    pch = _strtok(str2, ",", &last);
+    while(NULL != pch)
+    {
+        val = _strtoul(pch, NULL, 0);
+        ary[val/32] |= BIT(val%32);
+        pch = _strtok(NULL, ",", &last);
+    }
+
+    AIR_FREE(str2);
+    return AIR_E_OK;
+}
+
+static AIR_ERROR_NO_T
+doRegRead(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    UI32_T reg = 0, val = 0;
+
+    reg = _strtoul(argv[0], NULL, 16);
+    aml_readReg(0, reg, &val);
+    AIR_PRINT("Read reg=0x%x, value=0x%x\n", reg, val);
+
+    return AIR_E_OK;
+}
+
+static AIR_ERROR_NO_T
+doRegWrite(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    UI32_T reg = 0, val = 0;
+
+    reg = _strtoul(argv[0], NULL, 16);
+    val = _strtoul(argv[1], NULL, 16);
+    aml_writeReg(0, reg, val);
+    AIR_PRINT("Write reg=0x%x, value=0x%x\n", reg, val);
+
+    return AIR_E_OK;
+}
+
+static AIR_ERROR_NO_T
+doReg(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(regCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doPhyCL22Read(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    UI32_T port = 0, reg = 0, val = 0;
+
+    port = _strtoul(argv[0], NULL, 0);
+    reg  = _strtoul(argv[1], NULL, 16);
+    aml_readPhyReg(0, port, reg, &val);
+    AIR_PRINT("Phy read port=%d, reg=0x%x, value=0x%x\n", port, reg, val);
+
+    return AIR_E_OK;
+}
+
+static AIR_ERROR_NO_T
+doPhyCL22Write(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    UI32_T port = 0, reg = 0, val = 0;
+
+    port = _strtoul(argv[0], NULL, 0);
+    reg  = _strtoul(argv[1], NULL, 16);
+    val  = _strtoul(argv[2], NULL, 16);
+    aml_writePhyReg(0, port, reg, val);
+    AIR_PRINT("Phy write port=%d, reg=0x%x, value=0x%x\n", port, reg, val);
+
+    return AIR_E_OK;
+}
+
+static AIR_ERROR_NO_T
+doPhyCL22(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(phyCL22Cmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doPhyCL45Read(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    UI32_T port = 0, dev = 0, reg = 0, val = 0;
+
+    port = _strtoul(argv[0], NULL, 0);
+    dev  = _strtoul(argv[1], NULL, 16);
+    reg  = _strtoul(argv[2], NULL, 16);
+    aml_readPhyRegCL45(0, port, dev, reg, &val);
+    AIR_PRINT("Phy read port=%d, dev=0x%x, reg=0x%x, value=0x%x\n", port, dev, reg, val);
+
+    return AIR_E_OK;
+}
+
+static AIR_ERROR_NO_T
+doPhyCL45Write(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    UI32_T port = 0, dev = 0, reg = 0, val = 0;
+
+    port = _strtoul(argv[0], NULL, 0);
+    dev  = _strtoul(argv[1], NULL, 16);
+    reg  = _strtoul(argv[2], NULL, 16);
+    val  = _strtoul(argv[3], NULL, 16);
+    aml_writePhyRegCL45(0, port, dev, reg, val);
+    AIR_PRINT("Phy write port=%d, dev=0x%x, reg=0x%x, value=0x%x\n", port, dev, reg, val);
+
+    return AIR_E_OK;
+}
+
+static AIR_ERROR_NO_T
+doPhyCL45(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(phyCL45Cmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doPhy(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(phyCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doPortSetMatrix(UI32_T argc, C8_T *argv[])
+{
+    UI32_T port = 0;
+    UI32_T matrix = 0;
+    AIR_ERROR_NO_T rc = AIR_E_OK;
+
+    port   = _strtoul(argv[0], NULL, 0);
+    matrix = _strtoul(argv[1], NULL, 16);
+    rc = air_port_setPortMatrix(0, port, matrix);
+    if (rc != AIR_E_OK)
+    {
+        AIR_PRINT("Error: Operation failed!\n");
+    }
+    return rc;
+}
+
+static AIR_ERROR_NO_T
+doPortSetVlanMode(UI32_T argc, C8_T *argv[])
+{
+    UI32_T port = 0;
+    AIR_PORT_VLAN_MODE_T vlan_mode;
+    AIR_ERROR_NO_T rc = AIR_E_OK;
+
+    port      = _strtoul(argv[0], NULL, 0);
+    vlan_mode = _strtoul(argv[1], NULL, 0);
+    rc = air_port_setVlanMode(0, port, vlan_mode);
+    if (rc != AIR_E_OK)
+    {
+        AIR_PRINT("Error: Operation failed!\n");
+    }
+    return rc;
+}
+
+static AIR_ERROR_NO_T
+doPortSet(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(portSetCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doPortGetMatrix(UI32_T argc, C8_T *argv[])
+{
+    UI32_T port = 0;
+    UI32_T matrix = 0;
+    AIR_ERROR_NO_T rc = AIR_E_OK;
+
+    port = _strtoul(argv[0], NULL, 0);
+    rc = air_port_getPortMatrix(0, port, &matrix);
+    if (rc != AIR_E_OK)
+    {
+        AIR_PRINT("Error: Operation failed!\n");
+        return rc;
+    }
+    AIR_PRINT("Port %d Matrix: %2x\n", port, matrix);
+    return rc;
+}
+
+static AIR_ERROR_NO_T
+doPortGetVlanMode(UI32_T argc, C8_T *argv[])
+{
+    UI32_T port = 0;
+    AIR_PORT_VLAN_MODE_T vlan_mode;
+    AIR_ERROR_NO_T rc = AIR_E_OK;
+
+    port = _strtoul(argv[0], NULL, 0);
+    rc = air_port_getVlanMode(0, port, &vlan_mode);
+    if (rc != AIR_E_OK)
+    {
+        AIR_PRINT("Error: Operation failed!\n");
+        return rc;
+    }
+    AIR_PRINT("Port %d Vlan Mode: ", port);
+    switch(vlan_mode)
+    {
+        case AIR_PORT_VLAN_MODE_PORT_MATRIX:
+            AIR_PRINT("matrix(%d)\n", vlan_mode);
+            break;
+        case AIR_PORT_VLAN_MODE_FALLBACK:
+            AIR_PRINT("fallback(%d)\n", vlan_mode);
+            break;
+        case AIR_PORT_VLAN_MODE_CHECK:
+            AIR_PRINT("check(%d)\n", vlan_mode);
+            break;
+        case AIR_PORT_VLAN_MODE_SECURITY:
+            AIR_PRINT("security(%d)\n", vlan_mode);
+            break;
+        default:
+            AIR_PRINT("unknown(%d)\n", vlan_mode);
+            break;
+    };
+    return rc;
+}
+
+static AIR_ERROR_NO_T
+doPortGet(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(portGetCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doPort(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(portCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doVlanInitiate(UI32_T argc, C8_T *argv[])
+{
+    UI16_T vid = 0;
+    AIR_VLAN_ENTRY_ATTR_T vlan_entry = {0};
+    AIR_ERROR_NO_T rc = AIR_E_OK;
+
+    vid = _strtoul(argv[0], NULL, 0);
+    if (9 == argc)
+    {
+        vlan_entry.vlan_entry_format.fid           = _strtoul(argv[1], NULL, 0);
+        vlan_entry.vlan_entry_format.port_mem      = _strtoul(argv[2], NULL, 0);
+        vlan_entry.vlan_entry_format.ivl           = _strtoul(argv[3], NULL, 0);
+        vlan_entry.vlan_entry_format.port_stag     = _strtoul(argv[4], NULL, 0);
+        vlan_entry.vlan_entry_format.stag          = _strtoul(argv[5], NULL, 0);
+        vlan_entry.vlan_entry_format.eg_ctrl_en    = _strtoul(argv[6], NULL, 0);
+        vlan_entry.vlan_entry_format.eg_con        = _strtoul(argv[7], NULL, 0);
+        vlan_entry.vlan_entry_format.eg_ctrl       = _strtoul(argv[8], NULL, 0);
+
+        rc = air_vlan_create(0, vid, &vlan_entry);
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        rc = AIR_E_BAD_PARAMETER;
+    }
+
+    switch (rc)
+    {
+        case     AIR_E_OK:                                                            break;
+        case     AIR_E_ENTRY_EXISTS:  AIR_PRINT("VLAN already exist!\n");             break;
+        default:                      AIR_PRINT("Error %d: Operation failed!\n", rc); break;
+    }
+    return rc;
+}
+
+static AIR_ERROR_NO_T
+doVlanCreate(UI32_T argc, C8_T *argv[])
+{
+    UI16_T vid = 0;
+    AIR_ERROR_NO_T rc = AIR_E_OK;
+
+    vid = _strtoul(argv[0], NULL, 0);
+    rc  = air_vlan_create(0, vid, NULL);
+
+    switch (rc)
+    {
+        case     AIR_E_OK:                                                            break;
+        case     AIR_E_ENTRY_EXISTS:  AIR_PRINT("VLAN already exist!\n");             break;
+        default:                      AIR_PRINT("Error %d: Operation failed!\n", rc); break;
+    }
+    return rc;
+}
+
+static AIR_ERROR_NO_T
+doVlanDestroy(UI32_T argc, C8_T *argv[])
+{
+    C8_T *token = NULL;
+    UI16_T vid = 0, vid_limit = AIR_VLAN_ID_MAX;
+    AIR_ERROR_NO_T rc = AIR_E_OK;
+
+    if (argc > 0)
+    {
+        if (isdigit(argv[0][0]))
+        {
+            token = _strtok(argv[0], "-", &argv[0]);
+            vid = _strtoul(token, NULL, 0);
+            if ((token = _strtok(argv[0], "-", &argv[0])))
+                vid_limit = _strtoul(token, NULL, 0);
+            else
+                vid_limit = vid;
+            if (AIR_VLAN_ID_MAX < vid_limit)
+            {
+                AIR_PRINT("vid number should less than %d!\n", AIR_VLAN_ID_MAX);
+                return AIR_E_BAD_PARAMETER;
+            }
+            if (vid > vid_limit)
+            {
+                AIR_PRINT("vid0 should less than vid1!\n");
+                return AIR_E_BAD_PARAMETER;
+            }
+        }
+        else
+        {
+            AIR_PRINT("Bad parameter!\n");
+            return AIR_E_BAD_PARAMETER;
+        }
+    }
+
+    for (; vid <= vid_limit; vid++)
+    {
+        rc = air_vlan_destroy(0, vid);
+    }
+    return rc;
+}
+
+static AIR_ERROR_NO_T
+doVlanDestroyAll(UI32_T argc, C8_T *argv[])
+{
+    UI32_T restore_def_vlan = 0;
+    AIR_ERROR_NO_T rc = AIR_E_OK;
+
+    if (argc > 0)
+    {
+        restore_def_vlan = _strtoul(argv[0], NULL, 0);
+    }
+
+    rc = air_vlan_destroyAll(0, restore_def_vlan);
+    if (rc != AIR_E_OK)
+    {
+        AIR_PRINT("Error: Operation failed!\n");
+    }
+    return rc;
+}
+
+static AIR_ERROR_NO_T
+doVlanDump(UI32_T argc, C8_T *argv[])
+{
+    C8_T *token = NULL;
+    UI16_T port = 0, valid_count = 0, vid = 0, vid_limit = AIR_VLAN_ID_MAX;
+    AIR_PORT_EGS_TAG_ATTR_T tag_ctl[AIR_MAX_NUM_OF_PORTS] = {0};
+    AIR_VLAN_ENTRY_T vlan_entry = {0};
+
+    if (argc > 0)
+    {
+        if (isdigit(argv[0][0]))
+        {
+            token = _strtok(argv[0], "-", &argv[0]);
+            vid = _strtoul(token, NULL, 0);
+            if ((token = _strtok(argv[0], "-", &argv[0])))
+                vid_limit = _strtoul(token, NULL, 0);
+            else
+                vid_limit = vid;
+            if (AIR_VLAN_ID_MAX < vid_limit)
+            {
+                AIR_PRINT("vid number should less than %d!\n", AIR_VLAN_ID_MAX);
+                return AIR_E_BAD_PARAMETER;
+            }
+            if (vid > vid_limit)
+            {
+                AIR_PRINT("vid0 should less than vid1!\n");
+                return AIR_E_BAD_PARAMETER;
+            }
+        }
+        else
+        {
+            AIR_PRINT("Bad parameter!\n");
+            return AIR_E_BAD_PARAMETER;
+        }
+    }
+
+    for (valid_count = 0; vid <= vid_limit; vid++)
+    {
+        _air_vlan_readEntry(0, vid, &vlan_entry);
+        if (vlan_entry.valid)
+        {
+            valid_count++;
+            if (1 == valid_count)
+                AIR_PRINT(" Vid Fid MemPort Ivl PortBaseStag Stag EgsTagCtlEn EgsTagCon EgsTagCtl\n======================================================================\n");
+            for (port = 0; port < AIR_MAX_NUM_OF_PORTS; port++)
+                tag_ctl[port] = (vlan_entry.vlan_entry_format.eg_ctrl >> (port * 2)) & 0x3;
+            AIR_PRINT("%4d %3d      %2x %3d %12d %4d %11d %9d   %1x%1x%1x%1x%1x%1x%1x\n",
+                vid, vlan_entry.vlan_entry_format.fid, vlan_entry.vlan_entry_format.port_mem, vlan_entry.vlan_entry_format.ivl,
+                vlan_entry.vlan_entry_format.port_stag, vlan_entry.vlan_entry_format.stag, vlan_entry.vlan_entry_format.eg_ctrl_en, vlan_entry.vlan_entry_format.eg_con,
+                tag_ctl[6], tag_ctl[5], tag_ctl[4], tag_ctl[3], tag_ctl[2], tag_ctl[1], tag_ctl[0]);
+        }
+    }
+
+    if (!valid_count)
+        AIR_PRINT("not found!\n");
+    else
+        AIR_PRINT("Found %d valid entries!\n", valid_count);
+
+    return AIR_E_OK;
+}
+
+static AIR_ERROR_NO_T
+doVlanAddPortMem(UI32_T argc, C8_T *argv[])
+{
+    UI16_T vid = 0, port = 0;
+    AIR_ERROR_NO_T rc = AIR_E_OK;
+
+    vid  = _strtoul(argv[0], NULL, 0);
+    port = _strtoul(argv[1], NULL, 0);
+    rc = air_vlan_addMemberPort(0, vid, port);
+    switch (rc)
+    {
+        case     AIR_E_OK:                                                               break;
+        case     AIR_E_ENTRY_NOT_FOUND:  AIR_PRINT("VLAN not found!\n");                 break;
+        default:                         AIR_PRINT("Error %d: Operation failed!\n", rc); break;
+    }
+    return rc;
+}
+
+static AIR_ERROR_NO_T
+doVlanDelPortMem(UI32_T argc, C8_T *argv[])
+{
+    UI16_T vid = 0, port = 0;
+    AIR_ERROR_NO_T rc = AIR_E_OK;
+
+    vid  = _strtoul(argv[0], NULL, 0);
+    port = _strtoul(argv[1], NULL, 0);
+    rc = air_vlan_delMemberPort(0, vid, port);
+    switch (rc)
+    {
+        case     AIR_E_OK:                                                               break;
+        case     AIR_E_ENTRY_NOT_FOUND:  AIR_PRINT("VLAN not found!\n");                 break;
+        default:                         AIR_PRINT("Error %d: Operation failed!\n", rc); break;
+    }
+    return rc;
+}
+
+static AIR_ERROR_NO_T
+doVlanSetFid(UI32_T argc, C8_T *argv[])
+{
+    UI16_T vid = 0;
+    UI8_T  fid = 0;
+    AIR_ERROR_NO_T rc = AIR_E_OK;
+
+    vid = _strtoul(argv[0], NULL, 0);
+    fid = _strtoul(argv[1], NULL, 0);
+    rc = air_vlan_setFid(0, vid, fid);
+    switch (rc)
+    {
+        case     AIR_E_OK:                                                               break;
+        case     AIR_E_ENTRY_NOT_FOUND:  AIR_PRINT("VLAN not found!\n");                 break;
+        default:                         AIR_PRINT("Error %d: Operation failed!\n", rc); break;
+    }
+    return rc;
+}
+
+static AIR_ERROR_NO_T
+doVlanSetMemPort(UI32_T argc, C8_T *argv[])
+{
+    UI16_T vid = 0, port_bitmap = 0;
+    AIR_ERROR_NO_T rc = AIR_E_OK;
+
+    vid         = _strtoul(argv[0], NULL, 0);
+    port_bitmap = _strtoul(argv[1], NULL, 16);
+    rc = air_vlan_setMemberPort(0, vid, port_bitmap);
+    switch (rc)
+    {
+        case     AIR_E_OK:                                                               break;
+        case     AIR_E_ENTRY_NOT_FOUND:  AIR_PRINT("VLAN not found!\n");                 break;
+        default:                         AIR_PRINT("Error %d: Operation failed!\n", rc); break;
+    }
+    return rc;
+}
+
+static AIR_ERROR_NO_T
+doVlanSetIVL(UI32_T argc, C8_T *argv[])
+{
+    UI16_T vid = 0;
+    BOOL_T enable = TRUE;
+    AIR_ERROR_NO_T rc = AIR_E_OK;
+
+    vid    = _strtoul(argv[0], NULL, 0);
+    enable = _strtoul(argv[1], NULL, 0);
+    rc = air_vlan_setIVL(0, vid, enable);
+    switch (rc)
+    {
+        case     AIR_E_OK:                                                               break;
+        case     AIR_E_ENTRY_NOT_FOUND:  AIR_PRINT("VLAN not found!\n");                 break;
+        default:                         AIR_PRINT("Error %d: Operation failed!\n", rc); break;
+    }
+    return rc;
+}
+
+static AIR_ERROR_NO_T
+doVlanSetPortBaseStag(UI32_T argc, C8_T *argv[])
+{
+    UI16_T vid = 0;
+    BOOL_T enable = TRUE;
+    AIR_ERROR_NO_T rc = AIR_E_OK;
+
+    vid    = _strtoul(argv[0], NULL, 0);
+    enable = _strtoul(argv[1], NULL, 0);
+    rc = air_vlan_setPortBasedStag(0, vid, enable);
+    switch (rc)
+    {
+        case     AIR_E_OK:                                                               break;
+        case     AIR_E_ENTRY_NOT_FOUND:  AIR_PRINT("VLAN not found!\n");                 break;
+        default:                         AIR_PRINT("Error %d: Operation failed!\n", rc); break;
+    }
+    return rc;
+}
+
+static AIR_ERROR_NO_T
+doVlanSetStag(UI32_T argc, C8_T *argv[])
+{
+    UI16_T vid = 0, stag = 0;
+    AIR_ERROR_NO_T rc = AIR_E_OK;
+
+    vid  = _strtoul(argv[0], NULL, 0);
+    stag = _strtoul(argv[1], NULL, 0);
+    rc = air_vlan_setServiceTag(0, vid, stag);
+    switch (rc)
+    {
+        case     AIR_E_OK:                                                               break;
+        case     AIR_E_ENTRY_NOT_FOUND:  AIR_PRINT("VLAN not found!\n");                 break;
+        default:                         AIR_PRINT("Error %d: Operation failed!\n", rc); break;
+    }
+    return rc;
+}
+
+static AIR_ERROR_NO_T
+doVlanSetEgsTagCtlEn(UI32_T argc, C8_T *argv[])
+{
+    UI16_T vid = 0;
+    BOOL_T enable = TRUE;
+    AIR_ERROR_NO_T rc = AIR_E_OK;
+
+    vid    = _strtoul(argv[0], NULL, 0);
+    enable = _strtoul(argv[1], NULL, 0);
+    rc = air_vlan_setEgsTagCtlEnable(0, vid, enable);
+    switch (rc)
+    {
+        case     AIR_E_OK:                                                               break;
+        case     AIR_E_ENTRY_NOT_FOUND:  AIR_PRINT("VLAN not found!\n");                 break;
+        default:                         AIR_PRINT("Error %d: Operation failed!\n", rc); break;
+    }
+    return rc;
+}
+
+static AIR_ERROR_NO_T
+doVlanSetEgsTagCtlCon(UI32_T argc, C8_T *argv[])
+{
+    UI16_T vid = 0;
+    BOOL_T enable = TRUE;
+    AIR_ERROR_NO_T rc = AIR_E_OK;
+
+    vid    = _strtoul(argv[0], NULL, 0);
+    enable = _strtoul(argv[1], NULL, 0);
+    rc = air_vlan_setEgsTagConsistent(0, vid, enable);
+    switch (rc)
+    {
+        case     AIR_E_OK:                                                               break;
+        case     AIR_E_ENTRY_NOT_FOUND:  AIR_PRINT("VLAN not found!\n");                 break;
+        default:                         AIR_PRINT("Error %d: Operation failed!\n", rc); break;
+    }
+    return rc;
+}
+
+static AIR_ERROR_NO_T
+doVlanSetEgsTagCtl(UI32_T argc, C8_T *argv[])
+{
+    UI16_T vid = 0, port = 0;
+    AIR_PORT_EGS_TAG_ATTR_T tag_ctl = AIR_PORT_EGS_TAG_ATTR_UNTAGGED;
+    AIR_ERROR_NO_T rc = AIR_E_OK;
+
+    vid     = _strtoul(argv[0], NULL, 0);
+    port    = _strtoul(argv[1], NULL, 0);
+    tag_ctl = _strtoul(argv[2], NULL, 0);
+    rc = air_vlan_setPortEgsTagCtl(0, vid, port, tag_ctl);
+    switch (rc)
+    {
+        case     AIR_E_OK:                                                               break;
+        case     AIR_E_ENTRY_NOT_FOUND:  AIR_PRINT("VLAN not found!\n");                 break;
+        default:                         AIR_PRINT("Error %d: Operation failed!\n", rc); break;
+    }
+    return rc;
+}
+
+static AIR_ERROR_NO_T
+doVlanSetPortActFrame(UI32_T argc, C8_T *argv[])
+{
+    UI16_T port = 0;
+    AIR_VLAN_ACCEPT_FRAME_TYPE_T type = AIR_VLAN_ACCEPT_FRAME_TYPE_ALL;
+    AIR_ERROR_NO_T rc = AIR_E_OK;
+
+    port = _strtoul(argv[0], NULL, 0);
+    type = _strtoul(argv[1], NULL, 0);
+    rc = air_vlan_setPortAcceptFrameType(0, port, type);
+    if (rc != AIR_E_OK)
+    {
+        AIR_PRINT("Error: Operation failed!\n");
+    }
+    return rc;
+}
+
+static AIR_ERROR_NO_T
+doVlanSetLeakyVlanEn(UI32_T argc, C8_T *argv[])
+{
+    UI16_T port = 0;
+    AIR_LEAKY_PKT_TYPE_T pkt_type = AIR_LEAKY_PKT_TYPE_UNICAST;
+    BOOL_T enable = TRUE;
+    AIR_ERROR_NO_T rc = AIR_E_OK;
+
+    port     = _strtoul(argv[0], NULL, 0);
+    pkt_type = _strtoul(argv[1], NULL, 0);
+    enable   = _strtoul(argv[2], NULL, 0);
+    rc = air_vlan_setPortLeakyVlanEnable(0, port, pkt_type, enable);
+    if (rc != AIR_E_OK)
+    {
+        AIR_PRINT("Error: Operation failed!\n");
+    }
+    return rc;
+}
+
+static AIR_ERROR_NO_T
+doVlanSetPortVlanAttr(UI32_T argc, C8_T *argv[])
+{
+    UI16_T port = 0;
+    AIR_VLAN_PORT_ATTR_T attr = AIR_VLAN_PORT_ATTR_USER_PORT;
+    AIR_ERROR_NO_T rc = AIR_E_OK;
+
+    port = _strtoul(argv[0], NULL, 0);
+    attr = _strtoul(argv[1], NULL, 0);
+    rc = air_vlan_setPortAttr(0, port, attr);
+    if (rc != AIR_E_OK)
+    {
+        AIR_PRINT("Error: Operation failed!\n");
+    }
+    return rc;
+}
+
+static AIR_ERROR_NO_T
+doVlanSetIgsPortETagAttr(UI32_T argc, C8_T *argv[])
+{
+    UI16_T port = 0;
+    AIR_IGR_PORT_EG_TAG_ATTR_T attr = AIR_IGR_PORT_EG_TAG_ATTR_DISABLE;
+    AIR_ERROR_NO_T rc = AIR_E_OK;
+
+    port = _strtoul(argv[0], NULL, 0);
+    attr = _strtoul(argv[1], NULL, 0);
+    rc = air_vlan_setIgrPortTagAttr(0, port, attr);
+    if (rc != AIR_E_OK)
+    {
+        AIR_PRINT("Error: Operation failed!\n");
+    }
+    return rc;
+}
+
+static AIR_ERROR_NO_T
+doVlanSetPortETagAttr(UI32_T argc, C8_T *argv[])
+{
+    UI16_T port = 0;
+    AIR_PORT_EGS_TAG_ATTR_T attr = AIR_PORT_EGS_TAG_ATTR_UNTAGGED;
+    AIR_ERROR_NO_T rc = AIR_E_OK;
+
+    port = _strtoul(argv[0], NULL, 0);
+    attr = _strtoul(argv[1], NULL, 0);
+    rc = air_vlan_setPortEgsTagAttr(0, port, attr);
+    if (rc != AIR_E_OK)
+    {
+        AIR_PRINT("Error: Operation failed!\n");
+    }
+    return rc;
+}
+
+static AIR_ERROR_NO_T
+doVlanSetPortOuterTPID(UI32_T argc, C8_T *argv[])
+{
+    UI16_T port = 0, tpid = 0;
+    AIR_ERROR_NO_T rc = AIR_E_OK;
+
+    port = _strtoul(argv[0], NULL, 0);
+    tpid = _strtoul(argv[1], NULL, 16);
+    rc = air_vlan_setPortOuterTPID(0, port, tpid);
+    if (rc != AIR_E_OK)
+    {
+        AIR_PRINT("Error: Operation failed!\n");
+    }
+    return rc;
+}
+
+static AIR_ERROR_NO_T
+doVlanSetPvid(UI32_T argc, C8_T *argv[])
+{
+    UI16_T port = 0, pvid = 0;
+    AIR_ERROR_NO_T rc = AIR_E_OK;
+
+    port = _strtoul(argv[0], NULL, 0);
+    pvid = _strtoul(argv[1], NULL, 0);
+    rc = air_vlan_setPortPVID(0, port, pvid);
+    if (rc != AIR_E_OK)
+    {
+        AIR_PRINT("Error: Operation failed!\n");
+    }
+    return rc;
+}
+
+static AIR_ERROR_NO_T
+doVlanSet(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(vlanSetCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doVlanGetPortActFrame(UI32_T argc, C8_T *argv[])
+{
+    UI32_T port = 0;
+    AIR_VLAN_ACCEPT_FRAME_TYPE_T type;
+    AIR_ERROR_NO_T rc = AIR_E_OK;
+
+    port = _strtoul(argv[0], NULL, 0);
+    rc = air_vlan_getPortAcceptFrameType(0, port, &type);
+    if (rc != AIR_E_OK)
+    {
+        AIR_PRINT("Error: Operation failed!\n");
+        return rc;
+    }
+    AIR_PRINT("Port %d Acceptable Frame Type: ", port);
+    switch(type)
+    {
+        case AIR_VLAN_ACCEPT_FRAME_TYPE_ALL:
+            AIR_PRINT("all(%d)\n", type);
+            break;
+        case AIR_VLAN_ACCEPT_FRAME_TYPE_TAG_ONLY:
+            AIR_PRINT("tagged-only(%d)\n", type);
+            break;
+        case AIR_VLAN_ACCEPT_FRAME_TYPE_UNTAG_ONLY:
+            AIR_PRINT("untagged-only(%d)\n", type);
+            break;
+        default:
+            AIR_PRINT("unknown(%d)\n", type);
+            break;
+    };
+    return rc;
+}
+
+static AIR_ERROR_NO_T
+doVlanGetLeakyVlanEn(UI32_T argc, C8_T *argv[])
+{
+    UI32_T port = 0;
+    BOOL_T uc = FALSE, mc = FALSE, bc = FALSE;
+    AIR_ERROR_NO_T rc = AIR_E_OK;
+
+    port = _strtoul(argv[0], NULL, 0);
+    rc += air_vlan_getPortLeakyVlanEnable(0, port, AIR_LEAKY_PKT_TYPE_UNICAST, &uc);
+    rc += air_vlan_getPortLeakyVlanEnable(0, port, AIR_LEAKY_PKT_TYPE_MULTICAST, &mc);
+    rc += air_vlan_getPortLeakyVlanEnable(0, port, AIR_LEAKY_PKT_TYPE_BROADCAST, &bc);
+    if (rc != AIR_E_OK)
+    {
+        AIR_PRINT("Error: Operation failed!\n");
+        return rc;
+    }
+
+    AIR_PRINT("Port %d Leaky Vlan Enable\n", port);
+    AIR_PRINT("Unicast     : %s\n", uc ? "TRUE" : "FALSE");
+    AIR_PRINT("Multicast   : %s\n", mc ? "TRUE" : "FALSE");
+    AIR_PRINT("Broadcast   : %s\n", bc ? "TRUE" : "FALSE");
+    return rc;
+}
+
+static AIR_ERROR_NO_T
+doVlanGetPortVlanAttr(UI32_T argc, C8_T *argv[])
+{
+    UI32_T port = 0;
+    AIR_VLAN_PORT_ATTR_T attr;
+    AIR_ERROR_NO_T rc = AIR_E_OK;
+
+    port = _strtoul(argv[0], NULL, 0);
+    rc = air_vlan_getPortAttr(0, port, &attr);
+    if (rc != AIR_E_OK)
+    {
+        AIR_PRINT("Error: Operation failed!\n");
+        return rc;
+    }
+    AIR_PRINT("Port %d Vlan Attr: ", port);
+    switch(attr)
+    {
+        case AIR_VLAN_PORT_ATTR_USER_PORT:
+            AIR_PRINT("user port(%d)\n", attr);
+            break;
+        case AIR_VLAN_PORT_ATTR_STACK_PORT:
+            AIR_PRINT("stack port(%d)\n", attr);
+            break;
+        case AIR_VLAN_PORT_ATTR_TRANSLATION_PORT:
+            AIR_PRINT("translation port(%d)\n", attr);
+            break;
+        case AIR_VLAN_PORT_ATTR_TRANSPARENT_PORT:
+            AIR_PRINT("transparent port(%d)\n", attr);
+            break;
+        default:
+            AIR_PRINT("unknown(%d)\n", attr);
+            break;
+    };
+    return rc;
+}
+
+static AIR_ERROR_NO_T
+doVlanGetIgsPortETagAttr(UI32_T argc, C8_T *argv[])
+{
+    UI32_T port = 0;
+    AIR_IGR_PORT_EG_TAG_ATTR_T attr;
+    AIR_ERROR_NO_T rc = AIR_E_OK;
+
+    port = _strtoul(argv[0], NULL, 0);
+    rc = air_vlan_getIgrPortTagAttr(0, port, &attr);
+    if (rc != AIR_E_OK)
+    {
+        AIR_PRINT("Error: Operation failed!\n");
+        return rc;
+    }
+    AIR_PRINT("Port %d Incomming Port Egress Tag Attr: ", port);
+    switch(attr)
+    {
+        case AIR_IGR_PORT_EG_TAG_ATTR_DISABLE:
+            AIR_PRINT("disable(%d)\n", attr);
+            break;
+        case AIR_IGR_PORT_EG_TAG_ATTR_CONSISTENT:
+            AIR_PRINT("consistent(%d)\n", attr);
+            break;
+        case AIR_IGR_PORT_EG_TAG_ATTR_UNTAGGED:
+            AIR_PRINT("untagged(%d)\n", attr);
+            break;
+        case AIR_IGR_PORT_EG_TAG_ATTR_SWAP:
+            AIR_PRINT("swap(%d)\n", attr);
+            break;
+        case AIR_IGR_PORT_EG_TAG_ATTR_TAGGED:
+            AIR_PRINT("tagged(%d)\n", attr);
+            break;
+        case AIR_IGR_PORT_EG_TAG_ATTR_STACK:
+            AIR_PRINT("stack(%d)\n", attr);
+            break;
+        default:
+            AIR_PRINT("unknown(%d)\n", attr);
+            break;
+    };
+    return rc;
+}
+
+static AIR_ERROR_NO_T
+doVlanGetPortETagAttr(UI32_T argc, C8_T *argv[])
+{
+    UI32_T port = 0;
+    AIR_PORT_EGS_TAG_ATTR_T attr;
+    AIR_ERROR_NO_T rc = AIR_E_OK;
+
+    port = _strtoul(argv[0], NULL, 0);
+    rc = air_vlan_getPortEgsTagAttr(0, port, &attr);
+    if (rc != AIR_E_OK)
+    {
+        AIR_PRINT("Error: Operation failed!\n");
+        return rc;
+    }
+    AIR_PRINT("Port %d Egress Tag Attr: ", port);
+    switch(attr)
+    {
+        case AIR_PORT_EGS_TAG_ATTR_UNTAGGED:
+            AIR_PRINT("untagged(%d)\n", attr);
+            break;
+        case AIR_PORT_EGS_TAG_ATTR_SWAP:
+            AIR_PRINT("swap(%d)\n", attr);
+            break;
+        case AIR_PORT_EGS_TAG_ATTR_TAGGED:
+            AIR_PRINT("tagged(%d)\n", attr);
+            break;
+        case AIR_PORT_EGS_TAG_ATTR_STACK:
+            AIR_PRINT("stack(%d)\n", attr);
+            break;
+        default:
+            AIR_PRINT("unknown(%d)\n", attr);
+            break;
+    };
+    return rc;
+}
+
+static AIR_ERROR_NO_T
+doVlanGetPortOuterTPID(UI32_T argc, C8_T *argv[])
+{
+    UI32_T port = 0;
+    UI16_T tpid = 0;
+    AIR_ERROR_NO_T rc = AIR_E_OK;
+
+    port = _strtoul(argv[0], NULL, 0);
+    rc = air_vlan_getPortOuterTPID(0, port, &tpid);
+    if (rc != AIR_E_OK)
+    {
+        AIR_PRINT("Error: Operation failed!\n");
+        return rc;
+    }
+    AIR_PRINT("Port %d Outer TPID: %4x\n", port, tpid);
+    return rc;
+}
+
+static AIR_ERROR_NO_T
+doVlanGetPvid(UI32_T argc, C8_T *argv[])
+{
+    UI32_T port = 0;
+    UI16_T pvid = 0;
+    AIR_ERROR_NO_T rc = AIR_E_OK;
+
+    port = _strtoul(argv[0], NULL, 0);
+    rc = air_vlan_getPortPVID(0, port, &pvid);
+    if (rc != AIR_E_OK)
+    {
+        AIR_PRINT("Error: Operation failed!\n");
+        return rc;
+    }
+    AIR_PRINT("Port %d PVID: %d\n", port, pvid);
+    return rc;
+}
+
+static AIR_ERROR_NO_T
+doVlanGet(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(vlanGetCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doVlan(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(vlanCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doJumbo(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    I32_T pkt_len = 0, frame_len = 0;
+
+    if(0 == argc)
+    {
+        /* get command */
+        ret = air_port_getJumbo(0, &pkt_len, &frame_len);
+        if(ret == AIR_E_OK)
+        {
+            AIR_PRINT("Get ");
+            switch(pkt_len)
+            {
+                case 0:
+                    AIR_PRINT("RX_1518 ");
+                    break;
+                case 1:
+                    AIR_PRINT("RX_1536 ");
+                    break;
+                case 2:
+                    AIR_PRINT("RX_1552 ");
+                    break;
+                case 3:
+                    AIR_PRINT("RX_JUMBO ");
+                    break;
+            }
+            AIR_PRINT("frames lengths %d KBytes\n", frame_len);
+        }
+        else
+        {
+            AIR_PRINT("Get Jumbo Fail.\n");
+        }
+    }
+    else
+    {
+        /* set command */
+        pkt_len = _strtol(argv[0], NULL, 10);
+        frame_len = _strtol(argv[1], NULL, 10);
+
+        ret = air_port_setJumbo(0, pkt_len, frame_len);
+        if(ret == AIR_E_OK)
+        {
+            AIR_PRINT("Set ");
+            switch(pkt_len)
+            {
+                case 0:
+                    AIR_PRINT("RX_1518 ");
+                    break;
+                case 1:
+                    AIR_PRINT("RX_1536 ");
+                    break;
+                case 2:
+                    AIR_PRINT("RX_1552 ");
+                    break;
+                case 3:
+                    AIR_PRINT("RX_JUMBO ");
+                    break;
+            }
+            AIR_PRINT("frames lengths %d KBytes\n", frame_len);
+        }
+        else
+            AIR_PRINT("Set Jumbo Fail.\n");
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doFlowCtrl(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    BOOL_T fc_en = 0, dir = 0;
+    I32_T port = 0;
+
+    port = _strtol(argv[0], NULL, 10);
+    dir = _strtol(argv[1], NULL, 10);
+
+    if(2 == argc)
+    {
+        /* get command */
+        ret = air_port_getFlowCtrl(0, port, dir, &fc_en);
+        if(ret == AIR_E_OK)
+            AIR_PRINT("Get Port%02d %s Flow Control %s\n", port, ((dir)?"RX":"TX"), ((fc_en)?"Enable":"Disable"));
+        else
+            AIR_PRINT("Get Flow Control Fail.\n");
+    }
+    else
+    {
+        /* set command */
+        fc_en = _strtol(argv[2], NULL, 10);
+
+        ret = air_port_setFlowCtrl(0, port, dir, fc_en);
+        if(ret == AIR_E_OK)
+            AIR_PRINT("Set Port%02d %s Flow Control %s\n", port, ((dir)?"RX":"TX"), ((fc_en)?"Enable":"Disable"));
+        else
+            AIR_PRINT("Set Flow Control Fail.\n");
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doL2Set(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(l2SetCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doL2Get(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(l2GetCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doL2Clear(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(l2ClearCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doL2Del(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(l2DelCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doL2Add(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(l2AddCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doL2(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(l2Cmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doAnMode(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T port = 0;
+    BOOL_T en = 0;
+
+    port = _strtol(argv[0], NULL, 10);
+
+    if(1 == argc)
+    {
+        /* port get anCap <port> */
+        ret = air_port_getAnMode(0, port, &en);
+        if(ret == AIR_E_OK)
+            AIR_PRINT("Get Port%02d Auto-Negotiation %s\n", port, ((en)?"Enabled":"Disabled"));
+        else
+            AIR_PRINT("Get Port%02d Auto-Negotiation Fail.\n", port);
+    }
+    else if(2 == argc)
+    {
+        /* "port set anMode <port> <en> */
+        en = _strtol(argv[1], NULL, 10);
+        ret = air_port_setAnMode(0, port, en);
+        if(ret == AIR_E_OK)
+            AIR_PRINT("Set Port%02d Auto-Negotiation Mode:%s\n", port, ((en)?"Enabled":"Disabled"));
+        else
+            AIR_PRINT("Set Port%02d Auto-Negotiation Fail.\n", port);
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doLocalAdv(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T port = 0;
+    AIR_AN_ADV_T adv;
+
+    memset(&adv, 0, sizeof(AIR_AN_ADV_T));
+    port = _strtol(argv[0], NULL, 10);
+
+    if(1 == argc)
+    {
+        /* port get localAdv <port> */
+        ret = air_port_getLocalAdvAbility(0, port, &adv);
+        AIR_PRINT("Get Port%02d Local Auto-Negotiation Advertisement: ", port);
+        if(AIR_E_OK != ret)
+        {
+            AIR_PRINT("Fail!\n");
+        }
+    }
+    else if(7 == argc)
+    {
+        /* port set localAdv <port> <10H> <10F> <100H> <100F> <1000F> <pause> */
+        adv.advCap10HDX = _strtol(argv[1], NULL, 0) & BIT(0);
+        adv.advCap10FDX = _strtol(argv[2], NULL, 0) & BIT(0);
+        adv.advCap100HDX = _strtol(argv[3], NULL, 0) & BIT(0);
+        adv.advCap100FDX = _strtol(argv[4], NULL, 0) & BIT(0);
+        adv.advCap1000FDX = _strtol(argv[5], NULL, 0) & BIT(0);
+        adv.advPause = _strtol(argv[6], NULL, 0) & BIT(0);
+        ret = air_port_setLocalAdvAbility(0, port, adv);
+        AIR_PRINT("Set Port%02d Local Auto-Negotiation Advertisement: ", port);
+        if(AIR_E_OK != ret)
+        {
+            AIR_PRINT("Fail!\n");
+        }
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    if(ret == AIR_E_OK)
+    {
+        AIR_PRINT("\n");
+        AIR_PRINT("\tAdvertise 10BASE-T Half Duplex: %s\n", (adv.advCap10HDX)?"Effective":"Not Effective" );
+        AIR_PRINT("\tAdvertise 10BASE-T Full Duplex: %s\n", (adv.advCap10FDX)?"Effective":"Not Effective" );
+        AIR_PRINT("\tAdvertise 100BASE-T Half Duplex: %s\n", (adv.advCap100HDX)?"Effective":"Not Effective" );
+        AIR_PRINT("\tAdvertise 100BASE-T Full Duplex: %s\n", (adv.advCap100FDX)?"Effective":"Not Effective" );
+        AIR_PRINT("\tAdvertise 1000BASE-T Full Duplex: %s\n", (adv.advCap1000FDX)?"Effective":"Not Effective" );
+        AIR_PRINT("\tAdvertise Asynchronous Pause: %s\n", (adv.advPause)?"Effective":"Not Effective" );
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doRemoteAdv(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T port = 0;
+    AIR_AN_ADV_T lp_adv;
+
+    memset(&lp_adv, 0, sizeof(AIR_AN_ADV_T));
+    port = _strtol(argv[0], NULL, 10);
+
+    if(1 == argc)
+    {
+        /* port get remoteAdv <port> */
+        ret = air_port_getRemoteAdvAbility(0, port, &lp_adv);
+        AIR_PRINT("Get Port%02d Remote Auto-Negotiation Advertisement: ", port);
+        if(AIR_E_OK != ret)
+        {
+            AIR_PRINT("Fail!\n");
+        }
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    if(ret == AIR_E_OK)
+    {
+        AIR_PRINT("\n");
+        AIR_PRINT("\tAdvertise 10BASE-T Half Duplex: %s\n", lp_adv.advCap10HDX?"Effective":"Not Effective" );
+        AIR_PRINT("\tAdvertise 10BASE-T Full Duplex: %s\n", lp_adv.advCap10FDX?"Effective":"Not Effective" );
+        AIR_PRINT("\tAdvertise 100BASE-T Half Duplex: %s\n", lp_adv.advCap100HDX?"Effective":"Not Effective" );
+        AIR_PRINT("\tAdvertise 100BASE-T Full Duplex: %s\n", lp_adv.advCap100FDX?"Effective":"Not Effective" );
+        AIR_PRINT("\tAdvertise 1000BASE-T Full Duplex: %s\n", (lp_adv.advCap1000FDX)?"Effective":"Not Effective" );
+        AIR_PRINT("\tAdvertise Asynchronous Pause: %s\n", (lp_adv.advPause)?"Effective":"Not Effective" );
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doPortSpeed(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T port = 0;
+    UI32_T speed = 0;
+
+    port = _strtol(argv[0], NULL, 10);
+
+    if(1 == argc)
+    {
+        /* port get speed <port> */
+        ret = air_port_getSpeed(0, port, &speed);
+        if(ret == AIR_E_OK)
+        {
+            AIR_PRINT("Get Port%02d Speed:", port);
+        }
+        else
+        {
+            AIR_PRINT("Get Port%02d Speed Fail!\n", port);
+        }
+    }
+    else if(2 == argc)
+    {
+        /* port set speed <port> <speed> */
+        speed = _strtol(argv[1], NULL, 10);
+        ret = air_port_setSpeed(0, port, speed);
+        if(ret == AIR_E_OK)
+        {
+            AIR_PRINT("Set Port%02d Speed:", port);
+        }
+        else
+        {
+            AIR_PRINT("Set Port%02d Speed Fail!\n", port);
+        }
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    if(ret == AIR_E_OK)
+    {
+        switch(speed)
+        {
+            case AIR_PORT_SPEED_10M:
+                AIR_PRINT(" 10 Mbps\n");
+                break;
+            case AIR_PORT_SPEED_100M:
+                AIR_PRINT(" 100 Mbps\n");
+                break;
+            case AIR_PORT_SPEED_1000M:
+                AIR_PRINT(" 1 Gbps\n");
+                break;
+            case AIR_PORT_SPEED_2500M:
+                AIR_PRINT(" 2.5 Gbps\n");
+                break;
+            default:
+                AIR_PRINT(" Reserved\n");
+                break;
+        }
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doPortDuplex(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T port = 0;
+    UI32_T duplex = 0;
+
+    port = _strtol(argv[0], NULL, 10);
+
+    if(1 == argc)
+    {
+        /* port get duplex <port> */
+        ret = air_port_getDuplex(0, port, &duplex);
+        if(ret == AIR_E_OK)
+        {
+            AIR_PRINT("Get Port%02d Duplex:%s\n", port, duplex?"Full":"Half");
+        }
+        else
+        {
+            AIR_PRINT("Get Port%02d Duplex Fail!\n", port);
+        }
+    }
+    else if(2 == argc)
+    {
+        /* port set duplex <port> <duplex> */
+        duplex = _strtol(argv[1], NULL, 10);
+        ret = air_port_setDuplex(0, port, duplex);
+        if(ret == AIR_E_OK)
+        {
+            AIR_PRINT("Set Port%02d Duplex:%s\n", port, duplex?"Full":"Half");
+        }
+        else
+        {
+            AIR_PRINT("Set Port%02d Duplex Fail!\n", port);
+        }
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doPortStatus(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T port = 0;
+    AIR_PORT_STATUS_T ps;
+
+    memset(&ps, 0, sizeof(AIR_PORT_STATUS_T));
+    port = _strtol(argv[0], NULL, 10);
+
+    if(1 == argc)
+    {
+        /* port get status <port> */
+        ret = air_port_getLink(0, port, &ps);
+        if(ret == AIR_E_OK)
+        {
+            AIR_PRINT("Get Port%02d Link-Status\n", port);
+            AIR_PRINT("\tLink: %s\n", ps.link?"Up":"Down");
+            AIR_PRINT("\tDuplex: %s\n", ps.duplex?"Full":"Half");
+            AIR_PRINT("\tSpeed: ");
+            switch(ps.speed)
+            {
+                case AIR_PORT_SPEED_10M:
+                    AIR_PRINT("10 Mbps\n");
+                    break;
+                case AIR_PORT_SPEED_100M:
+                    AIR_PRINT("100 Mbps\n");
+                    break;
+                case AIR_PORT_SPEED_1000M:
+                    AIR_PRINT("1 Gbps\n");
+                    break;
+                case AIR_PORT_SPEED_2500M:
+                    AIR_PRINT("2.5 Gbps\n");
+                    break;
+                default:
+                    AIR_PRINT("Reserved\n");
+                    break;
+            }
+        }
+        else
+            AIR_PRINT("Get Port%02d Link-Status Fail!", port);
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doPortBckPres(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T port = 0;
+    UI32_T bckPres = 0;
+
+    port = _strtol(argv[0], NULL, 10);
+
+    if(1 == argc)
+    {
+        /* port get bckPres <port> */
+        ret = air_port_getBckPres(0, port, &bckPres);
+        if(ret == AIR_E_OK)
+            AIR_PRINT("Get Port%02d BckPres:%s\n", port, bckPres?"Enabled":"Disabled");
+        else
+            AIR_PRINT("Get Port%02d BckPres Fail!\n", port);
+    }
+    else if(2 == argc)
+    {
+        /* port set bckPres <port> <bckPres> */
+        bckPres = _strtol(argv[1], NULL, 10);
+        ret = air_port_setBckPres(0, port, bckPres);
+        if(ret == AIR_E_OK)
+            AIR_PRINT("Set Port%02d BckPres:%s\n", port, bckPres?"Enabled":"Disabled");
+        else
+            AIR_PRINT("Set Port%02d BckPres Fail!\n", port);
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doPortPsMode(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T port = 0;
+    UI32_T mode = 0;
+    BOOL_T ls_en = 0;
+    BOOL_T eee_en = 0;
+
+    port = _strtol(argv[0], NULL, 10);
+
+    if(1 == argc)
+    {
+        /* port get psMode <port> */
+        ret = air_port_getPsMode(0, port, &mode);
+        AIR_PRINT("Get Port%02d Power-Saving: ", port);
+        if(ret == AIR_E_OK)
+        {
+            AIR_PRINT("Done\n");
+        }
+        else
+        {
+            AIR_PRINT("Fail!\n");
+        }
+    }
+    else if(3 == argc)
+    {
+        /* port set psMode <port> <ls> <eee> */
+        ls_en = _strtol(argv[1], NULL, 0);
+        eee_en = _strtol(argv[2], NULL, 0);
+        if(TRUE == ls_en)
+        {
+            mode |= AIR_PORT_PS_LINKSTATUS;
+        }
+        if(TRUE == eee_en)
+        {
+            mode |= AIR_PORT_PS_EEE;
+        }
+        ret = air_port_setPsMode(0, port, mode);
+        AIR_PRINT("Set Port%02d Power-Saving: ", port);
+        if(ret == AIR_E_OK)
+        {
+            AIR_PRINT("Done\n");
+        }
+        else
+        {
+            AIR_PRINT("Fail!\n");
+        }
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+    if(ret == AIR_E_OK)
+    {
+        AIR_PRINT("\tLink status:%s\n", (mode & AIR_PORT_PS_LINKSTATUS)?"Enable":"Disable");
+        AIR_PRINT("\tEEE:%s\n", (mode & AIR_PORT_PS_EEE)?"Enable":"Disable");
+    }
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doPortSmtSpdDwn(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T port = 0;
+    UI32_T state = 0;
+    UI32_T retry = 0;
+
+    port = _strtol(argv[0], NULL, 10);
+
+    if(1 == argc)
+    {
+        /* port get smtSpdDwn <port> */
+        ret = air_port_getSmtSpdDwn(0, port, &state, &retry);
+        if(ret == AIR_E_OK)
+        {
+            AIR_PRINT("Get Port%02d Smart Speed Down: %s\n", port, state?"Enabled":"Disabled");
+            AIR_PRINT("Get Port%02d Retry Time: %d\n", port, retry + 2);
+        }
+        else
+            AIR_PRINT("Get Port%02d Smart-SpeedDown Fail!\n", port);
+    }
+    else if(3 == argc)
+    {
+        /* port set smtSpdDwn <port> <en> <retry> */
+        state = _strtol(argv[1], NULL, 10);
+        retry = _strtol(argv[2], NULL, 10);
+        if(retry >= 2)
+        {
+            ret = air_port_setSmtSpdDwn(0, port, state, retry - 2);
+            if(ret == AIR_E_OK)
+            {
+                AIR_PRINT("Set Port%02d Smart Speed Down: %s\n", port, state?"Enabled":"Disabled");
+                AIR_PRINT("Set Port%02d Retry Time: %d\n", port, retry);
+            }
+            else
+                AIR_PRINT("Set Port%02d Smart-SpeedDown Fail!\n", port);
+        }
+        else
+        {
+            ret = AIR_E_BAD_PARAMETER;
+        }
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doPortSpTag(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T port = 0;
+    BOOL_T sptag_en = FALSE;
+
+    port = _strtol(argv[0], NULL, 10);
+
+    if(1 == argc)
+    {
+        /* port get spTag <port> */
+        ret = air_port_getSpTag(0, port, &sptag_en);
+        if(AIR_E_OK == ret)
+        {
+            AIR_PRINT("Get Port%02d Special Tag %s\n", port, ((sptag_en)?"Enabled":"Disabled"));
+        }
+        else
+        {
+            AIR_PRINT("Get Port%02d Special Tag Fail.\n", port);
+        }
+    }
+    else if(2 == argc)
+    {
+        /* port set spTag <port> <en> */
+        sptag_en = _strtol(argv[1], NULL, 10);
+        ret = air_port_setSpTag(0, port, sptag_en);
+        if(AIR_E_OK == ret)
+        {
+            AIR_PRINT("Set Port%02d Special Tag:%s\n", port, ((sptag_en)?"Enabled":"Disabled"));
+        }
+        else
+        {
+            AIR_PRINT("Set Port%02d Special Tag Fail.\n", port);
+        }
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doPortEnable(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T port = 0;
+    UI32_T state = 0;
+
+    port = _strtol(argv[0], NULL, 10);
+
+    if(1 == argc)
+    {
+        /* port get enable <port> */
+        ret = air_port_getEnable(0, port, &state);
+        if(ret == AIR_E_OK)
+            AIR_PRINT("Get Port%02d State:%s\n", port, state?"Enable":"Disable");
+        else
+            AIR_PRINT("Get Port%02d State Fail!\n", port);
+    }
+    else if(2 == argc)
+    {
+        /* port set enable <port> <en> */
+        state = _strtol(argv[1], NULL, 10);
+        ret = air_port_setEnable(0, port, state);
+        if(ret == AIR_E_OK)
+            AIR_PRINT("Set Port%02d State:%s\n", port, state?"Enable":"Disable");
+        else
+            AIR_PRINT("Set Port%02d State Fail!\n", port);
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doPort5GBaseRMode(
+    UI32_T argc,
+    C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+
+    if(0 == argc)
+    {
+        /* port set 5GBaseRMode */
+        ret = air_port_set5GBaseRModeEn(0);
+        if(ret == AIR_E_OK)
+            AIR_PRINT("Set Port05 Mode: 5GBase-R\n");
+        else
+            AIR_PRINT("Set Port05 HSGMII Mode Fail.\n");
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doPortHsgmiiMode(
+    UI32_T argc,
+    C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+
+    if(0 == argc)
+    {
+        /* port set hsgmiiMode */
+        ret = air_port_setHsgmiiModeEn(0);
+        if(ret == AIR_E_OK)
+            AIR_PRINT("Set Port05 Mode: HSGMII\n");
+        else
+            AIR_PRINT("Set Port05 HSGMII Mode Fail.\n");
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doPortSgmiiMode(
+    UI32_T argc,
+    C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T mode = 0;
+    UI32_T speed = 0;
+
+    if(2 == argc)
+    {
+        /* port set sgmiiMode <mode(0:AN,1:Force)> <speed> */
+        mode = _strtol(argv[0], NULL, 10);
+        speed = _strtol(argv[1], NULL, 10);
+        ret = air_port_setSgmiiMode(0, mode, speed);
+        if(ret == AIR_E_OK)
+            AIR_PRINT("Set Port05 SGMII Mode:%s\nIf in Force Mode, speed:", mode?"Force":"AN");
+        else
+            AIR_PRINT("Set Port05 SGMII Mode Fail.\n");
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    if(ret == AIR_E_OK)
+    {
+        switch(speed)
+        {
+            case AIR_PORT_SPEED_10M:
+                AIR_PRINT(" 10 Mbps\n");
+                break;
+            case AIR_PORT_SPEED_100M:
+                AIR_PRINT(" 100 Mbps\n");
+                break;
+            case AIR_PORT_SPEED_1000M:
+                AIR_PRINT(" 1 Gbps\n");
+                break;
+            default:
+                AIR_PRINT(" Reserved\n");
+                break;
+        }
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doPortRmiiMode(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T speed = 0;
+
+    if(1 == argc)
+    {
+        /* port set rmiiMode <speed> */
+        speed = _strtol(argv[0], NULL, 10);
+        ret = air_port_setRmiiMode(0, speed);
+        if(ret == AIR_E_OK)
+        {
+            AIR_PRINT("Set Port05 RMII Mode Speed:");
+        }
+        else
+        {
+            AIR_PRINT("Set Port05 RMII Mode Fail!\n");
+        }
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    if(ret == AIR_E_OK)
+    {
+        switch(speed)
+        {
+            case AIR_PORT_SPEED_10M:
+                AIR_PRINT(" 10 Mbps\n");
+                break;
+            case AIR_PORT_SPEED_100M:
+                AIR_PRINT(" 100 Mbps\n");
+                break;
+            default:
+                AIR_PRINT(" Reserved\n");
+                break;
+        }
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doPortRgmiiMode(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T speed = 0;
+
+    if(1 == argc)
+    {
+        /* port set rgmiiMode <speed> */
+        speed = _strtol(argv[0], NULL, 10);
+        ret = air_port_setRgmiiMode(0, speed);
+        if(ret == AIR_E_OK)
+        {
+            AIR_PRINT("Set Port05 RGMII Mode Speed:");
+        }
+        else
+        {
+            AIR_PRINT("Set Port05 RGMII Mode Fail!\n");
+        }
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    if(ret == AIR_E_OK)
+    {
+        switch(speed)
+        {
+            case AIR_PORT_SPEED_10M:
+                AIR_PRINT(" 10 Mbps\n");
+                break;
+            case AIR_PORT_SPEED_100M:
+                AIR_PRINT(" 100 Mbps\n");
+                break;
+            case AIR_PORT_SPEED_1000M:
+                AIR_PRINT(" 1 Gbps\n");
+                break;
+            default:
+                AIR_PRINT(" Reserved\n");
+                break;
+        }
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doSptagEn(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T port = 0;
+    BOOL_T sp_en = FALSE;
+
+    port =  _strtol(argv[0], NULL, 10);
+    if (2 == argc)
+    {
+        sp_en =  _strtol(argv[1], NULL, 10);
+        ret = air_sptag_setState(0,port,sp_en);
+        if(AIR_E_OK == ret)
+        {
+            AIR_PRINT("set port %d SpTag state %s sucess\n", port,sp_en?"Enable":"Disable");
+        }
+        else
+        {
+            AIR_PRINT("set port %d SpTag state %s fail\n", port,sp_en?"Enable":"Disable");
+        }
+    }
+    else if(1 == argc)
+    {
+        air_sptag_getState(0,port,&sp_en);
+        AIR_PRINT("get port %d SpTag state: %s \n", port,sp_en?"Enable":"Disable");
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doSptagMode(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T port = 0;
+    BOOL_T sp_mode = FALSE;
+
+
+    port =  _strtol(argv[0], NULL, 10);
+    if (2 == argc)
+    {
+        sp_mode  =  _strtol(argv[1], NULL, 10);
+        ret = air_sptag_setMode(0,port,sp_mode);
+        if(AIR_E_OK == ret)
+        {
+            AIR_PRINT("set port %d SpTag Mode  %s sucess\n", port,sp_mode?"replace":"insert");
+        }
+        else
+        {
+            AIR_PRINT("set port %d SpTag state %s fail\n", port,sp_mode?"replace":"insert");
+        }
+    }
+    else if(1 == argc)
+    {
+        air_sptag_getMode(0,port,&sp_mode);
+        AIR_PRINT("get port %d SpTag state: %s \n", port,sp_mode?"replace":"insert");
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doSptagDecode(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    AIR_SPTAG_RX_PARA_T sptag_rx = {0};
+    UI8_T buf[AIR_STAG_BUF_LEN] = {0};
+    UI32_T len = AIR_STAG_BUF_LEN, i = 0;
+
+    if (4 == argc)
+    {
+        for(i = 0; i < len; i++)
+        {
+            buf[i] = _strtoul(argv[i], NULL, 16);
+        }
+
+        ret = air_sptag_decodeRx(0, buf, len, &sptag_rx);
+        if (AIR_E_OK != ret)
+        {
+            AIR_PRINT("SpTag decode fail\n");
+            return ret;
+        }
+
+        AIR_PRINT("SpTag decode success:\n");
+        AIR_PRINT("RSN : %s\n", _sptag_pt[sptag_rx.rsn]);
+        AIR_PRINT("VPM : %s\n", _sptag_vpm[sptag_rx.vpm]);
+        AIR_PRINT("SPN : %d\n", sptag_rx.spn);
+        AIR_PRINT("PRI : %d\n", sptag_rx.pri);
+        AIR_PRINT("CFI : %d\n", sptag_rx.cfi);
+        AIR_PRINT("VID : %d\n", sptag_rx.vid);
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doSptagEncode(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    AIR_STAG_TX_PARA_T sptag_tx = {0};
+    C8_T *token = NULL;
+    UI8_T buf[AIR_STAG_BUF_LEN] = {0};
+    UI32_T len = AIR_STAG_BUF_LEN;
+    char str[128] = {'\0'};
+    UI32_T data = 0;
+    AIR_STAG_MODE_T mode = AIR_STAG_MODE_LAST;
+
+    if (7 == argc)
+    {
+        if(_strcmp(argv[0],"mode=replace") == 0)
+            mode = AIR_STAG_MODE_REPLACE;
+        else if(_strcmp(argv[0],"mode=insert") == 0)
+            mode = AIR_STAG_MODE_INSERT;
+        else
+            printf("mode is wrong!!");
+
+        if(_strcmp(argv[1],"opc=portmap") == 0)
+            sptag_tx.opc = AIR_STAG_OPC_PORTMAP;
+        else if(_strcmp(argv[1],"opc=portid") == 0)
+            sptag_tx.opc = AIR_STAG_OPC_PORTID;
+        else if(_strcmp(argv[1],"opc=lookup") == 0)
+            sptag_tx.opc = AIR_STAG_OPC_LOOKUP;
+        else
+            printf("opc is wrong!!");
+
+        token = _strtok(argv[2], "=", &argv[2]);
+        if(_strcmp(token,"dp") != 0) {
+            AIR_PRINT("Bad parameter\r\n");
+        } else {
+            if ((token = _strtok(argv[2], "=", &argv[2]))) {
+                data = _strtoul(token, NULL, 16);
+                sptag_tx.pbm = data;
+                AIR_PRINT("sptag_tx.pbm %x\n",sptag_tx.pbm);
+            }
+        }
+
+        if(_strcmp(argv[3],"vpm=untagged") == 0)
+            sptag_tx.vpm = AIR_STAG_VPM_UNTAG;
+        else if(_strcmp(argv[3],"vpm=8100") == 0)
+            sptag_tx.vpm = AIR_STAG_VPM_TPID_8100;
+        else if(_strcmp(argv[3],"vpm=88a8") == 0)
+            sptag_tx.vpm = AIR_STAG_VPM_TPID_88A8;
+        else
+            printf("vpm is wrong!!");
+
+        token = _strtok(argv[4], "=", &argv[4]);
+        if(_strcmp(token, "pri") != 0) {
+            AIR_PRINT("Bad parameter\r\n");
+        } else {
+            if ((token = _strtok(argv[4], "=", &argv[4]))) {
+                data = _strtoul(token, NULL, 0);
+                sptag_tx.pri = data;
+                AIR_PRINT("sptag_tx.pri %d\n",sptag_tx.pri);
+            }
+        }
+
+        token = _strtok(argv[5], "=", &argv[5]);
+        if(_strcmp(token, "cfi") != 0) {
+            AIR_PRINT("Bad parameter\r\n");
+        } else {
+            if ((token = _strtok(argv[5], "=", &argv[5]))) {
+                data = _strtoul(token, NULL, 0);
+                sptag_tx.cfi  = data;
+                AIR_PRINT("sptag_tx.cfi %d\n",sptag_tx.cfi);
+            }
+        }
+
+        token = _strtok(argv[6], "=", &argv[6]);
+        if(_strcmp(token, "vid") != 0) {
+            AIR_PRINT("Bad parameter\r\n");
+        } else {
+            if ((token = _strtok(argv[6], "=", &argv[6]))) {
+                data = _strtoul(token, NULL, 0);
+                sptag_tx.vid = data;
+                AIR_PRINT("sptag_tx.vid %d\n",sptag_tx.vid);
+            }
+        }
+
+        ret = air_sptag_encodeTx(0,mode, &sptag_tx, (UI8_T *)&buf, &len);
+        if(AIR_E_OK == ret)
+        {
+            AIR_PRINT("SpTag encode sucess, returned len=%d\n", len);
+            AIR_PRINT("Encoded SpTag: %02x %02x %02x %02x\n", buf[0], buf[1], buf[2], buf[3]);
+        }
+        else
+        {
+            AIR_PRINT("SpTag encode fail\n");
+        }
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doSptag(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(sptagCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doL2Dump(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(l2DumpCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doMacAddr(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    AIR_MAC_ENTRY_T mt;
+    UI32_T fwd = 0;
+
+    memset(&mt, 0, sizeof(AIR_MAC_ENTRY_T));
+
+    if(0 == argc)
+    {
+        /* l2 clear mac */
+        ret = air_l2_clearMacAddr(0);
+        if(ret == AIR_E_OK)
+            AIR_PRINT("Clear MAC Address Table Done.\n");
+        else
+            AIR_PRINT("Clear MAC Address Table Fail.\n");
+    }
+    else if(3 == argc)
+    {
+        /* l2 del mac <mac(12'hex)> { vid <vid(0..4095)> | fid <fid(0..15)> } */
+        ret = _str2mac(argv[0], (C8_T *)mt.mac);
+        if(ret != AIR_E_OK)
+        {
+            AIR_PRINT("Unrecognized command.\n");
+            return ret;
+        }
+
+        /* check argument 1 */
+        if(FALSE == _strcmp(argv[1], "vid"))
+        {
+            /* get mac entry by MAC address & vid */
+            mt.cvid = _strtoul(argv[2], NULL, 0);
+            mt.flags |= AIR_L2_MAC_ENTRY_FLAGS_IVL;
+            AIR_PRINT("Get MAC Address:" MAC_STR " with vid:%u", MAC2STR(mt.mac), mt.cvid);
+        }
+        else if(FALSE == _strcmp(argv[1], "fid"))
+        {
+            /* get mac entry by MAC address & fid */
+            mt.fid = _strtoul(argv[2], NULL, 0);
+            AIR_PRINT("Get MAC Address:" MAC_STR " with fid:%u", MAC2STR(mt.mac), mt.fid);
+        }
+        else
+        {
+            AIR_PRINT("Unrecognized command.\n");
+            return AIR_E_BAD_PARAMETER;
+        }
+        ret = air_l2_delMacAddr(0, &mt);
+        if(ret == AIR_E_OK)
+        {
+            AIR_PRINT(" Done.\n");
+        }
+        else
+            AIR_PRINT("\n Fail!\n");
+    }
+    else if(7 == argc)
+    {
+        /* l2 add mac <static(0:dynamic,1:static)> <unauth(0:auth,1:unauth)> <mac(12'hex)> <portlist(uintlist)> [ vid <vid(0..4095)> | fid <fid(0..15)> ] <src_mac_forward=(0:default,1:cpu-include,2:cpu-exclude,3:cpu-only,4:drop)> */
+        if(argv[0])
+            mt.flags |= AIR_L2_MAC_ENTRY_FLAGS_STATIC;
+
+        if(argv[1])
+            mt.flags |= AIR_L2_MAC_ENTRY_FLAGS_UNAUTH;
+
+        ret = _str2mac(argv[2], (C8_T *)mt.mac);
+        if(ret != AIR_E_OK)
+        {
+            AIR_PRINT("Unrecognized command.\n");
+            return ret;
+        }
+
+        ret = _portListStr2Ary(argv[3], mt.port_bitmap, 1);
+        if(ret != AIR_E_OK)
+        {
+            AIR_PRINT("Unrecognized command.\n");
+            return ret;
+        }
+
+        /* check argument fid or vid */
+        if(FALSE == _strcmp(argv[4], "vid"))
+        {
+            /* get mac entry by MAC address & vid */
+            mt.cvid = _strtoul(argv[5], NULL, 0);
+            mt.flags |= AIR_L2_MAC_ENTRY_FLAGS_IVL;
+        }
+        else if(FALSE == _strcmp(argv[4], "fid"))
+        {
+            /* get mac entry by MAC address & fid */
+            mt.fid = _strtoul(argv[5], NULL, 0);
+        }
+        else
+        {
+            AIR_PRINT("Unrecognized command.\n");
+            return AIR_E_BAD_PARAMETER;
+        }
+        fwd = _strtoul(argv[6], NULL, 0);
+        if(0 == fwd)
+            mt.sa_fwd = AIR_L2_FWD_CTRL_DEFAULT;
+        else if(1 == fwd)
+            mt.sa_fwd = AIR_L2_FWD_CTRL_CPU_INCLUDE;
+        else if(2 == fwd)
+            mt.sa_fwd = AIR_L2_FWD_CTRL_CPU_EXCLUDE;
+        else if(3 == fwd)
+            mt.sa_fwd = AIR_L2_FWD_CTRL_CPU_ONLY;
+        else if(4 == fwd)
+            mt.sa_fwd = AIR_L2_FWD_CTRL_DROP;
+        else
+        {
+            AIR_PRINT("Unrecognized command.\n");
+            return AIR_E_BAD_PARAMETER;
+        }
+        ret = air_l2_addMacAddr(0, &mt);
+        AIR_PRINT("Add MAC Address:" MAC_STR, MAC2STR(mt.mac));
+        if(ret == AIR_E_OK)
+            AIR_PRINT(" Done.\n");
+        else
+            AIR_PRINT(" Fail.\n");
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+_printMacEntry(
+        AIR_MAC_ENTRY_T *mt,
+        UI32_T age_unit,
+        UI8_T count,
+        UI8_T title)
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    I32_T i = 0, j = 0;
+    UI8_T first = 0;
+    UI8_T find = 0;
+    if(title)
+    {
+        AIR_PRINT("%-6s%-15s%-5s%-5s%-5s%-10s%-10s%-6s\n",
+                "unit",
+                "mac",
+                "ivl",
+                "vid",
+                "fid",
+                "age-time",
+                "forward",
+                "port");
+        return ret;
+    }
+    for(i = 0; i < count; i++)
+    {
+        AIR_PRINT("%-6d", age_unit);
+        AIR_PRINT(MAC_STR, MAC2STR(mt[i].mac));
+        AIR_PRINT("...");
+        if(mt[i].flags & AIR_L2_MAC_ENTRY_FLAGS_IVL)
+        {
+            AIR_PRINT("%-3s..", "ivl");
+            AIR_PRINT("%-5d", mt[i].cvid);
+            AIR_PRINT("%-5s", ".....");
+        }
+        else
+        {
+            AIR_PRINT("%-3s..", "svl");
+            AIR_PRINT("%-5s", ".....");
+            AIR_PRINT("%-5d", mt[i].fid);
+        }
+        if(mt[i].flags & AIR_L2_MAC_ENTRY_FLAGS_STATIC)
+        {
+            AIR_PRINT("%-10s.", "static");
+        }
+        else
+        {
+            AIR_PRINT("%d sec..", mt[i].timer);
+        }
+        AIR_PRINT("%-10s", _air_mac_address_forward_control_string[mt[i].sa_fwd]);
+        first = 0;
+        find = 0;
+        for (j = (AIR_MAX_NUM_OF_PORTS - 1); j >= 0; j--)
+        {
+            if((mt[i].port_bitmap[0]) & (1 << j))
+            {
+                first = j;
+                find = 1;
+                break;
+            }
+        }
+        if(find)
+        {
+            for (j = 0; j < AIR_MAX_NUM_OF_PORTS; j++)
+            {
+                if((mt[i].port_bitmap[0]) & (1 << j))
+                {
+                    if(j == first)
+                        AIR_PRINT("%-2d", j);
+                    else
+                        AIR_PRINT("%-2d,", j);
+                }
+            }
+        }
+        else
+            AIR_PRINT("no dst port");
+        AIR_PRINT("\n");
+    }
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doGetMacAddr(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI8_T count = 0;
+    AIR_MAC_ENTRY_T * ptr_mt;
+
+    if(3 == argc)
+    {
+        ptr_mt = AIR_MALLOC(sizeof(AIR_MAC_ENTRY_T));
+        if (NULL == ptr_mt)
+        {
+            AIR_PRINT("***Error***, allocate memory fail\n");
+            return AIR_E_OTHERS;
+        }
+        memset(ptr_mt, 0, sizeof(AIR_MAC_ENTRY_T));
+        /* l2 get mac <mac(12'hex)> { vid <vid(0..4095)> | fid <fid(0..15)> } */
+        ret = _str2mac(argv[0], (C8_T *)ptr_mt->mac);
+        if(ret != AIR_E_OK)
+        {
+            AIR_PRINT("Unrecognized command.\n");
+            AIR_FREE(ptr_mt);
+            return ret;
+        }
+
+        /* check argument 1 */
+        if(FALSE == _strcmp(argv[1], "vid"))
+        {
+            /* get mac entry by MAC address & vid */
+            ptr_mt->cvid = _strtoul(argv[2], NULL, 0);
+            ptr_mt->flags |= AIR_L2_MAC_ENTRY_FLAGS_IVL;
+            AIR_PRINT("Get MAC Address:" MAC_STR " with vid:%u", MAC2STR(ptr_mt->mac), ptr_mt->cvid);
+        }
+        else if(FALSE == _strcmp(argv[1], "fid"))
+        {
+            /* get mac entry by MAC address & fid */
+            ptr_mt->fid = _strtoul(argv[2], NULL, 0);
+            AIR_PRINT("Get MAC Address:" MAC_STR " with fid:%u", MAC2STR(ptr_mt->mac), ptr_mt->fid);
+        }
+        else
+        {
+            AIR_PRINT("Unrecognized command.\n");
+            AIR_FREE(ptr_mt);
+            return AIR_E_BAD_PARAMETER;
+        }
+        ret = air_l2_getMacAddr(0, &count, ptr_mt);
+        if(ret == AIR_E_OK)
+        {
+            AIR_PRINT(" Done.\n");
+            _printMacEntry(ptr_mt, 0, 1, TRUE);
+            _printMacEntry(ptr_mt, 0, 1, FALSE);
+        }
+        else
+            AIR_PRINT("\n Not found!\n");
+        AIR_FREE(ptr_mt);
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doMacAddrAgeOut(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T time = 0;
+    if(0 == argc)
+    {
+        /* l2 get macAddrAgeOut */
+        ret = air_l2_getMacAddrAgeOut(0, &time);
+        if(ret == AIR_E_OK)
+        {
+            AIR_PRINT("Get MAC Address Age Out Time Done.\n");
+        }
+        else
+        {
+            AIR_PRINT("Get MAC Address Age Out Time Fail.\n");
+        }
+    }
+    else if(1 == argc)
+    {
+        /* l2 set macAddrAgeOut <time(1, 1000000)> */
+        time = _strtoul(argv[0], NULL, 0);
+        if(time < 1 || time > 1000000)
+        {
+            AIR_PRINT("Unrecognized command.\n");
+            return AIR_E_BAD_PARAMETER;
+        }
+        ret = air_l2_setMacAddrAgeOut(0, time);
+        if(ret == AIR_E_OK)
+        {
+            AIR_PRINT("Set MAC Address Age Out Time Done.\n");
+        }
+        else
+        {
+            AIR_PRINT("Set MAC Address Age Out Time Fail.\n");
+        }
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    if(ret == AIR_E_OK)
+    {
+        AIR_PRINT("MAC Address Age Out Time: %u seconds.\n", time);
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doDumpMacAddr(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    AIR_MAC_ENTRY_T *ptr_mt;
+    UI8_T count = 0;
+    UI32_T bucket_size = 0;
+    UI32_T total_count = 0;
+
+    if(0 != argc)
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        return AIR_E_BAD_PARAMETER;
+    }
+    /* get unit of aging time */
+    ret = air_l2_getMacBucketSize(0, &bucket_size);
+    if(ret != AIR_E_OK)
+    {
+        AIR_PRINT("Get MAC Age Time Fail!\n");
+        return ret;
+    }
+    ptr_mt = AIR_MALLOC(sizeof(AIR_MAC_ENTRY_T) * bucket_size);
+    if (NULL == ptr_mt)
+    {
+        AIR_PRINT("***Error***, allocate memory fail\n");
+        return AIR_E_OTHERS;
+    }
+    memset(ptr_mt, 0, sizeof(AIR_MAC_ENTRY_T) * bucket_size);
+    _printMacEntry(ptr_mt, 0, count, TRUE);
+    /* get 1st entry of MAC table */
+    ret = air_l2_getMacAddr(0, &count, ptr_mt);
+    switch(ret)
+    {
+        case AIR_E_ENTRY_NOT_FOUND:
+            AIR_FREE(ptr_mt);
+            AIR_PRINT("Not Found!\n");
+            return ret;
+        case AIR_E_TIMEOUT:
+            AIR_FREE(ptr_mt);
+            AIR_PRINT("Time Out!\n");
+            return ret;
+        case AIR_E_BAD_PARAMETER:
+            AIR_FREE(ptr_mt);
+            AIR_PRINT("Bad Parameter!\n");
+            return ret;
+        default:
+            break;
+    }
+    total_count += count;
+    _printMacEntry(ptr_mt, 0, count, FALSE);
+
+    /* get other entries of MAC table */
+    while(1)
+    {
+        memset(ptr_mt, 0, sizeof(AIR_MAC_ENTRY_T) * bucket_size);
+        ret = air_l2_getNextMacAddr(0, &count, ptr_mt);
+        if(AIR_E_OK != ret)
+        {
+            break;
+        }
+        total_count += count;
+        _printMacEntry(ptr_mt, 0, count, FALSE);
+    }
+    switch(ret)
+    {
+        case AIR_E_TIMEOUT:
+            AIR_PRINT("Time Out!\n");
+            break;
+        case AIR_E_BAD_PARAMETER:
+            AIR_PRINT("Bad Parameter!\n");
+            break;
+        default:
+            AIR_PRINT("Found %u %s\n", total_count, (total_count>1)?"entries":"entry");
+            break;
+    }
+    AIR_FREE(ptr_mt);
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doLagMember(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T portrunk_index = 0, member_index = 0, member_enable = 0, port_index = 0, i = 0;
+    AIR_LAG_PTGINFO_T  member;
+    memset(&member,0,sizeof(AIR_LAG_PTGINFO_T));
+
+    if(4 == argc)
+    {
+        /* lag set member <port trunk index> <member index> <member enable> <port_index>*/
+        portrunk_index  = _strtol(argv[0], NULL, 10);
+        member_index    = _strtol(argv[1], NULL, 10);
+        member_enable   = _strtol(argv[2], NULL, 10);
+        port_index      = _strtol(argv[3], NULL, 10);
+        ret = air_lag_setMember(0, portrunk_index, member_index, member_enable,port_index);
+        if(ret == AIR_E_OK)
+        {
+            AIR_PRINT("Set port trunk index %d member_index:%d member_enable:%d, port_index:%d ok.\n", portrunk_index, member_index, member_enable,port_index);
+        }
+        else
+        {
+            AIR_PRINT("Set port trunk index %d member_index:%d member_enable:%d, port_index:%d fail.\n", portrunk_index, member_index, member_enable,port_index);
+        }
+        memset(&member,0,sizeof(member));
+        air_lag_getMember(0, portrunk_index, &member);
+        if(! member.csr_gp_enable[0])
+        {
+            AIR_PRINT("\r\n!!!!!!!!!Port trunk index %d member_index:0 must be set,or else have taffic issues.\n", portrunk_index);
+        }
+    }
+    else if(1 == argc)
+    {
+        portrunk_index = _strtol(argv[0], NULL, 10);
+
+        /* lag get member <port> */
+        memset(&member,0,sizeof(member));
+        ret = air_lag_getMember(0, portrunk_index, &member);
+        if(ret == AIR_E_OK)
+        {
+            AIR_PRINT("Get port trunk %u member:\n", portrunk_index);
+            for(i = 0; i < AIR_LAG_MAX_MEM_NUM; i++)
+            {
+                if(member.csr_gp_enable[i])
+                    AIR_PRINT("port %d \r\n", member.csr_gp_port[i]);
+            }
+            AIR_PRINT("\r\n");
+        }
+        else
+        {
+            AIR_PRINT("Get port trunk:%u Member Fail.\n", portrunk_index);
+        }
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    return ret;
+}
+
+
+static AIR_ERROR_NO_T
+doLagDstInfo(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    AIR_LAG_DISTINFO_T dstInfo;
+
+    memset(&dstInfo, 0, sizeof(AIR_LAG_DISTINFO_T));
+    if(7 == argc)
+    {
+        /* lag set dstInfo <sp> <sa> <da> <sip> <dip> <sport> <dport> */
+        dstInfo.sp = _strtol(argv[0], NULL, 10) & BIT(0);
+        dstInfo.sa = _strtol(argv[1], NULL, 10) & BIT(0);
+        dstInfo.da = _strtol(argv[2], NULL, 10) & BIT(0);
+        dstInfo.sip = _strtol(argv[3], NULL, 10) & BIT(0);
+        dstInfo.dip = _strtol(argv[4], NULL, 10) & BIT(0);
+        dstInfo.sport = _strtol(argv[5], NULL, 10) & BIT(0);
+        dstInfo.dport = _strtol(argv[6], NULL, 10) & BIT(0);
+        ret = air_lag_setDstInfo(0, dstInfo);
+        if(ret == AIR_E_OK)
+        {
+            AIR_PRINT("Set LAG packet distrubution.\n");
+        }
+        else
+        {
+            AIR_PRINT("Set LAG packet distrubution Fail.\n");
+        }
+    }
+    else if(0 == argc)
+    {
+        /* lag get dstInfo */
+        ret = air_lag_getDstInfo(0, &dstInfo);
+        if(ret == AIR_E_OK)
+        {
+            AIR_PRINT("Get LAG packet distrubution:\n");
+        }
+        else
+        {
+            AIR_PRINT("Get LAG packet distrubution Fail.\n");
+        }
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+    if(ret == AIR_E_OK)
+    {
+        AIR_PRINT("%-5s|%-5s|%-5s|%-5s|%-5s|%-5s|%-5s\n",
+                "SP", "SA", "DA", "SIP", "DIP", "SPORT", "DPORT");
+        AIR_PRINT("%-5s|%-5s|%-5s|%-5s|%-5s|%-5s|%-5s\n",
+                (dstInfo.sp)?"En":"Dis",
+                (dstInfo.sa)?"En":"Dis",
+                (dstInfo.da)?"En":"Dis",
+                (dstInfo.sip)?"En":"Dis",
+                (dstInfo.dip)?"En":"Dis",
+                (dstInfo.sport)?"En":"Dis",
+                (dstInfo.dport)?"En":"Dis");
+    }
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doLagHashtype(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T hashtype = 0;
+
+    if(1 == argc)
+    {
+        hashtype = _strtol(argv[0], NULL, 10);
+        ret = air_lag_sethashtype(0, hashtype);
+        if(ret == AIR_E_OK)
+        {
+            AIR_PRINT("Set LAG hashtype Ok.\n");
+        }
+        else
+        {
+            AIR_PRINT("Set LAG hashtype Fail.\n");
+        }
+    }
+    else if(0 == argc)
+    {
+        /* lag get dstInfo */
+        ret = air_lag_gethashtype(0, &hashtype);
+        if(ret == AIR_E_OK)
+        {
+            AIR_PRINT("Get LAG hashtype:\n");
+        }
+        else
+        {
+            AIR_PRINT("Get LLAG hashtype Fail.\n");
+        }
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+    if(ret == AIR_E_OK)
+    {
+        switch (hashtype)
+        {
+            case 0:
+                AIR_PRINT("hashtype:crc32lsb.\n");
+                break;
+            case 1:
+                AIR_PRINT("hashtype:crc32msb.\n");
+                break;
+            case 2:
+                AIR_PRINT("hashtype:crc16.\n");
+                break;
+            case 3:
+                AIR_PRINT("hashtype:xor4.\n");
+                break;
+            default:
+                AIR_PRINT("wrong hashtype:%d.\n",hashtype);
+        }
+
+    }
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doLagPtseed(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T ptseed = 0;
+
+    if(1 == argc)
+    {
+        ptseed = _strtol(argv[0], NULL, 16);
+        ret = air_lag_setPTSeed(0, ptseed);
+        if(ret == AIR_E_OK)
+        {
+            AIR_PRINT("Set LAG Port Seed:%x(hex) ok\n",ptseed);
+        }
+        else
+        {
+            AIR_PRINT("Set LAG Port Seed:%x(hex) fail\n",ptseed);
+        }
+    }
+    else if(0 == argc)
+    {
+        /* lag get seed */
+        ret = air_lag_getPTSeed(0, &ptseed);
+        if(ret == AIR_E_OK)
+        {
+            AIR_PRINT("Get port trunk seed: %x(hex)\n",ptseed);
+        }
+        else
+        {
+            AIR_PRINT("Get port trunk seed Fail.\n");
+        }
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doLagSpsel(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T port = 0;
+    UI32_T state = 0;
+
+    if(1 == argc)
+    {
+        /* lag set spsel <state> */
+        state = _strtol(argv[0], NULL, 10);
+        ret = air_lag_setSpSel(0,state);
+        if(ret == AIR_E_OK)
+        {
+            AIR_PRINT("Set source port compare function:%s.\n", (state)?"Enabled":"Disabled");
+        }
+        else
+        {
+            AIR_PRINT("Set source port compare function Fail.\n");
+        }
+    }
+    else if(0 == argc)
+    {
+        /* lag get spsel*/
+        ret = air_lag_getSpSel(0, &state);
+        if(ret == AIR_E_OK)
+        {
+            AIR_PRINT("Get source port compare function:%s.\n", (state)?"Enabled":"Disabled");
+        }
+        else
+        {
+            AIR_PRINT("Get source port compare function Fail.\n");
+        }
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    return ret;
+}
+
+
+static AIR_ERROR_NO_T
+doLagState(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T port = 0;
+    UI32_T state = 0;
+
+    if(1 == argc)
+    {
+        /* lag set state <state> */
+        state = _strtol(argv[0], NULL, 10);
+        ret = air_lag_set_ptgc_state(0,state);
+        if(ret == AIR_E_OK)
+        {
+            AIR_PRINT("Set LAG Port Trunk State:%s.\n", (state)?"Enabled":"Disabled");
+        }
+        else
+        {
+            AIR_PRINT("Set LAG Port Trunk State Fail.\n");
+        }
+    }
+    else if(0 == argc)
+    {
+        /* lag get state*/
+        ret = air_lag_get_ptgc_state(0, &state);
+        if(ret == AIR_E_OK)
+        {
+            AIR_PRINT("Get LAG Port Trunk State:%s.\n", (state)?"Enabled":"Disabled");
+        }
+        else
+        {
+            AIR_PRINT("Get LAG Port Trunk State Fail.\n");
+        }
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doLagGet(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(lagGetCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doLagSet(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(lagSetCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doLag(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(lagCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doStpPortstate(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T port = 0;
+    UI32_T fid = 0;
+    UI32_T state = 0;
+
+    port = _strtol(argv[0], NULL, 10);
+    fid = _strtol(argv[1], NULL, 10);
+    if(3 == argc)
+    {
+        /* stp set portstate <port> <fid(0..15)> <state> */
+        state = _strtol(argv[2], NULL, 10);
+        ret = air_stp_setPortstate(0, port, fid, state);
+        if(ret == AIR_E_OK)
+        {
+            AIR_PRINT("Set STP Port:%u FID:%u State:", port, fid);
+            switch(state)
+            {
+                case AIR_STP_STATE_DISABLE:
+                    AIR_PRINT("Disable(STP) / Discard(RSTP).\n");
+                    break;
+                case AIR_STP_STATE_LISTEN:
+                    AIR_PRINT("Listening(STP) / Discard(RSTP).\n");
+                    break;
+                case AIR_STP_STATE_LEARN:
+                    AIR_PRINT("Learning(STP) / Learning(RSTP).\n");
+                    break;
+                case AIR_STP_STATE_FORWARD:
+                    AIR_PRINT("Forwarding(STP) / Forwarding(RSTP).\n");
+                    break;
+                default:
+                    break;
+            }
+        }
+        else
+        {
+            AIR_PRINT("Set STP Port:%u FID:%u State Fail.", port, fid);
+        }
+    }
+    else if(2 == argc)
+    {
+        /* stp get portstate <port> <fid(0..15)> */
+        ret = air_stp_getPortstate(0, port, fid, &state);
+        if(ret == AIR_E_OK)
+        {
+            AIR_PRINT("Get STP Port:%u FID:%u State:", port, fid);
+            switch(state)
+            {
+                case AIR_STP_STATE_DISABLE:
+                    AIR_PRINT("Disable(STP) / Discard(RSTP).\n");
+                    break;
+                case AIR_STP_STATE_LISTEN:
+                    AIR_PRINT("Listening(STP) / Discard(RSTP).\n");
+                    break;
+                case AIR_STP_STATE_LEARN:
+                    AIR_PRINT("Learning(STP) / Learning(RSTP).\n");
+                    break;
+                case AIR_STP_STATE_FORWARD:
+                    AIR_PRINT("Forwarding(STP) / Forwarding(RSTP).\n");
+                    break;
+                default:
+                    break;
+            }
+        }
+        else
+        {
+            AIR_PRINT("Get STP Port:%u FID:%u State Fail.", port, fid);
+        }
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doStpGet(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(stpGetCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doStpSet(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(stpSetCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doStp(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(stpCmds, argc, argv);
+}
+
+static void
+_mir_printPortList(UI32_T * mt)
+{
+    I8_T j = 0;
+    UI8_T first = 0;
+    UI8_T find = 0;
+    for(j = (AIR_MAX_NUM_OF_PORTS - 1); j >= 0; j--)
+    {
+        if((*mt) & (1 << j))
+        {
+            first = j;
+            find = 1;
+            break;
+        }
+    }
+    if(find)
+    {
+        for(j = 0; j < AIR_MAX_NUM_OF_PORTS; j++)
+        {
+            if((*mt) & (1 << j))
+            {
+                if(j == first)
+                    AIR_PRINT("%-2d", j);
+                else
+                    AIR_PRINT("%-2d,", j);
+            }
+        }
+    }
+    else
+        AIR_PRINT("NULL");
+    AIR_PRINT("\n");
+}
+
+static void
+_mir_printSrcPortList(
+    const UI32_T         unit,
+    const UI32_T         sessionid)
+{
+    I8_T i = 0;
+    AIR_MIR_SESSION_T   session;
+    AIR_PORT_BITMAP_T txPbm = {0}, rxPbm = {0};
+	AIR_ERROR_NO_T      rc = AIR_E_OK;
+
+    for(i = 0; i < AIR_MAX_NUM_OF_PORTS; i++)
+    {
+         memset(&session, 0, sizeof(session));
+         session.src_port = i;
+         rc = air_mir_getMirrorPort(unit, sessionid, &session);
+		 if (AIR_E_OK != rc)
+		 {
+			AIR_PRINT("***Error***,get port=%u error\n", i);
+			return rc;
+		 }
+
+         if(session.flags & AIR_MIR_SESSION_FLAGS_DIR_TX)
+         {
+            txPbm[0] |= (1 << i);
+         }
+         if(session.flags & AIR_MIR_SESSION_FLAGS_DIR_RX)
+         {
+            rxPbm[0] |= (1 << i);
+         }
+    }
+    AIR_PRINT("Src PortList\n");
+    AIR_PRINT(" - Rx portlist = ");
+    _mir_printPortList(rxPbm);
+    AIR_PRINT(" - Tx portlist = ");
+    _mir_printPortList(txPbm);
+}
+
+static void
+_mir_printSession(
+    const UI32_T            unit,
+    const UI32_T            session_id,
+    const AIR_MIR_SESSION_T *ptr_session)
+{
+
+    AIR_PRINT("Session id: %d\n", session_id);
+    AIR_PRINT("State: %s \n", (ptr_session->flags & AIR_MIR_SESSION_FLAGS_ENABLE)? "enable": "disable");
+    AIR_PRINT("Tx tag: %s \n", (ptr_session->flags & AIR_MIR_SESSION_FLAGS_TX_TAG_OBEY_CFG)? "On": "Off");
+    AIR_PRINT("Dst port: %d \n", ptr_session->dst_port);
+    _mir_printSrcPortList(unit,session_id);
+}
+
+static AIR_ERROR_NO_T
+doMirrorGetSid(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T      rc = AIR_E_OK;
+    UI32_T              session_id = 0;
+    AIR_MIR_SESSION_T   session = {0};
+    I8_T i = 0;
+
+    session_id = _strtoul(argv[0], NULL, 0);
+    rc = air_mir_getSession(0, session_id, &session);
+    if (AIR_E_OK != rc)
+    {
+        AIR_PRINT("***Error***, get mirror session fail\n");
+        return rc;
+    }
+    /* print session information */
+    if(session.dst_port == AIR_PORT_INVALID)
+    {
+        AIR_PRINT("Session id %d not found\n", session_id);
+    }
+    else
+    {
+        _mir_printSession(0, session_id, &session);
+    }
+    return rc;
+}
+
+static AIR_ERROR_NO_T
+doMirrorDelSid(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T      rc = AIR_E_OK;
+    UI32_T              session_id = 0;
+    AIR_MIR_SESSION_T   session = {0};
+    UI8_T i = 0;
+
+    session_id = _strtoul(argv[0], NULL, 0);
+    rc = air_mir_delSession(0, session_id);
+    if (AIR_E_OK != rc)
+    {
+        AIR_PRINT("***Error***, del mirror session fail\n");
+        return rc;
+    }
+    for(i = 0; i < AIR_MAX_NUM_OF_PORTS; i++)
+    {
+        session.src_port = i;
+        rc = air_mir_setMirrorPort(0, session_id, &session);
+        if (AIR_E_OK != rc)
+        {
+            AIR_PRINT("***Error***,port=%u error\n", i);
+            return rc;
+        }
+    }
+    if (rc != AIR_E_OK)
+    {
+        AIR_PRINT("***Error***, delete mirror session fail\n");
+    }
+    else
+        AIR_PRINT("***OK***, delete mirror session success\n");
+
+    return rc;
+}
+
+static AIR_ERROR_NO_T
+doMirrorAddRlist(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T      rc = AIR_E_OK;
+    UI32_T              session_id = 0;
+    AIR_MIR_SESSION_T   session = {0};
+    AIR_PORT_BITMAP_T rxPbm = {0};
+    UI8_T i = 0;
+
+    /*mirror add session-rlist <sid(0..3)> <list(UINTLIST)>*/
+    session_id = _strtoul(argv[0], NULL, 0);
+    rc = _portListStr2Ary(argv[1], rxPbm, 1);
+    if(rc != AIR_E_OK)
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        return rc;
+    }
+    if(!rxPbm[0])
+    {
+        for(i = 0; i < AIR_MAX_NUM_OF_PORTS; i++)
+        {
+            memset(&session, 0, sizeof(AIR_MIR_SESSION_T));
+            session.src_port = i;
+            rc = air_mir_getMirrorPort(0, session_id, &session);
+            if (AIR_E_OK != rc)
+            {
+                AIR_PRINT("***Error***,get port=%u error\n", i);
+                return rc;
+            }
+
+            session.flags &= ~AIR_MIR_SESSION_FLAGS_DIR_RX;
+            session.src_port = i;
+            rc = air_mir_setMirrorPort(0, session_id, &session);
+            if (AIR_E_OK != rc)
+            {
+                AIR_PRINT("***Error***,set rx port=%u error\n", i);
+                return rc;
+            }
+        }
+    }
+    else
+    {
+        for(i = 0; i < AIR_MAX_NUM_OF_PORTS; i++)
+        {
+            if(rxPbm[0] & (1 << i))
+            {
+                memset(&session, 0, sizeof(AIR_MIR_SESSION_T));
+                session.src_port = i;
+                rc = air_mir_getMirrorPort(0, session_id, &session);
+                if (AIR_E_OK != rc)
+                {
+                    AIR_PRINT("***Error***,get port=%u error\n", i);
+                    return rc;
+                }
+
+                session.flags |= AIR_MIR_SESSION_FLAGS_DIR_RX;
+                session.src_port = i;
+                rc = air_mir_setMirrorPort(0, session_id, &session);
+                if (AIR_E_OK != rc)
+                {
+                    AIR_PRINT("***Error***,port=%u error\n", i);
+                    return rc;
+                }
+            }
+        }
+    }
+
+    return rc;
+}
+
+static AIR_ERROR_NO_T
+doMirrorAddTlist(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T      rc = AIR_E_OK;
+    UI32_T              session_id = 0;
+    AIR_MIR_SESSION_T   session = {0};
+    AIR_PORT_BITMAP_T txPbm = {0};
+    UI8_T i = 0;
+
+    /*mirror add session-tlist <sid(0..3)> <list(UINTLIST)>*/
+    session_id = _strtoul(argv[0], NULL, 0);
+    rc = _portListStr2Ary(argv[1], txPbm, 1);
+    if(rc != AIR_E_OK)
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        return rc;
+    }
+    if(!txPbm[0])
+    {
+        for(i = 0; i < AIR_MAX_NUM_OF_PORTS; i++)
+        {
+            memset(&session, 0, sizeof(AIR_MIR_SESSION_T));
+            session.src_port = i;
+            rc = air_mir_getMirrorPort(0, session_id, &session);
+            if (AIR_E_OK != rc)
+            {
+                AIR_PRINT("***Error***,get port=%u error\n", i);
+                return rc;
+            }
+
+            session.flags &= ~AIR_MIR_SESSION_FLAGS_DIR_TX;
+            session.src_port = i;
+            rc = air_mir_setMirrorPort(0, session_id, &session);
+            if (AIR_E_OK != rc)
+            {
+                AIR_PRINT("***Error***,set rx port=%u error\n", i);
+                return rc;
+            }
+        }
+    }
+    else
+    {
+        for(i = 0; i < AIR_MAX_NUM_OF_PORTS; i++)
+        {
+            if(txPbm[0] & (1 << i))
+            {
+                memset(&session, 0, sizeof(AIR_MIR_SESSION_T));
+                session.src_port = i;
+                rc = air_mir_getMirrorPort(0, session_id, &session);
+                if (AIR_E_OK != rc)
+                {
+                    AIR_PRINT("***Error***,get port=%u error\n", i);
+                    return rc;
+                }
+
+                session.flags |= AIR_MIR_SESSION_FLAGS_DIR_TX;
+                session.src_port = i;
+                rc = air_mir_setMirrorPort(0, session_id, &session);
+                if (AIR_E_OK != rc)
+                {
+                    AIR_PRINT("***Error***,port=%u error\n", i);
+                    return rc;
+                }
+            }
+        }
+    }
+
+    return rc;
+}
+
+static AIR_ERROR_NO_T
+doMirrorSetSessionEnable(
+    UI32_T argc,
+    C8_T *argv[])
+
+{
+    AIR_ERROR_NO_T      rc = AIR_E_OK;
+    UI32_T              session_id = 0;
+    UI32_T              enable = 0;
+    BOOL_T              tmp_en = FALSE;
+
+    /*mirror set session-enable <sid(0..3)> <state(1:En,0:Dis)>*/
+    session_id = _strtoul(argv[0], NULL, 0);
+    enable = _strtoul(argv[1], NULL, 0);
+    if(enable)
+        tmp_en = TRUE;
+    /* set port mirror state */
+    rc = air_mir_setSessionAdminMode(0, session_id, tmp_en);
+    if(AIR_E_OK!=rc)
+    {
+        AIR_PRINT("***Error***\n");
+    }
+    return rc;
+}
+
+static AIR_ERROR_NO_T
+doMirrorSetSession(
+    UI32_T argc,
+    C8_T *argv[])
+{
+    AIR_ERROR_NO_T      rc = AIR_E_OK;
+    UI32_T              session_id = 0;
+    UI32_T              dst_port = 0;
+    UI8_T               enable = 0;
+    UI8_T               tag_en = 0;
+    UI8_T               dir = 0;
+    AIR_MIR_SESSION_T  session = {0};
+    AIR_PORT_BITMAP_T   rxPbm = {0};
+    I8_T               i = 0;
+
+    /*mirror set session <sid(0..3)> <dst_port(UINT)> <state(1:En,0:Dis)> <tag(1:on, 0:off)> <list(UINTLIST)> <dir(0:none,1:tx,2:rx,3:both)>*/
+    session_id = _strtoul(argv[0], NULL, 0);
+    dst_port = _strtoul(argv[1], NULL, 0);
+    AIR_PRINT("session id %d dst port %d.\n", session_id, dst_port);
+    session.dst_port = dst_port;
+    enable = _strtoul(argv[2], NULL, 0);
+    if(enable)
+    {
+        session.flags |= AIR_MIR_SESSION_FLAGS_ENABLE;
+    }
+    else
+    {
+        session.flags &= ~AIR_MIR_SESSION_FLAGS_ENABLE;
+    }
+    tag_en = _strtoul(argv[3], NULL, 0);
+    if(tag_en)
+    {
+        session.flags |= AIR_MIR_SESSION_FLAGS_TX_TAG_OBEY_CFG;
+    }
+    else
+    {
+        session.flags &= ~AIR_MIR_SESSION_FLAGS_TX_TAG_OBEY_CFG;
+    }
+    rc = _portListStr2Ary(argv[4], rxPbm, 1);
+    if(rc != AIR_E_OK)
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        return rc;
+    }
+    AIR_PRINT("pbm %x.\n", rxPbm);
+    dir = _strtoul(argv[5], NULL, 0);
+    if(dir == 1)
+    {
+        session.flags |= AIR_MIR_SESSION_FLAGS_DIR_TX;
+    }
+    else if(dir == 2)
+    {
+        session.flags |= AIR_MIR_SESSION_FLAGS_DIR_RX;
+    }
+    else if(dir == 3)
+    {
+        session.flags |= AIR_MIR_SESSION_FLAGS_DIR_TX;
+        session.flags |= AIR_MIR_SESSION_FLAGS_DIR_RX;
+    }
+    else if (!dir)
+    {
+        session.flags &= ~AIR_MIR_SESSION_FLAGS_DIR_TX;
+        session.flags &= ~AIR_MIR_SESSION_FLAGS_DIR_RX;
+    }
+    else
+    {
+        return AIR_E_BAD_PARAMETER;
+    }
+    for(i = 0; i < AIR_MAX_NUM_OF_PORTS; i++)
+    {
+        if(rxPbm[0] & (1 << i))
+        {
+            session.src_port = i;
+            /* set port mirror session */
+            rc = air_mir_addSession(0, session_id, &session);
+
+            if(AIR_E_OK!=rc)
+            {
+                AIR_PRINT("***Error***,dst-port=%u, src-port=%u error\n", session.dst_port, session.src_port);
+                return rc;
+            }
+            else
+                AIR_PRINT("add session %d,dst-port=%u, src-port=%u\n", session_id, session.dst_port, session.src_port);
+        }
+    }
+
+    return rc;
+}
+
+
+
+static AIR_ERROR_NO_T
+doMirrorSet(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(mirrorSetCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doMirrorAdd(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(mirrorAddCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doMirrorGet(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(mirrorGetCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doMirrorDel(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(mirrorDelCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doMirror(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(mirrorCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doMibClearPort(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T port = 0;
+
+    if(1 == argc)
+    {
+        /* mib clear port */
+        port = _strtoul(argv[0], NULL, 0);
+        ret = air_mib_clear_by_port(0,port);
+        AIR_PRINT("Clear port %d mib stats",port);
+        if(AIR_E_OK == ret)
+        {
+            AIR_PRINT("Done.\n");
+        }
+        else
+        {
+            AIR_PRINT("Fail.\n");
+        }
+    }
+    else if(0 == argc)
+    {
+        /*restart mib counter*/
+        air_mib_clear(0);
+        AIR_PRINT("Clear all mib stats",port);
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doMibClearAcl(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T port = 0;
+
+    if(0 == argc)
+    {
+        /* mib clear acl */
+        ret = air_mib_clearAclEvent(0);
+        AIR_PRINT("Clear ACL Event Counter ");
+        if(AIR_E_OK == ret)
+        {
+            AIR_PRINT("Done.\n");
+        }
+        else
+        {
+            AIR_PRINT("Fail.\n");
+        }
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doMibGetPort(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T port = 0;
+    UI32_T tmp32 = 0xffffffff;
+    AIR_MIB_CNT_RX_T rx_mib = {0};
+    AIR_MIB_CNT_TX_T tx_mib = {0};
+
+    port = _strtoul(argv[0], NULL, 0);
+    if(1 == argc)
+    {
+        /* mib get <port(0..6)> */
+        ret = air_mib_get(0, port, &rx_mib, &tx_mib);
+        AIR_PRINT("Get MIB Counter of Port %u ", port);
+        if(AIR_E_OK == ret)
+        {
+            AIR_PRINT("Done.\n");
+            AIR_PRINT("RX Drop Packet                    : %u\n", rx_mib.RDPC);
+            AIR_PRINT("RX filtering Packet               : %u\n", rx_mib.RFPC);
+            AIR_PRINT("RX Unicast Packet                 : %u\n", rx_mib.RUPC);
+            AIR_PRINT("RX Multicast Packet               : %u\n", rx_mib.RMPC);
+            AIR_PRINT("RX Broadcast Packet               : %u\n", rx_mib.RBPC);
+            AIR_PRINT("RX Alignment Error Packet         : %u\n", rx_mib.RAEPC);
+            AIR_PRINT("RX CRC Packet                     : %u\n", rx_mib.RCEPC);
+            AIR_PRINT("RX Undersize Packet               : %u\n", rx_mib.RUSPC);
+            AIR_PRINT("RX Fragment Error Packet          : %u\n", rx_mib.RFEPC);
+            AIR_PRINT("RX Oversize Packet                : %u\n", rx_mib.ROSPC);
+            AIR_PRINT("RX Jabber Error Packet            : %u\n", rx_mib.RJEPC);
+            AIR_PRINT("RX Pause Packet                   : %u\n", rx_mib.RPPC);
+            AIR_PRINT("RX Packet Length 64 bytes         : %u\n", rx_mib.RL64PC);
+            AIR_PRINT("RX Packet Length 65 ~ 127 bytes   : %u\n", rx_mib.RL65PC);
+            AIR_PRINT("RX Packet Length 128 ~ 255 bytes  : %u\n", rx_mib.RL128PC);
+            AIR_PRINT("RX Packet Length 256 ~ 511 bytes  : %u\n", rx_mib.RL256PC);
+            AIR_PRINT("RX Packet Length 512 ~ 1023 bytes : %u\n", rx_mib.RL512PC);
+            AIR_PRINT("RX Packet Length 1024 ~ 1518 bytes: %u\n", rx_mib.RL1024PC);
+            AIR_PRINT("RX Packet Length 1519 ~ max bytes : %u\n", rx_mib.RL1519PC);
+            AIR_PRINT("RX_CTRL Drop Packet               : %u\n", rx_mib.RCDPC);
+            AIR_PRINT("RX Ingress Drop Packet            : %u\n", rx_mib.RIDPC);
+            AIR_PRINT("RX ARL Drop Packet                : %u\n", rx_mib.RADPC);
+            AIR_PRINT("FLow Control Drop Packet          : %u\n", rx_mib.FCDPC);
+            AIR_PRINT("WRED Drop Packtet                 : %u\n", rx_mib.WRDPC);
+            AIR_PRINT("Mirror Drop Packet                : %u\n", rx_mib.MRDPC);
+            AIR_PRINT("RX  sFlow Sampling Packet         : %u\n", rx_mib.SFSPC);
+            AIR_PRINT("Rx sFlow Total Packet             : %u\n", rx_mib.SFTPC);
+            AIR_PRINT("Port Control Drop Packet          : %u\n", rx_mib.RXC_DPC);
+            AIR_PRINT("RX Octets good or bad packtes l32 : %u\n", (UI32_T)(rx_mib.ROC & tmp32));
+            AIR_PRINT("RX Octets good or bad packtes h32 : %u\n", (UI32_T)((rx_mib.ROC >> 32) & tmp32));
+            AIR_PRINT("RX Octets bad packets l32         : %u\n", (UI32_T)(rx_mib.ROC2 & tmp32));
+            AIR_PRINT("RX Octets bad packets h32         : %u\n", (UI32_T)((rx_mib.ROC2 >> 32) & tmp32));
+            AIR_PRINT("\n");
+            AIR_PRINT("TX Drop Packet                    : %u\n", tx_mib.TDPC);
+            AIR_PRINT("TX CRC Packet                     : %u\n", tx_mib.TCRC);
+            AIR_PRINT("TX Unicast Packet                 : %u\n", tx_mib.TUPC);
+            AIR_PRINT("TX Multicast Packet               : %u\n", tx_mib.TMPC);
+            AIR_PRINT("TX Broadcast Packet               : %u\n", tx_mib.TBPC);
+            AIR_PRINT("TX Collision Event Count          : %u\n", tx_mib.TCEC);
+            AIR_PRINT("TX Single Collision Event Count   : %u\n", tx_mib.TSCEC);
+            AIR_PRINT("TX Multiple Conllision Event Count: %u\n", tx_mib.TMCEC);
+            AIR_PRINT("TX Deferred Event Count           : %u\n", tx_mib.TDEC);
+            AIR_PRINT("TX Late Collision Event Count     : %u\n", tx_mib.TLCEC);
+            AIR_PRINT("TX Excessive Collision Event Count: %u\n", tx_mib.TXCEC);
+            AIR_PRINT("TX Pause Packet                   : %u\n", tx_mib.TPPC);
+            AIR_PRINT("TX Packet Length 64 bytes         : %u\n", tx_mib.TL64PC);
+            AIR_PRINT("TX Packet Length 65 ~ 127 bytes   : %u\n", tx_mib.TL65PC);
+            AIR_PRINT("TX Packet Length 128 ~ 255 bytes  : %u\n", tx_mib.TL128PC);
+            AIR_PRINT("TX Packet Length 256 ~ 511 bytes  : %u\n", tx_mib.TL256PC);
+            AIR_PRINT("TX Packet Length 512 ~ 1023 bytes : %u\n", tx_mib.TL512PC);
+            AIR_PRINT("TX Packet Length 1024 ~ 1518 bytes: %u\n", tx_mib.TL1024PC);
+            AIR_PRINT("TX Packet Length 1519 ~ max bytes : %u\n", tx_mib.TL1519PC);
+            AIR_PRINT("TX Oversize Drop Packet           : %u\n", tx_mib.TODPC);
+            AIR_PRINT("TX Octets good or bad packtes l32 : %u\n", (UI32_T)(tx_mib.TOC & tmp32));
+            AIR_PRINT("TX Octets good or bad packtes h32 : %u\n", (UI32_T)((tx_mib.TOC >> 32) & tmp32));
+            AIR_PRINT("TX Octets bad packets l32         : %u\n", (UI32_T)(tx_mib.TOC2 & tmp32));
+            AIR_PRINT("TX Octets bad packets h32         : %u\n", (UI32_T)((tx_mib.TOC2 >> 32) & tmp32));
+        }
+        else
+        {
+            AIR_PRINT("Fail.\n");
+        }
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doMibGetAcl(
+    UI32_T argc,
+    C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T event = 0;
+    UI32_T cnt = 0;
+
+    if(1 == argc)
+    {
+        /* mib get acl <event(0..7)> */
+        event = _strtoul(argv[0], NULL, 0);
+        ret = air_mib_getAclEvent(0, event, &cnt);
+        AIR_PRINT("Get counter of ACL event %u ", event);
+        if(AIR_E_OK == ret)
+        {
+            AIR_PRINT("Done.\n");
+            AIR_PRINT("ACL Event Counter:%u\n", cnt);
+        }
+        else
+        {
+            AIR_PRINT("Fail.\n");
+        }
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doMibClear(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(mibClearCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doMibGet(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(mibGetCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doMib(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(mibCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doQosRateLimitExMngFrm(
+    UI32_T argc,
+    C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T dir = 0;
+    BOOL_T enable = FALSE;
+
+    if(2 == argc)
+    {
+		dir = _strtoul(argv[0], NULL, 0);
+        if(dir == 0)
+            dir = AIR_QOS_RATE_DIR_EGRESS;
+        else if(dir == 1)
+            dir = AIR_QOS_RATE_DIR_INGRESS;
+        else
+        {
+            AIR_PRINT("Unrecognized command.\n");
+            ret = AIR_E_BAD_PARAMETER;
+            return ret;
+        }
+        enable = _strtoul(argv[1], NULL, 0);
+        ret = air_qos_setRateLimitExMngFrm(0, dir, enable);
+        if(ret == AIR_E_OK)
+        {
+            AIR_PRINT("Success.\n");
+            AIR_PRINT("Set %s Rate Limit Control %s management frame.\n",
+                    (AIR_QOS_RATE_DIR_INGRESS == dir)?"Ingress":"Egress",
+                    (TRUE == enable)?"exclude":"include");
+        }
+        else
+        {
+            AIR_PRINT("Fail.\n");
+            return ret;
+        }
+    }
+    else if(0 == argc)
+    {
+        dir = AIR_QOS_RATE_DIR_EGRESS;
+        ret = air_qos_getRateLimitExMngFrm(0, dir, &enable);
+        if(ret == AIR_E_OK)
+        {
+            AIR_PRINT("Success.\n");
+            AIR_PRINT("Get %s Rate Limit Control %s management frame.\n",
+                    (AIR_QOS_RATE_DIR_INGRESS == dir)?"Ingress":"Egress",
+                    (TRUE == enable)?"exclude":"include");
+        }
+        else
+        {
+            AIR_PRINT("Fail.\n");
+            return ret;
+        }
+        dir = AIR_QOS_RATE_DIR_INGRESS;
+        ret = air_qos_getRateLimitExMngFrm(0, dir, &enable);
+        if(ret == AIR_E_OK)
+        {
+            AIR_PRINT("Success.\n");
+            AIR_PRINT("Get %s Rate Limit Control %s management frame.\n",
+                    (AIR_QOS_RATE_DIR_INGRESS == dir)?"Ingress":"Egress",
+                    (TRUE == enable)?"exclude":"include");
+        }
+        else
+        {
+            AIR_PRINT("Fail.\n");
+            return ret;
+        }
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    return ret;
+
+}
+
+static AIR_ERROR_NO_T
+doQosPortPriority(
+    UI32_T argc,
+    C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    AIR_PORT_BITMAP_T portlist = {0};
+    UI32_T priority = 0;
+    UI8_T i = 0;
+
+    ret = _portListStr2Ary(argv[0], portlist, 1);
+    if(ret != AIR_E_OK)
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        return ret;
+    }
+    if(2 == argc)
+    {
+        priority = _strtoul(argv[1], NULL, 0);
+        for(i = 0; i < AIR_MAX_NUM_OF_PORTS; i++)
+        {
+            if(portlist[0] & (1 << i))
+            {
+                ret = air_qos_setPortPriority(0, i, priority);
+                if(ret == AIR_E_OK)
+                {
+                    AIR_PRINT("Set Port%02d port based priority %d Success.\n", i, priority);
+                }
+                else
+                {
+                    AIR_PRINT("Set Port%02d port based priority %d Fail.\n", i, priority);
+                }
+            }
+        }
+    }
+    else if(1 == argc)
+    {
+        for(i = 0; i < AIR_MAX_NUM_OF_PORTS; i++)
+        {
+            if(portlist[0] & (1 << i))
+            {
+                ret = air_qos_getPortPriority(0, i, &priority);
+                if(ret == AIR_E_OK)
+                {
+                    AIR_PRINT("Get Port%d port based priority %d.\n", i, priority);
+                }
+                else
+                {
+                    AIR_PRINT("Get Port%d port based priority Fail.\n", i);
+                }
+            }
+        }
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doQosRateLimit(
+    UI32_T argc,
+    C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    AIR_PORT_BITMAP_T portlist = {0};
+    AIR_QOS_RATE_LIMIT_CFG_T rl = {0};
+    UI8_T i = 0;
+
+    ret = _portListStr2Ary(argv[0], portlist, 1);
+    if(ret != AIR_E_OK)
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        return ret;
+    }
+    if(5 == argc)
+    {
+        rl.ingress_cir = _strtoul(argv[1], NULL, 0);
+        rl.ingress_cbs = _strtoul(argv[2], NULL, 0);
+        rl.egress_cir = _strtoul(argv[3], NULL, 0);
+        rl.egress_cbs = _strtoul(argv[4], NULL, 0);
+        rl.flags |= AIR_QOS_RATE_LIMIT_CFG_FLAGS_ENABLE_INGRESS;
+        rl.flags |= AIR_QOS_RATE_LIMIT_CFG_FLAGS_ENABLE_EGRESS;
+        for(i = 0; i < AIR_MAX_NUM_OF_PORTS; i++)
+        {
+            if(portlist[0] & (1 << i))
+            {
+                ret = air_qos_setRateLimit(0, i, &rl);
+                if(ret == AIR_E_OK)
+                {
+                    AIR_PRINT("Set Port%02d Ingress CIR %d CBS %d Egress CIR %d CBS %d Success.\n", i, rl.ingress_cir, rl.ingress_cbs, rl.egress_cir, rl.egress_cbs);
+                }
+                else
+                {
+                    AIR_PRINT("Set Port%02d Ingress CIR %d CBS %d Egress CIR %d CBS %d Fail.\n", i, rl.ingress_cir, rl.ingress_cbs, rl.egress_cir, rl.egress_cbs);
+                }
+            }
+        }
+    }
+    else if(1 == argc)
+    {
+        for(i = 0; i < AIR_MAX_NUM_OF_PORTS; i++)
+        {
+            if(portlist[0] & (1 << i))
+            {
+                ret = air_qos_getRateLimit(0, i, &rl);
+                if(ret == AIR_E_OK)
+                {
+                    AIR_PRINT("Get Port%02d Ingress CIR %d CBS %d Egress CIR %d CBS %d\n", i, rl.ingress_cir, rl.ingress_cbs, rl.egress_cir, rl.egress_cbs);
+                }
+                else
+                {
+                    AIR_PRINT("Get Port%02d Rate Info Fail.\n", i);
+                }
+            }
+        }
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doQosRateLimitEnable(
+    UI32_T argc,
+    C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    AIR_PORT_BITMAP_T portlist = {0};
+    C8_T sten[2][10] = {"Disable", "Enable"};
+    C8_T stdir[2][10] = {"Egress", "Ingress"};
+    UI32_T dir = 0, en = 0;
+    AIR_QOS_RATE_DIR_T tmp_dir = AIR_QOS_RATE_DIR_LAST;
+    BOOL_T state = FALSE;
+    UI8_T i = 0;
+
+    ret = _portListStr2Ary(argv[0], portlist, 1);
+    if(ret != AIR_E_OK)
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        return ret;
+    }
+    if(3 == argc)
+    {
+        dir = _strtoul(argv[1], NULL, 0);
+        en = _strtoul(argv[2], NULL, 0);
+        if(dir == 0)
+            tmp_dir = AIR_QOS_RATE_DIR_EGRESS;
+        else if(dir == 1)
+            tmp_dir = AIR_QOS_RATE_DIR_INGRESS;
+        else
+        {
+            AIR_PRINT("Unrecognized command.\n");
+            return AIR_E_BAD_PARAMETER;
+        }
+        if(en)
+            state= TRUE;
+        else
+            state = FALSE;
+
+        for(i = 0; i < AIR_MAX_NUM_OF_PORTS; i++)
+        {
+            if(portlist[0] & (1 << i))
+            {
+                ret = air_qos_setRateLimitEnable(0, i, tmp_dir, state);
+                if(AIR_E_OK == ret)
+                {
+                    AIR_PRINT("Set Port%02d %s rate %s Success.\n", i, stdir[dir], sten[en]);
+                }
+                else
+                {
+                    AIR_PRINT("Set Port%02d %s rate %s Fail.\n", i, stdir[dir], sten[en]);
+                }
+            }
+        }
+    }
+    else if(1 == argc)
+    {
+        for(i = 0; i < AIR_MAX_NUM_OF_PORTS; i++)
+        {
+            if(portlist[0] & (1 << i))
+            {
+                tmp_dir = AIR_QOS_RATE_DIR_EGRESS;
+                dir = 0;
+                ret = air_qos_getRateLimitEnable(0, i, tmp_dir, &state);
+                if(AIR_E_OK == ret)
+                {
+                    AIR_PRINT("Get Port%02d %s rate %s Success.\n", i, stdir[dir], sten[state]);
+                }
+                else
+                {
+                    AIR_PRINT("Get Port%02d %s rate state Fail.\n", i, stdir[dir]);
+                }
+                tmp_dir = AIR_QOS_RATE_DIR_INGRESS;
+                dir = 1;
+                ret = air_qos_getRateLimitEnable(0, i, tmp_dir, &state);
+                if(AIR_E_OK == ret)
+                {
+                    AIR_PRINT("Get Port%02d %s rate %s Success.\n", i, stdir[dir], sten[state]);
+                }
+                else
+                {
+                    AIR_PRINT("Get Port%02d %s rate state Fail.\n", i, stdir[dir]);
+                }
+            }
+        }
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    return ret;
+
+}
+
+static AIR_ERROR_NO_T
+doQosDscp2Pri(
+    UI32_T argc,
+    C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T dscp = 0, priority = 0;
+
+    dscp = _strtoul(argv[0], NULL, 0);
+    if(2 == argc)
+    {
+        priority = _strtoul(argv[1], NULL, 0);
+        ret = air_qos_setDscp2Pri(0, dscp, priority);
+        if(AIR_E_OK == ret)
+        {
+            AIR_PRINT("Set DSCP %d to priority %d Success.\n", dscp, priority);
+        }
+        else
+        {
+            AIR_PRINT("Set DSCP %d to priority %d Fail.\n", dscp, priority);
+        }
+    }
+    else if(1 == argc)
+    {
+        ret = air_qos_getDscp2Pri(0, dscp, &priority);
+        if(AIR_E_OK == ret)
+        {
+            AIR_PRINT("Get DSCP %d to priority %d\n", dscp, priority);
+        }
+        else
+        {
+            AIR_PRINT("Get DSCP %d to priority Fail.\n", dscp);
+        }
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doQosPri2Queue(
+    UI32_T argc,
+    C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T priority = 0, queue = 0;
+
+    priority = _strtoul(argv[1], NULL, 0);
+
+    if(2 == argc)
+    {
+        priority = _strtoul(argv[0], NULL, 0);
+        queue = _strtoul(argv[1], NULL, 0);
+        ret = air_qos_setPri2Queue(0, priority, queue);
+        if(AIR_E_OK == ret)
+        {
+            AIR_PRINT("Set priority %d to queue %d Success.\n", priority, queue);
+        }
+        else
+        {
+            AIR_PRINT("Set priority %d to queue %d Fail.\n", priority, queue);
+        }
+    }
+    else
+    {
+        for(; priority < AIR_QOS_QUEUE_MAX_NUM; priority++)
+        {
+            ret = air_qos_getPri2Queue(0, priority, &queue);
+            if(AIR_E_OK == ret)
+            {
+                AIR_PRINT("Get priority %d to queue %d\n", priority, queue);
+            }
+            else
+            {
+                AIR_PRINT("Get priority %d to queue Fail.\n", priority);
+            }
+        }
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doQosTrustMode(
+    UI32_T argc,
+    C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T mode = 0;
+    C8_T bs[4][13] = {"port", "1p_port", "dscp_port", "dscp_1p_port"};
+    AIR_QOS_TRUST_MODE_T mode_t = AIR_QOS_TRUST_MODE_LAST;
+    AIR_PORT_BITMAP_T portlist = {0};
+    UI8_T i = 0;
+
+    ret = _portListStr2Ary(argv[0], portlist, 1);
+    if(ret != AIR_E_OK)
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        return ret;
+    }
+    if(2 == argc)
+    {
+        mode = _strtoul(argv[1], NULL, 0);
+        if(mode == 0)
+            mode_t = AIR_QOS_TRUST_MODE_PORT;
+        else if(mode == 1)
+            mode_t = AIR_QOS_TRUST_MODE_1P_PORT;
+        else if(mode == 2)
+            mode_t = AIR_QOS_TRUST_MODE_DSCP_PORT;
+        else if(mode == 3)
+            mode_t = AIR_QOS_TRUST_MODE_DSCP_1P_PORT;
+        else
+        {
+            AIR_PRINT("Unrecognized command.\n");
+            return AIR_E_BAD_PARAMETER;
+        }
+        for(i = 0; i < AIR_MAX_NUM_OF_PORTS; i++)
+        {
+            if(portlist[0] & (1 << i))
+            {
+                ret = air_qos_setTrustMode(0, i, mode_t);
+                if(AIR_E_OK == ret)
+                {
+                    AIR_PRINT("port %d Set Trust mode %s Success.\n", i, bs[mode]);
+                }
+                else
+                {
+                    AIR_PRINT("port %d Set Trust mode %s Fail.\n", i, bs[mode]);
+                }
+            }
+        }
+    }
+    else if(1 == argc)
+    {
+        for(i = 0; i < AIR_MAX_NUM_OF_PORTS; i++)
+        {
+            if(portlist[0] & (1 << i))
+            {
+                mode_t = AIR_QOS_TRUST_MODE_LAST;
+                ret = air_qos_getTrustMode(0, i, &mode_t);
+                if(AIR_E_OK == ret)
+                {
+                    if(mode_t == AIR_QOS_TRUST_MODE_PORT)
+                        mode = 0;
+                    else if(mode_t == AIR_QOS_TRUST_MODE_1P_PORT)
+                        mode = 1;
+                    else if(mode_t == AIR_QOS_TRUST_MODE_DSCP_PORT)
+                        mode = 2;
+                    else if(mode_t == AIR_QOS_TRUST_MODE_DSCP_1P_PORT)
+                        mode = 3;
+                    else
+                    {
+                        AIR_PRINT("port %d Get Trust mode Fail.\n", i);
+                        return AIR_E_OTHERS;
+                    }
+                    AIR_PRINT("port %d Get Trust mode %s\n", i, bs[mode]);
+                }
+                else
+                {
+                    AIR_PRINT("port %d Get Trust mode Fail.\n", i);
+                }
+            }
+        }
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doQosScheduleAlgo(
+    UI32_T argc,
+    C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    AIR_PORT_BITMAP_T portlist = {0};
+    AIR_QOS_SCH_MODE_T sch_mode = AIR_QOS_SCH_MODE_LAST;
+    UI32_T scheduler = 0;
+    UI8_T queue = 0;
+    C8_T sche[3][5] = {"SP", "WRR", "WFQ"};
+    UI32_T weight = AIR_QOS_SHAPER_NOSETTING;
+    UI8_T i = 0;
+
+    ret = _portListStr2Ary(argv[0], portlist, 1);
+    if(ret != AIR_E_OK)
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        return ret;
+    }
+    AIR_PRINT("port list is %d\n", portlist[0]);
+    if(4 == argc)
+    {
+        queue = _strtoul(argv[1], NULL, 0);
+        AIR_PRINT("queue is %d\n", queue);
+        scheduler = _strtoul(argv[2], NULL, 0);
+        AIR_PRINT("scheduler is %d\n", scheduler);
+        weight = _strtoul(argv[3], NULL, 0);
+        AIR_PRINT("weight is %d\n", weight);
+        if(scheduler == 0)
+        {
+            sch_mode = AIR_QOS_SCH_MODE_SP;
+            weight = AIR_QOS_SHAPER_NOSETTING;
+            if(weight != AIR_QOS_SHAPER_NOSETTING)
+                AIR_PRINT("[Warning] SP schedule mode no need weight\n");
+        }
+        else if(scheduler == 1)
+        {
+            sch_mode = AIR_QOS_SCH_MODE_WRR;
+            if(weight == AIR_QOS_SHAPER_NOSETTING)
+            {
+                AIR_PRINT("[Warning] No weight value input , plz check\n");
+                return AIR_E_BAD_PARAMETER;
+            }
+            AIR_PRINT("sch_mode is 1\n");
+        }
+        else if(scheduler == 2)
+        {
+            sch_mode = AIR_QOS_SCH_MODE_WFQ;
+            if(weight == AIR_QOS_SHAPER_NOSETTING)
+            {
+                AIR_PRINT("[Warning] No weight value input , plz check\n");
+                return AIR_E_BAD_PARAMETER;
+            }
+        }
+        else
+        {
+            AIR_PRINT("Unknown schedule mode, plz check again\n");
+            return AIR_E_BAD_PARAMETER;
+        }
+        for(i = 0; i < AIR_MAX_NUM_OF_PORTS; i++)
+        {
+            if(portlist[0] & (1 << i))
+            {
+                AIR_PRINT("port %d\n", i);
+                ret = air_qos_setScheduleAlgo(0, i, queue, sch_mode, weight);
+                if(AIR_E_OK == ret)
+                {
+                    AIR_PRINT("Set Port%02d Scheduler %s Success.\n", i, sche[scheduler]);
+                }
+                else
+                {
+                    AIR_PRINT("Set Port%02d Scheduler %s Fail.\n", i, sche[scheduler]);
+                }
+            }
+        }
+    }
+    else if(2 == argc)
+    {
+        queue = _strtoul(argv[1], NULL, 0);
+        for(i = 0; i < AIR_MAX_NUM_OF_PORTS; i++)
+        {
+            if(portlist[0] & (1 << i))
+            {
+                ret = air_qos_getScheduleAlgo(0, i, queue, &sch_mode, &weight);
+                if(AIR_E_OK == ret)
+                {
+                    if(sch_mode == AIR_QOS_SCH_MODE_SP)
+                        AIR_PRINT("Get Port%02d queue %d Scheduler %s\n", i, queue, sche[sch_mode]);
+                    else if((sch_mode == AIR_QOS_SCH_MODE_WRR) || (sch_mode == AIR_QOS_SCH_MODE_WFQ))
+                        AIR_PRINT("Get Port%02d queue %d Scheduler %s weight %d\n", i, queue, sche[sch_mode], weight);
+                    else
+                        AIR_PRINT("Get Port%02d queue %d Scheduler unknown\n", i, queue);
+                }
+                else
+                {
+                    AIR_PRINT("Get Port%02d queue %d Scheduler Fail.\n", i, queue);
+                }
+            }
+        }
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doQosGet(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(qosGetCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doQosSet(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(qosSetCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doQos(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(qosCmds, argc, argv);
+}
+static AIR_ERROR_NO_T
+doDiagTxComply(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T phy = 0;
+    UI32_T mode = 0;
+
+    phy = _strtoul(argv[0], NULL, 0);
+    if(2 == argc)
+    {
+        /* diag set txComply <phy(0~5)> <mode(0~8)> */
+        mode = _strtoul(argv[1], NULL, 0);
+        ret = air_diag_setTxComplyMode(0, phy, mode);
+        AIR_PRINT("Set diagnostic function: PHY %u Tx Compliance mode = %u ", phy, mode);
+    }
+    else if(1 == argc)
+    {
+        /* diag get txComply <phy(0~5)> */
+        ret = air_diag_getTxComplyMode(0, phy, &mode);
+        AIR_PRINT("Get diagnostic function: PHY %u Tx Compliance mode ", phy);
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        return AIR_E_BAD_PARAMETER;
+    }
+
+    if(AIR_E_OK == ret)
+    {
+        AIR_PRINT("Done.\n\tMode=");
+        switch(mode)
+        {
+            case AIR_DIAG_TXCOMPLY_MODE_10M_NLP:
+                AIR_PRINT("%s\n", "10M_NLP");
+                break;
+            case AIR_DIAG_TXCOMPLY_MODE_10M_RANDOM:
+                AIR_PRINT("%s\n", "10M_Random");
+                break;
+            case AIR_DIAG_TXCOMPLY_MODE_10M_SINE:
+                AIR_PRINT("%s\n", "10M_Sine");
+                break;
+            case AIR_DIAG_TXCOMPLY_MODE_100M_PAIR_A:
+                AIR_PRINT("%s\n", "100M_Pair_a");
+                break;
+            case AIR_DIAG_TXCOMPLY_MODE_100M_PAIR_B:
+                AIR_PRINT("%s\n", "100M_Pair_b");
+                break;
+            case AIR_DIAG_TXCOMPLY_MODE_1000M_TM1:
+                AIR_PRINT("%s\n", "1000M_TM1");
+                break;
+            case AIR_DIAG_TXCOMPLY_MODE_1000M_TM2:
+                AIR_PRINT("%s\n", "1000M_TM2");
+                break;
+            case AIR_DIAG_TXCOMPLY_MODE_1000M_TM3:
+                AIR_PRINT("%s\n", "1000M_TM3");
+                break;
+            case AIR_DIAG_TXCOMPLY_MODE_1000M_TM4:
+                AIR_PRINT("%s\n", "1000M_TM4");
+                break;
+            default:
+                break;
+        }
+    }
+    else
+    if(AIR_E_OTHERS == ret)
+    {
+        AIR_PRINT("isn't setting.\n");
+    }
+    else
+    {
+        AIR_PRINT("Fail.\n");
+    }
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doDiagSet(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(diagSetCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doDiagGet(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(diagGetCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doDiag(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(diagCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doLedMode(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T mode = 0;
+
+    if(1 == argc)
+    {
+        /* led set mode <mode(0:disable, 1~3:2 LED, 4:User-Define)> */
+        mode = _strtoul(argv[0], NULL, 0);
+        ret = air_led_setMode(0, 0, mode);
+        AIR_PRINT("Set LED mode ");
+    }
+    else if(0 == argc)
+    {
+        /* led get mode */
+        ret = air_led_getMode(0, 0, &mode);
+        AIR_PRINT("Get LED mode ");
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        return AIR_E_BAD_PARAMETER;
+    }
+
+    if(AIR_E_OK == ret)
+    {
+        switch(mode)
+        {
+            case AIR_LED_MODE_DISABLE:
+                AIR_PRINT(": Disabled.\n");
+                break;
+            case AIR_LED_MODE_2LED_MODE0:
+                AIR_PRINT(": LED 0:Link / LED 1:Activity.\n");
+                break;
+            case AIR_LED_MODE_2LED_MODE1:
+                AIR_PRINT(": LED 0:1000M Activity / LED 1:100M Activity.\n");
+                break;
+            case AIR_LED_MODE_2LED_MODE2:
+                AIR_PRINT(": LED 0:1000M Activity / LED 1:10&100M Activity.\n");
+                break;
+            case AIR_LED_MODE_USER_DEFINE:
+                AIR_PRINT(": User-Defined.\n");
+                break;
+            default:
+                AIR_PRINT(": Fail.\n");
+                break;
+        }
+    }
+    else
+    if(AIR_E_OTHERS == ret)
+    {
+        AIR_PRINT(": Unrecognized.\n");
+    }
+    else
+    {
+        AIR_PRINT("Fail.\n");
+    }
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doLedState(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI8_T entity = 0;
+    BOOL_T state = FALSE;
+
+    entity = _strtoul(argv[0], NULL, 0);
+    if(2 == argc)
+    {
+        /* led set state <led(0..1)> <state(1:En 0:Dis)> */
+        state = _strtoul(argv[1], NULL, 0);
+        ret = air_led_setState(0, 0, entity, state);
+        AIR_PRINT("Set LED %u state ", entity);
+    }
+    else if(1 == argc)
+    {
+        /* led get state <led(0..1)> */
+        ret = air_led_getState(0, 0, entity, &state);
+        AIR_PRINT("Get LED %u state ", entity );
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        return AIR_E_BAD_PARAMETER;
+    }
+
+    if(AIR_E_OK == ret)
+    {
+        AIR_PRINT(": %s.\n", (state)?"Enable":"Disabled");
+    }
+    else
+    if(AIR_E_OTHERS == ret)
+    {
+        AIR_PRINT(": Unrecognized.\n");
+    }
+    else
+    {
+        AIR_PRINT("Fail.\n");
+    }
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doLedUsrDef(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T i = 0;
+    UI8_T entity = 0;
+    BOOL_T polarity = LOW;
+    UI32_T on_evt_map = 0;
+    UI32_T blk_evt_map = 0;
+    AIR_LED_ON_EVT_T on_evt;
+    AIR_LED_BLK_EVT_T blk_evt;
+
+    entity = _strtoul(argv[0], NULL, 0);
+    if(4 == argc)
+    {
+        /* led set usr <led(0..1)> <polarity(0:low, 1:high)> <on_evt(7'bin)> <blink_evt(10'bin)> */
+        polarity = _strtoul(argv[1], NULL, 0);
+        on_evt_map = _strtoul(argv[2], NULL, 2);
+        blk_evt_map = _strtoul(argv[3], NULL, 2);
+
+        memset(&on_evt, 0, sizeof(AIR_LED_ON_EVT_T));
+        if(on_evt_map & BIT(0))
+        {
+            on_evt.link_1000m = TRUE;
+        }
+        if(on_evt_map & BIT(1))
+        {
+            on_evt.link_100m = TRUE;
+        }
+        if(on_evt_map & BIT(2))
+        {
+            on_evt.link_10m = TRUE;
+        }
+        if(on_evt_map & BIT(3))
+        {
+            on_evt.link_dn = TRUE;
+        }
+        if(on_evt_map & BIT(4))
+        {
+            on_evt.fdx = TRUE;
+        }
+        if(on_evt_map & BIT(5))
+        {
+            on_evt.hdx = TRUE;
+        }
+        if(on_evt_map & BIT(6))
+        {
+            on_evt.force = TRUE;
+        }
+
+        memset(&blk_evt, 0, sizeof(AIR_LED_BLK_EVT_T));
+        if(blk_evt_map & BIT(0))
+        {
+            blk_evt.tx_act_1000m = TRUE;
+        }
+        if(blk_evt_map & BIT(1))
+        {
+            blk_evt.rx_act_1000m = TRUE;
+        }
+        if(blk_evt_map & BIT(2))
+        {
+            blk_evt.tx_act_100m = TRUE;
+        }
+        if(blk_evt_map & BIT(3))
+        {
+            blk_evt.rx_act_100m = TRUE;
+        }
+        if(blk_evt_map & BIT(4))
+        {
+            blk_evt.tx_act_10m = TRUE;
+        }
+        if(blk_evt_map & BIT(5))
+        {
+            blk_evt.rx_act_10m = TRUE;
+        }
+        if(blk_evt_map & BIT(6))
+        {
+            blk_evt.cls = TRUE;
+        }
+        if(blk_evt_map & BIT(7))
+        {
+            blk_evt.rx_crc = TRUE;
+        }
+        if(blk_evt_map & BIT(8))
+        {
+            blk_evt.rx_idle = TRUE;
+        }
+        if(blk_evt_map & BIT(9))
+        {
+            blk_evt.force = TRUE;
+        }
+        ret = air_led_setUsrDef(0, 0, entity, polarity, on_evt, blk_evt);
+        AIR_PRINT("Set LED %u User-define ", entity);
+    }
+    else if(1 == argc)
+    {
+        /* led get usr <led(0..1)> */
+        ret = air_led_getUsrDef(0, 0, entity, &polarity, &on_evt, &blk_evt);
+        AIR_PRINT("Get LED %u User-define ", entity );
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        return AIR_E_BAD_PARAMETER;
+    }
+
+    if(AIR_E_OK == ret)
+    {
+        AIR_PRINT("Done.\n");
+        AIR_PRINT("Polarity:%u.\n", polarity);
+        AIR_PRINT("On Event:\n");
+        i = 6;
+        AIR_PRINT("\t(%u)Force on :%s\n", i--, (on_evt.force)?"On":"Off");
+        AIR_PRINT("\t(%u)Half Duplex :%s\n", i--, (on_evt.hdx)?"On":"Off");
+        AIR_PRINT("\t(%u)Full Duplex :%s\n", i--, (on_evt.fdx)?"On":"Off");
+        AIR_PRINT("\t(%u)Link Down :%s\n", i--, (on_evt.link_dn)?"On":"Off");
+        AIR_PRINT("\t(%u)Link 10M :%s\n", i--, (on_evt.link_10m)?"On":"Off");
+        AIR_PRINT("\t(%u)Link 100M :%s\n", i--, (on_evt.link_100m)?"On":"Off");
+        AIR_PRINT("\t(%u)Link 1000M :%s\n", i, (on_evt.link_1000m)?"On":"Off");
+
+        AIR_PRINT("Blinking Event:\n");
+        i = 9;
+        AIR_PRINT("\t(%u)Force blinks :%s\n", i--, (blk_evt.force)?"On":"Off");
+        AIR_PRINT("\t(%u)Rx Idle Error :%s\n", i--, (blk_evt.rx_idle)?"On":"Off");
+        AIR_PRINT("\t(%u)Rx CRC Error :%s\n", i--, (blk_evt.rx_crc)?"On":"Off");
+        AIR_PRINT("\t(%u)Collision :%s\n", i--, (blk_evt.cls)?"On":"Off");
+        AIR_PRINT("\t(%u)10Mbps RX Activity :%s\n", i--, (blk_evt.rx_act_10m)?"On":"Off");
+        AIR_PRINT("\t(%u)10Mbps TX Activity :%s\n", i--, (blk_evt.tx_act_10m)?"On":"Off");
+        AIR_PRINT("\t(%u)100Mbps RX Activity :%s\n", i--, (blk_evt.rx_act_100m)?"On":"Off");
+        AIR_PRINT("\t(%u)100Mbps TX Activity :%s\n", i--, (blk_evt.tx_act_100m)?"On":"Off");
+        AIR_PRINT("\t(%u)1000Mbps RX Activity :%s\n", i--, (blk_evt.rx_act_1000m)?"On":"Off");
+        AIR_PRINT("\t(%u)1000Mbps TX Activity :%s\n", i, (blk_evt.tx_act_1000m)?"On":"Off");
+    }
+    else
+    {
+        AIR_PRINT("Fail.\n");
+    }
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doLedBlkTime(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    AIR_LED_BLK_DUR_T time = 0;
+
+    if(1 == argc)
+    {
+        /* led set time <time(0~5)> */
+        time = _strtoul(argv[0], NULL, 0);
+        ret = air_led_setBlkTime(0, 0, time);
+        AIR_PRINT("Set Blinking Duration ");
+    }
+    else if(0 == argc)
+    {
+        /* led get time */
+        ret = air_led_getBlkTime(0, 0, &time);
+        AIR_PRINT("Get Blinking Duration ");
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        return AIR_E_BAD_PARAMETER;
+    }
+
+    if(AIR_E_OK == ret)
+    {
+        AIR_PRINT("Done.\n");
+        AIR_PRINT("\tBlinking duration : %u (ms)\n", (32 << time) );
+    }
+    else
+    {
+        AIR_PRINT("Fail.\n");
+    }
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doLedSet(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(ledSetCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doLedGet(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(ledGetCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doLed(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(ledCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doShowVersion(
+    UI32_T argc,
+    C8_T *argv[])
+{
+    AIR_PRINT("VERSION: %s\n", AIR_VER_SDK);
+
+    return AIR_E_OK;
+}
+
+static AIR_ERROR_NO_T
+doShow(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(showCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doStormRate(
+    UI32_T argc,
+    C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T port = 0, type = 0;
+    UI32_T unit = 0, count = 0;
+    C8_T stype[3][5] = {"Bcst", "Mcst", "Ucst"};
+    UI32_T kb = 0;
+
+    port = _strtol(argv[0], NULL, 10);
+    type = _strtol(argv[1], NULL, 10);
+    if(4 == argc)
+    {
+        count = _strtol(argv[2], NULL, 10);
+        unit = _strtol(argv[3], NULL, 10);
+
+        if(0 == unit)
+            kb = 64;
+        else if(1 == unit)
+            kb = 256;
+        else if(2 == unit)
+            kb = 1024;
+        else if(3 == unit)
+            kb = 4096;
+        else
+            kb = 16384;
+        ret = air_sec_setStormRate(0, port, type, count, unit);
+        if(AIR_E_OK == ret)
+        {
+            AIR_PRINT("Set Port%02d %s storm rate (%d * %d) = %d Kbps\n", port, stype[type], count, kb, (count*kb));
+        }
+        else
+        {
+            AIR_PRINT("Set Port%02d %s storm rate Fail.\n", port, stype[type]);
+            AIR_PRINT("Note: Port(0..4) can only select unit(0..3), port(5..6) can only select unit(4)\n");
+        }
+    }
+    else if(2 == argc)
+    {
+        ret = air_sec_getStormRate(0, port, type, &count, &unit);
+        if(AIR_E_OK == ret)
+        {
+            if(0 == unit)
+                kb = 64;
+            else if(1 == unit)
+                kb = 256;
+            else if(2 == unit)
+                kb = 1024;
+            else if(3 == unit)
+                kb = 4096;
+            else
+                kb = 16384;
+            AIR_PRINT("Port%02d %s storm rate (%d * %d) = %d Kbps\n", port, stype[type], count, kb, (count*kb));
+        }
+        else
+        {
+            AIR_PRINT("Get Port%02d %s storm rate Fail\n", port, stype[type]);
+        }
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doFldMode(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T port = 0, type = 0;
+    BOOL_T fld_en = 0;
+    C8_T stype[4][5] = {"Bcst", "Mcst", "Ucst", "Qury"};
+    C8_T sen[2][10] = {"Disable", "Enable"};
+
+    port = _strtol(argv[0], NULL, 10);
+    type = _strtol(argv[1], NULL, 10);
+
+    if(2 == argc)
+    {
+        ret = air_sec_getFldMode(0, port, type, &fld_en);
+        if(AIR_E_OK == ret)
+        {
+            AIR_PRINT("Get Port%02d flooding %s frame %s\n", port, stype[type], sen[fld_en]);
+        }
+        else
+        {
+            AIR_PRINT("Get Port%02d flooding %s frame Fail\n", port, stype[type]);
+        }
+    }
+    else if(3 == argc)
+    {
+        fld_en = _strtol(argv[2], NULL, 10);
+        ret = air_sec_setFldMode(0, port, type, fld_en);
+        if(AIR_E_OK == ret)
+        {
+            AIR_PRINT("Set Port%02d flooding %s frame %s Success\n", port, stype[type], sen[fld_en]);
+        }
+        else
+        {
+            AIR_PRINT("Set Port%02d flooding %s frame %s Fail\n", port, stype[type], sen[fld_en]);
+        }
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doStormEnable(
+    UI32_T argc,
+    C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T port = 0, type = 0;
+    BOOL_T en = 0;
+    C8_T sen[2][10] = {"Disable", "Enable"};
+    C8_T stype[3][5] = {"Bcst", "Mcst", "Ucst"};
+
+    port = _strtol(argv[0], NULL, 10);
+    type = _strtol(argv[1], NULL, 10);
+    if(3 == argc)
+    {
+        en = _strtol(argv[2], NULL, 10);
+        ret = air_sec_setStormEnable(0, port, type, en);
+        if(AIR_E_OK == ret)
+        {
+            AIR_PRINT("Set Port%02d %s storm %s Success.\n", port, stype[type], sen[en]);
+        }
+        else
+        {
+            AIR_PRINT("Set Port%02d %s storm %s Fail.\n", port, stype[type], sen[en]);
+        }
+    }
+    else if(2 == argc)
+    {
+        ret = air_sec_getStormEnable(0, port, type, &en);
+        if(AIR_E_OK == ret)
+        {
+            AIR_PRINT("Port%02d %s storm %s\n", port, stype[type], sen[en]);
+        }
+        else
+        {
+            AIR_PRINT("Get Port%02d %s storm Fail\n", port, stype[type]);
+        }
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doSaLearning(UI32_T argc, C8_T *argv[])
+{
+    UI32_T port = 0;
+    AIR_SEC_PORTSEC_PORT_CONFIG_T port_config;
+    AIR_ERROR_NO_T rc = AIR_E_OK;
+
+    port = _strtoul(argv[0], NULL, 0);
+    if(2 == argc)
+    {
+        memset(&port_config, 0, sizeof(AIR_SEC_PORTSEC_PORT_CONFIG_T));
+        rc = air_sec_getPortSecPortCfg(0, port, &port_config);
+        port_config.sa_lrn_en = _strtoul(argv[1], NULL, 0);
+        rc = air_sec_setPortSecPortCfg(0, port, port_config);
+        if(AIR_E_OK == rc)
+        {
+            AIR_PRINT("Set Port%02d sa learn %s Success.\n", port, port_config.sa_lrn_en?"Enable":"Disable");
+        }
+        else
+        {
+            AIR_PRINT("Set Port%02d sa learn %s Fail.\n", port, port_config.sa_lrn_en?"Enable":"Disable");
+        }
+    }
+    else if(1 == argc)
+    {
+        rc = air_sec_getPortSecPortCfg(0, port, &port_config);
+        if(AIR_E_OK == rc)
+        {
+            AIR_PRINT("Port%02d sa learn: %s\n", port, port_config.sa_lrn_en?"Enable":"Disable");
+        }
+        else
+        {
+            AIR_PRINT("Get Port%02d sa learn Fail\n", port);
+        }
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        rc = AIR_E_BAD_PARAMETER;
+    }
+    return rc;
+}
+
+static AIR_ERROR_NO_T
+doSaLimit(UI32_T argc, C8_T *argv[])
+{
+    UI32_T port = 0;
+    AIR_SEC_PORTSEC_PORT_CONFIG_T port_config;
+    AIR_ERROR_NO_T rc = AIR_E_OK;
+
+    port = _strtoul(argv[0], NULL, 0);
+    if(3 == argc)
+    {
+        memset(&port_config, 0, sizeof(AIR_SEC_PORTSEC_PORT_CONFIG_T));
+        rc = air_sec_getPortSecPortCfg(0, port, &port_config);
+        port_config.sa_lmt_en = _strtoul(argv[1], NULL, 0);
+        port_config.sa_lmt_cnt = _strtoul(argv[2], NULL, 0);
+        rc = air_sec_setPortSecPortCfg(0, port, port_config);
+        if(AIR_E_OK == rc)
+        {
+            AIR_PRINT("Set Port%02d sa limit %s Success.\n", port, port_config.sa_lmt_en?"Enable":"Disable");
+        }
+        else
+        {
+            AIR_PRINT("Set Port%02d sa limit %s Fail.\n", port, port_config.sa_lmt_en?"Enable":"Disable");
+        }
+    }
+    else if(1 == argc)
+    {
+        rc = air_sec_getPortSecPortCfg(0, port, &port_config);
+        if(AIR_E_OK == rc)
+        {
+            AIR_PRINT("Port%02d ", port);
+            AIR_PRINT("sa limit: %s\n", port_config.sa_lmt_en?"Enable":"Disable");
+            if(TRUE == (port_config.sa_lmt_en && (AIR_MAX_NUM_OF_MAC ==  port_config.sa_lmt_cnt)))
+            {
+                AIR_PRINT("Sa learning without limitation\n");
+            }
+            else if(TRUE == (port_config.sa_lmt_en && (AIR_MAX_NUM_OF_MAC >  port_config.sa_lmt_cnt)))
+            {
+                AIR_PRINT("Rx sa allowable learning number: %d\n", port_config.sa_lmt_cnt);
+            }
+        }
+        else
+        {
+            AIR_PRINT("Get Port%02d sa limit Fail\n", port);
+        }
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        rc = AIR_E_BAD_PARAMETER;
+    }
+
+    return rc;
+}
+
+static AIR_ERROR_NO_T
+doSecGet(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(secGetCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doSecSet(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(secSetCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doSec(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(secCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doSwitchCpuPortEn(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    BOOL_T cpu_en = FALSE;
+
+    if(0 == argc)
+    {
+        /* switch get sysPhyEn */
+        ret = air_switch_getCpuPortEn(0, &cpu_en);
+        AIR_PRINT("Get Cpu Port State ");
+        if(ret == AIR_E_OK)
+        {
+            AIR_PRINT(": %s\n", cpu_en?"Enable":"Disable");
+        }
+        else
+        {
+            AIR_PRINT("Fail!\n");
+        }
+    }
+    else if(1 == argc)
+    {
+        /* switch set sysPhyEn <phy_en> */
+        cpu_en = _strtol(argv[0], NULL, 0);
+        ret = air_switch_setCpuPortEn(0, cpu_en);
+        AIR_PRINT("Set CPU port State ");
+        if(ret == AIR_E_OK)
+        {
+            AIR_PRINT(": %s\n", cpu_en?"Enable":"Disable");
+        }
+        else
+        {
+            AIR_PRINT("Fail!\n");
+        }
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doSwitchCpuPort(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    BOOL_T cpu_en = FALSE;
+    UI32_T port = 0;
+    C8_T str_temp[AIR_MAX_NUM_OF_PORTS+1];
+
+    if(1 == argc)
+    {
+        /* switch set cpuPort <portnumber> */
+        port = _strtol(argv[0], NULL, 10);
+        ret = air_switch_setCpuPort(0, port);
+        AIR_PRINT("Set CPU Port ");
+    }
+    else if(0 == argc)
+    {
+        /* switch get cpuPort */
+        ret = air_switch_getCpuPort(0, &port);
+        AIR_PRINT("Get CPU Port ");
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    if(AIR_E_OK == ret)
+    {
+        AIR_PRINT(": %d\n", port);
+    }
+    else
+    {
+        AIR_PRINT("Fail!\n");
+    }
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doSwitchPhyLCIntrEn(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T phy = 0;
+    BOOL_T enable = FALSE;
+
+    if(2 == argc)
+    {
+        /* switch set phyLCIntrEn <phy(0..6)> <(1:En,0:Dis)> */
+        phy    = _strtol(argv[0], NULL, 10);
+        enable = _strtol(argv[1], NULL, 10);
+        ret    = air_switch_setSysIntrEn(0, (phy + AIR_SYS_INTR_TYPE_PHY0_LC), enable);
+    }
+    else if(1 == argc)
+    {
+        /* switch get phyLCIntrEn <phy(0..6)> */
+        phy = _strtol(argv[0], NULL, 10);
+        ret = air_switch_getSysIntrEn(0, (phy + AIR_SYS_INTR_TYPE_PHY0_LC), &enable);
+        AIR_PRINT("PHY(%d) LinkChange interrupt : %s\n", phy, (TRUE == enable) ? "enable" : "disable");
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doSwitchPhyLCIntrSts(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T phy = 0;
+    BOOL_T enable = FALSE;
+
+    if(2 == argc)
+    {
+        /* switch set phyLCIntrSts <phy(0..6)> <(1:En)> */
+        phy    = _strtol(argv[0], NULL, 10);
+        enable = _strtol(argv[1], NULL, 10);
+        ret    = air_switch_setSysIntrStatus(0, (phy + AIR_SYS_INTR_TYPE_PHY0_LC), enable);
+    }
+    else if(1 == argc)
+    {
+        /* switch get phyLCIntrSts <phy(0..6)> */
+        phy = _strtol(argv[0], NULL, 10);
+        ret = air_switch_getSysIntrStatus(0, (phy + AIR_SYS_INTR_TYPE_PHY0_LC), &enable);
+        AIR_PRINT("PHY(%d) LinkChange interrupt state : %s\n", phy, (TRUE == enable) ? "set" : "unset");
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        ret = AIR_E_BAD_PARAMETER;
+    }
+
+    return ret;
+}
+
+
+static AIR_ERROR_NO_T
+doSwitchSet(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(switchSetCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doSwitchGet(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(switchGetCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doSwitch(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(switchCmds, argc, argv);
+}
+
+static void _air_acl_printRuleMap(UI32_T *rule_map, UI32_T ary_num)
+{
+    UI32_T i;
+    BOOL_T first;
+
+    first = TRUE;
+    for(i=0; i<ary_num*32; i++)
+    {
+        if(rule_map[i/32] & BIT(i%32))
+        {
+            if(TRUE == first)
+            {
+                AIR_PRINT("%u", i);
+                first = FALSE;
+            }
+            else
+            {
+                AIR_PRINT(",%u", i);
+            }
+        }
+    }
+    AIR_PRINT("\n");
+}
+
+static AIR_ERROR_NO_T
+doAclEn(
+    UI32_T argc,
+    C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T argi=0;
+    UI32_T port = 0;
+    BOOL_T en = FALSE;
+
+    if(1 == argc)
+    {
+        /* acl set en <en(1:En,0:Dis)> */
+        en = _strtoul(argv[argi++], NULL, 2);
+        ret = air_acl_setGlobalState(0, en);
+        AIR_PRINT("Set Global ACL function ");
+    }
+    else if(0 == argc)
+    {
+        /* acl get en */
+        ret = air_acl_getGlobalState(0, &en);
+        AIR_PRINT("Get Global ACL function ");
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        return AIR_E_BAD_PARAMETER;
+    }
+
+    if(ret == AIR_E_OK)
+    {
+        AIR_PRINT(": %s\n", (TRUE == en)?"Enable":"Disable");
+    }
+    else
+    {
+        AIR_PRINT("Fail!\n");
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doAclRule(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T rule_idx = 0;
+    BOOL_T state = FALSE, reverse = FALSE, end = FALSE;
+    UI32_T argi = 0, ipv6 = 0, i = 0;
+    AIR_ACL_RULE_T rule;
+    UI8_T tmp_ip[16] = {0};
+    C8_T str_temp[AIR_MAX_NUM_OF_PORTS+1];
+    C8_T str[40];
+
+    memset(&rule, 0, sizeof(AIR_ACL_RULE_T));
+    if(argc >= 6)
+    {
+        /* acl set rule <idx(0..255)> <state(0:Dis,1:En)> <reverse(0:Dis,1:En)> <end(0:Dis,1:En)> <portmap(7'bin)>
+        <ipv6(0:Dis,1:En,2:Not care)>
+        [ dmac <dmac(12'hex)> <dmac_mask(12'hex)> ]
+        [ smac <smac(12'hex)> <smac_mask(12'hex)> ]
+        [ stag <stag(4'hex)> <stag_mask(4'hex)> ]
+        [ ctag <ctag(4'hex)> <ctag_mask(4'hex)> ]
+        [ etype <etype(4'hex)> <etype_mask(4'hex)> ]
+        [ dip <dip(IPADDR)> <dip_mask(IPADDR)> ]
+        [ sip <sip(IPADDR)> <sip_mask(IPADDR)> ]
+        [ dscp <dscp(2'hex)> <dscp_mask(2'hex)> ]
+        [ protocol <protocol(2'hex)> <protocol_mask(2'hex)> ]
+        [ dport <dport(4'hex)> <dport_mask(4'hex)> ]
+        [ sport <sport(4'hex)> <sport_mask(4'hex)> ]
+        [ flow_label <flow_label(4'hex)> <flow_label_mask(4'hex)> ]
+        [ udf <udf(4'hex)> <udf_mask(4'hex)> ] */
+
+        rule_idx = _strtoul(argv[argi++], NULL, 0);
+
+        rule.ctrl.rule_en = _strtoul(argv[argi++], NULL, 0);
+        rule.ctrl.reverse = _strtoul(argv[argi++], NULL, 0);
+        rule.ctrl.end = _strtoul(argv[argi++], NULL, 0);
+
+        rule.key.portmap = _strtoul(argv[argi++], NULL, 2);
+        rule.mask.portmap = (~rule.key.portmap) & AIR_ALL_PORT_BITMAP;
+
+        ipv6 = _strtoul(argv[argi++], NULL, 0);
+        if(0 == ipv6)
+        {
+            rule.key.isipv6 = FALSE;
+            rule.mask.isipv6 = TRUE;
+        }
+        else if(1 == ipv6)
+        {
+            rule.key.isipv6 = TRUE;
+            rule.mask.isipv6 = TRUE;
+        }
+        else
+        {
+            rule.mask.isipv6 = FALSE;
+        }
+
+        if((argi < argc) && (0 == _strcmp(argv[argi], "dmac")))
+        {
+            argi++;
+            _str2mac(argv[argi++], rule.key.dmac);
+            _str2mac(argv[argi++], rule.mask.dmac);
+            rule.key.fieldmap |= 1 << AIR_ACL_DMAC;
+        }
+        if((argi < argc) && (0 == _strcmp(argv[argi], "smac")))
+        {
+            argi++;
+            _str2mac(argv[argi++], rule.key.smac);
+            _str2mac(argv[argi++], rule.mask.smac);
+            rule.key.fieldmap |= 1 << AIR_ACL_SMAC;
+        }
+
+        if((argi < argc) && (0 == _strcmp(argv[argi], "stag")))
+        {
+            argi++;
+            rule.key.stag = _strtoul(argv[argi++], NULL, 16);
+            rule.mask.stag = _strtoul(argv[argi++], NULL, 16);
+            rule.key.fieldmap |= 1 << AIR_ACL_STAG;
+        }
+
+        if((argi < argc) && (0 == _strcmp(argv[argi], "ctag")))
+        {
+            argi++;
+            rule.key.ctag = _strtoul(argv[argi++], NULL, 16);
+            rule.mask.ctag = _strtoul(argv[argi++], NULL, 16);
+            rule.key.fieldmap |= 1 << AIR_ACL_CTAG;
+        }
+
+        if((argi < argc) && (0 == _strcmp(argv[argi], "etype")))
+        {
+            argi++;
+            rule.key.etype= _strtoul(argv[argi++], NULL, 16);
+            rule.mask.etype = _strtoul(argv[argi++], NULL, 16);
+            rule.key.fieldmap |= 1 << AIR_ACL_ETYPE;
+        }
+
+        if((argi < argc) && (0 == _strcmp(argv[argi], "dip")))
+        {
+            argi++;
+            if(0 == ipv6)
+            {
+                _str2ipv4(argv[argi++], rule.key.dip);
+                _str2ipv4(argv[argi++], rule.mask.dip);
+            }
+            else if(1 == ipv6)
+            {
+                _str2ipv6(argv[argi++], tmp_ip);
+                rule.key.dip[3] = (tmp_ip[0]<<24) | (tmp_ip[1]<<16) | (tmp_ip[2]<<8) | tmp_ip[3];
+                rule.key.dip[2] = (tmp_ip[4]<<24) | (tmp_ip[5]<<16) | (tmp_ip[6]<<8) | tmp_ip[7];
+                rule.key.dip[1] = (tmp_ip[8]<<24) | (tmp_ip[9]<<16) | (tmp_ip[10]<<8) | tmp_ip[11];
+                rule.key.dip[0] = (tmp_ip[12]<<24) | (tmp_ip[13]<<16) | (tmp_ip[14]<<8) | tmp_ip[15];
+                _str2ipv6(argv[argi++], tmp_ip);
+                rule.mask.dip[3] = (tmp_ip[0]<<24) | (tmp_ip[1]<<16) | (tmp_ip[2]<<8) | tmp_ip[3];
+                rule.mask.dip[2] = (tmp_ip[4]<<24) | (tmp_ip[5]<<16) | (tmp_ip[6]<<8) | tmp_ip[7];
+                rule.mask.dip[1] = (tmp_ip[8]<<24) | (tmp_ip[9]<<16) | (tmp_ip[10]<<8) | tmp_ip[11];
+                rule.mask.dip[0] = (tmp_ip[12]<<24) | (tmp_ip[13]<<16) | (tmp_ip[14]<<8) | tmp_ip[15];
+            }
+            rule.key.fieldmap |= 1 << AIR_ACL_DIP;
+        }
+
+        if((argi < argc) && (0 == _strcmp(argv[argi], "sip")))
+        {
+            argi++;
+            if(0 == ipv6)
+            {
+                _str2ipv4(argv[argi++], rule.key.sip);
+                _str2ipv4(argv[argi++], rule.mask.sip);
+            }
+            else if(1 == ipv6)
+            {
+                _str2ipv6(argv[argi++], tmp_ip);
+                rule.key.sip[3] = (tmp_ip[0]<<24) | (tmp_ip[1]<<16) | (tmp_ip[2]<<8) | tmp_ip[3];
+                rule.key.sip[2] = (tmp_ip[4]<<24) | (tmp_ip[5]<<16) | (tmp_ip[6]<<8) | tmp_ip[7];
+                rule.key.sip[1] = (tmp_ip[8]<<24) | (tmp_ip[9]<<16) | (tmp_ip[10]<<8) | tmp_ip[11];
+                rule.key.sip[0] = (tmp_ip[12]<<24) | (tmp_ip[13]<<16) | (tmp_ip[14]<<8) | tmp_ip[15];
+                _str2ipv6(argv[argi++], tmp_ip);
+                rule.mask.sip[3] = (tmp_ip[0]<<24) | (tmp_ip[1]<<16) | (tmp_ip[2]<<8) | tmp_ip[3];
+                rule.mask.sip[2] = (tmp_ip[4]<<24) | (tmp_ip[5]<<16) | (tmp_ip[6]<<8) | tmp_ip[7];
+                rule.mask.sip[1] = (tmp_ip[8]<<24) | (tmp_ip[9]<<16) | (tmp_ip[10]<<8) | tmp_ip[11];
+                rule.mask.sip[0] = (tmp_ip[12]<<24) | (tmp_ip[13]<<16) | (tmp_ip[14]<<8) | tmp_ip[15];
+            }
+            rule.key.fieldmap |= 1 << AIR_ACL_SIP;
+        }
+
+        if((argi < argc) && (0 == _strcmp(argv[argi], "dscp")))
+        {
+            argi++;
+            rule.key.dscp = _strtoul(argv[argi++], NULL, 16);
+            rule.mask.dscp = _strtoul(argv[argi++], NULL, 16);
+            rule.key.fieldmap |= 1 << AIR_ACL_DSCP;
+        }
+
+        if((argi < argc) && (0 == _strcmp(argv[argi], "protocol")))
+        {
+            argi++;
+            rule.key.protocol = _strtoul(argv[argi++], NULL, 16);
+            rule.mask.protocol = _strtoul(argv[argi++], NULL, 16);
+            rule.key.fieldmap |= 1 << AIR_ACL_PROTOCOL;
+        }
+
+        if((argi < argc) && (0 == _strcmp(argv[argi], "dport")))
+        {
+            argi++;
+            rule.key.dport = _strtoul(argv[argi++], NULL, 16);
+            rule.mask.dport = _strtoul(argv[argi++], NULL, 16);
+            rule.key.fieldmap |= 1 << AIR_ACL_DPORT;
+        }
+
+        if((argi < argc) && (0 == _strcmp(argv[argi], "sport")))
+        {
+            argi++;
+            rule.key.sport = _strtoul(argv[argi++], NULL, 16);
+            rule.mask.sport = _strtoul(argv[argi++], NULL, 16);
+            rule.key.fieldmap |= 1 << AIR_ACL_SPORT;
+        }
+
+        if((argi < argc) && (0 == _strcmp(argv[argi], "flow_label")))
+        {
+            argi++;
+            rule.key.flow_label= _strtoul(argv[argi++], NULL, 16);
+            rule.mask.flow_label= _strtoul(argv[argi++], NULL, 16);
+            rule.key.fieldmap |= 1 << AIR_ACL_FLOW_LABEL;
+        }
+
+        if((argi < argc) && (0 == _strcmp(argv[argi], "udf")))
+        {
+            argi++;
+            rule.key.udf = _strtoul(argv[argi++], NULL, 16);
+            rule.mask.udf = _strtoul(argv[argi++], NULL, 16);
+            rule.key.fieldmap |= 1 << AIR_ACL_UDF;
+        }
+        rule.mask.fieldmap = rule.key.fieldmap;
+        ret = air_acl_setRule(0, rule_idx, &rule);
+        if(ret < AIR_E_LAST)
+            AIR_PRINT("Set ACL Rule(%u): %s\n", rule_idx, air_error_getString(ret));
+    }
+    else if(1 == argc)
+    {
+        rule_idx = _strtoul(argv[0], NULL, 0);
+        ret = air_acl_getRule(0, rule_idx, &rule);
+        if(ret < AIR_E_LAST)
+            AIR_PRINT("Get ACL Rule(%u): %s\n", rule_idx, air_error_getString(ret));
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        return AIR_E_BAD_PARAMETER;
+    }
+
+    if(AIR_E_OK == ret)
+    {
+        if(TRUE == rule.ctrl.rule_en)
+        {
+            AIR_PRINT("\t Rule end          : %s\n", (TRUE == rule.ctrl.end)?"Enable":"Disable");
+            AIR_PRINT("\t Rule reverse      : %s\n", (TRUE == rule.ctrl.reverse)?"Enable":"Disable");
+            _hex2bitstr((~rule.mask.portmap) & AIR_ALL_PORT_BITMAP, str_temp, AIR_MAX_NUM_OF_PORTS+1);
+            AIR_PRINT("\t Portmap[0:6]      : %s\n", str_temp);
+            for(i = AIR_ACL_DMAC; i < AIR_ACL_FIELD_TYPE_LAST; i++)
+            {
+                if((1 << i) & rule.mask.fieldmap)
+                {
+                    switch (i)
+                    {
+                        case AIR_ACL_DMAC:
+                            AIR_PRINT("\t dmac: ");
+                            AIR_PRINT("%02x-%02x-%02x-%02x-%02x-%02x",
+                            rule.key.dmac[0], rule.key.dmac[1], rule.key.dmac[2],
+                            rule.key.dmac[3], rule.key.dmac[4], rule.key.dmac[5]);
+                            AIR_PRINT(", dmac-mask: ");
+                            AIR_PRINT("%02x-%02x-%02x-%02x-%02x-%02x\n",
+                            rule.mask.dmac[0], rule.mask.dmac[1], rule.mask.dmac[2],
+                            rule.mask.dmac[3], rule.mask.dmac[4], rule.mask.dmac[5]);
+                            break;
+                        case AIR_ACL_SMAC:
+                            AIR_PRINT("\t smac: ");
+                            AIR_PRINT("%02x-%02x-%02x-%02x-%02x-%02x",
+                            rule.key.smac[0], rule.key.smac[1], rule.key.smac[2],
+                            rule.key.smac[3], rule.key.smac[4], rule.key.smac[5]);
+                            AIR_PRINT(", smac-mask: ");
+                            AIR_PRINT("%02x-%02x-%02x-%02x-%02x-%02x\n",
+                            rule.mask.smac[0], rule.mask.smac[1], rule.mask.smac[2],
+                            rule.mask.smac[3], rule.mask.smac[4], rule.mask.smac[5]);
+                            break;
+                        case AIR_ACL_ETYPE:
+                            AIR_PRINT("\t etype: 0x%x, etype-mask: 0x%x\n", rule.key.etype, rule.mask.etype);
+                            break;
+                        case AIR_ACL_STAG:
+                            AIR_PRINT("\t stag: 0x%x, stag-mask: 0x%x\n", rule.key.stag, rule.mask.stag);
+                            break;
+                        case AIR_ACL_CTAG:
+                            AIR_PRINT("\t ctag: 0x%x, ctag-mask: 0x%x\n", rule.key.ctag, rule.mask.ctag);
+                            break;
+                        case AIR_ACL_DPORT:
+                            AIR_PRINT("\t dport: 0x%x, dport-mask: 0x%x\n", rule.key.dport, rule.mask.dport);
+                            break;
+                        case AIR_ACL_SPORT:
+                            AIR_PRINT("\t sport: 0x%x, sport-mask: 0x%x\n", rule.key.sport, rule.mask.sport);
+                            break;
+                        case AIR_ACL_UDF:
+                            AIR_PRINT("\t udf: 0x%x, udf-mask: 0x%x\n", rule.key.udf, rule.mask.udf);
+                            break;
+                        case AIR_ACL_DIP:
+                            if (0 == rule.key.isipv6)
+                            {
+                                AIR_PRINT("\t dip: ");
+                                AIR_PRINT("%d.%d.%d.%d",
+                                ((rule.key.dip[0])&0xFF000000)>>24,((rule.key.dip[0])&0x00FF0000)>>16,
+                                ((rule.key.dip[0])&0x0000FF00)>>8, ((rule.key.dip[0])&0x000000FF));
+                                AIR_PRINT(", dip-mask: ");
+                                AIR_PRINT("%d.%d.%d.%d\n ",
+                                ((rule.mask.dip[0])&0xFF000000)>>24,((rule.mask.dip[0])&0x00FF0000)>>16,
+                                ((rule.mask.dip[0])&0x0000FF00)>>8, ((rule.mask.dip[0])&0x000000FF));
+                            }
+                            else
+                            {
+                                for(i=0; i<4; i++){
+                                    tmp_ip[i] = (rule.key.dip[3] >> (8*(3-i))) & 0xff;
+                                    AIR_PRINT("get tmp_ip[%d]=0x%x\n", i, tmp_ip[i]);
+                                }
+                                for(i=4; i<8; i++){
+                                    tmp_ip[i] = (rule.key.dip[2] >> (8*(7-i))) & 0xff;
+                                }
+                                for(i=8; i<12; i++){
+                                    tmp_ip[i] = (rule.key.dip[1] >> (8*(11-i))) & 0xff;
+                                }
+                                for(i=12; i<16; i++){
+                                    tmp_ip[i] = (rule.key.dip[0] >> (8*(15-i))) & 0xff;
+                                }
+
+                                AIR_PRINT("\t dip: ");
+                                AIR_PRINT("%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x",
+                                    tmp_ip[0], tmp_ip[1],tmp_ip[2], tmp_ip[3],tmp_ip[4], tmp_ip[5],tmp_ip[6], tmp_ip[7],
+                                    tmp_ip[8], tmp_ip[9],tmp_ip[10], tmp_ip[11],tmp_ip[12], tmp_ip[13],tmp_ip[14], tmp_ip[15]);
+                                for(i=0; i<4; i++){
+                                    tmp_ip[i] = (rule.mask.dip[3] >> (8*(3-i))) & 0xff;
+                                }
+                                for(i=4; i<8; i++){
+                                    tmp_ip[i] = (rule.mask.dip[2] >> (8*(7-i))) & 0xff;
+                                }
+                                for(i=8; i<12; i++){
+                                    tmp_ip[i] = (rule.mask.dip[1] >> (8*(11-i))) & 0xff;
+                                }
+                                for(i=12; i<16; i++){
+                                    tmp_ip[i] = (rule.mask.dip[0] >> (8*(15-i))) & 0xff;
+                                }
+                                AIR_PRINT(", dip-mask: ");
+                                AIR_PRINT("%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x\n",
+                                    tmp_ip[0], tmp_ip[1],tmp_ip[2], tmp_ip[3],tmp_ip[4], tmp_ip[5],tmp_ip[6], tmp_ip[7],
+                                    tmp_ip[8], tmp_ip[9],tmp_ip[10], tmp_ip[11],tmp_ip[12], tmp_ip[13],tmp_ip[14], tmp_ip[15]);
+                            }
+                            break;
+                        case AIR_ACL_SIP:
+                            if (0 == rule.key.isipv6)
+                            {
+                                AIR_PRINT("\t sip: ");
+                                AIR_PRINT("%d.%d.%d.%d ",
+                                ((rule.key.sip[0])&0xFF000000)>>24,((rule.key.sip[0])&0x00FF0000)>>16,
+                                ((rule.key.sip[0])&0x0000FF00)>>8, ((rule.key.sip[0])&0x000000FF));
+                                AIR_PRINT(", sip-mask: ");
+                                AIR_PRINT("%d.%d.%d.%d\n ",
+                                ((rule.mask.sip[0])&0xFF000000)>>24,((rule.mask.sip[0])&0x00FF0000)>>16,
+                                ((rule.mask.sip[0])&0x0000FF00)>>8, ((rule.mask.sip[0])&0x000000FF));
+                            }
+                            else
+                            {
+                                for(i=0; i<4; i++){
+                                    tmp_ip[i] = (rule.key.sip[3] >> (8*(3-i))) & 0xff;
+                                }
+                                for(i=4; i<8; i++){
+                                    tmp_ip[i] = (rule.key.sip[2] >> (8*(7-i))) & 0xff;
+                                }
+                                for(i=8; i<12; i++){
+                                    tmp_ip[i] = (rule.key.sip[1] >> (8*(11-i))) & 0xff;
+                                }
+                                for(i=12; i<16; i++){
+                                    tmp_ip[i] = (rule.key.sip[0] >> (8*(15-i))) & 0xff;
+                                }
+                                AIR_PRINT("\t sip: ");
+                                AIR_PRINT("%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x",
+                                    tmp_ip[0], tmp_ip[1],tmp_ip[2], tmp_ip[3],tmp_ip[4], tmp_ip[5],tmp_ip[6], tmp_ip[7],
+                                    tmp_ip[8], tmp_ip[9],tmp_ip[10], tmp_ip[11],tmp_ip[12], tmp_ip[13],tmp_ip[14], tmp_ip[15]);
+                                for(i=0; i<4; i++){
+                                    tmp_ip[i] = (rule.mask.sip[3] >> (8*(3-i))) & 0xff;
+                                }
+                                for(i=4; i<8; i++){
+                                    tmp_ip[i] = (rule.mask.sip[2] >> (8*(7-i))) & 0xff;
+                                }
+                                for(i=8; i<12; i++){
+                                    tmp_ip[i] = (rule.mask.sip[1] >> (8*(11-i))) & 0xff;
+                                }
+                                for(i=12; i<16; i++){
+                                    tmp_ip[i] = (rule.mask.sip[0] >> (8*(15-i))) & 0xff;
+                                }
+                                AIR_PRINT(", sip-mask: ");
+                                AIR_PRINT("%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x\n",
+                                    tmp_ip[0], tmp_ip[1],tmp_ip[2], tmp_ip[3],tmp_ip[4], tmp_ip[5],tmp_ip[6], tmp_ip[7],
+                                    tmp_ip[8], tmp_ip[9],tmp_ip[10], tmp_ip[11],tmp_ip[12], tmp_ip[13],tmp_ip[14], tmp_ip[15]);
+                            }
+                            break;
+                        case AIR_ACL_DSCP:
+                            AIR_PRINT("\t dscp: 0x%x, dscp-mask: 0x%x\n", rule.key.dscp, rule.mask.dscp);
+                            break;
+                        case AIR_ACL_PROTOCOL:
+                            AIR_PRINT("\t protocol: 0x%x, protocol-mask: 0x%x\n", rule.key.protocol, rule.mask.protocol);
+                            break;
+                        case AIR_ACL_FLOW_LABEL:
+                            AIR_PRINT("\t flow-label: 0x%x, flow-label-mask: 0x%x\n", rule.key.flow_label, rule.mask.flow_label);
+                            break;
+                        default:
+                            AIR_PRINT("error\n");
+                            break;
+                    }
+                }
+            }
+        }
+        else
+        {
+            AIR_PRINT("Entry is Invalid.\n");
+        }
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doAclRmvRule(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T rule_idx = 0;
+
+    if(1 == argc)
+    {
+        /* acl del rule <idx(0..127)> */
+        rule_idx = _strtoul(argv[0], NULL, 0);
+        ret = air_acl_delRule(0, rule_idx);
+        if(ret < AIR_E_LAST)
+            AIR_PRINT("Delete ACL Rule(%u): %s\n", rule_idx, air_error_getString(ret));
+    }
+    else if(0 == argc)
+    {
+        /* acl clear rule */
+        ret = air_acl_clearRule(0);
+        if(ret < AIR_E_LAST)
+            AIR_PRINT("Clear ACL Rule: %s\n", air_error_getString(ret));
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        return AIR_E_BAD_PARAMETER;
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doAclUdfRule(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T rule_idx;
+    AIR_ACL_UDF_RULE_T rule;
+    C8_T start_addr[8][12]=
+    {
+        "MAC header",
+        "L2 payload",
+        "IPv4 header",
+        "IPv6 header",
+        "L3 payload",
+        "TCP header",
+        "UDP header",
+        "L4 payload"
+    };
+    C8_T str_temp[AIR_MAX_NUM_OF_PORTS+1];
+
+    memset(&rule, 0, sizeof(AIR_ACL_UDF_RULE_T));
+    if(7 == argc)
+    {
+        /* acl set rule <idx(0..255)> <mode(0:pattern, 1:threshold)> [ <pat(4'hex)> <mask(4'hex)> | <low(4'hex)> <high(4'hex)> ] <start(0:MAC,1:ether,2:IP,3:IP_data,4:TCP/UDP,5:TCP/UDP data,6:IPv6)> <offset(0..62,unit:2 bytes)> <portmap(7'bin)> */
+        rule_idx = _strtoul(argv[0], NULL, 0);
+        rule.cmp_sel = _strtoul(argv[1], NULL, 2);
+        if(AIR_ACL_RULE_CMP_SEL_PATTERN == rule.cmp_sel)
+        {
+            rule.pattern = _strtoul(argv[2], NULL, 16);
+            rule.mask = _strtoul(argv[3], NULL, 16);
+        }
+        else
+        {
+            rule.low_threshold = _strtoul(argv[2], NULL, 16);
+            rule.high_threshold = _strtoul(argv[3], NULL, 16);
+        }
+        rule.offset_format = _strtoul(argv[4], NULL, 0);
+        rule.offset = _strtoul(argv[5], NULL, 0);
+        rule.portmap = _strtoul(argv[6], NULL, 2);
+        rule.valid = TRUE;
+        ret = air_acl_setUdfRule(0, rule_idx, rule);
+        if(ret < AIR_E_LAST)
+            AIR_PRINT("Set ACL UDF Rule(%u): %s\n", rule_idx, air_error_getString(ret));
+    }
+    else if(1 == argc)
+    {
+        rule_idx = _strtoul(argv[0], NULL, 0);
+        ret = air_acl_getUdfRule(0, rule_idx, &rule);
+        if(ret < AIR_E_LAST)
+            AIR_PRINT("Get ACL UDF Rule(%u): %s\n", rule_idx, air_error_getString(ret));
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        return AIR_E_BAD_PARAMETER;
+    }
+
+    if(AIR_E_OK == ret)
+    {
+        if(TRUE == rule.valid)
+        {
+            AIR_PRINT("\tMode          : %s\n", (AIR_ACL_RULE_CMP_SEL_PATTERN == rule.cmp_sel)?"Pattern":"Threshold");
+            if(AIR_ACL_RULE_CMP_SEL_PATTERN == rule.cmp_sel)
+            {
+                AIR_PRINT("\tPattern       : 0x%04X\n", rule.pattern);
+                AIR_PRINT("\tMask          : 0x%04X\n", rule.mask);
+            }
+            else
+            {
+                AIR_PRINT("\tLow Threshold : 0x%04X\n", rule.low_threshold);
+                AIR_PRINT("\tHigh Threshold: 0x%04X\n", rule.high_threshold);
+            }
+            AIR_PRINT("\tOffset Start  : %s\n", start_addr[rule.offset_format]);
+            AIR_PRINT("\tOffset        : %u %s\n", rule.offset*2, (0==rule.offset)?"Byte":"Bytes");
+            _hex2bitstr(rule.portmap, str_temp, AIR_MAX_NUM_OF_PORTS+1);
+            AIR_PRINT("\tPortmap[0:6]  : %s\n", str_temp);
+        }
+        else
+        {
+            AIR_PRINT("Entry is Invalid.\n");
+        }
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doAclRmvUdfRule(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T rule_idx;
+
+    if(1 == argc)
+    {
+        /* acl del udfRule <idx(0..15)> */
+        rule_idx = _strtoul(argv[0], NULL, 0);
+        ret = air_acl_delUdfRule(0, rule_idx);
+        if(ret < AIR_E_LAST)
+            AIR_PRINT("Delete ACL UDF Rule(%u): %s\n", rule_idx, air_error_getString(ret));
+    }
+    else if(0 == argc)
+    {
+        /* acl clear udfRule */
+        ret = air_acl_clearUdfRule(0);
+        if(ret < AIR_E_LAST)
+            AIR_PRINT("Clear ACL UDF Rule: %s\n", air_error_getString(ret));
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        return AIR_E_BAD_PARAMETER;
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doAclAction(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T argi = 0;
+    UI32_T act_idx;
+    AIR_ACL_ACTION_T act;
+    UI32_T redirect, trtcm, fwd;
+    C8_T fwding[AIR_ACL_ACT_FWD_LAST][25] =
+    {
+        "Default",
+        "Default",
+        "Default",
+        "Default",
+        "Default & CPU excluded",
+        "Default & CPU included",
+        "CPU only",
+        "Drop"
+    };
+    C8_T trtcm_usr[AIR_ACL_ACT_USR_TCM_LAST][8] =
+    {
+        "Default",
+        "Green",
+        "Yellow",
+        "Red"
+    };
+    C8_T egtag[AIR_ACL_ACT_EGTAG_LAST][11] =
+    {
+        "Default",
+        "Consistent",
+        "",
+        "",
+        "Untag",
+        "Swap",
+        "Tag",
+        "Stack"
+    };
+    C8_T str_temp[20];
+
+    memset(&act, 0, sizeof(AIR_ACL_ACTION_T));
+    if(2 < argc)
+    {
+        /* acl set action <idx(0..127)>
+        [ forward <forward(0:Default,4:Exclude CPU,5:Include CPU,6:CPU only,7:Drop)> ]
+        [ egtag <egtag(0:Default,1:Consistent,4:Untag,5:Swap,6:Tag,7:Stack)> ]
+        [ mirrormap <mirrormap(2'bin)> ]
+        [ priority <priority(0..7)> ]
+        [ redirect <redirect(0:Dst,1:Vlan)> <portmap(7'bin)> ]
+        [ leaky_vlan <leaky_vlan(1:En,0:Dis)> ]
+        [ cnt_idx <cnt_idx(0..63)> ]
+        [ rate_idx <rate_idx(0..31)> ]
+        [ attack_idx <attack_idx(0..95)> ]
+        [ vid <vid(0..4095)> ]
+        [ manage <manage(1:En,0:Dis)> ]
+        [ bpdu <bpdu(1:En,0:Dis)> ]
+        [ class <class(0:Original,1:Defined)>[0..7] ]
+        [ drop_pcd <drop_pcd(0:Original,1:Defined)> [red <red(0..7)>][yellow <yellow(0..7)>][green <green(0..7)>] ]
+        [ color <color(0:Defined,1:Trtcm)> [ <defined_color(0:Dis,1:Green,2:Yellow,3:Red)> | <trtcm_idx(0..31)> ] ]*/
+
+        act_idx = _strtoul(argv[argi++], NULL, 0);
+        if((argi < argc) && (0 == _strcmp(argv[argi], "forward")))
+        {
+            argi++;
+            fwd = _strtoul(argv[argi++], NULL, 0);
+            act.fwd_en = TRUE;
+            act.fwd = fwd;
+        }
+
+        if((argi < argc) && (0 == _strcmp(argv[argi], "egtag")))
+        {
+            argi++;
+            act.egtag_en = TRUE;
+            act.egtag = _strtoul(argv[argi++], NULL, 0);
+        }
+
+        if((argi < argc) && (0 == _strcmp(argv[argi], "mirrormap")))
+        {
+            argi++;
+            act.mirrormap = _strtoul(argv[argi++], NULL, 2);
+        }
+
+        if((argi < argc) && (0 == _strcmp(argv[argi], "priority")))
+        {
+            argi++;
+            act.pri_user_en = TRUE;
+            act.pri_user= _strtoul(argv[argi++], NULL, 0);
+        }
+
+        if((argi < argc) && (0 == _strcmp(argv[argi], "redirect")))
+        {
+            argi++;
+            redirect = _strtoul(argv[argi++], NULL, 0);
+            if(0 ==  redirect)
+            {
+                act.port_en = TRUE;
+                act.dest_port_sel = TRUE;
+                act.portmap = _strtoul(argv[argi++], NULL, 2);
+            }
+            else
+            {
+                act.port_en = TRUE;
+                act.vlan_port_sel = TRUE;
+                act.portmap = _strtoul(argv[argi++], NULL, 2);
+            }
+        }
+
+        if((argi < argc) && (0 == _strcmp(argv[argi], "leaky_vlan")))
+        {
+            argi++;
+            act.lyvlan_en = TRUE;
+            act.lyvlan = _strtoul(argv[argi++], NULL, 0);
+        }
+
+        /* ACL event counter */
+        if((argi < argc) && (0 == _strcmp(argv[argi], "cnt_idx")))
+        {
+            argi++;
+            act.cnt_en = TRUE;
+            act.cnt_idx = _strtol(argv[argi++], NULL, 0);
+        }
+
+        if((argi < argc) && (0 == _strcmp(argv[argi], "rate_idx")))
+        {
+            argi++;
+            act.rate_en = TRUE;
+            act.rate_idx = _strtol(argv[argi++], NULL, 0);
+        }
+
+        if((argi < argc) && (0 == _strcmp(argv[argi], "attack_idx")))
+        {
+            argi++;
+            act.attack_en = TRUE;
+            act.attack_idx = _strtol(argv[argi++], NULL, 0);
+        }
+
+        if((argi < argc) && (0 == _strcmp(argv[argi], "vid")))
+        {
+            argi++;
+            act.vlan_en = TRUE;
+            act.vlan_idx = _strtol(argv[argi++], NULL, 0);
+        }
+
+        /* Management frame */
+        if((argi < argc) && (0 == _strcmp(argv[argi], "manage")))
+        {
+            argi++;
+            act.mang = _strtoul(argv[argi++], NULL, 2);
+        }
+
+        if((argi < argc) && (0 == _strcmp(argv[argi], "bpdu")))
+        {
+            argi++;
+            act.bpdu = _strtoul(argv[argi++], NULL, 2);
+        }
+
+        /* DSCP class remap */
+        if((argi < argc) && (0 == _strcmp(argv[argi], "class")))
+        {
+            argi++;
+            act.trtcm_en = TRUE;
+            act.trtcm.cls_slr_sel = _strtoul(argv[argi++], NULL, 2);
+            if(TRUE == act.trtcm.cls_slr_sel)
+            {
+                act.trtcm.cls_slr = _strtoul(argv[argi++], NULL, 0);
+            }
+        }
+        if((argi < argc) && (0 == _strcmp(argv[argi], "drop_pcd")))
+        {
+            argi++;
+            act.trtcm_en = TRUE;
+            act.trtcm.drop_pcd_sel = _strtoul(argv[argi++], NULL, 2);
+            if(TRUE == act.trtcm.drop_pcd_sel)
+            {
+                if(0 == _strcmp(argv[argi], "red"))
+                {
+                    argi++;
+                    act.trtcm.drop_pcd_r= _strtoul(argv[argi++], NULL, 0);
+                }
+                if(0 == _strcmp(argv[argi], "yellow"))
+                {
+                    argi++;
+                    act.trtcm.drop_pcd_y= _strtoul(argv[argi++], NULL, 0);
+                }
+                if(0 == _strcmp(argv[argi], "green"))
+                {
+                    argi++;
+                    act.trtcm.drop_pcd_g= _strtoul(argv[argi++], NULL, 0);
+                }
+            }
+        }
+
+        /* trTCM */
+        if((argi < argc) && (0 == _strcmp(argv[argi], "color")))
+        {
+            argi++;
+            act.trtcm_en = TRUE;
+            act.trtcm.tcm_sel = _strtoul(argv[argi++], NULL, 2);
+            trtcm = _strtoul(argv[argi++], NULL, 0);
+            if(FALSE == act.trtcm.tcm_sel)
+            {
+                act.trtcm.usr_tcm = trtcm;
+            }
+            else
+            {
+                act.trtcm.tcm_idx = trtcm;
+            }
+        }
+        ret = air_acl_setAction(0, act_idx, act);
+        AIR_PRINT("Set ACL Action(%u): %s\n", act_idx, air_error_getString(ret));
+    }
+    else if(1 == argc)
+    {
+        /* acl get action <idx(0..127)> */
+        act_idx = _strtoul(argv[argi++], NULL, 0);
+        ret = air_acl_getAction(0, act_idx, &act);
+        AIR_PRINT("Get ACL Action(%u): %s\n", act_idx, air_error_getString(ret));
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        return AIR_E_BAD_PARAMETER;
+    }
+
+    if(AIR_E_OK == ret)
+    {
+        if(TRUE == act.fwd_en)
+        {
+            AIR_PRINT("\t Forwarding           : %s\n", fwding[act.fwd]);
+        }
+
+        if(TRUE == act.egtag_en)
+        {
+            AIR_PRINT("\t Egress tag           : %s\n", egtag[act.egtag]);
+        }
+
+        if(act.mirrormap)
+        {
+            AIR_PRINT("\t Mirror Session Map   : %u\n", act.mirrormap);
+        }
+
+        if(TRUE == act.pri_user_en)
+        {
+            AIR_PRINT("\t User Priority        : %u\n", act.pri_user);
+        }
+
+        if(TRUE == act.port_en)
+        {
+            _hex2bitstr(act.portmap, str_temp, AIR_MAX_NUM_OF_PORTS+1);
+            if(TRUE == act.dest_port_sel)
+            {
+                AIR_PRINT("\t Destination Port[0:6]: %s\n", str_temp);
+            }
+            else
+            {
+                AIR_PRINT("\t VLAN Port[0:6]       : %s\n", str_temp);
+            }
+        }
+
+        if(TRUE == act.lyvlan_en)
+        {
+            AIR_PRINT("\t Leaky VLAN           : %s\n", (TRUE == act.lyvlan)?"Enable":"Disable");
+        }
+        AIR_PRINT("\t Management Frame     : %s\n", (TRUE == act.mang)?"Enable":"Disable");
+        AIR_PRINT("\t BPDU Frame           : %s\n", (TRUE == act.bpdu)?"Enable":"Disable");
+
+        if(TRUE == act.cnt_en)
+        {
+            AIR_PRINT("\t Event Index          : %u\n", act.cnt_idx);
+        }
+
+        /* trTCM*/
+        if(TRUE == act.trtcm_en)
+        {
+            if(TRUE == act.trtcm.cls_slr_sel)
+            {
+                AIR_PRINT("\t Class Selector Remap : %u\n", act.trtcm.cls_slr);
+            }
+            else
+            {
+                AIR_PRINT("\t Class Selector Remap : %s\n", "Disable");
+            }
+            if(TRUE == act.trtcm.drop_pcd_sel)
+            {
+                AIR_PRINT("\t Drop Precedence Remap(Red): %u\n", act.trtcm.drop_pcd_r);
+                AIR_PRINT("\t Drop Precedence Remap(Yel): %u\n", act.trtcm.drop_pcd_y);
+                AIR_PRINT("\t Drop Precedence Remap(Gre): %u\n", act.trtcm.drop_pcd_g);
+            }
+            else
+            {
+                AIR_PRINT("\t Drop Precedence Remap: %s\n", "Disable");
+            }
+
+            if(TRUE == act.trtcm.tcm_sel)
+            {
+                AIR_PRINT("\t trTCM Meter Index    : %u\n", act.trtcm.tcm_idx);
+            }
+            else
+            {
+                AIR_PRINT("\t trTCM User Defined   : %s\n", trtcm_usr[act.trtcm.usr_tcm]);
+            }
+        }
+        /* rate control */
+        if(TRUE == act.rate_en)
+        {
+            AIR_PRINT("\t Rate Control Index   : %u\n", act.rate_idx);
+        }
+
+        if(TRUE == act.attack_en)
+        {
+            AIR_PRINT("\t Attack Rate Control Index: %u\n", act.attack_idx);
+        }
+
+        if(TRUE == act.vlan_en)
+        {
+            AIR_PRINT("\t ACL VLAN Index       : %u\n", act.vlan_idx);
+        }
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doAclRmvAction(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T act_idx;
+
+    if(1 == argc)
+    {
+        /* acl del action <idx(0..127)> */
+        act_idx = _strtoul(argv[0], NULL, 0);
+        ret = air_acl_delAction(0, act_idx);
+        if(ret < AIR_E_LAST)
+            AIR_PRINT("Delete ACL Action(%u): %s\n", act_idx, air_error_getString(ret));
+    }
+    else if(0 == argc)
+    {
+        /* acl clear action */
+        ret = air_acl_clearAction(0);
+        if(ret < AIR_E_LAST)
+            AIR_PRINT("Clear ACL Action: %s\n", air_error_getString(ret));
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        return AIR_E_BAD_PARAMETER;
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doAclTrtcm(
+    UI32_T argc,
+    C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T argi = 0;
+    UI32_T tcm_idx;
+    AIR_ACL_TRTCM_T tcm;
+
+    memset(&tcm, 0, sizeof(AIR_ACL_TRTCM_T));
+    if(5 == argc)
+    {
+        /* acl set trtcm <idx(0..31)> <cir(4'hex)> <pir(4'hex)> <cbs(4'hex)> <pbs(4'hex)> */
+        tcm_idx = _strtoul(argv[argi++], NULL, 0);
+        tcm.cir = _strtoul(argv[argi++], NULL, 16);
+        tcm.pir = _strtoul(argv[argi++], NULL, 16);
+        tcm.cbs = _strtoul(argv[argi++], NULL, 16);
+        tcm.pbs = _strtoul(argv[argi++], NULL, 16);
+
+        ret = air_acl_setTrtcm(0, tcm_idx, tcm);
+        if(ret < AIR_E_LAST)
+            AIR_PRINT("Set ACL trTCM(%u): %s\n", tcm_idx, air_error_getString(ret));
+    }
+    else if(1 == argc)
+    {
+        /* acl get trtcm <idx(1..31)> */
+        tcm_idx = _strtoul(argv[argi++], NULL, 0);
+        ret = air_acl_getTrtcm(0, tcm_idx, &tcm);
+        if(ret < AIR_E_LAST)
+            AIR_PRINT("Get ACL trTCM(%u): %s\n", tcm_idx, air_error_getString(ret));
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        return AIR_E_BAD_PARAMETER;
+    }
+
+    if(AIR_E_OK == ret)
+    {
+        AIR_PRINT("\t CIR: 0x%04X(unit:64Kbps)\n", tcm.cir);
+        AIR_PRINT("\t PIR: 0x%04X(unit:64Kbps)\n", tcm.pir);
+        AIR_PRINT("\t CBS: 0x%04X(unit:Byte)\n", tcm.cbs);
+        AIR_PRINT("\t PBS: 0x%04X(unit:Byte)\n", tcm.pbs);
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doAclTrtcmEn(
+    UI32_T argc,
+    C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    BOOL_T state = FALSE;
+
+    if (1 == argc)
+    {
+        /* acl set trtcmEn <en(1:En,0:Dis)> */
+        state = _strtol(argv[0], NULL, 10);
+        ret = air_acl_setTrtcmEnable(0, state);
+        AIR_PRINT("Set trTCM State ");
+    }
+    else if (0 == argc)
+    {
+        /* acl get trtcmEn */
+        ret = air_acl_getTrtcmEnable(0, &state);
+        AIR_PRINT("Get trTCM State ");
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        return AIR_E_BAD_PARAMETER;
+    }
+
+    if (ret == AIR_E_OK)
+    {
+        AIR_PRINT(": %s\n", (TRUE == state) ? "Enable" : "Disable");
+    }
+    else
+    {
+        AIR_PRINT("Fail!\n");
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doAclRmvTrtcm(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T tcm_idx;
+
+    if(1 == argc)
+    {
+        /* acl del trtcm <idx(1..31)> */
+        tcm_idx = _strtoul(argv[0], NULL, 0);
+        ret = air_acl_delTrtcm(0, tcm_idx);
+        if(ret < AIR_E_LAST)
+            AIR_PRINT("Delete ACL TRTCM(%u): %s\n", tcm_idx, air_error_getString(ret));
+    }
+    else if(0 == argc)
+    {
+        /* acl clear trtcm */
+        ret = air_acl_clearTrtcm(0);
+        if(ret < AIR_E_LAST)
+            AIR_PRINT("Clear ACL TRTCM: %s\n", air_error_getString(ret));
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        return AIR_E_BAD_PARAMETER;
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doAclPortEn(
+    UI32_T argc,
+    C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T argi=0;
+    UI32_T port = 0;
+    BOOL_T en;
+
+    if(2 == argc)
+    {
+        /* acl set portEn <port(0..6)> <en(1:En,0:Dis)> */
+        port = _strtoul(argv[argi++], NULL, 0);
+        en = _strtoul(argv[argi++], NULL, 2);
+        ret = air_acl_setPortEnable(0, port, en);
+        AIR_PRINT("Set Port:%u ACL function ", port);
+    }
+    else if(1 == argc)
+    {
+        /* acl get portEn <port(0..6)> */
+        port = _strtoul(argv[argi++], NULL, 0);
+        ret = air_acl_getPortEnable(0, port, &en);
+        AIR_PRINT("Get Port:%u ACL function ", port);
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        return AIR_E_BAD_PARAMETER;
+    }
+
+    if(ret == AIR_E_OK)
+    {
+        AIR_PRINT(": %s\n", (TRUE == en)?"Enable":"Disable");
+    }
+    else
+    {
+        AIR_PRINT("Fail!\n");
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doAclDropEn(
+    UI32_T argc,
+    C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T argi=0;
+    UI32_T port = 0;
+    BOOL_T en;
+
+    if(2 == argc)
+    {
+        /* acl set dropEn <port(0..6)> <en(1:En,0:Dis)> */
+        port = _strtoul(argv[argi++], NULL, 0);
+        en = _strtoul(argv[argi++], NULL, 2);
+        ret = air_acl_setDropEnable(0, port, en);
+        AIR_PRINT("Set ACL Drop precedence ");
+    }
+    else if(1 == argc)
+    {
+        /* acl set dropEn <port(0..6)> */
+        port = _strtoul(argv[argi++], NULL, 0);
+        ret = air_acl_getDropEnable(0, port, &en);
+        AIR_PRINT("Get ACL Drop precedence ");
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        return AIR_E_BAD_PARAMETER;
+    }
+
+    if(ret == AIR_E_OK)
+    {
+        AIR_PRINT("(Port %u):%s\n",
+                port,
+                (TRUE == en)?"Enable":"Disable");
+    }
+    else
+    {
+        AIR_PRINT("Fail!\n");
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doAclDropThrsh(
+    UI32_T argc,
+    C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T argi=0;
+    UI32_T port = 0;
+    AIR_ACL_DP_COLOR_T color;
+    UI8_T queue;
+    UI32_T high, low;
+    C8_T dp_color[AIR_ACL_DP_COLOR_LAST][7] =
+    {
+        "Green",
+        "Yellow",
+        "Red"
+    };
+
+    if(5 == argc)
+    {
+        /* acl set dropThrsh <port(0..6)> <color(0:green,1:yellow,2:red)> <queue(0..7)> <high(0..2047)> <low(0..2047) */
+        port = _strtoul(argv[argi++], NULL, 0);
+        color = _strtoul(argv[argi++], NULL, 0);
+        queue = _strtoul(argv[argi++], NULL, 0);
+        high = _strtoul(argv[argi++], NULL, 0);
+        low = _strtoul(argv[argi++], NULL, 0);
+        ret = air_acl_setDropThreshold(0, port, color, queue, high, low);
+        AIR_PRINT("Set ACL Drop precedence ");
+    }
+    else if(3 == argc)
+    {
+        /* acl get dropThrsh <port(0..6)> <color(0:green,1:yellow,2:red)> <queue(0..7)> */
+        port = _strtoul(argv[argi++], NULL, 0);
+        color = _strtoul(argv[argi++], NULL, 0);
+        queue = _strtoul(argv[argi++], NULL, 0);
+        ret = air_acl_getDropThreshold(0, port, color, queue, &high, &low);
+        AIR_PRINT("Get ACL Drop precedence ");
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        return AIR_E_BAD_PARAMETER;
+    }
+
+    if(ret == AIR_E_OK)
+    {
+        AIR_PRINT("(Port %u, color:%s, queue:%u):\n",
+                port,
+                dp_color[color],
+                queue);
+        AIR_PRINT("\tHigh Threshold :%u\n", high);
+        AIR_PRINT("\tLow Threshold  :%u\n", low);
+    }
+    else
+    {
+        AIR_PRINT("Fail!\n");
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doAclDropPbb(
+    UI32_T argc,
+    C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T argi=0;
+    UI32_T port = 0;
+    AIR_ACL_DP_COLOR_T color;
+    UI8_T queue;
+    UI32_T pbb;
+    C8_T dp_color[AIR_ACL_DP_COLOR_LAST][7] =
+    {
+        "Green",
+        "Yellow",
+        "Red"
+    };
+
+    if(4 == argc)
+    {
+        /* acl set dropPbb <port(0..6)> <color(0:green,1:yellow,2:red)> <queue(0..7)> <probability(0..1023) */
+        port = _strtoul(argv[argi++], NULL, 0);
+        color = _strtoul(argv[argi++], NULL, 0);
+        queue = _strtoul(argv[argi++], NULL, 0);
+        pbb = _strtoul(argv[argi++], NULL, 0);
+        ret = air_acl_setDropProbability(0, port, color, queue, pbb);
+        AIR_PRINT("Set ACL Drop precedence ");
+    }
+    else if(3 == argc)
+    {
+        /* acl get dropPbb <port(0..6)> <color(0:green,1:yellow,2:red)> <queue(0..7)> */
+        port = _strtoul(argv[argi++], NULL, 0);
+        color = _strtoul(argv[argi++], NULL, 0);
+        queue = _strtoul(argv[argi++], NULL, 0);
+        ret = air_acl_getDropProbability(0, port, color, queue, &pbb);
+        AIR_PRINT("Get ACL Drop precedence ");
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        return AIR_E_BAD_PARAMETER;
+    }
+
+    if(ret == AIR_E_OK)
+    {
+        AIR_PRINT("(Port %u, color:%s, queue %u):\n",
+                port,
+                dp_color[color],
+                queue);
+        AIR_PRINT("\tDrop probability:%u(unit=1/1023)\n", pbb);
+    }
+    else
+    {
+        AIR_PRINT("Fail!\n");
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doAclMeter(
+    UI32_T argc,
+    C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T argi = 0;
+    UI32_T meter_idx, state, rate;
+
+    if(3 == argc)
+    {
+        /* acl set meter <idx(0..31)> <en(1:En,0:Dis)> <rate(0..65535)>
+           Note: Limit rate = rate * 64Kbps */
+        meter_idx = _strtoul(argv[argi++], NULL, 0);
+        state = _strtoul(argv[argi++], NULL, 2);
+        rate = _strtoul(argv[argi++], NULL, 0);
+
+        ret = air_acl_setMeterTable(0, meter_idx, state, rate);
+        if(ret < AIR_E_LAST)
+            AIR_PRINT("Set ACL Meter(%u): %s\n", meter_idx, air_error_getString(ret));
+    }
+    else if(1 == argc)
+    {
+        /* acl get meter <idx(0..31)> */
+        meter_idx = _strtoul(argv[argi++], NULL, 0);
+        ret = air_acl_getMeterTable(0, meter_idx, &state, &rate);
+        if(ret < AIR_E_LAST)
+            AIR_PRINT("Get ACL Meter(%u): %s\n", meter_idx, air_error_getString(ret));
+    }
+    else
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        return AIR_E_BAD_PARAMETER;
+    }
+
+    if(AIR_E_OK == ret)
+    {
+        AIR_PRINT("\t State: %s\n", (TRUE == state)?"Enable":"Disable");
+        if(TRUE == state)
+        {
+            AIR_PRINT("\t Rate : %u(unit:64Kbps)\n", rate);
+        }
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doAclDump(
+    UI32_T argc,
+    C8_T *argv[])
+{
+    AIR_ERROR_NO_T ret = AIR_E_OK;
+    UI32_T i, cnt = 0;
+    AIR_ACL_CTRL_T ctrl;
+
+    if(0 != argc)
+    {
+        AIR_PRINT("Unrecognized command.\n");
+        return AIR_E_BAD_PARAMETER;
+    }
+
+    for(i=0; i<ACL_MAX_RULE_NUM; i++)
+    {
+        memset(&ctrl, 0, sizeof(AIR_ACL_CTRL_T));
+        ret = air_acl_getRuleCtrl(0, i, &ctrl);
+        if(AIR_E_OK == ret)
+        {
+            if(TRUE == ctrl.rule_en)
+            {
+                cnt++;
+                AIR_PRINT("\t Entry-%d vaild\n", i);
+            }
+        }
+    }
+    if(0 == cnt)
+    {
+        AIR_PRINT("\t No entry vaild\n");
+    }
+
+    return ret;
+}
+
+static AIR_ERROR_NO_T
+doAclSet(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(aclSetCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doAclGet(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(aclGetCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doAclDel(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(aclDelCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doAclClear(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(aclClearCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+doAcl(
+        UI32_T argc,
+        C8_T *argv[])
+{
+    return subcmd(aclCmds, argc, argv);
+}
+
+static AIR_ERROR_NO_T
+subcmd(
+        const AIR_CMD_T tab[],
+        UI32_T argc,
+        C8_T *argv[])
+{
+    const AIR_CMD_T *cmdp;
+    I32_T found = 0;
+    I32_T i, len;
+
+    if (argc < 1)
+    {
+        goto print_out_cmds;
+    }
+
+    for (cmdp = tab; cmdp->name != NULL; cmdp++)
+    {
+        if (strlen(argv[0]) == strlen(cmdp->name))
+        {
+            if (strncmp(argv[0], cmdp->name, strlen(argv[0])) == 0)
+            {
+                found = 1;
+                break;
+            }
+        }
+    }
+
+    if(!found)
+    {
+        C8_T buf[66];
+
+print_out_cmds:
+        AIR_PRINT("valid subcommands:\n");
+        memset(buf, ' ', sizeof(buf));
+        buf[64] = '\n';
+        buf[65] = '\0';
+
+        for (i=0, cmdp = tab; cmdp->name != NULL; cmdp++)
+        {
+            len = strlen(cmdp->name);
+            strncpy(&buf[i*16], cmdp->name, (len > 16) ? 16 : len);
+            if(3 == i)
+            {
+                AIR_PRINT("%s\n", buf);
+                memset(buf, ' ', sizeof(buf));
+                buf[64] = '\n';
+                buf[65] = '\0';
+            }
+            i = (i + 1) % 4;
+        }
+
+        if (0 != i)
+            AIR_PRINT("%s\n", buf);
+
+        return AIR_E_BAD_PARAMETER;
+    }
+
+    if (CMD_NO_PARA == cmdp->argc_min)
+    {
+        if (argc != 1)
+        {
+            if (cmdp->argc_errmsg != NULL)
+            {
+                AIR_PRINT("Usage: %s\n", cmdp->argc_errmsg);
+            }
+
+            return AIR_E_BAD_PARAMETER;
+        }
+    }
+    else if (CMD_VARIABLE_PARA == cmdp->argc_min)
+    {
+        if (argc < 3)
+        {
+            if (cmdp->argc_errmsg != NULL)
+            {
+                AIR_PRINT("Usage: %s\n", cmdp->argc_errmsg);
+            }
+
+            return AIR_E_BAD_PARAMETER;
+        }
+    }
+    else
+    {
+        if ((argc <= cmdp->argc_min) || ((cmdp->argc_min != 0) && (argc != (cmdp->argc_min + 1))))
+        {
+            if (cmdp->argc_errmsg != NULL)
+            {
+                AIR_PRINT("Usage: %s\n", cmdp->argc_errmsg);
+            }
+
+            return AIR_E_BAD_PARAMETER;
+        }
+    }
+
+    if (cmdp->func)
+    {
+        argc--;
+        argv++;
+        return (*cmdp->func)(argc, argv);
+    }
+    return AIR_E_OK;
+}
+
+/* FUNCTION NAME:   air_parse_cmd
+ * PURPOSE:
+ *      This function is used process diagnostic cmd
+ * INPUT:
+ *      argc         -- parameter number
+ *      argv         -- parameter strings
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      NPS_E_OK     -- Successfully read the data.
+ *      NPS_E_OTHERS -- Failed to read the data.
+ * NOTES:
+ *
+ */
+AIR_ERROR_NO_T
+air_parse_cmd(
+        const UI32_T argc,
+        const C8_T **argv)
+{
+    return subcmd(Cmds, argc, (C8_T **)argv);
+}
+
diff --git a/recipes-devtools/switch/files/src/an8855_sdk/api/src/air_error.c b/recipes-devtools/switch/files/src/an8855_sdk/api/src/air_error.c
index 3323e54..abe27dd 100644
--- a/recipes-devtools/switch/files/src/an8855_sdk/api/src/air_error.c
+++ b/recipes-devtools/switch/files/src/an8855_sdk/api/src/air_error.c
@@ -1,73 +1,73 @@
-/* FILE NAME:   air_error.c
- * PURPOSE:
- *      Define the software modules in AIR SDK.
- * NOTES:
- */
-
-/* INCLUDE FILE DECLARATIONS
- */
-#include "air.h"
-
-/* NAMING CONSTANT DECLARATIONS
- */
-
-/* MACRO FUNCTION DECLARATIONS
- */
-
-/* DATA TYPE DECLARATIONS
- */
-
-/* GLOBAL VARIABLE DECLARATIONS
- */
-
-/* LOCAL SUBPROGRAM DECLARATIONS
- */
-
-/* STATIC VARIABLE DECLARATIONS
- */
-static C8_T *_air_error_cause[AIR_E_LAST] =
-{
-    "OK",
-    "NOT_OK",
-    "BAD_PARAMETER",
-    "TABLE_FULL",
-    "ENTRY_NOT_FOUND",
-    "ENTRY_EXISTS",
-    "NOT_SUPPORT",
-    "TIMEOUT",
-};
-
-/* EXPORTED SUBPROGRAM BODIES
- */
-
-/* LOCAL SUBPROGRAM BODIES
- */
-/* FUNCTION NAME:   air_error_getString
- * PURPOSE:
- *      To obtain the error string of the specified error code
- *
- * INPUT:
- *      The specified error code
- * OUTPUT:
- *      None
- * RETURN:
- *      Pointer to the target error string
- *
- * NOTES:
- *
- *
- */
-C8_T *
-air_error_getString(
-const AIR_ERROR_NO_T cause )
-{
-    if(cause < AIR_E_LAST)
-    {
-        return _air_error_cause[cause];
-    }
-    else
-    {
-        return "";
-    }
-}
-
+/* FILE NAME:   air_error.c
+ * PURPOSE:
+ *      Define the software modules in AIR SDK.
+ * NOTES:
+ */
+
+/* INCLUDE FILE DECLARATIONS
+ */
+#include "air.h"
+
+/* NAMING CONSTANT DECLARATIONS
+ */
+
+/* MACRO FUNCTION DECLARATIONS
+ */
+
+/* DATA TYPE DECLARATIONS
+ */
+
+/* GLOBAL VARIABLE DECLARATIONS
+ */
+
+/* LOCAL SUBPROGRAM DECLARATIONS
+ */
+
+/* STATIC VARIABLE DECLARATIONS
+ */
+static C8_T *_air_error_cause[AIR_E_LAST] =
+{
+    "OK",
+    "NOT_OK",
+    "BAD_PARAMETER",
+    "TABLE_FULL",
+    "ENTRY_NOT_FOUND",
+    "ENTRY_EXISTS",
+    "NOT_SUPPORT",
+    "TIMEOUT",
+};
+
+/* EXPORTED SUBPROGRAM BODIES
+ */
+
+/* LOCAL SUBPROGRAM BODIES
+ */
+/* FUNCTION NAME:   air_error_getString
+ * PURPOSE:
+ *      To obtain the error string of the specified error code
+ *
+ * INPUT:
+ *      The specified error code
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      Pointer to the target error string
+ *
+ * NOTES:
+ *
+ *
+ */
+C8_T *
+air_error_getString(
+const AIR_ERROR_NO_T cause )
+{
+    if(cause < AIR_E_LAST)
+    {
+        return _air_error_cause[cause];
+    }
+    else
+    {
+        return "";
+    }
+}
+
diff --git a/recipes-devtools/switch/files/src/an8855_sdk/api/src/air_init.c b/recipes-devtools/switch/files/src/an8855_sdk/api/src/air_init.c
index 8a4f96f..63664dc 100644
--- a/recipes-devtools/switch/files/src/an8855_sdk/api/src/air_init.c
+++ b/recipes-devtools/switch/files/src/an8855_sdk/api/src/air_init.c
@@ -1,147 +1,147 @@
-/* FILE NAME:   air_init.c
- * PURPOSE:
- *      Define the initialization function in AIR SDK.
- *
- * NOTES:
- *      None
- */
-
-/* INCLUDE FILE DECLARATIONS
- */
-#include "air.h"
-
-/* NAMING CONSTANT DECLARATIONS
- */
-
-/* MACRO FUNCTION DECLARATIONS
- */
-
-/* DATA TYPE DECLARATIONS
- */
-
-/* GLOBAL VARIABLE DECLARATIONS
- */
-AIR_PRINTF _ext_printf;
-AIR_UDELAY _ext_udelay;
-AIR_MALLOC _ext_malloc;
-AIR_FREE   _ext_free;
-
-/* LOCAL SUBPROGRAM DECLARATIONS
- */
-
-/* STATIC VARIABLE DECLARATIONS
- */
-
-/* EXPORTED SUBPROGRAM BODIES
- */
-
-/* LOCAL SUBPROGRAM BODIES
- */
-
-/* FUNCTION NAME:   air_init
- * PURPOSE:
- *      This API is used to initialize the SDK.
- *
- * INPUT:
- *      unit            --  The device unit
- *      ptr_init_param  --  The sdk callback functions.
- *
- * OUTPUT:
- *      None
- *
- * RETURN:
- *      AIR_E_OK
- *      AIR_E_OTHERS
- *
- * NOTES:
- *      None
- */
-AIR_ERROR_NO_T
-air_init(
-    const UI32_T unit,
-    AIR_INIT_PARAM_T *ptr_init_param)
-{
-    AIR_ERROR_NO_T rc = AIR_E_OK;
-    UI32_T u32dat = 0;
-    UI8_T port = 0;
-    AIR_LED_ON_EVT_T on_evt;
-    AIR_LED_BLK_EVT_T blk_evt;
-
-    /* check point */
-    AIR_CHECK_PTR(ptr_init_param);
-
-    _ext_dev_access.read_callback = ptr_init_param->dev_access.read_callback;
-    _ext_dev_access.write_callback = ptr_init_param->dev_access.write_callback;
-    _ext_dev_access.phy_read_callback = ptr_init_param->dev_access.phy_read_callback;
-    _ext_dev_access.phy_write_callback = ptr_init_param->dev_access.phy_write_callback;
-    _ext_dev_access.phy_cl45_read_callback = ptr_init_param->dev_access.phy_cl45_read_callback;
-    _ext_dev_access.phy_cl45_write_callback = ptr_init_param->dev_access.phy_cl45_write_callback;
-    _ext_printf = ptr_init_param->printf;
-    _ext_udelay = ptr_init_param->udelay;
-    _ext_malloc = ptr_init_param->malloc;
-    _ext_free   = ptr_init_param->free;
-    
-    return rc;
-}
-
-/* FUNCTION NAME:   air_hw_reset
- * PURPOSE:
- *      This API is used to reset hardware.
- *
- * INPUT:
- *      unit            --  The device unit
- *
- * OUTPUT:
- *      None
- *
- * RETURN:
- *      AIR_E_OK
- *      AIR_E_OTHERS
- *
- * NOTES:
- *      None
- */
-AIR_ERROR_NO_T
-air_hw_reset(
-    const UI32_T unit)
-{
-    AIR_PRINT(">>>>> enct_hw_reset\n");
-    /* Set an8855 reset pin to 0 */
-
-    /* Delay 100ms */
-
-    /* Set an8855 reset pin to 1 */
-
-    /* Delay 600ms */
-
-    return AIR_E_OK;
-}
-
-/* FUNCTION NAME:   air_set_gpio_pin_mux
- * PURPOSE:
- *      This API is used to set gpio pin mux.
- *
- * INPUT:
- *      unit            --  The device unit
- *
- * OUTPUT:
- *      None
- *
- * RETURN:
- *      AIR_E_OK
- *      AIR_E_OTHERS
- *
- * NOTES:
- *      None
- */
-AIR_ERROR_NO_T
-air_set_gpio_pin_mux(
-    const UI32_T unit)
-{
-    AIR_PRINT(">>>>> enct_set_gpio_pin_mux\n");
-    /* Set GPIO_MODE0 */
-    /* Implementation for SLT HW */
-    aml_writeReg(unit, GPIO_MODE0, 0x11111111);
-
-    return AIR_E_OK;
-}
+/* FILE NAME:   air_init.c
+ * PURPOSE:
+ *      Define the initialization function in AIR SDK.
+ *
+ * NOTES:
+ *      None
+ */
+
+/* INCLUDE FILE DECLARATIONS
+ */
+#include "air.h"
+
+/* NAMING CONSTANT DECLARATIONS
+ */
+
+/* MACRO FUNCTION DECLARATIONS
+ */
+
+/* DATA TYPE DECLARATIONS
+ */
+
+/* GLOBAL VARIABLE DECLARATIONS
+ */
+AIR_PRINTF _ext_printf;
+AIR_UDELAY _ext_udelay;
+AIR_MALLOC _ext_malloc;
+AIR_FREE   _ext_free;
+
+/* LOCAL SUBPROGRAM DECLARATIONS
+ */
+
+/* STATIC VARIABLE DECLARATIONS
+ */
+
+/* EXPORTED SUBPROGRAM BODIES
+ */
+
+/* LOCAL SUBPROGRAM BODIES
+ */
+
+/* FUNCTION NAME:   air_init
+ * PURPOSE:
+ *      This API is used to initialize the SDK.
+ *
+ * INPUT:
+ *      unit            --  The device unit
+ *      ptr_init_param  --  The sdk callback functions.
+ *
+ * OUTPUT:
+ *      None
+ *
+ * RETURN:
+ *      AIR_E_OK
+ *      AIR_E_OTHERS
+ *
+ * NOTES:
+ *      None
+ */
+AIR_ERROR_NO_T
+air_init(
+    const UI32_T unit,
+    AIR_INIT_PARAM_T *ptr_init_param)
+{
+    AIR_ERROR_NO_T rc = AIR_E_OK;
+    UI32_T u32dat = 0;
+    UI8_T port = 0;
+    AIR_LED_ON_EVT_T on_evt;
+    AIR_LED_BLK_EVT_T blk_evt;
+
+    /* check point */
+    AIR_CHECK_PTR(ptr_init_param);
+
+    _ext_dev_access.read_callback = ptr_init_param->dev_access.read_callback;
+    _ext_dev_access.write_callback = ptr_init_param->dev_access.write_callback;
+    _ext_dev_access.phy_read_callback = ptr_init_param->dev_access.phy_read_callback;
+    _ext_dev_access.phy_write_callback = ptr_init_param->dev_access.phy_write_callback;
+    _ext_dev_access.phy_cl45_read_callback = ptr_init_param->dev_access.phy_cl45_read_callback;
+    _ext_dev_access.phy_cl45_write_callback = ptr_init_param->dev_access.phy_cl45_write_callback;
+    _ext_printf = ptr_init_param->printf;
+    _ext_udelay = ptr_init_param->udelay;
+    _ext_malloc = ptr_init_param->malloc;
+    _ext_free   = ptr_init_param->free;
+    
+    return rc;
+}
+
+/* FUNCTION NAME:   air_hw_reset
+ * PURPOSE:
+ *      This API is used to reset hardware.
+ *
+ * INPUT:
+ *      unit            --  The device unit
+ *
+ * OUTPUT:
+ *      None
+ *
+ * RETURN:
+ *      AIR_E_OK
+ *      AIR_E_OTHERS
+ *
+ * NOTES:
+ *      None
+ */
+AIR_ERROR_NO_T
+air_hw_reset(
+    const UI32_T unit)
+{
+    AIR_PRINT(">>>>> enct_hw_reset\n");
+    /* Set an8855 reset pin to 0 */
+
+    /* Delay 100ms */
+
+    /* Set an8855 reset pin to 1 */
+
+    /* Delay 600ms */
+
+    return AIR_E_OK;
+}
+
+/* FUNCTION NAME:   air_set_gpio_pin_mux
+ * PURPOSE:
+ *      This API is used to set gpio pin mux.
+ *
+ * INPUT:
+ *      unit            --  The device unit
+ *
+ * OUTPUT:
+ *      None
+ *
+ * RETURN:
+ *      AIR_E_OK
+ *      AIR_E_OTHERS
+ *
+ * NOTES:
+ *      None
+ */
+AIR_ERROR_NO_T
+air_set_gpio_pin_mux(
+    const UI32_T unit)
+{
+    AIR_PRINT(">>>>> enct_set_gpio_pin_mux\n");
+    /* Set GPIO_MODE0 */
+    /* Implementation for SLT HW */
+    aml_writeReg(unit, GPIO_MODE0, 0x11111111);
+
+    return AIR_E_OK;
+}
diff --git a/recipes-devtools/switch/files/src/an8855_sdk/api/src/air_port.c b/recipes-devtools/switch/files/src/an8855_sdk/api/src/air_port.c
index 09dcef1..d33bf70 100644
--- a/recipes-devtools/switch/files/src/an8855_sdk/api/src/air_port.c
+++ b/recipes-devtools/switch/files/src/an8855_sdk/api/src/air_port.c
@@ -390,8 +390,8 @@
     AIR_CHECK_PTR(ptr_speed);
 
     /* Read data from register */
-    aml_readPhyReg(unit, port, 0x0, &u32dat);
-    (*ptr_speed) = (BITS_OFF_R(u32dat, 6, 1) << 1) | BITS_OFF_R(u32dat, 13, 1);
+	aml_readReg(unit, PMSR(port), &u32dat);
+	(*ptr_speed) = BITS_OFF_R(u32dat, 28, 3);
 
     return ret;
 }
@@ -491,8 +491,8 @@
     AIR_CHECK_PTR(ptr_duplex);
 
     /* Read data from register */
-    aml_readPhyReg(unit, port, 0x0, &u32dat);
-    (*ptr_duplex) = BITS_OFF_R(u32dat, 8, 1);
+	aml_readReg(unit, PMSR(port), &u32dat);
+	(*ptr_duplex) = BITS_OFF_R(u32dat, 25, 1);
 
     return AIR_E_OK;
 }
diff --git a/recipes-devtools/switch/files/src/an8855_sdk/api/src/air_vlan.c b/recipes-devtools/switch/files/src/an8855_sdk/api/src/air_vlan.c
index 6629165..94f296e 100644
--- a/recipes-devtools/switch/files/src/an8855_sdk/api/src/air_vlan.c
+++ b/recipes-devtools/switch/files/src/an8855_sdk/api/src/air_vlan.c
@@ -1,1448 +1,1449 @@
-/* FILE NAME:   air_vlan.c
- * PURPOSE:
- *      Define the VLAN function in AIR SDK.
- * NOTES:
- */
-
-/* INCLUDE FILE DECLARATIONS
- */
-#include "air.h"
-
-/* NAMING CONSTANT DECLARATIONS
- */
-
-/* MACRO FUNCTION DECLARATIONS
- */
-
-/* DATA TYPE DECLARATIONS
- */
-
-/* GLOBAL VARIABLE DECLARATIONS
- */
-
-/* LOCAL SUBPROGRAM DECLARATIONS
- */
-
-/* STATIC VARIABLE DECLARATIONS
- */
-
-/* EXPORTED SUBPROGRAM BODIES
- */
-
-/* LOCAL SUBPROGRAM BODIES
-*/
-void
-_air_vlan_readEntry(
-    const UI32_T unit,
-    const UI16_T vid,
-    AIR_VLAN_ENTRY_T* vlan_entry)
-{
-    UI32_T val = 0;
-    val = (0x80000000 + vid); //r_vid_cmd
-    aml_writeReg(unit, VTCR, val);
-
-    for (;;)
-    {
-        aml_readReg(unit, VTCR, &val);
-        if ((val & 0x80000000) == 0)
-            break;
-        AIR_UDELAY(10);
-    }
-
-    aml_readReg(unit, VLNRDATA0, &(vlan_entry->vlan_table.vlan_table0));
-    aml_readReg(unit, VLNRDATA1, &(vlan_entry->vlan_table.vlan_table1));
-}
-
-void
-_air_vlan_writeEntry(
-    const UI32_T unit,
-    const UI16_T vid,
-    AIR_VLAN_ENTRY_T* vlan_entry)
-{
-    UI32_T val = 0;
-
-    aml_writeReg(unit, VLNWDATA0, vlan_entry->vlan_table.vlan_table0);
-    aml_writeReg(unit, VLNWDATA1, vlan_entry->vlan_table.vlan_table1);
-    aml_writeReg(unit, VLNWDATA2, 0);
-    aml_writeReg(unit, VLNWDATA3, 0);
-    aml_writeReg(unit, VLNWDATA4, 0);
-
-    val = (0x80001000 + vid); //w_vid_cmd
-    aml_writeReg(unit, VTCR, val);
-
-    for (;;)
-    {
-        aml_readReg(unit, VTCR, &val);
-        if ((val & 0x80000000) == 0)
-            break;
-        AIR_UDELAY(10);
-    }
-}
-
-void
-_air_untagged_vlan_readEntry(
-    const UI32_T unit,
-    const UI16_T vid,
-    AIR_VLAN_ENTRY_ATTR_T* vlan_entry)
-{
-    UI32_T val = 0;
-    val = (0x80000000 + vid); //r_vid_cmd
-    aml_writeReg(unit, VTCR, val);
-
-    for (;;)
-    {
-        aml_readReg(unit, VTCR, &val);
-        if ((val & 0x80000000) == 0)
-            break;
-        AIR_UDELAY(10);
-    }
-
-    aml_readReg(unit, VLNRDATA0, &(vlan_entry->vlan_table.vlan_table0));
-    aml_readReg(unit, VLNRDATA1, &(vlan_entry->vlan_table.vlan_table1));
-    aml_readReg(unit, VLNRDATA2, &(vlan_entry->vlan_table.vlan_table2));
-    aml_readReg(unit, VLNRDATA3, &(vlan_entry->vlan_table.vlan_table3));
-    aml_readReg(unit, VLNRDATA4, &(vlan_entry->vlan_table.vlan_table4));
-}
-
-void
-_air_untagged_vlan_writeEntry(
-    const UI32_T unit,
-    const UI16_T vid,
-    AIR_VLAN_ENTRY_ATTR_T* vlan_entry)
-{
-    UI32_T val = 0;
-
-    aml_writeReg(unit, VLNWDATA0, vlan_entry->vlan_table.vlan_table0);
-    aml_writeReg(unit, VLNWDATA1, vlan_entry->vlan_table.vlan_table1);
-    aml_writeReg(unit, VLNWDATA2, vlan_entry->vlan_table.vlan_table2);
-    aml_writeReg(unit, VLNWDATA3, vlan_entry->vlan_table.vlan_table3);
-    aml_writeReg(unit, VLNWDATA4, vlan_entry->vlan_table.vlan_table4);
-
-    val = (0x80001000 + vid); //w_vid_cmd
-    aml_writeReg(unit, VTCR, val);
-
-    for (;;)
-    {
-        aml_readReg(unit, VTCR, &val);
-        if ((val & 0x80000000) == 0)
-            break;
-        AIR_UDELAY(10);
-    }
-}
-
-/* FUNCTION NAME:   air_vlan_create
- * PURPOSE:
- *      Create the vlan in the specified device.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id
- *      p_attr      -- vlan attr
- * OUTPUT:
- *      None
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Vlan creation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_create(
-    const UI32_T    unit,
-    const UI16_T    vid,
-    AIR_VLAN_ENTRY_ATTR_T *p_attr)
-{
-    AIR_VLAN_ENTRY_T vlan_entry = {0};
-
-    AIR_PARAM_CHK((vid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
-
-    _air_vlan_readEntry(unit, vid, &vlan_entry);
-    if (vlan_entry.valid)
-        return AIR_E_ENTRY_EXISTS;
-
-    if (NULL != p_attr)
-    {
-        p_attr->valid = 1;
-        _air_untagged_vlan_writeEntry(unit, vid, p_attr);
-    }
-    else
-    {
-        memset(&vlan_entry, 0, sizeof(vlan_entry));
-        vlan_entry.valid = 1;
-        _air_untagged_vlan_writeEntry(unit, vid, &vlan_entry);
-    }
-
-    return AIR_E_OK;
-}
-
-/* FUNCTION NAME:   air_vlan_destroy
- * PURPOSE:
- *      Destroy the vlan in the specified device.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id
- * OUTPUT:
- *      None
- * RETURN:
- *      AIR_E_OK     -- Successfully read the data.
- *      AIR_E_OTHERS -- Vlan destroy failed.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_destroy(
-    const UI32_T    unit,
-    const UI16_T    vid)
-{
-    AIR_VLAN_ENTRY_T vlan_entry = {0};
-
-    AIR_PARAM_CHK((vid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
-
-    _air_vlan_writeEntry(unit, vid, &vlan_entry);
-
-    return AIR_E_OK;
-}
-
-/* FUNCTION NAME:   air_vlan_destroyAll
- * PURPOSE:
- *      Destroy the vlan in the specified device.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id
- * OUTPUT:
- *      None
- * RETURN:
- *      AIR_E_OK     -- Successfully read the data.
- *      AIR_E_OTHERS -- Vlan destroy failed.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_destroyAll(
-    const UI32_T    unit,
-    const UI32_T    keep_and_restore_default_vlan)
-{
-    UI16_T vid = 0;
-
-    for (vid = AIR_VLAN_ID_MIN; vid <= AIR_VLAN_ID_MAX; vid++)
-    {
-        if (keep_and_restore_default_vlan)
-        {
-            air_vlan_reset(unit, vid);
-        }
-        else
-        {
-            air_vlan_destroy(unit, vid);
-        }
-    }
-
-    return AIR_E_OK;
-}
-
-/* FUNCTION NAME:   air_vlan_reset
- * PURPOSE:
- *      Destroy the vlan in the specified device.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id
- * OUTPUT:
- *      None
- * RETURN:
- *      AIR_E_OK     -- Successfully reset the data.
- *      AIR_E_OTHERS -- Vlan reset failed.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_reset(
-    const UI32_T    unit,
-    const UI16_T    vid)
-{
-    AIR_VLAN_ENTRY_T vlan_entry = {0};
-
-    AIR_PARAM_CHK((vid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
-
-    vlan_entry.vlan_entry_format.port_mem = AIR_ALL_PORT_BITMAP;
-    vlan_entry.valid = TRUE;
-
-    _air_vlan_writeEntry(unit, vid, &vlan_entry);
-
-    return AIR_E_OK;
-}
-
-/* FUNCTION NAME:   air_vlan_setFid
- * PURPOSE:
- *      Set the filter id of the vlan to the specified device.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id
- *      fid         -- filter id
- * OUTPUT:
- *      None
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_setFid(
-    const UI32_T    unit,
-    const UI16_T    vid,
-    const UI8_T     fid)
-{
-    AIR_VLAN_ENTRY_T vlan_entry = {0};
-
-    /* VID check */
-    AIR_PARAM_CHK((vid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
-    AIR_PARAM_CHK((fid > AIR_FILTER_ID_MAX), AIR_E_BAD_PARAMETER);
-
-    _air_vlan_readEntry(unit, vid, &vlan_entry);
-    if (!vlan_entry.valid)
-        return AIR_E_ENTRY_NOT_FOUND;
-
-    vlan_entry.vlan_entry_format.fid = fid;
-    _air_vlan_writeEntry(unit, vid, &vlan_entry);
-
-    return AIR_E_OK;
-}
-
-/* FUNCTION NAME:   air_vlan_getFid
- * PURPOSE:
- *      Get the filter id of the vlan from the specified device.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id to be created
- * OUTPUT:
- *      ptr_fid     -- filter id
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_getFid(
-    const UI32_T    unit,
-    const UI16_T    vid,
-    UI8_T           *ptr_fid)
-{
-    AIR_VLAN_ENTRY_T vlan_entry = {0};
-
-    AIR_PARAM_CHK((vid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
-    AIR_CHECK_PTR(ptr_fid);
-
-    _air_vlan_readEntry(unit, vid, &vlan_entry);
-    if (!vlan_entry.valid)
-        return AIR_E_ENTRY_NOT_FOUND;
-
-    *ptr_fid = vlan_entry.vlan_entry_format.fid;
-
-    return AIR_E_OK;
-}
-
-/* FUNCTION NAME:   air_vlan_addMemberPort
- * PURPOSE:
- *      Add one vlan member to the specified device.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id
- *      port        -- port id
- * OUTPUT:
- *      None
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_addMemberPort(
-    const UI32_T    unit,
-    const UI16_T    vid,
-    const UI32_T    port)
-{
-    AIR_VLAN_ENTRY_T vlan_entry = {0};
-
-    AIR_PARAM_CHK((vid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
-    AIR_PARAM_CHK((port >= AIR_MAX_NUM_OF_PORTS), AIR_E_BAD_PARAMETER);
-
-    _air_vlan_readEntry(unit, vid, &vlan_entry);
-    if (!vlan_entry.valid)
-        return AIR_E_ENTRY_NOT_FOUND;
-
-    vlan_entry.vlan_entry_format.port_mem |= 1 << port;
-    _air_vlan_writeEntry(unit, vid, &vlan_entry);
-
-    return AIR_E_OK;
-}
-
-/* FUNCTION NAME:   air_vlan_delMemberPort
- * PURPOSE:
- *      Delete one vlan member from the specified device.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id
- *      port        -- port id
- * OUTPUT:
- *      None
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_delMemberPort(
-    const UI32_T    unit,
-    const UI16_T    vid,
-    const UI32_T    port)
-{
-    AIR_VLAN_ENTRY_T vlan_entry = {0};
-
-    AIR_PARAM_CHK((vid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
-    AIR_PARAM_CHK((port >= AIR_MAX_NUM_OF_PORTS), AIR_E_BAD_PARAMETER);
-
-    _air_vlan_readEntry(unit, vid, &vlan_entry);
-    if (!vlan_entry.valid)
-        return AIR_E_ENTRY_NOT_FOUND;
-
-    vlan_entry.vlan_entry_format.port_mem &= ~(1 << port);
-    _air_vlan_writeEntry(unit, vid, &vlan_entry);
-
-    return AIR_E_OK;
-}
-
-/* FUNCTION NAME:   air_vlan_setMemberPort
- * PURPOSE:
- *      Replace the vlan members in the specified device.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id
- *      port_bitmap -- member port bitmap
- * OUTPUT:
- *      None
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_setMemberPort(
-    const UI32_T    unit,
-    const UI16_T    vid,
-    const UI32_T    port_bitmap)
-{
-    AIR_VLAN_ENTRY_T vlan_entry = {0};
-
-    AIR_PARAM_CHK((vid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
-    AIR_PARAM_CHK((port_bitmap & (~AIR_ALL_PORT_BITMAP)), AIR_E_BAD_PARAMETER);
-
-    _air_vlan_readEntry(unit, vid, &vlan_entry);
-    if (!vlan_entry.valid)
-        return AIR_E_ENTRY_NOT_FOUND;
-
-    vlan_entry.vlan_entry_format.port_mem = port_bitmap;
-    _air_vlan_writeEntry(unit, vid, &vlan_entry);
-
-    return AIR_E_OK;
-}
-
-/* FUNCTION NAME:   air_vlan_getMemberPort
- * PURPOSE:
- *      Get the vlan members from the specified device.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id
- * OUTPUT:
- *      port_bitmap -- member port bitmap
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_getMemberPort(
-    const UI32_T    unit,
-    const UI16_T    vid,
-    UI32_T          *ptr_port_bitmap)
-{
-    AIR_VLAN_ENTRY_T vlan_entry = {0};
-
-    AIR_PARAM_CHK((vid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
-    AIR_CHECK_PTR(ptr_port_bitmap);
-
-    _air_vlan_readEntry(unit, vid, &vlan_entry);
-    if (!vlan_entry.valid)
-        return AIR_E_ENTRY_NOT_FOUND;
-
-    *ptr_port_bitmap = vlan_entry.vlan_entry_format.port_mem;
-
-    return AIR_E_OK;
-}
-
-/* FUNCTION NAME:   air_vlan_setIVL
- * PURPOSE:
- *      Set L2 lookup mode IVL/SVL for L2 traffic.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id
- *      enable      -- enable IVL
- * OUTPUT:
- *      None
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_setIVL(
-    const UI32_T    unit,
-    const UI16_T    vid,
-    const BOOL_T    enable)
-{
-    AIR_VLAN_ENTRY_T vlan_entry = {0};
-
-    AIR_PARAM_CHK((vid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
-
-    _air_vlan_readEntry(unit, vid, &vlan_entry);
-    if (!vlan_entry.valid)
-        return AIR_E_ENTRY_NOT_FOUND;
-
-    vlan_entry.vlan_entry_format.ivl = enable ? 1 : 0;
-    _air_vlan_writeEntry(unit, vid, &vlan_entry);
-
-    return AIR_E_OK;
-}
-
-/* FUNCTION NAME:   air_vlan_getIVL
- * PURPOSE:
- *      Get L2 lookup mode IVL/SVL for L2 traffic.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id
- * OUTPUT:
- *      ptr_enable  -- enable IVL
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_getIVL(
-    const UI32_T    unit,
-    const UI16_T    vid,
-    BOOL_T          *ptr_enable)
-{
-    AIR_VLAN_ENTRY_T vlan_entry = {0};
-
-    AIR_PARAM_CHK((vid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
-    AIR_CHECK_PTR(ptr_enable);
-
-    _air_vlan_readEntry(unit, vid, &vlan_entry);
-    if (!vlan_entry.valid)
-        return AIR_E_ENTRY_NOT_FOUND;
-
-    *ptr_enable = vlan_entry.vlan_entry_format.ivl;
-
-    return AIR_E_OK;
-}
-
-/* FUNCTION NAME:   air_vlan_setPortAcceptFrameType
- * PURPOSE:
- *      Set vlan accept frame type of the port from the specified device.
- * INPUT:
- *      unit        -- unit id
- *      port        -- port id
- *      type        -- accept frame type
- * OUTPUT:
- *      None
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_setPortAcceptFrameType(
-    const UI32_T    unit,
-    const UI32_T    port,
-    const AIR_VLAN_ACCEPT_FRAME_TYPE_T type)
-{
-    AIR_ERROR_NO_T rc = AIR_E_OK;
-    UI32_T val = 0;
-
-    AIR_PARAM_CHK((port >= AIR_MAX_NUM_OF_PORTS), AIR_E_BAD_PARAMETER);
-    AIR_PARAM_CHK((type >= AIR_VLAN_ACCEPT_FRAME_TYPE_LAST), AIR_E_BAD_PARAMETER);
-
-    aml_readReg(unit, PVC(port), &val);
-    val &= ~PVC_ACC_FRM_MASK;
-    val |= (type & PVC_ACC_FRM_RELMASK) << PVC_ACC_FRM_OFFT;
-    aml_writeReg(unit, PVC(port), val);
-
-    return rc;
-}
-
-/* FUNCTION NAME:   air_vlan_getPortAcceptFrameType
- * PURPOSE:
- *      Get vlan accept frame type of the port from the specified device.
- * INPUT:
- *      unit        -- unit id
- *      port        -- port id
- * OUTPUT:
- *      ptr_type    -- accept frame type
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_getPortAcceptFrameType(
-    const UI32_T    unit,
-    const UI32_T    port,
-    AIR_VLAN_ACCEPT_FRAME_TYPE_T *ptr_type)
-{
-    AIR_ERROR_NO_T rc = AIR_E_OK;
-    UI32_T val = 0;
-
-    AIR_PARAM_CHK((port >= AIR_MAX_NUM_OF_PORTS), AIR_E_BAD_PARAMETER);
-    AIR_CHECK_PTR(ptr_type);
-
-    aml_readReg(unit, PVC(port), &val);
-    *ptr_type = (val >> PVC_ACC_FRM_OFFT) & PVC_ACC_FRM_RELMASK;
-
-    return rc;
-}
-
-/* FUNCTION NAME:   air_vlan_setPortLeakyVlanEnable
- * PURPOSE:
- *      Set leaky vlan enable of the port from the specified device.
- * INPUT:
- *      unit        -- unit id
- *      port        -- port id
- *      pkt_type    -- packet type
- *      enable      -- enable leaky
- * OUTPUT:
- *      None
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_setPortLeakyVlanEnable(
-    const UI32_T    unit,
-    const UI32_T    port,
-    AIR_LEAKY_PKT_TYPE_T   pkt_type,
-    const BOOL_T    enable)
-{
-    AIR_ERROR_NO_T rc = AIR_E_OK;
-    UI32_T val = 0;
-
-    AIR_PARAM_CHK((port >= AIR_MAX_NUM_OF_PORTS), AIR_E_BAD_PARAMETER);
-    AIR_PARAM_CHK((pkt_type >= AIR_LEAKY_PKT_TYPE_LAST), AIR_E_BAD_PARAMETER);
-
-    aml_readReg(unit, PVC(port), &val);
-
-    if (pkt_type == AIR_LEAKY_PKT_TYPE_UNICAST)
-    {
-        if (enable)
-        {
-            val |= PVC_UC_LKYV_EN_MASK;
-        }
-        else
-        {
-            val &= ~PVC_UC_LKYV_EN_MASK;
-        }
-    }
-    else if (pkt_type == AIR_LEAKY_PKT_TYPE_MULTICAST)
-    {
-        if (enable)
-        {
-            val |= PVC_MC_LKYV_EN_MASK;
-        }
-        else
-        {
-            val &= ~PVC_MC_LKYV_EN_MASK;
-        }
-    }
-    else
-    {
-        if (enable)
-        {
-            val |= PVC_BC_LKYV_EN_MASK;
-        }
-        else
-        {
-            val &= ~PVC_BC_LKYV_EN_MASK;
-        }
-    }
-
-    aml_writeReg(unit, PVC(port), val);
-
-    return rc;
-}
-
-/* FUNCTION NAME:   air_vlan_getPortLeakyVlanEnable
- * PURPOSE:
- *      Get leaky vlan enable of the port from the specified device.
- * INPUT:
- *      unit        -- unit id
- *      port        -- port id
- *      pkt_type    -- packet type
- * OUTPUT:
- *      ptr_enable  -- enable leaky
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_getPortLeakyVlanEnable(
-    const UI32_T    unit,
-    const UI32_T    port,
-    AIR_LEAKY_PKT_TYPE_T   pkt_type,
-    BOOL_T          *ptr_enable)
-{
-    AIR_ERROR_NO_T rc = AIR_E_OK;
-    UI32_T val = 0;
-
-    AIR_PARAM_CHK((port >= AIR_MAX_NUM_OF_PORTS), AIR_E_BAD_PARAMETER);
-    AIR_PARAM_CHK((pkt_type >= AIR_LEAKY_PKT_TYPE_LAST), AIR_E_BAD_PARAMETER);
-    AIR_CHECK_PTR(ptr_enable);
-
-    aml_readReg(unit, PVC(port), &val);
-
-    if (pkt_type == AIR_LEAKY_PKT_TYPE_UNICAST)
-    {
-        *ptr_enable = val & PVC_UC_LKYV_EN_MASK ? TRUE : FALSE;
-    }
-    else if (pkt_type == AIR_LEAKY_PKT_TYPE_MULTICAST)
-    {
-        *ptr_enable = val & PVC_MC_LKYV_EN_MASK ? TRUE : FALSE;
-    }
-    else
-    {
-        *ptr_enable = val & PVC_BC_LKYV_EN_MASK ? TRUE : FALSE;
-    }
-
-    return rc;
-}
-
-/* FUNCTION NAME:   air_vlan_setPortAttr
- * PURPOSE:
- *      Set vlan port attribute from the specified device.
- * INPUT:
- *      unit        -- unit id
- *      port        -- port id
- *      attr        -- vlan port attr
- * OUTPUT:
- *      None
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_setPortAttr(
-    const UI32_T    unit,
-    const UI32_T    port,
-    const AIR_VLAN_PORT_ATTR_T attr)
-{
-    AIR_ERROR_NO_T rc = AIR_E_OK;
-    UI32_T val = 0;
-
-    AIR_PARAM_CHK((port >= AIR_MAX_NUM_OF_PORTS), AIR_E_BAD_PARAMETER);
-    AIR_PARAM_CHK((attr >= AIR_VLAN_PORT_ATTR_LAST), AIR_E_BAD_PARAMETER);
-
-    aml_readReg(unit, PVC(port), &val);
-    val &= ~PVC_VLAN_ATTR_MASK;
-    val |= (attr & PVC_VLAN_ATTR_RELMASK) << PVC_VLAN_ATTR_OFFT;
-    aml_writeReg(unit, PVC(port), val);
-
-    return rc;
-}
-
-/* FUNCTION NAME:   air_vlan_getPortAttr
- * PURPOSE:
- *      Get vlan port attribute from the specified device.
- * INPUT:
- *      unit        -- unit id
- *      port        -- port id
- * OUTPUT:
- *      ptr_attr    -- vlan port attr
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_getPortAttr(
-    const UI32_T    unit,
-    const UI32_T    port,
-    AIR_VLAN_PORT_ATTR_T *ptr_attr)
-{
-    AIR_ERROR_NO_T rc = AIR_E_OK;
-    UI32_T val = 0;
-
-    AIR_PARAM_CHK((port >= AIR_MAX_NUM_OF_PORTS), AIR_E_BAD_PARAMETER);
-    AIR_CHECK_PTR(ptr_attr);
-
-    aml_readReg(unit, PVC(port), &val);
-    *ptr_attr = (val >> PVC_VLAN_ATTR_OFFT) & PVC_VLAN_ATTR_RELMASK;
-
-    return rc;
-}
-
-/* FUNCTION NAME:   air_vlan_setIgrPortTagAttr
- * PURPOSE:
- *      Set vlan incoming port egress tag attribute from the specified device.
- * INPUT:
- *      unit        -- unit id
- *      port        -- port id
- *      attr        -- egress tag attr
- * OUTPUT:
- *      None
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_setIgrPortTagAttr(
-    const UI32_T    unit,
-    const UI32_T    port,
-    const AIR_IGR_PORT_EG_TAG_ATTR_T attr)
-{
-    UI32_T val = 0;
-
-    AIR_PARAM_CHK((port >= AIR_MAX_NUM_OF_PORTS), AIR_E_BAD_PARAMETER);
-    AIR_PARAM_CHK((attr >= AIR_IGR_PORT_EG_TAG_ATTR_LAST), AIR_E_BAD_PARAMETER);
-
-    aml_readReg(unit, PVC(port), &val);
-    val &= ~PVC_EG_TAG_MASK;
-    val |= (attr & PVC_EG_TAG_RELMASK) << PVC_EG_TAG_OFFT;
-    aml_writeReg(unit, PVC(port), val);
-
-    return AIR_E_OK;
-}
-
-/* FUNCTION NAME:   air_vlan_getIgrPortTagAttr
- * PURPOSE:
- *      Get vlan incoming port egress tag attribute from the specified device.
- * INPUT:
- *      unit        -- unit id
- *      port        -- port id
- * OUTPUT:
- *      ptr_attr    -- egress tag attr
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_getIgrPortTagAttr(
-    const UI32_T    unit,
-    const UI32_T    port,
-    AIR_IGR_PORT_EG_TAG_ATTR_T *ptr_attr)
-{
-    UI32_T val = 0;
-
-    AIR_PARAM_CHK((port >= AIR_MAX_NUM_OF_PORTS), AIR_E_BAD_PARAMETER);
-    AIR_CHECK_PTR(ptr_attr);
-
-    aml_readReg(unit, PVC(port), &val);
-    *ptr_attr = (val >> PVC_EG_TAG_OFFT) & PVC_EG_TAG_RELMASK;
-
-    return AIR_E_OK;
-}
-
-/* FUNCTION NAME:   air_vlan_setPortEgsTagAttr
- * PURPOSE:
- *      Set vlan port egress tag attribute from the specified device.
- * INPUT:
- *      unit        -- unit id
- *      port        -- port id
- *      attr        -- egress tag attr
- * OUTPUT:
- *      None
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_setPortEgsTagAttr(
-    const UI32_T    unit,
-    const UI32_T    port,
-    const AIR_PORT_EGS_TAG_ATTR_T attr)
-{
-    UI32_T val = 0;
-
-    AIR_PARAM_CHK((port >= AIR_MAX_NUM_OF_PORTS), AIR_E_BAD_PARAMETER);
-    AIR_PARAM_CHK((attr >= AIR_PORT_EGS_TAG_ATTR_LAST), AIR_E_BAD_PARAMETER);
-
-    aml_readReg(unit, PCR(port), &val);
-    val &= ~PCR_EG_TAG_MASK;
-    val |= (attr & PCR_EG_TAG_RELMASK) << PCR_EG_TAG_OFFT;
-    aml_writeReg(unit, PCR(port), val);
-
-    return AIR_E_OK;
-}
-
-/* FUNCTION NAME:   air_vlan_getPortEgsTagAttr
- * PURPOSE:
- *      Get vlan port egress tag attribute from the specified device.
- * INPUT:
- *      unit        -- unit id
- *      port        -- port id
- * OUTPUT:
- *      ptr_attr    -- egress tag attr
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_getPortEgsTagAttr(
-    const UI32_T    unit,
-    const UI32_T    port,
-    AIR_PORT_EGS_TAG_ATTR_T *ptr_attr)
-{
-    UI32_T val = 0;
-
-    AIR_PARAM_CHK((port >= AIR_MAX_NUM_OF_PORTS), AIR_E_BAD_PARAMETER);
-    AIR_CHECK_PTR(ptr_attr);
-
-    aml_readReg(unit, PCR(port), &val);
-    *ptr_attr = (val >> PCR_EG_TAG_OFFT) & PCR_EG_TAG_RELMASK;
-
-    return AIR_E_OK;
-}
-
-/* FUNCTION NAME:   air_vlan_setPortOuterTPID
- * PURPOSE:
- *      Set stack tag TPID of the port from the specified device.
- * INPUT:
- *      unit        -- unit id
- *      port        -- port id
- *      tpid        -- TPID
- * OUTPUT:
- *      None
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_setPortOuterTPID(
-    const UI32_T    unit,
-    const UI32_T    port,
-    const UI16_T    tpid)
-{
-    UI32_T val = 0;
-
-    AIR_PARAM_CHK((port >= AIR_MAX_NUM_OF_PORTS), AIR_E_BAD_PARAMETER);
-
-    aml_readReg(unit, PVC(port), &val);
-    val &= ~PVC_STAG_VPID_MASK;
-    val |= (tpid & PVC_STAG_VPID_RELMASK) << PVC_STAG_VPID_OFFT;
-    aml_writeReg(unit, PVC(port), val);
-
-    return AIR_E_OK;
-}
-
-/* FUNCTION NAME:   air_vlan_getPortOuterTPID
- * PURPOSE:
- *      Get stack tag TPID of the port from the specified device.
- * INPUT:
- *      unit        -- unit id
- *      port        -- port id
- * OUTPUT:
- *      ptr_tpid    -- TPID
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_getPortOuterTPID(
-    const UI32_T    unit,
-    const UI32_T    port,
-    UI16_T          *ptr_tpid)
-{
-    UI32_T val = 0;
-
-    AIR_PARAM_CHK((port >= AIR_MAX_NUM_OF_PORTS), AIR_E_BAD_PARAMETER);
-    AIR_CHECK_PTR(ptr_tpid);
-
-    aml_readReg(unit, PVC(port), &val);
-    *ptr_tpid = (val >> PVC_STAG_VPID_OFFT) & PVC_STAG_VPID_RELMASK;
-
-    return AIR_E_OK;
-}
-
-/* FUNCTION NAME:   air_vlan_setPortPVID
- * PURPOSE:
- *      Set PVID of the port from the specified device.
- * INPUT:
- *      unit        -- unit id
- *      port        -- port id
- *      pvid        -- native vlan id
- * OUTPUT:
- *      None
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_setPortPVID(
-    const UI32_T    unit,
-    const UI32_T    port,
-    const UI16_T    pvid)
-{
-    UI32_T val = 0;
-
-    AIR_PARAM_CHK((port >= AIR_MAX_NUM_OF_PORTS), AIR_E_BAD_PARAMETER);
-    AIR_PARAM_CHK((pvid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
-
-    aml_readReg(unit, PVID(port), &val);
-    val &= ~PVID_PCVID_MASK;
-    val |= (pvid & PVID_PCVID_RELMASK) << PVID_PCVID_OFFT;
-    aml_writeReg(unit, PVID(port), val);
-
-    return AIR_E_OK;
-}
-
-/* FUNCTION NAME:   air_vlan_getPortPVID
- * PURPOSE:
- *      Get PVID of the port from the specified device.
- * INPUT:
- *      unit        -- unit id
- *      port        -- port id
- * OUTPUT:
- *      ptr_pvid    -- native vlan id
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_getPortPVID(
-    const UI32_T    unit,
-    const UI32_T    port,
-    UI16_T          *ptr_pvid)
-{
-    UI32_T val = 0;
-
-    AIR_PARAM_CHK((port >= AIR_MAX_NUM_OF_PORTS), AIR_E_BAD_PARAMETER);
-    AIR_CHECK_PTR(ptr_pvid);
-
-    aml_readReg(unit, PVID(port), &val);
-    *ptr_pvid = (val >> PVID_PCVID_OFFT) & PVID_PCVID_RELMASK;
-
-    return AIR_E_OK;
-}
-
-/* FUNCTION NAME:   air_vlan_setServiceTag
- * PURPOSE:
- *      Set Vlan service tag.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id
- *      stag        -- service stag
- * OUTPUT:
- *      None
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_setServiceTag(
-    const UI32_T    unit,
-    const UI16_T    vid,
-    const UI16_T    stag)
-{
-    AIR_VLAN_ENTRY_T vlan_entry = {0};
-
-    AIR_PARAM_CHK((vid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
-    AIR_PARAM_CHK((stag > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
-
-    _air_vlan_readEntry(unit, vid, &vlan_entry);
-    if (!vlan_entry.valid)
-        return AIR_E_ENTRY_NOT_FOUND;
-
-    vlan_entry.vlan_entry_format.stag = stag;
-    _air_vlan_writeEntry(unit, vid, &vlan_entry);
-
-    return AIR_E_OK;
-}
-
-/* FUNCTION NAME:   air_vlan_getServiceTag
- * PURPOSE:
- *      Get Vlan service tag.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id
- * OUTPUT:
- *      ptr_stag    -- service stag
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_getServiceTag(
-    const UI32_T    unit,
-    const UI16_T    vid,
-    UI16_T          *ptr_stag)
-{
-    AIR_VLAN_ENTRY_T vlan_entry = {0};
-
-    AIR_PARAM_CHK((vid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
-    AIR_CHECK_PTR(ptr_stag);
-
-    _air_vlan_readEntry(unit, vid, &vlan_entry);
-    if (!vlan_entry.valid)
-        return AIR_E_ENTRY_NOT_FOUND;
-
-    *ptr_stag = vlan_entry.vlan_entry_format.stag;
-
-    return AIR_E_OK;
-}
-
-/* FUNCTION NAME:   air_vlan_setEgsTagCtlEnable
- * PURPOSE:
- *      Set per vlan egress tag control.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id
- *      enable      -- enable vlan egress tag control
- * OUTPUT:
- *      None
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_setEgsTagCtlEnable(
-    const UI32_T    unit,
-    const UI16_T    vid,
-    const BOOL_T    enable)
-{
-    AIR_VLAN_ENTRY_T vlan_entry = {0};
-
-    AIR_PARAM_CHK((vid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
-
-    _air_vlan_readEntry(unit, vid, &vlan_entry);
-    if (!vlan_entry.valid)
-        return AIR_E_ENTRY_NOT_FOUND;
-
-    vlan_entry.vlan_entry_format.eg_ctrl_en = enable ? 1 : 0;
-    _air_vlan_writeEntry(unit, vid, &vlan_entry);
-
-    return AIR_E_OK;
-}
-
-/* FUNCTION NAME:   air_vlan_getEgsTagCtlEnable
- * PURPOSE:
- *      Get per vlan egress tag control.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id
- * OUTPUT:
- *      ptr_enable  -- enable vlan egress tag control
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_getEgsTagCtlEnable(
-    const UI32_T    unit,
-    const UI16_T    vid,
-    BOOL_T          *ptr_enable)
-{
-    AIR_VLAN_ENTRY_T vlan_entry = {0};
-
-    AIR_PARAM_CHK((vid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
-    AIR_CHECK_PTR(ptr_enable);
-
-    _air_vlan_readEntry(unit, vid, &vlan_entry);
-    if (!vlan_entry.valid)
-        return AIR_E_ENTRY_NOT_FOUND;
-
-    *ptr_enable = vlan_entry.vlan_entry_format.eg_ctrl_en;
-
-    return AIR_E_OK;
-}
-
-/* FUNCTION NAME:   air_vlan_setEgsTagConsistent
- * PURPOSE:
- *      Set per vlan egress tag consistent.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id
- *      enable      -- enable vlan egress tag consistent
- * OUTPUT:
- *      None
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_setEgsTagConsistent(
-    const UI32_T    unit,
-    const UI16_T    vid,
-    const BOOL_T    enable)
-{
-    AIR_VLAN_ENTRY_T vlan_entry = {0};
-
-    AIR_PARAM_CHK((vid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
-
-    _air_vlan_readEntry(unit, vid, &vlan_entry);
-    if (!vlan_entry.valid)
-        return AIR_E_ENTRY_NOT_FOUND;
-
-    vlan_entry.vlan_entry_format.eg_con = enable;
-    _air_vlan_writeEntry(unit, vid, &vlan_entry);
-
-    return AIR_E_OK;
-}
-
-/* FUNCTION NAME:   air_vlan_getEgsTagConsistent
- * PURPOSE:
- *      Get per vlan egress tag consistent.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id
- * OUTPUT:
- *      ptr_enable  -- enable vlan egress tag consistent
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_getEgsTagConsistent(
-    const UI32_T    unit,
-    const UI16_T    vid,
-    BOOL_T          *ptr_enable)
-{
-    AIR_VLAN_ENTRY_T vlan_entry = {0};
-
-    AIR_PARAM_CHK((vid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
-    AIR_CHECK_PTR(ptr_enable);
-
-    _air_vlan_readEntry(unit, vid, &vlan_entry);
-    if (!vlan_entry.valid)
-        return AIR_E_ENTRY_NOT_FOUND;
-
-    *ptr_enable = vlan_entry.vlan_entry_format.eg_con;
-
-    return AIR_E_OK;
-}
-
-/* FUNCTION NAME:   air_vlan_setPortBasedStag
- * PURPOSE:
- *      Set vlan port based stag enable.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id
- *      enable      -- vlan port based stag enable
- * OUTPUT:
- *      None
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_setPortBasedStag(
-    const UI32_T    unit,
-    const UI16_T    vid,
-    const BOOL_T    enable)
-{
-    AIR_VLAN_ENTRY_T vlan_entry = {0};
-
-    AIR_PARAM_CHK((vid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
-
-    _air_vlan_readEntry(unit, vid, &vlan_entry);
-    if (!vlan_entry.valid)
-        return AIR_E_ENTRY_NOT_FOUND;
-
-    vlan_entry.vlan_entry_format.port_stag = enable;
-    _air_vlan_writeEntry(unit, vid, &vlan_entry);
-
-    return AIR_E_OK;
-}
-
-/* FUNCTION NAME:   air_vlan_getPortBasedStag
- * PURPOSE:
- *      Get vlan port based stag enable.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id
- * OUTPUT:
- *      ptr_enable  -- vlan port based stag enable
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_getPortBasedStag(
-    const UI32_T    unit,
-    const UI16_T    vid,
-    BOOL_T          *ptr_enable)
-{
-    AIR_VLAN_ENTRY_T vlan_entry = {0};
-
-    AIR_PARAM_CHK((vid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
-    AIR_CHECK_PTR(ptr_enable);
-
-    _air_vlan_readEntry(unit, vid, &vlan_entry);
-    if (!vlan_entry.valid)
-        return AIR_E_ENTRY_NOT_FOUND;
-
-    *ptr_enable = vlan_entry.vlan_entry_format.port_stag;
-
-    return AIR_E_OK;
-}
-
-/* FUNCTION NAME:   air_vlan_setPortEgsTagCtl
- * PURPOSE:
- *      Set vlan port egress tag control.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id
- *      port        -- port id
- *      tag_ctl     -- egress tag control
- * OUTPUT:
- *      None
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_setPortEgsTagCtl(
-    const UI32_T    unit,
-    const UI16_T    vid,
-    const UI32_T    port,
-    const AIR_VLAN_PORT_EGS_TAG_CTL_TYPE_T    tag_ctl)
-{
-    AIR_VLAN_ENTRY_T vlan_entry = {0};
-
-    AIR_PARAM_CHK((vid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
-    AIR_PARAM_CHK((port >= AIR_MAX_NUM_OF_PORTS), AIR_E_BAD_PARAMETER);
-    AIR_PARAM_CHK((tag_ctl >= AIR_PORT_EGS_TAG_ATTR_LAST), AIR_E_BAD_PARAMETER);
-
-    _air_vlan_readEntry(unit, vid, &vlan_entry);
-    if (!vlan_entry.valid)
-        return AIR_E_ENTRY_NOT_FOUND;
-
-    vlan_entry.vlan_entry_format.eg_ctrl &= ~(0x3 << (port * 2));
-    vlan_entry.vlan_entry_format.eg_ctrl |= (tag_ctl & 0x3) << (port * 2);
-    _air_vlan_writeEntry(unit, vid, &vlan_entry);
-
-    return AIR_E_OK;
-}
-
-/* FUNCTION NAME:   air_vlan_getPortEgsTagCtl
- * PURPOSE:
- *      Get vlan port egress tag control.
- * INPUT:
- *      unit        -- unit id
- *      vid         -- vlan id
- * OUTPUT:
- *      ptr_tag_ctl -- egress tag control
- * RETURN:
- *      AIR_E_OK                -- Successfully read the data.
- *      AIR_E_OTHERS            -- Operation failed.
- *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
- * NOTES:
- *      none
- */
-AIR_ERROR_NO_T
-air_vlan_getPortEgsTagCtl(
-    const UI32_T    unit,
-    const UI16_T    vid,
-    const UI32_T    port,
-    AIR_VLAN_PORT_EGS_TAG_CTL_TYPE_T   *ptr_tag_ctl)
-{
-    AIR_VLAN_ENTRY_T vlan_entry = {0};
-
-    AIR_PARAM_CHK((vid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
-    AIR_PARAM_CHK((port >= AIR_MAX_NUM_OF_PORTS), AIR_E_BAD_PARAMETER);
-    AIR_CHECK_PTR(ptr_tag_ctl);
-
-    _air_vlan_readEntry(unit, vid, &vlan_entry);
-    if (!vlan_entry.valid)
-        return AIR_E_ENTRY_NOT_FOUND;
-
-    *ptr_tag_ctl = (vlan_entry.vlan_entry_format.eg_ctrl >> (port * 2)) & 0x3;
-
-    return AIR_E_OK;
-}
+/* FILE NAME:   air_vlan.c
+ * PURPOSE:
+ *      Define the VLAN function in AIR SDK.
+ * NOTES:
+ */
+
+/* INCLUDE FILE DECLARATIONS
+ */
+#include "air.h"
+
+/* NAMING CONSTANT DECLARATIONS
+ */
+
+/* MACRO FUNCTION DECLARATIONS
+ */
+
+/* DATA TYPE DECLARATIONS
+ */
+
+/* GLOBAL VARIABLE DECLARATIONS
+ */
+
+/* LOCAL SUBPROGRAM DECLARATIONS
+ */
+
+/* STATIC VARIABLE DECLARATIONS
+ */
+
+/* EXPORTED SUBPROGRAM BODIES
+ */
+
+/* LOCAL SUBPROGRAM BODIES
+*/
+void
+_air_vlan_readEntry(
+    const UI32_T unit,
+    const UI16_T vid,
+    AIR_VLAN_ENTRY_T* vlan_entry)
+{
+    UI32_T val = 0;
+    val = (0x80000000 + vid); //r_vid_cmd
+    aml_writeReg(unit, VTCR, val);
+
+    for (;;)
+    {
+        aml_readReg(unit, VTCR, &val);
+        if ((val & 0x80000000) == 0)
+            break;
+        AIR_UDELAY(10);
+    }
+
+    aml_readReg(unit, VLNRDATA0, &(vlan_entry->vlan_table.vlan_table0));
+    aml_readReg(unit, VLNRDATA1, &(vlan_entry->vlan_table.vlan_table1));
+}
+
+void
+_air_vlan_writeEntry(
+    const UI32_T unit,
+    const UI16_T vid,
+    AIR_VLAN_ENTRY_T* vlan_entry)
+{
+    UI32_T val = 0;
+
+    aml_writeReg(unit, VLNWDATA0, vlan_entry->vlan_table.vlan_table0);
+    aml_writeReg(unit, VLNWDATA1, vlan_entry->vlan_table.vlan_table1);
+    aml_writeReg(unit, VLNWDATA2, 0);
+    aml_writeReg(unit, VLNWDATA3, 0);
+    aml_writeReg(unit, VLNWDATA4, 0);
+
+    val = (0x80001000 + vid); //w_vid_cmd
+    aml_writeReg(unit, VTCR, val);
+
+    for (;;)
+    {
+        aml_readReg(unit, VTCR, &val);
+        if ((val & 0x80000000) == 0)
+            break;
+        AIR_UDELAY(10);
+    }
+}
+
+void
+_air_untagged_vlan_readEntry(
+    const UI32_T unit,
+    const UI16_T vid,
+    AIR_VLAN_ENTRY_ATTR_T* vlan_entry)
+{
+    UI32_T val = 0;
+    val = (0x80000000 + vid); //r_vid_cmd
+    aml_writeReg(unit, VTCR, val);
+
+    for (;;)
+    {
+        aml_readReg(unit, VTCR, &val);
+        if ((val & 0x80000000) == 0)
+            break;
+        AIR_UDELAY(10);
+    }
+
+    aml_readReg(unit, VLNRDATA0, &(vlan_entry->vlan_table.vlan_table0));
+    aml_readReg(unit, VLNRDATA1, &(vlan_entry->vlan_table.vlan_table1));
+    aml_readReg(unit, VLNRDATA2, &(vlan_entry->vlan_table.vlan_table2));
+    aml_readReg(unit, VLNRDATA3, &(vlan_entry->vlan_table.vlan_table3));
+    aml_readReg(unit, VLNRDATA4, &(vlan_entry->vlan_table.vlan_table4));
+}
+
+void
+_air_untagged_vlan_writeEntry(
+    const UI32_T unit,
+    const UI16_T vid,
+    AIR_VLAN_ENTRY_ATTR_T* vlan_entry)
+{
+    UI32_T val = 0;
+
+    aml_writeReg(unit, VLNWDATA0, vlan_entry->vlan_table.vlan_table0);
+    aml_writeReg(unit, VLNWDATA1, vlan_entry->vlan_table.vlan_table1);
+    aml_writeReg(unit, VLNWDATA2, vlan_entry->vlan_table.vlan_table2);
+    aml_writeReg(unit, VLNWDATA3, vlan_entry->vlan_table.vlan_table3);
+    aml_writeReg(unit, VLNWDATA4, vlan_entry->vlan_table.vlan_table4);
+
+    val = (0x80001000 + vid); //w_vid_cmd
+    aml_writeReg(unit, VTCR, val);
+
+    for (;;)
+    {
+        aml_readReg(unit, VTCR, &val);
+        if ((val & 0x80000000) == 0)
+            break;
+        AIR_UDELAY(10);
+    }
+}
+
+/* FUNCTION NAME:   air_vlan_create
+ * PURPOSE:
+ *      Create the vlan in the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id
+ *      p_attr      -- vlan attr
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Vlan creation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_create(
+    const UI32_T    unit,
+    const UI16_T    vid,
+    AIR_VLAN_ENTRY_ATTR_T *p_attr)
+{
+    AIR_VLAN_ENTRY_T vlan_entry = {0};
+    AIR_VLAN_ENTRY_ATTR_T vlan_attr_entry = {0};
+
+    AIR_PARAM_CHK((vid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
+
+    _air_vlan_readEntry(unit, vid, &vlan_entry);
+    if (vlan_entry.valid)
+        return AIR_E_ENTRY_EXISTS;
+
+    if (NULL != p_attr)
+    {
+        p_attr->valid = 1;
+        _air_untagged_vlan_writeEntry(unit, vid, p_attr);
+    }
+    else
+    {
+        memset(&vlan_attr_entry, 0, sizeof(vlan_attr_entry));
+        vlan_attr_entry.valid = 1;
+        _air_untagged_vlan_writeEntry(unit, vid, &vlan_attr_entry);
+    }
+
+    return AIR_E_OK;
+}
+
+/* FUNCTION NAME:   air_vlan_destroy
+ * PURPOSE:
+ *      Destroy the vlan in the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      AIR_E_OK     -- Successfully read the data.
+ *      AIR_E_OTHERS -- Vlan destroy failed.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_destroy(
+    const UI32_T    unit,
+    const UI16_T    vid)
+{
+    AIR_VLAN_ENTRY_T vlan_entry = {0};
+
+    AIR_PARAM_CHK((vid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
+
+    _air_vlan_writeEntry(unit, vid, &vlan_entry);
+
+    return AIR_E_OK;
+}
+
+/* FUNCTION NAME:   air_vlan_destroyAll
+ * PURPOSE:
+ *      Destroy the vlan in the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      AIR_E_OK     -- Successfully read the data.
+ *      AIR_E_OTHERS -- Vlan destroy failed.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_destroyAll(
+    const UI32_T    unit,
+    const UI32_T    keep_and_restore_default_vlan)
+{
+    UI16_T vid = 0;
+
+    for (vid = AIR_VLAN_ID_MIN; vid <= AIR_VLAN_ID_MAX; vid++)
+    {
+        if (keep_and_restore_default_vlan)
+        {
+            air_vlan_reset(unit, vid);
+        }
+        else
+        {
+            air_vlan_destroy(unit, vid);
+        }
+    }
+
+    return AIR_E_OK;
+}
+
+/* FUNCTION NAME:   air_vlan_reset
+ * PURPOSE:
+ *      Destroy the vlan in the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      AIR_E_OK     -- Successfully reset the data.
+ *      AIR_E_OTHERS -- Vlan reset failed.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_reset(
+    const UI32_T    unit,
+    const UI16_T    vid)
+{
+    AIR_VLAN_ENTRY_T vlan_entry = {0};
+
+    AIR_PARAM_CHK((vid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
+
+    vlan_entry.vlan_entry_format.port_mem = AIR_ALL_PORT_BITMAP;
+    vlan_entry.valid = TRUE;
+
+    _air_vlan_writeEntry(unit, vid, &vlan_entry);
+
+    return AIR_E_OK;
+}
+
+/* FUNCTION NAME:   air_vlan_setFid
+ * PURPOSE:
+ *      Set the filter id of the vlan to the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id
+ *      fid         -- filter id
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_setFid(
+    const UI32_T    unit,
+    const UI16_T    vid,
+    const UI8_T     fid)
+{
+    AIR_VLAN_ENTRY_T vlan_entry = {0};
+
+    /* VID check */
+    AIR_PARAM_CHK((vid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
+    AIR_PARAM_CHK((fid > AIR_FILTER_ID_MAX), AIR_E_BAD_PARAMETER);
+
+    _air_vlan_readEntry(unit, vid, &vlan_entry);
+    if (!vlan_entry.valid)
+        return AIR_E_ENTRY_NOT_FOUND;
+
+    vlan_entry.vlan_entry_format.fid = fid;
+    _air_vlan_writeEntry(unit, vid, &vlan_entry);
+
+    return AIR_E_OK;
+}
+
+/* FUNCTION NAME:   air_vlan_getFid
+ * PURPOSE:
+ *      Get the filter id of the vlan from the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id to be created
+ * OUTPUT:
+ *      ptr_fid     -- filter id
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_getFid(
+    const UI32_T    unit,
+    const UI16_T    vid,
+    UI8_T           *ptr_fid)
+{
+    AIR_VLAN_ENTRY_T vlan_entry = {0};
+
+    AIR_PARAM_CHK((vid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
+    AIR_CHECK_PTR(ptr_fid);
+
+    _air_vlan_readEntry(unit, vid, &vlan_entry);
+    if (!vlan_entry.valid)
+        return AIR_E_ENTRY_NOT_FOUND;
+
+    *ptr_fid = vlan_entry.vlan_entry_format.fid;
+
+    return AIR_E_OK;
+}
+
+/* FUNCTION NAME:   air_vlan_addMemberPort
+ * PURPOSE:
+ *      Add one vlan member to the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id
+ *      port        -- port id
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_addMemberPort(
+    const UI32_T    unit,
+    const UI16_T    vid,
+    const UI32_T    port)
+{
+    AIR_VLAN_ENTRY_T vlan_entry = {0};
+
+    AIR_PARAM_CHK((vid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
+    AIR_PARAM_CHK((port >= AIR_MAX_NUM_OF_PORTS), AIR_E_BAD_PARAMETER);
+
+    _air_vlan_readEntry(unit, vid, &vlan_entry);
+    if (!vlan_entry.valid)
+        return AIR_E_ENTRY_NOT_FOUND;
+
+    vlan_entry.vlan_entry_format.port_mem |= 1 << port;
+    _air_vlan_writeEntry(unit, vid, &vlan_entry);
+
+    return AIR_E_OK;
+}
+
+/* FUNCTION NAME:   air_vlan_delMemberPort
+ * PURPOSE:
+ *      Delete one vlan member from the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id
+ *      port        -- port id
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_delMemberPort(
+    const UI32_T    unit,
+    const UI16_T    vid,
+    const UI32_T    port)
+{
+    AIR_VLAN_ENTRY_T vlan_entry = {0};
+
+    AIR_PARAM_CHK((vid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
+    AIR_PARAM_CHK((port >= AIR_MAX_NUM_OF_PORTS), AIR_E_BAD_PARAMETER);
+
+    _air_vlan_readEntry(unit, vid, &vlan_entry);
+    if (!vlan_entry.valid)
+        return AIR_E_ENTRY_NOT_FOUND;
+
+    vlan_entry.vlan_entry_format.port_mem &= ~(1 << port);
+    _air_vlan_writeEntry(unit, vid, &vlan_entry);
+
+    return AIR_E_OK;
+}
+
+/* FUNCTION NAME:   air_vlan_setMemberPort
+ * PURPOSE:
+ *      Replace the vlan members in the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id
+ *      port_bitmap -- member port bitmap
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_setMemberPort(
+    const UI32_T    unit,
+    const UI16_T    vid,
+    const UI32_T    port_bitmap)
+{
+    AIR_VLAN_ENTRY_T vlan_entry = {0};
+
+    AIR_PARAM_CHK((vid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
+    AIR_PARAM_CHK((port_bitmap & (~AIR_ALL_PORT_BITMAP)), AIR_E_BAD_PARAMETER);
+
+    _air_vlan_readEntry(unit, vid, &vlan_entry);
+    if (!vlan_entry.valid)
+        return AIR_E_ENTRY_NOT_FOUND;
+
+    vlan_entry.vlan_entry_format.port_mem = port_bitmap;
+    _air_vlan_writeEntry(unit, vid, &vlan_entry);
+
+    return AIR_E_OK;
+}
+
+/* FUNCTION NAME:   air_vlan_getMemberPort
+ * PURPOSE:
+ *      Get the vlan members from the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id
+ * OUTPUT:
+ *      port_bitmap -- member port bitmap
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_getMemberPort(
+    const UI32_T    unit,
+    const UI16_T    vid,
+    UI32_T          *ptr_port_bitmap)
+{
+    AIR_VLAN_ENTRY_T vlan_entry = {0};
+
+    AIR_PARAM_CHK((vid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
+    AIR_CHECK_PTR(ptr_port_bitmap);
+
+    _air_vlan_readEntry(unit, vid, &vlan_entry);
+    if (!vlan_entry.valid)
+        return AIR_E_ENTRY_NOT_FOUND;
+
+    *ptr_port_bitmap = vlan_entry.vlan_entry_format.port_mem;
+
+    return AIR_E_OK;
+}
+
+/* FUNCTION NAME:   air_vlan_setIVL
+ * PURPOSE:
+ *      Set L2 lookup mode IVL/SVL for L2 traffic.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id
+ *      enable      -- enable IVL
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_setIVL(
+    const UI32_T    unit,
+    const UI16_T    vid,
+    const BOOL_T    enable)
+{
+    AIR_VLAN_ENTRY_T vlan_entry = {0};
+
+    AIR_PARAM_CHK((vid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
+
+    _air_vlan_readEntry(unit, vid, &vlan_entry);
+    if (!vlan_entry.valid)
+        return AIR_E_ENTRY_NOT_FOUND;
+
+    vlan_entry.vlan_entry_format.ivl = enable ? 1 : 0;
+    _air_vlan_writeEntry(unit, vid, &vlan_entry);
+
+    return AIR_E_OK;
+}
+
+/* FUNCTION NAME:   air_vlan_getIVL
+ * PURPOSE:
+ *      Get L2 lookup mode IVL/SVL for L2 traffic.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id
+ * OUTPUT:
+ *      ptr_enable  -- enable IVL
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_getIVL(
+    const UI32_T    unit,
+    const UI16_T    vid,
+    BOOL_T          *ptr_enable)
+{
+    AIR_VLAN_ENTRY_T vlan_entry = {0};
+
+    AIR_PARAM_CHK((vid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
+    AIR_CHECK_PTR(ptr_enable);
+
+    _air_vlan_readEntry(unit, vid, &vlan_entry);
+    if (!vlan_entry.valid)
+        return AIR_E_ENTRY_NOT_FOUND;
+
+    *ptr_enable = vlan_entry.vlan_entry_format.ivl;
+
+    return AIR_E_OK;
+}
+
+/* FUNCTION NAME:   air_vlan_setPortAcceptFrameType
+ * PURPOSE:
+ *      Set vlan accept frame type of the port from the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      port        -- port id
+ *      type        -- accept frame type
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_setPortAcceptFrameType(
+    const UI32_T    unit,
+    const UI32_T    port,
+    const AIR_VLAN_ACCEPT_FRAME_TYPE_T type)
+{
+    AIR_ERROR_NO_T rc = AIR_E_OK;
+    UI32_T val = 0;
+
+    AIR_PARAM_CHK((port >= AIR_MAX_NUM_OF_PORTS), AIR_E_BAD_PARAMETER);
+    AIR_PARAM_CHK((type >= AIR_VLAN_ACCEPT_FRAME_TYPE_LAST), AIR_E_BAD_PARAMETER);
+
+    aml_readReg(unit, PVC(port), &val);
+    val &= ~PVC_ACC_FRM_MASK;
+    val |= (type & PVC_ACC_FRM_RELMASK) << PVC_ACC_FRM_OFFT;
+    aml_writeReg(unit, PVC(port), val);
+
+    return rc;
+}
+
+/* FUNCTION NAME:   air_vlan_getPortAcceptFrameType
+ * PURPOSE:
+ *      Get vlan accept frame type of the port from the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      port        -- port id
+ * OUTPUT:
+ *      ptr_type    -- accept frame type
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_getPortAcceptFrameType(
+    const UI32_T    unit,
+    const UI32_T    port,
+    AIR_VLAN_ACCEPT_FRAME_TYPE_T *ptr_type)
+{
+    AIR_ERROR_NO_T rc = AIR_E_OK;
+    UI32_T val = 0;
+
+    AIR_PARAM_CHK((port >= AIR_MAX_NUM_OF_PORTS), AIR_E_BAD_PARAMETER);
+    AIR_CHECK_PTR(ptr_type);
+
+    aml_readReg(unit, PVC(port), &val);
+    *ptr_type = (val >> PVC_ACC_FRM_OFFT) & PVC_ACC_FRM_RELMASK;
+
+    return rc;
+}
+
+/* FUNCTION NAME:   air_vlan_setPortLeakyVlanEnable
+ * PURPOSE:
+ *      Set leaky vlan enable of the port from the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      port        -- port id
+ *      pkt_type    -- packet type
+ *      enable      -- enable leaky
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_setPortLeakyVlanEnable(
+    const UI32_T    unit,
+    const UI32_T    port,
+    AIR_LEAKY_PKT_TYPE_T   pkt_type,
+    const BOOL_T    enable)
+{
+    AIR_ERROR_NO_T rc = AIR_E_OK;
+    UI32_T val = 0;
+
+    AIR_PARAM_CHK((port >= AIR_MAX_NUM_OF_PORTS), AIR_E_BAD_PARAMETER);
+    AIR_PARAM_CHK((pkt_type >= AIR_LEAKY_PKT_TYPE_LAST), AIR_E_BAD_PARAMETER);
+
+    aml_readReg(unit, PVC(port), &val);
+
+    if (pkt_type == AIR_LEAKY_PKT_TYPE_UNICAST)
+    {
+        if (enable)
+        {
+            val |= PVC_UC_LKYV_EN_MASK;
+        }
+        else
+        {
+            val &= ~PVC_UC_LKYV_EN_MASK;
+        }
+    }
+    else if (pkt_type == AIR_LEAKY_PKT_TYPE_MULTICAST)
+    {
+        if (enable)
+        {
+            val |= PVC_MC_LKYV_EN_MASK;
+        }
+        else
+        {
+            val &= ~PVC_MC_LKYV_EN_MASK;
+        }
+    }
+    else
+    {
+        if (enable)
+        {
+            val |= PVC_BC_LKYV_EN_MASK;
+        }
+        else
+        {
+            val &= ~PVC_BC_LKYV_EN_MASK;
+        }
+    }
+
+    aml_writeReg(unit, PVC(port), val);
+
+    return rc;
+}
+
+/* FUNCTION NAME:   air_vlan_getPortLeakyVlanEnable
+ * PURPOSE:
+ *      Get leaky vlan enable of the port from the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      port        -- port id
+ *      pkt_type    -- packet type
+ * OUTPUT:
+ *      ptr_enable  -- enable leaky
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_getPortLeakyVlanEnable(
+    const UI32_T    unit,
+    const UI32_T    port,
+    AIR_LEAKY_PKT_TYPE_T   pkt_type,
+    BOOL_T          *ptr_enable)
+{
+    AIR_ERROR_NO_T rc = AIR_E_OK;
+    UI32_T val = 0;
+
+    AIR_PARAM_CHK((port >= AIR_MAX_NUM_OF_PORTS), AIR_E_BAD_PARAMETER);
+    AIR_PARAM_CHK((pkt_type >= AIR_LEAKY_PKT_TYPE_LAST), AIR_E_BAD_PARAMETER);
+    AIR_CHECK_PTR(ptr_enable);
+
+    aml_readReg(unit, PVC(port), &val);
+
+    if (pkt_type == AIR_LEAKY_PKT_TYPE_UNICAST)
+    {
+        *ptr_enable = val & PVC_UC_LKYV_EN_MASK ? TRUE : FALSE;
+    }
+    else if (pkt_type == AIR_LEAKY_PKT_TYPE_MULTICAST)
+    {
+        *ptr_enable = val & PVC_MC_LKYV_EN_MASK ? TRUE : FALSE;
+    }
+    else
+    {
+        *ptr_enable = val & PVC_BC_LKYV_EN_MASK ? TRUE : FALSE;
+    }
+
+    return rc;
+}
+
+/* FUNCTION NAME:   air_vlan_setPortAttr
+ * PURPOSE:
+ *      Set vlan port attribute from the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      port        -- port id
+ *      attr        -- vlan port attr
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_setPortAttr(
+    const UI32_T    unit,
+    const UI32_T    port,
+    const AIR_VLAN_PORT_ATTR_T attr)
+{
+    AIR_ERROR_NO_T rc = AIR_E_OK;
+    UI32_T val = 0;
+
+    AIR_PARAM_CHK((port >= AIR_MAX_NUM_OF_PORTS), AIR_E_BAD_PARAMETER);
+    AIR_PARAM_CHK((attr >= AIR_VLAN_PORT_ATTR_LAST), AIR_E_BAD_PARAMETER);
+
+    aml_readReg(unit, PVC(port), &val);
+    val &= ~PVC_VLAN_ATTR_MASK;
+    val |= (attr & PVC_VLAN_ATTR_RELMASK) << PVC_VLAN_ATTR_OFFT;
+    aml_writeReg(unit, PVC(port), val);
+
+    return rc;
+}
+
+/* FUNCTION NAME:   air_vlan_getPortAttr
+ * PURPOSE:
+ *      Get vlan port attribute from the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      port        -- port id
+ * OUTPUT:
+ *      ptr_attr    -- vlan port attr
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_getPortAttr(
+    const UI32_T    unit,
+    const UI32_T    port,
+    AIR_VLAN_PORT_ATTR_T *ptr_attr)
+{
+    AIR_ERROR_NO_T rc = AIR_E_OK;
+    UI32_T val = 0;
+
+    AIR_PARAM_CHK((port >= AIR_MAX_NUM_OF_PORTS), AIR_E_BAD_PARAMETER);
+    AIR_CHECK_PTR(ptr_attr);
+
+    aml_readReg(unit, PVC(port), &val);
+    *ptr_attr = (val >> PVC_VLAN_ATTR_OFFT) & PVC_VLAN_ATTR_RELMASK;
+
+    return rc;
+}
+
+/* FUNCTION NAME:   air_vlan_setIgrPortTagAttr
+ * PURPOSE:
+ *      Set vlan incoming port egress tag attribute from the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      port        -- port id
+ *      attr        -- egress tag attr
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_setIgrPortTagAttr(
+    const UI32_T    unit,
+    const UI32_T    port,
+    const AIR_IGR_PORT_EG_TAG_ATTR_T attr)
+{
+    UI32_T val = 0;
+
+    AIR_PARAM_CHK((port >= AIR_MAX_NUM_OF_PORTS), AIR_E_BAD_PARAMETER);
+    AIR_PARAM_CHK((attr >= AIR_IGR_PORT_EG_TAG_ATTR_LAST), AIR_E_BAD_PARAMETER);
+
+    aml_readReg(unit, PVC(port), &val);
+    val &= ~PVC_EG_TAG_MASK;
+    val |= (attr & PVC_EG_TAG_RELMASK) << PVC_EG_TAG_OFFT;
+    aml_writeReg(unit, PVC(port), val);
+
+    return AIR_E_OK;
+}
+
+/* FUNCTION NAME:   air_vlan_getIgrPortTagAttr
+ * PURPOSE:
+ *      Get vlan incoming port egress tag attribute from the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      port        -- port id
+ * OUTPUT:
+ *      ptr_attr    -- egress tag attr
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_getIgrPortTagAttr(
+    const UI32_T    unit,
+    const UI32_T    port,
+    AIR_IGR_PORT_EG_TAG_ATTR_T *ptr_attr)
+{
+    UI32_T val = 0;
+
+    AIR_PARAM_CHK((port >= AIR_MAX_NUM_OF_PORTS), AIR_E_BAD_PARAMETER);
+    AIR_CHECK_PTR(ptr_attr);
+
+    aml_readReg(unit, PVC(port), &val);
+    *ptr_attr = (val >> PVC_EG_TAG_OFFT) & PVC_EG_TAG_RELMASK;
+
+    return AIR_E_OK;
+}
+
+/* FUNCTION NAME:   air_vlan_setPortEgsTagAttr
+ * PURPOSE:
+ *      Set vlan port egress tag attribute from the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      port        -- port id
+ *      attr        -- egress tag attr
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_setPortEgsTagAttr(
+    const UI32_T    unit,
+    const UI32_T    port,
+    const AIR_PORT_EGS_TAG_ATTR_T attr)
+{
+    UI32_T val = 0;
+
+    AIR_PARAM_CHK((port >= AIR_MAX_NUM_OF_PORTS), AIR_E_BAD_PARAMETER);
+    AIR_PARAM_CHK((attr >= AIR_PORT_EGS_TAG_ATTR_LAST), AIR_E_BAD_PARAMETER);
+
+    aml_readReg(unit, PCR(port), &val);
+    val &= ~PCR_EG_TAG_MASK;
+    val |= (attr & PCR_EG_TAG_RELMASK) << PCR_EG_TAG_OFFT;
+    aml_writeReg(unit, PCR(port), val);
+
+    return AIR_E_OK;
+}
+
+/* FUNCTION NAME:   air_vlan_getPortEgsTagAttr
+ * PURPOSE:
+ *      Get vlan port egress tag attribute from the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      port        -- port id
+ * OUTPUT:
+ *      ptr_attr    -- egress tag attr
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_getPortEgsTagAttr(
+    const UI32_T    unit,
+    const UI32_T    port,
+    AIR_PORT_EGS_TAG_ATTR_T *ptr_attr)
+{
+    UI32_T val = 0;
+
+    AIR_PARAM_CHK((port >= AIR_MAX_NUM_OF_PORTS), AIR_E_BAD_PARAMETER);
+    AIR_CHECK_PTR(ptr_attr);
+
+    aml_readReg(unit, PCR(port), &val);
+    *ptr_attr = (val >> PCR_EG_TAG_OFFT) & PCR_EG_TAG_RELMASK;
+
+    return AIR_E_OK;
+}
+
+/* FUNCTION NAME:   air_vlan_setPortOuterTPID
+ * PURPOSE:
+ *      Set stack tag TPID of the port from the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      port        -- port id
+ *      tpid        -- TPID
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_setPortOuterTPID(
+    const UI32_T    unit,
+    const UI32_T    port,
+    const UI16_T    tpid)
+{
+    UI32_T val = 0;
+
+    AIR_PARAM_CHK((port >= AIR_MAX_NUM_OF_PORTS), AIR_E_BAD_PARAMETER);
+
+    aml_readReg(unit, PVC(port), &val);
+    val &= ~PVC_STAG_VPID_MASK;
+    val |= (tpid & PVC_STAG_VPID_RELMASK) << PVC_STAG_VPID_OFFT;
+    aml_writeReg(unit, PVC(port), val);
+
+    return AIR_E_OK;
+}
+
+/* FUNCTION NAME:   air_vlan_getPortOuterTPID
+ * PURPOSE:
+ *      Get stack tag TPID of the port from the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      port        -- port id
+ * OUTPUT:
+ *      ptr_tpid    -- TPID
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_getPortOuterTPID(
+    const UI32_T    unit,
+    const UI32_T    port,
+    UI16_T          *ptr_tpid)
+{
+    UI32_T val = 0;
+
+    AIR_PARAM_CHK((port >= AIR_MAX_NUM_OF_PORTS), AIR_E_BAD_PARAMETER);
+    AIR_CHECK_PTR(ptr_tpid);
+
+    aml_readReg(unit, PVC(port), &val);
+    *ptr_tpid = (val >> PVC_STAG_VPID_OFFT) & PVC_STAG_VPID_RELMASK;
+
+    return AIR_E_OK;
+}
+
+/* FUNCTION NAME:   air_vlan_setPortPVID
+ * PURPOSE:
+ *      Set PVID of the port from the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      port        -- port id
+ *      pvid        -- native vlan id
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_setPortPVID(
+    const UI32_T    unit,
+    const UI32_T    port,
+    const UI16_T    pvid)
+{
+    UI32_T val = 0;
+
+    AIR_PARAM_CHK((port >= AIR_MAX_NUM_OF_PORTS), AIR_E_BAD_PARAMETER);
+    AIR_PARAM_CHK((pvid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
+
+    aml_readReg(unit, PVID(port), &val);
+    val &= ~PVID_PCVID_MASK;
+    val |= (pvid & PVID_PCVID_RELMASK) << PVID_PCVID_OFFT;
+    aml_writeReg(unit, PVID(port), val);
+
+    return AIR_E_OK;
+}
+
+/* FUNCTION NAME:   air_vlan_getPortPVID
+ * PURPOSE:
+ *      Get PVID of the port from the specified device.
+ * INPUT:
+ *      unit        -- unit id
+ *      port        -- port id
+ * OUTPUT:
+ *      ptr_pvid    -- native vlan id
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_getPortPVID(
+    const UI32_T    unit,
+    const UI32_T    port,
+    UI16_T          *ptr_pvid)
+{
+    UI32_T val = 0;
+
+    AIR_PARAM_CHK((port >= AIR_MAX_NUM_OF_PORTS), AIR_E_BAD_PARAMETER);
+    AIR_CHECK_PTR(ptr_pvid);
+
+    aml_readReg(unit, PVID(port), &val);
+    *ptr_pvid = (val >> PVID_PCVID_OFFT) & PVID_PCVID_RELMASK;
+
+    return AIR_E_OK;
+}
+
+/* FUNCTION NAME:   air_vlan_setServiceTag
+ * PURPOSE:
+ *      Set Vlan service tag.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id
+ *      stag        -- service stag
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_setServiceTag(
+    const UI32_T    unit,
+    const UI16_T    vid,
+    const UI16_T    stag)
+{
+    AIR_VLAN_ENTRY_T vlan_entry = {0};
+
+    AIR_PARAM_CHK((vid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
+    AIR_PARAM_CHK((stag > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
+
+    _air_vlan_readEntry(unit, vid, &vlan_entry);
+    if (!vlan_entry.valid)
+        return AIR_E_ENTRY_NOT_FOUND;
+
+    vlan_entry.vlan_entry_format.stag = stag;
+    _air_vlan_writeEntry(unit, vid, &vlan_entry);
+
+    return AIR_E_OK;
+}
+
+/* FUNCTION NAME:   air_vlan_getServiceTag
+ * PURPOSE:
+ *      Get Vlan service tag.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id
+ * OUTPUT:
+ *      ptr_stag    -- service stag
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_getServiceTag(
+    const UI32_T    unit,
+    const UI16_T    vid,
+    UI16_T          *ptr_stag)
+{
+    AIR_VLAN_ENTRY_T vlan_entry = {0};
+
+    AIR_PARAM_CHK((vid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
+    AIR_CHECK_PTR(ptr_stag);
+
+    _air_vlan_readEntry(unit, vid, &vlan_entry);
+    if (!vlan_entry.valid)
+        return AIR_E_ENTRY_NOT_FOUND;
+
+    *ptr_stag = vlan_entry.vlan_entry_format.stag;
+
+    return AIR_E_OK;
+}
+
+/* FUNCTION NAME:   air_vlan_setEgsTagCtlEnable
+ * PURPOSE:
+ *      Set per vlan egress tag control.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id
+ *      enable      -- enable vlan egress tag control
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_setEgsTagCtlEnable(
+    const UI32_T    unit,
+    const UI16_T    vid,
+    const BOOL_T    enable)
+{
+    AIR_VLAN_ENTRY_T vlan_entry = {0};
+
+    AIR_PARAM_CHK((vid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
+
+    _air_vlan_readEntry(unit, vid, &vlan_entry);
+    if (!vlan_entry.valid)
+        return AIR_E_ENTRY_NOT_FOUND;
+
+    vlan_entry.vlan_entry_format.eg_ctrl_en = enable ? 1 : 0;
+    _air_vlan_writeEntry(unit, vid, &vlan_entry);
+
+    return AIR_E_OK;
+}
+
+/* FUNCTION NAME:   air_vlan_getEgsTagCtlEnable
+ * PURPOSE:
+ *      Get per vlan egress tag control.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id
+ * OUTPUT:
+ *      ptr_enable  -- enable vlan egress tag control
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_getEgsTagCtlEnable(
+    const UI32_T    unit,
+    const UI16_T    vid,
+    BOOL_T          *ptr_enable)
+{
+    AIR_VLAN_ENTRY_T vlan_entry = {0};
+
+    AIR_PARAM_CHK((vid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
+    AIR_CHECK_PTR(ptr_enable);
+
+    _air_vlan_readEntry(unit, vid, &vlan_entry);
+    if (!vlan_entry.valid)
+        return AIR_E_ENTRY_NOT_FOUND;
+
+    *ptr_enable = vlan_entry.vlan_entry_format.eg_ctrl_en;
+
+    return AIR_E_OK;
+}
+
+/* FUNCTION NAME:   air_vlan_setEgsTagConsistent
+ * PURPOSE:
+ *      Set per vlan egress tag consistent.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id
+ *      enable      -- enable vlan egress tag consistent
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_setEgsTagConsistent(
+    const UI32_T    unit,
+    const UI16_T    vid,
+    const BOOL_T    enable)
+{
+    AIR_VLAN_ENTRY_T vlan_entry = {0};
+
+    AIR_PARAM_CHK((vid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
+
+    _air_vlan_readEntry(unit, vid, &vlan_entry);
+    if (!vlan_entry.valid)
+        return AIR_E_ENTRY_NOT_FOUND;
+
+    vlan_entry.vlan_entry_format.eg_con = enable;
+    _air_vlan_writeEntry(unit, vid, &vlan_entry);
+
+    return AIR_E_OK;
+}
+
+/* FUNCTION NAME:   air_vlan_getEgsTagConsistent
+ * PURPOSE:
+ *      Get per vlan egress tag consistent.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id
+ * OUTPUT:
+ *      ptr_enable  -- enable vlan egress tag consistent
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_getEgsTagConsistent(
+    const UI32_T    unit,
+    const UI16_T    vid,
+    BOOL_T          *ptr_enable)
+{
+    AIR_VLAN_ENTRY_T vlan_entry = {0};
+
+    AIR_PARAM_CHK((vid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
+    AIR_CHECK_PTR(ptr_enable);
+
+    _air_vlan_readEntry(unit, vid, &vlan_entry);
+    if (!vlan_entry.valid)
+        return AIR_E_ENTRY_NOT_FOUND;
+
+    *ptr_enable = vlan_entry.vlan_entry_format.eg_con;
+
+    return AIR_E_OK;
+}
+
+/* FUNCTION NAME:   air_vlan_setPortBasedStag
+ * PURPOSE:
+ *      Set vlan port based stag enable.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id
+ *      enable      -- vlan port based stag enable
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_setPortBasedStag(
+    const UI32_T    unit,
+    const UI16_T    vid,
+    const BOOL_T    enable)
+{
+    AIR_VLAN_ENTRY_T vlan_entry = {0};
+
+    AIR_PARAM_CHK((vid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
+
+    _air_vlan_readEntry(unit, vid, &vlan_entry);
+    if (!vlan_entry.valid)
+        return AIR_E_ENTRY_NOT_FOUND;
+
+    vlan_entry.vlan_entry_format.port_stag = enable;
+    _air_vlan_writeEntry(unit, vid, &vlan_entry);
+
+    return AIR_E_OK;
+}
+
+/* FUNCTION NAME:   air_vlan_getPortBasedStag
+ * PURPOSE:
+ *      Get vlan port based stag enable.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id
+ * OUTPUT:
+ *      ptr_enable  -- vlan port based stag enable
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_getPortBasedStag(
+    const UI32_T    unit,
+    const UI16_T    vid,
+    BOOL_T          *ptr_enable)
+{
+    AIR_VLAN_ENTRY_T vlan_entry = {0};
+
+    AIR_PARAM_CHK((vid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
+    AIR_CHECK_PTR(ptr_enable);
+
+    _air_vlan_readEntry(unit, vid, &vlan_entry);
+    if (!vlan_entry.valid)
+        return AIR_E_ENTRY_NOT_FOUND;
+
+    *ptr_enable = vlan_entry.vlan_entry_format.port_stag;
+
+    return AIR_E_OK;
+}
+
+/* FUNCTION NAME:   air_vlan_setPortEgsTagCtl
+ * PURPOSE:
+ *      Set vlan port egress tag control.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id
+ *      port        -- port id
+ *      tag_ctl     -- egress tag control
+ * OUTPUT:
+ *      None
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_setPortEgsTagCtl(
+    const UI32_T    unit,
+    const UI16_T    vid,
+    const UI32_T    port,
+    const AIR_VLAN_PORT_EGS_TAG_CTL_TYPE_T    tag_ctl)
+{
+    AIR_VLAN_ENTRY_T vlan_entry = {0};
+
+    AIR_PARAM_CHK((vid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
+    AIR_PARAM_CHK((port >= AIR_MAX_NUM_OF_PORTS), AIR_E_BAD_PARAMETER);
+    AIR_PARAM_CHK((tag_ctl >= AIR_PORT_EGS_TAG_ATTR_LAST), AIR_E_BAD_PARAMETER);
+
+    _air_vlan_readEntry(unit, vid, &vlan_entry);
+    if (!vlan_entry.valid)
+        return AIR_E_ENTRY_NOT_FOUND;
+
+    vlan_entry.vlan_entry_format.eg_ctrl &= ~(0x3 << (port * 2));
+    vlan_entry.vlan_entry_format.eg_ctrl |= (tag_ctl & 0x3) << (port * 2);
+    _air_vlan_writeEntry(unit, vid, &vlan_entry);
+
+    return AIR_E_OK;
+}
+
+/* FUNCTION NAME:   air_vlan_getPortEgsTagCtl
+ * PURPOSE:
+ *      Get vlan port egress tag control.
+ * INPUT:
+ *      unit        -- unit id
+ *      vid         -- vlan id
+ * OUTPUT:
+ *      ptr_tag_ctl -- egress tag control
+ * RETURN:
+ *      AIR_E_OK                -- Successfully read the data.
+ *      AIR_E_OTHERS            -- Operation failed.
+ *      AIR_E_BAD_PARAMETER     -- Invalid parameter.
+ * NOTES:
+ *      none
+ */
+AIR_ERROR_NO_T
+air_vlan_getPortEgsTagCtl(
+    const UI32_T    unit,
+    const UI16_T    vid,
+    const UI32_T    port,
+    AIR_VLAN_PORT_EGS_TAG_CTL_TYPE_T   *ptr_tag_ctl)
+{
+    AIR_VLAN_ENTRY_T vlan_entry = {0};
+
+    AIR_PARAM_CHK((vid > AIR_VLAN_ID_MAX), AIR_E_BAD_PARAMETER);
+    AIR_PARAM_CHK((port >= AIR_MAX_NUM_OF_PORTS), AIR_E_BAD_PARAMETER);
+    AIR_CHECK_PTR(ptr_tag_ctl);
+
+    _air_vlan_readEntry(unit, vid, &vlan_entry);
+    if (!vlan_entry.valid)
+        return AIR_E_ENTRY_NOT_FOUND;
+
+    *ptr_tag_ctl = (vlan_entry.vlan_entry_format.eg_ctrl >> (port * 2)) & 0x3;
+
+    return AIR_E_OK;
+}
diff --git a/recipes-devtools/switch/files/src/an8855_sdk/core/an8855_mdio.h b/recipes-devtools/switch/files/src/an8855_sdk/core/an8855_mdio.h
index c2d4bd7..5322393 100644
--- a/recipes-devtools/switch/files/src/an8855_sdk/core/an8855_mdio.h
+++ b/recipes-devtools/switch/files/src/an8855_sdk/core/an8855_mdio.h
@@ -1,203 +1,203 @@
-/* FILE NAME:  an8855_mdio.h
- * PURPOSE:
- *      It provides AN8855 mdio access API.
- * NOTES:
- *
- */
-
-#ifndef AN8855_MDIO_H
-#define AN8855_MDIO_H
-
-/* INCLUDE FILE DECLARATIONS
- */
-//#include "CTP_type.h"
-//#include "CTP_shell.h"
-//#include "common.h"
-//#include "eth.h"
-
-/* NAMING CONSTANT DECLARATIONS
- */
-
-/* MACRO FUNCTION DECLARATIONS
- */
-/* Attention!! Customer should define udelay function */
-void delayUs(int usecond);
-#define an8855_udelay(us) delayUs(us)
-
-/* Attention!! Customer should define dbg_print to get dbg output */
-#ifndef dbg_print
-#define dbg_print(...)
-#endif
-
-#define AN8855_PHY_NUM                      5
-
-/* DATA TYPE DECLARATIONS
- */
-#ifndef NULL
-#define NULL 0L
-#endif
-
-#ifndef u32
-#define u32 unsigned int
-#endif
-
-#ifndef u16
-#define u16 unsigned short
-#endif
-
-#ifndef u8
-#define u8 unsigned char
-#endif
-
-typedef u32 (*AIR_MII_READ_FUNC_T) (u32 phy_addr, u32 reg, u32 *p_data);
-
-typedef u32 (*AIR_MII_WRITE_FUNC_T) (u32 phy_addr, u32 reg, u32 data);
-
-typedef u32 (*AIR_MII_C45_READ_FUNC_T) (u32 phy_addr, u32 dev, u32 reg, u32 *p_data);
-
-typedef u32 (*AIR_MII_C45_WRITE_FUNC_T) (u32 phy_addr, u32 dev, u32 reg, u32 data);
-
-extern u32 g_smi_addr;
-
-/* EXPORTED SUBPROGRAM SPECIFICATIONS
- */
-
-/* FUNCTION NAME:   an8855_set_smi_addr
- * PURPOSE:
- *      This API is used to set an8855 smi address.
- * INPUT:
- *      smi_addr -- AN8855 smi address
- * OUTPUT:
- * RETURN:
- * NOTES:
- *      None
- */
-void
-an8855_set_smi_addr(u32 smi_addr);
-
-/* FUNCTION NAME:   an8855_set_mii_callback
- * PURPOSE:
- *      This API is used to set an8855 mii access callbacks.
- * INPUT:
- *      mii_read -- mii read api function
- *      mii_write -- mii write api function
- * OUTPUT:
- * RETURN:
- *      0     -- Successfully set callback.
- *      -1    -- Setting callback failed.
- * NOTES:
- *      None
- */
-int
-an8855_set_mii_callback(
-    AIR_MII_READ_FUNC_T mii_read, 
-    AIR_MII_WRITE_FUNC_T mii_write,
-    AIR_MII_C45_READ_FUNC_T mii_c45_read, 
-    AIR_MII_C45_WRITE_FUNC_T mii_c45_write);
-
-/* FUNCTION NAME:   an8855_reg_read
- * PURPOSE:
- *      This API is used read an8855 registers.
- * INPUT:
- *      reg -- register offset
- * OUTPUT:
- * RETURN:
- *      Register value
- * NOTES:
- *      Attention!! Customer should implement mdio mutex
- *      lock in this func
- */
-u32
-an8855_reg_read(u32 reg);
-
-/* FUNCTION NAME:   an8855_reg_write
- * PURPOSE:
- *      This API is used write an8855 registers.
- * INPUT:
- *      reg -- register offset
- *      val -- register value
- * OUTPUT:
- * RETURN:
- * NOTES:
- *      Attention!! Customer should implement mdio mutex
- *      lock in this func
- */
-void
-an8855_reg_write(u32 reg, u32 val);
-
-/* FUNCTION NAME:   an8855_phy_read
- * PURPOSE:
- *      This API is used read an8855 phy registers.
- * INPUT:
- *      port_num -- port number, 0~4
- *      reg -- phy register offset
- * OUTPUT:
- *      p_val -- phy register value
- * RETURN:
- *      0 -- read success
- *      -1 -- read failure
- * NOTES:
- *      Attention!! Customer should implement mii mutex
- *      lock in this func
- */
-int
-an8855_phy_read(u32 port_num, u32 reg, u32 *p_val);
-
-/* FUNCTION NAME:   an8855_phy_write
- * PURPOSE:
- *      This API is used write an8855 phy registers.
- * INPUT:
- *      port_num -- port number, 0~4
- *      reg -- phy register offset
- *      val -- phy register value
- * OUTPUT:
- * RETURN:
- *      0 -- write success
- *      -1 -- write failure
- * NOTES:
- *      Attention!! Customer should implement mii mutex
- *      lock in this func
- */
-int
-an8855_phy_write(u32 port_num, u32 reg, u32 val);
-
-/* FUNCTION NAME:   an8855_phy_read_cl45
- * PURPOSE:
- *      This API is used read an8855 phy registers.
- * INPUT:
- *      port_num -- port number, 0~4
- *      dev_addr -- phy device type
- *      reg_addr -- phy register offset
- * OUTPUT:
- *      p_val -- phy register value
- * RETURN:
- *      0 -- read success
- *      -1 -- read failure
- * NOTES:
- *      Attention!! Customer should implement mii mutex
- *      lock in this func or before/after calling this func
- */
-u32
-an8855_phy_read_cl45(u32 port_num, u32 dev_addr, u32 reg_addr, u32 *p_val);
-
-/* FUNCTION NAME:   an8855_phy_write_cl45
- * PURPOSE:
- *      This API is used write an8855 phy registers.
- * INPUT:
- *      port_num -- port number, 0~4
- *      dev_addr -- phy device type
- *      reg_addr -- phy register offset
- *      val -- phy register value
- * OUTPUT:
- * RETURN:
- *      0 -- write success
- *      -1 -- write failure
- * NOTES:
- *      Attention!! Customer should implement mii mutex
- *      lock in this func or before/after calling this func
- */
-int
-an8855_phy_write_cl45(u32 port_num, u32 dev_addr, u32 reg_addr, u32 val);
-
-#endif  /* End of AN8855_MDIO_H */
-
+/* FILE NAME:  an8855_mdio.h
+ * PURPOSE:
+ *      It provides AN8855 mdio access API.
+ * NOTES:
+ *
+ */
+
+#ifndef AN8855_MDIO_H
+#define AN8855_MDIO_H
+
+/* INCLUDE FILE DECLARATIONS
+ */
+//#include "CTP_type.h"
+//#include "CTP_shell.h"
+//#include "common.h"
+//#include "eth.h"
+
+/* NAMING CONSTANT DECLARATIONS
+ */
+
+/* MACRO FUNCTION DECLARATIONS
+ */
+/* Attention!! Customer should define udelay function */
+void delayUs(int usecond);
+#define an8855_udelay(us) delayUs(us)
+
+/* Attention!! Customer should define dbg_print to get dbg output */
+#ifndef dbg_print
+#define dbg_print(...)
+#endif
+
+#define AN8855_PHY_NUM                      5
+
+/* DATA TYPE DECLARATIONS
+ */
+#ifndef NULL
+#define NULL 0L
+#endif
+
+#ifndef u32
+#define u32 unsigned int
+#endif
+
+#ifndef u16
+#define u16 unsigned short
+#endif
+
+#ifndef u8
+#define u8 unsigned char
+#endif
+
+typedef u32 (*AIR_MII_READ_FUNC_T) (u32 phy_addr, u32 reg, u32 *p_data);
+
+typedef u32 (*AIR_MII_WRITE_FUNC_T) (u32 phy_addr, u32 reg, u32 data);
+
+typedef u32 (*AIR_MII_C45_READ_FUNC_T) (u32 phy_addr, u32 dev, u32 reg, u32 *p_data);
+
+typedef u32 (*AIR_MII_C45_WRITE_FUNC_T) (u32 phy_addr, u32 dev, u32 reg, u32 data);
+
+extern u32 g_smi_addr;
+
+/* EXPORTED SUBPROGRAM SPECIFICATIONS
+ */
+
+/* FUNCTION NAME:   an8855_set_smi_addr
+ * PURPOSE:
+ *      This API is used to set an8855 smi address.
+ * INPUT:
+ *      smi_addr -- AN8855 smi address
+ * OUTPUT:
+ * RETURN:
+ * NOTES:
+ *      None
+ */
+void
+an8855_set_smi_addr(u32 smi_addr);
+
+/* FUNCTION NAME:   an8855_set_mii_callback
+ * PURPOSE:
+ *      This API is used to set an8855 mii access callbacks.
+ * INPUT:
+ *      mii_read -- mii read api function
+ *      mii_write -- mii write api function
+ * OUTPUT:
+ * RETURN:
+ *      0     -- Successfully set callback.
+ *      -1    -- Setting callback failed.
+ * NOTES:
+ *      None
+ */
+int
+an8855_set_mii_callback(
+    AIR_MII_READ_FUNC_T mii_read, 
+    AIR_MII_WRITE_FUNC_T mii_write,
+    AIR_MII_C45_READ_FUNC_T mii_c45_read, 
+    AIR_MII_C45_WRITE_FUNC_T mii_c45_write);
+
+/* FUNCTION NAME:   an8855_reg_read
+ * PURPOSE:
+ *      This API is used read an8855 registers.
+ * INPUT:
+ *      reg -- register offset
+ * OUTPUT:
+ * RETURN:
+ *      Register value
+ * NOTES:
+ *      Attention!! Customer should implement mdio mutex
+ *      lock in this func
+ */
+u32
+an8855_reg_read(u32 reg);
+
+/* FUNCTION NAME:   an8855_reg_write
+ * PURPOSE:
+ *      This API is used write an8855 registers.
+ * INPUT:
+ *      reg -- register offset
+ *      val -- register value
+ * OUTPUT:
+ * RETURN:
+ * NOTES:
+ *      Attention!! Customer should implement mdio mutex
+ *      lock in this func
+ */
+void
+an8855_reg_write(u32 reg, u32 val);
+
+/* FUNCTION NAME:   an8855_phy_read
+ * PURPOSE:
+ *      This API is used read an8855 phy registers.
+ * INPUT:
+ *      port_num -- port number, 0~4
+ *      reg -- phy register offset
+ * OUTPUT:
+ *      p_val -- phy register value
+ * RETURN:
+ *      0 -- read success
+ *      -1 -- read failure
+ * NOTES:
+ *      Attention!! Customer should implement mii mutex
+ *      lock in this func
+ */
+int
+an8855_phy_read(u32 port_num, u32 reg, u32 *p_val);
+
+/* FUNCTION NAME:   an8855_phy_write
+ * PURPOSE:
+ *      This API is used write an8855 phy registers.
+ * INPUT:
+ *      port_num -- port number, 0~4
+ *      reg -- phy register offset
+ *      val -- phy register value
+ * OUTPUT:
+ * RETURN:
+ *      0 -- write success
+ *      -1 -- write failure
+ * NOTES:
+ *      Attention!! Customer should implement mii mutex
+ *      lock in this func
+ */
+int
+an8855_phy_write(u32 port_num, u32 reg, u32 val);
+
+/* FUNCTION NAME:   an8855_phy_read_cl45
+ * PURPOSE:
+ *      This API is used read an8855 phy registers.
+ * INPUT:
+ *      port_num -- port number, 0~4
+ *      dev_addr -- phy device type
+ *      reg_addr -- phy register offset
+ * OUTPUT:
+ *      p_val -- phy register value
+ * RETURN:
+ *      0 -- read success
+ *      -1 -- read failure
+ * NOTES:
+ *      Attention!! Customer should implement mii mutex
+ *      lock in this func or before/after calling this func
+ */
+u32
+an8855_phy_read_cl45(u32 port_num, u32 dev_addr, u32 reg_addr, u32 *p_val);
+
+/* FUNCTION NAME:   an8855_phy_write_cl45
+ * PURPOSE:
+ *      This API is used write an8855 phy registers.
+ * INPUT:
+ *      port_num -- port number, 0~4
+ *      dev_addr -- phy device type
+ *      reg_addr -- phy register offset
+ *      val -- phy register value
+ * OUTPUT:
+ * RETURN:
+ *      0 -- write success
+ *      -1 -- write failure
+ * NOTES:
+ *      Attention!! Customer should implement mii mutex
+ *      lock in this func or before/after calling this func
+ */
+int
+an8855_phy_write_cl45(u32 port_num, u32 dev_addr, u32 reg_addr, u32 val);
+
+#endif  /* End of AN8855_MDIO_H */
+
diff --git a/recipes-devtools/switch/files/src/an8855_sdk/core/an8855_phy.h b/recipes-devtools/switch/files/src/an8855_sdk/core/an8855_phy.h
index 3c810e7..70836e8 100644
--- a/recipes-devtools/switch/files/src/an8855_sdk/core/an8855_phy.h
+++ b/recipes-devtools/switch/files/src/an8855_sdk/core/an8855_phy.h
@@ -1,409 +1,409 @@
-/* FILE NAME:  an8855_phy.h
- * PURPOSE:
- *      It provides AN8855 phy definition.
- * NOTES:
- *
- */
-
-#ifndef _AN8855_PHY_H_
-#define _AN8855_PHY_H_
-
-
-/* Type Definitions */
-#define int8_t char
-#define uint8_t unsigned char
-#define int16_t short
-#define uint16_t unsigned short
-#define int32_t int
-#define uint32_t unsigned int
-/* DATA TYPE DECLARATIONS
- */
-typedef int                 BOOL_T;
-typedef signed char         I8_T;
-typedef unsigned char       UI8_T;
-typedef signed short        I16_T;
-typedef unsigned short      UI16_T;
-typedef signed int          I32_T;
-typedef unsigned int        UI32_T;
-typedef char                C8_T;
-typedef unsigned long long  UI64_T;
-
-typedef UI8_T   AIR_MAC_T[6];
-
-/* Debug flags */
-//#define _MDIO_BOOTS_MODE     1 // Boots for preamble
-#define _DEBUG_PRINT         1 // Debug print for Arduino
-//#define _DEBUG_PRINT_eFuse     1
-#define _write_eFuse     1
-
-#define _DEBUG_SCAN_ALL      0 // Scan all Code for SerDes Calibration
-#define _WRITE_RG_DIR        1 // Write RG directly for Calibration
-#define _USER_DEFINE_MODE    0 // Replace to user-defined RG for Calibration
-#define _DEBUG_MANUAL        1 // dbg_20210604  // manual dbg_20210604
-/**************************************************************************/
-
-/* Phy Address */
-//#define phyadd_common 0x1d            // EN8801
-//#define PHY_NUM 1             // EN8801
-//#define phyadd_common 0x9         // EN7523
-//#define PHY_NUM 4             // EN7523
-//#define phyadd_common 0x0         // EN8850
-//#define PHY_NUM   5           // EN8850
-#define PHY_NUM   4             // EN8851
-#define CALIPOLARITY  1
-
-#define TXAMP_offset  0    // for 8851
-
-/* On/Off */
-//#define ENABLE  1
-//#define DISABLE 0
-#define Relay_ENABLE  1
-#define Relay_DISABLE 0
-
-/* FT Pattern */
-#define _MDIO     0x0
-#define _I2C      0x1
-#define FT_USB3_T101    0x0
-#define FT_PCIE0_T101   0x1
-#define FT_PCIE1_T101   0x2
-#define FT_PON_T101     0x3
-
-/********* Digital pin definition *************/
-#define Relay_Tx_PN         22   // relay 1
-#define Relay_R_R50         23   // relay 2
-#define Relay_Tx_Vol        24   // relay 3
-#define Relay_Rx_Vol        25   // relay 4
-#define Relay_DUT_GND       26   // relay 5
-#define Relay_I2C           27   // PIN for SCL&SDA , relay 6
-//#define Relay_I2C_SCL       27   // PIN for SCL&SDA , relay 6
-//#define Relay_I2C_SDA       28   // PIN for SCL&SDA , relay 6
-
-#define pin_MDIO           36   // PIN for MDIO
-#define pin_MDC            37   // PIN for MDC
-#define FT_PATTERN_bit0    49   // PIN for FT0
-#define FT_PATTERN_bit1    48   // PIN for FT1
-#define Relay_MDIO         35   // PIN for MDIO relay, relay 7
-
-/***********************************************/
-/* Use for I/O register PORTA control */
-#define POR_Relay_Tx_PN    D22   // use for PORTA control, relay 1
-#define POR_Relay_R_R50    D23   // use for PORTA control, relay 2
-#define POR_Relay_Tx_Vol   D24   // use for PORTA control, relay 3
-#define POR_Relay_Rx_Vol   D25   // use for PORTA control, relay 4
-#define POR_Relay_DUT_GND  D26   // use for PORTA control, relay 5
-//#define POR_Relay_I2C      D27   // use for PORTA control, relay 6
-#define POR_Relay_I2C_SCL  D27   // use for PORTA control, relay 6
-#define POR_Relay_I2C_SDA  D28   // use for PORTA control, relay 7
-
-/* Use for I/O register PORTC control */
-#define POR_MDIO               D36  // use for PORTC control
-#define POR_MDC                D37  // use for PORTC control
-#define POR_Relay_MDIO         D35  // use for PORTC control, relay 7
-
-/* Use for I/O register PORTL control */
-#define POR_FT_PATTERN_bit0    D49  // use for PORTL control
-#define POR_FT_PATTERN_bit1    D48  // use for PORTL control
-
-
-/* I/O register Port A */
-#define D22   0
-#define D23   1
-#define D24   2
-#define D25   3
-#define D26   4
-#define D27   5
-#define D28   6
-#define D29   7
-
-/* I/O register Port C */
-#define D37   0
-#define D36   1
-#define D35   2
-#define D34   3
-#define D33   4
-#define D32   5
-#define D31   6
-#define D30   7
-
-/* I/O register Port L */
-#define D49   0
-#define D48   1
-#define D47   2
-#define D46   3
-#define D45   4
-#define D44   5
-#define D43   6
-#define D42   7
-
-/* I/O register Port D */
-#define D21   0
-#define D20   1
-#define D19   2
-#define D18   3
-
-
-/***************************************************************************
-**************************************************************************
-* MDC/MDIO
-***************************************************************************
-***************************************************************************/
-#define SET_HIGH(data, nbit) ((data)|=(nbit))
-#define SET_LOW(data, nbit) ((data)&=~(nbit))
-
-#define MDIO_ONE  _BV(POR_MDIO)
-#define MDIO_ZERO 0x00
-#define MDC_ONE   _BV(POR_MDC)
-#define MDC_ZERO  0x00
-
-#define delay_us delayMicroseconds(0)
-
-#define ANACAL_INIT        0x01
-#define ANACAL_ERROR       0xFD
-#define ANACAL_SATURATION  0xFE
-#define ANACAL_FINISH      0xFF
-#define ANACAL_PAIR_A      0
-#define ANACAL_PAIR_B      1
-#define ANACAL_PAIR_C      2
-#define ANACAL_PAIR_D      3
-#define DAC_IN_0V          0x000
-#define DAC_IN_2V          0x0f0  // +/-1V
-
-#define ZCAL_MIDDLE        0x20
-#define TX_OFFSET_0mV_idx  31
-#define TX_AMP_MIDDLE      0x20
-
-#define TX_i2mpb_hbt_ofs  0x4   // 8851 fine tune 100M v1 (20220414)
-#define R50_OFFSET_VALUE  0x5
-
-//============== definition value for GbE ===================//
-#define BG_VOLTAGE_OUT     0xc0
-#define FORCE_MDI          2
-#define FORCE_MDIX         3
-#define LDO_1p15_VOSEL_1   1
-#define RX_CAL_VALUE_9       0x3
-#define RX_CAL_HVGA_BW_2     0x2
-#define RX_CAL_DCO_Normal    0x0
-#define RX_CAL_DCO_BYPASS_TX_RX  0x3
-#define RX_CAL_DCO_0xF    0xF
-
-#define TANA_MON_DCV_SEL__MASK         0xE0
-#define TANA_MON_DCV_SEL__MPX_TANA_A   0x20
-#define TANA_MON_DCV_SEL__MPX_TANA_B   0x40
-#define TANA_MON_DCV_SEL__MPX_TANA_C   0x60
-#define TANA_MON_DCV_SEL__MPX_TANA_D   0x80
-#define TANA_MON_DCV_SEL__MONVC__MASK  0x008000C8
-#define TANA_MON_DCV__TANA__VBG_MON    0x000000C0
-#define TANA_MON_DCV__TANA__MONVC      0x000000C8
-
-#define AN_disable_force_1000M 0x0140
-#define BG_voltage_output 0xc000
-#define Fix_mdi 0x1010
-#define Disable_tx_slew_control 0x0000
-#define LDO_control 0x0100
-#define Cal_control_BG 0x1110
-#define Cal_control_R50 0x1100
-#define Cal_control_TX_AMP 0x1100
-#define Cal_control_TX_OFST 0x0100
-#define Cal_control_R50_pairA_ENABLE 0x1101
-#define Disable_all 0x0
-#define Zcalen_A_ENABLE 0x0000
-#define Zcalen_B_ENABLE 0x1000
-#define Zcalen_C_ENABLE 0x0100
-#define Zcalen_D_ENABLE 0x0010
-#define MASK_MSB_8bit 0xff00
-#define MASK_LSB_8bit 0x00ff
-#define MASK_r50ohm_rsel_tx_a 0x7f00
-#define MASK_r50ohm_rsel_tx_b 0x007f
-#define MASK_r50ohm_rsel_tx_c 0x7f00
-#define MASK_r50ohm_rsel_tx_d 0x007f
-#define Rg_r50ohm_rsel_tx_a_en 0x8000
-#define Rg_r50ohm_rsel_tx_b_en 0x0080
-#define Rg_r50ohm_rsel_tx_c_en 0x8000
-#define Rg_r50ohm_rsel_tx_d_en 0x0080
-#define Rg_txvos_calen_ENABLE 0x0001
-#define Bypass_tx_offset_cal 0x8000
-#define Enable_Tx_VLD 0xf808
-#define Rg_txg_calen_a_ENABLE 0x1000
-#define Rg_txg_calen_b_ENABLE 0x0100
-#define Rg_txg_calen_c_ENABLE 0x0010
-#define Rg_txg_calen_d_ENABLE 0x0001
-#define Force_dasn_dac_in0_ENABLE 0x8000
-#define Force_dasn_dac_in1_ENABLE 0x8000
-#define MASK_cr_tx_amp_offset_MSB 0x3f00
-#define MASK_cr_tx_amp_offset_LSB 0x003f
-#define Rg_cal_refsel_ENABLE 0x0010
-#define MASK_da_tx_i2mpb_a_gbe 0xfc00
-#define MASK_da_tx_i2mpb_b_c_d_gbe 0x3f00
-
-#define LED_basic_control_en_active_low 0x800a
-#define LED_led0_en_active_high 0xc007
-#define LED_led0_force_blinking 0x0200
-
-
-
-/*phy calibration use*/
-//Type defines
-typedef unsigned char    UINT8;
-typedef unsigned short   UINT16;
-typedef unsigned long    UINT32;
-
-typedef struct
-{
-  UINT16 DATA_Lo;
-  UINT8  DATA_Hi;
-}TR_DATA_T;
-
-//CL22 Reg Support Page Select//
-#define RgAddr_Reg1Fh        0x1f
-#define CL22_Page_Reg        0x0000
-#define CL22_Page_ExtReg     0x0001
-#define CL22_Page_MiscReg    0x0002
-#define CL22_Page_LpiReg     0x0003
-#define CL22_Page_tReg       0x02A3
-#define CL22_Page_TrReg      0x52B5
-
-//CL45 Reg Support DEVID//
-#define DEVID_03             0x03
-#define DEVID_07             0x07
-#define DEVID_1E             0x1E
-#define DEVID_1F             0x1F
-
-//TokenRing Reg Access//
-#define TrReg_PKT_XMT_STA    0x8000
-#define TrReg_WR             0x8000
-#define TrReg_RD             0xA000
-
-/* ----------------- gephy_all Bit Field Definitions ------------------- */
-
-
-
-//-------------------------------------
-//0x0000
-#define RgAddr_Reg00h                               0x00
-
-//0x51e01200
-#define RgAddr_dev1Eh_reg120h                       0x0120
-//0x51e01220
-#define RgAddr_dev1Eh_reg122h                       0x0122
-//0x51e01440
-#define RgAddr_dev1Eh_reg144h                       0x0144
-//0x51e014a0
-#define RgAddr_dev1Eh_reg14Ah                       0x014a
-//0x51e019b0
-#define RgAddr_dev1Eh_reg19Bh                       0x019b
-//0x51e02340
-#define RgAddr_dev1Eh_reg234h                       0x0234
-//0x51e02380
-#define RgAddr_dev1Eh_reg238h                       0x0238
-//0x51e02390
-#define RgAddr_dev1Eh_reg239h                       0x0239
-//0x51f02680
-#define RgAddr_dev1Fh_reg268h                       0x0268
-//0x51e02d10
-#define RgAddr_dev1Eh_reg2D1h                       0x02d1
-//0x51e03230
-#define RgAddr_dev1Eh_reg323h                       0x0323
-//0x51e03240
-#define RgAddr_dev1Eh_reg324h                       0x0324
-//0x51e03260
-#define RgAddr_dev1Eh_reg326h                       0x0326
-
-//0x51f01000
-#define RgAddr_dev1Fh_reg100h                       0x0100
-//0x51e01450
-#define RgAddr_dev1Eh_reg145h                       0x0145
-//0x51f00ff0
-#define RgAddr_dev1Fh_reg0FFh                       0x00ff
-//0x51e00db0
-#define RgAddr_dev1Eh_reg0DBh                       0x00db
-//0x51e00dc0
-#define RgAddr_dev1Eh_reg0DCh                       0x00dc
-//0x51e00e00
-#define RgAddr_dev1Eh_reg0E0h                       0x00e0
-//0x51e00e10
-#define RgAddr_dev1Eh_reg0E1h                       0x00e1
-//0x51e00e00
-#define RgAddr_dev1Eh_reg0E0h                       0x00e0
-//0x51e017a0
-#define RgAddr_dev1Eh_reg17Ah                       0x017a
-//0x51f01150
-#define RgAddr_dev1Fh_reg115h                       0x0115
-//0x51f01000
-#define RgAddr_dev1Fh_reg100h                       0x0100
-//0x51e01450
-#define RgAddr_dev1Eh_reg145h                       0x0145
-//0x51e01450
-#define RgAddr_dev1Eh_reg145h                       0x0145
-//0x51e01850
-#define RgAddr_dev1Eh_reg185h                       0x0185
-//0x51e00fb0
-#define RgAddr_dev1Eh_reg0FBh                       0x00fb
-//0x51e01740
-#define RgAddr_dev1Eh_reg174h                       0x0174
-//0x51e01750
-#define RgAddr_dev1Eh_reg175h                       0x0175
-//0x51e01850
-#define RgAddr_dev1Eh_reg185h                       0x0185
-//0x51e00fb0
-#define RgAddr_dev1Eh_reg0FBh                       0x00fb
-//0x51e00960
-#define RgAddr_dev1Eh_reg096h                       0x0096
-//0x51e003e0
-#define RgAddr_dev1Eh_reg03Eh                       0x003e
-//0x51e00dd0
-#define RgAddr_dev1Eh_reg0DDh                       0x00dd
-//0x51e017d0
-#define RgAddr_dev1Eh_reg17Dh                       0x017d
-//0x51e01810
-#define RgAddr_dev1Eh_reg181h                       0x0181
-//0x51e00120
-#define RgAddr_dev1Eh_reg012h                       0x0012
-//0x51e017e0
-#define RgAddr_dev1Eh_reg17Eh                       0x017e
-//0x51e01820
-#define RgAddr_dev1Eh_reg182h                       0x0182
-//0x51e00170
-#define RgAddr_dev1Eh_reg017h                       0x0017
-//0x51e01830
-#define RgAddr_dev1Eh_reg183h                       0x0183
-//0x51e00190
-#define RgAddr_dev1Eh_reg019h                       0x0019
-//0x51e01800
-#define RgAddr_dev1Eh_reg180h                       0x0180
-//0x51e01840
-#define RgAddr_dev1Eh_reg184h                       0x0184
-//0x51e00210
-#define RgAddr_dev1Eh_reg021h                       0x0021
-//0x51e01720
-#define RgAddr_dev1Eh_reg172h                       0x0172
-//0x51e01730
-#define RgAddr_dev1Eh_reg173h                       0x0173
-//0x51e017c0
-#define RgAddr_dev1Eh_reg17Ch                       0x017c
-//0x51e017f0
-#define RgAddr_dev1Eh_reg17Fh                       0x017f
-
-//0x52b5100
-#define RgAddr_TrReg10h                             0x10
-//0x52b5110
-#define RgAddr_TrReg11h                             0x11
-//0x52b5120
-#define RgAddr_TrReg12h                             0x12
-
-//0x31c0
-#define RgAddr_LpiReg1Ch                            0x1c
-//0x31d0
-#define RgAddr_LpiReg1Dh                            0x1d
-uint8_t BG_Calibration(uint8_t phyadd, int8_t calipolarity);
-uint8_t R50_Calibration(uint8_t phyadd, uint8_t phyadd_common);
-uint8_t TX_OFS_Calibration(uint8_t phyadd, uint8_t phyadd_common);
-uint8_t TX_AMP_Calibration(uint8_t phyadd, uint8_t phyadd_common);
-//void config_gphy_port(UINT8, UINT8);
-
-void set_gphy_reg_cl22(uint8_t, uint8_t, uint16_t);
-uint16_t get_gphy_reg_cl45(uint8_t, uint8_t, uint16_t);
-void set_gphy_reg_cl45(uint8_t, uint8_t, uint16_t, uint16_t);
-void anacal_exe(uint8_t);
-
-#endif /* _AN8855_PHY_H_ */
-
+/* FILE NAME:  an8855_phy.h
+ * PURPOSE:
+ *      It provides AN8855 phy definition.
+ * NOTES:
+ *
+ */
+
+#ifndef _AN8855_PHY_H_
+#define _AN8855_PHY_H_
+
+
+/* Type Definitions */
+#define int8_t char
+#define uint8_t unsigned char
+#define int16_t short
+#define uint16_t unsigned short
+#define int32_t int
+#define uint32_t unsigned int
+/* DATA TYPE DECLARATIONS
+ */
+typedef int                 BOOL_T;
+typedef signed char         I8_T;
+typedef unsigned char       UI8_T;
+typedef signed short        I16_T;
+typedef unsigned short      UI16_T;
+typedef signed int          I32_T;
+typedef unsigned int        UI32_T;
+typedef char                C8_T;
+typedef unsigned long long  UI64_T;
+
+typedef UI8_T   AIR_MAC_T[6];
+
+/* Debug flags */
+//#define _MDIO_BOOTS_MODE     1 // Boots for preamble
+#define _DEBUG_PRINT         1 // Debug print for Arduino
+//#define _DEBUG_PRINT_eFuse     1
+#define _write_eFuse     1
+
+#define _DEBUG_SCAN_ALL      0 // Scan all Code for SerDes Calibration
+#define _WRITE_RG_DIR        1 // Write RG directly for Calibration
+#define _USER_DEFINE_MODE    0 // Replace to user-defined RG for Calibration
+#define _DEBUG_MANUAL        1 // dbg_20210604  // manual dbg_20210604
+/**************************************************************************/
+
+/* Phy Address */
+//#define phyadd_common 0x1d            // EN8801
+//#define PHY_NUM 1             // EN8801
+//#define phyadd_common 0x9         // EN7523
+//#define PHY_NUM 4             // EN7523
+//#define phyadd_common 0x0         // EN8850
+//#define PHY_NUM   5           // EN8850
+#define PHY_NUM   4             // EN8851
+#define CALIPOLARITY  1
+
+#define TXAMP_offset  0    // for 8851
+
+/* On/Off */
+//#define ENABLE  1
+//#define DISABLE 0
+#define Relay_ENABLE  1
+#define Relay_DISABLE 0
+
+/* FT Pattern */
+#define _MDIO     0x0
+#define _I2C      0x1
+#define FT_USB3_T101    0x0
+#define FT_PCIE0_T101   0x1
+#define FT_PCIE1_T101   0x2
+#define FT_PON_T101     0x3
+
+/********* Digital pin definition *************/
+#define Relay_Tx_PN         22   // relay 1
+#define Relay_R_R50         23   // relay 2
+#define Relay_Tx_Vol        24   // relay 3
+#define Relay_Rx_Vol        25   // relay 4
+#define Relay_DUT_GND       26   // relay 5
+#define Relay_I2C           27   // PIN for SCL&SDA , relay 6
+//#define Relay_I2C_SCL       27   // PIN for SCL&SDA , relay 6
+//#define Relay_I2C_SDA       28   // PIN for SCL&SDA , relay 6
+
+#define pin_MDIO           36   // PIN for MDIO
+#define pin_MDC            37   // PIN for MDC
+#define FT_PATTERN_bit0    49   // PIN for FT0
+#define FT_PATTERN_bit1    48   // PIN for FT1
+#define Relay_MDIO         35   // PIN for MDIO relay, relay 7
+
+/***********************************************/
+/* Use for I/O register PORTA control */
+#define POR_Relay_Tx_PN    D22   // use for PORTA control, relay 1
+#define POR_Relay_R_R50    D23   // use for PORTA control, relay 2
+#define POR_Relay_Tx_Vol   D24   // use for PORTA control, relay 3
+#define POR_Relay_Rx_Vol   D25   // use for PORTA control, relay 4
+#define POR_Relay_DUT_GND  D26   // use for PORTA control, relay 5
+//#define POR_Relay_I2C      D27   // use for PORTA control, relay 6
+#define POR_Relay_I2C_SCL  D27   // use for PORTA control, relay 6
+#define POR_Relay_I2C_SDA  D28   // use for PORTA control, relay 7
+
+/* Use for I/O register PORTC control */
+#define POR_MDIO               D36  // use for PORTC control
+#define POR_MDC                D37  // use for PORTC control
+#define POR_Relay_MDIO         D35  // use for PORTC control, relay 7
+
+/* Use for I/O register PORTL control */
+#define POR_FT_PATTERN_bit0    D49  // use for PORTL control
+#define POR_FT_PATTERN_bit1    D48  // use for PORTL control
+
+
+/* I/O register Port A */
+#define D22   0
+#define D23   1
+#define D24   2
+#define D25   3
+#define D26   4
+#define D27   5
+#define D28   6
+#define D29   7
+
+/* I/O register Port C */
+#define D37   0
+#define D36   1
+#define D35   2
+#define D34   3
+#define D33   4
+#define D32   5
+#define D31   6
+#define D30   7
+
+/* I/O register Port L */
+#define D49   0
+#define D48   1
+#define D47   2
+#define D46   3
+#define D45   4
+#define D44   5
+#define D43   6
+#define D42   7
+
+/* I/O register Port D */
+#define D21   0
+#define D20   1
+#define D19   2
+#define D18   3
+
+
+/***************************************************************************
+**************************************************************************
+* MDC/MDIO
+***************************************************************************
+***************************************************************************/
+#define SET_HIGH(data, nbit) ((data)|=(nbit))
+#define SET_LOW(data, nbit) ((data)&=~(nbit))
+
+#define MDIO_ONE  _BV(POR_MDIO)
+#define MDIO_ZERO 0x00
+#define MDC_ONE   _BV(POR_MDC)
+#define MDC_ZERO  0x00
+
+#define delay_us delayMicroseconds(0)
+
+#define ANACAL_INIT        0x01
+#define ANACAL_ERROR       0xFD
+#define ANACAL_SATURATION  0xFE
+#define ANACAL_FINISH      0xFF
+#define ANACAL_PAIR_A      0
+#define ANACAL_PAIR_B      1
+#define ANACAL_PAIR_C      2
+#define ANACAL_PAIR_D      3
+#define DAC_IN_0V          0x000
+#define DAC_IN_2V          0x0f0  // +/-1V
+
+#define ZCAL_MIDDLE        0x20
+#define TX_OFFSET_0mV_idx  31
+#define TX_AMP_MIDDLE      0x20
+
+#define TX_i2mpb_hbt_ofs  0x4   // 8851 fine tune 100M v1 (20220414)
+#define R50_OFFSET_VALUE  0x5
+
+//============== definition value for GbE ===================//
+#define BG_VOLTAGE_OUT     0xc0
+#define FORCE_MDI          2
+#define FORCE_MDIX         3
+#define LDO_1p15_VOSEL_1   1
+#define RX_CAL_VALUE_9       0x3
+#define RX_CAL_HVGA_BW_2     0x2
+#define RX_CAL_DCO_Normal    0x0
+#define RX_CAL_DCO_BYPASS_TX_RX  0x3
+#define RX_CAL_DCO_0xF    0xF
+
+#define TANA_MON_DCV_SEL__MASK         0xE0
+#define TANA_MON_DCV_SEL__MPX_TANA_A   0x20
+#define TANA_MON_DCV_SEL__MPX_TANA_B   0x40
+#define TANA_MON_DCV_SEL__MPX_TANA_C   0x60
+#define TANA_MON_DCV_SEL__MPX_TANA_D   0x80
+#define TANA_MON_DCV_SEL__MONVC__MASK  0x008000C8
+#define TANA_MON_DCV__TANA__VBG_MON    0x000000C0
+#define TANA_MON_DCV__TANA__MONVC      0x000000C8
+
+#define AN_disable_force_1000M 0x0140
+#define BG_voltage_output 0xc000
+#define Fix_mdi 0x1010
+#define Disable_tx_slew_control 0x0000
+#define LDO_control 0x0100
+#define Cal_control_BG 0x1110
+#define Cal_control_R50 0x1100
+#define Cal_control_TX_AMP 0x1100
+#define Cal_control_TX_OFST 0x0100
+#define Cal_control_R50_pairA_ENABLE 0x1101
+#define Disable_all 0x0
+#define Zcalen_A_ENABLE 0x0000
+#define Zcalen_B_ENABLE 0x1000
+#define Zcalen_C_ENABLE 0x0100
+#define Zcalen_D_ENABLE 0x0010
+#define MASK_MSB_8bit 0xff00
+#define MASK_LSB_8bit 0x00ff
+#define MASK_r50ohm_rsel_tx_a 0x7f00
+#define MASK_r50ohm_rsel_tx_b 0x007f
+#define MASK_r50ohm_rsel_tx_c 0x7f00
+#define MASK_r50ohm_rsel_tx_d 0x007f
+#define Rg_r50ohm_rsel_tx_a_en 0x8000
+#define Rg_r50ohm_rsel_tx_b_en 0x0080
+#define Rg_r50ohm_rsel_tx_c_en 0x8000
+#define Rg_r50ohm_rsel_tx_d_en 0x0080
+#define Rg_txvos_calen_ENABLE 0x0001
+#define Bypass_tx_offset_cal 0x8000
+#define Enable_Tx_VLD 0xf808
+#define Rg_txg_calen_a_ENABLE 0x1000
+#define Rg_txg_calen_b_ENABLE 0x0100
+#define Rg_txg_calen_c_ENABLE 0x0010
+#define Rg_txg_calen_d_ENABLE 0x0001
+#define Force_dasn_dac_in0_ENABLE 0x8000
+#define Force_dasn_dac_in1_ENABLE 0x8000
+#define MASK_cr_tx_amp_offset_MSB 0x3f00
+#define MASK_cr_tx_amp_offset_LSB 0x003f
+#define Rg_cal_refsel_ENABLE 0x0010
+#define MASK_da_tx_i2mpb_a_gbe 0xfc00
+#define MASK_da_tx_i2mpb_b_c_d_gbe 0x3f00
+
+#define LED_basic_control_en_active_low 0x800a
+#define LED_led0_en_active_high 0xc007
+#define LED_led0_force_blinking 0x0200
+
+
+
+/*phy calibration use*/
+//Type defines
+typedef unsigned char    UINT8;
+typedef unsigned short   UINT16;
+typedef unsigned long    UINT32;
+
+typedef struct
+{
+  UINT16 DATA_Lo;
+  UINT8  DATA_Hi;
+}TR_DATA_T;
+
+//CL22 Reg Support Page Select//
+#define RgAddr_Reg1Fh        0x1f
+#define CL22_Page_Reg        0x0000
+#define CL22_Page_ExtReg     0x0001
+#define CL22_Page_MiscReg    0x0002
+#define CL22_Page_LpiReg     0x0003
+#define CL22_Page_tReg       0x02A3
+#define CL22_Page_TrReg      0x52B5
+
+//CL45 Reg Support DEVID//
+#define DEVID_03             0x03
+#define DEVID_07             0x07
+#define DEVID_1E             0x1E
+#define DEVID_1F             0x1F
+
+//TokenRing Reg Access//
+#define TrReg_PKT_XMT_STA    0x8000
+#define TrReg_WR             0x8000
+#define TrReg_RD             0xA000
+
+/* ----------------- gephy_all Bit Field Definitions ------------------- */
+
+
+
+//-------------------------------------
+//0x0000
+#define RgAddr_Reg00h                               0x00
+
+//0x51e01200
+#define RgAddr_dev1Eh_reg120h                       0x0120
+//0x51e01220
+#define RgAddr_dev1Eh_reg122h                       0x0122
+//0x51e01440
+#define RgAddr_dev1Eh_reg144h                       0x0144
+//0x51e014a0
+#define RgAddr_dev1Eh_reg14Ah                       0x014a
+//0x51e019b0
+#define RgAddr_dev1Eh_reg19Bh                       0x019b
+//0x51e02340
+#define RgAddr_dev1Eh_reg234h                       0x0234
+//0x51e02380
+#define RgAddr_dev1Eh_reg238h                       0x0238
+//0x51e02390
+#define RgAddr_dev1Eh_reg239h                       0x0239
+//0x51f02680
+#define RgAddr_dev1Fh_reg268h                       0x0268
+//0x51e02d10
+#define RgAddr_dev1Eh_reg2D1h                       0x02d1
+//0x51e03230
+#define RgAddr_dev1Eh_reg323h                       0x0323
+//0x51e03240
+#define RgAddr_dev1Eh_reg324h                       0x0324
+//0x51e03260
+#define RgAddr_dev1Eh_reg326h                       0x0326
+
+//0x51f01000
+#define RgAddr_dev1Fh_reg100h                       0x0100
+//0x51e01450
+#define RgAddr_dev1Eh_reg145h                       0x0145
+//0x51f00ff0
+#define RgAddr_dev1Fh_reg0FFh                       0x00ff
+//0x51e00db0
+#define RgAddr_dev1Eh_reg0DBh                       0x00db
+//0x51e00dc0
+#define RgAddr_dev1Eh_reg0DCh                       0x00dc
+//0x51e00e00
+#define RgAddr_dev1Eh_reg0E0h                       0x00e0
+//0x51e00e10
+#define RgAddr_dev1Eh_reg0E1h                       0x00e1
+//0x51e00e00
+#define RgAddr_dev1Eh_reg0E0h                       0x00e0
+//0x51e017a0
+#define RgAddr_dev1Eh_reg17Ah                       0x017a
+//0x51f01150
+#define RgAddr_dev1Fh_reg115h                       0x0115
+//0x51f01000
+#define RgAddr_dev1Fh_reg100h                       0x0100
+//0x51e01450
+#define RgAddr_dev1Eh_reg145h                       0x0145
+//0x51e01450
+#define RgAddr_dev1Eh_reg145h                       0x0145
+//0x51e01850
+#define RgAddr_dev1Eh_reg185h                       0x0185
+//0x51e00fb0
+#define RgAddr_dev1Eh_reg0FBh                       0x00fb
+//0x51e01740
+#define RgAddr_dev1Eh_reg174h                       0x0174
+//0x51e01750
+#define RgAddr_dev1Eh_reg175h                       0x0175
+//0x51e01850
+#define RgAddr_dev1Eh_reg185h                       0x0185
+//0x51e00fb0
+#define RgAddr_dev1Eh_reg0FBh                       0x00fb
+//0x51e00960
+#define RgAddr_dev1Eh_reg096h                       0x0096
+//0x51e003e0
+#define RgAddr_dev1Eh_reg03Eh                       0x003e
+//0x51e00dd0
+#define RgAddr_dev1Eh_reg0DDh                       0x00dd
+//0x51e017d0
+#define RgAddr_dev1Eh_reg17Dh                       0x017d
+//0x51e01810
+#define RgAddr_dev1Eh_reg181h                       0x0181
+//0x51e00120
+#define RgAddr_dev1Eh_reg012h                       0x0012
+//0x51e017e0
+#define RgAddr_dev1Eh_reg17Eh                       0x017e
+//0x51e01820
+#define RgAddr_dev1Eh_reg182h                       0x0182
+//0x51e00170
+#define RgAddr_dev1Eh_reg017h                       0x0017
+//0x51e01830
+#define RgAddr_dev1Eh_reg183h                       0x0183
+//0x51e00190
+#define RgAddr_dev1Eh_reg019h                       0x0019
+//0x51e01800
+#define RgAddr_dev1Eh_reg180h                       0x0180
+//0x51e01840
+#define RgAddr_dev1Eh_reg184h                       0x0184
+//0x51e00210
+#define RgAddr_dev1Eh_reg021h                       0x0021
+//0x51e01720
+#define RgAddr_dev1Eh_reg172h                       0x0172
+//0x51e01730
+#define RgAddr_dev1Eh_reg173h                       0x0173
+//0x51e017c0
+#define RgAddr_dev1Eh_reg17Ch                       0x017c
+//0x51e017f0
+#define RgAddr_dev1Eh_reg17Fh                       0x017f
+
+//0x52b5100
+#define RgAddr_TrReg10h                             0x10
+//0x52b5110
+#define RgAddr_TrReg11h                             0x11
+//0x52b5120
+#define RgAddr_TrReg12h                             0x12
+
+//0x31c0
+#define RgAddr_LpiReg1Ch                            0x1c
+//0x31d0
+#define RgAddr_LpiReg1Dh                            0x1d
+uint8_t BG_Calibration(uint8_t phyadd, int8_t calipolarity);
+uint8_t R50_Calibration(uint8_t phyadd, uint8_t phyadd_common);
+uint8_t TX_OFS_Calibration(uint8_t phyadd, uint8_t phyadd_common);
+uint8_t TX_AMP_Calibration(uint8_t phyadd, uint8_t phyadd_common);
+//void config_gphy_port(UINT8, UINT8);
+
+void set_gphy_reg_cl22(uint8_t, uint8_t, uint16_t);
+uint16_t get_gphy_reg_cl45(uint8_t, uint8_t, uint16_t);
+void set_gphy_reg_cl45(uint8_t, uint8_t, uint16_t, uint16_t);
+void anacal_exe(uint8_t);
+
+#endif /* _AN8855_PHY_H_ */
+
diff --git a/recipes-devtools/switch/files/src/an8855_sdk/core/an8855_phy_cal.c b/recipes-devtools/switch/files/src/an8855_sdk/core/an8855_phy_cal.c
index c2e8e5c..9eb52e1 100644
--- a/recipes-devtools/switch/files/src/an8855_sdk/core/an8855_phy_cal.c
+++ b/recipes-devtools/switch/files/src/an8855_sdk/core/an8855_phy_cal.c
@@ -1,967 +1,967 @@
-/* FILE NAME:  an8855_phy_cal.c
-* PURPOSE:
-*    It provides an8855 switch phy calibration function.
-*
-* NOTES:
-*
-*/
-
-/* INCLUDE FILE DECLARATIONS
-*/
-#include "an8855_mdio.h"
-#include "an8855_phy.h"
-//#include "swk_gphy_reg.h"
-//#include "gphy_calibration.h"
-//#include "gsw_reg.h"
-
-/* NAMING CONSTANT DECLARATIONS
- */
-#define MII_BMCR                (0)
-#define BMCR_PDOWN              (0x0800)
-/* MACRO FUNCTION DECLARATIONS
- */
-
-#define FULL_BITS(_n_) ((1UL << (_n_)) - 1)
-
-/* DATA TYPE DECLARATIONS
- */
-
-/* GLOBAL VARIABLE DECLARATIONS
- */
-/* Zcal to R50 mapping table (20220404) */
-const uint8_t ZCAL_TO_R50ohm_TBL[64] =
-{
-    127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127,
-    127, 127, 127, 127, 127, 123, 118, 114, 110, 106, 102, 98, 96, 92, 88, 85,
-    82, 80, 76, 72, 70, 67, 64, 62, 60, 56, 54, 52, 49, 48, 45, 43,
-    40, 39, 36, 34, 32, 32, 30, 28, 25, 24, 22, 20, 18, 16, 16, 14
-};
-
-/* Tx offset table, value is from small to big */
-const uint8_t  EN753x_TX_OFS_TBL[64] =
-{
-    0x3f, 0x3e, 0x3d, 0x3c, 0x3b, 0x3a, 0x39, 0x38, 0x37, 0x36, 0x35, 0x34, 0x33, 0x32, 0x31, 0x30,
-    0x2f, 0x2e, 0x2d, 0x2c, 0x2b, 0x2a, 0x29, 0x28, 0x27, 0x26, 0x25, 0x24, 0x23, 0x22, 0x21, 0x20,
-    0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
-    0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f
-};
-
-#define TOTAL_PATCH_C45_ITEMS   (15)
-#define TOTAL_PATCH_TR_ITEMS    (19)
-const uint16_t C45_PATCH_TABLE[TOTAL_PATCH_C45_ITEMS][3] =
-{
-    {0x1E, 0x120, 0x8014},
-    {0x1E, 0x122, 0xFFFF},
-    {0x1E, 0x122, 0xFFFF},
-    {0x1E, 0x144, 0x0200},
-    {0x1E, 0x14A, 0xEE20},
-    {0x1E, 0x189, 0x0110},
-    {0x1E, 0x19B, 0x0111},
-    {0x1E, 0x234, 0x0181},
-    {0x1E, 0x238, 0x0120},
-    {0x1E, 0x239, 0x0117},
-    {0x1F, 0x268, 0x07F4},
-    {0x1E, 0x2d1, 0x0733},
-    {0x1E, 0x323, 0x0011},
-    {0x1E, 0x324, 0x013F},
-    {0x1E, 0x326, 0x0037},
-};
-
-const uint32_t TR_PATCH_TABLE[TOTAL_PATCH_TR_ITEMS][2] =
-{
-    {0x83AA, 0x055a0 },
-    {0x83AE, 0x7FF3F },
-    {0x8F80, 0x0001e },
-    {0x8F82, 0x6FB90A},
-    {0x8FAE, 0x060671},
-    {0x8FB0, 0xE2F00 },
-    {0x8ECC, 0x444444},
-    {0x9686, 0x00000 },
-    {0x968C, 0x2EBAEF},
-    {0x9690, 0x00000b},
-    {0x9698, 0x0504D },
-    {0x969A, 0x2314f },
-    {0x969E, 0x03028 },
-    {0x96A0, 0x05010 },
-    {0x96A2, 0x40001 },
-    {0x96A6, 0x018670},
-    {0x96A8, 0x0024A },
-    {0x96B6, 0x00072 },
-    {0x96B8, 0x03210 },
-};
-
-#define TOTAL_NUMBER_OF_PATCH    (14)
-static uint16_t eee_patch_table[TOTAL_NUMBER_OF_PATCH][2] = {
-    {RgAddr_dev1Eh_reg120h, 0x8014},
-    {RgAddr_dev1Eh_reg122h, 0xFFFF},
-    {RgAddr_dev1Eh_reg122h, 0xFFFF},
-    {RgAddr_dev1Eh_reg144h, 0x0200},
-    {RgAddr_dev1Eh_reg14Ah, 0xEE20},
-    {RgAddr_dev1Eh_reg19Bh, 0x0111},
-    {RgAddr_dev1Eh_reg234h, 0x1181},
-    {RgAddr_dev1Eh_reg238h, 0x0120},
-    {RgAddr_dev1Eh_reg239h, 0x0117},
-    {RgAddr_dev1Fh_reg268h, 0x07F4},
-    {RgAddr_dev1Eh_reg2D1h, 0x0733},
-    {RgAddr_dev1Eh_reg323h, 0x0011},
-    {RgAddr_dev1Eh_reg324h, 0x013F},
-    {RgAddr_dev1Eh_reg326h, 0x0037}
-};
-
-#define TOTAL_NUMBER_OF_TR      (19)
-static uint16_t tr_reg_table[TOTAL_NUMBER_OF_TR][3] = {
-    {0x55A0, 0x0000, 0x83AA},
-    {0xFF3F, 0x0007, 0x83AE},
-    {0x001E, 0x0000, 0x8F80},
-    {0xB90A, 0x006F, 0x8F82},
-    {0x0671, 0x0006, 0x8FAE},
-    {0x2F00, 0x000E, 0x8FB0},
-    {0x4444, 0x0044, 0x8ECC},
-    {0x0004, 0x0000, 0x9686},
-    {0xBAEF, 0x002E, 0x968C},
-    {0x000B, 0x0000, 0x9690},
-    {0x504D, 0x0000, 0x9698},
-    {0x314F, 0x0002, 0x969A},
-    {0x3028, 0x0000, 0x969E},
-    {0x5010, 0x0000, 0x96A0},
-    {0x0001, 0x0004, 0x96A2},
-    {0x8670, 0x0001, 0x96A6},
-    {0x024A, 0x0000, 0x96A8},
-    {0x0072, 0x0000, 0x96B6},
-    {0x3210, 0x0000, 0x96B8}
-};
-
-void TR_RegWr(uint16_t phyadd, uint16_t tr_reg_addr, uint32_t tr_data);
-
-uint16_t get_gphy_reg_cl22(uint8_t phyad, uint8_t reg)
-{
-    uint32_t rdata = 0;
-
-    an8855_phy_read(phyad-g_smi_addr, reg, &rdata);
-
-    return ((uint16_t)rdata);
-    /*
-    gsw_top_reg_REG_PHY_IAC REG_PHY_IAC_val;
-    gsw_top_reg_REG_PHY_IAD REG_PHY_IAD_val;
-
-    // Wait until done
-    do
-    {
-      REG_PHY_IAC_val.Raw   = io_read32(RgAddr_gsw_top_reg_REG_PHY_IAC);
-    }
-    while(REG_PHY_IAC_val.Bits.csr_phy_acs_st);
-
-    // Set address
-    REG_PHY_IAC_val.Bits.csr_mdio_st = 1;
-    REG_PHY_IAC_val.Bits.csr_mdio_cmd   = 2;
-    REG_PHY_IAC_val.Bits.csr_mdio_phy_addr = phyad;
-    REG_PHY_IAC_val.Bits.csr_mdio_reg_addr = reg;
-    REG_PHY_IAC_val.Bits.csr_phy_acs_st =   1;
-    io_write32(RgAddr_gsw_top_reg_REG_PHY_IAC, REG_PHY_IAC_val.Raw);
-    // Wait until done
-    do
-    {
-        REG_PHY_IAC_val.Raw = io_read32(RgAddr_gsw_top_reg_REG_PHY_IAC);
-    }
-    while(REG_PHY_IAC_val.Bits.csr_phy_acs_st);
-
-    REG_PHY_IAD_val.Raw = io_read32(RgAddr_gsw_top_reg_REG_PHY_IAD);
-
-    return REG_PHY_IAD_val.Raw;
-    */
-}
-
-/* EXPORTED SUBPROGRAM BODIES
- */
-void gphy_config(void)
-{
-    uint8_t port = 1;
-    uint8_t phy_base = 0, phys_in_chip = 8;
-
-    for (port = 1; port <= phys_in_chip; port++)
-    {
-        set_gphy_reg_cl45(phy_base + port, 0x7, 0x3c, 0x0006); // Enable EEE
-        set_gphy_reg_cl45(phy_base + port, 0x1e, 0x3e, 0xf000); // force on TXVLD
-    }
-}
-
-static void set_gphy_TrReg(uint8_t prtid, uint16_t parm_1, uint16_t parm_2, uint16_t parm_3)
-{
-    set_gphy_reg_cl22(prtid, RgAddr_TrReg11h, parm_1);
-    set_gphy_reg_cl22(prtid, RgAddr_TrReg12h, parm_2);
-    set_gphy_reg_cl22(prtid, RgAddr_TrReg10h, parm_3);
-}
-
-static void gphy_eee_patch(uint8_t phy_base)
-{
-    UI8_T   port = 1, index = 0, phy_addr = 1;
-    UI16_T  data = 0;
-
-    for (port = 1; port <=8; port++)
-    {
-        phy_addr = phy_base + port;
-        data = get_gphy_reg_cl22(phy_addr, MII_BMCR);
-        set_gphy_reg_cl22(phy_addr, MII_BMCR, data & ~(BMCR_PDOWN));    /* PHY power on */
-
-        /* Change EEE RG default value */
-        for (index = 0; index < TOTAL_NUMBER_OF_PATCH; index++)
-        {
-            set_gphy_reg_cl45(phy_addr, DEVID_1E, eee_patch_table[index][0], eee_patch_table[index][1]);
-        }
-
-        set_gphy_reg_cl22(phy_addr, RgAddr_Reg1Fh, CL22_Page_TrReg);   /* change CL22page to LpiReg(0x3) */
-        for (index = 0; index < TOTAL_NUMBER_OF_TR; index++)
-        {
-            set_gphy_TrReg(phy_addr, tr_reg_table[index][0], tr_reg_table[index][1], tr_reg_table[index][2]);
-        }
-
-        set_gphy_reg_cl22(phy_addr, RgAddr_Reg1Fh, CL22_Page_LpiReg);  /* change CL22page to LpiReg(0x3) */
-        set_gphy_reg_cl22(phy_addr, RgAddr_LpiReg1Ch, 0x0c92);         /* Fine turn SigDet for B2B LPI link down issue */
-        set_gphy_reg_cl22(phy_addr, RgAddr_LpiReg1Dh, 0x0001);         /* Enable "lpi_quit_waitafesigdet_en" for LPI link down issue */
-
-        set_gphy_reg_cl22(phy_addr, RgAddr_Reg1Fh, CL22_Page_Reg);     /* change CL22page to Reg(0x0) */
-    }
-}
-
-void gphy_calibration(uint8_t phy_base)
-{
-    uint8_t port = 1, phy_addr = 1 ,phy_group = 1, index = 0;
-    uint8_t phys_in_chip = 5;
-
-    BG_Calibration(phy_base, 0x1);
-    if (phys_in_chip > 4)
-    {
-        BG_Calibration(phy_base + 0x4, 0x1);
-    }
-
-    for (port = 0; port < phys_in_chip; port++)
-    {
-        if (port < 4)
-        {
-            phy_group = phy_base;     /* PHY group 1 */
-        }
-        else
-        {
-            phy_group = phy_base + 0x04;     /* PHY group 2 */
-        }
-        phy_addr = phy_base + port;
-        R50_Calibration(phy_addr, phy_group);
-        TX_OFS_Calibration(phy_addr, phy_group);
-        TX_AMP_Calibration(phy_addr, phy_group);
-    }
-
-    for (port = 0; port < phys_in_chip; port++)
-    {
-        phy_addr = phy_base + port;
-        set_gphy_reg_cl45(phy_addr, 0x1e, 0x017d, 0x0000);
-        set_gphy_reg_cl45(phy_addr, 0x1e, 0x017e, 0x0000);
-        set_gphy_reg_cl45(phy_addr, 0x1e, 0x017f, 0x0000);
-        set_gphy_reg_cl45(phy_addr, 0x1e, 0x0180, 0x0000);
-        set_gphy_reg_cl45(phy_addr, 0x1e, 0x0181, 0x0000);
-        set_gphy_reg_cl45(phy_addr, 0x1e, 0x0182, 0x0000);
-        set_gphy_reg_cl45(phy_addr, 0x1e, 0x0183, 0x0000);
-        set_gphy_reg_cl45(phy_addr, 0x1e, 0x0184, 0x0000);
-        set_gphy_reg_cl45(phy_addr, 0x1e, 0x00db, 0x0000);  // disable analog calibration circuit
-        set_gphy_reg_cl45(phy_addr, 0x1e, 0x00dc, 0x0000);  // disable Tx offset calibration circuit
-        set_gphy_reg_cl45(phy_addr, 0x1e, 0x003e, 0x0000);  // disable Tx VLD force mode
-        set_gphy_reg_cl45(phy_addr, 0x1e, 0x00dd, 0x0000);  // disable Tx offset/amplitude calibration circuit
-        set_gphy_reg_cl45(phy_addr, 0x1e, 0x0145, 0x1000);  // enable auto MDI/MDIX
-
-        set_gphy_reg_cl22(phy_addr, 0, 0x1200);
-        /* GPHY Rx low pass filter */
-        set_gphy_reg_cl45(phy_addr, 0x1e, 0xc7, 0xd000);
-        /* patch */
-        for (index = 0; index < TOTAL_PATCH_C45_ITEMS; index++)
-        {
-            set_gphy_reg_cl45(phy_addr, C45_PATCH_TABLE[index][0], C45_PATCH_TABLE[index][1], C45_PATCH_TABLE[index][2]);
-        }
-        for (index = 0; index < TOTAL_PATCH_TR_ITEMS; index++)
-        {
-            TR_RegWr(phy_addr, TR_PATCH_TABLE[index][0], TR_PATCH_TABLE[index][1]);
-        }
-        set_gphy_reg_cl22(phy_addr, 0x1f, 0x0  );
-        set_gphy_reg_cl22(phy_addr, 0x1f, 0x3  );
-        set_gphy_reg_cl22(phy_addr, 0x1c, 0xc92);
-        set_gphy_reg_cl22(phy_addr, 0x1d, 0x01 );
-        set_gphy_reg_cl22(phy_addr, 0x1f, 0x0  );
-    }
-    gphy_eee_patch(phy_base);
-}
-
-/* LOCAL SUBPROGRAM BODIES
- */
-void TR_RegWr(uint16_t phyadd, uint16_t tr_reg_addr, uint32_t tr_data)
-{
-    set_gphy_reg_cl22(phyadd, 0x1F, 0x52b5);       /* page select */
-    set_gphy_reg_cl22(phyadd, 0x11, (uint16_t)(tr_data & 0xffff));
-    set_gphy_reg_cl22(phyadd, 0x12, (uint16_t)(tr_data >> 16));
-    set_gphy_reg_cl22(phyadd, 0x10, (uint16_t)(tr_reg_addr | TrReg_WR));
-    set_gphy_reg_cl22(phyadd, 0x1F, 0x0);          /* page resetore */
-    return;
-}
-
-uint8_t BG_Calibration(uint8_t phyadd, int8_t calipolarity)
-{
-    int8_t rg_zcal_ctrl = 0, calibration_polarity = 0;
-    uint8_t all_ana_cal_status = 1;
-    uint16_t ad_cal_comp_out_init = 0;
-
-    /* setting */
-    set_gphy_reg_cl22(phyadd, RgAddr_Reg1Fh, CL22_Page_Reg);        // g0
-    set_gphy_reg_cl22(phyadd, RgAddr_Reg00h, AN_disable_force_1000M);  // AN disable, force 1000M
-    set_gphy_reg_cl45(phyadd, DEVID_1F, RgAddr_dev1Fh_reg100h, BG_voltage_output);// BG voltage output
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg145h, Fix_mdi);// fix mdi
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Fh_reg0FFh, 0x2);
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DBh, Cal_control_BG);// 1e_db[12]:rg_cal_ckinv, [8]:rg_ana_calen, [4]:rg_rext_calen
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DCh, Disable_all);// 1e_dc[0]:rg_txvos_calen
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0E1h, Disable_all);// 1e_e1[4]:rg_cal_refsel(0:1.2V) enable BG 1.2V to REXT PAD
-
-    /* calibrate */
-    rg_zcal_ctrl = ZCAL_MIDDLE;
-
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0E0h, (uint16_t)rg_zcal_ctrl);
-
-    anacal_exe(phyadd);
-    if (all_ana_cal_status == 0)
-    {
-        all_ana_cal_status = ANACAL_ERROR;
-    }
-    ad_cal_comp_out_init = (get_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg17Ah) >> 8) & 0x1;
-
-
-    if (ad_cal_comp_out_init == 1)
-    {
-        calibration_polarity = -calipolarity;
-    }
-    else // ad_cal_comp_out_init == 0
-    {
-        calibration_polarity = calipolarity;
-    }
-
-    while (all_ana_cal_status < ANACAL_ERROR)
-    {
-        rg_zcal_ctrl += calibration_polarity;
-
-        set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0E0h, (uint16_t)rg_zcal_ctrl);
-
-
-        anacal_exe(phyadd);
-
-        if (all_ana_cal_status == 0)
-        {
-            all_ana_cal_status = ANACAL_ERROR;
-        }
-
-        else if (((get_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg17Ah) >> 8) & 0x1) != ad_cal_comp_out_init)
-        {
-            all_ana_cal_status = ANACAL_FINISH;
-        }
-        else
-        {
-            if ((rg_zcal_ctrl == 0x3F) || (rg_zcal_ctrl == 0x00))
-            {
-                all_ana_cal_status = ANACAL_SATURATION;  // need to FT
-                rg_zcal_ctrl = ZCAL_MIDDLE;  // 0 dB
-            }
-        }
-    }
-
-    if (all_ana_cal_status == ANACAL_ERROR)
-    {
-        rg_zcal_ctrl = ZCAL_MIDDLE;  // 0 dB
-
-        set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0E0h, (uint16_t)rg_zcal_ctrl);
-    }
-    else
-    {
-        // rg_zcal_ctrl[5:0] rg_rext_trim[13:8]
-        set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0E0h, (uint16_t)((rg_zcal_ctrl << 8) | rg_zcal_ctrl));
-
-        // 1f_115[2:0](rg_bg_rasel) = rg_zcal_ctrl[5:3]
-        set_gphy_reg_cl45(phyadd, DEVID_1F, RgAddr_dev1Fh_reg115h, (uint16_t)((rg_zcal_ctrl & 0x3f) >> 3));
-    }
-
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DBh, Disable_all);
-    return all_ana_cal_status;
-}
-
-uint8_t R50_Calibration(uint8_t phyadd, uint8_t phyadd_common)
-{
-    int8_t rg_zcal_ctrl = 0, rg_r50ohm_rsel_tx = 0, calibration_polarity = 0;
-    uint8_t all_ana_cal_status = 1;
-    int16_t backup_dev1e_e0 = 0, ad_cal_comp_out_init = 0, calibration_pair = 0;
-
-    /* setting */
-    set_gphy_reg_cl22(phyadd, RgAddr_Reg1Fh, CL22_Page_Reg);        // g0
-    set_gphy_reg_cl22(phyadd, RgAddr_Reg00h, AN_disable_force_1000M);  // AN disable, force 1000M
-
-    set_gphy_reg_cl45(phyadd_common, DEVID_1F, RgAddr_dev1Fh_reg100h, BG_voltage_output); // BG voltage output
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg145h, Fix_mdi); // fix mdi
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg185h, Disable_tx_slew_control); // disable tx slew control
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0FBh, LDO_control); // ldo
-    set_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg0DBh, Cal_control_R50); // 1e_db[12]:rg_cal_ckinv, [8]:rg_ana_calen, [4]:rg_rext_calen
-    set_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg0DCh, Disable_all); // 1e_dc[0]:rg_txvos_calen
-    set_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg0E1h, Disable_all); // 1e_e1[4]:rg_cal_refsel(0:1.2V) enable BG 1.2V to REXT PAD
-
-    for (calibration_pair = ANACAL_PAIR_A; calibration_pair <= ANACAL_PAIR_D; calibration_pair++)
-    {
-        all_ana_cal_status = 1;
-
-        if (calibration_pair == ANACAL_PAIR_A)
-        {
-            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DBh, Cal_control_R50_pairA_ENABLE); // 1e_db[12]:rg_cal_ckinv, [8]:rg_ana_calen, [4]:rg_rext_calen, [0]:rg_zcalen_a
-            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DCh, Zcalen_A_ENABLE);
-        }
-        else if (calibration_pair == ANACAL_PAIR_B)
-        {
-            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DBh, Cal_control_R50); // 1e_db[12]:rg_cal_ckinv, [8]:rg_ana_calen, [4]:rg_rext_calen, [0]:rg_zcalen_a
-            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DCh, Zcalen_B_ENABLE); // 1e_dc[12]:rg_zcalen_b
-        }
-        else if (calibration_pair == ANACAL_PAIR_C)
-        {
-            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DBh, Cal_control_R50); // 1e_db[12]:rg_cal_ckinv, [8]:rg_ana_calen, [4]:rg_rext_calen, [0]:rg_zcalen_a
-            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DCh, Zcalen_C_ENABLE); // 1e_dc[8]:rg_zcalen_c
-        }
-        else // if(calibration_pair == ANACAL_PAIR_D)
-        {
-            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DBh, Cal_control_R50); // 1e_db[12]:rg_cal_ckinv, [8]:rg_ana_calen, [4]:rg_rext_calen, [0]:rg_zcalen_a
-            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DCh, Zcalen_D_ENABLE); // 1e_dc[4]:rg_zcalen_d
-        }
-
-        /* calibrate */
-        rg_zcal_ctrl = ZCAL_MIDDLE;             // start with 0 dB
-
-        backup_dev1e_e0 = (get_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg0E0h)&(~0x003f));
-        set_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg0E0h, (backup_dev1e_e0 | rg_zcal_ctrl));
-
-        anacal_exe(phyadd_common);
-        if (all_ana_cal_status == 0)
-        {
-            all_ana_cal_status = ANACAL_ERROR;
-        }
-
-        ad_cal_comp_out_init = (get_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg17Ah) >> 8) & 0x1;  // 1e_17a[8]:ad_cal_comp_out
-
-        if (ad_cal_comp_out_init == 1)
-        {
-            calibration_polarity = -1;
-        }
-        else
-        {
-            calibration_polarity = 1;
-        }
-
-        while (all_ana_cal_status < ANACAL_ERROR)
-        {
-            rg_zcal_ctrl += calibration_polarity;
-
-            set_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg0E0h, (backup_dev1e_e0 | rg_zcal_ctrl));
-
-            anacal_exe(phyadd_common);
-
-            if (all_ana_cal_status == 0)
-            {
-                all_ana_cal_status = ANACAL_ERROR;
-            }
-            else if (((get_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg17Ah) >> 8) & 0x1) != ad_cal_comp_out_init)
-            {
-                all_ana_cal_status = ANACAL_FINISH;
-            }
-            else
-            {
-                if ((rg_zcal_ctrl == 0x3F) || (rg_zcal_ctrl == 0x00))
-                {
-                    all_ana_cal_status = ANACAL_SATURATION;  // need to FT
-                    rg_zcal_ctrl = ZCAL_MIDDLE;  // 0 dB
-                }
-            }
-        }
-
-        if (all_ana_cal_status == ANACAL_ERROR)
-        {
-            rg_r50ohm_rsel_tx = ZCAL_MIDDLE;  // 0 dB
-        }
-        else
-        {
-            if (rg_zcal_ctrl > (0x3F - R50_OFFSET_VALUE))
-            {
-                all_ana_cal_status = ANACAL_SATURATION;  // need to FT
-                rg_zcal_ctrl = ZCAL_MIDDLE;  // 0 dB
-            }
-            else
-            {
-                rg_zcal_ctrl += R50_OFFSET_VALUE;
-            }
-
-            rg_r50ohm_rsel_tx = ZCAL_TO_R50ohm_TBL[rg_zcal_ctrl];
-        }
-
-        if (calibration_pair == ANACAL_PAIR_A)
-        {
-            // cr_r50ohm_rsel_tx_a
-            ad_cal_comp_out_init = get_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg174h)&(~MASK_r50ohm_rsel_tx_a);
-            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg174h, (ad_cal_comp_out_init | (((rg_r50ohm_rsel_tx << 8) & MASK_MSB_8bit) | Rg_r50ohm_rsel_tx_a_en))); // 1e_174[15:8]
-        }
-        else if (calibration_pair == ANACAL_PAIR_B)
-        {
-            // cr_r50ohm_rsel_tx_b
-            ad_cal_comp_out_init = get_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg174h)&(~MASK_r50ohm_rsel_tx_b);
-            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg174h, (ad_cal_comp_out_init | (((rg_r50ohm_rsel_tx << 0) & MASK_LSB_8bit) | Rg_r50ohm_rsel_tx_b_en))); // 1e_174[7:0]
-        }
-        else if (calibration_pair == ANACAL_PAIR_C)
-        {
-            // cr_r50ohm_rsel_tx_c
-            ad_cal_comp_out_init = get_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg175h)&(~MASK_r50ohm_rsel_tx_c);
-            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg175h, (ad_cal_comp_out_init | (((rg_r50ohm_rsel_tx << 8) & MASK_MSB_8bit) | Rg_r50ohm_rsel_tx_c_en))); // 1e_175[15:8]
-        }
-        else // if(calibration_pair == ANACAL_PAIR_D)
-        {
-            // cr_r50ohm_rsel_tx_d
-            ad_cal_comp_out_init = get_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg175h)&(~MASK_r50ohm_rsel_tx_d);
-            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg175h, (ad_cal_comp_out_init | (((rg_r50ohm_rsel_tx << 0) & MASK_LSB_8bit) | Rg_r50ohm_rsel_tx_d_en))); // 1e_175[7:0]
-        }
-    }
-
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DBh, Disable_all);
-    set_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg0DBh, Disable_all);
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DCh, Disable_all);
-
-    return all_ana_cal_status;
-}
-
-uint8_t TX_OFS_Calibration(uint8_t phyadd, uint8_t phyadd_common)
-{
-    int8_t tx_offset_index = 0, calibration_polarity = 0;
-    uint8_t all_ana_cal_status = 1, tx_offset_reg_shift = 0, tbl_idx = 0;
-    int16_t ad_cal_comp_out_init = 0, calibration_pair = 0, tx_offset_reg = 0, reg_temp = 0;
-
-    /* setting */
-    set_gphy_reg_cl22(phyadd, RgAddr_Reg1Fh, CL22_Page_Reg);        // g0
-    set_gphy_reg_cl22(phyadd, RgAddr_Reg00h, AN_disable_force_1000M);  // AN disable, force 1000M
-
-    set_gphy_reg_cl45(phyadd, DEVID_1F, RgAddr_dev1Fh_reg100h, BG_voltage_output); // BG voltage output
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg145h, Fix_mdi); // fix mdi
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg185h, Disable_tx_slew_control); // disable tx slew control
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0FBh, LDO_control); // ldo
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DBh, Cal_control_TX_OFST); // 1e_db[12]:rg_cal_ckinv, [8]:rg_ana_calen, [4]:rg_rext_calen
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DCh, Rg_txvos_calen_ENABLE); // 1e_dc[0]:rg_txvos_calen
-    set_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg0DBh, Cal_control_TX_OFST); // 1e_db[12]:rg_cal_ckinv, [8]:rg_ana_calen, [4]:rg_rext_calen
-    set_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg0DCh, Rg_txvos_calen_ENABLE); // 1e_dc[0]:rg_txvos_calen
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0E1h, Disable_all); // 1e_e1[4]:rg_cal_refsel(0:1.2V) enable BG 1.2V to REXT PAD
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg096h, Bypass_tx_offset_cal); // 1e_96[15]:bypass_tx_offset_cal, Hw bypass, Fw cal
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg03Eh, Enable_Tx_VLD); // 1e_3e:enable Tx VLD
-
-    for (calibration_pair = ANACAL_PAIR_A; calibration_pair <= ANACAL_PAIR_D; calibration_pair++)
-    {
-        all_ana_cal_status = 1;
-
-        tbl_idx = TX_OFFSET_0mV_idx;
-        tx_offset_index = EN753x_TX_OFS_TBL[tbl_idx];
-
-        if (calibration_pair == ANACAL_PAIR_A)
-        {
-            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DDh, Rg_txg_calen_a_ENABLE);       // 1e_dd[12]:rg_txg_calen_a
-            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg17Dh, (Force_dasn_dac_in0_ENABLE | DAC_IN_0V));  // 1e_17d:dac_in0_a
-            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg181h, (Force_dasn_dac_in1_ENABLE | DAC_IN_0V));  // 1e_181:dac_in1_a
-
-            reg_temp = (get_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg172h)&(~MASK_cr_tx_amp_offset_MSB));
-            tx_offset_reg_shift = 8;  // 1e_172[13:8]
-            tx_offset_reg = RgAddr_dev1Eh_reg172h;
-        }
-        else if (calibration_pair == ANACAL_PAIR_B)
-        {
-            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DDh, Rg_txg_calen_b_ENABLE);       // 1e_dd[8]:rg_txg_calen_b
-            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg17Eh, (Force_dasn_dac_in0_ENABLE | DAC_IN_0V));  // 1e_17e:dac_in0_b
-            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg182h, (Force_dasn_dac_in1_ENABLE | DAC_IN_0V));  // 1e_182:dac_in1_b
-
-            reg_temp = (get_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg172h)&(~MASK_cr_tx_amp_offset_LSB));
-            tx_offset_reg_shift = 0;  // 1e_172[5:0]
-            tx_offset_reg = RgAddr_dev1Eh_reg172h;
-        }
-        else if (calibration_pair == ANACAL_PAIR_C)
-        {
-            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DDh, Rg_txg_calen_c_ENABLE);       // 1e_dd[4]:rg_txg_calen_c
-            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg17Fh, (Force_dasn_dac_in0_ENABLE | DAC_IN_0V));  // 1e_17f:dac_in0_c
-            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg183h, (Force_dasn_dac_in1_ENABLE | DAC_IN_0V));  // 1e_183:dac_in1_c
-
-            reg_temp = (get_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg173h)&(~MASK_cr_tx_amp_offset_MSB));
-            tx_offset_reg_shift = 8;  // 1e_173[13:8]
-            tx_offset_reg = RgAddr_dev1Eh_reg173h;
-        }
-        else // if(calibration_pair == ANACAL_PAIR_D)
-        {
-            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DDh, Rg_txg_calen_d_ENABLE);       // 1e_dd[0]:rg_txg_calen_d
-            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg180h, (Force_dasn_dac_in0_ENABLE | DAC_IN_0V));  // 1e_180:dac_in0_d
-            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg184h, (Force_dasn_dac_in1_ENABLE | DAC_IN_0V));  // 1e_184:dac_in1_d
-
-            reg_temp = (get_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg173h)&(~MASK_cr_tx_amp_offset_LSB));
-            tx_offset_reg_shift = 0;  // 1e_173[5:0]
-            tx_offset_reg = RgAddr_dev1Eh_reg173h;
-        }
-
-        /* calibrate */
-        //tx_offset_index = TX_AMP_OFFSET_0mV;
-        tbl_idx = TX_OFFSET_0mV_idx;
-        tx_offset_index = EN753x_TX_OFS_TBL[tbl_idx];
-        set_gphy_reg_cl45(phyadd, DEVID_1E, tx_offset_reg, (reg_temp | (tx_offset_index << tx_offset_reg_shift)));  // 1e_172, 1e_173
-
-        anacal_exe(phyadd_common);
-        if (all_ana_cal_status == 0)
-        {
-            all_ana_cal_status = ANACAL_ERROR;
-        }
-
-        ad_cal_comp_out_init = (get_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg17Ah) >> 8) & 0x1;  // 1e_17a[8]:ad_cal_comp_out
-
-        if (ad_cal_comp_out_init == 1)
-        {
-            calibration_polarity = -1;
-        }
-        else
-        {
-            calibration_polarity = 1;
-        }
-
-        while (all_ana_cal_status < ANACAL_ERROR)
-        {
-            tbl_idx += calibration_polarity;
-            tx_offset_index = EN753x_TX_OFS_TBL[tbl_idx];
-
-            set_gphy_reg_cl45(phyadd, DEVID_1E, tx_offset_reg, (reg_temp | (tx_offset_index << tx_offset_reg_shift)));  // 1e_172, 1e_173
-
-            anacal_exe(phyadd_common);
-
-            if (all_ana_cal_status == 0)
-            {
-                all_ana_cal_status = ANACAL_ERROR;
-            }
-            else if (((get_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg17Ah) >> 8) & 0x1) != ad_cal_comp_out_init)
-            {
-                all_ana_cal_status = ANACAL_FINISH;
-            }
-            else
-            {
-                if ((tx_offset_index == 0x3f) || (tx_offset_index == 0x1f))
-                {
-                    all_ana_cal_status = ANACAL_SATURATION;  // need to FT
-                }
-            }
-        }
-
-        if (all_ana_cal_status == ANACAL_ERROR)
-        {
-            tbl_idx = TX_OFFSET_0mV_idx;
-            tx_offset_index = EN753x_TX_OFS_TBL[tbl_idx];
-
-            set_gphy_reg_cl45(phyadd, DEVID_1E, tx_offset_reg, (reg_temp | (tx_offset_index << tx_offset_reg_shift)));  // cr_tx_amp_offset_a/b/c/d, 1e_172, 1e_173
-        }
-    }
-
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg17Dh, Disable_all);
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg17Eh, Disable_all);
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg17Fh, Disable_all);
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg180h, Disable_all);
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg181h, Disable_all);
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg182h, Disable_all);
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg183h, Disable_all);
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg184h, Disable_all);
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DBh, Disable_all); // disable analog calibration circuit
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DCh, Disable_all); // disable Tx offset calibration circuit
-    set_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg0DBh, Disable_all); // disable analog calibration circuit
-    set_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg0DCh, Disable_all); // disable Tx offset calibration circuit
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg03Eh, Disable_all); // disable Tx VLD force mode
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DDh, Disable_all); // disable Tx offset/amplitude calibration circuit
-
-    return all_ana_cal_status;
-}
-
-uint8_t TX_AMP_Calibration(uint8_t phyadd, uint8_t phyadd_common)
-{
-    int8_t tx_amp_index = 0, calibration_polarity = 0;
-    uint8_t all_ana_cal_status = 1, tx_amp_reg_shift = 0;
-    uint8_t tx_amp_reg = 0, tx_amp_reg_100 = 0, tst_offset = 0, hbt_offset = 0, gbe_offset = 0, tbt_offset = 0;
-    uint16_t ad_cal_comp_out_init = 0, calibration_pair = 0, reg_temp = 0;
-
-  //phyadd_common = phyadd;
-
-    /* setting */
-    set_gphy_reg_cl22(phyadd, RgAddr_Reg1Fh, CL22_Page_Reg);        // g0
-    set_gphy_reg_cl22(phyadd, RgAddr_Reg00h, AN_disable_force_1000M);  // AN disable, force 1000M
-
-    set_gphy_reg_cl45(phyadd, DEVID_1F, RgAddr_dev1Fh_reg100h, BG_voltage_output); // BG voltage output
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg145h, Fix_mdi); // fix mdi
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg185h, Disable_tx_slew_control); // disable tx slew control
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0FBh, LDO_control); // ldo
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DBh, Cal_control_TX_AMP); // 1e_db[12]:rg_cal_ckinv, [8]:rg_ana_calen, [4]:rg_rext_calen
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DCh, Rg_txvos_calen_ENABLE); // 1e_dc[0]:rg_txvos_calen
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0E1h, Rg_cal_refsel_ENABLE); // 1e_e1[4]:rg_cal_refsel(0:1.2V) enable BG 1.2V to REXT PAD
-    set_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg0DBh, Cal_control_TX_AMP); // 1e_db[12]:rg_cal_ckinv, [8]:rg_ana_calen, [4]:rg_rext_calen
-    set_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg0DCh, Rg_txvos_calen_ENABLE); // 1e_dc[0]:rg_txvos_calen
-    set_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg0E1h, Rg_cal_refsel_ENABLE); // 1e_e1[4]:rg_cal_refsel(0:1.2V) enable BG 1.2V to REXT PAD
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg096h, Bypass_tx_offset_cal); // 1e_96[15]:bypass_tx_offset_cal, Hw bypass, Fw cal
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg03Eh, Enable_Tx_VLD); // 1e_3e:enable Tx VLD
-
-    for (calibration_pair = ANACAL_PAIR_A; calibration_pair <= ANACAL_PAIR_D; calibration_pair++)
-    //for (calibration_pair = ANACAL_PAIR_A; calibration_pair <= ANACAL_PAIR_B; calibration_pair++) // debugging
-    {
-        all_ana_cal_status = 1;
-
-        /* calibrate */
-        tx_amp_index = TX_AMP_MIDDLE;   // start with 0 dB
-        if (calibration_pair == ANACAL_PAIR_A)
-        {
-            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DDh, Rg_txg_calen_a_ENABLE);       // 1e_dd[12]:rg_txg_calen_a amp calibration enable
-            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg17Dh, (Force_dasn_dac_in0_ENABLE | DAC_IN_2V));  // 1e_17d:dac_in0_a
-            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg181h, (Force_dasn_dac_in1_ENABLE | DAC_IN_2V));  // 1e_181:dac_in1_a
-
-            reg_temp = (get_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg012h)&(~MASK_da_tx_i2mpb_a_gbe));
-            tx_amp_reg_shift = 10;  // 1e_12[15:10]
-            tx_amp_reg = RgAddr_dev1Eh_reg012h;
-            tx_amp_reg_100 = 0x16;
-        }
-        else if (calibration_pair == ANACAL_PAIR_B)
-        {
-            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DDh, Rg_txg_calen_b_ENABLE);       // 1e_dd[8]:rg_txg_calen_b amp calibration enable
-            //Serial.println(Rg_txg_calen_b_ENABLE, HEX);
-            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg17Eh, (Force_dasn_dac_in0_ENABLE | DAC_IN_2V));  // 1e_17e:dac_in0_b
-            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg182h, (Force_dasn_dac_in1_ENABLE | DAC_IN_2V));  // 1e_182:dac_in1_b
-
-            reg_temp = (get_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg017h)&(~MASK_da_tx_i2mpb_b_c_d_gbe));
-            tx_amp_reg_shift = 8; // 1e_17[13:8]
-            tx_amp_reg = RgAddr_dev1Eh_reg017h;
-            tx_amp_reg_100 = 0x18;
-        }
-        else if (calibration_pair == ANACAL_PAIR_C)
-        {
-            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DDh, Rg_txg_calen_c_ENABLE);       // 1e_dd[4]:rg_txg_calen_c amp calibration enable
-            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg17Fh, (Force_dasn_dac_in0_ENABLE | DAC_IN_2V));  // 1e_17f:dac_in0_c
-            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg183h, (Force_dasn_dac_in1_ENABLE | DAC_IN_2V));  // 1e_183:dac_in1_c
-
-            reg_temp = (get_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg019h)&(~MASK_da_tx_i2mpb_b_c_d_gbe));
-            tx_amp_reg_shift = 8; // 1e_19[13:8]
-            tx_amp_reg = RgAddr_dev1Eh_reg019h;
-            tx_amp_reg_100 = 0x20;
-        }
-        else //if(calibration_pair == ANACAL_PAIR_D)
-        {
-            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DDh, Rg_txg_calen_d_ENABLE);       // 1e_dd[0]:rg_txg_calen_d amp calibration enable
-            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg180h, (Force_dasn_dac_in0_ENABLE | DAC_IN_2V));  // 1e_180:dac_in0_d
-            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg184h, (Force_dasn_dac_in1_ENABLE | DAC_IN_2V));  // 1e_184:dac_in1_d
-
-            reg_temp = (get_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg021h)&(~MASK_da_tx_i2mpb_b_c_d_gbe));
-            tx_amp_reg_shift = 8; // 1e_21[13:8]
-            tx_amp_reg = RgAddr_dev1Eh_reg021h;
-            tx_amp_reg_100 = 0x22;
-        }
-
-        /* calibrate */
-        tx_amp_index = TX_AMP_MIDDLE; // start with 0 dB
-
-        set_gphy_reg_cl45(phyadd, DEVID_1E, tx_amp_reg, (reg_temp | (tx_amp_index << tx_amp_reg_shift))); // 1e_12/17/19/21
-
-        anacal_exe(phyadd_common);
-        if (all_ana_cal_status == 0)
-        {
-            all_ana_cal_status = ANACAL_ERROR;
-        }
-
-
-        ad_cal_comp_out_init = (get_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg17Ah) >> 8) & 0x1;    // 1e_17a[8]:ad_cal_comp_out
-        //Serial.println(ad_cal_comp_out_init, HEX);
-
-        if (ad_cal_comp_out_init == 1)
-        {
-            calibration_polarity = -1;
-        }
-        else
-        {
-            calibration_polarity = 1;
-        }
-        while (all_ana_cal_status < ANACAL_ERROR)
-        {
-            tx_amp_index += calibration_polarity;
-            //Serial.println(tx_amp_index, HEX);
-
-            set_gphy_reg_cl45(phyadd, DEVID_1E, tx_amp_reg, (reg_temp | (tx_amp_index << tx_amp_reg_shift)));
-
-            anacal_exe(phyadd_common);
-
-            if (all_ana_cal_status == 0)
-            {
-                all_ana_cal_status = ANACAL_ERROR;
-            }
-            else if (((get_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg17Ah) >> 8) & 0x1) != ad_cal_comp_out_init)
-            {
-                all_ana_cal_status = ANACAL_FINISH;
-                //Serial.print("    tx_amp_index: ");
-                //Serial.println(tx_amp_index, HEX);
-                //reg_temp = get_gphy_reg_cl45(phyadd, 0x1e, tx_amp_reg)&(~0xff00);
-                //set_gphy_reg_cl45(phyadd, 0x1e, tx_amp_reg, (reg_temp|((tx_amp_index + tst_offset)<<tx_amp_reg_shift)));  // for gbe(DAC)
-            }
-            else
-            {
-                if ((tx_amp_index == 0x3f) || (tx_amp_index == 0x00))
-                {
-                    all_ana_cal_status = ANACAL_SATURATION;  // need to FT
-                    tx_amp_index = TX_AMP_MIDDLE;
-                }
-            }
-        }
-
-        if (all_ana_cal_status == ANACAL_ERROR)
-        {
-            tx_amp_index = TX_AMP_MIDDLE;
-        }
-
-        // da_tx_i2mpb_a_gbe / b/c/d, only GBE for now
-        set_gphy_reg_cl45(phyadd, DEVID_1E, tx_amp_reg, ((tx_amp_index - TXAMP_offset) | ((tx_amp_index - TXAMP_offset) << tx_amp_reg_shift)));  // // temp modify
-        set_gphy_reg_cl45(phyadd, DEVID_1E, tx_amp_reg_100, ((tx_amp_index - TXAMP_offset) | ((tx_amp_index + TX_i2mpb_hbt_ofs) << tx_amp_reg_shift)));
-    }
-
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg17Dh, Disable_all);
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg17Eh, Disable_all);
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg17Fh, Disable_all);
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg180h, Disable_all);
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg181h, Disable_all);
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg182h, Disable_all);
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg183h, Disable_all);
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg184h, Disable_all);
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DBh, Disable_all); // disable analog calibration circuit
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DCh, Disable_all); // disable Tx offset calibration circuit
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg03Eh, Disable_all); // disable Tx VLD force mode
-    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DDh, Disable_all); // disable Tx offset/amplitude calibration circuit
-
-    return all_ana_cal_status;
-}
-
-void set_gphy_reg_cl22(uint8_t phyad, uint8_t reg, uint16_t value)
-{
-    an8855_phy_write(phyad-g_smi_addr, reg, value);
-    /*
-       gsw_top_reg_REG_PHY_IAC REG_PHY_IAC_val;
-       gsw_top_reg_REG_PHY_IAD REG_PHY_IAD_val;
-
-    // Wait until done
-    do
-    {
-    REG_PHY_IAC_val.Raw = io_read32(RgAddr_gsw_top_reg_REG_PHY_IAC);
-    }
-    while(REG_PHY_IAC_val.Bits.csr_phy_acs_st);
-
-    // Set address
-    REG_PHY_IAC_val.Bits.csr_mdio_st = 1;
-    REG_PHY_IAC_val.Bits.csr_mdio_cmd = 1;
-    REG_PHY_IAC_val.Bits.csr_mdio_phy_addr = phyad;
-    REG_PHY_IAC_val.Bits.csr_mdio_reg_addr = reg;
-    REG_PHY_IAC_val.Bits.csr_mdio_wr_data = value;
-    REG_PHY_IAC_val.Bits.csr_phy_acs_st = 1;
-
-    io_write32(RgAddr_gsw_top_reg_REG_PHY_IAC, REG_PHY_IAC_val.Raw);
-    */
-}
-
-UINT16 get_gphy_reg_cl45(uint8_t prtid, uint8_t devid, uint16_t reg)
-{
-    UINT32 rdata = 0;
-
-    an8855_phy_read_cl45(prtid-g_smi_addr, devid, reg, &rdata);
-    return ((UINT16)rdata);
-    /*
-    gsw_top_reg_REG_PHY_IAC REG_PHY_IAC_val;
-    gsw_top_reg_REG_PHY_IAD REG_PHY_IAD_val;
-
-    // Wait until done
-    do
-    {
-    REG_PHY_IAC_val.Raw = io_read32(RgAddr_gsw_top_reg_REG_PHY_IAC);
-    }
-    while(REG_PHY_IAC_val.Bits.csr_phy_acs_st);
-
-    // Set address
-    REG_PHY_IAC_val.Bits.csr_mdio_st = 0;
-    REG_PHY_IAC_val.Bits.csr_mdio_cmd = 0;
-    REG_PHY_IAC_val.Bits.csr_mdio_phy_addr = prtid;
-    REG_PHY_IAC_val.Bits.csr_mdio_reg_addr = devid;
-    REG_PHY_IAC_val.Bits.csr_mdio_wr_data = reg;
-    REG_PHY_IAC_val.Bits.csr_phy_acs_st = 1;
-
-    io_write32(RgAddr_gsw_top_reg_REG_PHY_IAC, REG_PHY_IAC_val.Raw);
-
-    // Wait until done
-    do
-    {
-    REG_PHY_IAC_val.Raw = io_read32(RgAddr_gsw_top_reg_REG_PHY_IAC);
-    }
-    while(REG_PHY_IAC_val.Bits.csr_phy_acs_st);
-
-    // Read value
-    REG_PHY_IAC_val.Bits.csr_mdio_st = 0;
-    REG_PHY_IAC_val.Bits.csr_mdio_cmd = 3;
-    REG_PHY_IAC_val.Bits.csr_mdio_phy_addr = prtid;
-    REG_PHY_IAC_val.Bits.csr_mdio_reg_addr = devid;
-    REG_PHY_IAC_val.Bits.csr_mdio_wr_data = 0;
-    REG_PHY_IAC_val.Bits.csr_phy_acs_st = 1;
-    io_write32(RgAddr_gsw_top_reg_REG_PHY_IAC, REG_PHY_IAC_val.Raw);
-
-    // Wait until done
-    do
-    {
-    REG_PHY_IAC_val.Raw = io_read32(RgAddr_gsw_top_reg_REG_PHY_IAC);
-    }
-    while(REG_PHY_IAC_val.Bits.csr_phy_acs_st);
-
-    REG_PHY_IAD_val.Raw = io_read32(RgAddr_gsw_top_reg_REG_PHY_IAD);
-
-    return REG_PHY_IAD_val.Raw;
-    */
-}
-
-void set_gphy_reg_cl45(uint8_t prtid, uint8_t devid, uint16_t reg, uint16_t value)
-{
-    an8855_phy_write_cl45(prtid-g_smi_addr, devid, reg, value);
-    /*
-    gsw_top_reg_REG_PHY_IAC REG_PHY_IAC_val;
-
-    // Wait until done
-    do
-    {
-        REG_PHY_IAC_val.Raw = io_read32(RgAddr_gsw_top_reg_REG_PHY_IAC);
-    }
-    while(REG_PHY_IAC_val.Bits.csr_phy_acs_st);
-
-    // Set address
-    REG_PHY_IAC_val.Bits.csr_mdio_st = 0;
-    REG_PHY_IAC_val.Bits.csr_mdio_cmd = 0;
-    REG_PHY_IAC_val.Bits.csr_mdio_phy_addr = prtid;
-    REG_PHY_IAC_val.Bits.csr_mdio_reg_addr = devid;
-    REG_PHY_IAC_val.Bits.csr_mdio_wr_data = reg;
-    REG_PHY_IAC_val.Bits.csr_phy_acs_st = 1;
-
-    io_write32(RgAddr_gsw_top_reg_REG_PHY_IAC, REG_PHY_IAC_val.Raw);
-
-    // Wait until done
-    do
-    {
-        REG_PHY_IAC_val.Raw = io_read32(RgAddr_gsw_top_reg_REG_PHY_IAC);
-    }
-    while(REG_PHY_IAC_val.Bits.csr_phy_acs_st);
-
-    // Write value
-    REG_PHY_IAC_val.Bits.csr_mdio_st = 0;
-    REG_PHY_IAC_val.Bits.csr_mdio_cmd = 1;
-    REG_PHY_IAC_val.Bits.csr_mdio_phy_addr = prtid;
-    REG_PHY_IAC_val.Bits.csr_mdio_reg_addr = devid;
-    REG_PHY_IAC_val.Bits.csr_mdio_wr_data = value;
-    REG_PHY_IAC_val.Bits.csr_phy_acs_st = 1;
-
-    io_write32(RgAddr_gsw_top_reg_REG_PHY_IAC, REG_PHY_IAC_val.Raw);
-    */
-}
-
-void anacal_exe(uint8_t phyadd_common)
-{
-    set_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg17Ch, 1);// da_calin_flag pull high
-    an8855_udelay(1000);
-    set_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg17Ch, 0);// da_calin_flag pull low
-}
-
+/* FILE NAME:  an8855_phy_cal.c
+* PURPOSE:
+*    It provides an8855 switch phy calibration function.
+*
+* NOTES:
+*
+*/
+
+/* INCLUDE FILE DECLARATIONS
+*/
+#include "an8855_mdio.h"
+#include "an8855_phy.h"
+//#include "swk_gphy_reg.h"
+//#include "gphy_calibration.h"
+//#include "gsw_reg.h"
+
+/* NAMING CONSTANT DECLARATIONS
+ */
+#define MII_BMCR                (0)
+#define BMCR_PDOWN              (0x0800)
+/* MACRO FUNCTION DECLARATIONS
+ */
+
+#define FULL_BITS(_n_) ((1UL << (_n_)) - 1)
+
+/* DATA TYPE DECLARATIONS
+ */
+
+/* GLOBAL VARIABLE DECLARATIONS
+ */
+/* Zcal to R50 mapping table (20220404) */
+const uint8_t ZCAL_TO_R50ohm_TBL[64] =
+{
+    127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127,
+    127, 127, 127, 127, 127, 123, 118, 114, 110, 106, 102, 98, 96, 92, 88, 85,
+    82, 80, 76, 72, 70, 67, 64, 62, 60, 56, 54, 52, 49, 48, 45, 43,
+    40, 39, 36, 34, 32, 32, 30, 28, 25, 24, 22, 20, 18, 16, 16, 14
+};
+
+/* Tx offset table, value is from small to big */
+const uint8_t  EN753x_TX_OFS_TBL[64] =
+{
+    0x3f, 0x3e, 0x3d, 0x3c, 0x3b, 0x3a, 0x39, 0x38, 0x37, 0x36, 0x35, 0x34, 0x33, 0x32, 0x31, 0x30,
+    0x2f, 0x2e, 0x2d, 0x2c, 0x2b, 0x2a, 0x29, 0x28, 0x27, 0x26, 0x25, 0x24, 0x23, 0x22, 0x21, 0x20,
+    0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+    0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f
+};
+
+#define TOTAL_PATCH_C45_ITEMS   (15)
+#define TOTAL_PATCH_TR_ITEMS    (19)
+const uint16_t C45_PATCH_TABLE[TOTAL_PATCH_C45_ITEMS][3] =
+{
+    {0x1E, 0x120, 0x8014},
+    {0x1E, 0x122, 0xFFFF},
+    {0x1E, 0x122, 0xFFFF},
+    {0x1E, 0x144, 0x0200},
+    {0x1E, 0x14A, 0xEE20},
+    {0x1E, 0x189, 0x0110},
+    {0x1E, 0x19B, 0x0111},
+    {0x1E, 0x234, 0x0181},
+    {0x1E, 0x238, 0x0120},
+    {0x1E, 0x239, 0x0117},
+    {0x1F, 0x268, 0x07F4},
+    {0x1E, 0x2d1, 0x0733},
+    {0x1E, 0x323, 0x0011},
+    {0x1E, 0x324, 0x013F},
+    {0x1E, 0x326, 0x0037},
+};
+
+const uint32_t TR_PATCH_TABLE[TOTAL_PATCH_TR_ITEMS][2] =
+{
+    {0x83AA, 0x055a0 },
+    {0x83AE, 0x7FF3F },
+    {0x8F80, 0x0001e },
+    {0x8F82, 0x6FB90A},
+    {0x8FAE, 0x060671},
+    {0x8FB0, 0xE2F00 },
+    {0x8ECC, 0x444444},
+    {0x9686, 0x00000 },
+    {0x968C, 0x2EBAEF},
+    {0x9690, 0x00000b},
+    {0x9698, 0x0504D },
+    {0x969A, 0x2314f },
+    {0x969E, 0x03028 },
+    {0x96A0, 0x05010 },
+    {0x96A2, 0x40001 },
+    {0x96A6, 0x018670},
+    {0x96A8, 0x0024A },
+    {0x96B6, 0x00072 },
+    {0x96B8, 0x03210 },
+};
+
+#define TOTAL_NUMBER_OF_PATCH    (14)
+static uint16_t eee_patch_table[TOTAL_NUMBER_OF_PATCH][2] = {
+    {RgAddr_dev1Eh_reg120h, 0x8014},
+    {RgAddr_dev1Eh_reg122h, 0xFFFF},
+    {RgAddr_dev1Eh_reg122h, 0xFFFF},
+    {RgAddr_dev1Eh_reg144h, 0x0200},
+    {RgAddr_dev1Eh_reg14Ah, 0xEE20},
+    {RgAddr_dev1Eh_reg19Bh, 0x0111},
+    {RgAddr_dev1Eh_reg234h, 0x1181},
+    {RgAddr_dev1Eh_reg238h, 0x0120},
+    {RgAddr_dev1Eh_reg239h, 0x0117},
+    {RgAddr_dev1Fh_reg268h, 0x07F4},
+    {RgAddr_dev1Eh_reg2D1h, 0x0733},
+    {RgAddr_dev1Eh_reg323h, 0x0011},
+    {RgAddr_dev1Eh_reg324h, 0x013F},
+    {RgAddr_dev1Eh_reg326h, 0x0037}
+};
+
+#define TOTAL_NUMBER_OF_TR      (19)
+static uint16_t tr_reg_table[TOTAL_NUMBER_OF_TR][3] = {
+    {0x55A0, 0x0000, 0x83AA},
+    {0xFF3F, 0x0007, 0x83AE},
+    {0x001E, 0x0000, 0x8F80},
+    {0xB90A, 0x006F, 0x8F82},
+    {0x0671, 0x0006, 0x8FAE},
+    {0x2F00, 0x000E, 0x8FB0},
+    {0x4444, 0x0044, 0x8ECC},
+    {0x0004, 0x0000, 0x9686},
+    {0xBAEF, 0x002E, 0x968C},
+    {0x000B, 0x0000, 0x9690},
+    {0x504D, 0x0000, 0x9698},
+    {0x314F, 0x0002, 0x969A},
+    {0x3028, 0x0000, 0x969E},
+    {0x5010, 0x0000, 0x96A0},
+    {0x0001, 0x0004, 0x96A2},
+    {0x8670, 0x0001, 0x96A6},
+    {0x024A, 0x0000, 0x96A8},
+    {0x0072, 0x0000, 0x96B6},
+    {0x3210, 0x0000, 0x96B8}
+};
+
+void TR_RegWr(uint16_t phyadd, uint16_t tr_reg_addr, uint32_t tr_data);
+
+uint16_t get_gphy_reg_cl22(uint8_t phyad, uint8_t reg)
+{
+    uint32_t rdata = 0;
+
+    an8855_phy_read(phyad-g_smi_addr, reg, &rdata);
+
+    return ((uint16_t)rdata);
+    /*
+    gsw_top_reg_REG_PHY_IAC REG_PHY_IAC_val;
+    gsw_top_reg_REG_PHY_IAD REG_PHY_IAD_val;
+
+    // Wait until done
+    do
+    {
+      REG_PHY_IAC_val.Raw   = io_read32(RgAddr_gsw_top_reg_REG_PHY_IAC);
+    }
+    while(REG_PHY_IAC_val.Bits.csr_phy_acs_st);
+
+    // Set address
+    REG_PHY_IAC_val.Bits.csr_mdio_st = 1;
+    REG_PHY_IAC_val.Bits.csr_mdio_cmd   = 2;
+    REG_PHY_IAC_val.Bits.csr_mdio_phy_addr = phyad;
+    REG_PHY_IAC_val.Bits.csr_mdio_reg_addr = reg;
+    REG_PHY_IAC_val.Bits.csr_phy_acs_st =   1;
+    io_write32(RgAddr_gsw_top_reg_REG_PHY_IAC, REG_PHY_IAC_val.Raw);
+    // Wait until done
+    do
+    {
+        REG_PHY_IAC_val.Raw = io_read32(RgAddr_gsw_top_reg_REG_PHY_IAC);
+    }
+    while(REG_PHY_IAC_val.Bits.csr_phy_acs_st);
+
+    REG_PHY_IAD_val.Raw = io_read32(RgAddr_gsw_top_reg_REG_PHY_IAD);
+
+    return REG_PHY_IAD_val.Raw;
+    */
+}
+
+/* EXPORTED SUBPROGRAM BODIES
+ */
+void gphy_config(void)
+{
+    uint8_t port = 1;
+    uint8_t phy_base = 0, phys_in_chip = 8;
+
+    for (port = 1; port <= phys_in_chip; port++)
+    {
+        set_gphy_reg_cl45(phy_base + port, 0x7, 0x3c, 0x0006); // Enable EEE
+        set_gphy_reg_cl45(phy_base + port, 0x1e, 0x3e, 0xf000); // force on TXVLD
+    }
+}
+
+static void set_gphy_TrReg(uint8_t prtid, uint16_t parm_1, uint16_t parm_2, uint16_t parm_3)
+{
+    set_gphy_reg_cl22(prtid, RgAddr_TrReg11h, parm_1);
+    set_gphy_reg_cl22(prtid, RgAddr_TrReg12h, parm_2);
+    set_gphy_reg_cl22(prtid, RgAddr_TrReg10h, parm_3);
+}
+
+static void gphy_eee_patch(uint8_t phy_base)
+{
+    UI8_T   port = 1, index = 0, phy_addr = 1;
+    UI16_T  data = 0;
+
+    for (port = 1; port <=8; port++)
+    {
+        phy_addr = phy_base + port;
+        data = get_gphy_reg_cl22(phy_addr, MII_BMCR);
+        set_gphy_reg_cl22(phy_addr, MII_BMCR, data & ~(BMCR_PDOWN));    /* PHY power on */
+
+        /* Change EEE RG default value */
+        for (index = 0; index < TOTAL_NUMBER_OF_PATCH; index++)
+        {
+            set_gphy_reg_cl45(phy_addr, DEVID_1E, eee_patch_table[index][0], eee_patch_table[index][1]);
+        }
+
+        set_gphy_reg_cl22(phy_addr, RgAddr_Reg1Fh, CL22_Page_TrReg);   /* change CL22page to LpiReg(0x3) */
+        for (index = 0; index < TOTAL_NUMBER_OF_TR; index++)
+        {
+            set_gphy_TrReg(phy_addr, tr_reg_table[index][0], tr_reg_table[index][1], tr_reg_table[index][2]);
+        }
+
+        set_gphy_reg_cl22(phy_addr, RgAddr_Reg1Fh, CL22_Page_LpiReg);  /* change CL22page to LpiReg(0x3) */
+        set_gphy_reg_cl22(phy_addr, RgAddr_LpiReg1Ch, 0x0c92);         /* Fine turn SigDet for B2B LPI link down issue */
+        set_gphy_reg_cl22(phy_addr, RgAddr_LpiReg1Dh, 0x0001);         /* Enable "lpi_quit_waitafesigdet_en" for LPI link down issue */
+
+        set_gphy_reg_cl22(phy_addr, RgAddr_Reg1Fh, CL22_Page_Reg);     /* change CL22page to Reg(0x0) */
+    }
+}
+
+void gphy_calibration(uint8_t phy_base)
+{
+    uint8_t port = 1, phy_addr = 1 ,phy_group = 1, index = 0;
+    uint8_t phys_in_chip = 5;
+
+    BG_Calibration(phy_base, 0x1);
+    if (phys_in_chip > 4)
+    {
+        BG_Calibration(phy_base + 0x4, 0x1);
+    }
+
+    for (port = 0; port < phys_in_chip; port++)
+    {
+        if (port < 4)
+        {
+            phy_group = phy_base;     /* PHY group 1 */
+        }
+        else
+        {
+            phy_group = phy_base + 0x04;     /* PHY group 2 */
+        }
+        phy_addr = phy_base + port;
+        R50_Calibration(phy_addr, phy_group);
+        TX_OFS_Calibration(phy_addr, phy_group);
+        TX_AMP_Calibration(phy_addr, phy_group);
+    }
+
+    for (port = 0; port < phys_in_chip; port++)
+    {
+        phy_addr = phy_base + port;
+        set_gphy_reg_cl45(phy_addr, 0x1e, 0x017d, 0x0000);
+        set_gphy_reg_cl45(phy_addr, 0x1e, 0x017e, 0x0000);
+        set_gphy_reg_cl45(phy_addr, 0x1e, 0x017f, 0x0000);
+        set_gphy_reg_cl45(phy_addr, 0x1e, 0x0180, 0x0000);
+        set_gphy_reg_cl45(phy_addr, 0x1e, 0x0181, 0x0000);
+        set_gphy_reg_cl45(phy_addr, 0x1e, 0x0182, 0x0000);
+        set_gphy_reg_cl45(phy_addr, 0x1e, 0x0183, 0x0000);
+        set_gphy_reg_cl45(phy_addr, 0x1e, 0x0184, 0x0000);
+        set_gphy_reg_cl45(phy_addr, 0x1e, 0x00db, 0x0000);  // disable analog calibration circuit
+        set_gphy_reg_cl45(phy_addr, 0x1e, 0x00dc, 0x0000);  // disable Tx offset calibration circuit
+        set_gphy_reg_cl45(phy_addr, 0x1e, 0x003e, 0x0000);  // disable Tx VLD force mode
+        set_gphy_reg_cl45(phy_addr, 0x1e, 0x00dd, 0x0000);  // disable Tx offset/amplitude calibration circuit
+        set_gphy_reg_cl45(phy_addr, 0x1e, 0x0145, 0x1000);  // enable auto MDI/MDIX
+
+        set_gphy_reg_cl22(phy_addr, 0, 0x1200);
+        /* GPHY Rx low pass filter */
+        set_gphy_reg_cl45(phy_addr, 0x1e, 0xc7, 0xd000);
+        /* patch */
+        for (index = 0; index < TOTAL_PATCH_C45_ITEMS; index++)
+        {
+            set_gphy_reg_cl45(phy_addr, C45_PATCH_TABLE[index][0], C45_PATCH_TABLE[index][1], C45_PATCH_TABLE[index][2]);
+        }
+        for (index = 0; index < TOTAL_PATCH_TR_ITEMS; index++)
+        {
+            TR_RegWr(phy_addr, TR_PATCH_TABLE[index][0], TR_PATCH_TABLE[index][1]);
+        }
+        set_gphy_reg_cl22(phy_addr, 0x1f, 0x0  );
+        set_gphy_reg_cl22(phy_addr, 0x1f, 0x3  );
+        set_gphy_reg_cl22(phy_addr, 0x1c, 0xc92);
+        set_gphy_reg_cl22(phy_addr, 0x1d, 0x01 );
+        set_gphy_reg_cl22(phy_addr, 0x1f, 0x0  );
+    }
+    gphy_eee_patch(phy_base);
+}
+
+/* LOCAL SUBPROGRAM BODIES
+ */
+void TR_RegWr(uint16_t phyadd, uint16_t tr_reg_addr, uint32_t tr_data)
+{
+    set_gphy_reg_cl22(phyadd, 0x1F, 0x52b5);       /* page select */
+    set_gphy_reg_cl22(phyadd, 0x11, (uint16_t)(tr_data & 0xffff));
+    set_gphy_reg_cl22(phyadd, 0x12, (uint16_t)(tr_data >> 16));
+    set_gphy_reg_cl22(phyadd, 0x10, (uint16_t)(tr_reg_addr | TrReg_WR));
+    set_gphy_reg_cl22(phyadd, 0x1F, 0x0);          /* page resetore */
+    return;
+}
+
+uint8_t BG_Calibration(uint8_t phyadd, int8_t calipolarity)
+{
+    int8_t rg_zcal_ctrl = 0, calibration_polarity = 0;
+    uint8_t all_ana_cal_status = 1;
+    uint16_t ad_cal_comp_out_init = 0;
+
+    /* setting */
+    set_gphy_reg_cl22(phyadd, RgAddr_Reg1Fh, CL22_Page_Reg);        // g0
+    set_gphy_reg_cl22(phyadd, RgAddr_Reg00h, AN_disable_force_1000M);  // AN disable, force 1000M
+    set_gphy_reg_cl45(phyadd, DEVID_1F, RgAddr_dev1Fh_reg100h, BG_voltage_output);// BG voltage output
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg145h, Fix_mdi);// fix mdi
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Fh_reg0FFh, 0x2);
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DBh, Cal_control_BG);// 1e_db[12]:rg_cal_ckinv, [8]:rg_ana_calen, [4]:rg_rext_calen
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DCh, Disable_all);// 1e_dc[0]:rg_txvos_calen
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0E1h, Disable_all);// 1e_e1[4]:rg_cal_refsel(0:1.2V) enable BG 1.2V to REXT PAD
+
+    /* calibrate */
+    rg_zcal_ctrl = ZCAL_MIDDLE;
+
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0E0h, (uint16_t)rg_zcal_ctrl);
+
+    anacal_exe(phyadd);
+    if (all_ana_cal_status == 0)
+    {
+        all_ana_cal_status = ANACAL_ERROR;
+    }
+    ad_cal_comp_out_init = (get_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg17Ah) >> 8) & 0x1;
+
+
+    if (ad_cal_comp_out_init == 1)
+    {
+        calibration_polarity = -calipolarity;
+    }
+    else // ad_cal_comp_out_init == 0
+    {
+        calibration_polarity = calipolarity;
+    }
+
+    while (all_ana_cal_status < ANACAL_ERROR)
+    {
+        rg_zcal_ctrl += calibration_polarity;
+
+        set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0E0h, (uint16_t)rg_zcal_ctrl);
+
+
+        anacal_exe(phyadd);
+
+        if (all_ana_cal_status == 0)
+        {
+            all_ana_cal_status = ANACAL_ERROR;
+        }
+
+        else if (((get_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg17Ah) >> 8) & 0x1) != ad_cal_comp_out_init)
+        {
+            all_ana_cal_status = ANACAL_FINISH;
+        }
+        else
+        {
+            if ((rg_zcal_ctrl == 0x3F) || (rg_zcal_ctrl == 0x00))
+            {
+                all_ana_cal_status = ANACAL_SATURATION;  // need to FT
+                rg_zcal_ctrl = ZCAL_MIDDLE;  // 0 dB
+            }
+        }
+    }
+
+    if (all_ana_cal_status == ANACAL_ERROR)
+    {
+        rg_zcal_ctrl = ZCAL_MIDDLE;  // 0 dB
+
+        set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0E0h, (uint16_t)rg_zcal_ctrl);
+    }
+    else
+    {
+        // rg_zcal_ctrl[5:0] rg_rext_trim[13:8]
+        set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0E0h, (uint16_t)((rg_zcal_ctrl << 8) | rg_zcal_ctrl));
+
+        // 1f_115[2:0](rg_bg_rasel) = rg_zcal_ctrl[5:3]
+        set_gphy_reg_cl45(phyadd, DEVID_1F, RgAddr_dev1Fh_reg115h, (uint16_t)((rg_zcal_ctrl & 0x3f) >> 3));
+    }
+
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DBh, Disable_all);
+    return all_ana_cal_status;
+}
+
+uint8_t R50_Calibration(uint8_t phyadd, uint8_t phyadd_common)
+{
+    int8_t rg_zcal_ctrl = 0, rg_r50ohm_rsel_tx = 0, calibration_polarity = 0;
+    uint8_t all_ana_cal_status = 1;
+    int16_t backup_dev1e_e0 = 0, ad_cal_comp_out_init = 0, calibration_pair = 0;
+
+    /* setting */
+    set_gphy_reg_cl22(phyadd, RgAddr_Reg1Fh, CL22_Page_Reg);        // g0
+    set_gphy_reg_cl22(phyadd, RgAddr_Reg00h, AN_disable_force_1000M);  // AN disable, force 1000M
+
+    set_gphy_reg_cl45(phyadd_common, DEVID_1F, RgAddr_dev1Fh_reg100h, BG_voltage_output); // BG voltage output
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg145h, Fix_mdi); // fix mdi
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg185h, Disable_tx_slew_control); // disable tx slew control
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0FBh, LDO_control); // ldo
+    set_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg0DBh, Cal_control_R50); // 1e_db[12]:rg_cal_ckinv, [8]:rg_ana_calen, [4]:rg_rext_calen
+    set_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg0DCh, Disable_all); // 1e_dc[0]:rg_txvos_calen
+    set_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg0E1h, Disable_all); // 1e_e1[4]:rg_cal_refsel(0:1.2V) enable BG 1.2V to REXT PAD
+
+    for (calibration_pair = ANACAL_PAIR_A; calibration_pair <= ANACAL_PAIR_D; calibration_pair++)
+    {
+        all_ana_cal_status = 1;
+
+        if (calibration_pair == ANACAL_PAIR_A)
+        {
+            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DBh, Cal_control_R50_pairA_ENABLE); // 1e_db[12]:rg_cal_ckinv, [8]:rg_ana_calen, [4]:rg_rext_calen, [0]:rg_zcalen_a
+            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DCh, Zcalen_A_ENABLE);
+        }
+        else if (calibration_pair == ANACAL_PAIR_B)
+        {
+            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DBh, Cal_control_R50); // 1e_db[12]:rg_cal_ckinv, [8]:rg_ana_calen, [4]:rg_rext_calen, [0]:rg_zcalen_a
+            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DCh, Zcalen_B_ENABLE); // 1e_dc[12]:rg_zcalen_b
+        }
+        else if (calibration_pair == ANACAL_PAIR_C)
+        {
+            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DBh, Cal_control_R50); // 1e_db[12]:rg_cal_ckinv, [8]:rg_ana_calen, [4]:rg_rext_calen, [0]:rg_zcalen_a
+            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DCh, Zcalen_C_ENABLE); // 1e_dc[8]:rg_zcalen_c
+        }
+        else // if(calibration_pair == ANACAL_PAIR_D)
+        {
+            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DBh, Cal_control_R50); // 1e_db[12]:rg_cal_ckinv, [8]:rg_ana_calen, [4]:rg_rext_calen, [0]:rg_zcalen_a
+            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DCh, Zcalen_D_ENABLE); // 1e_dc[4]:rg_zcalen_d
+        }
+
+        /* calibrate */
+        rg_zcal_ctrl = ZCAL_MIDDLE;             // start with 0 dB
+
+        backup_dev1e_e0 = (get_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg0E0h)&(~0x003f));
+        set_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg0E0h, (backup_dev1e_e0 | rg_zcal_ctrl));
+
+        anacal_exe(phyadd_common);
+        if (all_ana_cal_status == 0)
+        {
+            all_ana_cal_status = ANACAL_ERROR;
+        }
+
+        ad_cal_comp_out_init = (get_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg17Ah) >> 8) & 0x1;  // 1e_17a[8]:ad_cal_comp_out
+
+        if (ad_cal_comp_out_init == 1)
+        {
+            calibration_polarity = -1;
+        }
+        else
+        {
+            calibration_polarity = 1;
+        }
+
+        while (all_ana_cal_status < ANACAL_ERROR)
+        {
+            rg_zcal_ctrl += calibration_polarity;
+
+            set_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg0E0h, (backup_dev1e_e0 | rg_zcal_ctrl));
+
+            anacal_exe(phyadd_common);
+
+            if (all_ana_cal_status == 0)
+            {
+                all_ana_cal_status = ANACAL_ERROR;
+            }
+            else if (((get_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg17Ah) >> 8) & 0x1) != ad_cal_comp_out_init)
+            {
+                all_ana_cal_status = ANACAL_FINISH;
+            }
+            else
+            {
+                if ((rg_zcal_ctrl == 0x3F) || (rg_zcal_ctrl == 0x00))
+                {
+                    all_ana_cal_status = ANACAL_SATURATION;  // need to FT
+                    rg_zcal_ctrl = ZCAL_MIDDLE;  // 0 dB
+                }
+            }
+        }
+
+        if (all_ana_cal_status == ANACAL_ERROR)
+        {
+            rg_r50ohm_rsel_tx = ZCAL_MIDDLE;  // 0 dB
+        }
+        else
+        {
+            if (rg_zcal_ctrl > (0x3F - R50_OFFSET_VALUE))
+            {
+                all_ana_cal_status = ANACAL_SATURATION;  // need to FT
+                rg_zcal_ctrl = ZCAL_MIDDLE;  // 0 dB
+            }
+            else
+            {
+                rg_zcal_ctrl += R50_OFFSET_VALUE;
+            }
+
+            rg_r50ohm_rsel_tx = ZCAL_TO_R50ohm_TBL[rg_zcal_ctrl];
+        }
+
+        if (calibration_pair == ANACAL_PAIR_A)
+        {
+            // cr_r50ohm_rsel_tx_a
+            ad_cal_comp_out_init = get_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg174h)&(~MASK_r50ohm_rsel_tx_a);
+            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg174h, (ad_cal_comp_out_init | (((rg_r50ohm_rsel_tx << 8) & MASK_MSB_8bit) | Rg_r50ohm_rsel_tx_a_en))); // 1e_174[15:8]
+        }
+        else if (calibration_pair == ANACAL_PAIR_B)
+        {
+            // cr_r50ohm_rsel_tx_b
+            ad_cal_comp_out_init = get_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg174h)&(~MASK_r50ohm_rsel_tx_b);
+            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg174h, (ad_cal_comp_out_init | (((rg_r50ohm_rsel_tx << 0) & MASK_LSB_8bit) | Rg_r50ohm_rsel_tx_b_en))); // 1e_174[7:0]
+        }
+        else if (calibration_pair == ANACAL_PAIR_C)
+        {
+            // cr_r50ohm_rsel_tx_c
+            ad_cal_comp_out_init = get_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg175h)&(~MASK_r50ohm_rsel_tx_c);
+            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg175h, (ad_cal_comp_out_init | (((rg_r50ohm_rsel_tx << 8) & MASK_MSB_8bit) | Rg_r50ohm_rsel_tx_c_en))); // 1e_175[15:8]
+        }
+        else // if(calibration_pair == ANACAL_PAIR_D)
+        {
+            // cr_r50ohm_rsel_tx_d
+            ad_cal_comp_out_init = get_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg175h)&(~MASK_r50ohm_rsel_tx_d);
+            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg175h, (ad_cal_comp_out_init | (((rg_r50ohm_rsel_tx << 0) & MASK_LSB_8bit) | Rg_r50ohm_rsel_tx_d_en))); // 1e_175[7:0]
+        }
+    }
+
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DBh, Disable_all);
+    set_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg0DBh, Disable_all);
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DCh, Disable_all);
+
+    return all_ana_cal_status;
+}
+
+uint8_t TX_OFS_Calibration(uint8_t phyadd, uint8_t phyadd_common)
+{
+    int8_t tx_offset_index = 0, calibration_polarity = 0;
+    uint8_t all_ana_cal_status = 1, tx_offset_reg_shift = 0, tbl_idx = 0;
+    int16_t ad_cal_comp_out_init = 0, calibration_pair = 0, tx_offset_reg = 0, reg_temp = 0;
+
+    /* setting */
+    set_gphy_reg_cl22(phyadd, RgAddr_Reg1Fh, CL22_Page_Reg);        // g0
+    set_gphy_reg_cl22(phyadd, RgAddr_Reg00h, AN_disable_force_1000M);  // AN disable, force 1000M
+
+    set_gphy_reg_cl45(phyadd, DEVID_1F, RgAddr_dev1Fh_reg100h, BG_voltage_output); // BG voltage output
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg145h, Fix_mdi); // fix mdi
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg185h, Disable_tx_slew_control); // disable tx slew control
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0FBh, LDO_control); // ldo
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DBh, Cal_control_TX_OFST); // 1e_db[12]:rg_cal_ckinv, [8]:rg_ana_calen, [4]:rg_rext_calen
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DCh, Rg_txvos_calen_ENABLE); // 1e_dc[0]:rg_txvos_calen
+    set_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg0DBh, Cal_control_TX_OFST); // 1e_db[12]:rg_cal_ckinv, [8]:rg_ana_calen, [4]:rg_rext_calen
+    set_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg0DCh, Rg_txvos_calen_ENABLE); // 1e_dc[0]:rg_txvos_calen
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0E1h, Disable_all); // 1e_e1[4]:rg_cal_refsel(0:1.2V) enable BG 1.2V to REXT PAD
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg096h, Bypass_tx_offset_cal); // 1e_96[15]:bypass_tx_offset_cal, Hw bypass, Fw cal
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg03Eh, Enable_Tx_VLD); // 1e_3e:enable Tx VLD
+
+    for (calibration_pair = ANACAL_PAIR_A; calibration_pair <= ANACAL_PAIR_D; calibration_pair++)
+    {
+        all_ana_cal_status = 1;
+
+        tbl_idx = TX_OFFSET_0mV_idx;
+        tx_offset_index = EN753x_TX_OFS_TBL[tbl_idx];
+
+        if (calibration_pair == ANACAL_PAIR_A)
+        {
+            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DDh, Rg_txg_calen_a_ENABLE);       // 1e_dd[12]:rg_txg_calen_a
+            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg17Dh, (Force_dasn_dac_in0_ENABLE | DAC_IN_0V));  // 1e_17d:dac_in0_a
+            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg181h, (Force_dasn_dac_in1_ENABLE | DAC_IN_0V));  // 1e_181:dac_in1_a
+
+            reg_temp = (get_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg172h)&(~MASK_cr_tx_amp_offset_MSB));
+            tx_offset_reg_shift = 8;  // 1e_172[13:8]
+            tx_offset_reg = RgAddr_dev1Eh_reg172h;
+        }
+        else if (calibration_pair == ANACAL_PAIR_B)
+        {
+            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DDh, Rg_txg_calen_b_ENABLE);       // 1e_dd[8]:rg_txg_calen_b
+            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg17Eh, (Force_dasn_dac_in0_ENABLE | DAC_IN_0V));  // 1e_17e:dac_in0_b
+            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg182h, (Force_dasn_dac_in1_ENABLE | DAC_IN_0V));  // 1e_182:dac_in1_b
+
+            reg_temp = (get_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg172h)&(~MASK_cr_tx_amp_offset_LSB));
+            tx_offset_reg_shift = 0;  // 1e_172[5:0]
+            tx_offset_reg = RgAddr_dev1Eh_reg172h;
+        }
+        else if (calibration_pair == ANACAL_PAIR_C)
+        {
+            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DDh, Rg_txg_calen_c_ENABLE);       // 1e_dd[4]:rg_txg_calen_c
+            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg17Fh, (Force_dasn_dac_in0_ENABLE | DAC_IN_0V));  // 1e_17f:dac_in0_c
+            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg183h, (Force_dasn_dac_in1_ENABLE | DAC_IN_0V));  // 1e_183:dac_in1_c
+
+            reg_temp = (get_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg173h)&(~MASK_cr_tx_amp_offset_MSB));
+            tx_offset_reg_shift = 8;  // 1e_173[13:8]
+            tx_offset_reg = RgAddr_dev1Eh_reg173h;
+        }
+        else // if(calibration_pair == ANACAL_PAIR_D)
+        {
+            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DDh, Rg_txg_calen_d_ENABLE);       // 1e_dd[0]:rg_txg_calen_d
+            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg180h, (Force_dasn_dac_in0_ENABLE | DAC_IN_0V));  // 1e_180:dac_in0_d
+            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg184h, (Force_dasn_dac_in1_ENABLE | DAC_IN_0V));  // 1e_184:dac_in1_d
+
+            reg_temp = (get_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg173h)&(~MASK_cr_tx_amp_offset_LSB));
+            tx_offset_reg_shift = 0;  // 1e_173[5:0]
+            tx_offset_reg = RgAddr_dev1Eh_reg173h;
+        }
+
+        /* calibrate */
+        //tx_offset_index = TX_AMP_OFFSET_0mV;
+        tbl_idx = TX_OFFSET_0mV_idx;
+        tx_offset_index = EN753x_TX_OFS_TBL[tbl_idx];
+        set_gphy_reg_cl45(phyadd, DEVID_1E, tx_offset_reg, (reg_temp | (tx_offset_index << tx_offset_reg_shift)));  // 1e_172, 1e_173
+
+        anacal_exe(phyadd_common);
+        if (all_ana_cal_status == 0)
+        {
+            all_ana_cal_status = ANACAL_ERROR;
+        }
+
+        ad_cal_comp_out_init = (get_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg17Ah) >> 8) & 0x1;  // 1e_17a[8]:ad_cal_comp_out
+
+        if (ad_cal_comp_out_init == 1)
+        {
+            calibration_polarity = -1;
+        }
+        else
+        {
+            calibration_polarity = 1;
+        }
+
+        while (all_ana_cal_status < ANACAL_ERROR)
+        {
+            tbl_idx += calibration_polarity;
+            tx_offset_index = EN753x_TX_OFS_TBL[tbl_idx];
+
+            set_gphy_reg_cl45(phyadd, DEVID_1E, tx_offset_reg, (reg_temp | (tx_offset_index << tx_offset_reg_shift)));  // 1e_172, 1e_173
+
+            anacal_exe(phyadd_common);
+
+            if (all_ana_cal_status == 0)
+            {
+                all_ana_cal_status = ANACAL_ERROR;
+            }
+            else if (((get_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg17Ah) >> 8) & 0x1) != ad_cal_comp_out_init)
+            {
+                all_ana_cal_status = ANACAL_FINISH;
+            }
+            else
+            {
+                if ((tx_offset_index == 0x3f) || (tx_offset_index == 0x1f))
+                {
+                    all_ana_cal_status = ANACAL_SATURATION;  // need to FT
+                }
+            }
+        }
+
+        if (all_ana_cal_status == ANACAL_ERROR)
+        {
+            tbl_idx = TX_OFFSET_0mV_idx;
+            tx_offset_index = EN753x_TX_OFS_TBL[tbl_idx];
+
+            set_gphy_reg_cl45(phyadd, DEVID_1E, tx_offset_reg, (reg_temp | (tx_offset_index << tx_offset_reg_shift)));  // cr_tx_amp_offset_a/b/c/d, 1e_172, 1e_173
+        }
+    }
+
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg17Dh, Disable_all);
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg17Eh, Disable_all);
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg17Fh, Disable_all);
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg180h, Disable_all);
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg181h, Disable_all);
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg182h, Disable_all);
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg183h, Disable_all);
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg184h, Disable_all);
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DBh, Disable_all); // disable analog calibration circuit
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DCh, Disable_all); // disable Tx offset calibration circuit
+    set_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg0DBh, Disable_all); // disable analog calibration circuit
+    set_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg0DCh, Disable_all); // disable Tx offset calibration circuit
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg03Eh, Disable_all); // disable Tx VLD force mode
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DDh, Disable_all); // disable Tx offset/amplitude calibration circuit
+
+    return all_ana_cal_status;
+}
+
+uint8_t TX_AMP_Calibration(uint8_t phyadd, uint8_t phyadd_common)
+{
+    int8_t tx_amp_index = 0, calibration_polarity = 0;
+    uint8_t all_ana_cal_status = 1, tx_amp_reg_shift = 0;
+    uint8_t tx_amp_reg = 0, tx_amp_reg_100 = 0, tst_offset = 0, hbt_offset = 0, gbe_offset = 0, tbt_offset = 0;
+    uint16_t ad_cal_comp_out_init = 0, calibration_pair = 0, reg_temp = 0;
+
+  //phyadd_common = phyadd;
+
+    /* setting */
+    set_gphy_reg_cl22(phyadd, RgAddr_Reg1Fh, CL22_Page_Reg);        // g0
+    set_gphy_reg_cl22(phyadd, RgAddr_Reg00h, AN_disable_force_1000M);  // AN disable, force 1000M
+
+    set_gphy_reg_cl45(phyadd, DEVID_1F, RgAddr_dev1Fh_reg100h, BG_voltage_output); // BG voltage output
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg145h, Fix_mdi); // fix mdi
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg185h, Disable_tx_slew_control); // disable tx slew control
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0FBh, LDO_control); // ldo
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DBh, Cal_control_TX_AMP); // 1e_db[12]:rg_cal_ckinv, [8]:rg_ana_calen, [4]:rg_rext_calen
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DCh, Rg_txvos_calen_ENABLE); // 1e_dc[0]:rg_txvos_calen
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0E1h, Rg_cal_refsel_ENABLE); // 1e_e1[4]:rg_cal_refsel(0:1.2V) enable BG 1.2V to REXT PAD
+    set_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg0DBh, Cal_control_TX_AMP); // 1e_db[12]:rg_cal_ckinv, [8]:rg_ana_calen, [4]:rg_rext_calen
+    set_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg0DCh, Rg_txvos_calen_ENABLE); // 1e_dc[0]:rg_txvos_calen
+    set_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg0E1h, Rg_cal_refsel_ENABLE); // 1e_e1[4]:rg_cal_refsel(0:1.2V) enable BG 1.2V to REXT PAD
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg096h, Bypass_tx_offset_cal); // 1e_96[15]:bypass_tx_offset_cal, Hw bypass, Fw cal
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg03Eh, Enable_Tx_VLD); // 1e_3e:enable Tx VLD
+
+    for (calibration_pair = ANACAL_PAIR_A; calibration_pair <= ANACAL_PAIR_D; calibration_pair++)
+    //for (calibration_pair = ANACAL_PAIR_A; calibration_pair <= ANACAL_PAIR_B; calibration_pair++) // debugging
+    {
+        all_ana_cal_status = 1;
+
+        /* calibrate */
+        tx_amp_index = TX_AMP_MIDDLE;   // start with 0 dB
+        if (calibration_pair == ANACAL_PAIR_A)
+        {
+            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DDh, Rg_txg_calen_a_ENABLE);       // 1e_dd[12]:rg_txg_calen_a amp calibration enable
+            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg17Dh, (Force_dasn_dac_in0_ENABLE | DAC_IN_2V));  // 1e_17d:dac_in0_a
+            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg181h, (Force_dasn_dac_in1_ENABLE | DAC_IN_2V));  // 1e_181:dac_in1_a
+
+            reg_temp = (get_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg012h)&(~MASK_da_tx_i2mpb_a_gbe));
+            tx_amp_reg_shift = 10;  // 1e_12[15:10]
+            tx_amp_reg = RgAddr_dev1Eh_reg012h;
+            tx_amp_reg_100 = 0x16;
+        }
+        else if (calibration_pair == ANACAL_PAIR_B)
+        {
+            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DDh, Rg_txg_calen_b_ENABLE);       // 1e_dd[8]:rg_txg_calen_b amp calibration enable
+            //Serial.println(Rg_txg_calen_b_ENABLE, HEX);
+            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg17Eh, (Force_dasn_dac_in0_ENABLE | DAC_IN_2V));  // 1e_17e:dac_in0_b
+            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg182h, (Force_dasn_dac_in1_ENABLE | DAC_IN_2V));  // 1e_182:dac_in1_b
+
+            reg_temp = (get_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg017h)&(~MASK_da_tx_i2mpb_b_c_d_gbe));
+            tx_amp_reg_shift = 8; // 1e_17[13:8]
+            tx_amp_reg = RgAddr_dev1Eh_reg017h;
+            tx_amp_reg_100 = 0x18;
+        }
+        else if (calibration_pair == ANACAL_PAIR_C)
+        {
+            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DDh, Rg_txg_calen_c_ENABLE);       // 1e_dd[4]:rg_txg_calen_c amp calibration enable
+            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg17Fh, (Force_dasn_dac_in0_ENABLE | DAC_IN_2V));  // 1e_17f:dac_in0_c
+            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg183h, (Force_dasn_dac_in1_ENABLE | DAC_IN_2V));  // 1e_183:dac_in1_c
+
+            reg_temp = (get_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg019h)&(~MASK_da_tx_i2mpb_b_c_d_gbe));
+            tx_amp_reg_shift = 8; // 1e_19[13:8]
+            tx_amp_reg = RgAddr_dev1Eh_reg019h;
+            tx_amp_reg_100 = 0x20;
+        }
+        else //if(calibration_pair == ANACAL_PAIR_D)
+        {
+            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DDh, Rg_txg_calen_d_ENABLE);       // 1e_dd[0]:rg_txg_calen_d amp calibration enable
+            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg180h, (Force_dasn_dac_in0_ENABLE | DAC_IN_2V));  // 1e_180:dac_in0_d
+            set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg184h, (Force_dasn_dac_in1_ENABLE | DAC_IN_2V));  // 1e_184:dac_in1_d
+
+            reg_temp = (get_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg021h)&(~MASK_da_tx_i2mpb_b_c_d_gbe));
+            tx_amp_reg_shift = 8; // 1e_21[13:8]
+            tx_amp_reg = RgAddr_dev1Eh_reg021h;
+            tx_amp_reg_100 = 0x22;
+        }
+
+        /* calibrate */
+        tx_amp_index = TX_AMP_MIDDLE; // start with 0 dB
+
+        set_gphy_reg_cl45(phyadd, DEVID_1E, tx_amp_reg, (reg_temp | (tx_amp_index << tx_amp_reg_shift))); // 1e_12/17/19/21
+
+        anacal_exe(phyadd_common);
+        if (all_ana_cal_status == 0)
+        {
+            all_ana_cal_status = ANACAL_ERROR;
+        }
+
+
+        ad_cal_comp_out_init = (get_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg17Ah) >> 8) & 0x1;    // 1e_17a[8]:ad_cal_comp_out
+        //Serial.println(ad_cal_comp_out_init, HEX);
+
+        if (ad_cal_comp_out_init == 1)
+        {
+            calibration_polarity = -1;
+        }
+        else
+        {
+            calibration_polarity = 1;
+        }
+        while (all_ana_cal_status < ANACAL_ERROR)
+        {
+            tx_amp_index += calibration_polarity;
+            //Serial.println(tx_amp_index, HEX);
+
+            set_gphy_reg_cl45(phyadd, DEVID_1E, tx_amp_reg, (reg_temp | (tx_amp_index << tx_amp_reg_shift)));
+
+            anacal_exe(phyadd_common);
+
+            if (all_ana_cal_status == 0)
+            {
+                all_ana_cal_status = ANACAL_ERROR;
+            }
+            else if (((get_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg17Ah) >> 8) & 0x1) != ad_cal_comp_out_init)
+            {
+                all_ana_cal_status = ANACAL_FINISH;
+                //Serial.print("    tx_amp_index: ");
+                //Serial.println(tx_amp_index, HEX);
+                //reg_temp = get_gphy_reg_cl45(phyadd, 0x1e, tx_amp_reg)&(~0xff00);
+                //set_gphy_reg_cl45(phyadd, 0x1e, tx_amp_reg, (reg_temp|((tx_amp_index + tst_offset)<<tx_amp_reg_shift)));  // for gbe(DAC)
+            }
+            else
+            {
+                if ((tx_amp_index == 0x3f) || (tx_amp_index == 0x00))
+                {
+                    all_ana_cal_status = ANACAL_SATURATION;  // need to FT
+                    tx_amp_index = TX_AMP_MIDDLE;
+                }
+            }
+        }
+
+        if (all_ana_cal_status == ANACAL_ERROR)
+        {
+            tx_amp_index = TX_AMP_MIDDLE;
+        }
+
+        // da_tx_i2mpb_a_gbe / b/c/d, only GBE for now
+        set_gphy_reg_cl45(phyadd, DEVID_1E, tx_amp_reg, ((tx_amp_index - TXAMP_offset) | ((tx_amp_index - TXAMP_offset) << tx_amp_reg_shift)));  // // temp modify
+        set_gphy_reg_cl45(phyadd, DEVID_1E, tx_amp_reg_100, ((tx_amp_index - TXAMP_offset) | ((tx_amp_index + TX_i2mpb_hbt_ofs) << tx_amp_reg_shift)));
+    }
+
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg17Dh, Disable_all);
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg17Eh, Disable_all);
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg17Fh, Disable_all);
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg180h, Disable_all);
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg181h, Disable_all);
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg182h, Disable_all);
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg183h, Disable_all);
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg184h, Disable_all);
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DBh, Disable_all); // disable analog calibration circuit
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DCh, Disable_all); // disable Tx offset calibration circuit
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg03Eh, Disable_all); // disable Tx VLD force mode
+    set_gphy_reg_cl45(phyadd, DEVID_1E, RgAddr_dev1Eh_reg0DDh, Disable_all); // disable Tx offset/amplitude calibration circuit
+
+    return all_ana_cal_status;
+}
+
+void set_gphy_reg_cl22(uint8_t phyad, uint8_t reg, uint16_t value)
+{
+    an8855_phy_write(phyad-g_smi_addr, reg, value);
+    /*
+       gsw_top_reg_REG_PHY_IAC REG_PHY_IAC_val;
+       gsw_top_reg_REG_PHY_IAD REG_PHY_IAD_val;
+
+    // Wait until done
+    do
+    {
+    REG_PHY_IAC_val.Raw = io_read32(RgAddr_gsw_top_reg_REG_PHY_IAC);
+    }
+    while(REG_PHY_IAC_val.Bits.csr_phy_acs_st);
+
+    // Set address
+    REG_PHY_IAC_val.Bits.csr_mdio_st = 1;
+    REG_PHY_IAC_val.Bits.csr_mdio_cmd = 1;
+    REG_PHY_IAC_val.Bits.csr_mdio_phy_addr = phyad;
+    REG_PHY_IAC_val.Bits.csr_mdio_reg_addr = reg;
+    REG_PHY_IAC_val.Bits.csr_mdio_wr_data = value;
+    REG_PHY_IAC_val.Bits.csr_phy_acs_st = 1;
+
+    io_write32(RgAddr_gsw_top_reg_REG_PHY_IAC, REG_PHY_IAC_val.Raw);
+    */
+}
+
+UINT16 get_gphy_reg_cl45(uint8_t prtid, uint8_t devid, uint16_t reg)
+{
+    UINT32 rdata = 0;
+
+    an8855_phy_read_cl45(prtid-g_smi_addr, devid, reg, &rdata);
+    return ((UINT16)rdata);
+    /*
+    gsw_top_reg_REG_PHY_IAC REG_PHY_IAC_val;
+    gsw_top_reg_REG_PHY_IAD REG_PHY_IAD_val;
+
+    // Wait until done
+    do
+    {
+    REG_PHY_IAC_val.Raw = io_read32(RgAddr_gsw_top_reg_REG_PHY_IAC);
+    }
+    while(REG_PHY_IAC_val.Bits.csr_phy_acs_st);
+
+    // Set address
+    REG_PHY_IAC_val.Bits.csr_mdio_st = 0;
+    REG_PHY_IAC_val.Bits.csr_mdio_cmd = 0;
+    REG_PHY_IAC_val.Bits.csr_mdio_phy_addr = prtid;
+    REG_PHY_IAC_val.Bits.csr_mdio_reg_addr = devid;
+    REG_PHY_IAC_val.Bits.csr_mdio_wr_data = reg;
+    REG_PHY_IAC_val.Bits.csr_phy_acs_st = 1;
+
+    io_write32(RgAddr_gsw_top_reg_REG_PHY_IAC, REG_PHY_IAC_val.Raw);
+
+    // Wait until done
+    do
+    {
+    REG_PHY_IAC_val.Raw = io_read32(RgAddr_gsw_top_reg_REG_PHY_IAC);
+    }
+    while(REG_PHY_IAC_val.Bits.csr_phy_acs_st);
+
+    // Read value
+    REG_PHY_IAC_val.Bits.csr_mdio_st = 0;
+    REG_PHY_IAC_val.Bits.csr_mdio_cmd = 3;
+    REG_PHY_IAC_val.Bits.csr_mdio_phy_addr = prtid;
+    REG_PHY_IAC_val.Bits.csr_mdio_reg_addr = devid;
+    REG_PHY_IAC_val.Bits.csr_mdio_wr_data = 0;
+    REG_PHY_IAC_val.Bits.csr_phy_acs_st = 1;
+    io_write32(RgAddr_gsw_top_reg_REG_PHY_IAC, REG_PHY_IAC_val.Raw);
+
+    // Wait until done
+    do
+    {
+    REG_PHY_IAC_val.Raw = io_read32(RgAddr_gsw_top_reg_REG_PHY_IAC);
+    }
+    while(REG_PHY_IAC_val.Bits.csr_phy_acs_st);
+
+    REG_PHY_IAD_val.Raw = io_read32(RgAddr_gsw_top_reg_REG_PHY_IAD);
+
+    return REG_PHY_IAD_val.Raw;
+    */
+}
+
+void set_gphy_reg_cl45(uint8_t prtid, uint8_t devid, uint16_t reg, uint16_t value)
+{
+    an8855_phy_write_cl45(prtid-g_smi_addr, devid, reg, value);
+    /*
+    gsw_top_reg_REG_PHY_IAC REG_PHY_IAC_val;
+
+    // Wait until done
+    do
+    {
+        REG_PHY_IAC_val.Raw = io_read32(RgAddr_gsw_top_reg_REG_PHY_IAC);
+    }
+    while(REG_PHY_IAC_val.Bits.csr_phy_acs_st);
+
+    // Set address
+    REG_PHY_IAC_val.Bits.csr_mdio_st = 0;
+    REG_PHY_IAC_val.Bits.csr_mdio_cmd = 0;
+    REG_PHY_IAC_val.Bits.csr_mdio_phy_addr = prtid;
+    REG_PHY_IAC_val.Bits.csr_mdio_reg_addr = devid;
+    REG_PHY_IAC_val.Bits.csr_mdio_wr_data = reg;
+    REG_PHY_IAC_val.Bits.csr_phy_acs_st = 1;
+
+    io_write32(RgAddr_gsw_top_reg_REG_PHY_IAC, REG_PHY_IAC_val.Raw);
+
+    // Wait until done
+    do
+    {
+        REG_PHY_IAC_val.Raw = io_read32(RgAddr_gsw_top_reg_REG_PHY_IAC);
+    }
+    while(REG_PHY_IAC_val.Bits.csr_phy_acs_st);
+
+    // Write value
+    REG_PHY_IAC_val.Bits.csr_mdio_st = 0;
+    REG_PHY_IAC_val.Bits.csr_mdio_cmd = 1;
+    REG_PHY_IAC_val.Bits.csr_mdio_phy_addr = prtid;
+    REG_PHY_IAC_val.Bits.csr_mdio_reg_addr = devid;
+    REG_PHY_IAC_val.Bits.csr_mdio_wr_data = value;
+    REG_PHY_IAC_val.Bits.csr_phy_acs_st = 1;
+
+    io_write32(RgAddr_gsw_top_reg_REG_PHY_IAC, REG_PHY_IAC_val.Raw);
+    */
+}
+
+void anacal_exe(uint8_t phyadd_common)
+{
+    set_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg17Ch, 1);// da_calin_flag pull high
+    an8855_udelay(1000);
+    set_gphy_reg_cl45(phyadd_common, DEVID_1E, RgAddr_dev1Eh_reg17Ch, 0);// da_calin_flag pull low
+}
+
diff --git a/recipes-devtools/switch/files/src/an8855_sdk/core/an8855_reg.h b/recipes-devtools/switch/files/src/an8855_sdk/core/an8855_reg.h
index 3459cef..b444697 100644
--- a/recipes-devtools/switch/files/src/an8855_sdk/core/an8855_reg.h
+++ b/recipes-devtools/switch/files/src/an8855_sdk/core/an8855_reg.h
@@ -1,191 +1,191 @@
-    /* FILE NAME:  an8855_reg.h
- * PURPOSE:
- *      It provides AN8855 register definition.
- * NOTES:
- *
- */
-
-#ifndef AN8855_REG_H
-#define AN8855_REG_H
-
-#define PORT_CTRL_BASE                      0x10208000
-#define PORT_CTRL_PORT_OFFSET               0x200
-#define PORT_CTRL_REG(p, r)                 (PORT_CTRL_BASE + (p) * PORT_CTRL_PORT_OFFSET + (r))
-#define PCR(p)                              PORT_CTRL_REG(p, 0x04)
-
-#define PORT_MAC_CTRL_BASE                  0x10210000
-#define PORT_MAC_CTRL_PORT_OFFSET           0x200
-#define PORT_MAC_CTRL_REG(p, r)             (PORT_MAC_CTRL_BASE + (p) * PORT_MAC_CTRL_PORT_OFFSET + (r))
-#define PMCR(p)                             PORT_MAC_CTRL_REG(p, 0x00)
-
-/* Port debug count register */
-#define DBG_CNT_BASE                        0x3018
-#define DBG_CNT_PORT_BASE                   0x100
-#define DBG_CNT(p)                          (DBG_CNT_BASE + (p) * DBG_CNT_PORT_BASE)
-#define DIS_CLR                             (1 << 31)
-
-#define GMACCR                              (PORT_MAC_CTRL_BASE + 0x30e0)
-#define MTCC_LMT_S                          8
-#define MAX_RX_JUMBO_S                      4
-
-/* Values of MAX_RX_PKT_LEN */
-#define RX_PKT_LEN_1518                     0
-#define RX_PKT_LEN_1536                     1
-#define RX_PKT_LEN_1522                     2
-#define RX_PKT_LEN_MAX_JUMBO                3
-
-/* Fields of PMCR */
-#define FORCE_MODE                          (1 << 31)
-#define IPG_CFG_S                           20
-#define IPG_CFG_M                           0x300000
-#define EXT_PHY                             (1 << 19)
-#define MAC_MODE                            (1 << 18)
-#define MAC_TX_EN                           (1 << 16)
-#define MAC_RX_EN                           (1 << 15)
-#define MAC_PRE                             (1 << 14)
-#define BKOFF_EN                            (1 << 12)
-#define BACKPR_EN                           (1 << 11)
-#define FORCE_EEE1G                         (1 << 7)
-#define FORCE_EEE100                        (1 << 6)
-#define FORCE_RX_FC                         (1 << 5)
-#define FORCE_TX_FC                         (1 << 4)
-#define FORCE_SPD_S                         28
-#define FORCE_SPD_M                         0x70000000
-#define FORCE_DPX                           (1 << 25)
-#define FORCE_LINK                          (1 << 24)
-
-/* Fields of PMSR */
-#define EEE1G_STS                           (1 << 7)
-#define EEE100_STS                          (1 << 6)
-#define RX_FC_STS                           (1 << 5)
-#define TX_FC_STS                           (1 << 4)
-#define MAC_SPD_STS_S                       28
-#define MAC_SPD_STS_M                       0x70000000
-#define MAC_DPX_STS                         (1 << 25)
-#define MAC_LNK_STS                         (1 << 24)
-
-/* Values of MAC_SPD_STS */
-#define MAC_SPD_10                          0
-#define MAC_SPD_100                         1
-#define MAC_SPD_1000                        2
-#define MAC_SPD_2500                        3
-
-/* Values of IPG_CFG */
-#define IPG_96BIT                           0
-#define IPG_96BIT_WITH_SHORT_IPG            1
-#define IPG_64BIT                           2
-
-#define SGMII_REG_BASE                      0x5000
-#define SGMII_REG_PORT_BASE                 0x1000
-#define SGMII_REG(p, r)                     (SGMII_REG_BASE + (p) * SGMII_REG_PORT_BASE + (r))
-#define PCS_CONTROL_1(p)                    SGMII_REG(p, 0x00)
-#define SGMII_MODE(p)                       SGMII_REG(p, 0x20)
-#define QPHY_PWR_STATE_CTRL(p)              SGMII_REG(p, 0xe8)
-#define PHYA_CTRL_SIGNAL3(p)                SGMII_REG(p, 0x128)
-
-/* Fields of PCS_CONTROL_1 */
-#define SGMII_LINK_STATUS                   (1 << 18)
-#define SGMII_AN_ENABLE                     (1 << 12)
-#define SGMII_AN_RESTART                    (1 << 9)
-
-/* Fields of SGMII_MODE */
-#define SGMII_REMOTE_FAULT_DIS              (1 << 8)
-#define SGMII_IF_MODE_FORCE_DUPLEX          (1 << 4)
-#define SGMII_IF_MODE_FORCE_SPEED_S         0x2
-#define SGMII_IF_MODE_FORCE_SPEED_M         0x0c
-#define SGMII_IF_MODE_ADVERT_AN             (1 << 1)
-
-/* Values of SGMII_IF_MODE_FORCE_SPEED */
-#define SGMII_IF_MODE_FORCE_SPEED_10        0
-#define SGMII_IF_MODE_FORCE_SPEED_100       1
-#define SGMII_IF_MODE_FORCE_SPEED_1000      2
-
-/* Fields of QPHY_PWR_STATE_CTRL */
-#define PHYA_PWD                            (1 << 4)
-
-/* Fields of PHYA_CTRL_SIGNAL3 */
-#define RG_TPHY_SPEED_S                     2
-#define RG_TPHY_SPEED_M                     0x0c
-
-/* Values of RG_TPHY_SPEED */
-#define RG_TPHY_SPEED_1000                  0
-#define RG_TPHY_SPEED_2500                  1
-
-#define SYS_CTRL                            0x7000
-#define SW_PHY_RST                          (1 << 2)
-#define SW_SYS_RST                          (1 << 1)
-#define SW_REG_RST                          (1 << 0)
-
-#define PHY_IAC                             (0x1000e000)
-#define IAC_MAX_BUSY_TIME                   (1000)
-
-#define CLKGEN_CTRL                         0x7500
-#define CLK_SKEW_OUT_S                      8
-#define CLK_SKEW_OUT_M                      0x300
-#define CLK_SKEW_IN_S                       6
-#define CLK_SKEW_IN_M                       0xc0
-#define RXCLK_NO_DELAY                      (1 << 5)
-#define TXCLK_NO_REVERSE                    (1 << 4)
-#define GP_MODE_S                           1
-#define GP_MODE_M                           0x06
-#define GP_CLK_EN                           (1 << 0)
-
-/* Values of GP_MODE */
-#define GP_MODE_RGMII                       0
-#define GP_MODE_MII                         1
-#define GP_MODE_REV_MII                     2
-
-/* Values of CLK_SKEW_IN */
-#define CLK_SKEW_IN_NO_CHANGE               0
-#define CLK_SKEW_IN_DELAY_100PPS            1
-#define CLK_SKEW_IN_DELAY_200PPS            2
-#define CLK_SKEW_IN_REVERSE                 3
-
-/* Values of CLK_SKEW_OUT */
-#define CLK_SKEW_OUT_NO_CHANGE              0
-#define CLK_SKEW_OUT_DELAY_100PPS           1
-#define CLK_SKEW_OUT_DELAY_200PPS           2
-#define CLK_SKEW_OUT_REVERSE                3
-
-#define HWSTRAP                             0x7800
-#define XTAL_FSEL_S                         7
-#define XTAL_FSEL_M                         (1 << 7)
-
-#define XTAL_40MHZ                          0
-#define XTAL_25MHZ                          1
-
-#define PLLGP_EN                            0x7820
-#define EN_COREPLL                          (1 << 2)
-#define SW_CLKSW                            (1 << 1)
-#define SW_PLLGP                            (1 << 0)
-
-#define PLLGP_CR0                           0x78a8
-#define RG_COREPLL_EN                       (1 << 22)
-#define RG_COREPLL_POSDIV_S                 23
-#define RG_COREPLL_POSDIV_M                 0x3800000
-#define RG_COREPLL_SDM_PCW_S                1
-#define RG_COREPLL_SDM_PCW_M                0x3ffffe
-#define RG_COREPLL_SDM_PCW_CHG              (1 << 0)
-
-#define MHWSTRAP                            0x7804
-#define TOP_SIG_SR                          0x780c
-#define PAD_DUAL_SGMII_EN                   (1 << 1)
-
-/* RGMII and SGMII PLL clock */
-#define ANA_PLLGP_CR2                       0x78b0
-#define ANA_PLLGP_CR5                       0x78bc
-
-/* Efuse Register Define */
-#define GBE_EFUSE                           0x7bc8
-#define GBE_SEL_EFUSE_EN                    (1 << 0)
-
-/* GPIO_PAD_0 */
-#define GPIO_MODE0                          0x7c0c
-#define GPIO_MODE0_S                        0
-#define GPIO_MODE0_M                        0xf
-#define GPIO_0_INTERRUPT_MODE               0x1
-
-#define SMT0_IOLB                           0x7f04
-#define SMT_IOLB_5_SMI_MDC_EN               (1 << 5)
-
-#endif  /* End of AN8855_REG_H */
+    /* FILE NAME:  an8855_reg.h
+ * PURPOSE:
+ *      It provides AN8855 register definition.
+ * NOTES:
+ *
+ */
+
+#ifndef AN8855_REG_H
+#define AN8855_REG_H
+
+#define PORT_CTRL_BASE                      0x10208000
+#define PORT_CTRL_PORT_OFFSET               0x200
+#define PORT_CTRL_REG(p, r)                 (PORT_CTRL_BASE + (p) * PORT_CTRL_PORT_OFFSET + (r))
+#define PCR(p)                              PORT_CTRL_REG(p, 0x04)
+
+#define PORT_MAC_CTRL_BASE                  0x10210000
+#define PORT_MAC_CTRL_PORT_OFFSET           0x200
+#define PORT_MAC_CTRL_REG(p, r)             (PORT_MAC_CTRL_BASE + (p) * PORT_MAC_CTRL_PORT_OFFSET + (r))
+#define PMCR(p)                             PORT_MAC_CTRL_REG(p, 0x00)
+
+/* Port debug count register */
+#define DBG_CNT_BASE                        0x3018
+#define DBG_CNT_PORT_BASE                   0x100
+#define DBG_CNT(p)                          (DBG_CNT_BASE + (p) * DBG_CNT_PORT_BASE)
+#define DIS_CLR                             (1 << 31)
+
+#define GMACCR                              (PORT_MAC_CTRL_BASE + 0x30e0)
+#define MTCC_LMT_S                          8
+#define MAX_RX_JUMBO_S                      4
+
+/* Values of MAX_RX_PKT_LEN */
+#define RX_PKT_LEN_1518                     0
+#define RX_PKT_LEN_1536                     1
+#define RX_PKT_LEN_1522                     2
+#define RX_PKT_LEN_MAX_JUMBO                3
+
+/* Fields of PMCR */
+#define FORCE_MODE                          (1 << 31)
+#define IPG_CFG_S                           20
+#define IPG_CFG_M                           0x300000
+#define EXT_PHY                             (1 << 19)
+#define MAC_MODE                            (1 << 18)
+#define MAC_TX_EN                           (1 << 16)
+#define MAC_RX_EN                           (1 << 15)
+#define MAC_PRE                             (1 << 14)
+#define BKOFF_EN                            (1 << 12)
+#define BACKPR_EN                           (1 << 11)
+#define FORCE_EEE1G                         (1 << 7)
+#define FORCE_EEE100                        (1 << 6)
+#define FORCE_RX_FC                         (1 << 5)
+#define FORCE_TX_FC                         (1 << 4)
+#define FORCE_SPD_S                         28
+#define FORCE_SPD_M                         0x70000000
+#define FORCE_DPX                           (1 << 25)
+#define FORCE_LINK                          (1 << 24)
+
+/* Fields of PMSR */
+#define EEE1G_STS                           (1 << 7)
+#define EEE100_STS                          (1 << 6)
+#define RX_FC_STS                           (1 << 5)
+#define TX_FC_STS                           (1 << 4)
+#define MAC_SPD_STS_S                       28
+#define MAC_SPD_STS_M                       0x70000000
+#define MAC_DPX_STS                         (1 << 25)
+#define MAC_LNK_STS                         (1 << 24)
+
+/* Values of MAC_SPD_STS */
+#define MAC_SPD_10                          0
+#define MAC_SPD_100                         1
+#define MAC_SPD_1000                        2
+#define MAC_SPD_2500                        3
+
+/* Values of IPG_CFG */
+#define IPG_96BIT                           0
+#define IPG_96BIT_WITH_SHORT_IPG            1
+#define IPG_64BIT                           2
+
+#define SGMII_REG_BASE                      0x5000
+#define SGMII_REG_PORT_BASE                 0x1000
+#define SGMII_REG(p, r)                     (SGMII_REG_BASE + (p) * SGMII_REG_PORT_BASE + (r))
+#define PCS_CONTROL_1(p)                    SGMII_REG(p, 0x00)
+#define SGMII_MODE(p)                       SGMII_REG(p, 0x20)
+#define QPHY_PWR_STATE_CTRL(p)              SGMII_REG(p, 0xe8)
+#define PHYA_CTRL_SIGNAL3(p)                SGMII_REG(p, 0x128)
+
+/* Fields of PCS_CONTROL_1 */
+#define SGMII_LINK_STATUS                   (1 << 18)
+#define SGMII_AN_ENABLE                     (1 << 12)
+#define SGMII_AN_RESTART                    (1 << 9)
+
+/* Fields of SGMII_MODE */
+#define SGMII_REMOTE_FAULT_DIS              (1 << 8)
+#define SGMII_IF_MODE_FORCE_DUPLEX          (1 << 4)
+#define SGMII_IF_MODE_FORCE_SPEED_S         0x2
+#define SGMII_IF_MODE_FORCE_SPEED_M         0x0c
+#define SGMII_IF_MODE_ADVERT_AN             (1 << 1)
+
+/* Values of SGMII_IF_MODE_FORCE_SPEED */
+#define SGMII_IF_MODE_FORCE_SPEED_10        0
+#define SGMII_IF_MODE_FORCE_SPEED_100       1
+#define SGMII_IF_MODE_FORCE_SPEED_1000      2
+
+/* Fields of QPHY_PWR_STATE_CTRL */
+#define PHYA_PWD                            (1 << 4)
+
+/* Fields of PHYA_CTRL_SIGNAL3 */
+#define RG_TPHY_SPEED_S                     2
+#define RG_TPHY_SPEED_M                     0x0c
+
+/* Values of RG_TPHY_SPEED */
+#define RG_TPHY_SPEED_1000                  0
+#define RG_TPHY_SPEED_2500                  1
+
+#define SYS_CTRL                            0x7000
+#define SW_PHY_RST                          (1 << 2)
+#define SW_SYS_RST                          (1 << 1)
+#define SW_REG_RST                          (1 << 0)
+
+#define PHY_IAC                             (0x1000e000)
+#define IAC_MAX_BUSY_TIME                   (1000)
+
+#define CLKGEN_CTRL                         0x7500
+#define CLK_SKEW_OUT_S                      8
+#define CLK_SKEW_OUT_M                      0x300
+#define CLK_SKEW_IN_S                       6
+#define CLK_SKEW_IN_M                       0xc0
+#define RXCLK_NO_DELAY                      (1 << 5)
+#define TXCLK_NO_REVERSE                    (1 << 4)
+#define GP_MODE_S                           1
+#define GP_MODE_M                           0x06
+#define GP_CLK_EN                           (1 << 0)
+
+/* Values of GP_MODE */
+#define GP_MODE_RGMII                       0
+#define GP_MODE_MII                         1
+#define GP_MODE_REV_MII                     2
+
+/* Values of CLK_SKEW_IN */
+#define CLK_SKEW_IN_NO_CHANGE               0
+#define CLK_SKEW_IN_DELAY_100PPS            1
+#define CLK_SKEW_IN_DELAY_200PPS            2
+#define CLK_SKEW_IN_REVERSE                 3
+
+/* Values of CLK_SKEW_OUT */
+#define CLK_SKEW_OUT_NO_CHANGE              0
+#define CLK_SKEW_OUT_DELAY_100PPS           1
+#define CLK_SKEW_OUT_DELAY_200PPS           2
+#define CLK_SKEW_OUT_REVERSE                3
+
+#define HWSTRAP                             0x7800
+#define XTAL_FSEL_S                         7
+#define XTAL_FSEL_M                         (1 << 7)
+
+#define XTAL_40MHZ                          0
+#define XTAL_25MHZ                          1
+
+#define PLLGP_EN                            0x7820
+#define EN_COREPLL                          (1 << 2)
+#define SW_CLKSW                            (1 << 1)
+#define SW_PLLGP                            (1 << 0)
+
+#define PLLGP_CR0                           0x78a8
+#define RG_COREPLL_EN                       (1 << 22)
+#define RG_COREPLL_POSDIV_S                 23
+#define RG_COREPLL_POSDIV_M                 0x3800000
+#define RG_COREPLL_SDM_PCW_S                1
+#define RG_COREPLL_SDM_PCW_M                0x3ffffe
+#define RG_COREPLL_SDM_PCW_CHG              (1 << 0)
+
+#define MHWSTRAP                            0x7804
+#define TOP_SIG_SR                          0x780c
+#define PAD_DUAL_SGMII_EN                   (1 << 1)
+
+/* RGMII and SGMII PLL clock */
+#define ANA_PLLGP_CR2                       0x78b0
+#define ANA_PLLGP_CR5                       0x78bc
+
+/* Efuse Register Define */
+#define GBE_EFUSE                           0x7bc8
+#define GBE_SEL_EFUSE_EN                    (1 << 0)
+
+/* GPIO_PAD_0 */
+#define GPIO_MODE0                          0x7c0c
+#define GPIO_MODE0_S                        0
+#define GPIO_MODE0_M                        0xf
+#define GPIO_0_INTERRUPT_MODE               0x1
+
+#define SMT0_IOLB                           0x7f04
+#define SMT_IOLB_5_SMI_MDC_EN               (1 << 5)
+
+#endif  /* End of AN8855_REG_H */
diff --git a/recipes-devtools/switch/files/src/switch_753x.c b/recipes-devtools/switch/files/src/switch_753x.c
index 6936f6a..03e9778 100644
--- a/recipes-devtools/switch/files/src/switch_753x.c
+++ b/recipes-devtools/switch/files/src/switch_753x.c
@@ -8,17 +8,19 @@
 #include <sys/ioctl.h>
 #include <sys/socket.h>
 #include <linux/if.h>
+#include <errno.h>
 
 #include "switch_netlink.h"
 #include "switch_ioctl.h"
 #include "switch_fun.h"
 #include "switch_fun_an8855.h"
 
-#define SWITCH_APP_VERSION "1.0.1"
+#define SWITCH_APP_VERSION "1.0.7"
 
 struct mt753x_attr *attres;
 int chip_name;
 bool nl_init_flag;
+bool air_skip_check_flag;
 struct switch_func_s *p_switch_func;
 
 static void usage(char *cmd)
@@ -427,27 +429,39 @@
 {
 	unsigned int val;
 	unsigned int off;
+	char *endptr;
 	int i, j;
 
 	if (!strncmp(argv[len - 3], "reg", 4)) {
 		if (argv[len - 2][0] == 'r') {
-			off = strtoul(argv[len - 1], NULL, 16);
+			errno = 0;
+			off = strtoul(argv[len - 1], &endptr, 16);
+			if (errno != 0 || *endptr != '\0')
+				goto error;
 			reg_read(off, &val);
 			printf(" Read reg=%x, value=%x\n", off, val);
 		} else if (argv[len - 2][0] == 'w') {
-			off = strtoul(argv[len - 1], NULL, 16);
+			errno = 0;
+			off = strtoul(argv[len - 1], &endptr, 16);
+			if (errno != 0 || *endptr != '\0')
+				goto error;
 			if (argc != len + 1)
 				usage(argv[0]);
-			val = strtoul(argv[len], NULL, 16);
+			errno = 0;
+			val = strtoul(argv[len], &endptr, 16);
+			if (errno != 0 || *endptr != '\0')
+				goto error;
 			reg_write(off, val);
 			printf(" Write reg=%x, value=%x\n", off, val);
 		} else if (argv[len - 2][0] == 'd') {
-			off = strtoul(argv[len - 1], NULL, 16);
+			errno = 0;
+			off = strtoul(argv[len - 1], &endptr, 16);
+			if (errno != 0 || *endptr != '\0')
+				goto error;
 			for (i = 0; i < 16; i++) {
 				printf("0x%08x: ", off + 0x10 * i);
 				for (j = 0; j < 4; j++) {
-					reg_read(off + i * 0x10 + j * 0x4,
-						 &val);
+					reg_read(off + i * 0x10 + j * 0x4, &val);
 					printf(" 0x%08x", val);
 				}
 				printf("\n");
@@ -456,6 +470,9 @@
 			usage(argv[0]);
 	} else
 		usage(argv[0]);
+	return;
+error:
+	printf("Error: string converting\n");
 }
 
 static int get_chip_name()
@@ -464,6 +481,12 @@
 	FILE *fp = NULL;
 	char buff[255];
 
+	/*judge an8855, must be placed before reg_read*/
+	if (air_skip_check_flag) {
+		temp = 0x8855;
+		return temp;
+	}
+
 	/*judge jaguar embedded switch */
 	fp = fopen("/proc/device-tree/compatible", "r");
 	if (fp != NULL) {
@@ -488,11 +511,6 @@
 	if (temp == 0x7531)
 		return temp;
 
-	/*judge an8855 */
-	reg_read(0x10005000, &temp);
-	if (temp == 0x8855)
-		return temp;
-
 	return -1;
 }
 
@@ -622,7 +640,9 @@
 
 int main(int argc, char *argv[])
 {
-	int err;
+	int err = -EINVAL;
+	FILE *fp = NULL;
+	char buff[255];
 
 	attres = (struct mt753x_attr *)malloc(sizeof(struct mt753x_attr));
 	if (attres == NULL) {
@@ -633,28 +653,35 @@
 	attres->port_num = -1;
 	attres->phy_dev = -1;
 	nl_init_flag = true;
+	air_skip_check_flag = false;
 
-	/* dsa netlink family might not be enabled. Try gsw netlink family. */
-	err = mt753x_netlink_init(MT753X_DSA_GENL_NAME);
-	if (!err)
-		chip_name = get_chip_name();
+	fp = fopen("/proc/air_sw/device", "r");
+	if (fp != NULL) {
+		if (fgets(buff, 255, (FILE *) fp) && strstr(buff, "an8855"))
+			air_skip_check_flag = true;
 
-	if (err < 0) {
-		err = mt753x_netlink_init(MT753X_GENL_NAME);
-		if (!err)
-			chip_name = get_chip_name();
-	}
+		if ((fclose(fp) == 0) && air_skip_check_flag) {
+			err = mt753x_netlink_init(AN8855_DSA_GENL_NAME);
+			if (!err)
+				chip_name = get_chip_name();
 
-	if (err < 0) {
-		err = mt753x_netlink_init(AN8855_DSA_GENL_NAME);
+			if (err < 0) {
+				err = mt753x_netlink_init(AN8855_GENL_NAME);
+				if (!err)
+					chip_name = get_chip_name();
+			}
+		}
+	} else {
+		/* dsa netlink family might not be enabled. Try gsw netlink family. */
+		err = mt753x_netlink_init(MT753X_DSA_GENL_NAME);
 		if (!err)
 			chip_name = get_chip_name();
-	}
 
-	if (err < 0) {
-		err = mt753x_netlink_init(AN8855_GENL_NAME);
-		if (!err)
-			chip_name = get_chip_name();
+		if (err < 0) {
+			err = mt753x_netlink_init(MT753X_GENL_NAME);
+			if (!err)
+				chip_name = get_chip_name();
+		}
 	}
 
 	if (err < 0) {
diff --git a/recipes-devtools/switch/files/src/switch_extend.h b/recipes-devtools/switch/files/src/switch_extend.h
index c352767..a35316e 100644
--- a/recipes-devtools/switch/files/src/switch_extend.h
+++ b/recipes-devtools/switch/files/src/switch_extend.h
@@ -154,7 +154,7 @@
 #define REG_VAWD2_ADDR			(0x0098)
 #define REG_VLAN_ID_BASE		(0x0100)
 
-#define REG_CPGC_ADDR 			(0xB0)
+#define REG_CPGC_ADDR			(0xB0)
 #define REG_CPCG_COL_EN_OFFT		(0)
 #define REG_CPCG_COL_EN_RELMASK		(0x00000001)
 #define REG_CPCG_COL_EN_MASK		(REG_CPCG_COL_EN_RELMASK << REG_CPCG_COL_EN_OFFT)
@@ -336,7 +336,7 @@
 						 "         1: Blocking/Listening/Discarding\n" \
 						 "         2: Learning\n" \
 						 "         3: Forwarding\n"
-#define HELP_COLLISION_POOL_EN	"collision-pool enable [enable 0|1] \n"
-#define HELP_EEE_EN		"eee [enable|disable] ([port|portMap]) \n"
+#define HELP_COLLISION_POOL_EN	"collision-pool enable [enable 0|1]\n"
+#define HELP_EEE_EN		"eee [enable|disable] ([port|portMap])\n"
 
 //#endif //SQA_VERIFY
diff --git a/recipes-devtools/switch/files/src/switch_fun.c b/recipes-devtools/switch/files/src/switch_fun.c
index 4745cf5..4239e1a 100644
--- a/recipes-devtools/switch/files/src/switch_fun.c
+++ b/recipes-devtools/switch/files/src/switch_fun.c
@@ -1,6 +1,6 @@
 /*
-* switch_fun.c: switch function sets
-*/
+ * switch_fun.c: switch function sets
+ */
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -202,7 +202,7 @@
 	int ret;
 
 	if (port_num > 31) {
-		printf("Invalid Port or PHY addr \n");
+		printf("Invalid Port or PHY addr\n");
 		return -1;
 	}
 
@@ -225,7 +225,7 @@
 	int ret;
 
 	if (port_num > 31) {
-		printf("Invalid Port or PHY addr \n");
+		printf("Invalid Port or PHY addr\n");
 		return -1;
 	}
 
@@ -249,7 +249,7 @@
 	int ret;
 
 	if (port_num > 31) {
-		printf("Invalid Port or PHY addr \n");
+		printf("Invalid Port or PHY addr\n");
 		return -1;
 	}
 
@@ -273,7 +273,7 @@
 	int ret;
 
 	if (port_num > 31) {
-		printf("Invalid Port or PHY addr \n");
+		printf("Invalid Port or PHY addr\n");
 		return -1;
 	}
 
@@ -335,8 +335,8 @@
 	}
 
 	printf("mii_mgr_cl45:");
-	printf("Read:  port#=%d, device=0x%x, reg=0x%x, value=0x%x\n", port_num,
-	       0x1E, MT7530_T10_TEST_CONTROL, value);
+	printf("Read:  port#=%d, device=0x%x, reg=0x%x, value=0x%x\n",
+			port_num, 0x1E, MT7530_T10_TEST_CONTROL, value);
 
 	if (!strncmp(argv[3], "auto", 5)) {
 		value &= (~(0x3 << 3));
@@ -349,8 +349,8 @@
 		printf("invaild parameter\n");
 		return;
 	}
-	printf("Write: port#=%d, device=0x%x, reg=0x%x. value=0x%x\n", port_num,
-	       0x1E, MT7530_T10_TEST_CONTROL, value);
+	printf("Write: port#=%d, device=0x%x, reg=0x%x. value=0x%x\n",
+		port_num, 0x1E, MT7530_T10_TEST_CONTROL, value);
 
 	if (nl_init_flag == true)
 		ret =
@@ -408,16 +408,15 @@
 			goto error;
 
 		printf("port = %x, ch_addr = %x, node_addr=%x, data_addr=%x\n",
-		       port_num, ch_addr, node_addr, data_addr);
+				port_num, ch_addr, node_addr, data_addr);
 		tr_reg_control =
 		    (1 << 15) | (1 << 13) | (ch_addr << 11) | (node_addr << 7) |
 		    (data_addr << 1);
 		mii_mgr_write(port_num, 16, tr_reg_control);	// r16 = tr_reg_control
 		mii_mgr_read(port_num, 17, &val_l);
 		mii_mgr_read(port_num, 18, &val_h);
-		printf
-		    ("switch trreg read tr_reg_control=%x, value_H=%x, value_L=%x\n",
-		     tr_reg_control, val_h, val_l);
+		printf("switch trreg read tr_reg_control=%x, value_H=%x, value_L=%x\n",
+				tr_reg_control, val_h, val_l);
 	} else if (argv[2][0] == 'w') {
 		if (argc != 9)
 			return -1;
@@ -456,16 +455,15 @@
 			goto error;
 
 		printf("port = %x, ch_addr = %x, node_addr=%x, data_addr=%x\n",
-		       port_num, ch_addr, node_addr, data_addr);
+				port_num, ch_addr, node_addr, data_addr);
 		tr_reg_control =
 		    (1 << 15) | (0 << 13) | (ch_addr << 11) | (node_addr << 7) |
 		    (data_addr << 1);
 		mii_mgr_write(port_num, 17, val_l);
 		mii_mgr_write(port_num, 18, val_h);
 		mii_mgr_write(port_num, 16, tr_reg_control);	// r16 = tr_reg_control
-		printf
-		    ("switch trreg Write tr_reg_control=%x, value_H=%x, value_L=%x\n",
-		     tr_reg_control, val_h, val_l);
+		printf("switch trreg Write tr_reg_control=%x, value_H=%x, value_L=%x\n",
+				tr_reg_control, val_h, val_l);
 	} else
 		return -1;
 
@@ -497,9 +495,8 @@
 	reg = REG_VTCR_ADDR;
 	while (1) {		// wait until not busy
 		reg_read(reg, &value);
-		if ((value & REG_VTCR_BUSY_MASK) == 0) {
+		if ((value & REG_VTCR_BUSY_MASK) == 0)
 			break;
-		}
 	}
 	reg_write(REG_VAWD1_ADDR, vawd1);
 	printf("write reg: %x, value: %x\n", REG_VAWD1_ADDR, vawd1);
@@ -521,11 +518,17 @@
 {
 	unsigned int vawd1 = 0, vawd2 = 0;
 	unsigned char tbl_idx = 0;
+	unsigned int max_index = 0;
 	char *endptr;
 
+	if (chip_name == 0x7531 || chip_name == 0x7988)
+		max_index = 256;
+	else
+		max_index = 64;
+
 	errno = 0;
 	tbl_idx = strtoul(argv[3], &endptr, 10);
-	if (errno != 0 || *endptr != '\0') {
+	if (errno != 0 || *endptr != '\0' || tbl_idx >= max_index) {
 		printf("Error: wrong ACL rule table index\n");
 		return;
 	}
@@ -589,11 +592,17 @@
 {
 	unsigned int vawd1 = 0, vawd2 = 0;
 	unsigned char tbl_idx = 0;
+	unsigned int max_index = 0;
 	char *endptr;
 
+	if (chip_name == 0x7531 || chip_name == 0x7988)
+		max_index = 128;
+	else
+		max_index = 32;
+
 	errno = 0;
 	tbl_idx = strtoul(argv[3], &endptr, 10);
-	if (errno != 0 || *endptr != '\0') {
+	if (errno != 0 || *endptr != '\0' || tbl_idx >= max_index) {
 		printf("Error: wrong ACL mask table index\n");
 		return;
 	}
@@ -628,7 +637,8 @@
 
 	printf("Rule_control_tbl_idx:%d\n", tbl_idx);
 
-	if (tbl_idx >= max_index) {	/* Check the input parameters is right or not. */
+	if (tbl_idx >= max_index) {
+		/* Check the input parameters is right or not. */
 		printf(HELP_ACL_RULE_TBL_ADD);
 		return;
 	}
@@ -636,9 +646,8 @@
 
 	while (1) {		// wait until not busy
 		reg_read(reg, &value);
-		if ((value & REG_VTCR_BUSY_MASK) == 0) {
+		if ((value & REG_VTCR_BUSY_MASK) == 0)
 			break;
-		}
 	}
 	reg_write(REG_VAWD1_ADDR, vawd1);
 	printf("write reg: %x, value: %x\n", REG_VAWD1_ADDR, vawd1);
@@ -651,9 +660,8 @@
 
 	while (1) {		// wait until not busy
 		reg_read(reg, &value);
-		if ((value & REG_VTCR_BUSY_MASK) == 0) {
+		if ((value & REG_VTCR_BUSY_MASK) == 0)
 			break;
-		}
 	}
 }
 
@@ -661,11 +669,17 @@
 {
 	unsigned int vawd1 = 0, vawd2 = 0;
 	unsigned char tbl_idx = 0;
+	unsigned int max_index = 0;
 	char *endptr;
 
+	if (chip_name == 0x7531 || chip_name == 0x7988)
+		max_index = 128;
+	else
+		max_index = 32;
+
 	errno = 0;
 	tbl_idx = strtoul(argv[3], &endptr, 10);
-	if (errno != 0 || *endptr != '\0') {
+	if (errno != 0 || *endptr != '\0' || tbl_idx >= max_index) {
 		printf("Error: wrong ACL rule control table index\n");
 		return;
 	}
@@ -727,11 +741,12 @@
 {
 	unsigned int vawd1 = 0, vawd2 = 0;
 	unsigned char tbl_idx = 0;
+	unsigned int max_index = 32;
 	char *endptr;
 
 	errno = 0;
 	tbl_idx = strtoul(argv[3], &endptr, 10);
-	if (errno != 0 || *endptr != '\0') {
+	if (errno != 0 || *endptr != '\0' || tbl_idx >= max_index) {
 		printf("Error: wrong ACL rate control table index\n");
 		return;
 	}
@@ -802,9 +817,8 @@
 
 	if (len2 == 12) {
 		if (!argv[4] || strlen(argv[4]) != len2) {
-			printf
-			    ("The [%s] format error, should be of length %d\n",
-			     argv[4], len2);
+			printf("The [%s] format error, should be of length %d\n",
+					argv[4], len2);
 			return -1;
 		}
 	}
@@ -816,8 +830,7 @@
 
 	for (i = 0; i < 7; i++) {
 		if (argv[5][i] != '0' && argv[5][i] != '1') {
-			printf
-			    ("portmap format error, should be of combination of 0 or 1\n");
+			printf("portmap format error, should be of combination of 0 or 1\n");
 			return -1;
 		}
 		*port += (argv[5][i] - '0') * (1 << i);
@@ -890,7 +903,6 @@
 
 error:
 	printf("Error: string converting\n");
-	return;
 }
 
 void acl_dip_meter(int argc, char *argv[])
@@ -1214,8 +1226,7 @@
 		table_size = 0x40;
 		reg_write(REG_ATC_ADDR, 0x811c);	//dip search command
 	}
-	printf
-	    ("hash   port(0:6)   rsp_cnt  flag  timer    dip-address       ATRD\n");
+	printf("hash   port(0:6)   rsp_cnt  flag  timer    dip-address       ATRD\n");
 	for (i = 0; i < table_size; i++) {
 		while (1) {
 			reg_read(REG_ATC_ADDR, &value);
@@ -1292,10 +1303,6 @@
 	reg_write(REG_ATA1_ADDR, value);
 	printf("REG_ATA1_ADDR is 0x%x\n\r", value);
 
-#if 0
-	reg_write(REG_ATA2_ADDR, value);
-	printf("REG_ATA2_ADDR is 0x%x\n\r", value);
-#endif
 	if (!argv[4] || strlen(argv[4]) != 8) {
 		printf("portmap format error, should be of length 7\n");
 		return;
@@ -1303,8 +1310,7 @@
 	j = 0;
 	for (i = 0; i < 7; i++) {
 		if (argv[4][i] != '0' && argv[4][i] != '1') {
-			printf
-			    ("portmap format error, should be of combination of 0 or 1\n");
+			printf("portmap format error, should be of combination of 0 or 1\n");
 			return;
 		}
 		j += (argv[4][i] - '0') * (1 << i);
@@ -1368,7 +1374,6 @@
 
 void dip_clear(int argc, char *argv[])
 {
-
 	unsigned int value = 0;
 
 	reg_write(REG_ATC_ADDR, 0x8102);	//clear all dip
@@ -1481,8 +1486,7 @@
 	j = 0;
 	for (i = 0; i < 7; i++) {
 		if (argv[5][i] != '0' && argv[5][i] != '1') {
-			printf
-			    ("portmap format error, should be of combination of 0 or 1\n");
+			printf("portmap format error, should be of combination of 0 or 1\n");
 			return;
 		}
 		j += (argv[5][i] - '0') * (1 << i);
@@ -1571,8 +1575,7 @@
 		table_end = 0x3F;
 		reg_write(REG_ATC_ADDR, 0x800C);
 	}
-	printf
-	    ("hash  port(0:6)   fid   vid  age(s)   mac-address     filter my_mac\n");
+	printf("hash  port(0:6)   fid   vid  age(s)   mac-address     filter my_mac\n");
 	for (i = 0; i < table_size; i++) {
 		while (1) {
 			reg_read(REG_ATC_ADDR, &value);
@@ -1623,8 +1626,7 @@
 				}
 				break;
 			} else if ((value & 0x4000) && (((value >> 15) & 0x1) == 0) && (((value >> 16) & 0xfff) == table_end)) {	//at_table_end
-				printf("found the last entry %d (not ready)\n",
-				       i);
+				printf("found the last entry %d (not ready)\n", i);
 				return;
 			} else
 				usleep(5);
@@ -1702,8 +1704,7 @@
 	j = 0;
 	for (i = 0; i < 7; i++) {
 		if (argv[3][i] != '0' && argv[3][i] != '1') {
-			printf
-			    ("portmap format error, should be of combination of 0 or 1\n");
+			printf("portmap format error, should be of combination of 0 or 1\n");
 			return;
 		}
 		j += (argv[3][i] - '0') * (1 << i);
@@ -2154,8 +2155,7 @@
 	}
 
 	if (eg_tag)
-		printf
-		    ("  vid  fid  portmap    s-tag\teg_tag(0:untagged 2:tagged)\n");
+		printf("  vid  fid  portmap    s-tag\teg_tag(0:untagged 2:tagged)\n");
 	else
 		printf("  vid  fid  portmap    s-tag\n");
 
@@ -2305,8 +2305,7 @@
 	vlan_mem = 0;
 	for (i = 0; i < 8; i++) {
 		if (argv[5][i] != '0' && argv[5][i] != '1') {
-			printf
-			    ("portmap format error, should be of combination of 0 or 1\n");
+			printf("portmap format error, should be of combination of 0 or 1\n");
 			return;
 		}
 		vlan_mem += (argv[5][i] - '0') * (1 << i);
@@ -2316,8 +2315,7 @@
 	if (argc > 6) {
 		stag = strtoul(argv[6], NULL, 16);
 		if (stag < 0 || 0xfff < stag) {
-			printf
-			    ("wrong stag id range, should be within 0~4095\n");
+			printf("wrong stag id range, should be within 0~4095\n");
 			return;
 		}
 		//printf("STAG is 0x%x\n", stag);
@@ -2338,15 +2336,13 @@
 
 	if (argc > 8 && !eg_con) {
 		if (strlen(argv[8]) != 8) {
-			printf
-			    ("egtag portmap format error, should be of length 7\n");
+			printf("egtag portmap format error, should be of length 7\n");
 			return;
 		}
 
 		for (i = 0; i < 8; i++) {
 			if (argv[8][i] < '0' || argv[8][i] > '3') {
-				printf
-				    ("egtag portmap format error, should be of combination of 0 or 3\n");
+				printf("egtag portmap format error, should be of combination of 0 or 3\n");
 				return;
 			}
 			//eg_tag += (argv[8][i] - '0') * (1 << i * 2);
@@ -2592,13 +2588,13 @@
 	/*Software Register Reset  and Software System Reset */
 	reg_write(0x7000, 0x3);
 	reg_read(0x7000, &value);
-	printf("SYS_CTRL(0x7000) register value =0x%x  \n", value);
+	printf("SYS_CTRL(0x7000) register value =0x%x\n", value);
 	if (chip_name == 0x7531) {
 		reg_write(0x7c0c, 0x11111111);
 		reg_read(0x7c0c, &value);
-		printf("GPIO Mode (0x7c0c) select value =0x%x  \n", value);
+		printf("GPIO Mode (0x7c0c) select value =0x%x\n", value);
 	}
-	printf("Switch Software Reset !!! \n");
+	printf("Switch Software Reset !!!\n");
 }
 
 void phy_set_fc(int argc, char *argv[])
@@ -2633,8 +2629,7 @@
 	}
 	mii_mgr_write(port, 4, phy_value);
 	printf("write phy_value:0x%x\r\n", phy_value);
-	return;
-}				/*end phy_set_fc */
+}
 
 void phy_set_an(int argc, char *argv[])
 {
@@ -2664,7 +2659,7 @@
 	phy_value |= (auto_negotiation_en << 12);
 	mii_mgr_write(port, 0, phy_value);
 	printf("write phy_value:0x%x\r\n", phy_value);
-}				/*end phy_set_an */
+}
 
 void set_mac_pfc(int argc, char *argv[])
 {
@@ -2887,9 +2882,8 @@
 
 	port = atoi(argv[3]);
 
-	for (i = 0; i < 8; i++) {
+	for (i = 0; i < 8; i++)
 		weight[i] = atoi(argv[i + 4]);
-	}
 
 	/* MT7530 total 7 port */
 	if (port < 0 || port > 6) {
@@ -3087,7 +3081,7 @@
 	reg_read(reg, &value);
 
 	printf("SetVid: index:%d active:%d vid:%d portMap:%x tagPortMap:%x\r\n",
-	       index, active, vid, portMap, tagPortMap);
+			index, active, vid, portMap, tagPortMap);
 	return 0;
 
 }				/*end macMT753xVlanSetVid */
@@ -3140,8 +3134,8 @@
 	macMT753xVlanSetPvid(port, pvid);
 
 	printf("port:%d pvid:%d,vlancap: max_port:%d maxvid:%d\r\n",
-	       port, pvid, SWITCH_MAX_PORT, MAX_VID_VALUE);
-}				/*end doVlanSetPvid */
+			port, pvid, SWITCH_MAX_PORT, MAX_VID_VALUE);
+}
 
 void doVlanSetVid(int argc, char *argv[])
 {
@@ -3212,9 +3206,9 @@
 		}
 	}
 	macMT753xVlanSetVid(index, active, vid, portMap, tagPortMap,
-			    ivl_en, fid, stag);
+						ivl_en, fid, stag);
 	printf("index:%d active:%d vid:%d\r\n", index, active, vid);
-}				/*end doVlanSetVid */
+}
 
 void doVlanSetAccFrm(int argc, char *argv[])
 {
@@ -3247,7 +3241,7 @@
 
 	printf("write reg: %x, value: %x\n", reg, value);
 	reg_write(reg, value);
-}				/*end doVlanSetAccFrm */
+}
 
 void doVlanSetPortAttr(int argc, char *argv[])
 {
@@ -3407,9 +3401,8 @@
 	reg = 0xa0;
 	reg_read(reg, &value);
 	value &= (~(1 << 20));
-	if (!aging_en) {
+	if (!aging_en)
 		value |= (1 << 20);
-	}
 
 	aging_unit = (time / 0x100) + 1;
 	aging_cnt = (time / aging_unit);
@@ -3497,9 +3490,8 @@
 	if (errno != 0 || *endptr != '\0' || igmp_mir > 1)
 		goto error;
 
-	printf
-	    ("port:%d, port_tx_mir:%d, port_rx_mir:%d, acl_mir:%d, vlan_mis:%d, igmp_mir:%d\n",
-	     port, port_tx_mir, port_rx_mir, acl_mir, vlan_mis, igmp_mir);
+	printf("port:%d, port_tx_mir:%d, port_rx_mir:%d, acl_mir:%d, vlan_mis:%d, igmp_mir:%d\n",
+			port, port_tx_mir, port_rx_mir, acl_mir, vlan_mis, igmp_mir);
 
 	reg = REG_PCR_P0_ADDR + port * 0x100;
 	reg_read(reg, &value);
@@ -3581,37 +3573,26 @@
 	if (on_off == 1) {
 		if (chip_name == 0x7530) {
 			if (bw > 1000000) {
-				printf
-				    ("\n**Charge rate(%d) is larger than line rate(1000000kbps)**\n",
-				     bw);
+				printf("\n**Charge rate(%d) is larger than line rate(1000000kbps)**\n", bw);
 				return;
 			}
-			value =
-			    ((bw / 32) << 16) + (1 << 15) + (7 << 8) +
-			    (1 << 7) + 0x0f;
+			value = ((bw / 32) << 16) + (1 << 15) + (7 << 8) + (1 << 7) + 0x0f;
 		} else if (chip_name == 0x7531 || chip_name == 0x7988) {
 			if ((chip_name == 0x7531) && (bw > 2500000)) {
-				printf
-				    ("\n**Charge rate(%d) is larger than line rate(2500000kbps)**\n",
-				     bw);
+				printf("\n**Charge rate(%d) is larger than line rate(2500000kbps)**\n", bw);
 				return;
 			}
 
 			if ((chip_name == 0x7988) && (bw > 4000000)) {
-				printf
-				    ("\n**Charge rate(%d) is larger than line rate(4000000kbps)**\n",
-				     bw);
+				printf("\n**Charge rate(%d) is larger than line rate(4000000kbps)**\n", bw);
 				return;
 			}
 
 			if (bw / 32 >= 65536)	//supoort 2.5G case
-				value =
-				    ((bw / 32) << 16) + (1 << 15) + (1 << 14) +
-				    (1 << 12) + (7 << 8) + 0xf;
+				value = ((bw / 32) << 16) + (1 << 15) + (1 << 14) + (1 << 12) +
+					(7 << 8) + 0xf;
 			else
-				value =
-				    ((bw / 32) << 16) + (1 << 15) + (1 << 14) +
-				    (7 << 8) + 0xf;
+				value = ((bw / 32) << 16) + (1 << 15) + (1 << 14) + (7 << 8) + 0xf;
 		} else
 			printf("unknow chip\n");
 	}
@@ -3705,36 +3686,25 @@
 	if (on_off == 1) {
 		if (chip_name == 0x7530) {
 			if (bw < 0 || bw > 1000000) {
-				printf
-				    ("\n**Charge rate(%d) is larger than line rate(1000000kbps)**\n",
-				     bw);
+				printf("\n**Charge rate(%d) is larger than line rate(1000000kbps)**\n", bw);
 				return;
 			}
-			value =
-			    ((bw / 32) << 16) + (1 << 15) + (7 << 8) +
-			    (1 << 7) + 0xf;
+			value = ((bw / 32) << 16) + (1 << 15) + (7 << 8) + (1 << 7) + 0xf;
 		} else if (chip_name == 0x7531 || chip_name == 0x7988) {
 			if ((chip_name == 0x7531) && (bw < 0 || bw > 2500000)) {
-				printf
-				    ("\n**Charge rate(%d) is larger than line rate(2500000kbps)**\n",
-				     bw);
+				printf("\n**Charge rate(%d) is larger than line rate(2500000kbps)**\n", bw);
 				return;
 			}
 			if ((chip_name == 0x7988) && (bw < 0 || bw > 4000000)) {
-				printf
-				    ("\n**Charge rate(%d) is larger than line rate(4000000kbps)**\n",
-				     bw);
+				printf("\n**Charge rate(%d) is larger than line rate(4000000kbps)**\n", bw);
 				return;
 			}
 
 			if (bw / 32 >= 65536)	//support 2.5G cases
-				value =
-				    ((bw / 32) << 16) + (1 << 15) + (1 << 14) +
-				    (1 << 12) + (7 << 8) + 0xf;
+				value = ((bw / 32) << 16) + (1 << 15) + (1 << 14) + (1 << 12) +
+					(7 << 8) + 0xf;
 			else
-				value =
-				    ((bw / 32) << 16) + (1 << 15) + (1 << 14) +
-				    (7 << 8) + 0xf;
+				value = ((bw / 32) << 16) + (1 << 15) + (1 << 14) + (7 << 8) + 0xf;
 		} else
 			printf("unknow chip\n");
 	}
@@ -3834,14 +3804,13 @@
 
 	enable = atoi(argv[3]);
 
-	printf("collision pool enable: %d \n", enable);
-
 	/*Check the input parameters is right or not. */
 	if (enable > 1) {
 		printf(HELP_COLLISION_POOL_EN);
 		return;
 	}
 
+	printf("collision pool enable: %d\n", enable);
 	if (chip_name == 0x7531 || chip_name == 0x7988) {
 		reg = REG_CPGC_ADDR;
 		if (enable == 1) {
@@ -3912,8 +3881,7 @@
 		if (value & REG_CPCG_COL_EN_MASK)
 			table_dump_internal(COLLISION_TABLE);
 		else
-			printf
-			    ("\ncollision pool is disabled, please enable it before use this command.\n");
+			printf("\ncollision pool is disabled, please enable it before use this command.\n");
 	} else {
 		printf("\nCommand not support by this chip.\n");
 	}
@@ -3929,8 +3897,7 @@
 		if (value & REG_CPCG_COL_EN_MASK)
 			dip_dump_internal(COLLISION_TABLE);
 		else
-			printf
-			    ("\ncollision pool is disabled, please enable it before use this command.\n");
+			printf("\ncollision pool is disabled, please enable it before use this command.\n");
 	} else {
 		printf("\nCommand not support by this chip.\n");
 	}
@@ -3946,8 +3913,7 @@
 		if (value & REG_CPCG_COL_EN_MASK)
 			sip_dump_internal(COLLISION_TABLE);
 		else
-			printf
-			    ("\ncollision pool is disabled, please enable it before use this command.\n");
+			printf("\ncollision pool is disabled, please enable it before use this command.\n");
 	} else {
 		printf("\nCommand not support by this chip.\n");
 	}
@@ -4229,15 +4195,13 @@
 			port_map = 0;
 			for (p = 0; p < MAX_PHY_PORT; p++) {
 				if (argv[3][p] != '0' && argv[3][p] != '1') {
-					printf
-					    ("portmap format error, should be combination of 0 or 1\n");
+					printf("portmap format error, should be combination of 0 or 1\n");
 					goto error;
 				}
 				port_map |= ((argv[3][p] - '0') << p);
 			}
 		} else {
-			printf
-			    ("port_no or portmap format error, should be length of 1 or 5\n");
+			printf("port_no or portmap format error, should be length of 1 or 5\n");
 			goto error;
 		}
 	} else {
@@ -4284,7 +4248,6 @@
 	return;
 error:
 	printf(HELP_EEE_EN);
-	return;
 }
 
 void eee_dump(int argc, char *argv[])
@@ -4395,7 +4358,7 @@
 	reg_write(0x4fe0, 0x800000f0);
 }
 
-void exit_free()
+void exit_free(void)
 {
 	free(attres);
 	attres = NULL;
diff --git a/recipes-devtools/switch/files/src/switch_fun.h b/recipes-devtools/switch/files/src/switch_fun.h
index cc16c20..7ca1b0a 100644
--- a/recipes-devtools/switch/files/src/switch_fun.h
+++ b/recipes-devtools/switch/files/src/switch_fun.h
@@ -102,9 +102,9 @@
 int mii_mgr_read(unsigned int port_num, unsigned int reg, unsigned int *value);
 int mii_mgr_write(unsigned int port_num, unsigned int reg, unsigned int value);
 int mii_mgr_c45_read(unsigned int port_num, unsigned int dev, unsigned int reg,
-		     unsigned int *value);
+		unsigned int *value);
 int mii_mgr_c45_write(unsigned int port_num, unsigned int dev, unsigned int reg,
-		      unsigned int value);
+		unsigned int value);
 
 /*phy setting*/
 int phy_dump(int phy_addr);
@@ -222,5 +222,5 @@
 void read_free_page_counters(int argc, char *argv[]);
 
 void phy_crossover(int argc, char *argv[]);
-void exit_free();
+void exit_free(void);
 #endif
diff --git a/recipes-devtools/switch/files/src/switch_fun_an8855.c b/recipes-devtools/switch/files/src/switch_fun_an8855.c
index e5ec490..3f5d9f6 100644
--- a/recipes-devtools/switch/files/src/switch_fun_an8855.c
+++ b/recipes-devtools/switch/files/src/switch_fun_an8855.c
@@ -1,6 +1,6 @@
 /*
-* switch_fun.c: switch function sets
-*/
+ * switch_fun.c: switch function sets
+ */
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -18,9 +18,8 @@
 #include "switch_fun_an8855.h"
 
 #define MAC_STR         "%02X%02X%02X%02X%02X%02X"
-#define MAC2STR(m)      (m)[0],(m)[1],(m)[2],(m)[3],(m)[4],(m)[5]
 
-const static C8_T *mac_address_forward_control_string[] = {
+const static C8_T * mac_address_forward_control_string[] = {
 	"Default",
 	"CPU include",
 	"CPU exclude",
@@ -105,14 +104,13 @@
 };
 
 AIR_ERROR_NO_T
-an8855_reg_read(const UI32_T unit, const UI32_T addr_offset, UI32_T * ptr_data)
+an8855_reg_read(const UI32_T unit, const UI32_T addr_offset, UI32_T *ptr_data)
 {
 	int ret;
 
 	ret = reg_read(addr_offset, ptr_data);
-	if (ret < 0) {
+	if (ret < 0)
 		return AIR_E_OTHERS;
-	}
 
 	return AIR_E_OK;
 }
@@ -123,9 +121,8 @@
 	int ret;
 
 	ret = reg_write(addr_offset, data);
-	if (ret < 0) {
+	if (ret < 0)
 		return AIR_E_OTHERS;
-	}
 
 	return AIR_E_OK;
 }
@@ -133,14 +130,13 @@
 AIR_ERROR_NO_T
 an8855_phy_cl22_read(const UI32_T unit,
 		     const UI32_T port_id,
-		     const UI32_T addr_offset, UI32_T * ptr_data)
+		     const UI32_T addr_offset, UI32_T *ptr_data)
 {
 	int ret;
 
 	ret = mii_mgr_read(port_id, addr_offset, ptr_data);
-	if (ret < 0) {
+	if (ret < 0)
 		return AIR_E_OTHERS;
-	}
 
 	return AIR_E_OK;
 }
@@ -153,9 +149,9 @@
 	int ret;
 
 	ret = mii_mgr_write(port_id, addr_offset, data);
-	if (ret < 0) {
+	if (ret < 0)
 		return AIR_E_OTHERS;
-	}
+
 
 	return AIR_E_OK;
 }
@@ -164,14 +160,14 @@
 an8855_phy_cl45_read(const UI32_T unit,
 		     const UI32_T port_id,
 		     const UI32_T dev_type,
-		     const UI32_T addr_offset, UI32_T * ptr_data)
+		     const UI32_T addr_offset, UI32_T *ptr_data)
 {
 	int ret;
 
 	ret = mii_mgr_c45_read(port_id, dev_type, addr_offset, ptr_data);
-	if (ret < 0) {
+	if (ret < 0)
 		return AIR_E_OTHERS;
-	}
+
 
 	return AIR_E_OK;
 }
@@ -185,9 +181,9 @@
 	int ret;
 
 	ret = mii_mgr_c45_write(port_id, dev_type, addr_offset, data);
-	if (ret < 0) {
+	if (ret < 0)
 		return AIR_E_OTHERS;
-	}
+
 
 	return AIR_E_OK;
 }
@@ -198,12 +194,13 @@
 }
 
 static AIR_ERROR_NO_T
-_printMacEntry(AIR_MAC_ENTRY_T * mt, UI32_T age_unit, UI8_T count, UI8_T title)
+_printMacEntry(AIR_MAC_ENTRY_T *mt, UI32_T age_unit, UI8_T count, UI8_T title)
 {
 	AIR_ERROR_NO_T ret = AIR_E_OK;
 	I32_T i = 0, j = 0;
 	UI8_T first = 0;
 	UI8_T find = 0;
+
 	if (title) {
 		printf("%-6s%-15s%-5s%-5s%-5s%-10s%-10s%-6s\n",
 		       "unit",
@@ -213,7 +210,8 @@
 	}
 	for (i = 0; i < count; i++) {
 		printf("%-6d", age_unit);
-		printf(MAC_STR, MAC2STR(mt[i].mac));
+		printf(MAC_STR, mt[i].mac[0], mt[i].mac[1], mt[i].mac[2],
+			 mt[i].mac[3], mt[i].mac[4], mt[i].mac[5]);
 		printf("...");
 		if (mt[i].flags & AIR_L2_MAC_ENTRY_FLAGS_IVL) {
 			printf("%-3s..", "ivl");
@@ -224,11 +222,11 @@
 			printf("%-5s", ".....");
 			printf("%-5d", mt[i].fid);
 		}
-		if (mt[i].flags & AIR_L2_MAC_ENTRY_FLAGS_STATIC) {
+		if (mt[i].flags & AIR_L2_MAC_ENTRY_FLAGS_STATIC)
 			printf("%-7s.", "static");
-		} else {
+		else
 			printf("%d sec..", mt[i].timer);
-		}
+
 		printf("%-10s",
 		       mac_address_forward_control_string[mt[i].sa_fwd]);
 		first = 0;
@@ -256,7 +254,7 @@
 	return ret;
 }
 
-static AIR_ERROR_NO_T _str2mac(C8_T * str, C8_T * mac)
+static AIR_ERROR_NO_T _str2mac(C8_T *str, C8_T *mac)
 {
 	UI32_T i;
 	C8_T tmpstr[3];
@@ -307,9 +305,9 @@
 	while (1) {
 		memset(ptr_mt, 0, sizeof(AIR_MAC_ENTRY_T) * bucket_size);
 		ret = air_l2_getNextMacAddr(0, &count, ptr_mt);
-		if (AIR_E_OK != ret) {
+		if (ret != AIR_E_OK)
 			break;
-		}
+
 		total_count += count;
 		_printMacEntry(ptr_mt, 0, count, FALSE);
 	}
@@ -328,7 +326,6 @@
 
 DUMP_ERROR:
 	free(ptr_mt);
-	return;
 }
 
 void an8855_table_dump(int argc, char *argv[])
@@ -342,6 +339,7 @@
 	AIR_MAC_ENTRY_T mt;
 	unsigned int i = 0;
 	unsigned int age_time = 0;
+
 	memset(&mt, 0, sizeof(AIR_MAC_ENTRY_T));
 	if (!argv[2] || strlen(argv[2]) != 12) {
 		printf("MAC address format error, should be of length 12\n");
@@ -354,7 +352,7 @@
 	}
 	if (argc > 4) {
 		mt.cvid = strtoul(argv[4], NULL, 0);
-		if (4095 < mt.cvid) {
+		if (mt.cvid > 4095) {
 			printf("wrong vid range, should be within 0~4095\n");
 			return;
 		}
@@ -379,9 +377,9 @@
 			printf("wrong age range, should be within 1~1000000\n");
 			return;
 		}
-	} else {
+	} else
 		mt.flags |= AIR_L2_MAC_ENTRY_FLAGS_STATIC;
-	}
+
 	mt.sa_fwd = AIR_L2_FWD_CTRL_DEFAULT;
 	ret = air_l2_addMacAddr(0, &mt);
 	if (ret == AIR_E_OK) {
@@ -389,16 +387,14 @@
 		usleep(5000);
 		if (!(mt.flags & AIR_L2_MAC_ENTRY_FLAGS_STATIC)) {
 			ret = air_l2_setMacAddrAgeOut(0, age_time);
-			if (ret == AIR_E_OK) {
+			if (ret == AIR_E_OK)
 				printf("set age out time done.\n");
-			} else {
+			else
 				printf("set age out time fail.\n");
-			}
+
 		}
-	} else {
+	} else
 		printf("add mac address fail.\n");
-	}
-	return;
 }
 
 void an8855_table_search_mac_vid(int argc, char *argv[])
@@ -414,7 +410,7 @@
 	}
 
 	ptr_mt = malloc(sizeof(AIR_MAC_ENTRY_T));
-	if (NULL == ptr_mt) {
+	if (ptr_mt == NULL) {
 		printf("Error, malloc fail\n");
 		return;
 	}
@@ -443,7 +439,6 @@
 		printf("\n Not found!\n");
 	}
 	free(ptr_mt);
-	return;
 }
 
 void an8855_table_search_mac_fid(int argc, char *argv[])
@@ -459,7 +454,7 @@
 	}
 
 	ptr_mt = malloc(sizeof(AIR_MAC_ENTRY_T));
-	if (NULL == ptr_mt) {
+	if (ptr_mt == NULL) {
 		printf("Error, malloc fail\n");
 		return;
 	}
@@ -483,11 +478,10 @@
 	if (ret == AIR_E_OK) {
 		_printMacEntry(ptr_mt, 0, 1, TRUE);
 		_printMacEntry(ptr_mt, 0, 1, FALSE);
-	} else {
+	} else
 		printf("\n Not found!\n");
-	}
+
 	free(ptr_mt);
-	return;
 }
 
 void an8855_table_del_fid(int argc, char *argv[])
@@ -516,12 +510,10 @@
 	}
 
 	ret = air_l2_delMacAddr(0, &mt);
-	if (ret == AIR_E_OK) {
+	if (ret == AIR_E_OK)
 		printf("Done.\n");
-	} else {
+	else
 		printf("Fail.\n");
-	}
-	return;
 }
 
 void an8855_table_del_vid(int argc, char *argv[])
@@ -551,12 +543,11 @@
 	}
 
 	ret = air_l2_delMacAddr(0, &mt);
-	if (ret == AIR_E_OK) {
+	if (ret == AIR_E_OK)
 		printf("Done.\n");
-	} else {
+	else
 		printf("Fail.\n");
-	}
-	return;
+
 }
 
 void an8855_table_clear(int argc, char *argv[])
@@ -568,7 +559,7 @@
 		printf("Clear MAC Address Table Done.\n");
 	else
 		printf("Clear MAC Address Table Fail.\n");
-	return;
+
 }
 
 void an8855_set_mirror_to(int argc, char *argv[])
@@ -577,7 +568,7 @@
 	AIR_MIR_SESSION_T session = { 0 };
 
 	idx = strtoul(argv[3], NULL, 0);
-	if (idx < 0 || MAX_PORT < idx) {
+	if (idx < 0 || idx > MAX_PORT) {
 		printf("wrong port member, should be within 0~%d\n", MAX_PORT);
 		return;
 	}
@@ -598,12 +589,12 @@
 	idx = _strtoul(argv[3], NULL, 0);
 	mirror = _strtoul(argv[4], NULL, 0);
 
-	if (idx < 0 || MAX_PORT < idx) {
+	if (idx < 0 || idx > MAX_PORT) {
 		printf("wrong port member, should be within 0~%d\n", MAX_PORT);
 		return;
 	}
 
-	if (mirror < 0 || 3 < mirror) {
+	if (mirror < 0 || mirror > 3) {
 		printf("wrong mirror setting, should be within 0~3\n");
 		return;
 	}
@@ -642,9 +633,9 @@
 
 	if (eg_tag)
 		printf
-		    ("  vid  fid  portmap    s-tag\teg_tag(0:untagged 2:tagged)\n");
+		    ("  vid  fid  portmap   s-tag\teg_tag(0:untagged 2:tagged)\n");
 	else
-		printf("  vid  fid  portmap    s-tag\n");
+		printf("  vid  fid  portmap   s-tag\n");
 
 	for (i = 1; i < 4096; i++) {
 		_air_vlan_readEntry(0, i, &vlan_entry);
@@ -652,73 +643,43 @@
 		if (vlan_entry.valid) {
 			printf(" %4d  ", i);
 			printf(" %2d ", vlan_entry.vlan_entry_format.fid);
-			printf(" %c",
-			       (vlan_entry.
-				vlan_entry_format.port_mem & 0b0000001) ? '1' :
-			       '-');
-			printf("%c",
-			       (vlan_entry.
-				vlan_entry_format.port_mem & 0b0000010) ? '1' :
-			       '-');
-			printf("%c",
-			       (vlan_entry.
-				vlan_entry_format.port_mem & 0b0000100) ? '1' :
-			       '-');
-			printf("%c",
-			       (vlan_entry.
-				vlan_entry_format.port_mem & 0b0001000) ? '1' :
-			       '-');
-			printf("%c",
-			       (vlan_entry.
-				vlan_entry_format.port_mem & 0b0010000) ? '1' :
-			       '-');
-			printf("%c",
-			       (vlan_entry.
-				vlan_entry_format.port_mem & 0b0100000) ? '1' :
-			       '-');
-			printf("%c",
-			       (vlan_entry.
-				vlan_entry_format.port_mem & 0b1000000) ? '1' :
-			       '-');
+			printf(" %c", (vlan_entry.vlan_entry_format.port_mem & 0b0000001)
+				? '1' : '-');
+			printf("%c", (vlan_entry.vlan_entry_format.port_mem & 0b0000010)
+				? '1' : '-');
+			printf("%c", (vlan_entry.vlan_entry_format.port_mem & 0b0000100)
+				? '1' : '-');
+			printf("%c", (vlan_entry.vlan_entry_format.port_mem & 0b0001000)
+				? '1' : '-');
+			printf("%c", (vlan_entry.vlan_entry_format.port_mem & 0b0010000)
+				? '1' : '-');
+			printf("%c", (vlan_entry.vlan_entry_format.port_mem & 0b0100000)
+				? '1' : '-');
+			printf("%c", (vlan_entry.vlan_entry_format.port_mem & 0b1000000)
+				? '1' : '-');
 			printf("    %4d", vlan_entry.vlan_entry_format.eg_ctrl);
 			if (eg_tag) {
 				printf("\t");
 				if (vlan_entry.vlan_entry_format.eg_con
-				    && vlan_entry.
-				    vlan_entry_format.eg_ctrl_en) {
+				    && vlan_entry.vlan_entry_format.eg_ctrl_en) {
 					/* VTAG_EN=1 and EG_CON=1 */
 					printf("CONSISTENT");
-				} else if (vlan_entry.
-					   vlan_entry_format.eg_ctrl_en) {
+				} else if (vlan_entry.vlan_entry_format.eg_ctrl_en) {
 					/* VTAG_EN=1 */
 					printf("%d",
-					       (vlan_entry.
-						vlan_entry_format.eg_ctrl >> 0)
-					       & 0x3);
+						(vlan_entry.vlan_entry_format.eg_ctrl >> 0) & 0x3);
 					printf("%d",
-					       (vlan_entry.
-						vlan_entry_format.eg_ctrl >> 2)
-					       & 0x3);
+						(vlan_entry.vlan_entry_format.eg_ctrl >> 2) & 0x3);
 					printf("%d",
-					       (vlan_entry.
-						vlan_entry_format.eg_ctrl >> 4)
-					       & 0x3);
+						(vlan_entry.vlan_entry_format.eg_ctrl >> 4) & 0x3);
 					printf("%d",
-					       (vlan_entry.
-						vlan_entry_format.eg_ctrl >> 6)
-					       & 0x3);
+						(vlan_entry.vlan_entry_format.eg_ctrl >> 6) & 0x3);
 					printf("%d",
-					       (vlan_entry.
-						vlan_entry_format.eg_ctrl >> 8)
-					       & 0x3);
+						(vlan_entry.vlan_entry_format.eg_ctrl >> 8) & 0x3);
 					printf("%d",
-					       (vlan_entry.
-						vlan_entry_format.eg_ctrl >> 10)
-					       & 0x3);
+						(vlan_entry.vlan_entry_format.eg_ctrl >> 10) & 0x3);
 					printf("%d",
-					       (vlan_entry.
-						vlan_entry_format.eg_ctrl >> 12)
-					       & 0x3);
+						(vlan_entry.vlan_entry_format.eg_ctrl >> 12) & 0x3);
 				} else {
 					/* VTAG_EN=0 */
 					printf("DISABLED");
@@ -802,7 +763,7 @@
 
 	if (argc > 7) {
 		eg_con = strtoul(argv[7], NULL, 2);
-		eg_con = ! !eg_con;
+		eg_con = !!eg_con;
 		vlan_entry.vlan_entry_format.eg_con = eg_con;
 		vlan_entry.vlan_entry_format.eg_ctrl_en = 1;
 	}
@@ -817,8 +778,8 @@
 
 		for (i = 0; i < SWITCH_MAX_PORT; i++) {
 			if (argv[8][i] < '0' || argv[8][i] > '3') {
-				printf
-				    ("egtag portmap format error, should be of combination of 0 or 3\n");
+				printf("egtag portmap format error,");
+				printf("should be of combination of 0 or 3\n");
 				return;
 			}
 			eg_tag |= (argv[8][i] - '0') << (i * 2);
@@ -947,8 +908,8 @@
 		return;
 	}
 
-	printf("\r\nswitch qos base : %d. (port-based:0, tag-based:1,\
-		dscp-based:2, acl-based:3, arl-based:4, stag-based:5)\n", base);
+	printf("\r\nswitch qos base : %d. (port-based:0, tag-based:1,", base);
+	printf("dscp-based:2, acl-based:3, arl-based:4, stag-based:5)\n");
 	reg_read(0x10208030 + 0x200 * port, &value);
 	an8855_get_upw(&value, base);
 	reg_write(0x10208030 + 0x200 * port, value);
@@ -962,9 +923,8 @@
 
 	port = _strtoul(argv[3], NULL, 10);
 
-	for (i = 0; i < 8; i++) {
+	for (i = 0; i < 8; i++)
 		weight[i] = _strtoul(argv[i + 4], NULL, 10);
-	}
 
 	/* MT7530 total 7 port */
 	if (port < 0 || port > 6) {
@@ -978,13 +938,15 @@
 			return;
 		}
 	}
-	printf("port: %x, q0: %x, q1: %x, q2: %x, q3: %x, \
-		q4: %x, q5: %x, q6: %x, q7: %x\n", port, weight[0], weight[1], weight[2], weight[3], weight[4], weight[5], weight[6], weight[7]);
+	printf("port: %x, q0: %x, q1: %x, q2: %x, q3: %x,",
+		port, weight[0], weight[1], weight[2], weight[3]);
+	printf("q4: %x, q5: %x, q6: %x, q7: %x\n",
+		weight[4], weight[5], weight[6], weight[7]);
 
-	for (queue = 0; queue < 8; queue++) {
+	for (queue = 0; queue < 8; queue++)
 		air_qos_setScheduleAlgo(0, port, queue, AIR_QOS_SCH_MODE_WFQ,
 					weight[queue]);
-	}
+
 }
 
 void an8855_qos_set_portpri(int argc, char *argv[])
@@ -1096,17 +1058,19 @@
 		}
 	}
 
-	printf("index: %x, active: %x, vid: %x, portMap: %x, \
-		tagPortMap: %x, ivl_en: %x, fid: %x, stag: %x\n", index, active, vid, portMap, tagPortMap, ivl_en, fid, stag);
+	printf("index: %x, active: %x, vid: %x, portMap: %x,",
+		index, active, vid, portMap);
+	printf("tagPortMap: %x, ivl_en: %x, fid: %x, stag: %x\n",
+		tagPortMap, ivl_en, fid, stag);
 
-	vlan_entry.valid = ! !active;
+	vlan_entry.valid = !!active;
 	vlan_entry.vlan_entry_format.port_mem = portMap;
 	/* Total 6 ports */
 	for (i = 0; i < SWITCH_MAX_PORT; i++) {
 		if (tagPortMap & (1 << i))
 			vlan_entry.vlan_entry_format.eg_ctrl |= 0x2 << (i * 2);
 	}
-	vlan_entry.vlan_entry_format.ivl = ! !ivl_en;
+	vlan_entry.vlan_entry_format.ivl = !!ivl_en;
 	vlan_entry.vlan_entry_format.fid = fid;
 	vlan_entry.vlan_entry_format.stag = stag;
 
@@ -1234,9 +1198,8 @@
 		return;
 	}
 
-	for (port = 0; port < 6; port++) {
+	for (port = 0; port < 6; port++)
 		air_l2_setAgeEnable(0, port, aging_en);
-	}
 
 	air_l2_setMacAddrAgeOut(0, time);
 }
@@ -1264,9 +1227,8 @@
 		session.dst_port = mirror_port;
 		session.flags |= AIR_MIR_SESSION_FLAGS_ENABLE;
 		air_mir_addSession(0, 0, &session);
-	} else {
+	} else
 		air_mir_delSession(0, 0);
-	}
 
 	air_mir_setSessionAdminMode(0, 0, (int)mirror_en);
 }				/*end doMirrorEn */
@@ -1285,13 +1247,14 @@
 	vlan_mis = _strtoul(argv[7], NULL, 10);
 	igmp_mir = _strtoul(argv[8], NULL, 10);
 
-	printf
-	    ("port:%d, port_tx_mir:%d, port_rx_mir:%d, acl_mir:%d, vlan_mis:%d, igmp_mir:%d\n",
-	     port, port_tx_mir, port_rx_mir, acl_mir, vlan_mis, igmp_mir);
+	printf("port:%d, port_tx_mir:%d, port_rx_mir:%d, ",
+		port, port_tx_mir, port_rx_mir);
+	printf("acl_mir:%d, vlan_mis:%d, igmp_mir:%d\n",
+		acl_mir, vlan_mis, igmp_mir);
 
 	/*Check the input parameters is right or not. */
-	//if((port >= vlanCap->max_port_no) || (port_tx_mir > 1) || (port_rx_mir > 1) || (acl_mir > 1) || (vlan_mis > 1)){
-	if ((port >= SWITCH_MAX_PORT) || (port_tx_mir > 1) || (port_rx_mir > 1) || (acl_mir > 1) || (vlan_mis > 1)) {	// also allow CPU port (port6)
+	if ((port >= SWITCH_MAX_PORT) || (port_tx_mir > 1) || (port_rx_mir > 1)
+		|| (acl_mir > 1) || (vlan_mis > 1)) {	// also allow CPU port (port6)
 		printf(HELP_MIRROR_PORTBASED);
 		return;
 	}
@@ -1312,11 +1275,7 @@
 
 	air_mir_setMirrorPort(0, 0, &session);
 
-	/*
-
-	   not support acl/vlan/igmp mismatch
-
-	 */
+	/* not support acl/vlan/igmp mismatch */
 }				/*end doMirrorPortBased */
 
 void an8855_doStp(int argc, char *argv[])
@@ -1346,35 +1305,40 @@
 {
 	AIR_ERROR_NO_T ret = AIR_E_OK;
 	AIR_QOS_RATE_LIMIT_CFG_T rl = { 0 };
+
 	if (on_off) {
 		ret =
 		    air_qos_setRateLimitEnable(0, port,
 					       AIR_QOS_RATE_DIR_INGRESS, TRUE);
-		if (AIR_E_OK != ret) {
+		if (ret != AIR_E_OK) {
 			printf("an8855 set ingress ratelimit eanble fail\n");
 			return;
 		}
+		ret = air_qos_getRateLimit(0, port, &rl);
+		if (ret != AIR_E_OK) {
+			printf("an8855 get port %d ratelimit fail\n",
+				port);
+			return;
+		}
 		rl.ingress_cir = bw;
 		rl.flags |= AIR_QOS_RATE_LIMIT_CFG_FLAGS_ENABLE_INGRESS;
 		ret = air_qos_setRateLimit(0, port, &rl);
-		if (AIR_E_OK != ret) {
+		if (ret != AIR_E_OK) {
 			printf("an8855 set ingress ratelimit value %d fail\n",
 			       bw);
 			return;
-		} else {
-			printf("an8855 set ingress ratelimit value %d ok\n",
-			       bw);
 		}
+		printf("an8855 set ingress ratelimit value %d ok\n", bw);
 	} else {
 		ret =
 		    air_qos_setRateLimitEnable(0, port,
 					       AIR_QOS_RATE_DIR_INGRESS, FALSE);
-		if (AIR_E_OK != ret) {
+		if (ret != AIR_E_OK) {
 			printf("an8855 set ingress ratelimit disable fail\n");
 			return;
-		} else {
-			printf("an8855 set ingress ratelimit disable ok\n");
 		}
+		printf("an8855 set ingress ratelimit disable ok\n");
+
 	}
 }
 
@@ -1382,34 +1346,41 @@
 {
 	AIR_ERROR_NO_T ret = AIR_E_OK;
 	AIR_QOS_RATE_LIMIT_CFG_T rl = { 0 };
+
 	if (on_off) {
 		ret =
 		    air_qos_setRateLimitEnable(0, port, AIR_QOS_RATE_DIR_EGRESS,
 					       TRUE);
-		if (AIR_E_OK != ret) {
+		if (ret != AIR_E_OK) {
 			printf("an8855 set egress ratelimit eanble fail\n");
 			return;
 		}
+		ret = air_qos_getRateLimit(0, port, &rl);
+		if (ret != AIR_E_OK) {
+			printf("an8855 get port %d ratelimit fail\n",
+				port);
+			return;
+		}
 		rl.egress_cir = bw;
 		rl.flags |= AIR_QOS_RATE_LIMIT_CFG_FLAGS_ENABLE_EGRESS;
 		ret = air_qos_setRateLimit(0, port, &rl);
-		if (AIR_E_OK != ret) {
+		if (ret != AIR_E_OK) {
 			printf("an8855 set egress ratelimit value %d fail\n",
 			       bw);
 			return;
-		} else {
-			printf("an8855 set egress ratelimit value %d ok\n", bw);
 		}
+		printf("an8855 set egress ratelimit value %d ok\n", bw);
+
 	} else {
 		ret =
 		    air_qos_setRateLimitEnable(0, port, AIR_QOS_RATE_DIR_EGRESS,
 					       FALSE);
-		if (AIR_E_OK != ret) {
+		if (ret != AIR_E_OK) {
 			printf("an8855 set egress ratelimit disable fail\n");
 			return;
-		} else {
-			printf("an8855 set egress ratelimit disable ok\n");
 		}
+		printf("an8855 set egress ratelimit disable ok\n");
+
 	}
 }
 
@@ -1422,9 +1393,9 @@
 		bw = _strtoul(argv[4], NULL, 0);
 		on_off = 1;
 	} else if (argv[2][1] == 'f') {
-		if (argc != 4) {
+		if (argc != 4)
 			return;
-		}
+
 		on_off = 0;
 	}
 
@@ -1441,9 +1412,9 @@
 		bw = _strtoul(argv[4], NULL, 0);
 		on_off = 1;
 	} else if (argv[2][1] == 'f') {
-		if (argc != 4) {
+		if (argc != 4)
 			return;
-		}
+
 		on_off = 0;
 	}
 
@@ -1554,35 +1525,35 @@
 	queue[6] = (value & 0x3F0000) >> 16;
 	queue[7] = (value & 0x3F000000) >> 24;
 
-	printf("<===Free Page=======Current============Minimal=========> \n ");
-	printf("	                                                 \n ");
-	printf(" page counter      %u                %u               \n ",
+	printf("<===Free Page=======Current============Minimal=========>\n");
+	printf("\n");
+	printf(" page counter      %u                %u\n",
 	       free_page, free_page_min);
-	printf("                                                        \n ");
-	printf("========================================================= \n ");
-	printf("<===Type=======High threshold======Low threshold=========\n ");
-	printf("                                                        \n ");
-	printf("  system:         %u                 %u               \n",
+	printf("\n");
+	printf("=========================================================\n");
+	printf("<===Type=======High threshold======Low threshold=========\n");
+	printf("\n");
+	printf("  system:         %u                 %u\n",
 	       fc_free_blk_hithd * 2, fc_free_blk_lothd * 2);
-	printf("    port:         %u                 %u               \n",
+	printf("    port:         %u                 %u\n",
 	       fc_port_blk_hi_thd * 2, fc_port_blk_thd * 2);
-	printf(" queue 0:         %u                 NA                \n",
+	printf(" queue 0:         %u                 NA\n",
 	       queue[0]);
-	printf(" queue 1:         %u                 NA                \n",
+	printf(" queue 1:         %u                 NA\n",
 	       queue[1]);
-	printf(" queue 2:         %u                 NA                 \n",
+	printf(" queue 2:         %u                 NA\n",
 	       queue[2]);
-	printf(" queue 3:         %u                 NA                \n",
+	printf(" queue 3:         %u                 NA\n",
 	       queue[3]);
-	printf(" queue 4:         %u                 NA                \n",
+	printf(" queue 4:         %u                 NA\n",
 	       queue[4]);
-	printf(" queue 5:         %u                 NA                \n",
+	printf(" queue 5:         %u                 NA\n",
 	       queue[5]);
-	printf(" queue 6:         %u                 NA                \n",
+	printf(" queue 6:         %u                 NA\n",
 	       queue[6]);
-	printf(" queue 7:         %u                 NA                \n",
+	printf(" queue 7:         %u                 NA\n",
 	       queue[7]);
-	printf("=========================================================\n ");
+	printf("=========================================================\n");
 }
 
 void an8855_eee_enable(int argc, char *argv[])
@@ -1618,8 +1589,8 @@
 			port_map = 0;
 			for (p = 0; p < MAX_PHY_PORT; p++) {
 				if (argv[3][p] != '0' && argv[3][p] != '1') {
-					printf
-					    ("portmap format error, should be combination of 0 or 1\n");
+					printf("portmap format error, ");
+					printf("should be combination of 0 or 1\n");
 					goto error;
 				}
 				port_map |= ((argv[3][p] - '0') << p);
@@ -1636,11 +1607,11 @@
 	for (port_num = 0; port_num < MAX_PHY_PORT; port_num++) {
 		if (port_map & (1 << port_num)) {
 			air_port_getPsMode(0, port_num, &mode);
-			if (enable) {
+			if (enable)
 				mode |= AIR_PORT_PS_EEE;
-			} else {
+			else
 				mode &= ~AIR_PORT_PS_EEE;
-			}
+
 			air_port_setPsMode(0, port_num, mode);
 		}
 	}
@@ -1648,7 +1619,6 @@
 
 error:
 	printf(HELP_EEE_EN);
-	return;
 }
 
 void an8855_eee_dump(int argc, char *argv[])
@@ -1694,107 +1664,106 @@
 	AIR_MIB_CNT_RX_T rx_mib[7];
 	AIR_MIB_CNT_TX_T tx_mib[7];
 
-	printf("===================== %8s %8s %8s %8s %8s %8s %8s\n",
+	printf("======================== %8s %8s %8s %8s %8s %8s %8s\n",
 	       "Port0", "Port1", "Port2", "Port3", "Port4", "Port5", "Port6");
 
-	for (port = 0; port < 7; port++) {
+	for (port = 0; port < 7; port++)
 		air_mib_get(0, port, &rx_mib[port], &tx_mib[port]);
-	}
 
 	printf("Tx Drop Packet      :");
-	for (port = 0; port < 7; port++) {
+	for (port = 0; port < 7; port++)
 		printf("%8u ", tx_mib[port].TDPC);
-	}
+
 	printf("\n");
 	printf("Tx CRC Error        :");
-	for (port = 0; port < 7; port++) {
+	for (port = 0; port < 7; port++)
 		printf("%8u ", tx_mib[port].TCRC);
-	}
+
 	printf("\n");
 	printf("Tx Unicast Packet   :");
-	for (port = 0; port < 7; port++) {
+	for (port = 0; port < 7; port++)
 		printf("%8u ", tx_mib[port].TUPC);
-	}
+
 	printf("\n");
 	printf("Tx Multicast Packet :");
-	for (port = 0; port < 7; port++) {
+	for (port = 0; port < 7; port++)
 		printf("%8u ", tx_mib[port].TMPC);
-	}
+
 	printf("\n");
 	printf("Tx Broadcast Packet :");
-	for (port = 0; port < 7; port++) {
+	for (port = 0; port < 7; port++)
 		printf("%8u ", tx_mib[port].TBPC);
-	}
+
 	printf("\n");
 	printf("Tx Collision Event  :");
-	for (port = 0; port < 7; port++) {
+	for (port = 0; port < 7; port++)
 		printf("%8u ", tx_mib[port].TCEC);
-	}
+
 	printf("\n");
 	printf("Tx Pause Packet     :");
-	for (port = 0; port < 7; port++) {
+	for (port = 0; port < 7; port++)
 		printf("%8u ", tx_mib[port].TPPC);
-	}
+
 	printf("\n");
 	printf("Rx Drop Packet      :");
-	for (port = 0; port < 7; port++) {
+	for (port = 0; port < 7; port++)
 		printf("%8u ", rx_mib[port].RDPC);
-	}
+
 	printf("\n");
 	printf("Rx Filtering Packet :");
-	for (port = 0; port < 7; port++) {
+	for (port = 0; port < 7; port++)
 		printf("%8u ", rx_mib[port].RFPC);
-	}
+
 	printf("\n");
 	printf("Rx Unicast Packet   :");
-	for (port = 0; port < 7; port++) {
+	for (port = 0; port < 7; port++)
 		printf("%8u ", rx_mib[port].RUPC);
-	}
+
 	printf("\n");
 	printf("Rx Multicast Packet :");
-	for (port = 0; port < 7; port++) {
+	for (port = 0; port < 7; port++)
 		printf("%8u ", rx_mib[port].RMPC);
-	}
+
 	printf("\n");
 	printf("Rx Broadcast Packet :");
-	for (port = 0; port < 7; port++) {
+	for (port = 0; port < 7; port++)
 		printf("%8u ", rx_mib[port].RBPC);
-	}
+
 	printf("\n");
 	printf("Rx Alignment Error  :");
-	for (port = 0; port < 7; port++) {
+	for (port = 0; port < 7; port++)
 		printf("%8u ", rx_mib[port].RAEPC);
-	}
+
 	printf("\n");
 	printf("Rx CRC Error	    :");
-	for (port = 0; port < 7; port++) {
+	for (port = 0; port < 7; port++)
 		printf("%8u ", rx_mib[port].RCEPC);
-	}
+
 	printf("\n");
 	printf("Rx Undersize Error  :");
-	for (port = 0; port < 7; port++) {
+	for (port = 0; port < 7; port++)
 		printf("%8u ", rx_mib[port].RUSPC);
-	}
+
 	printf("\n");
 	printf("Rx Fragment Error   :");
-	for (port = 0; port < 7; port++) {
+	for (port = 0; port < 7; port++)
 		printf("%8u ", rx_mib[port].RFEPC);
-	}
+
 	printf("\n");
 	printf("Rx Oversize Error   :");
-	for (port = 0; port < 7; port++) {
+	for (port = 0; port < 7; port++)
 		printf("%8u ", rx_mib[port].ROSPC);
-	}
+
 	printf("\n");
 	printf("Rx Jabber Error     :");
-	for (port = 0; port < 7; port++) {
+	for (port = 0; port < 7; port++)
 		printf("%8u ", rx_mib[port].RJEPC);
-	}
+
 	printf("\n");
 	printf("Rx Pause Packet     :");
-	for (port = 0; port < 7; port++) {
+	for (port = 0; port < 7; port++)
 		printf("%8u ", rx_mib[port].RPPC);
-	}
+
 	printf("\n");
 }
 
diff --git a/recipes-devtools/switch/files/src/switch_fun_an8855.h b/recipes-devtools/switch/files/src/switch_fun_an8855.h
index 1d67080..9be440f 100644
--- a/recipes-devtools/switch/files/src/switch_fun_an8855.h
+++ b/recipes-devtools/switch/files/src/switch_fun_an8855.h
@@ -1,6 +1,6 @@
 /*
-* switch_fun.h: switch function sets
-*/
+ * switch_fun.h: switch function sets
+ */
 #ifndef SWITCH_FUN_AN8855_H
 #define SWITCH_FUN_AN8855_H
 
@@ -16,7 +16,7 @@
 AIR_ERROR_NO_T
 an8855_phy_cl22_read(const UI32_T unit,
 		     const UI32_T port_id,
-		     const UI32_T addr_offset, UI32_T * ptr_data);
+		     const UI32_T addr_offset, UI32_T *ptr_data);
 
 AIR_ERROR_NO_T
 an8855_phy_cl22_write(const UI32_T unit,
@@ -27,7 +27,7 @@
 an8855_phy_cl45_read(const UI32_T unit,
 		     const UI32_T port_id,
 		     const UI32_T dev_type,
-		     const UI32_T addr_offset, UI32_T * ptr_data);
+		     const UI32_T addr_offset, UI32_T *ptr_data);
 
 AIR_ERROR_NO_T
 an8855_phy_cl45_write(const UI32_T unit,
@@ -40,38 +40,6 @@
 
 void an8855_not_supported(int argc, char *argv[]);
 
-#if 0
-/*acl setting*/
-void an8855_acl_mac_add(int argc, char *argv[]);
-void an8855_acl_dip_meter(int argc, char *argv[]);
-void an8855_acl_dip_trtcm(int argc, char *argv[]);
-void an8855_acl_ethertype(int argc, char *argv[]);
-void an8855_acl_ethertype(int argc, char *argv[]);
-void an8855_acl_dip_modify(int argc, char *argv[]);
-void an8855_acl_dip_pppoe(int argc, char *argv[]);
-void an8855_acl_dip_add(int argc, char *argv[]);
-void an8855_acl_l4_add(int argc, char *argv[]);
-void an8855_acl_sp_add(int argc, char *argv[]);
-
-void an8855_acl_port_enable(int argc, char *argv[]);
-void an8855_acl_table_add(int argc, char *argv[]);
-void an8855_acl_mask_table_add(int argc, char *argv[]);
-void an8855_acl_rule_table_add(int argc, char *argv[]);
-void an8855_acl_rate_table_add(int argc, char *argv[]);
-
-/*dip table*/
-void an8855_dip_dump(void);
-void an8855_dip_add(int argc, char *argv[]);
-void an8855_dip_del(int argc, char *argv[]);
-void an8855_dip_clear(void);
-
-/*sip table*/
-void an8855_sip_dump(void);
-void an8855_sip_add(int argc, char *argv[]);
-void an8855_sip_del(int argc, char *argv[]);
-void an8855_sip_clear(void);
-#endif
-
 /*stp*/
 void an8855_doStp(int argc, char *argv[]);
 
diff --git a/recipes-devtools/switch/files/src/switch_ioctl.c b/recipes-devtools/switch/files/src/switch_ioctl.c
index f6b97d4..dd9e621 100644
--- a/recipes-devtools/switch/files/src/switch_ioctl.c
+++ b/recipes-devtools/switch/files/src/switch_ioctl.c
@@ -164,7 +164,7 @@
 			break;
 		}
 	}
-	//printf(" PHY Indirect Access Control(0x701c) register read value =0x%x  \n", reg_value);
+	//printf(" PHY Indirect Access Control(0x701c) register read value =0x%x\n", reg_value);
 	*value = reg_value;
 
 	return 0;
@@ -205,7 +205,7 @@
 		}
 	}
 
-	//printf(" PHY Indirect Access Control(0x701c) register write value =0x%x  \n", reg_value);
+	//printf(" PHY Indirect Access Control(0x701c) register write value =0x%x\n", reg_value);
 
 	return 0;
 }
@@ -332,7 +332,7 @@
 		} else {
 			printf("MDIO cl45 set dev opeartion timeout\n");
 			reg_value = 0;
-			ret = -1; 
+			ret = -1;
 			goto out;
 		}
 	}
@@ -351,12 +351,12 @@
 		} else {
 			printf("MDIO cl45 read reg opeartion timeout\n");
 			reg_value = 0;
-			ret = -1; 
+			ret = -1;
 			break;
 		}
 	}
 out:
-	//printf(" PHY Indirect Access Control(0x701c) register read value =0x%x  \n", reg_value);
+	//printf(" PHY Indirect Access Control(0x701c) register read value =0x%x\n", reg_value);
 	*value = reg_value;
 
 	return ret;
@@ -384,7 +384,7 @@
 			loop_cnt++;
 		else {
 			printf("MDIO cl45 set dev opeartion timeout\n");
-			ret = -1; 
+			ret = -1;
 			goto out;
 		}
 	}
@@ -401,12 +401,12 @@
 			loop_cnt++;
 		else {
 			printf("MDIO cl45 write reg opeartion timeout\n");
-			ret = -1; 
+			ret = -1;
 			break;
 		}
 	}
 out:
-	//printf(" PHY Indirect Access Control(0x701c) register write value =0x%x  \n", reg_value);
+	//printf(" PHY Indirect Access Control(0x701c) register write value =0x%x\n", reg_value);
 	return ret;
 }
 
diff --git a/recipes-devtools/switch/files/src/switch_ioctl.h b/recipes-devtools/switch/files/src/switch_ioctl.h
index dffe9c7..3ee43d7 100644
--- a/recipes-devtools/switch/files/src/switch_ioctl.h
+++ b/recipes-devtools/switch/files/src/switch_ioctl.h
@@ -8,48 +8,43 @@
 #define ETH_DEVNAME "eth0"
 #define BR_DEVNAME "br-lan"
 
-#define RAETH_MII_READ                  0x89F3
-#define RAETH_MII_WRITE                 0x89F4
-#define RAETH_ESW_PHY_DUMP              0x89F7
+#define RAETH_MII_READ			0x89F3
+#define RAETH_MII_WRITE			0x89F4
+#define RAETH_ESW_PHY_DUMP		0x89F7
 
 struct esw_reg {
-        unsigned int off;
-        unsigned int val;
+	unsigned int off;
+	unsigned int val;
 };
 
 struct ra_mii_ioctl_data {
-        __u16 phy_id;
-        __u16 reg_num;
-        __u32 val_in;
-        __u32 val_out;
-/*
-        __u32 port_num;
-        __u32 dev_addr;
-        __u32 reg_addr;
-*/
+	__u16 phy_id;
+	__u16 reg_num;
+	__u32 val_in;
+	__u32 val_out;
 };
 
 struct ra_switch_ioctl_data {
-        unsigned int cmd;
-        unsigned int on_off;
-        unsigned int port;
-        unsigned int bw;
-        unsigned int vid;
-        unsigned int fid;
-        unsigned int port_map;
-        unsigned int rx_port_map;
-        unsigned int tx_port_map;
-        unsigned int igmp_query_interval;
-        unsigned int reg_addr;
-        unsigned int reg_val;
-        unsigned int mode;
-        unsigned int qos_queue_num;
-        unsigned int qos_type;
-        unsigned int qos_pri;
-        unsigned int qos_dscp;
-        unsigned int qos_table_idx;
-        unsigned int qos_weight;
-        unsigned char mac[6];
+	unsigned int cmd;
+	unsigned int on_off;
+	unsigned int port;
+	unsigned int bw;
+	unsigned int vid;
+	unsigned int fid;
+	unsigned int port_map;
+	unsigned int rx_port_map;
+	unsigned int tx_port_map;
+	unsigned int igmp_query_interval;
+	unsigned int reg_addr;
+	unsigned int reg_val;
+	unsigned int mode;
+	unsigned int qos_queue_num;
+	unsigned int qos_type;
+	unsigned int qos_pri;
+	unsigned int qos_dscp;
+	unsigned int qos_table_idx;
+	unsigned int qos_weight;
+	unsigned char mac[6];
 };
 
 extern int chip_name;
@@ -60,11 +55,11 @@
 int reg_write_ioctl(unsigned int offset, unsigned int value);
 int phy_dump_ioctl(unsigned int phy_addr);
 int mii_mgr_cl22_read_ioctl(unsigned int port_num, unsigned int reg,
-			    unsigned int *value);
+			unsigned int *value);
 int mii_mgr_cl22_write_ioctl(unsigned int port_num, unsigned int reg,
-			     unsigned int value);
+			unsigned int value);
 int mii_mgr_cl45_read_ioctl(unsigned int port_num, unsigned int dev,
-			    unsigned int reg, unsigned int *value);
+			unsigned int reg, unsigned int *value);
 int mii_mgr_cl45_write_ioctl(unsigned int port_num, unsigned int dev,
-			     unsigned int reg, unsigned int value);
+			unsigned int reg, unsigned int value);
 #endif
diff --git a/recipes-devtools/switch/files/src/switch_netlink.c b/recipes-devtools/switch/files/src/switch_netlink.c
index 397ebe5..f6f5fb0 100644
--- a/recipes-devtools/switch/files/src/switch_netlink.c
+++ b/recipes-devtools/switch/files/src/switch_netlink.c
@@ -44,7 +44,7 @@
 			    nla_get_string(attrs[MT753X_ATTR_TYPE_MESG]);
 			printf("register switch dev:\n%s", val->dev_info);
 		} else {
-			fprintf(stderr, "ERROR:No switch dev now\n");
+			printf("ERROR:No switch dev now\n");
 			goto done;
 		}
 	} else
@@ -132,7 +132,7 @@
 	/* Allocate an netllink message buffer */
 	msg = nlmsg_alloc();
 	if (!msg) {
-		fprintf(stderr, "Failed to allocate netlink message\n");
+		printf("Failed to allocate netlink message\n");
 		exit(1);
 	}
 	if (!construct) {
@@ -148,7 +148,7 @@
 	if (construct) {
 		err = construct(msg, arg);
 		if (err < 0) {
-			fprintf(stderr, "attributes error\n");
+			printf("attributes error\n");
 			goto nal_put_failure;
 		}
 	}
@@ -156,14 +156,14 @@
 	/* Allocate an new callback handler */
 	callback = nl_cb_alloc(NL_CB_CUSTOM);
 	if (!callback) {
-		fprintf(stderr, "Failed to allocate callback handler\n");
+		printf("Failed to allocate callback handler\n");
 		exit(1);
 	}
 
 	/* Send netlink message */
 	err = nl_send_auto_complete(user_sock, msg);
 	if (err < 0) {
-		fprintf(stderr, "nl_send_auto_complete failied:%d\n", err);
+		printf("nl_send_auto_complete failied:%d\n", err);
 		goto out;
 	}
 	finished = 0;
@@ -218,18 +218,18 @@
 	/* Allocate an new netlink socket */
 	user_sock = nl_socket_alloc();
 	if (!user_sock) {
-		fprintf(stderr, "Failed to create user socket\n");
+		printf("Failed to create user socket\n");
 		goto err;
 	}
 	/* Connetct the genl controller */
 	if (genl_connect(user_sock)) {
-		fprintf(stderr, "Failed to connetct to generic netlink\n");
+		printf("Failed to connetct to generic netlink\n");
 		goto err;
 	}
 	/* Allocate an new nl_cache */
 	ret = genl_ctrl_alloc_cache(user_sock, &cache);
 	if (ret < 0) {
-		fprintf(stderr, "Failed to allocate netlink cache\n");
+		printf("Failed to allocate netlink cache\n");
 		goto err;
 	}
 
@@ -254,7 +254,7 @@
 
 	err = mt753x_request_callback(cmd, list_swdevs, NULL, arg);
 	if (err < 0)
-		fprintf(stderr, "mt753x list dev error\n");
+		printf("mt753x list dev error\n");
 }
 
 static int mt753x_request(struct mt753x_attr *arg, int cmd)
@@ -263,7 +263,7 @@
 
 	err = mt753x_request_callback(cmd, spilt_attrs, construct_attrs, arg);
 	if (err < 0) {
-		fprintf(stderr, "mt753x deal request error\n");
+		printf("mt753x deal request error\n");
 		return err;
 	}
 	return 0;
@@ -279,7 +279,7 @@
 	attr->port_num = port_num;
 	attr->phy_dev = phy_dev;
 	attr->reg = offset;
-	attr->value = -1;
+	attr->value = 0;
 	attr->type = MT753X_ATTR_TYPE_REG;
 
 	switch (op) {
diff --git a/recipes-devtools/switch/files/src/switch_netlink.h b/recipes-devtools/switch/files/src/switch_netlink.h
index cb812d5..94d8389 100644
--- a/recipes-devtools/switch/files/src/switch_netlink.h
+++ b/recipes-devtools/switch/files/src/switch_netlink.h
@@ -1,6 +1,6 @@
 /*
  * switch_netlink.h: switch(netlink) set API
- * 
+ *
  * Author: Sirui Zhao <Sirui.Zhao@mediatek.com>
  */
 #ifndef MT753X_NETLINK_H
@@ -54,20 +54,16 @@
 int mt753x_netlink_init(const char *name);
 void mt753x_netlink_free(void);
 void mt753x_list_swdev(struct mt753x_attr *arg, int cmd);
-int reg_read_netlink(struct mt753x_attr *arg, unsigned int offset,
-		     unsigned int *value);
-int reg_write_netlink(struct mt753x_attr *arg, unsigned int offset,
-		      unsigned int value);
+int reg_read_netlink(struct mt753x_attr *arg, unsigned int offset, unsigned int *value);
+int reg_write_netlink(struct mt753x_attr *arg, unsigned int offset, unsigned int value);
 int phy_cl22_read_netlink(struct mt753x_attr *arg, unsigned int port_num,
-			  unsigned int phy_addr, unsigned int *value);
+			unsigned int phy_addr, unsigned int *value);
 int phy_cl22_write_netlink(struct mt753x_attr *arg, unsigned int port_num,
-			   unsigned int phy_addr, unsigned int value);
+			unsigned int phy_addr, unsigned int value);
 int phy_cl45_read_netlink(struct mt753x_attr *arg, unsigned int port_num,
-			  unsigned int phy_dev, unsigned int phy_addr,
-			  unsigned int *value);
+			unsigned int phy_dev, unsigned int phy_addr, unsigned int *value);
 int phy_cl45_write_netlink(struct mt753x_attr *arg, unsigned int port_num,
-			   unsigned int phy_dev, unsigned int phy_addr,
-			   unsigned int value);
+			unsigned int phy_dev, unsigned int phy_addr, unsigned int value);
 int phy_dump_netlink(struct mt753x_attr *arg, int phy_addr);
 
 #endif
diff --git a/recipes-kernel/linux/linux-mediatek-5.4/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/recipes-kernel/linux/linux-mediatek-5.4/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch
index bec6787..987a4f6 100644
--- a/recipes-kernel/linux/linux-mediatek-5.4/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch
+++ b/recipes-kernel/linux/linux-mediatek-5.4/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch
@@ -115,35 +115,3 @@
  	call_netdevice_notifiers(NETDEV_CHANGEADDR, dev);
  	add_device_randomness(dev->dev_addr, dev->addr_len);
  	return 0;
---- a/net/ethernet/eth.c
-+++ b/net/ethernet/eth.c
-@@ -143,6 +143,18 @@ u32 eth_get_headlen(const struct net_dev
- }
- EXPORT_SYMBOL(eth_get_headlen);
- 
-+static inline bool
-+eth_check_local_mask(const void *addr1, const void *addr2, const void *mask)
-+{
-+	const u16 *a1 = addr1;
-+	const u16 *a2 = addr2;
-+	const u16 *m = mask;
-+
-+	return (((a1[0] ^ a2[0]) & ~m[0]) |
-+		((a1[1] ^ a2[1]) & ~m[1]) |
-+		((a1[2] ^ a2[2]) & ~m[2]));
-+}
-+
- /**
-  * eth_type_trans - determine the packet's protocol ID.
-  * @skb: received socket data
-@@ -174,6 +186,10 @@ __be16 eth_type_trans(struct sk_buff *sk
- 		} else {
- 			skb->pkt_type = PACKET_OTHERHOST;
- 		}
-+
-+		if (eth_check_local_mask(eth->h_dest, dev->dev_addr,
-+					 dev->local_addr_mask))
-+			skb->gro_skip = 1;
- 	}
- 
- 	/*
diff --git a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/dsa/airoha/an8855/an8855.c b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/dsa/airoha/an8855/an8855.c
index b0ba4be..78cfbdc 100644
--- a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/dsa/airoha/an8855/an8855.c
+++ b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/dsa/airoha/an8855/an8855.c
@@ -20,12 +20,72 @@
 #include <linux/gpio/consumer.h>
 #include <net/dsa.h>
 #include <linux/of_address.h>
+#include <linux/seq_file.h>
+#include <linux/proc_fs.h>
+#include <linux/version.h>
 
 #include "an8855.h"
 #include "an8855_nl.h"
+#include "an8855_phy.h"
 
 /* AN8855 driver version */
-#define ARHT_AN8855_DSA_DRIVER_VER	"1.0.1-L5.4"
+#define ARHT_AN8855_DSA_DRIVER_VER	"1.0.2"
+
+#define ARHT_CHIP_NAME                  "an8855"
+#define ARHT_PROC_DIR                   "air_sw"
+#define ARHT_PROC_NODE_DEVICE           "device"
+
+struct proc_dir_entry *proc_an8855_dsa_dir;
+
+/* T830 AN8855 Reference Board */
+static const struct an8855_led_cfg led_cfg[] = {
+/*************************************************************************
+ * Enable, LED idx, LED Polarity, LED ON event,  LED Blink event  LED Freq
+ *************************************************************************
+ */
+	/* GPIO0 */
+	{1, P4_LED0, LED_HIGH, LED_ON_EVENT, LED_BLK_EVENT, LED_FREQ},
+	/* GPIO1 */
+	{1, P4_LED1, LED_HIGH, LED_ON_EVENT, LED_BLK_EVENT, LED_FREQ},
+	/* GPIO2 */
+	{1, P0_LED0, LED_HIGH, LED_ON_EVENT, LED_BLK_EVENT, LED_FREQ},
+	/* GPIO3 */
+	{1, P0_LED1, LED_HIGH, LED_ON_EVENT, LED_BLK_EVENT, LED_FREQ},
+	/* GPIO4 */
+	{1, P1_LED0, LED_LOW,  LED_ON_EVENT, LED_BLK_EVENT, LED_FREQ},
+	/* GPIO5 */
+	{1, P1_LED1, LED_LOW,  LED_ON_EVENT, LED_BLK_EVENT, LED_FREQ},
+	/* GPIO6 */
+	{0, PHY_LED_MAX, LED_LOW,  LED_ON_EVENT, LED_BLK_EVENT, LED_FREQ},
+	/* GPIO7 */
+	{0, PHY_LED_MAX, LED_HIGH, LED_ON_EVENT, LED_BLK_EVENT, LED_FREQ},
+	/* GPIO8 */
+	{0, PHY_LED_MAX, LED_HIGH, LED_ON_EVENT, LED_BLK_EVENT, LED_FREQ},
+	/* GPIO9 */
+	{1, P2_LED0, LED_HIGH, LED_ON_EVENT, LED_BLK_EVENT, LED_FREQ},
+	/* GPIO10 */
+	{1, P2_LED1, LED_HIGH, LED_ON_EVENT, LED_BLK_EVENT, LED_FREQ},
+	/* GPIO11 */
+	{1, P3_LED0, LED_HIGH, LED_ON_EVENT, LED_BLK_EVENT, LED_FREQ},
+	/* GPIO12 */
+	{1, P3_LED1, LED_HIGH,  LED_ON_EVENT, LED_BLK_EVENT, LED_FREQ},
+	/* GPIO13 */
+	{0, PHY_LED_MAX, LED_HIGH, LED_ON_EVENT, LED_BLK_EVENT, LED_FREQ},
+	/* GPIO14 */
+	{0, PHY_LED_MAX, LED_HIGH, LED_ON_EVENT, LED_BLK_EVENT, LED_FREQ},
+	/* GPIO15 */
+	{0, PHY_LED_MAX, LED_HIGH, LED_ON_EVENT, LED_BLK_EVENT, LED_FREQ},
+	/* GPIO16 */
+	{0, PHY_LED_MAX, LED_HIGH, LED_ON_EVENT, LED_BLK_EVENT, LED_FREQ},
+	/* GPIO17 */
+	{0, PHY_LED_MAX, LED_HIGH, LED_ON_EVENT, LED_BLK_EVENT, LED_FREQ},
+	/* GPIO18 */
+	{0, PHY_LED_MAX, LED_HIGH, LED_ON_EVENT, LED_BLK_EVENT, LED_FREQ},
+	/* GPIO19 */
+	{0, PHY_LED_MAX, LED_LOW,  LED_ON_EVENT, LED_BLK_EVENT, LED_FREQ},
+	/* GPIO20 */
+	{0, PHY_LED_MAX, LED_LOW,  LED_ON_EVENT, LED_BLK_EVENT, LED_FREQ},
+};
 
 /* String, offset, and register size in bytes if different from 4 bytes */
 static const struct an8855_mib_desc an8855_mib[] = {
@@ -99,7 +159,6 @@
 	ret = bus->write(bus, priv->phy_base, 0x14, (val & 0xFFFF));
 
 	ret = bus->write(bus, priv->phy_base, 0x1f, 0);
-	ret = bus->write(bus, priv->phy_base, 0x10, 0);
 
 	if (ret < 0) {
 		dev_err(&bus->dev, "failed to write an8855 register\n");
@@ -130,7 +189,6 @@
 	hi = bus->read(bus, priv->phy_base, 0x17);
 
 	ret = bus->write(bus, priv->phy_base, 0x1f, 0);
-	ret = bus->write(bus, priv->phy_base, 0x10, 0);
 	if (ret < 0) {
 		dev_err(&bus->dev, "failed to read an8855 register\n");
 		return ret;
@@ -327,16 +385,22 @@
 static int
 an8855_cl45_read(struct an8855_priv *priv, int port, int devad, int regnum)
 {
-	regnum = MII_ADDR_C45 | (devad << 16) | regnum;
-	return mdiobus_read_nested(priv->bus, port, regnum);
+	an8855_cl22_write(priv, port, 0x0d, devad);
+	an8855_cl22_write(priv, port, 0x0e, regnum);
+	an8855_cl22_write(priv, port, 0x0d, devad | (0x4000));
+	return an8855_cl22_read(priv, port, 0x0e);
 }
 
 static int
 an8855_cl45_write(struct an8855_priv *priv, int port, int devad, int regnum,
 		      u16 val)
 {
-	regnum = MII_ADDR_C45 | (devad << 16) | regnum;
-	return mdiobus_write_nested(priv->bus, port, regnum, val);
+	an8855_cl22_write(priv, port, 0x0d, devad);
+	an8855_cl22_write(priv, port, 0x0e, regnum);
+	an8855_cl22_write(priv, port, 0x0d, devad | (0x4000));
+	an8855_cl22_write(priv, port, 0x0e, val);
+
+	return 0;
 }
 
 int
@@ -457,7 +521,6 @@
 	priv->ports[port].pm |= PORTMATRIX_MATRIX(BIT(AN8855_CPU_PORT));
 	priv->ports[port].enable = true;
 	an8855_write(priv, AN8855_PORTMATRIX_P(port), priv->ports[port].pm);
-	an8855_clear(priv, AN8855_PMCR_P(port), PMCR_LINK_SETTINGS_MASK);
 
 	mutex_unlock(&priv->reg_mutex);
 
@@ -479,7 +542,6 @@
 	 */
 	priv->ports[port].enable = false;
 	an8855_write(priv, AN8855_PORTMATRIX_P(port), PORTMATRIX_CLR);
-	an8855_clear(priv, AN8855_PMCR_P(port), PMCR_LINK_SETTINGS_MASK);
 
 	mutex_unlock(&priv->reg_mutex);
 }
@@ -1085,6 +1147,216 @@
 		dev_dbg(ds->dev, "Add unused port%d to reserved VLAN%d group\n",
 			i, AN8855_RESERVED_VLAN);
 	}
+
+	return 0;
+}
+
+static int an8855_led_set_usr_def(struct dsa_switch *ds, u8 entity,
+		int polar, u16 on_evt, u16 blk_evt, u8 led_freq)
+{
+	struct an8855_priv *priv = ds->priv;
+	u32 cl45_data = 0;
+
+	if (polar == LED_HIGH)
+		on_evt |= LED_ON_POL;
+	else
+		on_evt &= ~LED_ON_POL;
+
+	/* LED on event */
+	an8855_phy_cl45_write(priv, (entity / 4), PHY_DEV1E,
+		PHY_SINGLE_LED_ON_CTRL(entity % 4), on_evt | LED_ON_EN);
+
+	/* LED blink event */
+	an8855_phy_cl45_write(priv, (entity / 4), PHY_DEV1E,
+		PHY_SINGLE_LED_BLK_CTRL(entity % 4), blk_evt);
+
+	/* LED freq */
+	switch (led_freq) {
+	case AIR_LED_BLK_DUR_32M:
+		cl45_data = 0x30e;
+		break;
+	case AIR_LED_BLK_DUR_64M:
+		cl45_data = 0x61a;
+		break;
+	case AIR_LED_BLK_DUR_128M:
+		cl45_data = 0xc35;
+		break;
+	case AIR_LED_BLK_DUR_256M:
+		cl45_data = 0x186a;
+		break;
+	case AIR_LED_BLK_DUR_512M:
+		cl45_data = 0x30d4;
+		break;
+	case AIR_LED_BLK_DUR_1024M:
+		cl45_data = 0x61a8;
+		break;
+	default:
+		break;
+	}
+	an8855_phy_cl45_write(priv, (entity / 4), PHY_DEV1E,
+		PHY_SINGLE_LED_BLK_DUR(entity % 4), cl45_data);
+
+	an8855_phy_cl45_write(priv, (entity / 4), PHY_DEV1E,
+		PHY_SINGLE_LED_ON_DUR(entity % 4), (cl45_data >> 1));
+
+	/* Disable DATA & BAD_SSD for port LED blink behavior */
+	cl45_data = an8855_phy_cl45_read(priv, (entity / 4), PHY_DEV1E,
+		PHY_PMA_CTRL);
+	cl45_data &= ~BIT(0);
+	cl45_data &= ~BIT(15);
+	an8855_phy_cl45_write(priv, (entity / 4), PHY_DEV1E,
+		PHY_PMA_CTRL, cl45_data);
+
+	return 0;
+}
+
+static int an8855_led_set_mode(struct dsa_switch *ds, u8 mode)
+{
+	struct an8855_priv *priv = ds->priv;
+	u16 cl45_data;
+
+	cl45_data = an8855_phy_cl45_read(priv, 0, PHY_DEV1F, PHY_LED_BCR);
+	switch (mode) {
+	case AN8855_LED_MODE_DISABLE:
+		cl45_data &= ~LED_BCR_EXT_CTRL;
+		cl45_data &= ~LED_BCR_MODE_MASK;
+		cl45_data |= LED_BCR_MODE_DISABLE;
+		break;
+	case AN8855_LED_MODE_USER_DEFINE:
+		cl45_data |= LED_BCR_EXT_CTRL;
+		cl45_data |= LED_BCR_CLK_EN;
+		break;
+	default:
+		dev_err(priv->dev, "LED mode%d is not supported!\n", mode);
+		return -EINVAL;
+	}
+	an8855_phy_cl45_write(priv, 0, PHY_DEV1F, PHY_LED_BCR, cl45_data);
+
+	return 0;
+}
+
+static int an8855_led_set_state(struct dsa_switch *ds, u8 entity, u8 state)
+{
+	struct an8855_priv *priv = ds->priv;
+	u16 cl45_data = 0;
+
+	/* Change to per port contorl */
+	cl45_data = an8855_phy_cl45_read(priv, (entity / 4), PHY_DEV1E,
+		PHY_LED_CTRL_SELECT);
+
+	if (state == 1)
+		cl45_data |= (1 << (entity % 4));
+	else
+		cl45_data &= ~(1 << (entity % 4));
+
+	an8855_phy_cl45_write(priv, (entity / 4), PHY_DEV1E,
+		PHY_LED_CTRL_SELECT, cl45_data);
+
+	/* LED enable setting */
+	cl45_data = an8855_phy_cl45_read(priv, (entity / 4),
+		PHY_DEV1E, PHY_SINGLE_LED_ON_CTRL(entity % 4));
+
+	if (state == 1)
+		cl45_data |= LED_ON_EN;
+	else
+		cl45_data &= ~LED_ON_EN;
+
+	an8855_phy_cl45_write(priv, (entity / 4), PHY_DEV1E,
+		PHY_SINGLE_LED_ON_CTRL(entity % 4), cl45_data);
+
+	return 0;
+}
+
+static int an8855_led_init(struct dsa_switch *ds)
+{
+	struct an8855_priv *priv = ds->priv;
+	u32 val, led_count = ARRAY_SIZE(led_cfg);
+	int ret = 0, id;
+	u32 tmp_val = 0;
+	u32 tmp_id = 0;
+
+	ret = an8855_led_set_mode(ds, AN8855_LED_MODE_USER_DEFINE);
+	if (ret != 0) {
+		dev_err(priv->dev, "led_set_mode fail(ret:%d)!\n", ret);
+		return ret;
+	}
+
+	for (id = 0; id < led_count; id++) {
+		ret = an8855_led_set_state(ds,
+			led_cfg[id].phy_led_idx, led_cfg[id].en);
+		if (ret != 0) {
+			dev_err(priv->dev, "led_set_state fail(ret:%d)!\n", ret);
+			return ret;
+		}
+		if (led_cfg[id].en == 1) {
+			ret = an8855_led_set_usr_def(ds,
+				led_cfg[id].phy_led_idx,
+				led_cfg[id].pol, led_cfg[id].on_cfg,
+				led_cfg[id].blk_cfg,
+				led_cfg[id].led_freq);
+			if (ret != 0) {
+				dev_err(priv->dev, "led_set_usr_def fail!\n");
+				return ret;
+			}
+		}
+	}
+
+	/* Setting for System LED & Loop LED */
+	an8855_write(priv, RG_GPIO_OE, 0x0);
+	an8855_write(priv, RG_GPIO_CTRL, 0x0);
+	val = 0;
+	an8855_write(priv, RG_GPIO_L_INV, val);
+
+	val = 0x1001;
+	an8855_write(priv, RG_GPIO_CTRL, val);
+	val = an8855_read(priv, RG_GPIO_DATA);
+	val |= BITS(1, 3);
+	val &= ~(BIT(0));
+	val &= ~(BIT(6));
+
+	an8855_write(priv, RG_GPIO_DATA, val);
+	val = an8855_read(priv, RG_GPIO_OE);
+	val |= 0x41;
+	an8855_write(priv, RG_GPIO_OE, val);
+
+	/* Mapping between GPIO & LED */
+	val = 0;
+	for (id = 0; id < led_count; id++) {
+		/* Skip GPIO6, due to GPIO6 does not support PORT LED */
+		if (id == 6)
+			continue;
+
+		if (led_cfg[id].en == 1) {
+			if (id < 7)
+				val |= led_cfg[id].phy_led_idx << ((id % 4) * 8);
+			else
+				val |= led_cfg[id].phy_led_idx << (((id - 1) % 4) * 8);
+		}
+
+		if (id < 7)
+			tmp_id = id;
+		else
+			tmp_id = id - 1;
+
+		if ((tmp_id % 4) == 0x3) {
+			an8855_write(priv, RG_GPIO_LED_SEL(tmp_id / 4), val);
+			tmp_val = an8855_read(priv, RG_GPIO_LED_SEL(tmp_id / 4));
+			val = 0;
+		}
+	}
+
+	/* Turn on LAN LED mode */
+	val = 0;
+	for (id = 0; id < led_count; id++) {
+		if (led_cfg[id].en == 1)
+			val |= 0x1 << id;
+	}
+	an8855_write(priv, RG_GPIO_LED_MODE, val);
+
+	/* Force clear blink pulse for per port LED */
+	an8855_phy_cl45_write(priv, 0, PHY_DEV1F, PHY_LED_BLINK_DUR_CTRL, 0x1f);
+	usleep_range(1000, 5000);
+	an8855_phy_cl45_write(priv, 0, PHY_DEV1F, PHY_LED_BLINK_DUR_CTRL, 0);
 
 	return 0;
 }
@@ -1095,7 +1367,7 @@
 	struct an8855_priv *priv = ds->priv;
 	struct an8855_dummy_poll p;
 	u32 unused_pm = 0;
-	u32 val, id;
+	u32 val, id, led_count = ARRAY_SIZE(led_cfg);
 	int ret, i;
 
 	/* Reset whole chip through gpio pin or memory-mapped registers for
@@ -1130,6 +1402,63 @@
 		priv->phy_base = priv->phy_base_new;
 	}
 
+	for (i = 0; i < AN8855_NUM_PHYS; i++) {
+		val = an8855_phy_read(ds, i, MII_BMCR);
+		val |= BMCR_ISOLATE;
+		an8855_phy_write(ds, i, MII_BMCR, val);
+	}
+
+	/* AN8855H need to setup before switch init */
+	val = an8855_read(priv, PKG_SEL);
+	if ((val & 0x7) == PAG_SEL_AN8855H) {
+		/* Invert for LED activity change */
+		val = an8855_read(priv, RG_GPIO_L_INV);
+		for (id = 0; id < led_count; id++) {
+			if ((led_cfg[id].pol == LED_HIGH) &&
+				(led_cfg[id].en == 1))
+				val |= 0x1 << id;
+		}
+		an8855_write(priv, RG_GPIO_L_INV, (val | 0x1));
+
+		/* MCU NOP CMD */
+		an8855_write(priv, RG_GDMP_RAM, 0x846);
+		an8855_write(priv, RG_GDMP_RAM + 4, 0x4a);
+
+		/* Enable MCU */
+		val = an8855_read(priv, RG_CLK_CPU_ICG);
+		an8855_write(priv, RG_CLK_CPU_ICG, val | MCU_ENABLE);
+		usleep_range(1000, 5000);
+
+		/* Disable MCU watchdog */
+		val = an8855_read(priv, RG_TIMER_CTL);
+		an8855_write(priv, RG_TIMER_CTL, (val & (~WDOG_ENABLE)));
+
+		/* Configure interrupt */
+		an8855_write(priv, RG_INTB_MODE, (0x1 << priv->intr_pin));
+
+		/* LED settings for T830 reference board */
+		ret = an8855_led_init(ds);
+		if (ret < 0) {
+			dev_err(priv->dev, "an8855_led_init fail. (ret=%d)\n", ret);
+			return ret;
+		}
+	}
+
+	/* Adjust to reduce noise */
+	for (i = 0; i < AN8855_NUM_PHYS; i++) {
+		an8855_phy_cl45_write(priv, i, PHY_DEV1E,
+			PHY_TX_PAIR_DLY_SEL_GBE, 0x4040);
+
+		an8855_phy_cl45_write(priv, i, PHY_DEV1E,
+			PHY_RXADC_CTRL, 0x1010);
+
+		an8855_phy_cl45_write(priv, i, PHY_DEV1E,
+			PHY_RXADC_REV_0, 0x100);
+
+		an8855_phy_cl45_write(priv, i, PHY_DEV1E,
+			PHY_RXADC_REV_1, 0x100);
+	}
+
 	/* Let phylink decide the interface later. */
 	priv->p5_interface = PHY_INTERFACE_MODE_NA;
 
@@ -1139,6 +1468,10 @@
 	an8855_rmw(priv, AN8855_BPC, AN8855_BPDU_PORT_FW_MASK,
 		   AN8855_BPDU_CPU_ONLY);
 
+	val = an8855_read(priv, AN8855_CKGCR);
+	val &= ~(CKG_LNKDN_GLB_STOP | CKG_LNKDN_PORT_STOP);
+	an8855_write(priv, AN8855_CKGCR, val);
+
 	/* Enable and reset MIB counters */
 	an8855_mib_reset(ds);
 
@@ -1157,8 +1490,18 @@
 			   PVC_EG_TAG(AN8855_VLAN_EG_CONSISTENT));
 	}
 
+	for (i = 0; i < AN8855_NUM_PHYS; i++) {
+		val = an8855_phy_read(ds, i, MII_BMCR);
+		val &= ~BMCR_ISOLATE;
+		an8855_phy_write(ds, i, MII_BMCR, val);
+	}
+
 	an8855_phy_setup(ds);
 
+	/* PHY restart AN*/
+	for (i = 0; i < AN8855_NUM_PHYS; i++)
+		an8855_phy_write(ds, i, MII_BMCR, 0x1240);
+
 	/* Group and enable unused ports as a standalone dumb switch. */
 	setup_unused_ports(ds, unused_pm);
 
@@ -1255,6 +1598,28 @@
 {
 	u32 val = 0;
 
+	/* TX FIR - improve TX EYE */
+	val = an8855_read(priv, INTF_CTRL_10);
+	val &= ~(0x3f << 16);
+	val |= BIT(21);
+	val &= ~(0x1f << 24);
+	val |= (0x4 << 24);
+	val |= BIT(29);
+	an8855_write(priv, INTF_CTRL_10, val);
+
+	val = an8855_read(priv, INTF_CTRL_11);
+	val &= ~(0x3f);
+	val |= BIT(6);
+	an8855_write(priv, INTF_CTRL_11, val);
+
+	/* RX CDR - improve RX Jitter Tolerance */
+	val = an8855_read(priv, RG_QP_CDR_LPF_BOT_LIM);
+	val &= ~(0x7 << 24);
+	val |= (0x5 << 24);
+	val &= ~(0x7 << 20);
+	val |= (0x5 << 20);
+	an8855_write(priv, RG_QP_CDR_LPF_BOT_LIM, val);
+
 	/* PLL */
 	val = an8855_read(priv, QP_DIG_MODE_CTRL_1);
 	val &= ~(0x3 << 2);
@@ -1384,7 +1749,7 @@
 	val &= ~(0xf << 25);
 	val |= (0x1 << 25);
 	val &= ~(0x7 << 29);
-	val |= (0x3 << 29);
+	val |= (0x6 << 29);
 	an8855_write(priv, RG_QP_CDR_LPF_SETVALUE, val);
 
 	val = an8855_read(priv, RG_QP_CDR_PR_CKREF_DIV1);
@@ -1415,12 +1780,9 @@
 	val |= (0x4 << 24);
 	an8855_write(priv, RG_QP_CDR_PR_CKREF_DIV1, val);
 
-	val = an8855_read(priv, PLL_CTRL_0);
-	val |= BIT(0);
-	an8855_write(priv, PLL_CTRL_0, val);
-
 	val = an8855_read(priv, RX_CTRL_26);
-	val &= ~BIT(23);
+	val |= BIT(23);
+	val &= ~BIT(24);
 	val |= BIT(26);
 	an8855_write(priv, RX_CTRL_26, val);
 
@@ -1448,8 +1810,8 @@
 	val = an8855_read(priv, RX_CTRL_8);
 	val &= ~(0xfff << 16);
 	val |= (0x200 << 16);
-	val &= ~(0x7fff << 14);
-	val |= (0xfff << 14);
+	val &= ~(0x7fff << 0);
+	val |= (0xfff << 0);
 	an8855_write(priv, RX_CTRL_8, val);
 
 	/* Frequency memter */
@@ -1468,6 +1830,10 @@
 	val |= (0x2710 << 0);
 	an8855_write(priv, RX_CTRL_7, val);
 
+	val = an8855_read(priv, PLL_CTRL_0);
+	val |= BIT(0);
+	an8855_write(priv, PLL_CTRL_0, val);
+
 	/* PCS Init */
 	val = an8855_read(priv, RG_HSGMII_PCS_CTROL_1);
 	val &= ~BIT(30);
@@ -1507,6 +1873,28 @@
 {
 	u32 val = 0;
 
+	/* TX FIR - improve TX EYE */
+	val = an8855_read(priv, INTF_CTRL_10);
+	val &= ~(0x3f << 16);
+	val |= BIT(21);
+	val &= ~(0x1f << 24);
+	val |= BIT(29);
+	an8855_write(priv, INTF_CTRL_10, val);
+
+	val = an8855_read(priv, INTF_CTRL_11);
+	val &= ~(0x3f);
+	val |= (0xd << 0);
+	val |= BIT(6);
+	an8855_write(priv, INTF_CTRL_11, val);
+
+	/* RX CDR - improve RX Jitter Tolerance */
+	val = an8855_read(priv, RG_QP_CDR_LPF_BOT_LIM);
+	val &= ~(0x7 << 24);
+	val |= (0x6 << 24);
+	val &= ~(0x7 << 20);
+	val |= (0x6 << 20);
+	an8855_write(priv, RG_QP_CDR_LPF_BOT_LIM, val);
+
 	/* PMA Init */
 	/* PLL */
 	val = an8855_read(priv, QP_DIG_MODE_CTRL_1);
@@ -1666,15 +2054,10 @@
 	val |= (0x4 << 24);
 	an8855_write(priv, RG_QP_CDR_PR_CKREF_DIV1, val);
 
-	val = an8855_read(priv, PLL_CTRL_0);
-	val |= BIT(0);
-	an8855_write(priv, PLL_CTRL_0, val);
-
 	val = an8855_read(priv, RX_CTRL_26);
-	val &= ~BIT(23);
-	if (mode == SGMII_MODE_AN)
+	val |= BIT(23);
+	val &= ~BIT(24);
 		val |= BIT(26);
-
 	an8855_write(priv, RX_CTRL_26, val);
 
 	val = an8855_read(priv, RX_DLY_0);
@@ -1721,6 +2104,10 @@
 	val |= (0x2710 << 0);
 	an8855_write(priv, RX_CTRL_7, val);
 
+	val = an8855_read(priv, PLL_CTRL_0);
+	val |= BIT(0);
+	an8855_write(priv, PLL_CTRL_0, val);
+
 	if (mode == SGMII_MODE_FORCE) {
 		/* PCS Init */
 		val = an8855_read(priv, QP_DIG_MODE_CTRL_0);
@@ -1805,7 +2192,6 @@
 		/* Restart AN */
 		val = an8855_read(priv, SGMII_REG_AN0);
 		val |= BIT(9);
-		val |= BIT(15);
 		an8855_write(priv, SGMII_REG_AN0, val);
 	}
 
@@ -1923,16 +2309,6 @@
 }
 
 static void
-an8855_phylink_mac_link_down(struct dsa_switch *ds, int port,
-					 unsigned int mode,
-					 phy_interface_t interface)
-{
-	struct an8855_priv *priv = ds->priv;
-
-	an8855_clear(priv, AN8855_PMCR_P(port), PMCR_LINK_SETTINGS_MASK);
-}
-
-static void
 an8855_phylink_mac_link_up(struct dsa_switch *ds, int port,
 				       unsigned int mode,
 				       phy_interface_t interface,
@@ -2194,6 +2570,51 @@
 	return priv->info->phy_write(ds, port, regnum, val);
 }
 
+static int an8855_proc_device_read(struct seq_file *seq, void *v)
+{
+	seq_printf(seq, "%s\n", ARHT_CHIP_NAME);
+
+	return 0;
+}
+
+static int an8855_proc_device_open(struct inode *inode, struct file *file)
+{
+	return single_open(file, an8855_proc_device_read, 0);
+}
+
+#if (KERNEL_VERSION(5, 6, 0) <= LINUX_VERSION_CODE)
+static const struct proc_ops an8855_proc_device_fops = {
+	.proc_open	= an8855_proc_device_open,
+	.proc_read	= seq_read,
+	.proc_lseek	= seq_lseek,
+	.proc_release	= single_release,
+};
+#else
+static const struct file_operations an8855_proc_device_fops = {
+	.owner	= THIS_MODULE,
+	.open	= an8855_proc_device_open,
+	.read	= seq_read,
+	.llseek	= seq_lseek,
+	.release	= single_release,
+};
+#endif
+
+static int an8855_proc_device_init(void)
+{
+	if (!proc_an8855_dsa_dir)
+		proc_an8855_dsa_dir = proc_mkdir(ARHT_PROC_DIR, 0);
+
+	proc_create(ARHT_PROC_NODE_DEVICE, 0400, proc_an8855_dsa_dir,
+			&an8855_proc_device_fops);
+
+	return 0;
+}
+
+static void an8855_proc_device_exit(void)
+{
+	remove_proc_entry(ARHT_PROC_NODE_DEVICE, 0);
+}
+
 static const struct dsa_switch_ops an8855_switch_ops = {
 	.get_tag_protocol = air_get_tag_protocol,
 	.setup = an8855_sw_setup,
@@ -2217,10 +2638,6 @@
 	.port_mirror_add = an8855_port_mirror_add,
 	.port_mirror_del = an8855_port_mirror_del,
 	.phylink_validate = an8855_phylink_validate,
-	.phylink_mac_link_state = an8855_sw_phylink_mac_link_state,
-	.phylink_mac_config = an8855_phylink_mac_config,
-	.phylink_mac_link_down = an8855_phylink_mac_link_down,
-	.phylink_mac_link_up = an8855_phylink_mac_link_up,
 	.get_mac_eee = an8855_get_mac_eee,
 	.set_mac_eee = an8855_set_mac_eee,
 };
@@ -2308,6 +2725,13 @@
 	if ((ret < 0) || (priv->phy_base_new > 0x1f))
 		priv->phy_base_new = -1;
 
+	/* Assign AN8855 interrupt pin */
+	if (of_property_read_u32(dn, "airoha,intr", &priv->intr_pin))
+		priv->intr_pin = AN8855_DFL_INTR_ID;
+
+	if (of_property_read_u32(dn, "airoha,extSurge", &priv->extSurge))
+		priv->extSurge = AN8855_DFL_EXT_SURGE;
+
 	priv->bus = mdiodev->bus;
 	priv->dev = &mdiodev->dev;
 	priv->ds->priv = priv;
@@ -2324,6 +2748,7 @@
 	}
 	an8855_nl_init(&priv);
 
+	an8855_proc_device_init();
 	return 0;
 }
 
@@ -2338,6 +2763,8 @@
 	if (priv->base)
 		iounmap(priv->base);
 
+	an8855_proc_device_exit();
+
 	an8855_nl_exit();
 }
 
diff --git a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/dsa/airoha/an8855/an8855.h b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/dsa/airoha/an8855/an8855.h
index 531d9be..6c472c2 100644
--- a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/dsa/airoha/an8855/an8855.h
+++ b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/dsa/airoha/an8855/an8855.h
@@ -10,10 +10,13 @@
 
 #define AN8855_NUM_PORTS				6
 #define AN8855_CPU_PORT					5
+#define AN8855_WORD_SIZE				4
 #define AN8855_NUM_FDB_RECORDS			2048
 #define AN8855_ALL_MEMBERS				0x3f
 #define AN8855_RESERVED_VLAN			2
 #define AN8855_GPHY_SMI_ADDR_DEFAULT	1
+#define AN8855_DFL_INTR_ID				0xd
+#define AN8855_DFL_EXT_SURGE			0x0
 
 enum an8855_id {
 	ID_AN8855 = 0,
@@ -286,6 +289,8 @@
 #define AN8855_CKGCR			(0x10213e1c)
 #define LPI_TXIDLE_THD			14
 #define LPI_TXIDLE_THD_MASK		BITS(14, 31)
+#define CKG_LNKDN_GLB_STOP	0x01
+#define CKG_LNKDN_PORT_STOP	0x02
 
 /* Register for MIB */
 #define AN8855_PORT_MIB_COUNTER(x)	(0x10214000 + (x) * 0x200)
@@ -303,18 +308,14 @@
 					 CCR_RX_OCT_CNT_BAD | \
 					 CCR_TX_OCT_CNT_GOOD | \
 					 CCR_TX_OCT_CNT_BAD | \
-					 CCR_RX_OCT_CNT_GOOD_2 | \
 					 CCR_RX_OCT_CNT_BAD_2 | \
-					 CCR_TX_OCT_CNT_GOOD_2 | \
 					 CCR_TX_OCT_CNT_BAD_2)
 #define	 CCR_MIB_ACTIVATE		(CCR_MIB_ENABLE | \
 					 CCR_RX_OCT_CNT_GOOD | \
 					 CCR_RX_OCT_CNT_BAD | \
 					 CCR_TX_OCT_CNT_GOOD | \
 					 CCR_TX_OCT_CNT_BAD | \
-					 CCR_RX_OCT_CNT_GOOD_2 | \
 					 CCR_RX_OCT_CNT_BAD_2 | \
-					 CCR_TX_OCT_CNT_GOOD_2 | \
 					 CCR_TX_OCT_CNT_BAD_2)
 
 /* AN8855 SGMII register group */
@@ -331,6 +332,22 @@
 #define AN8855_RST_CTRL			0x100050c0
 #define	 SYS_CTRL_SYS_RST		BIT(31)
 
+#define INT_MASK			0x100050F0
+#define INT_SYS_BIT			BIT(15)
+
+#define RG_CLK_CPU_ICG		0x10005034
+#define MCU_ENABLE			BIT(3)
+
+#define RG_TIMER_CTL		0x1000a100
+#define WDOG_ENABLE			BIT(25)
+
+#define CKGCR				0x10213E1C
+#define CKG_LNKDN_GLB_STOP	0x01
+#define CKG_LNKDN_PORT_STOP	0x02
+
+#define PKG_SEL				0x10000094
+#define PAG_SEL_AN8855H		0x2
+
 /* Register for hw trap status */
 #define AN8855_HWTRAP			0x1000009c
 
@@ -339,6 +356,15 @@
 
 #define SCU_BASE				0x10000000
 #define RG_RGMII_TXCK_C			(SCU_BASE + 0x1d0)
+#define RG_GPIO_LED_MODE		(SCU_BASE + 0x0054)
+#define RG_GPIO_LED_SEL(i)	(SCU_BASE + (0x0058 + ((i) * 4)))
+#define RG_INTB_MODE			(SCU_BASE + 0x0080)
+#define RG_GDMP_RAM				(SCU_BASE + 0x10000)
+
+#define RG_GPIO_L_INV			(SCU_BASE + 0x0010)
+#define RG_GPIO_CTRL			(SCU_BASE + 0xa300)
+#define RG_GPIO_DATA			(SCU_BASE + 0xa304)
+#define RG_GPIO_OE			(SCU_BASE + 0xa314)
 
 #define HSGMII_AN_CSR_BASE		0x10220000
 #define SGMII_REG_AN0			(HSGMII_AN_CSR_BASE + 0x000)
@@ -382,6 +408,8 @@
 #define SS_LCPLL_TDC_PCW_1			(QP_PMA_TOP_BASE + 0x248)
 #define INTF_CTRL_8			(QP_PMA_TOP_BASE + 0x320)
 #define INTF_CTRL_9			(QP_PMA_TOP_BASE + 0x324)
+#define INTF_CTRL_10		(QP_PMA_TOP_BASE + 0x328)
+#define INTF_CTRL_11		(QP_PMA_TOP_BASE + 0x32c)
 #define PLL_CTRL_0			(QP_PMA_TOP_BASE + 0x400)
 #define PLL_CTRL_2			(QP_PMA_TOP_BASE + 0x408)
 #define PLL_CTRL_3			(QP_PMA_TOP_BASE + 0x40c)
@@ -399,6 +427,7 @@
 #define QP_ANA_CSR_BASE				0x1022f000
 #define RG_QP_RX_DAC_EN				(QP_ANA_CSR_BASE + 0x00)
 #define RG_QP_RXAFE_RESERVE			(QP_ANA_CSR_BASE + 0x04)
+#define RG_QP_CDR_LPF_BOT_LIM		(QP_ANA_CSR_BASE + 0x08)
 #define RG_QP_CDR_LPF_MJV_LIM		(QP_ANA_CSR_BASE + 0x0c)
 #define RG_QP_CDR_LPF_SETVALUE		(QP_ANA_CSR_BASE + 0x14)
 #define RG_QP_CDR_PR_CKREF_DIV1		(QP_ANA_CSR_BASE + 0x18)
@@ -437,6 +466,74 @@
 	u8 ivl;
 };
 
+/* Definition of LED */
+#define LED_ON_EVENT	(LED_ON_EVT_LINK_1000M | \
+			LED_ON_EVT_LINK_100M | LED_ON_EVT_LINK_10M |\
+			LED_ON_EVT_LINK_HD | LED_ON_EVT_LINK_FD)
+
+#define LED_BLK_EVENT	(LED_BLK_EVT_1000M_TX_ACT | \
+			LED_BLK_EVT_1000M_RX_ACT | \
+			LED_BLK_EVT_100M_TX_ACT | \
+			LED_BLK_EVT_100M_RX_ACT | \
+			LED_BLK_EVT_10M_TX_ACT | \
+			LED_BLK_EVT_10M_RX_ACT)
+
+#define LED_FREQ	AIR_LED_BLK_DUR_64M
+
+enum phy_led_idx {
+	P0_LED0,
+	P0_LED1,
+	P0_LED2,
+	P0_LED3,
+	P1_LED0,
+	P1_LED1,
+	P1_LED2,
+	P1_LED3,
+	P2_LED0,
+	P2_LED1,
+	P2_LED2,
+	P2_LED3,
+	P3_LED0,
+	P3_LED1,
+	P3_LED2,
+	P3_LED3,
+	P4_LED0,
+	P4_LED1,
+	P4_LED2,
+	P4_LED3,
+	PHY_LED_MAX
+};
+
+/* TBD */
+enum an8855_led_blk_dur {
+	AIR_LED_BLK_DUR_32M,
+	AIR_LED_BLK_DUR_64M,
+	AIR_LED_BLK_DUR_128M,
+	AIR_LED_BLK_DUR_256M,
+	AIR_LED_BLK_DUR_512M,
+	AIR_LED_BLK_DUR_1024M,
+	AIR_LED_BLK_DUR_LAST
+};
+
+enum an8855_led_polarity {
+	LED_LOW,
+	LED_HIGH,
+};
+enum an8855_led_mode {
+	AN8855_LED_MODE_DISABLE,
+	AN8855_LED_MODE_USER_DEFINE,
+	AN8855_LED_MODE_LAST
+};
+
+struct an8855_led_cfg {
+	u16 en;
+	u8  phy_led_idx;
+	u16 pol;
+	u16 on_cfg;
+	u16 blk_cfg;
+	u8 led_freq;
+};
+
 /* struct an8855_port -	This is the main data structure for holding the state
  *			of the port.
  * @enable:	The status used for show port is enabled or not.
@@ -522,11 +619,13 @@
 	unsigned int phy_base;
 	int phy_base_new;
 	unsigned int id;
+	u32 intr_pin;
 	phy_interface_t p5_interface;
 	unsigned int p5_intf_sel;
 	u8 mirror_rx;
 	u8 mirror_tx;
 	u8 eee_enable;
+	u32 extSurge;
 
 	struct an8855_port ports[AN8855_NUM_PORTS];
 	/* protect among processes for registers access */
diff --git a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/dsa/airoha/an8855/an8855_nl.c b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/dsa/airoha/an8855/an8855_nl.c
index b80ce6f..45099d8 100644
--- a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/dsa/airoha/an8855/an8855_nl.c
+++ b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/dsa/airoha/an8855/an8855_nl.c
@@ -45,8 +45,8 @@
 static const struct nla_policy an8855_nl_cmd_policy[] = {
 	[AN8855_ATTR_TYPE_MESG] = {.type = NLA_STRING},
 	[AN8855_ATTR_TYPE_PHY] = {.type = NLA_S32},
-	[AN8855_ATTR_TYPE_REG] = {.type = NLA_S32},
-	[AN8855_ATTR_TYPE_VAL] = {.type = NLA_S32},
+	[AN8855_ATTR_TYPE_REG] = {.type = NLA_U32},
+	[AN8855_ATTR_TYPE_VAL] = {.type = NLA_U32},
 	[AN8855_ATTR_TYPE_DEV_NAME] = {.type = NLA_S32},
 	[AN8855_ATTR_TYPE_DEV_ID] = {.type = NLA_S32},
 	[AN8855_ATTR_TYPE_DEVAD] = {.type = NLA_S32},
@@ -150,15 +150,15 @@
 an8855_nl_reply_read(struct genl_info *info)
 {
 	struct sk_buff *rep_skb = NULL;
-	s32 phy, devad, reg;
-	int value;
+	s32 phy, devad;
+	u32 reg = 0;
+	int value = 0;
 	int ret = 0;
 
 	phy = an8855_nl_get_s32(info, AN8855_ATTR_TYPE_PHY, -1);
 	devad = an8855_nl_get_s32(info, AN8855_ATTR_TYPE_DEVAD, -1);
-	reg = an8855_nl_get_s32(info, AN8855_ATTR_TYPE_REG, -1);
 
-	if (reg < 0)
+	if (an8855_nl_get_u32(info, AN8855_ATTR_TYPE_REG, &reg))
 		goto err;
 
 	ret = an8855_nl_prepare_reply(info, AN8855_CMD_READ, &rep_skb);
@@ -172,11 +172,11 @@
 						devad, reg);
 	} else
 		value = an8855_read(an8855_sw_priv, reg);
-	ret = nla_put_s32(rep_skb, AN8855_ATTR_TYPE_REG, reg);
+	ret = nla_put_u32(rep_skb, AN8855_ATTR_TYPE_REG, reg);
 	if (ret < 0)
 		goto err;
 
-	ret = nla_put_s32(rep_skb, AN8855_ATTR_TYPE_VAL, value);
+	ret = nla_put_u32(rep_skb, AN8855_ATTR_TYPE_VAL, value);
 	if (ret < 0)
 		goto err;
 
@@ -193,18 +193,16 @@
 an8855_nl_reply_write(struct genl_info *info)
 {
 	struct sk_buff *rep_skb = NULL;
-	s32 phy, devad, reg;
-	u32 value;
+	s32 phy, devad;
+	u32 value = 0, reg = 0;
 	int ret = 0;
 
 	phy = an8855_nl_get_s32(info, AN8855_ATTR_TYPE_PHY, -1);
 	devad = an8855_nl_get_s32(info, AN8855_ATTR_TYPE_DEVAD, -1);
-	reg = an8855_nl_get_s32(info, AN8855_ATTR_TYPE_REG, -1);
-
-	if (an8855_nl_get_u32(info, AN8855_ATTR_TYPE_VAL, &value))
+	if (an8855_nl_get_u32(info, AN8855_ATTR_TYPE_REG, &reg))
 		goto err;
 
-	if (reg < 0)
+	if (an8855_nl_get_u32(info, AN8855_ATTR_TYPE_VAL, &value))
 		goto err;
 
 	ret = an8855_nl_prepare_reply(info, AN8855_CMD_WRITE, &rep_skb);
@@ -218,11 +216,11 @@
 					  value);
 	} else
 		an8855_write(an8855_sw_priv, reg, value);
-	ret = nla_put_s32(rep_skb, AN8855_ATTR_TYPE_REG, reg);
+	ret = nla_put_u32(rep_skb, AN8855_ATTR_TYPE_REG, reg);
 	if (ret < 0)
 		goto err;
 
-	ret = nla_put_s32(rep_skb, AN8855_ATTR_TYPE_VAL, value);
+	ret = nla_put_u32(rep_skb, AN8855_ATTR_TYPE_VAL, value);
 	if (ret < 0)
 		goto err;
 
diff --git a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/dsa/airoha/an8855/an8855_phy.c b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/dsa/airoha/an8855/an8855_phy.c
index 5499312..9df0834 100644
--- a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/dsa/airoha/an8855/an8855_phy.c
+++ b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/dsa/airoha/an8855/an8855_phy.c
@@ -14,32 +14,36 @@
 #include "an8855.h"
 #include "an8855_phy.h"
 
-#define AN8855_NUM_PHYS 5
+#define AN8855_EFUSE_DATA0	0x1000a500
 
-static u32
-an8855_phy_read_dev_reg(struct dsa_switch *ds, u32 port_num,
-				   u32 dev_addr, u32 reg_addr)
+const u8 dsa_r50ohm_table[] = {
+	127, 127, 127, 127, 127, 127, 127, 127, 127, 127,
+	127, 127, 127, 127, 127, 127, 127, 126, 122, 117,
+	112, 109, 104, 101,  97,  94,  90,  88,  84,  80,
+	78,  74,  72,  68,  66,  64,  61,  58,  56,  53,
+	51,  48,  47,  44,  42,  40,  38,  36,  34,  32,
+	31,  28,  27,  24,  24,  22,  20,  18,  16,  16,
+	14,  12,  11,   9
+};
+
+static u8 shift_check(u8 base)
 {
-	struct an8855_priv *priv = ds->priv;
-	u32 phy_val;
-	u32 addr;
+	u8 i;
+	u32 sz = sizeof(dsa_r50ohm_table)/sizeof(u8);
 
-	addr = MII_ADDR_C45 | (dev_addr << 16) | (reg_addr & 0xffff);
-	phy_val = priv->info->phy_read(ds, port_num, addr);
+	for (i = 0; i < sz; ++i)
+		if (dsa_r50ohm_table[i] == base)
+			break;
 
-	return phy_val;
+	if (i < 8 || i >= sz)
+		return 25; /* index of 94 */
+
+	return (i - 8);
 }
 
-static void
-an8855_phy_write_dev_reg(struct dsa_switch *ds, u32 port_num,
-				     u32 dev_addr, u32 reg_addr, u32 write_data)
+static u8 get_shift_val(u8 idx)
 {
-	struct an8855_priv *priv = ds->priv;
-	u32 addr;
-
-	addr = MII_ADDR_C45 | (dev_addr << 16) | (reg_addr & 0xffff);
-
-	priv->info->phy_write(ds, port_num, addr, write_data);
+	return dsa_r50ohm_table[idx];
 }
 
 static void
@@ -64,7 +68,10 @@
 an8855_phy_setting(struct dsa_switch *ds)
 {
 	struct an8855_priv *priv = ds->priv;
-	int i;
+	int i, j;
+	u8 shift_sel = 0, rsel_tx_a = 0, rsel_tx_b = 0;
+	u8 rsel_tx_c = 0, rsel_tx_d = 0;
+	u16 cl45_data = 0;
 	u32 val;
 
 	/* Release power down */
@@ -82,48 +89,89 @@
 		val |= ADVERTISE_PAUSE_ASYM;
 		an8855_switch_phy_write(ds, i, MII_ADVERTISE, val);
 	}
+
+	if (priv->extSurge) {
+		for (i = 0; i < AN8855_NUM_PHYS; i++) {
+			/* Read data */
+			for (j = 0; j < AN8855_WORD_SIZE; j++) {
+				val = an8855_read(priv, AN8855_EFUSE_DATA0 +
+					(AN8855_WORD_SIZE * (3 + j + (4 * i))));
+
+				shift_sel = shift_check((val & 0x7f000000) >> 24);
+				switch (j) {
+				case 0:
+					rsel_tx_a = get_shift_val(shift_sel);
+					break;
+				case 1:
+					rsel_tx_b = get_shift_val(shift_sel);
+					break;
+				case 2:
+					rsel_tx_c = get_shift_val(shift_sel);
+					break;
+				case 3:
+					rsel_tx_d = get_shift_val(shift_sel);
+					break;
+				default:
+					continue;
+				}
+			}
+			cl45_data = an8855_phy_cl45_read(priv, i, PHY_DEV1E, 0x174);
+			cl45_data &= ~(0x7f7f);
+			cl45_data |= (rsel_tx_a << 8);
+			cl45_data |= rsel_tx_b;
+			an8855_phy_cl45_write(priv, i, PHY_DEV1E, 0x174, cl45_data);
+			cl45_data = an8855_phy_cl45_read(priv, i, PHY_DEV1E, 0x175);
+			cl45_data &= ~(0x7f7f);
+			cl45_data |= (rsel_tx_c << 8);
+			cl45_data |= rsel_tx_d;
+			an8855_phy_cl45_write(priv, i, PHY_DEV1E, 0x175, cl45_data);
+		}
+	}
 }
 
 static void
 an8855_low_power_setting(struct dsa_switch *ds)
 {
 	int port, addr;
+	struct an8855_priv *priv = ds->priv;
 
 	for (port = 0; port < AN8855_NUM_PHYS; port++) {
-		an8855_phy_write_dev_reg(ds, port, 0x1e, 0x11, 0x0f00);
-		an8855_phy_write_dev_reg(ds, port, 0x1e, 0x3c, 0x0000);
-		an8855_phy_write_dev_reg(ds, port, 0x1e, 0x3d, 0x0000);
-		an8855_phy_write_dev_reg(ds, port, 0x1e, 0x3e, 0x0000);
-		an8855_phy_write_dev_reg(ds, port, 0x1e, 0xc6, 0x53aa);
+		an8855_phy_cl45_write(priv, port, 0x1e, 0x11, 0x0f00);
+		an8855_phy_cl45_write(priv, port, 0x1e, 0x3c, 0x0000);
+		an8855_phy_cl45_write(priv, port, 0x1e, 0x3d, 0x0000);
+		an8855_phy_cl45_write(priv, port, 0x1e, 0x3e, 0x0000);
+		an8855_phy_cl45_write(priv, port, 0x1e, 0xc6, 0x53aa);
 	}
 
-	an8855_phy_write_dev_reg(ds, 0, 0x1f, 0x268, 0x07f1);
-	an8855_phy_write_dev_reg(ds, 0, 0x1f, 0x269, 0x2111);
-	an8855_phy_write_dev_reg(ds, 0, 0x1f, 0x26a, 0x0000);
-	an8855_phy_write_dev_reg(ds, 0, 0x1f, 0x26b, 0x0074);
-	an8855_phy_write_dev_reg(ds, 0, 0x1f, 0x26e, 0x00f6);
-	an8855_phy_write_dev_reg(ds, 0, 0x1f, 0x26f, 0x6666);
-	an8855_phy_write_dev_reg(ds, 0, 0x1f, 0x271, 0x2c02);
-	an8855_phy_write_dev_reg(ds, 0, 0x1f, 0x272, 0x0c22);
-	an8855_phy_write_dev_reg(ds, 0, 0x1f, 0x700, 0x0001);
-	an8855_phy_write_dev_reg(ds, 0, 0x1f, 0x701, 0x0803);
-	an8855_phy_write_dev_reg(ds, 0, 0x1f, 0x702, 0x01b6);
-	an8855_phy_write_dev_reg(ds, 0, 0x1f, 0x703, 0x2111);
+	an8855_phy_cl45_write(priv, 0, 0x1f, 0x268, 0x07f1);
+	an8855_phy_cl45_write(priv, 0, 0x1f, 0x269, 0x2111);
+	an8855_phy_cl45_write(priv, 0, 0x1f, 0x26a, 0x0000);
+	an8855_phy_cl45_write(priv, 0, 0x1f, 0x26b, 0x0074);
+	an8855_phy_cl45_write(priv, 0, 0x1f, 0x26e, 0x00f6);
+	an8855_phy_cl45_write(priv, 0, 0x1f, 0x26f, 0x6666);
+	an8855_phy_cl45_write(priv, 0, 0x1f, 0x271, 0x2c02);
+	an8855_phy_cl45_write(priv, 0, 0x1f, 0x272, 0x0c22);
+	an8855_phy_cl45_write(priv, 0, 0x1f, 0x700, 0x0001);
+	an8855_phy_cl45_write(priv, 0, 0x1f, 0x701, 0x0803);
+	an8855_phy_cl45_write(priv, 0, 0x1f, 0x702, 0x01b6);
+	an8855_phy_cl45_write(priv, 0, 0x1f, 0x703, 0x2111);
 
-	an8855_phy_write_dev_reg(ds, 1, 0x1f, 0x700, 0x0001);
+	an8855_phy_cl45_write(priv, 1, 0x1f, 0x700, 0x0001);
 
 	for (addr = 0x200; addr <= 0x230; addr += 2)
-		an8855_phy_write_dev_reg(ds, 0, 0x1f, addr, 0x2020);
+		an8855_phy_cl45_write(priv, 0, 0x1f, addr, 0x2020);
 
 	for (addr = 0x201; addr <= 0x231; addr += 2)
-		an8855_phy_write_dev_reg(ds, 0, 0x1f, addr, 0x0020);
+		an8855_phy_cl45_write(priv, 0, 0x1f, addr, 0x0020);
 }
 
 static void
 an8855_eee_setting(struct dsa_switch *ds, u32 port)
 {
+	struct an8855_priv *priv = ds->priv;
+
 	/* Disable EEE */
-	an8855_phy_write_dev_reg(ds, port, PHY_DEV07, PHY_DEV07_REG_03C, 0);
+	an8855_phy_cl45_write(priv, port, PHY_DEV07, PHY_DEV07_REG_03C, 0);
 }
 
 int
diff --git a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/dsa/airoha/an8855/an8855_phy.h b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/dsa/airoha/an8855/an8855_phy.h
index 63a03bb..1193e67 100644
--- a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/dsa/airoha/an8855/an8855_phy.h
+++ b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/dsa/airoha/an8855/an8855_phy.h
@@ -12,6 +12,8 @@
 
 #include <linux/bitops.h>
 
+#define AN8855_NUM_PHYS	5
+
 /*phy calibration use*/
 #define DEV_1E				0x1E
 /*global device 0x1f, always set P0*/
@@ -169,11 +171,69 @@
 /* PHY EEE Register bitmap of define */
 #define PHY_DEV07			0x07
 #define PHY_DEV07_REG_03C		0x3c
+#define ADV_EEE_100			0x2
+#define ADV_EEE_1000		0x4
 
 /* PHY DEV 0x1e Register bitmap of define */
 #define PHY_DEV1E			0x1e
+/* PHY TX PAIR DELAY SELECT Register */
+#define PHY_TX_PAIR_DLY_SEL_GBE		0x013
+/* PHY ADC Register */
+#define PHY_RXADC_CTRL				0x0d8
+#define PHY_RXADC_REV_0				0x0d9
+#define PHY_RXADC_REV_1				0x0da
+
+/* PHY LED Register bitmap of define */
+#define PHY_LED_CTRL_SELECT		0x3e8
+#define PHY_SINGLE_LED_ON_CTRL(i)	(0x3e0 + ((i) * 2))
+#define PHY_SINGLE_LED_BLK_CTRL(i)	(0x3e1 + ((i) * 2))
+#define PHY_SINGLE_LED_ON_DUR(i)	(0x3e9 + ((i) * 2))
+#define PHY_SINGLE_LED_BLK_DUR(i)	(0x3ea + ((i) * 2))
+
+#define PHY_PMA_CTRL	(0x340)
+
 #define PHY_DEV1F			0x1f
 
+#define PHY_LED_ON_CTRL(i)		(0x24 + ((i) * 2))
+#define LED_ON_EN				(1 << 15)
+#define LED_ON_POL				(1 << 14)
+#define LED_ON_EVT_MASK			(0x7f)
+
+/* LED ON Event */
+#define LED_ON_EVT_FORCE		(1 << 6)
+#define LED_ON_EVT_LINK_HD		(1 << 5)
+#define LED_ON_EVT_LINK_FD		(1 << 4)
+#define LED_ON_EVT_LINK_DOWN	(1 << 3)
+#define LED_ON_EVT_LINK_10M		(1 << 2)
+#define LED_ON_EVT_LINK_100M	(1 << 1)
+#define LED_ON_EVT_LINK_1000M	(1 << 0)
+
+#define PHY_LED_BLK_CTRL(i)		(0x25 + ((i) * 2))
+#define LED_BLK_EVT_MASK		(0x3ff)
+/* LED Blinking Event */
+#define LED_BLK_EVT_FORCE			(1 << 9)
+#define LED_BLK_EVT_10M_RX_ACT		(1 << 5)
+#define LED_BLK_EVT_10M_TX_ACT		(1 << 4)
+#define LED_BLK_EVT_100M_RX_ACT		(1 << 3)
+#define LED_BLK_EVT_100M_TX_ACT		(1 << 2)
+#define LED_BLK_EVT_1000M_RX_ACT	(1 << 1)
+#define LED_BLK_EVT_1000M_TX_ACT	(1 << 0)
+
+#define PHY_LED_BCR				(0x21)
+#define LED_BCR_EXT_CTRL		(1 << 15)
+#define LED_BCR_CLK_EN			(1 << 3)
+#define LED_BCR_TIME_TEST		(1 << 2)
+#define LED_BCR_MODE_MASK		(3)
+#define LED_BCR_MODE_DISABLE	(0)
+
+#define PHY_LED_ON_DUR			(0x22)
+#define LED_ON_DUR_MASK			(0xffff)
+
+#define PHY_LED_BLK_DUR			(0x23)
+#define LED_BLK_DUR_MASK		(0xffff)
+
+#define PHY_LED_BLINK_DUR_CTRL	(0x720)
+
 /* Proprietory Control Register of Internal Phy device 0x1e */
 #define PHY_TX_MLT3_BASE		0x0
 #define PHY_DEV1E_REG_13		0x13
diff --git a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_eth_dbg.c b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_eth_dbg.c
index fca5e3e..1916266 100644
--- a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_eth_dbg.c
+++ b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_eth_dbg.c
@@ -609,7 +609,6 @@
 	case PSE_EIP197_PORT:
 		pse_info_get_cdm(eth, port, 6, options);
 		break;
-		break;
 	default:
 		pr_info("Not supported\n");
 		break;
diff --git a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_eth_reset.c b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_eth_reset.c
index df23ae3..19cd4e3 100644
--- a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_eth_reset.c
+++ b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_eth_reset.c
@@ -42,6 +42,41 @@
 	reset_event->count[id]++;
 }
 
+static void mtk_dump_reg(void *_eth, char *name, u32 offset, u32 range)
+{
+	struct mtk_eth *eth = _eth;
+	u32 cur = offset;
+
+	pr_info("\n============ %s ============\n", name);
+	while (cur < offset + range) {
+		pr_info("0x%x: %08x %08x %08x %08x\n",
+			cur, mtk_r32(eth, cur), mtk_r32(eth, cur + 0x4),
+			mtk_r32(eth, cur + 0x8), mtk_r32(eth, cur + 0xc));
+		cur += 0x10;
+	}
+}
+
+static void mtk_dump_regmap(struct regmap *pmap, char *name,
+			    u32 offset, u32 range)
+{
+	unsigned int cur = offset;
+	unsigned int val1 = 0, val2 = 0, val3 = 0, val4 = 0;
+
+	if (!pmap)
+		return;
+
+	pr_info("\n============ %s ============\n", name);
+	while (cur < offset + range) {
+		regmap_read(pmap, cur, &val1);
+		regmap_read(pmap, cur + 0x4, &val2);
+		regmap_read(pmap, cur + 0x8, &val3);
+		regmap_read(pmap, cur + 0xc, &val4);
+		pr_info("0x%x: %08x %08x %08x %08x\n",
+			cur, val1, val2, val3, val4);
+		cur += 0x10;
+	}
+}
+
 int mtk_eth_cold_reset(struct mtk_eth *eth)
 {
 	u32 reset_bits = 0;
@@ -55,16 +90,15 @@
 #if defined(CONFIG_MEDIATEK_NETSYS_V3)
 	if (MTK_HAS_CAPS(eth->soc->caps, MTK_RSTCTRL_PPE2))
 		reset_bits |= RSTCTRL_PPE2;
-	if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V3))
+	if (mtk_reset_flag == MTK_FE_START_RESET)
 		reset_bits |= RSTCTRL_WDMA0 | RSTCTRL_WDMA1 | RSTCTRL_WDMA2;
 #endif
 	ethsys_reset(eth, reset_bits);
 
-	if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2))
-		regmap_write(eth->ethsys, ETHSYS_FE_RST_CHK_IDLE_EN, 0x3ffffff);
-
 	if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V3))
-		regmap_write(eth->ethsys, ETHSYS_FE_RST_CHK_IDLE_EN, 0x6F8FF);
+		regmap_write(eth->ethsys, ETHSYS_FE_RST_CHK_IDLE_EN, 0x6f8ff);
+	else if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2))
+		regmap_write(eth->ethsys, ETHSYS_FE_RST_CHK_IDLE_EN, 0x3ffffff);
 
 	return 0;
 }
@@ -89,6 +123,7 @@
 	}
 
 	if (i < 1000) {
+		done = 1;
 		reset_bits = RSTCTRL_ETH | RSTCTRL_PPE0;
 		if (MTK_HAS_CAPS(eth->soc->caps, MTK_RSTCTRL_PPE1))
 			reset_bits |= RSTCTRL_PPE1;
@@ -96,8 +131,7 @@
 		if (MTK_HAS_CAPS(eth->soc->caps, MTK_RSTCTRL_PPE2))
 			reset_bits |= RSTCTRL_PPE2;
 		if (mtk_reset_flag == MTK_FE_START_RESET)
-			reset_bits |= RSTCTRL_WDMA0 |
-			RSTCTRL_WDMA1 | RSTCTRL_WDMA2;
+			reset_bits |= RSTCTRL_WDMA0 | RSTCTRL_WDMA1 | RSTCTRL_WDMA2;
 #endif
 
 		regmap_update_bits(eth->ethsys, ETHSYS_RSTCTRL,
@@ -105,27 +139,51 @@
 
 		udelay(1);
 		regmap_read(eth->ethsys, ETHSYS_RSTCTRL, &val2);
-		if (!(val2 & reset_bits))
+		if (!(val2 & reset_bits)) {
 			pr_info("[%s] error val2=0x%x reset_bits=0x%x !\n",
 				__func__, val2, reset_bits);
+			done = 0;
+		}
 		reset_bits |= RSTCTRL_FE;
 		regmap_update_bits(eth->ethsys, ETHSYS_RSTCTRL,
 				   reset_bits, ~reset_bits);
-
 		udelay(1);
 		regmap_read(eth->ethsys, ETHSYS_RSTCTRL, &val3);
-		if (val3 & reset_bits)
+		if (val3 & reset_bits) {
 			pr_info("[%s] error val3=0x%x reset_bits=0x%x !\n",
 				__func__, val3, reset_bits);
-		done = 1;
+			done = 0;
+		}
 		mtk_reset_event_update(eth, MTK_EVENT_WARM_CNT);
 	}
 
 	pr_info("[%s] reset record val1=0x%x, val2=0x%x, val3=0x%x i:%d done:%d\n",
 		__func__, val1, val2, val3, i, done);
 
-	if (!done)
+	if (!done) {
+		mtk_dump_reg(eth, "FE", 0x0, 0x300);
+		mtk_dump_reg(eth, "ADMA", PDMA_BASE + 0x200, 0x10);
+		mtk_dump_reg(eth, "QDMA", QDMA_BASE + 0x200, 0x10);
+		mtk_dump_reg(eth, "WDMA0", WDMA_BASE(0) + 0x200, 0x10);
+		mtk_dump_reg(eth, "WDMA1", WDMA_BASE(1) + 0x200, 0x10);
+		mtk_dump_reg(eth, "PPE0", PPE_BASE(0), 0x10);
+		mtk_dump_reg(eth, "PPE0", PPE_BASE(0) + 0x180, 0x20);
+		if (!MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V1)) {
+			mtk_dump_reg(eth, "PPE1", PPE_BASE(1), 0x10);
+			mtk_dump_reg(eth, "PPE1", PPE_BASE(1) + 0x180, 0x20);
+		}
+		if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V3)) {
+			mtk_dump_reg(eth, "PPE2", PPE_BASE(2), 0x10);
+			mtk_dump_reg(eth, "PPE2", PPE_BASE(2) + 0x180, 0x20);
+			regmap_write(eth->ethsys, ETHSYS_LP_NONE_IDLE_LAT0, 0xffffffff);
+			regmap_write(eth->ethsys, ETHSYS_LP_NONE_IDLE_LAT1, 0xffffffff);
+			regmap_read(eth->ethsys, ETHSYS_LP_NONE_IDLE_LAT0, &val1);
+			regmap_read(eth->ethsys, ETHSYS_LP_NONE_IDLE_LAT1, &val2);
+			pr_info("ETHSYS_LP_NONE_IDLE_LAT0:%x\n", val1);
+			pr_info("ETHSYS_LP_NONE_IDLE_LAT1:%x\n", val2);
+		}
 		mtk_eth_cold_reset(eth);
+	}
 
 	return 0;
 }
@@ -187,41 +245,6 @@
 	return IRQ_HANDLED;
 }
 
-static void mtk_dump_reg(void *_eth, char *name, u32 offset, u32 range)
-{
-	struct mtk_eth *eth = _eth;
-	u32 cur = offset;
-
-	pr_info("\n============ %s ============\n", name);
-	while(cur < offset + range) {
-		pr_info("0x%x: %08x %08x %08x %08x\n",
-			cur, mtk_r32(eth, cur), mtk_r32(eth, cur + 0x4),
-			mtk_r32(eth, cur + 0x8), mtk_r32(eth, cur + 0xc));
-		cur += 0x10;
-	}
-}
-
-static void mtk_dump_regmap(struct regmap *pmap, char *name,
-			    u32 offset, u32 range)
-{
-	unsigned int cur = offset;
-	unsigned int val1 = 0, val2 = 0, val3 = 0, val4 = 0;
-
-	if (!pmap)
-		return;
-
-	pr_info("\n============ %s ============\n", name);
-	while (cur < offset + range) {
-		regmap_read(pmap, cur, &val1);
-		regmap_read(pmap, cur + 0x4, &val2);
-		regmap_read(pmap, cur + 0x8, &val3);
-		regmap_read(pmap, cur + 0xc, &val4);
-		pr_info("0x%x: %08x %08x %08x %08x\n",
-			cur, val1, val2, val3, val4);
-		cur += 0x10;
-	}
-}
-
 void mtk_dump_netsys_info(void *_eth)
 {
 	struct mtk_eth *eth = _eth;
@@ -266,7 +289,7 @@
 
 	cur_opq = (mtk_r32(eth, MTK_PSE_OQ_STA(id)) & mask);
 	if ((cur_opq != 0) && (cur_opq == *pre_opq))
-		*err_opq++;
+		(*err_opq)++;
 	else
 		*err_opq = 0;
 
@@ -279,7 +302,7 @@
 	static u32 err_cnt[MTK_WDMA_CNT];
 	static u32 err_opq1, err_opq2, err_opq8;
 	static u32 err_opq9, err_opq13, err_opq15;
-	u32 opq1, opq2, opq8, opq9, opq13, opq15;
+	static u32 opq1, opq2, opq8, opq9, opq13, opq15;
 	u32 cur_dtx, tx_busy, fsm_ts;
 	u32 i, err_opq = 0, err_flag = 0;
 
@@ -342,26 +365,42 @@
 u32 mtk_monitor_wdma_rx(struct mtk_eth *eth)
 {
 	static u32 pre_drx[MTK_WDMA_CNT];
+	static u32 pre_crx[MTK_WDMA_CNT];
 	static u32 pre_opq[MTK_WDMA_CNT];
 	static u32 err_cnt[MTK_WDMA_CNT];
-	u32 cur_crx = 0, cur_drx = 0, cur_opq = 0, fsm_fs;
+	bool connsys_busy, netsys_busy;
+	u32 cur_crx = 0, cur_drx = 0, cur_opq = 0, fsm_fs, max_cnt;
 	u32 i, err_flag = 0;
+	int rx_cnt;
 
 	for (i = 0; i < MTK_WDMA_CNT; i++) {
+		connsys_busy = netsys_busy = false;
+		max_cnt = mtk_r32(eth, MTK_WDMA_RX_MAX_CNT(i));
 		cur_crx = mtk_r32(eth, MTK_WDMA_CRX_PTR(i));
 		cur_drx = mtk_r32(eth, MTK_WDMA_DRX_PTR(i));
+		rx_cnt = (cur_drx > cur_crx) ? (cur_drx - 1 - cur_crx) :
+					       (cur_drx - 1 - cur_crx + max_cnt);
 		cur_opq = MTK_FE_WDMA_OQ(i);
 		fsm_fs = mtk_r32(eth, MTK_FE_CDM_FSM(i)) &
 			(MTK_CDM_FS_FSM_MASK | MTK_CDM_FS_PARSER_FSM_MASK);
-		/*drx unchange && ring not full && output && fsm_fs*/
-		if (cur_drx == pre_drx[i] && (cur_crx != cur_drx) &&
-		    (cur_opq != 0 && cur_opq == pre_opq[i]) && fsm_fs) {
+		/* drx and crx remain unchanged && rx_cnt is not zero */
+		if ((cur_drx == pre_drx[i]) && (cur_crx == pre_crx[i]) && (rx_cnt > 0))
+			connsys_busy = true;
+		/* drx and crx remain unchanged && pse_opq is not empty */
+		else if ((cur_drx == pre_drx[i]) && (cur_crx == pre_crx[i]) &&
+			 (cur_opq != 0 && cur_opq == pre_opq[i]) && fsm_fs)
+			netsys_busy = true;
+		if (connsys_busy || netsys_busy) {
 			err_cnt[i]++;
 			if (err_cnt[i] >= 3) {
-				pr_info("WDMA %d Rx Info\n", i);
+				pr_info("WDMA %d Rx Info (%s)\n", i,
+					connsys_busy ? "CONNSYS busy" : "NETSYS busy");
 				pr_info("err_cnt = %d", err_cnt[i]);
 				pr_info("prev_drx = 0x%x	| cur_drx = 0x%x\n",
 					pre_drx[i], cur_drx);
+				pr_info("prev_crx = 0x%x	| cur_crx = 0x%x\n",
+					pre_crx[i], cur_crx);
+				pr_info("rx cnt = %d\n", rx_cnt);
 				pr_info("WDMA_CRX_PTR = 0x%x\n",
 					mtk_r32(eth, MTK_WDMA_CRX_PTR(i)));
 				pr_info("WDMA_DRX_PTR = 0x%x\n",
@@ -375,6 +414,7 @@
 			}
 		} else
 			err_cnt[i] = 0;
+		pre_crx[i] = cur_crx;
 		pre_drx[i] = cur_drx;
 		pre_opq[i] = cur_opq;
 	}
@@ -387,15 +427,21 @@
 
 u32 mtk_monitor_rx_fc(struct mtk_eth *eth)
 {
-	u32 i = 0, mib_base = 0, gdm_fc = 0;
+	struct mtk_hw_stats *hw_stats;
+	static u32 gdm_rx_fc[MTK_MAX_DEVS];
+	u32 i = 0, is_rx_fc = 0;
 
 	for (i = 0; i < MTK_MAC_COUNT; i++) {
-		mib_base = MTK_GDM1_TX_GBCNT + MTK_STAT_OFFSET*i + MTK_GDM_RX_FC;
-		gdm_fc =  mtk_r32(eth, mib_base);
-		if (gdm_fc < 1)
-			return 1;
+		if (!eth->mac[i] || !netif_running(eth->netdev[i]))
+			continue;
+
+		hw_stats = eth->mac[i]->hw_stats;
+		if (hw_stats->rx_flow_control_packets - gdm_rx_fc[i])
+			is_rx_fc = 1;
+
+		gdm_rx_fc[i] = hw_stats->rx_flow_control_packets;
 	}
-	return 0;
+	return is_rx_fc;
 }
 
 u32 mtk_monitor_qdma_tx(struct mtk_eth *eth)
@@ -408,7 +454,7 @@
 	u32 is_qfwd_hang = mtk_r32(eth, MTK_QDMA_FWD_CNT) == 0;
 
 	is_rx_fc = mtk_monitor_rx_fc(eth);
-	if (is_qfsm_hang && is_qfwd_hang && is_rx_fc) {
+	if (is_qfsm_hang && is_qfwd_hang && !is_rx_fc) {
 		err_cnt_qtx++;
 		if (err_cnt_qtx >= 3) {
 			pr_info("QDMA Tx Info\n");
@@ -604,6 +650,9 @@
 	u32 cur_fsm, pse_ipq, err_flag = 0, i;
 
 	for (i = 0; i < MTK_MAX_DEVS; i++) {
+		if (!eth->mac[i] || !netif_running(eth->netdev[i]))
+			continue;
+
 		struct mtk_hw_stats *hw_stats = eth->mac[i]->hw_stats;
 
 		is_gmac_rx[i] = (mtk_r32(eth, MTK_MAC_FSM(i)) & 0xFF0000) != 0x10000;
@@ -623,6 +672,9 @@
 
 	if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V3)) {
 		for (i = 0; i < MTK_MAX_DEVS; i++) {
+			if (!eth->mac[i] || !netif_running(eth->netdev[i]))
+				continue;
+
 			if (i == 0) {
 				pse_ipq = (mtk_r32(eth, MTK_PSE_IQ_STA(0)) >> 16) & 0xFFF;
 				cur_fsm = mtk_r32(eth, MTK_FE_GDM1_FSM) & 0xFF;
@@ -672,6 +724,9 @@
 	u32 err_flag = 0, i, pse_opq;
 
 	for (i = 0; i < MTK_MAX_DEVS; i++) {
+		if (!eth->mac[i] || !netif_running(eth->netdev[i]))
+			continue;
+
 		struct mtk_hw_stats *hw_stats = eth->mac[i]->hw_stats;
 
 		if (i == 0)
@@ -697,6 +752,9 @@
 	}
 
 	for (i = 0; i < MTK_MAX_DEVS; i++) {
+		if (!eth->mac[i] || !netif_running(eth->netdev[i]))
+			continue;
+
 		gdm_fsm = mtk_r32(eth, MTK_FE_GDM_FSM(i)) & 0x1FFF0000;
 		pse_opq = MTK_FE_GDM_OQ(i);
 		if ((pre_gdm[i] == gdm_fsm) && (gdm_fsm == 0x10330000) &&
@@ -811,6 +869,9 @@
 	u32 mcr, sts, i;
 
 	for (i = 0; i < MTK_MAX_DEVS; i++) {
+		if (!eth->mac[i])
+			continue;
+
 		mac = eth->mac[i];
 		if (mac->type == MTK_GDM_TYPE) {
 			mcr = mtk_r32(mac->hw, MTK_MAC_MCR(mac->id));
@@ -829,18 +890,21 @@
 	}
 }
 
-void mtk_pse_port_linkdown(struct mtk_eth *eth, int port)
+void mtk_pse_set_port_link(struct mtk_eth *eth, u32 port, bool enable)
 {
-	u32 fe_glo_cfg;
+	u32 val;
 
-	fe_glo_cfg = mtk_r32(eth, MTK_FE_GLO_CFG(port));
-	fe_glo_cfg |= MTK_FE_LINK_DOWN_PORT(port);
-	mtk_w32(eth, fe_glo_cfg, MTK_FE_GLO_CFG(port));
+	val = mtk_r32(eth, MTK_FE_GLO_CFG(port));
+	if (enable)
+		val &= ~MTK_FE_LINK_DOWN_P(port);
+	else
+		val |= MTK_FE_LINK_DOWN_P(port);
+	mtk_w32(eth, val, MTK_FE_GLO_CFG(port));
 }
 
 void mtk_prepare_reset_fe(struct mtk_eth *eth)
 {
-	u32 i = 0, val = 0, mcr = 0;
+	u32 i = 0, val = 0;
 
 	/* Disable NETSYS Interrupt */
 	mtk_w32(eth, 0, MTK_FE_INT_ENABLE);
@@ -851,6 +915,9 @@
 	for (i = 0; i < MTK_MAC_COUNT; i++) {
 		if (!eth->netdev[i])
 			continue;
+
+		/* call carrier off first to avoid false dev_watchdog timeouts */
+		netif_carrier_off(eth->netdev[i]);
 		netif_tx_disable(eth->netdev[i]);
 	}
 
@@ -861,14 +928,14 @@
 	/* Force mac link down */
 	mtk_mac_linkdown(eth);
 
-	/* Force pse port link down */
-	mtk_pse_port_linkdown(eth, 0);
-	mtk_pse_port_linkdown(eth, 1);
-	mtk_pse_port_linkdown(eth, 2);
-	mtk_pse_port_linkdown(eth, 8);
-	mtk_pse_port_linkdown(eth, 9);
+	/* Force PSE port link down */
+	mtk_pse_set_port_link(eth, 0, false);
+	mtk_pse_set_port_link(eth, 1, false);
+	mtk_pse_set_port_link(eth, 2, false);
+	mtk_pse_set_port_link(eth, 8, false);
+	mtk_pse_set_port_link(eth, 9, false);
 	if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V3))
-		mtk_pse_port_linkdown(eth, 15);
+		mtk_pse_set_port_link(eth, 15, false);
 
 	/* Enable GDM drop */
 	for (i = 0; i < MTK_MAC_COUNT; i++)
@@ -911,9 +978,9 @@
 	}
 
 	if (i >= poll_time) {
-		pr_info("[%s] PPE keeps busy !\n", __func__);
+		pr_warn("[%s] PPE%d keeps busy !\n", __func__, ppe_id);
 		mtk_dump_reg(eth, "FE", 0x0, 0x500);
-		mtk_dump_reg(eth, "PPE", 0x2200, 0x200);
+		mtk_dump_reg(eth, "PPE", PPE_BASE(ppe_id), 0x200);
 	}
 }
 
diff --git a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_eth_reset.h b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_eth_reset.h
index dd8206a..facb645 100644
--- a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_eth_reset.h
+++ b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_eth_reset.h
@@ -92,4 +92,5 @@
 void mtk_prepare_reset_fe(struct mtk_eth *eth);
 void mtk_prepare_reset_ppe(struct mtk_eth *eth, u32 ppe_id);
 
+void mtk_pse_set_port_link(struct mtk_eth *eth, u32 port, bool enable);
 #endif		/* MTK_ETH_RESET_H */
diff --git a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_eth_soc.c
index 8971a7f..82f87b5 100644
--- a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -623,9 +623,11 @@
 {
 	struct mtk_mac *mac = container_of(config, struct mtk_mac,
 					   phylink_config);
+	struct mtk_eth *eth = mac->hw;
 	u32 val;
 
-	if (mac->type == MTK_XGDM_TYPE && mac->id != MTK_GMAC1_ID) {
+	if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V3) &&
+	    mac->id != MTK_GMAC1_ID) {
 		val = mtk_r32(mac->hw, MTK_XMAC_MCR(mac->id));
 		val &= 0xfffffff0;
 		val |= XMAC_MCR_TRX_DISABLE;
@@ -970,10 +972,10 @@
 			__func__, gdm_fsm, mac_fsm);
 }
 
-static void mtk_pse_port_link_set(struct mtk_mac *mac, bool up,
-				  phy_interface_t interface)
+static void mtk_pse_set_mac_port_link(struct mtk_mac *mac, bool up,
+				      phy_interface_t interface)
 {
-	u32 fe_glo_cfg, val = 0, port = 0;
+	u32 port = 0;
 
 	if (!up && interface == PHY_INTERFACE_MODE_XGMII) {
 		void __iomem *base;
@@ -995,26 +997,18 @@
 	switch (mac->id) {
 	case MTK_GMAC1_ID:
 		port = PSE_GDM1_PORT;
-		val = MTK_FE_LINK_DOWN_PORT(port);
 		break;
 	case MTK_GMAC2_ID:
 		port = PSE_GDM2_PORT;
-		val = MTK_FE_LINK_DOWN_PORT(port);
 		break;
 	case MTK_GMAC3_ID:
 		port = PSE_GDM3_PORT;
-		val = MTK_FE_LINK_DOWN_PORT(port);
 		break;
+	default:
+		return;
 	}
 
-	fe_glo_cfg = mtk_r32(mac->hw, MTK_FE_GLO_CFG(port));
-
-	if (!up)
-		fe_glo_cfg |= val;
-	else
-		fe_glo_cfg &= ~val;
-
-	mtk_w32(mac->hw, fe_glo_cfg, MTK_FE_GLO_CFG(port));
+	mtk_pse_set_port_link(mac->hw, port, up);
 	mtk_gdm_fsm_poll(mac);
 }
 
@@ -1027,7 +1021,7 @@
 	unsigned int id;
 	u32 mcr, sts;
 
-	mtk_pse_port_link_set(mac, false, interface);
+	mtk_pse_set_mac_port_link(mac, false, interface);
 	if (mac->type == MTK_GDM_TYPE) {
 		mcr = mtk_r32(mac->hw, MTK_MAC_MCR(mac->id));
 		mcr &= ~(MAC_MCR_TX_EN | MAC_MCR_RX_EN | MAC_MCR_FORCE_LINK);
@@ -1209,7 +1203,7 @@
 		mcr &= ~(XMAC_MCR_TRX_DISABLE);
 		mtk_w32(mac->hw, mcr, MTK_XMAC_MCR(mac->id));
 	}
-	mtk_pse_port_link_set(mac, true, interface);
+	mtk_pse_set_mac_port_link(mac, true, interface);
 }
 
 static void mtk_validate(struct phylink_config *config,
@@ -2162,7 +2156,8 @@
 			}
 
 			memset(&txd_info, 0, sizeof(struct mtk_tx_dma_desc_info));
-			txd_info.size = min(frag_size, eth->soc->txrx.dma_max_len);
+			txd_info.size = min_t(unsigned int, frag_size,
+					      eth->soc->txrx.dma_max_len);
 			txd_info.qid = queue;
 			txd_info.last = i == skb_shinfo(skb)->nr_frags - 1 &&
 					!(frag_size - txd_info.size);
@@ -2322,7 +2317,6 @@
 	struct netdev_queue *txq;
 	bool gso = false;
 	int tx_num;
-	int i = 0;
 	int qid = skb_get_queue_mapping(skb);
 
 	/* normally we can rely on the stack not calling this more than once,
@@ -3254,8 +3248,11 @@
 	}
 
 	/* invalidate lro rings */
-	for (i = 0; i < MTK_HW_LRO_RING_NUM; i++)
-		mtk_w32(eth, 0, reg_map->pdma.lro_rx_ctrl_dw0 + 0x8 + (i * 0x40));
+	for (i = 0; i < MTK_HW_LRO_RING_NUM; i++) {
+		int idx = MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_RX_V2) ? i : i + 1;
+
+		mtk_w32(eth, 0, reg_map->pdma.lro_rx_ctrl_dw0 + 0x8 + (idx * 0x40));
+	}
 
 	/* disable HW LRO */
 	mtk_w32(eth, 0, reg_map->pdma.lro_ctrl_dw0);
@@ -3763,11 +3760,21 @@
 static void mtk_dma_free(struct mtk_eth *eth)
 {
 	const struct mtk_soc_data *soc = eth->soc;
-	int i;
+	int i, j, txqs;
 
-	for (i = 0; i < MTK_MAC_COUNT; i++)
-		if (eth->netdev[i])
-			netdev_reset_queue(eth->netdev[i]);
+	if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA))
+		txqs = MTK_QDMA_TX_NUM;
+	else
+		txqs = MTK_PDMA_TX_NUM;
+
+	for (i = 0; i < MTK_MAC_COUNT; i++) {
+		if (!eth->netdev[i])
+			continue;
+
+		for (j = 0; j < txqs; j++)
+			netdev_tx_reset_queue(netdev_get_tx_queue(eth->netdev[i], j));
+	}
+
 	if ( !eth->soc->has_sram && eth->scratch_ring) {
 		dma_free_coherent(eth->dma_dev,
 				  soc->txrx.fq_dma_size * soc->txrx.txd_size,
@@ -3859,8 +3866,8 @@
 	const struct mtk_reg_map *reg_map = eth->soc->reg_map;
 
 	if (tx_ring) {
-		if (unlikely(!(mtk_r32(eth, eth->soc->reg_map->pdma.irq_status) &
-			       mtk_r32(eth, eth->soc->reg_map->pdma.irq_mask) &
+		if (unlikely(!(mtk_r32(eth, reg_map->pdma.irq_status) &
+			       mtk_r32(eth, reg_map->pdma.irq_mask) &
 			       MTK_TX_DONE_INT(tx_ring->ring_no))))
 			return IRQ_NONE;
 
@@ -3869,8 +3876,8 @@
 			__napi_schedule(&txrx_napi->napi);
 		}
 	} else {
-		if (unlikely(!(mtk_r32(eth, eth->soc->reg_map->pdma.irq_status) &
-			       mtk_r32(eth, eth->soc->reg_map->pdma.irq_mask) &
+		if (unlikely(!(mtk_r32(eth, reg_map->pdma.irq_status) &
+			       mtk_r32(eth, reg_map->pdma.irq_mask) &
 			       MTK_RX_DONE_INT(rx_ring->ring_no))))
 			return IRQ_NONE;
 
@@ -4739,6 +4746,8 @@
 	mtk_prepare_reset_ppe(eth, 0);
 	if (MTK_HAS_CAPS(eth->soc->caps, MTK_RSTCTRL_PPE1))
 		mtk_prepare_reset_ppe(eth, 1);
+	if (MTK_HAS_CAPS(eth->soc->caps, MTK_RSTCTRL_PPE2))
+		mtk_prepare_reset_ppe(eth, 2);
 
 	/* Adjust FE configurations to prepare for reset */
 	mtk_prepare_reset_fe(eth);
@@ -4757,7 +4766,7 @@
 				eth->netdev[i]);
 		}
 		rtnl_unlock();
-		if (wait_for_completion_timeout(&wait_ser_done, 3000)) {
+		if (wait_for_completion_timeout(&wait_ser_done, msecs_to_jiffies(3000))) {
 			if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V3) &&
 			    (mtk_stop_fail)) {
 				pr_info("send MTK_FE_START_RESET stop\n");
@@ -4766,8 +4775,9 @@
 							 eth->netdev[i]);
 				rtnl_unlock();
 				if (!wait_for_completion_timeout(&wait_ser_done,
-								 3000))
+								 msecs_to_jiffies(3000)))
 					pr_warn("wait for MTK_FE_START_RESET\n");
+				mtk_stop_fail = 0;
 			}
 			pr_warn("wait for MTK_FE_START_RESET\n");
 		}
diff --git a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_eth_soc.h
index 198cd0e..08f5988 100644
--- a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_eth_soc.h
@@ -71,8 +71,10 @@
 #define MTK_RSS_MAX_INDIRECTION_TABLE	128
 
 /* Frame Engine Global Configuration */
-#define MTK_FE_GLO_CFG(port)	((port < 8) ? 0x0 : 0x24)
-#define MTK_FE_LINK_DOWN_PORT(x)	((x < 8) ? (1 << (8 + x)) : (1 << (x - 8)))
+#define MTK_FE_GLO_CFG(x)	((x < 8) ? 0x0 : 0x24)
+#define MTK_FE_LINK_DOWN_P(x)	((x < 8) ? FIELD_PREP(GENMASK(15, 8), BIT(x)) :	\
+					   FIELD_PREP(GENMASK(7, 0), BIT(x - 8)))
+
 /* Frame Engine Global Reset Register */
 #define MTK_RST_GL		0x04
 #define RST_GL_PSE		BIT(0)
@@ -539,6 +541,7 @@
 #define MTK_WDMA_GLO_CFG(x)	(WDMA_BASE(x) + 0x204)
 #define MTK_WDMA_TX_DBG_MON0(x)	(WDMA_BASE(x) + 0x230)
 #define MTK_WDMA_RX_DBG_MON1(x)	(WDMA_BASE(x) + 0x3c4)
+#define MTK_WDMA_RX_MAX_CNT(x)	(WDMA_BASE(x) + 0x104)
 #define MTK_WDMA_CRX_PTR(x)	(WDMA_BASE(x) + 0x108)
 #define MTK_WDMA_DRX_PTR(x)	(WDMA_BASE(x) + 0x10C)
 #define MTK_CDM_FS_PARSER_FSM_MASK	GENMASK(27, 24)
@@ -892,6 +895,10 @@
 /* ethernet reset check idle register */
 #define ETHSYS_FE_RST_CHK_IDLE_EN 	0x28
 
+/* ethernet non-idle check register */
+#define ETHSYS_LP_NONE_IDLE_LAT0 (0x144)
+#define ETHSYS_LP_NONE_IDLE_LAT1 (0x148)
+
 /* ethernet dma channel agent map */
 #define ETHSYS_DMA_AG_MAP	0x408
 #define ETHSYS_DMA_AG_MAP_PDMA	BIT(0)
@@ -1006,6 +1013,12 @@
 #define USXGMII_LPA_LINK	BIT(15)
 #define USXGMII_LPA_LATCH	BIT(31)
 
+/* Register to QPHY wrapper control */
+#define RG_PHY_TOP_CTRL0	0x82C
+#define USXGMII_PN_SWAP_MASK	GENMASK(1, 0)
+#define USXGMII_PN_SWAP_RX	BIT(1)
+#define USXGMII_PN_SWAP_TX	BIT(0)
+
 /* Register to read PCS Link status */
 #define RG_PCS_RX_STATUS0	0x904
 #define RG_PCS_RX_STATUS_UPDATE	BIT(16)
@@ -1775,16 +1788,18 @@
 	struct mtk_eth		*eth;
 	struct regmap		*regmap;
 	struct regmap		*regmap_pextp;
-	spinlock_t		regmap_lock;
+	struct mutex		regmap_lock;
+	struct mutex		reset_lock;
 	phy_interface_t		interface;
 	__ETHTOOL_DECLARE_LINK_MODE_MASK(advertising);
-	unsigned long		link_poll_inband;
+	unsigned long		link_poll_expire;
 	unsigned int		mode;
 	u32			flags;
 	u32			ana_rgc3;
 	u32			polarity;
 	u8			id;
-	struct timer_list	link_poll_outband;
+	struct phylink_link_state	state;
+	struct delayed_work	link_poll;
 	struct phylink_pcs	pcs;
 };
 
@@ -1812,12 +1827,15 @@
 	struct mtk_eth		*eth;
 	struct regmap		*regmap;
 	struct regmap		*regmap_pextp;
-	spinlock_t		regmap_lock;
+	struct mutex		regmap_lock;
+	struct mutex		reset_lock;
 	phy_interface_t		interface;
-	unsigned long		link_poll_inband;
+	unsigned long		link_poll_expire;
 	unsigned int		mode;
+	u32			polarity;
 	u8			id;
-	struct timer_list	link_poll_outband;
+	struct phylink_link_state	state;
+	struct delayed_work	link_poll;
 	struct phylink_pcs	pcs;
 };
 
diff --git a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_hnat/hnat.c b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_hnat/hnat.c
index 011421c..d4f74c1 100644
--- a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_hnat/hnat.c
+++ b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_hnat/hnat.c
@@ -36,20 +36,24 @@
 void (*ra_sw_nat_clear_bind_entries)(void) = NULL;
 EXPORT_SYMBOL(ra_sw_nat_clear_bind_entries);
 
-int (*hnat_get_wdma_tx_port)(int wdma_idx) = NULL;
+int (*hnat_get_wdma_tx_port)(u32 wdma_idx) = NULL;
 EXPORT_SYMBOL(hnat_get_wdma_tx_port);
-int (*hnat_get_wdma_rx_port)(int wdma_idx) = NULL;
+int (*hnat_get_wdma_rx_port)(u32 wdma_idx) = NULL;
 EXPORT_SYMBOL(hnat_get_wdma_rx_port);
 
 int (*ppe_del_entry_by_mac)(unsigned char *mac) = NULL;
 EXPORT_SYMBOL(ppe_del_entry_by_mac);
+int (*ppe_del_entry_by_ip)(bool is_ipv4, void *addr) = NULL;
+EXPORT_SYMBOL(ppe_del_entry_by_ip);
+int (*ppe_del_entry_by_bssid_wcid)(u32 wdma_idx, u16 bssid, u16 wcid) = NULL;
+EXPORT_SYMBOL(ppe_del_entry_by_bssid_wcid);
 
 void (*ppe_dev_register_hook)(struct net_device *dev) = NULL;
 EXPORT_SYMBOL(ppe_dev_register_hook);
 void (*ppe_dev_unregister_hook)(struct net_device *dev) = NULL;
 EXPORT_SYMBOL(ppe_dev_unregister_hook);
 
-int (*hnat_set_wdma_pse_port_state)(int wdma_idx, int up) = NULL;
+int (*hnat_set_wdma_pse_port_state)(u32 wdma_idx, bool up) = NULL;
 EXPORT_SYMBOL(hnat_set_wdma_pse_port_state);
 
 static void hnat_sma_build_entry(struct timer_list *t)
@@ -144,7 +148,7 @@
 	}
 }
 
-static int mtk_get_wdma_tx_port(int wdma_idx)
+static int mtk_get_wdma_tx_port(u32 wdma_idx)
 {
 	if (wdma_idx == 0 || wdma_idx == 1 || wdma_idx == 2)
 		return NR_PPE0_PORT;
@@ -152,7 +156,7 @@
 	return -EINVAL;
 }
 
-static int mtk_get_wdma_rx_port(int wdma_idx)
+static int mtk_get_wdma_rx_port(u32 wdma_idx)
 {
 	if (wdma_idx == 2)
 		return NR_WDMA2_PORT;
@@ -164,20 +168,39 @@
 	return -EINVAL;
 }
 
-static int mtk_set_wdma_pse_port_state(int wdma_idx, int up)
+static int mtk_set_wdma_pse_port_state(u32 wdma_idx, bool up)
 {
-	u32 port = 0, link_dwn = 0;
+	int port;
 
 	port = mtk_get_wdma_rx_port(wdma_idx);
 	if (port < 0)
 		return -EINVAL;
 
-	link_dwn = 0x1 << (port - NR_WDMA0_PORT);
-	cr_set_field(hnat_priv->fe_base + MTK_FE_GLO_CFG(port), link_dwn, !up);
+	cr_set_field(hnat_priv->fe_base + MTK_FE_GLO_CFG(port),
+		     MTK_FE_LINK_DOWN_P((u32)port), !up);
 
 	return 0;
 }
 
+static int mtk_set_ppe_pse_port_state(u32 ppe_id, bool up)
+{
+	u32 port;
+
+	if (ppe_id == 0)
+		port = NR_PPE0_PORT;
+	else if (ppe_id == 1)
+		port = NR_PPE1_PORT;
+	else if (ppe_id == 2)
+		port = NR_PPE2_PORT;
+	else
+		return -EINVAL;
+
+	cr_set_field(hnat_priv->fe_base + MTK_FE_GLO_CFG(port),
+		     MTK_FE_LINK_DOWN_P(port), !up);
+
+	return 0;
+}
+
 void set_gmac_ppe_fwd(int id, int enable)
 {
 	void __iomem *reg;
@@ -241,6 +264,85 @@
 	return ret;
 }
 
+static int entry_ip_cmp(struct foe_entry *entry, bool is_ipv4, void *addr)
+{
+	struct in6_addr *tmp_ipv6;
+	struct in6_addr ipv6 = {0};
+	struct in6_addr foe_sipv6 = {0};
+	struct in6_addr foe_dipv6 = {0};
+	u32 *tmp_ipv4, ipv4;
+	u32 *sipv6_0 = NULL;
+	u32 *dipv6_0 = NULL;
+	int ret = 0;
+
+	if (is_ipv4) {
+		tmp_ipv4 = (u32 *)addr;
+		ipv4 = ntohl(*tmp_ipv4);
+
+		switch ((int)entry->bfib1.pkt_type) {
+		case IPV4_HNAPT:
+		case IPV4_HNAT:
+			if (entry->ipv4_hnapt.sip == ipv4 ||
+			    entry->ipv4_hnapt.new_dip == ipv4)
+				ret = 1;
+			break;
+		case IPV4_DSLITE:
+		case IPV4_MAP_E:
+			if (entry->ipv4_dslite.sip == ipv4 ||
+			    entry->ipv4_dslite.dip == ipv4)
+				ret = 1;
+			break;
+		default:
+			break;
+		}
+	} else {
+		memset(&foe_sipv6, 0, sizeof(struct in6_addr));
+		memset(&foe_dipv6, 0, sizeof(struct in6_addr));
+		memset(&ipv6, 0, sizeof(struct in6_addr));
+
+		tmp_ipv6 = (struct in6_addr *)addr;
+		ipv6.s6_addr32[0] = ntohl(tmp_ipv6->s6_addr32[0]);
+		ipv6.s6_addr32[1] = ntohl(tmp_ipv6->s6_addr32[1]);
+		ipv6.s6_addr32[2] = ntohl(tmp_ipv6->s6_addr32[2]);
+		ipv6.s6_addr32[3] = ntohl(tmp_ipv6->s6_addr32[3]);
+
+		switch ((int)entry->bfib1.pkt_type) {
+		case IPV6_3T_ROUTE:
+		case IPV6_5T_ROUTE:
+		case IPV6_6RD:
+			sipv6_0 = &(entry->ipv6_3t_route.ipv6_sip0);
+			dipv6_0 = &(entry->ipv6_3t_route.ipv6_dip0);
+			break;
+#if defined(CONFIG_MEDIATEK_NETSYS_V3)
+		case IPV6_HNAT:
+		case IPV6_HNAPT:
+			sipv6_0 = &(entry->ipv6_hnapt.ipv6_sip0);
+			dipv6_0 = &(entry->ipv6_hnapt.new_ipv6_ip0);
+			break;
+#endif
+		default:
+			break;
+		}
+
+		if (sipv6_0 && dipv6_0) {
+			memcpy(&foe_sipv6, sipv6_0, sizeof(struct in6_addr));
+			memcpy(&foe_dipv6, dipv6_0, sizeof(struct in6_addr));
+			if (!memcmp(&foe_sipv6, &ipv6, sizeof(struct in6_addr)) ||
+			    !memcmp(&foe_dipv6, &ipv6, sizeof(struct in6_addr)))
+				ret = 1;
+		}
+	}
+
+	if (ret && debug_level >= 2) {
+		if (is_ipv4)
+			pr_info("ipv4=%pI4\n", tmp_ipv4);
+		else
+			pr_info("ipv6=%pI6\n", tmp_ipv6);
+	}
+
+	return ret;
+}
+
 int entry_delete_by_mac(u8 *mac)
 {
 	struct foe_entry *entry = NULL;
@@ -265,6 +367,70 @@
 	return ret;
 }
 
+int entry_delete_by_ip(bool is_ipv4, void *addr)
+{
+	struct foe_entry *entry = NULL;
+	int index, i, ret = 0;
+
+	for (i = 0; i < CFG_PPE_NUM; i++) {
+		entry = hnat_priv->foe_table_cpu[i];
+		for (index = 0; index < DEF_ETRY_NUM; entry++, index++) {
+			if (entry->bfib1.state == BIND && entry_ip_cmp(entry, is_ipv4, addr)) {
+				memset(entry, 0, sizeof(*entry));
+				hnat_cache_ebl(1);
+				if (debug_level >= 2)
+					pr_info("delete entry idx = %d\n", index);
+				ret++;
+			}
+		}
+	}
+
+	if (!ret && debug_level >= 2)
+		pr_info("entry not found\n");
+
+	return ret;
+}
+
+static int entry_delete_by_bssid_wcid(u32 wdma_idx, u16 bssid, u16 wcid)
+{
+	struct foe_entry *entry = NULL;
+	int index, i;
+	int ret = 0;
+	int port;
+
+	port = mtk_get_wdma_rx_port(wdma_idx);
+
+	if (port < 0)
+		return -EINVAL;
+
+	for (i = 0; i < CFG_PPE_NUM; i++) {
+		entry = hnat_priv->foe_table_cpu[i];
+		for (index = 0; index < DEF_ETRY_NUM; entry++, index++) {
+			if (entry->bfib1.state != BIND)
+				continue;
+
+			if (IS_IPV4_GRP(entry)) {
+				if (entry->ipv4_hnapt.winfo.bssid != bssid ||
+				    entry->ipv4_hnapt.winfo.wcid != wcid ||
+				    entry->ipv4_hnapt.iblk2.dp != port)
+					continue;
+			} else {
+				if (entry->ipv6_5t_route.winfo.bssid != bssid ||
+				    entry->ipv6_5t_route.winfo.wcid != wcid ||
+				    entry->ipv6_5t_route.iblk2.dp != port)
+					continue;
+			}
+
+			memset(entry, 0, sizeof(*entry));
+			hnat_cache_ebl(1);
+			if (debug_level >= 2)
+				pr_info("delete entry idx = %d\n", index);
+			ret++;
+		}
+	}
+	return ret;
+}
+
 static void hnat_roam_handler(struct work_struct *work)
 {
 	struct kvec iov;
@@ -442,6 +608,8 @@
 	if (hnat_priv->data->version == MTK_HNAT_V3) {
 		cr_set_field(hnat_priv->ppe_base[ppe_id] + PPE_SB_FIFO_DBG,
 			     SB_MED_FULL_DRP_EN, 1);
+		cr_set_bits(hnat_priv->ppe_base[ppe_id] + PPE_GLO_CFG,
+			    NEW_IPV4_ID_INC_EN | TSID_EN);
 	}
 
 	/*enable ppe mib counter*/
@@ -668,6 +836,8 @@
 		return -1;
 
 	ppe_del_entry_by_mac = entry_delete_by_mac;
+	ppe_del_entry_by_ip = entry_delete_by_ip;
+	ppe_del_entry_by_bssid_wcid = entry_delete_by_bssid_wcid;
 	hook_toggle = 1;
 
 	return 0;
@@ -705,6 +875,8 @@
 
 	mod_timer(&hnat_priv->hnat_sma_build_entry_timer, jiffies + 3 * HZ);
 	ppe_del_entry_by_mac = NULL;
+	ppe_del_entry_by_ip = NULL;
+	ppe_del_entry_by_bssid_wcid = NULL;
 	hook_toggle = 0;
 
 	return 0;
@@ -713,6 +885,7 @@
 int hnat_warm_init(void)
 {
 	u32 foe_table_sz, foe_mib_tb_sz, ppe_id = 0;
+	int i;
 
 	unregister_netevent_notifier(&nf_hnat_netevent_nb);
 
@@ -738,6 +911,14 @@
 		hnat_hw_init(ppe_id);
 	}
 
+	/* The SER will enable all the PPE ports again,
+	 * so we have to manually disable the unused ports one more.
+	 */
+	for (i = 0; i < MAX_PPE_NUM; i++) {
+		if (i >= CFG_PPE_NUM)
+			mtk_set_ppe_pse_port_state(i, false);
+	}
+
 	set_gmac_ppe_fwd(NR_GMAC1_PORT, 1);
 	set_gmac_ppe_fwd(NR_GMAC2_PORT, 1);
 	set_gmac_ppe_fwd(NR_GMAC3_PORT, 1);
@@ -765,14 +946,18 @@
 	const struct of_device_id *match;
 
 	hnat_priv = devm_kzalloc(&pdev->dev, sizeof(struct mtk_hnat), GFP_KERNEL);
-	if (!hnat_priv)
-		return -ENOMEM;
+	if (!hnat_priv) {
+		err = -ENOMEM;
+		goto err_out2;
+	}
 
 	hnat_priv->foe_etry_num = DEF_ETRY_NUM;
 
 	match = of_match_device(of_hnat_match, &pdev->dev);
-	if (unlikely(!match))
-		return -EINVAL;
+	if (unlikely(!match)) {
+		err = -EINVAL;
+		goto err_out2;
+	}
 
 	hnat_priv->data = (struct mtk_hnat_data *)match->data;
 
@@ -780,8 +965,10 @@
 	np = hnat_priv->dev->of_node;
 
 	err = of_property_read_string(np, "mtketh-wan", &name);
-	if (err < 0)
-		return -EINVAL;
+	if (err < 0) {
+		err = -EINVAL;
+		goto err_out2;
+	}
 
 	strncpy(hnat_priv->wan, (char *)name, IFNAMSIZ - 1);
 	dev_info(&pdev->dev, "wan = %s\n", hnat_priv->wan);
@@ -810,8 +997,10 @@
 	/*get total gmac num in hnat*/
 	err = of_property_read_u32_index(np, "mtketh-max-gmac", 0, &val);
 
-	if (err < 0)
-		return -EINVAL;
+	if (err < 0) {
+		err = -EINVAL;
+		goto err_out2;
+	}
 
 	hnat_priv->gmac_num = val;
 
@@ -836,13 +1025,17 @@
 	dev_info(&pdev->dev, "ppe num = %d\n", hnat_priv->ppe_num);
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res)
-		return -ENOENT;
+	if (!res) {
+		err = -ENOENT;
+		goto err_out2;
+	}
 
 	hnat_priv->fe_base = devm_ioremap_nocache(&pdev->dev, res->start,
 					     res->end - res->start + 1);
-	if (!hnat_priv->fe_base)
-		return -EADDRNOTAVAIL;
+	if (!hnat_priv->fe_base) {
+		err = -EADDRNOTAVAIL;
+		goto err_out2;
+	}
 
 #if defined(CONFIG_MEDIATEK_NETSYS_V2) || defined(CONFIG_MEDIATEK_NETSYS_V3)
 	hnat_priv->ppe_base[0] = hnat_priv->fe_base + 0x2200;
@@ -858,7 +1051,7 @@
 
 	err = hnat_init_debugfs(hnat_priv);
 	if (err)
-		return err;
+		goto err_out2;
 
 	prop = of_find_property(np, "ext-devices", NULL);
 	for (name = of_prop_next_string(prop, NULL); name;
@@ -886,6 +1079,16 @@
 			goto err_out;
 	}
 
+	/* The PSE default enables all the PPE ports,
+	 * so we need to manually disable the unused ports.
+	 */
+	for (i = 0; i < MAX_PPE_NUM; i++) {
+		if (i >= CFG_PPE_NUM)
+			mtk_set_ppe_pse_port_state(i, false);
+		else
+			mtk_set_ppe_pse_port_state(i, true);
+	}
+
 	if (hnat_priv->data->whnat) {
 		err = whnat_adjust_nf_hooks();
 		if (err)
@@ -932,6 +1135,9 @@
 		ext_if_del(ext_entry);
 		kfree(ext_entry);
 	}
+err_out2:
+	for (i = 0; i < MAX_PPE_NUM; i++)
+		mtk_set_ppe_pse_port_state(i, false);
 	return err;
 }
 
@@ -950,6 +1156,9 @@
 	for (i = 0; i < CFG_PPE_NUM; i++)
 		hnat_stop(i);
 
+	for (i = 0; i < MAX_PPE_NUM; i++)
+		mtk_set_ppe_pse_port_state(i, false);
+
 	hnat_deinit_debugfs(hnat_priv);
 	hnat_release_netdev();
 	del_timer_sync(&hnat_priv->hnat_sma_build_entry_timer);
diff --git a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_hnat/hnat.h b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_hnat/hnat.h
index f7ca61c..c59e97e 100644
--- a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_hnat/hnat.h
+++ b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_hnat/hnat.h
@@ -17,6 +17,7 @@
 #include <linux/string.h>
 #include <linux/if.h>
 #include <linux/if_ether.h>
+#include <net/dsa.h>
 #include <net/netevent.h>
 #include <net/netfilter/nf_conntrack_zones.h>
 #include <linux/mod_devicetable.h>
@@ -192,6 +193,7 @@
 #define TTL0_DRP (0x1 << 4) /* RW */
 #define MCAST_TB_EN (0x1 << 7) /* RW */
 #define MCAST_HASH (0x3 << 12) /* RW */
+#define NEW_IPV4_ID_INC_EN (0x1 << 20) /* RW */
 #define SP_CMP_EN (0x1 << 25) /* RW */
 
 #define MC_P3_PPSE (0xf << 12) /* RW */
@@ -1286,30 +1288,19 @@
 		hnat_set_entry_lock(entry, false);
 }
 
-#if defined(CONFIG_NET_DSA_MT7530)
-u32 hnat_dsa_fill_stag(const struct net_device *netdev,
+int hnat_dsa_fill_stag(const struct net_device *netdev,
 		       struct foe_entry *entry,
 		       struct flow_offload_hw_path *hw_path,
 		       u16 eth_proto, int mape);
-
+int hnat_dsa_get_port(struct net_device **dev);
 static inline bool hnat_dsa_is_enable(struct mtk_hnat *priv)
 {
+#if defined(CONFIG_NET_DSA)
 	return (priv->wan_dsa_port != NONE_DSA_PORT);
-}
 #else
-static inline u32 hnat_dsa_fill_stag(const struct net_device *netdev,
-				     struct foe_entry *entry,
-				     struct flow_offload_hw_path *hw_path,
-				     u16 eth_proto, int mape)
-{
-	return 0;
-}
-
-static inline bool hnat_dsa_is_enable(struct mtk_hnat *priv)
-{
 	return false;
-}
 #endif
+}
 
 void hnat_deinit_debugfs(struct mtk_hnat *h);
 int hnat_init_debugfs(struct mtk_hnat *h);
@@ -1350,6 +1341,7 @@
 void set_gmac_ppe_fwd(int gmac_no, int enable);
 int entry_detail(u32 ppe_id, int index);
 int entry_delete_by_mac(u8 *mac);
+int entry_delete_by_ip(bool is_ipv4, void *addr);
 int entry_delete(u32 ppe_id, int index);
 int hnat_warm_init(void);
 u32 hnat_get_ppe_hash(struct foe_entry *entry);
diff --git a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_hnat/hnat_debugfs.c b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_hnat/hnat_debugfs.c
index 3e0d540..53f4d10 100644
--- a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_hnat/hnat_debugfs.c
+++ b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_hnat/hnat_debugfs.c
@@ -324,6 +324,9 @@
 	pr_info("              6   <entry_idx>  Show PPE2 specific foe entry info. of assigned <entry_idx>\n");
 	pr_info("              7   <entry_idx>  Delete PPE2 specific foe entry of assigned <entry_idx>\n");
 	pr_info("                               When entry_idx is -1, clear all entries\n");
+	pr_info("              8   <mac>        Delete all PPEs foe entry of assinged smac and dmac\n");
+	pr_info("              9   <ip>         Delete all PPEs foe entry of assinged IP(DL and UL)\n");
+	pr_info("              10  <ipV6>       Delete all PPEs foe entry of assinged IPv6(DL and UL)\n");
 
 	return 0;
 }
@@ -743,6 +746,66 @@
 }
 EXPORT_SYMBOL(entry_delete);
 
+static u32 hnat_char2hex(const char c)
+{
+	switch (c) {
+	case '0'...'9':
+		return 0x0 + (c - '0');
+	case 'a'...'f':
+		return 0xa + (c - 'a');
+	case 'A'...'F':
+		return 0xa + (c - 'A');
+	default:
+		pr_info("MAC format error\n");
+		return 0;
+	}
+}
+
+static void hnat_parse_mac(char *str, char *mac)
+{
+	int i;
+
+	for (i = 0; i < ETH_ALEN; i++) {
+		mac[i] = (hnat_char2hex(str[i * 3]) << 4) +
+			 (hnat_char2hex(str[i * 3 + 1]));
+	}
+}
+
+int delete_entry_by_mac(char *mac_str)
+{
+	char mac[6];
+
+	hnat_parse_mac(mac_str, mac);
+	entry_delete_by_mac(mac);
+
+	return 0;
+}
+
+int delete_entry_by_ip(bool is_ipv4, char *str)
+{
+	struct in6_addr ipv6;
+	void *addr = NULL;
+	u32 ipv4;
+
+	if (is_ipv4) {
+		if (!in4_pton(str, -1, (u8 *)&ipv4, -1, NULL)) {
+			pr_info("Invalid IPv4 address.\n");
+			return -EINVAL;
+		}
+		addr = (void *)(&ipv4);
+	} else {
+		if (!in6_pton(str, -1, (u8 *)&ipv6, -1, NULL)) {
+			pr_info("Invalid IPv6 address.\n");
+			return -EINVAL;
+		}
+		addr = (void *)(&ipv6);
+	}
+
+	entry_delete_by_ip(is_ipv4, addr);
+
+	return 0;
+}
+
 int cr_set_usage(int level)
 {
 	debug_level = level;
@@ -1893,6 +1956,7 @@
 	char *p_token = NULL;
 	char *p_delimiter = " \t";
 	int ret;
+	bool is_ipv4 = true;
 
 	if (len >= sizeof(buf)) {
 		pr_info("input handling fail!\n");
@@ -1925,16 +1989,32 @@
 			arg1 = 0;
 		else
 			ret = kstrtol(p_token, 10, &arg1);
+
+		(*entry_set_func[arg0])(arg1);
+		break;
+	case 8:
+		p_token = strsep(&p_buf, p_delimiter);
+		if (!p_token)
+			break;
+
+		delete_entry_by_mac(p_token);
+		break;
+	case 9:
+	case 10:
+		p_token = strsep(&p_buf, p_delimiter);
+		if (!p_token)
+			break;
+
+		if (arg0 == 10)
+			is_ipv4 = false;
+		delete_entry_by_ip(is_ipv4, p_token);
 		break;
 	default:
 		pr_info("no handler defined for command id(0x%08lx)\n\r", arg0);
-		arg0 = 0;
-		arg1 = 0;
+		entry_set_usage(debug_level);
 		break;
 	}
 
-	(*entry_set_func[arg0])(arg1);
-
 	return len;
 }
 
@@ -3049,31 +3129,6 @@
 	return hash;
 }
 
-static u32 hnat_char2hex(const char c)
-{
-	switch (c) {
-	case '0'...'9':
-		return 0x0 + (c - '0');
-	case 'a'...'f':
-		return 0xa + (c - 'a');
-	case 'A'...'F':
-		return 0xa + (c - 'A');
-	default:
-		pr_info("MAC format error\n");
-		return 0;
-	}
-}
-
-static void hnat_parse_mac(char *str, char *mac)
-{
-	int i;
-
-	for (i = 0; i < ETH_ALEN; i++) {
-		mac[i] = (hnat_char2hex(str[i * 3]) << 4) +
-			 (hnat_char2hex(str[i * 3 + 1]));
-	}
-}
-
 static void hnat_static_entry_help(void)
 {
 	pr_info("-------------------- Usage --------------------\n");
diff --git a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_hnat/hnat_nf_hook.c b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_hnat/hnat_nf_hook.c
index cbebcd4..6960462 100644
--- a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_hnat/hnat_nf_hook.c
+++ b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_hnat/hnat_nf_hook.c
@@ -843,7 +843,7 @@
 mtk_hnat_ipv4_nf_pre_routing(void *priv, struct sk_buff *skb,
 			     const struct nf_hook_state *state)
 {
-	struct flow_offload_hw_path hw_path;
+	struct flow_offload_hw_path hw_path = { 0 };
 
 	if (!skb)
 		goto drop;
@@ -998,7 +998,7 @@
 	return NF_DROP;
 }
 
-static unsigned int hnat_ipv6_get_nexthop(struct sk_buff *skb,
+static int hnat_ipv6_get_nexthop(struct sk_buff *skb,
 					  const struct net_device *out,
 					  struct flow_offload_hw_path *hw_path)
 {
@@ -1056,7 +1056,7 @@
 	return 0;
 }
 
-static unsigned int hnat_ipv4_get_nexthop(struct sk_buff *skb,
+static int hnat_ipv4_get_nexthop(struct sk_buff *skb,
 					  const struct net_device *out,
 					  struct flow_offload_hw_path *hw_path)
 {
@@ -1065,10 +1065,13 @@
 	struct dst_entry *dst = skb_dst(skb);
 	struct rtable *rt = (struct rtable *)dst;
 	struct net_device *dev = (__force struct net_device *)out;
+	struct ethhdr *eth;
 
 	if (hw_path->flags & FLOW_OFFLOAD_PATH_PPPOE) {
+		rcu_read_lock_bh();
 		memcpy(eth_hdr(skb)->h_source, hw_path->eth_src, ETH_ALEN);
 		memcpy(eth_hdr(skb)->h_dest, hw_path->eth_dest, ETH_ALEN);
+		rcu_read_unlock_bh();
 		return 0;
 	}
 
@@ -1088,8 +1091,15 @@
 		return -1;
 	}
 
+	if (ip_hdr(skb)->protocol == IPPROTO_IPV6)
+		/* 6RD LAN->WAN(6to4) */
+		eth = (struct ethhdr *)(skb->data - ETH_HLEN);
+	else
+		eth = eth_hdr(skb);
+
-	memcpy(eth_hdr(skb)->h_dest, neigh->ha, ETH_ALEN);
-	memcpy(eth_hdr(skb)->h_source, out->dev_addr, ETH_ALEN);
+	memcpy(eth->h_dest, neigh->ha, ETH_ALEN);
+	memcpy(eth->h_source, out->dev_addr, ETH_ALEN);
+	eth->h_proto = htons(ETH_P_IP);
 
 	rcu_read_unlock_bh();
 
@@ -1224,8 +1234,10 @@
 				     struct foe_entry *foe,
 				     struct flow_offload_hw_path *hw_path)
 {
+	struct net_device *master_dev = (struct net_device *)dev;
 	struct foe_entry entry = { 0 };
 	int whnat = IS_WHNAT(dev);
+	struct mtk_mac *mac;
 	struct ethhdr *eth;
 	struct iphdr *iph;
 	struct ipv6hdr *ip6h;
@@ -1235,15 +1247,17 @@
 	enum ip_conntrack_info ctinfo;
 	int gmac = NR_DISCARD;
 	int udp = 0;
+	int port_id = 0;
 	u32 qid = 0;
-	u32 port_id = 0;
 	u32 payload_len = 0;
 	int mape = 0;
-	struct mtk_mac *mac = netdev_priv(dev);
 
 	if (ipv6_hdr(skb)->nexthdr == NEXTHDR_IPIP)
 		/* point to ethernet header for DS-Lite and MapE */
 		eth = get_ipv6_ipip_ethhdr(skb, hw_path);
+	else if (ip_hdr(skb)->protocol == IPPROTO_IPV6)
+		/* 6RD LAN->WAN(6to4) */
+		eth = (struct ethhdr *)(skb->data - ETH_HLEN);
 	else
 		eth = eth_hdr(skb);
 
@@ -1381,6 +1395,44 @@
 			entry.ipv4_hnapt.bfib1.udp = udp;
 			break;
 
+		case IPPROTO_IPV6:
+			/* 6RD LAN->WAN(6to4) */
+			if (entry.bfib1.pkt_type == IPV6_6RD) {
+				entry.ipv6_6rd.ipv6_sip0 = foe->ipv6_6rd.ipv6_sip0;
+				entry.ipv6_6rd.ipv6_sip1 = foe->ipv6_6rd.ipv6_sip1;
+				entry.ipv6_6rd.ipv6_sip2 = foe->ipv6_6rd.ipv6_sip2;
+				entry.ipv6_6rd.ipv6_sip3 = foe->ipv6_6rd.ipv6_sip3;
+
+				entry.ipv6_6rd.ipv6_dip0 = foe->ipv6_6rd.ipv6_dip0;
+				entry.ipv6_6rd.ipv6_dip1 = foe->ipv6_6rd.ipv6_dip1;
+				entry.ipv6_6rd.ipv6_dip2 = foe->ipv6_6rd.ipv6_dip2;
+				entry.ipv6_6rd.ipv6_dip3 = foe->ipv6_6rd.ipv6_dip3;
+
+				entry.ipv6_6rd.sport = foe->ipv6_6rd.sport;
+				entry.ipv6_6rd.dport = foe->ipv6_6rd.dport;
+				entry.ipv6_6rd.tunnel_sipv4 = ntohl(iph->saddr);
+				entry.ipv6_6rd.tunnel_dipv4 = ntohl(iph->daddr);
+				entry.ipv6_6rd.hdr_chksum = ppe_get_chkbase(iph);
+				entry.ipv6_6rd.flag = (ntohs(iph->frag_off) >> 13);
+				entry.ipv6_6rd.ttl = iph->ttl;
+				entry.ipv6_6rd.dscp = iph->tos;
+				entry.ipv6_6rd.per_flow_6rd_id = 1;
+				entry.ipv6_6rd.vlan1 = hw_path->vlan_id;
+				if (hnat_priv->data->per_flow_accounting)
+					entry.ipv6_6rd.iblk2.mibf = 1;
+
+				ip6h = (struct ipv6hdr *)skb_inner_network_header(skb);
+				if (ip6h->nexthdr == NEXTHDR_UDP)
+					entry.ipv6_6rd.bfib1.udp = 1;
+
+#if defined(CONFIG_MEDIATEK_NETSYS_V3)
+				entry.ipv6_6rd.eg_keep_ecn = 1;
+				entry.ipv6_6rd.eg_keep_cls = 1;
+#endif
+				break;
+			}
+
+			return -1;
 		default:
 			return -1;
 		}
@@ -1640,41 +1692,7 @@
 		break;
 
 	default:
-		iph = ip_hdr(skb);
-		switch (entry.bfib1.pkt_type) {
-		case IPV6_6RD: /* 6RD LAN->WAN */
-			entry.ipv6_6rd.ipv6_sip0 = foe->ipv6_6rd.ipv6_sip0;
-			entry.ipv6_6rd.ipv6_sip1 = foe->ipv6_6rd.ipv6_sip1;
-			entry.ipv6_6rd.ipv6_sip2 = foe->ipv6_6rd.ipv6_sip2;
-			entry.ipv6_6rd.ipv6_sip3 = foe->ipv6_6rd.ipv6_sip3;
-
-			entry.ipv6_6rd.ipv6_dip0 = foe->ipv6_6rd.ipv6_dip0;
-			entry.ipv6_6rd.ipv6_dip1 = foe->ipv6_6rd.ipv6_dip1;
-			entry.ipv6_6rd.ipv6_dip2 = foe->ipv6_6rd.ipv6_dip2;
-			entry.ipv6_6rd.ipv6_dip3 = foe->ipv6_6rd.ipv6_dip3;
-
-			entry.ipv6_6rd.sport = foe->ipv6_6rd.sport;
-			entry.ipv6_6rd.dport = foe->ipv6_6rd.dport;
-			entry.ipv6_6rd.tunnel_sipv4 = ntohl(iph->saddr);
-			entry.ipv6_6rd.tunnel_dipv4 = ntohl(iph->daddr);
-			entry.ipv6_6rd.hdr_chksum = ppe_get_chkbase(iph);
-			entry.ipv6_6rd.flag = (ntohs(iph->frag_off) >> 13);
-			entry.ipv6_6rd.ttl = iph->ttl;
-			entry.ipv6_6rd.dscp = iph->tos;
-			entry.ipv6_6rd.per_flow_6rd_id = 1;
-			entry.ipv6_6rd.vlan1 = hw_path->vlan_id;
-			if (hnat_priv->data->per_flow_accounting)
-				entry.ipv6_6rd.iblk2.mibf = 1;
-
-#if defined(CONFIG_MEDIATEK_NETSYS_V3)
-			entry.ipv6_6rd.eg_keep_ecn = 1;
-			entry.ipv6_6rd.eg_keep_cls = 1;
-#endif
-			break;
-
-		default:
-			return -1;
-		}
+		return -1;
 	}
 
 	/* Fill Layer2 Info.*/
@@ -1683,33 +1701,25 @@
 	/* Fill Info Blk*/
 	entry = ppe_fill_info_blk(eth, entry, hw_path);
 
-	if (IS_LAN(dev)) {
-		if (IS_BOND_MODE) {
-			gmac = ((skb_hnat_entry(skb) >> 1) % hnat_priv->gmac_num) ?
-				 NR_GMAC2_PORT : NR_GMAC1_PORT;
-		} else if (IS_DSA_LAN(dev)) {
-			port_id = hnat_dsa_fill_stag(dev, &entry, hw_path,
-						     ntohs(eth->h_proto),
-						     mape);
-			gmac = NR_GMAC1_PORT;
-		} else {
-			gmac = HNAT_GMAC_FP(mac->id);
+	if (IS_LAN_GRP(dev) || IS_WAN(dev)) { /* Forward to GMAC Ports */
+		port_id = hnat_dsa_get_port(&master_dev);
+		if (port_id >= 0) {
+			if (hnat_dsa_fill_stag(dev, &entry, hw_path,
+					       ntohs(eth->h_proto), mape) < 0)
+				return 0;
 		}
-	} else if (IS_LAN2(dev)) {
+
+		mac = netdev_priv(master_dev);
 		gmac = HNAT_GMAC_FP(mac->id);
-	} else if (IS_WAN(dev)) {
-		if (mape_toggle && mape == 1) {
+
+		if (IS_LAN(dev) && IS_BOND_MODE) {
+			gmac = ((skb_hnat_entry(skb) >> 1) % hnat_priv->gmac_num) ?
+				 NR_GMAC2_PORT : NR_GMAC1_PORT;
+		} else if (IS_WAN(dev) && mape_toggle && mape == 1) {
 			gmac = NR_PDMA_PORT;
 			/* Set act_dp = wan_dev */
 			entry.ipv4_hnapt.act_dp &= ~UDF_PINGPONG_IFIDX;
 			entry.ipv4_hnapt.act_dp |= dev->ifindex & UDF_PINGPONG_IFIDX;
-		} else if (IS_DSA_WAN(dev)) {
-			port_id = hnat_dsa_fill_stag(dev, &entry, hw_path,
-						     ntohs(eth->h_proto),
-						     mape);
-			gmac = NR_GMAC1_PORT;
-		} else {
-			gmac = HNAT_GMAC_FP(mac->id);
 		}
 	} else if (IS_EXT(dev) && (FROM_GE_PPD(skb) || FROM_GE_LAN_GRP(skb) ||
 		   FROM_GE_WAN(skb) || FROM_GE_VIRTUAL(skb) || FROM_WED(skb))) {
@@ -1931,7 +1941,7 @@
 		/* We must ensure all info has been updated before set to hw */
 		wmb();
 		/* After other fields have been written, write info1 to BIND the entry */
-		foe->bfib1 = entry.bfib1;
+		memcpy(&foe->bfib1, &entry.bfib1, sizeof(entry.bfib1));
 
 		/* reset statistic for this entry */
 		if (hnat_priv->data->per_flow_accounting &&
@@ -2240,7 +2250,7 @@
 	/* We must ensure all info has been updated before set to hw */
 	wmb();
 	/* After other fields have been written, write info1 to BIND the entry */
-	hw_entry->bfib1 = entry.bfib1;
+	memcpy(&hw_entry->bfib1, &entry.bfib1, sizeof(entry.bfib1));
 
 	hnat_set_entry_lock(hw_entry, false);
 
@@ -2748,8 +2758,8 @@
 
 static unsigned int mtk_hnat_nf_post_routing(
 	struct sk_buff *skb, const struct net_device *out,
-	unsigned int (*fn)(struct sk_buff *, const struct net_device *,
-			   struct flow_offload_hw_path *),
+	int (*fn)(struct sk_buff *, const struct net_device *,
+		  struct flow_offload_hw_path *),
 	const char *func)
 {
 	struct foe_entry *entry;
diff --git a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_hnat/hnat_stag.c b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_hnat/hnat_stag.c
index 75c3a75..d8e5709 100644
--- a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_hnat/hnat_stag.c
+++ b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_hnat/hnat_stag.c
@@ -6,58 +6,77 @@
 
 #include <linux/of_device.h>
 #include <net/netfilter/nf_flow_table.h>
+
 #include "hnat.h"
 
+int hnat_dsa_get_port(struct net_device **dev)
+{
+#if defined(CONFIG_NET_DSA)
+	struct dsa_port *dp;
+
+	dp = dsa_port_from_netdev(*dev);
+	if (IS_ERR(dp))
+		return -ENODEV;
+
+	*dev = dp->cpu_dp->master;
+
+	return dp->index;
+#else
+	return -ENODEV;
+#endif
+}
+
-u32 hnat_dsa_fill_stag(const struct net_device *netdev,
+int hnat_dsa_fill_stag(const struct net_device *netdev,
 		       struct foe_entry *entry,
 		       struct flow_offload_hw_path *hw_path,
 		       u16 eth_proto,
 		       int mape)
 {
-	const struct net_device *ndev;
+#if defined(CONFIG_NET_DSA)
 	const unsigned int *port_reg;
+	const struct dsa_port *dp;
+	struct net_device *ndev;
 	int port_index;
-	u16 sp_tag;
+	u16 dsa_tag;
 
 	if (hw_path->flags & FLOW_OFFLOAD_PATH_VLAN)
 		ndev = hw_path->dev;
 	else
-		ndev = netdev;
+		ndev = (struct net_device *)netdev;
 
 	port_reg = of_get_property(ndev->dev.of_node, "reg", NULL);
 	if (unlikely(!port_reg))
 		return -EINVAL;
 
 	port_index = be32_to_cpup(port_reg);
-	sp_tag = BIT(port_index);
+
+	/* In the case MAPE LAN --> WAN, binding entry is to CPU.
+	 * Do not add special tag.
+	 */
+	if (IS_WAN(ndev) && mape)
+		return port_index;
+
+	dp = dsa_port_from_netdev(ndev);
+	if (IS_ERR(dp))
+		return -ENODEV;
+
+	dsa_tag = BIT(port_index);
 
 	if (!entry->bfib1.vlan_layer)
 		entry->bfib1.vlan_layer = 1;
 	else
 		/* VLAN existence indicator */
-		sp_tag |= BIT(8);
-	entry->bfib1.vpm = 0;
+		dsa_tag |= BIT(8);
 
-	switch (eth_proto) {
-	case ETH_P_IP:
-		if (entry->ipv4_hnapt.bfib1.pkt_type == IPV4_DSLITE
-			|| (entry->ipv4_hnapt.bfib1.pkt_type == IPV4_MAP_E))
-			entry->ipv4_dslite.etype = sp_tag;
-		else
-			entry->ipv4_hnapt.etype = sp_tag;
-		break;
-	case ETH_P_IPV6:
-		/* In the case MAPE LAN --> WAN, binding entry is to CPU.
-		 * Do not add special tag.
-		 */
-		if (!mape)
-			/* etype offset of ipv6 entries are the same. */
-			entry->ipv6_5t_route.etype = sp_tag;
+	if (IS_IPV4_GRP(entry))
+		entry->ipv4_hnapt.etype = dsa_tag;
+	else
+		entry->ipv6_5t_route.etype = dsa_tag;
 
-		break;
-	default:
-		pr_info("DSA + HNAT unsupport protocol\n");
-	}
+	entry->bfib1.vpm = 0;
 
 	return port_index;
+#else
+	return -EINVAL;
+#endif
 }
diff --git a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_sgmii.c b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_sgmii.c
index 8ae7608..51a9b1f 100755
--- a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_sgmii.c
+++ b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_sgmii.c
@@ -77,18 +77,70 @@
 {
 	unsigned int val;
 
+	mutex_lock(&mpcs->reset_lock);
+
 	regmap_read(mpcs->regmap, SGMSYS_PCS_CONTROL_1, &val);
 
+	mutex_unlock(&mpcs->reset_lock);
+
 	return FIELD_GET(SGMII_LINK_STATYS, val);
 }
 
+static void mtk_sgmii_get_state(struct mtk_sgmii_pcs *mpcs)
+{
+	struct phylink_link_state *state = &mpcs->state;
+	unsigned int bm, adv, rgc3, sgm_mode;
+
+	mutex_lock(&mpcs->reset_lock);
+
+	state->interface = mpcs->interface;
+
+	regmap_read(mpcs->regmap, SGMSYS_PCS_CONTROL_1, &bm);
+	if (bm & SGMII_AN_ENABLE) {
+		regmap_read(mpcs->regmap, SGMSYS_PCS_ADVERTISE, &adv);
+
+		phylink_mii_c22_pcs_decode_state(state,
+						 FIELD_GET(SGMII_BMSR, bm),
+						 FIELD_GET(SGMII_LPA, adv));
+	} else {
+		state->link = !!(bm & SGMII_LINK_STATYS);
+
+		regmap_read(mpcs->regmap, SGMSYS_SGMII_MODE, &sgm_mode);
+
+		switch (sgm_mode & SGMII_SPEED_MASK) {
+		case SGMII_SPEED_10:
+			state->speed = SPEED_10;
+			break;
+		case SGMII_SPEED_100:
+			state->speed = SPEED_100;
+			break;
+		case SGMII_SPEED_1000:
+			regmap_read(mpcs->regmap, mpcs->ana_rgc3, &rgc3);
+			rgc3 = FIELD_GET(RG_PHY_SPEED_3_125G, rgc3);
+			state->speed = rgc3 ? SPEED_2500 : SPEED_1000;
+			break;
+		}
+
+		if (sgm_mode & SGMII_DUPLEX_HALF)
+			state->duplex = DUPLEX_HALF;
+		else
+			state->duplex = DUPLEX_FULL;
+	}
+
+	mutex_unlock(&mpcs->reset_lock);
+}
+
-void mtk_sgmii_reset(struct mtk_eth *eth, int id)
+void mtk_sgmii_reset(struct mtk_sgmii_pcs *mpcs)
 {
+	struct mtk_eth *eth = mpcs->eth;
+	int id = mpcs->id;
 	u32 val = 0;
 
-	if (!eth->toprgu)
+	if (id >= MTK_MAX_DEVS || !eth->toprgu)
 		return;
 
+	mutex_lock(&mpcs->reset_lock);
+
 	switch (id) {
 	case 0:
 		/* Enable software reset */
@@ -104,7 +156,7 @@
 		       SWSYSRST_SGMII0_GRST;
 		regmap_write(eth->toprgu, TOPRGU_SWSYSRST, val);
 
-		udelay(100);
+		usleep_range(100, 500);
 
 		/* De-assert SGMII reset */
 		regmap_read(eth->toprgu, TOPRGU_SWSYSRST, &val);
@@ -133,7 +185,7 @@
 		       SWSYSRST_SGMII1_GRST;
 		regmap_write(eth->toprgu, TOPRGU_SWSYSRST, val);
 
-		udelay(100);
+		usleep_range(100, 500);
 
 		/* De-assert SGMII reset */
 		regmap_read(eth->toprgu, TOPRGU_SWSYSRST, &val);
@@ -150,7 +202,9 @@
 		break;
 	}
 
+	mutex_unlock(&mpcs->reset_lock);
+
-	mdelay(1);
+	usleep_range(10000, 11000);
 }
 
 void mtk_sgmii_setup_phya_gen1(struct mtk_sgmii_pcs *mpcs)
@@ -210,7 +264,7 @@
 	/* Force AEQ on */
 	regmap_update_bits(mpcs->regmap_pextp, 0x0070, GENMASK(31, 0),
 			   0x02002800);
-	ndelay(1020);
+	usleep_range(1, 5);
 	regmap_update_bits(mpcs->regmap_pextp, 0x3040, GENMASK(31, 0),
 			   0x20000000);
 	/* Setup DA default value */
@@ -241,28 +295,28 @@
 	/* Release reset */
 	regmap_update_bits(mpcs->regmap_pextp, 0x0070, GENMASK(31, 0),
 			   0x0200E800);
-	udelay(150);
+	usleep_range(150, 500);
 	/* Switch to P0 */
 	regmap_update_bits(mpcs->regmap_pextp, 0x0070, GENMASK(31, 0),
 			   0x0200C111);
-	ndelay(1020);
+	usleep_range(1, 5);
 	regmap_update_bits(mpcs->regmap_pextp, 0x0070, GENMASK(31, 0),
 			   0x0200C101);
-	udelay(15);
+	usleep_range(15, 50);
 	/* Switch to Gen2 */
 	regmap_update_bits(mpcs->regmap_pextp, 0x0070, GENMASK(31, 0),
 			   0x0201C111);
-	ndelay(1020);
+	usleep_range(1, 5);
 	regmap_update_bits(mpcs->regmap_pextp, 0x0070, GENMASK(31, 0),
 			   0x0201C101);
-	udelay(100);
+	usleep_range(100, 500);
 	regmap_update_bits(mpcs->regmap_pextp, 0x30B0, GENMASK(31, 0),
 			   0x00000030);
 	regmap_update_bits(mpcs->regmap_pextp, 0x00F4, GENMASK(31, 0),
 			   0x80201F01);
 	regmap_update_bits(mpcs->regmap_pextp, 0x3040, GENMASK(31, 0),
 			   0x30000000);
-	udelay(400);
+	usleep_range(400, 1000);
 }
 
 void mtk_sgmii_setup_phya_gen2(struct mtk_sgmii_pcs *mpcs)
@@ -322,7 +376,7 @@
 	/* Force AEQ on */
 	regmap_update_bits(mpcs->regmap_pextp, 0x0070, GENMASK(31, 0),
 			   0x02002800);
-	ndelay(1020);
+	usleep_range(1, 5);
 	regmap_update_bits(mpcs->regmap_pextp, 0x3040, GENMASK(31, 0),
 			   0x20000000);
 	/* Setup DA default value */
@@ -351,28 +405,28 @@
 	/* Release reset */
 	regmap_update_bits(mpcs->regmap_pextp, 0x0070, GENMASK(31, 0),
 			   0x0200E800);
-	udelay(150);
+	usleep_range(150, 500);
 	/* Switch to P0 */
 	regmap_update_bits(mpcs->regmap_pextp, 0x0070, GENMASK(31, 0),
 			   0x0200C111);
-	ndelay(1020);
+	usleep_range(1, 5);
 	regmap_update_bits(mpcs->regmap_pextp, 0x0070, GENMASK(31, 0),
 			   0x0200C101);
-	udelay(15);
+	usleep_range(15, 50);
 	/* Switch to Gen2 */
 	regmap_update_bits(mpcs->regmap_pextp, 0x0070, GENMASK(31, 0),
 			   0x0201C111);
-	ndelay(1020);
+	usleep_range(1, 5);
 	regmap_update_bits(mpcs->regmap_pextp, 0x0070, GENMASK(31, 0),
 			   0x0201C101);
-	udelay(100);
+	usleep_range(100, 500);
 	regmap_update_bits(mpcs->regmap_pextp, 0x30B0, GENMASK(31, 0),
 			   0x00000030);
 	regmap_update_bits(mpcs->regmap_pextp, 0x00F4, GENMASK(31, 0),
 			   0x80201F01);
 	regmap_update_bits(mpcs->regmap_pextp, 0x3040, GENMASK(31, 0),
 			   0x30000000);
-	udelay(400);
+	usleep_range(400, 1000);
 }
 
 static int mtk_sgmii_pcs_config(struct phylink_pcs *pcs, unsigned int mode,
@@ -391,8 +445,6 @@
 	if (advertise < 0)
 		return advertise;
 
-	spin_lock(&mpcs->regmap_lock);
-
 	/* Clearing IF_MODE_BIT0 switches the PCS to BASE-X mode, and
 	 * we assume that fixes it's speed at bitrate = line rate (in
 	 * other words, 1000Mbps or 2500Mbps).
@@ -416,22 +468,22 @@
 			speed = SGMII_SPEED_1000;
 	}
 
-	if (mpcs->interface != interface) {
-		mpcs->interface = interface;
-		mpcs->mode = mode;
-		linkmode_copy(mpcs->advertising, advertising);
-		mode_changed = true;
-	}
-
 	link_timer = phylink_get_link_timer_ns(interface);
-	if (link_timer < 0) {
-		spin_unlock(&mpcs->regmap_lock);
+	if (link_timer < 0)
 		return link_timer;
-	}
 
 	if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V3)) {
 		mtk_sgmii_xfi_pll_enable(eth->sgmii);
-		mtk_sgmii_reset(eth, mpcs->id);
+		mtk_sgmii_reset(mpcs);
+	}
+
+	mutex_lock(&mpcs->regmap_lock);
+
+	if (mode >= 0 && mpcs->interface != interface) {
+		mpcs->interface = interface;
+		mpcs->mode = mode;
+		linkmode_copy(mpcs->advertising, advertising);
+		mode_changed = true;
 	}
 
 	/* PHYA power down */
@@ -474,7 +526,7 @@
 			   SGMII_AN_ENABLE, bmcr);
 
 	/* Release PHYA power down state */
-	udelay(100);
+	usleep_range(50, 100);
 	regmap_write(mpcs->regmap, SGMSYS_QPHY_PWR_STATE_CTRL, 0);
 
 	if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V3)) {
@@ -484,32 +536,38 @@
 			mtk_sgmii_setup_phya_gen1(mpcs);
 	}
 
-	spin_unlock(&mpcs->regmap_lock);
+	mutex_unlock(&mpcs->regmap_lock);
 
 	return changed || mode_changed;
 }
 
-static void mtk_sgmii_pcs_link_poll(struct timer_list *t)
+static void mtk_sgmii_pcs_link_poll(struct work_struct *work)
 {
-	struct mtk_sgmii_pcs *mpcs = from_timer(mpcs, t, link_poll_outband);
+	struct mtk_sgmii_pcs *mpcs = container_of(work, struct mtk_sgmii_pcs,
+						  link_poll.work);
 
-	if (mpcs->interface == PHY_INTERFACE_MODE_NA)
+	if (mpcs->interface != PHY_INTERFACE_MODE_SGMII &&
+	    mpcs->interface != PHY_INTERFACE_MODE_1000BASEX &&
+	    mpcs->interface != PHY_INTERFACE_MODE_2500BASEX)
 		goto exit;
 
 	if (!mtk_sgmii_link_status(mpcs))
-		mtk_sgmii_pcs_config(&mpcs->pcs, mpcs->mode, mpcs->interface,
+		mtk_sgmii_pcs_config(&mpcs->pcs, -1, mpcs->interface,
 				     mpcs->advertising, false);
 
 exit:
-	if (mpcs->mode != MLO_AN_INBAND)
-		mod_timer(&mpcs->link_poll_outband, jiffies + HZ);
+	if (mpcs->mode == MLO_AN_INBAND)
+		mtk_sgmii_get_state(mpcs);
+	else if (!delayed_work_pending(&mpcs->link_poll))
+		schedule_delayed_work(&mpcs->link_poll, msecs_to_jiffies(1000));
 }
 
 static int mtk_sgmii_pcs_enable(struct phylink_pcs *pcs)
 {
 	struct mtk_sgmii_pcs *mpcs = pcs_to_mtk_sgmii_pcs(pcs);
 
-	mod_timer(&mpcs->link_poll_outband, jiffies + HZ);
+	if (!delayed_work_pending(&mpcs->link_poll))
+		schedule_delayed_work(&mpcs->link_poll, msecs_to_jiffies(1000));
 
 	return 0;
 }
@@ -518,58 +576,34 @@
 {
 	struct mtk_sgmii_pcs *mpcs = pcs_to_mtk_sgmii_pcs(pcs);
 
-	del_timer_sync(&mpcs->link_poll_outband);
+	cancel_delayed_work_sync(&mpcs->link_poll);
 
-	mpcs->interface = PHY_INTERFACE_MODE_NA;
+	if (mpcs->mode == MLO_AN_INBAND)
+		mtk_sgmii_get_state(mpcs);
 }
 
 static void mtk_sgmii_pcs_get_state(struct phylink_pcs *pcs,
 				    struct phylink_link_state *state)
 {
 	struct mtk_sgmii_pcs *mpcs = pcs_to_mtk_sgmii_pcs(pcs);
-	unsigned int bm, adv, rgc3, sgm_mode;
-
-	state->interface = mpcs->interface;
-
-	regmap_read(mpcs->regmap, SGMSYS_PCS_CONTROL_1, &bm);
-	if (bm & SGMII_AN_ENABLE) {
-		regmap_read(mpcs->regmap, SGMSYS_PCS_ADVERTISE, &adv);
-
-		phylink_mii_c22_pcs_decode_state(state,
-						 FIELD_GET(SGMII_BMSR, bm),
-						 FIELD_GET(SGMII_LPA, adv));
-	} else {
-		state->link = !!(bm & SGMII_LINK_STATYS);
-
-		regmap_read(mpcs->regmap, SGMSYS_SGMII_MODE, &sgm_mode);
-
-		switch (sgm_mode & SGMII_SPEED_MASK) {
-		case SGMII_SPEED_10:
-			state->speed = SPEED_10;
-			break;
-		case SGMII_SPEED_100:
-			state->speed = SPEED_100;
-			break;
-		case SGMII_SPEED_1000:
-			regmap_read(mpcs->regmap, mpcs->ana_rgc3, &rgc3);
-			rgc3 = FIELD_GET(RG_PHY_SPEED_3_125G, rgc3);
-			state->speed = rgc3 ? SPEED_2500 : SPEED_1000;
-			break;
-		}
 
-		if (sgm_mode & SGMII_DUPLEX_HALF)
-			state->duplex = DUPLEX_HALF;
-		else
-			state->duplex = DUPLEX_FULL;
-	}
+	/* When the interface of the mpcs is not initialized,
+	 * we should avoid overriding the state interface.
+	 */
+	if (mpcs->state.interface != PHY_INTERFACE_MODE_NA)
+		state->interface = mpcs->state.interface;
+	state->speed = mpcs->state.speed;
+	state->duplex = mpcs->state.duplex;
+	state->link = mpcs->state.link;
 
 	/* Reconfiguring SGMII every second to ensure that PCS can
 	 * link up with the Link Partner when a module is inserted.
 	 */
-	if (state->link == 0 && time_after(jiffies, mpcs->link_poll_inband + HZ)) {
-		mpcs->link_poll_inband = jiffies;
-		mtk_sgmii_pcs_config(pcs, MLO_AN_INBAND,
-				     state->interface, mpcs->advertising, false);
+	if (time_after(jiffies, mpcs->link_poll_expire) &&
+	    !delayed_work_pending(&mpcs->link_poll)) {
+		mpcs->link_poll_expire = jiffies + HZ;
+		mpcs->state.an_enabled = state->an_enabled;
+		schedule_delayed_work(&mpcs->link_poll, 0);
 	}
 }
 
@@ -591,6 +625,7 @@
 				  int speed, int duplex)
 {
 	struct mtk_sgmii_pcs *mpcs = pcs_to_mtk_sgmii_pcs(pcs);
+	struct device *dev = mpcs->eth->dev;
 	unsigned int sgm_mode, val;
 	unsigned long t_start = jiffies;
 
@@ -602,7 +637,7 @@
 
 	} while (time_before(jiffies, t_start + msecs_to_jiffies(3000)));
 
-	pr_warn("%s wait link up timeout!\n", __func__);
+	dev_warn(dev, "sgmii%d: wait link up timeout!\n", mpcs->id);
 	return;
 
 exit:
@@ -669,9 +704,14 @@
 		ss->pcs[i].pcs.poll = true;
 		ss->pcs[i].interface = PHY_INTERFACE_MODE_NA;
 
-		timer_setup(&ss->pcs[i].link_poll_outband, mtk_sgmii_pcs_link_poll, 0);
+		ss->pcs[i].state.link = 0;
+		ss->pcs[i].state.duplex = DUPLEX_FULL;
+		ss->pcs[i].state.speed = SPEED_1000;
+
+		INIT_DELAYED_WORK(&ss->pcs[i].link_poll, mtk_sgmii_pcs_link_poll);
 
-		spin_lock_init(&ss->pcs[i].regmap_lock);
+		mutex_init(&ss->pcs[i].regmap_lock);
+		mutex_init(&ss->pcs[i].reset_lock);
 
 		of_node_put(np);
 	}
diff --git a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_usxgmii.c b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_usxgmii.c
index 16ae838..85aae88 100644
--- a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_usxgmii.c
+++ b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/ethernet/mediatek/mtk_usxgmii.c
@@ -186,7 +186,7 @@
 	/* Force AEQ on */
 	regmap_update_bits(mpcs->regmap_pextp, 0x0070, GENMASK(31, 0),
 			   0x02002800);
-	ndelay(1020);
+	usleep_range(1, 5);
 	regmap_update_bits(mpcs->regmap_pextp, 0x3040, GENMASK(31, 0),
 			   0x20000000);
 	/* Setup DA default value */
@@ -219,28 +219,28 @@
 	/* Release reset */
 	regmap_update_bits(mpcs->regmap_pextp, 0x0070, GENMASK(31, 0),
 			   0x0200E800);
-	udelay(150);
+	usleep_range(150, 500);
 	/* Switch to P0 */
 	regmap_update_bits(mpcs->regmap_pextp, 0x0070, GENMASK(31, 0),
 			   0x0200C111);
-	ndelay(1020);
+	usleep_range(1, 5);
 	regmap_update_bits(mpcs->regmap_pextp, 0x0070, GENMASK(31, 0),
 			   0x0200C101);
-	udelay(15);
+	usleep_range(15, 50);
 	/* Switch to Gen3 */
 	regmap_update_bits(mpcs->regmap_pextp, 0x0070, GENMASK(31, 0),
 			   0x0202C111);
-	ndelay(1020);
+	usleep_range(1, 5);
 	regmap_update_bits(mpcs->regmap_pextp, 0x0070, GENMASK(31, 0),
 			   0x0202C101);
-	udelay(100);
+	usleep_range(100, 500);
 	regmap_update_bits(mpcs->regmap_pextp, 0x30B0, GENMASK(31, 0),
 			   0x00000030);
 	regmap_update_bits(mpcs->regmap_pextp, 0x00F4, GENMASK(31, 0),
 			   0x80201F00);
 	regmap_update_bits(mpcs->regmap_pextp, 0x3040, GENMASK(31, 0),
 			   0x30000000);
-	udelay(400);
+	usleep_range(400, 1000);
 }
 
 void mtk_usxgmii_setup_phya_5gbaser(struct mtk_usxgmii_pcs *mpcs)
@@ -300,7 +300,7 @@
 	/* Force AEQ on */
 	regmap_update_bits(mpcs->regmap_pextp, 0x0070, GENMASK(31, 0),
 			   0x02002800);
-	ndelay(1020);
+	usleep_range(1, 5);
 	regmap_update_bits(mpcs->regmap_pextp, 0x3040, GENMASK(31, 0),
 			   0x20000000);
 	/* Setup DA default value */
@@ -333,28 +333,28 @@
 	/* Release reset */
 	regmap_update_bits(mpcs->regmap_pextp, 0x0070, GENMASK(31, 0),
 			   0x0200E800);
-	udelay(150);
+	usleep_range(150, 500);
 	/* Switch to P0 */
 	regmap_update_bits(mpcs->regmap_pextp, 0x0070, GENMASK(31, 0),
 			   0x0200C111);
-	ndelay(1020);
+	usleep_range(1, 5);
 	regmap_update_bits(mpcs->regmap_pextp, 0x0070, GENMASK(31, 0),
 			   0x0200C101);
-	udelay(15);
+	usleep_range(15, 50);
 	/* Switch to Gen3 */
 	regmap_update_bits(mpcs->regmap_pextp, 0x0070, GENMASK(31, 0),
 			   0x0202C111);
-	ndelay(1020);
+	usleep_range(1, 5);
 	regmap_update_bits(mpcs->regmap_pextp, 0x0070, GENMASK(31, 0),
 			   0x0202C101);
-	udelay(100);
+	usleep_range(100, 500);
 	regmap_update_bits(mpcs->regmap_pextp, 0x30B0, GENMASK(31, 0),
 			   0x00000030);
 	regmap_update_bits(mpcs->regmap_pextp, 0x00F4, GENMASK(31, 0),
 			   0x80201F00);
 	regmap_update_bits(mpcs->regmap_pextp, 0x3040, GENMASK(31, 0),
 			   0x30000000);
-	udelay(400);
+	usleep_range(400, 1000);
 }
 
 void mtk_usxgmii_setup_phya_10gbaser(struct mtk_usxgmii_pcs *mpcs)
@@ -414,7 +414,7 @@
 	/* Force AEQ on */
 	regmap_update_bits(mpcs->regmap_pextp, 0x0070, GENMASK(31, 0),
 			   0x02002800);
-	ndelay(1020);
+	usleep_range(1, 5);
 	regmap_update_bits(mpcs->regmap_pextp, 0x3040, GENMASK(31, 0),
 			   0x20000000);
 	/* Setup DA default value */
@@ -450,34 +450,36 @@
 	/* Release reset */
 	regmap_update_bits(mpcs->regmap_pextp, 0x0070, GENMASK(31, 0),
 			   0x0200E800);
-	udelay(150);
+	usleep_range(150, 500);
 	/* Switch to P0 */
 	regmap_update_bits(mpcs->regmap_pextp, 0x0070, GENMASK(31, 0),
 			   0x0200C111);
-	ndelay(1020);
+	usleep_range(1, 5);
 	regmap_update_bits(mpcs->regmap_pextp, 0x0070, GENMASK(31, 0),
 			   0x0200C101);
-	udelay(15);
+	usleep_range(15, 50);
 	/* Switch to Gen3 */
 	regmap_update_bits(mpcs->regmap_pextp, 0x0070, GENMASK(31, 0),
 			   0x0202C111);
-	ndelay(1020);
+	usleep_range(1, 5);
 	regmap_update_bits(mpcs->regmap_pextp, 0x0070, GENMASK(31, 0),
 			   0x0202C101);
-	udelay(100);
+	usleep_range(100, 500);
 	regmap_update_bits(mpcs->regmap_pextp, 0x30B0, GENMASK(31, 0),
 			   0x00000030);
 	regmap_update_bits(mpcs->regmap_pextp, 0x00F4, GENMASK(31, 0),
 			   0x80201F00);
 	regmap_update_bits(mpcs->regmap_pextp, 0x3040, GENMASK(31, 0),
 			   0x30000000);
-	udelay(400);
+	usleep_range(400, 1000);
 }
 
 int mtk_usxgmii_link_status(struct mtk_usxgmii_pcs *mpcs)
 {
 	unsigned int val;
 
+	mutex_lock(&mpcs->reset_lock);
+
 	/* Refresh USXGMII link status by toggling RG_PCS_RX_STATUS_UPDATE */
 	regmap_read(mpcs->regmap, RG_PCS_RX_STATUS0, &val);
 	val |= RG_PCS_RX_STATUS_UPDATE;
@@ -490,16 +492,113 @@
 	/* Read USXGMII link status */
 	regmap_read(mpcs->regmap, RG_PCS_RX_STATUS0, &val);
 
+	mutex_unlock(&mpcs->reset_lock);
+
 	return FIELD_GET(RG_PCS_RX_LINK_STATUS, val);
 }
 
+bool mtk_usxgmii_is_valid_ctle(struct mtk_usxgmii_pcs *mpcs)
+{
+	unsigned int val, ctle;
+
+	mutex_lock(&mpcs->reset_lock);
+
+	regmap_write(mpcs->regmap_pextp, 0x00, 0x00000404);
+	regmap_write(mpcs->regmap_pextp, 0x10, 0x00d600d5);
+	regmap_read(mpcs->regmap_pextp, 0xd0, &val);
+
+	mutex_unlock(&mpcs->reset_lock);
+
+	ctle = FIELD_GET(GENMASK(12, 8), val);
+	if (ctle > 10)
+		return false;
+
+	return true;
+}
+
+static void mtk_usxgmii_get_state(struct mtk_usxgmii_pcs *mpcs)
+{
+	struct phylink_link_state *state = &mpcs->state;
+	struct mtk_eth *eth = mpcs->eth;
+	struct mtk_mac *mac = eth->mac[mtk_xgmii2mac_id(eth, mpcs->id)];
+	u32 val = 0;
+
+	mutex_lock(&mpcs->reset_lock);
+
+	regmap_read(mpcs->regmap, RG_PCS_AN_CTRL0, &val);
+	if (FIELD_GET(USXGMII_AN_ENABLE, val)) {
+		/* Refresh LPA by inverting LPA_LATCH */
+		regmap_read(mpcs->regmap, RG_PCS_AN_STS0, &val);
+		regmap_update_bits(mpcs->regmap, RG_PCS_AN_STS0,
+				   USXGMII_LPA_LATCH,
+				   !(val & USXGMII_LPA_LATCH));
+
+		regmap_read(mpcs->regmap, RG_PCS_AN_STS0, &val);
+
+		state->interface = mpcs->interface;
+		state->link = FIELD_GET(USXGMII_LPA_LINK, val);
+		state->duplex = FIELD_GET(USXGMII_LPA_DUPLEX, val);
+
+		switch (FIELD_GET(USXGMII_LPA_SPEED_MASK, val)) {
+		case USXGMII_LPA_SPEED_10:
+			state->speed = SPEED_10;
+			break;
+		case USXGMII_LPA_SPEED_100:
+			state->speed = SPEED_100;
+			break;
+		case USXGMII_LPA_SPEED_1000:
+			state->speed = SPEED_1000;
+			break;
+		case USXGMII_LPA_SPEED_2500:
+			state->speed = SPEED_2500;
+			break;
+		case USXGMII_LPA_SPEED_5000:
+			state->speed = SPEED_5000;
+			break;
+		case USXGMII_LPA_SPEED_10000:
+			state->speed = SPEED_10000;
+			break;
+		}
+	} else {
+		val = mtk_r32(mac->hw, MTK_XGMAC_STS(mac->id));
+
+		if (mac->id == MTK_GMAC2_ID)
+			val = val >> 16;
+
+		switch (FIELD_GET(MTK_USXGMII_PCS_MODE, val)) {
+		case 0:
+			state->speed = SPEED_10000;
+			break;
+		case 1:
+			state->speed = SPEED_5000;
+			break;
+		case 2:
+			state->speed = SPEED_2500;
+			break;
+		case 3:
+			state->speed = SPEED_1000;
+			break;
+		}
+
+		state->interface = mpcs->interface;
+		state->link = FIELD_GET(MTK_USXGMII_PCS_LINK, val);
+		state->duplex = DUPLEX_FULL;
+	}
+
+	mutex_unlock(&mpcs->reset_lock);
+}
+
-void mtk_usxgmii_reset(struct mtk_eth *eth, int id)
+void mtk_usxgmii_reset(struct mtk_usxgmii_pcs *mpcs)
 {
+	struct mtk_eth *eth = mpcs->eth;
+	int id = mpcs->id;
 	u32 val = 0;
 
 	if (id >= MTK_MAX_DEVS || !eth->toprgu)
 		return;
 
+	mutex_lock(&mpcs->reset_lock);
+
 	switch (id) {
 	case 0:
 		/* Enable software reset */
@@ -515,7 +614,7 @@
 		       SWSYSRST_XFI0_GRST;
 		regmap_write(eth->toprgu, TOPRGU_SWSYSRST, val);
 
-		udelay(100);
+		usleep_range(100, 500);
 
 		/* De-assert USXGMII reset */
 		regmap_read(eth->toprgu, TOPRGU_SWSYSRST, &val);
@@ -544,7 +643,7 @@
 		       SWSYSRST_XFI1_GRST;
 		regmap_write(eth->toprgu, TOPRGU_SWSYSRST, val);
 
-		udelay(100);
+		usleep_range(100, 500);
 
 		/* De-assert USXGMII reset */
 		regmap_read(eth->toprgu, TOPRGU_SWSYSRST, &val);
@@ -561,7 +660,9 @@
 		break;
 	}
 
+	mutex_unlock(&mpcs->reset_lock);
+
-	mdelay(10);
+	usleep_range(10000, 11000);
 }
 
 static int mtk_usxgmii_pcs_config(struct phylink_pcs *pcs, unsigned int mode,
@@ -571,12 +672,9 @@
 {
 	struct mtk_usxgmii_pcs *mpcs = pcs_to_mtk_usxgmii_pcs(pcs);
 	struct mtk_eth *eth = mpcs->eth;
-	unsigned long flags;
 	unsigned int an_ctrl = 0, link_timer = 0, xfi_mode = 0, adapt_mode = 0;
 	bool mode_changed = false;
 
-	spin_lock_irqsave(&mpcs->regmap_lock, flags);
-
 	if (interface == PHY_INTERFACE_MODE_USXGMII) {
 		an_ctrl = FIELD_PREP(USXGMII_AN_SYNC_CNT, 0x1FF) |
 			  USXGMII_AN_ENABLE;
@@ -602,20 +700,25 @@
 			   FIELD_PREP(USXGMII_XFI_TX_MODE, USXGMII_XFI_TX_MODE_5G);
 		adapt_mode = USXGMII_RATE_UPDATE_MODE;
 	} else {
-		spin_unlock_irqrestore(&mpcs->regmap_lock, flags);
 		return -EINVAL;
 	}
 
 	adapt_mode |= FIELD_PREP(USXGMII_RATE_ADAPT_MODE, USXGMII_RATE_ADAPT_MODE_X1);
 
+	mtk_usxgmii_xfi_pll_enable(eth->usxgmii);
+	mtk_usxgmii_reset(mpcs);
+
-	if (mpcs->interface != interface) {
+	mutex_lock(&mpcs->regmap_lock);
+
+	if (mode >= 0 && mpcs->interface != interface) {
 		mpcs->interface = interface;
 		mpcs->mode = mode;
 		mode_changed = true;
 	}
 
-	mtk_usxgmii_xfi_pll_enable(eth->usxgmii);
-	mtk_usxgmii_reset(eth, mpcs->id);
+	/* Configure the interface polarity */
+	regmap_update_bits(mpcs->regmap, RG_PHY_TOP_CTRL0,
+			   USXGMII_PN_SWAP_MASK, mpcs->polarity);
 
 	/* Setup USXGMII AN ctrl */
 	regmap_update_bits(mpcs->regmap, RG_PCS_AN_CTRL0,
@@ -646,13 +749,13 @@
 			   USXGMII_XFI_RX_MODE | USXGMII_XFI_TX_MODE,
 			   xfi_mode);
 
-	udelay(1);
+	usleep_range(1, 5);
 
 	/* Un-gated MAC CK */
 	regmap_update_bits(mpcs->regmap, RG_PHY_TOP_SPEED_CTRL1,
 			   USXGMII_MAC_CK_GATED, 0);
 
-	udelay(1);
+	usleep_range(1, 5);
 
 	/* Disable interface force mode for the AN mode */
 	if (an_ctrl & USXGMII_AN_ENABLE)
@@ -667,32 +770,38 @@
 	else if (interface == PHY_INTERFACE_MODE_5GBASER)
 		mtk_usxgmii_setup_phya_5gbaser(mpcs);
 
-	spin_unlock_irqrestore(&mpcs->regmap_lock, flags);
+	mutex_unlock(&mpcs->regmap_lock);
 
 	return mode_changed;
 }
 
-static void mtk_usxgmii_pcs_link_poll(struct timer_list *t)
+static void mtk_usxgmii_pcs_link_poll(struct work_struct *work)
 {
-	struct mtk_usxgmii_pcs *mpcs = from_timer(mpcs, t, link_poll_outband);
+	struct mtk_usxgmii_pcs *mpcs = container_of(work, struct mtk_usxgmii_pcs,
+						    link_poll.work);
 
-	if (mpcs->interface == PHY_INTERFACE_MODE_NA)
+	if (mpcs->interface != PHY_INTERFACE_MODE_5GBASER &&
+	    mpcs->interface != PHY_INTERFACE_MODE_10GKR &&
+	    mpcs->interface != PHY_INTERFACE_MODE_USXGMII)
 		goto exit;
 
-	if (!mtk_usxgmii_link_status(mpcs))
-		mtk_usxgmii_pcs_config(&mpcs->pcs, mpcs->mode,
+	if (!mtk_usxgmii_link_status(mpcs) || !mtk_usxgmii_is_valid_ctle(mpcs))
+		mtk_usxgmii_pcs_config(&mpcs->pcs, -1,
 				       mpcs->interface, NULL, false);
 
 exit:
-	if (mpcs->mode != MLO_AN_INBAND)
-		mod_timer(&mpcs->link_poll_outband, jiffies + HZ);
+	if (mpcs->mode == MLO_AN_INBAND)
+		mtk_usxgmii_get_state(mpcs);
+	else if (!delayed_work_pending(&mpcs->link_poll))
+		schedule_delayed_work(&mpcs->link_poll, msecs_to_jiffies(1000));
 }
 
 static int mtk_usxgmii_pcs_enable(struct phylink_pcs *pcs)
 {
 	struct mtk_usxgmii_pcs *mpcs = pcs_to_mtk_usxgmii_pcs(pcs);
 
-	mod_timer(&mpcs->link_poll_outband, jiffies + HZ);
+	if (!delayed_work_pending(&mpcs->link_poll))
+		schedule_delayed_work(&mpcs->link_poll, msecs_to_jiffies(1000));
 
 	return 0;
 }
@@ -701,86 +810,31 @@
 {
 	struct mtk_usxgmii_pcs *mpcs = pcs_to_mtk_usxgmii_pcs(pcs);
 
-	del_timer_sync(&mpcs->link_poll_outband);
+	cancel_delayed_work_sync(&mpcs->link_poll);
 
-	mpcs->interface = PHY_INTERFACE_MODE_NA;
+	if (mpcs->mode == MLO_AN_INBAND)
+		mtk_usxgmii_get_state(mpcs);
 }
 
 static void mtk_usxgmii_pcs_get_state(struct phylink_pcs *pcs,
 				    struct phylink_link_state *state)
 {
 	struct mtk_usxgmii_pcs *mpcs = pcs_to_mtk_usxgmii_pcs(pcs);
-	struct mtk_eth *eth = mpcs->eth;
-	struct mtk_mac *mac = eth->mac[mtk_xgmii2mac_id(eth, mpcs->id)];
-	u32 val = 0;
-
-	regmap_read(mpcs->regmap, RG_PCS_AN_CTRL0, &val);
-	if (FIELD_GET(USXGMII_AN_ENABLE, val)) {
-		/* Refresh LPA by inverting LPA_LATCH */
-		regmap_read(mpcs->regmap, RG_PCS_AN_STS0, &val);
-		regmap_update_bits(mpcs->regmap, RG_PCS_AN_STS0,
-				   USXGMII_LPA_LATCH,
-				   !(val & USXGMII_LPA_LATCH));
-
-		regmap_read(mpcs->regmap, RG_PCS_AN_STS0, &val);
-
-		state->interface = mpcs->interface;
-		state->link = FIELD_GET(USXGMII_LPA_LINK, val);
-		state->duplex = FIELD_GET(USXGMII_LPA_DUPLEX, val);
-
-		switch (FIELD_GET(USXGMII_LPA_SPEED_MASK, val)) {
-		case USXGMII_LPA_SPEED_10:
-			state->speed = SPEED_10;
-			break;
-		case USXGMII_LPA_SPEED_100:
-			state->speed = SPEED_100;
-			break;
-		case USXGMII_LPA_SPEED_1000:
-			state->speed = SPEED_1000;
-			break;
-		case USXGMII_LPA_SPEED_2500:
-			state->speed = SPEED_2500;
-			break;
-		case USXGMII_LPA_SPEED_5000:
-			state->speed = SPEED_5000;
-			break;
-		case USXGMII_LPA_SPEED_10000:
-			state->speed = SPEED_10000;
-			break;
-		}
-	} else {
-		val = mtk_r32(mac->hw, MTK_XGMAC_STS(mac->id));
-
-		if (mac->id == MTK_GMAC2_ID)
-			val = val >> 16;
-
-		switch (FIELD_GET(MTK_USXGMII_PCS_MODE, val)) {
-		case 0:
-			state->speed = SPEED_10000;
-			break;
-		case 1:
-			state->speed = SPEED_5000;
-			break;
-		case 2:
-			state->speed = SPEED_2500;
-			break;
-		case 3:
-			state->speed = SPEED_1000;
-			break;
-		}
 
-		state->interface = mpcs->interface;
-		state->link = FIELD_GET(MTK_USXGMII_PCS_LINK, val);
-		state->duplex = DUPLEX_FULL;
-	}
+	if (mpcs->state.interface != PHY_INTERFACE_MODE_NA)
+		state->interface = mpcs->state.interface;
+	state->speed = mpcs->state.speed;
+	state->duplex = mpcs->state.duplex;
+	state->link = mpcs->state.link;
 
 	/* Reconfiguring USXGMII every second to ensure that PCS can
 	 * link up with the Link Partner when a module is inserted.
 	 */
-	if (state->link == 0 && time_after(jiffies, mpcs->link_poll_inband + HZ)) {
-		mpcs->link_poll_inband = jiffies;
-		mtk_usxgmii_pcs_config(pcs, MLO_AN_INBAND,
-				       state->interface, NULL, false);
+	if (time_after(jiffies, mpcs->link_poll_expire) &&
+	    !delayed_work_pending(&mpcs->link_poll)) {
+		mpcs->link_poll_expire = jiffies + HZ;
+		mpcs->state.an_enabled = state->an_enabled;
+		schedule_delayed_work(&mpcs->link_poll, 0);
 	}
 }
 
@@ -802,14 +856,9 @@
 				    int speed, int duplex)
 {
 	struct mtk_usxgmii_pcs *mpcs = pcs_to_mtk_usxgmii_pcs(pcs);
+	struct device *dev = mpcs->eth->dev;
 	unsigned long t_start = jiffies;
 
-	/* Reconfiguring USXGMII to ensure the quality of the RX signal
-	 * after the line side link up.
-	 */
-	mtk_usxgmii_pcs_config(pcs, mode,
-			       interface, NULL, false);
-
 	do {
 		msleep(100);
 
@@ -818,7 +867,7 @@
 
 	} while (time_before(jiffies, t_start + msecs_to_jiffies(3000)));
 
-	pr_warn("%s wait link up timeout!\n", __func__);
+	dev_warn(dev, "usxgmii%d: wait link up timeout!\n", mpcs->id);
 }
 
 static const struct phylink_pcs_ops mtk_usxgmii_pcs_ops = {
@@ -848,13 +897,26 @@
 		if (IS_ERR(ss->pcs[i].regmap))
 			return PTR_ERR(ss->pcs[i].regmap);
 
+		ss->pcs[i].polarity = 0;
+		if (of_property_read_bool(np, "pn_swap"))
+			ss->pcs[i].polarity |= USXGMII_PN_SWAP_TX | USXGMII_PN_SWAP_RX;
+		else if (of_property_read_bool(np, "pn_swap_tx"))
+			ss->pcs[i].polarity |= USXGMII_PN_SWAP_TX;
+		else if (of_property_read_bool(np, "pn_swap_rx"))
+			ss->pcs[i].polarity |= USXGMII_PN_SWAP_RX;
+
 		ss->pcs[i].pcs.ops = &mtk_usxgmii_pcs_ops;
 		ss->pcs[i].pcs.poll = true;
 		ss->pcs[i].interface = PHY_INTERFACE_MODE_NA;
 
-		timer_setup(&ss->pcs[i].link_poll_outband, mtk_usxgmii_pcs_link_poll, 0);
+		ss->pcs[i].state.link = 0;
+		ss->pcs[i].state.duplex = DUPLEX_FULL;
+		ss->pcs[i].state.speed = SPEED_10000;
+
+		INIT_DELAYED_WORK(&ss->pcs[i].link_poll, mtk_usxgmii_pcs_link_poll);
 
-		spin_lock_init(&ss->pcs[i].regmap_lock);
+		mutex_init(&ss->pcs[i].regmap_lock);
+		mutex_init(&ss->pcs[i].reset_lock);
 
 		of_node_put(np);
 	}
diff --git a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/phy/airoha/an8855/an8855.c b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/phy/airoha/an8855/an8855.c
index f3db8b8..79d6d1a 100644
--- a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/phy/airoha/an8855/an8855.c
+++ b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/phy/airoha/an8855/an8855.c
@@ -18,6 +18,16 @@
 /* AN8855 registers */
 #define SCU_BASE					0x10000000
 #define RG_RGMII_TXCK_C				(SCU_BASE + 0x1d0)
+#define RG_GPIO_LED_MODE			(SCU_BASE + 0x0054)
+#define RG_GPIO_LED_SEL(i)	(SCU_BASE + (0x0058 + ((i) * 4)))
+#define RG_INTB_MODE				(SCU_BASE + 0x0080)
+#define RG_GDMP_RAM				(SCU_BASE + 0x10000)
+
+#define RG_GPIO_L_INV			(SCU_BASE + 0x0010)
+#define RG_GPIO_CTRL			(SCU_BASE + 0xa300)
+#define RG_GPIO_DATA			(SCU_BASE + 0xa304)
+#define RG_GPIO_OE			(SCU_BASE + 0xa314)
+
 
 #define HSGMII_AN_CSR_BASE			0x10220000
 #define SGMII_REG_AN0				(HSGMII_AN_CSR_BASE + 0x000)
@@ -61,6 +71,8 @@
 #define SS_LCPLL_TDC_PCW_1			(QP_PMA_TOP_BASE + 0x248)
 #define INTF_CTRL_8		(QP_PMA_TOP_BASE + 0x320)
 #define INTF_CTRL_9		(QP_PMA_TOP_BASE + 0x324)
+#define INTF_CTRL_10	(QP_PMA_TOP_BASE + 0x328)
+#define INTF_CTRL_11	(QP_PMA_TOP_BASE + 0x32c)
 #define PLL_CTRL_0		(QP_PMA_TOP_BASE + 0x400)
 #define PLL_CTRL_2		(QP_PMA_TOP_BASE + 0x408)
 #define PLL_CTRL_3		(QP_PMA_TOP_BASE + 0x40c)
@@ -78,6 +90,7 @@
 #define QP_ANA_CSR_BASE				0x1022f000
 #define RG_QP_RX_DAC_EN				(QP_ANA_CSR_BASE + 0x00)
 #define RG_QP_RXAFE_RESERVE			(QP_ANA_CSR_BASE + 0x04)
+#define RG_QP_CDR_LPF_BOT_LIM		(QP_ANA_CSR_BASE + 0x08)
 #define RG_QP_CDR_LPF_MJV_LIM		(QP_ANA_CSR_BASE + 0x0c)
 #define RG_QP_CDR_LPF_SETVALUE		(QP_ANA_CSR_BASE + 0x14)
 #define RG_QP_CDR_PR_CKREF_DIV1		(QP_ANA_CSR_BASE + 0x18)
@@ -106,6 +119,66 @@
 /* Fields of PHY_EXT_REG_14 */
 #define PHY_EN_DOWN_SHFIT		BIT(4)
 
+/* PHY dev address 0x1E */
+#define PHY_DEV1E				0x1e
+
+/* PHY TX PAIR DELAY SELECT Register */
+#define PHY_TX_PAIR_DLY_SEL_GBE		0x013
+/* PHY ADC Register */
+#define PHY_RXADC_CTRL				0x0d8
+#define PHY_RXADC_REV_0				0x0d9
+#define PHY_RXADC_REV_1				0x0da
+
+/* PHY LED Register bitmap of define */
+#define PHY_LED_CTRL_SELECT		0x3e8
+#define PHY_SINGLE_LED_ON_CTRL(i)	(0x3e0 + ((i) * 2))
+#define PHY_SINGLE_LED_BLK_CTRL(i)	(0x3e1 + ((i) * 2))
+#define PHY_SINGLE_LED_ON_DUR(i)	(0x3e9 + ((i) * 2))
+#define PHY_SINGLE_LED_BLK_DUR(i)	(0x3ea + ((i) * 2))
+
+#define PHY_PMA_CTRL	(0x340)
+
+/* PHY dev address 0x1F */
+#define PHY_DEV1F				0x1f
+#define PHY_LED_ON_CTRL(i)		(0x24 + ((i) * 2))
+#define LED_ON_EN				(1 << 15)
+#define LED_ON_POL				(1 << 14)
+#define LED_ON_EVT_MASK			(0x7f)
+/* LED ON Event */
+#define LED_ON_EVT_FORCE		(1 << 6)
+#define LED_ON_EVT_LINK_HD		(1 << 5)
+#define LED_ON_EVT_LINK_FD		(1 << 4)
+#define LED_ON_EVT_LINK_DOWN	(1 << 3)
+#define LED_ON_EVT_LINK_10M		(1 << 2)
+#define LED_ON_EVT_LINK_100M	(1 << 1)
+#define LED_ON_EVT_LINK_1000M	(1 << 0)
+
+#define PHY_LED_BLK_CTRL(i)		(0x25 + ((i) * 2))
+#define LED_BLK_EVT_MASK		(0x3ff)
+/* LED Blinking Event */
+#define LED_BLK_EVT_FORCE			(1 << 9)
+#define LED_BLK_EVT_10M_RX_ACT		(1 << 5)
+#define LED_BLK_EVT_10M_TX_ACT		(1 << 4)
+#define LED_BLK_EVT_100M_RX_ACT		(1 << 3)
+#define LED_BLK_EVT_100M_TX_ACT		(1 << 2)
+#define LED_BLK_EVT_1000M_RX_ACT	(1 << 1)
+#define LED_BLK_EVT_1000M_TX_ACT	(1 << 0)
+
+#define PHY_LED_BCR				(0x21)
+#define LED_BCR_EXT_CTRL		(1 << 15)
+#define LED_BCR_CLK_EN			(1 << 3)
+#define LED_BCR_TIME_TEST		(1 << 2)
+#define LED_BCR_MODE_MASK		(3)
+#define LED_BCR_MODE_DISABLE	(0)
+
+#define PHY_LED_ON_DUR			(0x22)
+#define LED_ON_DUR_MASK			(0xffff)
+
+#define PHY_LED_BLK_DUR			(0x23)
+#define LED_BLK_DUR_MASK		(0xffff)
+
+#define PHY_LED_BLINK_DUR_CTRL	(0x720)
+
 /* Unique fields of PMCR for AN8855 */
 #define FORCE_TX_FC		BIT(4)
 #define FORCE_RX_FC		BIT(5)
@@ -117,10 +190,114 @@
 #define CHIP_ID			0x10005000
 #define CHIP_REV		0x10005004
 
+#define AN8855_EFUSE_DATA0	0x1000a500
+
+const u8 r50ohm_table[] = {
+	127, 127, 127, 127, 127, 127, 127, 127, 127, 127,
+	127, 127, 127, 127, 127, 127, 127, 126, 122, 117,
+	112, 109, 104, 101,  97,  94,  90,  88,  84,  80,
+	78,  74,  72,  68,  66,  64,  61,  58,  56,  53,
+	51,  48,  47,  44,  42,  40,  38,  36,  34,  32,
+	31,  28,  27,  24,  24,  22,  20,  18,  16,  16,
+	14,  12,  11,   9
+};
+
+static u8 shift_check(u8 base)
+{
+	u8 i;
+	u32 sz = sizeof(r50ohm_table)/sizeof(u8);
+
+	for (i = 0; i < sz; ++i)
+		if (r50ohm_table[i] == base)
+			break;
+
+	if (i < 8 || i >= sz)
+		return 25; /* index of 94 */
+
+	return (i - 8);
+}
+
+static u8 get_shift_val(u8 idx)
+{
+	return r50ohm_table[idx];
+}
+
+/* T830 AN8855 Reference Board */
+static const struct an8855_led_cfg led_cfg[] = {
+/*************************************************************************
+ * Enable, LED idx, LED Polarity, LED ON event,  LED Blink event  LED Freq
+ *************************************************************************
+ */
+	/* GPIO0 */
+	{0, PHY_LED_MAX, LED_HIGH, LED_ON_EVENT, LED_BLK_EVENT, LED_FREQ},
+	/* GPIO1 */
+	{1, P0_LED1, LED_HIGH, LED_ON_EVENT, LED_BLK_EVENT, LED_FREQ},
+	/* GPIO2 */
+	{1, P1_LED1, LED_HIGH, LED_ON_EVENT, LED_BLK_EVENT, LED_FREQ},
+	/* GPIO3 */
+	{1, P2_LED1, LED_HIGH, LED_ON_EVENT, LED_BLK_EVENT, LED_FREQ},
+	/* GPIO4 */
+	{1, P3_LED1, LED_LOW,  LED_ON_EVENT, LED_BLK_EVENT, LED_FREQ},
+	/* GPIO5 */
+	{1, P4_LED1, LED_LOW,  LED_ON_EVENT, LED_BLK_EVENT, LED_FREQ},
+	/* GPIO6 */
+	{0, PHY_LED_MAX, LED_LOW,  LED_ON_EVENT, LED_BLK_EVENT, LED_FREQ},
+	/* GPIO7 */
+	{0, PHY_LED_MAX, LED_HIGH, LED_ON_EVENT, LED_BLK_EVENT, LED_FREQ},
+	/* GPIO8 */
+	{0, PHY_LED_MAX, LED_HIGH, LED_ON_EVENT, LED_BLK_EVENT, LED_FREQ},
+	/* GPIO9 */
+	{0, PHY_LED_MAX, LED_HIGH, LED_ON_EVENT, LED_BLK_EVENT, LED_FREQ},
+	/* GPIO10 */
+	{0, PHY_LED_MAX, LED_HIGH, LED_ON_EVENT, LED_BLK_EVENT, LED_FREQ},
+	/* GPIO11 */
+	{0, PHY_LED_MAX, LED_HIGH, LED_ON_EVENT, LED_BLK_EVENT, LED_FREQ},
+	/* GPIO12 */
+	{0, PHY_LED_MAX, LED_LOW,  LED_ON_EVENT, LED_BLK_EVENT, LED_FREQ},
+	/* GPIO13 */
+	{0, PHY_LED_MAX, LED_HIGH, LED_ON_EVENT, LED_BLK_EVENT, LED_FREQ},
+	/* GPIO14 */
+	{0, PHY_LED_MAX, LED_HIGH, LED_ON_EVENT, LED_BLK_EVENT, LED_FREQ},
+	/* GPIO15 */
+	{0, PHY_LED_MAX, LED_HIGH, LED_ON_EVENT, LED_BLK_EVENT, LED_FREQ},
+	/* GPIO16 */
+	{0, PHY_LED_MAX, LED_HIGH, LED_ON_EVENT, LED_BLK_EVENT, LED_FREQ},
+	/* GPIO17 */
+	{0, PHY_LED_MAX, LED_HIGH, LED_ON_EVENT, LED_BLK_EVENT, LED_FREQ},
+	/* GPIO18 */
+	{0, PHY_LED_MAX, LED_HIGH, LED_ON_EVENT, LED_BLK_EVENT, LED_FREQ},
+	/* GPIO19 */
+	{0, PHY_LED_MAX, LED_LOW,  LED_ON_EVENT, LED_BLK_EVENT, LED_FREQ},
+	/* GPIO20 */
+	{0, PHY_LED_MAX, LED_LOW,  LED_ON_EVENT, LED_BLK_EVENT, LED_FREQ},
+};
+
 static int an8855_set_hsgmii_mode(struct gsw_an8855 *gsw)
 {
 	u32 val = 0;
 
+	/* TX FIR - improve TX EYE */
+	val = an8855_reg_read(gsw, INTF_CTRL_10);
+	val &= ~(0x3f << 16);
+	val |= BIT(21);
+	val &= ~(0x1f << 24);
+	val |= (0x4 << 24);
+	val |= BIT(29);
+	an8855_reg_write(gsw, INTF_CTRL_10, val);
+
+	val = an8855_reg_read(gsw, INTF_CTRL_11);
+	val &= ~(0x3f);
+	val |= BIT(6);
+	an8855_reg_write(gsw, INTF_CTRL_11, val);
+
+	/* RX CDR - improve RX Jitter Tolerance */
+	val = an8855_reg_read(gsw, RG_QP_CDR_LPF_BOT_LIM);
+	val &= ~(0x7 << 24);
+	val |= (0x5 << 24);
+	val &= ~(0x7 << 20);
+	val |= (0x5 << 20);
+	an8855_reg_write(gsw, RG_QP_CDR_LPF_BOT_LIM, val);
+
 	/* PLL */
 	val = an8855_reg_read(gsw, QP_DIG_MODE_CTRL_1);
 	val &= ~(0x3 << 2);
@@ -250,7 +427,7 @@
 	val &= ~(0xf << 25);
 	val |= (0x1 << 25);
 	val &= ~(0x7 << 29);
-	val |= (0x3 << 29);
+	val |= (0x6 << 29);
 	an8855_reg_write(gsw, RG_QP_CDR_LPF_SETVALUE, val);
 
 	val = an8855_reg_read(gsw, RG_QP_CDR_PR_CKREF_DIV1);
@@ -281,12 +458,10 @@
 	val |= (0x4 << 24);
 	an8855_reg_write(gsw, RG_QP_CDR_PR_CKREF_DIV1, val);
 
-	val = an8855_reg_read(gsw, PLL_CTRL_0);
-	val |= BIT(0);
-	an8855_reg_write(gsw, PLL_CTRL_0, val);
-
+	/* PMA (For HW Mode) */
 	val = an8855_reg_read(gsw, RX_CTRL_26);
-	val &= ~BIT(23);
+	val |= BIT(23);
+	val &= ~BIT(24);
 	val |= BIT(26);
 	an8855_reg_write(gsw, RX_CTRL_26, val);
 
@@ -314,8 +489,8 @@
 	val = an8855_reg_read(gsw, RX_CTRL_8);
 	val &= ~(0xfff << 16);
 	val |= (0x200 << 16);
-	val &= ~(0x7fff << 14);
-	val |= (0xfff << 14);
+	val &= ~(0x7fff << 0);
+	val |= (0xfff << 0);
 	an8855_reg_write(gsw, RX_CTRL_8, val);
 
 	/* Frequency memter */
@@ -334,6 +509,10 @@
 	val |= (0x2710 << 0);
 	an8855_reg_write(gsw, RX_CTRL_7, val);
 
+	val = an8855_reg_read(gsw, PLL_CTRL_0);
+	val |= BIT(0);
+	an8855_reg_write(gsw, PLL_CTRL_0, val);
+
 	/* PCS Init */
 	val = an8855_reg_read(gsw, RG_HSGMII_PCS_CTROL_1);
 	val &= ~BIT(30);
@@ -372,6 +551,28 @@
 {
 	u32 val = 0;
 
+	/* TX FIR - improve TX EYE */
+	val = an8855_reg_read(gsw, INTF_CTRL_10);
+	val &= ~(0x3f << 16);
+	val |= BIT(21);
+	val &= ~(0x1f << 24);
+	val |= BIT(29);
+	an8855_reg_write(gsw, INTF_CTRL_10, val);
+
+	val = an8855_reg_read(gsw, INTF_CTRL_11);
+	val &= ~(0x3f);
+	val |= (0xd << 0);
+	val |= BIT(6);
+	an8855_reg_write(gsw, INTF_CTRL_11, val);
+
+	/* RX CDR - improve RX Jitter Tolerance */
+	val = an8855_reg_read(gsw, RG_QP_CDR_LPF_BOT_LIM);
+	val &= ~(0x7 << 24);
+	val |= (0x6 << 24);
+	val &= ~(0x7 << 20);
+	val |= (0x6 << 20);
+	an8855_reg_write(gsw, RG_QP_CDR_LPF_BOT_LIM, val);
+
 	/* PMA Init */
 	/* PLL */
 	val = an8855_reg_read(gsw, QP_DIG_MODE_CTRL_1);
@@ -531,13 +732,10 @@
 	val |= (0x4 << 24);
 	an8855_reg_write(gsw, RG_QP_CDR_PR_CKREF_DIV1, val);
 
-	val = an8855_reg_read(gsw, PLL_CTRL_0);
-	val |= BIT(0);
-	an8855_reg_write(gsw, PLL_CTRL_0, val);
-
+	/* PMA (For HW Mode) */
 	val = an8855_reg_read(gsw, RX_CTRL_26);
-	val &= ~BIT(23);
-	if (mode == SGMII_MODE_AN)
+	val |= BIT(23);
+	val &= ~BIT(24);
 		val |= BIT(26);
 
 	an8855_reg_write(gsw, RX_CTRL_26, val);
@@ -586,6 +784,10 @@
 	val |= (0x2710 << 0);
 	an8855_reg_write(gsw, RX_CTRL_7, val);
 
+	val = an8855_reg_read(gsw, PLL_CTRL_0);
+	val |= BIT(0);
+	an8855_reg_write(gsw, PLL_CTRL_0, val);
+
 	if (mode == SGMII_MODE_FORCE) {
 		/* PCS Init */
 		val = an8855_reg_read(gsw, QP_DIG_MODE_CTRL_0);
@@ -670,7 +872,6 @@
 		/* Restart AN */
 		val = an8855_reg_read(gsw, SGMII_REG_AN0);
 		val |= BIT(9);
-		val |= BIT(15);
 		an8855_reg_write(gsw, SGMII_REG_AN0, val);
 	}
 
@@ -772,7 +973,10 @@
 
 static void an8855_phy_setting(struct gsw_an8855 *gsw)
 {
-	int i;
+	int i, j;
+	u8 shift_sel = 0, rsel_tx_a = 0, rsel_tx_b = 0;
+	u8 rsel_tx_c = 0, rsel_tx_d = 0;
+	u16 cl45_data = 0;
 	u32 val;
 
 	/* Release power down */
@@ -791,52 +995,262 @@
 		val |= ADVERTISE_PAUSE_ASYM;
 		gsw->mii_write(gsw, i, MII_ADVERTISE, val);
 	}
+
+	if (gsw->extSurge) {
+		for (i = 0; i < AN8855_NUM_PHYS; i++) {
+			/* Read data */
+			for (j = 0; j < AN8855_WORD_SIZE; j++) {
+				val = an8855_reg_read(gsw, AN8855_EFUSE_DATA0 +
+					(AN8855_WORD_SIZE * (3 + j + (4 * i))));
+
+				shift_sel = shift_check((val & 0x7f000000) >> 24);
+				switch (j) {
+				case 0:
+					rsel_tx_a = get_shift_val(shift_sel);
+					break;
+				case 1:
+					rsel_tx_b = get_shift_val(shift_sel);
+					break;
+				case 2:
+					rsel_tx_c = get_shift_val(shift_sel);
+					break;
+				case 3:
+					rsel_tx_d = get_shift_val(shift_sel);
+					break;
+				default:
+					continue;
+				}
+			}
+			cl45_data = gsw->mmd_read(gsw, i, PHY_DEV1E, 0x174);
+			cl45_data &= ~(0x7f7f);
+			cl45_data |= (rsel_tx_a << 8);
+			cl45_data |= rsel_tx_b;
+			gsw->mmd_write(gsw, i, PHY_DEV1E, 0x174, cl45_data);
+			cl45_data = gsw->mmd_read(gsw, i, PHY_DEV1E, 0x175);
+			cl45_data &= ~(0x7f7f);
+			cl45_data |= (rsel_tx_c << 8);
+			cl45_data |= rsel_tx_d;
+			gsw->mmd_write(gsw, i, PHY_DEV1E, 0x175, cl45_data);
+		}
+	}
+}
+
+static void an8855_eee_setting(struct gsw_an8855 *gsw, u32 port)
+{
+	/* Disable EEE */
+	gsw->mmd_write(gsw, port, PHY_DEV07, PHY_DEV07_REG_03C, 0);
+}
+
+static int an8855_led_set_usr_def(struct gsw_an8855 *gsw, u8 entity,
+		int polar, u16 on_evt, u16 blk_evt, u8 led_freq)
+{
+	u32 cl45_data = 0;
+
+	if (polar == LED_HIGH)
+		on_evt |= LED_ON_POL;
+	else
+		on_evt &= ~LED_ON_POL;
+
+	/* LED on event */
+	gsw->mmd_write(gsw, (entity / 4), PHY_DEV1E,
+		PHY_SINGLE_LED_ON_CTRL(entity % 4), on_evt | LED_ON_EN);
+
+	/* LED blink event */
+	gsw->mmd_write(gsw, (entity / 4), PHY_DEV1E,
+		PHY_SINGLE_LED_BLK_CTRL(entity % 4), blk_evt);
+
+	/* LED freq */
+	switch (led_freq) {
+	case AIR_LED_BLK_DUR_32M:
+		cl45_data = 0x30e;
+		break;
+	case AIR_LED_BLK_DUR_64M:
+		cl45_data = 0x61a;
+		break;
+	case AIR_LED_BLK_DUR_128M:
+		cl45_data = 0xc35;
+		break;
+	case AIR_LED_BLK_DUR_256M:
+		cl45_data = 0x186a;
+		break;
+	case AIR_LED_BLK_DUR_512M:
+		cl45_data = 0x30d4;
+		break;
+	case AIR_LED_BLK_DUR_1024M:
+		cl45_data = 0x61a8;
+		break;
+	default:
+		break;
+	}
+	gsw->mmd_write(gsw, (entity / 4), PHY_DEV1E,
+		PHY_SINGLE_LED_BLK_DUR(entity % 4), cl45_data);
+
+	gsw->mmd_write(gsw, (entity / 4), PHY_DEV1E,
+		PHY_SINGLE_LED_ON_DUR(entity % 4), (cl45_data >> 1));
+
+	/* Disable DATA & BAD_SSD for port LED blink behavior */
+	cl45_data = gsw->mmd_read(gsw, (entity / 4), PHY_DEV1E,
+		PHY_PMA_CTRL);
+	cl45_data &= ~BIT(0);
+	cl45_data &= ~BIT(15);
+	gsw->mmd_write(gsw, (entity / 4), PHY_DEV1E,
+		PHY_PMA_CTRL, cl45_data);
+
+	return 0;
 }
 
-static void an8855_low_power_setting(struct gsw_an8855 *gsw)
+static int an8855_led_set_mode(struct gsw_an8855 *gsw, u8 mode)
 {
-	int port, addr;
+	u16 cl45_data;
 
-	for (port = 0; port < AN8855_NUM_PHYS; port++) {
-		gsw->mmd_write(gsw, port, 0x1e, 0x11, 0x0f00);
-		gsw->mmd_write(gsw, port, 0x1e, 0x3c, 0x0000);
-		gsw->mmd_write(gsw, port, 0x1e, 0x3d, 0x0000);
-		gsw->mmd_write(gsw, port, 0x1e, 0x3e, 0x0000);
-		gsw->mmd_write(gsw, port, 0x1e, 0xc6, 0x53aa);
+	cl45_data = gsw->mmd_read(gsw, 0, PHY_DEV1F, PHY_LED_BCR);
+	switch (mode) {
+	case AN8855_LED_MODE_DISABLE:
+		cl45_data &= ~LED_BCR_EXT_CTRL;
+		cl45_data &= ~LED_BCR_MODE_MASK;
+		cl45_data |= LED_BCR_MODE_DISABLE;
+		break;
+	case AN8855_LED_MODE_USER_DEFINE:
+		cl45_data |= LED_BCR_EXT_CTRL;
+		cl45_data |= LED_BCR_CLK_EN;
+		break;
+	default:
+		dev_info(gsw->dev, "LED mode%d is not supported!\n", mode);
+		return -EINVAL;
 	}
+	gsw->mmd_write(gsw, 0, PHY_DEV1F, PHY_LED_BCR, cl45_data);
 
-	gsw->mmd_write(gsw, 0, 0x1f, 0x268, 0x07f1);
-	gsw->mmd_write(gsw, 0, 0x1f, 0x269, 0x2111);
-	gsw->mmd_write(gsw, 0, 0x1f, 0x26a, 0x0000);
-	gsw->mmd_write(gsw, 0, 0x1f, 0x26b, 0x0074);
-	gsw->mmd_write(gsw, 0, 0x1f, 0x26e, 0x00f6);
-	gsw->mmd_write(gsw, 0, 0x1f, 0x26f, 0x6666);
-	gsw->mmd_write(gsw, 0, 0x1f, 0x271, 0x2c02);
-	gsw->mmd_write(gsw, 0, 0x1f, 0x272, 0x0c22);
-	gsw->mmd_write(gsw, 0, 0x1f, 0x700, 0x0001);
-	gsw->mmd_write(gsw, 0, 0x1f, 0x701, 0x0803);
-	gsw->mmd_write(gsw, 0, 0x1f, 0x702, 0x01b6);
-	gsw->mmd_write(gsw, 0, 0x1f, 0x703, 0x2111);
+	return 0;
+}
 
-	gsw->mmd_write(gsw, 1, 0x1f, 0x700, 0x0001);
+static int an8855_led_set_state(struct gsw_an8855 *gsw, u8 entity, u8 state)
+{
+	u16 cl45_data = 0;
+
+	/* Change to per port contorl */
+	cl45_data = gsw->mmd_read(gsw, (entity / 4), PHY_DEV1E,
+		PHY_LED_CTRL_SELECT);
+
+	if (state == 1)
+		cl45_data |= (1 << (entity % 4));
+	else
+		cl45_data &= ~(1 << (entity % 4));
+	gsw->mmd_write(gsw, (entity / 4), PHY_DEV1E,
+		PHY_LED_CTRL_SELECT, cl45_data);
+
+	/* LED enable setting */
+	cl45_data = gsw->mmd_read(gsw, (entity / 4),
+		PHY_DEV1E, PHY_SINGLE_LED_ON_CTRL(entity % 4));
 
-	for (addr = 0x200; addr <= 0x230; addr += 2)
-		gsw->mmd_write(gsw, 0, 0x1f, addr, 0x2020);
+	if (state == 1)
+		cl45_data |= LED_ON_EN;
+	else
+		cl45_data &= ~LED_ON_EN;
 
-	for (addr = 0x201; addr <= 0x231; addr += 2)
-		gsw->mmd_write(gsw, 0, 0x1f, addr, 0x0020);
+	gsw->mmd_write(gsw, (entity / 4), PHY_DEV1E,
+		PHY_SINGLE_LED_ON_CTRL(entity % 4), cl45_data);
+
+	return 0;
 }
 
-static void an8855_eee_setting(struct gsw_an8855 *gsw, u32 port)
+static int an8855_led_init(struct gsw_an8855 *gsw)
 {
-	/* Disable EEE */
-	gsw->mmd_write(gsw, port, PHY_DEV07, PHY_DEV07_REG_03C, 0);
+	u32 val, led_count = ARRAY_SIZE(led_cfg);
+	int ret = 0, id;
+	u32 tmp_val = 0;
+	u32 tmp_id = 0;
+
+	ret = an8855_led_set_mode(gsw, AN8855_LED_MODE_USER_DEFINE);
+	if (ret != 0) {
+		dev_info(gsw->dev, "led_set_mode fail(ret:%d)!\n", ret);
+		return ret;
+	}
+
+	for (id = 0; id < led_count; id++) {
+		ret = an8855_led_set_state(gsw,
+			led_cfg[id].phy_led_idx, led_cfg[id].en);
+		if (ret != 0) {
+			dev_info(gsw->dev, "led_set_state fail(ret:%d)!\n", ret);
+			return ret;
+		}
+		if (led_cfg[id].en == 1) {
+			ret = an8855_led_set_usr_def(gsw,
+				led_cfg[id].phy_led_idx,
+				led_cfg[id].pol, led_cfg[id].on_cfg,
+				led_cfg[id].blk_cfg,
+				led_cfg[id].led_freq);
+			if (ret != 0) {
+				dev_info(gsw->dev, "led_set_usr_def fail!\n");
+				return ret;
+			}
+		}
+	}
+
+	/* Setting for System LED & Loop LED */
+	an8855_reg_write(gsw, RG_GPIO_OE, 0x0);
+	an8855_reg_write(gsw, RG_GPIO_CTRL, 0x0);
+	val = 0;
+	an8855_reg_write(gsw, RG_GPIO_L_INV, val);
+
+	val = 0x1001;
+	an8855_reg_write(gsw, RG_GPIO_CTRL, val);
+	val = an8855_reg_read(gsw, RG_GPIO_DATA);
+	val |= BITS(1, 3);
+	val &= ~(BIT(0));
+	val &= ~(BIT(6));
+
+	an8855_reg_write(gsw, RG_GPIO_DATA, val);
+	val = an8855_reg_read(gsw, RG_GPIO_OE);
+	val |= 0x41;
+	an8855_reg_write(gsw, RG_GPIO_OE, val);
+
+	/* Mapping between GPIO & LED */
+	val = 0;
+	for (id = 0; id < led_count; id++) {
+		/* Skip GPIO6, due to GPIO6 does not support PORT LED */
+		if (id == 6)
+			continue;
+
+		if (led_cfg[id].en == 1) {
+			if (id < 7)
+				val |= led_cfg[id].phy_led_idx << ((id % 4) * 8);
+			else
+				val |= led_cfg[id].phy_led_idx << (((id - 1) % 4) * 8);
+		}
+
+		if (id < 7)
+			tmp_id = id;
+		else
+			tmp_id = id - 1;
+
+		if ((tmp_id % 4) == 0x3) {
+			an8855_reg_write(gsw, RG_GPIO_LED_SEL(tmp_id / 4), val);
+			tmp_val = an8855_reg_read(gsw, RG_GPIO_LED_SEL(tmp_id / 4));
+			val = 0;
+		}
+	}
+
+	/* Turn on LAN LED mode */
+	val = 0;
+	for (id = 0; id < led_count; id++) {
+		if (led_cfg[id].en == 1)
+			val |= 0x1 << id;
+	}
+	an8855_reg_write(gsw, RG_GPIO_LED_MODE, val);
+
+	/* Force clear blink pulse for per port LED */
+	gsw->mmd_write(gsw, 0, PHY_DEV1F, PHY_LED_BLINK_DUR_CTRL, 0x1f);
+	usleep_range(1000, 5000);
+	gsw->mmd_write(gsw, 0, PHY_DEV1F, PHY_LED_BLINK_DUR_CTRL, 0);
+
+	return 0;
 }
 
 static int an8855_sw_init(struct gsw_an8855 *gsw)
 {
-	int i;
-	u32 val;
+	int i, ret = 0;
+	u32 val, led_count = ARRAY_SIZE(led_cfg);
+	int id;
 
 	gsw->phy_base = gsw->smi_addr & AN8855_SMI_ADDR_MASK;
 
@@ -852,7 +1266,7 @@
 	an8855_reg_write(gsw, SYS_CTRL, SW_SYS_RST);
 	usleep_range(100000, 110000);
 
-	/* change gphy smi address */
+	/* Change gphy smi address */
 	if (gsw->new_smi_addr != gsw->smi_addr) {
 		an8855_reg_write(gsw, RG_GPHY_SMI_ADDR, gsw->new_smi_addr);
 		gsw->smi_addr = gsw->new_smi_addr;
@@ -865,6 +1279,59 @@
 		gsw->mii_write(gsw, i, MII_BMCR, val);
 	}
 
+	/* AN8855H need to setup before switch init */
+	val = an8855_reg_read(gsw, PKG_SEL);
+	if ((val & 0x7) == PAG_SEL_AN8855H) {
+
+		/* Invert for LED activity change */
+		val = an8855_reg_read(gsw, RG_GPIO_L_INV);
+		for (id = 0; id < led_count; id++) {
+			if ((led_cfg[id].pol == LED_HIGH) &&
+				(led_cfg[id].en == 1))
+				val |= 0x1 << id;
+		}
+		an8855_reg_write(gsw, RG_GPIO_L_INV, (val | 0x1));
+
+		/* MCU NOP CMD */
+		an8855_reg_write(gsw, RG_GDMP_RAM, 0x846);
+		an8855_reg_write(gsw, RG_GDMP_RAM + 4, 0x4a);
+
+		/* Enable MCU */
+		val = an8855_reg_read(gsw, RG_CLK_CPU_ICG);
+		an8855_reg_write(gsw, RG_CLK_CPU_ICG, val | MCU_ENABLE);
+		usleep_range(1000, 5000);
+
+		/* Disable MCU watchdog */
+		val = an8855_reg_read(gsw, RG_TIMER_CTL);
+		an8855_reg_write(gsw, RG_TIMER_CTL, (val & (~WDOG_ENABLE)));
+
+		/* Configure interrupt */
+		an8855_reg_write(gsw, RG_INTB_MODE, (0x1 << gsw->intr_pin));
+
+		/* LED settings for T830 reference board */
+		ret = an8855_led_init(gsw);
+		if (ret < 0) {
+			dev_info(gsw->dev, "an8855_led_init fail. (ret=%d)\n", ret);
+			return ret;
+		}
+	}
+
+	/* Adjust to reduce noise */
+	for (i = 0; i < AN8855_NUM_PHYS; i++) {
+		gsw->mmd_write(gsw, i, PHY_DEV1E,
+			PHY_TX_PAIR_DLY_SEL_GBE, 0x4040);
+
+		gsw->mmd_write(gsw, i, PHY_DEV1E,
+			PHY_RXADC_CTRL, 0x1010);
+
+		gsw->mmd_write(gsw, i, PHY_DEV1E,
+			PHY_RXADC_REV_0, 0x100);
+
+		gsw->mmd_write(gsw, i, PHY_DEV1E,
+			PHY_RXADC_REV_1, 0x100);
+	}
+
+	/* Setup SERDES port 5 */
 	an8855_mac_port_setup(gsw, 5, &gsw->port5_cfg);
 
 	/* Global mac control settings */
@@ -875,6 +1342,7 @@
 	val = an8855_reg_read(gsw, CKGCR);
 	val &= ~(CKG_LNKDN_GLB_STOP | CKG_LNKDN_PORT_STOP);
 	an8855_reg_write(gsw, CKGCR, val);
+
 	return 0;
 }
 
diff --git a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/phy/airoha/an8855/an8855.h b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/phy/airoha/an8855/an8855.h
index 883ba6e..5f84ee5 100644
--- a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/phy/airoha/an8855/an8855.h
+++ b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/phy/airoha/an8855/an8855.h
@@ -23,8 +23,24 @@
 
 #define AN8855_DFL_CPU_PORT		5
 #define AN8855_NUM_PHYS			5
+#define AN8855_WORD_SIZE		4
 #define AN8855_DFL_SMI_ADDR		0x1
 #define AN8855_SMI_ADDR_MASK	0x1f
+#define AN8855_DFL_INTR_ID		0xd
+#define AN8855_DFL_EXT_SURGE	0x0
+
+#define LED_ON_EVENT	(LED_ON_EVT_LINK_1000M | \
+			LED_ON_EVT_LINK_100M | LED_ON_EVT_LINK_10M |\
+			LED_ON_EVT_LINK_HD | LED_ON_EVT_LINK_FD)
+
+#define LED_BLK_EVENT	(LED_BLK_EVT_1000M_TX_ACT | \
+			LED_BLK_EVT_1000M_RX_ACT | \
+			LED_BLK_EVT_100M_TX_ACT | \
+			LED_BLK_EVT_100M_RX_ACT | \
+			LED_BLK_EVT_10M_TX_ACT | \
+			LED_BLK_EVT_10M_RX_ACT)
+
+#define LED_FREQ	AIR_LED_BLK_DUR_64M
 
 struct gsw_an8855;
 
@@ -37,6 +53,60 @@
 	SGMII_MODE_FORCE,
 };
 
+enum phy_led_idx {
+	P0_LED0,
+	P0_LED1,
+	P0_LED2,
+	P0_LED3,
+	P1_LED0,
+	P1_LED1,
+	P1_LED2,
+	P1_LED3,
+	P2_LED0,
+	P2_LED1,
+	P2_LED2,
+	P2_LED3,
+	P3_LED0,
+	P3_LED1,
+	P3_LED2,
+	P3_LED3,
+	P4_LED0,
+	P4_LED1,
+	P4_LED2,
+	P4_LED3,
+	PHY_LED_MAX
+};
+
+/* TBD */
+enum an8855_led_blk_dur {
+	AIR_LED_BLK_DUR_32M,
+	AIR_LED_BLK_DUR_64M,
+	AIR_LED_BLK_DUR_128M,
+	AIR_LED_BLK_DUR_256M,
+	AIR_LED_BLK_DUR_512M,
+	AIR_LED_BLK_DUR_1024M,
+	AIR_LED_BLK_DUR_LAST
+};
+
+enum an8855_led_polarity {
+	LED_LOW,
+	LED_HIGH,
+};
+enum an8855_led_mode {
+	AN8855_LED_MODE_DISABLE,
+	AN8855_LED_MODE_USER_DEFINE,
+	AN8855_LED_MODE_LAST
+};
+
+struct an8855_led_cfg {
+	u16 en;
+	u8  phy_led_idx;
+	u16 pol;
+	u16 on_cfg;
+	u16 blk_cfg;
+	u8 led_freq;
+};
+
 struct an8855_port_cfg {
 	struct device_node *np;
 	phy_interface_t phy_mode;
@@ -55,6 +125,8 @@
 	u32 smi_addr;
 	u32 new_smi_addr;
 	u32 phy_base;
+	u32 intr_pin;
+	u32 extSurge;
 
 	enum an8855_model model;
 	const char *name;
diff --git a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/phy/airoha/an8855/an8855_mdio.c b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/phy/airoha/an8855/an8855_mdio.c
index 920240d..a4eb389 100644
--- a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/phy/airoha/an8855/an8855_mdio.c
+++ b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/phy/airoha/an8855/an8855_mdio.c
@@ -1,4 +1,4 @@
-// SPDX-License-Identifian8855_gsw_ider: GPL-2.0
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright (c) 2023 Airoha Inc.
  * Author: Min Yao <min.yao@airoha.com>
@@ -18,6 +18,9 @@
 #include <linux/of_net.h>
 #include <linux/of_irq.h>
 #include <linux/phy.h>
+#include <linux/version.h>
+#include <linux/seq_file.h>
+#include <linux/proc_fs.h>
 
 #include "an8855.h"
 #include "an8855_swconfig.h"
@@ -25,11 +28,15 @@
 #include "an8855_nl.h"
 
 /* AN8855 driver version */
-#define ARHT_AN8855_SWCFG_DRIVER_VER	"1.0.1-L5.4"
+#define ARHT_AN8855_SWCFG_DRIVER_VER	"1.0.6"
+#define ARHT_CHIP_NAME                  "an8855"
+#define ARHT_PROC_DIR                   "air_sw"
+#define ARHT_PROC_NODE_DEVICE           "device"
 
 static u32 an8855_gsw_id;
 struct list_head an8855_devs;
 static DEFINE_MUTEX(an8855_devs_lock);
+struct proc_dir_entry *proc_an8855_gsw_dir;
 
 static struct an8855_sw_id *an8855_sw_ids[] = {
 	&an8855_id,
@@ -53,7 +60,6 @@
 	high = gsw->host_bus->read(gsw->host_bus, gsw->smi_addr, 0x17);
 
 	gsw->host_bus->write(gsw->host_bus, gsw->smi_addr, 0x1f, 0x0);
-	gsw->host_bus->write(gsw->host_bus, gsw->smi_addr, 0x10, 0x0);
 
 	mutex_unlock(&gsw->host_bus->mdio_lock);
 
@@ -78,7 +84,6 @@
 			     (val & 0xFFFF));
 
 	gsw->host_bus->write(gsw->host_bus, gsw->smi_addr, 0x1f, 0x0);
-	gsw->host_bus->write(gsw->host_bus, gsw->smi_addr, 0x10, 0x0);
 
 	mutex_unlock(&gsw->host_bus->mdio_lock);
 }
@@ -110,13 +115,17 @@
 int an8855_mmd_read(struct gsw_an8855 *gsw, int addr, int devad, u16 reg)
 {
 	int val;
-	u32 regnum = MII_ADDR_C45 | (devad << 16) | reg;
 
 	if (addr < AN8855_NUM_PHYS)
 		addr = (gsw->phy_base + addr) & AN8855_SMI_ADDR_MASK;
 
 	mutex_lock(&gsw->host_bus->mdio_lock);
-	val = gsw->host_bus->read(gsw->host_bus, addr, regnum);
+
+	gsw->host_bus->write(gsw->host_bus, addr, 0x0d, devad);
+	gsw->host_bus->write(gsw->host_bus, addr, 0x0e, reg);
+	gsw->host_bus->write(gsw->host_bus, addr, 0x0d, devad | (0x4000));
+	val = gsw->host_bus->read(gsw->host_bus, addr, 0xe);
+
 	mutex_unlock(&gsw->host_bus->mdio_lock);
 
 	return val;
@@ -125,13 +134,16 @@
 void an8855_mmd_write(struct gsw_an8855 *gsw, int addr, int devad, u16 reg,
 		      u16 val)
 {
-	u32 regnum = MII_ADDR_C45 | (devad << 16) | reg;
-
 	if (addr < AN8855_NUM_PHYS)
 		addr = (gsw->phy_base + addr) & AN8855_SMI_ADDR_MASK;
 
 	mutex_lock(&gsw->host_bus->mdio_lock);
-	gsw->host_bus->write(gsw->host_bus, addr, regnum, val);
+
+	gsw->host_bus->write(gsw->host_bus, addr, 0x0d, devad);
+	gsw->host_bus->write(gsw->host_bus, addr, 0x0e, reg);
+	gsw->host_bus->write(gsw->host_bus, addr, 0x0d, devad | (0x4000));
+	gsw->host_bus->write(gsw->host_bus, addr, 0x0e, val);
+
 	mutex_unlock(&gsw->host_bus->mdio_lock);
 }
 
@@ -146,6 +158,10 @@
 	struct device_node *fixed_link_node;
 	struct an8855_port_cfg *port_cfg;
 	u32 port;
+#if (KERNEL_VERSION(5, 5, 0) <= LINUX_VERSION_CODE)
+	int ret;
+
+#endif
 
 	for_each_child_of_node(gsw->dev->of_node, port_np) {
 		if (!of_device_is_compatible(port_np, "airoha,an8855-port"))
@@ -172,9 +188,13 @@
 		}
 
 		port_cfg->np = port_np;
-
+#if (KERNEL_VERSION(5, 5, 0) <= LINUX_VERSION_CODE)
+		ret = of_get_phy_mode(port_np, &port_cfg->phy_mode);
+		if (ret < 0) {
+#else
 		port_cfg->phy_mode = of_get_phy_mode(port_np);
 		if (port_cfg->phy_mode < 0) {
+#endif
 			dev_info(gsw->dev, "incorrect phy-mode %d\n", port);
 			continue;
 		}
@@ -296,6 +316,7 @@
 	}
 
 	gpio_direction_output(gsw->reset_pin, 0);
+	gpio_set_value(gsw->reset_pin, 0);
 	usleep_range(100000, 150000);
 	gpio_set_value(gsw->reset_pin, 1);
 	usleep_range(100000, 150000);
@@ -314,6 +335,51 @@
 	return IRQ_HANDLED;
 }
 
+static int an8855_proc_device_read(struct seq_file *seq, void *v)
+{
+	seq_printf(seq, "%s\n", ARHT_CHIP_NAME);
+
+	return 0;
+}
+
+static int an8855_proc_device_open(struct inode *inode, struct file *file)
+{
+	return single_open(file, an8855_proc_device_read, 0);
+}
+
+#if (KERNEL_VERSION(5, 6, 0) <= LINUX_VERSION_CODE)
+static const struct proc_ops an8855_proc_device_fops = {
+	.proc_open	= an8855_proc_device_open,
+	.proc_read	= seq_read,
+	.proc_lseek	= seq_lseek,
+	.proc_release	= single_release,
+};
+#else
+static const struct file_operations an8855_proc_device_fops = {
+	.owner	= THIS_MODULE,
+	.open	= an8855_proc_device_open,
+	.read	= seq_read,
+	.llseek	= seq_lseek,
+	.release	= single_release,
+};
+#endif
+
+static int an8855_proc_device_init(struct gsw_an8855 *gsw)
+{
+	if (!proc_an8855_gsw_dir)
+		proc_an8855_gsw_dir = proc_mkdir(ARHT_PROC_DIR, 0);
+
+	proc_create(ARHT_PROC_NODE_DEVICE, 0400, proc_an8855_gsw_dir,
+			&an8855_proc_device_fops);
+
+	return 0;
+}
+
+static void an8855_proc_device_exit(void)
+{
+	remove_proc_entry(ARHT_PROC_NODE_DEVICE, 0);
+}
+
 static int an8855_probe(struct platform_device *pdev)
 {
 	struct gsw_an8855 *gsw;
@@ -355,6 +421,14 @@
 	if (of_property_read_u32(np, "airoha,smi-addr", &gsw->new_smi_addr))
 		gsw->new_smi_addr = AN8855_DFL_SMI_ADDR;
 
+	/* Assign AN8855 interrupt pin */
+	if (of_property_read_u32(np, "airoha,intr", &gsw->intr_pin))
+		gsw->intr_pin = AN8855_DFL_INTR_ID;
+
+	/* AN8855 surge enhancement */
+	if (of_property_read_u32(np, "airoha,extSurge", &gsw->extSurge))
+		gsw->extSurge = AN8855_DFL_EXT_SURGE;
+
 	/* Get LAN/WAN port mapping */
 	map = an8855_find_mapping(np);
 	if (map) {
@@ -411,6 +485,8 @@
 
 	an8855_gsw_nl_init();
 
+	an8855_proc_device_init(gsw);
+
 	an8855_swconfig_init(gsw);
 
 	if (sw->post_init)
@@ -441,6 +517,8 @@
 	an8855_swconfig_destroy(gsw);
 #endif
 
+	an8855_proc_device_exit();
+
 	an8855_gsw_nl_exit();
 
 	an8855_remove_gsw(gsw);
diff --git a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/phy/airoha/an8855/an8855_nl.c b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/phy/airoha/an8855/an8855_nl.c
index 37e3dad..f5af6d3 100644
--- a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/phy/airoha/an8855/an8855_nl.c
+++ b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/phy/airoha/an8855/an8855_nl.c
@@ -26,8 +26,8 @@
 static const struct nla_policy an8855_nl_cmd_policy[] = {
 	[AN8855_ATTR_TYPE_MESG] = { .type = NLA_STRING },
 	[AN8855_ATTR_TYPE_PHY] = { .type = NLA_S32 },
-	[AN8855_ATTR_TYPE_REG] = { .type = NLA_S32 },
-	[AN8855_ATTR_TYPE_VAL] = { .type = NLA_S32 },
+	[AN8855_ATTR_TYPE_REG] = { .type = NLA_U32 },
+	[AN8855_ATTR_TYPE_VAL] = { .type = NLA_U32 },
 	[AN8855_ATTR_TYPE_DEV_NAME] = { .type = NLA_S32 },
 	[AN8855_ATTR_TYPE_DEV_ID] = { .type = NLA_S32 },
 	[AN8855_ATTR_TYPE_DEVAD] = { .type = NLA_S32 },
@@ -202,15 +202,15 @@
 static int an8855_nl_reply_read(struct genl_info *info, struct gsw_an8855 *gsw)
 {
 	struct sk_buff *rep_skb = NULL;
-	s32 phy, devad, reg;
-	int value;
+	s32 phy, devad;
+	u32 reg = 0;
+	int value = 0;
 	int ret = 0;
 
 	phy = an8855_nl_get_s32(info, AN8855_ATTR_TYPE_PHY, -1);
 	devad = an8855_nl_get_s32(info, AN8855_ATTR_TYPE_DEVAD, -1);
-	reg = an8855_nl_get_s32(info, AN8855_ATTR_TYPE_REG, -1);
 
-	if (reg < 0)
+	if (an8855_nl_get_u32(info, AN8855_ATTR_TYPE_REG, &reg))
 		goto err;
 
 	ret = an8855_nl_prepare_reply(info, AN8855_CMD_READ, &rep_skb);
@@ -226,11 +226,11 @@
 		value = an8855_reg_read(gsw, reg);
 	}
 
-	ret = nla_put_s32(rep_skb, AN8855_ATTR_TYPE_REG, reg);
+	ret = nla_put_u32(rep_skb, AN8855_ATTR_TYPE_REG, reg);
 	if (ret < 0)
 		goto err;
 
-	ret = nla_put_s32(rep_skb, AN8855_ATTR_TYPE_VAL, value);
+	ret = nla_put_u32(rep_skb, AN8855_ATTR_TYPE_VAL, value);
 	if (ret < 0)
 		goto err;
 
@@ -246,18 +246,16 @@
 static int an8855_nl_reply_write(struct genl_info *info, struct gsw_an8855 *gsw)
 {
 	struct sk_buff *rep_skb = NULL;
-	s32 phy, devad, reg;
-	u32 value;
+	s32 phy, devad;
+	u32 value = 0, reg = 0;
 	int ret = 0;
 
 	phy = an8855_nl_get_s32(info, AN8855_ATTR_TYPE_PHY, -1);
 	devad = an8855_nl_get_s32(info, AN8855_ATTR_TYPE_DEVAD, -1);
-	reg = an8855_nl_get_s32(info, AN8855_ATTR_TYPE_REG, -1);
-
-	if (an8855_nl_get_u32(info, AN8855_ATTR_TYPE_VAL, &value))
+	if (an8855_nl_get_u32(info, AN8855_ATTR_TYPE_REG, &reg))
 		goto err;
 
-	if (reg < 0)
+	if (an8855_nl_get_u32(info, AN8855_ATTR_TYPE_VAL, &value))
 		goto err;
 
 	ret = an8855_nl_prepare_reply(info, AN8855_CMD_WRITE, &rep_skb);
@@ -273,11 +271,11 @@
 		an8855_reg_write(gsw, reg, value);
 	}
 
-	ret = nla_put_s32(rep_skb, AN8855_ATTR_TYPE_REG, reg);
+	ret = nla_put_u32(rep_skb, AN8855_ATTR_TYPE_REG, reg);
 	if (ret < 0)
 		goto err;
 
-	ret = nla_put_s32(rep_skb, AN8855_ATTR_TYPE_VAL, value);
+	ret = nla_put_u32(rep_skb, AN8855_ATTR_TYPE_VAL, value);
 	if (ret < 0)
 		goto err;
 
diff --git a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/phy/airoha/an8855/an8855_regs.h b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/phy/airoha/an8855/an8855_regs.h
index 9dbfaeb..32790a1 100644
--- a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/phy/airoha/an8855/an8855_regs.h
+++ b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/phy/airoha/an8855/an8855_regs.h
@@ -85,10 +85,10 @@
 #define PMCR(p)					PORT_MAC_CTRL_REG(p, 0x00)
 #define PMSR(p)					PORT_MAC_CTRL_REG(p, 0x10)
 
-#define GMACCR					(PORT_MAC_CTRL_BASE + 0x30e0)
+#define GMACCR					(PORT_MAC_CTRL_BASE + 0x3e00)
 
-#define MAX_RX_JUMBO_S			2
-#define MAX_RX_JUMBO_M			0x3c
+#define MAX_RX_JUMBO_S			4
+#define MAX_RX_JUMBO_M			0xf0
 #define MAX_RX_PKT_LEN_S		0
 #define MAX_RX_PKT_LEN_M		0x3
 
@@ -172,6 +172,12 @@
 #define STATS_RSFTPC		0xF8
 #define STATS_RXCDPC		0xFC
 
+#define RG_CLK_CPU_ICG		0x10005034
+#define MCU_ENABLE			BIT(3)
+
+#define RG_TIMER_CTL		0x1000a100
+#define WDOG_ENABLE			BIT(25)
+
 #define SYS_CTRL			0x100050C0
 #define SW_SYS_RST			BIT(31)
 
@@ -182,7 +188,10 @@
 #define SYS_INT_STS			0x1021C014
 #define PHY_LC_INT(p)		BIT(p)
 
-#define CKGCR				(0x10213E1C)
-#define CKG_LNKDN_GLB_STOP	(0x01)
-#define CKG_LNKDN_PORT_STOP	(0x02)
+#define CKGCR				0x10213E1C
+#define CKG_LNKDN_GLB_STOP	0x01
+#define CKG_LNKDN_PORT_STOP	0x02
+
+#define PKG_SEL				0x10000094
+#define PAG_SEL_AN8855H		0x2
 #endif /* _AN8855_REGS_H_ */
diff --git a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/phy/airoha/an8855/an8855_swconfig.c b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/phy/airoha/an8855/an8855_swconfig.c
index e796582..2dd2ffd 100644
--- a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/phy/airoha/an8855/an8855_swconfig.c
+++ b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/phy/airoha/an8855/an8855_swconfig.c
@@ -125,7 +125,7 @@
 {
 	struct gsw_an8855 *gsw = container_of(dev, struct gsw_an8855, swdev);
 
-	if (port >= AN8855_NUM_PORTS)
+	if (port < 0 || port >= AN8855_NUM_PORTS)
 		return -EINVAL;
 
 	*val = an8855_reg_read(gsw, PVID(port));
@@ -138,7 +138,7 @@
 {
 	struct gsw_an8855 *gsw = container_of(dev, struct gsw_an8855, swdev);
 
-	if (port >= AN8855_NUM_PORTS)
+	if (port < 0 || port >= AN8855_NUM_PORTS)
 		return -EINVAL;
 
 	if (pvid < AN8855_MIN_VID || pvid > AN8855_MAX_VID)
@@ -300,18 +300,20 @@
 static u64 get_mib_counter(struct gsw_an8855 *gsw, int i, int port)
 {
 	unsigned int offset;
-	u64 lo, hi, hi2;
+	u64 lo = 0, hi = 0, hi2 = 0;
 
-	offset = an8855_mibs[i].offset;
+	if (i >= 0) {
+		offset = an8855_mibs[i].offset;
 
-	if (an8855_mibs[i].size == 1)
-		return an8855_reg_read(gsw, MIB_COUNTER_REG(port, offset));
+		if (an8855_mibs[i].size == 1)
+			return an8855_reg_read(gsw, MIB_COUNTER_REG(port, offset));
 
-	do {
-		hi = an8855_reg_read(gsw, MIB_COUNTER_REG(port, offset + 4));
-		lo = an8855_reg_read(gsw, MIB_COUNTER_REG(port, offset));
-		hi2 = an8855_reg_read(gsw, MIB_COUNTER_REG(port, offset + 4));
-	} while (hi2 != hi);
+		do {
+			hi = an8855_reg_read(gsw, MIB_COUNTER_REG(port, offset + 4));
+			lo = an8855_reg_read(gsw, MIB_COUNTER_REG(port, offset));
+			hi2 = an8855_reg_read(gsw, MIB_COUNTER_REG(port, offset + 4));
+		} while (hi2 != hi);
+	}
 
 	return (hi << 32) | lo;
 }
@@ -370,7 +372,7 @@
 	an8855_reg_write(gsw, PORTMATRIX(gsw->cpu_port), PORT_MATRIX_M);
 
 	for (i = 0; i < AN8855_NUM_PORTS; i++) {
-		u32 pvc_mode = 0x8100 << STAG_VPID_S;
+		u32 pvc_mode = 0x9100 << STAG_VPID_S;
 
 		if (gsw->port5_cfg.stag_on && i == 5)
 			pvc_mode |= PVC_PORT_STAG | PVC_STAG_REPLACE;
diff --git a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/phy/airoha/an8855/an8855_vlan.c b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/phy/airoha/an8855/an8855_vlan.c
index 6ef8c99..1a1d751 100644
--- a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/phy/airoha/an8855/an8855_vlan.c
+++ b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/files-5.4/drivers/net/phy/airoha/an8855/an8855_vlan.c
@@ -11,19 +11,19 @@
 		.name = "llllw",
 		.pvids = { 1, 1, 1, 1, 2, 1 },
 		.members = { 0, 0x2f, 0x30 },
-		.etags = { 0, 0, 0x20 },
+		.etags = { 0, 0, 0 },
 		.vids = { 0, 1, 2 },
 	}, {
 		.name = "wllll",
 		.pvids = { 2, 1, 1, 1, 1, 1 },
 		.members = { 0, 0x3e, 0x21 },
-		.etags = { 0, 0, 0x20 },
+		.etags = { 0, 0, 0 },
 		.vids = { 0, 1, 2 },
 	}, {
 		.name = "lwlll",
 		.pvids = { 1, 2, 1, 1, 1, 1 },
 		.members = { 0, 0x3d, 0x22 },
-		.etags = { 0, 0, 0x20 },
+		.etags = { 0, 0, 0 },
 		.vids = { 0, 1, 2 },
 	}, {
 		.name = "lllll",
@@ -124,14 +124,14 @@
 
 	/* set all untag-only ports as transparent and the rest as user port */
 	for (i = 0; i < AN8855_NUM_PORTS; i++) {
-		u32 pvc_mode = 0x8100 << STAG_VPID_S;
+		u32 pvc_mode = 0x9100 << STAG_VPID_S;
 
 		if (untag_ports & BIT(i) && !(tag_ports & BIT(i)))
-			pvc_mode = (0x8100 << STAG_VPID_S) |
+			pvc_mode = (0x9100 << STAG_VPID_S) |
 				(VA_TRANSPARENT_PORT << VLAN_ATTR_S);
 
 		if (gsw->port5_cfg.stag_on && i == 5)
-			pvc_mode = (u32)((0x8100 << STAG_VPID_S) | PVC_PORT_STAG
+			pvc_mode = (u32)((0x9100 << STAG_VPID_S) | PVC_PORT_STAG
 						| PVC_STAG_REPLACE);
 
 		an8855_reg_write(gsw, PVC(i), pvc_mode);
@@ -159,7 +159,8 @@
 		u16 pvid = 0;
 		u32 val;
 
-		if (vlan < AN8855_NUM_VLANS && gsw->vlan_entries[vlan].member)
+		if ((vlan >= 0) && (vlan < AN8855_NUM_VLANS)
+			&& (gsw->vlan_entries[vlan].member))
 			pvid = gsw->vlan_entries[vlan].vid;
 
 		val = an8855_reg_read(gsw, PVID(i));
diff --git a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/flow_patch/999-3001-mt7622-backport-nf-hw-offload-framework-and-upstream.patch b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/flow_patch/999-3001-mt7622-backport-nf-hw-offload-framework-and-upstream.patch
index b0eb98b..ec39c96 100644
--- a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/flow_patch/999-3001-mt7622-backport-nf-hw-offload-framework-and-upstream.patch
+++ b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/flow_patch/999-3001-mt7622-backport-nf-hw-offload-framework-and-upstream.patch
@@ -3101,10 +3101,10 @@
  static struct dst_entry	*ip6_dst_check(struct dst_entry *dst, u32 cookie);
  static unsigned int	 ip6_default_advmss(const struct dst_entry *dst);
 -static unsigned int	 ip6_mtu(const struct dst_entry *dst);
-+static unsigned int	ip6_mtu(const struct dst_entry *dst);
- static struct dst_entry *ip6_negative_advice(struct dst_entry *);
++static unsigned int    ip6_mtu(const struct dst_entry *dst);
+ static void		ip6_negative_advice(struct sock *sk,
+ 					    struct dst_entry *dst);
  static void		ip6_dst_destroy(struct dst_entry *);
- static void		ip6_dst_ifdown(struct dst_entry *,
 @@ -3125,25 +3125,7 @@ static unsigned int ip6_default_advmss(const struct dst_entry *dst)
  
  static unsigned int ip6_mtu(const struct dst_entry *dst)
diff --git a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/patches-5.4/0005-dts-mt7622-add-gsw.patch b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/patches-5.4/0005-dts-mt7622-add-gsw.patch
index fb959ce..73aba88 100644
--- a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/patches-5.4/0005-dts-mt7622-add-gsw.patch
+++ b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/patches-5.4/0005-dts-mt7622-add-gsw.patch
@@ -1,3 +1,5 @@
+diff --git a/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts b/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts
+index eec9ec1..84df1ca 100644
 --- a/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts
 +++ b/arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts
 @@ -53,6 +53,13 @@
@@ -14,7 +16,7 @@
  	leds {
  		compatible = "gpio-leds";
  
-@@ -146,6 +153,36 @@
+@@ -147,6 +154,36 @@
  	};
  };
  
@@ -51,6 +53,8 @@
  &i2c1 {
  	pinctrl-names = "default";
  	pinctrl-0 = <&i2c1_pins>;
+diff --git a/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts b/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts
+index ee57fcc..0fc2dcb 100644
 --- a/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts
 +++ b/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts
 @@ -1,7 +1,6 @@
@@ -81,7 +85,7 @@
  	};
  
  	cpus {
-@@ -39,23 +39,36 @@
+@@ -40,23 +39,36 @@
  
  	gpio-keys {
  		compatible = "gpio-keys";
@@ -115,14 +119,14 @@
 +			gpios = <&pio 88 GPIO_ACTIVE_HIGH>;
 + 		};
 + 	};
-+	
++
  	memory@40000000 {
 -		reg = <0 0x40000000 0 0x20000000>;
 +		reg = <0 0x40000000 0 0x40000000>;
+ 		device_type = "memory";
  	};
  
- 	reg_1p8v: regulator-1p8v {
-@@ -101,23 +113,82 @@
+@@ -102,24 +114,83 @@
  };
  
  &eth {
@@ -162,6 +166,7 @@
 -		phy5: ethernet-phy@5 {
 -			reg = <5>;
 -			phy-mode = "sgmii";
+-		};
 +		switch@0 {
 +			compatible = "mediatek,mt7531";
 +			reg = <0>;
@@ -209,24 +214,11 @@
 +					};
 +				};
 +			};
- 		};
++ 		};
  	};
  };
-@@ -185,15 +256,28 @@
  
- &pcie {
- 	pinctrl-names = "default";
--	pinctrl-0 = <&pcie0_pins>;
-+	pinctrl-0 = <&pcie0_pins>, <&pcie1_pins>;
- 	status = "okay";
- 
- 	pcie@0,0 {
- 		status = "okay";
- 	};
-+
-+	pcie@1,0 {
-+		status = "okay";
-+	};
+@@ -195,6 +266,15 @@
  };
  
  &pio {
@@ -242,7 +234,7 @@
  	/* eMMC is shared pin with parallel NAND */
  	emmc_pins_default: emmc-pins-default {
  		mux {
-@@ -460,11 +544,11 @@
+@@ -461,11 +541,11 @@
  };
  
  &sata {
diff --git a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/patches-5.4/0993-arm64-dts-mediatek-Split-PCIe-node-for-MT2712-MT7622.patch b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/patches-5.4/0993-arm64-dts-mediatek-Split-PCIe-node-for-MT2712-MT7622.patch
index 4fe0e0f..14999a5 100644
--- a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/patches-5.4/0993-arm64-dts-mediatek-Split-PCIe-node-for-MT2712-MT7622.patch
+++ b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/patches-5.4/0993-arm64-dts-mediatek-Split-PCIe-node-for-MT2712-MT7622.patch
@@ -389,25 +389,20 @@
  					<0 0 0 2 &pcie_intc1 1>,
 --- a/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts
 +++ b/arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts
-@@ -254,18 +254,16 @@
+@@ -184,14 +184,16 @@
  	};
  };
  
 -&pcie {
 +&pcie0 {
  	pinctrl-names = "default";
--	pinctrl-0 = <&pcie0_pins>, <&pcie1_pins>;
-+	pinctrl-0 = <&pcie0_pins>;
+ 	pinctrl-0 = <&pcie0_pins>;
  	status = "okay";
 +};
  
 -	pcie@0,0 {
 -		status = "okay";
 -	};
--
--	pcie@1,0 {
--		status = "okay";
--	};
 +&pcie1 {
 +	pinctrl-names = "default";
 +	pinctrl-0 = <&pcie1_pins>;
diff --git a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/patches-5.4/999-1402-v6.4-mtd-spinand-backport-series-flash.patch b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/patches-5.4/999-1402-v6.4-mtd-spinand-backport-series-flash.patch
index d3434eb..e0c59d5 100644
--- a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/patches-5.4/999-1402-v6.4-mtd-spinand-backport-series-flash.patch
+++ b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/patches-5.4/999-1402-v6.4-mtd-spinand-backport-series-flash.patch
@@ -442,7 +442,7 @@
  		     NAND_MEMORG(1, 2048, 64, 64, 2048, 40, 2, 1, 1),
  		     NAND_ECCREQ(4, 512),
  		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
-@@ -116,51 +118,194 @@ static const struct spinand_info macroni
+@@ -116,23 +118,76 @@ static const struct spinand_info macroni
  					      &update_cache_variants),
  		     SPINAND_HAS_QE_BIT,
  		     SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout, NULL)),
@@ -455,16 +455,18 @@
  					      &write_cache_variants,
  					      &update_cache_variants),
  		     SPINAND_HAS_QE_BIT,
+-		     SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout, NULL)),
+-	SPINAND_INFO("MX35LF4GE4AD", 0x37,
 +		     SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout,
 +				     mx35lf1ge4ab_ecc_get_status)),
 +	SPINAND_INFO("MX35LF4GE4AD",
 +		     SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x37),
-+		     NAND_MEMORG(1, 4096, 128, 64, 2048, 40, 1, 1, 1),
-+		     NAND_ECCREQ(8, 512),
-+		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
-+					      &write_cache_variants,
-+					      &update_cache_variants),
-+		     SPINAND_HAS_QE_BIT,
+ 		     NAND_MEMORG(1, 4096, 128, 64, 2048, 40, 1, 1, 1),
+ 		     NAND_ECCREQ(8, 512),
+ 		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
+ 					      &write_cache_variants,
+ 					      &update_cache_variants),
+ 		     SPINAND_HAS_QE_BIT,
 +		     SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout,
 +				     mx35lf1ge4ab_ecc_get_status)),
 +	SPINAND_INFO("MX35LF1G24AD",
@@ -476,30 +478,16 @@
 +					      &update_cache_variants),
 +		     SPINAND_HAS_QE_BIT,
  		     SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout, NULL)),
--	SPINAND_INFO("MX35LF4GE4AD", 0x37,
--		     NAND_MEMORG(1, 4096, 128, 64, 2048, 40, 1, 1, 1),
+-	SPINAND_INFO("MX35LF2G14AC", 0x20,
 +	SPINAND_INFO("MX35LF2G24AD",
 +		     SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x24),
 +		     NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 2, 1, 1),
- 		     NAND_ECCREQ(8, 512),
- 		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
- 					      &write_cache_variants,
- 					      &update_cache_variants),
- 		     SPINAND_HAS_QE_BIT,
- 		     SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout, NULL)),
--};
--
--static int macronix_spinand_detect(struct spinand_device *spinand)
--{
--	u8 *id = spinand->id.data;
--	int ret;
--
--	/*
--	 * Macronix SPI NAND read ID needs a dummy byte, so the first byte in
--	 * raw_id is garbage.
--	 */
--	if (id[1] != SPINAND_MFR_MACRONIX)
--		return 0;
++		     NAND_ECCREQ(8, 512),
++		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
++					      &write_cache_variants,
++					      &update_cache_variants),
++		     SPINAND_HAS_QE_BIT,
++		     SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout, NULL)),
 +	SPINAND_INFO("MX35LF4G24AD",
 +		     SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x35),
 +		     NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 2, 1, 1),
@@ -529,131 +517,133 @@
 +		     SPINAND_HAS_QE_BIT,
 +		     SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout,
 +				     mx35lf1ge4ab_ecc_get_status)),
- 
--	ret = spinand_match_and_init(spinand, macronix_spinand_table,
--				     ARRAY_SIZE(macronix_spinand_table),
--				     id[2]);
--	if (ret)
--		return ret;
++
 +	SPINAND_INFO("MX35LF2G14AC",
 +		     SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x20),
-+		     NAND_MEMORG(1, 2048, 64, 64, 2048, 40, 2, 1, 1),
-+		     NAND_ECCREQ(4, 512),
-+		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
-+					      &write_cache_variants,
-+					      &update_cache_variants),
-+		     SPINAND_HAS_QE_BIT,
-+		     SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout,
-+				     mx35lf1ge4ab_ecc_get_status)),
+ 		     NAND_MEMORG(1, 2048, 64, 64, 2048, 40, 2, 1, 1),
+ 		     NAND_ECCREQ(4, 512),
+ 		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
+@@ -141,7 +196,8 @@ static const struct spinand_info macroni
+ 		     SPINAND_HAS_QE_BIT,
+ 		     SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout,
+ 				     mx35lf1ge4ab_ecc_get_status)),
+-	SPINAND_INFO("MX35UF4G24AD", 0xb5,
 +	SPINAND_INFO("MX35UF4G24AD",
 +		     SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xb5),
-+		     NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 2, 1, 1),
-+		     NAND_ECCREQ(8, 512),
-+		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
-+					      &write_cache_variants,
-+					      &update_cache_variants),
-+		     SPINAND_HAS_QE_BIT,
-+		     SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout,
-+				     mx35lf1ge4ab_ecc_get_status)),
+ 		     NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 2, 1, 1),
+ 		     NAND_ECCREQ(8, 512),
+ 		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
+@@ -150,7 +206,8 @@ static const struct spinand_info macroni
+ 		     SPINAND_HAS_QE_BIT,
+ 		     SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout,
+ 				     mx35lf1ge4ab_ecc_get_status)),
+-	SPINAND_INFO("MX35UF4GE4AD", 0xb7,
 +	SPINAND_INFO("MX35UF4GE4AD",
 +		     SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xb7),
-+		     NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 1, 1, 1),
-+		     NAND_ECCREQ(8, 512),
-+		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
-+					      &write_cache_variants,
-+					      &update_cache_variants),
-+		     SPINAND_HAS_QE_BIT,
-+		     SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout,
-+				     mx35lf1ge4ab_ecc_get_status)),
+ 		     NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 1, 1, 1),
+ 		     NAND_ECCREQ(8, 512),
+ 		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
+@@ -159,7 +216,8 @@ static const struct spinand_info macroni
+ 		     SPINAND_HAS_QE_BIT,
+ 		     SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout,
+ 				     mx35lf1ge4ab_ecc_get_status)),
+-	SPINAND_INFO("MX35UF2G14AC", 0xa0,
 +	SPINAND_INFO("MX35UF2G14AC",
 +		     SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xa0),
-+		     NAND_MEMORG(1, 2048, 64, 64, 2048, 40, 2, 1, 1),
-+		     NAND_ECCREQ(4, 512),
-+		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
-+					      &write_cache_variants,
-+					      &update_cache_variants),
-+		     SPINAND_HAS_QE_BIT,
-+		     SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout,
-+				     mx35lf1ge4ab_ecc_get_status)),
+ 		     NAND_MEMORG(1, 2048, 64, 64, 2048, 40, 2, 1, 1),
+ 		     NAND_ECCREQ(4, 512),
+ 		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
+@@ -168,7 +226,8 @@ static const struct spinand_info macroni
+ 		     SPINAND_HAS_QE_BIT,
+ 		     SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout,
+ 				     mx35lf1ge4ab_ecc_get_status)),
+-	SPINAND_INFO("MX35UF2G24AD", 0xa4,
 +	SPINAND_INFO("MX35UF2G24AD",
 +		     SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xa4),
-+		     NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 2, 1, 1),
-+		     NAND_ECCREQ(8, 512),
-+		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
-+					      &write_cache_variants,
-+					      &update_cache_variants),
-+		     SPINAND_HAS_QE_BIT,
-+		     SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout,
-+				     mx35lf1ge4ab_ecc_get_status)),
+ 		     NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 2, 1, 1),
+ 		     NAND_ECCREQ(8, 512),
+ 		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
+@@ -177,7 +236,8 @@ static const struct spinand_info macroni
+ 		     SPINAND_HAS_QE_BIT,
+ 		     SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout,
+ 				     mx35lf1ge4ab_ecc_get_status)),
+-	SPINAND_INFO("MX35UF2GE4AD", 0xa6,
 +	SPINAND_INFO("MX35UF2GE4AD",
 +		     SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xa6),
-+		     NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1),
-+		     NAND_ECCREQ(8, 512),
-+		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
-+					      &write_cache_variants,
-+					      &update_cache_variants),
-+		     SPINAND_HAS_QE_BIT,
-+		     SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout,
-+				     mx35lf1ge4ab_ecc_get_status)),
+ 		     NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1),
+ 		     NAND_ECCREQ(8, 512),
+ 		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
+@@ -186,7 +246,8 @@ static const struct spinand_info macroni
+ 		     SPINAND_HAS_QE_BIT,
+ 		     SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout,
+ 				     mx35lf1ge4ab_ecc_get_status)),
+-	SPINAND_INFO("MX35UF2GE4AC", 0xa2,
 +	SPINAND_INFO("MX35UF2GE4AC",
 +		     SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xa2),
-+		     NAND_MEMORG(1, 2048, 64, 64, 2048, 40, 1, 1, 1),
-+		     NAND_ECCREQ(4, 512),
-+		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
-+					      &write_cache_variants,
-+					      &update_cache_variants),
-+		     SPINAND_HAS_QE_BIT,
-+		     SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout,
-+				     mx35lf1ge4ab_ecc_get_status)),
+ 		     NAND_MEMORG(1, 2048, 64, 64, 2048, 40, 1, 1, 1),
+ 		     NAND_ECCREQ(4, 512),
+ 		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
+@@ -195,7 +256,8 @@ static const struct spinand_info macroni
+ 		     SPINAND_HAS_QE_BIT,
+ 		     SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout,
+ 				     mx35lf1ge4ab_ecc_get_status)),
+-	SPINAND_INFO("MX35UF1G14AC", 0x90,
 +	SPINAND_INFO("MX35UF1G14AC",
 +		     SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x90),
-+		     NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 1),
-+		     NAND_ECCREQ(4, 512),
-+		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
-+					      &write_cache_variants,
-+					      &update_cache_variants),
-+		     SPINAND_HAS_QE_BIT,
-+		     SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout,
-+				     mx35lf1ge4ab_ecc_get_status)),
+ 		     NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 1),
+ 		     NAND_ECCREQ(4, 512),
+ 		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
+@@ -204,7 +266,8 @@ static const struct spinand_info macroni
+ 		     SPINAND_HAS_QE_BIT,
+ 		     SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout,
+ 				     mx35lf1ge4ab_ecc_get_status)),
+-	SPINAND_INFO("MX35UF1G24AD", 0x94,
 +	SPINAND_INFO("MX35UF1G24AD",
 +		     SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x94),
-+		     NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1),
-+		     NAND_ECCREQ(8, 512),
-+		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
-+					      &write_cache_variants,
-+					      &update_cache_variants),
-+		     SPINAND_HAS_QE_BIT,
-+		     SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout,
-+				     mx35lf1ge4ab_ecc_get_status)),
+ 		     NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1),
+ 		     NAND_ECCREQ(8, 512),
+ 		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
+@@ -213,7 +276,8 @@ static const struct spinand_info macroni
+ 		     SPINAND_HAS_QE_BIT,
+ 		     SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout,
+ 				     mx35lf1ge4ab_ecc_get_status)),
+-	SPINAND_INFO("MX35UF1GE4AD", 0x96,
 +	SPINAND_INFO("MX35UF1GE4AD",
 +		     SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x96),
-+		     NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1),
-+		     NAND_ECCREQ(8, 512),
-+		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
-+					      &write_cache_variants,
-+					      &update_cache_variants),
-+		     SPINAND_HAS_QE_BIT,
-+		     SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout,
-+				     mx35lf1ge4ab_ecc_get_status)),
+ 		     NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1),
+ 		     NAND_ECCREQ(8, 512),
+ 		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
+@@ -222,7 +286,8 @@ static const struct spinand_info macroni
+ 		     SPINAND_HAS_QE_BIT,
+ 		     SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout,
+ 				     mx35lf1ge4ab_ecc_get_status)),
+-	SPINAND_INFO("MX35UF1GE4AC", 0x92,
 +	SPINAND_INFO("MX35UF1GE4AC",
 +		     SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x92),
-+		     NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 1),
-+		     NAND_ECCREQ(4, 512),
-+		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
-+					      &write_cache_variants,
-+					      &update_cache_variants),
-+		     SPINAND_HAS_QE_BIT,
-+		     SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout,
-+				     mx35lf1ge4ab_ecc_get_status)),
+ 		     NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 1),
+ 		     NAND_ECCREQ(4, 512),
+ 		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
+@@ -231,6 +296,7 @@ static const struct spinand_info macroni
+ 		     SPINAND_HAS_QE_BIT,
+ 		     SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout,
+ 				     mx35lf1ge4ab_ecc_get_status)),
++
+ };
  
--	return 1;
--}
-+};
+ static int macronix_spinand_detect(struct spinand_device *spinand)
+--- a/drivers/mtd/nand/spi/macronix.c
++++ b/drivers/mtd/nand/spi/macronix.c
+@@ -255,7 +255,6 @@ static int macronix_spinand_detect(struc
+ }
  
  static const struct spinand_manufacturer_ops macronix_spinand_manuf_ops = {
 -	.detect = macronix_spinand_detect,
  };
+ const struct spinand_manufacturer macronix_spinand_manufacturer = {
  
+--- a/drivers/mtd/nand/spi/macronix.c
++++ b/drivers/mtd/nand/spi/macronix.c
+@@ -326,5 +326,7 @@ static const struct spinand_manufacturer
  const struct spinand_manufacturer macronix_spinand_manufacturer = {
  	.id = SPINAND_MFR_MACRONIX,
  	.name = "Macronix",
@@ -661,6 +651,7 @@
 +	.nchips = ARRAY_SIZE(macronix_spinand_table),
  	.ops = &macronix_spinand_manuf_ops,
  };
+ 
 Index: linux-5.4.260/drivers/mtd/nand/spi/micron.c
 ===================================================================
 --- linux-5.4.260.orig/drivers/mtd/nand/spi/micron.c
diff --git a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/patches-5.4/999-1716-v6.6-net-phy-add-phylink-pcs_enable-and-pcs_disable.patch b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/patches-5.4/999-1716-v6.6-net-phy-add-phylink-pcs_enable-and-pcs_disable.patch
index 29306fd..a3f7134 100644
--- a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/patches-5.4/999-1716-v6.6-net-phy-add-phylink-pcs_enable-and-pcs_disable.patch
+++ b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/patches-5.4/999-1716-v6.6-net-phy-add-phylink-pcs_enable-and-pcs_disable.patch
@@ -38,7 +38,7 @@
 -	if (pcs_changed)
 +	if (pcs_changed) {
 +		if (pl->pcs && pl->pcs->ops->pcs_disable)
-+			pcs->ops->pcs_disable(pl->pcs);
++			pl->pcs->ops->pcs_disable(pl->pcs);
 +
  		pl->pcs = pcs;
 +	}
@@ -47,7 +47,7 @@
  
 +	if (pl->pcs_state == PCS_STATE_STARTING || pcs_changed) {
 +		if (pl->pcs && pl->pcs->ops->pcs_enable)
-+			err = pcs->ops->pcs_enable(pl->pcs);
++			err = pl->pcs->ops->pcs_enable(pl->pcs);
 +	}
 +
  	if (pl->pcs) {
diff --git a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/patches-5.4/999-1802-v6.4-backport-pinctrl-pinconf-setting-combo.patch b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/patches-5.4/999-1802-v6.4-backport-pinctrl-pinconf-setting-combo.patch
index 43ca0c5..cea4fe8 100644
--- a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/patches-5.4/999-1802-v6.4-backport-pinctrl-pinconf-setting-combo.patch
+++ b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/patches-5.4/999-1802-v6.4-backport-pinctrl-pinconf-setting-combo.patch
@@ -109,109 +109,82 @@
  					return err;
 --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
 +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
-@@ -506,6 +506,404 @@ int mtk_pinconf_bias_get_rev1(struct mtk
- 	return 0;
+@@ -6,7 +6,6 @@
+  *
+  */
+ 
+-#include <dt-bindings/pinctrl/mt65xx.h>
+ #include <linux/device.h>
+ #include <linux/err.h>
+ #include <linux/gpio/driver.h>
+@@ -67,44 +66,34 @@ static int mtk_hw_pin_field_lookup(struc
+ 				   const struct mtk_pin_desc *desc,
+ 				   int field, struct mtk_pin_field *pfd)
+ {
+-	const struct mtk_pin_field_calc *c;
++	const struct mtk_pin_field_calc *c, *e;
+ 	const struct mtk_pin_reg_calc *rc;
+-	int start = 0, end, check;
+-	bool found = false;
+ 	u32 bits;
+ 
+ 	if (hw->soc->reg_cal && hw->soc->reg_cal[field].range) {
+ 		rc = &hw->soc->reg_cal[field];
+ 	} else {
+ 		dev_dbg(hw->dev,
+-			"Not support field %d for this soc\n", field);
++			"Not support field %d for pin %d (%s)\n",
++			field, desc->number, desc->name);
+ 		return -ENOTSUPP;
+ 	}
+ 
+-	end = rc->nranges - 1;
++	c = rc->range;
++	e = c + rc->nranges;
+ 
+-	while (start <= end) {
+-		check = (start + end) >> 1;
+-		if (desc->number >= rc->range[check].s_pin
+-		 && desc->number <= rc->range[check].e_pin) {
+-			found = true;
+-			break;
+-		} else if (start == end)
++	while (c < e) {
++		if (desc->number >= c->s_pin && desc->number <= c->e_pin)
+ 			break;
+-		else if (desc->number < rc->range[check].s_pin)
+-			end = check - 1;
+-		else
+-			start = check + 1;
++		c++;
+ 	}
+ 
+-	if (!found) {
++	if (c >= e) {
+ 		dev_dbg(hw->dev, "Not support field %d for pin = %d (%s)\n",
+ 			field, desc->number, desc->name);
+ 		return -ENOTSUPP;
+ 	}
+ 
+-	c = rc->range + check;
+-
+ 	if (c->i_base > hw->nbase - 1) {
+ 		dev_err(hw->dev,
+ 			"Invalid base for field %d for pin = %d (%s)\n",
+@@ -193,9 +182,6 @@ int mtk_hw_set_value(struct mtk_pinctrl
+ 	if (err)
+ 		return err;
+ 
+-	if (value < 0 || value > pf.mask)
+-		return -EINVAL;
+-
+ 	if (!pf.next)
+ 		mtk_rmw(hw, pf.index, pf.offset, pf.mask << pf.bitpos,
+ 			(value & pf.mask) << pf.bitpos);
+@@ -619,6 +605,186 @@ out:
+ 	return err;
  }
  
-+/* Combo for the following pull register type:
-+ * 1. PU + PD
-+ * 2. PULLSEL + PULLEN
-+ * 3. PUPD + R0 + R1
-+ */
-+static int mtk_pinconf_bias_set_pu_pd(struct mtk_pinctrl *hw,
-+				const struct mtk_pin_desc *desc,
-+				u32 pullup, u32 arg)
-+{
-+	int err, pu, pd;
-+
-+	if (arg == MTK_DISABLE) {
-+		pu = 0;
-+		pd = 0;
-+	} else if ((arg == MTK_ENABLE) && pullup) {
-+		pu = 1;
-+		pd = 0;
-+	} else if ((arg == MTK_ENABLE) && !pullup) {
-+		pu = 0;
-+		pd = 1;
-+	} else {
-+		err = -EINVAL;
-+		goto out;
-+	}
-+
-+	err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_PU, pu);
-+	if (err)
-+		goto out;
-+
-+	err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_PD, pd);
-+
-+out:
-+	return err;
-+}
-+
-+static int mtk_pinconf_bias_set_pullsel_pullen(struct mtk_pinctrl *hw,
-+				const struct mtk_pin_desc *desc,
-+				u32 pullup, u32 arg)
-+{
-+	int err, enable;
-+
-+	if (arg == MTK_DISABLE)
-+		enable = 0;
-+	else if (arg == MTK_ENABLE)
-+		enable = 1;
-+	else {
-+		err = -EINVAL;
-+		goto out;
-+	}
-+
-+	err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_PULLEN, enable);
-+	if (err)
-+		goto out;
-+
-+	err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_PULLSEL, pullup);
-+
-+out:
-+	return err;
-+}
-+
-+static int mtk_pinconf_bias_set_pupd_r1_r0(struct mtk_pinctrl *hw,
-+				const struct mtk_pin_desc *desc,
-+				u32 pullup, u32 arg)
-+{
-+	int err, r0, r1;
-+
-+	if ((arg == MTK_DISABLE) || (arg == MTK_PUPD_SET_R1R0_00)) {
-+		pullup = 0;
-+		r0 = 0;
-+		r1 = 0;
-+	} else if (arg == MTK_PUPD_SET_R1R0_01) {
-+		r0 = 1;
-+		r1 = 0;
-+	} else if (arg == MTK_PUPD_SET_R1R0_10) {
-+		r0 = 0;
-+		r1 = 1;
-+	} else if (arg == MTK_PUPD_SET_R1R0_11) {
-+		r0 = 1;
-+		r1 = 1;
-+	} else {
-+		err = -EINVAL;
-+		goto out;
-+	}
-+
-+	/* MTK HW PUPD bit: 1 for pull-down, 0 for pull-up */
-+	err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_PUPD, !pullup);
-+	if (err)
-+		goto out;
-+
-+	err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_R0, r0);
-+	if (err)
-+		goto out;
-+
-+	err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_R1, r1);
-+
-+out:
-+	return err;
-+}
-+
 +static int mtk_hw_pin_rsel_lookup(struct mtk_pinctrl *hw,
 +				  const struct mtk_pin_desc *desc,
 +				  u32 pullup, u32 arg, u32 *rsel_val)
@@ -392,105 +365,59 @@
 +	return err;
 +}
 +
-+static int mtk_pinconf_bias_get_pu_pd(struct mtk_pinctrl *hw,
-+				const struct mtk_pin_desc *desc,
-+				u32 *pullup, u32 *enable)
-+{
-+	int err, pu, pd;
-+
-+	err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PU, &pu);
-+	if (err)
-+		goto out;
-+
-+	err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PD, &pd);
-+	if (err)
-+		goto out;
-+
-+	if (pu == 0 && pd == 0) {
-+		*pullup = 0;
-+		*enable = MTK_DISABLE;
-+	} else if (pu == 1 && pd == 0) {
-+		*pullup = 1;
-+		*enable = MTK_ENABLE;
-+	} else if (pu == 0 && pd == 1) {
-+		*pullup = 0;
-+		*enable = MTK_ENABLE;
-+	} else
-+		err = -EINVAL;
-+
-+out:
-+	return err;
-+}
-+
-+static int mtk_pinconf_bias_get_pullsel_pullen(struct mtk_pinctrl *hw,
-+				const struct mtk_pin_desc *desc,
-+				u32 *pullup, u32 *enable)
-+{
-+	int err;
-+
-+	err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PULLSEL, pullup);
-+	if (err)
-+		goto out;
-+
-+	err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PULLEN, enable);
-+
-+out:
-+	return err;
-+}
-+
-+static int mtk_pinconf_bias_get_pupd_r1_r0(struct mtk_pinctrl *hw,
-+				const struct mtk_pin_desc *desc,
-+				u32 *pullup, u32 *enable)
-+{
-+	int err, r0, r1;
-+
-+	err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PUPD, pullup);
-+	if (err)
-+		goto out;
-+	/* MTK HW PUPD bit: 1 for pull-down, 0 for pull-up */
-+	*pullup = !(*pullup);
-+
-+	err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_R0, &r0);
-+	if (err)
-+		goto out;
-+
-+	err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_R1, &r1);
-+	if (err)
-+		goto out;
-+
-+	if ((r1 == 0) && (r0 == 0))
-+		*enable = MTK_PUPD_SET_R1R0_00;
-+	else if ((r1 == 0) && (r0 == 1))
-+		*enable = MTK_PUPD_SET_R1R0_01;
-+	else if ((r1 == 1) && (r0 == 0))
-+		*enable = MTK_PUPD_SET_R1R0_10;
-+	else if ((r1 == 1) && (r0 == 1))
-+		*enable = MTK_PUPD_SET_R1R0_11;
-+	else
-+		err = -EINVAL;
-+
-+out:
-+	return err;
-+}
-+
-+int mtk_pinconf_bias_get_combo(struct mtk_pinctrl *hw,
-+			      const struct mtk_pin_desc *desc,
-+			      u32 *pullup, u32 *enable)
-+{
+ static int mtk_pinconf_bias_get_pu_pd(struct mtk_pinctrl *hw,
+ 				const struct mtk_pin_desc *desc,
+ 				u32 *pullup, u32 *enable)
+@@ -700,45 +866,43 @@ out:
+ 	return err;
+ }
+ 
+-int mtk_pinconf_bias_set_combo(struct mtk_pinctrl *hw,
+-				const struct mtk_pin_desc *desc,
+-				u32 pullup, u32 arg)
+-{
+-	int err;
+-
+-	err = mtk_pinconf_bias_set_pu_pd(hw, desc, pullup, arg);
+-	if (!err)
+-		goto out;
+-
+-	err = mtk_pinconf_bias_set_pullsel_pullen(hw, desc, pullup, arg);
+-	if (!err)
+-		goto out;
+-
+-	err = mtk_pinconf_bias_set_pupd_r1_r0(hw, desc, pullup, arg);
+-
+-out:
+-	return err;
+-}
+-
+ int mtk_pinconf_bias_get_combo(struct mtk_pinctrl *hw,
+ 			      const struct mtk_pin_desc *desc,
+ 			      u32 *pullup, u32 *enable)
+ {
+-	int err;
 +	int err = -ENOTSUPP;
 +	u32 try_all_type;
-+
+ 
+-	err = mtk_pinconf_bias_get_pu_pd(hw, desc, pullup, enable);
+-	if (!err)
+-		goto out;
 +	if (hw->soc->pull_type)
 +		try_all_type = hw->soc->pull_type[desc->number];
 +	else
 +		try_all_type = MTK_PULL_TYPE_MASK;
-+
+ 
+-	err = mtk_pinconf_bias_get_pullsel_pullen(hw, desc, pullup, enable);
+-	if (!err)
+-		goto out;
 +	if (try_all_type & MTK_PULL_RSEL_TYPE) {
 +		err = mtk_pinconf_bias_get_rsel(hw, desc, pullup, enable);
 +		if (!err)
 +			return err;
 +	}
-+
+ 
+-	err = mtk_pinconf_bias_get_pupd_r1_r0(hw, desc, pullup, enable);
 +	if (try_all_type & MTK_PULL_PU_PD_TYPE) {
 +		err = mtk_pinconf_bias_get_pu_pd(hw, desc, pullup, enable);
 +		if (!err)
@@ -506,14 +433,44 @@
 +
 +	if (try_all_type & MTK_PULL_PUPD_R1R0_TYPE)
 +		err = mtk_pinconf_bias_get_pupd_r1_r0(hw, desc, pullup, enable);
-+
-+	return err;
-+}
+ 
+-out:
+ 	return err;
+ }
 +EXPORT_SYMBOL_GPL(mtk_pinconf_bias_get_combo);
-+
+ 
  /* Revision 0 */
  int mtk_pinconf_drive_set(struct mtk_pinctrl *hw,
- 			  const struct mtk_pin_desc *desc, u32 arg)
+@@ -831,18 +995,6 @@ int mtk_pinconf_drive_get_rev1(struct mt
+ 	return 0;
+ }
+ 
+-int mtk_pinconf_drive_set_raw(struct mtk_pinctrl *hw,
+-			       const struct mtk_pin_desc *desc, u32 arg)
+-{
+-	return mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DRV, arg);
+-}
+-
+-int mtk_pinconf_drive_get_raw(struct mtk_pinctrl *hw,
+-			       const struct mtk_pin_desc *desc, int *val)
+-{
+-	return mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_DRV, val);
+-}
+-
+ int mtk_pinconf_adv_pull_set(struct mtk_pinctrl *hw,
+ 			     const struct mtk_pin_desc *desc, bool pullup,
+ 			     u32 arg)
+@@ -876,9 +1028,7 @@ int mtk_pinconf_adv_pull_set(struct mtk_
+ 			if (err)
+ 				return err;
+ 		} else {
+-			err = mtk_pinconf_bias_set_rev1(hw, desc, pullup);
+-			if (err)
+-				err = mtk_pinconf_bias_set(hw, desc, pullup);
++			return -ENOTSUPP;
+ 		}
+ 	}
+ 
 --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h
 +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h
 @@ -17,6 +17,34 @@
@@ -593,19 +550,22 @@
  
  	/* Specific pinconfig operations */
  	int (*bias_disable_set)(struct mtk_pinctrl *hw,
-@@ -215,7 +264,10 @@ struct mtk_pin_soc {
+@@ -215,12 +264,10 @@ struct mtk_pin_soc {
  			const struct mtk_pin_desc *desc, bool pullup);
  	int (*bias_get)(struct mtk_pinctrl *hw,
  			const struct mtk_pin_desc *desc, bool pullup, int *res);
 -
-+	int (*bias_set_combo)(struct mtk_pinctrl *hw,
+ 	int (*bias_set_combo)(struct mtk_pinctrl *hw,
+-			const struct mtk_pin_desc *desc, u32 pullup, u32 arg);
 +			      const struct mtk_pin_desc *desc, u32 pullup, u32 arg);
-+	int (*bias_get_combo)(struct mtk_pinctrl *hw,
+ 	int (*bias_get_combo)(struct mtk_pinctrl *hw,
+-			const struct mtk_pin_desc *desc, u32 *pullup, u32 *arg);
+-
 +			      const struct mtk_pin_desc *desc, u32 *pullup, u32 *arg);
  	int (*drive_set)(struct mtk_pinctrl *hw,
  			 const struct mtk_pin_desc *desc, u32 arg);
  	int (*drive_get)(struct mtk_pinctrl *hw,
-@@ -246,6 +298,10 @@ struct mtk_pinctrl {
+@@ -251,6 +298,10 @@ struct mtk_pinctrl {
  	struct mtk_eint			*eint;
  	struct mtk_pinctrl_group	*groups;
  	const char          **grp_names;
@@ -616,7 +576,18 @@
  };
  
  void mtk_rmw(struct mtk_pinctrl *pctl, u8 i, u32 reg, u32 mask, u32 set);
-@@ -282,7 +338,12 @@ int mtk_pinconf_drive_set(struct mtk_pin
+@@ -282,28 +333,22 @@ int mtk_pinconf_bias_set_rev1(struct mtk
+ int mtk_pinconf_bias_get_rev1(struct mtk_pinctrl *hw,
+ 			      const struct mtk_pin_desc *desc, bool pullup,
+ 			      int *res);
+-int mtk_pinconf_bias_set_combo(struct mtk_pinctrl *hw,
+-				const struct mtk_pin_desc *desc,
+-				u32 pullup, u32 enable);
+-int mtk_pinconf_bias_get_combo(struct mtk_pinctrl *hw,
+-			      const struct mtk_pin_desc *desc,
+-			      u32 *pullup, u32 *enable);
+ 
+ int mtk_pinconf_drive_set(struct mtk_pinctrl *hw,
  			  const struct mtk_pin_desc *desc, u32 arg);
  int mtk_pinconf_drive_get(struct mtk_pinctrl *hw,
  			  const struct mtk_pin_desc *desc, int *val);
@@ -630,3 +601,13 @@
  int mtk_pinconf_drive_set_rev1(struct mtk_pinctrl *hw,
  			       const struct mtk_pin_desc *desc, u32 arg);
  int mtk_pinconf_drive_get_rev1(struct mtk_pinctrl *hw,
+ 			       const struct mtk_pin_desc *desc, int *val);
+ 
+-int mtk_pinconf_drive_set_raw(struct mtk_pinctrl *hw,
+-			       const struct mtk_pin_desc *desc, u32 arg);
+-int mtk_pinconf_drive_get_raw(struct mtk_pinctrl *hw,
+-			       const struct mtk_pin_desc *desc, int *val);
+-
+ int mtk_pinconf_adv_pull_set(struct mtk_pinctrl *hw,
+ 			     const struct mtk_pin_desc *desc, bool pullup,
+ 			     u32 arg);
diff --git a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/patches-5.4/999-2377-integrate-ONFI-and-CASN-manipulation.patch b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/patches-5.4/999-2377-integrate-ONFI-and-CASN-manipulation.patch
new file mode 100644
index 0000000..c2b76f9
--- /dev/null
+++ b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/patches-5.4/999-2377-integrate-ONFI-and-CASN-manipulation.patch
@@ -0,0 +1,162 @@
+--- a/drivers/mtd/nand/raw/nand_onfi.c
++++ b/drivers/mtd/nand/raw/nand_onfi.c
+@@ -12,20 +12,14 @@
+  * This file contains all ONFI helpers.
+  */
+ 
++#include <linux/mtd/param.h>
+ #include <linux/slab.h>
+ 
+ #include "internals.h"
+ 
+ u16 onfi_crc16(u16 crc, u8 const *p, size_t len)
+ {
+-	int i;
+-	while (len--) {
+-		crc ^= *p++ << 8;
+-		for (i = 0; i < 8; i++)
+-			crc = (crc << 1) ^ ((crc & 0x8000) ? 0x8005 : 0);
+-	}
+-
+-	return crc;
++	return nanddev_crc16(crc, p, len);
+ }
+ 
+ /* Parse the Extended Parameter Page. */
+@@ -104,37 +98,6 @@ ext_out:
+ }
+ 
+ /*
+- * Recover data with bit-wise majority
+- */
+-static void nand_bit_wise_majority(const void **srcbufs,
+-				   unsigned int nsrcbufs,
+-				   void *dstbuf,
+-				   unsigned int bufsize)
+-{
+-	int i, j, k;
+-
+-	for (i = 0; i < bufsize; i++) {
+-		u8 val = 0;
+-
+-		for (j = 0; j < 8; j++) {
+-			unsigned int cnt = 0;
+-
+-			for (k = 0; k < nsrcbufs; k++) {
+-				const u8 *srcbuf = srcbufs[k];
+-
+-				if (srcbuf[i] & BIT(j))
+-					cnt++;
+-			}
+-
+-			if (cnt > nsrcbufs / 2)
+-				val |= BIT(j);
+-		}
+-
+-		((u8 *)dstbuf)[i] = val;
+-	}
+-}
+-
+-/*
+  * Check if the NAND chip is ONFI compliant, returns 1 if it is, 0 otherwise.
+  */
+ int nand_onfi_detect(struct nand_chip *chip)
+@@ -184,7 +147,7 @@ int nand_onfi_detect(struct nand_chip *c
+ 		const void *srcbufs[3] = {p, p + 1, p + 2};
+ 
+ 		pr_warn("Could not find a valid ONFI parameter page, trying bit-wise majority to recover it\n");
+-		nand_bit_wise_majority(srcbufs, ARRAY_SIZE(srcbufs), p,
++		nanddev_bit_wise_majority(srcbufs, ARRAY_SIZE(srcbufs), p,
+ 				       sizeof(*p));
+ 
+ 		if (onfi_crc16(ONFI_CRC_BASE, (u8 *)p, 254) !=
+--- /dev/null
++++ b/drivers/mtd/nand/param.c
+@@ -0,0 +1,52 @@
++/* SPDX-License-Identifier: GPL-2.0 */
++/*
++ * Copyright (c) 2023 - Mediatek
++ *
++ * Author: SkyLake <SkyLake.Huang@mediatek.com>
++ */
++
++#include <linux/mtd/param.h>
++
++u16 nanddev_crc16(u16 crc, u8 const *p, size_t len)
++{
++	int i;
++
++	while (len--) {
++		crc ^= *p++ << 8;
++		for (i = 0; i < 8; i++)
++			crc = (crc << 1) ^ ((crc & 0x8000) ? 0x8005 : 0);
++	}
++
++	return crc;
++}
++
++/*
++ * Recover data with bit-wise majority
++ */
++void nanddev_bit_wise_majority(const void **srcbufs,
++				   unsigned int nsrcbufs,
++				   void *dstbuf,
++				   unsigned int bufsize)
++{
++	int i, j, k;
++
++	for (i = 0; i < bufsize; i++) {
++		u8 val = 0;
++
++		for (j = 0; j < 8; j++) {
++			unsigned int cnt = 0;
++
++			for (k = 0; k < nsrcbufs; k++) {
++				const u8 *srcbuf = srcbufs[k];
++
++				if (srcbuf[i] & BIT(j))
++					cnt++;
++			}
++
++			if (cnt > nsrcbufs / 2)
++				val |= BIT(j);
++		}
++
++		((u8 *)dstbuf)[i] = val;
++	}
++}
+--- /dev/null
++++ b/include/linux/mtd/param.h
+@@ -0,0 +1,22 @@
++/* SPDX-License-Identifier: GPL-2.0 */
++/*
++ * Copyright (c) 2023 - Mediatek
++ *
++ * Author: SkyLake <SkyLake.Huang@mediatek.com>
++ */
++
++#ifndef __LINUX_NAND_PARAM
++#define __LINUX_NAND_PARAM
++
++#include <linux/bitops.h>
++#include <linux/types.h>
++#include <stddef.h>
++
++u16 nanddev_crc16(u16 crc, u8 const *p, size_t len);
++void nanddev_bit_wise_majority(const void **srcbufs,
++				   unsigned int nsrcbufs,
++				   void *dstbuf,
++				   unsigned int bufsize);
++
++#endif /* __LINUX_NAND_PARAM */
++
+--- a/drivers/mtd/nand/Makefile
++++ b/drivers/mtd/nand/Makefile
+@@ -1,6 +1,6 @@
+ # SPDX-License-Identifier: GPL-2.0
+ 
+-nandcore-objs := core.o bbt.o
++nandcore-objs := core.o bbt.o param.o
+ obj-$(CONFIG_MTD_NAND_CORE) += nandcore.o
+ 
+ obj-y	+= onenand/
diff --git a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/patches-5.4/999-2378-Add-CASN-support-for-SPI-NAND.patch b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/patches-5.4/999-2378-Add-CASN-support-for-SPI-NAND.patch
new file mode 100644
index 0000000..fbf328f
--- /dev/null
+++ b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/patches-5.4/999-2378-Add-CASN-support-for-SPI-NAND.patch
@@ -0,0 +1,1196 @@
+From f588443bf5be9b8fda24fbdc80187ce8f015dcf1 Mon Sep 17 00:00:00 2001
+From: "SkyLake.Huang" <skylake.huang@mediatek.com>
+Date: Mon, 31 Jul 2023 10:40:09 +0800
+Subject: [PATCH] Add CASN support for SPI-NAND
+
+Signed-off-by: SkyLake.Huang <skylake.huang@mediatek.com>
+---
+ drivers/mtd/nand/spi/core.c | 569 +++++++++++++++++++++++++++++++++++-
+ include/linux/mtd/onfi.h    | 153 +++++++++-
+ include/linux/mtd/spinand.h |  59 +++-
+ 3 files changed, 772 insertions(+), 9 deletions(-)
+
+--- a/drivers/mtd/nand/spi/core.c
++++ b/drivers/mtd/nand/spi/core.c
+@@ -9,10 +9,13 @@
+ 
+ #define pr_fmt(fmt)	"spi-nand: " fmt
+ 
++#include <linux/bitfield.h>
+ #include <linux/device.h>
+ #include <linux/jiffies.h>
+ #include <linux/kernel.h>
+ #include <linux/module.h>
++#include <linux/mtd/casn.h>
++#include <linux/mtd/param.h>
+ #include <linux/mtd/spinand.h>
+ #include <linux/of.h>
+ #include <linux/slab.h>
+@@ -20,12 +23,15 @@
+ #include <linux/spi/spi.h>
+ #include <linux/spi/spi-mem.h>
+ 
++extern void sanitize_string(uint8_t *s, size_t len);
++
+ static int spinand_read_reg_op(struct spinand_device *spinand, u8 reg, u8 *val)
+ {
+-	struct spi_mem_op op = SPINAND_GET_FEATURE_OP(reg,
+-						      spinand->scratchbuf);
++	struct spi_mem_op op;
+ 	int ret;
+ 
++	op = (struct spi_mem_op) SPINAND_GET_FEATURE_OP(reg,
++							spinand->scratchbuf);
+ 	ret = spi_mem_exec_op(spinand->spimem, &op);
+ 	if (ret)
+ 		return ret;
+@@ -36,8 +42,10 @@ static int spinand_read_reg_op(struct sp
+ 
+ static int spinand_write_reg_op(struct spinand_device *spinand, u8 reg, u8 val)
+ {
+-	struct spi_mem_op op = SPINAND_SET_FEATURE_OP(reg,
+-						      spinand->scratchbuf);
++	struct spi_mem_op op;
++
++	op = (struct spi_mem_op) SPINAND_SET_FEATURE_OP(reg,
++							spinand->scratchbuf);
+ 
+ 	*spinand->scratchbuf = val;
+ 	return spi_mem_exec_op(spinand->spimem, &op);
+@@ -402,6 +410,62 @@ static int spinand_lock_block(struct spi
+ 	return spinand_write_reg_op(spinand, REG_BLOCK_LOCK, lock);
+ }
+ 
++static size_t eccsr_none_op(size_t val, size_t mask) { return val; }
++static size_t eccsr_and_op(size_t val, size_t mask) { return val & mask; }
++static size_t eccsr_add_op(size_t val, size_t mask) { return val + mask; }
++static size_t eccsr_minus_op(size_t val, size_t mask) { return val - mask; }
++static size_t eccsr_mul_op(size_t val, size_t mask) { return val * mask; }
++
++static void spinand_read_adv_ecc(struct spinand_device *spinand,
++				 struct spi_mem_op *ops, u16 *eccsr,
++				 u16 mask, u8 shift,
++				 u8 pre_op, u8 pre_mask)
++{
++	u8 *p = spinand->scratchbuf;
++
++	spi_mem_exec_op(spinand->spimem, ops);
++
++	if (likely(mask <= 0xff))
++		*eccsr += (*p & mask) >> shift;
++	else
++		*eccsr += (((*p << 8) | (*p+1)) & mask) >> shift;
++
++	*eccsr = spinand->eccsr_math_op[pre_op](*eccsr, pre_mask);
++}
++
++static int spinand_casn_get_ecc_status(struct spinand_device *spinand, u8 status)
++{
++	struct mtd_info *mtd = spinand_to_mtd(spinand);
++	struct CASN_ADVECC *ah = spinand->advecc_high;
++	struct CASN_ADVECC *al = spinand->advecc_low;
++	u16 eccsr_high = 0;
++	u16 eccsr_low = 0;
++	u32 eccsr = 0;
++
++	if (al->cmd) {
++		spinand_read_adv_ecc(spinand,
++				     spinand->advecc_low_ops, &eccsr_low,
++				     al->mask, al->shift,
++				     al->pre_op, al->pre_mask);
++		eccsr += eccsr_low;
++	}
++	if (ah->cmd) {
++		spinand_read_adv_ecc(spinand,
++				     spinand->advecc_high_ops, &eccsr_high,
++				     ah->mask, ah->shift,
++				     ah->pre_op, ah->pre_mask);
++		eccsr += eccsr_high << spinand->advecc_low_bitcnt;
++	}
++
++	if (eccsr == spinand->advecc_noerr_status)
++		return 0;
++	else if (eccsr == spinand->advecc_uncor_status)
++		return -EBADMSG;
++	eccsr = spinand->eccsr_math_op[spinand->advecc_post_op](eccsr, spinand->advecc_post_mask);
++
++	return eccsr > mtd->ecc_strength ? mtd->ecc_strength : eccsr;
++}
++
+ static int spinand_check_ecc_status(struct spinand_device *spinand, u8 status)
+ {
+ 	struct nand_device *nand = spinand_to_nand(spinand);
+@@ -792,10 +856,11 @@ static int spinand_manufacturer_match(st
+ }
+ 
+ int spinand_cal_read(void *priv, u32 *addr, int addrlen, u8 *buf, int readlen) {
+-	int ret;
+-	u8 status;
+ 	struct spinand_device *spinand = (struct spinand_device *)priv;
+ 	struct device *dev = &spinand->spimem->spi->dev;
++	struct spi_mem_op op;
++	u8 status;
++	int ret;
+ 
+ 	typedef struct nand_pos my_pos;
+ 	my_pos pos;
+@@ -838,13 +903,246 @@ int spinand_cal_read(void *priv, u32 *ad
+ 	if (ret < 0)
+ 		return ret;
+ 
+-	struct spi_mem_op op = SPINAND_PAGE_READ_FROM_CACHE_OP(
++	op = (struct spi_mem_op) SPINAND_PAGE_READ_FROM_CACHE_OP(
+ 		false, 0, 1, buf, readlen);
+ 	ret = spi_mem_exec_op(spinand->spimem, &op);
+ 
+ 	return 0;
+ }
+ 
++static int spinand_check_casn_validity(struct spinand_device *spinand,
++				       struct nand_casn *casn)
++{
++	struct device *dev = &spinand->spimem->spi->dev;
++
++	if (be32_to_cpu(casn->bits_per_cell) != 1) {
++		dev_err(dev, "[CASN] bits-per-cell must be 1\n");
++		return -EINVAL;
++	}
++
++	switch (be32_to_cpu(casn->bytes_per_page)) {
++	case 2048:
++	case 4096:
++		break;
++	default:
++		dev_err(dev, "[CASN] page size must be 2048/4096\n");
++		return -EINVAL;
++	}
++
++	switch (be32_to_cpu(casn->spare_bytes_per_page)) {
++	case 64:
++	case 96:
++	case 128:
++	case 256:
++		break;
++	default:
++		dev_err(dev, "[CASN] spare size must be 64/128/256\n");
++		return -EINVAL;
++	}
++
++	switch (be32_to_cpu(casn->pages_per_block)) {
++	case 64:
++	case 128:
++		break;
++	default:
++		dev_err(dev, "[CASN] pages_per_block must be 64/128\n");
++		return -EINVAL;
++	}
++
++	switch (be32_to_cpu(casn->blocks_per_lun)) {
++	case 1024:
++		if (be32_to_cpu(casn->max_bb_per_lun) != 20) {
++			dev_err(dev, "[CASN] max_bb_per_lun must be 20 when blocks_per_lun is 1024\n");
++			return -EINVAL;
++		}
++		break;
++	case 2048:
++		if (be32_to_cpu(casn->max_bb_per_lun) != 40) {
++			dev_err(dev, "[CASN] max_bb_per_lun must be 40 when blocks_per_lun is 2048\n");
++			return -EINVAL;
++		}
++		break;
++	case 4096:
++		if (be32_to_cpu(casn->max_bb_per_lun) != 80) {
++			dev_err(dev, "[CASN] max_bb_per_lun must be 80 when blocks_per_lun is 4096\n");
++			return -EINVAL;
++		}
++		break;
++	default:
++		dev_err(dev, "[CASN] blocks_per_lun must be 1024/2048/4096\n");
++		return -EINVAL;
++	}
++
++	switch (be32_to_cpu(casn->planes_per_lun)) {
++	case 1:
++	case 2:
++		break;
++	default:
++		dev_err(dev, "[CASN] planes_per_lun must be 1/2\n");
++		return -EINVAL;
++	}
++
++	switch (be32_to_cpu(casn->luns_per_target)) {
++	case 1:
++	case 2:
++		break;
++	default:
++		dev_err(dev, "[CASN] luns_per_target must be 1/2\n");
++		return -EINVAL;
++	}
++
++	switch (be32_to_cpu(casn->total_target)) {
++	case 1:
++	case 2:
++		break;
++	default:
++		dev_err(dev, "[CASN] ntargets must be 1/2\n");
++		return -EINVAL;
++	}
++
++	if (casn->casn_oob.layout_type != OOB_CONTINUOUS &&
++	    casn->casn_oob.layout_type != OOB_DISCRETE) {
++		dev_err(dev, "[CASN] OOB layout type isn't correct.\n");
++		return -EINVAL;
++	}
++
++	if (casn->ecc_status_high.status_nbytes > 2 ||
++	    casn->ecc_status_low.status_nbytes > 2) {
++		dev_err(dev, "[CASN] ADVECC status nbytes must be no more than 2\n");
++		return -EINVAL;
++	}
++
++	return 0;
++}
++
++static int spinand_check_casn(struct spinand_device *spinand,
++			struct nand_casn *casn, unsigned int *sel)
++{
++	struct device *dev = &spinand->spimem->spi->dev;
++	uint16_t crc = be16_to_cpu(casn->crc);
++	uint16_t crc_compute;
++	int ret = 0;
++	int i;
++
++	/* There are 3 copies of CASN Pages V1. Choose one avabilable copy
++	 * first. If none of the copies is available, try to recover.
++	 */
++	for (i = 0; i < CASN_PAGE_V1_COPIES; i++) {
++		if (be32_to_cpu(casn[i].signature) != CASN_SIGNATURE) {
++			ret = -EINVAL;
++			continue;
++		}
++		crc_compute = nanddev_crc16(CASN_CRC_BASE, (u8 *)(casn + i),
++					    SPINAND_CASN_V1_CRC_OFS);
++		dev_dbg(dev, "CASN COPY %d CRC read: 0x%x, compute: 0x%x\n",
++			i, crc, crc_compute);
++		if (crc != crc_compute) {
++			ret = -EBADMSG;
++			continue;
++		}
++		ret = spinand_check_casn_validity(spinand, casn + i);
++		if (ret < 0)
++			continue;
++		*sel = i;
++		break;
++	}
++
++	if (i == CASN_PAGE_V1_COPIES && ret == -EBADMSG) {
++		const void *srcbufs[CASN_PAGE_V1_COPIES];
++		int j;
++
++		for (j = 0; j < CASN_PAGE_V1_COPIES; j++)
++			srcbufs[j] = casn + j;
++		dev_info(dev, "Couldn't find a valid CASN page, try bitwise majority to recover it\n");
++		nanddev_bit_wise_majority(srcbufs, CASN_PAGE_V1_COPIES, casn,
++					  sizeof(*casn));
++		crc_compute = nanddev_crc16(CASN_CRC_BASE, (uint8_t *)casn,
++					    SPINAND_CASN_V1_CRC_OFS);
++		if (crc_compute != crc) {
++			dev_err(dev, "CASN page recovery failed, aborting\n");
++			return -EBADMSG;
++		}
++		ret = spinand_check_casn_validity(spinand, casn + i);
++		if (ret < 0)
++			return ret;
++		dev_info(dev, "CASN page recovery succeeded\n");
++		*sel = 0;
++	}
++
++	return ret;
++}
++
++static int spinand_casn_detect(struct spinand_device *spinand,
++			       struct nand_casn *casn, unsigned int *sel)
++{
++	struct device *dev = &spinand->spimem->spi->dev;
++	uint8_t casn_offset[3] = {0x0, 0x1, 0x4};
++	struct nand_page_io_req req;
++	struct spi_mem_op op;
++	struct nand_pos pos;
++	int check_ret = 0;
++	uint8_t status;
++	int final_ret;
++	int ret = 0;
++	u8 cfg_reg;
++	int i;
++
++	ret = spinand_read_reg_op(spinand, REG_CFG, &cfg_reg);
++	if (ret)
++		return ret;
++
++	ret = spinand_write_reg_op(spinand, REG_CFG, cfg_reg | BIT(6));
++	if (ret)
++		return ret;
++
++	memset(&pos, 0, sizeof(pos));
++
++	req = (struct nand_page_io_req){
++		.pos = pos,
++		.dataoffs = 0,
++		.datalen = 256 * CASN_PAGE_V1_COPIES,
++		.databuf.in = (u8 *)casn,
++		.mode = MTD_OPS_AUTO_OOB,
++	};
++
++	for (i = 0; i < sizeof(casn_offset)/sizeof(uint8_t); i++) {
++		req.pos.page = casn_offset[i];
++		ret = spinand_load_page_op(spinand, &req);
++		if (ret)
++			goto finish;
++
++		ret = spinand_wait(spinand, &status);
++		if (ret < 0)
++			goto finish;
++
++		op = (struct spi_mem_op) SPINAND_PAGE_READ_FROM_CACHE_OP(
++			false, 768, 1, (u8 *)casn, 256 * CASN_PAGE_V1_COPIES);
++		ret = spi_mem_exec_op(spinand->spimem, &op);
++		if (ret < 0)
++			goto finish;
++
++		check_ret = spinand_check_casn(spinand, casn, sel);
++		if (!check_ret)
++			break;
++	}
++
++finish:
++	/* We need to restore configuration register. */
++	final_ret = spinand_write_reg_op(spinand, REG_CFG, cfg_reg);
++	if (final_ret)
++		return final_ret;
++
++	if (check_ret) {
++		dev_err(dev, "CASN page check failed\n");
++		return check_ret;
++	}
++
++	if (ret)
++		dev_err(dev, "CASN page read failed\n");
++
++	return ret;
++}
++
+ static int spinand_id_detect(struct spinand_device *spinand)
+ {
+ 	u8 *id = spinand->id.data;
+@@ -876,7 +1174,7 @@ static int spinand_id_detect(struct spin
+ 
+ static int spinand_manufacturer_init(struct spinand_device *spinand)
+ {
+-	if (spinand->manufacturer->ops->init)
++	if (!spinand->use_casn && spinand->manufacturer->ops->init)
+ 		return spinand->manufacturer->ops->init(spinand);
+ 
+ 	return 0;
+@@ -885,7 +1183,7 @@ static int spinand_manufacturer_init(str
+ static void spinand_manufacturer_cleanup(struct spinand_device *spinand)
+ {
+ 	/* Release manufacturer private data */
+-	if (spinand->manufacturer->ops->cleanup)
++	if (!spinand->use_casn && spinand->manufacturer->ops->cleanup)
+ 		return spinand->manufacturer->ops->cleanup(spinand);
+ }
+ 
+@@ -988,37 +1286,456 @@ int spinand_match_and_init(struct spinan
+ 	return -ENOTSUPP;
+ }
+ 
++static int spinand_casn_ooblayout_ecc(struct mtd_info *mtd, int section,
++				       struct mtd_oob_region *region)
++{
++	struct spinand_device *spinand = mtd_to_spinand(mtd);
++	int sectionp;
++	struct CASN_OOB *co = spinand->casn_oob;
++
++	sectionp = spinand->base.memorg.pagesize/mtd->ecc_step_size;
++	if (section >= sectionp)
++		return -ERANGE;
++
++	if (co->layout_type == OOB_DISCRETE) {
++		region->offset = co->ecc_parity_start +
++				 (co->free_length + co->ecc_parity_space)
++				 * section;
++	} else if (co->layout_type == OOB_CONTINUOUS) {
++		region->offset = co->ecc_parity_start + co->ecc_parity_space * section;
++	}
++	region->length = co->ecc_parity_real_length;
++
++	return 0;
++}
++
++static int spinand_casn_ooblayout_free(struct mtd_info *mtd, int section,
++					struct mtd_oob_region *region)
++{
++	struct spinand_device *spinand = mtd_to_spinand(mtd);
++	int sectionp;
++	struct CASN_OOB *co = spinand->casn_oob;
++
++	sectionp = spinand->base.memorg.pagesize/mtd->ecc_step_size;
++	if (section >= sectionp)
++		return -ERANGE;
++
++	if (!section) {
++		region->offset = co->free_start + co->bbm_length;
++		region->length = co->free_length - co->bbm_length;
++	} else {
++		if (co->layout_type == OOB_DISCRETE) {
++			region->offset = co->free_start +
++					 (co->free_length +
++					  co->ecc_parity_space) * section;
++		} else if (co->layout_type == OOB_CONTINUOUS) {
++			region->offset = co->free_start +
++					 co->free_length * section;
++		}
++		region->length = co->free_length;
++	}
++
++	return 0;
++}
++
++static const struct mtd_ooblayout_ops spinand_casn_ooblayout = {
++	.ecc = spinand_casn_ooblayout_ecc,
++	.free = spinand_casn_ooblayout_free,
++};
++
++static int spinand_set_read_op_variants(struct spinand_device *spinand,
++					struct nand_casn *casn)
++{
++	struct spinand_op_variants casn_read_cache_variants;
++	u16 sdr_read_cap = be16_to_cpu(casn->sdr_read_cap);
++	struct spi_mem_op *read_ops;
++	const struct spi_mem_op *op;
++	int i = 0;
++
++	read_ops = devm_kzalloc(&spinand->spimem->spi->dev,
++				sizeof(struct spi_mem_op) *
++				hweight16(sdr_read_cap),
++				GFP_KERNEL);
++	if (!read_ops)
++		return -ENOMEM;
++
++	if (FIELD_GET(SDR_READ_1_4_4, sdr_read_cap)) {
++		read_ops[i] = (struct spi_mem_op)
++			SPINAND_CASN_PAGE_READ_FROM_CACHE_QUADIO_OP(
++				casn->sdr_read_1_4_4.addr_nbytes, 0,
++				casn->sdr_read_1_4_4.dummy_nbytes, NULL, 0
++			);
++		i++;
++	}
++	if (FIELD_GET(SDR_READ_1_1_4, sdr_read_cap)) {
++		read_ops[i] = (struct spi_mem_op)
++			SPINAND_CASN_PAGE_READ_FROM_CACHE_X4_OP(
++				casn->sdr_read_1_1_4.addr_nbytes, 0,
++				casn->sdr_read_1_1_4.dummy_nbytes, NULL, 0
++			);
++		i++;
++	}
++	if (FIELD_GET(SDR_READ_1_2_2, sdr_read_cap)) {
++		read_ops[i] = (struct spi_mem_op)
++			SPINAND_CASN_PAGE_READ_FROM_CACHE_DUALIO_OP(
++				casn->sdr_read_1_2_2.addr_nbytes, 0,
++				casn->sdr_read_1_2_2.dummy_nbytes, NULL, 0
++			);
++		i++;
++	}
++	if (FIELD_GET(SDR_READ_1_1_2, sdr_read_cap)) {
++		read_ops[i] = (struct spi_mem_op)
++			SPINAND_CASN_PAGE_READ_FROM_CACHE_X2_OP(
++				casn->sdr_read_1_1_2.addr_nbytes, 0,
++				casn->sdr_read_1_1_2.dummy_nbytes, NULL, 0
++			);
++		i++;
++	}
++	if (FIELD_GET(SDR_READ_1_1_1_FAST, sdr_read_cap)) {
++		read_ops[i] = (struct spi_mem_op)
++			SPINAND_CASN_PAGE_READ_FROM_CACHE_OP(
++				true, casn->sdr_read_1_1_1_fast.addr_nbytes, 0,
++				casn->sdr_read_1_1_1_fast.dummy_nbytes, NULL, 0
++			);
++		i++;
++	}
++	if (FIELD_GET(SDR_READ_1_1_1, sdr_read_cap)) {
++		read_ops[i] = (struct spi_mem_op)
++			SPINAND_CASN_PAGE_READ_FROM_CACHE_OP(
++				false, casn->sdr_read_1_1_1.addr_nbytes, 0,
++				casn->sdr_read_1_1_1.dummy_nbytes, NULL, 0
++			);
++		i++;
++	}
++
++	casn_read_cache_variants = (struct spinand_op_variants){
++		.ops = read_ops,
++		.nops = hweight16(sdr_read_cap),
++	};
++
++	op = spinand_select_op_variant(spinand, &casn_read_cache_variants);
++	if (!op) {
++		devm_kfree(&spinand->spimem->spi->dev, read_ops);
++		return -ENOTSUPP;
++	}
++	spinand->op_templates.read_cache = op;
++
++	return 0;
++}
++
++static int spinand_set_write_op_variants(struct spinand_device *spinand,
++					 struct nand_casn *casn)
++{
++	struct spinand_op_variants casn_write_cache_variants;
++	struct spi_mem_op *write_ops;
++	const struct spi_mem_op *op;
++	int i = 0;
++
++	write_ops = devm_kzalloc(&spinand->spimem->spi->dev,
++				 sizeof(struct spi_mem_op) *
++				 hweight8(casn->sdr_write_cap),
++				 GFP_KERNEL);
++	if (!write_ops)
++		return -ENOMEM;
++
++	if (FIELD_GET(SDR_WRITE_1_1_4, casn->sdr_write_cap)) {
++		write_ops[i] = (struct spi_mem_op)
++			SPINAND_CASN_PROG_LOAD_X4(
++				true, casn->sdr_write_1_1_4.addr_nbytes, 0,
++				NULL, 0);
++		i++;
++	}
++	if (FIELD_GET(SDR_WRITE_1_1_1, casn->sdr_write_cap)) {
++		write_ops[i] = (struct spi_mem_op)
++			SPINAND_CASN_PROG_LOAD(
++				true, casn->sdr_write_1_1_1.addr_nbytes, 0,
++				NULL, 0);
++		i++;
++	}
++
++	casn_write_cache_variants = (struct spinand_op_variants){
++		.ops = write_ops,
++		.nops = hweight8(casn->sdr_write_cap),
++	};
++
++	op = spinand_select_op_variant(spinand, &casn_write_cache_variants);
++	if (!op) {
++		devm_kfree(&spinand->spimem->spi->dev, write_ops);
++		return -ENOTSUPP;
++	}
++	spinand->op_templates.write_cache = op;
++
++	return 0;
++}
++
++static int spinand_set_update_op_variants(struct spinand_device *spinand,
++					  struct nand_casn *casn)
++{
++	struct spinand_op_variants casn_update_cache_variants;
++	struct spi_mem_op *update_ops;
++	const struct spi_mem_op *op;
++	int i = 0;
++
++	update_ops = devm_kzalloc(&spinand->spimem->spi->dev,
++				  sizeof(struct spi_mem_op) *
++				  hweight8(casn->sdr_update_cap),
++				  GFP_KERNEL);
++	if (!update_ops)
++		return -ENOMEM;
++
++	if (FIELD_GET(SDR_UPDATE_1_1_4, casn->sdr_update_cap)) {
++		update_ops[i] = (struct spi_mem_op)
++			SPINAND_CASN_PROG_LOAD_X4(
++				false, casn->sdr_update_1_1_4.addr_nbytes, 0,
++				NULL, 0);
++		i++;
++	}
++	if (FIELD_GET(SDR_UPDATE_1_1_1, casn->sdr_update_cap)) {
++		update_ops[i] = (struct spi_mem_op)
++			SPINAND_CASN_PROG_LOAD(
++				false, casn->sdr_update_1_1_1.addr_nbytes, 0,
++				NULL, 0);
++		i++;
++	}
++
++	casn_update_cache_variants = (struct spinand_op_variants){
++		.ops = update_ops,
++		.nops = hweight8(casn->sdr_update_cap),
++	};
++
++	op = spinand_select_op_variant(spinand, &casn_update_cache_variants);
++	if (!op) {
++		devm_kfree(&spinand->spimem->spi->dev, update_ops);
++		return -ENOTSUPP;
++	}
++	spinand->op_templates.update_cache = op;
++
++	return 0;
++}
++
++static int spinand_init_via_casn(struct spinand_device *spinand,
++				 struct nand_casn *casn)
++{
++	struct nand_device *nand = spinand_to_nand(spinand);
++	u32 val;
++	int ret;
++	int i;
++
++	/* Set members of nand->memorg via CASN. */
++	for (i = 0; i < 9; i++) {
++		val = be32_to_cpu(*(&casn->bits_per_cell + i));
++		memcpy((u32 *)&nand->memorg.bits_per_cell + i, &val, sizeof(u32));
++	}
++	nand->eccreq.strength = be32_to_cpu(casn->ecc_strength);
++	nand->eccreq.step_size = be32_to_cpu(casn->ecc_step_size);
++	spinand->flags = casn->flags;
++
++	if (spinand->flags & SPINAND_SUP_ADV_ECC_STATUS) {
++		spinand->eccinfo = (struct spinand_ecc_info) {
++			&spinand_casn_get_ecc_status, &spinand_casn_ooblayout};
++	} else {
++		spinand->eccinfo = (struct spinand_ecc_info) {
++			NULL, &spinand_casn_ooblayout };
++	}
++
++	spinand->advecc_high_ops = devm_kzalloc(&spinand->spimem->spi->dev,
++						sizeof(struct spi_mem_op),
++						GFP_KERNEL);
++	if (!spinand->advecc_high_ops)
++		return -ENOMEM;
++	spinand->advecc_low_ops = devm_kzalloc(&spinand->spimem->spi->dev,
++					       sizeof(struct spi_mem_op),
++					       GFP_KERNEL);
++	if (!spinand->advecc_low_ops)
++		return -ENOMEM;
++	spinand->casn_oob = devm_kzalloc(&spinand->spimem->spi->dev,
++					 sizeof(struct CASN_OOB),
++					 GFP_KERNEL);
++	if (!spinand->casn_oob)
++		return -ENOMEM;
++	spinand->advecc_high = devm_kzalloc(&spinand->spimem->spi->dev,
++					    sizeof(struct CASN_ADVECC),
++					    GFP_KERNEL);
++	if (!spinand->advecc_high)
++		return -ENOMEM;
++	spinand->advecc_low = devm_kzalloc(&spinand->spimem->spi->dev,
++					   sizeof(struct CASN_ADVECC),
++					   GFP_KERNEL);
++	if (!spinand->advecc_low)
++		return -ENOMEM;
++
++	*spinand->advecc_high_ops = (struct spi_mem_op)
++		SPINAND_CASN_ADVECC_OP(casn->ecc_status_high, spinand->scratchbuf);
++	*spinand->advecc_low_ops = (struct spi_mem_op)
++		SPINAND_CASN_ADVECC_OP(casn->ecc_status_low, spinand->scratchbuf);
++
++	memcpy(spinand->casn_oob, &casn->casn_oob, sizeof(struct CASN_OOB));
++
++	spinand->advecc_high->cmd = casn->ecc_status_high.cmd;
++	spinand->advecc_high->mask = be16_to_cpu(casn->ecc_status_high.status_mask);
++	spinand->advecc_high->shift = spinand->advecc_high->mask ?
++				      ffs(spinand->advecc_high->mask)-1 : 0;
++	spinand->advecc_high->pre_op = casn->ecc_status_high.pre_op;
++	spinand->advecc_high->pre_mask = casn->ecc_status_high.pre_mask;
++
++	spinand->advecc_low->cmd = casn->ecc_status_low.cmd;
++	spinand->advecc_low->mask = be16_to_cpu(casn->ecc_status_low.status_mask);
++	spinand->advecc_low->shift = spinand->advecc_low->mask ?
++				     ffs(spinand->advecc_low->mask)-1 : 0;
++	spinand->advecc_low->pre_op = casn->ecc_status_low.pre_op;
++	spinand->advecc_low->pre_mask = casn->ecc_status_low.pre_mask;
++
++	spinand->advecc_low_bitcnt = hweight16(spinand->advecc_low->mask);
++
++	spinand->advecc_noerr_status = casn->advecc_noerr_status;
++	spinand->advecc_uncor_status = casn->advecc_uncor_status;
++	spinand->advecc_post_op = casn->advecc_post_op;
++	spinand->advecc_post_mask = casn->advecc_post_mask;
++	spinand->eccsr_math_op[0] = eccsr_none_op;
++	spinand->eccsr_math_op[1] = eccsr_and_op;
++	spinand->eccsr_math_op[2] = eccsr_add_op;
++	spinand->eccsr_math_op[3] = eccsr_minus_op;
++	spinand->eccsr_math_op[4] = eccsr_mul_op;
++
++	ret = spinand_set_read_op_variants(spinand, casn);
++	if (ret < 0)
++		return ret;
++	ret = spinand_set_write_op_variants(spinand, casn);
++	if (ret < 0)
++		return ret;
++	ret = spinand_set_update_op_variants(spinand, casn);
++	if (ret < 0)
++		return ret;
++
++	return 0;
++}
++
++static void spinand_dump_casn(struct spinand_device *spinand, struct nand_casn *casn)
++{
++	int i;
++
++	dev_dbg(&spinand->spimem->spi->dev,
++		"---Start dumping full CASN page---\n");
++	for (i = 0; i < 64; i++)
++		pr_debug("0x%08x", *((u32 *)casn + i));
++
++	pr_debug("** Dump critical fields **\n");
++	pr_debug("signature: 0x%04x\n", be32_to_cpu(casn->signature));
++	pr_debug("version: v%u.%u\n", casn->version >> 4, casn->version & 0xf);
++	pr_debug("[Memory Organization]\n");
++	pr_debug("  bits_per_cell: %d\n", be32_to_cpu(casn->bits_per_cell));
++	pr_debug("  bytes_per_page: %d\n", be32_to_cpu(casn->bytes_per_page));
++	pr_debug("  spare_bytes_per_page: %d\n",
++		 be32_to_cpu(casn->spare_bytes_per_page));
++	pr_debug("  pages_per_block: %d\n",
++		 be32_to_cpu(casn->pages_per_block));
++	pr_debug("  blocks_per_lun: %d\n", be32_to_cpu(casn->blocks_per_lun));
++	pr_debug("  max_bb_per_lun: %d\n", be32_to_cpu(casn->max_bb_per_lun));
++	pr_debug("  planes_per_lun: %d\n", be32_to_cpu(casn->planes_per_lun));
++	pr_debug("  luns_per_target: %d\n",
++		 be32_to_cpu(casn->luns_per_target));
++	pr_debug("  total_target: %d\n", be32_to_cpu(casn->total_target));
++	pr_debug("[flags]\n");
++	pr_debug("  0. Have QE bit? %s\n",
++		casn->flags & SPINAND_HAS_QE_BIT ? "Yes" : "No");
++	pr_debug("  1. Have continuous read feature bit? %s\n",
++		casn->flags & SPINAND_HAS_CR_FEAT_BIT ? "Yes" : "No");
++	pr_debug("  2. Support continuous read? %s\n",
++		casn->flags & SPINAND_SUP_CR ? "Yes" : "No");
++	pr_debug("  3. Support on-die ECC? %s\n",
++		casn->flags & SPINAND_SUP_ON_DIE_ECC ? "Yes" : "No");
++	pr_debug("  4. Support legacy ECC status? %s\n",
++		casn->flags & SPINAND_SUP_LEGACY_ECC_STATUS ? "Yes" : "No");
++	pr_debug("  5. Support advanced ECC status? %s\n",
++		casn->flags & SPINAND_SUP_ADV_ECC_STATUS ? "Yes" : "No");
++	pr_debug("  6. ECC parity readable? %s\n",
++		casn->flags & SPINAND_ECC_PARITY_READABLE ? "Yes" : "No");
++	pr_debug("[R/W ability]\n");
++	pr_debug("  read ability: %x\n", be16_to_cpu(casn->sdr_read_cap));
++	pr_debug("  write ability: %x\n", casn->sdr_write_cap);
++	pr_debug("  update ability: %x\n", casn->sdr_update_cap);
++	pr_debug("advanced ECC no error state: %x\n",
++		 casn->advecc_noerr_status);
++	pr_debug("advecced ECC uncorrectable state: %x\n",
++		 casn->advecc_uncor_status);
++	pr_debug("CRC: 0x%04x\n", be16_to_cpu(casn->crc));
++
++	dev_dbg(&spinand->spimem->spi->dev,
++		"---Dumping full CASN page ends here.---\n");
++}
++
+ static int spinand_detect(struct spinand_device *spinand)
+ {
+-	struct device *dev = &spinand->spimem->spi->dev;
+ 	struct nand_device *nand = spinand_to_nand(spinand);
++	struct device *dev = &spinand->spimem->spi->dev;
++	struct nand_casn *casn;
++	char manufacturer[14];
++	unsigned int sel = 0;
++	char model[17];
+ 	int ret;
+ 
+ 	ret = spinand_reset_op(spinand);
+ 	if (ret)
+ 		return ret;
+ 
+-	ret = spinand_id_detect(spinand);
+-	if (ret) {
+-		dev_err(dev, "unknown raw ID %*phN\n", SPINAND_MAX_ID_LEN,
+-			spinand->id.data);
+-		return ret;
++	spinand->use_casn = false;
++	casn = kzalloc((sizeof(struct nand_casn) * CASN_PAGE_V1_COPIES), GFP_KERNEL);
++	if (!casn)
++		return -ENOMEM;
++
++	ret = spinand_casn_detect(spinand, casn, &sel);
++	if (!ret) {
++		spinand->use_casn = true;
++		strncpy(manufacturer, casn[sel].manufacturer, sizeof(manufacturer)-1);
++		sanitize_string(manufacturer, sizeof(manufacturer));
++		strncpy(model, casn[sel].model, sizeof(model)-1);
++		sanitize_string(model, sizeof(model));
++
++		spinand_dump_casn(spinand, casn + sel);
++
++		ret = spinand_init_via_casn(spinand, casn + sel);
++		if (ret)
++			dev_err(dev, "Initilize spinand via CASN failed: %d\n", ret);
++	}
++
++	if (ret < 0) {
++		dev_warn(dev, "Fallback to read ID\n");
++
++		ret = spinand_reset_op(spinand);
++		if (ret)
++			goto free_casn;
++		ret = spinand_id_detect(spinand);
++		if (ret) {
++			dev_err(dev, "unknown raw ID %*phN\n", SPINAND_MAX_ID_LEN,
++				spinand->id.data);
++			goto free_casn;
++		}
+ 	}
+ 
+ 	if (nand->memorg.ntargets > 1 && !spinand->select_target) {
+ 		dev_err(dev,
+ 			"SPI NANDs with more than one die must implement ->select_target()\n");
+-		return -EINVAL;
++		ret = -EINVAL;
++		goto free_casn;
++	}
++
++	if (spinand->use_casn) {
++		dev_info(&spinand->spimem->spi->dev,
++			 "%s %s SPI NAND was found.\n", manufacturer, model);
++	} else {
++		dev_info(&spinand->spimem->spi->dev,
++			 "%s SPI NAND was found.\n", spinand->manufacturer->name);
+ 	}
+ 
+-	dev_info(&spinand->spimem->spi->dev,
+-		 "%s SPI NAND was found.\n", spinand->manufacturer->name);
+ 	dev_info(&spinand->spimem->spi->dev,
+ 		 "%llu MiB, block size: %zu KiB, page size: %zu, OOB size: %u\n",
+ 		 nanddev_size(nand) >> 20, nanddev_eraseblock_size(nand) >> 10,
+ 		 nanddev_page_size(nand), nanddev_per_page_oobsize(nand));
+ 
+-	return 0;
++free_casn:
++	kfree(casn);
++
++	return ret;
+ }
+ 
+ static int spinand_noecc_ooblayout_ecc(struct mtd_info *mtd, int section,
+--- a/include/linux/mtd/spinand.h
++++ b/include/linux/mtd/spinand.h
+@@ -62,6 +62,59 @@
+ 		   SPI_MEM_OP_NO_DUMMY,					\
+ 		   SPI_MEM_OP_NO_DATA)
+ 
++/* Macros for CASN */
++#define SPINAND_CASN_PAGE_READ_FROM_CACHE_OP(fast, naddr, addr, ndummy, buf, len) \
++	SPI_MEM_OP(SPI_MEM_OP_CMD(fast ? 0x0b : 0x03, 1),		\
++		   SPI_MEM_OP_ADDR(naddr, addr, 1),			\
++		   SPI_MEM_OP_DUMMY(ndummy, 1),			\
++		   SPI_MEM_OP_DATA_IN(len, buf, 1))
++
++#define SPINAND_CASN_PAGE_READ_FROM_CACHE_X2_OP(naddr, addr, ndummy, buf, len)	\
++	SPI_MEM_OP(SPI_MEM_OP_CMD(0x3b, 1),			\
++		   SPI_MEM_OP_ADDR(naddr, addr, 1),			\
++		   SPI_MEM_OP_DUMMY(ndummy, 1),			\
++		   SPI_MEM_OP_DATA_IN(len, buf, 2))
++
++#define SPINAND_CASN_PAGE_READ_FROM_CACHE_DUALIO_OP(naddr, addr, ndummy, buf, len)	\
++		SPI_MEM_OP(SPI_MEM_OP_CMD(0xbb, 1),			\
++			   SPI_MEM_OP_ADDR(naddr, addr, 2),			\
++			   SPI_MEM_OP_DUMMY(ndummy, 2),			\
++			   SPI_MEM_OP_DATA_IN(len, buf, 2))
++
++#define SPINAND_CASN_PAGE_READ_FROM_CACHE_X4_OP(naddr, addr, ndummy, buf, len)	\
++	SPI_MEM_OP(SPI_MEM_OP_CMD(0x6b, 1),				\
++		   SPI_MEM_OP_ADDR(naddr, addr, 1),				\
++		   SPI_MEM_OP_DUMMY(ndummy, 1),				\
++		   SPI_MEM_OP_DATA_IN(len, buf, 4))
++
++#define SPINAND_CASN_PAGE_READ_FROM_CACHE_QUADIO_OP(naddr, addr, ndummy, buf, len)	\
++	SPI_MEM_OP(SPI_MEM_OP_CMD(0xeb, 1),				\
++		   SPI_MEM_OP_ADDR(naddr, addr, 4),				\
++		   SPI_MEM_OP_DUMMY(ndummy, 4),				\
++		   SPI_MEM_OP_DATA_IN(len, buf, 4))
++
++#define SPINAND_CASN_PROG_LOAD(reset, naddr, addr, buf, len)			\
++	SPI_MEM_OP(SPI_MEM_OP_CMD(reset ? 0x02 : 0x84, 1),		\
++		   SPI_MEM_OP_ADDR(naddr, addr, 1),				\
++		   SPI_MEM_OP_NO_DUMMY,					\
++		   SPI_MEM_OP_DATA_OUT(len, buf, 1))
++
++#define SPINAND_CASN_PROG_LOAD_X4(reset, naddr, addr, buf, len)			\
++	SPI_MEM_OP(SPI_MEM_OP_CMD(reset ? 0x32 : 0x34, 1),		\
++		   SPI_MEM_OP_ADDR(naddr, addr, 1),				\
++		   SPI_MEM_OP_NO_DUMMY,					\
++		   SPI_MEM_OP_DATA_OUT(len, buf, 4))
++
++#define SPINAND_CASN_ADVECC_OP(casn_adv_ecc_status, buf)			\
++	SPI_MEM_OP(SPI_MEM_OP_CMD(casn_adv_ecc_status.cmd, 1),			\
++		   SPI_MEM_OP_ADDR(casn_adv_ecc_status.addr_nbytes,		\
++				   casn_adv_ecc_status.addr,			\
++				   casn_adv_ecc_status.addr_buswidth),		\
++		   SPI_MEM_OP_DUMMY(casn_adv_ecc_status.dummy_nbytes,		\
++				    casn_adv_ecc_status.dummy_buswidth),	\
++		   SPI_MEM_OP_DATA_IN(casn_adv_ecc_status.status_nbytes, buf, 1))
++/* Macros for CASN end */
++
+ #define SPINAND_PAGE_READ_FROM_CACHE_OP(fast, addr, ndummy, buf, len)	\
+ 	SPI_MEM_OP(SPI_MEM_OP_CMD(fast ? 0x0b : 0x03, 1),		\
+ 		   SPI_MEM_OP_ADDR(2, addr, 1),				\
+@@ -287,6 +340,12 @@ struct spinand_ecc_info {
+ 
+ #define SPINAND_HAS_QE_BIT		BIT(0)
+ #define SPINAND_HAS_CR_FEAT_BIT		BIT(1)
++#define SPINAND_SUP_CR			BIT(2)
++#define SPINAND_SUP_ON_DIE_ECC		BIT(3)
++#define SPINAND_SUP_LEGACY_ECC_STATUS	BIT(4)
++#define SPINAND_SUP_ADV_ECC_STATUS	BIT(5)
++#define SPINAND_ECC_PARITY_READABLE	BIT(6)
++
+ 
+ /**
+  * struct spinand_info - Structure used to describe SPI NAND chips
+@@ -363,6 +422,28 @@ struct spinand_dirmap {
+ };
+ 
+ /**
++ * struct CASN_ADVECC - CASN's advanced ECC description
++ * @cmd: Command to access SPI-NAND on-chip ECC status registers
++ * @mask: Mask to access SPI-NAND on-chip ECC status registers.
++ *	  ADV_ECC_STATUS->status_nbytes | CASN_ADVECC->mask
++ *			1		|      0 to 0xff
++ *			2		|     0 to 0xffff
++ * @shift: How many bits to shift to get on-chip ECC status
++ * @pre_op: This comes from CASN page's ADV_ECC_STATUS's pre_op.
++ *	    After reading on-chip ECC status, we need to do some math
++ *	    operations if this is specified.
++ * @pre_mask: This comes from CASN page's ADV_ECC_STATUS's pre_mask.
++ *	      This is used in companion with pre_op above.
++ */
++struct CASN_ADVECC {
++	u8 cmd;
++	u16 mask;
++	u8 shift;
++	u8 pre_op;
++	u8 pre_mask;
++};
++
++/**
+  * struct spinand_device - SPI NAND device instance
+  * @base: NAND device instance
+  * @spimem: pointer to the SPI mem object
+@@ -414,6 +495,23 @@ struct spinand_device {
+ 	u8 *oobbuf;
+ 	u8 *scratchbuf;
+ 	const struct spinand_manufacturer *manufacturer;
++
++	bool use_casn;
++	struct nand_casn *casn;
++	struct spi_mem_op *advecc_high_ops; /* ops to read higher part of advanced ECC status*/
++	struct spi_mem_op *advecc_low_ops;
++	struct CASN_OOB *casn_oob;
++	struct CASN_ADVECC *advecc_high;
++	struct CASN_ADVECC *advecc_low;
++
++	u8 advecc_low_bitcnt;
++	u8 advecc_noerr_status;
++	u8 advecc_uncor_status;
++	u8 advecc_post_op;
++	u8 advecc_post_mask;
++
++	size_t (*eccsr_math_op[4])(size_t, size_t);
++
+ 	void *priv;
+ };
+ 
+@@ -484,3 +582,4 @@ int spinand_upd_cfg(struct spinand_devic
+ int spinand_select_target(struct spinand_device *spinand, unsigned int target);
+ 
+ #endif /* __LINUX_MTD_SPINAND_H */
++
+--- /dev/null
++++ b/include/linux/mtd/casn.h
+@@ -0,0 +1,191 @@
++/* SPDX-License-Identifier: GPL-2.0 */
++/*
++ * Copyright (c) 2023 - Mediatek
++ *
++ * Author: SkyLake <SkyLake.Huang@mediatek.com>
++ */
++
++#ifndef __LINUX_MTD_CASN_H
++#define __LINUX_MTD_CASN_H
++
++#define CASN_CRC_BASE	0x4341
++#define CASN_SIGNATURE	0x4341534EU
++#define SPINAND_CASN_V1_CRC_OFS (254)
++#define CASN_PAGE_V1_COPIES     (3)
++
++#define SDR_READ_1_1_1		BIT(0)
++#define SDR_READ_1_1_1_FAST	BIT(1)
++#define SDR_READ_1_1_2		BIT(2)
++#define SDR_READ_1_2_2		BIT(3)
++#define SDR_READ_1_1_4		BIT(4)
++#define SDR_READ_1_4_4		BIT(5)
++#define SDR_READ_1_1_8		BIT(6)
++#define SDR_READ_1_8_8		BIT(7)
++
++#define SDR_WRITE_1_1_1		BIT(0)
++#define SDR_WRITE_1_1_4		BIT(1)
++
++#define SDR_UPDATE_1_1_1	BIT(0)
++#define SDR_UPDATE_1_1_4	BIT(1)
++
++struct op_slice {
++	u8 cmd_opcode;
++#if defined(__LITTLE_ENDIAN_BITFIELD)
++	u8 dummy_nbytes : 4;
++	u8 addr_nbytes : 4;
++#elif defined(__BIG_ENDIAN_BITFIELD)
++	u8 addr_nbytes : 4;
++	u8 dummy_nbytes : 4;
++#endif
++};
++
++struct SPINAND_FLAGS {
++#if defined(__LITTLE_ENDIAN_BITFIELD)
++	u8 has_qe_bit : 1;
++	u8 has_cr_feat_bit : 1;
++	u8 conti_read_cap : 1;
++	u8 on_die_ecc : 1;
++	u8 legacy_ecc_status : 1;
++	u8 adv_ecc_status : 1;
++	u8 ecc_parity_readable : 1;
++	u8 ecc_alg : 1; /* ECC algorithm */
++#elif defined(__BIG_ENDIAN_BITFIELD)
++	u8 ecc_alg : 1; /* ECC algorithm */
++	u8 ecc_parity_readable : 1;
++	u8 adv_ecc_status : 1;
++	u8 legacy_ecc_status : 1;
++	u8 on_die_ecc : 1;
++	u8 conti_read_cap : 1;
++	u8 has_cr_feat_bit : 1;
++	u8 has_qe_bit : 1;
++#endif
++};
++
++struct ADV_ECC_STATUS {
++	u8 cmd;
++	u8 addr;
++	u8 addr_nbytes;
++	u8 addr_buswidth;
++	u8 dummy_nbytes;
++	u8 dummy_buswidth;
++	u8 status_nbytes;
++	u16 status_mask;
++	u8 pre_op; /* pre-process operator */
++	u8 pre_mask; /* pre-process mask */
++} __packed;
++
++struct CASN_OOB {
++	u8 layout_type;
++
++	/* OOB free layout */
++	u8 free_start;
++	u8 free_length;
++	u8 bbm_length;
++
++	/* ECC parity layout */
++	u8 ecc_parity_start;
++	u8 ecc_parity_space;
++	u8 ecc_parity_real_length;
++};
++
++enum oob_overall {
++	OOB_DISCRETE = 0,
++	OOB_CONTINUOUS,
++};
++
++struct nand_casn {
++	/* CASN signature must be 4 chars: 'C','A','S','N'  */
++	union {
++		u8 sig[4];
++		u32 signature;
++	};
++
++	u8 version;
++	char manufacturer[13];
++	char model[16];
++
++	__be32 bits_per_cell;
++	__be32 bytes_per_page;
++	__be32 spare_bytes_per_page;
++	__be32 pages_per_block;
++	__be32 blocks_per_lun;
++	__be32 max_bb_per_lun;
++	__be32 planes_per_lun;
++	__be32 luns_per_target;
++	__be32 total_target;
++
++	__be32 ecc_strength;
++	__be32 ecc_step_size;
++
++	u8 flags;
++	u8 reserved1;
++
++	__be16 sdr_read_cap;
++	struct op_slice sdr_read_1_1_1;
++	struct op_slice sdr_read_1_1_1_fast;
++	struct op_slice sdr_read_1_1_2;
++	struct op_slice sdr_read_1_2_2;
++	struct op_slice sdr_read_1_1_4;
++	struct op_slice sdr_read_1_4_4;
++	struct op_slice sdr_read_1_1_8;
++	struct op_slice sdr_read_1_8_8;
++
++	struct op_slice sdr_cont_read_1_1_1;
++	struct op_slice sdr_cont_read_1_1_1_fast;
++	struct op_slice sdr_cont_read_1_1_2;
++	struct op_slice sdr_cont_read_1_2_2;
++	struct op_slice sdr_cont_read_1_1_4;
++	struct op_slice sdr_cont_read_1_4_4;
++	struct op_slice sdr_cont_read_1_1_8;
++	struct op_slice sdr_cont_read_1_8_8;
++
++	__be16 ddr_read_cap;
++	struct op_slice ddr_read_1_1_1;
++	struct op_slice ddr_read_1_1_1_fast;
++	struct op_slice ddr_read_1_1_2;
++	struct op_slice ddr_read_1_2_2;
++	struct op_slice ddr_read_1_1_4;
++	struct op_slice ddr_read_1_4_4;
++	struct op_slice ddr_read_1_1_8;
++	struct op_slice ddr_read_1_8_8;
++
++	struct op_slice ddr_cont_read_1_1_1;
++	struct op_slice ddr_cont_read_1_1_1_fast;
++	struct op_slice ddr_cont_read_1_1_2;
++	struct op_slice ddr_cont_read_1_2_2;
++	struct op_slice ddr_cont_read_1_1_4;
++	struct op_slice ddr_cont_read_1_4_4;
++	struct op_slice ddr_cont_read_1_1_8;
++	struct op_slice ddr_cont_read_1_8_8;
++
++	u8 sdr_write_cap;
++	struct op_slice sdr_write_1_1_1;
++	struct op_slice sdr_write_1_1_4;
++	struct op_slice reserved2[6];
++	u8 ddr_write_cap;
++	struct op_slice reserved3[8];
++
++	u8 sdr_update_cap;
++	struct op_slice sdr_update_1_1_1;
++	struct op_slice sdr_update_1_1_4;
++	struct op_slice reserved4[6];
++	u8 ddr_update_cap;
++	struct op_slice reserved5[8];
++
++	struct CASN_OOB casn_oob;
++
++	/* Advanced ECC status CMD0 (higher bits) */
++	struct ADV_ECC_STATUS ecc_status_high;
++	/* Advanced ECC status CMD1 (lower bits) */
++	struct ADV_ECC_STATUS ecc_status_low;
++
++	u8 advecc_noerr_status;
++	u8 advecc_uncor_status;
++	u8 advecc_post_op;
++	u8 advecc_post_mask;
++
++	u8 reserved6[5];
++	__be16 crc;
++} __packed;
++
++#endif /* __LINUX_MTD_CASN_H */
diff --git a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/patches-5.4/patches-5.4.inc b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/patches-5.4/patches-5.4.inc
index 81a4054..6ab5265 100644
--- a/recipes-kernel/linux/linux-mediatek-5.4/mediatek/patches-5.4/patches-5.4.inc
+++ b/recipes-kernel/linux/linux-mediatek-5.4/mediatek/patches-5.4/patches-5.4.inc
@@ -162,6 +162,8 @@
     file://999-2374-drivers-spi-mt65xx-Add-controller-calibration-parameter.patch \
     file://999-2375-spi-update-driver.patch \
     file://999-2376-drivers-spi-mt65xx-add-dts-buswidth-flow.patch \
+    file://999-2377-integrate-ONFI-and-CASN-manipulation.patch \
+    file://999-2378-Add-CASN-support-for-SPI-NAND.patch \
     file://999-2380-fix-dirty-race-between-do_tmpfile.patch \
     file://999-2500-cpufreq-add-the-missing-platform-driver-unregister.patch \
     file://999-2501-cpufreq-Enable-clocks-and-regulators.patch \
diff --git a/recipes-kernel/linux/linux-mediatek_5.4.bb b/recipes-kernel/linux/linux-mediatek_5.4.bb
index fcfe567..643bab7 100644
--- a/recipes-kernel/linux/linux-mediatek_5.4.bb
+++ b/recipes-kernel/linux/linux-mediatek_5.4.bb
@@ -9,8 +9,8 @@
 
 KBRANCH ?= "linux-5.4.y"
 
-LINUX_VERSION ?= "5.4.271"
-SRCREV_machine ?= "3fec063b052e395f4920fbc59a8d0bb3c9666d76"
+LINUX_VERSION ?= "5.4.281"
+SRCREV_machine ?= "84d75fd864979b0228cfe7170a359c0a60f04a98"
 KMETA = "kernel-meta"
 SRCREV_meta ?= "feeb59687bc0f054af837a5061f8d413ec7c93e9"
 
