diff options
Diffstat (limited to 'net/mac80211/rate.c')
-rw-r--r-- | net/mac80211/rate.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c index 3d5a2cb835c4..f61244c0e0a2 100644 --- a/net/mac80211/rate.c +++ b/net/mac80211/rate.c | |||
@@ -233,6 +233,27 @@ static void rc_send_low_broadcast(s8 *idx, u32 basic_rates, | |||
233 | /* could not find a basic rate; use original selection */ | 233 | /* could not find a basic rate; use original selection */ |
234 | } | 234 | } |
235 | 235 | ||
236 | static inline s8 | ||
237 | rate_lowest_non_cck_index(struct ieee80211_supported_band *sband, | ||
238 | struct ieee80211_sta *sta) | ||
239 | { | ||
240 | int i; | ||
241 | |||
242 | for (i = 0; i < sband->n_bitrates; i++) { | ||
243 | struct ieee80211_rate *srate = &sband->bitrates[i]; | ||
244 | if ((srate->bitrate == 10) || (srate->bitrate == 20) || | ||
245 | (srate->bitrate == 55) || (srate->bitrate == 110)) | ||
246 | continue; | ||
247 | |||
248 | if (rate_supported(sta, sband->band, i)) | ||
249 | return i; | ||
250 | } | ||
251 | |||
252 | /* No matching rate found */ | ||
253 | return 0; | ||
254 | } | ||
255 | |||
256 | |||
236 | bool rate_control_send_low(struct ieee80211_sta *sta, | 257 | bool rate_control_send_low(struct ieee80211_sta *sta, |
237 | void *priv_sta, | 258 | void *priv_sta, |
238 | struct ieee80211_tx_rate_control *txrc) | 259 | struct ieee80211_tx_rate_control *txrc) |
@@ -242,7 +263,13 @@ bool rate_control_send_low(struct ieee80211_sta *sta, | |||
242 | int mcast_rate; | 263 | int mcast_rate; |
243 | 264 | ||
244 | if (!sta || !priv_sta || rc_no_data_or_no_ack(txrc)) { | 265 | if (!sta || !priv_sta || rc_no_data_or_no_ack(txrc)) { |
245 | info->control.rates[0].idx = rate_lowest_index(txrc->sband, sta); | 266 | if ((sband->band != IEEE80211_BAND_2GHZ) || |
267 | !(info->flags & IEEE80211_TX_CTL_NO_CCK_RATE)) | ||
268 | info->control.rates[0].idx = | ||
269 | rate_lowest_index(txrc->sband, sta); | ||
270 | else | ||
271 | info->control.rates[0].idx = | ||
272 | rate_lowest_non_cck_index(txrc->sband, sta); | ||
246 | info->control.rates[0].count = | 273 | info->control.rates[0].count = |
247 | (info->flags & IEEE80211_TX_CTL_NO_ACK) ? | 274 | (info->flags & IEEE80211_TX_CTL_NO_ACK) ? |
248 | 1 : txrc->hw->max_rate_tries; | 275 | 1 : txrc->hw->max_rate_tries; |