aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/rc80211_simple.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/rc80211_simple.c')
-rw-r--r--net/mac80211/rc80211_simple.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/net/mac80211/rc80211_simple.c b/net/mac80211/rc80211_simple.c
index 33de6f967e55..934676d687d6 100644
--- a/net/mac80211/rc80211_simple.c
+++ b/net/mac80211/rc80211_simple.c
@@ -207,21 +207,36 @@ rate_control_simple_get_rate(void *priv, struct net_device *dev,
207{ 207{
208 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); 208 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
209 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; 209 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
210 struct ieee80211_sub_if_data *sdata;
210 struct sta_info *sta; 211 struct sta_info *sta;
211 int rateidx; 212 int rateidx;
213 u16 fc;
212 214
213 sta = sta_info_get(local, hdr->addr1); 215 sta = sta_info_get(local, hdr->addr1);
214 216
215 if (!sta) { 217 /* Send management frames and broadcast/multicast data using lowest
216 sel->rate = rate_lowest(local, mode, NULL); 218 * rate. */
219 fc = le16_to_cpu(hdr->frame_control);
220 if ((fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA ||
221 is_multicast_ether_addr(hdr->addr1) || !sta) {
222 sel->rate = rate_lowest(local, mode, sta);
223 if (sta)
224 sta_info_put(sta);
217 return; 225 return;
218 } 226 }
219 227
228 /* If a forced rate is in effect, select it. */
229 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
230 if (sdata->bss && sdata->bss->force_unicast_rateidx > -1)
231 sta->txrate = sdata->bss->force_unicast_rateidx;
232
220 rateidx = sta->txrate; 233 rateidx = sta->txrate;
221 234
222 if (rateidx >= mode->num_rates) 235 if (rateidx >= mode->num_rates)
223 rateidx = mode->num_rates - 1; 236 rateidx = mode->num_rates - 1;
224 237
238 sta->last_txrate = rateidx;
239
225 sta_info_put(sta); 240 sta_info_put(sta);
226 241
227 sel->rate = &mode->rates[rateidx]; 242 sel->rate = &mode->rates[rateidx];