diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2014-02-05 05:48:53 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2014-02-06 03:34:58 -0500 |
commit | 63c361f5114d81db789f8f5671c76c228c35b021 (patch) | |
tree | f1304b5a7bc415d40e5da8ab4732b407dc8bec9d | |
parent | 1b8d242adbea881658071efc31d2c0dcf8a44fb7 (diff) |
mac80211: propagate STBC / LDPC flags to radiotap
This capabilities weren't propagated to the radiotap header.
We don't set here the VHT_KNOWN / MCS_HAVE flag because not
all the low level drivers will know how to properly flag
the frames, hence the low level driver will be in charge
of setting IEEE80211_RADIOTAP_MCS_HAVE_FEC,
IEEE80211_RADIOTAP_MCS_HAVE_STBC and / or
IEEE80211_RADIOTAP_VHT_KNOWN_STBC according to its
capabilities.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r-- | include/net/ieee80211_radiotap.h | 4 | ||||
-rw-r--r-- | include/net/mac80211.h | 2 | ||||
-rw-r--r-- | net/mac80211/rx.c | 7 |
3 files changed, 13 insertions, 0 deletions
diff --git a/include/net/ieee80211_radiotap.h b/include/net/ieee80211_radiotap.h index 8b5b71433297..b0fd9476c538 100644 --- a/include/net/ieee80211_radiotap.h +++ b/include/net/ieee80211_radiotap.h | |||
@@ -316,6 +316,10 @@ enum ieee80211_radiotap_type { | |||
316 | #define IEEE80211_RADIOTAP_VHT_FLAG_LDPC_EXTRA_OFDM_SYM 0x10 | 316 | #define IEEE80211_RADIOTAP_VHT_FLAG_LDPC_EXTRA_OFDM_SYM 0x10 |
317 | #define IEEE80211_RADIOTAP_VHT_FLAG_BEAMFORMED 0x20 | 317 | #define IEEE80211_RADIOTAP_VHT_FLAG_BEAMFORMED 0x20 |
318 | 318 | ||
319 | #define IEEE80211_RADIOTAP_CODING_LDPC_USER0 0x01 | ||
320 | #define IEEE80211_RADIOTAP_CODING_LDPC_USER1 0x02 | ||
321 | #define IEEE80211_RADIOTAP_CODING_LDPC_USER2 0x04 | ||
322 | #define IEEE80211_RADIOTAP_CODING_LDPC_USER3 0x08 | ||
319 | 323 | ||
320 | /* helpers */ | 324 | /* helpers */ |
321 | static inline int ieee80211_get_radiotap_len(unsigned char *data) | 325 | static inline int ieee80211_get_radiotap_len(unsigned char *data) |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index a119da52665f..4f0f29dce0aa 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -827,6 +827,7 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info) | |||
827 | * on this subframe | 827 | * on this subframe |
828 | * @RX_FLAG_AMPDU_DELIM_CRC_KNOWN: The delimiter CRC field is known (the CRC | 828 | * @RX_FLAG_AMPDU_DELIM_CRC_KNOWN: The delimiter CRC field is known (the CRC |
829 | * is stored in the @ampdu_delimiter_crc field) | 829 | * is stored in the @ampdu_delimiter_crc field) |
830 | * @RX_FLAG_LDPC: LDPC was used | ||
830 | * @RX_FLAG_STBC_MASK: STBC 2 bit bitmask. 1 - Nss=1, 2 - Nss=2, 3 - Nss=3 | 831 | * @RX_FLAG_STBC_MASK: STBC 2 bit bitmask. 1 - Nss=1, 2 - Nss=2, 3 - Nss=3 |
831 | * @RX_FLAG_10MHZ: 10 MHz (half channel) was used | 832 | * @RX_FLAG_10MHZ: 10 MHz (half channel) was used |
832 | * @RX_FLAG_5MHZ: 5 MHz (quarter channel) was used | 833 | * @RX_FLAG_5MHZ: 5 MHz (quarter channel) was used |
@@ -863,6 +864,7 @@ enum mac80211_rx_flags { | |||
863 | RX_FLAG_AMPDU_DELIM_CRC_KNOWN = BIT(20), | 864 | RX_FLAG_AMPDU_DELIM_CRC_KNOWN = BIT(20), |
864 | RX_FLAG_MACTIME_END = BIT(21), | 865 | RX_FLAG_MACTIME_END = BIT(21), |
865 | RX_FLAG_VHT = BIT(22), | 866 | RX_FLAG_VHT = BIT(22), |
867 | RX_FLAG_LDPC = BIT(23), | ||
866 | RX_FLAG_STBC_MASK = BIT(26) | BIT(27), | 868 | RX_FLAG_STBC_MASK = BIT(26) | BIT(27), |
867 | RX_FLAG_10MHZ = BIT(28), | 869 | RX_FLAG_10MHZ = BIT(28), |
868 | RX_FLAG_5MHZ = BIT(29), | 870 | RX_FLAG_5MHZ = BIT(29), |
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index e81cab3ca157..593062109c50 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -279,6 +279,8 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local, | |||
279 | *pos |= IEEE80211_RADIOTAP_MCS_BW_40; | 279 | *pos |= IEEE80211_RADIOTAP_MCS_BW_40; |
280 | if (status->flag & RX_FLAG_HT_GF) | 280 | if (status->flag & RX_FLAG_HT_GF) |
281 | *pos |= IEEE80211_RADIOTAP_MCS_FMT_GF; | 281 | *pos |= IEEE80211_RADIOTAP_MCS_FMT_GF; |
282 | if (status->flag & RX_FLAG_LDPC) | ||
283 | *pos |= IEEE80211_RADIOTAP_MCS_FEC_LDPC; | ||
282 | stbc = (status->flag & RX_FLAG_STBC_MASK) >> RX_FLAG_STBC_SHIFT; | 284 | stbc = (status->flag & RX_FLAG_STBC_MASK) >> RX_FLAG_STBC_SHIFT; |
283 | *pos |= stbc << IEEE80211_RADIOTAP_MCS_STBC_SHIFT; | 285 | *pos |= stbc << IEEE80211_RADIOTAP_MCS_STBC_SHIFT; |
284 | pos++; | 286 | pos++; |
@@ -328,6 +330,9 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local, | |||
328 | /* flags */ | 330 | /* flags */ |
329 | if (status->flag & RX_FLAG_SHORT_GI) | 331 | if (status->flag & RX_FLAG_SHORT_GI) |
330 | *pos |= IEEE80211_RADIOTAP_VHT_FLAG_SGI; | 332 | *pos |= IEEE80211_RADIOTAP_VHT_FLAG_SGI; |
333 | /* in VHT, STBC is binary */ | ||
334 | if (status->flag & RX_FLAG_STBC_MASK) | ||
335 | *pos |= IEEE80211_RADIOTAP_VHT_FLAG_STBC; | ||
331 | pos++; | 336 | pos++; |
332 | /* bandwidth */ | 337 | /* bandwidth */ |
333 | if (status->vht_flag & RX_VHT_FLAG_80MHZ) | 338 | if (status->vht_flag & RX_VHT_FLAG_80MHZ) |
@@ -344,6 +349,8 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local, | |||
344 | *pos = (status->rate_idx << 4) | status->vht_nss; | 349 | *pos = (status->rate_idx << 4) | status->vht_nss; |
345 | pos += 4; | 350 | pos += 4; |
346 | /* coding field */ | 351 | /* coding field */ |
352 | if (status->flag & RX_FLAG_LDPC) | ||
353 | *pos |= IEEE80211_RADIOTAP_CODING_LDPC_USER0; | ||
347 | pos++; | 354 | pos++; |
348 | /* group ID */ | 355 | /* group ID */ |
349 | pos++; | 356 | pos++; |