aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/mac80211.h
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2008-10-05 12:04:24 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-10-06 18:14:57 -0400
commit870abdf67170daa9f1022e55a35c469239fcc74c (patch)
tree5ca00db880d71149eea2cdaeb67ed20f5281071d /include/net/mac80211.h
parent76708dee382a69b2f9d0e50f413f99fefb2dc509 (diff)
mac80211: add multi-rate retry support
This patch adjusts the rate control API to allow multi-rate retry if supported by the driver. The ieee80211_hw struct specifies how many alternate rate selections the driver supports. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include/net/mac80211.h')
-rw-r--r--include/net/mac80211.h29
1 files changed, 25 insertions, 4 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index feb3be81dfa6..5617a1613c91 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -292,6 +292,20 @@ enum mac80211_tx_control_flags {
292#define IEEE80211_TX_INFO_DRIVER_DATA_PTRS \ 292#define IEEE80211_TX_INFO_DRIVER_DATA_PTRS \
293 (IEEE80211_TX_INFO_DRIVER_DATA_SIZE / sizeof(void *)) 293 (IEEE80211_TX_INFO_DRIVER_DATA_SIZE / sizeof(void *))
294 294
295/* maximum number of alternate rate retry stages */
296#define IEEE80211_TX_MAX_ALTRATE 3
297
298/**
299 * struct ieee80211_tx_altrate - alternate rate selection/status
300 *
301 * @rate_idx: rate index to attempt to send with
302 * @limit: number of retries before fallback
303 */
304struct ieee80211_tx_altrate {
305 s8 rate_idx;
306 u8 limit;
307};
308
295/** 309/**
296 * struct ieee80211_tx_info - skb transmit information 310 * struct ieee80211_tx_info - skb transmit information
297 * 311 *
@@ -335,12 +349,14 @@ struct ieee80211_tx_info {
335 struct ieee80211_key_conf *hw_key; 349 struct ieee80211_key_conf *hw_key;
336 struct ieee80211_sta *sta; 350 struct ieee80211_sta *sta;
337 unsigned long jiffies; 351 unsigned long jiffies;
338 s8 rts_cts_rate_idx, alt_retry_rate_idx; 352 s8 rts_cts_rate_idx;
339 u8 retry_limit; 353 u8 retry_limit;
354 struct ieee80211_tx_altrate retries[IEEE80211_TX_MAX_ALTRATE];
340 } control; 355 } control;
341 struct { 356 struct {
342 u64 ampdu_ack_map; 357 u64 ampdu_ack_map;
343 int ack_signal; 358 int ack_signal;
359 struct ieee80211_tx_altrate retries[IEEE80211_TX_MAX_ALTRATE + 1];
344 u8 retry_count; 360 u8 retry_count;
345 bool excessive_retries; 361 bool excessive_retries;
346 u8 ampdu_ack_len; 362 u8 ampdu_ack_len;
@@ -828,6 +844,9 @@ enum ieee80211_hw_flags {
828 * within &struct ieee80211_vif. 844 * within &struct ieee80211_vif.
829 * @sta_data_size: size (in bytes) of the drv_priv data area 845 * @sta_data_size: size (in bytes) of the drv_priv data area
830 * within &struct ieee80211_sta. 846 * within &struct ieee80211_sta.
847 *
848 * @max_altrates: maximum number of alternate rate retry stages
849 * @max_altrate_tries: maximum number of tries for each stage
831 */ 850 */
832struct ieee80211_hw { 851struct ieee80211_hw {
833 struct ieee80211_conf conf; 852 struct ieee80211_conf conf;
@@ -844,6 +863,8 @@ struct ieee80211_hw {
844 u16 ampdu_queues; 863 u16 ampdu_queues;
845 u16 max_listen_interval; 864 u16 max_listen_interval;
846 s8 max_signal; 865 s8 max_signal;
866 u8 max_altrates;
867 u8 max_altrate_tries;
847}; 868};
848 869
849struct ieee80211_hw *wiphy_to_hw(struct wiphy *wiphy); 870struct ieee80211_hw *wiphy_to_hw(struct wiphy *wiphy);
@@ -900,11 +921,11 @@ ieee80211_get_rts_cts_rate(const struct ieee80211_hw *hw,
900 921
901static inline struct ieee80211_rate * 922static inline struct ieee80211_rate *
902ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw, 923ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw,
903 const struct ieee80211_tx_info *c) 924 const struct ieee80211_tx_info *c, int idx)
904{ 925{
905 if (c->control.alt_retry_rate_idx < 0) 926 if (c->control.retries[idx].rate_idx < 0)
906 return NULL; 927 return NULL;
907 return &hw->wiphy->bands[c->band]->bitrates[c->control.alt_retry_rate_idx]; 928 return &hw->wiphy->bands[c->band]->bitrates[c->control.retries[idx].rate_idx];
908} 929}
909 930
910/** 931/**