Merge "[qca-ssdk] add inner port bitmap support."
diff --git a/include/adpt/cppe/adpt_cppe_mib.h b/include/adpt/cppe/adpt_cppe_mib.h
new file mode 100755
index 0000000..3b1302e
--- /dev/null
+++ b/include/adpt/cppe/adpt_cppe_mib.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2019, 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_MIB_H_
+#define _ADPT_CPPE_MIB_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+sw_error_t
+adpt_cppe_lpbk_mib_cpukeep_get(a_uint32_t dev_id, a_uint32_t port_id,
+ a_bool_t *enable);
+
+sw_error_t
+adpt_cppe_lpbk_mib_cpukeep_set(a_uint32_t dev_id, a_uint32_t port_id,
+ a_bool_t enable);
+
+sw_error_t
+adpt_hppe_lpbk_mib_status_get(a_uint32_t dev_id, a_uint32_t port_id,
+ a_bool_t *enable);
+
+sw_error_t
+adpt_cppe_lpbk_mib_status_set(a_uint32_t dev_id, a_uint32_t port_id,
+ a_bool_t enable);
+
+sw_error_t
+adpt_cppe_lpbk_mib_flush_counters(a_uint32_t dev_id,
+ fal_port_t port_id);
+
+sw_error_t
+adpt_cppe_lpbk_get_mib_info(a_uint32_t dev_id, fal_port_t port_id,
+ fal_mib_info_t * mib_info );
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+#endif
diff --git a/include/fal/fal_mib.h b/include/fal/fal_mib.h
index 4a2adcd..b4b59ff 100755
--- a/include/fal/fal_mib.h
+++ b/include/fal/fal_mib.h
@@ -77,6 +77,11 @@
a_uint32_t TxUniCast;
a_uint32_t RxJumboFcsErr; /* add for Hawkeye*/
a_uint32_t RxJumboAligenErr; /* add for Hawkeye*/
+ a_uint32_t Rx14To63; /*add for ipq60xx lpbk port*/
+ a_uint32_t RxTooLongByte_lo; /*add for ipq60xx lpbk port*/
+ a_uint32_t RxTooLongByte_hi; /*add for ipq60xx lpbk port*/
+ a_uint32_t RxRuntByte_lo; /*add for ipq60xx lpbk port*/
+ a_uint32_t RxRuntByte_hi; /*add for ipq60xx lpbk port*/
} fal_mib_info_t;
/*define structure for software with 64bit*/
@@ -125,6 +130,9 @@
a_uint64_t TxUniCast;
a_uint64_t RxJumboFcsErr; /* add for Hawkeye*/
a_uint64_t RxJumboAligenErr; /* add for Hawkeye*/
+ a_uint64_t Rx14To63; /*add for ipq60xx lpbk port*/
+ a_uint64_t RxTooLongByte; /*add for ipq60xx lpbk port*/
+ a_uint64_t RxRuntByte; /*add for ipq60xx lpbk port*/
} fal_mib_counter_t;
enum
diff --git a/src/adpt/adpt.c b/src/adpt/adpt.c
index 5f50307..ef70a89 100755
--- a/src/adpt/adpt.c
+++ b/src/adpt/adpt.c
@@ -319,6 +319,7 @@
printk("%s, %d:malloc fail for adpt api\n", __FUNCTION__, __LINE__);
return SW_FAIL;
}
+ aos_mem_zero(g_adpt_api[dev_id], sizeof(adpt_api_t));
g_chip_ver[dev_id].chip_type = cfg->chip_type;
g_chip_ver[dev_id].chip_revision = cfg->chip_revision;
diff --git a/src/adpt/cppe/Makefile b/src/adpt/cppe/Makefile
index 376bbb3..cc7acbf 100755
--- a/src/adpt/cppe/Makefile
+++ b/src/adpt/cppe/Makefile
@@ -29,6 +29,10 @@
SRC_LIST += adpt_cppe_flow.c
endif
+ifeq (TRUE, $(IN_MIB))
+ SRC_LIST += adpt_cppe_mib.c
+endif
+
ifeq (, $(findstring CPPE, $(SUPPORT_CHIP)))
SRC_LIST=
endif
diff --git a/src/adpt/cppe/adpt_cppe_mib.c b/src/adpt/cppe/adpt_cppe_mib.c
new file mode 100755
index 0000000..60c4f62
--- /dev/null
+++ b/src/adpt/cppe/adpt_cppe_mib.c
@@ -0,0 +1,181 @@
+/*
+ * Copyright (c) 2019, 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 "adpt.h"
+#include "cppe_loopback_reg.h"
+#include "cppe_loopback.h"
+#include "hppe_init.h"
+
+sw_error_t
+adpt_cppe_lpbk_mib_cpukeep_get(a_uint32_t dev_id, a_uint32_t port_id,
+ a_bool_t *enable)
+{
+ sw_error_t rv = SW_OK;
+ union lpbk_mib_ctrl_u reg_value;
+
+ ADPT_DEV_ID_CHECK(dev_id);
+ ADPT_NULL_POINT_CHECK(enable);
+
+ rv = cppe_lpbk_mib_ctrl_get(dev_id, port_id, ®_value);
+ SW_RTN_ON_ERROR(rv);
+
+ if (reg_value.bf.mib_rd_clr == A_TRUE)
+ {
+ *enable = A_FALSE;
+ }
+ else
+ {
+ *enable = A_TRUE;
+ }
+
+ return SW_OK;
+}
+
+sw_error_t
+adpt_cppe_lpbk_mib_cpukeep_set(a_uint32_t dev_id, a_uint32_t port_id,
+ a_bool_t enable)
+{
+ union lpbk_mib_ctrl_u reg_value;
+ sw_error_t rv = SW_OK;
+
+ ADPT_DEV_ID_CHECK(dev_id);
+ port_id = HPPE_TO_GMAC_PORT_ID(port_id);
+ rv = cppe_lpbk_mib_ctrl_get(dev_id, port_id, ®_value);
+ SW_RTN_ON_ERROR(rv);
+ if(!enable)
+ {
+ reg_value.bf.mib_rd_clr = A_TRUE;
+ }
+ else
+ {
+ reg_value.bf.mib_rd_clr = A_FALSE;
+ }
+ rv = cppe_lpbk_mib_ctrl_set(dev_id, port_id, ®_value);
+
+ return rv;
+}
+
+sw_error_t
+adpt_hppe_lpbk_mib_status_get(a_uint32_t dev_id, a_uint32_t port_id,
+ a_bool_t *enable)
+{
+ sw_error_t rv = SW_OK;
+ union lpbk_mib_ctrl_u reg_value;
+
+ ADPT_DEV_ID_CHECK(dev_id);
+ ADPT_NULL_POINT_CHECK(enable);
+
+ rv = cppe_lpbk_mib_ctrl_get(dev_id, port_id, ®_value);
+ SW_RTN_ON_ERROR(rv);
+ *enable = reg_value.bf.mib_en;
+
+ return rv;
+}
+
+sw_error_t
+adpt_cppe_lpbk_mib_status_set(a_uint32_t dev_id, a_uint32_t port_id,
+ a_bool_t enable)
+{
+ union lpbk_mib_ctrl_u reg_value;
+ sw_error_t rv = SW_OK;
+
+ ADPT_DEV_ID_CHECK(dev_id);
+
+ port_id = HPPE_TO_GMAC_PORT_ID(port_id);
+ rv = cppe_lpbk_mib_ctrl_get(dev_id, port_id, ®_value);
+ SW_RTN_ON_ERROR(rv);
+ reg_value.bf.mib_en = enable;
+ rv = cppe_lpbk_mib_ctrl_set(dev_id, port_id, ®_value);
+
+ return rv;
+}
+
+sw_error_t
+adpt_cppe_lpbk_mib_flush_counters(a_uint32_t dev_id, fal_port_t port_id)
+{
+ union lpbk_mib_ctrl_u reg_value;
+ sw_error_t rv = SW_OK;
+
+ ADPT_DEV_ID_CHECK(dev_id);
+ port_id = HPPE_TO_GMAC_PORT_ID(port_id);
+ rv = cppe_lpbk_mib_ctrl_get(dev_id, port_id, ®_value);
+ SW_RTN_ON_ERROR(rv);
+ reg_value.bf.mib_reset = A_TRUE;
+ rv = cppe_lpbk_mib_ctrl_set(dev_id, port_id, ®_value);
+ SW_RTN_ON_ERROR(rv);
+ reg_value.bf.mib_reset = A_FALSE;
+ rv = cppe_lpbk_mib_ctrl_set(dev_id, port_id, ®_value);
+
+ return rv;
+}
+
+sw_error_t
+adpt_cppe_lpbk_get_mib_info(a_uint32_t dev_id, fal_port_t port_id,
+ fal_mib_info_t * mib_info )
+{
+ ADPT_DEV_ID_CHECK(dev_id);
+ ADPT_NULL_POINT_CHECK(mib_info);
+ memset(mib_info, 0, sizeof(*mib_info));
+
+ port_id = HPPE_TO_GMAC_PORT_ID(port_id);
+ cppe_lpbk_mib_uni_get(dev_id, (a_uint32_t)port_id,
+ (union lpbkuni_u *)&mib_info->RxUniCast);
+ cppe_lpbk_mib_multi_get(dev_id, (a_uint32_t)port_id,
+ (union lpbkmulti_u *)&mib_info->RxMulti);
+ cppe_lpbk_mib_broad_get(dev_id, (a_uint32_t)port_id,
+ (union lpbkbroad_u *)&mib_info->RxBroad);
+ cppe_lpbk_mib_pkt64_get(dev_id, (a_uint32_t)port_id,
+ (union lpbkpkt64_u *)&mib_info->Rx64Byte);
+ cppe_lpbk_mib_pkt65to127_get(dev_id, (a_uint32_t)port_id,
+ (union lpbkpkt65to127_u *)&mib_info->Rx128Byte);
+ cppe_lpbk_mib_pkt128to255_get(dev_id, (a_uint32_t)port_id,
+ (union lpbkpkt128to255_u *)&mib_info->Rx256Byte);
+ cppe_lpbk_mib_pkt256to511_get(dev_id, (a_uint32_t)port_id,
+ (union lpbkpkt256to511_u *)&mib_info->Rx512Byte);
+ cppe_lpbk_mib_pkt512to1023_get(dev_id, (a_uint32_t)port_id,
+ (union lpbkpkt512to1023_u *)&mib_info->Rx1024Byte);
+ cppe_lpbk_mib_pkt1024to1518_get(dev_id, (a_uint32_t)port_id,
+ (union lpbkpkt1024to1518_u *)&mib_info->Rx1518Byte);
+ cppe_lpbk_mib_pkt1519tox_get(dev_id, (a_uint32_t)port_id,
+ (union lpbkpkt1519tox_u *)&mib_info->RxMaxByte);
+ cppe_lpbk_mib_toolong_get(dev_id, (a_uint32_t)port_id,
+ (union lpbkpkttoolong_u *)&mib_info->RxTooLong);
+ cppe_lpbk_mib_byte_l_get(dev_id, (a_uint32_t)port_id,
+ (union lpbkbyte_l_u *)&mib_info->RxGoodByte_lo);
+ cppe_lpbk_mib_byte_h_get(dev_id, (a_uint32_t)port_id,
+ (union lpbkbyte_h_u *)&mib_info->RxGoodByte_hi);
+ cppe_lpbk_mib_drop_get(dev_id, (a_uint32_t)port_id,
+ (union lpbkdropcounter_u *)&mib_info->Filtered);
+ cppe_lpbk_mib_tooshort_get(dev_id, (a_uint32_t)port_id,
+ (union lpbkpkttooshort_u *)&mib_info->RxRunt);
+ cppe_lpbk_mib_pkt14to63_get(dev_id, (a_uint32_t)port_id,
+ (union lpbkpkt14to63_u *)&mib_info->Rx14To63);
+ cppe_lpbk_mib_toolongbyte_l_get(dev_id, (a_uint32_t)port_id,
+ (union lpbktoolongbyte_l_u *)&mib_info->RxTooLongByte_lo);
+ cppe_lpbk_mib_toolongbyte_h_get(dev_id, (a_uint32_t)port_id,
+ (union lpbktoolongbyte_h_u *)&mib_info->RxTooLongByte_hi);
+ cppe_lpbk_mib_tooshortbyte_l_get(dev_id, (a_uint32_t)port_id,
+ (union lpbktooshortbyte_l_u *)&mib_info->RxRuntByte_lo);
+ cppe_lpbk_mib_tooshortbyte_h_get(dev_id, (a_uint32_t)port_id,
+ (union lpbktooshortbyte_h_u *)&mib_info->RxRuntByte_hi);
+
+ return SW_OK;
+}
+/**
+ * @}
+ */
diff --git a/src/adpt/hppe/adpt_hppe_mib.c b/src/adpt/hppe/adpt_hppe_mib.c
index 3d73800..5237072 100755
--- a/src/adpt/hppe/adpt_hppe_mib.c
+++ b/src/adpt/hppe/adpt_hppe_mib.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2019, 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.
@@ -25,6 +25,10 @@
#include "hppe_xgmacmib.h"
#include "hppe_init.h"
+#include "adpt_hppe.h"
+#ifdef CPPE
+#include "adpt_cppe_mib.h"
+#endif
sw_error_t
adpt_hppe_mib_cpukeep_get(a_uint32_t dev_id, a_bool_t *enable)
@@ -38,35 +42,52 @@
rv = hppe_mac_mib_ctrl_mib_rd_clr_get(dev_id, port_id, &status);
if (status == A_TRUE)
+ {
*enable = A_FALSE;
+ }
else
+ {
*enable = A_TRUE;
+ }
if( rv != SW_OK )
+ {
return rv;
-
- return SW_OK;
-}
-
-sw_error_t
-adpt_hppe_mib_cpukeep_set(a_uint32_t dev_id, a_bool_t enable)
-{
- a_uint32_t port_id = 0;
-
- ADPT_DEV_ID_CHECK(dev_id);
-
- for (port_id = SSDK_PHYSICAL_PORT0; port_id < SSDK_PHYSICAL_PORT6; port_id++) {
-
- hppe_mac_mib_ctrl_mib_rd_clr_set(dev_id, port_id, (a_uint32_t)(!enable));
}
return SW_OK;
}
+
sw_error_t
+adpt_ppe_mib_cpukeep_set(a_uint32_t dev_id, a_bool_t enable)
+{
+ a_uint32_t port_id = 0, g_port_id = 0;
+ sw_error_t rv = SW_OK;
+
+ ADPT_DEV_ID_CHECK(dev_id);
+
+ for (port_id = SSDK_PHYSICAL_PORT1; port_id <= SSDK_PHYSICAL_PORT6; port_id++)
+ {
+#ifdef CPPE
+ if (adpt_hppe_chip_revision_get(dev_id) == CPPE_REVISION &&
+ port_id == SSDK_PHYSICAL_PORT6)
+ {
+ rv = adpt_cppe_lpbk_mib_cpukeep_set(dev_id, port_id, enable);
+ SW_RTN_ON_ERROR(rv);
+ continue;
+ }
+#endif
+ g_port_id = HPPE_TO_GMAC_PORT_ID(port_id);
+ hppe_mac_mib_ctrl_mib_rd_clr_set(dev_id, g_port_id, (a_uint32_t)(!enable));
+ }
+
+ return rv;
+}
+
+static sw_error_t
adpt_hppe_get_mib_info(a_uint32_t dev_id, fal_port_t port_id,
fal_mib_info_t * mib_info )
{
-
ADPT_DEV_ID_CHECK(dev_id);
ADPT_NULL_POINT_CHECK(mib_info);
memset(mib_info, 0, sizeof(fal_mib_info_t));
@@ -76,42 +97,70 @@
hppe_rxpause_get(dev_id, (a_uint32_t)port_id, (union rxpause_u *)&mib_info->RxPause);
hppe_rxmulti_get(dev_id, (a_uint32_t)port_id, (union rxmulti_u *)&mib_info->RxMulti);
hppe_rxfcserr_get(dev_id, (a_uint32_t)port_id, (union rxfcserr_u *)&mib_info->RxFcsErr);
- hppe_rxalignerr_get(dev_id, (a_uint32_t)port_id, (union rxalignerr_u *)&mib_info->RxAllignErr);
+ hppe_rxalignerr_get(dev_id, (a_uint32_t)port_id,
+ (union rxalignerr_u *)&mib_info->RxAllignErr);
hppe_rxrunt_get(dev_id, (a_uint32_t)port_id, (union rxrunt_u *)&mib_info->RxRunt);
hppe_rxfrag_get(dev_id, (a_uint32_t)port_id, (union rxfrag_u *)&mib_info->RxFragment);
- hppe_rxjumbofcserr_get(dev_id, (a_uint32_t)port_id, (union rxjumbofcserr_u *)&mib_info->RxJumboFcsErr);
- hppe_rxjumboalignerr_get(dev_id, (a_uint32_t)port_id, (union rxjumboalignerr_u *)&mib_info->RxJumboAligenErr);
+ hppe_rxjumbofcserr_get(dev_id, (a_uint32_t)port_id,
+ (union rxjumbofcserr_u *)&mib_info->RxJumboFcsErr);
+ hppe_rxjumboalignerr_get(dev_id, (a_uint32_t)port_id,
+ (union rxjumboalignerr_u *)&mib_info->RxJumboAligenErr);
hppe_rxpkt64_get(dev_id, (a_uint32_t)port_id, (union rxpkt64_u *)&mib_info->Rx64Byte);
- hppe_rxpkt65to127_get(dev_id, (a_uint32_t)port_id, (union rxpkt65to127_u *)&mib_info->Rx128Byte);
- hppe_rxpkt128to255_get(dev_id, (a_uint32_t)port_id, (union rxpkt128to255_u *)&mib_info->Rx256Byte);
- hppe_rxpkt256to511_get(dev_id, (a_uint32_t)port_id, (union rxpkt256to511_u *)&mib_info->Rx512Byte);
- hppe_rxpkt512to1023_get(dev_id, (a_uint32_t)port_id, (union rxpkt512to1023_u *)&mib_info->Rx1024Byte);
- hppe_rxpkt1024to1518_get(dev_id, (a_uint32_t)port_id, (union rxpkt1024to1518_u *)&mib_info->Rx1518Byte);
- hppe_rxpkt1519tox_get(dev_id, (a_uint32_t)port_id, (union rxpkt1519tox_u *)&mib_info->RxMaxByte);
- hppe_rxtoolong_get(dev_id, (a_uint32_t)port_id, (union rxtoolong_u *)&mib_info->RxTooLong);
- hppe_rxgoodbyte_l_get(dev_id, (a_uint32_t)port_id, (union rxgoodbyte_l_u *)&mib_info->RxGoodByte_lo);
- hppe_rxgoodbyte_h_get(dev_id, (a_uint32_t)port_id, (union rxgoodbyte_h_u *)&mib_info->RxGoodByte_hi);
- hppe_rxbadbyte_l_get(dev_id, (a_uint32_t)port_id, (union rxbadbyte_l_u *)&mib_info->RxBadByte_lo);
- hppe_rxbadbyte_h_get(dev_id, (a_uint32_t)port_id, (union rxbadbyte_h_u *)&mib_info->RxBadByte_hi);
+ hppe_rxpkt65to127_get(dev_id, (a_uint32_t)port_id,
+ (union rxpkt65to127_u *)&mib_info->Rx128Byte);
+ hppe_rxpkt128to255_get(dev_id, (a_uint32_t)port_id,
+ (union rxpkt128to255_u *)&mib_info->Rx256Byte);
+ hppe_rxpkt256to511_get(dev_id, (a_uint32_t)port_id,
+ (union rxpkt256to511_u *)&mib_info->Rx512Byte);
+ hppe_rxpkt512to1023_get(dev_id, (a_uint32_t)port_id,
+ (union rxpkt512to1023_u *)&mib_info->Rx1024Byte);
+ hppe_rxpkt1024to1518_get(dev_id, (a_uint32_t)port_id,
+ (union rxpkt1024to1518_u *)&mib_info->Rx1518Byte);
+ hppe_rxpkt1519tox_get(dev_id, (a_uint32_t)port_id,
+ (union rxpkt1519tox_u *)&mib_info->RxMaxByte);
+ hppe_rxtoolong_get(dev_id, (a_uint32_t)port_id,
+ (union rxtoolong_u *)&mib_info->RxTooLong);
+ hppe_rxgoodbyte_l_get(dev_id, (a_uint32_t)port_id,
+ (union rxgoodbyte_l_u *)&mib_info->RxGoodByte_lo);
+ hppe_rxgoodbyte_h_get(dev_id, (a_uint32_t)port_id,
+ (union rxgoodbyte_h_u *)&mib_info->RxGoodByte_hi);
+ hppe_rxbadbyte_l_get(dev_id, (a_uint32_t)port_id,
+ (union rxbadbyte_l_u *)&mib_info->RxBadByte_lo);
+ hppe_rxbadbyte_h_get(dev_id, (a_uint32_t)port_id,
+ (union rxbadbyte_h_u *)&mib_info->RxBadByte_hi);
hppe_rxuni_get(dev_id, (a_uint32_t)port_id, (union rxuni_u *)&mib_info->RxUniCast);
hppe_txbroad_get(dev_id, (a_uint32_t)port_id, (union txbroad_u *)&mib_info->TxBroad);
hppe_txpause_get(dev_id, (a_uint32_t)port_id, (union txpause_u *)&mib_info->TxPause);
hppe_txmulti_get(dev_id, (a_uint32_t)port_id, (union txmulti_u *)&mib_info->TxMulti);
- hppe_txunderrun_get(dev_id, (a_uint32_t)port_id, (union txunderrun_u *)&mib_info->TxUnderRun);
+ hppe_txunderrun_get(dev_id, (a_uint32_t)port_id,
+ (union txunderrun_u *)&mib_info->TxUnderRun);
hppe_txpkt64_get(dev_id, (a_uint32_t)port_id, (union txpkt64_u *)&mib_info->Tx64Byte);
- hppe_txpkt65to127_get(dev_id, (a_uint32_t)port_id, (union txpkt65to127_u *)&mib_info->Tx128Byte);
- hppe_txpkt128to255_get(dev_id, (a_uint32_t)port_id, (union txpkt128to255_u *)&mib_info->Tx256Byte);
- hppe_txpkt256to511_get(dev_id, (a_uint32_t)port_id, (union txpkt256to511_u *)&mib_info->Tx512Byte);
- hppe_txpkt512to1023_get(dev_id, (a_uint32_t)port_id, (union txpkt512to1023_u *)&mib_info->Tx1024Byte);
- hppe_txpkt1024to1518_get(dev_id, (a_uint32_t)port_id, (union txpkt1024to1518_u *)&mib_info->Tx1518Byte);
- hppe_txpkt1519tox_get(dev_id, (a_uint32_t)port_id, (union txpkt1519tox_u *)&mib_info->TxMaxByte);
- hppe_txbyte_l_get(dev_id, (a_uint32_t)port_id, (union txbyte_l_u *)&mib_info->TxByte_lo);
- hppe_txbyte_h_get(dev_id, (a_uint32_t)port_id, (union txbyte_h_u *)&mib_info->TxByte_hi);
- hppe_txcollisions_get(dev_id, (a_uint32_t)port_id, (union txcollisions_u *)&mib_info->TxCollision);
- hppe_txabortcol_get(dev_id, (a_uint32_t)port_id, (union txabortcol_u *)&mib_info->TxAbortCol);
- hppe_txmulticol_get(dev_id, (a_uint32_t)port_id, (union txmulticol_u *)&mib_info->TxMultiCol);
- hppe_txsinglecol_get(dev_id, (a_uint32_t)port_id, (union txsinglecol_u *)&mib_info->TxSingalCol);
- hppe_txexcessivedefer_get(dev_id, (a_uint32_t)port_id, (union txexcessivedefer_u *)&mib_info->TxExcDefer);
+ hppe_txpkt65to127_get(dev_id, (a_uint32_t)port_id,
+ (union txpkt65to127_u *)&mib_info->Tx128Byte);
+ hppe_txpkt128to255_get(dev_id, (a_uint32_t)port_id,
+ (union txpkt128to255_u *)&mib_info->Tx256Byte);
+ hppe_txpkt256to511_get(dev_id, (a_uint32_t)port_id,
+ (union txpkt256to511_u *)&mib_info->Tx512Byte);
+ hppe_txpkt512to1023_get(dev_id, (a_uint32_t)port_id,
+ (union txpkt512to1023_u *)&mib_info->Tx1024Byte);
+ hppe_txpkt1024to1518_get(dev_id, (a_uint32_t)port_id,
+ (union txpkt1024to1518_u *)&mib_info->Tx1518Byte);
+ hppe_txpkt1519tox_get(dev_id, (a_uint32_t)port_id,
+ (union txpkt1519tox_u *)&mib_info->TxMaxByte);
+ hppe_txbyte_l_get(dev_id, (a_uint32_t)port_id,
+ (union txbyte_l_u *)&mib_info->TxByte_lo);
+ hppe_txbyte_h_get(dev_id, (a_uint32_t)port_id,
+ (union txbyte_h_u *)&mib_info->TxByte_hi);
+ hppe_txcollisions_get(dev_id, (a_uint32_t)port_id,
+ (union txcollisions_u *)&mib_info->TxCollision);
+ hppe_txabortcol_get(dev_id, (a_uint32_t)port_id,
+ (union txabortcol_u *)&mib_info->TxAbortCol);
+ hppe_txmulticol_get(dev_id, (a_uint32_t)port_id,
+ (union txmulticol_u *)&mib_info->TxMultiCol);
+ hppe_txsinglecol_get(dev_id, (a_uint32_t)port_id,
+ (union txsinglecol_u *)&mib_info->TxSingalCol);
+ hppe_txexcessivedefer_get(dev_id, (a_uint32_t)port_id,
+ (union txexcessivedefer_u *)&mib_info->TxExcDefer);
hppe_txdefer_get(dev_id, (a_uint32_t)port_id, (union txdefer_u *)&mib_info->TxDefer);
hppe_txlatecol_get(dev_id, (a_uint32_t)port_id, (union txlatecol_u *)&mib_info->TxLateCol);
hppe_txuni_get(dev_id, (a_uint32_t)port_id, (union txuni_u *)&mib_info->TxUniCast);
@@ -120,10 +169,25 @@
}
sw_error_t
+adpt_ppe_get_mib_info(a_uint32_t dev_id, fal_port_t port_id,
+ fal_mib_info_t * mib_info)
+{
+ ADPT_DEV_ID_CHECK(dev_id);
+ ADPT_NULL_POINT_CHECK(mib_info);
+#ifdef CPPE
+ if (adpt_hppe_chip_revision_get(dev_id) == CPPE_REVISION &&
+ port_id == SSDK_PHYSICAL_PORT6)
+ {
+ return adpt_cppe_lpbk_get_mib_info(dev_id, port_id, mib_info);
+ }
+#endif
+ return adpt_hppe_get_mib_info(dev_id, port_id, mib_info);
+}
+
+sw_error_t
adpt_hppe_get_tx_mib_info(a_uint32_t dev_id, fal_port_t port_id,
fal_mib_info_t * mib_info )
{
-
ADPT_DEV_ID_CHECK(dev_id);
ADPT_NULL_POINT_CHECK(mib_info);
memset(mib_info, 0, sizeof(fal_mib_info_t));
@@ -132,44 +196,65 @@
hppe_txbroad_get(dev_id, (a_uint32_t)port_id, (union txbroad_u *)&mib_info->TxBroad);
hppe_txpause_get(dev_id, (a_uint32_t)port_id, (union txpause_u *)&mib_info->TxPause);
hppe_txmulti_get(dev_id, (a_uint32_t)port_id, (union txmulti_u *)&mib_info->TxMulti);
- hppe_txunderrun_get(dev_id, (a_uint32_t)port_id, (union txunderrun_u *)&mib_info->TxUnderRun);
+ hppe_txunderrun_get(dev_id, (a_uint32_t)port_id,
+ (union txunderrun_u *)&mib_info->TxUnderRun);
hppe_txpkt64_get(dev_id, (a_uint32_t)port_id, (union txpkt64_u *)&mib_info->Tx64Byte);
- hppe_txpkt65to127_get(dev_id, (a_uint32_t)port_id, (union txpkt65to127_u *)&mib_info->Tx128Byte);
- hppe_txpkt128to255_get(dev_id, (a_uint32_t)port_id, (union txpkt128to255_u *)&mib_info->Tx256Byte);
- hppe_txpkt256to511_get(dev_id, (a_uint32_t)port_id, (union txpkt256to511_u *)&mib_info->Tx512Byte);
- hppe_txpkt512to1023_get(dev_id, (a_uint32_t)port_id, (union txpkt512to1023_u *)&mib_info->Tx1024Byte);
- hppe_txpkt1024to1518_get(dev_id, (a_uint32_t)port_id, (union txpkt1024to1518_u *)&mib_info->Tx1518Byte);
- hppe_txpkt1519tox_get(dev_id, (a_uint32_t)port_id, (union txpkt1519tox_u *)&mib_info->TxMaxByte);
+ hppe_txpkt65to127_get(dev_id, (a_uint32_t)port_id,
+ (union txpkt65to127_u *)&mib_info->Tx128Byte);
+ hppe_txpkt128to255_get(dev_id, (a_uint32_t)port_id,
+ (union txpkt128to255_u *)&mib_info->Tx256Byte);
+ hppe_txpkt256to511_get(dev_id, (a_uint32_t)port_id,
+ (union txpkt256to511_u *)&mib_info->Tx512Byte);
+ hppe_txpkt512to1023_get(dev_id, (a_uint32_t)port_id,
+ (union txpkt512to1023_u *)&mib_info->Tx1024Byte);
+ hppe_txpkt1024to1518_get(dev_id, (a_uint32_t)port_id,
+ (union txpkt1024to1518_u *)&mib_info->Tx1518Byte);
+ hppe_txpkt1519tox_get(dev_id, (a_uint32_t)port_id,
+ (union txpkt1519tox_u *)&mib_info->TxMaxByte);
hppe_txbyte_l_get(dev_id, (a_uint32_t)port_id, (union txbyte_l_u *)&mib_info->TxByte_lo);
hppe_txbyte_h_get(dev_id, (a_uint32_t)port_id, (union txbyte_h_u *)&mib_info->TxByte_hi);
- hppe_txcollisions_get(dev_id, (a_uint32_t)port_id, (union txcollisions_u *)&mib_info->TxCollision);
- hppe_txabortcol_get(dev_id, (a_uint32_t)port_id, (union txabortcol_u *)&mib_info->TxAbortCol);
- hppe_txmulticol_get(dev_id, (a_uint32_t)port_id, (union txmulticol_u *)&mib_info->TxMultiCol);
- hppe_txsinglecol_get(dev_id, (a_uint32_t)port_id, (union txsinglecol_u *)&mib_info->TxSingalCol);
- hppe_txexcessivedefer_get(dev_id, (a_uint32_t)port_id, (union txexcessivedefer_u *)&mib_info->TxExcDefer);
+ hppe_txcollisions_get(dev_id, (a_uint32_t)port_id,
+ (union txcollisions_u *)&mib_info->TxCollision);
+ hppe_txabortcol_get(dev_id, (a_uint32_t)port_id,
+ (union txabortcol_u *)&mib_info->TxAbortCol);
+ hppe_txmulticol_get(dev_id, (a_uint32_t)port_id,
+ (union txmulticol_u *)&mib_info->TxMultiCol);
+ hppe_txsinglecol_get(dev_id, (a_uint32_t)port_id,
+ (union txsinglecol_u *)&mib_info->TxSingalCol);
+ hppe_txexcessivedefer_get(dev_id, (a_uint32_t)port_id,
+ (union txexcessivedefer_u *)&mib_info->TxExcDefer);
hppe_txdefer_get(dev_id, (a_uint32_t)port_id, (union txdefer_u *)&mib_info->TxDefer);
- hppe_txlatecol_get(dev_id, (a_uint32_t)port_id, (union txlatecol_u *)&mib_info->TxLateCol);
+ hppe_txlatecol_get(dev_id, (a_uint32_t)port_id,
+ (union txlatecol_u *)&mib_info->TxLateCol);
hppe_txuni_get(dev_id, (a_uint32_t)port_id, (union txuni_u *)&mib_info->TxUniCast);
return SW_OK;
}
sw_error_t
-adpt_hppe_mib_status_set(a_uint32_t dev_id, a_bool_t enable)
+adpt_ppe_mib_status_set(a_uint32_t dev_id, a_bool_t enable)
{
- a_uint32_t port_id = 0, xg_port_id = 0;
+ a_uint32_t port_id = 0, xg_port_id = 0, g_port_id = 0;
+ a_uint32_t port_num = SSDK_PHYSICAL_PORT6;
union mmc_control_u mmc_control;
+ sw_error_t rv = SW_OK;
memset(&mmc_control, 0, sizeof(mmc_control));
ADPT_DEV_ID_CHECK(dev_id);
-
- for (port_id = SSDK_PHYSICAL_PORT0; port_id < SSDK_PHYSICAL_PORT6; port_id++) {
-
- hppe_mac_mib_ctrl_mib_en_set(dev_id, port_id, (a_uint32_t)enable);
+#ifdef CPPE
+ if (adpt_hppe_chip_revision_get(dev_id) == CPPE_REVISION)
+ {
+ port_num = SSDK_PHYSICAL_PORT5;
+ rv = adpt_cppe_lpbk_mib_status_set(dev_id, SSDK_PHYSICAL_PORT6, enable);
+ SW_RTN_ON_ERROR(rv);
+ }
+#endif
+ for (port_id = SSDK_PHYSICAL_PORT1; port_id <= port_num; port_id++) {
+ g_port_id = HPPE_TO_GMAC_PORT_ID(port_id);
+ hppe_mac_mib_ctrl_mib_en_set(dev_id, g_port_id, (a_uint32_t)enable);
}
- for (port_id = SSDK_PHYSICAL_PORT5; port_id <= SSDK_PHYSICAL_PORT6; port_id++) {
-
+ for (port_id = SSDK_PHYSICAL_PORT5; port_id <= port_num; port_id++) {
xg_port_id = HPPE_TO_XGMAC_PORT_ID(port_id);
hppe_mmc_control_get(dev_id, xg_port_id, &mmc_control);
@@ -181,7 +266,7 @@
hppe_mmc_control_set(dev_id, xg_port_id, &mmc_control);
}
- return SW_OK;
+ return rv;
}
sw_error_t
@@ -212,6 +297,20 @@
return SW_OK;
}
+
+sw_error_t
+adpt_ppe_mib_port_flush_counters(a_uint32_t dev_id, fal_port_t port_id)
+{
+#ifdef CPPE
+ if (adpt_hppe_chip_revision_get(dev_id) == CPPE_REVISION &&
+ port_id == SSDK_PHYSICAL_PORT6)
+ {
+ return adpt_cppe_lpbk_mib_flush_counters(dev_id, port_id);
+ }
+#endif
+ return adpt_hppe_mib_port_flush_counters(dev_id, port_id);
+}
+
sw_error_t
adpt_hppe_mib_status_get(a_uint32_t dev_id, a_bool_t * enable)
{
@@ -234,7 +333,6 @@
adpt_hppe_get_rx_mib_info(a_uint32_t dev_id, fal_port_t port_id,
fal_mib_info_t * mib_info )
{
-
ADPT_DEV_ID_CHECK(dev_id);
ADPT_NULL_POINT_CHECK(mib_info);
memset(mib_info, 0, sizeof(fal_mib_info_t));
@@ -244,28 +342,58 @@
hppe_rxpause_get(dev_id, (a_uint32_t)port_id, (union rxpause_u *)&mib_info->RxPause);
hppe_rxmulti_get(dev_id, (a_uint32_t)port_id, (union rxmulti_u *)&mib_info->RxMulti);
hppe_rxfcserr_get(dev_id, (a_uint32_t)port_id, (union rxfcserr_u *)&mib_info->RxFcsErr);
- hppe_rxalignerr_get(dev_id, (a_uint32_t)port_id, (union rxalignerr_u *)&mib_info->RxAllignErr);
+ hppe_rxalignerr_get(dev_id, (a_uint32_t)port_id,
+ (union rxalignerr_u *)&mib_info->RxAllignErr);
hppe_rxrunt_get(dev_id, (a_uint32_t)port_id, (union rxrunt_u *)&mib_info->RxRunt);
hppe_rxfrag_get(dev_id, (a_uint32_t)port_id, (union rxfrag_u *)&mib_info->RxFragment);
- hppe_rxjumbofcserr_get(dev_id, (a_uint32_t)port_id, (union rxjumbofcserr_u *)&mib_info->RxJumboFcsErr);
- hppe_rxjumboalignerr_get(dev_id, (a_uint32_t)port_id, (union rxjumboalignerr_u *)&mib_info->RxJumboAligenErr);
+ hppe_rxjumbofcserr_get(dev_id, (a_uint32_t)port_id,
+ (union rxjumbofcserr_u *)&mib_info->RxJumboFcsErr);
+ hppe_rxjumboalignerr_get(dev_id, (a_uint32_t)port_id,
+ (union rxjumboalignerr_u *)&mib_info->RxJumboAligenErr);
hppe_rxpkt64_get(dev_id, (a_uint32_t)port_id, (union rxpkt64_u *)&mib_info->Rx64Byte);
- hppe_rxpkt65to127_get(dev_id, (a_uint32_t)port_id, (union rxpkt65to127_u *)&mib_info->Rx128Byte);
- hppe_rxpkt128to255_get(dev_id, (a_uint32_t)port_id, (union rxpkt128to255_u *)&mib_info->Rx256Byte);
- hppe_rxpkt256to511_get(dev_id, (a_uint32_t)port_id, (union rxpkt256to511_u *)&mib_info->Rx512Byte);
- hppe_rxpkt512to1023_get(dev_id, (a_uint32_t)port_id, (union rxpkt512to1023_u *)&mib_info->Rx1024Byte);
- hppe_rxpkt1024to1518_get(dev_id, (a_uint32_t)port_id, (union rxpkt1024to1518_u *)&mib_info->Rx1518Byte);
- hppe_rxpkt1519tox_get(dev_id, (a_uint32_t)port_id, (union rxpkt1519tox_u *)&mib_info->RxMaxByte);
- hppe_rxtoolong_get(dev_id, (a_uint32_t)port_id, (union rxtoolong_u *)&mib_info->RxTooLong);
- hppe_rxgoodbyte_l_get(dev_id, (a_uint32_t)port_id, (union rxgoodbyte_l_u *)&mib_info->RxGoodByte_lo);
- hppe_rxgoodbyte_h_get(dev_id, (a_uint32_t)port_id, (union rxgoodbyte_h_u *)&mib_info->RxGoodByte_hi);
- hppe_rxbadbyte_l_get(dev_id, (a_uint32_t)port_id, (union rxbadbyte_l_u *)&mib_info->RxBadByte_lo);
- hppe_rxbadbyte_h_get(dev_id, (a_uint32_t)port_id, (union rxbadbyte_h_u *)&mib_info->RxBadByte_hi);
+ hppe_rxpkt65to127_get(dev_id, (a_uint32_t)port_id,
+ (union rxpkt65to127_u *)&mib_info->Rx128Byte);
+ hppe_rxpkt128to255_get(dev_id, (a_uint32_t)port_id,
+ (union rxpkt128to255_u *)&mib_info->Rx256Byte);
+ hppe_rxpkt256to511_get(dev_id, (a_uint32_t)port_id,
+ (union rxpkt256to511_u *)&mib_info->Rx512Byte);
+ hppe_rxpkt512to1023_get(dev_id, (a_uint32_t)port_id,
+ (union rxpkt512to1023_u *)&mib_info->Rx1024Byte);
+ hppe_rxpkt1024to1518_get(dev_id, (a_uint32_t)port_id,
+ (union rxpkt1024to1518_u *)&mib_info->Rx1518Byte);
+ hppe_rxpkt1519tox_get(dev_id, (a_uint32_t)port_id,
+ (union rxpkt1519tox_u *)&mib_info->RxMaxByte);
+ hppe_rxtoolong_get(dev_id, (a_uint32_t)port_id,
+ (union rxtoolong_u *)&mib_info->RxTooLong);
+ hppe_rxgoodbyte_l_get(dev_id, (a_uint32_t)port_id,
+ (union rxgoodbyte_l_u *)&mib_info->RxGoodByte_lo);
+ hppe_rxgoodbyte_h_get(dev_id, (a_uint32_t)port_id,
+ (union rxgoodbyte_h_u *)&mib_info->RxGoodByte_hi);
+ hppe_rxbadbyte_l_get(dev_id, (a_uint32_t)port_id,
+ (union rxbadbyte_l_u *)&mib_info->RxBadByte_lo);
+ hppe_rxbadbyte_h_get(dev_id, (a_uint32_t)port_id,
+ (union rxbadbyte_h_u *)&mib_info->RxBadByte_hi);
hppe_rxuni_get(dev_id, (a_uint32_t)port_id, (union rxuni_u *)&mib_info->RxUniCast);
return SW_OK;
}
+sw_error_t
+adpt_ppe_get_rx_mib_info(a_uint32_t dev_id, fal_port_t port_id,
+ fal_mib_info_t * mib_info)
+{
+ ADPT_DEV_ID_CHECK(dev_id);
+ ADPT_NULL_POINT_CHECK(mib_info);
+#ifdef CPPE
+ if (adpt_hppe_chip_revision_get(dev_id) == CPPE_REVISION &&
+ port_id == SSDK_PHYSICAL_PORT6)
+ {
+ return adpt_cppe_lpbk_get_mib_info(dev_id, port_id, mib_info);
+ }
+#endif
+ return adpt_hppe_get_rx_mib_info(dev_id, port_id, mib_info);
+}
+
void adpt_hppe_mib_func_bitmap_init(a_uint32_t dev_id)
{
adpt_api_t *p_adpt_api = NULL;
@@ -840,11 +968,11 @@
if(p_adpt_api->adpt_mib_func_bitmap & (1<<FUNC_GET_MIB_INFO))
{
- p_adpt_api->adpt_get_mib_info = adpt_hppe_get_mib_info;
+ p_adpt_api->adpt_get_mib_info = adpt_ppe_get_mib_info;
}
if(p_adpt_api->adpt_mib_func_bitmap & (1<<FUNC_GET_RX_MIB_INFO))
{
- p_adpt_api->adpt_get_rx_mib_info = adpt_hppe_get_rx_mib_info;
+ p_adpt_api->adpt_get_rx_mib_info = adpt_ppe_get_rx_mib_info;
}
if(p_adpt_api->adpt_mib_func_bitmap & (1<<FUNC_GET_TX_MIB_INFO))
{
@@ -852,7 +980,7 @@
}
if(p_adpt_api->adpt_mib_func_bitmap & (1<<FUNC_MIB_STATUS_SET))
{
- p_adpt_api->adpt_mib_status_set = adpt_hppe_mib_status_set;
+ p_adpt_api->adpt_mib_status_set = adpt_ppe_mib_status_set;
}
if(p_adpt_api->adpt_mib_func_bitmap & (1<<FUNC_MIB_STATUS_GET))
{
@@ -860,11 +988,11 @@
}
if(p_adpt_api->adpt_mib_func_bitmap & (1<<FUNC_MIB_PORT_FLUSH_COUNTERS))
{
- p_adpt_api->adpt_mib_port_flush_counters = adpt_hppe_mib_port_flush_counters;
+ p_adpt_api->adpt_mib_port_flush_counters = adpt_ppe_mib_port_flush_counters;
}
if(p_adpt_api->adpt_mib_func_bitmap & (1<<FUNC_MIB_CPUKEEP_SET))
{
- p_adpt_api->adpt_mib_cpukeep_set = adpt_hppe_mib_cpukeep_set;
+ p_adpt_api->adpt_mib_cpukeep_set = adpt_ppe_mib_cpukeep_set;
}
if(p_adpt_api->adpt_mib_func_bitmap & (1<<FUNC_MIB_CPUKEEP_GET))
{
diff --git a/src/adpt/hppe/adpt_hppe_trunk.c b/src/adpt/hppe/adpt_hppe_trunk.c
index d2c96d9..0a7834f 100755
--- a/src/adpt/hppe/adpt_hppe_trunk.c
+++ b/src/adpt/hppe/adpt_hppe_trunk.c
@@ -139,7 +139,15 @@
ADPT_DEV_ID_CHECK(dev_id);
if (trunk_id >= TRUNK_FILTER_MAX_ENTRY)
+ {
return SW_OUT_OF_RANGE;
+ }
+
+ if(enable == A_TRUE && member == 0)
+ {
+ SSDK_ERROR("trunk member cannot be 0 when trunk group was enabled\n");
+ return SW_BAD_PARAM;
+ }
if (A_TRUE == enable)
{
diff --git a/src/adpt/hppe/adpt_hppe_vsi.c b/src/adpt/hppe/adpt_hppe_vsi.c
index 2db55e9..557f8d7 100755
--- a/src/adpt/hppe/adpt_hppe_vsi.c
+++ b/src/adpt/hppe/adpt_hppe_vsi.c
@@ -72,6 +72,13 @@
return A_TRUE;
}
}
+ else
+ {
+ if(!(xlt_rule->bf.ckey_vid_incl))
+ {
+ return A_TRUE;
+ }
+ }
}
}
return A_FALSE;
diff --git a/src/fal/fal_mib.c b/src/fal/fal_mib.c
index 8b339e9..0e8b39e 100755
--- a/src/fal/fal_mib.c
+++ b/src/fal/fal_mib.c
@@ -315,6 +315,11 @@
g_mibcounter[dev_id][port_id].RxOverFlow += mib_Info->RxOverFlow;
g_mibcounter[dev_id][port_id].Filtered += mib_Info->Filtered;
g_mibcounter[dev_id][port_id].RxUniCast += mib_Info->RxUniCast;
+ g_mibcounter[dev_id][port_id].RxTooLongByte +=
+ (((u64)mib_Info->RxTooLongByte_hi) << 32) | mib_Info->RxTooLongByte_lo;
+ g_mibcounter[dev_id][port_id].RxRuntByte +=
+ (((u64)mib_Info->RxRuntByte_hi) << 32) | mib_Info->RxRuntByte_lo;
+ g_mibcounter[dev_id][port_id].Rx14To63 += mib_Info->Rx14To63;
return;
}
@@ -388,47 +393,50 @@
if(rv != SW_OK)
return rv;
- mib_counter->RxBroad = g_mibcounter[dev_id][port_id].RxBroad;
- mib_counter->RxPause = g_mibcounter[dev_id][port_id].RxPause;
- mib_counter->RxMulti = g_mibcounter[dev_id][port_id].RxMulti;
- mib_counter->RxFcsErr = g_mibcounter[dev_id][port_id].RxFcsErr;
- mib_counter->RxAllignErr = g_mibcounter[dev_id][port_id].RxAllignErr;
- mib_counter->RxRunt = g_mibcounter[dev_id][port_id].RxRunt;
- mib_counter->RxFragment = g_mibcounter[dev_id][port_id].RxFragment ;
- mib_counter->Rx64Byte = g_mibcounter[dev_id][port_id].Rx64Byte ;
- mib_counter->Rx128Byte = g_mibcounter[dev_id][port_id].Rx128Byte;
- mib_counter->Rx256Byte = g_mibcounter[dev_id][port_id].Rx256Byte;
- mib_counter->Rx512Byte = g_mibcounter[dev_id][port_id].Rx512Byte;
- mib_counter->Rx1024Byte = g_mibcounter[dev_id][port_id].Rx1024Byte;
- mib_counter->Rx1518Byte = g_mibcounter[dev_id][port_id].Rx1518Byte;
- mib_counter->RxMaxByte = g_mibcounter[dev_id][port_id].RxMaxByte;
- mib_counter->RxTooLong = g_mibcounter[dev_id][port_id].RxTooLong;
- mib_counter->RxGoodByte = g_mibcounter[dev_id][port_id].RxGoodByte;
- mib_counter->RxBadByte = g_mibcounter[dev_id][port_id].RxBadByte;
- mib_counter->RxOverFlow = g_mibcounter[dev_id][port_id].RxOverFlow;
- mib_counter->Filtered = g_mibcounter[dev_id][port_id].Filtered;
- mib_counter->TxBroad = g_mibcounter[dev_id][port_id].TxBroad;
- mib_counter->TxPause = g_mibcounter[dev_id][port_id].TxPause;
- mib_counter->TxMulti = g_mibcounter[dev_id][port_id].TxMulti;
- mib_counter->TxUnderRun = g_mibcounter[dev_id][port_id].TxUnderRun;
- mib_counter->Tx64Byte = g_mibcounter[dev_id][port_id].Tx64Byte;
- mib_counter->Tx128Byte = g_mibcounter[dev_id][port_id].Tx128Byte;
- mib_counter->Tx256Byte = g_mibcounter[dev_id][port_id].Tx256Byte;
- mib_counter->Tx512Byte = g_mibcounter[dev_id][port_id].Tx512Byte;
- mib_counter->Tx1024Byte = g_mibcounter[dev_id][port_id].Tx1024Byte;
- mib_counter->Tx1518Byte = g_mibcounter[dev_id][port_id].Tx1518Byte;
- mib_counter->TxMaxByte = g_mibcounter[dev_id][port_id].TxMaxByte;
- mib_counter->TxOverSize = g_mibcounter[dev_id][port_id].TxOverSize;
- mib_counter->TxByte = g_mibcounter[dev_id][port_id].TxByte;
- mib_counter->TxCollision = g_mibcounter[dev_id][port_id].TxCollision;
- mib_counter->TxAbortCol = g_mibcounter[dev_id][port_id].TxAbortCol;
- mib_counter->TxMultiCol = g_mibcounter[dev_id][port_id].TxMultiCol;
- mib_counter->TxSingalCol = g_mibcounter[dev_id][port_id].TxSingalCol;
- mib_counter->TxExcDefer = g_mibcounter[dev_id][port_id].TxExcDefer;
- mib_counter->TxDefer = g_mibcounter[dev_id][port_id].TxDefer;
- mib_counter->TxLateCol = g_mibcounter[dev_id][port_id].TxLateCol;
- mib_counter->RxUniCast = g_mibcounter[dev_id][port_id].RxUniCast;
- mib_counter->TxUniCast = g_mibcounter[dev_id][port_id].TxUniCast;
+ mib_counter->RxBroad = g_mibcounter[dev_id][port_id].RxBroad;
+ mib_counter->RxPause = g_mibcounter[dev_id][port_id].RxPause;
+ mib_counter->RxMulti = g_mibcounter[dev_id][port_id].RxMulti;
+ mib_counter->RxFcsErr = g_mibcounter[dev_id][port_id].RxFcsErr;
+ mib_counter->RxAllignErr = g_mibcounter[dev_id][port_id].RxAllignErr;
+ mib_counter->RxRunt = g_mibcounter[dev_id][port_id].RxRunt;
+ mib_counter->RxFragment = g_mibcounter[dev_id][port_id].RxFragment ;
+ mib_counter->Rx64Byte = g_mibcounter[dev_id][port_id].Rx64Byte ;
+ mib_counter->Rx128Byte = g_mibcounter[dev_id][port_id].Rx128Byte;
+ mib_counter->Rx256Byte = g_mibcounter[dev_id][port_id].Rx256Byte;
+ mib_counter->Rx512Byte = g_mibcounter[dev_id][port_id].Rx512Byte;
+ mib_counter->Rx1024Byte = g_mibcounter[dev_id][port_id].Rx1024Byte;
+ mib_counter->Rx1518Byte = g_mibcounter[dev_id][port_id].Rx1518Byte;
+ mib_counter->RxMaxByte = g_mibcounter[dev_id][port_id].RxMaxByte;
+ mib_counter->RxTooLong = g_mibcounter[dev_id][port_id].RxTooLong;
+ mib_counter->RxGoodByte = g_mibcounter[dev_id][port_id].RxGoodByte;
+ mib_counter->RxBadByte = g_mibcounter[dev_id][port_id].RxBadByte;
+ mib_counter->RxOverFlow = g_mibcounter[dev_id][port_id].RxOverFlow;
+ mib_counter->Filtered = g_mibcounter[dev_id][port_id].Filtered;
+ mib_counter->TxBroad = g_mibcounter[dev_id][port_id].TxBroad;
+ mib_counter->TxPause = g_mibcounter[dev_id][port_id].TxPause;
+ mib_counter->TxMulti = g_mibcounter[dev_id][port_id].TxMulti;
+ mib_counter->TxUnderRun = g_mibcounter[dev_id][port_id].TxUnderRun;
+ mib_counter->Tx64Byte = g_mibcounter[dev_id][port_id].Tx64Byte;
+ mib_counter->Tx128Byte = g_mibcounter[dev_id][port_id].Tx128Byte;
+ mib_counter->Tx256Byte = g_mibcounter[dev_id][port_id].Tx256Byte;
+ mib_counter->Tx512Byte = g_mibcounter[dev_id][port_id].Tx512Byte;
+ mib_counter->Tx1024Byte = g_mibcounter[dev_id][port_id].Tx1024Byte;
+ mib_counter->Tx1518Byte = g_mibcounter[dev_id][port_id].Tx1518Byte;
+ mib_counter->TxMaxByte = g_mibcounter[dev_id][port_id].TxMaxByte;
+ mib_counter->TxOverSize = g_mibcounter[dev_id][port_id].TxOverSize;
+ mib_counter->TxByte = g_mibcounter[dev_id][port_id].TxByte;
+ mib_counter->TxCollision = g_mibcounter[dev_id][port_id].TxCollision;
+ mib_counter->TxAbortCol = g_mibcounter[dev_id][port_id].TxAbortCol;
+ mib_counter->TxMultiCol = g_mibcounter[dev_id][port_id].TxMultiCol;
+ mib_counter->TxSingalCol = g_mibcounter[dev_id][port_id].TxSingalCol;
+ mib_counter->TxExcDefer = g_mibcounter[dev_id][port_id].TxExcDefer;
+ mib_counter->TxDefer = g_mibcounter[dev_id][port_id].TxDefer;
+ mib_counter->TxLateCol = g_mibcounter[dev_id][port_id].TxLateCol;
+ mib_counter->RxUniCast = g_mibcounter[dev_id][port_id].RxUniCast;
+ mib_counter->TxUniCast = g_mibcounter[dev_id][port_id].TxUniCast;
+ mib_counter->Rx14To63 = g_mibcounter[dev_id][port_id].Rx14To63;
+ mib_counter->RxTooLongByte = g_mibcounter[dev_id][port_id].RxTooLongByte;
+ mib_counter->RxRuntByte = g_mibcounter[dev_id][port_id].RxRuntByte;
return SW_OK;
}