[qca-ssdk]: new qos support for cppe

Change-Id: I2e72c2c1926715a89ad33eec2aec2159e7d0f663
Signed-off-by: xiaofeis <xiaofeis@codeaurora.org>
diff --git a/include/adpt/cppe/adpt_cppe_qm.h b/include/adpt/cppe/adpt_cppe_qm.h
new file mode 100755
index 0000000..c45e5bd
--- /dev/null
+++ b/include/adpt/cppe/adpt_cppe_qm.h
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2018, The Linux Foundation. All rights reserved.
+ * Permission to use, copy, modify, and/or distribute this software for
+ * any purpose with or without fee is hereby granted, provided that the
+ * above copyright notice and this permission notice appear in all copies.
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+
+/**
+ * @defgroup
+ * @{
+ */
+#ifndef _ADPT_CPPE_QM_H_
+#define _ADPT_CPPE_QM_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif                          /* __cplusplus */
+
+sw_error_t
+adpt_cppe_qm_port_source_profile_set(
+		a_uint32_t dev_id, fal_port_t port, a_uint32_t src_profile);
+sw_error_t
+adpt_cppe_qm_port_source_profile_get(
+		a_uint32_t dev_id, fal_port_t port, a_uint32_t *src_profile);
+
+#ifdef __cplusplus
+}
+#endif                          /* __cplusplus */
+#endif
+
+
diff --git a/include/adpt/cppe/adpt_cppe_qos.h b/include/adpt/cppe/adpt_cppe_qos.h
new file mode 100755
index 0000000..7cd3bcd
--- /dev/null
+++ b/include/adpt/cppe/adpt_cppe_qos.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2018, The Linux Foundation. All rights reserved.
+ * Permission to use, copy, modify, and/or distribute this software for
+ * any purpose with or without fee is hereby granted, provided that the
+ * above copyright notice and this permission notice appear in all copies.
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+
+/**
+ * @defgroup
+ * @{
+ */
+#ifndef _ADPT_CPPE_QOS_H_
+#define _ADPT_CPPE_QOS_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif                          /* __cplusplus */
+
+sw_error_t
+adpt_cppe_qos_port_pri_set(a_uint32_t dev_id, fal_port_t port_id,
+					fal_qos_pri_precedence_t *pri);
+sw_error_t
+adpt_cppe_qos_port_pri_get(a_uint32_t dev_id, fal_port_t port_id,
+					fal_qos_pri_precedence_t *pri);
+sw_error_t
+adpt_cppe_qos_cosmap_pcp_get(a_uint32_t dev_id, a_uint8_t group_id,
+					a_uint8_t pcp,
+					fal_qos_cosmap_t *cosmap);
+sw_error_t
+adpt_cppe_qos_cosmap_pcp_set(a_uint32_t dev_id, a_uint8_t group_id,
+					a_uint8_t pcp,
+					fal_qos_cosmap_t *cosmap);
+sw_error_t
+adpt_cppe_qos_cosmap_dscp_get(a_uint32_t dev_id, a_uint8_t group_id,
+					a_uint8_t dscp,
+					fal_qos_cosmap_t *cosmap);
+sw_error_t
+adpt_cppe_qos_cosmap_flow_set(a_uint32_t dev_id, a_uint8_t group_id,
+					a_uint8_t flow,
+					fal_qos_cosmap_t *cosmap);
+sw_error_t
+adpt_cppe_qos_port_group_set(a_uint32_t dev_id, fal_port_t port_id,
+					fal_qos_group_t *group);
+sw_error_t
+adpt_cppe_qos_cosmap_dscp_set(a_uint32_t dev_id, a_uint8_t group_id,
+					a_uint8_t dscp,
+					fal_qos_cosmap_t *cosmap);
+sw_error_t
+adpt_cppe_qos_cosmap_flow_get(a_uint32_t dev_id, a_uint8_t group_id,
+					a_uint8_t flow,
+					fal_qos_cosmap_t *cosmap);
+sw_error_t
+adpt_cppe_qos_port_group_get(a_uint32_t dev_id, fal_port_t port_id,
+					fal_qos_group_t *group);
+
+#ifdef __cplusplus
+}
+#endif                          /* __cplusplus */
+#endif
+
diff --git a/include/fal/fal_qos.h b/include/fal/fal_qos.h
index 8e5d429..eb824c5 100755
--- a/include/fal/fal_qos.h
+++ b/include/fal/fal_qos.h
@@ -64,6 +64,9 @@
 	a_int8_t preheader_pri;
 	a_uint8_t flow_pri;
 	a_uint8_t acl_pri;
