iwlwifi: mvm: propagate LDPC / STBC status to radiotap
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Tue, 4 Feb 2014 13:32:43 +0000 (15:32 +0200)
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Thu, 13 Feb 2014 08:27:24 +0000 (10:27 +0200)
This will allow to get sniffer captures with correct
settings for these HT / VHT capabilities.
Also set the corresponding HAVE_MCS / VHT_KNOWN bits in
the registration to mac80211.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
drivers/net/wireless/iwlwifi/mvm/fw-api-rs.h
drivers/net/wireless/iwlwifi/mvm/mac80211.c
drivers/net/wireless/iwlwifi/mvm/rs.c
drivers/net/wireless/iwlwifi/mvm/rx.c

index 85057219cc43ff4c4edbd3e606a9254dae9772e5..39148b5bb33262596e1dea348c1ae32c9a2c9166 100644 (file)
@@ -257,7 +257,8 @@ enum {
 
 /* Bit 17-18: (0) SS, (1) SS*2 */
 #define RATE_MCS_STBC_POS              17
-#define RATE_MCS_STBC_MSK              (1 << RATE_MCS_STBC_POS)
+#define RATE_MCS_HT_STBC_MSK           (3 << RATE_MCS_STBC_POS)
+#define RATE_MCS_VHT_STBC_MSK          (1 << RATE_MCS_STBC_POS)
 
 /* Bit 19: (0) Beamforming is off, (1) Beamforming is on */
 #define RATE_MCS_BF_POS                        19
index 42f70469e73be956fff7902442b49426c1414109..2a1b4b628e2f201a40cafeb1fe81e07d1c65f448 100644 (file)
@@ -68,6 +68,7 @@
 #include <linux/ip.h>
 #include <linux/if_arp.h>
 #include <net/mac80211.h>
+#include <net/ieee80211_radiotap.h>
 #include <net/tcp.h>
 
 #include "iwl-op-mode.h"
@@ -280,6 +281,9 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm)
 
        hw->queues = mvm->first_agg_queue;
        hw->offchannel_tx_hw_queue = IWL_MVM_OFFCHANNEL_QUEUE;
+       hw->radiotap_mcs_details |= IEEE80211_RADIOTAP_MCS_HAVE_FEC |
+                                   IEEE80211_RADIOTAP_MCS_HAVE_STBC;
+       hw->radiotap_vht_details |= IEEE80211_RADIOTAP_VHT_KNOWN_STBC;
        hw->rate_control_algorithm = "iwl-mvm-rs";
 
        /*
index 32bb8075121cdb4eeaaab80ad926fabf5bc7b620..a6d0ab129c6b8b0693e7361e8607f8f71d9b8398 100644 (file)
@@ -2595,7 +2595,7 @@ static int rs_pretty_print_rate(char *buf, const u32 rate)
        return sprintf(buf, "%s | ANT: %s BW: %s MCS: %d NSS: %d %s%s%s%s%s\n",
                       type, rs_pretty_ant(ant), bw, mcs, nss,
                       (rate & RATE_MCS_SGI_MSK) ? "SGI " : "NGI ",
-                      (rate & RATE_MCS_STBC_MSK) ? "STBC " : "",
+                      (rate & RATE_MCS_HT_STBC_MSK) ? "STBC " : "",
                       (rate & RATE_MCS_LDPC_MSK) ? "LDPC " : "",
                       (rate & RATE_MCS_BF_MSK) ? "BF " : "",
                       (rate & RATE_MCS_ZLF_MSK) ? "ZLF " : "");
index fa3c1393e1032e05170389ae61e65c107fa129a2..817d3e0b37e2d785e13418185cd0528a805891fb 100644 (file)
@@ -368,15 +368,23 @@ int iwl_mvm_rx_rx_mpdu(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb,
                rx_status.flag |= RX_FLAG_SHORT_GI;
        if (rate_n_flags & RATE_HT_MCS_GF_MSK)
                rx_status.flag |= RX_FLAG_HT_GF;
+       if (rate_n_flags & RATE_MCS_LDPC_MSK)
+               rx_status.flag |= RX_FLAG_LDPC;
        if (rate_n_flags & RATE_MCS_HT_MSK) {
+               u8 stbc = (rate_n_flags & RATE_MCS_HT_STBC_MSK) >>
+                               RATE_MCS_STBC_POS;
                rx_status.flag |= RX_FLAG_HT;
                rx_status.rate_idx = rate_n_flags & RATE_HT_MCS_INDEX_MSK;
+               rx_status.flag |= stbc << RX_FLAG_STBC_SHIFT;
        } else if (rate_n_flags & RATE_MCS_VHT_MSK) {
+               u8 stbc = (rate_n_flags & RATE_MCS_VHT_STBC_MSK) >>
+                               RATE_MCS_STBC_POS;
                rx_status.vht_nss =
                        ((rate_n_flags & RATE_VHT_MCS_NSS_MSK) >>
                                                RATE_VHT_MCS_NSS_POS) + 1;
                rx_status.rate_idx = rate_n_flags & RATE_VHT_MCS_RATE_CODE_MSK;
                rx_status.flag |= RX_FLAG_VHT;
+               rx_status.flag |= stbc << RX_FLAG_STBC_SHIFT;
        } else {
                rx_status.rate_idx =
                        iwl_mvm_legacy_rate_to_mac80211_idx(rate_n_flags,