Lines Matching refs:key
34 struct ieee80211_key_conf *key, u8 *peer_addr) in fill_wep_pair() argument
36 WARN(key->keylen > sizeof(msg->key_data), "inconsistent data"); in fill_wep_pair()
37 msg->key_length = key->keylen; in fill_wep_pair()
38 memcpy(msg->key_data, key->key, key->keylen); in fill_wep_pair()
44 struct ieee80211_key_conf *key) in fill_wep_group() argument
46 WARN(key->keylen > sizeof(msg->key_data), "inconsistent data"); in fill_wep_group()
47 msg->key_id = key->keyidx; in fill_wep_group()
48 msg->key_length = key->keylen; in fill_wep_group()
49 memcpy(msg->key_data, key->key, key->keylen); in fill_wep_group()
54 struct ieee80211_key_conf *key, u8 *peer_addr) in fill_tkip_pair() argument
56 u8 *keybuf = key->key; in fill_tkip_pair()
58 WARN(key->keylen != sizeof(msg->tkip_key_data) + sizeof(msg->tx_mic_key) + in fill_tkip_pair()
69 static u8 fill_tkip_group(struct wfx_hif_tkip_group_key *msg, struct ieee80211_key_conf *key, in fill_tkip_group() argument
72 u8 *keybuf = key->key; in fill_tkip_group()
74 WARN(key->keylen != sizeof(msg->tkip_key_data) + 2 * sizeof(msg->rx_mic_key), in fill_tkip_group()
76 msg->key_id = key->keyidx; in fill_tkip_group()
91 struct ieee80211_key_conf *key, u8 *peer_addr) in fill_ccmp_pair() argument
93 WARN(key->keylen != sizeof(msg->aes_key_data), "inconsistent data"); in fill_ccmp_pair()
95 memcpy(msg->aes_key_data, key->key, key->keylen); in fill_ccmp_pair()
100 struct ieee80211_key_conf *key, struct ieee80211_key_seq *seq) in fill_ccmp_group() argument
102 WARN(key->keylen != sizeof(msg->aes_key_data), "inconsistent data"); in fill_ccmp_group()
103 memcpy(msg->aes_key_data, key->key, key->keylen); in fill_ccmp_group()
106 msg->key_id = key->keyidx; in fill_ccmp_group()
111 struct ieee80211_key_conf *key, u8 *peer_addr) in fill_sms4_pair() argument
113 u8 *keybuf = key->key; in fill_sms4_pair()
115 WARN(key->keylen != sizeof(msg->wapi_key_data) + sizeof(msg->mic_key_data), in fill_sms4_pair()
121 msg->key_id = key->keyidx; in fill_sms4_pair()
126 struct ieee80211_key_conf *key) in fill_sms4_group() argument
128 u8 *keybuf = key->key; in fill_sms4_group()
130 WARN(key->keylen != sizeof(msg->wapi_key_data) + sizeof(msg->mic_key_data), in fill_sms4_group()
135 msg->key_id = key->keyidx; in fill_sms4_group()
140 struct ieee80211_key_conf *key, struct ieee80211_key_seq *seq) in fill_aes_cmac_group() argument
142 WARN(key->keylen != sizeof(msg->igtk_key_data), "inconsistent data"); in fill_aes_cmac_group()
143 memcpy(msg->igtk_key_data, key->key, key->keylen); in fill_aes_cmac_group()
146 msg->key_id = key->keyidx; in fill_aes_cmac_group()
151 struct ieee80211_key_conf *key) in wfx_add_key() argument
158 bool pairwise = key->flags & IEEE80211_KEY_FLAG_PAIRWISE; in wfx_add_key()
161 WARN(key->flags & IEEE80211_KEY_FLAG_PAIRWISE && !sta, "inconsistent data"); in wfx_add_key()
162 ieee80211_get_key_rx_seq(key, 0, &seq); in wfx_add_key()
167 if (key->cipher == WLAN_CIPHER_SUITE_WEP40 || in wfx_add_key()
168 key->cipher == WLAN_CIPHER_SUITE_WEP104) { in wfx_add_key()
170 k.type = fill_wep_pair(&k.key.wep_pairwise_key, key, sta->addr); in wfx_add_key()
172 k.type = fill_wep_group(&k.key.wep_group_key, key); in wfx_add_key()
173 } else if (key->cipher == WLAN_CIPHER_SUITE_TKIP) { in wfx_add_key()
175 k.type = fill_tkip_pair(&k.key.tkip_pairwise_key, key, sta->addr); in wfx_add_key()
177 k.type = fill_tkip_group(&k.key.tkip_group_key, key, &seq, in wfx_add_key()
179 } else if (key->cipher == WLAN_CIPHER_SUITE_CCMP) { in wfx_add_key()
181 k.type = fill_ccmp_pair(&k.key.aes_pairwise_key, key, sta->addr); in wfx_add_key()
183 k.type = fill_ccmp_group(&k.key.aes_group_key, key, &seq); in wfx_add_key()
184 } else if (key->cipher == WLAN_CIPHER_SUITE_SMS4) { in wfx_add_key()
186 k.type = fill_sms4_pair(&k.key.wapi_pairwise_key, key, sta->addr); in wfx_add_key()
188 k.type = fill_sms4_group(&k.key.wapi_group_key, key); in wfx_add_key()
189 } else if (key->cipher == WLAN_CIPHER_SUITE_AES_CMAC) { in wfx_add_key()
190 k.type = fill_aes_cmac_group(&k.key.igtk_group_key, key, &seq); in wfx_add_key()
191 key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIE; in wfx_add_key()
193 dev_warn(wdev->dev, "unsupported key type %d\n", key->cipher); in wfx_add_key()
202 key->flags |= IEEE80211_KEY_FLAG_PUT_IV_SPACE | IEEE80211_KEY_FLAG_RESERVE_TAILROOM; in wfx_add_key()
203 key->hw_key_idx = idx; in wfx_add_key()
207 static int wfx_remove_key(struct wfx_vif *wvif, struct ieee80211_key_conf *key) in wfx_remove_key() argument
209 WARN(key->hw_key_idx >= MAX_KEY_ENTRIES, "corrupted hw_key_idx"); in wfx_remove_key()
210 wfx_free_key(wvif->wdev, key->hw_key_idx); in wfx_remove_key()
211 return wfx_hif_remove_key(wvif->wdev, key->hw_key_idx); in wfx_remove_key()
215 struct ieee80211_sta *sta, struct ieee80211_key_conf *key) in wfx_set_key() argument
222 ret = wfx_add_key(wvif, sta, key); in wfx_set_key()
224 ret = wfx_remove_key(wvif, key); in wfx_set_key()