* [PATCH net-next 0/2] Add phylink helper for 10G modes
@ 2021-10-04 11:02 Russell King (Oracle)
2021-10-04 11:03 ` [PATCH net-next 1/2] net: phylink: add phylink_set_10g_modes() helper Russell King (Oracle)
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Russell King (Oracle) @ 2021-10-04 11:02 UTC (permalink / raw)
To: Andrew Lunn, Heiner Kallweit
Cc: Claudiu Beznea, David S. Miller, Ioana Ciornei, Jakub Kicinski,
Marcin Wojtas, netdev, Nicolas Ferre
Hi,
During the last cycle, there was discussion about adding a helper
to set the 10G link modes for phylink, which resulted in these two
patches introduce such a helper.
drivers/net/ethernet/cadence/macb_main.c | 7 +------
drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c | 7 +------
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 7 +------
drivers/net/phy/phylink.c | 11 +++++++++++
include/linux/phylink.h | 1 +
5 files changed, 15 insertions(+), 18 deletions(-)
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH net-next 1/2] net: phylink: add phylink_set_10g_modes() helper
2021-10-04 11:02 [PATCH net-next 0/2] Add phylink helper for 10G modes Russell King (Oracle)
@ 2021-10-04 11:03 ` Russell King (Oracle)
2021-10-04 11:03 ` [PATCH net-next 2/2] net: ethernet: use phylink_set_10g_modes() Russell King (Oracle)
2021-10-04 13:20 ` [PATCH net-next 0/2] Add phylink helper for 10G modes patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Russell King (Oracle) @ 2021-10-04 11:03 UTC (permalink / raw)
To: Andrew Lunn, Heiner Kallweit; +Cc: David S. Miller, netdev, Jakub Kicinski
Add a helper for setting 10Gigabit modes, so we have one central
place that sets all appropriate 10G modes for a driver.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
drivers/net/phy/phylink.c | 11 +++++++++++
include/linux/phylink.h | 1 +
2 files changed, 12 insertions(+)
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index 5a58c77d0002..b32774fd65f8 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -132,6 +132,17 @@ void phylink_set_port_modes(unsigned long *mask)
}
EXPORT_SYMBOL_GPL(phylink_set_port_modes);
+void phylink_set_10g_modes(unsigned long *mask)
+{
+ phylink_set(mask, 10000baseT_Full);
+ phylink_set(mask, 10000baseCR_Full);
+ phylink_set(mask, 10000baseSR_Full);
+ phylink_set(mask, 10000baseLR_Full);
+ phylink_set(mask, 10000baseLRM_Full);
+ phylink_set(mask, 10000baseER_Full);
+}
+EXPORT_SYMBOL_GPL(phylink_set_10g_modes);
+
static int phylink_is_empty_linkmode(const unsigned long *linkmode)
{
__ETHTOOL_DECLARE_LINK_MODE_MASK(tmp) = { 0, };
diff --git a/include/linux/phylink.h b/include/linux/phylink.h
index 237291196ce2..f7b5ed06a815 100644
--- a/include/linux/phylink.h
+++ b/include/linux/phylink.h
@@ -484,6 +484,7 @@ int phylink_speed_up(struct phylink *pl);
#define phylink_test(bm, mode) __phylink_do_bit(test_bit, bm, mode)
void phylink_set_port_modes(unsigned long *bits);
+void phylink_set_10g_modes(unsigned long *mask);
void phylink_helper_basex_speed(struct phylink_link_state *state);
void phylink_mii_c22_pcs_get_state(struct mdio_device *pcs,
--
2.30.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH net-next 2/2] net: ethernet: use phylink_set_10g_modes()
2021-10-04 11:02 [PATCH net-next 0/2] Add phylink helper for 10G modes Russell King (Oracle)
2021-10-04 11:03 ` [PATCH net-next 1/2] net: phylink: add phylink_set_10g_modes() helper Russell King (Oracle)
@ 2021-10-04 11:03 ` Russell King (Oracle)
2021-10-04 13:20 ` [PATCH net-next 0/2] Add phylink helper for 10G modes patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Russell King (Oracle) @ 2021-10-04 11:03 UTC (permalink / raw)
To: Andrew Lunn, Heiner Kallweit
Cc: David S. Miller, netdev, Nicolas Ferre, Claudiu Beznea,
Jakub Kicinski, Ioana Ciornei, Marcin Wojtas
Update three drivers to use the new phylink_set_10g_modes() helper:
Cadence macb, Freescale DPAA2 and Marvell PP2.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
drivers/net/ethernet/cadence/macb_main.c | 7 +------
drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c | 7 +------
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 7 +------
3 files changed, 3 insertions(+), 18 deletions(-)
diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index e2730b3e1a57..b58297aeb793 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -547,13 +547,8 @@ static void macb_validate(struct phylink_config *config,
if (bp->caps & MACB_CAPS_GIGABIT_MODE_AVAILABLE &&
(state->interface == PHY_INTERFACE_MODE_NA ||
state->interface == PHY_INTERFACE_MODE_10GBASER)) {
- phylink_set(mask, 10000baseCR_Full);
- phylink_set(mask, 10000baseER_Full);
+ phylink_set_10g_modes(mask);
phylink_set(mask, 10000baseKR_Full);
- phylink_set(mask, 10000baseLR_Full);
- phylink_set(mask, 10000baseLRM_Full);
- phylink_set(mask, 10000baseSR_Full);
- phylink_set(mask, 10000baseT_Full);
if (state->interface != PHY_INTERFACE_MODE_NA)
goto out;
}
diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
index 543c1f202420..ef8f0a055024 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
@@ -139,12 +139,7 @@ static void dpaa2_mac_validate(struct phylink_config *config,
case PHY_INTERFACE_MODE_NA:
case PHY_INTERFACE_MODE_10GBASER:
case PHY_INTERFACE_MODE_USXGMII:
- phylink_set(mask, 10000baseT_Full);
- phylink_set(mask, 10000baseCR_Full);
- phylink_set(mask, 10000baseSR_Full);
- phylink_set(mask, 10000baseLR_Full);
- phylink_set(mask, 10000baseLRM_Full);
- phylink_set(mask, 10000baseER_Full);
+ phylink_set_10g_modes(mask);
if (state->interface == PHY_INTERFACE_MODE_10GBASER)
break;
phylink_set(mask, 5000baseT_Full);
diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
index d5c92e43f89e..34b997aa6c66 100644
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
@@ -6301,12 +6301,7 @@ static void mvpp2_phylink_validate(struct phylink_config *config,
case PHY_INTERFACE_MODE_XAUI:
case PHY_INTERFACE_MODE_NA:
if (mvpp2_port_supports_xlg(port)) {
- phylink_set(mask, 10000baseT_Full);
- phylink_set(mask, 10000baseCR_Full);
- phylink_set(mask, 10000baseSR_Full);
- phylink_set(mask, 10000baseLR_Full);
- phylink_set(mask, 10000baseLRM_Full);
- phylink_set(mask, 10000baseER_Full);
+ phylink_set_10g_modes(mask);
phylink_set(mask, 10000baseKR_Full);
}
if (state->interface != PHY_INTERFACE_MODE_NA)
--
2.30.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next 0/2] Add phylink helper for 10G modes
2021-10-04 11:02 [PATCH net-next 0/2] Add phylink helper for 10G modes Russell King (Oracle)
2021-10-04 11:03 ` [PATCH net-next 1/2] net: phylink: add phylink_set_10g_modes() helper Russell King (Oracle)
2021-10-04 11:03 ` [PATCH net-next 2/2] net: ethernet: use phylink_set_10g_modes() Russell King (Oracle)
@ 2021-10-04 13:20 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-10-04 13:20 UTC (permalink / raw)
To: Russell King
Cc: andrew, hkallweit1, claudiu.beznea, davem, ioana.ciornei, kuba,
mw, netdev, nicolas.ferre
Hello:
This series was applied to netdev/net-next.git (refs/heads/master):
On Mon, 4 Oct 2021 12:02:36 +0100 you wrote:
> Hi,
>
> During the last cycle, there was discussion about adding a helper
> to set the 10G link modes for phylink, which resulted in these two
> patches introduce such a helper.
>
> drivers/net/ethernet/cadence/macb_main.c | 7 +------
> drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c | 7 +------
> drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 7 +------
> drivers/net/phy/phylink.c | 11 +++++++++++
> include/linux/phylink.h | 1 +
> 5 files changed, 15 insertions(+), 18 deletions(-)
Here is the summary with links:
- [net-next,1/2] net: phylink: add phylink_set_10g_modes() helper
https://git.kernel.org/netdev/net-next/c/a2c27a61b433
- [net-next,2/2] net: ethernet: use phylink_set_10g_modes()
https://git.kernel.org/netdev/net-next/c/14ad41c74f6b
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-10-04 13:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-04 11:02 [PATCH net-next 0/2] Add phylink helper for 10G modes Russell King (Oracle)
2021-10-04 11:03 ` [PATCH net-next 1/2] net: phylink: add phylink_set_10g_modes() helper Russell King (Oracle)
2021-10-04 11:03 ` [PATCH net-next 2/2] net: ethernet: use phylink_set_10g_modes() Russell King (Oracle)
2021-10-04 13:20 ` [PATCH net-next 0/2] Add phylink helper for 10G modes patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).