iwlwifi: mvm: put LTF symbol size into HE radiotap
authorJohannes Berg <johannes.berg@intel.com>
Wed, 2 May 2018 09:20:00 +0000 (11:20 +0200)
committerLuca Coelho <luciano.coelho@intel.com>
Fri, 31 Aug 2018 08:38:34 +0000 (11:38 +0300)
I evidently completely confused "number of LTF symbols" and "LTF size".
Radiotap was reporting the former, while I thought it was the latter,
and we really need both.

Add the LTF symbol size into the newly defined field in radiotap.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c

index fd66ea7c4b664c1a22198b3e0785af651f75ebd0..f644bcf7e0485b619109bddc6379b78c579f315b 100644 (file)
@@ -925,7 +925,7 @@ static void iwl_mvm_rx_he(struct iwl_mvm *mvm, struct sk_buff *skb,
        struct ieee80211_radiotap_he *he = NULL;
        struct ieee80211_radiotap_he_mu *he_mu = NULL;
        u32 he_type = 0xffffffff;
-       u8 stbc;
+       u8 stbc, ltf;
 
        static const struct ieee80211_radiotap_he known = {
                .data1 = cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_DATA_MCS_KNOWN |
@@ -1151,21 +1151,33 @@ static void iwl_mvm_rx_he(struct iwl_mvm *mvm, struct sk_buff *skb,
                RATE_MCS_HE_GI_LTF_POS) {
        case 0:
                rx_status->he_gi = NL80211_RATE_INFO_HE_GI_0_8;
+               if (he_type == RATE_MCS_HE_TYPE_MU)
+                       ltf = IEEE80211_RADIOTAP_HE_DATA5_LTF_SIZE_4X;
+               else
+                       ltf = IEEE80211_RADIOTAP_HE_DATA5_LTF_SIZE_1X;
                break;
        case 1:
                rx_status->he_gi = NL80211_RATE_INFO_HE_GI_0_8;
+               ltf = IEEE80211_RADIOTAP_HE_DATA5_LTF_SIZE_2X;
                break;
        case 2:
                rx_status->he_gi = NL80211_RATE_INFO_HE_GI_1_6;
+               if (he_type == RATE_MCS_HE_TYPE_TRIG)
+                       ltf = IEEE80211_RADIOTAP_HE_DATA5_LTF_SIZE_4X;
+               else
+                       ltf = IEEE80211_RADIOTAP_HE_DATA5_LTF_SIZE_2X;
                break;
        case 3:
                if (rate_n_flags & RATE_MCS_SGI_MSK)
                        rx_status->he_gi = NL80211_RATE_INFO_HE_GI_0_8;
                else
                        rx_status->he_gi = NL80211_RATE_INFO_HE_GI_3_2;
+               ltf = IEEE80211_RADIOTAP_HE_DATA5_LTF_SIZE_4X;
                break;
        }
 
+       he->data5 |= le16_encode_bits(ltf, IEEE80211_RADIOTAP_HE_DATA5_LTF_SIZE);
+
        switch (he_type) {
        case RATE_MCS_HE_TYPE_SU: {
                u16 val;