Fix statistics in monitor mode
Hi,
I guess it is time for me to add my .02 cents to iwlwifi driver.
Recently I reported a bug about crazy statistics (> 100 quality for example) when turning on the monitor interface (this bug actually is triggered when card is put in monitor mode, thus shows up when promisc mode enabled as well)
It turns out that iwl3945_rx_reply_rx wasn't filling in the statistics when running in monitor on, instead a garbage was passed.
Best regards,
Maxim Levitsky
From 92b7594dc40254495c32de42a2163a409025dfce Mon Sep 17 00:00:00 2001
From: Maxim Levitsky <[email protected]>
Date: Fri, 1 Aug 2008 12:54:27 +0300
Subject: [PATCH] [IWL3945] Fix statistics in monitor mode
iwl3945_rx_reply_rx was sending packets too early to mac80211, before updating signal strength/quality. This resulted in garbage power levels.
--- drivers/net/wireless/iwlwifi/iwl-3945.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-)
drivers/net/wireless/iwlwifi/iwl-3945.c +6 -4
@@ -708,10 +708,7 @@ static void iwl3945_rx_reply_rx(struct iwl3945_priv *priv,return ; } -if (priv->iw_mode ==IEEE80211_IF_TYPE_MNTR ) { -iwl3945_pass_packet_to_mac80211 (priv, rxb, &rx_status); -return ; - } +/* Convert 3945's rssi indicator to dBm */ rx_status.signal = rx_stats->rssi -IWL_RSSI_OFFSET ;
@@ -773,6 +770,11 @@ static void iwl3945_rx_reply_rx(struct iwl3945_priv *priv, priv->last_rx_noise = rx_status.noise; } +if (priv->iw_mode ==IEEE80211_IF_TYPE_MNTR ) { +iwl3945_pass_packet_to_mac80211 (priv, rxb, &rx_status); +return ; + } +switch (le16_to_cpu (header->frame_control) &IEEE80211_FCTL_FTYPE ) {case IEEE80211_FTYPE_MGMT : switch (le16_to_cpu(header->frame_control) &
Signature · 1 line
1.5.4.3
Quoted 8 lines · Maxim Levitsky
I guess it is time for me to add my .02 cents to iwlwifi driver. Recently I reported a bug about crazy statistics (> 100 quality for example) when turning on the monitor interface (this bug actually is triggered when card is put in monitor mode, thus shows up when promisc mode enabled as well)
It turns out that
iwl3945_rx_reply_rxwasn't filling in the statistics when running in monitor on, instead a garbage was passed.
Good catch. I'd suggest change 3945 the same way as 4965. That is, move the iwl_pass_packet_to_mac80211() for MNTR before setting priv->last_beacon_time, et al. We don't need to update these fields in monitor mode anyway.
Thanks,
-yi
Quoted 10 lines · Zhu Yi
Quoted 8 lines · Maxim Levitsky
I guess it is time for me to add my .02 cents to iwlwifi driver. Recently I reported a bug about crazy statistics (> 100 quality for example) when turning on the monitor interface (this bug actually is triggered when card is put in monitor mode, thus shows up when promisc mode enabled as well)
It turns out that
iwl3945_rx_reply_rxwasn't filling in the statistics when running in monitor on, instead a garbage was passed.
Quoted 8 lines
Good catch. I'd suggest change 3945 the same way as 4965. That is, move the
iwl_pass_packet_to_mac80211()for MNTR before settingpriv->last_beacon_time, et al. We don't need to update these fields in monitor mode anyway.Thanks,
-yi
If we can have this data, what reason is their not to have it processed?
-J
Quoted 2 lines · Junty Mesmon
If we can have this data, what reason is their not to have it processed?
They are not for the monitor mode. Not related frames will mess up the values for associated STA. This is affect the associated-while-in-monitor mode.
Thanks,
-yi