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

Daniel Machon daniel.machon at microchip.com
Wed Oct 2 00:48:05 PDT 2024


> > 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 at microchip.com>
> > Reviewed-by: Steen Hegelund <Steen.Hegelund at microchip.com>
> > ---
> >  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.
>

Exactly :-)

/Daniel



More information about the linux-arm-kernel mailing list