Skip to contentSkip to conversation

MCS extension

RFA Johannes Berg 2 participants 4 messages Dec 18, 2010 – Jan 27, 2011 3 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

This is a request for adoption of a new version of the MCS extension. I've split out the aMPDU extension since that seems more natural.

The MCS extension allows giving MCS information about a frame.

The normative text of this proposal follows (minus formatting):
--- begin normative text ---
MCS

Bit number

	19
Structure
	u8 known, u8 flags, u8 mcs
Required alignment
	1

The MCS field indicates the MCS rate index as in IEEE_802.11n-2009.

The "known" field indicates which information is known:
| flag | definition
---------------------

| 0x01 | bandwidth
| 0x02 | MCS index known (in "mcs" part of the field)
| 0x04 | guard interval
| 0x08 | HT format
| 0x10 | FEC type
| 0xe0 | reserved

The "flags" field is any combination of the following:
| flag | definition
-----------------------------

| 0x03 | bandwidth - 0: 20, 1: 40, 2: 20L, 3: 20U
| 0x04 | guard interval - 0: long GI, 1: short GI
| 0x08 | HT format - 0: mixed, 1: greenfield
| 0x10 | FEC type - 0: BCC, 1: LDPC
| 0xe0 | reserved

--- end normative text ---

I've implemented this in mac80211 (the Linux 802.11 stack) and in wireshark, both patches are attached.

Due to holidays, I suggest the following timeline:
* comment period until Jan. 15th
* tentatively adopt Jan. 22nd
* fully adopt end of January

I'm also preparing a separate aMPDU field -- see
http://www.radiotap.org/suggested-fields/aMPDU%20status

johannes

mac80211: add radiotap MCS information

From: Johannes Berg <[email protected]>

This adds the MCS information we currently get
from the drivers into radiotap.

---
 include/net/ieee80211_radiotap.h |   20 ++++++++++++++++++++
 net/mac80211/rx.c                |   17 +++++++++++++++++
 2 files changed, 37 insertions(+)
net/mac80211/rx.c +17 -0
@@ -85,6 +85,9 @@ ieee80211_rx_radiotap_len(struct ieee802
 	if (len & 1) /* padding for RX_FLAGS if necessary */
 		len++;
 
+	if (status->flag & RX_FLAG_HT) /* HT info */
+		len += 3;
+
 	return len;
 }
 
@@ -193,6 +196,20 @@ ieee80211_add_rx_radiotap_header(struct
 		rx_flags |= IEEE80211_RADIOTAP_F_RX_BADPLCP;
 	put_unaligned_le16(rx_flags, pos);
 	pos += 2;
+
+	if (status->flag & RX_FLAG_HT) {
+		rthdr->it_present |= cpu_to_le32(1 << IEEE80211_RADIOTAP_MCS);
+		*pos++ = IEEE80211_RADIOTAP_MCS_HAVE_MCS |
+			 IEEE80211_RADIOTAP_MCS_HAVE_GI |
+			 IEEE80211_RADIOTAP_MCS_HAVE_BW;
+		*pos = 0;
+		if (status->flag & RX_FLAG_SHORT_GI)
+			*pos |= IEEE80211_RADIOTAP_MCS_SGI;
+		if (status->flag & RX_FLAG_40MHZ)
+			*pos |= IEEE80211_RADIOTAP_MCS_BW_40;
+		pos++;
+		*pos++ = status->rate_idx;
+	}
 }
 
 /*
include/net/ieee80211_radiotap.h +20 -0
@@ -199,6 +199,8 @@ enum ieee80211_radiotap_type {
 	IEEE80211_RADIOTAP_RTS_RETRIES = 16,
 	IEEE80211_RADIOTAP_DATA_RETRIES = 17,
 
+	IEEE80211_RADIOTAP_MCS = 19,
+
 	/* valid in every it_present bitmap, even vendor namespaces */
 	IEEE80211_RADIOTAP_RADIOTAP_NAMESPACE = 29,
 	IEEE80211_RADIOTAP_VENDOR_NAMESPACE = 30,
@@ -245,6 +247,24 @@ enum ieee80211_radiotap_type {
 #define IEEE80211_RADIOTAP_F_TX_CTS	0x0002	/* used cts 'protection' */
 #define IEEE80211_RADIOTAP_F_TX_RTS	0x0004	/* used rts/cts handshake */
 
+
+/* For IEEE80211_RADIOTAP_MCS */
+#define IEEE80211_RADIOTAP_MCS_HAVE_BW		0x01
+#define IEEE80211_RADIOTAP_MCS_HAVE_MCS		0x02
+#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_BW_MASK		0x03
+#define		IEEE80211_RADIOTAP_MCS_BW_20	0
+#define		IEEE80211_RADIOTAP_MCS_BW_40	1
+#define		IEEE80211_RADIOTAP_MCS_BW_20L	2
+#define		IEEE80211_RADIOTAP_MCS_BW_20U	3
+#define IEEE80211_RADIOTAP_MCS_SGI		0x04
+#define IEEE80211_RADIOTAP_MCS_FMT_GF		0x08
+#define IEEE80211_RADIOTAP_MCS_FEC_LDPC		0x10
+
+
 /* Ugly macro to convert literal channel numbers into their mhz equivalents
  * There are certianly some conditions that will break this (like feeding it '30')
  * but they shouldn't arise since nothing talks on channel 30. */
---
 epan/dissectors/packet-radiotap-defs.h |   19 ++++++
 epan/dissectors/packet-radiotap-iter.c |    4 +
 epan/dissectors/packet-radiotap.c      |   92 +++++++++++++++++++++++++++++++++
 3 files changed, 114 insertions(+), 1 deletion(-)
epan/dissectors/packet-radiotap-defs.h +19 -0
@@ -198,6 +198,8 @@ enum ieee80211_radiotap_type {
 	IEEE80211_RADIOTAP_RTS_RETRIES = 16,
 	IEEE80211_RADIOTAP_DATA_RETRIES = 17,
 
+	IEEE80211_RADIOTAP_MCS = 19,
+
 	/* valid in every it_present bitmap, even vendor namespaces */
 	IEEE80211_RADIOTAP_RADIOTAP_NAMESPACE = 29,
 	IEEE80211_RADIOTAP_VENDOR_NAMESPACE = 30,
@@ -244,4 +246,21 @@ enum ieee80211_radiotap_type {
 #define IEEE80211_RADIOTAP_F_TX_CTS	0x0002	/* used cts 'protection' */
 #define IEEE80211_RADIOTAP_F_TX_RTS	0x0004	/* used rts/cts handshake */
 
+
+/* For IEEE80211_RADIOTAP_MCS */
+#define IEEE80211_RADIOTAP_MCS_HAVE_BW		0x01
+#define IEEE80211_RADIOTAP_MCS_HAVE_MCS		0x02
+#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_BW_MASK		0x03
+#define		IEEE80211_RADIOTAP_MCS_BW_20	0
+#define		IEEE80211_RADIOTAP_MCS_BW_40	1
+#define		IEEE80211_RADIOTAP_MCS_BW_20L	2
+#define		IEEE80211_RADIOTAP_MCS_BW_20U	3
+#define IEEE80211_RADIOTAP_MCS_SGI		0x04
+#define IEEE80211_RADIOTAP_MCS_FMT_GF		0x08
+#define IEEE80211_RADIOTAP_MCS_FEC_LDPC		0x10
+
 #endif				/* IEEE80211_RADIOTAP_H */
epan/dissectors/packet-radiotap-iter.c +3 -1
@@ -48,7 +48,9 @@ static const struct radiotap_align_size
 	/* [IEEE80211_RADIOTAP_RX_FLAGS] = 14 */		{ 2, 2 },
 	/* [IEEE80211_RADIOTAP_TX_FLAGS] = 15 */		{ 2, 2 },
 	/* [IEEE80211_RADIOTAP_RTS_RETRIES] = 16 */		{ 1, 1 },
-	/* [IEEE80211_RADIOTAP_DATA_RETRIES] = 17 */		{ 1, 1 }
+	/* [IEEE80211_RADIOTAP_DATA_RETRIES] = 17 */		{ 1, 1 },
+	/* currently undefined = 18 */				{ 0, 0 },
+	/* [IEEE80211_RADIOTAP_MCS] = 19 */			{ 1, 3 }
 	/*
 	 * add more here as they are defined in
 	 * include/net/ieee80211_radiotap.h
epan/dissectors/packet-radiotap.c +92 -0

140 lines not on this page · raw message

#2 lore raw
In reply to a message not in the archive
Quoted 4 lines · Johannes Berg

This is a request for adoption of a new version of the MCS extension. I've split out the aMPDU extension since that seems more natural.

The MCS extension allows giving MCS information about a frame.

Any notes on this? Nobody objecting to the split between MCS and a-MPDU that I now did? :-)

johannes

#4 lore raw
In reply to a message not in the archive
Quoted 8 lines · Johannes Berg
Quoted 4 lines · Johannes Berg

This is a request for adoption of a new version of the MCS extension. I've split out the aMPDU extension since that seems more natural.

The MCS extension allows giving MCS information about a frame.

Any notes on this? Nobody objecting to the split between MCS and a-MPDU that I now did? :-)

Thanks for the reminder. Radiotap emails keep slipping over my email horizon. :-/

Looks good to me. Thanks for doing this.

Dave

Signature · 2 lines
David Young             OJC Technologies
[email protected]      Urbana, IL * (217) 278-3933
#6 lore raw
In reply to a message not in the archive
Quoted 7 lines · David Young
Quoted 6 lines · Johannes Berg
Quoted 4 lines · Johannes Berg

This is a request for adoption of a new version of the MCS extension. I've split out the aMPDU extension since that seems more natural.

The MCS extension allows giving MCS information about a frame.

Quoted 7 lines
Quoted 2 lines

Any notes on this? Nobody objecting to the split between MCS and a-MPDU that I now did? :-)

Thanks for the reminder. Radiotap emails keep slipping over my email horizon. :-/

Looks good to me. Thanks for doing this.

Thanks for looking, I got behind too. I've made the corresponding wiki change now, and will go ahead and submit the patches I'd done.

Thanks! A-MPDU is next, and maybe those TX flags and retry things.

johannes