aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/mac80211.h
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-05-15 06:55:27 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-05-21 21:48:09 -0400
commit2e92e6f2c50b4baf85cca968f0e6f1b5c0df7d39 (patch)
treee845c2f3af6d29c807c540366b97b1d886b92c91 /include/net/mac80211.h
parent36d6825b91bc492b65b6333c369cd96a2fc8c903 (diff)
mac80211: use rate index in TX control
This patch modifies struct ieee80211_tx_control to give band info and the rate index (instead of rate pointers) to drivers. This mostly serves to reduce the TX control structure size to make it fit into skb->cb so that the fragmentation code can put it there and we can think about passing it to drivers that way in the future. The rt2x00 driver update was done by Ivo, thanks. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include/net/mac80211.h')
-rw-r--r--include/net/mac80211.h51
1 files changed, 39 insertions, 12 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index f00fc76a7344..0df91bea6c1f 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -266,27 +266,26 @@ enum mac80211_tx_control_flags {
266 * ieee80211_ops->remove_interface() callback funtion. 266 * ieee80211_ops->remove_interface() callback funtion.
267 * The hw_key pointer is valid until it has been removed with the 267 * The hw_key pointer is valid until it has been removed with the
268 * ieee80211_ops->set_key() callback function. 268 * ieee80211_ops->set_key() callback function.
269 * The tx_rate and alt_retry_rate pointers are valid until the phy is
270 * deregistered.
271 */ 269 */
272struct ieee80211_tx_control { 270struct ieee80211_tx_control {
273 struct ieee80211_vif *vif; 271 u32 flags; /* tx control flags defined above */
274 struct ieee80211_rate *tx_rate; 272
273 s8 tx_rate_idx, /* Transmit rate (indexes registered rates) */
274 rts_cts_rate_idx, /* Transmit rate for RTS/CTS frame */
275 alt_retry_rate_idx; /* retry rate for the last retries */
275 276
276 /* Transmit rate for RTS/CTS frame */ 277 s8 retry_limit; /* 1 = only first attempt, 2 = one retry, ..
277 struct ieee80211_rate *rts_cts_rate; 278 * This could be used when set_retry_limit
279 * is not implemented by the driver */
278 280
279 /* retry rate for the last retries */ 281 struct ieee80211_vif *vif;
280 struct ieee80211_rate *alt_retry_rate;
281 282
282 /* Key used for hardware encryption 283 /* Key used for hardware encryption
283 * NULL if IEEE80211_TXCTL_DO_NOT_ENCRYPT is set */ 284 * NULL if IEEE80211_TXCTL_DO_NOT_ENCRYPT is set */
284 struct ieee80211_key_conf *hw_key; 285 struct ieee80211_key_conf *hw_key;
285 286
286 u32 flags; /* tx control flags defined above */ 287 enum ieee80211_band band;
287 u8 retry_limit; /* 1 = only first attempt, 2 = one retry, .. 288
288 * This could be used when set_retry_limit
289 * is not implemented by the driver */
290 u8 antenna_sel_tx; /* 0 = default/diversity, otherwise bit 289 u8 antenna_sel_tx; /* 0 = default/diversity, otherwise bit
291 * position represents antenna number used */ 290 * position represents antenna number used */
292 u8 icv_len; /* length of the ICV/MIC field in octets */ 291 u8 icv_len; /* length of the ICV/MIC field in octets */
@@ -298,6 +297,7 @@ struct ieee80211_tx_control {
298}; 297};
299 298
300 299
300
301/** 301/**
302 * enum mac80211_rx_flags - receive flags 302 * enum mac80211_rx_flags - receive flags
303 * 303 *
@@ -823,6 +823,33 @@ static inline void SET_IEEE80211_PERM_ADDR(struct ieee80211_hw *hw, u8 *addr)
823 memcpy(hw->wiphy->perm_addr, addr, ETH_ALEN); 823 memcpy(hw->wiphy->perm_addr, addr, ETH_ALEN);
824} 824}
825 825
826static inline struct ieee80211_rate *
827ieee80211_get_tx_rate(const struct ieee80211_hw *hw,
828 const struct ieee80211_tx_control *c)
829{
830 if (WARN_ON(c->tx_rate_idx < 0))
831 return NULL;
832 return &hw->wiphy->bands[c->band]->bitrates[c->tx_rate_idx];
833}
834
835static inline struct ieee80211_rate *
836ieee80211_get_rts_cts_rate(const struct ieee80211_hw *hw,
837 const struct ieee80211_tx_control *c)
838{
839 if (c->rts_cts_rate_idx < 0)
840 return NULL;
841 return &hw->wiphy->bands[c->band]->bitrates[c->rts_cts_rate_idx];
842}
843
844static inline struct ieee80211_rate *
845ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw,
846 const struct ieee80211_tx_control *c)
847{
848 if (c->alt_retry_rate_idx < 0)
849 return NULL;
850 return &hw->wiphy->bands[c->band]->bitrates[c->alt_retry_rate_idx];
851}
852
826/** 853/**
827 * DOC: Hardware crypto acceleration 854 * DOC: Hardware crypto acceleration
828 * 855 *