depends on IWLCORE
 
 config IWLWIFI_DEBUG
-       bool "Enable full debugging output in iwlagn driver"
+       bool "Enable full debugging output in iwlagn and iwl3945 drivers"
        depends on IWLCORE
        ---help---
          This option will enable debug tracing output for the iwlwifi drivers
        depends on IWL3945
        ---help---
          This option enables LEDS for the iwl3945 driver.
-
-config IWL3945_DEBUG
-       bool "Enable full debugging output in iwl3945 driver"
-       depends on IWL3945
-       ---help---
-         This option will enable debug tracing output for the iwl3945
-         driver.
-
-         This will result in the kernel module being ~100k larger.  You can
-         control which debug output is sent to the kernel log by setting the
-         value in
-
-                 /sys/bus/pci/drivers/${DRIVER}/debug_level
-
-         This entry will only exist if this option is enabled.
-
-         To set a value, simply echo an 8-byte hex value to the same file:
-
-                 % echo 0x43fff > /sys/bus/pci/drivers/${DRIVER}/debug_level
-
-         You can find the list of debug mask values in:
-                 drivers/net/wireless/iwlwifi/iwl-3945-debug.h
-
-         If this is your first time using this driver, you should say Y here
-         as the debug information can assist others in helping you resolve
-         any problems you may encounter.
-
 
        return 0;               /* "diversity" is default if error */
 }
 
-#ifdef CONFIG_IWL3945_DEBUG
+#ifdef CONFIG_IWLWIFI_DEBUG
 #define TX_STATUS_ENTRY(x) case TX_STATUS_FAIL_ ## x: return #x
 
 static const char *iwl3945_get_tx_fail_reason(u32 status)
  * Misc. internal state and helper functions
  *
  ******************************************************************************/
-#ifdef CONFIG_IWL3945_DEBUG
+#ifdef CONFIG_IWLWIFI_DEBUG
 
 /**
  * iwl3945_report_frame - dump frame to syslog during debug sessions
  * including selective frame dumps.
  * group100 parameter selects whether to show 1 out of 100 good frames.
  */
