Add STBC rx flag for radiotap using ath9k driver
cover Add STBC rx flag for radiotap using ath9k driver
These patches add STBC rx flag for radiotap. They are based on proposed field structure from radiotap.org. Only one STBC stream is supported.
TODO: Implement mechanism for passing the number of STBC streams being used. We could use mac80211_rx_flags to point number of streams which would require 3 precious bits or use a separate structure.
Wojciech Dubowik (2):
mac80211: Add STBC RX flag to radiotap
ath9k: Add STBC flag to rx status
drivers/net/wireless/ath/ath9k/ar9003_mac.c | 1 + drivers/net/wireless/ath/ath9k/mac.c | 2 ++ drivers/net/wireless/ath/ath9k/mac.h | 1 + drivers/net/wireless/ath/ath9k/recv.c | 2 ++ include/net/ieee80211_radiotap.h | 6 ++++++ include/net/mac80211.h | 2 ++ net/mac80211/main.c | 3 ++- net/mac80211/rx.c | 2 ++ 8 files changed, 18 insertions(+), 1 deletion(-)
Signature · 1 line
1.7.10.4
PATCH 1/2 mac80211: Add STBC RX flag to radiotap
Add rx flag to radiotap header which tells whether Space-Time Block Code was used. At the moment only 1 stream STBC is supported.
TODO: Pass information from the driver on how many STBC streams have been received.
--- include/net/ieee80211_radiotap.h | 6 ++++++ include/net/mac80211.h | 2 ++ net/mac80211/main.c | 3 ++- net/mac80211/rx.c | 2 ++ 4 files changed, 12 insertions(+), 1 deletion(-)
include/net/ieee80211_radiotap.h +6 -0
@@ -271,6 +271,7 @@ enum ieee80211_radiotap_type {#define IEEE80211_RADIOTAP_MCS_HAVE_GI 0x04#define IEEE80211_RADIOTAP_MCS_HAVE_FMT 0x08#define IEEE80211_RADIOTAP_MCS_HAVE_FEC 0x10 +#define IEEE80211_RADIOTAP_MCS_HAVE_STBC 0x20#define IEEE80211_RADIOTAP_MCS_BW_MASK 0x03#define IEEE80211_RADIOTAP_MCS_BW_20 0
@@ -280,6 +281,11 @@ enum ieee80211_radiotap_type {#define IEEE80211_RADIOTAP_MCS_SGI 0x04#define IEEE80211_RADIOTAP_MCS_FMT_GF 0x08#define IEEE80211_RADIOTAP_MCS_FEC_LDPC 0x10 +#define IEEE80211_RADIOTAP_MCS_STBC_MASK 0x60 +#define IEEE80211_RADIOTAP_MCS_STBC_0 0 +#define IEEE80211_RADIOTAP_MCS_STBC_1 1 +#define IEEE80211_RADIOTAP_MCS_STBC_2 2 +#define IEEE80211_RADIOTAP_MCS_STBC_3 3/* For IEEE80211_RADIOTAP_AMPDU_STATUS */ #define IEEE80211_RADIOTAP_AMPDU_REPORT_ZEROLEN 0x0001
include/net/mac80211.h +2 -0
@@ -808,6 +808,7 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info)* on this subframe * @RX_FLAG_AMPDU_DELIM_CRC_KNOWN: The delimiter CRC field is known (the CRC * is stored in the @ampdu_delimiter_crc field) +* @RX_FLAG_STBC: Space-Time Block Code was used */ enum mac80211_rx_flags {RX_FLAG_MMIC_ERROR =BIT (0 ),
@@ -835,6 +836,7 @@ enum mac80211_rx_flags {RX_FLAG_80MHZ =BIT (23 ),RX_FLAG_80P80MHZ =BIT (24 ),RX_FLAG_160MHZ =BIT (25 ), + RX_FLAG_STBC = BIT(26), };/**
net/mac80211/main.c +2 -1
@@ -589,7 +589,8 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len, local->hw.conf.short_frame_max_tx_count = wiphy->retry_short; local->hw.radiotap_mcs_details =IEEE80211_RADIOTAP_MCS_HAVE_MCS |IEEE80211_RADIOTAP_MCS_HAVE_GI | -IEEE80211_RADIOTAP_MCS_HAVE_BW ; +IEEE80211_RADIOTAP_MCS_HAVE_BW | +IEEE80211_RADIOTAP_MCS_HAVE_STBC ; local->hw.radiotap_vht_details =IEEE80211_RADIOTAP_VHT_KNOWN_GI |IEEE80211_RADIOTAP_VHT_KNOWN_BANDWIDTH ; local->hw.uapsd_queues =IEEE80211_DEFAULT_UAPSD_QUEUES ;
net/mac80211/rx.c +2 -0
@@ -267,6 +267,8 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local, *pos |=IEEE80211_RADIOTAP_MCS_BW_40 ;if (status->flag &RX_FLAG_HT_GF ) *pos |=IEEE80211_RADIOTAP_MCS_FMT_GF ; +if (status->flag &RX_FLAG_STBC ) + *pos |=IEEE80211_RADIOTAP_MCS_STBC_1 ; pos++; *pos++ = status->rate_idx; }
Signature · 1 line
1.7.10.4
PATCH 1/2 mac80211: Add STBC RX flag to radiotap
Am 29.04.2013 11:04, schrieb Wojciech Dubowik:
Quoted 6 lines
Add rx flag to radiotap header which tells whether Space-Time Block Code was used. At the moment only 1 stream STBC is supported.
TODO: Pass information from the driver on how many STBC streams have been received.
Hi,
do i understand it correctly, on 2x2 or 2x1 system we will get one stream STBC. On 4x4 or 4x2 we will get one or two stream STBC, is it correct?
Is it possible that we will get some thing like this any time soon?
Signature · 2 lines
Regards, Oleksij
Johannes Berg
maintainerPATCH 1/2 mac80211: Add STBC RX flag to radiotap
In reply to Wojciech DubowikQuoted 1 line · Wojciech Dubowik
Add rx flag to radiotap header which tells whether
Same here, you can't just randomly add something to radiotap. Go standardise it first.
johannes
PATCH 2/2 ath9k: Add STBC flag to rx status
In reply to Wojciech DubowikPass RX flag to mac80211 layer when STBC stream has been received.
--- drivers/net/wireless/ath/ath9k/ar9003_mac.c | 1 + drivers/net/wireless/ath/ath9k/mac.c | 2 ++ drivers/net/wireless/ath/ath9k/mac.h | 1 + drivers/net/wireless/ath/ath9k/recv.c | 2 ++ 4 files changed, 6 insertions(+)
drivers/net/wireless/ath/ath9k/ar9003_mac.c +1 -0
@@ -592,6 +592,7 @@ int ath9k_hw_process_rxdesc_edma(struct ath_hw *ah, struct ath_rx_status *rxs, rxs->rs_antenna = (MS (rxsp->status4, AR_RxAntenna) &0x7 ); rxs->rs_flags = (rxsp->status4 &AR_GI ) ?ATH9K_RX_GI :0 ; rxs->rs_flags |= (rxsp->status4 &AR_2040 ) ?ATH9K_RX_2040 :0 ; + rxs->rs_flags |= (rxsp->status4 & AR_RxStbc) ?ATH9K_RX_STBC :0 ; rxs->rs_hw_upload_data = (rxsp->status2 & AR_HwUploadData) ?1 :0 ; rxs->rs_not_sounding = (rxsp->status4 & AR_RxNotSounding) ?1 :0 ;
drivers/net/wireless/ath/ath9k/mac.c +2 -0
@@ -590,6 +590,8 @@ int ath9k_hw_rxprocdesc(struct ath_hw *ah, struct ath_desc *ds, (ads.ds_rxstatus3 &AR_GI ) ?ATH9K_RX_GI :0 ; rs->rs_flags |= (ads.ds_rxstatus3 &AR_2040 ) ?ATH9K_RX_2040 :0 ; + rs->rs_flags |= + (ads.ds_rxstatus3 & AR_RxStbc) ?ATH9K_RX_STBC :0 ;if (ads.ds_rxstatus8 & AR_PreDelimCRCErr) rs->rs_flags |=ATH9K_RX_DELIM_CRC_PRE ;
drivers/net/wireless/ath/ath9k/mac.h +1 -0
@@ -199,6 +199,7 @@ struct ath_htc_rx_status {#define ATH9K_RX_DELIM_CRC_PRE 0x10#define ATH9K_RX_DELIM_CRC_POST 0x20#define ATH9K_RX_DECRYPT_BUSY 0x40 +#define ATH9K_RX_STBC 0x80#define ATH9K_RXKEYIX_INVALID ((u8)-1)#define ATH9K_TXKEYIX_INVALID ((u8)-1)
drivers/net/wireless/ath/ath9k/recv.c +2 -0
@@ -872,6 +872,8 @@ static int ath9k_process_rate(struct ath_common *common, rxs->flag |=RX_FLAG_40MHZ ;if (rx_stats->rs_flags &ATH9K_RX_GI ) rxs->flag |=RX_FLAG_SHORT_GI ; +if (rx_stats->rs_flags &ATH9K_RX_STBC ) + rxs->flag |=RX_FLAG_STBC ; rxs->rate_idx = rx_stats->rs_rate &0x7f ;return 0 ; }
Signature · 1 line
1.7.10.4