aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath
diff options
context:
space:
mode:
authorRajkumar Manoharan <rmanohar@qca.qualcomm.com>2011-08-20 07:52:10 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-08-24 14:57:15 -0400
commita35e27802291a8119c2b12532fb5f3c1b3e565a2 (patch)
tree68b5fbeaf2311677741243bd0e1a2d7bcbc70093 /drivers/net/wireless/ath
parent2a15b394f8e46dd3e2ab365ab41cfa701d92fa77 (diff)
ath9k: Change rate control to use legacy rate as last MRR
In congested network, having all rate reties at MCS rates is failing to transmit the frame offenly. By the time reaching the success rate set, the application gets timed out. One such scenario is that authentication time out during 4-Way handshake. This patch uses a legacy rate as last retry sequnce for unaggregated frames or if the first selected rate's PER is ~80% of max limit. And also observed from the tx status that the frame was trasmitted successfully by using legacy rates. Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r--drivers/net/wireless/ath/ath9k/rc.c34
1 files changed, 27 insertions, 7 deletions
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
index 9e3649a3d5ca..4f1301881137 100644
--- a/drivers/net/wireless/ath/ath9k/rc.c
+++ b/drivers/net/wireless/ath/ath9k/rc.c
@@ -603,7 +603,8 @@ static u8 ath_rc_setvalid_htrates(struct ath_rate_priv *ath_rc_priv,
603static u8 ath_rc_get_highest_rix(struct ath_softc *sc, 603static u8 ath_rc_get_highest_rix(struct ath_softc *sc,
604 struct ath_rate_priv *ath_rc_priv, 604 struct ath_rate_priv *ath_rc_priv,
605 const struct ath_rate_table *rate_table, 605 const struct ath_rate_table *rate_table,
606 int *is_probing) 606 int *is_probing,
607 bool legacy)
607{ 608{
608 u32 best_thruput, this_thruput, now_msec; 609 u32 best_thruput, this_thruput, now_msec;
609 u8 rate, next_rate, best_rate, maxindex, minindex; 610 u8 rate, next_rate, best_rate, maxindex, minindex;
@@ -624,6 +625,8 @@ static u8 ath_rc_get_highest_rix(struct ath_softc *sc,
624 u8 per_thres; 625 u8 per_thres;
625 626
626 rate = ath_rc_priv->valid_rate_index[index]; 627 rate = ath_rc_priv->valid_rate_index[index];
628 if (legacy && !(rate_table->info[rate].rate_flags & RC_LEGACY))
629 continue;
627 if (rate > ath_rc_priv->rate_max_phy) 630 if (rate > ath_rc_priv->rate_max_phy)
628 continue; 631 continue;
629 632
@@ -767,7 +770,7 @@ static void ath_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta,
767 struct ieee80211_tx_rate *rates = tx_info->control.rates; 770 struct ieee80211_tx_rate *rates = tx_info->control.rates;
768 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; 771 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
769 __le16 fc = hdr->frame_control; 772 __le16 fc = hdr->frame_control;
770 u8 try_per_rate, i = 0, rix; 773 u8 try_per_rate, i = 0, rix, high_rix;
771 int is_probe = 0; 774 int is_probe = 0;
772 775
773 if (rate_control_send_low(sta, priv_sta, txrc)) 776 if (rate_control_send_low(sta, priv_sta, txrc))
@@ -786,7 +789,9 @@ static void ath_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta,
786 try_per_rate = 4; 789 try_per_rate = 4;
787 790
788 rate_table = ath_rc_priv->rate_table; 791 rate_table = ath_rc_priv->rate_table;
789 rix = ath_rc_get_highest_rix(sc, ath_rc_priv, rate_table, &is_probe); 792 rix = ath_rc_get_highest_rix(sc, ath_rc_priv, rate_table,
793 &is_probe, false);
794 high_rix = rix;
790 795
791 /* 796 /*
792 * If we're in HT mode and both us and our peer supports LDPC. 797 * If we're in HT mode and both us and our peer supports LDPC.
@@ -822,10 +827,7 @@ static void ath_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta,
822 } 827 }
823 828
824 /* Fill in the other rates for multirate retry */ 829 /* Fill in the other rates for multirate retry */
825 for ( ; i < 4; i++) { 830 for ( ; i < 3; i++) {
826 /* Use twice the number of tries for the last MRR segment. */
827 if (i + 1 == 4)
828 try_per_rate = 8;
829 831
830 ath_rc_get_lower_rix(rate_table, ath_rc_priv, rix, &rix); 832 ath_rc_get_lower_rix(rate_table, ath_rc_priv, rix, &rix);
831 /* All other rates in the series have RTS enabled */ 833 /* All other rates in the series have RTS enabled */
@@ -833,6 +835,24 @@ static void ath_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta,
833 try_per_rate, rix, 1); 835 try_per_rate, rix, 1);
834 } 836 }
835 837
838 /* Use twice the number of tries for the last MRR segment. */
839 try_per_rate = 8;
840
841 /*
842 * Use a legacy rate as last retry to ensure that the frame
843 * is tried in both MCS and legacy rates.
844 */
845 if ((rates[2].flags & IEEE80211_TX_RC_MCS) &&
846 (!(tx_info->flags & IEEE80211_TX_CTL_AMPDU) ||
847 (ath_rc_priv->per[high_rix] > 45)))
848 rix = ath_rc_get_highest_rix(sc, ath_rc_priv, rate_table,
849 &is_probe, true);
850 else
851 ath_rc_get_lower_rix(rate_table, ath_rc_priv, rix, &rix);
852
853 /* All other rates in the series have RTS enabled */
854 ath_rc_rate_set_series(rate_table, &rates[i], txrc,
855 try_per_rate, rix, 1);
836 /* 856 /*
837 * NB:Change rate series to enable aggregation when operating 857 * NB:Change rate series to enable aggregation when operating
838 * at lower MCS rates. When first rate in series is MCS2 858 * at lower MCS rates. When first rate in series is MCS2