mac80211: notify drivers on sta rate table changes
[linux-block.git] / net / mac80211 / rate.c
index 8fdadfd94ba8576ae8bc0ee2e99e8c656c2f6a5b..08ab7d6d15173822d844e60f920e15b5ac94c1cc 100644 (file)
@@ -385,7 +385,7 @@ static void rate_idx_match_mask(struct ieee80211_tx_rate *rate,
                        *rate = alt_rate;
                        return;
                }
-       } else {
+       } else if (!(rate->flags & IEEE80211_TX_RC_VHT_MCS)) {
                /* handle legacy rates */
                if (rate_idx_match_legacy_mask(rate, sband->n_bitrates, mask))
                        return;
@@ -448,7 +448,7 @@ static void rate_fixup_ratelist(struct ieee80211_vif *vif,
         */
        if (!(rates[0].flags & IEEE80211_TX_RC_MCS)) {
                u32 basic_rates = vif->bss_conf.basic_rates;
-               s8 baserate = basic_rates ? ffs(basic_rates - 1) : 0;
+               s8 baserate = basic_rates ? ffs(basic_rates) - 1 : 0;
 
                rate = &sband->bitrates[rates[0].idx];
 
@@ -696,6 +696,7 @@ int rate_control_set_rates(struct ieee80211_hw *hw,
                           struct ieee80211_sta *pubsta,
                           struct ieee80211_sta_rates *rates)
 {
+       struct sta_info *sta = container_of(pubsta, struct sta_info, sta);
        struct ieee80211_sta_rates *old;
 
        /*
@@ -709,6 +710,8 @@ int rate_control_set_rates(struct ieee80211_hw *hw,
        if (old)
                kfree_rcu(old, rcu_head);
 
+       drv_sta_rate_tbl_update(hw_to_local(hw), sta->sdata, pubsta);
+
        return 0;
 }
 EXPORT_SYMBOL(rate_control_set_rates);