-static void iwl3945_dbg_report_frame(struct iwl_priv *priv,
+static void _iwl3945_dbg_report_frame(struct iwl_priv *priv,
                      struct iwl_rx_packet *pkt,
                      struct ieee80211_hdr *header, int group100)
 {
        if (print_dump)
                iwl_print_hex_dump(priv, IWL_DL_RX, data, length);
 }
+
+static void iwl3945_dbg_report_frame(struct iwl_priv *priv,
+                     struct iwl_rx_packet *pkt,
+                     struct ieee80211_hdr *header, int group100)
+{
+       if (priv->debug_level & IWL_DL_RX)
+               _iwl3945_dbg_report_frame(priv, pkt, header, group100);
+}
+
 #else
 static inline void iwl3945_dbg_report_frame(struct iwl_priv *priv,
                      struct iwl_rx_packet *pkt,
                              rx_status.signal, rx_status.signal,
                              rx_status.noise, rx_status.rate_idx);
 
-#ifdef CONFIG_IWL3945_DEBUG
-       if (priv->debug_level & (IWL_DL_RX))
-               /* Set "1" to report good data frames in groups of 100 */
-               iwl3945_dbg_report_frame(priv, pkt, header, 1);
-#endif
+       /* Set "1" to report good data frames in groups of 100 */
+       iwl3945_dbg_report_frame(priv, pkt, header, 1);
 
        if (network_packet) {
                priv->last_beacon_time = le32_to_cpu(rx_end->beacon_timestamp);
 
 #define DRV_DESCRIPTION        \
 "Intel(R) PRO/Wireless 3945ABG/BG Network Connection driver for Linux"
 
-#ifdef CONFIG_IWL3945_DEBUG
+#ifdef CONFIG_IWLWIFI_DEBUG
 #define VD "d"
 #else
 #define VD
 
        fc = hdr->frame_control;
 
-#ifdef CONFIG_IWL3945_DEBUG
+#ifdef CONFIG_IWLWIFI_DEBUG
        if (ieee80211_is_auth(fc))
                IWL_DEBUG_TX("Sending AUTH frame\n");
        else if (ieee80211_is_assoc_req(fc))
 static void iwl3945_rx_pm_sleep_notif(struct iwl_priv *priv,
                                  struct iwl_rx_mem_buffer *rxb)
 {
-#ifdef CONFIG_IWL3945_DEBUG
+#ifdef CONFIG_IWLWIFI_DEBUG
        struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
        struct iwl_sleep_notification *sleep = &(pkt->u.sleep_notif);
        IWL_DEBUG_RX("sleep mode: %d, src: %d\n",
 static void iwl3945_rx_beacon_notif(struct iwl_priv *priv,
                                struct iwl_rx_mem_buffer *rxb)
 {
-#ifdef CONFIG_IWL3945_DEBUG
+#ifdef CONFIG_IWLWIFI_DEBUG
        struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
        struct iwl3945_beacon_notif *beacon = &(pkt->u.beacon_status);
        u8 rate = beacon->beacon_notify_hdr.rate;
 static void iwl3945_rx_reply_scan(struct iwl_priv *priv,
                              struct iwl_rx_mem_buffer *rxb)
 {
-#ifdef CONFIG_IWL3945_DEBUG
+#ifdef CONFIG_IWLWIFI_DEBUG
        struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
        struct iwl_scanreq_notification *notif =
            (struct iwl_scanreq_notification *)pkt->u.raw;
        iwl3945_rx_queue_restock(priv);
 }
 
-#ifdef CONFIG_IWL3945_DEBUG
+#ifdef CONFIG_IWLWIFI_DEBUG
 static void iwl3945_print_rx_config_cmd(struct iwl_priv *priv,
                                        struct iwl3945_rxon_cmd *rxon)
 {
        /* Cancel currently queued command. */
        clear_bit(STATUS_HCMD_ACTIVE, &priv->status);
 
-#ifdef CONFIG_IWL3945_DEBUG
+#ifdef CONFIG_IWLWIFI_DEBUG
        if (priv->debug_level & IWL_DL_FW_ERRORS) {
                iwl3945_dump_nic_error_log(priv);
                iwl3945_dump_nic_event_log(priv);
        u32 inta, handled = 0;
        u32 inta_fh;
        unsigned long flags;
-#ifdef CONFIG_IWL3945_DEBUG
+#ifdef CONFIG_IWLWIFI_DEBUG
        u32 inta_mask;
 #endif
 
        inta_fh = iwl_read32(priv, CSR_FH_INT_STATUS);
        iwl_write32(priv, CSR_FH_INT_STATUS, inta_fh);
 
-#ifdef CONFIG_IWL3945_DEBUG
+#ifdef CONFIG_IWLWIFI_DEBUG
        if (priv->debug_level & IWL_DL_ISR) {
                /* just for debug */
                inta_mask = iwl_read32(priv, CSR_INT_MASK);
                return;
        }
 
-#ifdef CONFIG_IWL3945_DEBUG
+#ifdef CONFIG_IWLWIFI_DEBUG
        if (priv->debug_level & (IWL_DL_ISR)) {
                /* NIC fires this, but we don't use it, redundant with WAKEUP */
                if (inta & CSR_INT_BIT_SCD)
        if (test_bit(STATUS_INT_ENABLED, &priv->status))
                iwl3945_enable_interrupts(priv);
 
-#ifdef CONFIG_IWL3945_DEBUG
+#ifdef CONFIG_IWLWIFI_DEBUG
        if (priv->debug_level & (IWL_DL_ISR)) {
                inta = iwl_read32(priv, CSR_INT);
                inta_mask = iwl_read32(priv, CSR_INT_MASK);
  *
  *****************************************************************************/
 
-#ifdef CONFIG_IWL3945_DEBUG
+#ifdef CONFIG_IWLWIFI_DEBUG
 
 /*
  * The following adds a new attribute to the sysfs representation
 static DEVICE_ATTR(debug_level, S_IWUSR | S_IRUGO,
                        show_debug_level, store_debug_level);
 
-#endif /* CONFIG_IWL3945_DEBUG */
+#endif /* CONFIG_IWLWIFI_DEBUG */
 
 static ssize_t show_temperature(struct device *d,
                                struct device_attribute *attr, char *buf)
        &dev_attr_status.attr,
        &dev_attr_temperature.attr,
        &dev_attr_tx_power.attr,
-#ifdef CONFIG_IWL3945_DEBUG
+#ifdef CONFIG_IWLWIFI_DEBUG
        &dev_attr_debug_level.attr,
 #endif
        NULL
        priv->cfg = cfg;
        priv->pci_dev = pdev;
 
-#ifdef CONFIG_IWL3945_DEBUG
+#ifdef CONFIG_IWLWIFI_DEBUG
        priv->debug_level = iwl3945_mod_params.debug;
        atomic_set(&priv->restrict_refcnt, 0);
 #endif