Skip to content

Commit

Permalink
net: dsa: rename switch EEE ops
Browse files Browse the repository at this point in the history
To avoid confusion with the PHY EEE settings, rename the .set_eee and
.get_eee ops to respectively .set_mac_eee and .get_mac_eee.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Vivien Didelot authored and David S. Miller committed Aug 2, 2017
1 parent 5480db6 commit 08f5006
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 26 deletions.
12 changes: 6 additions & 6 deletions drivers/net/dsa/bcm_sf2.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,8 @@ static int bcm_sf2_eee_init(struct dsa_switch *ds, int port,
return 1;
}

static int bcm_sf2_sw_get_eee(struct dsa_switch *ds, int port,
struct ethtool_eee *e)
static int bcm_sf2_sw_get_mac_eee(struct dsa_switch *ds, int port,
struct ethtool_eee *e)
{
struct bcm_sf2_priv *priv = bcm_sf2_to_priv(ds);
struct ethtool_eee *p = &priv->port_sts[port].eee;
Expand All @@ -352,8 +352,8 @@ static int bcm_sf2_sw_get_eee(struct dsa_switch *ds, int port,
return 0;
}

static int bcm_sf2_sw_set_eee(struct dsa_switch *ds, int port,
struct ethtool_eee *e)
static int bcm_sf2_sw_set_mac_eee(struct dsa_switch *ds, int port,
struct ethtool_eee *e)
{
struct bcm_sf2_priv *priv = bcm_sf2_to_priv(ds);
struct ethtool_eee *p = &priv->port_sts[port].eee;
Expand Down Expand Up @@ -1011,8 +1011,8 @@ static const struct dsa_switch_ops bcm_sf2_ops = {
.set_wol = bcm_sf2_sw_set_wol,
.port_enable = bcm_sf2_port_setup,
.port_disable = bcm_sf2_port_disable,
.get_eee = bcm_sf2_sw_get_eee,
.set_eee = bcm_sf2_sw_set_eee,
.get_mac_eee = bcm_sf2_sw_get_mac_eee,
.set_mac_eee = bcm_sf2_sw_set_mac_eee,
.port_bridge_join = b53_br_join,
.port_bridge_leave = b53_br_leave,
.port_stp_state_set = b53_br_set_stp_state,
Expand Down
12 changes: 6 additions & 6 deletions drivers/net/dsa/mv88e6xxx/chip.c
Original file line number Diff line number Diff line change
Expand Up @@ -810,15 +810,15 @@ static void mv88e6xxx_get_regs(struct dsa_switch *ds, int port,
mutex_unlock(&chip->reg_lock);
}

static int mv88e6xxx_get_eee(struct dsa_switch *ds, int port,
struct ethtool_eee *e)
static int mv88e6xxx_get_mac_eee(struct dsa_switch *ds, int port,
struct ethtool_eee *e)
{
/* Nothing to do on the port's MAC */
return 0;
}

static int mv88e6xxx_set_eee(struct dsa_switch *ds, int port,
struct ethtool_eee *e)
static int mv88e6xxx_set_mac_eee(struct dsa_switch *ds, int port,
struct ethtool_eee *e)
{
/* Nothing to do on the port's MAC */
return 0;
Expand Down Expand Up @@ -3890,8 +3890,8 @@ static const struct dsa_switch_ops mv88e6xxx_switch_ops = {
.get_sset_count = mv88e6xxx_get_sset_count,
.port_enable = mv88e6xxx_port_enable,
.port_disable = mv88e6xxx_port_disable,
.set_eee = mv88e6xxx_set_eee,
.get_eee = mv88e6xxx_get_eee,
.get_mac_eee = mv88e6xxx_get_mac_eee,
.set_mac_eee = mv88e6xxx_set_mac_eee,
.get_eeprom_len = mv88e6xxx_get_eeprom_len,
.get_eeprom = mv88e6xxx_get_eeprom,
.set_eeprom = mv88e6xxx_set_eeprom,
Expand Down
9 changes: 4 additions & 5 deletions drivers/net/dsa/qca8k.c
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ qca8k_get_sset_count(struct dsa_switch *ds)
}

static int
qca8k_set_eee(struct dsa_switch *ds, int port, struct ethtool_eee *eee)
qca8k_set_mac_eee(struct dsa_switch *ds, int port, struct ethtool_eee *eee)
{
struct qca8k_priv *priv = (struct qca8k_priv *)ds->priv;
u32 lpi_en = QCA8K_REG_EEE_CTRL_LPI_EN(port);
Expand All @@ -657,8 +657,7 @@ qca8k_set_eee(struct dsa_switch *ds, int port, struct ethtool_eee *eee)
}

static int
qca8k_get_eee(struct dsa_switch *ds, int port,
struct ethtool_eee *e)
qca8k_get_mac_eee(struct dsa_switch *ds, int port, struct ethtool_eee *e)
{
/* Nothing to do on the port's MAC */
return 0;
Expand Down Expand Up @@ -863,8 +862,8 @@ static const struct dsa_switch_ops qca8k_switch_ops = {
.phy_write = qca8k_phy_write,
.get_ethtool_stats = qca8k_get_ethtool_stats,
.get_sset_count = qca8k_get_sset_count,
.get_eee = qca8k_get_eee,
.set_eee = qca8k_set_eee,
.get_mac_eee = qca8k_get_mac_eee,
.set_mac_eee = qca8k_set_mac_eee,
.port_enable = qca8k_port_enable,
.port_disable = qca8k_port_disable,
.port_stp_state_set = qca8k_port_stp_state_set,
Expand Down
10 changes: 5 additions & 5 deletions include/net/dsa.h
Original file line number Diff line number Diff line change
Expand Up @@ -332,12 +332,12 @@ struct dsa_switch_ops {
struct phy_device *phy);

/*
* EEE setttings
* Port's MAC EEE settings
*/
int (*set_eee)(struct dsa_switch *ds, int port,
struct ethtool_eee *e);
int (*get_eee)(struct dsa_switch *ds, int port,
struct ethtool_eee *e);
int (*set_mac_eee)(struct dsa_switch *ds, int port,
struct ethtool_eee *e);
int (*get_mac_eee)(struct dsa_switch *ds, int port,
struct ethtool_eee *e);

/* EEPROM access */
int (*get_eeprom_len)(struct dsa_switch *ds);
Expand Down
8 changes: 4 additions & 4 deletions net/dsa/slave.c
Original file line number Diff line number Diff line change
Expand Up @@ -652,10 +652,10 @@ static int dsa_slave_set_eee(struct net_device *dev, struct ethtool_eee *e)
if (!p->phy)
return -ENODEV;

if (!ds->ops->set_eee)
if (!ds->ops->set_mac_eee)
return -EOPNOTSUPP;

ret = ds->ops->set_eee(ds, p->dp->index, e);
ret = ds->ops->set_mac_eee(ds, p->dp->index, e);
if (ret)
return ret;

Expand All @@ -678,10 +678,10 @@ static int dsa_slave_get_eee(struct net_device *dev, struct ethtool_eee *e)
if (!p->phy)
return -ENODEV;

if (!ds->ops->get_eee)
if (!ds->ops->get_mac_eee)
return -EOPNOTSUPP;

ret = ds->ops->get_eee(ds, p->dp->index, e);
ret = ds->ops->get_mac_eee(ds, p->dp->index, e);
if (ret)
return ret;

Expand Down

0 comments on commit 08f5006

Please sign in to comment.