All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 1/8] dsa: Change dsa_uses_{dsa,trailer}_tags() into inline functions
@ 2011-11-26  0:32 Ben Hutchings
  2011-11-26  0:34 ` [PATCH net-next 2/8] dsa: Export functions from core to modules Ben Hutchings
                   ` (7 more replies)
  0 siblings, 8 replies; 17+ messages in thread
From: Ben Hutchings @ 2011-11-26  0:32 UTC (permalink / raw)
  To: David Miller; +Cc: Lennert Buytenhek, netdev

eth_type_trans() will use these functions if DSA is enabled, which
blocks building DSA as a module.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 include/linux/netdevice.h |    2 +-
 include/net/dsa.h         |   53 +++++++++++++++++++++++++++++++++++++++++++-
 net/dsa/dsa.c             |   23 -------------------
 net/dsa/dsa_priv.h        |   33 ----------------------------
 4 files changed, 52 insertions(+), 59 deletions(-)

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 999bb26..63721a6 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1080,7 +1080,7 @@ struct net_device {
 	struct vlan_group __rcu	*vlgrp;		/* VLAN group */
 #endif
 #ifdef CONFIG_NET_DSA
-	void			*dsa_ptr;	/* dsa specific data */
+	struct dsa_switch_tree	*dsa_ptr;	/* dsa specific data */
 #endif
 	void 			*atalk_ptr;	/* AppleTalk link 	*/
 	struct in_device __rcu	*ip_ptr;	/* IPv4 specific data	*/
diff --git a/include/net/dsa.h b/include/net/dsa.h
index 839f768..32a1b49 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -11,6 +11,9 @@
 #ifndef __LINUX_NET_DSA_H
 #define __LINUX_NET_DSA_H
 
+#include <linux/timer.h>
+#include <linux/workqueue.h>
+
 #define DSA_MAX_SWITCHES	4
 #define DSA_MAX_PORTS		12
 
@@ -54,8 +57,54 @@ struct dsa_platform_data {
 	struct dsa_chip_data	*chip;
 };
 
-extern bool dsa_uses_dsa_tags(void *dsa_ptr);
-extern bool dsa_uses_trailer_tags(void *dsa_ptr);
+struct dsa_switch_tree {
+	/*
+	 * Configuration data for the platform device that owns
+	 * this dsa switch tree instance.
+	 */
+	struct dsa_platform_data	*pd;
+
+	/*
+	 * Reference to network device to use, and which tagging
+	 * protocol to use.
+	 */
+	struct net_device	*master_netdev;
+	__be16			tag_protocol;
+
+	/*
+	 * The switch and port to which the CPU is attached.
+	 */
+	s8			cpu_switch;
+	s8			cpu_port;
+
+	/*
+	 * Link state polling.
+	 */
+	int			link_poll_needed;
+	struct work_struct	link_poll_work;
+	struct timer_list	link_poll_timer;
+
+	/*
+	 * Data for the individual switch chips.
+	 */
+	struct dsa_switch	*ds[DSA_MAX_SWITCHES];
+};
+
+/*
+ * The original DSA tag format and some other tag formats have no
+ * ethertype, which means that we need to add a little hack to the
+ * networking receive path to make sure that received frames get
+ * the right ->protocol assigned to them when one of those tag
+ * formats is in use.
+ */
+static inline bool dsa_uses_dsa_tags(struct dsa_switch_tree *dst)
+{
+	return !!(dst->tag_protocol == htons(ETH_P_DSA));
+}
 
+static inline bool dsa_uses_trailer_tags(struct dsa_switch_tree *dst)
+{
+	return !!(dst->tag_protocol == htons(ETH_P_TRAILER));
+}
 
 #endif
diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
index 0dc1589..66f5c04 100644
--- a/net/dsa/dsa.c
+++ b/net/dsa/dsa.c
@@ -199,29 +199,6 @@ static void dsa_switch_destroy(struct dsa_switch *ds)
 }
 

