Commit 34a430d7 authored by Ben Hutchings's avatar Ben Hutchings Committed by David S. Miller

dsa: Allow core and drivers to be built as modules

Change the kconfig types to tristate and adjust the condition for
declaring net_device::dsa_ptr to allow for this.

Adjust the makefile so that if NET_DSA_MV88E6123_61_65=y and
NET_DSA_MV88E6131=m or vice versa then both drivers are built-in.  We
could leave these options as bool and make NET_DSA_MV88E6XXX a
user-selected option, but that would break existing configurations.
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3d825ede
...@@ -1079,7 +1079,7 @@ struct net_device { ...@@ -1079,7 +1079,7 @@ struct net_device {
#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
struct vlan_group __rcu *vlgrp; /* VLAN group */ struct vlan_group __rcu *vlgrp; /* VLAN group */
#endif #endif
#ifdef CONFIG_NET_DSA #if IS_ENABLED(CONFIG_NET_DSA)
struct dsa_switch_tree *dsa_ptr; /* dsa specific data */ struct dsa_switch_tree *dsa_ptr; /* dsa specific data */
#endif #endif
void *atalk_ptr; /* AppleTalk link */ void *atalk_ptr; /* AppleTalk link */
......
menuconfig NET_DSA menuconfig NET_DSA
bool "Distributed Switch Architecture support" tristate "Distributed Switch Architecture support"
default n default n
depends on EXPERIMENTAL && NETDEVICES && !S390 depends on EXPERIMENTAL && NETDEVICES && !S390
select PHYLIB select PHYLIB
...@@ -26,11 +26,11 @@ config NET_DSA_TAG_TRAILER ...@@ -26,11 +26,11 @@ config NET_DSA_TAG_TRAILER
# switch drivers # switch drivers
config NET_DSA_MV88E6XXX config NET_DSA_MV88E6XXX
bool tristate
default n default n
config NET_DSA_MV88E6060 config NET_DSA_MV88E6060
bool "Marvell 88E6060 ethernet switch chip support" tristate "Marvell 88E6060 ethernet switch chip support"
select NET_DSA_TAG_TRAILER select NET_DSA_TAG_TRAILER
---help--- ---help---
This enables support for the Marvell 88E6060 ethernet switch This enables support for the Marvell 88E6060 ethernet switch
...@@ -41,7 +41,7 @@ config NET_DSA_MV88E6XXX_NEED_PPU ...@@ -41,7 +41,7 @@ config NET_DSA_MV88E6XXX_NEED_PPU
default n default n
config NET_DSA_MV88E6131 config NET_DSA_MV88E6131
bool "Marvell 88E6085/6095/6095F/6131 ethernet switch chip support" tristate "Marvell 88E6085/6095/6095F/6131 ethernet switch chip support"
select NET_DSA_MV88E6XXX select NET_DSA_MV88E6XXX
select NET_DSA_MV88E6XXX_NEED_PPU select NET_DSA_MV88E6XXX_NEED_PPU
select NET_DSA_TAG_DSA select NET_DSA_TAG_DSA
...@@ -50,7 +50,7 @@ config NET_DSA_MV88E6131 ...@@ -50,7 +50,7 @@ config NET_DSA_MV88E6131
ethernet switch chips. ethernet switch chips.
config NET_DSA_MV88E6123_61_65 config NET_DSA_MV88E6123_61_65
bool "Marvell 88E6123/6161/6165 ethernet switch chip support" tristate "Marvell 88E6123/6161/6165 ethernet switch chip support"
select NET_DSA_MV88E6XXX select NET_DSA_MV88E6XXX
select NET_DSA_TAG_EDSA select NET_DSA_TAG_EDSA
---help--- ---help---
......
...@@ -11,5 +11,9 @@ dsa_core-$(CONFIG_NET_DSA_TAG_TRAILER) += tag_trailer.o ...@@ -11,5 +11,9 @@ dsa_core-$(CONFIG_NET_DSA_TAG_TRAILER) += tag_trailer.o
obj-$(CONFIG_NET_DSA_MV88E6060) += mv88e6060.o obj-$(CONFIG_NET_DSA_MV88E6060) += mv88e6060.o
obj-$(CONFIG_NET_DSA_MV88E6XXX) += mv88e6xxx_drv.o obj-$(CONFIG_NET_DSA_MV88E6XXX) += mv88e6xxx_drv.o
mv88e6xxx_drv-y += mv88e6xxx.o mv88e6xxx_drv-y += mv88e6xxx.o
mv88e6xxx_drv-$(CONFIG_NET_DSA_MV88E6123_61_65) += mv88e6123_61_65.o ifdef CONFIG_NET_DSA_MV88E6123_61_65
mv88e6xxx_drv-$(CONFIG_NET_DSA_MV88E6131) += mv88e6131.o mv88e6xxx_drv-y += mv88e6123_61_65.o
endif
ifdef CONFIG_NET_DSA_MV88E6131
mv88e6xxx_drv-y += mv88e6131.o
endif
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