diff --git a/include/osi_common.h b/include/osi_common.h index e0240c9..de3e13e 100644 --- a/include/osi_common.h +++ b/include/osi_common.h @@ -160,7 +160,7 @@ /* Logging defines */ /* log levels */ -#define OSI_LOG_INFO 1U +#define OSI_LOG_INFO 1U #ifndef OSI_STRIPPED_LIB #define OSI_LOG_WARN 2U #endif /* OSI_STRIPPED_LIB */ diff --git a/include/osi_core.h b/include/osi_core.h index a2c57f6..f3e97ec 100644 --- a/include/osi_core.h +++ b/include/osi_core.h @@ -300,8 +300,8 @@ typedef my_lint_64 nvel64_t; */ #define OSI_CORE_INFO(priv, type, err, loga) \ { \ - osi_core->osd_ops.ops_log((priv), __func__, __LINE__, \ - OSI_LOG_INFO, (type), (err), (loga)); \ + osi_core->osd_ops.ops_log(priv, __func__, __LINE__, \ + OSI_LOG_INFO, type, err, loga); \ } #define VLAN_NUM_VID 4096U @@ -379,9 +379,6 @@ typedef my_lint_64 nvel64_t; #define MACSEC_REG_VIOL_ERR_IDX 3U /** @} */ -extern nveu32_t osi_hsi_err_code[][2]; -extern nveu16_t osi_hsi_reporter_id[]; - /** * @addtogroup HSI_TIME_THRESHOLD * diff --git a/osi/core/eqos_core.c b/osi/core/eqos_core.c index e5d3c89..59eca7e 100644 --- a/osi/core/eqos_core.c +++ b/osi/core/eqos_core.c @@ -811,7 +811,7 @@ static nve32_t eqos_hsi_configure(struct osi_core_priv_data *const osi_core, if (enable == OSI_ENABLE) { osi_core->hsi.enabled = OSI_ENABLE; - osi_core->hsi.reporter_id = osi_hsi_reporter_id[osi_core->instance_id]; + osi_core->hsi.reporter_id = OSI_HSI_EQOS0_REPORTER_ID; /* T23X-EQOS_HSIv2-19: Enabling of Consistency Monitor for TX Frame Errors */ value = osi_readla(osi_core, @@ -1756,8 +1756,7 @@ static void eqos_handle_hsi_intr(struct osi_core_priv_data *const osi_core) EQOS_WRAP_COMMON_INTR_STATUS); if (((val & EQOS_REGISTER_PARITY_ERR) == EQOS_REGISTER_PARITY_ERR) || ((val & EQOS_CORE_UNCORRECTABLE_ERR) == EQOS_CORE_UNCORRECTABLE_ERR)) { - osi_core->hsi.err_code[UE_IDX] = - osi_hsi_err_code[osi_core->instance_id][UE_IDX]; + osi_core->hsi.err_code[UE_IDX] = OSI_HSI_EQOS0_UE_CODE; osi_core->hsi.report_err = OSI_ENABLE; osi_core->hsi.report_count_err[UE_IDX] = OSI_ENABLE; /* Disable the interrupt */ @@ -1769,8 +1768,7 @@ static void eqos_handle_hsi_intr(struct osi_core_priv_data *const osi_core) EQOS_WRAP_COMMON_INTR_ENABLE); } if ((val & EQOS_CORE_CORRECTABLE_ERR) == EQOS_CORE_CORRECTABLE_ERR) { - osi_core->hsi.err_code[CE_IDX] = - osi_hsi_err_code[osi_core->instance_id][CE_IDX]; + osi_core->hsi.err_code[CE_IDX] = OSI_HSI_EQOS0_CE_CODE; osi_core->hsi.report_err = OSI_ENABLE; osi_core->hsi.ce_count = osi_update_stats_counter(osi_core->hsi.ce_count, 1UL); diff --git a/osi/core/mgbe_core.c b/osi/core/mgbe_core.c index e25b828..a7aa896 100644 --- a/osi/core/mgbe_core.c +++ b/osi/core/mgbe_core.c @@ -2077,6 +2077,12 @@ static nve32_t mgbe_hsi_configure(struct osi_core_priv_data *const osi_core, { nveu32_t value = 0U; nve32_t ret = 0; + const nveu16_t osi_hsi_reporter_id[] = { + OSI_HSI_MGBE0_REPORTER_ID, + OSI_HSI_MGBE1_REPORTER_ID, + OSI_HSI_MGBE2_REPORTER_ID, + OSI_HSI_MGBE3_REPORTER_ID, + }; if (enable == OSI_ENABLE) { osi_core->hsi.enabled = OSI_ENABLE; @@ -3434,6 +3440,12 @@ static void mgbe_handle_hsi_intr(struct osi_core_priv_data *osi_core) nveu32_t val2 = 0; void *xpcs_base = osi_core->xpcs_base; nveu64_t ce_count_threshold; + const nveu32_t osi_hsi_err_code[][2] = { + {OSI_HSI_MGBE0_UE_CODE, OSI_HSI_MGBE0_CE_CODE}, + {OSI_HSI_MGBE1_UE_CODE, OSI_HSI_MGBE1_CE_CODE}, + {OSI_HSI_MGBE2_UE_CODE, OSI_HSI_MGBE2_CE_CODE}, + {OSI_HSI_MGBE3_UE_CODE, OSI_HSI_MGBE3_CE_CODE}, + }; val = osi_readla(osi_core, (nveu8_t *)osi_core->base + MGBE_WRAP_COMMON_INTR_STATUS); diff --git a/osi/core/osi_core.c b/osi/core/osi_core.c index 2d75675..e73872a 100644 --- a/osi/core/osi_core.c +++ b/osi/core/osi_core.c @@ -25,30 +25,6 @@ #include "core_local.h" #include "../osi/common/common.h" -#ifdef HSI_SUPPORT -/** - * @brief osi_hsi_err_code - Array of error code - */ -nveu32_t osi_hsi_err_code[][2] = { - {OSI_HSI_MGBE0_UE_CODE, OSI_HSI_MGBE0_CE_CODE}, - {OSI_HSI_MGBE1_UE_CODE, OSI_HSI_MGBE1_CE_CODE}, - {OSI_HSI_MGBE2_UE_CODE, OSI_HSI_MGBE2_CE_CODE}, - {OSI_HSI_MGBE3_UE_CODE, OSI_HSI_MGBE3_CE_CODE}, - {OSI_HSI_EQOS0_UE_CODE, OSI_HSI_EQOS0_CE_CODE}, -}; - -/** - * @brief osi_hsi_reporter_id - Array of reporter_id - */ -nveu16_t osi_hsi_reporter_id[] = { - OSI_HSI_MGBE0_REPORTER_ID, - OSI_HSI_MGBE1_REPORTER_ID, - OSI_HSI_MGBE2_REPORTER_ID, - OSI_HSI_MGBE3_REPORTER_ID, - OSI_HSI_EQOS0_REPORTER_ID, -}; -#endif - /** * @brief Function to validate function pointers. *