From 14fce58336815c74c4fda17459f9a5de93d369f3 Mon Sep 17 00:00:00 2001 From: Helmut Schaa Date: Tue, 11 Oct 2011 18:08:55 +0200 Subject: [PATCH] --- yaml --- r: 266758 b: refs/heads/master c: 7f2a5e214d3f8daf1e9a5ad021c74528f970e673 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/net/mac80211.h | 2 +- trunk/net/mac80211/status.c | 23 +++++++++++++++++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 5407304ac48e..a7460d645ad2 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a2fe81667410723d941a688e1958a49d67ca3346 +refs/heads/master: 7f2a5e214d3f8daf1e9a5ad021c74528f970e673 diff --git a/trunk/include/net/mac80211.h b/trunk/include/net/mac80211.h index 021317367d55..dc1123aa8181 100644 --- a/trunk/include/net/mac80211.h +++ b/trunk/include/net/mac80211.h @@ -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. * 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 diff --git a/trunk/net/mac80211/status.c b/trunk/net/mac80211/status.c index f97fa0a54cf6..df643cedf9b9 100644 --- a/trunk/net/mac80211/status.c +++ b/trunk/net/mac80211/status.c @@ -243,6 +243,11 @@ static int ieee80211_tx_radiotap_len(struct ieee80211_tx_info *info) /* IEEE80211_RADIOTAP_DATA_RETRIES */ 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; } @@ -299,6 +304,24 @@ static void ieee80211_add_tx_radiotap_header(struct ieee80211_supported_band /* for now report the total retry_count */ *pos = retry_count; 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; + } + } /*