On Fri, Sep 14, 2018 at 03:23:14PM -0700, Florian Fainelli wrote: > On 09/14/2018 02:38 PM, Andrew Lunn wrote: > > The phy_mii_ioctl can be used to write a value into the MII_ADVERTISE > > register in the PHY. Since this changes the state of the PHY, we need > > to make the same change to phydev->advertising. Add a helper which can > > convert the register value to a linkmode. > > It would have been nice if we could eliminate the duplication between > mii_adv_to_ethtool_adv_t() and mii_adv_to_linkmode_adv_t() but I don't > really see how without changing the former function's signature.
Some of these functions are also used by non-phylib MAC drivers. So the ethtool version cannot be eliminated. And the UAPI for EEE still uses a u32 for which modes EEE is advertised :-( Andrew