Skip to contentSkip to conversation

Revert "iwl3945: remove iwl-3945-led.[ch]"

PATCH In review Zhu Yi 3 participants 4 messages Dec 23, 2008 – Dec 24, 2008 Networking drivers (wireless)

lore
Share & tools
lore

Zhu Yi

author
#0 lore raw

PATCH 1/1 Revert "iwl3945: remove iwl-3945-led.[ch]"

This reverts commit b3489137ec7dabe4531c4344347270857301e209. This fixes the iwl3945 scan regression reported by Kalle Valo.

Conflicts:

drivers/net/wireless/iwlwifi/iwl3945-base.c

---
 drivers/net/wireless/iwlwifi/Kconfig        |    1 -
 drivers/net/wireless/iwlwifi/Makefile       |    3 +
 drivers/net/wireless/iwlwifi/iwl-3945-led.c |  409 +++++++++++++++++++++++++++
 drivers/net/wireless/iwlwifi/iwl-3945-led.h |   60 ++++
 drivers/net/wireless/iwlwifi/iwl-3945.c     |   10 +-
 drivers/net/wireless/iwlwifi/iwl-3945.h     |    1 +
 drivers/net/wireless/iwlwifi/iwl-dev.h      |   11 +-
 drivers/net/wireless/iwlwifi/iwl3945-base.c |    7 +-
 8 files changed, 497 insertions(+), 5 deletions(-)
 create mode 100644 drivers/net/wireless/iwlwifi/iwl-3945-led.c
 create mode 100644 drivers/net/wireless/iwlwifi/iwl-3945-led.h
drivers/net/wireless/iwlwifi/Kconfig +0 -1
index 5ed2030..47bee0e 100644
@@ -146,7 +146,6 @@ config IWL3945_SPECTRUM_MEASUREMENT
 config IWL3945_LEDS
 	bool "Enable LEDS features in iwl3945 driver"
 	depends on IWL3945
-	select IWLWIFI_LEDS
 	---help---
 	  This option enables LEDS for the iwl3945 driver.
 
drivers/net/wireless/iwlwifi/Makefile +3 -0
index 9808992..0be9e6b 100644
@@ -15,3 +15,6 @@ iwlagn-$(CONFIG_IWL5000) += iwl-5000.o
 
 obj-$(CONFIG_IWL3945)	+= iwl3945.o
 iwl3945-objs		:= iwl3945-base.o iwl-3945.o iwl-3945-rs.o
+iwl3945-$(CONFIG_IWL3945_LEDS) += iwl-3945-led.o
+
+
drivers/net/wireless/iwlwifi/iwl-3945-led.c new file +409 -0

409 lines not on this page · raw message

drivers/net/wireless/iwlwifi/iwl-3945-led.h new file +60 -0

60 lines not on this page · raw message

drivers/net/wireless/iwlwifi/iwl-3945.c +9 -1
index 77c55a6..85a8790 100644
@@ -399,7 +399,7 @@ void iwl3945_hw_rx_statistics(struct iwl_priv *priv, struct iwl_rx_mem_buffer *r
 
 	memcpy(&priv->statistics_39, pkt->u.raw, sizeof(priv->statistics_39));
 
-	iwl_leds_background(priv);
+	iwl3945_led_background(priv);
 
 	priv->last_statistics_time = jiffies;
 }
@@ -576,6 +576,9 @@ static void iwl3945_pass_packet_to_mac80211(struct iwl_priv *priv,
 				   struct ieee80211_rx_status *stats)
 {
 	struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data;
+#ifdef CONFIG_IWL3945_LEDS
+	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)IWL_RX_DATA(pkt);
+#endif
 	struct iwl3945_rx_frame_hdr *rx_hdr = IWL_RX_HDR(pkt);
 	struct iwl3945_rx_frame_end *rx_end = IWL_RX_END(pkt);
 	short len = le16_to_cpu(rx_hdr->len);
@@ -600,6 +603,11 @@ static void iwl3945_pass_packet_to_mac80211(struct iwl_priv *priv,
 	if (iwl3945_mod_params.sw_crypto)
 		iwl3945_set_decrypted_flag(priv, rxb->skb,
 				       le32_to_cpu(rx_end->status), stats);
+
+#ifdef CONFIG_IWL3945_LEDS
+	if (ieee80211_is_data(hdr->frame_control))
+		priv->rxtxpackets += len;
+#endif
 	ieee80211_rx_irqsafe(priv->hw, rxb->skb, stats);
 	rxb->skb = NULL;
 }
