Commit e23eba72 authored by Vladimir Oltean's avatar Vladimir Oltean Committed by Jakub Kicinski

net: dsa: mv88e6xxx: rename references to "lag" as "lag_dev"

In preparation of converting struct net_device *dp->lag_dev into a
struct dsa_lag *dp->lag, we need to rename, for consistency purposes,
all occurrences of the "lag" variable in mv88e6xxx to "lag_dev".
Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 46a76724
...@@ -6175,7 +6175,7 @@ static int mv88e6xxx_port_bridge_flags(struct dsa_switch *ds, int port, ...@@ -6175,7 +6175,7 @@ static int mv88e6xxx_port_bridge_flags(struct dsa_switch *ds, int port,
} }
static bool mv88e6xxx_lag_can_offload(struct dsa_switch *ds, static bool mv88e6xxx_lag_can_offload(struct dsa_switch *ds,
struct net_device *lag, struct net_device *lag_dev,
struct netdev_lag_upper_info *info) struct netdev_lag_upper_info *info)
{ {
struct mv88e6xxx_chip *chip = ds->priv; struct mv88e6xxx_chip *chip = ds->priv;
...@@ -6185,11 +6185,11 @@ static bool mv88e6xxx_lag_can_offload(struct dsa_switch *ds, ...@@ -6185,11 +6185,11 @@ static bool mv88e6xxx_lag_can_offload(struct dsa_switch *ds,
if (!mv88e6xxx_has_lag(chip)) if (!mv88e6xxx_has_lag(chip))
return false; return false;
id = dsa_lag_id(ds->dst, lag); id = dsa_lag_id(ds->dst, lag_dev);
if (id < 0 || id >= ds->num_lag_ids) if (id < 0 || id >= ds->num_lag_ids)
return false; return false;
dsa_lag_foreach_port(dp, ds->dst, lag) dsa_lag_foreach_port(dp, ds->dst, lag_dev)
/* Includes the port joining the LAG */ /* Includes the port joining the LAG */
members++; members++;
...@@ -6209,20 +6209,21 @@ static bool mv88e6xxx_lag_can_offload(struct dsa_switch *ds, ...@@ -6209,20 +6209,21 @@ static bool mv88e6xxx_lag_can_offload(struct dsa_switch *ds,
return true; return true;
} }
static int mv88e6xxx_lag_sync_map(struct dsa_switch *ds, struct net_device *lag) static int mv88e6xxx_lag_sync_map(struct dsa_switch *ds,
struct net_device *lag_dev)
{ {
struct mv88e6xxx_chip *chip = ds->priv; struct mv88e6xxx_chip *chip = ds->priv;
struct dsa_port *dp; struct dsa_port *dp;
u16 map = 0; u16 map = 0;
int id; int id;
id = dsa_lag_id(ds->dst, lag); id = dsa_lag_id(ds->dst, lag_dev);
/* Build the map of all ports to distribute flows destined for /* Build the map of all ports to distribute flows destined for
* this LAG. This can be either a local user port, or a DSA * this LAG. This can be either a local user port, or a DSA
* port if the LAG port is on a remote chip. * port if the LAG port is on a remote chip.
*/ */
dsa_lag_foreach_port(dp, ds->dst, lag) dsa_lag_foreach_port(dp, ds->dst, lag_dev)
map |= BIT(dsa_towards_port(ds, dp->ds->index, dp->index)); map |= BIT(dsa_towards_port(ds, dp->ds->index, dp->index));
return mv88e6xxx_g2_trunk_mapping_write(chip, id, map); return mv88e6xxx_g2_trunk_mapping_write(chip, id, map);
...@@ -6266,8 +6267,8 @@ static void mv88e6xxx_lag_set_port_mask(u16 *mask, int port, ...@@ -6266,8 +6267,8 @@ static void mv88e6xxx_lag_set_port_mask(u16 *mask, int port,
static int mv88e6xxx_lag_sync_masks(struct dsa_switch *ds) static int mv88e6xxx_lag_sync_masks(struct dsa_switch *ds)
{ {
struct mv88e6xxx_chip *chip = ds->priv; struct mv88e6xxx_chip *chip = ds->priv;
struct net_device *lag_dev;
unsigned int id, num_tx; unsigned int id, num_tx;
struct net_device *lag;
struct dsa_port *dp; struct dsa_port *dp;
int i, err, nth; int i, err, nth;
u16 mask[8]; u16 mask[8];
...@@ -6291,12 +6292,12 @@ static int mv88e6xxx_lag_sync_masks(struct dsa_switch *ds) ...@@ -6291,12 +6292,12 @@ static int mv88e6xxx_lag_sync_masks(struct dsa_switch *ds)
* are in the Tx set. * are in the Tx set.
*/ */
dsa_lags_foreach_id(id, ds->dst) { dsa_lags_foreach_id(id, ds->dst) {
lag = dsa_lag_dev(ds->dst, id); lag_dev = dsa_lag_dev(ds->dst, id);
if (!lag) if (!lag_dev)
continue; continue;
num_tx = 0; num_tx = 0;
dsa_lag_foreach_port(dp, ds->dst, lag) { dsa_lag_foreach_port(dp, ds->dst, lag_dev) {
if (dp->lag_tx_enabled) if (dp->lag_tx_enabled)
num_tx++; num_tx++;
} }
...@@ -6305,7 +6306,7 @@ static int mv88e6xxx_lag_sync_masks(struct dsa_switch *ds) ...@@ -6305,7 +6306,7 @@ static int mv88e6xxx_lag_sync_masks(struct dsa_switch *ds)
continue; continue;
nth = 0; nth = 0;
dsa_lag_foreach_port(dp, ds->dst, lag) { dsa_lag_foreach_port(dp, ds->dst, lag_dev) {
if (!dp->lag_tx_enabled) if (!dp->lag_tx_enabled)
continue; continue;
...@@ -6327,14 +6328,14 @@ static int mv88e6xxx_lag_sync_masks(struct dsa_switch *ds) ...@@ -6327,14 +6328,14 @@ static int mv88e6xxx_lag_sync_masks(struct dsa_switch *ds)
} }
static int mv88e6xxx_lag_sync_masks_map(struct dsa_switch *ds, static int mv88e6xxx_lag_sync_masks_map(struct dsa_switch *ds,
struct net_device *lag) struct net_device *lag_dev)
{ {
int err; int err;
err = mv88e6xxx_lag_sync_masks(ds); err = mv88e6xxx_lag_sync_masks(ds);
if (!err) if (!err)
err = mv88e6xxx_lag_sync_map(ds, lag); err = mv88e6xxx_lag_sync_map(ds, lag_dev);
return err; return err;
} }
...@@ -6351,16 +6352,16 @@ static int mv88e6xxx_port_lag_change(struct dsa_switch *ds, int port) ...@@ -6351,16 +6352,16 @@ static int mv88e6xxx_port_lag_change(struct dsa_switch *ds, int port)
} }
static int mv88e6xxx_port_lag_join(struct dsa_switch *ds, int port, static int mv88e6xxx_port_lag_join(struct dsa_switch *ds, int port,
struct net_device *lag, struct net_device *lag_dev,
struct netdev_lag_upper_info *info) struct netdev_lag_upper_info *info)
{ {
struct mv88e6xxx_chip *chip = ds->priv; struct mv88e6xxx_chip *chip = ds->priv;
int err, id; int err, id;
if (!mv88e6xxx_lag_can_offload(ds, lag, info)) if (!mv88e6xxx_lag_can_offload(ds, lag_dev, info))
return -EOPNOTSUPP; return -EOPNOTSUPP;
id = dsa_lag_id(ds->dst, lag); id = dsa_lag_id(ds->dst, lag_dev);
mv88e6xxx_reg_lock(chip); mv88e6xxx_reg_lock(chip);
...@@ -6368,7 +6369,7 @@ static int mv88e6xxx_port_lag_join(struct dsa_switch *ds, int port, ...@@ -6368,7 +6369,7 @@ static int mv88e6xxx_port_lag_join(struct dsa_switch *ds, int port,
if (err) if (err)
goto err_unlock; goto err_unlock;
err = mv88e6xxx_lag_sync_masks_map(ds, lag); err = mv88e6xxx_lag_sync_masks_map(ds, lag_dev);
if (err) if (err)
goto err_clear_trunk; goto err_clear_trunk;
...@@ -6383,13 +6384,13 @@ static int mv88e6xxx_port_lag_join(struct dsa_switch *ds, int port, ...@@ -6383,13 +6384,13 @@ static int mv88e6xxx_port_lag_join(struct dsa_switch *ds, int port,
} }
static int mv88e6xxx_port_lag_leave(struct dsa_switch *ds, int port, static int mv88e6xxx_port_lag_leave(struct dsa_switch *ds, int port,
struct net_device *lag) struct net_device *lag_dev)
{ {
struct mv88e6xxx_chip *chip = ds->priv; struct mv88e6xxx_chip *chip = ds->priv;
int err_sync, err_trunk; int err_sync, err_trunk;
mv88e6xxx_reg_lock(chip); mv88e6xxx_reg_lock(chip);
err_sync = mv88e6xxx_lag_sync_masks_map(ds, lag); err_sync = mv88e6xxx_lag_sync_masks_map(ds, lag_dev);
err_trunk = mv88e6xxx_port_set_trunk(chip, port, false, 0); err_trunk = mv88e6xxx_port_set_trunk(chip, port, false, 0);
mv88e6xxx_reg_unlock(chip); mv88e6xxx_reg_unlock(chip);
return err_sync ? : err_trunk; return err_sync ? : err_trunk;
...@@ -6408,18 +6409,18 @@ static int mv88e6xxx_crosschip_lag_change(struct dsa_switch *ds, int sw_index, ...@@ -6408,18 +6409,18 @@ static int mv88e6xxx_crosschip_lag_change(struct dsa_switch *ds, int sw_index,
} }
static int mv88e6xxx_crosschip_lag_join(struct dsa_switch *ds, int sw_index, static int mv88e6xxx_crosschip_lag_join(struct dsa_switch *ds, int sw_index,
int port, struct net_device *lag, int port, struct net_device *lag_dev,
struct netdev_lag_upper_info *info) struct netdev_lag_upper_info *info)
{ {
struct mv88e6xxx_chip *chip = ds->priv; struct mv88e6xxx_chip *chip = ds->priv;
int err; int err;
if (!mv88e6xxx_lag_can_offload(ds, lag, info)) if (!mv88e6xxx_lag_can_offload(ds, lag_dev, info))
return -EOPNOTSUPP; return -EOPNOTSUPP;
mv88e6xxx_reg_lock(chip); mv88e6xxx_reg_lock(chip);
err = mv88e6xxx_lag_sync_masks_map(ds, lag); err = mv88e6xxx_lag_sync_masks_map(ds, lag_dev);
if (err) if (err)
goto unlock; goto unlock;
...@@ -6431,13 +6432,13 @@ static int mv88e6xxx_crosschip_lag_join(struct dsa_switch *ds, int sw_index, ...@@ -6431,13 +6432,13 @@ static int mv88e6xxx_crosschip_lag_join(struct dsa_switch *ds, int sw_index,
} }
static int mv88e6xxx_crosschip_lag_leave(struct dsa_switch *ds, int sw_index, static int mv88e6xxx_crosschip_lag_leave(struct dsa_switch *ds, int sw_index,
int port, struct net_device *lag) int port, struct net_device *lag_dev)
{ {
struct mv88e6xxx_chip *chip = ds->priv; struct mv88e6xxx_chip *chip = ds->priv;
int err_sync, err_pvt; int err_sync, err_pvt;
mv88e6xxx_reg_lock(chip); mv88e6xxx_reg_lock(chip);
err_sync = mv88e6xxx_lag_sync_masks_map(ds, lag); err_sync = mv88e6xxx_lag_sync_masks_map(ds, lag_dev);
err_pvt = mv88e6xxx_pvt_map(chip, sw_index, port); err_pvt = mv88e6xxx_pvt_map(chip, sw_index, port);
mv88e6xxx_reg_unlock(chip); mv88e6xxx_reg_unlock(chip);
return err_sync ? : err_pvt; return err_sync ? : err_pvt;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment