From: Andrew Lunn <andrew@lunn.ch>
To: Russell King <rmk+kernel@armlinux.org.uk>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
Heiner Kallweit <hkallweit1@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
netdev@vger.kernel.org
Subject: Re: [PATCH net-next 3/3] net: phylink: pcs: add 802.3 clause 45 helpers
Date: Sat, 14 Mar 2020 22:48:00 +0100 [thread overview]
Message-ID: <20200314214800.GF8622@lunn.ch> (raw)
In-Reply-To: <E1jD44s-0006Mx-Fv@rmk-PC.armlinux.org.uk>
On Sat, Mar 14, 2020 at 10:31:34AM +0000, Russell King wrote:
> Implement helpers for PCS accessed via the MII bus using 802.3 clause
> 45 cycles for 10GBASE-R. Only link up/down is supported, 10G full
> duplex is assumed.
>
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
> ---
> drivers/net/phy/phylink.c | 30 ++++++++++++++++++++++++++++++
> include/linux/phylink.h | 2 ++
> 2 files changed, 32 insertions(+)
>
> diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
> index 7ca427c46d9f..bff570f59d5c 100644
> --- a/drivers/net/phy/phylink.c
> +++ b/drivers/net/phy/phylink.c
> @@ -2247,4 +2247,34 @@ void phylink_mii_c22_pcs_an_restart(struct mdio_device *pcs)
> }
> EXPORT_SYMBOL_GPL(phylink_mii_c22_pcs_an_restart);
>
> +#define C45_ADDR(d,a) (MII_ADDR_C45 | (d) << 16 | (a))
Hi Russell
That seems like a macro that should be made global.
dsa/mv88e6xxx/serdes.c: int reg_c45 = MII_ADDR_C45 | device << 16 | reg;
dsa/mv88e6xxx/serdes.c: int reg_c45 = MII_ADDR_C45 | device << 16 | reg;
ethernet/intel/ixgbe/ixgbe_main.c: regnum |= (devad << 16) | MII_ADDR_C45;
ethernet/intel/ixgbe/ixgbe_main.c: regnum |= (devad << 16) | MII_ADDR_C45;
phy/phylink.c: devad = MII_ADDR_C45 | devad << 16 | reg;
phy/phylink.c: devad = MII_ADDR_C45 | devad << 16 | reg;
phy/phylink.c: devad = MII_ADDR_C45 | devad << 16 | reg;
phy/phylink.c: devad = MII_ADDR_C45 | devad << 16 | reg;
phy/phy-core.c: u32 addr = MII_ADDR_C45 | (devad << 16) | (regnum & 0xffff);
phy/phy-core.c: u32 addr = MII_ADDR_C45 | (devad << 16) | (regnum & 0xffff);
phy/phy_device.c: reg_addr = MII_ADDR_C45 | dev_addr << 16 | MDIO_DEVS2;
phy/phy_device.c: reg_addr = MII_ADDR_C45 | dev_addr << 16 | MDIO_DEVS1;
phy/phy_device.c: reg_addr = MII_ADDR_C45 | i << 16 | MII_PHYSID1;
phy/phy_device.c: reg_addr = MII_ADDR_C45 | i << 16 | MII_PHYSID2;
phy/phy.c: devad = MII_ADDR_C45 | devad << 16 | mii_data->reg_num;
phy/phy.c: devad = MII_ADDR_C45 | devad << 16 | mii_data->reg_num;
phy/bcm87xx.c: u32 regnum = MII_ADDR_C45 | (devid << 16) | reg;
I'm not suggesting you convert all these cases, just make the macro
available and we can make more use of it later.
Thanks
Andrew
next prev parent reply other threads:[~2020-03-15 1:54 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-14 10:31 [PATCH REPOST3 net-next 0/3] net: add phylink support for PCS Russell King - ARM Linux admin
2020-03-14 10:31 ` [PATCH net-next 1/3] net: mdiobus: add APIs for modifying a MDIO device register Russell King
2020-03-14 21:57 ` Andrew Lunn
2020-03-16 9:12 ` Russell King - ARM Linux admin
2020-03-17 14:09 ` Andrew Lunn
2020-03-14 10:31 ` [PATCH net-next 2/3] net: phylink: pcs: add 802.3 clause 22 helpers Russell King
2020-03-14 10:31 ` [PATCH net-next 3/3] net: phylink: pcs: add 802.3 clause 45 helpers Russell King
2020-03-14 21:48 ` Andrew Lunn [this message]
2020-03-14 22:00 ` [PATCH REPOST3 net-next 0/3] net: add phylink support for PCS Andrew Lunn
2020-03-14 22:44 ` Russell King - ARM Linux admin
2020-03-17 14:18 ` Andrew Lunn
2020-03-17 15:26 ` Russell King - ARM Linux admin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200314214800.GF8622@lunn.ch \
--to=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=rmk+kernel@armlinux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.