aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/key.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-04-17 17:28:10 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-04-19 15:38:06 -0400
commit93ae2dd2230393566738a5f211ffbaa33b056d56 (patch)
tree7dc59fdc6e07d2919b16e2def11258c2caa5d615 /drivers/net/wireless/ath/key.c
parent5519541d5a5f19893546883547e2f0f2e5934df7 (diff)
ath9k: assign keycache slots to unencrypted stations
Frame filtering relies on having a valid destination index (keycache slot), to keep track of the destination. Assigning a keycache slot (configured to unencrypted, with no key data attached) improves powersave handling in AP mode with no encryption. The dummy keycache entry for a station is cleared, when a real key gets added. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/key.c')
-rw-r--r--drivers/net/wireless/ath/key.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/key.c b/drivers/net/wireless/ath/key.c
index 0d4f39cbdcab..a61ef3d6d89c 100644
--- a/drivers/net/wireless/ath/key.c
+++ b/drivers/net/wireless/ath/key.c
@@ -483,6 +483,9 @@ int ath_key_config(struct ath_common *common,
483 memset(&hk, 0, sizeof(hk)); 483 memset(&hk, 0, sizeof(hk));
484 484
485 switch (key->cipher) { 485 switch (key->cipher) {
486 case 0:
487 hk.kv_type = ATH_CIPHER_CLR;
488 break;
486 case WLAN_CIPHER_SUITE_WEP40: 489 case WLAN_CIPHER_SUITE_WEP40:
487 case WLAN_CIPHER_SUITE_WEP104: 490 case WLAN_CIPHER_SUITE_WEP104:
488 hk.kv_type = ATH_CIPHER_WEP; 491 hk.kv_type = ATH_CIPHER_WEP;
@@ -498,7 +501,8 @@ int ath_key_config(struct ath_common *common,
498 } 501 }
499 502
500 hk.kv_len = key->keylen; 503 hk.kv_len = key->keylen;
501 memcpy(hk.kv_val, key->key, key->keylen); 504 if (key->keylen)
505 memcpy(hk.kv_val, key->key, key->keylen);
502 506
503 if (!(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) { 507 if (!(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) {
504 switch (vif->type) { 508 switch (vif->type) {