diff options
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r-- | net/mac80211/mlme.c | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index b6c163ac22da..38996a44aa8e 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -1103,8 +1103,11 @@ static void __ieee80211_connection_loss(struct ieee80211_sub_if_data *sdata) | |||
1103 | printk(KERN_DEBUG "Connection to AP %pM lost.\n", bssid); | 1103 | printk(KERN_DEBUG "Connection to AP %pM lost.\n", bssid); |
1104 | 1104 | ||
1105 | ieee80211_set_disassoc(sdata, true); | 1105 | ieee80211_set_disassoc(sdata, true); |
1106 | ieee80211_recalc_idle(local); | ||
1107 | mutex_unlock(&ifmgd->mtx); | 1106 | mutex_unlock(&ifmgd->mtx); |
1107 | |||
1108 | mutex_lock(&local->mtx); | ||
1109 | ieee80211_recalc_idle(local); | ||
1110 | mutex_unlock(&local->mtx); | ||
1108 | /* | 1111 | /* |
1109 | * must be outside lock due to cfg80211, | 1112 | * must be outside lock due to cfg80211, |
1110 | * but that's not a problem. | 1113 | * but that's not a problem. |
@@ -1173,7 +1176,9 @@ ieee80211_rx_mgmt_deauth(struct ieee80211_sub_if_data *sdata, | |||
1173 | sdata->name, bssid, reason_code); | 1176 | sdata->name, bssid, reason_code); |
1174 | 1177 | ||
1175 | ieee80211_set_disassoc(sdata, true); | 1178 | ieee80211_set_disassoc(sdata, true); |
1179 | mutex_lock(&sdata->local->mtx); | ||
1176 | ieee80211_recalc_idle(sdata->local); | 1180 | ieee80211_recalc_idle(sdata->local); |
1181 | mutex_unlock(&sdata->local->mtx); | ||
1177 | 1182 | ||
1178 | return RX_MGMT_CFG80211_DEAUTH; | 1183 | return RX_MGMT_CFG80211_DEAUTH; |
1179 | } | 1184 | } |
@@ -1203,7 +1208,9 @@ ieee80211_rx_mgmt_disassoc(struct ieee80211_sub_if_data *sdata, | |||
1203 | sdata->name, mgmt->sa, reason_code); | 1208 | sdata->name, mgmt->sa, reason_code); |
1204 | 1209 | ||
1205 | ieee80211_set_disassoc(sdata, true); | 1210 | ieee80211_set_disassoc(sdata, true); |
1211 | mutex_lock(&sdata->local->mtx); | ||
1206 | ieee80211_recalc_idle(sdata->local); | 1212 | ieee80211_recalc_idle(sdata->local); |
1213 | mutex_unlock(&sdata->local->mtx); | ||
1207 | return RX_MGMT_CFG80211_DISASSOC; | 1214 | return RX_MGMT_CFG80211_DISASSOC; |
1208 | } | 1215 | } |
1209 | 1216 | ||
@@ -1751,7 +1758,7 @@ void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata, | |||
1751 | struct ieee80211_local *local = sdata->local; | 1758 | struct ieee80211_local *local = sdata->local; |
1752 | struct ieee80211_work *wk; | 1759 | struct ieee80211_work *wk; |
1753 | 1760 | ||
1754 | mutex_lock(&local->work_mtx); | 1761 | mutex_lock(&local->mtx); |
1755 | list_for_each_entry(wk, &local->work_list, list) { | 1762 | list_for_each_entry(wk, &local->work_list, list) { |
1756 | if (wk->sdata != sdata) | 1763 | if (wk->sdata != sdata) |
1757 | continue; | 1764 | continue; |
@@ -1783,7 +1790,7 @@ void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata, | |||
1783 | free_work(wk); | 1790 | free_work(wk); |
1784 | break; | 1791 | break; |
1785 | } | 1792 | } |
1786 | mutex_unlock(&local->work_mtx); | 1793 | mutex_unlock(&local->mtx); |
1787 | 1794 | ||
1788 | cfg80211_send_deauth(sdata->dev, (u8 *)mgmt, skb->len); | 1795 | cfg80211_send_deauth(sdata->dev, (u8 *)mgmt, skb->len); |
1789 | } | 1796 | } |
@@ -1840,8 +1847,10 @@ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata) | |||
1840 | " after %dms, disconnecting.\n", | 1847 | " after %dms, disconnecting.\n", |
1841 | bssid, (1000 * IEEE80211_PROBE_WAIT)/HZ); | 1848 | bssid, (1000 * IEEE80211_PROBE_WAIT)/HZ); |
1842 | ieee80211_set_disassoc(sdata, true); | 1849 | ieee80211_set_disassoc(sdata, true); |
1843 | ieee80211_recalc_idle(local); | ||
1844 | mutex_unlock(&ifmgd->mtx); | 1850 | mutex_unlock(&ifmgd->mtx); |
1851 | mutex_lock(&local->mtx); | ||
1852 | ieee80211_recalc_idle(local); | ||
1853 | mutex_unlock(&local->mtx); | ||
1845 | /* | 1854 | /* |
1846 | * must be outside lock due to cfg80211, | 1855 | * must be outside lock due to cfg80211, |
1847 | * but that's not a problem. | 1856 | * but that's not a problem. |
@@ -1917,6 +1926,8 @@ void ieee80211_sta_quiesce(struct ieee80211_sub_if_data *sdata) | |||
1917 | * time -- the code here is properly synchronised. | 1926 | * time -- the code here is properly synchronised. |
1918 | */ | 1927 | */ |
1919 | 1928 | ||
1929 | cancel_work_sync(&ifmgd->request_smps_work); | ||
1930 | |||
1920 | cancel_work_sync(&ifmgd->beacon_connection_loss_work); | 1931 | cancel_work_sync(&ifmgd->beacon_connection_loss_work); |
1921 | if (del_timer_sync(&ifmgd->timer)) | 1932 | if (del_timer_sync(&ifmgd->timer)) |
1922 | set_bit(TMR_RUNNING_TIMER, &ifmgd->timers_running); | 1933 | set_bit(TMR_RUNNING_TIMER, &ifmgd->timers_running); |
@@ -1952,6 +1963,7 @@ void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata) | |||
1952 | INIT_WORK(&ifmgd->chswitch_work, ieee80211_chswitch_work); | 1963 | INIT_WORK(&ifmgd->chswitch_work, ieee80211_chswitch_work); |
1953 | INIT_WORK(&ifmgd->beacon_connection_loss_work, | 1964 | INIT_WORK(&ifmgd->beacon_connection_loss_work, |
1954 | ieee80211_beacon_connection_loss_work); | 1965 | ieee80211_beacon_connection_loss_work); |
1966 | INIT_WORK(&ifmgd->request_smps_work, ieee80211_request_smps_work); | ||
1955 | setup_timer(&ifmgd->timer, ieee80211_sta_timer, | 1967 | setup_timer(&ifmgd->timer, ieee80211_sta_timer, |
1956 | (unsigned long) sdata); | 1968 | (unsigned long) sdata); |
1957 | setup_timer(&ifmgd->bcn_mon_timer, ieee80211_sta_bcn_mon_timer, | 1969 | setup_timer(&ifmgd->bcn_mon_timer, ieee80211_sta_bcn_mon_timer, |
@@ -2275,7 +2287,7 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata, | |||
2275 | 2287 | ||
2276 | mutex_unlock(&ifmgd->mtx); | 2288 | mutex_unlock(&ifmgd->mtx); |
2277 | 2289 | ||
2278 | mutex_lock(&local->work_mtx); | 2290 | mutex_lock(&local->mtx); |
2279 | list_for_each_entry(wk, &local->work_list, list) { | 2291 | list_for_each_entry(wk, &local->work_list, list) { |
2280 | if (wk->sdata != sdata) | 2292 | if (wk->sdata != sdata) |
2281 | continue; | 2293 | continue; |
@@ -2294,7 +2306,7 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata, | |||
2294 | free_work(wk); | 2306 | free_work(wk); |
2295 | break; | 2307 | break; |
2296 | } | 2308 | } |
2297 | mutex_unlock(&local->work_mtx); | 2309 | mutex_unlock(&local->mtx); |
2298 | 2310 | ||
2299 | /* | 2311 | /* |
2300 | * If somebody requests authentication and we haven't | 2312 | * If somebody requests authentication and we haven't |
@@ -2319,7 +2331,9 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata, | |||
2319 | if (assoc_bss) | 2331 | if (assoc_bss) |
2320 | sta_info_destroy_addr(sdata, bssid); | 2332 | sta_info_destroy_addr(sdata, bssid); |
2321 | 2333 | ||
2334 | mutex_lock(&sdata->local->mtx); | ||
2322 | ieee80211_recalc_idle(sdata->local); | 2335 | ieee80211_recalc_idle(sdata->local); |
2336 | mutex_unlock(&sdata->local->mtx); | ||
2323 | 2337 | ||
2324 | return 0; | 2338 | return 0; |
2325 | } | 2339 | } |
@@ -2357,7 +2371,9 @@ int ieee80211_mgd_disassoc(struct ieee80211_sub_if_data *sdata, | |||
2357 | cookie, !req->local_state_change); | 2371 | cookie, !req->local_state_change); |
2358 | sta_info_destroy_addr(sdata, bssid); | 2372 | sta_info_destroy_addr(sdata, bssid); |
2359 | 2373 | ||
2374 | mutex_lock(&sdata->local->mtx); | ||
2360 | ieee80211_recalc_idle(sdata->local); | 2375 | ieee80211_recalc_idle(sdata->local); |
2376 | mutex_unlock(&sdata->local->mtx); | ||
2361 | 2377 | ||
2362 | return 0; | 2378 | return 0; |
2363 | } | 2379 | } |