Search Linux Wireless

[RFC 2/5] ath: Add a keycache entry if beamforming is enabled.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Keycache entry for a sta has the details of the negotiated
beamforming parameters which is to be used by the hardware
while trasmitting to that specific sta.

Signed-off-by: Vivek Natarajan <vnatarajan@xxxxxxxxxxx>
---
 drivers/net/wireless/ath/ath.h |    2 ++
 drivers/net/wireless/ath/key.c |   29 +++++++++++++++++++++++++++++
 2 files changed, 31 insertions(+), 0 deletions(-)

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.
  */
-- 
1.6.3.3

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux