mac80211: add fixed_rate management to minstrel rc
Add the capability to use a fixed modulation rate to minstrel rate controller Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com> Acked-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
392b9ffb05
commit
45966aebad
|
@ -203,6 +203,15 @@ minstrel_update_stats(struct minstrel_priv *mp, struct minstrel_sta_info *mi)
|
||||||
memcpy(mi->max_tp_rate, tmp_tp_rate, sizeof(mi->max_tp_rate));
|
memcpy(mi->max_tp_rate, tmp_tp_rate, sizeof(mi->max_tp_rate));
|
||||||
mi->max_prob_rate = tmp_prob_rate;
|
mi->max_prob_rate = tmp_prob_rate;
|
||||||
|
|
||||||
|
#ifdef CONFIG_MAC80211_DEBUGFS
|
||||||
|
/* use fixed index if set */
|
||||||
|
if (mp->fixed_rate_idx != -1) {
|
||||||
|
mi->max_tp_rate[0] = mp->fixed_rate_idx;
|
||||||
|
mi->max_tp_rate[1] = mp->fixed_rate_idx;
|
||||||
|
mi->max_prob_rate = mp->fixed_rate_idx;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Reset update timer */
|
/* Reset update timer */
|
||||||
mi->stats_update = jiffies;
|
mi->stats_update = jiffies;
|
||||||
|
|
||||||
|
@ -310,6 +319,11 @@ minstrel_get_rate(void *priv, struct ieee80211_sta *sta,
|
||||||
/* increase sum packet counter */
|
/* increase sum packet counter */
|
||||||
mi->packet_count++;
|
mi->packet_count++;
|
||||||
|
|
||||||
|
#ifdef CONFIG_MAC80211_DEBUGFS
|
||||||
|
if (mp->fixed_rate_idx != -1)
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
|
|
||||||
delta = (mi->packet_count * sampling_ratio / 100) -
|
delta = (mi->packet_count * sampling_ratio / 100) -
|
||||||
(mi->sample_count + mi->sample_deferred / 2);
|
(mi->sample_count + mi->sample_deferred / 2);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue