net: pcs: Move XPCS into new PCS subdirectory
authorAndrew Lunn <andrew@lunn.ch>
Thu, 27 Aug 2020 02:00:28 +0000 (04:00 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 27 Aug 2020 13:55:50 +0000 (06:55 -0700)
Create drivers/net/pcs and move the Synopsys DesignWare XPCS into the
new directory. Move the header file into a subdirectory
include/linux/pcs

Start a naming convention of all PCS files use the prefix pcs-, and
rename the XPCS files to fit.

v2:
Add include/linux/pcs

v4:
Fix include path in stmmac.
Remove PCS_DEVICES to avoid new prompts

Cc: Jose Abreu <Jose.Abreu@synopsys.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
MAINTAINERS
drivers/net/Kconfig
drivers/net/Makefile
drivers/net/ethernet/stmicro/stmmac/Kconfig
drivers/net/ethernet/stmicro/stmmac/common.h
drivers/net/pcs/Kconfig [new file with mode: 0644]
drivers/net/pcs/Makefile [new file with mode: 0644]
drivers/net/pcs/pcs-xpcs.c [moved from drivers/net/phy/mdio-xpcs.c with 99% similarity]
drivers/net/phy/Kconfig
drivers/net/phy/Makefile
include/linux/pcs/pcs-xpcs.h [moved from include/linux/mdio-xpcs.h with 88% similarity]

index 36ec0bd..347ed69 100644 (file)
@@ -6513,6 +6513,7 @@ F:        Documentation/devicetree/bindings/net/ethernet-phy.yaml
 F:     Documentation/devicetree/bindings/net/mdio*
 F:     Documentation/devicetree/bindings/net/qca,ar803x.yaml
 F:     Documentation/networking/phy.rst
+F:     drivers/net/pcs/
 F:     drivers/net/phy/
 F:     drivers/of/of_mdio.c
 F:     drivers/of/of_net.c
@@ -16730,8 +16731,8 @@ SYNOPSYS DESIGNWARE ETHERNET XPCS DRIVER
 M:     Jose Abreu <Jose.Abreu@synopsys.com>
 L:     netdev@vger.kernel.org
 S:     Supported
-F:     drivers/net/phy/mdio-xpcs.c
-F:     include/linux/mdio-xpcs.h
+F:     drivers/net/pcs/pcs-xpcs.c
+F:     include/linux/pcs/pcs-xpcs.h
 
 SYNOPSYS DESIGNWARE I2C DRIVER
 M:     Jarkko Nikula <jarkko.nikula@linux.intel.com>
index 1368d1d..2b07566 100644 (file)
@@ -473,6 +473,8 @@ config NET_SB1000
 
 source "drivers/net/phy/Kconfig"
 
+source "drivers/net/pcs/Kconfig"
+
 source "drivers/net/plip/Kconfig"
 
 source "drivers/net/ppp/Kconfig"
index 94b6080..f7402d7 100644 (file)
@@ -21,6 +21,7 @@ obj-$(CONFIG_MDIO) += mdio.o
 obj-$(CONFIG_NET) += Space.o loopback.o
 obj-$(CONFIG_NETCONSOLE) += netconsole.o
 obj-y += phy/
+obj-y += pcs/
 obj-$(CONFIG_RIONET) += rionet.o
 obj-$(CONFIG_NET_TEAM) += team/
 obj-$(CONFIG_TUN) += tun.o
index 7572cea..53f14c5 100644 (file)
@@ -3,7 +3,7 @@ config STMMAC_ETH
        tristate "STMicroelectronics Multi-Gigabit Ethernet driver"
        depends on HAS_IOMEM && HAS_DMA
        select MII
-       select MDIO_XPCS
+       select PCS_XPCS
        select PAGE_POOL
        select PHYLINK
        select CRC32
index 127f758..acc5e3f 100644 (file)
@@ -15,7 +15,7 @@
 #include <linux/netdevice.h>
 #include <linux/stmmac.h>
 #include <linux/phy.h>
-#include <linux/mdio-xpcs.h>
+#include <linux/pcs/pcs-xpcs.h>
 #include <linux/module.h>
 #if IS_ENABLED(CONFIG_VLAN_8021Q)
 #define STMMAC_VLAN_TAG_USED
diff --git a/drivers/net/pcs/Kconfig b/drivers/net/pcs/Kconfig
new file mode 100644 (file)
index 0000000..9d6e2be
--- /dev/null
@@ -0,0 +1,16 @@
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# PCS Layer Configuration
+#
+
+menu "PCS device drivers"
+
+config PCS_XPCS
+       tristate "Synopsys DesignWare XPCS controller"
+       select MDIO_BUS
+       depends on MDIO_DEVICE
+       help
+         This module provides helper functions for Synopsys DesignWare XPCS
+         controllers.
+
+endmenu
diff --git a/drivers/net/pcs/Makefile b/drivers/net/pcs/Makefile
new file mode 100644 (file)
index 0000000..f0480af
--- /dev/null
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
+# Makefile for Linux PCS drivers
+
+obj-$(CONFIG_PCS_XPCS)         += pcs-xpcs.o
similarity index 99%
rename from drivers/net/phy/mdio-xpcs.c
rename to drivers/net/pcs/pcs-xpcs.c
index 0d66a8b..1aa9903 100644 (file)
@@ -7,8 +7,8 @@
  */
 
 #include <linux/delay.h>
+#include <linux/pcs/pcs-xpcs.h>
 #include <linux/mdio.h>
-#include <linux/mdio-xpcs.h>
 #include <linux/phylink.h>
 #include <linux/workqueue.h>
 
index 726e4b2..c69cc80 100644 (file)
@@ -234,12 +234,6 @@ config MDIO_XGENE
          This module provides a driver for the MDIO busses found in the
          APM X-Gene SoC's.
 
-config MDIO_XPCS
-       tristate "Synopsys DesignWare XPCS controller"
-       help
-         This module provides helper functions for Synopsys DesignWare XPCS
-         controllers.
-
 endif
 endif
 
index d84bab4..7cd8a0d 100644 (file)
@@ -47,7 +47,6 @@ obj-$(CONFIG_MDIO_OCTEON)     += mdio-octeon.o
 obj-$(CONFIG_MDIO_SUN4I)       += mdio-sun4i.o
 obj-$(CONFIG_MDIO_THUNDER)     += mdio-thunder.o
 obj-$(CONFIG_MDIO_XGENE)       += mdio-xgene.o
-obj-$(CONFIG_MDIO_XPCS)                += mdio-xpcs.o
 
 obj-$(CONFIG_NETWORK_PHY_TIMESTAMPING) += mii_timestamper.o
 
similarity index 88%
rename from include/linux/mdio-xpcs.h
rename to include/linux/pcs/pcs-xpcs.h
index 9a841aa..351c1c9 100644 (file)
@@ -4,8 +4,8 @@
  * Synopsys DesignWare XPCS helpers
  */
 
-#ifndef __LINUX_MDIO_XPCS_H
-#define __LINUX_MDIO_XPCS_H
+#ifndef __LINUX_PCS_XPCS_H
+#define __LINUX_PCS_XPCS_H
 
 #include <linux/phy.h>
 #include <linux/phylink.h>
@@ -29,7 +29,7 @@ struct mdio_xpcs_ops {
        int (*probe)(struct mdio_xpcs_args *xpcs, phy_interface_t interface);
 };
 
-#if IS_ENABLED(CONFIG_MDIO_XPCS)
+#if IS_ENABLED(CONFIG_PCS_XPCS)
 struct mdio_xpcs_ops *mdio_xpcs_get_ops(void);
 #else
 static inline struct mdio_xpcs_ops *mdio_xpcs_get_ops(void)
@@ -38,4 +38,4 @@ static inline struct mdio_xpcs_ops *mdio_xpcs_get_ops(void)
 }
 #endif
 
-#endif /* __LINUX_MDIO_XPCS_H */
+#endif /* __LINUX_PCS_XPCS_H */