Commit ad018375 authored by Mattias Nissler's avatar Mattias Nissler Committed by David S. Miller

mac80211: add PID controller based rate control algorithm

Add a new rate control algorithm based on a PID controller. It samples the
percentage of failed frames over time, feeds the result into the controller and
uses its output to control the TX rate.
Signed-off-by: default avatarMattias Nissler <mattias.nissler@gmx.de>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1abbe498
...@@ -25,6 +25,18 @@ config MAC80211_RCSIMPLE ...@@ -25,6 +25,18 @@ config MAC80211_RCSIMPLE
Say Y unless you know you will have another algorithm Say Y unless you know you will have another algorithm
available. available.
config MAC80211_RCPID
bool "'PID' rate control algorithm" if EMBEDDED
default y
depends on MAC80211
help
This option enables a TX rate control algorithm for
mac80211 that uses a PID controller to select the TX
rate.
Say Y unless you're sure you want to use a different
rate control algorithm.
config MAC80211_LEDS config MAC80211_LEDS
bool "Enable LED triggers" bool "Enable LED triggers"
depends on MAC80211 && LEDS_TRIGGERS depends on MAC80211 && LEDS_TRIGGERS
......
...@@ -4,6 +4,7 @@ mac80211-objs-$(CONFIG_MAC80211_LEDS) += ieee80211_led.o ...@@ -4,6 +4,7 @@ mac80211-objs-$(CONFIG_MAC80211_LEDS) += ieee80211_led.o
mac80211-objs-$(CONFIG_MAC80211_DEBUGFS) += debugfs.o debugfs_sta.o debugfs_netdev.o debugfs_key.o mac80211-objs-$(CONFIG_MAC80211_DEBUGFS) += debugfs.o debugfs_sta.o debugfs_netdev.o debugfs_key.o
mac80211-objs-$(CONFIG_NET_SCHED) += wme.o mac80211-objs-$(CONFIG_NET_SCHED) += wme.o
mac80211-objs-$(CONFIG_MAC80211_RCSIMPLE) += rc80211_simple.o mac80211-objs-$(CONFIG_MAC80211_RCSIMPLE) += rc80211_simple.o
mac80211-objs-$(CONFIG_MAC80211_RCPID) += rc80211_pid.o
mac80211-objs := \ mac80211-objs := \
ieee80211.o \ ieee80211.o \
......
...@@ -1315,23 +1315,37 @@ static int __init ieee80211_init(void) ...@@ -1315,23 +1315,37 @@ static int __init ieee80211_init(void)
#ifdef CONFIG_MAC80211_RCSIMPLE #ifdef CONFIG_MAC80211_RCSIMPLE
ret = ieee80211_rate_control_register(&mac80211_rcsimple); ret = ieee80211_rate_control_register(&mac80211_rcsimple);
if (ret) if (ret)
return ret; goto fail;
#endif
#ifdef CONFIG_MAC80211_RCPID
ret = ieee80211_rate_control_register(&mac80211_rcpid);
if (ret)
goto fail;
#endif #endif
ret = ieee80211_wme_register(); ret = ieee80211_wme_register();
if (ret) { if (ret) {
#ifdef CONFIG_MAC80211_RCSIMPLE
ieee80211_rate_control_unregister(&mac80211_rcsimple);
#endif
printk(KERN_DEBUG "ieee80211_init: failed to " printk(KERN_DEBUG "ieee80211_init: failed to "
"initialize WME (err=%d)\n", ret); "initialize WME (err=%d)\n", ret);
return ret; goto fail;
} }
ieee80211_debugfs_netdev_init(); ieee80211_debugfs_netdev_init();
ieee80211_regdomain_init(); ieee80211_regdomain_init();
return 0; return 0;
fail:
#ifdef CONFIG_MAC80211_RCSIMPLE
ieee80211_rate_control_unregister(&mac80211_rcsimple);
#endif
#ifdef CONFIG_MAC80211_RCPID
ieee80211_rate_control_unregister(&mac80211_rcpid);
#endif
return ret;
} }
static void __exit ieee80211_exit(void) static void __exit ieee80211_exit(void)
...@@ -1339,6 +1353,9 @@ static void __exit ieee80211_exit(void) ...@@ -1339,6 +1353,9 @@ static void __exit ieee80211_exit(void)
#ifdef CONFIG_MAC80211_RCSIMPLE #ifdef CONFIG_MAC80211_RCSIMPLE
ieee80211_rate_control_unregister(&mac80211_rcsimple); ieee80211_rate_control_unregister(&mac80211_rcsimple);
#endif #endif
#ifdef CONFIG_MAC80211_RCPID
ieee80211_rate_control_unregister(&mac80211_rcpid);
#endif
ieee80211_wme_unregister(); ieee80211_wme_unregister();
ieee80211_debugfs_netdev_exit(); ieee80211_debugfs_netdev_exit();
......
...@@ -61,6 +61,9 @@ struct rate_control_ref { ...@@ -61,6 +61,9 @@ struct rate_control_ref {
/* default 'simple' algorithm */ /* default 'simple' algorithm */
extern struct rate_control_ops mac80211_rcsimple; extern struct rate_control_ops mac80211_rcsimple;
/* 'PID' algorithm */
extern struct rate_control_ops mac80211_rcpid;
int ieee80211_rate_control_register(struct rate_control_ops *ops); int ieee80211_rate_control_register(struct rate_control_ops *ops);
void ieee80211_rate_control_unregister(struct rate_control_ops *ops); void ieee80211_rate_control_unregister(struct rate_control_ops *ops);
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment