Lines Matching defs:sdata

62 update_vlan_tailroom_need_count(struct ieee80211_sub_if_data *sdata, int delta)
66 if (sdata->vif.type != NL80211_IFTYPE_AP)
70 assert_key_lock(sdata->local);
74 list_for_each_entry_rcu(vlan, &sdata->u.ap.vlans, u.vlan.list)
80 static void increment_tailroom_need_count(struct ieee80211_sub_if_data *sdata)
101 assert_key_lock(sdata->local);
103 update_vlan_tailroom_need_count(sdata, 1);
105 if (!sdata->crypto_tx_tailroom_needed_cnt++) {
114 static void decrease_tailroom_need_count(struct ieee80211_sub_if_data *sdata,
117 assert_key_lock(sdata->local);
119 WARN_ON_ONCE(sdata->crypto_tx_tailroom_needed_cnt < delta);
121 update_vlan_tailroom_need_count(sdata, -delta);
122 sdata->crypto_tx_tailroom_needed_cnt -= delta;
127 struct ieee80211_sub_if_data *sdata = key->sdata;
145 increment_tailroom_need_count(sdata);
169 if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) {
180 if (key->conf.link_id >= 0 && sdata->vif.active_links &&
181 !(sdata->vif.active_links & BIT(key->conf.link_id)))
184 ret = drv_set_key(key->local, SET_KEY, sdata,
193 decrease_tailroom_need_count(sdata, 1);
205 sdata_err(sdata,
236 struct ieee80211_sub_if_data *sdata;
251 sdata = key->sdata;
253 if (key->conf.link_id >= 0 && sdata->vif.active_links &&
254 !(sdata->vif.active_links & BIT(key->conf.link_id)))
260 increment_tailroom_need_count(sdata);
263 ret = drv_set_key(key->local, DISABLE_KEY, sdata,
267 sdata_err(sdata,
350 ieee80211_flush_queues(local, old->sdata, false);
358 struct ieee80211_sub_if_data *sdata = link->sdata;
361 assert_key_lock(sdata->local);
364 key = key_mtx_dereference(sdata->local, sdata->keys[idx]);
366 key = key_mtx_dereference(sdata->local, link->gtk[idx]);
370 rcu_assign_pointer(sdata->default_unicast_key, key);
371 ieee80211_check_fast_xmit_iface(sdata);
372 if (sdata->vif.type != NL80211_IFTYPE_AP_VLAN)
373 drv_set_default_unicast_key(sdata->local, sdata, idx);
379 ieee80211_debugfs_key_update_default(sdata);
385 mutex_lock(&link->sdata->local->key_mtx);
387 mutex_unlock(&link->sdata->local->key_mtx);
393 struct ieee80211_sub_if_data *sdata = link->sdata;
396 assert_key_lock(sdata->local);
400 key = key_mtx_dereference(sdata->local, link->gtk[idx]);
404 ieee80211_debugfs_key_update_default(sdata);
410 mutex_lock(&link->sdata->local->key_mtx);
412 mutex_unlock(&link->sdata->local->key_mtx);
418 struct ieee80211_sub_if_data *sdata = link->sdata;
421 assert_key_lock(sdata->local);
426 key = key_mtx_dereference(sdata->local, link->gtk[idx]);
430 ieee80211_debugfs_key_update_default(sdata);
436 mutex_lock(&link->sdata->local->key_mtx);
438 mutex_unlock(&link->sdata->local->key_mtx);
441 static int ieee80211_key_replace(struct ieee80211_sub_if_data *sdata,
478 link = sdata_dereference(sdata->link[link_id], sdata);
490 link = &sdata->deflink;
525 list_add_tail_rcu(&new->list, &sdata->key_list);
544 old == key_mtx_dereference(sdata->local,
545 sdata->default_unicast_key);
547 old == key_mtx_dereference(sdata->local,
550 old == key_mtx_dereference(sdata->local,
553 old == key_mtx_dereference(sdata->local,
566 rcu_assign_pointer(sdata->keys[idx], new);
771 struct ieee80211_sub_if_data *sdata = key->sdata;
777 sdata->crypto_tx_tailroom_pending_dec++;
778 schedule_delayed_work(&sdata->dec_tailroom_needed_wk,
781 decrease_tailroom_need_count(sdata, 1);
808 WARN_ON(key->sdata || key->local);
812 static bool ieee80211_key_identical(struct ieee80211_sub_if_data *sdata,
830 if (sdata->vif.type == NL80211_IFTYPE_STATION &&
849 struct ieee80211_sub_if_data *sdata = link->sdata;
859 bool delay_tailroom = sdata->vif.type == NL80211_IFTYPE_STATION;
862 mutex_lock(&sdata->local->key_mtx);
867 old_key = key_mtx_dereference(sdata->local, sta->ptk[idx]);
868 alt_key = key_mtx_dereference(sdata->local, sta->ptk[idx ^ 1]);
891 old_key = key_mtx_dereference(sdata->local, link_sta->gtk[idx]);
894 old_key = key_mtx_dereference(sdata->local,
895 sdata->keys[idx]);
897 old_key = key_mtx_dereference(sdata->local,
913 if (ieee80211_key_identical(sdata, old_key, key)) {
918 key->local = sdata->local;
919 key->sdata = sdata;
928 increment_tailroom_need_count(sdata);
930 ret = ieee80211_key_replace(sdata, link, sta, pairwise, old_key, key);
943 mutex_unlock(&sdata->local->key_mtx);
956 if (key->sdata)
957 ieee80211_key_replace(key->sdata, NULL, key->sta,
963 void ieee80211_reenable_keys(struct ieee80211_sub_if_data *sdata)
968 lockdep_assert_wiphy(sdata->local->hw.wiphy);
970 mutex_lock(&sdata->local->key_mtx);
972 sdata->crypto_tx_tailroom_needed_cnt = 0;
973 sdata->crypto_tx_tailroom_pending_dec = 0;
975 if (sdata->vif.type == NL80211_IFTYPE_AP) {
976 list_for_each_entry(vlan, &sdata->u.ap.vlans, u.vlan.list) {
982 if (ieee80211_sdata_running(sdata)) {
983 list_for_each_entry(key, &sdata->key_list, list) {
984 increment_tailroom_need_count(sdata);
989 mutex_unlock(&sdata->local->key_mtx);
1003 struct ieee80211_sub_if_data *sdata;
1009 sdata = vif_to_sdata(vif);
1010 list_for_each_entry_safe(key, tmp, &sdata->key_list, list)
1011 iter(hw, &sdata->vif,
1015 list_for_each_entry(sdata, &local->interfaces, list)
1017 &sdata->key_list, list)
1018 iter(hw, &sdata->vif,
1028 struct ieee80211_sub_if_data *sdata,
1038 list_for_each_entry_rcu(key, &sdata->key_list, list) {
1045 iter(hw, &sdata->vif,
1061 struct ieee80211_sub_if_data *sdata;
1064 sdata = vif_to_sdata(vif);
1065 _ieee80211_iter_keys_rcu(hw, sdata, iter, iter_data);
1067 list_for_each_entry_rcu(sdata, &local->interfaces, list)
1068 _ieee80211_iter_keys_rcu(hw, sdata, iter, iter_data);
1073 static void ieee80211_free_keys_iface(struct ieee80211_sub_if_data *sdata,
1078 decrease_tailroom_need_count(sdata,
1079 sdata->crypto_tx_tailroom_pending_dec);
1080 sdata->crypto_tx_tailroom_pending_dec = 0;
1082 ieee80211_debugfs_key_remove_mgmt_default(sdata);
1083 ieee80211_debugfs_key_remove_beacon_default(sdata);
1085 list_for_each_entry_safe(key, tmp, &sdata->key_list, list) {
1086 ieee80211_key_replace(key->sdata, NULL, key->sta,
1092 ieee80211_debugfs_key_update_default(sdata);
1098 struct ieee80211_sub_if_data *sdata = link->sdata;
1099 struct ieee80211_local *local = sdata->local;
1103 list_for_each_entry_safe(key, tmp, &sdata->key_list, list) {
1106 ieee80211_key_replace(key->sdata, link, key->sta,
1125 void ieee80211_free_keys(struct ieee80211_sub_if_data *sdata,
1128 struct ieee80211_local *local = sdata->local;
1134 cancel_delayed_work_sync(&sdata->dec_tailroom_needed_wk);
1138 ieee80211_free_keys_iface(sdata, &keys);
1140 if (sdata->vif.type == NL80211_IFTYPE_AP) {
1141 list_for_each_entry(vlan, &sdata->u.ap.vlans, u.vlan.list)
1150 if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) {
1151 if (sdata->bss) {
1152 master = container_of(sdata->bss,
1156 WARN_ON_ONCE(sdata->crypto_tx_tailroom_needed_cnt !=
1160 WARN_ON_ONCE(sdata->crypto_tx_tailroom_needed_cnt ||
1161 sdata->crypto_tx_tailroom_pending_dec);
1164 if (sdata->vif.type == NL80211_IFTYPE_AP) {
1165 list_for_each_entry(vlan, &sdata->u.ap.vlans, u.vlan.list)
1184 ieee80211_key_replace(key->sdata, NULL, key->sta,
1187 __ieee80211_key_destroy(key, key->sdata->vif.type ==
1195 ieee80211_key_replace(key->sdata, NULL, key->sta,
1198 __ieee80211_key_destroy(key, key->sdata->vif.type ==
1207 struct ieee80211_sub_if_data *sdata;
1209 sdata = container_of(wk, struct ieee80211_sub_if_data,
1228 mutex_lock(&sdata->local->key_mtx);
1229 decrease_tailroom_need_count(sdata,
1230 sdata->crypto_tx_tailroom_pending_dec);
1231 sdata->crypto_tx_tailroom_pending_dec = 0;
1232 mutex_unlock(&sdata->local->key_mtx);
1238 struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
1240 trace_api_gtk_rekey_notify(sdata, bssid, replay_ctr);
1242 cfg80211_gtk_rekey_notify(sdata->dev, bssid, replay_ctr, gfp);
1373 increment_tailroom_need_count(key->sdata);
1384 struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
1385 struct ieee80211_local *local = sdata->local;
1401 if (sdata->u.mgd.mfp != IEEE80211_MFP_DISABLED)
1405 err = ieee80211_key_link(key, &sdata->deflink, NULL);
1462 int ieee80211_key_switch_links(struct ieee80211_sub_if_data *sdata,
1469 list_for_each_entry(key, &sdata->key_list, list) {
1480 list_for_each_entry(key, &sdata->key_list, list) {