Skip to contentSkip to conversation

create net/wireless/Kconfig and make nl80211 optional

PATCH In review James Ketrenos 2 participants 6 messages Feb 22, 2007 – Feb 23, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 create net/wireless/Kconfig and make nl80211 optional

Move the wireless Kconfig options into their own wireless/Kconfig and add a CONFIG_NL80211 configuration option to allow nl80211 support to be optionally included (default =y)

---
 net/Kconfig           |   17 +----------------
 net/wireless/Kconfig  |   42 ++++++++++++++++++++++++++++++++++++++++++
 net/wireless/Makefile |    3 ++-
 3 files changed, 45 insertions(+), 17 deletions(-)

---

net/Kconfig +1 -16
index 969754f..218570b 100644
@@ -227,22 +227,7 @@ config WIRELESS_EXT
 config FIB_RULES
 	bool
 
-config CFG80211
-	tristate "Improved wireless configuration API"
-
-config CFG80211_WEXT_COMPAT
-	bool "cfg80211 Wireless Extensions compatibility"
-	depends CFG80211
-	default y
-	---help---
-	This option allows using devices whose drivers have been
-	converted to use the new cfg80211 with wireless extensions,
-	providing WE-20 compatibility. Note that cfg80211's "native"
-	interface is nl80211 using generic netlink. The wireless
-	extensions are being deprecated, but userspace tools may still
-	be using them.
-
-	If unsure, say Y.
+source "net/wireless/Kconfig"
 
 endif   # if NET
 endmenu # Networking
net/wireless/Kconfig new file +42 -0

42 lines not on this page · raw message

net/wireless/Makefile +2 -1
index c52c251..1f47511 100644
@@ -1,6 +1,7 @@
 obj-$(CONFIG_CFG80211) += cfg80211.o
 
-cfg80211-y += core.o sysfs.o nl80211.o
+cfg80211-y += core.o sysfs.o
+cfg80211-$(CONFIG_NL80211) += nl80211.o
 cfg80211-$(CONFIG_CFG80211_WEXT_COMPAT) += wext-compat.o
 
 ifeq ($(CONFIG_CFG80211),m)
maintainer
#1 lore raw
Quoted 3 lines · James Ketrenos

Move the wireless Kconfig options into their own wireless/Kconfig and add a CONFIG_NL80211 configuration option to allow nl80211 support to be optionally included (default =y)

Ack, but we'll need to modify core.h to stub out nl80211_init() and nl80211_exit() in case nl80211 isn't compiled in. The reason this worked for you is that I forgot to hook up nl80211 completely ;)

Do you want me to take care of that?`

Thanks,
johannes

#2 lore raw
Quoted 10 lines · Johannes Berg
Quoted 3 lines · James Ketrenos

Move the wireless Kconfig options into their own wireless/Kconfig and add a CONFIG_NL80211 configuration option to allow nl80211 support to be optionally included (default =y)

Ack, but we'll need to modify core.h to stub out nl80211_init() and nl80211_exit() in case nl80211 isn't compiled in. The reason this worked for you is that I forgot to hook up nl80211 completely ;)

Do you want me to take care of that?`

Something like this?

James
--------------

[PATCH] Make nl80211_init and nl80211_exit depend on NL80211 config

This applies after Johannes patch 'hook up nl80211 again' and wraps nl80211_init and nl80211_exit usage in CONFIG_CFG80211_NL80211.

---
 net/wireless/core.c |    6 ++++++
 1 file changed, 6 insertions(+)

---

net/wireless/core.c +6 -0
index abf0f78..8c1e914 100644
@@ -249,16 +249,20 @@ static int cfg80211_init(void)
        if (err)
                goto out_exit_sysfs;
 
+#ifdef CONFIG_CFG80211_NL80211
        err = nl80211_init();
        if (err)
                goto out_nl80211;
+#endif
 
        ieee80211_debugfs_dir = debugfs_create_dir("ieee80211", NULL);
 
        return 0;
 
+#ifdef CONFIG_CFG80211_NL80211
  out_nl80211:
        cfg80211_wext_exit();
