Skip to content

Commit 0025fa4

Browse files
hkallweitkuba-moo
authored andcommitted
net: phy: c45: improve handling of disabled EEE modes in generic ethtool functions
Currently disabled EEE modes are shown as supported in ethtool. Change this by filtering them out when populating data->supported in genphy_c45_ethtool_get_eee. Disabled EEE modes are silently filtered out by genphy_c45_write_eee_adv. This is planned to be removed, therefore ensure in genphy_c45_ethtool_set_eee that disabled EEE modes are removed from the user space provided EEE advertisement. For now keep the current behavior to do this silently. Signed-off-by: Heiner Kallweit <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent c2ddb61 commit 0025fa4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/net/phy/phy-c45.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1525,8 +1525,8 @@ int genphy_c45_ethtool_get_eee(struct phy_device *phydev,
15251525
return ret;
15261526

15271527
data->eee_active = phydev->eee_active;
1528-
linkmode_copy(data->supported, phydev->supported_eee);
1529-
1528+
linkmode_andnot(data->supported, phydev->supported_eee,
1529+
phydev->eee_disabled_modes);
15301530
return 0;
15311531
}
15321532
EXPORT_SYMBOL(genphy_c45_ethtool_get_eee);
@@ -1559,7 +1559,9 @@ int genphy_c45_ethtool_set_eee(struct phy_device *phydev,
15591559
phydev_warn(phydev, "At least some EEE link modes are not supported.\n");
15601560
return -EINVAL;
15611561
}
1562-
linkmode_copy(phydev->advertising_eee, adv);
1562+
1563+
linkmode_andnot(phydev->advertising_eee, adv,
1564+
phydev->eee_disabled_modes);
15631565
} else if (linkmode_empty(phydev->advertising_eee)) {
15641566
phy_advertise_eee_all(phydev);
15651567
}

0 commit comments

Comments
 (0)