linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iwlwifi: provide frequency to radiotap monitor not channel index
@ 2007-07-26  3:26 Zhu Yi
  2007-07-26  3:26 ` [PATCH] iwlwifi: Calculate and report noise level while associated Zhu Yi
  2007-07-26  7:15 ` [PATCH] iwlwifi: provide frequency to radiotap monitor not channel index Andy Green
  0 siblings, 2 replies; 6+ messages in thread
From: Zhu Yi @ 2007-07-26  3:26 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Andy Green, Zhu Yi

From: Andy Green <andy@warmcat.com>

iwlwifi wrongly provides the channel index to the radiotap header
on Monitor mode. This results in tcpdump showing "6MHz" for example.

This patch arranges to send the frequency in MHz instead eg, 2437MHz

Signed-off-by: Andy Green <andy@warmcat.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
---
 drivers/net/wireless/iwl-base.c |    5 ++---
 drivers/net/wireless/iwlwifi.h  |    2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/iwl-base.c b/drivers/net/wireless/iwl-base.c
index a1ebc2a..8671891 100644
--- a/drivers/net/wireless/iwl-base.c
+++ b/drivers/net/wireless/iwl-base.c
@@ -3120,7 +3120,6 @@ void iwl_handle_data_packet_monitor(struct iwl_priv *priv,
 	 * the information provided in the skb from the hardware */
 	s8 signal = stats->ssi;
 	s8 noise = 0;
-	u16 channel = stats->channel;
 	int rate = stats->rate;
 	u64 tsf = stats->mactime;
 
@@ -3162,8 +3161,8 @@ void iwl_handle_data_packet_monitor(struct iwl_priv *priv,
 	iwl_rt->rt_dbmsignal = signal;
 	iwl_rt->rt_dbmnoise = noise;
 
-	/* Convert the channel data and set the flags */
-	iwl_rt->rt_channel = cpu_to_le16(channel);
+	/* Convert the channel frequency and set the flags */
+	iwl_rt->rt_channelMHz = cpu_to_le16(stats->freq);
 	if (!(phy_flags & RX_RES_PHY_FLAGS_BAND_24_MSK)) {
 		iwl_rt->rt_chbitmask =
 		    cpu_to_le16((IEEE80211_CHAN_OFDM | IEEE80211_CHAN_5GHZ));
diff --git a/drivers/net/wireless/iwlwifi.h b/drivers/net/wireless/iwlwifi.h
index a86fc48..58e3ea6 100644
--- a/drivers/net/wireless/iwlwifi.h
+++ b/drivers/net/wireless/iwlwifi.h
@@ -104,7 +104,7 @@ struct iwl_rt_rx_hdr {
 	__le64 rt_tsf;		/* TSF */
 	u8 rt_flags;		/* radiotap packet flags */
 	u8 rt_rate;		/* rate in 500kb/s */
-	__le16 rt_channel;	/* channel in mHz */
+	__le16 rt_channelMHz;	/* channel in MHz */
 	__le16 rt_chbitmask;	/* channel bitfield */
 	s8 rt_dbmsignal;	/* signal in dBm, kluged to signed */
 	s8 rt_dbmnoise;
-- 
1.5.2

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

end of thread, other threads:[~2007-07-26  7:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-26  3:26 [PATCH] iwlwifi: provide frequency to radiotap monitor not channel index Zhu Yi
2007-07-26  3:26 ` [PATCH] iwlwifi: Calculate and report noise level while associated Zhu Yi
2007-07-26  3:26   ` [PATCH] iwlwifi: modify station fix Zhu Yi
2007-07-26  3:26     ` [PATCH] iwlwifi: cleanup tx queue allocation Zhu Yi
2007-07-26  3:26       ` [PATCH] iwlwifi: rxon filter_flags endianity fix Zhu Yi
2007-07-26  7:15 ` [PATCH] iwlwifi: provide frequency to radiotap monitor not channel index Andy Green

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).