Re: [PATCH net-next 10/15] net: sparx5: ops out chip port to device index/bit functions

From: Jacob Keller
Date: Tue Oct 01 2024 - 14:00:38 EST




On 10/1/2024 6:50 AM, Daniel Machon wrote:
> The chip port device index and mode bit can be obtained using the port
> number. However the mapping of port number to chip device index and
> mode bit differs on Sparx5 and lan969x. Therefore ops out the function.
>
> Signed-off-by: Daniel Machon <daniel.machon@xxxxxxxxxxxxx>
> Reviewed-by: Steen Hegelund <Steen.Hegelund@xxxxxxxxxxxxx>
> ---
> drivers/net/ethernet/microchip/sparx5/sparx5_main.c | 2 ++
> drivers/net/ethernet/microchip/sparx5/sparx5_main.h | 2 ++
> drivers/net/ethernet/microchip/sparx5/sparx5_port.c | 4 +++-
> drivers/net/ethernet/microchip/sparx5/sparx5_port.h | 7 ++++++-
> 4 files changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
> index 8b1033c49cfe..8617fc3983cc 100644
> --- a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
> +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
> @@ -982,6 +982,8 @@ static const struct sparx5_ops sparx5_ops = {
> .is_port_5g = &sparx5_port_is_5g,
> .is_port_10g = &sparx5_port_is_10g,
> .is_port_25g = &sparx5_port_is_25g,
> + .get_port_dev_index = &sparx5_port_dev_mapping,
> + .get_port_dev_bit = &sparx5_port_dev_mapping,

So for sparx5, these are identical operations, but for lan969x these
will be different? Ok.