Skip to content

Commit cccf129

Browse files
Felix Fietkaulinvjw
authored andcommitted
mac80211: add the 'minstrel' rate control algorithm
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
1 parent 2f7fe87 commit cccf129

File tree

7 files changed

+868
-0
lines changed

7 files changed

+868
-0
lines changed

net/mac80211/Kconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ config MAC80211_RC_PID
2222
mac80211 that uses a PID controller to select the TX
2323
rate.
2424

25+
config MAC80211_RC_MINSTREL
26+
bool "Minstrel"
27+
---help---
28+
This option enables the 'minstrel' TX rate control algorithm
29+
2530
choice
2631
prompt "Default rate control algorithm"
2732
default MAC80211_RC_DEFAULT_PID
@@ -39,11 +44,19 @@ config MAC80211_RC_DEFAULT_PID
3944
default rate control algorithm. You should choose
4045
this unless you know what you are doing.
4146

47+
config MAC80211_RC_DEFAULT_MINSTREL
48+
bool "Minstrel"
49+
depends on MAC80211_RC_MINSTREL
50+
---help---
51+
Select Minstrel as the default rate control algorithm.
52+
53+
4254
endchoice
4355

4456
config MAC80211_RC_DEFAULT
4557
string
4658
default "pid" if MAC80211_RC_DEFAULT_PID
59+
default "minstrel" if MAC80211_RC_DEFAULT_MINSTREL
4760
default ""
4861

4962
endmenu

net/mac80211/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,8 @@ mac80211-$(CONFIG_MAC80211_MESH) += \
4141
rc80211_pid-y := rc80211_pid_algo.o
4242
rc80211_pid-$(CONFIG_MAC80211_DEBUGFS) += rc80211_pid_debugfs.o
4343

44+
rc80211_minstrel-y := rc80211_minstrel.o
45+
rc80211_minstrel-$(CONFIG_MAC80211_DEBUGFS) += rc80211_minstrel_debugfs.o
46+
4447
mac80211-$(CONFIG_MAC80211_RC_PID) += $(rc80211_pid-y)
48+
mac80211-$(CONFIG_MAC80211_RC_MINSTREL) += $(rc80211_minstrel-y)

net/mac80211/main.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,6 +1015,10 @@ static int __init ieee80211_init(void)
10151015
BUILD_BUG_ON(offsetof(struct ieee80211_tx_info, driver_data) +
10161016
IEEE80211_TX_INFO_DRIVER_DATA_SIZE > sizeof(skb->cb));
10171017

1018+
ret = rc80211_minstrel_init();
1019+
if (ret)
1020+
return ret;
1021+
10181022
ret = rc80211_pid_init();
10191023
if (ret)
10201024
return ret;
@@ -1027,6 +1031,7 @@ static int __init ieee80211_init(void)
10271031
static void __exit ieee80211_exit(void)
10281032
{
10291033
rc80211_pid_exit();
1034+
rc80211_minstrel_exit();
10301035

10311036
/*
10321037
* For key todo, it'll be empty by now but the work

net/mac80211/rate.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,18 @@ static inline void rc80211_pid_exit(void)
125125
}
126126
#endif
127127

128+
#ifdef CONFIG_MAC80211_RC_MINSTREL
129+
extern int rc80211_minstrel_init(void);
130+
extern void rc80211_minstrel_exit(void);
131+
#else
132+
static inline int rc80211_minstrel_init(void)
133+
{
134+
return 0;
135+
}
136+
static inline void rc80211_minstrel_exit(void)
137+
{
138+
}
139+
#endif
140+
141+
128142
#endif /* IEEE80211_RATE_H */

0 commit comments

Comments
 (0)