Configure phylink to work with the PHYs in the AX88197A controllers and provide ethtool get/set eee operations calling into phylink. Signed-off-by: Birger Koblitz Reviewed-by: Andrew Lunn --- drivers/net/usb/ax88179a_devices.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/net/usb/ax88179a_devices.c b/drivers/net/usb/ax88179a_devices.c index 92e1512f62852d7687ae27f97351f07fa13057fe..966e86a007fab2e73756af52eb66ae654c7e09e4 100644 --- a/drivers/net/usb/ax88179a_devices.c +++ b/drivers/net/usb/ax88179a_devices.c @@ -204,6 +204,20 @@ static int ax88179a_get_eeprom_len(struct net_device *net) return AX88179A_EEPROM_LEN; } +static int ax88179a_get_eee(struct net_device *net, struct ethtool_keee *edata) +{ + struct ax88179_data *ax179_data = netdev2data(net); + + return phylink_ethtool_get_eee(ax179_data->phylink, edata); +} + +static int ax88179a_set_eee(struct net_device *net, struct ethtool_keee *edata) +{ + struct ax88179_data *ax179_data = netdev2data(net); + + return phylink_ethtool_set_eee(ax179_data->phylink, edata); +} + static const struct ethtool_ops ax88179a_ethtool_ops = { .get_link = ethtool_op_get_link, .get_msglevel = usbnet_get_msglevel, @@ -213,6 +227,8 @@ static const struct ethtool_ops ax88179a_ethtool_ops = { .get_eeprom_len = ax88179a_get_eeprom_len, .get_eeprom = ax88179_get_eeprom, .set_eeprom = ax88179_set_eeprom, + .get_eee = ax88179a_get_eee, + .set_eee = ax88179a_set_eee, .nway_reset = usbnet_nway_reset, .get_link_ksettings = phy_ethtool_get_link_ksettings, .set_link_ksettings = phy_ethtool_set_link_ksettings, @@ -438,6 +454,10 @@ static int ax88179a_phylink_setup(struct usbnet *dev) phy_if_mode = PHY_INTERFACE_MODE_SGMII; } + memcpy(data->phylink_config.lpi_interfaces, + data->phylink_config.supported_interfaces, + sizeof(data->phylink_config.lpi_interfaces)); + phylink = phylink_create(&data->phylink_config, dev->net->dev.fwnode, phy_if_mode, &ax88179a_phylink_mac_ops); if (IS_ERR(phylink)) -- 2.47.3