+	a_uint8_t post_acl_pri;
+	a_bool_t pcp_pri_force;
+	a_bool_t dscp_pri_force;
 } fal_qos_pri_precedence_t;
 
 typedef struct {
@@ -78,6 +81,13 @@
 	a_uint8_t internal_pri;
 	a_uint8_t internal_dscp;
 	a_uint8_t internal_dp;
+	a_uint8_t dscp_mask;
+	a_bool_t dscp_en;
+	a_bool_t pcp_en;
+	a_bool_t dei_en;
+	a_bool_t pri_en;
+	a_bool_t dp_en;
+	a_uint8_t qos_prec; /* resolution precedence */
 } fal_qos_cosmap_t;
 
 typedef enum {
diff --git a/include/hsl/cppe/cppe_qos.h b/include/hsl/cppe/cppe_qos.h
new file mode 100755
index 0000000..ae58396
--- /dev/null
+++ b/include/hsl/cppe/cppe_qos.h
@@ -0,0 +1,186 @@
+/*
+ * Copyright (c) 2018, The Linux Foundation. All rights reserved.
+ * Permission to use, copy, modify, and/or distribute this software for
+ * any purpose with or without fee is hereby granted, provided that the
+ * above copyright notice and this permission notice appear in all copies.
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+
+/**
+ * @defgroup
+ * @{
+ */
+#ifndef _CPPE_QOS_H_
+#define _CPPE_QOS_H_
+
+#define QOS_MAPPING_TBL_MAX_ENTRY	2592
+#define QOS_MAPPING_FLOW_TBL_MAX_ENTRY	2048
+#define QOS_MAPPING_DSCP_TBL_MAX_ENTRY	256
+#define QOS_MAPPING_PCP_TBL_MAX_ENTRY	16
+#define QOS_MAPPING_TBL_MAX_GROUP	2
+
+
+sw_error_t
+cppe_qos_mapping_tbl_get(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		union qos_mapping_tbl_u *value);
+
+sw_error_t
+cppe_qos_mapping_tbl_set(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		union qos_mapping_tbl_u *value);
+
+sw_error_t
+cppe_qos_mapping_tbl_int_pcp_get(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t *value);
+
+sw_error_t
+cppe_qos_mapping_tbl_int_pcp_set(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t value);
+
+sw_error_t
+cppe_qos_mapping_tbl_int_dei_get(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t *value);
+
+sw_error_t
+cppe_qos_mapping_tbl_int_dei_set(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t value);
+
+sw_error_t
+cppe_qos_mapping_tbl_int_dei_en_get(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t *value);
+
+sw_error_t
+cppe_qos_mapping_tbl_int_dei_en_set(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t value);
+
+sw_error_t
+cppe_qos_mapping_tbl_dscp_tc_mask_get(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t *value);
+
+sw_error_t
+cppe_qos_mapping_tbl_dscp_tc_mask_set(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t value);
+
+sw_error_t
+cppe_qos_mapping_tbl_int_dscp_tc_get(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t *value);
+
+sw_error_t
+cppe_qos_mapping_tbl_int_dscp_tc_set(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t value);
+
+sw_error_t
+cppe_qos_mapping_tbl_int_dp_en_get(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t *value);
+
+sw_error_t
+cppe_qos_mapping_tbl_int_dp_en_set(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t value);
+
+sw_error_t
+cppe_qos_mapping_tbl_int_dp_get(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t *value);
+
+sw_error_t
+cppe_qos_mapping_tbl_int_dp_set(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t value);
+
+sw_error_t
+cppe_qos_mapping_tbl_int_pri_en_get(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t *value);
+
+sw_error_t
+cppe_qos_mapping_tbl_int_pri_en_set(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t value);
+
+sw_error_t
+cppe_qos_mapping_tbl_qos_res_prec_get(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t *value);
+
+sw_error_t
+cppe_qos_mapping_tbl_qos_res_prec_set(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t value);
+
+sw_error_t
+cppe_qos_mapping_tbl_int_pcp_en_get(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t *value);
+
+sw_error_t
+cppe_qos_mapping_tbl_int_pcp_en_set(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t value);
+
+sw_error_t
+cppe_qos_mapping_tbl_int_pri_get(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t *value);
+
+sw_error_t
+cppe_qos_mapping_tbl_int_pri_set(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t value);
+
+sw_error_t
+cppe_qos_mapping_tbl_int_dscp_en_get(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t *value);
+
+sw_error_t
+cppe_qos_mapping_tbl_int_dscp_en_set(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t value);
+
+#endif
\ No newline at end of file
diff --git a/include/hsl/cppe/cppe_qos_reg.h b/include/hsl/cppe/cppe_qos_reg.h
new file mode 100755
index 0000000..92e473b
--- /dev/null
+++ b/include/hsl/cppe/cppe_qos_reg.h
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2018, The Linux Foundation. All rights reserved.
+ * Permission to use, copy, modify, and/or distribute this software for
+ * any purpose with or without fee is hereby granted, provided that the
+ * above copyright notice and this permission notice appear in all copies.
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+
+/**
+ * @defgroup
+ * @{
+ */
+#ifndef _CPPE_QOS_REG_H_
+#define _CPPE_QOS_REG_H_
+
+/*[table] QOS_MAPPING_TBL*/
+#define QOS_MAPPING_TBL
+#define QOS_MAPPING_TBL_ADDRESS 0x20000
+#define QOS_MAPPING_TBL_NUM     2592
+#define QOS_MAPPING_TBL_INC     0x10
+#define QOS_MAPPING_TBL_TYPE    REG_TYPE_RW
+#define QOS_MAPPING_TBL_DEFAULT 0x0
+	/*[field] INT_DSCP_TC*/
+	#define QOS_MAPPING_TBL_INT_DSCP_TC
+	#define QOS_MAPPING_TBL_INT_DSCP_TC_OFFSET  0
+	#define QOS_MAPPING_TBL_INT_DSCP_TC_LEN     8
+	#define QOS_MAPPING_TBL_INT_DSCP_TC_DEFAULT 0x0
+	/*[field] DSCP_TC_MASK*/
+	#define QOS_MAPPING_TBL_DSCP_TC_MASK
+	#define QOS_MAPPING_TBL_DSCP_TC_MASK_OFFSET  8
+	#define QOS_MAPPING_TBL_DSCP_TC_MASK_LEN     8
+	#define QOS_MAPPING_TBL_DSCP_TC_MASK_DEFAULT 0x0
+	/*[field] INT_DSCP_EN*/
+	#define QOS_MAPPING_TBL_INT_DSCP_EN
+	#define QOS_MAPPING_TBL_INT_DSCP_EN_OFFSET  16
+	#define QOS_MAPPING_TBL_INT_DSCP_EN_LEN     1
+	#define QOS_MAPPING_TBL_INT_DSCP_EN_DEFAULT 0x0
+	/*[field] INT_PCP_EN*/
+	#define QOS_MAPPING_TBL_INT_PCP_EN
+	#define QOS_MAPPING_TBL_INT_PCP_EN_OFFSET  17
+	#define QOS_MAPPING_TBL_INT_PCP_EN_LEN     1
+	#define QOS_MAPPING_TBL_INT_PCP_EN_DEFAULT 0x0
+	/*[field] INT_PCP*/
+	#define QOS_MAPPING_TBL_INT_PCP
+	#define QOS_MAPPING_TBL_INT_PCP_OFFSET  18
+	#define QOS_MAPPING_TBL_INT_PCP_LEN     3
+	#define QOS_MAPPING_TBL_INT_PCP_DEFAULT 0x0
+	/*[field] INT_DEI_EN*/
+	#define QOS_MAPPING_TBL_INT_DEI_EN
+	#define QOS_MAPPING_TBL_INT_DEI_EN_OFFSET  21
+	#define QOS_MAPPING_TBL_INT_DEI_EN_LEN     1
+	#define QOS_MAPPING_TBL_INT_DEI_EN_DEFAULT 0x0
+	/*[field] INT_DEI*/
+	#define QOS_MAPPING_TBL_INT_DEI
+	#define QOS_MAPPING_TBL_INT_DEI_OFFSET  22
+	#define QOS_MAPPING_TBL_INT_DEI_LEN     1
+	#define QOS_MAPPING_TBL_INT_DEI_DEFAULT 0x0
+	/*[field] INT_PRI_EN*/
+	#define QOS_MAPPING_TBL_INT_PRI_EN
+	#define QOS_MAPPING_TBL_INT_PRI_EN_OFFSET  23
+	#define QOS_MAPPING_TBL_INT_PRI_EN_LEN     1
+	#define QOS_MAPPING_TBL_INT_PRI_EN_DEFAULT 0x0
+	/*[field] INT_PRI*/
+	#define QOS_MAPPING_TBL_INT_PRI
+	#define QOS_MAPPING_TBL_INT_PRI_OFFSET  24
+	#define QOS_MAPPING_TBL_INT_PRI_LEN     4
+	#define QOS_MAPPING_TBL_INT_PRI_DEFAULT 0x0
+	/*[field] INT_DP_EN*/
+	#define QOS_MAPPING_TBL_INT_DP_EN
+	#define QOS_MAPPING_TBL_INT_DP_EN_OFFSET  28
+	#define QOS_MAPPING_TBL_INT_DP_EN_LEN     1
+	#define QOS_MAPPING_TBL_INT_DP_EN_DEFAULT 0x0
+	/*[field] INT_DP*/
+	#define QOS_MAPPING_TBL_INT_DP
+	#define QOS_MAPPING_TBL_INT_DP_OFFSET  29
+	#define QOS_MAPPING_TBL_INT_DP_LEN     2
+	#define QOS_MAPPING_TBL_INT_DP_DEFAULT 0x0
+	/*[field] QOS_RES_PREC*/
+	#define QOS_MAPPING_TBL_QOS_RES_PREC
+	#define QOS_MAPPING_TBL_QOS_RES_PREC_OFFSET  31
+	#define QOS_MAPPING_TBL_QOS_RES_PREC_LEN     3
+	#define QOS_MAPPING_TBL_QOS_RES_PREC_DEFAULT 0x0
+
+struct qos_mapping_tbl {
+	a_uint32_t  int_dscp_tc:8;
+	a_uint32_t  dscp_tc_mask:8;
+	a_uint32_t  int_dscp_en:1;
+	a_uint32_t  int_pcp_en:1;
+	a_uint32_t  int_pcp:3;
+	a_uint32_t  int_dei_en:1;
+	a_uint32_t  int_dei:1;
+	a_uint32_t  int_pri_en:1;
+	a_uint32_t  int_pri:4;
+	a_uint32_t  int_dp_en:1;
+	a_uint32_t  int_dp:2;
+	a_uint32_t  qos_res_prec_0:1;
+	a_uint32_t  qos_res_prec_1:2;
+	a_uint32_t  _reserved0:30;
+};
+
+union qos_mapping_tbl_u {
+	a_uint32_t val[2];
+	struct qos_mapping_tbl bf;
+};
+
+#endif
\ No newline at end of file
diff --git a/src/adpt/cppe/Makefile b/src/adpt/cppe/Makefile
index dda7038..26ba4ae 100755
--- a/src/adpt/cppe/Makefile
+++ b/src/adpt/cppe/Makefile
@@ -9,6 +9,14 @@
   SRC_LIST += adpt_cppe_portctrl.c
 endif
 
+ifeq (TRUE, $(IN_QM))
+  SRC_LIST += adpt_cppe_qm.c
+endif
+
+ifeq (TRUE, $(IN_QOS))
+  SRC_LIST += adpt_cppe_qos.c
+endif
+
 ifeq (, $(findstring CPPE, $(SUPPORT_CHIP)))
   SRC_LIST=
 endif
diff --git a/src/adpt/cppe/adpt_cppe_qm.c b/src/adpt/cppe/adpt_cppe_qm.c
new file mode 100755
index 0000000..9715bf2
--- /dev/null
+++ b/src/adpt/cppe/adpt_cppe_qm.c
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2018, The Linux Foundation. All rights reserved.
+ * Permission to use, copy, modify, and/or distribute this software for
+ * any purpose with or without fee is hereby granted, provided that the
+ * above copyright notice and this permission notice appear in all copies.
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+
+/**
+ * @defgroup
+ * @{
+ */
+#include "sw.h"
+#include "fal_qos.h"
+#include "cppe_portctrl_reg.h"
+#include "cppe_portctrl.h"
+#include "adpt.h"
+
+sw_error_t
+adpt_cppe_qm_port_source_profile_set(
+		a_uint32_t dev_id, fal_port_t port, a_uint32_t src_profile)
+{
+	union cppe_mru_mtu_ctrl_tbl_u mru_mtu_ctrl_tbl;
+	a_uint32_t index = FAL_PORT_ID_VALUE(port);
+
+	ADPT_DEV_ID_CHECK(dev_id);
+	memset(&mru_mtu_ctrl_tbl, 0, sizeof(mru_mtu_ctrl_tbl));
+
+
+	return cppe_mru_mtu_ctrl_tbl_src_profile_set(dev_id, index,
+				src_profile);
+}
+
+sw_error_t
+adpt_cppe_qm_port_source_profile_get(
+		a_uint32_t dev_id, fal_port_t port, a_uint32_t *src_profile)
+{
+	union cppe_mru_mtu_ctrl_tbl_u mru_mtu_ctrl_tbl;
+	a_uint32_t index = FAL_PORT_ID_VALUE(port);
+
+	ADPT_DEV_ID_CHECK(dev_id);
+	ADPT_NULL_POINT_CHECK(src_profile);
+	memset(&mru_mtu_ctrl_tbl, 0, sizeof(mru_mtu_ctrl_tbl));
+
+	return cppe_mru_mtu_ctrl_tbl_src_profile_get(dev_id, index,
+				src_profile);
+}
+
+/**
+ * @}
+ */
\ No newline at end of file
diff --git a/src/adpt/cppe/adpt_cppe_qos.c b/src/adpt/cppe/adpt_cppe_qos.c
new file mode 100755
index 0000000..638cd68
--- /dev/null
+++ b/src/adpt/cppe/adpt_cppe_qos.c
@@ -0,0 +1,289 @@
+/*
+ * Copyright (c) 2018, The Linux Foundation. All rights reserved.
+ * Permission to use, copy, modify, and/or distribute this software for
+ * any purpose with or without fee is hereby granted, provided that the
+ * above copyright notice and this permission notice appear in all copies.
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+
+/**
+ * @defgroup
+ * @{
+ */
+#include "sw.h"
+#include "fal_qos.h"
+#include "cppe_portctrl_reg.h"
+#include "cppe_portctrl.h"
+#include "cppe_qos_reg.h"
+#include "cppe_qos.h"
+#include "adpt.h"
+
+static sw_error_t
+adpt_cppe_qos_mapping_get(a_uint32_t dev_id, a_uint32_t index,
+			fal_qos_cosmap_t *cosmap)
+{
+	sw_error_t rv = SW_OK;
+	union qos_mapping_tbl_u qos_mapping_tbl;
+
+	ADPT_DEV_ID_CHECK(dev_id);
+	ADPT_NULL_POINT_CHECK(cosmap);
+
+	rv = cppe_qos_mapping_tbl_get(dev_id, index, &qos_mapping_tbl);
+	if (rv != SW_OK)
+		return rv;
+
+	cosmap->internal_pcp = qos_mapping_tbl.bf.int_pcp;
+	cosmap->internal_dei = qos_mapping_tbl.bf.int_dei;
+	cosmap->internal_pri = qos_mapping_tbl.bf.int_pri;
+	cosmap->internal_dscp = qos_mapping_tbl.bf.int_dscp_tc;
+	cosmap->internal_dp = qos_mapping_tbl.bf.int_dp;
+	cosmap->dscp_mask = qos_mapping_tbl.bf.dscp_tc_mask;
+	cosmap->dscp_en = qos_mapping_tbl.bf.int_dscp_en;
+	cosmap->pcp_en = qos_mapping_tbl.bf.int_pcp_en;
+	cosmap->dei_en = qos_mapping_tbl.bf.int_dei_en;
+	cosmap->pri_en = qos_mapping_tbl.bf.int_pri_en;
+	cosmap->dp_en = qos_mapping_tbl.bf.int_dp_en;
+	cosmap->qos_prec = qos_mapping_tbl.bf.qos_res_prec_0 |
+			     qos_mapping_tbl.bf.qos_res_prec_1 << 1;
+
+	return SW_OK;
+}
+
+static sw_error_t
+adpt_cppe_qos_mapping_set(a_uint32_t dev_id, a_uint32_t index,
+			fal_qos_cosmap_t *cosmap)
+{
+	union qos_mapping_tbl_u qos_mapping_tbl;
+
+	ADPT_DEV_ID_CHECK(dev_id);
+        ADPT_NULL_POINT_CHECK(cosmap);
+
+	memset(&qos_mapping_tbl, 0, sizeof(qos_mapping_tbl));
+
+	qos_mapping_tbl.bf.int_pcp = cosmap->internal_pcp;
+	qos_mapping_tbl.bf.int_dei = cosmap->internal_dei;
+	qos_mapping_tbl.bf.int_pri = cosmap->internal_pri;
+	qos_mapping_tbl.bf.int_dscp_tc = cosmap->internal_dscp;
+	qos_mapping_tbl.bf.int_dp = cosmap->internal_dp;
+	qos_mapping_tbl.bf.dscp_tc_mask = cosmap->dscp_mask;
+	qos_mapping_tbl.bf.int_dscp_en = cosmap->dscp_en;
+	qos_mapping_tbl.bf.int_pcp_en = cosmap->pcp_en;
+	qos_mapping_tbl.bf.int_dei_en = cosmap->dei_en;
+	qos_mapping_tbl.bf.int_pri_en = cosmap->pri_en;
+	qos_mapping_tbl.bf.int_dp_en = cosmap->dp_en;
+	qos_mapping_tbl.bf.qos_res_prec_0 = cosmap->qos_prec & 1;
+	qos_mapping_tbl.bf.qos_res_prec_1 = (cosmap->qos_prec >> 1) & 3;
+
+	return cppe_qos_mapping_tbl_set(dev_id, index, &qos_mapping_tbl);
+}
+
+sw_error_t
+adpt_cppe_qos_port_pri_set(a_uint32_t dev_id, fal_port_t port_id,
+			fal_qos_pri_precedence_t *pri)
+{
+	union cppe_mru_mtu_ctrl_tbl_u cppe_mru_mtu_ctrl;
+
+	memset(&cppe_mru_mtu_ctrl, 0, sizeof(cppe_mru_mtu_ctrl));
+	ADPT_DEV_ID_CHECK(dev_id);
+	ADPT_NULL_POINT_CHECK(pri);
+
+	cppe_mru_mtu_ctrl_tbl_get(dev_id, port_id, &cppe_mru_mtu_ctrl);
+
+	cppe_mru_mtu_ctrl.bf.pcp_res_prec = pri->pcp_pri;
+	cppe_mru_mtu_ctrl.bf.dscp_res_prec = pri->dscp_pri;
+	cppe_mru_mtu_ctrl.bf.preheader_res_prec = pri->preheader_pri;
+	cppe_mru_mtu_ctrl.bf.flow_res_prec = pri->flow_pri;
+	cppe_mru_mtu_ctrl.bf.pre_acl_res_prec = pri->acl_pri;
+	cppe_mru_mtu_ctrl.bf.post_acl_res_prec = pri->post_acl_pri;
+	cppe_mru_mtu_ctrl.bf.pcp_res_prec_force = pri->pcp_pri_force;
+	cppe_mru_mtu_ctrl.bf.dscp_res_prec_force = pri->dscp_pri_force;
+
+	return cppe_mru_mtu_ctrl_tbl_set(dev_id, port_id, &cppe_mru_mtu_ctrl);
+}
+
+sw_error_t
+adpt_cppe_qos_port_pri_get(a_uint32_t dev_id, fal_port_t port_id,
+			fal_qos_pri_precedence_t *pri)
+{
+	sw_error_t rv = SW_OK;
+	union cppe_mru_mtu_ctrl_tbl_u cppe_mru_mtu_ctrl;
+
+	memset(&cppe_mru_mtu_ctrl, 0, sizeof(cppe_mru_mtu_ctrl));
+	ADPT_DEV_ID_CHECK(dev_id);
+	ADPT_NULL_POINT_CHECK(pri);
+
+	rv = cppe_mru_mtu_ctrl_tbl_get(dev_id, port_id, &cppe_mru_mtu_ctrl);
+	if( rv != SW_OK )
+		return rv;
+
+	pri->pcp_pri = cppe_mru_mtu_ctrl.bf.pcp_res_prec;
+	pri->dscp_pri = cppe_mru_mtu_ctrl.bf.dscp_res_prec;
+	pri->preheader_pri = cppe_mru_mtu_ctrl.bf.preheader_res_prec;
+	pri->flow_pri = cppe_mru_mtu_ctrl.bf.flow_res_prec;
+	pri->acl_pri = cppe_mru_mtu_ctrl.bf.pre_acl_res_prec;
+	pri->post_acl_pri = cppe_mru_mtu_ctrl.bf.post_acl_res_prec;
+	pri->pcp_pri_force = cppe_mru_mtu_ctrl.bf.pcp_res_prec_force;
+	pri->dscp_pri_force = cppe_mru_mtu_ctrl.bf.dscp_res_prec_force;
+
+	return SW_OK;
+}
+
+sw_error_t
+adpt_cppe_qos_cosmap_pcp_get(a_uint32_t dev_id, a_uint8_t group_id,
+			a_uint8_t pcp,
+			fal_qos_cosmap_t *cosmap)
+{
+	a_uint32_t index = 0;
+
+	ADPT_DEV_ID_CHECK(dev_id);
+	ADPT_NULL_POINT_CHECK(cosmap);
+
+	if (group_id >= QOS_MAPPING_TBL_MAX_GROUP)
+		return SW_BAD_PARAM;
+
+	index = QOS_MAPPING_FLOW_TBL_MAX_ENTRY +
+		2 * QOS_MAPPING_DSCP_TBL_MAX_ENTRY +
+		group_id * QOS_MAPPING_PCP_TBL_MAX_ENTRY + pcp;
+
+	return adpt_cppe_qos_mapping_get(dev_id, index, cosmap);
+}
+
+sw_error_t
+adpt_cppe_qos_cosmap_pcp_set(a_uint32_t dev_id, a_uint8_t group_id,
+			a_uint8_t pcp,
+			fal_qos_cosmap_t *cosmap)
+{
+	a_uint32_t index = 0;
+
+	ADPT_DEV_ID_CHECK(dev_id);
+	ADPT_NULL_POINT_CHECK(cosmap);
+
+	if (group_id >= QOS_MAPPING_TBL_MAX_GROUP)
+		return SW_BAD_PARAM;
+
+	index = QOS_MAPPING_FLOW_TBL_MAX_ENTRY +
+		2 * QOS_MAPPING_DSCP_TBL_MAX_ENTRY +
+		group_id * QOS_MAPPING_PCP_TBL_MAX_ENTRY + pcp;
+
+	return adpt_cppe_qos_mapping_set(dev_id, index, cosmap);
+}
+
+sw_error_t
+adpt_cppe_qos_cosmap_dscp_get(a_uint32_t dev_id, a_uint8_t group_id,
+			a_uint8_t dscp,
+			fal_qos_cosmap_t *cosmap)
+{
+	a_uint32_t index = 0;
+
+	ADPT_DEV_ID_CHECK(dev_id);
+	ADPT_NULL_POINT_CHECK(cosmap);
+
+	if (group_id >= QOS_MAPPING_TBL_MAX_GROUP)
+		return SW_BAD_PARAM;
+
+	index = QOS_MAPPING_FLOW_TBL_MAX_ENTRY +
+		group_id * QOS_MAPPING_DSCP_TBL_MAX_ENTRY +
+		dscp;
+
+	return adpt_cppe_qos_mapping_get(dev_id, index, cosmap);
+}
+
+sw_error_t
+adpt_cppe_qos_cosmap_flow_set(a_uint32_t dev_id, a_uint8_t group_id,
+			a_uint8_t flow,
+			fal_qos_cosmap_t *cosmap)
+{
+	ADPT_DEV_ID_CHECK(dev_id);
+	ADPT_NULL_POINT_CHECK(cosmap);
+
+	if (flow >= QOS_MAPPING_FLOW_TBL_MAX_ENTRY)
+		return SW_BAD_PARAM;
+
+	return adpt_cppe_qos_mapping_set(dev_id, flow, cosmap);
+}
+
+sw_error_t
+adpt_cppe_qos_port_group_set(a_uint32_t dev_id, fal_port_t port_id,
+			fal_qos_group_t *group)
+{
+	union cppe_mru_mtu_ctrl_tbl_u cppe_mru_mtu_ctrl;
+
+	memset(&cppe_mru_mtu_ctrl, 0, sizeof(cppe_mru_mtu_ctrl));
+	ADPT_DEV_ID_CHECK(dev_id);
+	ADPT_NULL_POINT_CHECK(group);
+
+	cppe_mru_mtu_ctrl_tbl_get(dev_id, port_id, &cppe_mru_mtu_ctrl);
+
+	cppe_mru_mtu_ctrl.bf.pcp_qos_group_id = group->pcp_group;
+	cppe_mru_mtu_ctrl.bf.dscp_qos_group_id = group->dscp_group;
+
+	return cppe_mru_mtu_ctrl_tbl_set(dev_id, port_id, &cppe_mru_mtu_ctrl);
+}
+
+sw_error_t
+adpt_cppe_qos_cosmap_dscp_set(a_uint32_t dev_id, a_uint8_t group_id,
+			a_uint8_t dscp,
+			fal_qos_cosmap_t *cosmap)
+{
+	a_uint32_t index = 0;
+
+	ADPT_DEV_ID_CHECK(dev_id);
+	ADPT_NULL_POINT_CHECK(cosmap);
+
+	if (group_id >= QOS_MAPPING_TBL_MAX_GROUP)
+		return SW_BAD_PARAM;
+
+	index = QOS_MAPPING_FLOW_TBL_MAX_ENTRY +
+		group_id * QOS_MAPPING_DSCP_TBL_MAX_ENTRY +
+		dscp;
+
+	return adpt_cppe_qos_mapping_set(dev_id, index, cosmap);
+}
+
+sw_error_t
+adpt_cppe_qos_cosmap_flow_get(a_uint32_t dev_id, a_uint8_t group_id,
+			a_uint8_t flow,
+			fal_qos_cosmap_t *cosmap)
+{
+	ADPT_DEV_ID_CHECK(dev_id);
+	ADPT_NULL_POINT_CHECK(cosmap);
+
+	if (flow >= QOS_MAPPING_FLOW_TBL_MAX_ENTRY)
+		return SW_BAD_PARAM;
+
+	return adpt_cppe_qos_mapping_get(dev_id, flow, cosmap);
+}
+
+sw_error_t
+adpt_cppe_qos_port_group_get(a_uint32_t dev_id, fal_port_t port_id,
+			fal_qos_group_t *group)
+{
+	sw_error_t rv = SW_OK;
+	union cppe_mru_mtu_ctrl_tbl_u cppe_mru_mtu_ctrl;
+
+	memset(&cppe_mru_mtu_ctrl, 0, sizeof(cppe_mru_mtu_ctrl));
+	ADPT_DEV_ID_CHECK(dev_id);
+	ADPT_NULL_POINT_CHECK(group);
+
+	rv = cppe_mru_mtu_ctrl_tbl_get(dev_id, port_id, &cppe_mru_mtu_ctrl);
+	if( rv != SW_OK )
+		return rv;
+
+	group->pcp_group = cppe_mru_mtu_ctrl.bf.pcp_qos_group_id;
+	group->dscp_group = cppe_mru_mtu_ctrl.bf.dscp_qos_group_id;
+
+	return SW_OK;
+}
+
+
+/**
+ * @}
+ */
+
diff --git a/src/adpt/hppe/adpt_hppe_qm.c b/src/adpt/hppe/adpt_hppe_qm.c
old mode 100644
new mode 100755
index 190959b..5464b26
--- a/src/adpt/hppe/adpt_hppe_qm.c
+++ b/src/adpt/hppe/adpt_hppe_qm.c
@@ -29,6 +29,10 @@
 #include "hppe_portctrl_reg.h"
 #include "hppe_portctrl.h"
 #include "adpt.h"
+#include "adpt_hppe.h"
+#if defined(CPPE)
+#include "adpt_cppe_qm.h"
+#endif
 
 #define SERVICE_CODE_QUEUE_OFFSET   2048
 #define CPU_CODE_QUEUE_OFFSET         1024
@@ -1159,7 +1163,7 @@
 	return SW_OK;
 }
 
