From patchwork Sat Nov 26 00:38:38 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Hutchings X-Patchwork-Id: 127767 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 6D64DB6F9D for ; Sat, 26 Nov 2011 11:38:51 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754136Ab1KZAiq (ORCPT ); Fri, 25 Nov 2011 19:38:46 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:34302 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753937Ab1KZAiq convert rfc822-to-8bit (ORCPT ); Fri, 25 Nov 2011 19:38:46 -0500 Received: from [2001:470:1f08:1539:21c:bfff:fe03:f805] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1RU6I0-0002tv-1Y; Sat, 26 Nov 2011 00:38:44 +0000 Received: from ben by deadeye with local (Exim 4.77) (envelope-from ) id 1RU6Hu-0007ci-QD; Sat, 26 Nov 2011 00:38:38 +0000 Message-ID: <1322267918.2839.388.camel@deadeye> Subject: [PATCH net-next 6/8] dsa: Allow core and drivers to be built as modules From: Ben Hutchings To: David Miller Cc: Lennert Buytenhek , netdev@vger.kernel.org Date: Sat, 26 Nov 2011 00:38:38 +0000 In-Reply-To: <1322267572.2839.381.camel@deadeye> References: <1322267572.2839.381.camel@deadeye> X-Mailer: Evolution 3.0.3-2 Mime-Version: 1.0 X-SA-Exim-Connect-IP: 2001:470:1f08:1539:21c:bfff:fe03:f805 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 Acked-by: Lennert Buytenhek --- 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