Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: stmmac: Relocate extern declarations in common.h and hwif.h

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>

authored by

Furong Xu and committed by
Jakub Kicinski
46afe345 23c57f40

+27 -21
-14
drivers/net/ethernet/stmicro/stmmac/common.h
··· 545 545 #define STMMAC_VLAN_INSERT 0x2 546 546 #define STMMAC_VLAN_REPLACE 0x3 547 547 548 - extern const struct stmmac_desc_ops enh_desc_ops; 549 - extern const struct stmmac_desc_ops ndesc_ops; 550 - 551 548 struct mac_device_info; 552 - 553 - extern const struct stmmac_hwtimestamp stmmac_ptp; 554 - extern const struct stmmac_hwtimestamp dwmac1000_ptp; 555 - extern const struct stmmac_mode_ops dwmac4_ring_mode_ops; 556 - 557 - extern const struct ptp_clock_info stmmac_ptp_clock_ops; 558 - extern const struct ptp_clock_info dwmac1000_ptp_clock_ops; 559 549 560 550 struct mac_link { 561 551 u32 caps; ··· 632 642 void stmmac_dwmac4_set_mac(void __iomem *ioaddr, bool enable); 633 643 634 644 void dwmac_dma_flush_tx_fifo(void __iomem *ioaddr); 635 - 636 - extern const struct stmmac_mode_ops ring_mode_ops; 637 - extern const struct stmmac_mode_ops chain_mode_ops; 638 - extern const struct stmmac_desc_ops dwmac4_desc_ops; 639 645 640 646 #endif /* __COMMON_H__ */
+3
drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.h
··· 144 144 /* TDS3 use for both format (read and write back) */ 145 145 #define RDES3_OWN BIT(31) 146 146 147 + extern const struct stmmac_mode_ops dwmac4_ring_mode_ops; 148 + extern const struct stmmac_desc_ops dwmac4_desc_ops; 149 + 147 150 #endif /* __DWMAC4_DESCS_H__ */
+5
drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h
··· 493 493 #define XGMAC_RDES3_TSD BIT(6) 494 494 #define XGMAC_RDES3_TSA BIT(4) 495 495 496 + extern const struct stmmac_ops dwxgmac210_ops; 497 + extern const struct stmmac_ops dwxlgmac2_ops; 498 + extern const struct stmmac_dma_ops dwxgmac210_dma_ops; 499 + extern const struct stmmac_desc_ops dwxgmac210_desc_ops; 500 + 496 501 #endif /* __STMMAC_DWXGMAC2_H__ */
+2
drivers/net/ethernet/stmicro/stmmac/hwif.c
··· 9 9 #include "stmmac_fpe.h" 10 10 #include "stmmac_ptp.h" 11 11 #include "stmmac_est.h" 12 + #include "dwmac4_descs.h" 13 + #include "dwxgmac2.h" 12 14 13 15 static u32 stmmac_get_id(struct stmmac_priv *priv, u32 id_reg) 14 16 {
+9 -7
drivers/net/ethernet/stmicro/stmmac/hwif.h
··· 665 665 u32 est_off; 666 666 }; 667 667 668 + extern const struct stmmac_desc_ops enh_desc_ops; 669 + extern const struct stmmac_desc_ops ndesc_ops; 670 + 671 + extern const struct stmmac_hwtimestamp stmmac_ptp; 672 + extern const struct stmmac_hwtimestamp dwmac1000_ptp; 673 + 674 + extern const struct stmmac_mode_ops ring_mode_ops; 675 + extern const struct stmmac_mode_ops chain_mode_ops; 676 + 668 677 extern const struct stmmac_ops dwmac100_ops; 669 678 extern const struct stmmac_dma_ops dwmac100_dma_ops; 670 679 extern const struct stmmac_ops dwmac1000_ops; ··· 686 677 extern const struct stmmac_tc_ops dwmac4_tc_ops; 687 678 extern const struct stmmac_tc_ops dwmac510_tc_ops; 688 679 extern const struct stmmac_tc_ops dwxgmac_tc_ops; 689 - extern const struct stmmac_ops dwxgmac210_ops; 690 - extern const struct stmmac_ops dwxlgmac2_ops; 691 - extern const struct stmmac_dma_ops dwxgmac210_dma_ops; 692 - extern const struct stmmac_desc_ops dwxgmac210_desc_ops; 693 - extern const struct stmmac_mmc_ops dwmac_mmc_ops; 694 - extern const struct stmmac_mmc_ops dwxgmac_mmc_ops; 695 - extern const struct stmmac_est_ops dwmac510_est_ops; 696 680 697 681 #define GMAC_VERSION 0x00000020 /* GMAC CORE Version */ 698 682 #define GMAC4_VERSION 0x00000110 /* GMAC4+ CORE Version */
+3
drivers/net/ethernet/stmicro/stmmac/mmc.h
··· 139 139 unsigned int mmc_rx_fpe_fragment_cntr; 140 140 }; 141 141 142 + extern const struct stmmac_mmc_ops dwmac_mmc_ops; 143 + extern const struct stmmac_mmc_ops dwxgmac_mmc_ops; 144 + 142 145 #endif /* __MMC_H__ */
+2
drivers/net/ethernet/stmicro/stmmac/stmmac_est.h
··· 62 62 #define EST_SRWO BIT(0) 63 63 64 64 #define EST_GCL_DATA 0x00000034 65 + 66 + extern const struct stmmac_est_ops dwmac510_est_ops;
+3
drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h
··· 104 104 void dwmac1000_get_ptptime(void __iomem *ptpaddr, u64 *ptp_time); 105 105 void dwmac1000_timestamp_interrupt(struct stmmac_priv *priv); 106 106 107 + extern const struct ptp_clock_info stmmac_ptp_clock_ops; 108 + extern const struct ptp_clock_info dwmac1000_ptp_clock_ops; 109 + 107 110 #endif /* __STMMAC_PTP_H__ */