-sw_error_t
+static sw_error_t
 adpt_hppe_qm_port_source_profile_set(
 		a_uint32_t dev_id, fal_port_t port, a_uint32_t src_profile)
 {
@@ -1175,6 +1179,26 @@
 }
 
 sw_error_t
+adpt_ppe_qm_port_source_profile_set(
+		a_uint32_t dev_id, fal_port_t port, a_uint32_t src_profile)
+{
+	a_uint32_t chip_ver = 0;
+
+	chip_ver = adpt_hppe_chip_revision_get(dev_id);
+	if (chip_ver == CPPE_REVISION) {
+#if defined(CPPE)
+		return adpt_cppe_qm_port_source_profile_set(dev_id, port,
+				src_profile);
+#endif
+	} else {
+		return adpt_hppe_qm_port_source_profile_set(dev_id, port,
+				src_profile);
+	}
+
+	return SW_NOT_SUPPORTED;
+}
+
+static sw_error_t
 adpt_hppe_qm_port_source_profile_get(
 		a_uint32_t dev_id, fal_port_t port, a_uint32_t *src_profile)
 {
@@ -1190,6 +1214,26 @@
 }
 #endif
 
+sw_error_t
+adpt_ppe_qm_port_source_profile_get(
+		a_uint32_t dev_id, fal_port_t port, a_uint32_t *src_profile)
+{
+	a_uint32_t chip_ver = 0;
+
+	chip_ver = adpt_hppe_chip_revision_get(dev_id);
+	if (chip_ver == CPPE_REVISION) {
+#if defined(CPPE)
+		return adpt_cppe_qm_port_source_profile_get(dev_id, port,
+				src_profile);
+#endif
+	} else {
+		return adpt_hppe_qm_port_source_profile_get(dev_id, port,
+				src_profile);
+	}
+
+	return SW_NOT_SUPPORTED;
+}
+
 void adpt_hppe_qm_func_bitmap_init(a_uint32_t dev_id)
 {
 	adpt_api_t *p_adpt_api = NULL;
@@ -1356,12 +1400,11 @@
 	if (p_adpt_api->adpt_qm_func_bitmap[0] & (1 << FUNC_QM_ENQUEUE_CTRL_GET))
 		p_adpt_api->adpt_qm_enqueue_ctrl_get = adpt_hppe_qm_enqueue_ctrl_get;
 	if (p_adpt_api->adpt_qm_func_bitmap[0] & (1 << FUNC_QM_PORT_SRCPROFILE_GET))
-		p_adpt_api->adpt_qm_port_source_profile_get = adpt_hppe_qm_port_source_profile_get;
+		p_adpt_api->adpt_qm_port_source_profile_get = adpt_ppe_qm_port_source_profile_get;
 	if (p_adpt_api->adpt_qm_func_bitmap[1] & (1 << (FUNC_QM_PORT_SRCPROFILE_SET % 32)))
-		p_adpt_api->adpt_qm_port_source_profile_set = adpt_hppe_qm_port_source_profile_set;
+		p_adpt_api->adpt_qm_port_source_profile_set = adpt_ppe_qm_port_source_profile_set;
 #endif
 
-
 	return SW_OK;
 }
 
