ath9k: check for Rx-STBC flag and pass it to ieee80211
authorOleksij Rempel <linux@rempel-privat.de>
Fri, 24 May 2013 18:30:59 +0000 (20:30 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 30 May 2013 18:42:35 +0000 (14:42 -0400)
This patch make use of STBC flag in DMA RX descriptor.
Only devices after ar9280 can provide this information.

If card support it we will set HAVE_STBC flag, to show
clint programm thet STBC is supported but not received.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/init.c
drivers/net/wireless/ath/ath9k/mac.c
drivers/net/wireless/ath/ath9k/mac.h

index c7b888f227030c3ef1357ea22eb694e43cdc7d09..0536d442b0682950d3b5aa2d7aeeda2e8c8b1cc4 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/ath9k_platform.h>
 #include <linux/module.h>
 #include <linux/relay.h>
+#include <net/ieee80211_radiotap.h>
 
 #include "ath9k.h"
 
@@ -766,8 +767,13 @@ void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw)
                IEEE80211_HW_REPORTS_TX_ACK_STATUS |
                IEEE80211_HW_SUPPORTS_RC_TABLE;
 
-       if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_HT)
-                hw->flags |= IEEE80211_HW_AMPDU_AGGREGATION;
+       if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_HT) {
+               hw->flags |= IEEE80211_HW_AMPDU_AGGREGATION;
+
+               if (AR_SREV_9280_20_OR_LATER(ah))
+                       hw->radiotap_mcs_details |=
+                               IEEE80211_RADIOTAP_MCS_HAVE_STBC;
+       }
 
        if (AR_SREV_9160_10_OR_LATER(sc->sc_ah) || ath9k_modparam_nohwcrypt)
                hw->flags |= IEEE80211_HW_MFP_CAPABLE;
index a52081d73befdc9395eddb92ed6ed6a360d3652e..d055e389abfc80d7a7b156a58ba0aa29ca9f1945 100644 (file)
@@ -593,6 +593,11 @@ int ath9k_hw_rxprocdesc(struct ath_hw *ah, struct ath_desc *ds,
                (ads.ds_rxstatus3 & AR_GI) ? RX_FLAG_SHORT_GI : 0;
        rs->flag |=
                (ads.ds_rxstatus3 & AR_2040) ? RX_FLAG_40MHZ : 0;
+       if (AR_SREV_9280_20_OR_LATER(ah))
+               rs->flag |=
+                       (ads.ds_rxstatus3 & AR_STBC) ?
+                               /* we can only Nss=1 STBC */
+                               (1 << RX_FLAG_STBC_SHIFT) : 0;
 
        if (ads.ds_rxstatus8 & AR_PreDelimCRCErr)
                rs->rs_flags |= ATH9K_RX_DELIM_CRC_PRE;
index 3f1e7754a1a764a4c6d1fcd5563182541ac4fedb..b02dfce964b4d82f952aaba959e9fcac5fbfe19c 100644 (file)
@@ -534,7 +534,8 @@ struct ar5416_desc {
 #define AR_2040             0x00000002
 #define AR_Parallel40       0x00000004
 #define AR_Parallel40_S     2
-#define AR_RxStatusRsvd30   0x000000f8
+#define AR_STBC             0x00000008 /* on ar9280 and later */
+#define AR_RxStatusRsvd30   0x000000f0
 #define AR_RxAntenna       0xffffff00
 #define AR_RxAntenna_S     8