From patchwork Tue Jan 25 04:15:49 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruno Randolf X-Patchwork-Id: 504051 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p0P4FrHc001632 for ; Tue, 25 Jan 2011 04:15:53 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752960Ab1AYEPv (ORCPT ); Mon, 24 Jan 2011 23:15:51 -0500 Received: from mail30s.wh2.ocn.ne.jp ([125.206.180.198]:29905 "HELO mail30s.wh2.ocn.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752908Ab1AYEPv (ORCPT ); Mon, 24 Jan 2011 23:15:51 -0500 Received: from vs3006.wh2.ocn.ne.jp (125.206.180.169) by mail30s.wh2.ocn.ne.jp (RS ver 1.0.95vs) with SMTP id 2-0372278950 for ; Tue, 25 Jan 2011 13:15:50 +0900 (JST) Received: (qmail 7513 invoked from network); 25 Jan 2011 04:15:49 -0000 Received: from unknown (HELO localhost6.localdomain6) (220.110.201.18) by with SMTP; 25 Jan 2011 04:15:49 -0000 Subject: [PATCH 6/6] ath: Fix WEP hardware encryption To: linville@tuxdriver.com From: Bruno Randolf Cc: ath5k-devel@venema.h4ckr.net, linux-wireless@vger.kernel.org Date: Tue, 25 Jan 2011 13:15:49 +0900 Message-ID: <20110125041549.6944.15800.stgit@localhost6.localdomain6> In-Reply-To: <20110125041522.6944.22566.stgit@localhost6.localdomain6> References: <20110125041522.6944.22566.stgit@localhost6.localdomain6> User-Agent: StGit/0.15 MIME-Version: 1.0 X-SF-Loop: 1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 25 Jan 2011 04:15:53 +0000 (UTC) diff --git a/drivers/net/wireless/ath/key.c b/drivers/net/wireless/ath/key.c index 5d465e5..5748dae 100644 --- a/drivers/net/wireless/ath/key.c +++ b/drivers/net/wireless/ath/key.c @@ -465,6 +465,16 @@ int ath_key_config(struct ath_common *common, hk.kv_len = key->keylen; memcpy(hk.kv_val, key->key, key->keylen); + /* set WEP keys directly to index */ + if ((key->cipher == WLAN_CIPHER_SUITE_WEP40 || + key->cipher == WLAN_CIPHER_SUITE_WEP104) && key->keyidx < 4) { + ret = ath_hw_set_keycache_entry(common, key->keyidx, &hk, NULL); + if (!ret) + return -EIO; + set_bit(key->keyidx, common->keymap); + return key->keyidx; + } + if (!(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) { switch (vif->type) { case NL80211_IFTYPE_AP: @@ -541,10 +551,8 @@ EXPORT_SYMBOL(ath_key_config); void ath_key_delete(struct ath_common *common, struct ieee80211_key_conf *key) { ath_hw_keyreset(common, key->hw_key_idx); - if (key->hw_key_idx < IEEE80211_WEP_NKID) - return; - clear_bit(key->hw_key_idx, common->keymap); + if (key->cipher != WLAN_CIPHER_SUITE_TKIP) return;