From: "Russell King (Oracle)" <rmk+kernel@armlinux•org.uk>
To: Andrew Lunn <andrew@lunn•ch>, Heiner Kallweit <hkallweit1@gmail•com>
Cc: "Broadcom internal kernel review list"
<bcm-kernel-feedback-list@broadcom•com>,
"David S. Miller" <davem@davemloft•net>,
"Eric Dumazet" <edumazet@google•com>,
"Florian Fainelli" <florian.fainelli@broadcom•com>,
"Jakub Kicinski" <kuba@kernel•org>,
"Marek Behún" <kabel@kernel•org>,
netdev@vger•kernel.org, "Paolo Abeni" <pabeni@redhat•com>
Subject: [PATCH RFC net-next 07/10] net: phylink: pass PHY into phylink_validate_one()
Date: Wed, 22 Nov 2023 15:31:49 +0000 [thread overview]
Message-ID: <E1r5pCf-00DAHV-PR@rmk-PC.armlinux.org.uk> (raw)
In-Reply-To: <ZV4eolj9AI0b37y6@shell.armlinux.org.uk>
Pass the phy (if any) into phylink_validate_one() so that we can
validate each interface with its rate matching setting.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux•org.uk>
---
drivers/net/phy/phylink.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index 11dd743141d5..52414af5c93f 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -689,7 +689,7 @@ static int phylink_validate_mac_and_pcs(struct phylink *pl,
return phylink_is_empty_linkmode(supported) ? -EINVAL : 0;
}
-static void phylink_validate_one(struct phylink *pl,
+static void phylink_validate_one(struct phylink *pl, struct phy_device *phy,
const unsigned long *supported,
const struct phylink_link_state *state,
phy_interface_t interface,
@@ -704,6 +704,9 @@ static void phylink_validate_one(struct phylink *pl,
tmp_state = *state;
tmp_state.interface = interface;
+ if (phy)
+ tmp_state.rate_matching = phy_get_rate_matching(phy, interface);
+
if (!phylink_validate_mac_and_pcs(pl, tmp_supported, &tmp_state)) {
phylink_dbg(pl, " interface %u (%s) rate match %s supports %*pbl\n",
interface, phy_modes(interface),
@@ -725,7 +728,7 @@ static int phylink_validate_mask(struct phylink *pl, unsigned long *supported,
int interface;
for_each_set_bit(interface, interfaces, PHY_INTERFACE_MODE_MAX)
- phylink_validate_one(pl, supported, state, interface,
+ phylink_validate_one(pl, NULL, supported, state, interface,
all_s, all_adv);
linkmode_copy(supported, all_s);
--
2.30.2
next prev parent reply other threads:[~2023-11-22 15:31 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-22 15:30 [PATCH RFC 00/10] net: phylink: improve PHY validation Russell King (Oracle)
2023-11-22 15:31 ` [PATCH RFC net-next 01/10] net: phy: add possible interfaces Russell King (Oracle)
2023-11-22 15:31 ` [PATCH RFC net-next 02/10] net: phy: marvell10g: table driven mactype decode Russell King (Oracle)
2023-11-22 15:31 ` [PATCH RFC net-next 03/10] net: phy: marvell10g: fill in possible_interfaces Russell King (Oracle)
2023-11-22 15:31 ` [PATCH RFC net-next 04/10] net: phy: bcm84881: " Russell King (Oracle)
2023-11-22 22:11 ` Florian Fainelli
2023-11-22 15:31 ` [PATCH RFC net-next 05/10] net: phy: aquantia: fill in possible_interfaces for AQR113C Russell King (Oracle)
2023-11-22 15:31 ` [PATCH RFC net-next 06/10] net: phylink: split out per-interface validation Russell King (Oracle)
2023-11-22 15:31 ` Russell King (Oracle) [this message]
2023-11-22 15:31 ` [PATCH RFC net-next 08/10] net: phylink: pass PHY into phylink_validate_mask() Russell King (Oracle)
2023-11-22 15:32 ` [PATCH RFC net-next 09/10] net: phylink: split out PHY validation from phylink_bringup_phy() Russell King (Oracle)
2023-11-22 15:32 ` [PATCH RFC net-next 10/10] net: phylink: use the PHY's possible_interfaces if populated Russell King (Oracle)
2023-11-24 10:42 ` [PATCH RFC 00/10] net: phylink: improve PHY validation Jie Luo
2023-11-24 12:25 ` [PATCH net-next " Russell King (Oracle)
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=E1r5pCf-00DAHV-PR@rmk-PC.armlinux.org.uk \
--to=rmk+kernel@armlinux$(echo .)org.uk \
--cc=andrew@lunn$(echo .)ch \
--cc=bcm-kernel-feedback-list@broadcom$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=edumazet@google$(echo .)com \
--cc=florian.fainelli@broadcom$(echo .)com \
--cc=hkallweit1@gmail$(echo .)com \
--cc=kabel@kernel$(echo .)org \
--cc=kuba@kernel$(echo .)org \
--cc=netdev@vger$(echo .)kernel.org \
--cc=pabeni@redhat$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox