diff options
author | Helmut Schaa <helmut.schaa@googlemail.com> | 2011-10-11 12:08:55 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-10-14 14:48:14 -0400 |
commit | 7f2a5e214d3f8daf1e9a5ad021c74528f970e673 (patch) | |
tree | b71cbcdae3d7226e771b44576f2ca49ac85c3b97 /net/mac80211/status.c | |
parent | a2fe81667410723d941a688e1958a49d67ca3346 (diff) |
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: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/status.c')
-rw-r--r-- | net/mac80211/status.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/net/mac80211/status.c b/net/mac80211/status.c index f97fa0a54cf6..df643cedf9b9 100644 --- a/net/mac80211/status.c +++ b/net/mac80211/status.c | |||
@@ -243,6 +243,11 @@ static int ieee80211_tx_radiotap_len(struct ieee80211_tx_info *info) | |||
243 | /* IEEE80211_RADIOTAP_DATA_RETRIES */ | 243 | /* IEEE80211_RADIOTAP_DATA_RETRIES */ |
244 | len += 1; | 244 | len += 1; |
245 | 245 | ||
246 | /* IEEE80211_TX_RC_MCS */ | ||
247 | if (info->status.rates[0].idx >= 0 && | ||
248 | info->status.rates[0].flags & IEEE80211_TX_RC_MCS) | ||
249 | len += 3; | ||
250 | |||
246 | return len; | 251 | return len; |
247 | } | 252 | } |
248 | 253 | ||
@@ -299,6 +304,24 @@ static void ieee80211_add_tx_radiotap_header(struct ieee80211_supported_band | |||
299 | /* for now report the total retry_count */ | 304 | /* for now report the total retry_count */ |
300 | *pos = retry_count; | 305 | *pos = retry_count; |
301 | pos++; | 306 | pos++; |
307 | |||
308 | /* IEEE80211_TX_RC_MCS */ | ||
309 | if (info->status.rates[0].idx >= 0 && | ||
310 | info->status.rates[0].flags & IEEE80211_TX_RC_MCS) { | ||
311 | rthdr->it_present |= cpu_to_le32(1 << IEEE80211_RADIOTAP_MCS); | ||
312 | pos[0] = IEEE80211_RADIOTAP_MCS_HAVE_MCS | | ||
313 | IEEE80211_RADIOTAP_MCS_HAVE_GI | | ||
314 | IEEE80211_RADIOTAP_MCS_HAVE_BW; | ||
315 | if (info->status.rates[0].flags & IEEE80211_TX_RC_SHORT_GI) | ||
316 | pos[1] |= IEEE80211_RADIOTAP_MCS_SGI; | ||
317 | if (info->status.rates[0].flags & IEEE80211_TX_RC_40_MHZ_WIDTH) | ||
318 | pos[1] |= IEEE80211_RADIOTAP_MCS_BW_40; | ||
319 | if (info->status.rates[0].flags & IEEE80211_TX_RC_GREEN_FIELD) | ||
320 | pos[1] |= IEEE80211_RADIOTAP_MCS_FMT_GF; | ||
321 | pos[2] = info->status.rates[0].idx; | ||
322 | pos += 3; | ||
323 | } | ||
324 | |||
302 | } | 325 | } |
303 | 326 | ||
304 | /* | 327 | /* |