+ if (ax179_data->phylink) {
+ ret = phylink_ethtool_get_eee(ax179_data->phylink, data);
+ /* AX88279 MAC does not support 2500Mbit EEE */
+ linkmode_set_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT, mask);
+ linkmode_andnot(data->supported, data->supported, mask);
When you tell phylink the MACs EEE capabilities, this will go away.
quoted hunk ↗ jump to hunk
+ return ret;
+ }
/* Get Supported EEE */
val = ax_read_mmd(dev, MDIO_MMD_PCS, MDIO_PCS_EEE_ABLE);
@@ -1025,9 +1035,14 @@ ax88179_ethtool_get_eee(struct usbnet *dev, struct ethtool_keee *data)
static int
ax88179_ethtool_set_eee(struct usbnet *dev, struct ethtool_keee *data)
{
- u16 tmp16 = linkmode_to_mii_eee_cap1_t(data->advertised);
+ struct ax88179_data *priv = dev->driver_priv;
+ u16 tmp16;
- return ax_write_mmd(dev, MDIO_MMD_AN, MDIO_AN_EEE_ADV, tmp16);
+ if (priv->phylink)
+ return phylink_ethtool_set_eee(priv->phylink, data);
+
+ tmp16 = linkmode_to_mii_eee_cap2_t(data->advertised);
+ return ax_write_mmd(dev, MDIO_MMD_AN, MDIO_AN_EEE_ADV2, tmp16);
The phylib should do this. All the MAC driver needs is enable/disable
the LPI timer. Nothing more.
We have had lots of broken EEE implementations in MAC drivers. We
tried to solve this by moving as much as possible to core code. The
MAC drivers should now be KISS and much less likely to be broken.
Andrew