aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/tx.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2010-01-06 06:09:08 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-01-12 13:50:11 -0500
commit37eb0b164cf9fa9f70c8500926f5cde7c652f48e (patch)
tree9260e7045f32268c8c4ded718677711d371cd5ed /net/mac80211/tx.c
parente00cfce0cb2a397859607bf515c6de9ce064b64a (diff)
cfg80211/mac80211: Use more generic bitrate mask for rate control
Extend struct cfg80211_bitrate_mask to actually use a bitfield mask instead of just a single fixed or maximum rate index. This change itself does not modify the behavior (except for debugfs files), but it prepares cfg80211 and mac80211 for a new nl80211 command for setting which rates can be used in TX rate control. Since frames are now going through the rate control algorithm unconditionally, the internal IEEE80211_TX_INTFL_RCALGO flag can now be removed. The RC implementations can use the rate_idx_mask value to optimize their behavior if only a single rate is enabled. The old max_rate_idx in struct ieee80211_tx_rate_control is maintained (but commented as deprecated) for backwards compatibility with existing RC implementations. Once these implementations have been updated to use the more generic rate_idx_mask, the max_rate_idx value can be removed. Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/tx.c')
-rw-r--r--net/mac80211/tx.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 4961168f5091..d3a44812f8bf 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -519,7 +519,11 @@ ieee80211_tx_h_rate_ctrl(struct ieee80211_tx_data *tx)
519 txrc.bss_conf = &tx->sdata->vif.bss_conf; 519 txrc.bss_conf = &tx->sdata->vif.bss_conf;
520 txrc.skb = tx->skb; 520 txrc.skb = tx->skb;
521 txrc.reported_rate.idx = -1; 521 txrc.reported_rate.idx = -1;
522 txrc.max_rate_idx = tx->sdata->max_ratectrl_rateidx; 522 txrc.rate_idx_mask = tx->sdata->rc_rateidx_mask[tx->channel->band];
523 if (txrc.rate_idx_mask == (1 << sband->n_bitrates) - 1)
524 txrc.max_rate_idx = -1;
525 else
526 txrc.max_rate_idx = fls(txrc.rate_idx_mask) - 1;
523 txrc.ap = tx->sdata->vif.type == NL80211_IFTYPE_AP; 527 txrc.ap = tx->sdata->vif.type == NL80211_IFTYPE_AP;
524 528
525 /* set up RTS protection if desired */ 529 /* set up RTS protection if desired */
@@ -2178,7 +2182,11 @@ struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw,
2178 txrc.bss_conf = &sdata->vif.bss_conf; 2182 txrc.bss_conf = &sdata->vif.bss_conf;
2179 txrc.skb = skb; 2183 txrc.skb = skb;
2180 txrc.reported_rate.idx = -1; 2184 txrc.reported_rate.idx = -1;
2181 txrc.max_rate_idx = sdata->max_ratectrl_rateidx; 2185 txrc.rate_idx_mask = sdata->rc_rateidx_mask[band];
2186 if (txrc.rate_idx_mask == (1 << sband->n_bitrates) - 1)
2187 txrc.max_rate_idx = -1;
2188 else
2189 txrc.max_rate_idx = fls(txrc.rate_idx_mask) - 1;
2182 txrc.ap = true; 2190 txrc.ap = true;
2183 rate_control_get_rate(sdata, NULL, &txrc); 2191 rate_control_get_rate(sdata, NULL, &txrc);
2184 2192