diff --git a/src/adpt/hppe/adpt_hppe_qos.c b/src/adpt/hppe/adpt_hppe_qos.c
index 289d658..54dda6a 100755
--- a/src/adpt/hppe/adpt_hppe_qos.c
+++ b/src/adpt/hppe/adpt_hppe_qos.c
@@ -25,6 +25,10 @@
 #include "hppe_shaper_reg.h"
 #include "hppe_shaper.h"
 #include "adpt.h"
+#include "adpt_hppe.h"
+#if defined(CPPE)
+#include "adpt_cppe_qos.h"
+#endif
 
 static fal_queue_bmp_t port_queue_map[8] = {0};
 
@@ -119,7 +123,8 @@
 	return SW_OK;
 }
 #endif
-sw_error_t
+
+static sw_error_t
 adpt_hppe_qos_port_pri_set(a_uint32_t dev_id, fal_port_t port_id,
 					fal_qos_pri_precedence_t *pri)
 {
@@ -139,7 +144,29 @@
 	
 	return hppe_port_qos_ctrl_set(dev_id, port_id, &port_qos_ctrl);
 }
+
 sw_error_t
+adpt_ppe_qos_port_pri_set(a_uint32_t dev_id, fal_port_t port_id,
+					fal_qos_pri_precedence_t *pri)
+{
+	a_uint32_t chip_ver = 0;
+
+	ADPT_DEV_ID_CHECK(dev_id);
+	ADPT_NULL_POINT_CHECK(pri);
+
+	chip_ver = adpt_hppe_chip_revision_get(dev_id);
+	if (chip_ver == CPPE_REVISION) {
+#if defined(CPPE)
+		return adpt_cppe_qos_port_pri_set(dev_id, port_id, pri);
+#endif
+	} else {
+		return adpt_hppe_qos_port_pri_set(dev_id, port_id, pri);
+	}
+
+	return SW_NOT_SUPPORTED;
+}
+
+static sw_error_t
 adpt_hppe_qos_port_pri_get(a_uint32_t dev_id, fal_port_t port_id,
 					fal_qos_pri_precedence_t *pri)
 {
@@ -164,6 +191,27 @@
 }
 
 sw_error_t
