aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@kernel.org>2008-06-26 06:38:13 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-06-30 17:37:34 -0400
commite5f5e7339cd95d07937e6f8081b46fba86c742a7 (patch)
tree9526b93d4272d978349b825d90e10a5710d08f00
parentbf998f686430107fb8790ef6713f8e352a3deede (diff)
build algorithms into the mac80211 module
The old infrastructure was: - the default algorithm is built into mac80211 - other algorithms get into their own modules The implementation of this complicated scheme was horrible (just look at net/mac80211/Makefile), and anyone adding a new algorithm would most likely not get it right at his first attempt. This patch therefore builds all enabled algorithms into the mac80211 module. The user interface for the rate control algorithms changes as follows: - first the user can choose which algorithms to enable (currently only MAC80211_RC_PID is available) - if more than one algorithm is enabled (currently not possible since only one algorithm is present) the user then chooses the default one Note: - MAC80211_RC_PID is always enables for CONFIG_EMBEDDED=n Technical changes: - all selected algorithms get into the mac80211 module - net/mac80211/Makefile can now become much less complicated - support for rc80211_pid_algo.c being modular is no longer required - this includes unexporting mesh_plink_broken Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--net/mac80211/Kconfig31
-rw-r--r--net/mac80211/Makefile18
-rw-r--r--net/mac80211/mesh_pathtbl.c1
-rw-r--r--net/mac80211/rate.h4
-rw-r--r--net/mac80211/rc80211_pid_algo.c10
5 files changed, 14 insertions, 50 deletions
diff --git a/net/mac80211/Kconfig b/net/mac80211/Kconfig
index 594bc7319ca6..661d3c291482 100644
--- a/net/mac80211/Kconfig
+++ b/net/mac80211/Kconfig
@@ -27,6 +27,14 @@ comment "QoS/HT support needs CONFIG_NETDEVICES_MULTIQUEUE"
27menu "Rate control algorithm selection" 27menu "Rate control algorithm selection"
28 depends on MAC80211 != n 28 depends on MAC80211 != n
29 29
30config MAC80211_RC_PID
31 bool "PID controller based rate control algorithm" if EMBEDDED
32 default y
33 ---help---
34 This option enables a TX rate control algorithm for
35 mac80211 that uses a PID controller to select the TX
36 rate.
37
30choice 38choice
31 prompt "Default rate control algorithm" 39 prompt "Default rate control algorithm"
32 default MAC80211_RC_DEFAULT_PID 40 default MAC80211_RC_DEFAULT_PID
@@ -38,40 +46,19 @@ choice
38 46
39config MAC80211_RC_DEFAULT_PID 47config MAC80211_RC_DEFAULT_PID
40 bool "PID controller based rate control algorithm" 48 bool "PID controller based rate control algorithm"
41 select MAC80211_RC_PID 49 depends on MAC80211_RC_PID
42 ---help--- 50 ---help---
43 Select the PID controller based rate control as the 51 Select the PID controller based rate control as the
44 default rate control algorithm. You should choose 52 default rate control algorithm. You should choose
45 this unless you know what you are doing. 53 this unless you know what you are doing.
46 54
47config MAC80211_RC_DEFAULT_NONE
48 bool "No default algorithm"
49 depends on EMBEDDED
50 help
51 Selecting this option will select no default algorithm
52 and allow you to not build any. Do not choose this
53 option unless you know your driver comes with another
54 suitable algorithm.
55endchoice 55endchoice
56 56
57comment "Selecting 'y' for an algorithm will"
58comment "build the algorithm into mac80211."
59
60config MAC80211_RC_DEFAULT 57config MAC80211_RC_DEFAULT
61 string 58 string
62 default "pid" if MAC80211_RC_DEFAULT_PID 59 default "pid" if MAC80211_RC_DEFAULT_PID
63 default "" 60 default ""
64 61
65config MAC80211_RC_PID
66 tristate "PID controller based rate control algorithm"
67 ---help---
68 This option enables a TX rate control algorithm for
69 mac80211 that uses a PID controller to select the TX
70 rate.
71
72 Say Y or M unless you're sure you want to use a
73 different rate control algorithm.
74
75endmenu 62endmenu
76 63
77config MAC80211_MESH 64config MAC80211_MESH
diff --git a/net/mac80211/Makefile b/net/mac80211/Makefile
index 1d2a4e010e5c..fa47438e338f 100644
--- a/net/mac80211/Makefile
+++ b/net/mac80211/Makefile
@@ -1,13 +1,5 @@
1obj-$(CONFIG_MAC80211) += mac80211.o 1obj-$(CONFIG_MAC80211) += mac80211.o
2 2
3# objects for PID algorithm
4rc80211_pid-y := rc80211_pid_algo.o
5rc80211_pid-$(CONFIG_MAC80211_DEBUGFS) += rc80211_pid_debugfs.o
6
7# build helper for PID algorithm
8rc-pid-y := $(rc80211_pid-y)
9rc-pid-m := rc80211_pid.o
10
11# mac80211 objects 3# mac80211 objects
12mac80211-y := \ 4mac80211-y := \
13 main.o \ 5 main.o \
@@ -42,10 +34,8 @@ mac80211-$(CONFIG_MAC80211_MESH) += \
42 mesh_plink.o \ 34 mesh_plink.o \
43 mesh_hwmp.o 35 mesh_hwmp.o
44 36
37# objects for PID algorithm
38rc80211_pid-y := rc80211_pid_algo.o
39rc80211_pid-$(CONFIG_MAC80211_DEBUGFS) += rc80211_pid_debugfs.o
45 40
46# Build rate control algorithm(s) 41mac80211-$(CONFIG_MAC80211_RC_PID) += $(rc80211_pid-y)
47CFLAGS_rc80211_pid_algo.o += -DRC80211_PID_COMPILE
48mac80211-$(CONFIG_MAC80211_RC_PID) += $(rc-pid-$(CONFIG_MAC80211_RC_PID))
49
50# Modular rate algorithms are assigned to mac80211-m - make separate modules
51obj-m += $(mac80211-m)
diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c
index 947b13b40726..5f88a2e6ee50 100644
--- a/net/mac80211/mesh_pathtbl.c
+++ b/net/mac80211/mesh_pathtbl.c
@@ -262,7 +262,6 @@ void mesh_plink_broken(struct sta_info *sta)
262 } 262 }
263 rcu_read_unlock(); 263 rcu_read_unlock();
264} 264}
265EXPORT_SYMBOL(mesh_plink_broken);
266 265
267/** 266/**
268 * mesh_path_flush_by_nexthop - Deletes mesh paths if their next hop matches 267 * mesh_path_flush_by_nexthop - Deletes mesh paths if their next hop matches
diff --git a/net/mac80211/rate.h b/net/mac80211/rate.h
index 0ed9c8a2f56f..ede7ab56f65b 100644
--- a/net/mac80211/rate.h
+++ b/net/mac80211/rate.h
@@ -162,9 +162,7 @@ void rate_control_deinitialize(struct ieee80211_local *local);
162 162
163 163
164/* Rate control algorithms */ 164/* Rate control algorithms */
165#if defined(RC80211_PID_COMPILE) || \ 165#ifdef CONFIG_MAC80211_RC_PID
166 (defined(CONFIG_MAC80211_RC_PID) && \
167 !defined(CONFIG_MAC80211_RC_PID_MODULE))
168extern int rc80211_pid_init(void); 166extern int rc80211_pid_init(void);
169extern void rc80211_pid_exit(void); 167extern void rc80211_pid_exit(void);
170#else 168#else
diff --git a/net/mac80211/rc80211_pid_algo.c b/net/mac80211/rc80211_pid_algo.c
index e8945413e4a2..62388f8e9024 100644
--- a/net/mac80211/rc80211_pid_algo.c
+++ b/net/mac80211/rc80211_pid_algo.c
@@ -540,11 +540,6 @@ static struct rate_control_ops mac80211_rcpid = {
540#endif 540#endif
541}; 541};
542 542
543MODULE_DESCRIPTION("PID controller based rate control algorithm");
544MODULE_AUTHOR("Stefano Brivio");
545MODULE_AUTHOR("Mattias Nissler");
546MODULE_LICENSE("GPL");
547
548int __init rc80211_pid_init(void) 543int __init rc80211_pid_init(void)
549{ 544{
550 return ieee80211_rate_control_register(&mac80211_rcpid); 545 return ieee80211_rate_control_register(&mac80211_rcpid);
@@ -554,8 +549,3 @@ void rc80211_pid_exit(void)
554{ 549{
555 ieee80211_rate_control_unregister(&mac80211_rcpid); 550 ieee80211_rate_control_unregister(&mac80211_rcpid);
556} 551}
557
558#ifdef CONFIG_MAC80211_RC_PID_MODULE
559module_init(rc80211_pid_init);
560module_exit(rc80211_pid_exit);
561#endif