linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] add HT format to radiotap
@ 2012-05-10  7:09 Johannes Berg
  2012-05-10  7:09 ` [PATCH 1/2] mac80211: (selectively) add HT details in radiotap Johannes Berg
  2012-05-10  7:09 ` [RFC 2/2] iwlwifi: give HT format to mac80211/radiotap Johannes Berg
  0 siblings, 2 replies; 3+ messages in thread
From: Johannes Berg @ 2012-05-10  7:09 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

The iwlwifi patch is only as RFC since I should
push it through our internal tree first, the
mac80211 patch allows us to add HT format to the
MCS field in radiotap.

johannes


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] mac80211: (selectively) add HT details in radiotap
  2012-05-10  7:09 [PATCH 0/2] add HT format to radiotap Johannes Berg
@ 2012-05-10  7:09 ` Johannes Berg
  2012-05-10  7:09 ` [RFC 2/2] iwlwifi: give HT format to mac80211/radiotap Johannes Berg
  1 sibling, 0 replies; 3+ messages in thread
From: Johannes Berg @ 2012-05-10  7:09 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

From: Johannes Berg <johannes.berg@intel.com>

Add a flag for the HT format (mixed vs. greenfield)
to allow drivers to report that on receive. Not all
drivers will do that though, so allow drivers to set
which radiotap MCS details they report.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 include/net/mac80211.h |   10 ++++++++++
 net/mac80211/main.c    |    3 +++
 net/mac80211/rx.c      |    6 +++---
 3 files changed, 16 insertions(+), 3 deletions(-)

--- a/net/mac80211/rx.c	2012-05-10 08:54:21.000000000 +0200
+++ b/net/mac80211/rx.c	2012-05-10 08:58:09.000000000 +0200
@@ -204,14 +204,14 @@ ieee80211_add_rx_radiotap_header(struct
 
 	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++ = local->hw.radiotap_mcs_details;
 		*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;
+		if (status->flag & RX_FLAG_HT_GF)
+			*pos |= IEEE80211_RADIOTAP_MCS_FMT_GF;
 		pos++;
 		*pos++ = status->rate_idx;
 	}
