From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Lunn Subject: Re: [PATH RFC net-next 3/8] net: phy: Add helper to convert MII ADV register to a linkmode Date: Sat, 15 Sep 2018 01:23:20 +0200 Message-ID: <20180914232320.GA30993@lunn.ch> References: <1536961136-30453-1-git-send-email-andrew@lunn.ch> <1536961136-30453-4-git-send-email-andrew@lunn.ch> <8c8fd712-d7bd-59b3-6ef9-187f45ba62b8@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: netdev To: Florian Fainelli Return-path: Received: from vps0.lunn.ch ([185.16.172.187]:35294 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725753AbeIOEj5 (ORCPT ); Sat, 15 Sep 2018 00:39:57 -0400 Content-Disposition: inline In-Reply-To: <8c8fd712-d7bd-59b3-6ef9-187f45ba62b8@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: 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