+adpt_ppe_qos_port_pri_get(a_uint32_t dev_id, fal_port_t port_id,
+					fal_qos_pri_precedence_t *pri)
+{
+	a_uint32_t chip_ver = 0;
+
+	ADPT_DEV_ID_CHECK(dev_id);
+        ADPT_NULL_POINT_CHECK(pri);
+
+	chip_ver = adpt_hppe_chip_revision_get(dev_id);
+	if (chip_ver == CPPE_REVISION) {
+#if defined(CPPE)
+		return adpt_cppe_qos_port_pri_get(dev_id, port_id, pri);
+#endif
+	} else {
+		return adpt_hppe_qos_port_pri_get(dev_id, port_id, pri);
+	}
+
+	return SW_NOT_SUPPORTED;
+}
+
+static sw_error_t
 adpt_hppe_qos_cosmap_pcp_get(a_uint32_t dev_id, a_uint8_t group_id,
 					a_uint8_t pcp, fal_qos_cosmap_t *cosmap)
 {
@@ -202,6 +250,29 @@
 }
 
 sw_error_t
+adpt_ppe_qos_cosmap_pcp_get(a_uint32_t dev_id, a_uint8_t group_id,
+					a_uint8_t pcp, fal_qos_cosmap_t *cosmap)
+{
+	a_uint32_t chip_ver = 0;
+
+	ADPT_DEV_ID_CHECK(dev_id);
+        ADPT_NULL_POINT_CHECK(cosmap);
+
+	chip_ver = adpt_hppe_chip_revision_get(dev_id);
+	if (chip_ver == CPPE_REVISION) {
+#if defined(CPPE)
+		return adpt_cppe_qos_cosmap_pcp_get(dev_id, group_id,
+				pcp, cosmap);
+#endif
+	} else {
+		return adpt_hppe_qos_cosmap_pcp_get(dev_id, group_id,
+				pcp, cosmap);
+	}
+
+	return SW_NOT_SUPPORTED;
+}
+
+sw_error_t
 adpt_hppe_l0_queue_map_set(a_uint32_t dev_id,
 					a_uint32_t node_id,
 					fal_port_t port_id,
@@ -302,7 +373,7 @@
 	return SW_OK;
 }
 
-sw_error_t
+static sw_error_t
 adpt_hppe_qos_cosmap_pcp_set(a_uint32_t dev_id, a_uint8_t group_id,
 					a_uint8_t pcp, fal_qos_cosmap_t *cosmap)
 {
@@ -335,6 +406,29 @@
 
 	return rv;
 }
+
+sw_error_t
+adpt_ppe_qos_cosmap_pcp_set(a_uint32_t dev_id, a_uint8_t group_id,
+					a_uint8_t pcp, fal_qos_cosmap_t *cosmap)
+{
+	a_uint32_t chip_ver = 0;
+
+	ADPT_DEV_ID_CHECK(dev_id);
+        ADPT_NULL_POINT_CHECK(cosmap);
+
+	chip_ver = adpt_hppe_chip_revision_get(dev_id);
+	if (chip_ver == CPPE_REVISION) {
+#if defined(CPPE)
+		return adpt_cppe_qos_cosmap_pcp_set(dev_id, group_id,
+				pcp, cosmap);
+#endif
+	} else {
+		return adpt_hppe_qos_cosmap_pcp_set(dev_id, group_id,
+				pcp, cosmap);
+	}
+
+	return SW_NOT_SUPPORTED;;
+}
 sw_error_t
 adpt_hppe_qos_port_remark_get(a_uint32_t dev_id, fal_port_t port_id,
 					fal_qos_remark_enable_t *remark)
@@ -358,7 +452,7 @@
 	return SW_OK;
 }
 
-sw_error_t
+static sw_error_t
 adpt_hppe_qos_cosmap_dscp_get(a_uint32_t dev_id, a_uint8_t group_id,
 					a_uint8_t dscp, fal_qos_cosmap_t *cosmap)
 {
@@ -397,6 +491,29 @@
 }
 
 sw_error_t
+adpt_ppe_qos_cosmap_dscp_get(a_uint32_t dev_id, a_uint8_t group_id,
+					a_uint8_t dscp, fal_qos_cosmap_t *cosmap)
+{
+	a_uint32_t chip_ver = 0;
+
+	ADPT_DEV_ID_CHECK(dev_id);
+        ADPT_NULL_POINT_CHECK(cosmap);
+
+	chip_ver = adpt_hppe_chip_revision_get(dev_id);
+	if (chip_ver == CPPE_REVISION) {
+#if defined(CPPE)
+		return adpt_cppe_qos_cosmap_dscp_get(dev_id, group_id,
+				dscp, cosmap);
+#endif
+	} else {
+		return adpt_hppe_qos_cosmap_dscp_get(dev_id, group_id,
+				dscp, cosmap);
+	}
+
+	return SW_NOT_SUPPORTED;
+}
+
+static sw_error_t
 adpt_hppe_qos_cosmap_flow_set(a_uint32_t dev_id, a_uint8_t group_id,
 					a_uint8_t flow, fal_qos_cosmap_t *cosmap)
 {
@@ -429,7 +546,31 @@
 
 	return rv;
 }
+
 sw_error_t
+adpt_ppe_qos_cosmap_flow_set(a_uint32_t dev_id, a_uint8_t group_id,
+					a_uint8_t flow, fal_qos_cosmap_t *cosmap)
+{
+	a_uint32_t chip_ver = 0;
+
+	ADPT_DEV_ID_CHECK(dev_id);
+        ADPT_NULL_POINT_CHECK(cosmap);
+
+	chip_ver = adpt_hppe_chip_revision_get(dev_id);
+	if (chip_ver == CPPE_REVISION) {
+#if defined(CPPE)
+		return adpt_cppe_qos_cosmap_flow_set(dev_id, group_id,
+				flow, cosmap);
+#endif
+	} else {
+		return adpt_hppe_qos_cosmap_flow_set(dev_id, group_id,
+				flow, cosmap);
+	}
+
+	return SW_NOT_SUPPORTED;
+}
+
+static sw_error_t
 adpt_hppe_qos_port_group_set(a_uint32_t dev_id, fal_port_t port_id,
 					fal_qos_group_t *group)
 {
@@ -449,6 +590,27 @@
 }
 
 sw_error_t
+adpt_ppe_qos_port_group_set(a_uint32_t dev_id, fal_port_t port_id,
+					fal_qos_group_t *group)
+{
+	a_uint32_t chip_ver = 0;
+
+	ADPT_DEV_ID_CHECK(dev_id);
+        ADPT_NULL_POINT_CHECK(group);
+
+	chip_ver = adpt_hppe_chip_revision_get(dev_id);
+	if (chip_ver == CPPE_REVISION) {
+#if defined(CPPE)
+		return adpt_cppe_qos_port_group_set(dev_id, port_id, group);
+#endif
+	} else {
+		return adpt_hppe_qos_port_group_set(dev_id, port_id, group);
+	}
+
+	return SW_NOT_SUPPORTED;
+}
+
+sw_error_t
 adpt_hppe_ring_queue_map_set(a_uint32_t dev_id, 
 					a_uint32_t ring_id, fal_queue_bmp_t *queue_bmp)
 {
@@ -464,7 +626,7 @@
 	return hppe_ring_q_map_tbl_set(dev_id, ring_id, &ring_q_map_tbl);
 }
 
-sw_error_t
+static sw_error_t
 adpt_hppe_qos_cosmap_dscp_set(a_uint32_t dev_id, a_uint8_t group_id,
 					a_uint8_t dscp, fal_qos_cosmap_t *cosmap)
 {
@@ -499,6 +661,29 @@
 }
 
 sw_error_t
+adpt_ppe_qos_cosmap_dscp_set(a_uint32_t dev_id, a_uint8_t group_id,
+				a_uint8_t dscp, fal_qos_cosmap_t *cosmap)
+{
+	a_uint32_t chip_ver = 0;
+
+	ADPT_DEV_ID_CHECK(dev_id);
+        ADPT_NULL_POINT_CHECK(cosmap);
+
+	chip_ver = adpt_hppe_chip_revision_get(dev_id);
+	if (chip_ver == CPPE_REVISION) {
+#if defined(CPPE)
+		return adpt_cppe_qos_cosmap_dscp_set(dev_id, group_id,
+				dscp, cosmap);
+#endif
+	} else {
+		return adpt_hppe_qos_cosmap_dscp_set(dev_id, group_id,
+				dscp, cosmap);
+	}
+
+	return SW_NOT_SUPPORTED;
+}
+
+sw_error_t
 adpt_hppe_qos_port_remark_set(a_uint32_t dev_id, fal_port_t port_id,
 					fal_qos_remark_enable_t *remark)
 {
@@ -590,7 +775,7 @@
 		return SW_FAIL;
 }
 
-sw_error_t
+static sw_error_t
 adpt_hppe_qos_cosmap_flow_get(a_uint32_t dev_id, a_uint8_t group_id,
 					a_uint8_t flow, fal_qos_cosmap_t *cosmap)
 {
@@ -629,6 +814,29 @@
 }
 
 sw_error_t
+adpt_ppe_qos_cosmap_flow_get(a_uint32_t dev_id, a_uint8_t group_id,
+					a_uint8_t flow, fal_qos_cosmap_t *cosmap)
+{
+	a_uint32_t chip_ver = 0;
+
+	ADPT_DEV_ID_CHECK(dev_id);
+        ADPT_NULL_POINT_CHECK(cosmap);
+
+	chip_ver = adpt_hppe_chip_revision_get(dev_id);
+	if (chip_ver == CPPE_REVISION) {
+#if defined(CPPE)
+		return adpt_cppe_qos_cosmap_flow_get(dev_id, group_id,
+				flow, cosmap);
+#endif
+	} else {
+		return adpt_hppe_qos_cosmap_flow_get(dev_id, group_id,
+				flow, cosmap);
+	}
+
+	return SW_NOT_SUPPORTED;
+}
+
+static sw_error_t
 adpt_hppe_qos_port_group_get(a_uint32_t dev_id, fal_port_t port_id,
 					fal_qos_group_t *group)
 {
@@ -651,6 +859,27 @@
 }
 
 sw_error_t
