aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ath
diff options
context:
space:
mode:
authorAdrian Chadd <adrian@FreeBSD.org>2020-05-16 01:56:06 +0000
committerAdrian Chadd <adrian@FreeBSD.org>2020-05-16 01:56:06 +0000
commit5add701776232903532062c48930bb8a7ab65c1b (patch)
treec555a921c01af97c95fcd65e0d5cff07a2abd213 /sys/dev/ath
parent2e09b2590e837d8e0c9c820ad67e628d0c4efe08 (diff)
Notes
Diffstat (limited to 'sys/dev/ath')
-rw-r--r--sys/dev/ath/ath_rate/sample/sample.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/sys/dev/ath/ath_rate/sample/sample.c b/sys/dev/ath/ath_rate/sample/sample.c
index f3f1a41c958b..5abe5a9505c0 100644
--- a/sys/dev/ath/ath_rate/sample/sample.c
+++ b/sys/dev/ath/ath_rate/sample/sample.c
@@ -712,10 +712,13 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_node *an,
* Limit the time measuring the performance of other tx
* rates to sample_rate% of the total transmission time.
*/
- if (sn->sample_tt[size_bin] < average_tx_time * (sn->packets_since_sample[size_bin]*ssc->sample_rate/100)) {
+ if (sn->sample_tt[size_bin] <
+ average_tx_time *
+ (sn->packets_since_sample[size_bin]*ssc->sample_rate/100)) {
rix = pick_sample_rate(ssc, an, rt, size_bin);
IEEE80211_NOTE(an->an_node.ni_vap, IEEE80211_MSG_RATECTL,
- &an->an_node, "att %d sample_tt %d size %u sample rate %d %s current rate %d %s",
+ &an->an_node, "att %d sample_tt %d size %u "
+ "sample rate %d %s current rate %d %s",
average_tx_time,
sn->sample_tt[size_bin],
bin_to_size(size_bin),
@@ -776,12 +779,9 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_node *an,
printf("cur rix/att %x/%d, best rix/att %x/%d\n",
MCS(cur_rix), cur_att, MCS(best_rix), average_tx_time);
#endif
-#if 0
- if (((MCS(best_rix) & 0x7) > (MCS(cur_rix) & 0x7)) &&
- (average_tx_time * 10) <= (cur_att * 10)) {
-#else
- if ((average_tx_time * 10) <= (cur_att * 10)) {
-#endif
+ if ((best_rix != cur_rix) &&
+ ((MCS(best_rix) & 0x7) >= (MCS(cur_rix) & 0x7)) &&
+ (average_tx_time * 9) <= (cur_att * 10)) {
IEEE80211_NOTE(an->an_node.ni_vap,
IEEE80211_MSG_RATECTL, &an->an_node,
"%s: HT: size %d best_rix 0x%x > "
@@ -823,7 +823,9 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_node *an,
/*
* Set the visible txrate for this node.
*/
- an->an_node.ni_txrate = (rt->info[best_rix].phy == IEEE80211_T_HT) ? MCS(best_rix) : DOT11RATE(best_rix);
+ an->an_node.ni_txrate =
+ (rt->info[best_rix].phy == IEEE80211_T_HT) ?
+ MCS(best_rix) : DOT11RATE(best_rix);
}
rix = sn->current_rix[size_bin];
sn->packets_since_switch[size_bin]++;