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