From 4b475898ec9dc6e62cebcb8fc0b3495c986a4590 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Wed, 2 Jan 2008 15:17:03 +0100 Subject: 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 Signed-off-by: John W. Linville Signed-off-by: David S. Miller --- net/mac80211/rc80211_pid_algo.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'net/mac80211/rc80211_pid_algo.c') diff --git a/net/mac80211/rc80211_pid_algo.c b/net/mac80211/rc80211_pid_algo.c index da3529017da1..0995bb9cec21 100644 --- a/net/mac80211/rc80211_pid_algo.c +++ b/net/mac80211/rc80211_pid_algo.c @@ -12,7 +12,7 @@ #include #include #include - +#include #include #include "ieee80211_rate.h" @@ -492,7 +492,7 @@ static void rate_control_pid_free_sta(void *priv, void *priv_sta) kfree(spinfo); } -struct rate_control_ops mac80211_rcpid = { +static struct rate_control_ops mac80211_rcpid = { .name = "pid", .tx_status = rate_control_pid_tx_status, .get_rate = rate_control_pid_get_rate, @@ -507,3 +507,23 @@ struct rate_control_ops mac80211_rcpid = { .remove_sta_debugfs = rate_control_pid_remove_sta_debugfs, #endif }; + +MODULE_DESCRIPTION("PID controller based rate control algorithm"); +MODULE_AUTHOR("Stefano Brivio"); +MODULE_AUTHOR("Mattias Nissler"); +MODULE_LICENSE("GPL"); + +int __init rc80211_pid_init(void) +{ + return ieee80211_rate_control_register(&mac80211_rcpid); +} + +void __exit rc80211_pid_exit(void) +{ + ieee80211_rate_control_unregister(&mac80211_rcpid); +} + +#ifdef CONFIG_MAC80211_RC_PID_MODULE +module_init(rc80211_pid_init); +module_exit(rc80211_pid_exit); +#endif -- cgit v1.2.3