Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

-64
-7
drivers/net/dsa/b53/b53_common.c
··· 2232 2232 } 2233 2233 EXPORT_SYMBOL(b53_support_eee); 2234 2234 2235 - int b53_get_mac_eee(struct dsa_switch *ds, int port, struct ethtool_keee *e) 2236 - { 2237 - return 0; 2238 - } 2239 - EXPORT_SYMBOL(b53_get_mac_eee); 2240 - 2241 2235 int b53_set_mac_eee(struct dsa_switch *ds, int port, struct ethtool_keee *e) 2242 2236 { 2243 2237 struct b53_device *dev = ds->priv; ··· 2293 2299 .port_enable = b53_enable_port, 2294 2300 .port_disable = b53_disable_port, 2295 2301 .support_eee = b53_support_eee, 2296 - .get_mac_eee = b53_get_mac_eee, 2297 2302 .set_mac_eee = b53_set_mac_eee, 2298 2303 .port_bridge_join = b53_br_join, 2299 2304 .port_bridge_leave = b53_br_leave,
-1
drivers/net/dsa/b53/b53_priv.h
··· 385 385 void b53_brcm_hdr_setup(struct dsa_switch *ds, int port); 386 386 int b53_eee_init(struct dsa_switch *ds, int port, struct phy_device *phy); 387 387 bool b53_support_eee(struct dsa_switch *ds, int port); 388 - int b53_get_mac_eee(struct dsa_switch *ds, int port, struct ethtool_keee *e); 389 388 int b53_set_mac_eee(struct dsa_switch *ds, int port, struct ethtool_keee *e); 390 389 391 390 #endif
-1
drivers/net/dsa/bcm_sf2.c
··· 1233 1233 .port_enable = bcm_sf2_port_setup, 1234 1234 .port_disable = bcm_sf2_port_disable, 1235 1235 .support_eee = b53_support_eee, 1236 - .get_mac_eee = b53_get_mac_eee, 1237 1236 .set_mac_eee = b53_set_mac_eee, 1238 1237 .port_bridge_join = b53_br_join, 1239 1238 .port_bridge_leave = b53_br_leave,
-15
drivers/net/dsa/microchip/ksz_common.c
··· 3489 3489 return false; 3490 3490 } 3491 3491 3492 - static int ksz_get_mac_eee(struct dsa_switch *ds, int port, 3493 - struct ethtool_keee *e) 3494 - { 3495 - /* There is no documented control of Tx LPI configuration. */ 3496 - e->tx_lpi_enabled = true; 3497 - 3498 - /* There is no documented control of Tx LPI timer. According to tests 3499 - * Tx LPI timer seems to be set by default to minimal value. 3500 - */ 3501 - e->tx_lpi_timer = 0; 3502 - 3503 - return 0; 3504 - } 3505 - 3506 3492 static int ksz_set_mac_eee(struct dsa_switch *ds, int port, 3507 3493 struct ethtool_keee *e) 3508 3494 { ··· 4658 4672 .cls_flower_del = ksz_cls_flower_del, 4659 4673 .port_setup_tc = ksz_setup_tc, 4660 4674 .support_eee = ksz_support_eee, 4661 - .get_mac_eee = ksz_get_mac_eee, 4662 4675 .set_mac_eee = ksz_set_mac_eee, 4663 4676 .port_get_default_prio = ksz_port_get_default_prio, 4664 4677 .port_set_default_prio = ksz_port_set_default_prio,
-13
drivers/net/dsa/mt7530.c
··· 3085 3085 return ret; 3086 3086 } 3087 3087 3088 - static int mt753x_get_mac_eee(struct dsa_switch *ds, int port, 3089 - struct ethtool_keee *e) 3090 - { 3091 - struct mt7530_priv *priv = ds->priv; 3092 - u32 eeecr = mt7530_read(priv, MT753X_PMEEECR_P(port)); 3093 - 3094 - e->tx_lpi_enabled = !(eeecr & LPI_MODE_EN); 3095 - e->tx_lpi_timer = LPI_THRESH_GET(eeecr); 3096 - 3097 - return 0; 3098 - } 3099 - 3100 3088 static int mt753x_set_mac_eee(struct dsa_switch *ds, int port, 3101 3089 struct ethtool_keee *e) 3102 3090 { ··· 3227 3239 .port_mirror_del = mt753x_port_mirror_del, 3228 3240 .phylink_get_caps = mt753x_phylink_get_caps, 3229 3241 .support_eee = dsa_supports_eee, 3230 - .get_mac_eee = mt753x_get_mac_eee, 3231 3242 .set_mac_eee = mt753x_set_mac_eee, 3232 3243 .conduit_state_change = mt753x_conduit_state_change, 3233 3244 .port_setup_tc = mt753x_setup_tc,
-8
drivers/net/dsa/mv88e6xxx/chip.c
··· 1513 1513 mv88e6xxx_reg_unlock(chip); 1514 1514 } 1515 1515 1516 - static int mv88e6xxx_get_mac_eee(struct dsa_switch *ds, int port, 1517 - struct ethtool_keee *e) 1518 - { 1519 - /* Nothing to do on the port's MAC */ 1520 - return 0; 1521 - } 1522 - 1523 1516 static int mv88e6xxx_set_mac_eee(struct dsa_switch *ds, int port, 1524 1517 struct ethtool_keee *e) 1525 1518 { ··· 7093 7100 .port_max_mtu = mv88e6xxx_get_max_mtu, 7094 7101 .port_change_mtu = mv88e6xxx_change_mtu, 7095 7102 .support_eee = dsa_supports_eee, 7096 - .get_mac_eee = mv88e6xxx_get_mac_eee, 7097 7103 .set_mac_eee = mv88e6xxx_set_mac_eee, 7098 7104 .get_eeprom_len = mv88e6xxx_get_eeprom_len, 7099 7105 .get_eeprom = mv88e6xxx_get_eeprom,
-1
drivers/net/dsa/qca/qca8k-8xxx.c
··· 2017 2017 .get_sset_count = qca8k_get_sset_count, 2018 2018 .set_ageing_time = qca8k_set_ageing_time, 2019 2019 .support_eee = dsa_supports_eee, 2020 - .get_mac_eee = qca8k_get_mac_eee, 2021 2020 .set_mac_eee = qca8k_set_mac_eee, 2022 2021 .port_enable = qca8k_port_enable, 2023 2022 .port_disable = qca8k_port_disable,
-7
drivers/net/dsa/qca/qca8k-common.c
··· 557 557 return ret; 558 558 } 559 559 560 - int qca8k_get_mac_eee(struct dsa_switch *ds, int port, 561 - struct ethtool_keee *e) 562 - { 563 - /* Nothing to do on the port's MAC */ 564 - return 0; 565 - } 566 - 567 560 static int qca8k_port_configure_learning(struct dsa_switch *ds, int port, 568 561 bool learning) 569 562 {
-1
drivers/net/dsa/qca/qca8k.h
··· 520 520 521 521 /* Common eee function */ 522 522 int qca8k_set_mac_eee(struct dsa_switch *ds, int port, struct ethtool_keee *eee); 523 - int qca8k_get_mac_eee(struct dsa_switch *ds, int port, struct ethtool_keee *e); 524 523 525 524 /* Common bridge function */ 526 525 void qca8k_port_stp_state_set(struct dsa_switch *ds, int port, u8 state);
-2
include/net/dsa.h
··· 991 991 bool (*support_eee)(struct dsa_switch *ds, int port); 992 992 int (*set_mac_eee)(struct dsa_switch *ds, int port, 993 993 struct ethtool_keee *e); 994 - int (*get_mac_eee)(struct dsa_switch *ds, int port, 995 - struct ethtool_keee *e); 996 994 997 995 /* EEPROM access */ 998 996 int (*get_eeprom_len)(struct dsa_switch *ds);
-8
net/dsa/user.c
··· 1251 1251 { 1252 1252 struct dsa_port *dp = dsa_user_to_port(dev); 1253 1253 struct dsa_switch *ds = dp->ds; 1254 - int ret; 1255 1254 1256 1255 /* Check whether the switch supports EEE */ 1257 1256 if (!ds->ops->support_eee || !ds->ops->support_eee(ds, dp->index)) ··· 1259 1260 /* Port's PHY and MAC both need to be EEE capable */ 1260 1261 if (!dev->phydev) 1261 1262 return -ENODEV; 1262 - 1263 - if (!ds->ops->get_mac_eee) 1264 - return -EOPNOTSUPP; 1265 - 1266 - ret = ds->ops->get_mac_eee(ds, dp->index, e); 1267 - if (ret) 1268 - return ret; 1269 1263 1270 1264 return phylink_ethtool_get_eee(dp->pl, e); 1271 1265 }