Commit c8005511 authored by Vladimir Oltean's avatar Vladimir Oltean Committed by Jakub Kicinski

net: dsa: ocelot: build felix.c into a dedicated kernel module

The build system currently complains:

scripts/Makefile.build:252: drivers/net/dsa/ocelot/Makefile:
felix.o is added to multiple modules: mscc_felix mscc_seville

Since felix.c holds the DSA glue layer, create a mscc_felix_dsa_lib.ko.
This is similar to how mscc_ocelot_switch_lib.ko holds a library for
configuring the hardware.
Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
Acked-by: default avatarColin Foster <colin.foster@in-advantage.com>
Link: https://lore.kernel.org/r/20230125145716.271355-1-vladimir.oltean@nxp.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 82fe335b
# SPDX-License-Identifier: GPL-2.0-only # SPDX-License-Identifier: GPL-2.0-only
config NET_DSA_MSCC_FELIX_DSA_LIB
tristate
help
This is an umbrella module for all network switches that are
register-compatible with Ocelot and that perform I/O to their host
CPU through an NPI (Node Processor Interface) Ethernet port.
Its name comes from the first hardware chip to make use of it
(VSC9959), code named Felix.
config NET_DSA_MSCC_FELIX config NET_DSA_MSCC_FELIX
tristate "Ocelot / Felix Ethernet switch support" tristate "Ocelot / Felix Ethernet switch support"
depends on NET_DSA && PCI depends on NET_DSA && PCI
...@@ -8,6 +17,7 @@ config NET_DSA_MSCC_FELIX ...@@ -8,6 +17,7 @@ config NET_DSA_MSCC_FELIX
depends on PTP_1588_CLOCK_OPTIONAL depends on PTP_1588_CLOCK_OPTIONAL
depends on NET_SCH_TAPRIO || NET_SCH_TAPRIO=n depends on NET_SCH_TAPRIO || NET_SCH_TAPRIO=n
select MSCC_OCELOT_SWITCH_LIB select MSCC_OCELOT_SWITCH_LIB
select NET_DSA_MSCC_FELIX_DSA_LIB
select NET_DSA_TAG_OCELOT_8021Q select NET_DSA_TAG_OCELOT_8021Q
select NET_DSA_TAG_OCELOT select NET_DSA_TAG_OCELOT
select FSL_ENETC_MDIO select FSL_ENETC_MDIO
...@@ -24,6 +34,7 @@ config NET_DSA_MSCC_SEVILLE ...@@ -24,6 +34,7 @@ config NET_DSA_MSCC_SEVILLE
depends on PTP_1588_CLOCK_OPTIONAL depends on PTP_1588_CLOCK_OPTIONAL
select MDIO_MSCC_MIIM select MDIO_MSCC_MIIM
select MSCC_OCELOT_SWITCH_LIB select MSCC_OCELOT_SWITCH_LIB
select NET_DSA_MSCC_FELIX_DSA_LIB
select NET_DSA_TAG_OCELOT_8021Q select NET_DSA_TAG_OCELOT_8021Q
select NET_DSA_TAG_OCELOT select NET_DSA_TAG_OCELOT
select PCS_LYNX select PCS_LYNX
......
# SPDX-License-Identifier: GPL-2.0-only # SPDX-License-Identifier: GPL-2.0-only
obj-$(CONFIG_NET_DSA_MSCC_FELIX_DSA_LIB) += mscc_felix_dsa_lib.o
obj-$(CONFIG_NET_DSA_MSCC_FELIX) += mscc_felix.o obj-$(CONFIG_NET_DSA_MSCC_FELIX) += mscc_felix.o
obj-$(CONFIG_NET_DSA_MSCC_SEVILLE) += mscc_seville.o obj-$(CONFIG_NET_DSA_MSCC_SEVILLE) += mscc_seville.o
mscc_felix-objs := \ mscc_felix_dsa_lib-objs := felix.o
felix.o \ mscc_felix-objs := felix_vsc9959.o
felix_vsc9959.o mscc_seville-objs := seville_vsc9953.o
mscc_seville-objs := \
felix.o \
seville_vsc9953.o
...@@ -2131,6 +2131,7 @@ const struct dsa_switch_ops felix_switch_ops = { ...@@ -2131,6 +2131,7 @@ const struct dsa_switch_ops felix_switch_ops = {
.port_set_host_flood = felix_port_set_host_flood, .port_set_host_flood = felix_port_set_host_flood,
.port_change_master = felix_port_change_master, .port_change_master = felix_port_change_master,
}; };
EXPORT_SYMBOL_GPL(felix_switch_ops);
struct net_device *felix_port_to_netdev(struct ocelot *ocelot, int port) struct net_device *felix_port_to_netdev(struct ocelot *ocelot, int port)
{ {
...@@ -2142,6 +2143,7 @@ struct net_device *felix_port_to_netdev(struct ocelot *ocelot, int port) ...@@ -2142,6 +2143,7 @@ struct net_device *felix_port_to_netdev(struct ocelot *ocelot, int port)
return dsa_to_port(ds, port)->slave; return dsa_to_port(ds, port)->slave;
} }
EXPORT_SYMBOL_GPL(felix_port_to_netdev);
int felix_netdev_to_port(struct net_device *dev) int felix_netdev_to_port(struct net_device *dev)
{ {
...@@ -2153,3 +2155,7 @@ int felix_netdev_to_port(struct net_device *dev) ...@@ -2153,3 +2155,7 @@ int felix_netdev_to_port(struct net_device *dev)
return dp->index; return dp->index;
} }
EXPORT_SYMBOL_GPL(felix_netdev_to_port);
MODULE_DESCRIPTION("Felix DSA library");
MODULE_LICENSE("GPL");
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment