diff options
author | Rajkumar Manoharan <rmanohar@qca.qualcomm.com> | 2011-09-25 05:23:31 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-09-27 14:34:10 -0400 |
commit | aad14ceb45f5ff12da2ab5b37a596e6f81566515 (patch) | |
tree | 898380834d260961219b687e377b60c41f5f16e9 /net/mac80211/rate.c | |
parent | e9f935e3e8dc0bddd0df6d148165d95925422502 (diff) |
mac80211: Send the management frame at requested rate
Whenever the scan request or tx_mgmt is requesting not to
use CCK rate for managemet frames through
NL80211_ATTR_TX_NO_CCK_RATE attribute, then mac80211 should
select appropriate least non-CCK rate. This could help to
send P2P probes and P2P action frames at non 11b rates
without diabling 11b rates globally.
Cc: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
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; |