diff options
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r-- | net/mac80211/mlme.c | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 41812a15eea0..be5f723d643a 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -177,7 +177,8 @@ static u32 ieee80211_enable_ht(struct ieee80211_sub_if_data *sdata, | |||
177 | sta = sta_info_get(sdata, bssid); | 177 | sta = sta_info_get(sdata, bssid); |
178 | if (sta) | 178 | if (sta) |
179 | rate_control_rate_update(local, sband, sta, | 179 | rate_control_rate_update(local, sband, sta, |
180 | IEEE80211_RC_HT_CHANGED); | 180 | IEEE80211_RC_HT_CHANGED, |
181 | local->oper_channel_type); | ||
181 | rcu_read_unlock(); | 182 | rcu_read_unlock(); |
182 | } | 183 | } |
183 | 184 | ||
@@ -435,10 +436,12 @@ static void ieee80211_enable_ps(struct ieee80211_local *local, | |||
435 | if (local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK) | 436 | if (local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK) |
436 | ieee80211_send_nullfunc(local, sdata, 1); | 437 | ieee80211_send_nullfunc(local, sdata, 1); |
437 | 438 | ||
438 | if (!(local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS)) { | 439 | if ((local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK) && |
439 | conf->flags |= IEEE80211_CONF_PS; | 440 | (local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS)) |
440 | ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS); | 441 | return; |
441 | } | 442 | |
443 | conf->flags |= IEEE80211_CONF_PS; | ||
444 | ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS); | ||
442 | } | 445 | } |
443 | } | 446 | } |
444 | 447 | ||
@@ -557,7 +560,8 @@ void ieee80211_dynamic_ps_enable_work(struct work_struct *work) | |||
557 | (!(ifmgd->flags & IEEE80211_STA_NULLFUNC_ACKED))) | 560 | (!(ifmgd->flags & IEEE80211_STA_NULLFUNC_ACKED))) |
558 | ieee80211_send_nullfunc(local, sdata, 1); | 561 | ieee80211_send_nullfunc(local, sdata, 1); |
559 | 562 | ||
560 | if (!(local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS) || | 563 | if (!((local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS) && |
564 | (local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK)) || | ||
561 | (ifmgd->flags & IEEE80211_STA_NULLFUNC_ACKED)) { | 565 | (ifmgd->flags & IEEE80211_STA_NULLFUNC_ACKED)) { |
562 | ifmgd->flags &= ~IEEE80211_STA_NULLFUNC_ACKED; | 566 | ifmgd->flags &= ~IEEE80211_STA_NULLFUNC_ACKED; |
563 | local->hw.conf.flags |= IEEE80211_CONF_PS; | 567 | local->hw.conf.flags |= IEEE80211_CONF_PS; |
@@ -1893,8 +1897,20 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata, | |||
1893 | 1897 | ||
1894 | mutex_lock(&ifmgd->mtx); | 1898 | mutex_lock(&ifmgd->mtx); |
1895 | if (ifmgd->associated) { | 1899 | if (ifmgd->associated) { |
1896 | mutex_unlock(&ifmgd->mtx); | 1900 | if (!req->prev_bssid || |
1897 | return -EALREADY; | 1901 | memcmp(req->prev_bssid, ifmgd->associated->bssid, |
1902 | ETH_ALEN)) { | ||
1903 | /* | ||
1904 | * We are already associated and the request was not a | ||
1905 | * reassociation request from the current BSS, so | ||
1906 | * reject it. | ||
1907 | */ | ||
1908 | mutex_unlock(&ifmgd->mtx); | ||
1909 | return -EALREADY; | ||
1910 | } | ||
1911 | |||
1912 | /* Trying to reassociate - clear previous association state */ | ||
1913 | ieee80211_set_disassoc(sdata); | ||
1898 | } | 1914 | } |
1899 | mutex_unlock(&ifmgd->mtx); | 1915 | mutex_unlock(&ifmgd->mtx); |
1900 | 1916 | ||