+adpt_ppe_qos_port_group_get(a_uint32_t dev_id, fal_port_t port_id,
+					fal_qos_group_t *group)
+{
+	a_uint32_t chip_ver = 0;
+
+	ADPT_DEV_ID_CHECK(dev_id);
+        ADPT_NULL_POINT_CHECK(group);
+
+	chip_ver = adpt_hppe_chip_revision_get(dev_id);
+	if (chip_ver == CPPE_REVISION) {
+#if defined(CPPE)
+		return adpt_cppe_qos_port_group_get(dev_id, port_id, group);
+#endif
+	} else {
+		return adpt_hppe_qos_port_group_get(dev_id, port_id, group);
+	}
+
+	return SW_NOT_SUPPORTED;
+}
+
+sw_error_t
 adpt_hppe_ring_queue_map_get(a_uint32_t dev_id, 
 					a_uint32_t ring_id, fal_queue_bmp_t *queue_bmp)
 {
@@ -938,11 +1167,11 @@
 	adpt_hppe_qos_func_unregister(dev_id, p_adpt_api);
 
 	if (p_adpt_api->adpt_qos_func_bitmap & (1 << FUNC_QOS_PORT_PRI_SET))
-		p_adpt_api->adpt_qos_port_pri_set = adpt_hppe_qos_port_pri_set;
+		p_adpt_api->adpt_qos_port_pri_set = adpt_ppe_qos_port_pri_set;
 	if (p_adpt_api->adpt_qos_func_bitmap & (1 << FUNC_QOS_PORT_PRI_GET))
-		p_adpt_api->adpt_qos_port_pri_get = adpt_hppe_qos_port_pri_get;
+		p_adpt_api->adpt_qos_port_pri_get = adpt_ppe_qos_port_pri_get;
 	if (p_adpt_api->adpt_qos_func_bitmap & (1 << FUNC_QOS_COSMAP_PCP_GET))
-		p_adpt_api->adpt_qos_cosmap_pcp_get = adpt_hppe_qos_cosmap_pcp_get;
+		p_adpt_api->adpt_qos_cosmap_pcp_get = adpt_ppe_qos_cosmap_pcp_get;
 	if (p_adpt_api->adpt_qos_func_bitmap & (1 << FUNC_QUEUE_SCHEDULER_SET))
 		p_adpt_api->adpt_queue_scheduler_set = adpt_hppe_queue_scheduler_set;
 	if (p_adpt_api->adpt_qos_func_bitmap & (1 << FUNC_QUEUE_SCHEDULER_GET))
@@ -950,25 +1179,25 @@
 	if (p_adpt_api->adpt_qos_func_bitmap & (1 << FUNC_PORT_QUEUES_GET))
 		p_adpt_api->adpt_port_queues_get = adpt_hppe_port_queues_get;
 	if (p_adpt_api->adpt_qos_func_bitmap & (1 << FUNC_QOS_COSMAP_PCP_SET))
-		p_adpt_api->adpt_qos_cosmap_pcp_set = adpt_hppe_qos_cosmap_pcp_set;
+		p_adpt_api->adpt_qos_cosmap_pcp_set = adpt_ppe_qos_cosmap_pcp_set;
 	if (p_adpt_api->adpt_qos_func_bitmap & (1 << FUNC_QOS_PORT_REMARK_GET))
 		p_adpt_api->adpt_qos_port_remark_get = adpt_hppe_qos_port_remark_get;
 	if (p_adpt_api->adpt_qos_func_bitmap & (1 << FUNC_QOS_COSMAP_DSCP_GET))
-		p_adpt_api->adpt_qos_cosmap_dscp_get = adpt_hppe_qos_cosmap_dscp_get;
+		p_adpt_api->adpt_qos_cosmap_dscp_get = adpt_ppe_qos_cosmap_dscp_get;
 	if (p_adpt_api->adpt_qos_func_bitmap & (1 << FUNC_QOS_COSMAP_FLOW_SET))
-		p_adpt_api->adpt_qos_cosmap_flow_set = adpt_hppe_qos_cosmap_flow_set;
+		p_adpt_api->adpt_qos_cosmap_flow_set = adpt_ppe_qos_cosmap_flow_set;
 	if (p_adpt_api->adpt_qos_func_bitmap & (1 << FUNC_QOS_PORT_GROUP_SET))
-		p_adpt_api->adpt_qos_port_group_set = adpt_hppe_qos_port_group_set;
+		p_adpt_api->adpt_qos_port_group_set = adpt_ppe_qos_port_group_set;
 	if (p_adpt_api->adpt_qos_func_bitmap & (1 << FUNC_RING_QUEUE_MAP_SET))
 		p_adpt_api->adpt_ring_queue_map_set = adpt_hppe_ring_queue_map_set;
 	if (p_adpt_api->adpt_qos_func_bitmap & (1 << FUNC_QOS_COSMAP_DSCP_SET))
-		p_adpt_api->adpt_qos_cosmap_dscp_set = adpt_hppe_qos_cosmap_dscp_set;
+		p_adpt_api->adpt_qos_cosmap_dscp_set = adpt_ppe_qos_cosmap_dscp_set;
 	if (p_adpt_api->adpt_qos_func_bitmap & (1 << FUNC_QOS_PORT_REMARK_SET))
 		p_adpt_api->adpt_qos_port_remark_set = adpt_hppe_qos_port_remark_set;
 	if (p_adpt_api->adpt_qos_func_bitmap & (1 << FUNC_QOS_COSMAP_FLOW_GET))
-		p_adpt_api->adpt_qos_cosmap_flow_get = adpt_hppe_qos_cosmap_flow_get;
+		p_adpt_api->adpt_qos_cosmap_flow_get = adpt_ppe_qos_cosmap_flow_get;
 	if (p_adpt_api->adpt_qos_func_bitmap & (1 << FUNC_QOS_PORT_GROUP_GET))
-		p_adpt_api->adpt_qos_port_group_get = adpt_hppe_qos_port_group_get;
+		p_adpt_api->adpt_qos_port_group_get = adpt_ppe_qos_port_group_get;
 	if (p_adpt_api->adpt_qos_func_bitmap & (1 << FUNC_RING_QUEUE_MAP_GET))
 		p_adpt_api->adpt_ring_queue_map_get = adpt_hppe_ring_queue_map_get;
 	if (p_adpt_api->adpt_qos_func_bitmap & (1 << FUNC_TDM_TICK_NUM_SET))
diff --git a/src/hsl/cppe/Makefile b/src/hsl/cppe/Makefile
index 8e591de..81a4466 100755
--- a/src/hsl/cppe/Makefile
+++ b/src/hsl/cppe/Makefile
@@ -4,7 +4,11 @@
 include $(PRJ_PATH)/make/config.mk
 
 ifeq (TRUE, $(IN_PORTCONTROL))
-SRC_LIST=cppe_portctrl.c
+  SRC_LIST+=cppe_portctrl.c
+endif
+
+ifeq (TRUE, $(IN_QOS))
+  SRC_LIST+=cppe_qos.c
 endif
 
 ifeq (, $(findstring CPPE, $(SUPPORT_CHIP)))
diff --git a/src/hsl/cppe/cppe_qos.c b/src/hsl/cppe/cppe_qos.c
new file mode 100755
index 0000000..a919192
--- /dev/null
+++ b/src/hsl/cppe/cppe_qos.c
@@ -0,0 +1,428 @@
+/*
+ * Copyright (c) 2018, The Linux Foundation. All rights reserved.
+ * Permission to use, copy, modify, and/or distribute this software for
+ * any purpose with or without fee is hereby granted, provided that the
+ * above copyright notice and this permission notice appear in all copies.
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+
+/**
+ * @defgroup
+ * @{
+ */
+#include "sw.h"
+#include "hsl.h"
+#include "hppe_reg_access.h"
+#include "hppe_qos_reg.h"
+#include "hppe_qos.h"
+#include "cppe_qos_reg.h"
+
+
+sw_error_t
+cppe_qos_mapping_tbl_get(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		union qos_mapping_tbl_u *value)
+{
+	return hppe_reg_tbl_get(
+				dev_id,
+				IPE_L2_BASE_ADDR + QOS_MAPPING_TBL_ADDRESS + \
+				index * QOS_MAPPING_TBL_INC,
+				value->val,
+				2);
+}
+
+sw_error_t
+cppe_qos_mapping_tbl_set(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		union qos_mapping_tbl_u *value)
+{
+	return hppe_reg_tbl_set(
+				dev_id,
+				IPE_L2_BASE_ADDR + QOS_MAPPING_TBL_ADDRESS + \
+				index * QOS_MAPPING_TBL_INC,
+				value->val,
+				2);
+}
+
+sw_error_t
+cppe_qos_mapping_tbl_int_pcp_get(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t *value)
+{
+	union qos_mapping_tbl_u reg_val;
+	sw_error_t ret = SW_OK;
+
+	ret = cppe_qos_mapping_tbl_get(dev_id, index, &reg_val);
+	*value = reg_val.bf.int_pcp;
+	return ret;
+}
+
+sw_error_t
+cppe_qos_mapping_tbl_int_pcp_set(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t value)
+{
+	union qos_mapping_tbl_u reg_val;
+	sw_error_t ret = SW_OK;
+
+	ret = cppe_qos_mapping_tbl_get(dev_id, index, &reg_val);
+	if (SW_OK != ret)
+		return ret;
+	reg_val.bf.int_pcp = value;
+	ret = cppe_qos_mapping_tbl_set(dev_id, index, &reg_val);
+	return ret;
+}
+
+sw_error_t
+cppe_qos_mapping_tbl_int_dei_get(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t *value)
+{
+	union qos_mapping_tbl_u reg_val;
+	sw_error_t ret = SW_OK;
+
+	ret = cppe_qos_mapping_tbl_get(dev_id, index, &reg_val);
+	*value = reg_val.bf.int_dei;
+	return ret;
+}
+
+sw_error_t
+cppe_qos_mapping_tbl_int_dei_set(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t value)
+{
+	union qos_mapping_tbl_u reg_val;
+	sw_error_t ret = SW_OK;
+
+	ret = cppe_qos_mapping_tbl_get(dev_id, index, &reg_val);
+	if (SW_OK != ret)
+		return ret;
+	reg_val.bf.int_dei = value;
+	ret = cppe_qos_mapping_tbl_set(dev_id, index, &reg_val);
+	return ret;
+}
+
+sw_error_t
+cppe_qos_mapping_tbl_int_dei_en_get(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t *value)
+{
+	union qos_mapping_tbl_u reg_val;
+	sw_error_t ret = SW_OK;
+
+	ret = cppe_qos_mapping_tbl_get(dev_id, index, &reg_val);
+	*value = reg_val.bf.int_dei_en;
+	return ret;
+}
+
+sw_error_t
+cppe_qos_mapping_tbl_int_dei_en_set(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t value)
+{
+	union qos_mapping_tbl_u reg_val;
+	sw_error_t ret = SW_OK;
+
+	ret = cppe_qos_mapping_tbl_get(dev_id, index, &reg_val);
+	if (SW_OK != ret)
+		return ret;
+	reg_val.bf.int_dei_en = value;
+	ret = cppe_qos_mapping_tbl_set(dev_id, index, &reg_val);
+	return ret;
+}
+
+sw_error_t
+cppe_qos_mapping_tbl_dscp_tc_mask_get(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t *value)
+{
+	union qos_mapping_tbl_u reg_val;
+	sw_error_t ret = SW_OK;
+
+	ret = cppe_qos_mapping_tbl_get(dev_id, index, &reg_val);
+	*value = reg_val.bf.dscp_tc_mask;
+	return ret;
+}
+
+sw_error_t
+cppe_qos_mapping_tbl_dscp_tc_mask_set(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t value)
+{
+	union qos_mapping_tbl_u reg_val;
+	sw_error_t ret = SW_OK;
+
+	ret = cppe_qos_mapping_tbl_get(dev_id, index, &reg_val);
+	if (SW_OK != ret)
+		return ret;
+	reg_val.bf.dscp_tc_mask = value;
+	ret = cppe_qos_mapping_tbl_set(dev_id, index, &reg_val);
+	return ret;
+}
+
+sw_error_t
+cppe_qos_mapping_tbl_int_dscp_tc_get(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t *value)
+{
+	union qos_mapping_tbl_u reg_val;
+	sw_error_t ret = SW_OK;
+
+	ret = cppe_qos_mapping_tbl_get(dev_id, index, &reg_val);
+	*value = reg_val.bf.int_dscp_tc;
+	return ret;
+}
+
+sw_error_t
+cppe_qos_mapping_tbl_int_dscp_tc_set(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t value)
+{
+	union qos_mapping_tbl_u reg_val;
+	sw_error_t ret = SW_OK;
+
+	ret = cppe_qos_mapping_tbl_get(dev_id, index, &reg_val);
+	if (SW_OK != ret)
+		return ret;
+	reg_val.bf.int_dscp_tc = value;
+	ret = cppe_qos_mapping_tbl_set(dev_id, index, &reg_val);
+	return ret;
+}
+
+sw_error_t
+cppe_qos_mapping_tbl_int_dp_en_get(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t *value)
+{
+	union qos_mapping_tbl_u reg_val;
+	sw_error_t ret = SW_OK;
+
+	ret = cppe_qos_mapping_tbl_get(dev_id, index, &reg_val);
+	*value = reg_val.bf.int_dp_en;
+	return ret;
+}
+
+sw_error_t
+cppe_qos_mapping_tbl_int_dp_en_set(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t value)
+{
+	union qos_mapping_tbl_u reg_val;
+	sw_error_t ret = SW_OK;
+
+	ret = cppe_qos_mapping_tbl_get(dev_id, index, &reg_val);
+	if (SW_OK != ret)
+		return ret;
+	reg_val.bf.int_dp_en = value;
+	ret = cppe_qos_mapping_tbl_set(dev_id, index, &reg_val);
+	return ret;
+}
+
+sw_error_t
+cppe_qos_mapping_tbl_int_dp_get(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t *value)
+{
+	union qos_mapping_tbl_u reg_val;
+	sw_error_t ret = SW_OK;
+
+	ret = cppe_qos_mapping_tbl_get(dev_id, index, &reg_val);
+	*value = reg_val.bf.int_dp;
+	return ret;
+}
+
+sw_error_t
+cppe_qos_mapping_tbl_int_dp_set(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t value)
+{
+	union qos_mapping_tbl_u reg_val;
+	sw_error_t ret = SW_OK;
+
+	ret = cppe_qos_mapping_tbl_get(dev_id, index, &reg_val);
+	if (SW_OK != ret)
+		return ret;
+	reg_val.bf.int_dp = value;
+	ret = cppe_qos_mapping_tbl_set(dev_id, index, &reg_val);
+	return ret;
+}
+
+sw_error_t
+cppe_qos_mapping_tbl_int_pri_en_get(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t *value)
+{
+	union qos_mapping_tbl_u reg_val;
+	sw_error_t ret = SW_OK;
+
+	ret = cppe_qos_mapping_tbl_get(dev_id, index, &reg_val);
+	*value = reg_val.bf.int_pri_en;
+	return ret;
+}
+
+sw_error_t
+cppe_qos_mapping_tbl_int_pri_en_set(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t value)
+{
+	union qos_mapping_tbl_u reg_val;
+	sw_error_t ret = SW_OK;
+
+	ret = cppe_qos_mapping_tbl_get(dev_id, index, &reg_val);
+	if (SW_OK != ret)
+		return ret;
+	reg_val.bf.int_pri_en = value;
+	ret = cppe_qos_mapping_tbl_set(dev_id, index, &reg_val);
+	return ret;
+}
+
+sw_error_t
+cppe_qos_mapping_tbl_qos_res_prec_get(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t *value)
+{
+	union qos_mapping_tbl_u reg_val;
+	sw_error_t ret = SW_OK;
+
+	ret = cppe_qos_mapping_tbl_get(dev_id, index, &reg_val);
+	*value = reg_val.bf.qos_res_prec_1 << 1 | \
+		reg_val.bf.qos_res_prec_0;
+	return ret;
+}
+
+sw_error_t
+cppe_qos_mapping_tbl_qos_res_prec_set(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t value)
+{
+	union qos_mapping_tbl_u reg_val;
+	sw_error_t ret = SW_OK;
+
+	ret = cppe_qos_mapping_tbl_get(dev_id, index, &reg_val);
+	if (SW_OK != ret)
+		return ret;
+	reg_val.bf.qos_res_prec_1 = value >> 1;
+	reg_val.bf.qos_res_prec_0 = value & (((a_uint64_t)1<<1)-1);
+	ret = cppe_qos_mapping_tbl_set(dev_id, index, &reg_val);
+	return ret;
+}
+
+sw_error_t
+cppe_qos_mapping_tbl_int_pcp_en_get(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t *value)
+{
+	union qos_mapping_tbl_u reg_val;
+	sw_error_t ret = SW_OK;
+
+	ret = cppe_qos_mapping_tbl_get(dev_id, index, &reg_val);
+	*value = reg_val.bf.int_pcp_en;
+	return ret;
+}
+
+sw_error_t
+cppe_qos_mapping_tbl_int_pcp_en_set(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t value)
+{
+	union qos_mapping_tbl_u reg_val;
+	sw_error_t ret = SW_OK;
+
+	ret = cppe_qos_mapping_tbl_get(dev_id, index, &reg_val);
+	if (SW_OK != ret)
+		return ret;
+	reg_val.bf.int_pcp_en = value;
+	ret = cppe_qos_mapping_tbl_set(dev_id, index, &reg_val);
+	return ret;
+}
+
+sw_error_t
+cppe_qos_mapping_tbl_int_pri_get(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t *value)
+{
+	union qos_mapping_tbl_u reg_val;
+	sw_error_t ret = SW_OK;
+
+	ret = cppe_qos_mapping_tbl_get(dev_id, index, &reg_val);
+	*value = reg_val.bf.int_pri;
+	return ret;
+}
+
+sw_error_t
+cppe_qos_mapping_tbl_int_pri_set(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t value)
+{
+	union qos_mapping_tbl_u reg_val;
+	sw_error_t ret = SW_OK;
+
+	ret = cppe_qos_mapping_tbl_get(dev_id, index, &reg_val);
+	if (SW_OK != ret)
+		return ret;
+	reg_val.bf.int_pri = value;
+	ret = cppe_qos_mapping_tbl_set(dev_id, index, &reg_val);
+	return ret;
+}
+
+sw_error_t
+cppe_qos_mapping_tbl_int_dscp_en_get(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t *value)
+{
+	union qos_mapping_tbl_u reg_val;
+	sw_error_t ret = SW_OK;
+
+	ret = cppe_qos_mapping_tbl_get(dev_id, index, &reg_val);
+	*value = reg_val.bf.int_dscp_en;
+	return ret;
+}
+
+sw_error_t
+cppe_qos_mapping_tbl_int_dscp_en_set(
+		a_uint32_t dev_id,
+		a_uint32_t index,
+		a_uint32_t value)
+{
+	union qos_mapping_tbl_u reg_val;
+	sw_error_t ret = SW_OK;
+
+	ret = cppe_qos_mapping_tbl_get(dev_id, index, &reg_val);
+	if (SW_OK != ret)
+		return ret;
+	reg_val.bf.int_dscp_en = value;
+	ret = cppe_qos_mapping_tbl_set(dev_id, index, &reg_val);
+	return ret;
+}
\ No newline at end of file
diff --git a/src/ref/ref_uci.c b/src/ref/ref_uci.c
index fce8b31..f75da12 100755
--- a/src/ref/ref_uci.c
+++ b/src/ref/ref_uci.c
@@ -567,6 +567,12 @@
 			val_ptr[4] = (char*)ext_value_p->option_value;
 		} else if (!strcmp(ext_value_p->option_name, "aclprec")) {
 			val_ptr[5] = (char*)ext_value_p->option_value;
+		}  else if (!strcmp(ext_value_p->option_name, "postaclprec")) {
+			val_ptr[6] = (char*)ext_value_p->option_value;
+		}  else if (!strcmp(ext_value_p->option_name, "pcpprecforce")) {
+			val_ptr[7] = (char*)ext_value_p->option_value;
+		}  else if (!strcmp(ext_value_p->option_name, "dscpprecforce")) {
+			val_ptr[8] = (char*)ext_value_p->option_value;
 		}  else {
 			rv = -1;
 			break;
@@ -638,6 +644,20 @@
 			val_ptr[5] = (char*)ext_value_p->option_value;
 		} else if (!strcmp(ext_value_p->option_name, "internaldropprec")) {
 			val_ptr[6] = (char*)ext_value_p->option_value;
+		}  else if (!strcmp(ext_value_p->option_name, "dscpmask")) {
+			val_ptr[7] = (char*)ext_value_p->option_value;
+		}  else if (!strcmp(ext_value_p->option_name, "dscpen")) {
+			val_ptr[8] = (char*)ext_value_p->option_value;
+		}  else if (!strcmp(ext_value_p->option_name, "pcpen")) {
+			val_ptr[9] = (char*)ext_value_p->option_value;
+		}  else if (!strcmp(ext_value_p->option_name, "deien")) {
+			val_ptr[10] = (char*)ext_value_p->option_value;
+		}  else if (!strcmp(ext_value_p->option_name, "prien")) {
+			val_ptr[11] = (char*)ext_value_p->option_value;
+		}  else if (!strcmp(ext_value_p->option_name, "dpen")) {
+			val_ptr[12] = (char*)ext_value_p->option_value;
+		}  else if (!strcmp(ext_value_p->option_name, "qosprec")) {
+			val_ptr[13] = (char*)ext_value_p->option_value;
 		}  else {
 			rv = -1;
 			break;
diff --git a/src/shell_lib/shell_io.c b/src/shell_lib/shell_io.c
index 2cc8419..b2e831f 100755
--- a/src/shell_lib/shell_io.c
+++ b/src/shell_lib/shell_io.c
@@ -1400,6 +1400,72 @@
     }
     while (talk_mode && (SW_OK != rv));
 
