diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-01-02 09:17:03 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:01:02 -0500 |
commit | 4b475898ec9dc6e62cebcb8fc0b3495c986a4590 (patch) | |
tree | 8409a6865f3d83965228fd8f6fae3b05e1e106ed /net/mac80211/ieee80211.c | |
parent | 688b88a4886834d7e3457711cd4feef6611d3232 (diff) |
mac80211: better rate control algorithm selection
This patch changes mac80211's Kconfig/Makefile to:
* select between the PID and the SIMPLE rate control
algorithm as default
* always allow tri-state for the rate control algorithms,
building those that are selected 'y' into the mac80211
module (if that is a module, otherwise all into the kernel)
* force the default rate control algorithm to be built into
mac80211
It also makes both rate control algorithms proper modules again
with MODULE_LICENSE etc.
Only if EMBEDDED is the user allowed to select "NONE" as default
which will cause no algorithm to be selected, this will work
only when the driver brings one itself (e.g. iwlwifi drivers).
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mac80211/ieee80211.c')
-rw-r--r-- | net/mac80211/ieee80211.c | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c index 2011c726f2b1..8ba69ae676ca 100644 --- a/net/mac80211/ieee80211.c +++ b/net/mac80211/ieee80211.c | |||
@@ -1323,23 +1323,19 @@ static int __init ieee80211_init(void) | |||
1323 | 1323 | ||
1324 | BUILD_BUG_ON(sizeof(struct ieee80211_tx_packet_data) > sizeof(skb->cb)); | 1324 | BUILD_BUG_ON(sizeof(struct ieee80211_tx_packet_data) > sizeof(skb->cb)); |
1325 | 1325 | ||
1326 | #ifdef CONFIG_MAC80211_RC_SIMPLE | 1326 | ret = rc80211_simple_init(); |
1327 | ret = ieee80211_rate_control_register(&mac80211_rcsimple); | ||
1328 | if (ret) | 1327 | if (ret) |
1329 | goto fail; | 1328 | goto fail; |
1330 | #endif | ||
1331 | 1329 | ||
1332 | #ifdef CONFIG_MAC80211_RC_PID | 1330 | ret = rc80211_pid_init(); |
1333 | ret = ieee80211_rate_control_register(&mac80211_rcpid); | ||
1334 | if (ret) | 1331 | if (ret) |
1335 | goto fail; | 1332 | goto fail_simple; |
1336 | #endif | ||
1337 | 1333 | ||
1338 | ret = ieee80211_wme_register(); | 1334 | ret = ieee80211_wme_register(); |
1339 | if (ret) { | 1335 | if (ret) { |
1340 | printk(KERN_DEBUG "ieee80211_init: failed to " | 1336 | printk(KERN_DEBUG "ieee80211_init: failed to " |
1341 | "initialize WME (err=%d)\n", ret); | 1337 | "initialize WME (err=%d)\n", ret); |
1342 | goto fail; | 1338 | goto fail_pid; |
1343 | } | 1339 | } |
1344 | 1340 | ||
1345 | ieee80211_debugfs_netdev_init(); | 1341 | ieee80211_debugfs_netdev_init(); |
@@ -1347,26 +1343,18 @@ static int __init ieee80211_init(void) | |||
1347 | 1343 | ||
1348 | return 0; | 1344 | return 0; |
1349 | 1345 | ||
1350 | fail: | 1346 | fail_pid: |
1351 | 1347 | rc80211_simple_exit(); | |
1352 | #ifdef CONFIG_MAC80211_RC_SIMPLE | 1348 | fail_simple: |
1353 | ieee80211_rate_control_unregister(&mac80211_rcsimple); | 1349 | rc80211_pid_exit(); |
1354 | #endif | 1350 | fail: |
1355 | #ifdef CONFIG_MAC80211_RC_PID | ||
1356 | ieee80211_rate_control_unregister(&mac80211_rcpid); | ||
1357 | #endif | ||
1358 | |||
1359 | return ret; | 1351 | return ret; |
1360 | } | 1352 | } |
1361 | 1353 | ||
1362 | static void __exit ieee80211_exit(void) | 1354 | static void __exit ieee80211_exit(void) |
1363 | { | 1355 | { |
1364 | #ifdef CONFIG_MAC80211_RC_SIMPLE | 1356 | rc80211_simple_exit(); |
1365 | ieee80211_rate_control_unregister(&mac80211_rcsimple); | 1357 | rc80211_pid_exit(); |
1366 | #endif | ||
1367 | #ifdef CONFIG_MAC80211_RC_PID | ||
1368 | ieee80211_rate_control_unregister(&mac80211_rcpid); | ||
1369 | #endif | ||
1370 | 1358 | ||
1371 | ieee80211_wme_unregister(); | 1359 | ieee80211_wme_unregister(); |
1372 | ieee80211_debugfs_netdev_exit(); | 1360 | ieee80211_debugfs_netdev_exit(); |