Skip to content

Commit

Permalink
mac80211: add PID controller based rate control algorithm
Browse files Browse the repository at this point in the history
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: Mattias Nissler <mattias.nissler@gmx.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Mattias Nissler authored and David S. Miller committed Jan 28, 2008
1 parent 1abbe49 commit ad01837
Show file tree
Hide file tree
Showing 5 changed files with 403 additions and 5 deletions.
12 changes: 12 additions & 0 deletions net/mac80211/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@ config MAC80211_RCSIMPLE
Say Y unless you know you will have another algorithm
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
bool "Enable LED triggers"
depends on MAC80211 && LEDS_TRIGGERS
Expand Down
1 change: 1 addition & 0 deletions net/mac80211/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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_NET_SCHED) += wme.o
mac80211-objs-$(CONFIG_MAC80211_RCSIMPLE) += rc80211_simple.o
mac80211-objs-$(CONFIG_MAC80211_RCPID) += rc80211_pid.o

mac80211-objs := \
ieee80211.o \
Expand Down
27 changes: 22 additions & 5 deletions net/mac80211/ieee80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -1315,30 +1315,47 @@ static int __init ieee80211_init(void)
#ifdef CONFIG_MAC80211_RCSIMPLE
ret = ieee80211_rate_control_register(&mac80211_rcsimple);
if (ret)
return ret;
goto fail;
#endif

#ifdef CONFIG_MAC80211_RCPID
ret = ieee80211_rate_control_register(&mac80211_rcpid);
if (ret)
goto fail;
#endif

ret = ieee80211_wme_register();
if (ret) {
#ifdef CONFIG_MAC80211_RCSIMPLE
ieee80211_rate_control_unregister(&mac80211_rcsimple);
#endif
printk(KERN_DEBUG "ieee80211_init: failed to "
"initialize WME (err=%d)\n", ret);
return ret;
goto fail;
}

ieee80211_debugfs_netdev_init();
ieee80211_regdomain_init();

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)
{
#ifdef CONFIG_MAC80211_RCSIMPLE
ieee80211_rate_control_unregister(&mac80211_rcsimple);
#endif
#ifdef CONFIG_MAC80211_RCPID
ieee80211_rate_control_unregister(&mac80211_rcpid);
#endif

ieee80211_wme_unregister();
ieee80211_debugfs_netdev_exit();
Expand Down
3 changes: 3 additions & 0 deletions net/mac80211/ieee80211_rate.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ struct rate_control_ref {
/* default 'simple' algorithm */
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);
void ieee80211_rate_control_unregister(struct rate_control_ops *ops);

Expand Down
Loading

0 comments on commit ad01837

Please sign in to comment.