From patchwork Wed Nov 10 12:23:46 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Natarajan X-Patchwork-Id: 313842 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 oAACO426008790 for ; Wed, 10 Nov 2010 12:24:04 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755795Ab0KJMYD (ORCPT ); Wed, 10 Nov 2010 07:24:03 -0500 Received: from mail.atheros.com ([12.19.149.2]:25294 "EHLO mail.atheros.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755761Ab0KJMYB (ORCPT ); Wed, 10 Nov 2010 07:24:01 -0500 Received: from mail.atheros.com ([10.10.20.108]) by sidewinder.atheros.com for ; Wed, 10 Nov 2010 04:23:48 -0800 Received: from smtp.atheros.com (10.12.4.60) by SC1EXHC-02.global.atheros.com (10.10.20.106) with Microsoft SMTP Server (TLS) id 8.2.213.0; Wed, 10 Nov 2010 04:23:59 -0800 Received: by smtp.atheros.com (sSMTP sendmail emulation); Wed, 10 Nov 2010 17:53:55 +0530 From: Vivek Natarajan To: Subject: [RFC 2/5] ath: Add a keycache entry if beamforming is enabled. Date: Wed, 10 Nov 2010 17:53:46 +0530 Message-ID: <1289391829-8577-2-git-send-email-vnatarajan@atheros.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1289391829-8577-1-git-send-email-vnatarajan@atheros.com> References: <1289391829-8577-1-git-send-email-vnatarajan@atheros.com> MIME-Version: 1.0 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.3 (demeter1.kernel.org [140.211.167.41]); Wed, 10 Nov 2010 12:24:04 +0000 (UTC) diff --git a/drivers/net/wireless/ath/ath.h b/drivers/net/wireless/ath/ath.h index 501050c..214a25f 100644 --- a/drivers/net/wireless/ath/ath.h +++ b/drivers/net/wireless/ath/ath.h @@ -177,5 +177,7 @@ int ath_key_config(struct ath_common *common, bool ath_hw_keyreset(struct ath_common *common, u16 entry); void ath_hw_cycle_counters_update(struct ath_common *common); int32_t ath_hw_get_listen_time(struct ath_common *common); +int ath_txbf_key_config(struct ath_common *common, + struct ieee80211_sta *sta); #endif /* ATH_H */ diff --git a/drivers/net/wireless/ath/key.c b/drivers/net/wireless/ath/key.c index 62e3dac..11f562e 100644 --- a/drivers/net/wireless/ath/key.c +++ b/drivers/net/wireless/ath/key.c @@ -115,6 +115,7 @@ static bool ath_hw_set_keycache_entry(struct ath_common *common, u16 entry, void *ah = common->ah; u32 key0, key1, key2, key3, key4; u32 keyType; + u32 txbf = 0; if (entry >= common->keymax) { ath_print(common, ATH_DBG_FATAL, @@ -199,6 +200,9 @@ static bool ath_hw_set_keycache_entry(struct ath_common *common, u16 entry, REG_WRITE(ah, AR_KEYTABLE_KEY4(entry), key4); REG_WRITE(ah, AR_KEYTABLE_TYPE(entry), keyType); + REG_WRITE(ah, AR_KEYTABLE_TYPE(entry), + keyType | txbf); + /* Write MAC address for the entry */ (void) ath_hw_keysetmac(common, entry, mac); @@ -435,6 +439,31 @@ static int ath_reserve_key_cache_slot(struct ath_common *common, return -1; } +int ath_txbf_key_config(struct ath_common *common, struct ieee80211_sta *sta) +{ + int idx, ret; + struct ath_keyval hk; + + if (WARN_ON(!sta)) + return -EOPNOTSUPP; + + memset(&hk, 0, sizeof(hk)); + hk.kv_type = ATH_CIPHER_CLR; + + idx = ath_reserve_key_cache_slot(common, 0); + + if (idx < 0) + return -ENOSPC; + + ret = ath_hw_set_keycache_entry(common, idx, &hk, sta->addr); + + if (!ret) + return -EIO; + + return idx; +} +EXPORT_SYMBOL(ath_txbf_key_config); + /* * Configure encryption in the HW. */