Lines Matching defs:key

36 #define IEEE80211_WEP_NKID      4       /* number of key ids */
104 * Not setting this bit allows the hardware to use the key
165 ath_dbg(common, ANY, "WEP key length %u too small\n",
203 * Write inverted key[47:0] first to avoid Michael MIC errors
205 * The correct key will be written in the end once everything
211 /* Write key[95:48] */
215 /* Write key[127:96] and key type */
224 * TKIP uses two key cache entries:
225 * Michael MIC TX/RX keys in the same key cache entry
227 * key0 [31:0] = RX key [31:0]
228 * key1 [15:0] = TX key [31:16]
230 * key2 [31:0] = RX key [63:32]
231 * key3 [15:0] = TX key [15:0]
233 * key4 [31:0] = TX key [63:32]
262 * TKIP uses four key cache entries (two for group
264 * Michael MIC TX/RX keys are in different key cache
267 * key0 [31:0] = TX/RX MIC key [31:0]
269 * key2 [31:0] = TX/RX MIC key [63:32]
284 /* Write MIC key[31:0] */
288 /* Write MIC key[63:32] */
307 * Write the correct (un-inverted) key[47:0] last to enable
318 /* Write key[47:0] */
322 /* Write key[95:48] */
326 /* Write key[127:96] and key type */
339 static int ath_setkey_tkip(struct ath_common *common, u16 keyix, const u8 *key,
346 key_txmic = key + NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY;
347 key_rxmic = key + NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY;
351 * Group key installation - only two key cache entries are used
352 * regardless of splitmic capability since group key is only
365 /* TX and RX keys share the same key cache entry. */
371 /* Separate key cache entries for TX and RX */
373 /* TX key goes at first index, RX key at +32. */
382 /* XXX delete tx key on failure? */
393 continue; /* At least one part of TKIP key allocated */
397 continue; /* At least one part of TKIP key allocated */
399 /* Found a free slot for a TKIP key */
463 return i; /* Found a free slot for a key */
476 struct ieee80211_key_conf *key)
486 switch (key->cipher) {
504 hk.kv_len = key->keylen;
505 if (key->keylen)
506 memcpy(&hk.kv_values, key->key, key->keylen);
508 if (!(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) {
514 idx = ath_reserve_key_cache_slot(common, key->cipher);
518 idx = key->keyidx;
524 idx = ath_reserve_key_cache_slot(common, key->cipher);
527 idx = key->keyidx;
530 } else if (key->keyidx) {
536 /* Only keyidx 0 should be used with unicast key, but
538 idx = key->keyidx;
546 idx = ath_reserve_key_cache_slot(common, key->cipher);
550 return -ENOSPC; /* no free key cache entries */
552 if (key->cipher == WLAN_CIPHER_SUITE_TKIP)
553 ret = ath_setkey_tkip(common, idx, key->key, &hk, mac,
562 if (key->cipher == WLAN_CIPHER_SUITE_CCMP)
565 if (key->cipher == WLAN_CIPHER_SUITE_TKIP) {
586 /* Leave CCMP and TKIP (main key) configured to avoid disabling
588 * keyix pointing to this key entry. Instead, only clear the MAC address
589 * to prevent RX processing from using this key cache entry.