Commit 24f7580e authored by Zefir Kurtisi's avatar Zefir Kurtisi Committed by John W. Linville

minstrel_ht: fixed rate mode through debugfs

Found several threads about fixed rate mode in minstrel_ht for test
environments, but no patches for it.

This patch provides such a mode through debugfs.
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 71063f0e
...@@ -532,12 +532,21 @@ minstrel_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir) ...@@ -532,12 +532,21 @@ minstrel_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir)
mp->hw = hw; mp->hw = hw;
mp->update_interval = 100; mp->update_interval = 100;
#ifdef CONFIG_MAC80211_DEBUGFS
mp->fixed_rate_idx = (u32) -1;
mp->dbg_fixed_rate = debugfs_create_u32("fixed_rate_idx",
S_IRUGO | S_IWUGO, debugfsdir, &mp->fixed_rate_idx);
#endif
return mp; return mp;
} }
static void static void
minstrel_free(void *priv) minstrel_free(void *priv)
{ {
#ifdef CONFIG_MAC80211_DEBUGFS
debugfs_remove(((struct minstrel_priv *)priv)->dbg_fixed_rate);
#endif
kfree(priv); kfree(priv);
} }
......
...@@ -78,6 +78,18 @@ struct minstrel_priv { ...@@ -78,6 +78,18 @@ struct minstrel_priv {
unsigned int update_interval; unsigned int update_interval;
unsigned int lookaround_rate; unsigned int lookaround_rate;
unsigned int lookaround_rate_mrr; unsigned int lookaround_rate_mrr;
#ifdef CONFIG_MAC80211_DEBUGFS
/*
* enable fixed rate processing per RC
* - write static index to debugfs:ieee80211/phyX/rc/fixed_rate_idx
* - write -1 to enable RC processing again
* - setting will be applied on next update
*/
u32 fixed_rate_idx;
struct dentry *dbg_fixed_rate;
#endif
}; };
struct minstrel_debugfs_info { struct minstrel_debugfs_info {
......
...@@ -609,6 +609,13 @@ minstrel_ht_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta, ...@@ -609,6 +609,13 @@ minstrel_ht_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta,
info->flags |= mi->tx_flags; info->flags |= mi->tx_flags;
sample_idx = minstrel_get_sample_rate(mp, mi); sample_idx = minstrel_get_sample_rate(mp, mi);
#ifdef CONFIG_MAC80211_DEBUGFS
/* use fixed index if set */
if (mp->fixed_rate_idx != -1)
sample_idx = mp->fixed_rate_idx;
#endif
if (sample_idx >= 0) { if (sample_idx >= 0) {
sample = true; sample = true;
minstrel_ht_set_rate(mp, mi, &ar[0], sample_idx, minstrel_ht_set_rate(mp, mi, &ar[0], sample_idx,
......
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