]> Pileus Git - ~andy/linux/blobdiff - drivers/net/wireless/ath/ath9k/rc.c
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux...
[~andy/linux] / drivers / net / wireless / ath / ath9k / rc.c
index 7eb1f4b458e4fb1f3c096fd297bb60b273d9c686..d3d7c51fa6c8bd65d7df5f803c99450aff980d95 100644 (file)
@@ -1275,15 +1275,21 @@ static void ath_tx_status(void *priv, struct ieee80211_supported_band *sband,
 }
 
 static void ath_rate_init(void *priv, struct ieee80211_supported_band *sband,
+                         struct cfg80211_chan_def *chandef,
                           struct ieee80211_sta *sta, void *priv_sta)
 {
        struct ath_softc *sc = priv;
        struct ath_common *common = ath9k_hw_common(sc->sc_ah);
        struct ath_rate_priv *ath_rc_priv = priv_sta;
        int i, j = 0;
+       u32 rate_flags = ieee80211_chandef_rate_flags(&sc->hw->conf.chandef);
 
        for (i = 0; i < sband->n_bitrates; i++) {
                if (sta->supp_rates[sband->band] & BIT(i)) {
+                       if ((rate_flags & sband->bitrates[i].flags)
+                           != rate_flags)
+                               continue;
+
                        ath_rc_priv->neg_rates.rs_rates[j]
                                = (sband->bitrates[i].bitrate * 2) / 10;
                        j++;
@@ -1313,6 +1319,7 @@ static void ath_rate_init(void *priv, struct ieee80211_supported_band *sband,
 }
 
 static void ath_rate_update(void *priv, struct ieee80211_supported_band *sband,
+                           struct cfg80211_chan_def *chandef,
                            struct ieee80211_sta *sta, void *priv_sta,
                            u32 changed)
 {
@@ -1324,8 +1331,8 @@ static void ath_rate_update(void *priv, struct ieee80211_supported_band *sband,
                ath_rc_init(sc, priv_sta);
 
                ath_dbg(ath9k_hw_common(sc->sc_ah), CONFIG,
-                       "Operating HT Bandwidth changed to: %d\n",
-                       cfg80211_get_chandef_type(&sc->hw->conf.chandef));
+                       "Operating Bandwidth changed to: %d\n",
+                       sc->hw->conf.chandef.width);
        }
 }