Lines Matching full:common
25 #define REG_READ (common->ops->read)
26 #define REG_WRITE(_ah, _reg, _val) (common->ops->write)(_ah, _val, _reg)
28 if (common->ops->enable_write_buffer) \
29 common->ops->enable_write_buffer((_ah));
32 if (common->ops->write_flush) \
33 common->ops->write_flush((_ah));
42 bool ath_hw_keyreset(struct ath_common *common, u16 entry) in ath_hw_keyreset() argument
45 void *ah = common->ah; in ath_hw_keyreset()
47 if (entry >= common->keymax) { in ath_hw_keyreset()
48 ath_err(common, "keycache entry %u out of range\n", entry); in ath_hw_keyreset()
72 if (common->crypt_caps & ATH_CRYPT_CAP_MIC_COMBINED) { in ath_hw_keyreset()
86 static bool ath_hw_keysetmac(struct ath_common *common, in ath_hw_keysetmac() argument
91 void *ah = common->ah; in ath_hw_keysetmac()
93 if (entry >= common->keymax) { in ath_hw_keysetmac()
94 ath_err(common, "keycache entry %u out of range\n", entry); in ath_hw_keysetmac()
127 static bool ath_hw_set_keycache_entry(struct ath_common *common, u16 entry, in ath_hw_set_keycache_entry() argument
131 void *ah = common->ah; in ath_hw_set_keycache_entry()
135 if (entry >= common->keymax) { in ath_hw_set_keycache_entry()
136 ath_err(common, "keycache entry %u out of range\n", entry); in ath_hw_set_keycache_entry()
145 if (!(common->crypt_caps & ATH_CRYPT_CAP_CIPHER_AESCCM)) { in ath_hw_set_keycache_entry()
146 ath_dbg(common, ANY, in ath_hw_set_keycache_entry()
154 if (entry + 64 >= common->keymax) { in ath_hw_set_keycache_entry()
155 ath_dbg(common, ANY, in ath_hw_set_keycache_entry()
162 ath_dbg(common, ANY, "WEP key length %u too small\n", in ath_hw_set_keycache_entry()
177 ath_err(common, "cipher %u not supported\n", k->kv_type); in ath_hw_set_keycache_entry()
217 (void) ath_hw_keysetmac(common, entry, mac); in ath_hw_set_keycache_entry()
219 if (common->crypt_caps & ATH_CRYPT_CAP_MIC_COMBINED) { in ath_hw_set_keycache_entry()
330 (void) ath_hw_keysetmac(common, entry, mac); in ath_hw_set_keycache_entry()
336 static int ath_setkey_tkip(struct ath_common *common, u16 keyix, const u8 *key, in ath_setkey_tkip() argument
359 return ath_hw_set_keycache_entry(common, keyix, hk, addr); in ath_setkey_tkip()
361 if (common->crypt_caps & ATH_CRYPT_CAP_MIC_COMBINED) { in ath_setkey_tkip()
365 return ath_hw_set_keycache_entry(common, keyix, hk, addr); in ath_setkey_tkip()
372 if (!ath_hw_set_keycache_entry(common, keyix, hk, NULL)) { in ath_setkey_tkip()
374 ath_err(common, "Setting TX MIC Key Failed\n"); in ath_setkey_tkip()
380 return ath_hw_set_keycache_entry(common, keyix + 32, hk, addr); in ath_setkey_tkip()
383 static int ath_reserve_key_cache_slot_tkip(struct ath_common *common) in ath_reserve_key_cache_slot_tkip() argument
387 for (i = IEEE80211_WEP_NKID; i < common->keymax / 2; i++) { in ath_reserve_key_cache_slot_tkip()
388 if (test_bit(i, common->keymap) || in ath_reserve_key_cache_slot_tkip()
389 test_bit(i + 64, common->keymap)) in ath_reserve_key_cache_slot_tkip()
391 if (!(common->crypt_caps & ATH_CRYPT_CAP_MIC_COMBINED) && in ath_reserve_key_cache_slot_tkip()
392 (test_bit(i + 32, common->keymap) || in ath_reserve_key_cache_slot_tkip()
393 test_bit(i + 64 + 32, common->keymap))) in ath_reserve_key_cache_slot_tkip()
402 static int ath_reserve_key_cache_slot(struct ath_common *common, in ath_reserve_key_cache_slot() argument
408 return ath_reserve_key_cache_slot_tkip(common); in ath_reserve_key_cache_slot()
411 if (!(common->crypt_caps & ATH_CRYPT_CAP_MIC_COMBINED)) { in ath_reserve_key_cache_slot()
412 for (i = IEEE80211_WEP_NKID; i < common->keymax / 4; i++) { in ath_reserve_key_cache_slot()
413 if (!test_bit(i, common->keymap) && in ath_reserve_key_cache_slot()
414 (test_bit(i + 32, common->keymap) || in ath_reserve_key_cache_slot()
415 test_bit(i + 64, common->keymap) || in ath_reserve_key_cache_slot()
416 test_bit(i + 64 + 32, common->keymap))) in ath_reserve_key_cache_slot()
418 if (!test_bit(i + 32, common->keymap) && in ath_reserve_key_cache_slot()
419 (test_bit(i, common->keymap) || in ath_reserve_key_cache_slot()
420 test_bit(i + 64, common->keymap) || in ath_reserve_key_cache_slot()
421 test_bit(i + 64 + 32, common->keymap))) in ath_reserve_key_cache_slot()
423 if (!test_bit(i + 64, common->keymap) && in ath_reserve_key_cache_slot()
424 (test_bit(i , common->keymap) || in ath_reserve_key_cache_slot()
425 test_bit(i + 32, common->keymap) || in ath_reserve_key_cache_slot()
426 test_bit(i + 64 + 32, common->keymap))) in ath_reserve_key_cache_slot()
428 if (!test_bit(i + 64 + 32, common->keymap) && in ath_reserve_key_cache_slot()
429 (test_bit(i, common->keymap) || in ath_reserve_key_cache_slot()
430 test_bit(i + 32, common->keymap) || in ath_reserve_key_cache_slot()
431 test_bit(i + 64, common->keymap))) in ath_reserve_key_cache_slot()
435 for (i = IEEE80211_WEP_NKID; i < common->keymax / 2; i++) { in ath_reserve_key_cache_slot()
436 if (!test_bit(i, common->keymap) && in ath_reserve_key_cache_slot()
437 test_bit(i + 64, common->keymap)) in ath_reserve_key_cache_slot()
439 if (test_bit(i, common->keymap) && in ath_reserve_key_cache_slot()
440 !test_bit(i + 64, common->keymap)) in ath_reserve_key_cache_slot()
446 for (i = IEEE80211_WEP_NKID; i < common->keymax; i++) { in ath_reserve_key_cache_slot()
452 if (!(common->crypt_caps & ATH_CRYPT_CAP_MIC_COMBINED)) { in ath_reserve_key_cache_slot()
459 if (!test_bit(i, common->keymap)) in ath_reserve_key_cache_slot()
470 int ath_key_config(struct ath_common *common, in ath_key_config() argument
511 idx = ath_reserve_key_cache_slot(common, key->cipher); in ath_key_config()
521 idx = ath_reserve_key_cache_slot(common, key->cipher); in ath_key_config()
543 idx = ath_reserve_key_cache_slot(common, key->cipher); in ath_key_config()
550 ret = ath_setkey_tkip(common, idx, key->key, &hk, mac, in ath_key_config()
553 ret = ath_hw_set_keycache_entry(common, idx, &hk, mac); in ath_key_config()
558 set_bit(idx, common->keymap); in ath_key_config()
560 set_bit(idx + 64, common->keymap); in ath_key_config()
561 set_bit(idx, common->tkip_keymap); in ath_key_config()
562 set_bit(idx + 64, common->tkip_keymap); in ath_key_config()
563 if (!(common->crypt_caps & ATH_CRYPT_CAP_MIC_COMBINED)) { in ath_key_config()
564 set_bit(idx + 32, common->keymap); in ath_key_config()
565 set_bit(idx + 64 + 32, common->keymap); in ath_key_config()
566 set_bit(idx + 32, common->tkip_keymap); in ath_key_config()
567 set_bit(idx + 64 + 32, common->tkip_keymap); in ath_key_config()
578 void ath_key_delete(struct ath_common *common, struct ieee80211_key_conf *key) in ath_key_delete() argument
580 ath_hw_keyreset(common, key->hw_key_idx); in ath_key_delete()
584 clear_bit(key->hw_key_idx, common->keymap); in ath_key_delete()
588 clear_bit(key->hw_key_idx + 64, common->keymap); in ath_key_delete()
590 clear_bit(key->hw_key_idx, common->tkip_keymap); in ath_key_delete()
591 clear_bit(key->hw_key_idx + 64, common->tkip_keymap); in ath_key_delete()
593 if (!(common->crypt_caps & ATH_CRYPT_CAP_MIC_COMBINED)) { in ath_key_delete()
594 ath_hw_keyreset(common, key->hw_key_idx + 32); in ath_key_delete()
595 clear_bit(key->hw_key_idx + 32, common->keymap); in ath_key_delete()
596 clear_bit(key->hw_key_idx + 64 + 32, common->keymap); in ath_key_delete()
598 clear_bit(key->hw_key_idx + 32, common->tkip_keymap); in ath_key_delete()
599 clear_bit(key->hw_key_idx + 64 + 32, common->tkip_keymap); in ath_key_delete()