Commit 7f2a5e21 authored by Helmut Schaa's avatar Helmut Schaa Committed by John W. Linville

mac80211: Populate radiotap header with MCS info for TX frames

mac80211 already filled in the MCS rate info for rx'ed frames but tx'ed
frames that are sent to a monitor interface during the status callback
lack this information.

Add the radiotap fields for MCS info to ieee80211_tx_status_rtap_hdr
and populate them when sending tx'ed frames to the monitors.

The needed headroom is only extended by one byte since we don't include
legacy rate information in the rtap header for HT frames.
Signed-off-by: default avatarHelmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent a2fe8166
...@@ -2522,7 +2522,7 @@ static inline int ieee80211_sta_ps_transition_ni(struct ieee80211_sta *sta, ...@@ -2522,7 +2522,7 @@ static inline int ieee80211_sta_ps_transition_ni(struct ieee80211_sta *sta,
* The TX headroom reserved by mac80211 for its own tx_status functions. * The TX headroom reserved by mac80211 for its own tx_status functions.
* This is enough for the radiotap header. * This is enough for the radiotap header.
*/ */
#define IEEE80211_TX_STATUS_HEADROOM 13 #define IEEE80211_TX_STATUS_HEADROOM 14
/** /**
* ieee80211_sta_set_buffered - inform mac80211 about driver-buffered frames * ieee80211_sta_set_buffered - inform mac80211 about driver-buffered frames
......
...@@ -243,6 +243,11 @@ static int ieee80211_tx_radiotap_len(struct ieee80211_tx_info *info) ...@@ -243,6 +243,11 @@ static int ieee80211_tx_radiotap_len(struct ieee80211_tx_info *info)
/* IEEE80211_RADIOTAP_DATA_RETRIES */ /* IEEE80211_RADIOTAP_DATA_RETRIES */
len += 1; len += 1;
/* IEEE80211_TX_RC_MCS */
if (info->status.rates[0].idx >= 0 &&
info->status.rates[0].flags & IEEE80211_TX_RC_MCS)
len += 3;
return len; return len;
} }
...@@ -299,6 +304,24 @@ static void ieee80211_add_tx_radiotap_header(struct ieee80211_supported_band ...@@ -299,6 +304,24 @@ static void ieee80211_add_tx_radiotap_header(struct ieee80211_supported_band
/* for now report the total retry_count */ /* for now report the total retry_count */
*pos = retry_count; *pos = retry_count;
pos++; pos++;
/* IEEE80211_TX_RC_MCS */
if (info->status.rates[0].idx >= 0 &&
info->status.rates[0].flags & IEEE80211_TX_RC_MCS) {
rthdr->it_present |= cpu_to_le32(1 << IEEE80211_RADIOTAP_MCS);
pos[0] = IEEE80211_RADIOTAP_MCS_HAVE_MCS |
IEEE80211_RADIOTAP_MCS_HAVE_GI |
IEEE80211_RADIOTAP_MCS_HAVE_BW;
if (info->status.rates[0].flags & IEEE80211_TX_RC_SHORT_GI)
pos[1] |= IEEE80211_RADIOTAP_MCS_SGI;
if (info->status.rates[0].flags & IEEE80211_TX_RC_40_MHZ_WIDTH)
pos[1] |= IEEE80211_RADIOTAP_MCS_BW_40;
if (info->status.rates[0].flags & IEEE80211_TX_RC_GREEN_FIELD)
pos[1] |= IEEE80211_RADIOTAP_MCS_FMT_GF;
pos[2] = info->status.rates[0].idx;
pos += 3;
}
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment