Commit 4b5a433a authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville

mac80211: call rate control only after init

There are situations where we don't have the
necessary rate control information yet for
station entries, e.g. when associating. This
currently doesn't really happen due to the
dummy station handling; explicitly disabling
rate control when it's not initialised will
allow us to remove dummy stations.
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 24d2b8c0
...@@ -63,14 +63,14 @@ static ssize_t sta_flags_read(struct file *file, char __user *userbuf, ...@@ -63,14 +63,14 @@ static ssize_t sta_flags_read(struct file *file, char __user *userbuf,
test_sta_flag(sta, WLAN_STA_##flg) ? #flg "\n" : "" test_sta_flag(sta, WLAN_STA_##flg) ? #flg "\n" : ""
int res = scnprintf(buf, sizeof(buf), int res = scnprintf(buf, sizeof(buf),
"%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s", "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
TEST(AUTH), TEST(ASSOC), TEST(PS_STA), TEST(AUTH), TEST(ASSOC), TEST(PS_STA),
TEST(PS_DRIVER), TEST(AUTHORIZED), TEST(PS_DRIVER), TEST(AUTHORIZED),
TEST(SHORT_PREAMBLE), TEST(SHORT_PREAMBLE),
TEST(WME), TEST(WDS), TEST(CLEAR_PS_FILT), TEST(WME), TEST(WDS), TEST(CLEAR_PS_FILT),
TEST(MFP), TEST(BLOCK_BA), TEST(PSPOLL), TEST(MFP), TEST(BLOCK_BA), TEST(PSPOLL),
TEST(UAPSD), TEST(SP), TEST(TDLS_PEER), TEST(UAPSD), TEST(SP), TEST(TDLS_PEER),
TEST(TDLS_PEER_AUTH)); TEST(TDLS_PEER_AUTH), TEST(RATE_CONTROL));
#undef TEST #undef TEST
return simple_read_from_buffer(userbuf, count, ppos, buf, res); return simple_read_from_buffer(userbuf, count, ppos, buf, res);
} }
......
...@@ -336,7 +336,7 @@ void rate_control_get_rate(struct ieee80211_sub_if_data *sdata, ...@@ -336,7 +336,7 @@ void rate_control_get_rate(struct ieee80211_sub_if_data *sdata,
int i; int i;
u32 mask; u32 mask;
if (sta) { if (sta && test_sta_flag(sta, WLAN_STA_RATE_CONTROL)) {
ista = &sta->sta; ista = &sta->sta;
priv_sta = sta->rate_ctrl_priv; priv_sta = sta->rate_ctrl_priv;
} }
......
...@@ -62,6 +62,7 @@ static inline void rate_control_rate_init(struct sta_info *sta) ...@@ -62,6 +62,7 @@ static inline void rate_control_rate_init(struct sta_info *sta)
sband = local->hw.wiphy->bands[local->hw.conf.channel->band]; sband = local->hw.wiphy->bands[local->hw.conf.channel->band];
ref->ops->rate_init(ref->priv, sband, ista, priv_sta); ref->ops->rate_init(ref->priv, sband, ista, priv_sta);
set_sta_flag(sta, WLAN_STA_RATE_CONTROL);
} }
static inline void rate_control_rate_update(struct ieee80211_local *local, static inline void rate_control_rate_update(struct ieee80211_local *local,
......
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
* @WLAN_STA_SP: Station is in a service period, so don't try to * @WLAN_STA_SP: Station is in a service period, so don't try to
* reply to other uAPSD trigger frames or PS-Poll. * reply to other uAPSD trigger frames or PS-Poll.
* @WLAN_STA_4ADDR_EVENT: 4-addr event was already sent for this frame. * @WLAN_STA_4ADDR_EVENT: 4-addr event was already sent for this frame.
* @WLAN_STA_RATE_CONTROL: rate control was initialized for this station.
*/ */
enum ieee80211_sta_info_flags { enum ieee80211_sta_info_flags {
WLAN_STA_AUTH, WLAN_STA_AUTH,
...@@ -71,6 +72,7 @@ enum ieee80211_sta_info_flags { ...@@ -71,6 +72,7 @@ enum ieee80211_sta_info_flags {
WLAN_STA_UAPSD, WLAN_STA_UAPSD,
WLAN_STA_SP, WLAN_STA_SP,
WLAN_STA_4ADDR_EVENT, WLAN_STA_4ADDR_EVENT,
WLAN_STA_RATE_CONTROL,
}; };
enum ieee80211_sta_state { enum ieee80211_sta_state {
......
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