--- a/include/net/mac80211.h	2012-05-10 08:54:21.000000000 +0200
+++ b/include/net/mac80211.h	2012-05-10 09:00:41.000000000 +0200
@@ -667,6 +667,9 @@ ieee80211_tx_info_clear_status(struct ie
  * @RX_FLAG_SHORT_GI: Short guard interval was used
  * @RX_FLAG_NO_SIGNAL_VAL: The signal strength value is not present.
  *	Valid only for data frames (mainly A-MPDU)
+ * @RX_FLAG_HT_GF: This frame was received in a HT-greenfield transmission, if
+ *	the driver fills this value it should add %IEEE80211_RADIOTAP_MCS_HAVE_FMT
+ *	to hw.radiotap_mcs_details to advertise that fact
  */
 enum mac80211_rx_flags {
 	RX_FLAG_MMIC_ERROR	= 1<<0,
@@ -681,6 +684,7 @@ enum mac80211_rx_flags {
 	RX_FLAG_40MHZ		= 1<<10,
 	RX_FLAG_SHORT_GI	= 1<<11,
 	RX_FLAG_NO_SIGNAL_VAL	= 1<<12,
+	RX_FLAG_HT_GF		= 1<<13,
 };
 
 /**
@@ -1288,6 +1292,11 @@ enum ieee80211_hw_flags {
  *
  * @offchannel_tx_hw_queue: HW queue ID to use for offchannel TX
  *	(if %IEEE80211_HW_QUEUE_CONTROL is set)
+ *
+ * @radiotap_mcs_details: lists which MCS information can the HW
+ *	reports, by default it is set to _MCS, _GI and _BW but doesn't
+ *	include _FMT. Use %IEEE80211_RADIOTAP_MCS_HAVE_* values, only
+ *	adding _BW is supported today.
  */
 struct ieee80211_hw {
 	struct ieee80211_conf conf;
@@ -1309,6 +1318,7 @@ struct ieee80211_hw {
 	u8 max_rx_aggregation_subframes;
 	u8 max_tx_aggregation_subframes;
 	u8 offchannel_tx_hw_queue;
+	u8 radiotap_mcs_details;
 };
 
 /**
--- a/net/mac80211/main.c	2012-05-10 08:53:23.000000000 +0200
+++ b/net/mac80211/main.c	2012-05-10 08:58:42.000000000 +0200
@@ -597,6 +597,9 @@ struct ieee80211_hw *ieee80211_alloc_hw(
 	local->hw.offchannel_tx_hw_queue = IEEE80211_INVAL_HW_QUEUE;
 	local->hw.conf.long_frame_max_tx_count = wiphy->retry_long;
 	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;
 	local->user_power_level = -1;
 	wiphy->ht_capa_mod_mask = &mac80211_ht_capa_mod_mask;
 



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [RFC 2/2] iwlwifi: give HT format to mac80211/radiotap
  2012-05-10  7:09 [PATCH 0/2] add HT format to radiotap Johannes Berg
  2012-05-10  7:09 ` [PATCH 1/2] mac80211: (selectively) add HT details in radiotap Johannes Berg
@ 2012-05-10  7:09 ` Johannes Berg
  1 sibling, 0 replies; 3+ messages in thread
From: Johannes Berg @ 2012-05-10  7:09 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

From: Johannes Berg <johannes.berg@intel.com>

We know whether we received a frame in GF format
or not, add it to the radiotap information.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-agn-rx.c   |    2 ++
 drivers/net/wireless/iwlwifi/iwl-mac80211.c |    2 ++
 2 files changed, 4 insertions(+)

--- a/drivers/net/wireless/iwlwifi/iwl-agn-rx.c	2012-05-10 08:54:26.000000000 +0200
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rx.c	2012-05-10 09:04:42.000000000 +0200
@@ -1007,6 +1007,8 @@ static int iwlagn_rx_reply_rx(struct iwl
 		rx_status.flag |= RX_FLAG_40MHZ;
 	if (rate_n_flags & RATE_MCS_SGI_MSK)
 		rx_status.flag |= RX_FLAG_SHORT_GI;
+	if (rate_n_flags & RATE_MCS_GF_MSK)
+		rx_status.flag |= RX_FLAG_HT_GF;
 
 	iwlagn_pass_packet_to_mac80211(priv, header, len, ampdu_status,
 				    rxb, &rx_status);
--- a/drivers/net/wireless/iwlwifi/iwl-mac80211.c	2012-05-10 08:53:23.000000000 +0200
+++ b/drivers/net/wireless/iwlwifi/iwl-mac80211.c	2012-05-10 09:06:16.000000000 +0200
@@ -38,6 +38,7 @@
 #include <linux/etherdevice.h>
 #include <linux/if_arp.h>
 
+#include <net/ieee80211_radiotap.h>
 #include <net/mac80211.h>
 
 #include <asm/div64.h>
@@ -154,6 +155,7 @@ int iwlagn_mac_setup_register(struct iwl
 		    IEEE80211_HW_SCAN_WHILE_IDLE;
 
 	hw->offchannel_tx_hw_queue = IWL_AUX_QUEUE;
+	hw->radiotap_mcs_details |= IEEE80211_RADIOTAP_MCS_HAVE_FMT;
 
 	/*
 	 * Including the following line will crash some AP's.  This



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-05-10  7:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-10  7:09 [PATCH 0/2] add HT format to radiotap Johannes Berg
2012-05-10  7:09 ` [PATCH 1/2] mac80211: (selectively) add HT details in radiotap Johannes Berg
2012-05-10  7:09 ` [RFC 2/2] iwlwifi: give HT format to mac80211/radiotap Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).