drivers/net/wireless/iwlwifi/iwl-3945.h +1 -0
index bd41643..c5f5481 100644
@@ -50,6 +50,7 @@ extern struct pci_device_id iwl3945_hw_card_ids[];
 #include "iwl-debug.h"
 #include "iwl-power.h"
 #include "iwl-dev.h"
+#include "iwl-3945-led.h"
 
 /* Highest firmware API version supported */
 #define IWL3945_UCODE_API_MAX 2
drivers/net/wireless/iwlwifi/iwl-dev.h +10 -1
index ef1099c..9b9d743 100644
@@ -44,6 +44,7 @@
 #include "iwl-rfkill.h"
 #include "iwl-4965-hw.h"
 #include "iwl-3945-hw.h"
+#include "iwl-3945-led.h"
 #include "iwl-led.h"
 #include "iwl-power.h"
 #include "iwl-agn-rs.h"
@@ -903,13 +904,21 @@ struct iwl_priv {
 	struct rfkill *rfkill;
 #endif
 
-#ifdef	CONFIG_IWLWIFI_LEDS
+#if defined(CONFIG_IWLWIFI_LEDS) || defined(CONFIG_IWL3945_LEDS)
 	unsigned long last_blink_time;
 	u8 last_blink_rate;
 	u8 allow_blinking;
 	u64 led_tpt;
+#endif
+
+#ifdef CONFIG_IWLWIFI_LEDS
 	struct iwl_led led[IWL_LED_TRG_MAX];
 #endif
+
+#ifdef CONFIG_IWL3945_LEDS
+	struct iwl3945_led led39[IWL_LED_TRG_MAX];
+	unsigned int rxtxpackets;
+#endif
 	u16 active_rate;
 	u16 active_rate_basic;
 
drivers/net/wireless/iwlwifi/iwl3945-base.c +5 -2
index c098cac..b5f0b31 100644
@@ -2146,6 +2146,9 @@ static void iwl3945_build_tx_cmd_basic(struct iwl_priv *priv,
 			tx->timeout.pm_frame_timeout = cpu_to_le16(2);
 	} else {
 		tx->timeout.pm_frame_timeout = 0;
+#ifdef CONFIG_IWL3945_LEDS
+		priv->rxtxpackets += le16_to_cpu(cmd->cmd.tx.len);
+#endif
 	}
 
 	tx->driver_txop = 0;
@@ -5274,7 +5277,7 @@ static void iwl3945_alive_start(struct iwl_priv *priv)
 
 	iwl3945_reg_txpower_periodic(priv);
 
-	iwl_leds_register(priv);
+	iwl3945_led_register(priv);
 
 	IWL_DEBUG_INFO("ALIVE processing complete.\n");
 	set_bit(STATUS_READY, &priv->status);
@@ -5312,7 +5315,7 @@ static void __iwl3945_down(struct iwl_priv *priv)
 	if (!exit_pending)
 		set_bit(STATUS_EXIT_PENDING, &priv->status);
 
-	iwl_leds_unregister(priv);
+	iwl3945_led_unregister(priv);
 	iwl3945_clear_stations_table(priv);
 
 	/* Unblock any waiting calls */
Signature · 1 line
1.5.3.6
Tested-by on v1 1/1
#1 lore raw
Quoted 6 lines · Zhu Yi

This reverts commit b3489137ec7dabe4531c4344347270857301e209. This fixes the iwl3945 scan regression reported by Kalle Valo.

Conflicts:

drivers/net/wireless/iwlwifi/iwl3945-base.c

Yes, this fixes the scan crash. I applied this patch on top of the ten patches you posted earlier this week and I could associate to my AP again. Thank you for fixing this.

Noticed that your Signed-off-by line was missing.

Signature · 1 line
Kalle Valo
#2 lore raw
In reply to Zhu Yi
Quoted 2 lines · Zhu Yi

This reverts commit b3489137ec7dabe4531c4344347270857301e209. This fixes the iwl3945 scan regression reported by Kalle Valo.

Would it be best if I just didn't apply that patch in the first place?

Thanks,

John

Signature · 2 lines
John W. Linville		Linux should be at the core
[email protected]			of your literate lifestyle.
author
#3 lore raw
Quoted 4 lines · John W. Linville
Quoted 2 lines

This reverts commit b3489137ec7dabe4531c4344347270857301e209. This fixes the iwl3945 scan regression reported by Kalle Valo.

Would it be best if I just didn't apply that patch in the first place?

Sure. Just the patches after this one might not be applied cleanly. But it's obvious to fix.

Thanks,
-yi