diff options
author | Luis R. Rodriguez <lrodriguez@atheros.com> | 2009-07-16 13:05:41 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-07-24 15:05:16 -0400 |
commit | 4c6d4f5c33fbe19b134c1af43af166fee79eb986 (patch) | |
tree | 789bd7f9c049ea9c57ad8f4826df6bcad3774ade /net/mac80211/rc80211_pid_algo.c | |
parent | 943ab70f6aebfdc0005ef7e58ae982e9ec22224b (diff) |
mac80211: add helper for management / no-ack frame rate decision
All current rate control algorithms agree to send management and no-ack
frames at the lowest rate. They also agree to do this when sta
and the private rate control data is NULL. We add a hlper to mac80211
for this and simplify the rate control algorithm code.
Developers wishing to make enhancements to rate control algorithms
are for broadcast/multicast can opt to not use this in their
gate_rate() mac80211 callback.
Cc: Zhu Yi <yi.zhu@intel.com>
Acked-by: Reinette Chatre <reinette.chatre@intel.com>
Cc: ipw3945-devel@lists.sourceforge.net
Cc: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Felix Fietkau <nbd@openwrt.org>
Cc: Derek Smithies <derek@indranet.co.nz>
Cc: Chittajit Mitra <Chittajit.Mitra@Atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/rc80211_pid_algo.c')
-rw-r--r-- | net/mac80211/rc80211_pid_algo.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/net/mac80211/rc80211_pid_algo.c b/net/mac80211/rc80211_pid_algo.c index 549607703bd8..8c053be9dc24 100644 --- a/net/mac80211/rc80211_pid_algo.c +++ b/net/mac80211/rc80211_pid_algo.c | |||
@@ -276,11 +276,9 @@ rate_control_pid_get_rate(void *priv, struct ieee80211_sta *sta, | |||
276 | { | 276 | { |
277 | struct sk_buff *skb = txrc->skb; | 277 | struct sk_buff *skb = txrc->skb; |
278 | struct ieee80211_supported_band *sband = txrc->sband; | 278 | struct ieee80211_supported_band *sband = txrc->sband; |
279 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; | ||
280 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | 279 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
281 | struct rc_pid_sta_info *spinfo = priv_sta; | 280 | struct rc_pid_sta_info *spinfo = priv_sta; |
282 | int rateidx; | 281 | int rateidx; |
283 | __le16 fc; | ||
284 | 282 | ||
285 | if (txrc->rts) | 283 | if (txrc->rts) |
286 | info->control.rates[0].count = | 284 | info->control.rates[0].count = |
@@ -290,15 +288,8 @@ rate_control_pid_get_rate(void *priv, struct ieee80211_sta *sta, | |||
290 | txrc->hw->conf.short_frame_max_tx_count; | 288 | txrc->hw->conf.short_frame_max_tx_count; |
291 | 289 | ||
292 | /* Send management frames and NO_ACK data using lowest rate. */ | 290 | /* Send management frames and NO_ACK data using lowest rate. */ |
293 | fc = hdr->frame_control; | 291 | if (rate_control_send_low(sta, priv_sta, txrc)) |
294 | if (!sta || !spinfo || !ieee80211_is_data(fc) || | ||
295 | info->flags & IEEE80211_TX_CTL_NO_ACK) { | ||
296 | info->control.rates[0].idx = rate_lowest_index(sband, sta); | ||
297 | if (info->flags & IEEE80211_TX_CTL_NO_ACK) | ||
298 | info->control.rates[0].count = 1; | ||
299 | |||
300 | return; | 292 | return; |
301 | } | ||
302 | 293 | ||
303 | rateidx = spinfo->txrate_idx; | 294 | rateidx = spinfo->txrate_idx; |
304 | 295 | ||