aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/rc.c
diff options
context:
space:
mode:
authorLuis R. Rodriguez <lrodriguez@atheros.com>2009-07-14 20:13:56 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-07-24 15:05:14 -0400
commitdd1901830ca7baaaae2e58f549f770f215c6f3af (patch)
tree1a6e4336c22696858bc39b16c5abf1f828691c97 /drivers/net/wireless/ath/ath9k/rc.c
parent0ab216d9727c0728c8b5f9ad627b6955570303d7 (diff)
ath9k: cleanup try count for MRR in rate control
This has no functional change and just cleans up the code to be more legible and removes a useless variable for Multi Rate Retry. For regular frames we use 2 retries for MRR segments [0-2]. For the last MRR segment [3] we use 4. MRR[0] = 2 MRR[1] = 2 MRR[2] = 2 MRR[3] = 4 Cc: Derek Smithies <derek@indranet.co.nz> Cc: Chittajit Mitra <Chittajit.Mitra@Atheros.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/rc.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/rc.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
index d7f403080f7a..a23b66bdbe92 100644
--- a/drivers/net/wireless/ath/ath9k/rc.c
+++ b/drivers/net/wireless/ath/ath9k/rc.c
@@ -853,9 +853,21 @@ static void ath_rc_ratefind(struct ath_softc *sc,
853 struct ieee80211_tx_rate *rates = tx_info->control.rates; 853 struct ieee80211_tx_rate *rates = tx_info->control.rates;
854 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; 854 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
855 __le16 fc = hdr->frame_control; 855 __le16 fc = hdr->frame_control;
856 u8 try_per_rate = 0, i = 0, rix, nrix; 856 u8 try_per_rate, i = 0, rix, nrix;
857 int is_probe = 0; 857 int is_probe = 0;
858 858
859 /*
860 * For Multi Rate Retry we use a different number of
861 * retry attempt counts. This ends up looking like this:
862 *
863 * MRR[0] = 2
864 * MRR[1] = 2
865 * MRR[2] = 2
866 * MRR[3] = 4
867 *
868 */
869 try_per_rate = sc->hw->max_rate_tries;
870
859 rate_table = sc->cur_rate_table; 871 rate_table = sc->cur_rate_table;
860 rix = ath_rc_ratefind_ht(sc, ath_rc_priv, rate_table, &is_probe); 872 rix = ath_rc_ratefind_ht(sc, ath_rc_priv, rate_table, &is_probe);
861 nrix = rix; 873 nrix = rix;
@@ -866,7 +878,6 @@ static void ath_rc_ratefind(struct ath_softc *sc,
866 ath_rc_rate_set_series(rate_table, &rates[i++], txrc, 878 ath_rc_rate_set_series(rate_table, &rates[i++], txrc,
867 1, nrix, 0); 879 1, nrix, 0);
868 880
869 try_per_rate = (ATH_11N_TXMAXTRY/4);
870 /* Get the next tried/allowed rate. No RTS for the next series 881 /* Get the next tried/allowed rate. No RTS for the next series
871 * after the probe rate 882 * after the probe rate
872 */ 883 */
@@ -877,7 +888,6 @@ static void ath_rc_ratefind(struct ath_softc *sc,
877 888
878 tx_info->flags |= IEEE80211_TX_CTL_RATE_CTRL_PROBE; 889 tx_info->flags |= IEEE80211_TX_CTL_RATE_CTRL_PROBE;
879 } else { 890 } else {
880 try_per_rate = (ATH_11N_TXMAXTRY/4);
881 /* Set the choosen rate. No RTS for first series entry. */ 891 /* Set the choosen rate. No RTS for first series entry. */
882 ath_rc_rate_set_series(rate_table, &rates[i++], txrc, 892 ath_rc_rate_set_series(rate_table, &rates[i++], txrc,
883 try_per_rate, nrix, 0); 893 try_per_rate, nrix, 0);
@@ -885,18 +895,19 @@ static void ath_rc_ratefind(struct ath_softc *sc,
885 895
886 /* Fill in the other rates for multirate retry */ 896 /* Fill in the other rates for multirate retry */
887 for ( ; i < 4; i++) { 897 for ( ; i < 4; i++) {
888 u8 try_num;
889 u8 min_rate; 898 u8 min_rate;
890 899
891 try_num = ((i + 1) == 4) ? 900 /* Use twice the number of tries for the last MRR segment. */
892 ATH_11N_TXMAXTRY - (try_per_rate * i) : try_per_rate ; 901 if (i + 1 == 4)
902 try_per_rate = 4;
903
893 min_rate = (((i + 1) == 4) && 0); 904 min_rate = (((i + 1) == 4) && 0);
894 905
895 nrix = ath_rc_rate_getidx(sc, ath_rc_priv, 906 nrix = ath_rc_rate_getidx(sc, ath_rc_priv,
896 rate_table, nrix, 1, min_rate); 907 rate_table, nrix, 1, min_rate);
897 /* All other rates in the series have RTS enabled */ 908 /* All other rates in the series have RTS enabled */
898 ath_rc_rate_set_series(rate_table, &rates[i], txrc, 909 ath_rc_rate_set_series(rate_table, &rates[i], txrc,
899 try_num, nrix, 1); 910 try_per_rate, nrix, 1);
900 } 911 }
901 912
902 /* 913 /*
@@ -1529,7 +1540,7 @@ static void ath_tx_status(void *priv, struct ieee80211_supported_band *sband,
1529 /* 1540 /*
1530 * If underrun error is seen assume it as an excessive retry only 1541 * If underrun error is seen assume it as an excessive retry only
1531 * if prefetch trigger level have reached the max (0x3f for 5416) 1542 * if prefetch trigger level have reached the max (0x3f for 5416)
1532 * Adjust the long retry as if the frame was tried ATH_11N_TXMAXTRY 1543 * Adjust the long retry as if the frame was tried hw->max_rate_tries
1533 * times. This affects how ratectrl updates PER for the failed rate. 1544 * times. This affects how ratectrl updates PER for the failed rate.
1534 */ 1545 */
1535 if (tx_info_priv->tx.ts_flags & 1546 if (tx_info_priv->tx.ts_flags &
@@ -1544,7 +1555,7 @@ static void ath_tx_status(void *priv, struct ieee80211_supported_band *sband,
1544 tx_status = 1; 1555 tx_status = 1;
1545 1556
1546 ath_rc_tx_status(sc, ath_rc_priv, tx_info, final_ts_idx, tx_status, 1557 ath_rc_tx_status(sc, ath_rc_priv, tx_info, final_ts_idx, tx_status,
1547 (is_underrun) ? ATH_11N_TXMAXTRY : 1558 (is_underrun) ? sc->hw->max_rate_tries :
1548 tx_info_priv->tx.ts_longretry); 1559 tx_info_priv->tx.ts_longretry);
1549 1560
1550 /* Check if aggregation has to be enabled for this tid */ 1561 /* Check if aggregation has to be enabled for this tid */