key.c (7483d45f0aee3afc0646d185cabd4af9f6cab58c) | key.c (bed3d9c0b71f9afbfec905cb6db3b9f16be29d4d) |
---|---|
1/* 2 * Copyright (c) 2009 Atheros Communications Inc. 3 * Copyright (c) 2010 Bruno Randolf <br1@einfach.org> 4 * 5 * Permission to use, copy, modify, and/or distribute this software for any 6 * purpose with or without fee is hereby granted, provided that the above 7 * copyright notice and this permission notice appear in all copies. 8 * --- 542 unchanged lines hidden (view full) --- 551 vif->type == NL80211_IFTYPE_AP); 552 else 553 ret = ath_hw_set_keycache_entry(common, idx, &hk, mac); 554 555 if (!ret) 556 return -EIO; 557 558 set_bit(idx, common->keymap); | 1/* 2 * Copyright (c) 2009 Atheros Communications Inc. 3 * Copyright (c) 2010 Bruno Randolf <br1@einfach.org> 4 * 5 * Permission to use, copy, modify, and/or distribute this software for any 6 * purpose with or without fee is hereby granted, provided that the above 7 * copyright notice and this permission notice appear in all copies. 8 * --- 542 unchanged lines hidden (view full) --- 551 vif->type == NL80211_IFTYPE_AP); 552 else 553 ret = ath_hw_set_keycache_entry(common, idx, &hk, mac); 554 555 if (!ret) 556 return -EIO; 557 558 set_bit(idx, common->keymap); |
559 if (key->cipher == WLAN_CIPHER_SUITE_CCMP) 560 set_bit(idx, common->ccmp_keymap); 561 |
|
559 if (key->cipher == WLAN_CIPHER_SUITE_TKIP) { 560 set_bit(idx + 64, common->keymap); 561 set_bit(idx, common->tkip_keymap); 562 set_bit(idx + 64, common->tkip_keymap); 563 if (!(common->crypt_caps & ATH_CRYPT_CAP_MIC_COMBINED)) { 564 set_bit(idx + 32, common->keymap); 565 set_bit(idx + 64 + 32, common->keymap); 566 set_bit(idx + 32, common->tkip_keymap); --- 10 unchanged lines hidden (view full) --- 577 */ 578void ath_key_delete(struct ath_common *common, struct ieee80211_key_conf *key) 579{ 580 ath_hw_keyreset(common, key->hw_key_idx); 581 if (key->hw_key_idx < IEEE80211_WEP_NKID) 582 return; 583 584 clear_bit(key->hw_key_idx, common->keymap); | 562 if (key->cipher == WLAN_CIPHER_SUITE_TKIP) { 563 set_bit(idx + 64, common->keymap); 564 set_bit(idx, common->tkip_keymap); 565 set_bit(idx + 64, common->tkip_keymap); 566 if (!(common->crypt_caps & ATH_CRYPT_CAP_MIC_COMBINED)) { 567 set_bit(idx + 32, common->keymap); 568 set_bit(idx + 64 + 32, common->keymap); 569 set_bit(idx + 32, common->tkip_keymap); --- 10 unchanged lines hidden (view full) --- 580 */ 581void ath_key_delete(struct ath_common *common, struct ieee80211_key_conf *key) 582{ 583 ath_hw_keyreset(common, key->hw_key_idx); 584 if (key->hw_key_idx < IEEE80211_WEP_NKID) 585 return; 586 587 clear_bit(key->hw_key_idx, common->keymap); |
588 clear_bit(key->hw_key_idx, common->ccmp_keymap); |
|
585 if (key->cipher != WLAN_CIPHER_SUITE_TKIP) 586 return; 587 588 clear_bit(key->hw_key_idx + 64, common->keymap); 589 590 clear_bit(key->hw_key_idx, common->tkip_keymap); 591 clear_bit(key->hw_key_idx + 64, common->tkip_keymap); 592 593 if (!(common->crypt_caps & ATH_CRYPT_CAP_MIC_COMBINED)) { 594 ath_hw_keyreset(common, key->hw_key_idx + 32); 595 clear_bit(key->hw_key_idx + 32, common->keymap); 596 clear_bit(key->hw_key_idx + 64 + 32, common->keymap); 597 598 clear_bit(key->hw_key_idx + 32, common->tkip_keymap); 599 clear_bit(key->hw_key_idx + 64 + 32, common->tkip_keymap); 600 } 601} 602EXPORT_SYMBOL(ath_key_delete); | 589 if (key->cipher != WLAN_CIPHER_SUITE_TKIP) 590 return; 591 592 clear_bit(key->hw_key_idx + 64, common->keymap); 593 594 clear_bit(key->hw_key_idx, common->tkip_keymap); 595 clear_bit(key->hw_key_idx + 64, common->tkip_keymap); 596 597 if (!(common->crypt_caps & ATH_CRYPT_CAP_MIC_COMBINED)) { 598 ath_hw_keyreset(common, key->hw_key_idx + 32); 599 clear_bit(key->hw_key_idx + 32, common->keymap); 600 clear_bit(key->hw_key_idx + 64 + 32, common->keymap); 601 602 clear_bit(key->hw_key_idx + 32, common->tkip_keymap); 603 clear_bit(key->hw_key_idx + 64 + 32, common->tkip_keymap); 604 } 605} 606EXPORT_SYMBOL(ath_key_delete); |