[PATCH v2 2/3] common/sfc_efx/base: add FEC related macros

Denis Pryazhennikov denis.pryazhennikov at arknetworks.am
Thu Jun 15 10:38:46 CEST 2023


Added new macros to simplify working with FEC bits.

Signed-off-by: Denis Pryazhennikov <denis.pryazhennikov at arknetworks.am>
Reviewed-by: Andy Moreton <amoreton at xilinx.com>
Acked-by: Andrew Rybchenko <arybchenko at oktetlabs.ru>
---
 drivers/common/sfc_efx/base/efx.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/common/sfc_efx/base/efx.h b/drivers/common/sfc_efx/base/efx.h
index 49e29dcc1c69..10c412bcd7dc 100644
--- a/drivers/common/sfc_efx/base/efx.h
+++ b/drivers/common/sfc_efx/base/efx.h
@@ -3958,6 +3958,15 @@ typedef enum efx_phy_fec_type_e {
 	EFX_PHY_FEC_RS
 } efx_phy_fec_type_t;
 
+#define EFX_PHY_CAP_FEC_BIT(_fec_bit) (1U << EFX_PHY_CAP_##_fec_bit)
+#define EFX_PHY_CAP_FEC_MASK \
+	(EFX_PHY_CAP_FEC_BIT(BASER_FEC) |		\
+	 EFX_PHY_CAP_FEC_BIT(25G_BASER_FEC) |		\
+	 EFX_PHY_CAP_FEC_BIT(BASER_FEC_REQUESTED) |	\
+	 EFX_PHY_CAP_FEC_BIT(25G_BASER_FEC_REQUESTED) |	\
+	 EFX_PHY_CAP_FEC_BIT(RS_FEC) |			\
+	 EFX_PHY_CAP_FEC_BIT(RS_FEC_REQUESTED))
+
 LIBEFX_API
 extern	__checkReturn	efx_rc_t
 efx_phy_fec_type_get(
-- 
2.37.0 (Apple Git-136)



More information about the dev mailing list