mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-30 02:21:15 +00:00
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>
This commit is contained in:
parent
76708dee38
commit
870abdf671
7 changed files with 39 additions and 14 deletions
|
@ -454,15 +454,16 @@ ieee80211_tx_h_rate_ctrl(struct ieee80211_tx_data *tx)
|
|||
if (unlikely(rsel.probe_idx >= 0)) {
|
||||
info->flags |= IEEE80211_TX_CTL_RATE_CTRL_PROBE;
|
||||
tx->flags |= IEEE80211_TX_PROBE_LAST_FRAG;
|
||||
info->control.alt_retry_rate_idx = tx->rate_idx;
|
||||
info->control.retries[0].rate_idx = tx->rate_idx;
|
||||
info->control.retries[0].limit = tx->local->hw.max_altrate_tries;
|
||||
tx->rate_idx = rsel.probe_idx;
|
||||
} else
|
||||
info->control.alt_retry_rate_idx = -1;
|
||||
} else if (info->control.retries[0].limit == 0)
|
||||
info->control.retries[0].rate_idx = -1;
|
||||
|
||||
if (unlikely(tx->rate_idx < 0))
|
||||
return TX_DROP;
|
||||
} else
|
||||
info->control.alt_retry_rate_idx = -1;
|
||||
info->control.retries[0].rate_idx = -1;
|
||||
|
||||
if (tx->sdata->bss_conf.use_cts_prot &&
|
||||
(tx->flags & IEEE80211_TX_FRAGMENTED) && (rsel.nonerp_idx >= 0)) {
|
||||
|
@ -521,7 +522,7 @@ ieee80211_tx_h_misc(struct ieee80211_tx_data *tx)
|
|||
* frames.
|
||||
* TODO: The last fragment could still use multiple retry
|
||||
* rates. */
|
||||
info->control.alt_retry_rate_idx = -1;
|
||||
info->control.retries[0].rate_idx = -1;
|
||||
}
|
||||
|
||||
/* Use CTS protection for unicast frames sent using extended rates if
|
||||
|
@ -551,7 +552,7 @@ ieee80211_tx_h_misc(struct ieee80211_tx_data *tx)
|
|||
int idx;
|
||||
|
||||
/* Do not use multiple retry rates when using RTS/CTS */
|
||||
info->control.alt_retry_rate_idx = -1;
|
||||
info->control.retries[0].rate_idx = -1;
|
||||
|
||||
/* Use min(data rate, max base rate) as CTS/RTS rate */
|
||||
rate = &sband->bitrates[tx->rate_idx];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue