diff options
author | David S. Miller <davem@davemloft.net> | 2019-10-31 14:26:38 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-10-31 14:26:38 -0700 |
commit | e43ea83cc78604b4eb02d5917f50a8b8eb6c0c85 (patch) | |
tree | 7f47ea748cbfa8ca1e207a954322c590d5ec9404 /drivers/net/dsa/mv88e6xxx/chip.c | |
parent | 5c26c1d6dffaae126b98ee27feba6e8042cc619d (diff) | |
parent | fcee85f19f39d1b98b2674c2a9e57348fe803252 (diff) |
Merge branch 'net-dsa-replace-routing-tables-with-a-list'
Vivien Didelot says:
====================
net: dsa: replace routing tables with a list
This branch gets rid of the ds->rtable static arrays in favor of
a single dst->rtable list. This allows us to move away from the
DSA_MAX_SWITCHES limitation and simplify the switch fabric setup.
Changes in v2:
- fix the reverse christmas for David
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/mv88e6xxx/chip.c')
-rw-r--r-- | drivers/net/dsa/mv88e6xxx/chip.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index 619cd081339e..66de492117ad 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -1143,6 +1143,7 @@ static int mv88e6xxx_pri_setup(struct mv88e6xxx_chip *chip) static int mv88e6xxx_devmap_setup(struct mv88e6xxx_chip *chip) { + struct dsa_switch *ds = chip->ds; int target, port; int err; @@ -1151,10 +1152,9 @@ static int mv88e6xxx_devmap_setup(struct mv88e6xxx_chip *chip) /* Initialize the routing port to the 32 possible target devices */ for (target = 0; target < 32; target++) { - port = 0x1f; - if (target < DSA_MAX_SWITCHES) - if (chip->ds->rtable[target] != DSA_RTABLE_NONE) - port = chip->ds->rtable[target]; + port = dsa_routing_port(ds, target); + if (port == ds->num_ports) + port = 0x1f; err = mv88e6xxx_g2_device_mapping_write(chip, target, port); if (err) |