+#endif
  out_exit_sysfs:
        wiphy_sysfs_exit();
 
@@ -269,7 +273,9 @@ module_init(cfg80211_init);
 static void cfg80211_exit(void)
 {
        debugfs_remove(ieee80211_debugfs_dir);
+#ifdef CONFIG_CFG80211_NL80211
        nl80211_exit();
+#endif
        cfg80211_wext_exit();
        wiphy_sysfs_exit();
 }
maintainer
#3 lore raw
Quoted 6 lines · James Ketrenos
Quoted 5 lines · Johannes Berg
Quoted 3 lines · James Ketrenos

Move the wireless Kconfig options into their own wireless/Kconfig and add a CONFIG_NL80211 configuration option to allow nl80211 support to be optionally included (default =y)

Quoted 7 lines
Quoted 5 lines

Ack, but we'll need to modify core.h to stub out nl80211_init() and nl80211_exit() in case nl80211 isn't compiled in. The reason this worked for you is that I forgot to hook up nl80211 completely ;)

Do you want me to take care of that?`

Something like this?

Yup. I'd prefer this instead, and then rolled into your original patch so it applies after my hookup patch.

johannes

net/wireless/nl80211.h +10 -0
@@ -1,7 +1,17 @@
 #ifndef __NET_WIRELESS_NL80211_H
 #define __NET_WIRELESS_NL80211_H
 
+#ifdef CONFIG_CFG80211_NL80211
 extern int nl80211_init(void);
 extern void nl80211_exit(void);
+#else
+static inline int nl80211_init(void)
+{
+	return 0;
+}
+static inline void nl80211_exit(void)
+{
+}
+#endif /* CONFIG_CFG80211_NL80211 */
 
 #endif /* __NET_WIRELESS_NL80211_H */
#4 lore raw
Quoted 10 lines · Johannes Berg
Quoted 9 lines · James Ketrenos
Quoted 8 lines · Johannes Berg
Quoted 3 lines · James Ketrenos

Move the wireless Kconfig options into their own wireless/Kconfig and add a CONFIG_NL80211 configuration option to allow nl80211 support to be optionally included (default =y)

Ack, but we'll need to modify core.h to stub out nl80211_init() and nl80211_exit() in case nl80211 isn't compiled in. The reason this worked for you is that I forgot to hook up nl80211 completely ;)

Quoted 5 lines
Quoted 2 lines
Quoted 1 line

Do you want me to take care of that?`

Something like this?

Yup. I'd prefer this instead, and then rolled into your original patch so it applies after my hookup patch.

Ya, I guess that follows standard kernel guidelines more... I tend to find it a lot easier in resolving problems with short spanning ifdef's sprinkled in code vs. hidden functionality in header files that changes based on CONFIG options. But alas, I think I am in the minority on that.

I'll resend my prior 'make nl80211 optional' patch adding below to it.

Thanks,
James

Quoted 23 lines

johannes

net/wireless/nl80211.h +10 -0
@@ -1,7 +1,17 @@
 #ifndef __NET_WIRELESS_NL80211_H
 #define __NET_WIRELESS_NL80211_H
 
+#ifdef CONFIG_CFG80211_NL80211
 extern int nl80211_init(void);
 extern void nl80211_exit(void);
+#else
+static inline int nl80211_init(void)
+{
+	return 0;
+}
+static inline void nl80211_exit(void)
+{
+}
+#endif /* CONFIG_CFG80211_NL80211 */
 
 #endif /* __NET_WIRELESS_NL80211_H */
maintainer Acked-by
#5 lore raw
Quoted 4 lines · James Ketrenos

Ya, I guess that follows standard kernel guidelines more... I tend to find it a lot easier in resolving problems with short spanning ifdef's sprinkled in code vs. hidden functionality in header files that changes based on CONFIG options. But alas, I think I am in the minority on that.

Yeah, I guess you can argue about that. I tend to not care about what the functions do (unless I want to follow them anyway) so it's more readable that way.

Quoted 1 line

I'll resend my prior 'make nl80211 optional' patch adding below to it.

Great, thanks. That has my

then.

johannes