aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/mac80211.h
diff options
context:
space:
mode:
authorLuis R. Rodriguez <lrodriguez@atheros.com>2009-07-16 13:05:41 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-07-24 15:05:16 -0400
commit4c6d4f5c33fbe19b134c1af43af166fee79eb986 (patch)
tree789bd7f9c049ea9c57ad8f4826df6bcad3774ade /include/net/mac80211.h
parent943ab70f6aebfdc0005ef7e58ae982e9ec22224b (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 'include/net/mac80211.h')
-rw-r--r--include/net/mac80211.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index d98fac54577b..a861259c3050 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -2094,6 +2094,29 @@ static inline int rate_supported(struct ieee80211_sta *sta,
2094 return (sta == NULL || sta->supp_rates[band] & BIT(index)); 2094 return (sta == NULL || sta->supp_rates[band] & BIT(index));
2095} 2095}
2096 2096
2097/**
2098 * rate_control_send_low - helper for drivers for management/no-ack frames
2099 *
2100 * Rate control algorithms that agree to use the lowest rate to
2101 * send management frames and NO_ACK data with the respective hw
2102 * retries should use this in the beginning of their mac80211 get_rate
2103 * callback. If true is returned the rate control can simply return.
2104 * If false is returned we guarantee that sta and sta and priv_sta is
2105 * not null.
2106 *
2107 * Rate control algorithms wishing to do more intelligent selection of
2108 * rate for multicast/broadcast frames may choose to not use this.
2109 *
2110 * @sta: &struct ieee80211_sta pointer to the target destination. Note
2111 * that this may be null.
2112 * @priv_sta: private rate control structure. This may be null.
2113 * @txrc: rate control information we sholud populate for mac80211.
2114 */
2115bool rate_control_send_low(struct ieee80211_sta *sta,
2116 void *priv_sta,
2117 struct ieee80211_tx_rate_control *txrc);
2118
2119
2097static inline s8 2120static inline s8
2098rate_lowest_index(struct ieee80211_supported_band *sband, 2121rate_lowest_index(struct ieee80211_supported_band *sband,
2099 struct ieee80211_sta *sta) 2122 struct ieee80211_sta *sta)