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

Message ID 20230615083847.75590-3-denis.pryazhennikov@arknetworks.am (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net/sfc: support FEC feature |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Denis Pryazhennikov June 15, 2023, 8:38 a.m. UTC
  Added new macros to simplify working with FEC bits.

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

Comments

Ferruh Yigit June 20, 2023, 11:34 a.m. UTC | #1
On 6/15/2023 9:38 AM, Denis Pryazhennikov wrote:
> Added new macros to simplify working with FEC bits.
> 
> Signed-off-by: Denis Pryazhennikov <denis.pryazhennikov@arknetworks.am>
> Reviewed-by: Andy Moreton <amoreton@xilinx.com>
> Acked-by: Andrew Rybchenko <arybchenko@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(

will squash to commit 3/3 where actual functionality is added and these
macros are used.
  

Patch

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(