From: "Russell King (Oracle)" <rmk+kernel@armlinux•org.uk>
To: Andrew Lunn <andrew@lunn•ch>, Heiner Kallweit <hkallweit1@gmail•com>
Cc: Alexander Couzens <lynxis@fe80•eu>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora•com>,
Cc: Alexander Couzens <lynxis@fe80•eu>,
Claudiu Beznea <claudiu.beznea@microchip•com>,
Daniel Golle <daniel@makrotopia•org>,
Daniel Machon <daniel.machon@microchip•com>,
"David S. Miller" <davem@davemloft•net>,
DENG Qingfang <dqfext@gmail•com>,
Eric Dumazet <edumazet@google•com>,
Florian Fainelli <f.fainelli@gmail•com>,
Horatiu Vultur <horatiu.vultur@microchip•com>,
Ioana Ciornei <ioana.ciornei@nxp•com>,
Jakub Kicinski <kuba@kernel•org>,
Jose Abreu <Jose.Abreu@synopsys•com>,
Landen Chao <Landen.Chao@mediatek•com>,
Lars Povlsen <lars.povlsen@microchip•com>,
linux-arm-kernel@lists•infradead.org,
linux-mediatek@lists•infradead.org,
Madalin Bucur <madalin.bucur@nxp•com>,
Marcin Wojtas <mw@semihalf•com>,
Matthias Brugger <matthias.bgg@gmail•com>,
Michal Simek <michal.simek@amd•com>,
netdev@vger•kernel.org,
Nicolas Ferre <nicolas.ferre@microchip•com>,
Paolo Abeni <pabeni@redhat•com>,
Radhey Shyam Pandey <radhey.shyam.pandey@xilinx•com>,
Sean Anderson <sean.anderson@seco•com>,
Sean Wang <sean.wang@mediatek•com>,
Steen Hegelund <Steen.Hegelund@microchip•com>,
Taras Chornyi <taras.chornyi@plvision•eu>,
Thomas Petazzoni <thomas.petazzoni@bootlin•com>,
UNGLinuxDriver@microchip•com, Vladimir Oltean <olteanv@gmail•com>
Subject: [PATCH RFC net-next 12/15] net: sparx5: update PCS driver to use neg_mode
Date: Tue, 13 Jun 2023 15:38:29 +0100 [thread overview]
Message-ID: <E1q95AD-00EBwc-9d@rmk-PC.armlinux.org.uk> (raw)
In-Reply-To: <ZIh/CLQ3z89g0Ua0@shell.armlinux.org.uk>
Update Sparx5's embedded PCS driver to use neg_mode rather than the
mode argument. As there is no pcs_link_up() method, this only affects
the pcs_config() method.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux•org.uk>
---
drivers/net/ethernet/microchip/sparx5/sparx5_main.c | 1 +
drivers/net/ethernet/microchip/sparx5/sparx5_phylink.c | 8 ++++----
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
index a7edf524eedb..dc9af480bfea 100644
--- a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
+++ b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
@@ -281,6 +281,7 @@ static int sparx5_create_port(struct sparx5 *sparx5,
spx5_port->custom_etype = 0x8880; /* Vitesse */
spx5_port->phylink_pcs.poll = true;
spx5_port->phylink_pcs.ops = &sparx5_phylink_pcs_ops;
+ spx5_port->phylink_pcs.neg_mode = true;
spx5_port->is_mrouter = false;
INIT_LIST_HEAD(&spx5_port->tc_templates);
sparx5->ports[config->portno] = spx5_port;
diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_phylink.c b/drivers/net/ethernet/microchip/sparx5/sparx5_phylink.c
index bb97d27a1da4..f8562c1a894d 100644
--- a/drivers/net/ethernet/microchip/sparx5/sparx5_phylink.c
+++ b/drivers/net/ethernet/microchip/sparx5/sparx5_phylink.c
@@ -91,8 +91,7 @@ static void sparx5_pcs_get_state(struct phylink_pcs *pcs,
state->pause = status.pause;
}
-static int sparx5_pcs_config(struct phylink_pcs *pcs,
- unsigned int mode,
+static int sparx5_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode,
phy_interface_t interface,
const unsigned long *advertising,
bool permit_pause_to_mac)
@@ -104,8 +103,9 @@ static int sparx5_pcs_config(struct phylink_pcs *pcs,
conf = port->conf;
conf.power_down = false;
conf.portmode = interface;
- conf.inband = phylink_autoneg_inband(mode);
- conf.autoneg = phylink_test(advertising, Autoneg);
+ conf.inband = neg_mode == PHYLINK_PCS_NEG_INBAND_DISABLED ||
+ neg_mode == PHYLINK_PCS_NEG_INBAND_ENABLED;
+ conf.autoneg = neg_mode == PHYLINK_PCS_NEG_INBAND_ENABLED;
conf.pause_adv = 0;
if (phylink_test(advertising, Pause))
conf.pause_adv |= ADVERTISE_1000XPAUSE;
--
2.30.2
next prev parent reply other threads:[~2023-06-13 14:38 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-13 14:36 [PATCH RFC 0/15] Add and use helper for PCS negotiation modes Russell King (Oracle)
2023-06-13 14:37 ` [PATCH RFC net-next 01/15] net: phylink: add PCS negotiation mode Russell King (Oracle)
2023-06-13 15:55 ` Simon Horman
2023-06-13 14:37 ` [PATCH RFC net-next 02/15] net: phylink: convert phylink_mii_c22_pcs_config() to neg_mode Russell King (Oracle)
2023-06-13 14:37 ` [PATCH RFC net-next 03/15] net: phylink: pass neg_mode into phylink_mii_c22_pcs_config() Russell King (Oracle)
2023-06-13 14:37 ` [PATCH RFC net-next 04/15] net: pcs: xpcs: update PCS driver to use neg_mode Russell King (Oracle)
2023-06-13 14:37 ` [PATCH RFC net-next 05/15] net: pcs: lynxi: " Russell King (Oracle)
2023-06-13 14:37 ` [PATCH RFC net-next 06/15] net: pcs: lynx: " Russell King (Oracle)
2023-06-13 14:38 ` [PATCH RFC net-next 07/15] net: lan966x: " Russell King (Oracle)
2023-06-13 14:38 ` [PATCH RFC net-next 08/15] net: mvneta: " Russell King (Oracle)
2023-06-13 14:38 ` [PATCH RFC net-next 09/15] net: mvpp2: " Russell King (Oracle)
2023-06-13 14:38 ` [PATCH RFC net-next 10/15] net: prestera: " Russell King (Oracle)
2023-06-13 16:17 ` [EXT] " Elad Nachman
2023-06-13 14:38 ` [PATCH RFC net-next 11/15] net: qca8k: " Russell King (Oracle)
2023-06-13 14:38 ` Russell King (Oracle) [this message]
2023-06-13 14:38 ` [PATCH RFC net-next 13/15] net: dsa: b53: " Russell King (Oracle)
2023-06-13 14:38 ` [PATCH RFC net-next 14/15] net: dsa: mt7530: " Russell King (Oracle)
2023-06-13 14:38 ` [PATCH RFC net-next 15/15] net: macb: " 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=E1q95AD-00EBwc-9d@rmk-PC.armlinux.org.uk \
--to=rmk+kernel@armlinux$(echo .)org.uk \
--cc=Jose.Abreu@synopsys$(echo .)com \
--cc=Landen.Chao@mediatek$(echo .)com \
--cc=Steen.Hegelund@microchip$(echo .)com \
--cc=UNGLinuxDriver@microchip$(echo .)com \
--cc=andrew@lunn$(echo .)ch \
--cc=angelogioacchino.delregno@collabora$(echo .)com \
--cc=claudiu.beznea@microchip$(echo .)com \
--cc=daniel.machon@microchip$(echo .)com \
--cc=daniel@makrotopia$(echo .)org \
--cc=davem@davemloft$(echo .)net \
--cc=dqfext@gmail$(echo .)com \
--cc=edumazet@google$(echo .)com \
--cc=f.fainelli@gmail$(echo .)com \
--cc=hkallweit1@gmail$(echo .)com \
--cc=horatiu.vultur@microchip$(echo .)com \
--cc=ioana.ciornei@nxp$(echo .)com \
--cc=kuba@kernel$(echo .)org \
--cc=lars.povlsen@microchip$(echo .)com \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=linux-mediatek@lists$(echo .)infradead.org \
--cc=lynxis@fe80$(echo .)eu \
--cc=madalin.bucur@nxp$(echo .)com \
--cc=matthias.bgg@gmail$(echo .)com \
--cc=michal.simek@amd$(echo .)com \
--cc=mw@semihalf$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=nicolas.ferre@microchip$(echo .)com \
--cc=olteanv@gmail$(echo .)com \
--cc=pabeni@redhat$(echo .)com \
--cc=radhey.shyam.pandey@xilinx$(echo .)com \
--cc=sean.anderson@seco$(echo .)com \
--cc=sean.wang@mediatek$(echo .)com \
--cc=taras.chornyi@plvision$(echo .)eu \
--cc=thomas.petazzoni@bootlin$(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