sta_info.c (86f22e7cce02d17da740d8d9a79a661bcff9eece) | sta_info.c (1a327862eb13c5f492268f8eb3d1dfb16544fe14) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * Copyright 2002-2005, Instant802 Networks, Inc. 4 * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz> 5 * Copyright 2013-2014 Intel Mobile Communications GmbH 6 * Copyright (C) 2015 - 2017 Intel Deutschland GmbH 7 * Copyright (C) 2018-2023 Intel Corporation 8 */ --- 1270 unchanged lines hidden (view full) --- 1279 1280 return 0; 1281} 1282 1283static int _sta_info_move_state(struct sta_info *sta, 1284 enum ieee80211_sta_state new_state, 1285 bool recalc) 1286{ | 1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * Copyright 2002-2005, Instant802 Networks, Inc. 4 * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz> 5 * Copyright 2013-2014 Intel Mobile Communications GmbH 6 * Copyright (C) 2015 - 2017 Intel Deutschland GmbH 7 * Copyright (C) 2018-2023 Intel Corporation 8 */ --- 1270 unchanged lines hidden (view full) --- 1279 1280 return 0; 1281} 1282 1283static int _sta_info_move_state(struct sta_info *sta, 1284 enum ieee80211_sta_state new_state, 1285 bool recalc) 1286{ |
1287 struct ieee80211_local *local = sta->local; 1288 |
|
1287 might_sleep(); 1288 1289 if (sta->sta_state == new_state) 1290 return 0; 1291 1292 /* check allowed transitions first */ 1293 1294 switch (new_state) { --- 59 unchanged lines hidden (view full) --- 1354 if (recalc) { 1355 ieee80211_recalc_min_chandef(sta->sdata, -1); 1356 if (!sta->sta.support_p2p_ps) 1357 ieee80211_recalc_p2p_go_ps_allowed(sta->sdata); 1358 } 1359 } else if (sta->sta_state == IEEE80211_STA_AUTHORIZED) { 1360 ieee80211_vif_dec_num_mcast(sta->sdata); 1361 clear_bit(WLAN_STA_AUTHORIZED, &sta->_flags); | 1289 might_sleep(); 1290 1291 if (sta->sta_state == new_state) 1292 return 0; 1293 1294 /* check allowed transitions first */ 1295 1296 switch (new_state) { --- 59 unchanged lines hidden (view full) --- 1356 if (recalc) { 1357 ieee80211_recalc_min_chandef(sta->sdata, -1); 1358 if (!sta->sta.support_p2p_ps) 1359 ieee80211_recalc_p2p_go_ps_allowed(sta->sdata); 1360 } 1361 } else if (sta->sta_state == IEEE80211_STA_AUTHORIZED) { 1362 ieee80211_vif_dec_num_mcast(sta->sdata); 1363 clear_bit(WLAN_STA_AUTHORIZED, &sta->_flags); |
1364 1365 /* 1366 * If we have encryption offload, flush (station) queues 1367 * (after ensuring concurrent TX completed) so we won't 1368 * transmit anything later unencrypted if/when keys are 1369 * also removed, which might otherwise happen depending 1370 * on how the hardware offload works. 1371 */ 1372 if (local->ops->set_key) { 1373 synchronize_net(); 1374 if (local->ops->flush_sta) 1375 drv_flush_sta(local, sta->sdata, sta); 1376 else 1377 ieee80211_flush_queues(local, 1378 sta->sdata, 1379 false); 1380 } 1381 |
|
1362 ieee80211_clear_fast_xmit(sta); 1363 ieee80211_clear_fast_rx(sta); 1364 } 1365 break; 1366 case IEEE80211_STA_AUTHORIZED: 1367 if (sta->sta_state == IEEE80211_STA_ASSOC) { 1368 ieee80211_vif_inc_num_mcast(sta->sdata); 1369 set_bit(WLAN_STA_AUTHORIZED, &sta->_flags); --- 49 unchanged lines hidden (view full) --- 1419 might_sleep(); 1420 lockdep_assert_held(&local->sta_mtx); 1421 1422 if (sta->sta_state == IEEE80211_STA_AUTHORIZED) { 1423 ret = _sta_info_move_state(sta, IEEE80211_STA_ASSOC, recalc); 1424 WARN_ON_ONCE(ret); 1425 } 1426 | 1382 ieee80211_clear_fast_xmit(sta); 1383 ieee80211_clear_fast_rx(sta); 1384 } 1385 break; 1386 case IEEE80211_STA_AUTHORIZED: 1387 if (sta->sta_state == IEEE80211_STA_ASSOC) { 1388 ieee80211_vif_inc_num_mcast(sta->sdata); 1389 set_bit(WLAN_STA_AUTHORIZED, &sta->_flags); --- 49 unchanged lines hidden (view full) --- 1439 might_sleep(); 1440 lockdep_assert_held(&local->sta_mtx); 1441 1442 if (sta->sta_state == IEEE80211_STA_AUTHORIZED) { 1443 ret = _sta_info_move_state(sta, IEEE80211_STA_ASSOC, recalc); 1444 WARN_ON_ONCE(ret); 1445 } 1446 |
1427 /* Flush queues before removing keys, as that might remove them 1428 * from hardware, and then depending on the offload method, any 1429 * frames sitting on hardware queues might be sent out without 1430 * any encryption at all. 1431 */ 1432 if (local->ops->set_key) { 1433 if (local->ops->flush_sta) 1434 drv_flush_sta(local, sta->sdata, sta); 1435 else 1436 ieee80211_flush_queues(local, sta->sdata, false); 1437 } 1438 | |
1439 /* now keys can no longer be reached */ 1440 ieee80211_free_sta_keys(local, sta); 1441 1442 /* disable TIM bit - last chance to tell driver */ 1443 __sta_info_recalc_tim(sta, true); 1444 1445 sta->dead = true; 1446 --- 1577 unchanged lines hidden --- | 1447 /* now keys can no longer be reached */ 1448 ieee80211_free_sta_keys(local, sta); 1449 1450 /* disable TIM bit - last chance to tell driver */ 1451 __sta_info_recalc_tim(sta, true); 1452 1453 sta->dead = true; 1454 --- 1577 unchanged lines hidden --- |