From: Karl Beldan <karl.beldan@xxxxxxxxxxxxxxxx> Currently we get it from the sdata. This uses the ad-hoc masks of the ieee80211_tx_rate_control txrc and lets the mcs mask get overwritten to spare an IEEE80211_HT_MCS_MASK_LEN bytes memcpy since it is not used afterwards. Signed-off-by: Karl Beldan <karl.beldan@xxxxxxxxxxxxxxxx> --- net/mac80211/rate.c | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-) diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c index dd88381..cedc2ef 100644 --- a/net/mac80211/rate.c +++ b/net/mac80211/rate.c @@ -436,7 +436,7 @@ void rate_control_get_rate(struct ieee80211_sub_if_data *sdata, struct ieee80211_tx_info *info = IEEE80211_SKB_CB(txrc->skb); int i; u32 mask; - u8 mcs_mask[IEEE80211_HT_MCS_MASK_LEN]; + u8 *mcs_mask; if (sta && test_sta_flag(sta, WLAN_STA_RATE_CONTROL)) { ista = &sta->sta; @@ -459,14 +459,13 @@ void rate_control_get_rate(struct ieee80211_sub_if_data *sdata, * default mask (allow all rates) is used to save some processing for * the common case. */ - mask = sdata->rc_rateidx_mask[info->band]; - memcpy(mcs_mask, sdata->rc_rateidx_mcs_mask[info->band], - sizeof(mcs_mask)); + mask = txrc->rate_idx_mask; + mcs_mask = txrc->rate_idx_mcs_mask; if (mask != (1 << txrc->sband->n_bitrates) - 1) { if (sta) { /* Filter out rates that the STA does not support */ mask &= sta->sta.supp_rates[info->band]; - for (i = 0; i < sizeof(mcs_mask); i++) + for (i = 0; i < sizeof(txrc->rate_idx_mcs_mask); i++) mcs_mask[i] &= sta->sta.ht_cap.mcs.rx_mask[i]; } /* -- 1.7.9.dirty -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html