Commit df26e7ea authored by Andrew Lutomirski's avatar Andrew Lutomirski Committed by David S. Miller

rc80211_pid should respect fixed rates.

I would argue that mac80211 should handle fixed rates outside the rate
control code, which would also allow them to take effect immediately
instead of during the rate control callback, but this is pretty close
to correct.
Signed-Off-By: default avatarAndy Lutomirski <luto@myrealbox.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4b475898
...@@ -108,10 +108,6 @@ static void rate_control_pid_adjust_rate(struct ieee80211_local *local, ...@@ -108,10 +108,6 @@ static void rate_control_pid_adjust_rate(struct ieee80211_local *local,
int back = (adj > 0) ? 1 : -1; int back = (adj > 0) ? 1 : -1;
sdata = IEEE80211_DEV_TO_SUB_IF(sta->dev); sdata = IEEE80211_DEV_TO_SUB_IF(sta->dev);
if (sdata->bss && sdata->bss->force_unicast_rateidx > -1) {
/* forced unicast rate - do not change STA rate */
return;
}
mode = local->oper_hw_mode; mode = local->oper_hw_mode;
maxrate = sdata->bss ? sdata->bss->max_ratectrl_rateidx : -1; maxrate = sdata->bss ? sdata->bss->max_ratectrl_rateidx : -1;
...@@ -241,6 +237,7 @@ static void rate_control_pid_tx_status(void *priv, struct net_device *dev, ...@@ -241,6 +237,7 @@ static void rate_control_pid_tx_status(void *priv, struct net_device *dev,
{ {
struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
struct ieee80211_sub_if_data *sdata;
struct rc_pid_info *pinfo = priv; struct rc_pid_info *pinfo = priv;
struct sta_info *sta; struct sta_info *sta;
struct rc_pid_sta_info *spinfo; struct rc_pid_sta_info *spinfo;
...@@ -251,6 +248,13 @@ static void rate_control_pid_tx_status(void *priv, struct net_device *dev, ...@@ -251,6 +248,13 @@ static void rate_control_pid_tx_status(void *priv, struct net_device *dev,
if (!sta) if (!sta)
return; return;
/* Don't update the state if we're not controlling the rate. */
sdata = IEEE80211_DEV_TO_SUB_IF(sta->dev);
if (sdata->bss && sdata->bss->force_unicast_rateidx > -1) {
sta->txrate = sdata->bss->max_ratectrl_rateidx;
return;
}
/* Ignore all frames that were sent with a different rate than the rate /* Ignore all frames that were sent with a different rate than the rate
* we currently advise mac80211 to use. */ * we currently advise mac80211 to use. */
if (status->control.rate != &local->oper_hw_mode->rates[sta->txrate]) if (status->control.rate != &local->oper_hw_mode->rates[sta->txrate])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment