aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi
diff options
context:
space:
mode:
authorReinette Chatre <reinette.chatre@intel.com>2009-08-07 18:41:37 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-08-14 09:13:46 -0400
commit3d816c77ecb05d3a3e974a205e53392e5353553e (patch)
treed86eb434ea830d5ec43ee0a6d6aa1251fbcd67a5 /drivers/net/wireless/iwlwifi
parent34b921cf6fb4014e0e8d414492959a4725049000 (diff)
iwlwifi: re-introduce per device debugging
Commit "iwlwifi: make debug level more user friendly" cleaned up the debug level handling. In doing so it created a single global debug level for all devices. Some setups do consits of more that one iwlwifi device and in these setups there is a requirement that debug levels should be unique per device. We now re-introduce the per device debugging while maintaining the cleanup effort of the previous patch. The maintain the global debug level and now introduce a per-device debug level that will be used if it (the per-device debug level) is set. The per-device debug level can be controlled via the debug_level sysfs file while the global debug level is controlled by the debug module parameter. Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Acked-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c22
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-debug.h11
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h21
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-rx.c6
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-sta.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-tx.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c21
10 files changed, 63 insertions, 40 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index e1b0ef3c56a3..7ad020747252 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -502,14 +502,14 @@ static void _iwl3945_dbg_report_frame(struct iwl_priv *priv,
502 } 502 }
503 } 503 }
504 if (print_dump) 504 if (print_dump)
505 iwl_print_hex_dump(IWL_DL_RX, data, length); 505 iwl_print_hex_dump(priv, IWL_DL_RX, data, length);
506} 506}
507 507
508static void iwl3945_dbg_report_frame(struct iwl_priv *priv, 508static void iwl3945_dbg_report_frame(struct iwl_priv *priv,
509 struct iwl_rx_packet *pkt, 509 struct iwl_rx_packet *pkt,
510 struct ieee80211_hdr *header, int group100) 510 struct ieee80211_hdr *header, int group100)
511{ 511{
512 if (iwl_debug_level & IWL_DL_RX) 512 if (iwl_get_debug_level(priv) & IWL_DL_RX)
513 _iwl3945_dbg_report_frame(priv, pkt, header, group100); 513 _iwl3945_dbg_report_frame(priv, pkt, header, group100);
514} 514}
515 515
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index 670214823cb9..62436a90ba89 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -46,7 +46,7 @@
46#include "iwl-sta.h" 46#include "iwl-sta.h"
47 47
48static int iwl4965_send_tx_power(struct iwl_priv *priv); 48static int iwl4965_send_tx_power(struct iwl_priv *priv);
49static int iwl4965_hw_get_temperature(const struct iwl_priv *priv); 49static int iwl4965_hw_get_temperature(struct iwl_priv *priv);
50 50
51/* Highest firmware API version supported */ 51/* Highest firmware API version supported */
52#define IWL4965_UCODE_API_MAX 2 52#define IWL4965_UCODE_API_MAX 2
@@ -1680,7 +1680,7 @@ static s32 sign_extend(u32 oper, int index)
1680 * 1680 *
1681 * A return of <0 indicates bogus data in the statistics 1681 * A return of <0 indicates bogus data in the statistics
1682 */ 1682 */
1683static int iwl4965_hw_get_temperature(const struct iwl_priv *priv) 1683static int iwl4965_hw_get_temperature(struct iwl_priv *priv)
1684{ 1684{
1685 s32 temperature; 1685 s32 temperature;
1686 s32 vt; 1686 s32 vt;
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index db580cbf5982..24c1ae6b8162 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -896,7 +896,7 @@ static void iwl_irq_tasklet_legacy(struct iwl_priv *priv)
896 iwl_write32(priv, CSR_FH_INT_STATUS, inta_fh); 896 iwl_write32(priv, CSR_FH_INT_STATUS, inta_fh);
897 897
898#ifdef CONFIG_IWLWIFI_DEBUG 898#ifdef CONFIG_IWLWIFI_DEBUG
899 if (iwl_debug_level & IWL_DL_ISR) { 899 if (iwl_get_debug_level(priv) & IWL_DL_ISR) {
900 /* just for debug */ 900 /* just for debug */
901 inta_mask = iwl_read32(priv, CSR_INT_MASK); 901 inta_mask = iwl_read32(priv, CSR_INT_MASK);
902 IWL_DEBUG_ISR(priv, "inta 0x%08x, enabled 0x%08x, fh 0x%08x\n", 902 IWL_DEBUG_ISR(priv, "inta 0x%08x, enabled 0x%08x, fh 0x%08x\n",
@@ -931,7 +931,7 @@ static void iwl_irq_tasklet_legacy(struct iwl_priv *priv)
931 } 931 }
932 932
933#ifdef CONFIG_IWLWIFI_DEBUG 933#ifdef CONFIG_IWLWIFI_DEBUG
934 if (iwl_debug_level & (IWL_DL_ISR)) { 934 if (iwl_get_debug_level(priv) & (IWL_DL_ISR)) {
935 /* NIC fires this, but we don't use it, redundant with WAKEUP */ 935 /* NIC fires this, but we don't use it, redundant with WAKEUP */
936 if (inta & CSR_INT_BIT_SCD) { 936 if (inta & CSR_INT_BIT_SCD) {
937 IWL_DEBUG_ISR(priv, "Scheduler finished to transmit " 937 IWL_DEBUG_ISR(priv, "Scheduler finished to transmit "
@@ -1045,7 +1045,7 @@ static void iwl_irq_tasklet_legacy(struct iwl_priv *priv)
1045 iwl_enable_interrupts(priv); 1045 iwl_enable_interrupts(priv);
1046 1046
1047#ifdef CONFIG_IWLWIFI_DEBUG 1047#ifdef CONFIG_IWLWIFI_DEBUG
1048 if (iwl_debug_level & (IWL_DL_ISR)) { 1048 if (iwl_get_debug_level(priv) & (IWL_DL_ISR)) {
1049 inta = iwl_read32(priv, CSR_INT); 1049 inta = iwl_read32(priv, CSR_INT);
1050 inta_mask = iwl_read32(priv, CSR_INT_MASK); 1050 inta_mask = iwl_read32(priv, CSR_INT_MASK);
1051 inta_fh = iwl_read32(priv, CSR_FH_INT_STATUS); 1051 inta_fh = iwl_read32(priv, CSR_FH_INT_STATUS);
@@ -1076,7 +1076,7 @@ static void iwl_irq_tasklet(struct iwl_priv *priv)
1076 inta = priv->inta; 1076 inta = priv->inta;
1077 1077
1078#ifdef CONFIG_IWLWIFI_DEBUG 1078#ifdef CONFIG_IWLWIFI_DEBUG
1079 if (iwl_debug_level & IWL_DL_ISR) { 1079 if (iwl_get_debug_level(priv) & IWL_DL_ISR) {
1080 /* just for debug */ 1080 /* just for debug */
1081 inta_mask = iwl_read32(priv, CSR_INT_MASK); 1081 inta_mask = iwl_read32(priv, CSR_INT_MASK);
1082 IWL_DEBUG_ISR(priv, "inta 0x%08x, enabled 0x%08x\n ", 1082 IWL_DEBUG_ISR(priv, "inta 0x%08x, enabled 0x%08x\n ",
@@ -1104,7 +1104,7 @@ static void iwl_irq_tasklet(struct iwl_priv *priv)
1104 } 1104 }
1105 1105
1106#ifdef CONFIG_IWLWIFI_DEBUG 1106#ifdef CONFIG_IWLWIFI_DEBUG
1107 if (iwl_debug_level & (IWL_DL_ISR)) { 1107 if (iwl_get_debug_level(priv) & (IWL_DL_ISR)) {
1108 /* NIC fires this, but we don't use it, redundant with WAKEUP */ 1108 /* NIC fires this, but we don't use it, redundant with WAKEUP */
1109 if (inta & CSR_INT_BIT_SCD) { 1109 if (inta & CSR_INT_BIT_SCD) {
1110 IWL_DEBUG_ISR(priv, "Scheduler finished to transmit " 1110 IWL_DEBUG_ISR(priv, "Scheduler finished to transmit "
@@ -2455,15 +2455,15 @@ static int iwl_mac_get_stats(struct ieee80211_hw *hw,
2455 * 2455 *
2456 * See the level definitions in iwl for details. 2456 * See the level definitions in iwl for details.
2457 * 2457 *
2458 * FIXME This file can be deprecated as the module parameter is 2458 * The debug_level being managed using sysfs below is a per device debug
2459 * writable and users can thus also change the debug level 2459 * level that is used instead of the global debug level if it (the per
2460 * using the /sys/module/iwl3945/parameters/debug file. 2460 * device debug level) is set.
2461 */ 2461 */
2462
2463static ssize_t show_debug_level(struct device *d, 2462static ssize_t show_debug_level(struct device *d,
2464 struct device_attribute *attr, char *buf) 2463 struct device_attribute *attr, char *buf)
2465{ 2464{
2466 return sprintf(buf, "0x%08X\n", iwl_debug_level); 2465 struct iwl_priv *priv = dev_get_drvdata(d);
2466 return sprintf(buf, "0x%08X\n", iwl_get_debug_level(priv));
2467} 2467}
2468static ssize_t store_debug_level(struct device *d, 2468static ssize_t store_debug_level(struct device *d,
2469 struct device_attribute *attr, 2469 struct device_attribute *attr,
@@ -2477,7 +2477,7 @@ static ssize_t store_debug_level(struct device *d,
2477 if (ret) 2477 if (ret)
2478 IWL_ERR(priv, "%s is not in hex or decimal form.\n", buf); 2478 IWL_ERR(priv, "%s is not in hex or decimal form.\n", buf);
2479 else 2479 else
2480 iwl_debug_level = val; 2480 priv->debug_level = val;
2481 2481
2482 return strnlen(buf, count); 2482 return strnlen(buf, count);
2483} 2483}
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 2ffbd27d01d2..30f1953208ee 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -1278,7 +1278,7 @@ static void iwl_print_rx_config_cmd(struct iwl_priv *priv)
1278 struct iwl_rxon_cmd *rxon = &priv->staging_rxon; 1278 struct iwl_rxon_cmd *rxon = &priv->staging_rxon;
1279 1279
1280 IWL_DEBUG_RADIO(priv, "RX CONFIG:\n"); 1280 IWL_DEBUG_RADIO(priv, "RX CONFIG:\n");
1281 iwl_print_hex_dump(IWL_DL_RADIO, (u8 *) rxon, sizeof(*rxon)); 1281 iwl_print_hex_dump(priv, IWL_DL_RADIO, (u8 *) rxon, sizeof(*rxon));
1282 IWL_DEBUG_RADIO(priv, "u16 channel: 0x%x\n", le16_to_cpu(rxon->channel)); 1282 IWL_DEBUG_RADIO(priv, "u16 channel: 0x%x\n", le16_to_cpu(rxon->channel));
1283 IWL_DEBUG_RADIO(priv, "u32 flags: 0x%08X\n", le32_to_cpu(rxon->flags)); 1283 IWL_DEBUG_RADIO(priv, "u32 flags: 0x%08X\n", le32_to_cpu(rxon->flags));
1284 IWL_DEBUG_RADIO(priv, "u32 filter_flags: 0x%08x\n", 1284 IWL_DEBUG_RADIO(priv, "u32 filter_flags: 0x%08x\n",
@@ -1508,7 +1508,7 @@ void iwl_irq_handle_error(struct iwl_priv *priv)
1508 clear_bit(STATUS_HCMD_ACTIVE, &priv->status); 1508 clear_bit(STATUS_HCMD_ACTIVE, &priv->status);
1509 1509
1510#ifdef CONFIG_IWLWIFI_DEBUG 1510#ifdef CONFIG_IWLWIFI_DEBUG
1511 if (iwl_debug_level & IWL_DL_FW_ERRORS) { 1511 if (iwl_get_debug_level(priv) & IWL_DL_FW_ERRORS) {
1512 iwl_dump_nic_error_log(priv); 1512 iwl_dump_nic_error_log(priv);
1513 iwl_dump_nic_event_log(priv); 1513 iwl_dump_nic_event_log(priv);
1514 iwl_print_rx_config_cmd(priv); 1514 iwl_print_rx_config_cmd(priv);
@@ -1985,7 +1985,7 @@ static irqreturn_t iwl_isr(int irq, void *data)
1985 } 1985 }
1986 1986
1987#ifdef CONFIG_IWLWIFI_DEBUG 1987#ifdef CONFIG_IWLWIFI_DEBUG
1988 if (iwl_debug_level & (IWL_DL_ISR)) { 1988 if (iwl_get_debug_level(priv) & (IWL_DL_ISR)) {
1989 inta_fh = iwl_read32(priv, CSR_FH_INT_STATUS); 1989 inta_fh = iwl_read32(priv, CSR_FH_INT_STATUS);
1990 IWL_DEBUG_ISR(priv, "ISR inta 0x%08x, enabled 0x%08x, " 1990 IWL_DEBUG_ISR(priv, "ISR inta 0x%08x, enabled 0x%08x, "
1991 "fh 0x%08x\n", inta, inta_mask, inta_fh); 1991 "fh 0x%08x\n", inta, inta_mask, inta_fh);
@@ -2310,7 +2310,7 @@ void iwl_rx_pm_debug_statistics_notif(struct iwl_priv *priv,
2310 IWL_DEBUG_RADIO(priv, "Dumping %d bytes of unhandled " 2310 IWL_DEBUG_RADIO(priv, "Dumping %d bytes of unhandled "
2311 "notification for %s:\n", 2311 "notification for %s:\n",
2312 le32_to_cpu(pkt->len), get_cmd_string(pkt->hdr.cmd)); 2312 le32_to_cpu(pkt->len), get_cmd_string(pkt->hdr.cmd));
2313 iwl_print_hex_dump(IWL_DL_RADIO, pkt->u.raw, le32_to_cpu(pkt->len)); 2313 iwl_print_hex_dump(priv, IWL_DL_RADIO, pkt->u.raw, le32_to_cpu(pkt->len));
2314} 2314}
2315EXPORT_SYMBOL(iwl_rx_pm_debug_statistics_notif); 2315EXPORT_SYMBOL(iwl_rx_pm_debug_statistics_notif);
2316 2316
diff --git a/drivers/net/wireless/iwlwifi/iwl-debug.h b/drivers/net/wireless/iwlwifi/iwl-debug.h
index fbe177608bc7..09af046927ab 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debug.h
+++ b/drivers/net/wireless/iwlwifi/iwl-debug.h
@@ -46,7 +46,7 @@ do { \
46#ifdef CONFIG_IWLWIFI_DEBUG 46#ifdef CONFIG_IWLWIFI_DEBUG
47#define IWL_DEBUG(__priv, level, fmt, args...) \ 47#define IWL_DEBUG(__priv, level, fmt, args...) \
48do { \ 48do { \
49 if (iwl_debug_level & (level)) \ 49 if (iwl_get_debug_level(__priv) & (level)) \
50 dev_printk(KERN_ERR, &(__priv->hw->wiphy->dev), \ 50 dev_printk(KERN_ERR, &(__priv->hw->wiphy->dev), \
51 "%c %s " fmt, in_interrupt() ? 'I' : 'U', \ 51 "%c %s " fmt, in_interrupt() ? 'I' : 'U', \
52 __func__ , ## args); \ 52 __func__ , ## args); \
@@ -54,15 +54,15 @@ do { \
54 54
55#define IWL_DEBUG_LIMIT(__priv, level, fmt, args...) \ 55#define IWL_DEBUG_LIMIT(__priv, level, fmt, args...) \
56do { \ 56do { \
57 if ((iwl_debug_level & (level)) && net_ratelimit()) \ 57 if ((iwl_get_debug_level(__priv) & (level)) && net_ratelimit()) \
58 dev_printk(KERN_ERR, &(__priv->hw->wiphy->dev), \ 58 dev_printk(KERN_ERR, &(__priv->hw->wiphy->dev), \
59 "%c %s " fmt, in_interrupt() ? 'I' : 'U', \ 59 "%c %s " fmt, in_interrupt() ? 'I' : 'U', \
60 __func__ , ## args); \ 60 __func__ , ## args); \
61} while (0) 61} while (0)
62 62
63#define iwl_print_hex_dump(level, p, len) \ 63#define iwl_print_hex_dump(priv, level, p, len) \
64do { \ 64do { \
65 if (iwl_debug_level & level) \ 65 if (iwl_get_debug_level(priv) & level) \
66 print_hex_dump(KERN_DEBUG, "iwl data: ", \ 66 print_hex_dump(KERN_DEBUG, "iwl data: ", \
67 DUMP_PREFIX_OFFSET, 16, 1, p, len, 1); \ 67 DUMP_PREFIX_OFFSET, 16, 1, p, len, 1); \
68} while (0) 68} while (0)
@@ -106,7 +106,8 @@ void iwl_dbgfs_unregister(struct iwl_priv *priv);
106#else 106#else
107#define IWL_DEBUG(__priv, level, fmt, args...) 107#define IWL_DEBUG(__priv, level, fmt, args...)
108#define IWL_DEBUG_LIMIT(__priv, level, fmt, args...) 108#define IWL_DEBUG_LIMIT(__priv, level, fmt, args...)
109static inline void iwl_print_hex_dump(int level, void *p, u32 len) 109static inline void iwl_print_hex_dump(struct iwl_priv *priv, int level,
110 void *p, u32 len)
110{} 111{}
111#endif /* CONFIG_IWLWIFI_DEBUG */ 112#endif /* CONFIG_IWLWIFI_DEBUG */
112 113
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index cab6255210d5..1bf3e4ccc5d9 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -1175,6 +1175,8 @@ struct iwl_priv {
1175 1175
1176#ifdef CONFIG_IWLWIFI_DEBUG 1176#ifdef CONFIG_IWLWIFI_DEBUG
1177 /* debugging info */ 1177 /* debugging info */
1178 u32 debug_level; /* per device debugging will override global
1179 iwl_debug_level if set */
1178 u32 framecnt_to_us; 1180 u32 framecnt_to_us;
1179 atomic_t restrict_refcnt; 1181 atomic_t restrict_refcnt;
1180 bool disable_ht40; 1182 bool disable_ht40;
@@ -1211,8 +1213,27 @@ static inline void iwl_txq_ctx_deactivate(struct iwl_priv *priv, int txq_id)
1211 1213
1212#ifdef CONFIG_IWLWIFI_DEBUG 1214#ifdef CONFIG_IWLWIFI_DEBUG
1213const char *iwl_get_tx_fail_reason(u32 status); 1215const char *iwl_get_tx_fail_reason(u32 status);
1216/*
1217 * iwl_get_debug_level: Return active debug level for device
1218 *
1219 * Using sysfs it is possible to set per device debug level. This debug
1220 * level will be used if set, otherwise the global debug level which can be
1221 * set via module parameter is used.
1222 */
1223static inline u32 iwl_get_debug_level(struct iwl_priv *priv)
1224{
1225 if (priv->debug_level)
1226 return priv->debug_level;
1227 else
1228 return iwl_debug_level;
1229}
1214#else 1230#else
1215static inline const char *iwl_get_tx_fail_reason(u32 status) { return ""; } 1231static inline const char *iwl_get_tx_fail_reason(u32 status) { return ""; }
1232
1233static inline u32 iwl_get_debug_level(struct iwl_priv *priv)
1234{
1235 return iwl_debug_level;
1236}
1216#endif 1237#endif
1217 1238
1218 1239
diff --git a/drivers/net/wireless/iwlwifi/iwl-rx.c b/drivers/net/wireless/iwlwifi/iwl-rx.c
index e002c8b56c49..98f014276e6d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-rx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-rx.c
@@ -645,7 +645,7 @@ static void iwl_dbg_report_frame(struct iwl_priv *priv,
645 u32 tsf_low; 645 u32 tsf_low;
646 int rssi; 646 int rssi;
647 647
648 if (likely(!(iwl_debug_level & IWL_DL_RX))) 648 if (likely(!(iwl_get_debug_level(priv) & IWL_DL_RX)))
649 return; 649 return;
650 650
651 /* MAC header */ 651 /* MAC header */
@@ -741,7 +741,7 @@ static void iwl_dbg_report_frame(struct iwl_priv *priv,
741 } 741 }
742 } 742 }
743 if (print_dump) 743 if (print_dump)
744 iwl_print_hex_dump(IWL_DL_RX, header, length); 744 iwl_print_hex_dump(priv, IWL_DL_RX, header, length);
745} 745}
746#endif 746#endif
747 747
@@ -1060,7 +1060,7 @@ void iwl_rx_reply_rx(struct iwl_priv *priv,
1060 1060
1061 /* Set "1" to report good data frames in groups of 100 */ 1061 /* Set "1" to report good data frames in groups of 100 */
1062#ifdef CONFIG_IWLWIFI_DEBUG 1062#ifdef CONFIG_IWLWIFI_DEBUG
1063 if (unlikely(iwl_debug_level & IWL_DL_RX)) 1063 if (unlikely(iwl_get_debug_level(priv) & IWL_DL_RX))
1064 iwl_dbg_report_frame(priv, rx_start, len, header, 1); 1064 iwl_dbg_report_frame(priv, rx_start, len, header, 1);
1065#endif 1065#endif
1066 IWL_DEBUG_STATS_LIMIT(priv, "Rssi %d, noise %d, qual %d, TSF %llu\n", 1066 IWL_DEBUG_STATS_LIMIT(priv, "Rssi %d, noise %d, qual %d, TSF %llu\n",
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c
index efcae0d5e193..def12545d9a9 100644
--- a/drivers/net/wireless/iwlwifi/iwl-sta.c
+++ b/drivers/net/wireless/iwlwifi/iwl-sta.c
@@ -1088,7 +1088,7 @@ int iwl_get_sta_id(struct iwl_priv *priv, struct ieee80211_hdr *hdr)
1088 IWL_DEBUG_DROP(priv, "Station %pM not in station map. " 1088 IWL_DEBUG_DROP(priv, "Station %pM not in station map. "
1089 "Defaulting to broadcast...\n", 1089 "Defaulting to broadcast...\n",
1090 hdr->addr1); 1090 hdr->addr1);
1091 iwl_print_hex_dump(IWL_DL_DROP, (u8 *) hdr, sizeof(*hdr)); 1091 iwl_print_hex_dump(priv, IWL_DL_DROP, (u8 *) hdr, sizeof(*hdr));
1092 return priv->hw_params.bcast_sta_id; 1092 return priv->hw_params.bcast_sta_id;
1093 1093
1094 default: 1094 default:
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c
index 288b871e974b..0cac06c43f9a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-tx.c
@@ -884,8 +884,8 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
884 IWL_DEBUG_TX(priv, "sequence nr = 0X%x \n", 884 IWL_DEBUG_TX(priv, "sequence nr = 0X%x \n",
885 le16_to_cpu(out_cmd->hdr.sequence)); 885 le16_to_cpu(out_cmd->hdr.sequence));
886 IWL_DEBUG_TX(priv, "tx_flags = 0X%x \n", le32_to_cpu(tx_cmd->tx_flags)); 886 IWL_DEBUG_TX(priv, "tx_flags = 0X%x \n", le32_to_cpu(tx_cmd->tx_flags));
887 iwl_print_hex_dump(IWL_DL_TX, (u8 *)tx_cmd, sizeof(*tx_cmd)); 887 iwl_print_hex_dump(priv, IWL_DL_TX, (u8 *)tx_cmd, sizeof(*tx_cmd));
888 iwl_print_hex_dump(IWL_DL_TX, (u8 *)tx_cmd->hdr, hdr_len); 888 iwl_print_hex_dump(priv, IWL_DL_TX, (u8 *)tx_cmd->hdr, hdr_len);
889 889
890 /* Set up entry for this TFD in Tx byte-count array */ 890 /* Set up entry for this TFD in Tx byte-count array */
891 if (info->flags & IEEE80211_TX_CTL_AMPDU) 891 if (info->flags & IEEE80211_TX_CTL_AMPDU)
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index ea051b739ba2..0babce250ea4 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -614,8 +614,8 @@ static int iwl3945_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
614 IWL_DEBUG_TX(priv, "sequence nr = 0X%x \n", 614 IWL_DEBUG_TX(priv, "sequence nr = 0X%x \n",
615 le16_to_cpu(out_cmd->hdr.sequence)); 615 le16_to_cpu(out_cmd->hdr.sequence));
616 IWL_DEBUG_TX(priv, "tx_flags = 0X%x \n", le32_to_cpu(tx->tx_flags)); 616 IWL_DEBUG_TX(priv, "tx_flags = 0X%x \n", le32_to_cpu(tx->tx_flags));
617 iwl_print_hex_dump(IWL_DL_TX, tx, sizeof(*tx)); 617 iwl_print_hex_dump(priv, IWL_DL_TX, tx, sizeof(*tx));
618 iwl_print_hex_dump(IWL_DL_TX, (u8 *)tx->hdr, 618 iwl_print_hex_dump(priv, IWL_DL_TX, (u8 *)tx->hdr,
619 ieee80211_hdrlen(fc)); 619 ieee80211_hdrlen(fc));
620 620
621 /* 621 /*
@@ -1646,7 +1646,7 @@ static void iwl3945_irq_tasklet(struct iwl_priv *priv)
1646 iwl_write32(priv, CSR_FH_INT_STATUS, inta_fh); 1646 iwl_write32(priv, CSR_FH_INT_STATUS, inta_fh);
1647 1647
1648#ifdef CONFIG_IWLWIFI_DEBUG 1648#ifdef CONFIG_IWLWIFI_DEBUG
1649 if (iwl_debug_level & IWL_DL_ISR) { 1649 if (iwl_get_debug_level(priv) & IWL_DL_ISR) {
1650 /* just for debug */ 1650 /* just for debug */
1651 inta_mask = iwl_read32(priv, CSR_INT_MASK); 1651 inta_mask = iwl_read32(priv, CSR_INT_MASK);
1652 IWL_DEBUG_ISR(priv, "inta 0x%08x, enabled 0x%08x, fh 0x%08x\n", 1652 IWL_DEBUG_ISR(priv, "inta 0x%08x, enabled 0x%08x, fh 0x%08x\n",
@@ -1681,7 +1681,7 @@ static void iwl3945_irq_tasklet(struct iwl_priv *priv)
1681 } 1681 }
1682 1682
1683#ifdef CONFIG_IWLWIFI_DEBUG 1683#ifdef CONFIG_IWLWIFI_DEBUG
1684 if (iwl_debug_level & (IWL_DL_ISR)) { 1684 if (iwl_get_debug_level(priv) & (IWL_DL_ISR)) {
1685 /* NIC fires this, but we don't use it, redundant with WAKEUP */ 1685 /* NIC fires this, but we don't use it, redundant with WAKEUP */
1686 if (inta & CSR_INT_BIT_SCD) { 1686 if (inta & CSR_INT_BIT_SCD) {
1687 IWL_DEBUG_ISR(priv, "Scheduler finished to transmit " 1687 IWL_DEBUG_ISR(priv, "Scheduler finished to transmit "
@@ -1760,7 +1760,7 @@ static void iwl3945_irq_tasklet(struct iwl_priv *priv)
1760 iwl_enable_interrupts(priv); 1760 iwl_enable_interrupts(priv);
1761 1761
1762#ifdef CONFIG_IWLWIFI_DEBUG 1762#ifdef CONFIG_IWLWIFI_DEBUG
1763 if (iwl_debug_level & (IWL_DL_ISR)) { 1763 if (iwl_get_debug_level(priv) & (IWL_DL_ISR)) {
1764 inta = iwl_read32(priv, CSR_INT); 1764 inta = iwl_read32(priv, CSR_INT);
1765 inta_mask = iwl_read32(priv, CSR_INT_MASK); 1765 inta_mask = iwl_read32(priv, CSR_INT_MASK);
1766 inta_fh = iwl_read32(priv, CSR_FH_INT_STATUS); 1766 inta_fh = iwl_read32(priv, CSR_FH_INT_STATUS);
@@ -3311,14 +3311,15 @@ static int iwl3945_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
3311 * 3311 *
3312 * See the level definitions in iwl for details. 3312 * See the level definitions in iwl for details.
3313 * 3313 *
3314 * FIXME This file can be deprecated as the module parameter is 3314 * The debug_level being managed using sysfs below is a per device debug
3315 * writable and users can thus also change the debug level 3315 * level that is used instead of the global debug level if it (the per
3316 * using the /sys/module/iwl3945/parameters/debug file. 3316 * device debug level) is set.
3317 */ 3317 */
3318static ssize_t show_debug_level(struct device *d, 3318static ssize_t show_debug_level(struct device *d,
3319 struct device_attribute *attr, char *buf) 3319 struct device_attribute *attr, char *buf)
3320{ 3320{
3321 return sprintf(buf, "0x%08X\n", iwl_debug_level); 3321 struct iwl_priv *priv = dev_get_drvdata(d);
3322 return sprintf(buf, "0x%08X\n", iwl_get_debug_level(priv));
3322} 3323}
3323static ssize_t store_debug_level(struct device *d, 3324static ssize_t store_debug_level(struct device *d,
3324 struct device_attribute *attr, 3325 struct device_attribute *attr,
@@ -3332,7 +3333,7 @@ static ssize_t store_debug_level(struct device *d,
3332 if (ret) 3333 if (ret)
3333 IWL_INFO(priv, "%s is not in hex or decimal form.\n", buf); 3334 IWL_INFO(priv, "%s is not in hex or decimal form.\n", buf);
3334 else 3335 else
3335 iwl_debug_level = val; 3336 priv->debug_level = val;
3336 3337
3337 return strnlen(buf, count); 3338 return strnlen(buf, count);
3338} 3339}