Explorar o código

iwlwifi: fix incorrect 5GHz rates reported in monitor mode

This patch fixes the rates reported in monitor mode operation
(Wireshark) for iwlwifi.

Previously, packets with rates of 6M..24M would be reported
incorrectly and packets with rates of 36M..54M would not passed
up the stack.

Signed-off-by: Rick Farrington <rickdic@hotmail.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Rick Farrington %!s(int64=17) %!d(string=hai) anos
pai
achega
ec04fd60fd

+ 5 - 1
drivers/net/wireless/iwlwifi/iwl-3945.c

@@ -588,8 +588,12 @@ static void iwl3945_add_radiotap(struct iwl3945_priv *priv,
 
 
 	if (rate == -1)
 	if (rate == -1)
 		iwl3945_rt->rt_rate = 0;
 		iwl3945_rt->rt_rate = 0;
-	else
+	else {
+		if (stats->band == IEEE80211_BAND_5GHZ)
+			rate += IWL_FIRST_OFDM_RATE;
+
 		iwl3945_rt->rt_rate = iwl3945_rates[rate].ieee;
 		iwl3945_rt->rt_rate = iwl3945_rates[rate].ieee;
+	}
 
 
 	/* antenna number */
 	/* antenna number */
 	antenna = phy_flags_hw & RX_RES_PHY_FLAGS_ANTENNA_MSK;
 	antenna = phy_flags_hw & RX_RES_PHY_FLAGS_ANTENNA_MSK;

+ 5 - 1
drivers/net/wireless/iwlwifi/iwl-4965.c

@@ -3528,8 +3528,12 @@ static void iwl4965_add_radiotap(struct iwl_priv *priv,
 
 
 	if (rate == -1)
 	if (rate == -1)
 		iwl4965_rt->rt_rate = 0;
 		iwl4965_rt->rt_rate = 0;
-	else
+	else {
+		if (stats->band == IEEE80211_BAND_5GHZ)
+			rate += IWL_FIRST_OFDM_RATE;
+
 		iwl4965_rt->rt_rate = iwl4965_rates[rate].ieee;
 		iwl4965_rt->rt_rate = iwl4965_rates[rate].ieee;
+	}
 
 
 	/*
 	/*
 	 * "antenna number"
 	 * "antenna number"