Skip to contentSkip to conversation

ath9k_htc: add STBC TX support

PATCH New Oleksij Rempel 1 participant 1 message Apr 26, 2013 Qualcomm Atheros ATH9K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath9k_htc: add STBC TX support

current firmware will enable STBC_TX, only if other peer support it. This patch provide ht_peer_caps to firmware.
FW versions 1.3, 1.4 should be able to work with it. Tested on ar7010+ar9280 and ar7010+ar9287.

---
 drivers/net/wireless/ath/ath9k/htc.h          | 2 ++
 drivers/net/wireless/ath/ath9k/htc_drv_init.c | 3 +++
 drivers/net/wireless/ath/ath9k/htc_drv_main.c | 4 ++++
 3 files changed, 9 insertions(+)
drivers/net/wireless/ath/ath9k/htc.h +2 -0
index d3b099d..db4a793 100644
@@ -142,6 +142,8 @@ struct ath9k_htc_target_aggr {
 #define WLAN_RC_40_FLAG  0x02
 #define WLAN_RC_SGI_FLAG 0x04
 #define WLAN_RC_HT_FLAG  0x08
+#define WLAN_RC_TX_STBC_FLAG 0x20 /* TX STBC */
+#define WLAN_RC_RX_STBC_FLAG 0xC0 /* RX STBC ,2 bits */
 
 struct ath9k_htc_rateset {
 	u8 rs_nrates;
drivers/net/wireless/ath/ath9k/htc_drv_init.c +3 -0
index a47f5e0..c79c5ac 100644
@@ -517,6 +517,9 @@ static void setup_ht_cap(struct ath9k_htc_priv *priv,
 	ath_dbg(common, CONFIG, "TX streams %d, RX streams: %d\n",
 		tx_streams, rx_streams);
 
+	if (tx_streams >= 2)
+		ht_info->cap |= IEEE80211_HT_CAP_TX_STBC;
+
 	if (tx_streams != rx_streams) {
 		ht_info->mcs.tx_params |= IEEE80211_HT_MCS_TX_RX_DIFF;
 		ht_info->mcs.tx_params |= ((tx_streams - 1) <<
drivers/net/wireless/ath/ath9k/htc_drv_main.c +4 -0
index 0743a47..af08b4a 100644
@@ -623,6 +623,10 @@ static void ath9k_htc_setup_rate(struct ath9k_htc_priv *priv,
 		trate->rates.ht_rates.rs_nrates = j;
 
 		caps = WLAN_RC_HT_FLAG;
+		if (sta->ht_cap.cap & IEEE80211_HT_CAP_RX_STBC)
+			caps |= WLAN_RC_RX_STBC_FLAG;
+		if (sta->ht_cap.cap & IEEE80211_HT_CAP_TX_STBC)
+			caps |= WLAN_RC_TX_STBC_FLAG;
 		if (sta->ht_cap.mcs.rx_mask[1])
 			caps |= WLAN_RC_DS_FLAG;
 		if ((sta->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) &&
Signature · 1 line
1.8.1.2