提交 1d2d350b 编写于 作者: A Andrei Otcheretianski 提交者: Johannes Berg

mac80211: respect rate mask in TX

Bitrate mask were not respected in transmissions, causing (for
example) P2P GO/client to use CCK rates for auth and assoc frames.
Fix it by considering the rate mask in __rate_control_send_low().
Signed-off-by: NAndrei Otcheretianski <andrei.otcheretianski@intel.com>
Reviewed-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
上级 1431fcb7
...@@ -235,7 +235,8 @@ static void rc_send_low_basicrate(s8 *idx, u32 basic_rates, ...@@ -235,7 +235,8 @@ static void rc_send_low_basicrate(s8 *idx, u32 basic_rates,
static void __rate_control_send_low(struct ieee80211_hw *hw, static void __rate_control_send_low(struct ieee80211_hw *hw,
struct ieee80211_supported_band *sband, struct ieee80211_supported_band *sband,
struct ieee80211_sta *sta, struct ieee80211_sta *sta,
struct ieee80211_tx_info *info) struct ieee80211_tx_info *info,
u32 rate_mask)
{ {
int i; int i;
u32 rate_flags = u32 rate_flags =
...@@ -247,6 +248,9 @@ static void __rate_control_send_low(struct ieee80211_hw *hw, ...@@ -247,6 +248,9 @@ static void __rate_control_send_low(struct ieee80211_hw *hw,
info->control.rates[0].idx = 0; info->control.rates[0].idx = 0;
for (i = 0; i < sband->n_bitrates; i++) { for (i = 0; i < sband->n_bitrates; i++) {
if (!(rate_mask & BIT(i)))
continue;
if ((rate_flags & sband->bitrates[i].flags) != rate_flags) if ((rate_flags & sband->bitrates[i].flags) != rate_flags)
continue; continue;
...@@ -277,7 +281,8 @@ bool rate_control_send_low(struct ieee80211_sta *pubsta, ...@@ -277,7 +281,8 @@ bool rate_control_send_low(struct ieee80211_sta *pubsta,
bool use_basicrate = false; bool use_basicrate = false;
if (!pubsta || !priv_sta || rc_no_data_or_no_ack_use_min(txrc)) { if (!pubsta || !priv_sta || rc_no_data_or_no_ack_use_min(txrc)) {
__rate_control_send_low(txrc->hw, sband, pubsta, info); __rate_control_send_low(txrc->hw, sband, pubsta, info,
txrc->rate_idx_mask);
if (!pubsta && txrc->bss) { if (!pubsta && txrc->bss) {
mcast_rate = txrc->bss_conf->mcast_rate[sband->band]; mcast_rate = txrc->bss_conf->mcast_rate[sband->band];
...@@ -659,7 +664,8 @@ void ieee80211_get_tx_rates(struct ieee80211_vif *vif, ...@@ -659,7 +664,8 @@ void ieee80211_get_tx_rates(struct ieee80211_vif *vif,
rate_control_apply_mask(sdata, sta, sband, info, dest, max_rates); rate_control_apply_mask(sdata, sta, sband, info, dest, max_rates);
if (dest[0].idx < 0) if (dest[0].idx < 0)
__rate_control_send_low(&sdata->local->hw, sband, sta, info); __rate_control_send_low(&sdata->local->hw, sband, sta, info,
sdata->rc_rateidx_mask[info->band]);
if (sta) if (sta)
rate_fixup_ratelist(vif, sband, info, dest, max_rates); rate_fixup_ratelist(vif, sband, info, dest, max_rates);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册