linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
To: Andrew Lunn <andrew@lunn.ch>, Heiner Kallweit <hkallweit1@gmail.com>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Jiawen Wu <jiawenwu@trustnetic.com>,
	Jose Abreu <joabreu@synopsys.com>,
	Jose Abreu <Jose.Abreu@synopsys.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-stm32@st-md-mailman.stormreply.com,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Mengyuan Lou <mengyuanlou@net-swift.com>,
	netdev@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>,
	Vladimir Oltean <olteanv@gmail.com>
Subject: [PATCH RFC net-next 04/10] net: pcs: xpcs: add xpcs_destroy_pcs() and xpcs_create_pcs_mdiodev()
Date: Mon, 23 Sep 2024 15:01:15 +0100	[thread overview]
Message-ID: <E1ssjcp-005Nrx-5r@rmk-PC.armlinux.org.uk> (raw)
In-Reply-To: <ZvF0er+vyciwy3Nx@shell.armlinux.org.uk>

Provide xpcs create/destroy functions that return and take a phylink_pcs
pointer instead of an xpcs pointer. This will be used by drivers that
have been converted to use phylink_pcs pointers internally, rather than
dw_xpcs pointers.

As xpcs_create_mdiodev() no longer makes use of its interface argument,
pass PHY_INTERFACE_MODE_NA into xpcs_create_mdiodev() until it is
removed later in the series.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 drivers/net/pcs/pcs-xpcs.c   | 18 ++++++++++++++++++
 include/linux/pcs/pcs-xpcs.h |  3 +++
 2 files changed, 21 insertions(+)

diff --git a/drivers/net/pcs/pcs-xpcs.c b/drivers/net/pcs/pcs-xpcs.c
index 8765b01c0b5d..9b61f97222b9 100644
--- a/drivers/net/pcs/pcs-xpcs.c
+++ b/drivers/net/pcs/pcs-xpcs.c
@@ -1550,6 +1550,18 @@ struct dw_xpcs *xpcs_create_mdiodev(struct mii_bus *bus, int addr,
 }
 EXPORT_SYMBOL_GPL(xpcs_create_mdiodev);
 
+struct phylink_pcs *xpcs_create_pcs_mdiodev(struct mii_bus *bus, int addr)
+{
+	struct dw_xpcs *xpcs;
+
+	xpcs = xpcs_create_mdiodev(bus, addr, PHY_INTERFACE_MODE_NA);
+	if (IS_ERR(xpcs))
+		return ERR_CAST(xpcs);
+
+	return &xpcs->pcs;
+}
+EXPORT_SYMBOL_GPL(xpcs_create_pcs_mdiodev);
+
 /**
  * xpcs_create_fwnode() - Create a DW xPCS instance from @fwnode
  * @fwnode: fwnode handle poining to the DW XPCS device
@@ -1599,5 +1611,11 @@ void xpcs_destroy(struct dw_xpcs *xpcs)
 }
 EXPORT_SYMBOL_GPL(xpcs_destroy);
 
+void xpcs_destroy_pcs(struct phylink_pcs *pcs)
+{
+	xpcs_destroy(phylink_pcs_to_xpcs(pcs));
+}
+EXPORT_SYMBOL_GPL(xpcs_destroy_pcs);
+
 MODULE_DESCRIPTION("Synopsys DesignWare XPCS library");
 MODULE_LICENSE("GPL v2");
diff --git a/include/linux/pcs/pcs-xpcs.h b/include/linux/pcs/pcs-xpcs.h
index fd75d0605bb6..a4e2243ce647 100644
--- a/include/linux/pcs/pcs-xpcs.h
+++ b/include/linux/pcs/pcs-xpcs.h
@@ -78,4 +78,7 @@ struct dw_xpcs *xpcs_create_fwnode(struct fwnode_handle *fwnode,
 				   phy_interface_t interface);
 void xpcs_destroy(struct dw_xpcs *xpcs);
 
+struct phylink_pcs *xpcs_create_pcs_mdiodev(struct mii_bus *bus, int addr);
+void xpcs_destroy_pcs(struct phylink_pcs *pcs);
+
 #endif /* __LINUX_PCS_XPCS_H */
-- 
2.30.2



  parent reply	other threads:[~2024-09-23 14:05 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-23 14:00 [PATCH RFC 00/10] net: pcs: xpcs: cleanups batch 1 Russell King (Oracle)
2024-09-23 14:00 ` [PATCH RFC net-next 01/10] net: pcs: xpcs: move PCS reset to .pcs_pre_config() Russell King (Oracle)
2024-09-25 12:44   ` Vladimir Oltean
2024-09-29 22:16   ` Serge Semin
2024-09-30 10:14     ` Russell King (Oracle)
2024-10-01 20:20       ` Serge Semin
2024-09-23 14:01 ` [PATCH RFC net-next 02/10] net: pcs: xpcs: drop interface argument from internal functions Russell King (Oracle)
2024-09-25 12:47   ` Vladimir Oltean
2024-09-23 14:01 ` [PATCH RFC net-next 03/10] net: pcs: xpcs: get rid of xpcs_init_iface() Russell King (Oracle)
2024-09-25 12:48   ` Vladimir Oltean
2024-09-23 14:01 ` Russell King (Oracle) [this message]
2024-09-25 12:50   ` [PATCH RFC net-next 04/10] net: pcs: xpcs: add xpcs_destroy_pcs() and xpcs_create_pcs_mdiodev() Vladimir Oltean
2024-09-23 14:01 ` [PATCH RFC net-next 05/10] net: wangxun: txgbe: use phylink_pcs internally Russell King (Oracle)
2024-09-23 14:01 ` [PATCH RFC net-next 06/10] net: dsa: sja1105: simplify static configuration reload Russell King (Oracle)
2024-09-25 13:15   ` Vladimir Oltean
2024-09-25 19:38     ` Russell King (Oracle)
2024-09-25 21:16       ` Vladimir Oltean
2024-09-26 12:02         ` Russell King (Oracle)
2024-09-26 14:06           ` Vladimir Oltean
2024-09-23 14:01 ` [PATCH RFC net-next 07/10] net: dsa: sja1105: call PCS config/link_up via pcs_ops structure Russell King (Oracle)
2024-09-25 13:30   ` Vladimir Oltean
2024-09-23 14:01 ` [PATCH RFC net-next 08/10] net: dsa: sja1105: use phylink_pcs internally Russell King (Oracle)
2024-09-25 13:34   ` Vladimir Oltean
2024-09-23 14:01 ` [PATCH RFC net-next 09/10] net: pcs: xpcs: drop interface argument from xpcs_create*() Russell King (Oracle)
2024-09-25 13:36   ` Vladimir Oltean
2024-09-23 14:01 ` [PATCH RFC net-next 10/10] net: pcs: xpcs: make xpcs_do_config() and xpcs_link_up() internal Russell King (Oracle)
2024-09-25 13:38   ` Vladimir Oltean
2024-09-23 15:02 ` [PATCH RFC 00/10] net: pcs: xpcs: cleanups batch 1 Maxime Chevallier
2024-09-25 13:43 ` Vladimir Oltean
2024-09-26 11:41   ` Russell King (Oracle)
2024-09-26 13:49     ` Vladimir Oltean

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=E1ssjcp-005Nrx-5r@rmk-PC.armlinux.org.uk \
    --to=rmk+kernel@armlinux.org.uk \
    --cc=Jose.Abreu@synopsys.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=jiawenwu@trustnetic.com \
    --cc=joabreu@synopsys.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=mengyuanlou@net-swift.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    /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 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).