diff options
| -rw-r--r-- | net/mac80211/tx.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index aad0bf5d8812..c93483fd477e 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c | |||
| @@ -712,19 +712,22 @@ ieee80211_tx_h_rate_ctrl(struct ieee80211_tx_data *tx) | |||
| 712 | } | 712 | } |
| 713 | 713 | ||
| 714 | /* | 714 | /* |
| 715 | * set up the RTS/CTS rate as the fastest basic rate | 715 | * Set up the RTS/CTS rate as the fastest basic rate |
| 716 | * that is not faster than the data rate | 716 | * that is not faster than the data rate unless there |
| 717 | * is no basic rate slower than the data rate, in which | ||
| 718 | * case we pick the slowest basic rate | ||
| 717 | * | 719 | * |
| 718 | * XXX: Should this check all retry rates? | 720 | * XXX: Should this check all retry rates? |
| 719 | */ | 721 | */ |
| 720 | if (!(info->control.rates[0].flags & IEEE80211_TX_RC_MCS)) { | 722 | if (!(info->control.rates[0].flags & IEEE80211_TX_RC_MCS)) { |
| 721 | s8 baserate = 0; | 723 | u32 basic_rates = tx->sdata->vif.bss_conf.basic_rates; |
| 724 | s8 baserate = basic_rates ? ffs(basic_rates - 1) : 0; | ||
| 722 | 725 | ||
| 723 | rate = &sband->bitrates[info->control.rates[0].idx]; | 726 | rate = &sband->bitrates[info->control.rates[0].idx]; |
| 724 | 727 | ||
| 725 | for (i = 0; i < sband->n_bitrates; i++) { | 728 | for (i = 0; i < sband->n_bitrates; i++) { |
| 726 | /* must be a basic rate */ | 729 | /* must be a basic rate */ |
| 727 | if (!(tx->sdata->vif.bss_conf.basic_rates & BIT(i))) | 730 | if (!(basic_rates & BIT(i))) |
| 728 | continue; | 731 | continue; |
| 729 | /* must not be faster than the data rate */ | 732 | /* must not be faster than the data rate */ |
| 730 | if (sband->bitrates[i].bitrate > rate->bitrate) | 733 | if (sband->bitrates[i].bitrate > rate->bitrate) |
