Lines Matching +full:32 +full:k
122 ath_keyset_tkip(struct ath_softc *sc, const struct ieee80211_key *k, in ath_keyset_tkip() argument
129 KASSERT(k->wk_cipher->ic_cipher == IEEE80211_CIPHER_TKIP, in ath_keyset_tkip()
130 ("got a non-TKIP key, cipher %u", k->wk_cipher->ic_cipher)); in ath_keyset_tkip()
131 if ((k->wk_flags & IEEE80211_KEY_XR) == IEEE80211_KEY_XR) { in ath_keyset_tkip()
137 memcpy(hk->kv_mic, k->wk_txmic, sizeof(hk->kv_mic)); in ath_keyset_tkip()
138 KEYPRINTF(sc, k->wk_keyix, hk, zerobssid); in ath_keyset_tkip()
139 if (!ath_hal_keyset(ah, k->wk_keyix, hk, zerobssid)) in ath_keyset_tkip()
142 memcpy(hk->kv_mic, k->wk_rxmic, sizeof(hk->kv_mic)); in ath_keyset_tkip()
143 KEYPRINTF(sc, k->wk_keyix+32, hk, mac); in ath_keyset_tkip()
145 return ath_hal_keyset(ah, k->wk_keyix+32, hk, mac); in ath_keyset_tkip()
152 memcpy(hk->kv_mic, k->wk_rxmic, sizeof(hk->kv_mic)); in ath_keyset_tkip()
153 memcpy(hk->kv_txmic, k->wk_txmic, sizeof(hk->kv_txmic)); in ath_keyset_tkip()
154 KEYPRINTF(sc, k->wk_keyix, hk, mac); in ath_keyset_tkip()
155 return ath_hal_keyset(ah, k->wk_keyix, hk, mac); in ath_keyset_tkip()
157 } else if (k->wk_flags & IEEE80211_KEY_XMIT) { in ath_keyset_tkip()
163 memcpy(hk->kv_mic, k->wk_txmic, sizeof(hk->kv_txmic)); in ath_keyset_tkip()
165 memcpy(hk->kv_txmic, k->wk_txmic, sizeof(hk->kv_txmic)); in ath_keyset_tkip()
166 KEYPRINTF(sc, k->wk_keyix, hk, mac); in ath_keyset_tkip()
167 return ath_hal_keyset(ah, k->wk_keyix, hk, mac); in ath_keyset_tkip()
168 } else if (k->wk_flags & IEEE80211_KEY_RECV) { in ath_keyset_tkip()
169 memcpy(hk->kv_mic, k->wk_rxmic, sizeof(hk->kv_mic)); in ath_keyset_tkip()
170 KEYPRINTF(sc, k->wk_keyix, hk, mac); in ath_keyset_tkip()
171 return ath_hal_keyset(ah, k->wk_keyix, hk, mac); in ath_keyset_tkip()
184 const struct ieee80211_key *k, in ath_keyset() argument
197 const struct ieee80211_cipher *cip = k->wk_cipher; in ath_keyset()
209 if ((k->wk_flags & IEEE80211_KEY_SWCRYPT) == 0) { in ath_keyset()
213 hk.kv_len = k->wk_keylen; in ath_keyset()
214 memcpy(hk.kv_val, k->wk_key, k->wk_keylen); in ath_keyset()
242 (k->wk_flags & IEEE80211_KEY_GROUP) && in ath_keyset()
253 mac = k->wk_macaddr; in ath_keyset()
258 (k->wk_flags & IEEE80211_KEY_SWMIC) == 0) { in ath_keyset()
259 ret = ath_keyset_tkip(sc, k, &hk, mac); in ath_keyset()
261 KEYPRINTF(sc, k->wk_keyix, &hk, mac); in ath_keyset()
262 ret = ath_hal_keyset(ah, k->wk_keyix, &hk, mac); in ath_keyset()
295 if (isset(sc->sc_keymap, keyix+32) || in key_alloc_2pair()
297 isset(sc->sc_keymap, keyix+32+64)) { in key_alloc_2pair()
308 setbit(sc->sc_keymap, keyix+32); in key_alloc_2pair()
309 setbit(sc->sc_keymap, keyix+32+64); in key_alloc_2pair()
313 keyix+32, keyix+32+64); in key_alloc_2pair()
315 *rxkeyix = keyix+32; in key_alloc_2pair()
386 /* XXX try i,i+32,i+64,i+32+64 to minimize key pair conflicts */ in key_alloc_single()
417 ath_key_alloc(struct ieee80211vap *vap, struct ieee80211_key *k, in ath_key_alloc() argument
433 if (k->wk_keyix != IEEE80211_KEYIX_NONE) { in ath_key_alloc()
437 if (!ieee80211_is_key_global(vap, k)) { in ath_key_alloc()
444 !(k->wk_flags & IEEE80211_KEY_GROUP) || in ath_key_alloc()
452 ieee80211_crypto_get_key_wepidx(vap, k); in ath_key_alloc()
458 k->wk_keyix = IEEE80211_KEYIX_NONE; in ath_key_alloc()
469 if (k->wk_flags & IEEE80211_KEY_SWCRYPT) { in ath_key_alloc()
471 } else if (k->wk_cipher->ic_cipher == IEEE80211_CIPHER_TKIP && in ath_key_alloc()
472 (k->wk_flags & IEEE80211_KEY_SWMIC) == 0) { in ath_key_alloc()
486 ath_key_delete(struct ieee80211vap *vap, const struct ieee80211_key *k) in ath_key_delete() argument
490 const struct ieee80211_cipher *cip = k->wk_cipher; in ath_key_delete()
491 u_int keyix = k->wk_keyix; in ath_key_delete()
502 (k->wk_flags & IEEE80211_KEY_SWMIC) == 0 && sc->sc_splitmic) in ath_key_delete()
503 ath_hal_keyreset(ah, keyix+32); /* RX key */ in ath_key_delete()
511 (k->wk_flags & IEEE80211_KEY_SWMIC) == 0) { in ath_key_delete()
514 /* +32 for RX key, +32+64 for RX key MIC */ in ath_key_delete()
515 clrbit(sc->sc_keymap, keyix+32); in ath_key_delete()
516 clrbit(sc->sc_keymap, keyix+32+64); in ath_key_delete()
530 ath_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k) in ath_key_set() argument
534 return ath_keyset(sc, vap, k, vap->iv_bss); in ath_key_set()