From: David S. Miller Date: Mon, 15 Feb 2010 06:30:54 +0000 (-0800) Subject: Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 X-Git-Tag: firefly_0821_release~9833^2~3055^2~324 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=5ecccb74dc91e22496a142b103ba958f93c29275;p=firefly-linux-kernel-4.4.55.git Merge branch 'master' of /linux/kernel/git/davem/net-2.6 Conflicts: net/mac80211/rate.c --- 5ecccb74dc91e22496a142b103ba958f93c29275 diff --cc net/mac80211/rate.c index 99ab24cc9783,12a2bff7dcdb..0b299d236fa1 --- a/net/mac80211/rate.c +++ b/net/mac80211/rate.c @@@ -303,31 -245,26 +303,34 @@@ void rate_control_get_rate(struct ieee8 info->control.rates[i].count = 1; } + if (sdata->local->hw.flags & IEEE80211_HW_HAS_RATE_CONTROL) + return; + - if (sta && sdata->force_unicast_rateidx > -1) { - info->control.rates[0].idx = sdata->force_unicast_rateidx; - } else { - ref->ops->get_rate(ref->priv, ista, priv_sta, txrc); - info->flags |= IEEE80211_TX_INTFL_RCALGO; - } + ref->ops->get_rate(ref->priv, ista, priv_sta, txrc); /* - * try to enforce the maximum rate the user wanted + * Try to enforce the rateidx mask the user wanted. skip this if the + * default mask (allow all rates) is used to save some processing for + * the common case. */ - if (sdata->max_ratectrl_rateidx > -1) + mask = sdata->rc_rateidx_mask[info->band]; + 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]; + } + /* + * Make sure the rate index selected for each TX rate is + * included in the configured mask and change the rate indexes + * if needed. + */ for (i = 0; i < IEEE80211_TX_MAX_RATES; i++) { + /* Rate masking supports only legacy rates for now */ if (info->control.rates[i].flags & IEEE80211_TX_RC_MCS) continue; - info->control.rates[i].idx = - min_t(s8, info->control.rates[i].idx, - sdata->max_ratectrl_rateidx); + rate_idx_match_mask(&info->control.rates[i], + txrc->sband->n_bitrates, mask); + } } BUG_ON(info->control.rates[0].idx < 0);