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,
}
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 mv88e6xxx_chip *chip = ds->priv;
......@@ -6185,11 +6185,11 @@ static bool mv88e6xxx_lag_can_offload(struct dsa_switch *ds,
if (!mv88e6xxx_has_lag(chip))
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)
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 */
members++;
......@@ -6209,20 +6209,21 @@ static bool mv88e6xxx_lag_can_offload(struct dsa_switch *ds,
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 dsa_port *dp;
u16 map = 0;
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
* this LAG. This can be either a local user port, or a DSA
* 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));
return mv88e6xxx_g2_trunk_mapping_write(chip, id, map);
......@@ -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)
{
struct mv88e6xxx_chip *chip = ds->priv;
struct net_device *lag_dev;
unsigned int id, num_tx;
struct net_device *lag;
struct dsa_port *dp;
int i, err, nth;
u16 mask[8];
......@@ -6291,12 +6292,12 @@ static int mv88e6xxx_lag_sync_masks(struct dsa_switch *ds)
* are in the Tx set.
*/
dsa_lags_foreach_id(id, ds->dst) {
lag = dsa_lag_dev(ds->dst, id);
if (!lag)
lag_dev = dsa_lag_dev(ds->dst, id);
if (!lag_dev)
continue;
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)
num_tx++;
}
......@@ -6305,7 +6306,7 @@ static int mv88e6xxx_lag_sync_masks(struct dsa_switch *ds)
continue;
nth = 0;
dsa_lag_foreach_port(dp, ds->dst, lag) {
dsa_lag_foreach_port(dp, ds->dst, lag_dev) {
if (!dp->lag_tx_enabled)
continue;
......@@ -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,
struct net_device *lag)
struct net_device *lag_dev)
{
int err;
err = mv88e6xxx_lag_sync_masks(ds);
if (!err)
err = mv88e6xxx_lag_sync_map(ds, lag);
err = mv88e6xxx_lag_sync_map(ds, lag_dev);
return err;
}
......@@ -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,
struct net_device *lag,
struct net_device *lag_dev,
struct netdev_lag_upper_info *info)
{
struct mv88e6xxx_chip *chip = ds->priv;
int err, id;
if (!mv88e6xxx_lag_can_offload(ds, lag, info))
if (!mv88e6xxx_lag_can_offload(ds, lag_dev, info))
return -EOPNOTSUPP;
id = dsa_lag_id(ds->dst, lag);
id = dsa_lag_id(ds->dst, lag_dev);
mv88e6xxx_reg_lock(chip);
......@@ -6368,7 +6369,7 @@ static int mv88e6xxx_port_lag_join(struct dsa_switch *ds, int port,
if (err)
goto err_unlock;
err = mv88e6xxx_lag_sync_masks_map(ds, lag);
err = mv88e6xxx_lag_sync_masks_map(ds, lag_dev);
if (err)
goto err_clear_trunk;
......@@ -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,
struct net_device *lag)
struct net_device *lag_dev)
{
struct mv88e6xxx_chip *chip = ds->priv;
int err_sync, err_trunk;
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);
mv88e6xxx_reg_unlock(chip);
return err_sync ? : err_trunk;
......@@ -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,
int port, struct net_device *lag,
int port, struct net_device *lag_dev,
struct netdev_lag_upper_info *info)
{
struct mv88e6xxx_chip *chip = ds->priv;
int err;
if (!mv88e6xxx_lag_can_offload(ds, lag, info))
if (!mv88e6xxx_lag_can_offload(ds, lag_dev, info))
return -EOPNOTSUPP;
mv88e6xxx_reg_lock(chip);
err = mv88e6xxx_lag_sync_masks_map(ds, lag);
err = mv88e6xxx_lag_sync_masks_map(ds, lag_dev);
if (err)
goto unlock;
......@@ -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,
int port, struct net_device *lag)
int port, struct net_device *lag_dev)
{
struct mv88e6xxx_chip *chip = ds->priv;
int err_sync, err_pvt;
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);
mv88e6xxx_reg_unlock(chip);
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