[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 13 May 2023 01:57:46 +0200
From: Andrew Lunn <andrew@...n.ch>
To: "Russell King (Oracle)" <rmk+kernel@...linux.org.uk>
Cc: Jose Abreu <Jose.Abreu@...opsys.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Heiner Kallweit <hkallweit1@...il.com>,
Jakub Kicinski <kuba@...nel.org>, netdev@...r.kernel.org,
Paolo Abeni <pabeni@...hat.com>
Subject: Re: [PATCH RFC net-next 3/9] net: phylink: add function to resolve
clause 73 negotiation
> +void phylink_resolve_c73(struct phylink_link_state *state)
> +{
> + int i;
> +
> + for (i = 0; i < ARRAY_SIZE(phylink_c73_priority_resolution); i++) {
> + int bit = phylink_c73_priority_resolution[i].bit;
> + if (linkmode_test_bit(bit, state->advertising) &&
> + linkmode_test_bit(bit, state->lp_advertising))
> + break;
> + }
> +
> + if (i < ARRAY_SIZE(phylink_c73_priority_resolution)) {
> + state->speed = phylink_c73_priority_resolution[i].speed;
> + state->duplex = DUPLEX_FULL;
> + } else {
> + /* negotiation failure */
> + state->link = false;
> + }
Hi Russell
This looks asymmetric in that state->link is not set true if a
resolution is found.
Can that set be moved here? Or are there other conditions which also
need to be fulfilled before it is set?
Andrew
Powered by blists - more mailing lists