diff options
author | Daniel Machon <daniel.machon@microchip.com> | 2024-10-04 16:19:41 +0300 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2024-10-08 13:07:02 +0300 |
commit | 8cc4102363c76ed734cf030e6389d423e884edf1 (patch) | |
tree | 4f3784dbec37f1ebf1f34780b641ff4e48c44d25 /drivers/net/ethernet/microchip/sparx5/sparx5_fdma.c | |
parent | 4b67bcb9094e74890483e55ea2aaf2d57c4df843 (diff) | |
download | linux-8cc4102363c76ed734cf030e6389d423e884edf1.tar.xz |
net: sparx5: redefine internal ports and PGID's as offsets
Internal ports and PGID's are both defined relative to the number of
front ports on Sparx5. This will not work on lan969x. Instead make them
offsets to the number of front ports and add two helpers to retrieve
them. Use the helpers throughout.
Reviewed-by: Steen Hegelund <Steen.Hegelund@microchip.com>
Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'drivers/net/ethernet/microchip/sparx5/sparx5_fdma.c')
-rw-r--r-- | drivers/net/ethernet/microchip/sparx5/sparx5_fdma.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_fdma.c b/drivers/net/ethernet/microchip/sparx5/sparx5_fdma.c index 4919719da0cb..88f7509f0980 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_fdma.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_fdma.c @@ -364,7 +364,9 @@ static void sparx5_fdma_injection_mode(struct sparx5 *sparx5) sparx5, QS_INJ_GRP_CFG(INJ_QUEUE)); /* CPU ports capture setup */ - for (portno = SPX5_PORT_CPU_0; portno <= SPX5_PORT_CPU_1; portno++) { + for (portno = sparx5_get_internal_port(sparx5, SPX5_PORT_CPU_0); + portno <= sparx5_get_internal_port(sparx5, SPX5_PORT_CPU_1); + portno++) { /* ASM CPU port: No preamble, IFH, enable padding */ spx5_wr(ASM_PORT_CFG_PAD_ENA_SET(1) | ASM_PORT_CFG_NO_PREAMBLE_ENA_SET(1) | |