diff options
author | Felix Fietkau <nbd@openwrt.org> | 2010-02-18 19:46:36 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-02-19 15:52:48 -0500 |
commit | 5c0ba62fd4b2dce08055a89600f1d834f9f0fe9e (patch) | |
tree | 269325db69c99e953abdc98cf4fc0f48a69f51fc /drivers | |
parent | 54f2d7361da09f3fc2b5407f93ad3b86df951577 (diff) |
ath9k: fix rate control fallback rate selection
When selecting the tx fallback rate, rc.c used a separate variable
'nrix' for storing the next rate index, however it did not use that as
reference for further rate index lowering. Because of that, it ended up
reusing the same rate for multiple multi-rate retry stages, thus
decreasing delivery probability under changing link conditions.
This patch removes the separate (unnecessary) variable and fixes
fallback the way it was intended to work.
This should result in increased throughput and better link stability.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/rc.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c index 74290137f43d..2880507f9d3f 100644 --- a/drivers/net/wireless/ath/ath9k/rc.c +++ b/drivers/net/wireless/ath/ath9k/rc.c | |||
@@ -668,7 +668,7 @@ static void ath_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta, | |||
668 | struct ieee80211_tx_rate *rates = tx_info->control.rates; | 668 | struct ieee80211_tx_rate *rates = tx_info->control.rates; |
669 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; | 669 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; |
670 | __le16 fc = hdr->frame_control; | 670 | __le16 fc = hdr->frame_control; |
671 | u8 try_per_rate, i = 0, rix, nrix; | 671 | u8 try_per_rate, i = 0, rix; |
672 | int is_probe = 0; | 672 | int is_probe = 0; |
673 | 673 | ||
674 | if (rate_control_send_low(sta, priv_sta, txrc)) | 674 | if (rate_control_send_low(sta, priv_sta, txrc)) |
@@ -688,26 +688,25 @@ static void ath_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta, | |||
688 | 688 | ||
689 | rate_table = sc->cur_rate_table; | 689 | rate_table = sc->cur_rate_table; |
690 | rix = ath_rc_get_highest_rix(sc, ath_rc_priv, rate_table, &is_probe); | 690 | rix = ath_rc_get_highest_rix(sc, ath_rc_priv, rate_table, &is_probe); |
691 | nrix = rix; | ||
692 | 691 | ||
693 | if (is_probe) { | 692 | if (is_probe) { |
694 | /* set one try for probe rates. For the | 693 | /* set one try for probe rates. For the |
695 | * probes don't enable rts */ | 694 | * probes don't enable rts */ |
696 | ath_rc_rate_set_series(rate_table, &rates[i++], txrc, | 695 | ath_rc_rate_set_series(rate_table, &rates[i++], txrc, |
697 | 1, nrix, 0); | 696 | 1, rix, 0); |
698 | 697 | ||
699 | /* Get the next tried/allowed rate. No RTS for the next series | 698 | /* Get the next tried/allowed rate. No RTS for the next series |
700 | * after the probe rate | 699 | * after the probe rate |
701 | */ | 700 | */ |
702 | ath_rc_get_lower_rix(rate_table, ath_rc_priv, rix, &nrix); | 701 | ath_rc_get_lower_rix(rate_table, ath_rc_priv, rix, &rix); |
703 | ath_rc_rate_set_series(rate_table, &rates[i++], txrc, | 702 | ath_rc_rate_set_series(rate_table, &rates[i++], txrc, |
704 | try_per_rate, nrix, 0); | 703 | try_per_rate, rix, 0); |
705 | 704 | ||
706 | tx_info->flags |= IEEE80211_TX_CTL_RATE_CTRL_PROBE; | 705 | tx_info->flags |= IEEE80211_TX_CTL_RATE_CTRL_PROBE; |
707 | } else { | 706 | } else { |
708 | /* Set the choosen rate. No RTS for first series entry. */ | 707 | /* Set the choosen rate. No RTS for first series entry. */ |
709 | ath_rc_rate_set_series(rate_table, &rates[i++], txrc, | 708 | ath_rc_rate_set_series(rate_table, &rates[i++], txrc, |
710 | try_per_rate, nrix, 0); | 709 | try_per_rate, rix, 0); |
711 | } | 710 | } |
712 | 711 | ||
713 | /* Fill in the other rates for multirate retry */ | 712 | /* Fill in the other rates for multirate retry */ |
@@ -716,10 +715,10 @@ static void ath_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta, | |||
716 | if (i + 1 == 4) | 715 | if (i + 1 == 4) |
717 | try_per_rate = 8; | 716 | try_per_rate = 8; |
718 | 717 | ||
719 | ath_rc_get_lower_rix(rate_table, ath_rc_priv, rix, &nrix); | 718 | ath_rc_get_lower_rix(rate_table, ath_rc_priv, rix, &rix); |
720 | /* All other rates in the series have RTS enabled */ | 719 | /* All other rates in the series have RTS enabled */ |
721 | ath_rc_rate_set_series(rate_table, &rates[i], txrc, | 720 | ath_rc_rate_set_series(rate_table, &rates[i], txrc, |
722 | try_per_rate, nrix, 1); | 721 | try_per_rate, rix, 1); |
723 | } | 722 | } |
724 | 723 | ||
725 | /* | 724 | /* |