• Home
  • Raw
  • Download

Lines Matching refs:sdata

62 update_vlan_tailroom_need_count(struct ieee80211_sub_if_data *sdata, int delta)  in update_vlan_tailroom_need_count()  argument
66 if (sdata->vif.type != NL80211_IFTYPE_AP) in update_vlan_tailroom_need_count()
70 assert_key_lock(sdata->local); in update_vlan_tailroom_need_count()
74 list_for_each_entry_rcu(vlan, &sdata->u.ap.vlans, u.vlan.list) in update_vlan_tailroom_need_count()
80 static void increment_tailroom_need_count(struct ieee80211_sub_if_data *sdata) in increment_tailroom_need_count() argument
101 assert_key_lock(sdata->local); in increment_tailroom_need_count()
103 update_vlan_tailroom_need_count(sdata, 1); in increment_tailroom_need_count()
105 if (!sdata->crypto_tx_tailroom_needed_cnt++) { in increment_tailroom_need_count()
114 static void decrease_tailroom_need_count(struct ieee80211_sub_if_data *sdata, in decrease_tailroom_need_count() argument
117 assert_key_lock(sdata->local); in decrease_tailroom_need_count()
119 WARN_ON_ONCE(sdata->crypto_tx_tailroom_needed_cnt < delta); in decrease_tailroom_need_count()
121 update_vlan_tailroom_need_count(sdata, -delta); in decrease_tailroom_need_count()
122 sdata->crypto_tx_tailroom_needed_cnt -= delta; in decrease_tailroom_need_count()
127 struct ieee80211_sub_if_data *sdata = key->sdata; in ieee80211_key_enable_hw_accel() local
145 increment_tailroom_need_count(sdata); in ieee80211_key_enable_hw_accel()
169 if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) { in ieee80211_key_enable_hw_accel()
180 ret = drv_set_key(key->local, SET_KEY, sdata, in ieee80211_key_enable_hw_accel()
189 decrease_tailroom_need_count(sdata, 1); in ieee80211_key_enable_hw_accel()
201 sdata_err(sdata, in ieee80211_key_enable_hw_accel()
232 struct ieee80211_sub_if_data *sdata; in ieee80211_key_disable_hw_accel() local
247 sdata = key->sdata; in ieee80211_key_disable_hw_accel()
252 increment_tailroom_need_count(sdata); in ieee80211_key_disable_hw_accel()
255 ret = drv_set_key(key->local, DISABLE_KEY, sdata, in ieee80211_key_disable_hw_accel()
259 sdata_err(sdata, in ieee80211_key_disable_hw_accel()
342 ieee80211_flush_queues(local, old->sdata, false); in ieee80211_pairwise_rekey()
347 static void __ieee80211_set_default_key(struct ieee80211_sub_if_data *sdata, in __ieee80211_set_default_key() argument
352 assert_key_lock(sdata->local); in __ieee80211_set_default_key()
355 key = key_mtx_dereference(sdata->local, sdata->keys[idx]); in __ieee80211_set_default_key()
358 rcu_assign_pointer(sdata->default_unicast_key, key); in __ieee80211_set_default_key()
359 ieee80211_check_fast_xmit_iface(sdata); in __ieee80211_set_default_key()
360 if (sdata->vif.type != NL80211_IFTYPE_AP_VLAN) in __ieee80211_set_default_key()
361 drv_set_default_unicast_key(sdata->local, sdata, idx); in __ieee80211_set_default_key()
365 rcu_assign_pointer(sdata->default_multicast_key, key); in __ieee80211_set_default_key()
367 ieee80211_debugfs_key_update_default(sdata); in __ieee80211_set_default_key()
370 void ieee80211_set_default_key(struct ieee80211_sub_if_data *sdata, int idx, in ieee80211_set_default_key() argument
373 mutex_lock(&sdata->local->key_mtx); in ieee80211_set_default_key()
374 __ieee80211_set_default_key(sdata, idx, uni, multi); in ieee80211_set_default_key()
375 mutex_unlock(&sdata->local->key_mtx); in ieee80211_set_default_key()
379 __ieee80211_set_default_mgmt_key(struct ieee80211_sub_if_data *sdata, int idx) in __ieee80211_set_default_mgmt_key() argument
383 assert_key_lock(sdata->local); in __ieee80211_set_default_mgmt_key()
387 key = key_mtx_dereference(sdata->local, sdata->keys[idx]); in __ieee80211_set_default_mgmt_key()
389 rcu_assign_pointer(sdata->default_mgmt_key, key); in __ieee80211_set_default_mgmt_key()
391 ieee80211_debugfs_key_update_default(sdata); in __ieee80211_set_default_mgmt_key()
394 void ieee80211_set_default_mgmt_key(struct ieee80211_sub_if_data *sdata, in ieee80211_set_default_mgmt_key() argument
397 mutex_lock(&sdata->local->key_mtx); in ieee80211_set_default_mgmt_key()
398 __ieee80211_set_default_mgmt_key(sdata, idx); in ieee80211_set_default_mgmt_key()
399 mutex_unlock(&sdata->local->key_mtx); in ieee80211_set_default_mgmt_key()
403 __ieee80211_set_default_beacon_key(struct ieee80211_sub_if_data *sdata, int idx) in __ieee80211_set_default_beacon_key() argument
407 assert_key_lock(sdata->local); in __ieee80211_set_default_beacon_key()
412 key = key_mtx_dereference(sdata->local, sdata->keys[idx]); in __ieee80211_set_default_beacon_key()
414 rcu_assign_pointer(sdata->default_beacon_key, key); in __ieee80211_set_default_beacon_key()
416 ieee80211_debugfs_key_update_default(sdata); in __ieee80211_set_default_beacon_key()
419 void ieee80211_set_default_beacon_key(struct ieee80211_sub_if_data *sdata, in ieee80211_set_default_beacon_key() argument
422 mutex_lock(&sdata->local->key_mtx); in ieee80211_set_default_beacon_key()
423 __ieee80211_set_default_beacon_key(sdata, idx); in ieee80211_set_default_beacon_key()
424 mutex_unlock(&sdata->local->key_mtx); in ieee80211_set_default_beacon_key()
427 static int ieee80211_key_replace(struct ieee80211_sub_if_data *sdata, in ieee80211_key_replace() argument
442 list_add_tail_rcu(&new->list, &sdata->key_list); in ieee80211_key_replace()
489 old == key_mtx_dereference(sdata->local, in ieee80211_key_replace()
490 sdata->default_unicast_key); in ieee80211_key_replace()
492 old == key_mtx_dereference(sdata->local, in ieee80211_key_replace()
493 sdata->default_multicast_key); in ieee80211_key_replace()
495 old == key_mtx_dereference(sdata->local, in ieee80211_key_replace()
496 sdata->default_mgmt_key); in ieee80211_key_replace()
498 old == key_mtx_dereference(sdata->local, in ieee80211_key_replace()
499 sdata->default_beacon_key); in ieee80211_key_replace()
502 __ieee80211_set_default_key(sdata, -1, true, false); in ieee80211_key_replace()
504 __ieee80211_set_default_key(sdata, -1, false, true); in ieee80211_key_replace()
506 __ieee80211_set_default_mgmt_key(sdata, -1); in ieee80211_key_replace()
508 __ieee80211_set_default_beacon_key(sdata, -1); in ieee80211_key_replace()
510 rcu_assign_pointer(sdata->keys[idx], new); in ieee80211_key_replace()
512 __ieee80211_set_default_key(sdata, new->conf.keyidx, in ieee80211_key_replace()
515 __ieee80211_set_default_key(sdata, new->conf.keyidx, in ieee80211_key_replace()
518 __ieee80211_set_default_mgmt_key(sdata, in ieee80211_key_replace()
521 __ieee80211_set_default_beacon_key(sdata, in ieee80211_key_replace()
727 struct ieee80211_sub_if_data *sdata = key->sdata; in __ieee80211_key_destroy() local
733 sdata->crypto_tx_tailroom_pending_dec++; in __ieee80211_key_destroy()
734 schedule_delayed_work(&sdata->dec_tailroom_needed_wk, in __ieee80211_key_destroy()
737 decrease_tailroom_need_count(sdata, 1); in __ieee80211_key_destroy()
761 WARN_ON(key->sdata || key->local); in ieee80211_key_free_unused()
765 static bool ieee80211_key_identical(struct ieee80211_sub_if_data *sdata, in ieee80211_key_identical() argument
783 if (sdata->vif.type == NL80211_IFTYPE_STATION && in ieee80211_key_identical()
799 struct ieee80211_sub_if_data *sdata, in ieee80211_key_link() argument
811 bool delay_tailroom = sdata->vif.type == NL80211_IFTYPE_STATION; in ieee80211_key_link()
814 mutex_lock(&sdata->local->key_mtx); in ieee80211_key_link()
819 old_key = key_mtx_dereference(sdata->local, sta->ptk[idx]); in ieee80211_key_link()
820 alt_key = key_mtx_dereference(sdata->local, sta->ptk[idx ^ 1]); in ieee80211_key_link()
829 old_key = key_mtx_dereference(sdata->local, sta->gtk[idx]); in ieee80211_key_link()
831 old_key = key_mtx_dereference(sdata->local, sdata->keys[idx]); in ieee80211_key_link()
844 if (ieee80211_key_identical(sdata, old_key, key)) { in ieee80211_key_link()
850 key->local = sdata->local; in ieee80211_key_link()
851 key->sdata = sdata; in ieee80211_key_link()
860 increment_tailroom_need_count(sdata); in ieee80211_key_link()
862 ret = ieee80211_key_replace(sdata, sta, pairwise, old_key, key); in ieee80211_key_link()
872 mutex_unlock(&sdata->local->key_mtx); in ieee80211_key_link()
885 if (key->sdata) in ieee80211_key_free()
886 ieee80211_key_replace(key->sdata, key->sta, in ieee80211_key_free()
892 void ieee80211_reenable_keys(struct ieee80211_sub_if_data *sdata) in ieee80211_reenable_keys() argument
899 mutex_lock(&sdata->local->key_mtx); in ieee80211_reenable_keys()
901 sdata->crypto_tx_tailroom_needed_cnt = 0; in ieee80211_reenable_keys()
902 sdata->crypto_tx_tailroom_pending_dec = 0; in ieee80211_reenable_keys()
904 if (sdata->vif.type == NL80211_IFTYPE_AP) { in ieee80211_reenable_keys()
905 list_for_each_entry(vlan, &sdata->u.ap.vlans, u.vlan.list) { in ieee80211_reenable_keys()
911 if (ieee80211_sdata_running(sdata)) { in ieee80211_reenable_keys()
912 list_for_each_entry(key, &sdata->key_list, list) { in ieee80211_reenable_keys()
913 increment_tailroom_need_count(sdata); in ieee80211_reenable_keys()
918 mutex_unlock(&sdata->local->key_mtx); in ieee80211_reenable_keys()
932 struct ieee80211_sub_if_data *sdata; in ieee80211_iter_keys() local
938 sdata = vif_to_sdata(vif); in ieee80211_iter_keys()
939 list_for_each_entry_safe(key, tmp, &sdata->key_list, list) in ieee80211_iter_keys()
940 iter(hw, &sdata->vif, in ieee80211_iter_keys()
944 list_for_each_entry(sdata, &local->interfaces, list) in ieee80211_iter_keys()
946 &sdata->key_list, list) in ieee80211_iter_keys()
947 iter(hw, &sdata->vif, in ieee80211_iter_keys()
957 struct ieee80211_sub_if_data *sdata, in _ieee80211_iter_keys_rcu() argument
967 list_for_each_entry_rcu(key, &sdata->key_list, list) { in _ieee80211_iter_keys_rcu()
974 iter(hw, &sdata->vif, in _ieee80211_iter_keys_rcu()
990 struct ieee80211_sub_if_data *sdata; in ieee80211_iter_keys_rcu() local
993 sdata = vif_to_sdata(vif); in ieee80211_iter_keys_rcu()
994 _ieee80211_iter_keys_rcu(hw, sdata, iter, iter_data); in ieee80211_iter_keys_rcu()
996 list_for_each_entry_rcu(sdata, &local->interfaces, list) in ieee80211_iter_keys_rcu()
997 _ieee80211_iter_keys_rcu(hw, sdata, iter, iter_data); in ieee80211_iter_keys_rcu()
1002 static void ieee80211_free_keys_iface(struct ieee80211_sub_if_data *sdata, in ieee80211_free_keys_iface() argument
1007 decrease_tailroom_need_count(sdata, in ieee80211_free_keys_iface()
1008 sdata->crypto_tx_tailroom_pending_dec); in ieee80211_free_keys_iface()
1009 sdata->crypto_tx_tailroom_pending_dec = 0; in ieee80211_free_keys_iface()
1011 ieee80211_debugfs_key_remove_mgmt_default(sdata); in ieee80211_free_keys_iface()
1012 ieee80211_debugfs_key_remove_beacon_default(sdata); in ieee80211_free_keys_iface()
1014 list_for_each_entry_safe(key, tmp, &sdata->key_list, list) { in ieee80211_free_keys_iface()
1015 ieee80211_key_replace(key->sdata, key->sta, in ieee80211_free_keys_iface()
1021 ieee80211_debugfs_key_update_default(sdata); in ieee80211_free_keys_iface()
1024 void ieee80211_free_keys(struct ieee80211_sub_if_data *sdata, in ieee80211_free_keys() argument
1027 struct ieee80211_local *local = sdata->local; in ieee80211_free_keys()
1033 cancel_delayed_work_sync(&sdata->dec_tailroom_needed_wk); in ieee80211_free_keys()
1037 ieee80211_free_keys_iface(sdata, &keys); in ieee80211_free_keys()
1039 if (sdata->vif.type == NL80211_IFTYPE_AP) { in ieee80211_free_keys()
1040 list_for_each_entry(vlan, &sdata->u.ap.vlans, u.vlan.list) in ieee80211_free_keys()
1049 if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) { in ieee80211_free_keys()
1050 if (sdata->bss) { in ieee80211_free_keys()
1051 master = container_of(sdata->bss, in ieee80211_free_keys()
1055 WARN_ON_ONCE(sdata->crypto_tx_tailroom_needed_cnt != in ieee80211_free_keys()
1059 WARN_ON_ONCE(sdata->crypto_tx_tailroom_needed_cnt || in ieee80211_free_keys()
1060 sdata->crypto_tx_tailroom_pending_dec); in ieee80211_free_keys()
1063 if (sdata->vif.type == NL80211_IFTYPE_AP) { in ieee80211_free_keys()
1064 list_for_each_entry(vlan, &sdata->u.ap.vlans, u.vlan.list) in ieee80211_free_keys()
1083 ieee80211_key_replace(key->sdata, key->sta, in ieee80211_free_sta_keys()
1086 __ieee80211_key_destroy(key, key->sdata->vif.type == in ieee80211_free_sta_keys()
1094 ieee80211_key_replace(key->sdata, key->sta, in ieee80211_free_sta_keys()
1097 __ieee80211_key_destroy(key, key->sdata->vif.type == in ieee80211_free_sta_keys()
1106 struct ieee80211_sub_if_data *sdata; in ieee80211_delayed_tailroom_dec() local
1108 sdata = container_of(wk, struct ieee80211_sub_if_data, in ieee80211_delayed_tailroom_dec()
1127 mutex_lock(&sdata->local->key_mtx); in ieee80211_delayed_tailroom_dec()
1128 decrease_tailroom_need_count(sdata, in ieee80211_delayed_tailroom_dec()
1129 sdata->crypto_tx_tailroom_pending_dec); in ieee80211_delayed_tailroom_dec()
1130 sdata->crypto_tx_tailroom_pending_dec = 0; in ieee80211_delayed_tailroom_dec()
1131 mutex_unlock(&sdata->local->key_mtx); in ieee80211_delayed_tailroom_dec()
1137 struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif); in ieee80211_gtk_rekey_notify() local
1139 trace_api_gtk_rekey_notify(sdata, bssid, replay_ctr); in ieee80211_gtk_rekey_notify()
1141 cfg80211_gtk_rekey_notify(sdata->dev, bssid, replay_ctr, gfp); in ieee80211_gtk_rekey_notify()
1272 increment_tailroom_need_count(key->sdata); in ieee80211_remove_key()
1283 struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif); in ieee80211_gtk_rekey_add() local
1284 struct ieee80211_local *local = sdata->local; in ieee80211_gtk_rekey_add()
1300 if (sdata->u.mgd.mfp != IEEE80211_MFP_DISABLED) in ieee80211_gtk_rekey_add()
1303 err = ieee80211_key_link(key, sdata, NULL); in ieee80211_gtk_rekey_add()