[PATCH net-next 05/13] net: pcs: xpcs: move definition of struct dw_xpcs to private header
Russell King (Oracle)
rmk+kernel at armlinux.org.uk
Fri Oct 4 03:21:01 PDT 2024
There should be no reason for anything outside the XPCS code to know
the contents of struct dw_xpcs - this is a private structure to XPCS.
Move the definition to the private pcs-xpcs.h header, leaving a
declaration in the global pcs/pcs-xpcs.h
Signed-off-by: Russell King (Oracle) <rmk+kernel at armlinux.org.uk>
---
drivers/net/pcs/pcs-xpcs.h | 18 ++++++++++++++++++
include/linux/pcs/pcs-xpcs.h | 18 +-----------------
2 files changed, 19 insertions(+), 17 deletions(-)
diff --git a/drivers/net/pcs/pcs-xpcs.h b/drivers/net/pcs/pcs-xpcs.h
index fa05adfae220..1b546eae8280 100644
--- a/drivers/net/pcs/pcs-xpcs.h
+++ b/drivers/net/pcs/pcs-xpcs.h
@@ -123,6 +123,24 @@
#define DW_XPCS_INFO_DECLARE(_name, _pcs, _pma) \
static const struct dw_xpcs_info _name = { .pcs = _pcs, .pma = _pma }
+struct dw_xpcs_desc;
+
+enum dw_xpcs_clock {
+ DW_XPCS_CORE_CLK,
+ DW_XPCS_PAD_CLK,
+ DW_XPCS_NUM_CLKS,
+};
+
+struct dw_xpcs {
+ struct dw_xpcs_info info;
+ const struct dw_xpcs_desc *desc;
+ struct mdio_device *mdiodev;
+ struct clk_bulk_data clks[DW_XPCS_NUM_CLKS];
+ struct phylink_pcs pcs;
+ phy_interface_t interface;
+ bool need_reset;
+};
+
int xpcs_read(struct dw_xpcs *xpcs, int dev, u32 reg);
int xpcs_write(struct dw_xpcs *xpcs, int dev, u32 reg, u16 val);
int xpcs_read_vpcs(struct dw_xpcs *xpcs, int reg);
diff --git a/include/linux/pcs/pcs-xpcs.h b/include/linux/pcs/pcs-xpcs.h
index 868515f3cc88..b5b5d17998b8 100644
--- a/include/linux/pcs/pcs-xpcs.h
+++ b/include/linux/pcs/pcs-xpcs.h
@@ -21,8 +21,6 @@
#define DW_AN_C37_1000BASEX 4
#define DW_10GBASER 5
-struct dw_xpcs_desc;
-
enum dw_xpcs_pcs_id {
DW_XPCS_ID_NATIVE = 0,
NXP_SJA1105_XPCS_ID = 0x00000010,
@@ -48,21 +46,7 @@ struct dw_xpcs_info {
u32 pma;
};
-enum dw_xpcs_clock {
- DW_XPCS_CORE_CLK,
- DW_XPCS_PAD_CLK,
- DW_XPCS_NUM_CLKS,
-};
-
-struct dw_xpcs {
- struct dw_xpcs_info info;
- const struct dw_xpcs_desc *desc;
- struct mdio_device *mdiodev;
- struct clk_bulk_data clks[DW_XPCS_NUM_CLKS];
- struct phylink_pcs pcs;
- phy_interface_t interface;
- bool need_reset;
-};
+struct dw_xpcs;
struct phylink_pcs *xpcs_to_phylink_pcs(struct dw_xpcs *xpcs);
int xpcs_get_an_mode(struct dw_xpcs *xpcs, phy_interface_t interface);
--
2.30.2
More information about the linux-arm-kernel
mailing list