Lines Matching full:key

32  * DOC: Key handling basics
34 * Key handling in mac80211 is done based on per-interface (sub_if_data)
36 * each station key also belongs to that interface.
39 * that are implemented in software, for each key the hardware is asked
40 * to enable that key for offloading but if it cannot do that the key is
43 * There is currently no way of knowing whether a key is handled in SW
46 * All key management is internally protected by a mutex. Within all
47 * other parts of mac80211, key references are, just as STA structure
49 * unprotected, namely the key->sta dereferences within the hardware
51 * remove the key which waits for an RCU grace period.
82 * 1. SKB resize was skipped because no key was added but just before in increment_tailroom_need_count()
83 * the xmit key is added and SW encryption kicks off. in increment_tailroom_need_count()
86 * just before xmit one of the key is deleted and SW encryption kicks in increment_tailroom_need_count()
120 static int ieee80211_key_enable_hw_accel(struct ieee80211_key *key) in ieee80211_key_enable_hw_accel() argument
122 struct ieee80211_sub_if_data *sdata = key->sdata; in ieee80211_key_enable_hw_accel()
127 lockdep_assert_wiphy(key->local->hw.wiphy); in ieee80211_key_enable_hw_accel()
129 if (key->flags & KEY_FLAG_TAINTED) { in ieee80211_key_enable_hw_accel()
130 /* If we get here, it's during resume and the key is in ieee80211_key_enable_hw_accel()
137 if (key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE && in ieee80211_key_enable_hw_accel()
138 !(key->conf.flags & (IEEE80211_KEY_FLAG_GENERATE_MMIC | in ieee80211_key_enable_hw_accel()
143 key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE; in ieee80211_key_enable_hw_accel()
147 if (!key->local->ops->set_key) in ieee80211_key_enable_hw_accel()
150 sta = key->sta; in ieee80211_key_enable_hw_accel()
156 if (sta && !(key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE) && in ieee80211_key_enable_hw_accel()
157 !ieee80211_hw_check(&key->local->hw, SUPPORTS_PER_STA_GTK)) in ieee80211_key_enable_hw_accel()
168 if (!(key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE)) { in ieee80211_key_enable_hw_accel()
174 if (key->conf.link_id >= 0 && sdata->vif.active_links && in ieee80211_key_enable_hw_accel()
175 !(sdata->vif.active_links & BIT(key->conf.link_id))) in ieee80211_key_enable_hw_accel()
178 ret = drv_set_key(key->local, SET_KEY, sdata, in ieee80211_key_enable_hw_accel()
179 sta ? &sta->sta : NULL, &key->conf); in ieee80211_key_enable_hw_accel()
182 key->flags |= KEY_FLAG_UPLOADED_TO_HARDWARE; in ieee80211_key_enable_hw_accel()
184 if (!(key->conf.flags & (IEEE80211_KEY_FLAG_GENERATE_MMIC | in ieee80211_key_enable_hw_accel()
189 WARN_ON((key->conf.flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE) && in ieee80211_key_enable_hw_accel()
190 (key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV)); in ieee80211_key_enable_hw_accel()
192 WARN_ON((key->conf.flags & IEEE80211_KEY_FLAG_PUT_MIC_SPACE) && in ieee80211_key_enable_hw_accel()
193 (key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC)); in ieee80211_key_enable_hw_accel()
200 "failed to set key (%d, %pM) to hardware (%d)\n", in ieee80211_key_enable_hw_accel()
201 key->conf.keyidx, in ieee80211_key_enable_hw_accel()
205 switch (key->conf.cipher) { in ieee80211_key_enable_hw_accel()
220 if (ieee80211_hw_check(&key->local->hw, SW_CRYPTO_CONTROL)) in ieee80211_key_enable_hw_accel()
228 static void ieee80211_key_disable_hw_accel(struct ieee80211_key *key) in ieee80211_key_disable_hw_accel() argument
236 if (!key || !key->local->ops->set_key) in ieee80211_key_disable_hw_accel()
239 if (!(key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE)) in ieee80211_key_disable_hw_accel()
242 sta = key->sta; in ieee80211_key_disable_hw_accel()
243 sdata = key->sdata; in ieee80211_key_disable_hw_accel()
245 lockdep_assert_wiphy(key->local->hw.wiphy); in ieee80211_key_disable_hw_accel()
247 if (key->conf.link_id >= 0 && sdata->vif.active_links && in ieee80211_key_disable_hw_accel()
248 !(sdata->vif.active_links & BIT(key->conf.link_id))) in ieee80211_key_disable_hw_accel()
251 if (!(key->conf.flags & (IEEE80211_KEY_FLAG_GENERATE_MMIC | in ieee80211_key_disable_hw_accel()
256 key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE; in ieee80211_key_disable_hw_accel()
257 ret = drv_set_key(key->local, DISABLE_KEY, sdata, in ieee80211_key_disable_hw_accel()
258 sta ? &sta->sta : NULL, &key->conf); in ieee80211_key_disable_hw_accel()
262 "failed to remove key (%d, %pM) from hardware (%d)\n", in ieee80211_key_disable_hw_accel()
263 key->conf.keyidx, in ieee80211_key_disable_hw_accel()
267 static int _ieee80211_set_tx_key(struct ieee80211_key *key, bool force) in _ieee80211_set_tx_key() argument
269 struct sta_info *sta = key->sta; in _ieee80211_set_tx_key()
270 struct ieee80211_local *local = key->local; in _ieee80211_set_tx_key()
276 sta->ptk_idx = key->conf.keyidx; in _ieee80211_set_tx_key()
285 int ieee80211_set_tx_key(struct ieee80211_key *key) in ieee80211_set_tx_key() argument
287 return _ieee80211_set_tx_key(key, false); in ieee80211_set_tx_key()
300 /* Extended Key ID key install, initial one or rekey */ in ieee80211_pairwise_rekey()
304 /* Aggregation Sessions with Extended Key ID must not in ieee80211_pairwise_rekey()
309 * supporting A-MPDU key borders. (Blocking Tx only in ieee80211_pairwise_rekey()
319 /* Rekey without Extended Key ID. in ieee80211_pairwise_rekey()
327 /* Stop Tx till we are on the new key */ in ieee80211_pairwise_rekey()
351 struct ieee80211_key *key = NULL; in __ieee80211_set_default_key() local
356 key = wiphy_dereference(sdata->local->hw.wiphy, in __ieee80211_set_default_key()
358 if (!key) in __ieee80211_set_default_key()
359 key = wiphy_dereference(sdata->local->hw.wiphy, in __ieee80211_set_default_key()
364 rcu_assign_pointer(sdata->default_unicast_key, key); in __ieee80211_set_default_key()
371 rcu_assign_pointer(link->default_multicast_key, key); in __ieee80211_set_default_key()
388 struct ieee80211_key *key = NULL; in __ieee80211_set_default_mgmt_key() local
394 key = wiphy_dereference(sdata->local->hw.wiphy, in __ieee80211_set_default_mgmt_key()
397 rcu_assign_pointer(link->default_mgmt_key, key); in __ieee80211_set_default_mgmt_key()
414 struct ieee80211_key *key = NULL; in __ieee80211_set_default_beacon_key() local
421 key = wiphy_dereference(sdata->local->hw.wiphy, in __ieee80211_set_default_beacon_key()
424 rcu_assign_pointer(link->default_beacon_key, key); in __ieee80211_set_default_beacon_key()
497 /* Unicast rekey needs special handling. With Extended Key ID in ieee80211_key_replace()
533 /* Only needed for transition from no key -> key. in ieee80211_key_replace()
534 * Still triggers unnecessary when using Extended Key ID in ieee80211_key_replace()
535 * and installing the second key ID the first time. in ieee80211_key_replace()
592 struct ieee80211_key *key; in ieee80211_key_alloc() local
600 key = kzalloc(sizeof(struct ieee80211_key) + key_len, GFP_KERNEL); in ieee80211_key_alloc()
601 if (!key) in ieee80211_key_alloc()
606 * key to the hardware if possible. in ieee80211_key_alloc()
608 key->conf.flags = 0; in ieee80211_key_alloc()
609 key->flags = 0; in ieee80211_key_alloc()
611 key->conf.link_id = -1; in ieee80211_key_alloc()
612 key->conf.cipher = cipher; in ieee80211_key_alloc()
613 key->conf.keyidx = idx; in ieee80211_key_alloc()
614 key->conf.keylen = key_len; in ieee80211_key_alloc()
618 key->conf.iv_len = IEEE80211_WEP_IV_LEN; in ieee80211_key_alloc()
619 key->conf.icv_len = IEEE80211_WEP_ICV_LEN; in ieee80211_key_alloc()
622 key->conf.iv_len = IEEE80211_TKIP_IV_LEN; in ieee80211_key_alloc()
623 key->conf.icv_len = IEEE80211_TKIP_ICV_LEN; in ieee80211_key_alloc()
626 key->u.tkip.rx[i].iv32 = in ieee80211_key_alloc()
628 key->u.tkip.rx[i].iv16 = in ieee80211_key_alloc()
632 spin_lock_init(&key->u.tkip.txlock); in ieee80211_key_alloc()
635 key->conf.iv_len = IEEE80211_CCMP_HDR_LEN; in ieee80211_key_alloc()
636 key->conf.icv_len = IEEE80211_CCMP_MIC_LEN; in ieee80211_key_alloc()
640 key->u.ccmp.rx_pn[i][j] = in ieee80211_key_alloc()
644 * Initialize AES key state here as an optimization so that in ieee80211_key_alloc()
647 key->u.ccmp.tfm = ieee80211_aes_key_setup_encrypt( in ieee80211_key_alloc()
649 if (IS_ERR(key->u.ccmp.tfm)) { in ieee80211_key_alloc()
650 err = PTR_ERR(key->u.ccmp.tfm); in ieee80211_key_alloc()
651 kfree(key); in ieee80211_key_alloc()
656 key->conf.iv_len = IEEE80211_CCMP_256_HDR_LEN; in ieee80211_key_alloc()
657 key->conf.icv_len = IEEE80211_CCMP_256_MIC_LEN; in ieee80211_key_alloc()
660 key->u.ccmp.rx_pn[i][j] = in ieee80211_key_alloc()
662 /* Initialize AES key state here as an optimization so that in ieee80211_key_alloc()
665 key->u.ccmp.tfm = ieee80211_aes_key_setup_encrypt( in ieee80211_key_alloc()
667 if (IS_ERR(key->u.ccmp.tfm)) { in ieee80211_key_alloc()
668 err = PTR_ERR(key->u.ccmp.tfm); in ieee80211_key_alloc()
669 kfree(key); in ieee80211_key_alloc()
675 key->conf.iv_len = 0; in ieee80211_key_alloc()
677 key->conf.icv_len = sizeof(struct ieee80211_mmie); in ieee80211_key_alloc()
679 key->conf.icv_len = sizeof(struct ieee80211_mmie_16); in ieee80211_key_alloc()
682 key->u.aes_cmac.rx_pn[j] = in ieee80211_key_alloc()
685 * Initialize AES key state here as an optimization so that in ieee80211_key_alloc()
688 key->u.aes_cmac.tfm = in ieee80211_key_alloc()
690 if (IS_ERR(key->u.aes_cmac.tfm)) { in ieee80211_key_alloc()
691 err = PTR_ERR(key->u.aes_cmac.tfm); in ieee80211_key_alloc()
692 kfree(key); in ieee80211_key_alloc()
698 key->conf.iv_len = 0; in ieee80211_key_alloc()
699 key->conf.icv_len = sizeof(struct ieee80211_mmie_16); in ieee80211_key_alloc()
702 key->u.aes_gmac.rx_pn[j] = in ieee80211_key_alloc()
704 /* Initialize AES key state here as an optimization so that in ieee80211_key_alloc()
707 key->u.aes_gmac.tfm = in ieee80211_key_alloc()
709 if (IS_ERR(key->u.aes_gmac.tfm)) { in ieee80211_key_alloc()
710 err = PTR_ERR(key->u.aes_gmac.tfm); in ieee80211_key_alloc()
711 kfree(key); in ieee80211_key_alloc()
717 key->conf.iv_len = IEEE80211_GCMP_HDR_LEN; in ieee80211_key_alloc()
718 key->conf.icv_len = IEEE80211_GCMP_MIC_LEN; in ieee80211_key_alloc()
721 key->u.gcmp.rx_pn[i][j] = in ieee80211_key_alloc()
723 /* Initialize AES key state here as an optimization so that in ieee80211_key_alloc()
726 key->u.gcmp.tfm = ieee80211_aes_gcm_key_setup_encrypt(key_data, in ieee80211_key_alloc()
728 if (IS_ERR(key->u.gcmp.tfm)) { in ieee80211_key_alloc()
729 err = PTR_ERR(key->u.gcmp.tfm); in ieee80211_key_alloc()
730 kfree(key); in ieee80211_key_alloc()
735 memcpy(key->conf.key, key_data, key_len); in ieee80211_key_alloc()
736 INIT_LIST_HEAD(&key->list); in ieee80211_key_alloc()
738 return key; in ieee80211_key_alloc()
741 static void ieee80211_key_free_common(struct ieee80211_key *key) in ieee80211_key_free_common() argument
743 switch (key->conf.cipher) { in ieee80211_key_free_common()
746 ieee80211_aes_key_free(key->u.ccmp.tfm); in ieee80211_key_free_common()
750 ieee80211_aes_cmac_key_free(key->u.aes_cmac.tfm); in ieee80211_key_free_common()
754 ieee80211_aes_gmac_key_free(key->u.aes_gmac.tfm); in ieee80211_key_free_common()
758 ieee80211_aes_gcm_key_free(key->u.gcmp.tfm); in ieee80211_key_free_common()
761 kfree_sensitive(key); in ieee80211_key_free_common()
764 static void __ieee80211_key_destroy(struct ieee80211_key *key, in __ieee80211_key_destroy() argument
767 if (key->local) { in __ieee80211_key_destroy()
768 struct ieee80211_sub_if_data *sdata = key->sdata; in __ieee80211_key_destroy()
770 ieee80211_debugfs_key_remove(key); in __ieee80211_key_destroy()
783 ieee80211_key_free_common(key); in __ieee80211_key_destroy()
786 static void ieee80211_key_destroy(struct ieee80211_key *key, in ieee80211_key_destroy() argument
789 if (!key) in ieee80211_key_destroy()
793 * Synchronize so the TX path and rcu key iterators in ieee80211_key_destroy()
794 * can no longer be using this key before we free/remove it. in ieee80211_key_destroy()
798 __ieee80211_key_destroy(key, delay_tailroom); in ieee80211_key_destroy()
801 void ieee80211_key_free_unused(struct ieee80211_key *key) in ieee80211_key_free_unused() argument
803 if (!key) in ieee80211_key_free_unused()
806 WARN_ON(key->sdata || key->local); in ieee80211_key_free_unused()
807 ieee80211_key_free_common(key); in ieee80211_key_free_unused()
820 tk_old = old->conf.key; in ieee80211_key_identical()
821 tk_new = new->conf.key; in ieee80211_key_identical()
824 * In station mode, don't compare the TX MIC key, as it's never used in ieee80211_key_identical()
843 int ieee80211_key_link(struct ieee80211_key *key, in ieee80211_key_link() argument
850 int idx = key->conf.keyidx; in ieee80211_key_link()
851 bool pairwise = key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE; in ieee80211_key_link()
870 /* The rekey code assumes that the old and new key are using in ieee80211_key_link()
873 if ((alt_key && alt_key->conf.cipher != key->conf.cipher) || in ieee80211_key_link()
874 (old_key && old_key->conf.cipher != key->conf.cipher)) { in ieee80211_key_link()
880 int link_id = key->conf.link_id; in ieee80211_key_link()
904 if (old_key && old_key->conf.cipher != key->conf.cipher) { in ieee80211_key_link()
911 * Silently accept key re-installation without really installing the in ieee80211_key_link()
912 * new version of the key to avoid nonce reuse or replay issues. in ieee80211_key_link()
914 if (ieee80211_key_identical(sdata, old_key, key)) { in ieee80211_key_link()
919 key->local = sdata->local; in ieee80211_key_link()
920 key->sdata = sdata; in ieee80211_key_link()
921 key->sta = sta; in ieee80211_key_link()
924 * Assign a unique ID to every key so we can easily prevent mixed in ieee80211_key_link()
925 * key and fragment cache attacks. in ieee80211_key_link()
927 key->color = atomic_inc_return(&key_color); in ieee80211_key_link()
931 key->conf.flags |= IEEE80211_KEY_FLAG_SPP_AMSDU; in ieee80211_key_link()
935 ret = ieee80211_key_replace(sdata, link, sta, pairwise, old_key, key); in ieee80211_key_link()
938 ieee80211_debugfs_key_add(key); in ieee80211_key_link()
941 ieee80211_key_free(key, delay_tailroom); in ieee80211_key_link()
944 key = NULL; in ieee80211_key_link()
947 ieee80211_key_free_unused(key); in ieee80211_key_link()
951 void ieee80211_key_free(struct ieee80211_key *key, bool delay_tailroom) in ieee80211_key_free() argument
953 if (!key) in ieee80211_key_free()
957 * Replace key with nothingness if it was ever used. in ieee80211_key_free()
959 if (key->sdata) in ieee80211_key_free()
960 ieee80211_key_replace(key->sdata, NULL, key->sta, in ieee80211_key_free()
961 key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE, in ieee80211_key_free()
962 key, NULL); in ieee80211_key_free()
963 ieee80211_key_destroy(key, delay_tailroom); in ieee80211_key_free()
968 struct ieee80211_key *key; in ieee80211_reenable_keys() local
984 list_for_each_entry(key, &sdata->key_list, list) { in ieee80211_reenable_keys()
986 ieee80211_key_enable_hw_accel(key); in ieee80211_reenable_keys()
994 struct ieee80211_key *key, in ieee80211_key_iter() argument
998 struct ieee80211_key_conf *key, in ieee80211_key_iter() argument
1003 if (key->sta && key->sta->removed) in ieee80211_key_iter()
1005 if (!(key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE)) in ieee80211_key_iter()
1007 iter(hw, vif, key->sta ? &key->sta->sta : NULL, in ieee80211_key_iter()
1008 &key->conf, iter_data); in ieee80211_key_iter()
1016 struct ieee80211_key_conf *key, in ieee80211_iter_keys() argument
1021 struct ieee80211_key *key, *tmp; in ieee80211_iter_keys() local
1028 list_for_each_entry_safe(key, tmp, &sdata->key_list, list) in ieee80211_iter_keys()
1029 ieee80211_key_iter(hw, vif, key, iter, iter_data); in ieee80211_iter_keys()
1032 list_for_each_entry_safe(key, tmp, in ieee80211_iter_keys()
1034 ieee80211_key_iter(hw, &sdata->vif, key, in ieee80211_iter_keys()
1046 struct ieee80211_key_conf *key, in _ieee80211_iter_keys_rcu() argument
1050 struct ieee80211_key *key; in _ieee80211_iter_keys_rcu() local
1052 list_for_each_entry_rcu(key, &sdata->key_list, list) in _ieee80211_iter_keys_rcu()
1053 ieee80211_key_iter(hw, &sdata->vif, key, iter, iter_data); in _ieee80211_iter_keys_rcu()
1061 struct ieee80211_key_conf *key, in ieee80211_iter_keys_rcu() argument
1081 struct ieee80211_key *key, *tmp; in ieee80211_free_keys_iface() local
1090 list_for_each_entry_safe(key, tmp, &sdata->key_list, list) { in ieee80211_free_keys_iface()
1091 ieee80211_key_replace(key->sdata, NULL, key->sta, in ieee80211_free_keys_iface()
1092 key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE, in ieee80211_free_keys_iface()
1093 key, NULL); in ieee80211_free_keys_iface()
1094 list_add_tail(&key->list, keys); in ieee80211_free_keys_iface()
1105 struct ieee80211_key *key, *tmp; in ieee80211_remove_link_keys() local
1109 list_for_each_entry_safe(key, tmp, &sdata->key_list, list) { in ieee80211_remove_link_keys()
1110 if (key->conf.link_id != link->link_id) in ieee80211_remove_link_keys()
1112 ieee80211_key_replace(key->sdata, link, key->sta, in ieee80211_remove_link_keys()
1113 key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE, in ieee80211_remove_link_keys()
1114 key, NULL); in ieee80211_remove_link_keys()
1115 list_add_tail(&key->list, keys); in ieee80211_remove_link_keys()
1122 struct ieee80211_key *key, *tmp; in ieee80211_free_key_list() local
1126 list_for_each_entry_safe(key, tmp, keys, list) in ieee80211_free_key_list()
1127 __ieee80211_key_destroy(key, false); in ieee80211_free_key_list()
1136 struct ieee80211_key *key, *tmp; in ieee80211_free_keys() local
1153 list_for_each_entry_safe(key, tmp, &keys, list) in ieee80211_free_keys()
1154 __ieee80211_key_destroy(key, false); in ieee80211_free_keys()
1180 struct ieee80211_key *key; in ieee80211_free_sta_keys() local
1186 key = wiphy_dereference(local->hw.wiphy, sta->deflink.gtk[i]); in ieee80211_free_sta_keys()
1187 if (!key) in ieee80211_free_sta_keys()
1189 ieee80211_key_replace(key->sdata, NULL, key->sta, in ieee80211_free_sta_keys()
1190 key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE, in ieee80211_free_sta_keys()
1191 key, NULL); in ieee80211_free_sta_keys()
1192 __ieee80211_key_destroy(key, key->sdata->vif.type == in ieee80211_free_sta_keys()
1197 key = wiphy_dereference(local->hw.wiphy, sta->ptk[i]); in ieee80211_free_sta_keys()
1198 if (!key) in ieee80211_free_sta_keys()
1200 ieee80211_key_replace(key->sdata, NULL, key->sta, in ieee80211_free_sta_keys()
1201 key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE, in ieee80211_free_sta_keys()
1202 key, NULL); in ieee80211_free_sta_keys()
1203 __ieee80211_key_destroy(key, key->sdata->vif.type == in ieee80211_free_sta_keys()
1219 * and then new keys are installed. The first new key causes the in ieee80211_delayed_tailroom_dec()
1223 * key removal for a while, so if we roam the value is larger than in ieee80211_delayed_tailroom_dec()
1251 struct ieee80211_key *key; in ieee80211_get_key_rx_seq() local
1254 key = container_of(keyconf, struct ieee80211_key, conf); in ieee80211_get_key_rx_seq()
1256 switch (key->conf.cipher) { in ieee80211_get_key_rx_seq()
1260 seq->tkip.iv32 = key->u.tkip.rx[tid].iv32; in ieee80211_get_key_rx_seq()
1261 seq->tkip.iv16 = key->u.tkip.rx[tid].iv16; in ieee80211_get_key_rx_seq()
1268 pn = key->u.ccmp.rx_pn[IEEE80211_NUM_TIDS]; in ieee80211_get_key_rx_seq()
1270 pn = key->u.ccmp.rx_pn[tid]; in ieee80211_get_key_rx_seq()
1277 pn = key->u.aes_cmac.rx_pn; in ieee80211_get_key_rx_seq()
1284 pn = key->u.aes_gmac.rx_pn; in ieee80211_get_key_rx_seq()
1292 pn = key->u.gcmp.rx_pn[IEEE80211_NUM_TIDS]; in ieee80211_get_key_rx_seq()
1294 pn = key->u.gcmp.rx_pn[tid]; in ieee80211_get_key_rx_seq()
1304 struct ieee80211_key *key; in ieee80211_set_key_rx_seq() local
1307 key = container_of(keyconf, struct ieee80211_key, conf); in ieee80211_set_key_rx_seq()
1309 switch (key->conf.cipher) { in ieee80211_set_key_rx_seq()
1313 key->u.tkip.rx[tid].iv32 = seq->tkip.iv32; in ieee80211_set_key_rx_seq()
1314 key->u.tkip.rx[tid].iv16 = seq->tkip.iv16; in ieee80211_set_key_rx_seq()
1321 pn = key->u.ccmp.rx_pn[IEEE80211_NUM_TIDS]; in ieee80211_set_key_rx_seq()
1323 pn = key->u.ccmp.rx_pn[tid]; in ieee80211_set_key_rx_seq()
1330 pn = key->u.aes_cmac.rx_pn; in ieee80211_set_key_rx_seq()
1337 pn = key->u.aes_gmac.rx_pn; in ieee80211_set_key_rx_seq()
1345 pn = key->u.gcmp.rx_pn[IEEE80211_NUM_TIDS]; in ieee80211_set_key_rx_seq()
1347 pn = key->u.gcmp.rx_pn[tid]; in ieee80211_set_key_rx_seq()
1365 struct ieee80211_key *key; in ieee80211_gtk_rekey_add() local
1409 key = ieee80211_key_alloc(prev_key->conf.cipher, idx, in ieee80211_gtk_rekey_add()
1412 if (IS_ERR(key)) in ieee80211_gtk_rekey_add()
1413 return ERR_CAST(key); in ieee80211_gtk_rekey_add()
1416 key->conf.flags |= IEEE80211_KEY_FLAG_RX_MGMT; in ieee80211_gtk_rekey_add()
1418 key->conf.link_id = link_data->link_id; in ieee80211_gtk_rekey_add()
1420 err = ieee80211_key_link(key, link_data, NULL); in ieee80211_gtk_rekey_add()
1424 return &key->conf; in ieee80211_gtk_rekey_add()
1430 struct ieee80211_key *key; in ieee80211_key_mic_failure() local
1432 key = container_of(keyconf, struct ieee80211_key, conf); in ieee80211_key_mic_failure()
1434 switch (key->conf.cipher) { in ieee80211_key_mic_failure()
1437 key->u.aes_cmac.icverrors++; in ieee80211_key_mic_failure()
1441 key->u.aes_gmac.icverrors++; in ieee80211_key_mic_failure()
1452 struct ieee80211_key *key; in ieee80211_key_replay() local
1454 key = container_of(keyconf, struct ieee80211_key, conf); in ieee80211_key_replay()
1456 switch (key->conf.cipher) { in ieee80211_key_replay()
1459 key->u.ccmp.replays++; in ieee80211_key_replay()
1463 key->u.aes_cmac.replays++; in ieee80211_key_replay()
1467 key->u.aes_gmac.replays++; in ieee80211_key_replay()
1471 key->u.gcmp.replays++; in ieee80211_key_replay()
1481 struct ieee80211_key *key; in ieee80211_key_switch_links() local
1484 list_for_each_entry(key, &sdata->key_list, list) { in ieee80211_key_switch_links()
1485 if (key->conf.link_id < 0 || in ieee80211_key_switch_links()
1486 !(del_links_mask & BIT(key->conf.link_id))) in ieee80211_key_switch_links()
1490 WARN_ON(key->sta); in ieee80211_key_switch_links()
1492 ieee80211_key_disable_hw_accel(key); in ieee80211_key_switch_links()
1495 list_for_each_entry(key, &sdata->key_list, list) { in ieee80211_key_switch_links()
1496 if (key->conf.link_id < 0 || in ieee80211_key_switch_links()
1497 !(add_links_mask & BIT(key->conf.link_id))) in ieee80211_key_switch_links()
1501 WARN_ON(key->sta); in ieee80211_key_switch_links()
1503 ret = ieee80211_key_enable_hw_accel(key); in ieee80211_key_switch_links()