mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-05 14:40:12 -04:00
Merge branch 'net-dsa-cleanup-eee-part-2'
Russell King says: ==================== net: dsa: cleanup EEE (part 2) This is part 2 of the DSA EEE cleanups, removing what has become dead code as a result of the EEE management phylib now does. Patch 1 removes the useless setting of tx_lpi parameters in the ksz driver. Patch 2 does the same for mt753x. Patch 3 removes the DSA core code that calls the get_mac_eee() operation. This needs to be done before removing the implementations because doing otherwise would cause dsa_user_get_eee() to return -EOPNOTSUPP. Patches 4..8 remove the trivial get_mac_eee() implementations from DSA drivers. Patch 9 finally removes the get_mac_eee() method from struct dsa_switch_ops. ==================== Link: https://patch.msgid.link/Z3vDwwsHSxH5D6Pm@shell.armlinux.org.uk Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
@@ -2232,12 +2232,6 @@ bool b53_support_eee(struct dsa_switch *ds, int port)
|
||||
}
|
||||
EXPORT_SYMBOL(b53_support_eee);
|
||||
|
||||
int b53_get_mac_eee(struct dsa_switch *ds, int port, struct ethtool_keee *e)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(b53_get_mac_eee);
|
||||
|
||||
int b53_set_mac_eee(struct dsa_switch *ds, int port, struct ethtool_keee *e)
|
||||
{
|
||||
struct b53_device *dev = ds->priv;
|
||||
@@ -2299,7 +2293,6 @@ static const struct dsa_switch_ops b53_switch_ops = {
|
||||
.port_enable = b53_enable_port,
|
||||
.port_disable = b53_disable_port,
|
||||
.support_eee = b53_support_eee,
|
||||
.get_mac_eee = b53_get_mac_eee,
|
||||
.set_mac_eee = b53_set_mac_eee,
|
||||
.port_bridge_join = b53_br_join,
|
||||
.port_bridge_leave = b53_br_leave,
|
||||
|
||||
@@ -385,7 +385,6 @@ void b53_disable_port(struct dsa_switch *ds, int port);
|
||||
void b53_brcm_hdr_setup(struct dsa_switch *ds, int port);
|
||||
int b53_eee_init(struct dsa_switch *ds, int port, struct phy_device *phy);
|
||||
bool b53_support_eee(struct dsa_switch *ds, int port);
|
||||
int b53_get_mac_eee(struct dsa_switch *ds, int port, struct ethtool_keee *e);
|
||||
int b53_set_mac_eee(struct dsa_switch *ds, int port, struct ethtool_keee *e);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1233,7 +1233,6 @@ static const struct dsa_switch_ops bcm_sf2_ops = {
|
||||
.port_enable = bcm_sf2_port_setup,
|
||||
.port_disable = bcm_sf2_port_disable,
|
||||
.support_eee = b53_support_eee,
|
||||
.get_mac_eee = b53_get_mac_eee,
|
||||
.set_mac_eee = b53_set_mac_eee,
|
||||
.port_bridge_join = b53_br_join,
|
||||
.port_bridge_leave = b53_br_leave,
|
||||
|
||||
@@ -3489,20 +3489,6 @@ static bool ksz_support_eee(struct dsa_switch *ds, int port)
|
||||
return false;
|
||||
}
|
||||
|
||||
static int ksz_get_mac_eee(struct dsa_switch *ds, int port,
|
||||
struct ethtool_keee *e)
|
||||
{
|
||||
/* There is no documented control of Tx LPI configuration. */
|
||||
e->tx_lpi_enabled = true;
|
||||
|
||||
/* There is no documented control of Tx LPI timer. According to tests
|
||||
* Tx LPI timer seems to be set by default to minimal value.
|
||||
*/
|
||||
e->tx_lpi_timer = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ksz_set_mac_eee(struct dsa_switch *ds, int port,
|
||||
struct ethtool_keee *e)
|
||||
{
|
||||
@@ -4672,7 +4658,6 @@ static const struct dsa_switch_ops ksz_switch_ops = {
|
||||
.cls_flower_del = ksz_cls_flower_del,
|
||||
.port_setup_tc = ksz_setup_tc,
|
||||
.support_eee = ksz_support_eee,
|
||||
.get_mac_eee = ksz_get_mac_eee,
|
||||
.set_mac_eee = ksz_set_mac_eee,
|
||||
.port_get_default_prio = ksz_port_get_default_prio,
|
||||
.port_set_default_prio = ksz_port_set_default_prio,
|
||||
|
||||
@@ -3085,18 +3085,6 @@ mt753x_setup(struct dsa_switch *ds)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int mt753x_get_mac_eee(struct dsa_switch *ds, int port,
|
||||
struct ethtool_keee *e)
|
||||
{
|
||||
struct mt7530_priv *priv = ds->priv;
|
||||
u32 eeecr = mt7530_read(priv, MT753X_PMEEECR_P(port));
|
||||
|
||||
e->tx_lpi_enabled = !(eeecr & LPI_MODE_EN);
|
||||
e->tx_lpi_timer = LPI_THRESH_GET(eeecr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mt753x_set_mac_eee(struct dsa_switch *ds, int port,
|
||||
struct ethtool_keee *e)
|
||||
{
|
||||
@@ -3239,7 +3227,6 @@ const struct dsa_switch_ops mt7530_switch_ops = {
|
||||
.port_mirror_del = mt753x_port_mirror_del,
|
||||
.phylink_get_caps = mt753x_phylink_get_caps,
|
||||
.support_eee = dsa_supports_eee,
|
||||
.get_mac_eee = mt753x_get_mac_eee,
|
||||
.set_mac_eee = mt753x_set_mac_eee,
|
||||
.conduit_state_change = mt753x_conduit_state_change,
|
||||
.port_setup_tc = mt753x_setup_tc,
|
||||
|
||||
@@ -1513,13 +1513,6 @@ static void mv88e6xxx_get_regs(struct dsa_switch *ds, int port,
|
||||
mv88e6xxx_reg_unlock(chip);
|
||||
}
|
||||
|
||||
static int mv88e6xxx_get_mac_eee(struct dsa_switch *ds, int port,
|
||||
struct ethtool_keee *e)
|
||||
{
|
||||
/* Nothing to do on the port's MAC */
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mv88e6xxx_set_mac_eee(struct dsa_switch *ds, int port,
|
||||
struct ethtool_keee *e)
|
||||
{
|
||||
@@ -7100,7 +7093,6 @@ static const struct dsa_switch_ops mv88e6xxx_switch_ops = {
|
||||
.port_max_mtu = mv88e6xxx_get_max_mtu,
|
||||
.port_change_mtu = mv88e6xxx_change_mtu,
|
||||
.support_eee = dsa_supports_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,
|
||||
|
||||
@@ -2017,7 +2017,6 @@ static const struct dsa_switch_ops qca8k_switch_ops = {
|
||||
.get_sset_count = qca8k_get_sset_count,
|
||||
.set_ageing_time = qca8k_set_ageing_time,
|
||||
.support_eee = dsa_supports_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,
|
||||
|
||||
@@ -557,13 +557,6 @@ int qca8k_set_mac_eee(struct dsa_switch *ds, int port,
|
||||
return ret;
|
||||
}
|
||||
|
||||
int qca8k_get_mac_eee(struct dsa_switch *ds, int port,
|
||||
struct ethtool_keee *e)
|
||||
{
|
||||
/* Nothing to do on the port's MAC */
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int qca8k_port_configure_learning(struct dsa_switch *ds, int port,
|
||||
bool learning)
|
||||
{
|
||||
|
||||
@@ -520,7 +520,6 @@ int qca8k_get_sset_count(struct dsa_switch *ds, int port, int sset);
|
||||
|
||||
/* Common eee function */
|
||||
int qca8k_set_mac_eee(struct dsa_switch *ds, int port, struct ethtool_keee *eee);
|
||||
int qca8k_get_mac_eee(struct dsa_switch *ds, int port, struct ethtool_keee *e);
|
||||
|
||||
/* Common bridge function */
|
||||
void qca8k_port_stp_state_set(struct dsa_switch *ds, int port, u8 state);
|
||||
|
||||
@@ -991,8 +991,6 @@ struct dsa_switch_ops {
|
||||
bool (*support_eee)(struct dsa_switch *ds, int port);
|
||||
int (*set_mac_eee)(struct dsa_switch *ds, int port,
|
||||
struct ethtool_keee *e);
|
||||
int (*get_mac_eee)(struct dsa_switch *ds, int port,
|
||||
struct ethtool_keee *e);
|
||||
|
||||
/* EEPROM access */
|
||||
int (*get_eeprom_len)(struct dsa_switch *ds);
|
||||
|
||||
@@ -1251,7 +1251,6 @@ static int dsa_user_get_eee(struct net_device *dev, struct ethtool_keee *e)
|
||||
{
|
||||
struct dsa_port *dp = dsa_user_to_port(dev);
|
||||
struct dsa_switch *ds = dp->ds;
|
||||
int ret;
|
||||
|
||||
/* Check whether the switch supports EEE */
|
||||
if (!ds->ops->support_eee || !ds->ops->support_eee(ds, dp->index))
|
||||
@@ -1261,13 +1260,6 @@ static int dsa_user_get_eee(struct net_device *dev, struct ethtool_keee *e)
|
||||
if (!dev->phydev)
|
||||
return -ENODEV;
|
||||
|
||||
if (!ds->ops->get_mac_eee)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
ret = ds->ops->get_mac_eee(ds, dp->index, e);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
return phylink_ethtool_get_eee(dp->pl, e);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user