]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ath9k: fix max phy rate at rate control init
authorRajkumar Manoharan <rmanohar@qca.qualcomm.com>
Sat, 10 Dec 2011 13:29:43 +0000 (18:59 +0530)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 6 Jan 2012 22:17:14 +0000 (14:17 -0800)
commit 10636bc2d60942254bda149827b922c41f4cb4af upstream.

The stations always chooses 1Mbps for all trasmitting frames,
whenever the AP is configured to lock the supported rates.
As the max phy rate is always set with the 4th from highest phy rate,
this assumption might be wrong if we have less than that. Fix that.

Cc: Paul Stewart <pstew@google.com>
Reported-by: Ajay Gummalla <agummalla@google.com>
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/net/wireless/ath/ath9k/rc.c

index c04a6c3cac7f62d3aa88ff186a29b88ee52146a5..297d762dc2532dbebdf7a7348e8ab09abb125b4f 100644 (file)
@@ -1250,7 +1250,9 @@ static void ath_rc_init(struct ath_softc *sc,
 
        ath_rc_priv->max_valid_rate = k;
        ath_rc_sort_validrates(rate_table, ath_rc_priv);
-       ath_rc_priv->rate_max_phy = ath_rc_priv->valid_rate_index[k-4];
+       ath_rc_priv->rate_max_phy = (k > 4) ?
+                                       ath_rc_priv->valid_rate_index[k-4] :
+                                       ath_rc_priv->valid_rate_index[k-1];
        ath_rc_priv->rate_table = rate_table;
 
        ath_dbg(common, ATH_DBG_CONFIG,