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 cf2dc989f230ee47f4bf0b4f42ab02a511abc19d..e1c4e5a1e5dc584a471090876bcb7479cd392708 100644 --- a/drivers/net/usb/ax88179a_devices.c +++ b/drivers/net/usb/ax88179a_devices.c @@ -216,6 +216,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, @@ -225,6 +239,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, @@ -450,6 +466,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