diff --git a/osi/core/core_common.c b/osi/core/core_common.c index 08d906f..e9acd50 100644 --- a/osi/core/core_common.c +++ b/osi/core/core_common.c @@ -1438,10 +1438,15 @@ void hw_tsn_init(struct osi_core_priv_data *osi_core, * @param[in] error_code: Ethernet HSI error code * * @note MAC should be init and started. see osi_start_mac() + * + * @retval 0 on success + * @retval -1 on failure. */ -void hsi_common_error_inject(struct osi_core_priv_data *osi_core, - nveu32_t error_code) +nve32_t hsi_common_error_inject(struct osi_core_priv_data *osi_core, + nveu32_t error_code) { + nve32_t ret = 0; + switch (error_code) { case OSI_INBOUND_BUS_CRC_ERR: osi_core->hsi.inject_crc_err_count = @@ -1491,8 +1496,11 @@ void hsi_common_error_inject(struct osi_core_priv_data *osi_core, default: OSI_CORE_ERR(osi_core->osd, OSI_LOG_ARG_HW_FAIL, "Invalid error code\n", (nveu32_t)error_code); + ret = -1; break; } + + return ret; } #endif diff --git a/osi/core/core_common.h b/osi/core/core_common.h index 5634966..e5544b9 100644 --- a/osi/core/core_common.h +++ b/osi/core/core_common.h @@ -173,7 +173,7 @@ void prepare_l3l4_registers(const struct osi_core_priv_data *const osi_core, nveu32_t *l3_addr1_reg, nveu32_t *ctr_reg); #ifdef HSI_SUPPORT -void hsi_common_error_inject(struct osi_core_priv_data *osi_core, - nveu32_t error_code); +nve32_t hsi_common_error_inject(struct osi_core_priv_data *osi_core, + nveu32_t error_code); #endif #endif /* INCLUDED_CORE_COMMON_H */ diff --git a/osi/core/core_local.h b/osi/core/core_local.h index fac7c8b..685ee9a 100644 --- a/osi/core/core_local.h +++ b/osi/core/core_local.h @@ -228,8 +228,8 @@ struct core_ops { nve32_t (*core_hsi_configure)(struct osi_core_priv_data *const osi_core, const nveu32_t enable); /** Interface function called to inject error */ - void (*core_hsi_inject_err)(struct osi_core_priv_data *const osi_core, - const nveu32_t error_code); + nve32_t (*core_hsi_inject_err)(struct osi_core_priv_data *const osi_core, + const nveu32_t error_code); #endif }; diff --git a/osi/core/eqos_core.c b/osi/core/eqos_core.c index b1db023..32c076c 100644 --- a/osi/core/eqos_core.c +++ b/osi/core/eqos_core.c @@ -957,10 +957,11 @@ static nve32_t eqos_hsi_configure(struct osi_core_priv_data *const osi_core, * @retval -1 on failure */ -static void eqos_hsi_inject_err(struct osi_core_priv_data *const osi_core, +static nve32_t eqos_hsi_inject_err(struct osi_core_priv_data *const osi_core, const nveu32_t error_code) { nveu32_t value; + nve32_t ret = 0; switch (error_code) { case OSI_HSI_EQOS0_CE_CODE: @@ -978,9 +979,11 @@ static void eqos_hsi_inject_err(struct osi_core_priv_data *const osi_core, EQOS_MTL_DBG_CTL); break; default: - hsi_common_error_inject(osi_core, error_code); + ret = hsi_common_error_inject(osi_core, error_code); break; } + + return ret; } #endif diff --git a/osi/core/mgbe_core.c b/osi/core/mgbe_core.c index 59b8c69..a510cb9 100644 --- a/osi/core/mgbe_core.c +++ b/osi/core/mgbe_core.c @@ -1687,8 +1687,10 @@ fail: * @param[in] osi_core: OSI core private data structure. * @param[in] error_code: HSI Error code * + * @retval 0 on success + * @retval -1 on failure */ -static void mgbe_hsi_inject_err(struct osi_core_priv_data *const osi_core, +static nve32_t mgbe_hsi_inject_err(struct osi_core_priv_data *const osi_core, const nveu32_t error_code) { const nveu32_t val_ce = (MGBE_MTL_DEBUG_CONTROL_FDBGEN | @@ -1701,6 +1703,7 @@ static void mgbe_hsi_inject_err(struct osi_core_priv_data *const osi_core, MGBE_MTL_DEBUG_CONTROL_DBGMOD | MGBE_MTL_DEBUG_CONTROL_FIFORDEN | MGBE_MTL_DEBUG_CONTROL_EIEE); + nve32_t ret = 0; switch (error_code) { case OSI_HSI_MGBE0_CE_CODE: @@ -1718,9 +1721,11 @@ static void mgbe_hsi_inject_err(struct osi_core_priv_data *const osi_core, MGBE_MTL_DEBUG_CONTROL); break; default: - hsi_common_error_inject(osi_core, error_code); + ret = hsi_common_error_inject(osi_core, error_code); break; } + + return ret; } #endif diff --git a/osi/core/osi_hal.c b/osi/core/osi_hal.c index e567b07..211988a 100644 --- a/osi/core/osi_hal.c +++ b/osi/core/osi_hal.c @@ -2768,8 +2768,7 @@ static nve32_t osi_hal_handle_ioctl(struct osi_core_priv_data *osi_core, ret = ops_p->core_hsi_configure(osi_core, data->arg1_u32); break; case OSI_CMD_HSI_INJECT_ERR: - ops_p->core_hsi_inject_err(osi_core, data->arg1_u32); - ret = 0; + ret = ops_p->core_hsi_inject_err(osi_core, data->arg1_u32); break; #endif