Skip to content

Commit f43a2db

Browse files
ffainellidavem330
authored andcommitted
net: dsa: b53: Wire-up EEE
Add support for enabling and disabling EEE, as well as re-negotiating it in .adjust_link() and in .port_enable(). Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 22256b0 commit f43a2db

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/net/dsa/b53/b53_common.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,10 @@ static int b53_enable_port(struct dsa_switch *ds, int port,
523523

524524
b53_imp_vlan_setup(ds, cpu_port);
525525

526+
/* If EEE was enabled, restore it */
527+
if (dev->ports[port].eee.eee_enabled)
528+
b53_eee_enable_set(ds, port, true);
529+
526530
return 0;
527531
}
528532

@@ -879,6 +883,7 @@ static void b53_adjust_link(struct dsa_switch *ds, int port,
879883
struct phy_device *phydev)
880884
{
881885
struct b53_device *dev = ds->priv;
886+
struct ethtool_eee *p = &dev->ports[port].eee;
882887
u8 rgmii_ctrl = 0, reg = 0, off;
883888

884889
if (!phy_is_pseudo_fixed_link(phydev))
@@ -1000,6 +1005,9 @@ static void b53_adjust_link(struct dsa_switch *ds, int port,
10001005
b53_write8(dev, B53_CTRL_PAGE, po_reg, gmii_po);
10011006
}
10021007
}
1008+
1009+
/* Re-negotiate EEE if it was enabled already */
1010+
p->eee_enabled = b53_eee_init(ds, port, phydev);
10031011
}
10041012

10051013
int b53_vlan_filtering(struct dsa_switch *ds, int port, bool vlan_filtering)
@@ -1605,6 +1613,8 @@ static const struct dsa_switch_ops b53_switch_ops = {
16051613
.adjust_link = b53_adjust_link,
16061614
.port_enable = b53_enable_port,
16071615
.port_disable = b53_disable_port,
1616+
.get_mac_eee = b53_get_mac_eee,
1617+
.set_mac_eee = b53_set_mac_eee,
16081618
.port_bridge_join = b53_br_join,
16091619
.port_bridge_leave = b53_br_leave,
16101620
.port_stp_state_set = b53_br_set_stp_state,

0 commit comments

Comments
 (0)