netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Hutchings <ben@decadent.org.uk>
To: David Miller <davem@davemloft.net>
Cc: Lennert Buytenhek <buytenh@wantstofly.org>, netdev@vger.kernel.org
Subject: [PATCH net-next 6/8] dsa: Allow core and drivers to be built as modules
Date: Sat, 26 Nov 2011 00:38:38 +0000	[thread overview]
Message-ID: <1322267918.2839.388.camel@deadeye> (raw)
In-Reply-To: <1322267572.2839.381.camel@deadeye>

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: Ben Hutchings <ben@decadent.org.uk>
---
I've tested that the all-modules configuration works as far as building
and loading them, but no further.

Ben.

 include/linux/netdevice.h |    2 +-
 net/dsa/Kconfig           |   10 +++++-----
 net/dsa/Makefile          |    8 ++++++--
 3 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 63721a6..87f7353 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1079,7 +1079,7 @@ struct net_device {
 #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
 	struct vlan_group __rcu	*vlgrp;		/* VLAN group */
 #endif
-#ifdef CONFIG_NET_DSA
+#if IS_ENABLED(CONFIG_NET_DSA)
 	struct dsa_switch_tree	*dsa_ptr;	/* dsa specific data */
 #endif
 	void 			*atalk_ptr;	/* AppleTalk link 	*/
diff --git a/net/dsa/Kconfig b/net/dsa/Kconfig
index c53ded2..7e12303 100644
--- a/net/dsa/Kconfig
+++ b/net/dsa/Kconfig
@@ -1,5 +1,5 @@
 menuconfig NET_DSA
-	bool "Distributed Switch Architecture support"
+	tristate "Distributed Switch Architecture support"
 	default n
 	depends on EXPERIMENTAL && NETDEVICES && !S390
 	select PHYLIB
@@ -26,11 +26,11 @@ config NET_DSA_TAG_TRAILER
 
 # switch drivers
 config NET_DSA_MV88E6XXX
-	bool
+	tristate
 	default n
 
 config NET_DSA_MV88E6060
-	bool "Marvell 88E6060 ethernet switch chip support"
+	tristate "Marvell 88E6060 ethernet switch chip support"
 	select NET_DSA_TAG_TRAILER
 	---help---
 	  This enables support for the Marvell 88E6060 ethernet switch
@@ -41,7 +41,7 @@ config NET_DSA_MV88E6XXX_NEED_PPU
 	default n
 
 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_NEED_PPU
 	select NET_DSA_TAG_DSA
@@ -50,7 +50,7 @@ config NET_DSA_MV88E6131
 	  ethernet switch chips.
 
 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_TAG_EDSA
 	---help---
diff --git a/net/dsa/Makefile b/net/dsa/Makefile
index 5c48ac5..191dd48 100644
--- a/net/dsa/Makefile
+++ b/net/dsa/Makefile
@@ -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_MV88E6XXX) += mv88e6xxx_drv.o
 mv88e6xxx_drv-y += mv88e6xxx.o
-mv88e6xxx_drv-$(CONFIG_NET_DSA_MV88E6123_61_65) += mv88e6123_61_65.o
-mv88e6xxx_drv-$(CONFIG_NET_DSA_MV88E6131) += mv88e6131.o
+ifdef CONFIG_NET_DSA_MV88E6123_61_65
+mv88e6xxx_drv-y += mv88e6123_61_65.o
+endif
+ifdef CONFIG_NET_DSA_MV88E6131
+mv88e6xxx_drv-y += mv88e6131.o
+endif
-- 
1.7.7.3

  parent reply	other threads:[~2011-11-26  0:38 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-26  0:32 [PATCH net-next 1/8] dsa: Change dsa_uses_{dsa,trailer}_tags() into inline functions Ben Hutchings
2011-11-26  0:34 ` [PATCH net-next 2/8] dsa: Export functions from core to modules Ben Hutchings
2011-11-27 19:15   ` Lennert Buytenhek
2011-11-27 22:38     ` Ben Hutchings
2011-11-26  0:35 ` [PATCH net-next 3/8] dsa: Combine core and tagging code Ben Hutchings
2011-11-27 19:16   ` Lennert Buytenhek
2011-11-26  0:36 ` [PATCH net-next 4/8] mv88e6xxx: Combine mv88e6131 and mv88e612_61_65 drivers Ben Hutchings
2011-11-27 19:18   ` Lennert Buytenhek
2011-11-26  0:37 ` [PATCH net-next 5/8] dsa: Define module author, description, license and aliases for drivers Ben Hutchings
2011-11-27 19:17   ` Lennert Buytenhek
2011-11-26  0:38 ` Ben Hutchings [this message]
2011-11-27 19:19   ` [PATCH net-next 6/8] dsa: Allow core and drivers to be built as modules Lennert Buytenhek
2011-11-27 22:39     ` Ben Hutchings
2011-11-26  0:40 ` [PATCH net-next 7/8] net: Revert ARCNET and PHYLIB to tristate options Ben Hutchings
2011-11-26 19:42   ` David Miller
2011-11-26  0:40 ` [PATCH net-next 8/8] net: Use IS_ENABLED() in netdevice.h as appropriate Ben Hutchings
2011-11-27 19:12 ` [PATCH net-next 1/8] dsa: Change dsa_uses_{dsa,trailer}_tags() into inline functions Lennert Buytenhek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1322267918.2839.388.camel@deadeye \
    --to=ben@decadent.org.uk \
    --cc=buytenh@wantstofly.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).