aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/rate.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/rate.c')
-rw-r--r--net/mac80211/rate.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c
index ba63ac851c2b..e126605cec66 100644
--- a/net/mac80211/rate.c
+++ b/net/mac80211/rate.c
@@ -210,7 +210,7 @@ static bool rc_no_data_or_no_ack_use_min(struct ieee80211_tx_rate_control *txrc)
210 !ieee80211_is_data(fc); 210 !ieee80211_is_data(fc);
211} 211}
212 212
213static void rc_send_low_broadcast(s8 *idx, u32 basic_rates, 213static void rc_send_low_basicrate(s8 *idx, u32 basic_rates,
214 struct ieee80211_supported_band *sband) 214 struct ieee80211_supported_band *sband)
215{ 215{
216 u8 i; 216 u8 i;
@@ -263,28 +263,37 @@ static void __rate_control_send_low(struct ieee80211_hw *hw,
263} 263}
264 264
265 265
266bool rate_control_send_low(struct ieee80211_sta *sta, 266bool rate_control_send_low(struct ieee80211_sta *pubsta,
267 void *priv_sta, 267 void *priv_sta,
268 struct ieee80211_tx_rate_control *txrc) 268 struct ieee80211_tx_rate_control *txrc)
269{ 269{
270 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(txrc->skb); 270 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(txrc->skb);
271 struct ieee80211_supported_band *sband = txrc->sband; 271 struct ieee80211_supported_band *sband = txrc->sband;
272 struct sta_info *sta;
272 int mcast_rate; 273 int mcast_rate;
274 bool use_basicrate = false;
273 275
274 if (!sta || !priv_sta || rc_no_data_or_no_ack_use_min(txrc)) { 276 if (!pubsta || !priv_sta || rc_no_data_or_no_ack_use_min(txrc)) {
275 __rate_control_send_low(txrc->hw, sband, sta, info); 277 __rate_control_send_low(txrc->hw, sband, pubsta, info);
276 278
277 if (!sta && txrc->bss) { 279 if (!pubsta && txrc->bss) {
278 mcast_rate = txrc->bss_conf->mcast_rate[sband->band]; 280 mcast_rate = txrc->bss_conf->mcast_rate[sband->band];
279 if (mcast_rate > 0) { 281 if (mcast_rate > 0) {
280 info->control.rates[0].idx = mcast_rate - 1; 282 info->control.rates[0].idx = mcast_rate - 1;
281 return true; 283 return true;
282 } 284 }
285 use_basicrate = true;
286 } else if (pubsta) {
287 sta = container_of(pubsta, struct sta_info, sta);
288 if (ieee80211_vif_is_mesh(&sta->sdata->vif))
289 use_basicrate = true;
290 }
283 291
284 rc_send_low_broadcast(&info->control.rates[0].idx, 292 if (use_basicrate)
293 rc_send_low_basicrate(&info->control.rates[0].idx,
285 txrc->bss_conf->basic_rates, 294 txrc->bss_conf->basic_rates,
286 sband); 295 sband);
287 } 296
288 return true; 297 return true;
289 } 298 }
290 return false; 299 return false;