]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: stmmac: Relocate extern declarations in common.h and hwif.h
authorFurong Xu <0x1207@gmail.com>
Sun, 8 Dec 2024 07:02:02 +0000 (15:02 +0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 11 Dec 2024 02:24:36 +0000 (18:24 -0800)
The extern declarations should be in a header file that corresponds to
their definition, move these extern declarations to its header file.
Some of them have nowhere to go, so move them to hwif.h since they are
referenced in hwif.c only.

dwmac100_* dwmac1000_* dwmac4_* dwmac410_* dwmac510_* stay in hwif.h,
otherwise you will be flooded with name conflicts from dwmac100.h,
dwmac1000.h and dwmac4.h if hwif.c try to #include these .h files.

Compile tested only.
No functional change intended.

Suggested-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: Furong Xu <0x1207@gmail.com>
Link: https://patch.msgid.link/20241208070202.203931-1-0x1207@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/common.h
drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.h
drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h
drivers/net/ethernet/stmicro/stmmac/hwif.c
drivers/net/ethernet/stmicro/stmmac/hwif.h
drivers/net/ethernet/stmicro/stmmac/mmc.h
drivers/net/ethernet/stmicro/stmmac/stmmac_est.h
drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h

index 70d601f454811b3d6986dff955c0874f1cf383eb..e25db747a81a5bf2c5b11298b3be1ddebfae4f32 100644 (file)
@@ -545,18 +545,8 @@ struct dma_features {
 #define STMMAC_VLAN_INSERT     0x2
 #define STMMAC_VLAN_REPLACE    0x3
 
-extern const struct stmmac_desc_ops enh_desc_ops;
-extern const struct stmmac_desc_ops ndesc_ops;
-
 struct mac_device_info;
 
-extern const struct stmmac_hwtimestamp stmmac_ptp;
-extern const struct stmmac_hwtimestamp dwmac1000_ptp;
-extern const struct stmmac_mode_ops dwmac4_ring_mode_ops;
-
-extern const struct ptp_clock_info stmmac_ptp_clock_ops;
-extern const struct ptp_clock_info dwmac1000_ptp_clock_ops;
-
 struct mac_link {
        u32 caps;
        u32 speed_mask;
@@ -643,8 +633,4 @@ void stmmac_dwmac4_set_mac(void __iomem *ioaddr, bool enable);
 
 void dwmac_dma_flush_tx_fifo(void __iomem *ioaddr);
 
-extern const struct stmmac_mode_ops ring_mode_ops;
-extern const struct stmmac_mode_ops chain_mode_ops;
-extern const struct stmmac_desc_ops dwmac4_desc_ops;
-
 #endif /* __COMMON_H__ */
index 1ce6f43d545ae6dfe1a82714443d9c84dd4afe0c..806555976496ed575edbe21c4f8da073430cbe3e 100644 (file)
 /* TDS3 use for both format (read and write back) */
 #define RDES3_OWN                      BIT(31)
 
+extern const struct stmmac_mode_ops dwmac4_ring_mode_ops;
+extern const struct stmmac_desc_ops dwmac4_desc_ops;
+
 #endif /* __DWMAC4_DESCS_H__ */
index a04a790036927fda7e8b8b19269c09879938d791..20027d3c25a79a6cc6af91c857a99dfc6ce35531 100644 (file)
 #define XGMAC_RDES3_TSD                        BIT(6)
 #define XGMAC_RDES3_TSA                        BIT(4)
 
+extern const struct stmmac_ops dwxgmac210_ops;
+extern const struct stmmac_ops dwxlgmac2_ops;
+extern const struct stmmac_dma_ops dwxgmac210_dma_ops;
+extern const struct stmmac_desc_ops dwxgmac210_desc_ops;
+
 #endif /* __STMMAC_DWXGMAC2_H__ */
index a72d336a835080b337faff42f94bba20eff66cee..4bd79de2e22208db6d55b9d275f957a6b094010b 100644 (file)
@@ -9,6 +9,8 @@
 #include "stmmac_fpe.h"
 #include "stmmac_ptp.h"
 #include "stmmac_est.h"
+#include "dwmac4_descs.h"
+#include "dwxgmac2.h"
 
 static u32 stmmac_get_id(struct stmmac_priv *priv, u32 id_reg)
 {
index 64f8ed67dcc4abe954314e13ef9611589bab5802..e428c82b7d317e74deaec3a932604c1420823512 100644 (file)
@@ -665,6 +665,15 @@ struct stmmac_regs_off {
        u32 est_off;
 };
 
+extern const struct stmmac_desc_ops enh_desc_ops;
+extern const struct stmmac_desc_ops ndesc_ops;
+
+extern const struct stmmac_hwtimestamp stmmac_ptp;
+extern const struct stmmac_hwtimestamp dwmac1000_ptp;
+
+extern const struct stmmac_mode_ops ring_mode_ops;
+extern const struct stmmac_mode_ops chain_mode_ops;
+
 extern const struct stmmac_ops dwmac100_ops;
 extern const struct stmmac_dma_ops dwmac100_dma_ops;
 extern const struct stmmac_ops dwmac1000_ops;
@@ -677,13 +686,6 @@ extern const struct stmmac_ops dwmac510_ops;
 extern const struct stmmac_tc_ops dwmac4_tc_ops;
 extern const struct stmmac_tc_ops dwmac510_tc_ops;
 extern const struct stmmac_tc_ops dwxgmac_tc_ops;
-extern const struct stmmac_ops dwxgmac210_ops;
-extern const struct stmmac_ops dwxlgmac2_ops;
-extern const struct stmmac_dma_ops dwxgmac210_dma_ops;
-extern const struct stmmac_desc_ops dwxgmac210_desc_ops;
-extern const struct stmmac_mmc_ops dwmac_mmc_ops;
-extern const struct stmmac_mmc_ops dwxgmac_mmc_ops;
-extern const struct stmmac_est_ops dwmac510_est_ops;
 
 #define GMAC_VERSION           0x00000020      /* GMAC CORE Version */
 #define GMAC4_VERSION          0x00000110      /* GMAC4+ CORE Version */
index 5d1ea3e07459a390f2d561b4147c7c0c3f33e4ce..1cba39fb2c44ccce9a1ebd7d893fed112bb5e76f 100644 (file)
@@ -139,4 +139,7 @@ struct stmmac_counters {
        unsigned int mmc_rx_fpe_fragment_cntr;
 };
 
+extern const struct stmmac_mmc_ops dwmac_mmc_ops;
+extern const struct stmmac_mmc_ops dwxgmac_mmc_ops;
+
 #endif /* __MMC_H__ */
index 7a858c566e7e5da04736e389a856c1e6e174639d..d247fa383a6e44a5a8371dd491eab5b1c99cd1f2 100644 (file)
@@ -62,3 +62,5 @@
 #define EST_SRWO                       BIT(0)
 
 #define EST_GCL_DATA                   0x00000034
+
+extern const struct stmmac_est_ops dwmac510_est_ops;
index 4cc70480ce0f0d0485fa1dc2053d0b35d1348f8d..3fe0e3a80e80ac594a7af71f39adaf59de39d6ec 100644 (file)
@@ -104,4 +104,7 @@ int dwmac1000_ptp_enable(struct ptp_clock_info *ptp,
 void dwmac1000_get_ptptime(void __iomem *ptpaddr, u64 *ptp_time);
 void dwmac1000_timestamp_interrupt(struct stmmac_priv *priv);
 
+extern const struct ptp_clock_info stmmac_ptp_clock_ops;
+extern const struct ptp_clock_info dwmac1000_ptp_clock_ops;
+
 #endif /* __STMMAC_PTP_H__ */