@@ -3026,6 +3026,8 @@ static int igb_set_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd)
static int igb_get_eee(struct net_device *netdev, struct ethtool_eee *edata)
{
struct igb_adapter *adapter = netdev_priv(netdev);
+ __ETHTOOL_DECLARE_LINK_MODE_MASK(adv) = {};
+ __ETHTOOL_DECLARE_LINK_MODE_MASK(lp) = {};
struct e1000_hw *hw = &adapter->hw;
u32 ret_val;
u16 phy_data;
@@ -3036,9 +3038,12 @@ static int igb_get_eee(struct net_device *netdev, struct ethtool_eee *edata)
edata->supported = (SUPPORTED_1000baseT_Full |
SUPPORTED_100baseT_Full);
- if (!hw->dev_spec._82575.eee_disable)
- edata->advertised =
- mmd_eee_adv_to_ethtool_adv_t(adapter->eee_advert);
+
+ if (!hw->dev_spec._82575.eee_disable) {
+ mii_eee_cap1_mod_linkmode_t(adv, adapter->eee_advert);
+ ethtool_convert_link_mode_to_legacy_u32(&edata->advertised,
+ adv);
+ }
/* The IPCNFG and EEER registers are not supported on I354. */
if (hw->mac.type == e1000_i354) {
@@ -3064,7 +3069,9 @@ static int igb_get_eee(struct net_device *netdev, struct ethtool_eee *edata)
if (ret_val)
return -ENODATA;
- edata->lp_advertised = mmd_eee_adv_to_ethtool_adv_t(phy_data);
+ mii_eee_cap1_mod_linkmode_t(lp, phy_data);
+ ethtool_convert_link_mode_to_legacy_u32(&edata->lp_advertised,
+ lp);
break;
case e1000_i354:
case e1000_i210:
@@ -3075,7 +3082,9 @@ static int igb_get_eee(struct net_device *netdev, struct ethtool_eee *edata)
if (ret_val)
return -ENODATA;
- edata->lp_advertised = mmd_eee_adv_to_ethtool_adv_t(phy_data);
+ mii_eee_cap1_mod_linkmode_t(lp, phy_data);
+ ethtool_convert_link_mode_to_legacy_u32(&edata->lp_advertised,
+ lp);
break;
default:
@@ -3105,6 +3114,7 @@ static int igb_set_eee(struct net_device *netdev,
struct ethtool_eee *edata)
{
struct igb_adapter *adapter = netdev_priv(netdev);
+ __ETHTOOL_DECLARE_LINK_MODE_MASK(adv) = {};
struct e1000_hw *hw = &adapter->hw;
struct ethtool_eee eee_curr;
bool adv1g_eee = true, adv100m_eee = true;
@@ -3149,7 +3159,8 @@ static int igb_set_eee(struct net_device *netdev,
return -EINVAL;
}
- adapter->eee_advert = ethtool_adv_to_mmd_eee_adv_t(edata->advertised);
+ adv[0] = edata->advertised;
+ adapter->eee_advert = linkmode_to_mii_eee_cap1_t(adv);
if (hw->dev_spec._82575.eee_disable != !edata->eee_enabled) {
hw->dev_spec._82575.eee_disable = !edata->eee_enabled;
adapter->flags |= IGB_FLAG_EEE;
Replace EEE ethtool helpers with linkmode variants. This will reduce similar code snippets and prepare ethtool EEE interface to linkmode migration. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> --- drivers/net/ethernet/intel/igb/igb_ethtool.c | 23 +++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-)