blob: 3a4769506ce301cfad9f5b3ef302b51bf662cc91 [file] [log] [blame]
Bruno Randolf1bba5b72010-09-08 16:04:38 +09001/*
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 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */
17
18#include <asm/unaligned.h>
19#include <net/mac80211.h>
20
21#include "ath.h"
22#include "reg.h"
23#include "debug.h"
24
25#define REG_READ (common->ops->read)
26#define REG_WRITE(_ah, _reg, _val) (common->ops->write)(_ah, _val, _reg)
27
28#define IEEE80211_WEP_NKID 4 /* number of key ids */
29
30/************************/
31/* Key Cache Management */
32/************************/
33
34bool ath_hw_keyreset(struct ath_common *common, u16 entry)
35{
36 u32 keyType;
37 void *ah = common->ah;
38
39 if (entry >= common->keymax) {
Joe Perches38002762010-12-02 19:12:36 -080040 ath_err(common, "keycache entry %u out of range\n", entry);
Bruno Randolf1bba5b72010-09-08 16:04:38 +090041 return false;
42 }
43
44 keyType = REG_READ(ah, AR_KEYTABLE_TYPE(entry));
45
46 REG_WRITE(ah, AR_KEYTABLE_KEY0(entry), 0);
47 REG_WRITE(ah, AR_KEYTABLE_KEY1(entry), 0);
48 REG_WRITE(ah, AR_KEYTABLE_KEY2(entry), 0);
49 REG_WRITE(ah, AR_KEYTABLE_KEY3(entry), 0);
50 REG_WRITE(ah, AR_KEYTABLE_KEY4(entry), 0);
51 REG_WRITE(ah, AR_KEYTABLE_TYPE(entry), AR_KEYTABLE_TYPE_CLR);
52 REG_WRITE(ah, AR_KEYTABLE_MAC0(entry), 0);
53 REG_WRITE(ah, AR_KEYTABLE_MAC1(entry), 0);
54
55 if (keyType == AR_KEYTABLE_TYPE_TKIP) {
56 u16 micentry = entry + 64;
57
58 REG_WRITE(ah, AR_KEYTABLE_KEY0(micentry), 0);
59 REG_WRITE(ah, AR_KEYTABLE_KEY1(micentry), 0);
60 REG_WRITE(ah, AR_KEYTABLE_KEY2(micentry), 0);
61 REG_WRITE(ah, AR_KEYTABLE_KEY3(micentry), 0);
62
63 }
64
65 return true;
66}
67EXPORT_SYMBOL(ath_hw_keyreset);
68
Luis R. Rodrigueza3685d12010-10-20 06:59:36 -070069static bool ath_hw_keysetmac(struct ath_common *common,
70 u16 entry, const u8 *mac)
Bruno Randolf1bba5b72010-09-08 16:04:38 +090071{
72 u32 macHi, macLo;
73 u32 unicast_flag = AR_KEYTABLE_VALID;
74 void *ah = common->ah;
75
76 if (entry >= common->keymax) {
Joe Perches38002762010-12-02 19:12:36 -080077 ath_err(common, "keycache entry %u out of range\n", entry);
Bruno Randolf1bba5b72010-09-08 16:04:38 +090078 return false;
79 }
80
81 if (mac != NULL) {
82 /*
83 * AR_KEYTABLE_VALID indicates that the address is a unicast
84 * address, which must match the transmitter address for
85 * decrypting frames.
86 * Not setting this bit allows the hardware to use the key
87 * for multicast frame decryption.
88 */
89 if (mac[0] & 0x01)
90 unicast_flag = 0;
91
92 macHi = (mac[5] << 8) | mac[4];
93 macLo = (mac[3] << 24) |
94 (mac[2] << 16) |
95 (mac[1] << 8) |
96 mac[0];
97 macLo >>= 1;
98 macLo |= (macHi & 1) << 31;
99 macHi >>= 1;
100 } else {
101 macLo = macHi = 0;
102 }
103 REG_WRITE(ah, AR_KEYTABLE_MAC0(entry), macLo);
104 REG_WRITE(ah, AR_KEYTABLE_MAC1(entry), macHi | unicast_flag);
105
106 return true;
107}
108
Luis R. Rodriguezf8c2a082010-10-20 06:59:37 -0700109static bool ath_hw_set_keycache_entry(struct ath_common *common, u16 entry,
110 const struct ath_keyval *k,
111 const u8 *mac)
Bruno Randolf1bba5b72010-09-08 16:04:38 +0900112{
113 void *ah = common->ah;
114 u32 key0, key1, key2, key3, key4;
115 u32 keyType;
116
117 if (entry >= common->keymax) {
Joe Perches38002762010-12-02 19:12:36 -0800118 ath_err(common, "keycache entry %u out of range\n", entry);
Bruno Randolf1bba5b72010-09-08 16:04:38 +0900119 return false;
120 }
121
122 switch (k->kv_type) {
123 case ATH_CIPHER_AES_OCB:
124 keyType = AR_KEYTABLE_TYPE_AES;
125 break;
126 case ATH_CIPHER_AES_CCM:
127 if (!(common->crypt_caps & ATH_CRYPT_CAP_CIPHER_AESCCM)) {
128 ath_print(common, ATH_DBG_ANY,
129 "AES-CCM not supported by this mac rev\n");
130 return false;
131 }
132 keyType = AR_KEYTABLE_TYPE_CCM;
133 break;
134 case ATH_CIPHER_TKIP:
135 keyType = AR_KEYTABLE_TYPE_TKIP;
136 if (entry + 64 >= common->keymax) {
137 ath_print(common, ATH_DBG_ANY,
138 "entry %u inappropriate for TKIP\n", entry);
139 return false;
140 }
141 break;
142 case ATH_CIPHER_WEP:
143 if (k->kv_len < WLAN_KEY_LEN_WEP40) {
144 ath_print(common, ATH_DBG_ANY,
145 "WEP key length %u too small\n", k->kv_len);
146 return false;
147 }
148 if (k->kv_len <= WLAN_KEY_LEN_WEP40)
149 keyType = AR_KEYTABLE_TYPE_40;
150 else if (k->kv_len <= WLAN_KEY_LEN_WEP104)
151 keyType = AR_KEYTABLE_TYPE_104;
152 else
153 keyType = AR_KEYTABLE_TYPE_128;
154 break;
155 case ATH_CIPHER_CLR:
156 keyType = AR_KEYTABLE_TYPE_CLR;
157 break;
158 default:
Joe Perches38002762010-12-02 19:12:36 -0800159 ath_err(common, "cipher %u not supported\n", k->kv_type);
Bruno Randolf1bba5b72010-09-08 16:04:38 +0900160 return false;
161 }
162
163 key0 = get_unaligned_le32(k->kv_val + 0);
164 key1 = get_unaligned_le16(k->kv_val + 4);
165 key2 = get_unaligned_le32(k->kv_val + 6);
166 key3 = get_unaligned_le16(k->kv_val + 10);
167 key4 = get_unaligned_le32(k->kv_val + 12);
168 if (k->kv_len <= WLAN_KEY_LEN_WEP104)
169 key4 &= 0xff;
170
171 /*
172 * Note: Key cache registers access special memory area that requires
173 * two 32-bit writes to actually update the values in the internal
174 * memory. Consequently, the exact order and pairs used here must be
175 * maintained.
176 */
177
178 if (keyType == AR_KEYTABLE_TYPE_TKIP) {
179 u16 micentry = entry + 64;
180
181 /*
182 * Write inverted key[47:0] first to avoid Michael MIC errors
183 * on frames that could be sent or received at the same time.
184 * The correct key will be written in the end once everything
185 * else is ready.
186 */
187 REG_WRITE(ah, AR_KEYTABLE_KEY0(entry), ~key0);
188 REG_WRITE(ah, AR_KEYTABLE_KEY1(entry), ~key1);
189
190 /* Write key[95:48] */
191 REG_WRITE(ah, AR_KEYTABLE_KEY2(entry), key2);
192 REG_WRITE(ah, AR_KEYTABLE_KEY3(entry), key3);
193
194 /* Write key[127:96] and key type */
195 REG_WRITE(ah, AR_KEYTABLE_KEY4(entry), key4);
196 REG_WRITE(ah, AR_KEYTABLE_TYPE(entry), keyType);
197
198 /* Write MAC address for the entry */
199 (void) ath_hw_keysetmac(common, entry, mac);
200
Bruno Randolf117675d2010-09-08 16:04:54 +0900201 if (common->crypt_caps & ATH_CRYPT_CAP_MIC_COMBINED) {
Bruno Randolf1bba5b72010-09-08 16:04:38 +0900202 /*
203 * TKIP uses two key cache entries:
204 * Michael MIC TX/RX keys in the same key cache entry
205 * (idx = main index + 64):
206 * key0 [31:0] = RX key [31:0]
207 * key1 [15:0] = TX key [31:16]
208 * key1 [31:16] = reserved
209 * key2 [31:0] = RX key [63:32]
210 * key3 [15:0] = TX key [15:0]
211 * key3 [31:16] = reserved
212 * key4 [31:0] = TX key [63:32]
213 */
214 u32 mic0, mic1, mic2, mic3, mic4;
215
216 mic0 = get_unaligned_le32(k->kv_mic + 0);
217 mic2 = get_unaligned_le32(k->kv_mic + 4);
218 mic1 = get_unaligned_le16(k->kv_txmic + 2) & 0xffff;
219 mic3 = get_unaligned_le16(k->kv_txmic + 0) & 0xffff;
220 mic4 = get_unaligned_le32(k->kv_txmic + 4);
221
222 /* Write RX[31:0] and TX[31:16] */
223 REG_WRITE(ah, AR_KEYTABLE_KEY0(micentry), mic0);
224 REG_WRITE(ah, AR_KEYTABLE_KEY1(micentry), mic1);
225
226 /* Write RX[63:32] and TX[15:0] */
227 REG_WRITE(ah, AR_KEYTABLE_KEY2(micentry), mic2);
228 REG_WRITE(ah, AR_KEYTABLE_KEY3(micentry), mic3);
229
230 /* Write TX[63:32] and keyType(reserved) */
231 REG_WRITE(ah, AR_KEYTABLE_KEY4(micentry), mic4);
232 REG_WRITE(ah, AR_KEYTABLE_TYPE(micentry),
233 AR_KEYTABLE_TYPE_CLR);
234
235 } else {
236 /*
237 * TKIP uses four key cache entries (two for group
238 * keys):
239 * Michael MIC TX/RX keys are in different key cache
240 * entries (idx = main index + 64 for TX and
241 * main index + 32 + 96 for RX):
242 * key0 [31:0] = TX/RX MIC key [31:0]
243 * key1 [31:0] = reserved
244 * key2 [31:0] = TX/RX MIC key [63:32]
245 * key3 [31:0] = reserved
246 * key4 [31:0] = reserved
247 *
248 * Upper layer code will call this function separately
249 * for TX and RX keys when these registers offsets are
250 * used.
251 */
252 u32 mic0, mic2;
253
254 mic0 = get_unaligned_le32(k->kv_mic + 0);
255 mic2 = get_unaligned_le32(k->kv_mic + 4);
256
257 /* Write MIC key[31:0] */
258 REG_WRITE(ah, AR_KEYTABLE_KEY0(micentry), mic0);
259 REG_WRITE(ah, AR_KEYTABLE_KEY1(micentry), 0);
260
261 /* Write MIC key[63:32] */
262 REG_WRITE(ah, AR_KEYTABLE_KEY2(micentry), mic2);
263 REG_WRITE(ah, AR_KEYTABLE_KEY3(micentry), 0);
264
265 /* Write TX[63:32] and keyType(reserved) */
266 REG_WRITE(ah, AR_KEYTABLE_KEY4(micentry), 0);
267 REG_WRITE(ah, AR_KEYTABLE_TYPE(micentry),
268 AR_KEYTABLE_TYPE_CLR);
269 }
270
271 /* MAC address registers are reserved for the MIC entry */
272 REG_WRITE(ah, AR_KEYTABLE_MAC0(micentry), 0);
273 REG_WRITE(ah, AR_KEYTABLE_MAC1(micentry), 0);
274
275 /*
276 * Write the correct (un-inverted) key[47:0] last to enable
277 * TKIP now that all other registers are set with correct
278 * values.
279 */
280 REG_WRITE(ah, AR_KEYTABLE_KEY0(entry), key0);
281 REG_WRITE(ah, AR_KEYTABLE_KEY1(entry), key1);
282 } else {
283 /* Write key[47:0] */
284 REG_WRITE(ah, AR_KEYTABLE_KEY0(entry), key0);
285 REG_WRITE(ah, AR_KEYTABLE_KEY1(entry), key1);
286
287 /* Write key[95:48] */
288 REG_WRITE(ah, AR_KEYTABLE_KEY2(entry), key2);
289 REG_WRITE(ah, AR_KEYTABLE_KEY3(entry), key3);
290
291 /* Write key[127:96] and key type */
292 REG_WRITE(ah, AR_KEYTABLE_KEY4(entry), key4);
293 REG_WRITE(ah, AR_KEYTABLE_TYPE(entry), keyType);
294
295 /* Write MAC address for the entry */
296 (void) ath_hw_keysetmac(common, entry, mac);
297 }
298
299 return true;
300}
301
302static int ath_setkey_tkip(struct ath_common *common, u16 keyix, const u8 *key,
303 struct ath_keyval *hk, const u8 *addr,
304 bool authenticator)
305{
306 const u8 *key_rxmic;
307 const u8 *key_txmic;
308
309 key_txmic = key + NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY;
310 key_rxmic = key + NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY;
311
312 if (addr == NULL) {
313 /*
314 * Group key installation - only two key cache entries are used
315 * regardless of splitmic capability since group key is only
316 * used either for TX or RX.
317 */
318 if (authenticator) {
319 memcpy(hk->kv_mic, key_txmic, sizeof(hk->kv_mic));
320 memcpy(hk->kv_txmic, key_txmic, sizeof(hk->kv_mic));
321 } else {
322 memcpy(hk->kv_mic, key_rxmic, sizeof(hk->kv_mic));
323 memcpy(hk->kv_txmic, key_rxmic, sizeof(hk->kv_mic));
324 }
325 return ath_hw_set_keycache_entry(common, keyix, hk, addr);
326 }
Bruno Randolf117675d2010-09-08 16:04:54 +0900327 if (common->crypt_caps & ATH_CRYPT_CAP_MIC_COMBINED) {
Bruno Randolf1bba5b72010-09-08 16:04:38 +0900328 /* TX and RX keys share the same key cache entry. */
329 memcpy(hk->kv_mic, key_rxmic, sizeof(hk->kv_mic));
330 memcpy(hk->kv_txmic, key_txmic, sizeof(hk->kv_txmic));
331 return ath_hw_set_keycache_entry(common, keyix, hk, addr);
332 }
333
334 /* Separate key cache entries for TX and RX */
335
336 /* TX key goes at first index, RX key at +32. */
337 memcpy(hk->kv_mic, key_txmic, sizeof(hk->kv_mic));
338 if (!ath_hw_set_keycache_entry(common, keyix, hk, NULL)) {
339 /* TX MIC entry failed. No need to proceed further */
Joe Perches38002762010-12-02 19:12:36 -0800340 ath_err(common, "Setting TX MIC Key Failed\n");
Bruno Randolf1bba5b72010-09-08 16:04:38 +0900341 return 0;
342 }
343
344 memcpy(hk->kv_mic, key_rxmic, sizeof(hk->kv_mic));
345 /* XXX delete tx key on failure? */
346 return ath_hw_set_keycache_entry(common, keyix + 32, hk, addr);
347}
348
349static int ath_reserve_key_cache_slot_tkip(struct ath_common *common)
350{
351 int i;
352
353 for (i = IEEE80211_WEP_NKID; i < common->keymax / 2; i++) {
354 if (test_bit(i, common->keymap) ||
355 test_bit(i + 64, common->keymap))
356 continue; /* At least one part of TKIP key allocated */
Bruno Randolf117675d2010-09-08 16:04:54 +0900357 if (!(common->crypt_caps & ATH_CRYPT_CAP_MIC_COMBINED) &&
Bruno Randolf1bba5b72010-09-08 16:04:38 +0900358 (test_bit(i + 32, common->keymap) ||
359 test_bit(i + 64 + 32, common->keymap)))
360 continue; /* At least one part of TKIP key allocated */
361
362 /* Found a free slot for a TKIP key */
363 return i;
364 }
365 return -1;
366}
367
368static int ath_reserve_key_cache_slot(struct ath_common *common,
369 u32 cipher)
370{
371 int i;
372
373 if (cipher == WLAN_CIPHER_SUITE_TKIP)
374 return ath_reserve_key_cache_slot_tkip(common);
375
376 /* First, try to find slots that would not be available for TKIP. */
Bruno Randolf117675d2010-09-08 16:04:54 +0900377 if (!(common->crypt_caps & ATH_CRYPT_CAP_MIC_COMBINED)) {
Bruno Randolf1bba5b72010-09-08 16:04:38 +0900378 for (i = IEEE80211_WEP_NKID; i < common->keymax / 4; i++) {
379 if (!test_bit(i, common->keymap) &&
380 (test_bit(i + 32, common->keymap) ||
381 test_bit(i + 64, common->keymap) ||
382 test_bit(i + 64 + 32, common->keymap)))
383 return i;
384 if (!test_bit(i + 32, common->keymap) &&
385 (test_bit(i, common->keymap) ||
386 test_bit(i + 64, common->keymap) ||
387 test_bit(i + 64 + 32, common->keymap)))
388 return i + 32;
389 if (!test_bit(i + 64, common->keymap) &&
390 (test_bit(i , common->keymap) ||
391 test_bit(i + 32, common->keymap) ||
392 test_bit(i + 64 + 32, common->keymap)))
393 return i + 64;
394 if (!test_bit(i + 64 + 32, common->keymap) &&
395 (test_bit(i, common->keymap) ||
396 test_bit(i + 32, common->keymap) ||
397 test_bit(i + 64, common->keymap)))
398 return i + 64 + 32;
399 }
400 } else {
401 for (i = IEEE80211_WEP_NKID; i < common->keymax / 2; i++) {
402 if (!test_bit(i, common->keymap) &&
403 test_bit(i + 64, common->keymap))
404 return i;
405 if (test_bit(i, common->keymap) &&
406 !test_bit(i + 64, common->keymap))
407 return i + 64;
408 }
409 }
410
411 /* No partially used TKIP slots, pick any available slot */
412 for (i = IEEE80211_WEP_NKID; i < common->keymax; i++) {
413 /* Do not allow slots that could be needed for TKIP group keys
414 * to be used. This limitation could be removed if we know that
415 * TKIP will not be used. */
416 if (i >= 64 && i < 64 + IEEE80211_WEP_NKID)
417 continue;
Bruno Randolf117675d2010-09-08 16:04:54 +0900418 if (!(common->crypt_caps & ATH_CRYPT_CAP_MIC_COMBINED)) {
Bruno Randolf1bba5b72010-09-08 16:04:38 +0900419 if (i >= 32 && i < 32 + IEEE80211_WEP_NKID)
420 continue;
421 if (i >= 64 + 32 && i < 64 + 32 + IEEE80211_WEP_NKID)
422 continue;
423 }
424
425 if (!test_bit(i, common->keymap))
426 return i; /* Found a free slot for a key */
427 }
428
429 /* No free slot found */
430 return -1;
431}
432
433/*
434 * Configure encryption in the HW.
435 */
436int ath_key_config(struct ath_common *common,
437 struct ieee80211_vif *vif,
438 struct ieee80211_sta *sta,
439 struct ieee80211_key_conf *key)
440{
441 struct ath_keyval hk;
442 const u8 *mac = NULL;
443 u8 gmac[ETH_ALEN];
444 int ret = 0;
445 int idx;
446
447 memset(&hk, 0, sizeof(hk));
448
449 switch (key->cipher) {
450 case WLAN_CIPHER_SUITE_WEP40:
451 case WLAN_CIPHER_SUITE_WEP104:
452 hk.kv_type = ATH_CIPHER_WEP;
453 break;
454 case WLAN_CIPHER_SUITE_TKIP:
455 hk.kv_type = ATH_CIPHER_TKIP;
456 break;
457 case WLAN_CIPHER_SUITE_CCMP:
458 hk.kv_type = ATH_CIPHER_AES_CCM;
459 break;
460 default:
461 return -EOPNOTSUPP;
462 }
463
464 hk.kv_len = key->keylen;
465 memcpy(hk.kv_val, key->key, key->keylen);
466
467 if (!(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) {
468 switch (vif->type) {
469 case NL80211_IFTYPE_AP:
470 memcpy(gmac, vif->addr, ETH_ALEN);
471 gmac[0] |= 0x01;
472 mac = gmac;
473 idx = ath_reserve_key_cache_slot(common, key->cipher);
474 break;
475 case NL80211_IFTYPE_ADHOC:
476 if (!sta) {
477 idx = key->keyidx;
478 break;
479 }
480 memcpy(gmac, sta->addr, ETH_ALEN);
481 gmac[0] |= 0x01;
482 mac = gmac;
483 idx = ath_reserve_key_cache_slot(common, key->cipher);
484 break;
485 default:
486 idx = key->keyidx;
487 break;
488 }
489 } else if (key->keyidx) {
490 if (WARN_ON(!sta))
491 return -EOPNOTSUPP;
492 mac = sta->addr;
493
494 if (vif->type != NL80211_IFTYPE_AP) {
495 /* Only keyidx 0 should be used with unicast key, but
496 * allow this for client mode for now. */
497 idx = key->keyidx;
498 } else
499 return -EIO;
500 } else {
501 if (WARN_ON(!sta))
502 return -EOPNOTSUPP;
503 mac = sta->addr;
504
505 idx = ath_reserve_key_cache_slot(common, key->cipher);
506 }
507
508 if (idx < 0)
509 return -ENOSPC; /* no free key cache entries */
510
511 if (key->cipher == WLAN_CIPHER_SUITE_TKIP)
512 ret = ath_setkey_tkip(common, idx, key->key, &hk, mac,
513 vif->type == NL80211_IFTYPE_AP);
514 else
515 ret = ath_hw_set_keycache_entry(common, idx, &hk, mac);
516
517 if (!ret)
518 return -EIO;
519
520 set_bit(idx, common->keymap);
521 if (key->cipher == WLAN_CIPHER_SUITE_TKIP) {
522 set_bit(idx + 64, common->keymap);
523 set_bit(idx, common->tkip_keymap);
524 set_bit(idx + 64, common->tkip_keymap);
Bruno Randolf117675d2010-09-08 16:04:54 +0900525 if (!(common->crypt_caps & ATH_CRYPT_CAP_MIC_COMBINED)) {
Bruno Randolf1bba5b72010-09-08 16:04:38 +0900526 set_bit(idx + 32, common->keymap);
527 set_bit(idx + 64 + 32, common->keymap);
528 set_bit(idx + 32, common->tkip_keymap);
529 set_bit(idx + 64 + 32, common->tkip_keymap);
530 }
531 }
532
533 return idx;
534}
535EXPORT_SYMBOL(ath_key_config);
536
537/*
538 * Delete Key.
539 */
540void ath_key_delete(struct ath_common *common, struct ieee80211_key_conf *key)
541{
542 ath_hw_keyreset(common, key->hw_key_idx);
543 if (key->hw_key_idx < IEEE80211_WEP_NKID)
544 return;
545
546 clear_bit(key->hw_key_idx, common->keymap);
547 if (key->cipher != WLAN_CIPHER_SUITE_TKIP)
548 return;
549
550 clear_bit(key->hw_key_idx + 64, common->keymap);
551
552 clear_bit(key->hw_key_idx, common->tkip_keymap);
553 clear_bit(key->hw_key_idx + 64, common->tkip_keymap);
554
Bruno Randolf117675d2010-09-08 16:04:54 +0900555 if (!(common->crypt_caps & ATH_CRYPT_CAP_MIC_COMBINED)) {
Bruno Randolf1bba5b72010-09-08 16:04:38 +0900556 ath_hw_keyreset(common, key->hw_key_idx + 32);
557 clear_bit(key->hw_key_idx + 32, common->keymap);
558 clear_bit(key->hw_key_idx + 64 + 32, common->keymap);
559
560 clear_bit(key->hw_key_idx + 32, common->tkip_keymap);
561 clear_bit(key->hw_key_idx + 64 + 32, common->tkip_keymap);
562 }
563}
564EXPORT_SYMBOL(ath_key_delete);