[v2,2/3] common/sfc_efx/base: add FEC related macros
Checks
Commit Message
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
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.
@@ -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(