struct ethtool_eee *p = &priv->port_sts[port].eee;
p->eee_enabled = e->eee_enabled;
-
- if (!p->eee_enabled) {
- bcm_sf2_eee_enable_set(ds, port, false);
- } else {
- p->eee_enabled = bcm_sf2_eee_init(ds, port, phydev);
- if (!p->eee_enabled)
- return -EOPNOTSUPP;
- }
+ bcm_sf2_eee_enable_set(ds, port, e->eee_enabled);
return 0;
}
struct mv88e6xxx_chip *chip = ds->priv;
int err;
- if (e->eee_enabled) {
- err = phy_init_eee(phydev, 0);
- if (err)
- return err;
- }
-
mutex_lock(&chip->reg_lock);
err = mv88e6xxx_energy_detect_write(chip, port, e);
mutex_unlock(&chip->reg_lock);
mutex_unlock(&priv->reg_mutex);
}
-static int
-qca8k_eee_init(struct dsa_switch *ds, int port,
- struct phy_device *phy)
-{
- int ret;
-
- ret = phy_init_eee(phy, 0);
- if (ret)
- return 0;
-
- qca8k_eee_enable_set(ds, port, true);
-
- return 1;
-}
-
static int
qca8k_set_eee(struct dsa_switch *ds, int port,
struct phy_device *phydev,
struct ethtool_eee *e)
{
- struct qca8k_priv *priv = (struct qca8k_priv *)ds->priv;
- struct ethtool_eee *p = &priv->port_sts[port].eee;
- int ret = 0;
+ qca8k_eee_enable_set(ds, port, e->eee_enabled);
- p->eee_enabled = e->eee_enabled;
-
- if (!p->eee_enabled) {
- qca8k_eee_enable_set(ds, port, false);
- } else {
- p->eee_enabled = qca8k_eee_init(ds, port, phydev);
- if (!p->eee_enabled)
- ret = -EOPNOTSUPP;
- }
-
- return ret;
+ return 0;
}
static int