+    do
+    {
+        cmd = get_sub_cmd("post_acl_pri_prece", "0");
+        SW_RTN_ON_NULL_PARAM(cmd);
+
+        if (!strncasecmp(cmd, "quit", 4))
+        {
+            return SW_BAD_VALUE;
+        }
+        else if (!strncasecmp(cmd, "help", 4))
+        {
+            rv = SW_BAD_VALUE;
+        }
+        else
+        {
+            rv = cmd_data_check_uint8(cmd, (a_uint32_t *)&(entry.post_acl_pri),
+                                       sizeof (a_uint8_t));
+        }
+
+    }
+    while (talk_mode && (SW_OK != rv));
+
+    do
+    {
+        cmd = get_sub_cmd("pcp_pri_force", "no");
+        SW_RTN_ON_NULL_PARAM(cmd);
+
+        if (!strncasecmp(cmd, "quit", 4))
+        {
+            return SW_BAD_VALUE;
+        }
+        else if (!strncasecmp(cmd, "help", 4))
+        {
+            rv = SW_BAD_VALUE;
+        }
+        else
+        {
+            rv = cmd_data_check_confirm(cmd, A_FALSE, &(entry.pcp_pri_force),
+                                       sizeof (a_bool_t));
+        }
+
+    }
+    while (talk_mode && (SW_OK != rv));
+
+    do
+    {
+        cmd = get_sub_cmd("dscp_pri_force", "no");
+        SW_RTN_ON_NULL_PARAM(cmd);
+
+        if (!strncasecmp(cmd, "quit", 4))
+        {
+            return SW_BAD_VALUE;
+        }
+        else if (!strncasecmp(cmd, "help", 4))
+        {
+            rv = SW_BAD_VALUE;
+        }
+        else
+        {
+            rv = cmd_data_check_confirm(cmd, A_FALSE, &(entry.dscp_pri_force),
+                                       sizeof (a_bool_t));
+        }
+
+    }
+    while (talk_mode && (SW_OK != rv));
+
     *(fal_qos_pri_precedence_t *)val = entry;
     return SW_OK;
 }
