net: dsa: qca8k: 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 qca8k to "lag_dev". Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
e23eba7228
commit
066ce9779c
|
@ -2647,17 +2647,17 @@ qca8k_get_tag_protocol(struct dsa_switch *ds, int port,
|
|||
|
||||
static bool
|
||||
qca8k_lag_can_offload(struct dsa_switch *ds,
|
||||
struct net_device *lag,
|
||||
struct net_device *lag_dev,
|
||||
struct netdev_lag_upper_info *info)
|
||||
{
|
||||
struct dsa_port *dp;
|
||||
int id, members = 0;
|
||||
|
||||
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++;
|
||||
|
||||
|
@ -2676,7 +2676,7 @@ qca8k_lag_can_offload(struct dsa_switch *ds,
|
|||
|
||||
static int
|
||||
qca8k_lag_setup_hash(struct dsa_switch *ds,
|
||||
struct net_device *lag,
|
||||
struct net_device *lag_dev,
|
||||
struct netdev_lag_upper_info *info)
|
||||
{
|
||||
struct qca8k_priv *priv = ds->priv;
|
||||
|
@ -2684,7 +2684,7 @@ qca8k_lag_setup_hash(struct dsa_switch *ds,
|
|||
u32 hash = 0;
|
||||
int i, id;
|
||||
|
||||
id = dsa_lag_id(ds->dst, lag);
|
||||
id = dsa_lag_id(ds->dst, lag_dev);
|
||||
|
||||
switch (info->hash_type) {
|
||||
case NETDEV_LAG_HASH_L23:
|
||||
|
@ -2716,7 +2716,7 @@ qca8k_lag_setup_hash(struct dsa_switch *ds,
|
|||
if (unique_lag) {
|
||||
priv->lag_hash_mode = hash;
|
||||
} else if (priv->lag_hash_mode != hash) {
|
||||
netdev_err(lag, "Error: Mismatched Hash Mode across different lag is not supported\n");
|
||||
netdev_err(lag_dev, "Error: Mismatched Hash Mode across different lag is not supported\n");
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
|
@ -2726,13 +2726,13 @@ qca8k_lag_setup_hash(struct dsa_switch *ds,
|
|||
|
||||
static int
|
||||
qca8k_lag_refresh_portmap(struct dsa_switch *ds, int port,
|
||||
struct net_device *lag, bool delete)
|
||||
struct net_device *lag_dev, bool delete)
|
||||
{
|
||||
struct qca8k_priv *priv = ds->priv;
|
||||
int ret, id, i;
|
||||
u32 val;
|
||||
|
||||
id = dsa_lag_id(ds->dst, lag);
|
||||
id = dsa_lag_id(ds->dst, lag_dev);
|
||||
|
||||
/* Read current port member */
|
||||
ret = regmap_read(priv->regmap, QCA8K_REG_GOL_TRUNK_CTRL0, &val);
|
||||
|
@ -2795,26 +2795,26 @@ qca8k_lag_refresh_portmap(struct dsa_switch *ds, int port,
|
|||
|
||||
static int
|
||||
qca8k_port_lag_join(struct dsa_switch *ds, int port,
|
||||
struct net_device *lag,
|
||||
struct net_device *lag_dev,
|
||||
struct netdev_lag_upper_info *info)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (!qca8k_lag_can_offload(ds, lag, info))
|
||||
if (!qca8k_lag_can_offload(ds, lag_dev, info))
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
ret = qca8k_lag_setup_hash(ds, lag, info);
|
||||
ret = qca8k_lag_setup_hash(ds, lag_dev, info);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
return qca8k_lag_refresh_portmap(ds, port, lag, false);
|
||||
return qca8k_lag_refresh_portmap(ds, port, lag_dev, false);
|
||||
}
|
||||
|
||||
static int
|
||||
qca8k_port_lag_leave(struct dsa_switch *ds, int port,
|
||||
struct net_device *lag)
|
||||
struct net_device *lag_dev)
|
||||
{
|
||||
return qca8k_lag_refresh_portmap(ds, port, lag, true);
|
||||
return qca8k_lag_refresh_portmap(ds, port, lag_dev, true);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in New Issue