diff --git a/include/mmc.h b/include/mmc.h index 461569e..e82b6b7 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -22,6 +22,9 @@ #ifndef INCLUDED_MMC_H #define INCLUDED_MMC_H + +#include "../osi/common/type.h" + /** * @brief osi_mmc_counters - The structure to hold RMON counter values */ diff --git a/include/osi_common.h b/include/osi_common.h index 4a0b42b..ba8d006 100644 --- a/include/osi_common.h +++ b/include/osi_common.h @@ -205,4 +205,37 @@ /** @} */ #endif /* OSI_STRIPPED_LIB */ +/** + * @brief osi_update_stats_counter - update value by increment passed + * as parameter + * + * @note + * Algorithm: + * - Check for boundary and return sum + * + * @param[in] last_value: last value of stat counter + * @param[in] incr: increment value + * + * @note Input parameter should be only nveu64_t type + * + * @note + * API Group: + * - Initialization: No + * - Run time: Yes + * - De-initialization: No + * + * @return nveu64_t value + */ +static inline nveu64_t osi_update_stats_counter(nveu64_t last_value, + nveu64_t incr) +{ + nveu64_t temp = last_value + incr; + + if (temp < last_value) { + /* Stats overflow, so reset it to zero */ + return 0UL; + } + + return temp; +} #endif /* OSI_COMMON_H */ diff --git a/include/osi_core.h b/include/osi_core.h index 04d2a52..289b298 100644 --- a/include/osi_core.h +++ b/include/osi_core.h @@ -23,9 +23,8 @@ #ifndef INCLUDED_OSI_CORE_H #define INCLUDED_OSI_CORE_H -#include "../osi/common/common.h" +#include #include "mmc.h" -#include "../osi/common/type.h" /** * @addtogroup typedef related info diff --git a/include/osi_dma.h b/include/osi_dma.h index f9d6df6..d365946 100644 --- a/include/osi_dma.h +++ b/include/osi_dma.h @@ -23,7 +23,7 @@ #ifndef INCLUDED_OSI_DMA_H #define INCLUDED_OSI_DMA_H -#include "../osi/common/common.h" +#include #include "osi_dma_txrx.h" /** diff --git a/osi/common/common.h b/osi/common/common.h index f13f357..0864669 100644 --- a/osi/common/common.h +++ b/osi/common/common.h @@ -22,6 +22,7 @@ #ifndef INCLUDED_COMMON_H #define INCLUDED_COMMON_H +#include "../osi/common/type.h" #include struct osi_core_priv_data; @@ -216,40 +217,6 @@ static inline nve32_t is_valid_mac_version(nveu32_t mac_ver) return 0; } -/** - * @brief osi_update_stats_counter - update value by increment passed - * as parameter - * - * @note - * Algorithm: - * - Check for boundary and return sum - * - * @param[in] last_value: last value of stat counter - * @param[in] incr: increment value - * - * @note Input parameter should be only nveu64_t type - * - * @note - * API Group: - * - Initialization: No - * - Run time: Yes - * - De-initialization: No - * - * @return nveu64_t value - */ -static inline nveu64_t osi_update_stats_counter(nveu64_t last_value, - nveu64_t incr) -{ - nveu64_t temp = last_value + incr; - - if (temp < last_value) { - /* Stats overflow, so reset it to zero */ - return 0UL; - } - - return temp; -} - /** * @brief osi_memset - osi memset * diff --git a/osi/common/include/local_common.h b/osi/common/include/local_common.h index 903af66..9251d95 100644 --- a/osi/common/include/local_common.h +++ b/osi/common/include/local_common.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -24,7 +24,6 @@ #define LOCAL_COMMON_H #include -#include "../osi/common/type.h" /** *@brief div_u64_rem - updates remainder and returns Quotient diff --git a/osi/core/ivc_core.c b/osi/core/ivc_core.c index 5614e84..30ee0b3 100644 --- a/osi/core/ivc_core.c +++ b/osi/core/ivc_core.c @@ -26,6 +26,7 @@ #include "eqos_core.h" #include "eqos_mmc.h" #include "core_local.h" +#include "../osi/common/common.h" /** * @brief ivc_safety_config - EQOS MAC core safety configuration diff --git a/osi/core/osi_core.c b/osi/core/osi_core.c index 6a0e7f6..52be9c0 100644 --- a/osi/core/osi_core.c +++ b/osi/core/osi_core.c @@ -23,6 +23,7 @@ #include #include #include "core_local.h" +#include "../osi/common/common.h" /** * @brief g_core - Static core local data variable diff --git a/osi/dma/osi_dma_txrx.c b/osi/dma/osi_dma_txrx.c index 7131cec..7a28171 100644 --- a/osi/dma/osi_dma_txrx.c +++ b/osi/dma/osi_dma_txrx.c @@ -24,6 +24,7 @@ #include #include "../osi/common/type.h" #include "hw_desc.h" +#include "../osi/common/common.h" /** * @brief get_rx_csum - Get the Rx checksum from descriptor if valid