-/* hooks for ethertype-less tagging formats *********************************/
-/*
- * The original DSA tag format and some other tag formats have no
- * ethertype, which means that we need to add a little hack to the
- * networking receive path to make sure that received frames get
- * the right ->protocol assigned to them when one of those tag
- * formats is in use.
- */
-bool dsa_uses_dsa_tags(void *dsa_ptr)
-{
-	struct dsa_switch_tree *dst = dsa_ptr;
-
-	return !!(dst->tag_protocol == htons(ETH_P_DSA));
-}
-
-bool dsa_uses_trailer_tags(void *dsa_ptr)
-{
-	struct dsa_switch_tree *dst = dsa_ptr;
-
-	return !!(dst->tag_protocol == htons(ETH_P_TRAILER));
-}
-
-
 /* link polling *************************************************************/
 static void dsa_link_poll_work(struct work_struct *ugly)
 {
diff --git a/net/dsa/dsa_priv.h b/net/dsa/dsa_priv.h
index 4b0ea05..a45186cb 100644
--- a/net/dsa/dsa_priv.h
+++ b/net/dsa/dsa_priv.h
@@ -48,39 +48,6 @@ struct dsa_switch {
 	struct net_device	*ports[DSA_MAX_PORTS];
 };
 
-struct dsa_switch_tree {
-	/*
-	 * Configuration data for the platform device that owns
-	 * this dsa switch tree instance.
-	 */
-	struct dsa_platform_data	*pd;
-
-	/*
-	 * Reference to network device to use, and which tagging
-	 * protocol to use.
-	 */
-	struct net_device	*master_netdev;
-	__be16			tag_protocol;
-
-	/*
-	 * The switch and port to which the CPU is attached.
-	 */
-	s8			cpu_switch;
-	s8			cpu_port;
-
-	/*
-	 * Link state polling.
-	 */
-	int			link_poll_needed;
-	struct work_struct	link_poll_work;
-	struct timer_list	link_poll_timer;
-
-	/*
-	 * Data for the individual switch chips.
-	 */
-	struct dsa_switch	*ds[DSA_MAX_SWITCHES];
-};
-
 static inline bool dsa_is_cpu_port(struct dsa_switch *ds, int p)
 {
 	return !!(ds->index == ds->dst->cpu_switch && p == ds->dst->cpu_port);
-- 
1.7.7.3

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH net-next 2/8] dsa: Export functions from core to modules
  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 ` Ben Hutchings
  2011-11-27 19:15   ` Lennert Buytenhek
  2011-11-26  0:35 ` [PATCH net-next 3/8] dsa: Combine core and tagging code Ben Hutchings
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 17+ messages in thread
From: Ben Hutchings @ 2011-11-26  0:34 UTC (permalink / raw)
  To: David Miller; +Cc: Lennert Buytenhek, netdev

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 net/dsa/dsa.c   |    2 ++
 net/dsa/slave.c |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
index 66f5c04..fc93088 100644
--- a/net/dsa/dsa.c
+++ b/net/dsa/dsa.c
@@ -29,6 +29,7 @@ void register_switch_driver(struct dsa_switch_driver *drv)
 	list_add_tail(&drv->list, &dsa_switch_drivers);
 	mutex_unlock(&dsa_switch_drivers_mutex);
 }
+EXPORT_SYMBOL_GPL(register_switch_driver);
 
 void unregister_switch_driver(struct dsa_switch_driver *drv)
 {
@@ -36,6 +37,7 @@ void unregister_switch_driver(struct dsa_switch_driver *drv)
 	list_del_init(&drv->list);
 	mutex_unlock(&dsa_switch_drivers_mutex);
 }
+EXPORT_SYMBOL_GPL(unregister_switch_driver);
 
 static struct dsa_switch_driver *
 dsa_switch_probe(struct mii_bus *bus, int sw_addr, char **_name)
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 56cf9b8..c9d52ca 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -45,6 +45,7 @@ void dsa_slave_mii_bus_init(struct dsa_switch *ds)
 			ds->master_mii_bus->id, ds->pd->sw_addr);
 	ds->slave_mii_bus->parent = &ds->master_mii_bus->dev;
 }
+EXPORT_SYMBOL_GPL(dsa_slave_mii_bus_init);
 

 /* slave device handling ****************************************************/
@@ -402,3 +403,4 @@ dsa_slave_create(struct dsa_switch *ds, struct device *parent,
 
 	return slave_dev;
 }
+EXPORT_SYMBOL_GPL(dsa_slave_create);
-- 
1.7.7.3

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH net-next 3/8] dsa: Combine core and tagging code
  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-26  0:35 ` 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
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 17+ messages in thread
From: Ben Hutchings @ 2011-11-26  0:35 UTC (permalink / raw)
  To: David Miller; +Cc: Lennert Buytenhek, netdev

These files have circular dependencies, so if we make DSA modular then
they must be built into the same module.  Therefore, link them
together and merge their respective module init and exit functions.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 net/dsa/Makefile      |   13 +++++++------
 net/dsa/dsa.c         |   26 +++++++++++++++++++++++++-
 net/dsa/dsa_priv.h    |    3 +++
 net/dsa/tag_dsa.c     |   15 +--------------
 net/dsa/tag_edsa.c    |   15 +--------------
 net/dsa/tag_trailer.c |   15 +--------------
 6 files changed, 38 insertions(+), 49 deletions(-)

diff --git a/net/dsa/Makefile b/net/dsa/Makefile
index 2374faf..5431b4a 100644
--- a/net/dsa/Makefile
+++ b/net/dsa/Makefile
@@ -1,13 +1,14 @@
+# the core
+obj-$(CONFIG_NET_DSA) += dsa_core.o
+dsa_core-y += dsa.o slave.o
+
 # tagging formats
-obj-$(CONFIG_NET_DSA_TAG_DSA) += tag_dsa.o
-obj-$(CONFIG_NET_DSA_TAG_EDSA) += tag_edsa.o
-obj-$(CONFIG_NET_DSA_TAG_TRAILER) += tag_trailer.o
+dsa_core-$(CONFIG_NET_DSA_TAG_DSA) += tag_dsa.o
+dsa_core-$(CONFIG_NET_DSA_TAG_EDSA) += tag_edsa.o
+dsa_core-$(CONFIG_NET_DSA_TAG_TRAILER) += tag_trailer.o
 
 # switch drivers
 obj-$(CONFIG_NET_DSA_MV88E6XXX) += mv88e6xxx.o
 obj-$(CONFIG_NET_DSA_MV88E6060) += mv88e6060.o
 obj-$(CONFIG_NET_DSA_MV88E6123_61_65) += mv88e6123_61_65.o
 obj-$(CONFIG_NET_DSA_MV88E6131) += mv88e6131.o
-
-# the core
-obj-$(CONFIG_NET_DSA) += dsa.o slave.o
diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
index fc93088..88e7c2f 100644
--- a/net/dsa/dsa.c
+++ b/net/dsa/dsa.c
@@ -398,12 +398,36 @@ static struct platform_driver dsa_driver = {
 
 static int __init dsa_init_module(void)
 {
-	return platform_driver_register(&dsa_driver);
+	int rc;
+
+	rc = platform_driver_register(&dsa_driver);
+	if (rc)
+		return rc;
+
+#ifdef CONFIG_NET_DSA_TAG_DSA
+	dev_add_pack(&dsa_packet_type);
+#endif
+#ifdef CONFIG_NET_DSA_TAG_EDSA
+	dev_add_pack(&edsa_packet_type);
+#endif
+#ifdef CONFIG_NET_DSA_TAG_TRAILER
+	dev_add_pack(&trailer_packet_type);
+#endif
+	return 0;
 }
 module_init(dsa_init_module);
 
 static void __exit dsa_cleanup_module(void)
 {
+#ifdef CONFIG_NET_DSA_TAG_TRAILER
+	dev_remove_pack(&trailer_packet_type);
+#endif
+#ifdef CONFIG_NET_DSA_TAG_EDSA
+	dev_remove_pack(&edsa_packet_type);
+#endif
+#ifdef CONFIG_NET_DSA_TAG_DSA
+	dev_remove_pack(&dsa_packet_type);
+#endif
 	platform_driver_unregister(&dsa_driver);
 }
 module_exit(dsa_cleanup_module);
diff --git a/net/dsa/dsa_priv.h b/net/dsa/dsa_priv.h
index a45186cb..89a2eb4 100644
--- a/net/dsa/dsa_priv.h
+++ b/net/dsa/dsa_priv.h
@@ -137,12 +137,15 @@ struct net_device *dsa_slave_create(struct dsa_switch *ds,
 
 /* tag_dsa.c */
 netdev_tx_t dsa_xmit(struct sk_buff *skb, struct net_device *dev);
+extern struct packet_type dsa_packet_type;
 
 /* tag_edsa.c */
 netdev_tx_t edsa_xmit(struct sk_buff *skb, struct net_device *dev);
+extern struct packet_type edsa_packet_type;
 
 /* tag_trailer.c */
 netdev_tx_t trailer_xmit(struct sk_buff *skb, struct net_device *dev);
+extern struct packet_type trailer_packet_type;
 

 #endif
diff --git a/net/dsa/tag_dsa.c b/net/dsa/tag_dsa.c
index 98dfe80..cacce1e 100644
--- a/net/dsa/tag_dsa.c
+++ b/net/dsa/tag_dsa.c
@@ -186,20 +186,7 @@ out:
 	return 0;
 }
 
-static struct packet_type dsa_packet_type __read_mostly = {
+struct packet_type dsa_packet_type __read_mostly = {
 	.type	= cpu_to_be16(ETH_P_DSA),
 	.func	= dsa_rcv,
 };
-
-static int __init dsa_init_module(void)
-{
-	dev_add_pack(&dsa_packet_type);
-	return 0;
-}
-module_init(dsa_init_module);
-
-static void __exit dsa_cleanup_module(void)
-{
-	dev_remove_pack(&dsa_packet_type);
-}
-module_exit(dsa_cleanup_module);
diff --git a/net/dsa/tag_edsa.c b/net/dsa/tag_edsa.c
index 6f38332..e70c43c 100644
--- a/net/dsa/tag_edsa.c
+++ b/net/dsa/tag_edsa.c
@@ -205,20 +205,7 @@ out:
 	return 0;
 }
 
-static struct packet_type edsa_packet_type __read_mostly = {
+struct packet_type edsa_packet_type __read_mostly = {
 	.type	= cpu_to_be16(ETH_P_EDSA),
 	.func	= edsa_rcv,
 };
-
-static int __init edsa_init_module(void)
-{
-	dev_add_pack(&edsa_packet_type);
-	return 0;
-}
-module_init(edsa_init_module);
-
-static void __exit edsa_cleanup_module(void)
-{
-	dev_remove_pack(&edsa_packet_type);
-}
-module_exit(edsa_cleanup_module);
diff --git a/net/dsa/tag_trailer.c b/net/dsa/tag_trailer.c
index d6d7d0a..94bc260 100644
--- a/net/dsa/tag_trailer.c
+++ b/net/dsa/tag_trailer.c
@@ -114,20 +114,7 @@ out:
 	return 0;
 }
 
-static struct packet_type trailer_packet_type __read_mostly = {
+struct packet_type trailer_packet_type __read_mostly = {
 	.type	= cpu_to_be16(ETH_P_TRAILER),
 	.func	= trailer_rcv,
 };
-
-static int __init trailer_init_module(void)
-{
-	dev_add_pack(&trailer_packet_type);
-	return 0;
-}
-module_init(trailer_init_module);
-
-static void __exit trailer_cleanup_module(void)
-{
-	dev_remove_pack(&trailer_packet_type);
-}
-module_exit(trailer_cleanup_module);
-- 
1.7.7.3

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH net-next 4/8] mv88e6xxx: Combine mv88e6131 and mv88e612_61_65 drivers
  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-26  0:35 ` [PATCH net-next 3/8] dsa: Combine core and tagging code Ben Hutchings
@ 2011-11-26  0:36 ` 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
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 17+ messages in thread
From: Ben Hutchings @ 2011-11-26  0:36 UTC (permalink / raw)
  To: David Miller; +Cc: Lennert Buytenhek, netdev

These drivers share a lot of code, so if we make them modular they
should be built into the same module.  Therefore, link them together
and merge their respective module init and exit functions.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 net/dsa/Makefile          |    7 ++++---
 net/dsa/mv88e6123_61_65.c |   15 +--------------
 net/dsa/mv88e6131.c       |   15 +--------------
 net/dsa/mv88e6xxx.c       |   23 +++++++++++++++++++++++
 net/dsa/mv88e6xxx.h       |    3 +++
 5 files changed, 32 insertions(+), 31 deletions(-)

diff --git a/net/dsa/Makefile b/net/dsa/Makefile
index 5431b4a..5c48ac5 100644
--- a/net/dsa/Makefile
+++ b/net/dsa/Makefile
@@ -8,7 +8,8 @@ dsa_core-$(CONFIG_NET_DSA_TAG_EDSA) += tag_edsa.o
 dsa_core-$(CONFIG_NET_DSA_TAG_TRAILER) += tag_trailer.o
 
 # switch drivers
-obj-$(CONFIG_NET_DSA_MV88E6XXX) += mv88e6xxx.o
 obj-$(CONFIG_NET_DSA_MV88E6060) += mv88e6060.o
-obj-$(CONFIG_NET_DSA_MV88E6123_61_65) += mv88e6123_61_65.o
-obj-$(CONFIG_NET_DSA_MV88E6131) += mv88e6131.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
diff --git a/net/dsa/mv88e6123_61_65.c b/net/dsa/mv88e6123_61_65.c
index 52faaa2..7951a6c 100644
--- a/net/dsa/mv88e6123_61_65.c
+++ b/net/dsa/mv88e6123_61_65.c
@@ -419,7 +419,7 @@ static int mv88e6123_61_65_get_sset_count(struct dsa_switch *ds)
 	return ARRAY_SIZE(mv88e6123_61_65_hw_stats);
 }
 
-static struct dsa_switch_driver mv88e6123_61_65_switch_driver = {
+struct dsa_switch_driver mv88e6123_61_65_switch_driver = {
 	.tag_protocol		= cpu_to_be16(ETH_P_EDSA),
 	.priv_size		= sizeof(struct mv88e6xxx_priv_state),
 	.probe			= mv88e6123_61_65_probe,
@@ -432,16 +432,3 @@ static struct dsa_switch_driver mv88e6123_61_65_switch_driver = {
 	.get_ethtool_stats	= mv88e6123_61_65_get_ethtool_stats,
 	.get_sset_count		= mv88e6123_61_65_get_sset_count,
 };
-
-static int __init mv88e6123_61_65_init(void)
-{
-	register_switch_driver(&mv88e6123_61_65_switch_driver);
-	return 0;
-}
-module_init(mv88e6123_61_65_init);
-
-static void __exit mv88e6123_61_65_cleanup(void)
-{
-	unregister_switch_driver(&mv88e6123_61_65_switch_driver);
-}
-module_exit(mv88e6123_61_65_cleanup);
diff --git a/net/dsa/mv88e6131.c b/net/dsa/mv88e6131.c
index 9bd1061..45f4123 100644
--- a/net/dsa/mv88e6131.c
+++ b/net/dsa/mv88e6131.c
@@ -415,7 +415,7 @@ static int mv88e6131_get_sset_count(struct dsa_switch *ds)
 	return ARRAY_SIZE(mv88e6131_hw_stats);
 }
 
-static struct dsa_switch_driver mv88e6131_switch_driver = {
+struct dsa_switch_driver mv88e6131_switch_driver = {
 	.tag_protocol		= cpu_to_be16(ETH_P_DSA),
 	.priv_size		= sizeof(struct mv88e6xxx_priv_state),
 	.probe			= mv88e6131_probe,
@@ -428,16 +428,3 @@ static struct dsa_switch_driver mv88e6131_switch_driver = {
 	.get_ethtool_stats	= mv88e6131_get_ethtool_stats,
 	.get_sset_count		= mv88e6131_get_sset_count,
 };
-
-static int __init mv88e6131_init(void)
-{
-	register_switch_driver(&mv88e6131_switch_driver);
-	return 0;
-}
-module_init(mv88e6131_init);
-
-static void __exit mv88e6131_cleanup(void)
-{
-	unregister_switch_driver(&mv88e6131_switch_driver);
-}
-module_exit(mv88e6131_cleanup);
diff --git a/net/dsa/mv88e6xxx.c b/net/dsa/mv88e6xxx.c
index efe661a..50fd860 100644
--- a/net/dsa/mv88e6xxx.c
+++ b/net/dsa/mv88e6xxx.c
@@ -520,3 +520,26 @@ void mv88e6xxx_get_ethtool_stats(struct dsa_switch *ds,
 
 	mutex_unlock(&ps->stats_mutex);
 }
+
+static int __init mv88e6xxx_init(void)
+{
+#if IS_ENABLED(CONFIG_NET_DSA_MV88E6131)
+	register_switch_driver(&mv88e6131_switch_driver);
+#endif
+#if IS_ENABLED(CONFIG_NET_DSA_MV88E6123_61_65)
+	register_switch_driver(&mv88e6123_61_65_switch_driver);
+#endif
+	return 0;
+}
+module_init(mv88e6xxx_init);
+
+static void __exit mv88e6xxx_cleanup(void)
+{
+#if IS_ENABLED(CONFIG_NET_DSA_MV88E6123_61_65)
+	unregister_switch_driver(&mv88e6123_61_65_switch_driver);
+#endif
+#if IS_ENABLED(CONFIG_NET_DSA_MV88E6131)
+	unregister_switch_driver(&mv88e6131_switch_driver);
+#endif
+}
+module_exit(mv88e6xxx_cleanup);
diff --git a/net/dsa/mv88e6xxx.h b/net/dsa/mv88e6xxx.h
index 61156ca2..fc2cd7b 100644
--- a/net/dsa/mv88e6xxx.h
+++ b/net/dsa/mv88e6xxx.h
@@ -71,6 +71,9 @@ void mv88e6xxx_get_ethtool_stats(struct dsa_switch *ds,
 				 int nr_stats, struct mv88e6xxx_hw_stat *stats,
 				 int port, uint64_t *data);
 
+extern struct dsa_switch_driver mv88e6131_switch_driver;
+extern struct dsa_switch_driver mv88e6123_61_65_switch_driver;
+
 #define REG_READ(addr, reg)						\
 	({								\
 		int __ret;						\
-- 
1.7.7.3

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH net-next 5/8] dsa: Define module author, description, license and aliases for drivers
  2011-11-26  0:32 [PATCH net-next 1/8] dsa: Change dsa_uses_{dsa,trailer}_tags() into inline functions Ben Hutchings
                   ` (2 preceding siblings ...)
  2011-11-26  0:36 ` [PATCH net-next 4/8] mv88e6xxx: Combine mv88e6131 and mv88e612_61_65 drivers Ben Hutchings
@ 2011-11-26  0:37 ` Ben Hutchings
  2011-11-27 19:17   ` Lennert Buytenhek
  2011-11-26  0:38 ` [PATCH net-next 6/8] dsa: Allow core and drivers to be built as modules Ben Hutchings
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 17+ messages in thread
From: Ben Hutchings @ 2011-11-26  0:37 UTC (permalink / raw)
  To: David Miller; +Cc: Lennert Buytenhek, netdev

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 net/dsa/mv88e6060.c       |    5 +++++
 net/dsa/mv88e6123_61_65.c |    4 ++++
 net/dsa/mv88e6131.c       |    5 +++++
 net/dsa/mv88e6xxx.c       |    4 ++++
 4 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/net/dsa/mv88e6060.c b/net/dsa/mv88e6060.c
index 8f4ff5a..0e028df 100644
--- a/net/dsa/mv88e6060.c
+++ b/net/dsa/mv88e6060.c
@@ -286,3 +286,8 @@ static void __exit mv88e6060_cleanup(void)
 	unregister_switch_driver(&mv88e6060_switch_driver);
 }
 module_exit(mv88e6060_cleanup);
+
+MODULE_AUTHOR("Lennert Buytenhek <buytenh@wantstofly.org>");
+MODULE_DESCRIPTION("Driver for Marvell 88E6060 ethernet switch chip");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:mv88e6060");
diff --git a/net/dsa/mv88e6123_61_65.c b/net/dsa/mv88e6123_61_65.c
index 7951a6c..6504405 100644
--- a/net/dsa/mv88e6123_61_65.c
+++ b/net/dsa/mv88e6123_61_65.c
@@ -432,3 +432,7 @@ struct dsa_switch_driver mv88e6123_61_65_switch_driver = {
 	.get_ethtool_stats	= mv88e6123_61_65_get_ethtool_stats,
 	.get_sset_count		= mv88e6123_61_65_get_sset_count,
 };
+
+MODULE_ALIAS("platform:mv88e6123");
+MODULE_ALIAS("platform:mv88e6161");
+MODULE_ALIAS("platform:mv88e6165");
diff --git a/net/dsa/mv88e6131.c b/net/dsa/mv88e6131.c
index 45f4123..6786ba4 100644
--- a/net/dsa/mv88e6131.c
+++ b/net/dsa/mv88e6131.c
@@ -428,3 +428,8 @@ struct dsa_switch_driver mv88e6131_switch_driver = {
 	.get_ethtool_stats	= mv88e6131_get_ethtool_stats,
 	.get_sset_count		= mv88e6131_get_sset_count,
 };
+
+MODULE_ALIAS("platform:mv88e6085");
+MODULE_ALIAS("platform:mv88e6095");
+MODULE_ALIAS("platform:mv88e6095f");
+MODULE_ALIAS("platform:mv88e6131");
diff --git a/net/dsa/mv88e6xxx.c b/net/dsa/mv88e6xxx.c
index 50fd860..cacd955 100644
--- a/net/dsa/mv88e6xxx.c
+++ b/net/dsa/mv88e6xxx.c
@@ -543,3 +543,7 @@ static void __exit mv88e6xxx_cleanup(void)
 #endif
 }
 module_exit(mv88e6xxx_cleanup);
+
+MODULE_AUTHOR("Lennert Buytenhek <buytenh@wantstofly.org>");
+MODULE_DESCRIPTION("Driver for Marvell 88E6XXX ethernet switch chips");
+MODULE_LICENSE("GPL");
-- 
1.7.7.3

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH net-next 6/8] dsa: Allow core and drivers to be built as modules
  2011-11-26  0:32 [PATCH net-next 1/8] dsa: Change dsa_uses_{dsa,trailer}_tags() into inline functions Ben Hutchings
                   ` (3 preceding siblings ...)
  2011-11-26  0:37 ` [PATCH net-next 5/8] dsa: Define module author, description, license and aliases for drivers Ben Hutchings
@ 2011-11-26  0:38 ` Ben Hutchings
  2011-11-27 19:19   ` Lennert Buytenhek
  2011-11-26  0:40 ` [PATCH net-next 7/8] net: Revert ARCNET and PHYLIB to tristate options Ben Hutchings
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 17+ messages in thread
From: Ben Hutchings @ 2011-11-26  0:38 UTC (permalink / raw)
  To: David Miller; +Cc: Lennert Buytenhek, netdev

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

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH net-next 7/8] net: Revert ARCNET and PHYLIB to tristate options
  2011-11-26  0:32 [PATCH net-next 1/8] dsa: Change dsa_uses_{dsa,trailer}_tags() into inline functions Ben Hutchings
                   ` (4 preceding siblings ...)
  2011-11-26  0:38 ` [PATCH net-next 6/8] dsa: Allow core and drivers to be built as modules Ben Hutchings
@ 2011-11-26  0:40 ` 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
  7 siblings, 1 reply; 17+ messages in thread
From: Ben Hutchings @ 2011-11-26  0:40 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

commit 88491d8103498a6166f70d5999902fec70924314 ("drivers/net: Kconfig
& Makefile cleanup") changed the type of these options to bool, but
they select code that could (and still can) be built as modules.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
Yes David, they do still build this way.  Even in an allmodconfig
configuration, now.  And I still really want this in net.

Ben.

 drivers/net/arcnet/Kconfig |    2 +-
 drivers/net/phy/Kconfig    |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/arcnet/Kconfig b/drivers/net/arcnet/Kconfig
index a73d9dc..84fb634 100644
--- a/drivers/net/arcnet/Kconfig
+++ b/drivers/net/arcnet/Kconfig
@@ -4,7 +4,7 @@
 
 menuconfig ARCNET
 	depends on NETDEVICES && (ISA || PCI || PCMCIA)
-	bool "ARCnet support"
+	tristate "ARCnet support"
 	---help---
 	  If you have a network card of this type, say Y and check out the
 	  (arguably) beautiful poetry in
diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
index bb88e12..a702443 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -3,7 +3,7 @@
 #
 
 menuconfig PHYLIB
-	bool "PHY Device support and infrastructure"
+	tristate "PHY Device support and infrastructure"
 	depends on !S390
 	depends on NETDEVICES
 	help
-- 
1.7.7.3

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH net-next 8/8] net: Use IS_ENABLED() in netdevice.h as appropriate
  2011-11-26  0:32 [PATCH net-next 1/8] dsa: Change dsa_uses_{dsa,trailer}_tags() into inline functions Ben Hutchings
                   ` (5 preceding siblings ...)
  2011-11-26  0:40 ` [PATCH net-next 7/8] net: Revert ARCNET and PHYLIB to tristate options Ben Hutchings
@ 2011-11-26  0:40 ` Ben Hutchings
  2011-11-27 19:12 ` [PATCH net-next 1/8] dsa: Change dsa_uses_{dsa,trailer}_tags() into inline functions Lennert Buytenhek
  7 siblings, 0 replies; 17+ messages in thread
From: Ben Hutchings @ 2011-11-26  0:40 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 include/linux/netdevice.h |   18 ++++++++----------
 1 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 87f7353..ac9a4b9 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -144,22 +144,20 @@ static inline bool dev_xmit_complete(int rc)
  *	used.
  */
 
-#if defined(CONFIG_WLAN) || defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE)
+#if defined(CONFIG_WLAN) || IS_ENABLED(CONFIG_AX25)
 # if defined(CONFIG_MAC80211_MESH)
 #  define LL_MAX_HEADER 128
 # else
 #  define LL_MAX_HEADER 96
 # endif
-#elif defined(CONFIG_TR) || defined(CONFIG_TR_MODULE)
+#elif IS_ENABLED(CONFIG_TR)
 # define LL_MAX_HEADER 48
 #else
 # define LL_MAX_HEADER 32
 #endif
 
-#if !defined(CONFIG_NET_IPIP) && !defined(CONFIG_NET_IPIP_MODULE) && \
-    !defined(CONFIG_NET_IPGRE) &&  !defined(CONFIG_NET_IPGRE_MODULE) && \
-    !defined(CONFIG_IPV6_SIT) && !defined(CONFIG_IPV6_SIT_MODULE) && \
-    !defined(CONFIG_IPV6_TUNNEL) && !defined(CONFIG_IPV6_TUNNEL_MODULE)
+#if !IS_ENABLED(CONFIG_NET_IPIP) && !IS_ENABLED(CONFIG_NET_IPGRE) && \
+    !IS_ENABLED(CONFIG_IPV6_SIT) && !IS_ENABLED(CONFIG_IPV6_TUNNEL)
 #define MAX_HEADER LL_MAX_HEADER
 #else
 #define MAX_HEADER (LL_MAX_HEADER + 48)
@@ -922,7 +920,7 @@ struct net_device_ops {
 	int			(*ndo_get_vf_port)(struct net_device *dev,
 						   int vf, struct sk_buff *skb);
 	int			(*ndo_setup_tc)(struct net_device *dev, u8 tc);
-#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
+#if IS_ENABLED(CONFIG_FCOE)
 	int			(*ndo_fcoe_enable)(struct net_device *dev);
 	int			(*ndo_fcoe_disable)(struct net_device *dev);
 	int			(*ndo_fcoe_ddp_setup)(struct net_device *dev,
@@ -937,7 +935,7 @@ struct net_device_ops {
 						       unsigned int sgc);
 #endif
 
-#if defined(CONFIG_LIBFCOE) || defined(CONFIG_LIBFCOE_MODULE)
+#if IS_ENABLED(CONFIG_LIBFCOE)
 #define NETDEV_FCOE_WWNN 0
 #define NETDEV_FCOE_WWPN 1
 	int			(*ndo_fcoe_get_wwn)(struct net_device *dev,
@@ -1076,7 +1074,7 @@ struct net_device {
 
 	/* Protocol specific pointers */
 
-#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
+#if IS_ENABLED(CONFIG_VLAN_8021Q)
 	struct vlan_group __rcu	*vlgrp;		/* VLAN group */
 #endif
 #if IS_ENABLED(CONFIG_NET_DSA)
@@ -1242,7 +1240,7 @@ struct net_device {
 	struct netdev_tc_txq tc_to_txq[TC_MAX_QUEUE];
 	u8 prio_tc_map[TC_BITMASK + 1];
 
-#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
+#if IS_ENABLED(CONFIG_FCOE)
 	/* max exchange id for FCoE LRO by ddp */
 	unsigned int		fcoe_ddp_xid;
 #endif
-- 
1.7.7.3

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [PATCH net-next 7/8] net: Revert ARCNET and PHYLIB to tristate options
  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
  0 siblings, 0 replies; 17+ messages in thread
From: David Miller @ 2011-11-26 19:42 UTC (permalink / raw)
  To: ben; +Cc: netdev

From: Ben Hutchings <ben@decadent.org.uk>
Date: Sat, 26 Nov 2011 00:40:02 +0000

> commit 88491d8103498a6166f70d5999902fec70924314 ("drivers/net: Kconfig
> & Makefile cleanup") changed the type of these options to bool, but
> they select code that could (and still can) be built as modules.
> 
> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> ---
> Yes David, they do still build this way.  Even in an allmodconfig
> configuration, now.  And I still really want this in net.

Color me extremely impressed.

Ok, I'll put this into 'net', pull it into 'net-next', then apply the
rest of this series there.

Thanks!

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH net-next 1/8] dsa: Change dsa_uses_{dsa,trailer}_tags() into inline functions
  2011-11-26  0:32 [PATCH net-next 1/8] dsa: Change dsa_uses_{dsa,trailer}_tags() into inline functions Ben Hutchings
                   ` (6 preceding siblings ...)
  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 ` Lennert Buytenhek
  7 siblings, 0 replies; 17+ messages in thread
From: Lennert Buytenhek @ 2011-11-27 19:12 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: David Miller, netdev

On Sat, Nov 26, 2011 at 12:32:52AM +0000, Ben Hutchings wrote:

> eth_type_trans() will use these functions if DSA is enabled, which
> blocks building DSA as a module.

Acked-by: Lennert Buytenhek <buytenh@wantstofly.org>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH net-next 2/8] dsa: Export functions from core to modules
  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
  0 siblings, 1 reply; 17+ messages in thread
From: Lennert Buytenhek @ 2011-11-27 19:15 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: David Miller, netdev

On Sat, Nov 26, 2011 at 12:34:07AM +0000, Ben Hutchings wrote:

> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> ---
>  net/dsa/dsa.c   |    2 ++
>  net/dsa/slave.c |    2 ++
>  2 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
> index 66f5c04..fc93088 100644
> --- a/net/dsa/dsa.c
> +++ b/net/dsa/dsa.c
> @@ -29,6 +29,7 @@ void register_switch_driver(struct dsa_switch_driver *drv)
>  	list_add_tail(&drv->list, &dsa_switch_drivers);
>  	mutex_unlock(&dsa_switch_drivers_mutex);
>  }
> +EXPORT_SYMBOL_GPL(register_switch_driver);
>  
>  void unregister_switch_driver(struct dsa_switch_driver *drv)
>  {
> @@ -36,6 +37,7 @@ void unregister_switch_driver(struct dsa_switch_driver *drv)
>  	list_del_init(&drv->list);
>  	mutex_unlock(&dsa_switch_drivers_mutex);
>  }
> +EXPORT_SYMBOL_GPL(unregister_switch_driver);
>  
>  static struct dsa_switch_driver *
>  dsa_switch_probe(struct mii_bus *bus, int sw_addr, char **_name)

ACK on these.


> diff --git a/net/dsa/slave.c b/net/dsa/slave.c
> index 56cf9b8..c9d52ca 100644
> --- a/net/dsa/slave.c
> +++ b/net/dsa/slave.c
> @@ -45,6 +45,7 @@ void dsa_slave_mii_bus_init(struct dsa_switch *ds)
>  			ds->master_mii_bus->id, ds->pd->sw_addr);
>  	ds->slave_mii_bus->parent = &ds->master_mii_bus->dev;
>  }
> +EXPORT_SYMBOL_GPL(dsa_slave_mii_bus_init);
>  
> 
>  /* slave device handling ****************************************************/
> @@ -402,3 +403,4 @@ dsa_slave_create(struct dsa_switch *ds, struct device *parent,
>  
>  	return slave_dev;
>  }
> +EXPORT_SYMBOL_GPL(dsa_slave_create);

Why do these need to be exported?  They are only called from dsa.c,
and dsa.c and slave.c are always linked into the same entity, even
after your patches.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH net-next 3/8] dsa: Combine core and tagging code
  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
  0 siblings, 0 replies; 17+ messages in thread
From: Lennert Buytenhek @ 2011-11-27 19:16 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: David Miller, netdev

On Sat, Nov 26, 2011 at 12:35:02AM +0000, Ben Hutchings wrote:

> These files have circular dependencies, so if we make DSA modular then
> they must be built into the same module.  Therefore, link them
> together and merge their respective module init and exit functions.
> 
> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

Acked-by: Lennert Buytenhek <buytenh@wantstofly.org>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH net-next 5/8] dsa: Define module author, description, license and aliases for drivers
  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
  0 siblings, 0 replies; 17+ messages in thread
From: Lennert Buytenhek @ 2011-11-27 19:17 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: David Miller, netdev

On Sat, Nov 26, 2011 at 12:37:16AM +0000, Ben Hutchings wrote:

> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

Acked-by: Lennert Buytenhek <buytenh@wantstofly.org>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH net-next 4/8] mv88e6xxx: Combine mv88e6131 and mv88e612_61_65 drivers
  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
  0 siblings, 0 replies; 17+ messages in thread
From: Lennert Buytenhek @ 2011-11-27 19:18 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: David Miller, netdev

On Sat, Nov 26, 2011 at 12:36:19AM +0000, Ben Hutchings wrote:

> These drivers share a lot of code, so if we make them modular they
> should be built into the same module.  Therefore, link them together
> and merge their respective module init and exit functions.
> 
> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

Acked-by: Lennert Buytenhek <buytenh@wantstofly.org>

Minor nit: s/612_/6123_/ in Subject: line.


> ---
>  net/dsa/Makefile          |    7 ++++---
>  net/dsa/mv88e6123_61_65.c |   15 +--------------
>  net/dsa/mv88e6131.c       |   15 +--------------
>  net/dsa/mv88e6xxx.c       |   23 +++++++++++++++++++++++
>  net/dsa/mv88e6xxx.h       |    3 +++
>  5 files changed, 32 insertions(+), 31 deletions(-)

[...]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH net-next 6/8] dsa: Allow core and drivers to be built as modules
  2011-11-26  0:38 ` [PATCH net-next 6/8] dsa: Allow core and drivers to be built as modules Ben Hutchings
@ 2011-11-27 19:19   ` Lennert Buytenhek
  2011-11-27 22:39     ` Ben Hutchings
  0 siblings, 1 reply; 17+ messages in thread
From: Lennert Buytenhek @ 2011-11-27 19:19 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: David Miller, netdev

On Sat, Nov 26, 2011 at 12:38:38AM +0000, Ben Hutchings wrote:

> 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>

Acked-by: Lennert Buytenhek <buytenh@wantstofly.org>

Thanks for the patches!

(While you're at it -- the switch chip drivers in net/dsa/ still
ought to be moved to drivers/net/dsa/ or so -- feel like whipping up
a patch for that?)

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH net-next 2/8] dsa: Export functions from core to modules
  2011-11-27 19:15   ` Lennert Buytenhek
@ 2011-11-27 22:38     ` Ben Hutchings
  0 siblings, 0 replies; 17+ messages in thread
From: Ben Hutchings @ 2011-11-27 22:38 UTC (permalink / raw)
  To: Lennert Buytenhek; +Cc: David Miller, netdev

[-- Attachment #1: Type: text/plain, Size: 1090 bytes --]

On Sun, 2011-11-27 at 20:15 +0100, Lennert Buytenhek wrote:
[...]
> > diff --git a/net/dsa/slave.c b/net/dsa/slave.c
> > index 56cf9b8..c9d52ca 100644
> > --- a/net/dsa/slave.c
> > +++ b/net/dsa/slave.c
> > @@ -45,6 +45,7 @@ void dsa_slave_mii_bus_init(struct dsa_switch *ds)
> >  			ds->master_mii_bus->id, ds->pd->sw_addr);
> >  	ds->slave_mii_bus->parent = &ds->master_mii_bus->dev;
> >  }
> > +EXPORT_SYMBOL_GPL(dsa_slave_mii_bus_init);
> >  
> > 
> >  /* slave device handling ****************************************************/
> > @@ -402,3 +403,4 @@ dsa_slave_create(struct dsa_switch *ds, struct device *parent,
> >  
> >  	return slave_dev;
> >  }
> > +EXPORT_SYMBOL_GPL(dsa_slave_create);
> 
> Why do these need to be exported?  They are only called from dsa.c,
> and dsa.c and slave.c are always linked into the same entity, even
> after your patches.

Oh, yes.  I just failed to revert these exports when I decided they
should be linked together.

Ben.

-- 
Ben Hutchings
The two most common things in the universe are hydrogen and stupidity.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH net-next 6/8] dsa: Allow core and drivers to be built as modules
  2011-11-27 19:19   ` Lennert Buytenhek
@ 2011-11-27 22:39     ` Ben Hutchings
  0 siblings, 0 replies; 17+ messages in thread
From: Ben Hutchings @ 2011-11-27 22:39 UTC (permalink / raw)
  To: Lennert Buytenhek; +Cc: David Miller, netdev

[-- Attachment #1: Type: text/plain, Size: 985 bytes --]

On Sun, 2011-11-27 at 20:19 +0100, Lennert Buytenhek wrote:
> On Sat, Nov 26, 2011 at 12:38:38AM +0000, Ben Hutchings wrote:
> 
> > 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>
> 
> Acked-by: Lennert Buytenhek <buytenh@wantstofly.org>
> 
> Thanks for the patches!
> 
> (While you're at it -- the switch chip drivers in net/dsa/ still
> ought to be moved to drivers/net/dsa/ or so -- feel like whipping up
> a patch for that?)

I agree.  Maybe.

Ben.

-- 
Ben Hutchings
The two most common things in the universe are hydrogen and stupidity.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2011-11-27 22:39 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH net-next 6/8] dsa: Allow core and drivers to be built as modules Ben Hutchings
2011-11-27 19:19   ` 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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.