@@ -1602,6 +1668,160 @@
     }
     while (talk_mode && (SW_OK != rv));
 
+    do
+    {
+        cmd = get_sub_cmd("dscp_mask", "0");
+        SW_RTN_ON_NULL_PARAM(cmd);
+
+        if (!strncasecmp(cmd, "quit", 4))
+        {
+            return SW_BAD_VALUE;
+        }
+        else if (!strncasecmp(cmd, "help", 4))
+        {
+            rv = SW_BAD_VALUE;
+        }
+        else
+        {
+            rv = cmd_data_check_uint8(cmd, (a_uint32_t *)&(entry.dscp_mask),
+                                       sizeof (a_uint8_t));
+        }
+
+    }
+    while (talk_mode && (SW_OK != rv));
+
+    do
+    {
+        cmd = get_sub_cmd("dscp_en", "no");
+        SW_RTN_ON_NULL_PARAM(cmd);
+
+        if (!strncasecmp(cmd, "quit", 4))
+        {
+            return SW_BAD_VALUE;
+        }
+        else if (!strncasecmp(cmd, "help", 4))
+        {
+            rv = SW_BAD_VALUE;
+        }
+        else
+        {
+            rv = cmd_data_check_confirm(cmd, A_FALSE, &(entry.dscp_en),
+                                       sizeof (a_bool_t));
+        }
+
+    }
+    while (talk_mode && (SW_OK != rv));
+
+    do
+    {
+        cmd = get_sub_cmd("pcp_en", "no");
+        SW_RTN_ON_NULL_PARAM(cmd);
+
+        if (!strncasecmp(cmd, "quit", 4))
+        {
+            return SW_BAD_VALUE;
+        }
+        else if (!strncasecmp(cmd, "help", 4))
+        {
+            rv = SW_BAD_VALUE;
+        }
+        else
+        {
+            rv = cmd_data_check_confirm(cmd, A_FALSE, &(entry.pcp_en),
+                                       sizeof (a_bool_t));
+        }
+
+    }
+    while (talk_mode && (SW_OK != rv));
+
+    do
+    {
+        cmd = get_sub_cmd("dei_en", "no");
+        SW_RTN_ON_NULL_PARAM(cmd);
+
+        if (!strncasecmp(cmd, "quit", 4))
+        {
+            return SW_BAD_VALUE;
+        }
+        else if (!strncasecmp(cmd, "help", 4))
+        {
+            rv = SW_BAD_VALUE;
+        }
+        else
+        {
+            rv = cmd_data_check_confirm(cmd, A_FALSE, &(entry.dei_en),
+                                       sizeof (a_bool_t));
+        }
+
+    }
+    while (talk_mode && (SW_OK != rv));
+
+    do
+    {
+        cmd = get_sub_cmd("pri_en", "no");
+        SW_RTN_ON_NULL_PARAM(cmd);
+
+        if (!strncasecmp(cmd, "quit", 4))
+        {
+            return SW_BAD_VALUE;
+        }
+        else if (!strncasecmp(cmd, "help", 4))
+        {
+            rv = SW_BAD_VALUE;
+        }
+        else
+        {
+            rv = cmd_data_check_confirm(cmd, A_FALSE, &(entry.pri_en),
+                                       sizeof (a_bool_t));
+        }
+
+    }
+    while (talk_mode && (SW_OK != rv));
+
+    do
+    {
+        cmd = get_sub_cmd("dp_en", "no");
+        SW_RTN_ON_NULL_PARAM(cmd);
+
+        if (!strncasecmp(cmd, "quit", 4))
+        {
+            return SW_BAD_VALUE;
+        }
+        else if (!strncasecmp(cmd, "help", 4))
+        {
+            rv = SW_BAD_VALUE;
+        }
+        else
+        {
+            rv = cmd_data_check_confirm(cmd, A_FALSE, &(entry.dp_en),
+                                       sizeof (a_bool_t));
+        }
+
+    }
+    while (talk_mode && (SW_OK != rv));
+
+    do
+    {
+        cmd = get_sub_cmd("qos_prec", "0");
+        SW_RTN_ON_NULL_PARAM(cmd);
+
+        if (!strncasecmp(cmd, "quit", 4))
+        {
+            return SW_BAD_VALUE;
+        }
+        else if (!strncasecmp(cmd, "help", 4))
+        {
+            rv = SW_BAD_VALUE;
+        }
+        else
+        {
+            rv = cmd_data_check_uint8(cmd, (a_uint32_t *)&(entry.qos_prec),
+                                       sizeof (a_uint8_t));
+        }
+
+    }
+    while (talk_mode && (SW_OK != rv));
+
     *(fal_qos_cosmap_t *)val = entry;
     return SW_OK;
 }