aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2009-12-15 23:26:25 -0500
committerDavid S. Miller <davem@davemloft.net>2009-12-23 17:13:31 -0500
commit0df828f670b1fd8c469f3d60472ddca0d0f51fcf (patch)
tree37ff2a14a2238d38fc42ad7e471a62095a698790
parent9fa4d67c6e4d678271798f006ca1d945e8b2bd5c (diff)
iwmc3200top: cleanup log messages
1. add TRACE level 2. use TRACE where needed to reduce the noise 3 don't INFOEX from driver 4. add DUMP level for packets dumps 5. use correct context for the log messages Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/misc/iwmc3200top/fw-download.c26
-rw-r--r--drivers/misc/iwmc3200top/log.h31
-rw-r--r--drivers/misc/iwmc3200top/main.c25
3 files changed, 48 insertions, 34 deletions
diff --git a/drivers/misc/iwmc3200top/fw-download.c b/drivers/misc/iwmc3200top/fw-download.c
index 474be9228904..07055afef858 100644
--- a/drivers/misc/iwmc3200top/fw-download.c
+++ b/drivers/misc/iwmc3200top/fw-download.c
@@ -43,7 +43,7 @@ static int iwmct_fw_parser_init(struct iwmct_priv *priv, const u8 *file,
43 struct iwmct_parser *parser = &priv->parser; 43 struct iwmct_parser *parser = &priv->parser;
44 struct iwmct_fw_hdr *fw_hdr = &parser->versions; 44 struct iwmct_fw_hdr *fw_hdr = &parser->versions;
45 45
46 LOG_INFOEX(priv, INIT, "-->\n"); 46 LOG_TRACE(priv, FW_DOWNLOAD, "-->\n");
47 47
48 LOG_INFO(priv, FW_DOWNLOAD, "file_size=%zd\n", file_size); 48 LOG_INFO(priv, FW_DOWNLOAD, "file_size=%zd\n", file_size);
49 49
@@ -69,7 +69,7 @@ static int iwmct_fw_parser_init(struct iwmct_priv *priv, const u8 *file,
69 69
70 parser->cur_pos += sizeof(struct iwmct_fw_hdr); 70 parser->cur_pos += sizeof(struct iwmct_fw_hdr);
71 71
72 LOG_INFOEX(priv, INIT, "<--\n"); 72 LOG_TRACE(priv, FW_DOWNLOAD, "<--\n");
73 return 0; 73 return 0;
74} 74}
75 75
@@ -112,7 +112,7 @@ static int iwmct_parse_next_section(struct iwmct_priv *priv, const u8 **p_sec,
112 struct iwmct_dbg *dbg = &priv->dbg; 112 struct iwmct_dbg *dbg = &priv->dbg;
113 struct iwmct_fw_sec_hdr *sec_hdr; 113 struct iwmct_fw_sec_hdr *sec_hdr;
114 114
115 LOG_INFOEX(priv, INIT, "-->\n"); 115 LOG_TRACE(priv, FW_DOWNLOAD, "-->\n");
116 116
117 while (parser->cur_pos + sizeof(struct iwmct_fw_sec_hdr) 117 while (parser->cur_pos + sizeof(struct iwmct_fw_sec_hdr)
118 <= parser->file_size) { 118 <= parser->file_size) {
@@ -151,7 +151,7 @@ static int iwmct_parse_next_section(struct iwmct_priv *priv, const u8 **p_sec,
151 "finished with section cur_pos=%zd\n", parser->cur_pos); 151 "finished with section cur_pos=%zd\n", parser->cur_pos);
152 } 152 }
153 153
154 LOG_INFOEX(priv, INIT, "<--\n"); 154 LOG_TRACE(priv, INIT, "<--\n");
155 return 0; 155 return 0;
156} 156}
157 157
@@ -166,7 +166,7 @@ static int iwmct_download_section(struct iwmct_priv *priv, const u8 *p_sec,
166 int ret = 0; 166 int ret = 0;
167 u32 cmd = 0; 167 u32 cmd = 0;
168 168
169 LOG_INFOEX(priv, INIT, "-->\n"); 169 LOG_TRACE(priv, FW_DOWNLOAD, "-->\n");
170 LOG_INFO(priv, FW_DOWNLOAD, "Download address 0x%x size 0x%zx\n", 170 LOG_INFO(priv, FW_DOWNLOAD, "Download address 0x%x size 0x%zx\n",
171 addr, sec_size); 171 addr, sec_size);
172 172
@@ -250,7 +250,7 @@ static int iwmct_download_section(struct iwmct_priv *priv, const u8 *p_sec,
250 if (sent < sec_size) 250 if (sent < sec_size)
251 ret = -EINVAL; 251 ret = -EINVAL;
252exit: 252exit:
253 LOG_INFOEX(priv, INIT, "<--\n"); 253 LOG_TRACE(priv, FW_DOWNLOAD, "<--\n");
254 return ret; 254 return ret;
255} 255}
256 256
@@ -261,7 +261,7 @@ static int iwmct_kick_fw(struct iwmct_priv *priv, bool jump)
261 int ret; 261 int ret;
262 u32 cmd; 262 u32 cmd;
263 263
264 LOG_INFOEX(priv, INIT, "-->\n"); 264 LOG_TRACE(priv, FW_DOWNLOAD, "-->\n");
265 265
266 memset(parser->buf, 0, parser->buf_size); 266 memset(parser->buf, 0, parser->buf_size);
267 cmd = IWMC_CMD_SIGNATURE << CMD_HDR_SIGNATURE_POS; 267 cmd = IWMC_CMD_SIGNATURE << CMD_HDR_SIGNATURE_POS;
@@ -284,7 +284,7 @@ static int iwmct_kick_fw(struct iwmct_priv *priv, bool jump)
284 if (ret) 284 if (ret)
285 LOG_INFO(priv, FW_DOWNLOAD, "iwmct_tx returned %d", ret); 285 LOG_INFO(priv, FW_DOWNLOAD, "iwmct_tx returned %d", ret);
286 286
287 LOG_INFOEX(priv, INIT, "<--\n"); 287 LOG_TRACE(priv, FW_DOWNLOAD, "<--\n");
288 return 0; 288 return 0;
289} 289}
290 290
@@ -298,6 +298,16 @@ int iwmct_fw_load(struct iwmct_priv *priv)
298 int ret; 298 int ret;
299 299
300 300
301 LOG_INFO(priv, FW_DOWNLOAD, "barker download request 0x%x is:\n",
302 priv->barker);
303 LOG_INFO(priv, FW_DOWNLOAD, "******* Top FW %s requested ********\n",
304 (priv->barker & BARKER_DNLOAD_TOP_MSK) ? "was" : "not");
305 LOG_INFO(priv, FW_DOWNLOAD, "******* GPS FW %s requested ********\n",
306 (priv->barker & BARKER_DNLOAD_GPS_MSK) ? "was" : "not");
307 LOG_INFO(priv, FW_DOWNLOAD, "******* BT FW %s requested ********\n",
308 (priv->barker & BARKER_DNLOAD_BT_MSK) ? "was" : "not");
309
310
301 /* get the firmware */ 311 /* get the firmware */
302 ret = request_firmware(&raw, fw_name, &priv->func->dev); 312 ret = request_firmware(&raw, fw_name, &priv->func->dev);
303 if (ret < 0) { 313 if (ret < 0) {
diff --git a/drivers/misc/iwmc3200top/log.h b/drivers/misc/iwmc3200top/log.h
index aba8121f978c..4434bb16cea7 100644
--- a/drivers/misc/iwmc3200top/log.h
+++ b/drivers/misc/iwmc3200top/log.h
@@ -37,13 +37,26 @@
37#define LOG_SEV_INFO 3 37#define LOG_SEV_INFO 3
38#define LOG_SEV_INFOEX 4 38#define LOG_SEV_INFOEX 4
39 39
40#define LOG_SEV_FILTER_ALL \ 40/* Log levels not defined for FW */
41 (BIT(LOG_SEV_CRITICAL) | \ 41#define LOG_SEV_TRACE 5
42 BIT(LOG_SEV_ERROR) | \ 42#define LOG_SEV_DUMP 6
43 BIT(LOG_SEV_WARNING) | \ 43
44 BIT(LOG_SEV_INFO) | \ 44#define LOG_SEV_FW_FILTER_ALL \
45 (BIT(LOG_SEV_CRITICAL) | \
46 BIT(LOG_SEV_ERROR) | \
47 BIT(LOG_SEV_WARNING) | \
48 BIT(LOG_SEV_INFO) | \
45 BIT(LOG_SEV_INFOEX)) 49 BIT(LOG_SEV_INFOEX))
46 50
51#define LOG_SEV_FILTER_ALL \
52 (BIT(LOG_SEV_CRITICAL) | \
53 BIT(LOG_SEV_ERROR) | \
54 BIT(LOG_SEV_WARNING) | \
55 BIT(LOG_SEV_INFO) | \
56 BIT(LOG_SEV_INFOEX) | \
57 BIT(LOG_SEV_TRACE) | \
58 BIT(LOG_SEV_DUMP))
59
47/* log source */ 60/* log source */
48#define LOG_SRC_INIT 0 61#define LOG_SRC_INIT 0
49#define LOG_SRC_DEBUGFS 1 62#define LOG_SRC_DEBUGFS 1
@@ -104,16 +117,16 @@ do { \
104 __func__, __LINE__, ##args); \ 117 __func__, __LINE__, ##args); \
105} while (0) 118} while (0)
106 119
107#define LOG_INFOEX(priv, src, fmt, args...) \ 120#define LOG_TRACE(priv, src, fmt, args...) \
108do { \ 121do { \
109 if (iwmct_logdefs[LOG_SRC_ ## src] & BIT(LOG_SEV_INFOEX)) \ 122 if (iwmct_logdefs[LOG_SRC_ ## src] & BIT(LOG_SEV_TRACE)) \
110 dev_dbg(priv2dev(priv), "%s %d: " fmt, \ 123 dev_dbg(priv2dev(priv), "%s %d: " fmt, \
111 __func__, __LINE__, ##args); \ 124 __func__, __LINE__, ##args); \
112} while (0) 125} while (0)
113 126
114#define LOG_HEXDUMP(src, ptr, len) \ 127#define LOG_HEXDUMP(src, ptr, len) \
115do { \ 128do { \
116 if (iwmct_logdefs[LOG_SRC_ ## src] & BIT(LOG_SEV_INFOEX)) \ 129 if (iwmct_logdefs[LOG_SRC_ ## src] & BIT(LOG_SEV_DUMP)) \
117 print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_NONE, \ 130 print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_NONE, \
118 16, 1, ptr, len, false); \ 131 16, 1, ptr, len, false); \
119} while (0) 132} while (0)
@@ -142,7 +155,7 @@ ssize_t store_iwmct_log_level_fw(struct device *d,
142#define LOG_ERROR(priv, src, fmt, args...) 155#define LOG_ERROR(priv, src, fmt, args...)
143#define LOG_WARNING(priv, src, fmt, args...) 156#define LOG_WARNING(priv, src, fmt, args...)
144#define LOG_INFO(priv, src, fmt, args...) 157#define LOG_INFO(priv, src, fmt, args...)
145#define LOG_INFOEX(priv, src, fmt, args...) 158#define LOG_TRACE(priv, src, fmt, args...)
146#define LOG_HEXDUMP(src, ptr, len) 159#define LOG_HEXDUMP(src, ptr, len)
147 160
148static inline void iwmct_log_top_message(struct iwmct_priv *priv, 161static inline void iwmct_log_top_message(struct iwmct_priv *priv,
diff --git a/drivers/misc/iwmc3200top/main.c b/drivers/misc/iwmc3200top/main.c
index fafcaa481d74..38627949ff54 100644
--- a/drivers/misc/iwmc3200top/main.c
+++ b/drivers/misc/iwmc3200top/main.c
@@ -66,7 +66,7 @@ static void iwmct_rescan_worker(struct work_struct *ws)
66 66
67 ret = bus_rescan_devices(priv->func->dev.bus); 67 ret = bus_rescan_devices(priv->func->dev.bus);
68 if (ret < 0) 68 if (ret < 0)
69 LOG_INFO(priv, FW_DOWNLOAD, "bus_rescan_devices FAILED!!!\n"); 69 LOG_INFO(priv, INIT, "bus_rescan_devices FAILED!!!\n");
70} 70}
71 71
72static void op_top_message(struct iwmct_priv *priv, struct top_msg *msg) 72static void op_top_message(struct iwmct_priv *priv, struct top_msg *msg)
@@ -137,7 +137,7 @@ int iwmct_send_hcmd(struct iwmct_priv *priv, u8 *cmd, u16 len)
137 int ret; 137 int ret;
138 u8 *buf; 138 u8 *buf;
139 139
140 LOG_INFOEX(priv, FW_MSG, "Sending hcmd:\n"); 140 LOG_TRACE(priv, FW_MSG, "Sending hcmd:\n");
141 141
142 /* add padding to 256 for IWMC */ 142 /* add padding to 256 for IWMC */
143 ((struct top_msg *)cmd)->hdr.flags |= CMD_FLAG_PADDING_256; 143 ((struct top_msg *)cmd)->hdr.flags |= CMD_FLAG_PADDING_256;
@@ -192,7 +192,7 @@ static void iwmct_irq_read_worker(struct work_struct *ws)
192 192
193 priv = container_of(ws, struct iwmct_priv, isr_worker); 193 priv = container_of(ws, struct iwmct_priv, isr_worker);
194 194
195 LOG_INFO(priv, IRQ, "enter iwmct_irq_read_worker %p\n", ws); 195 LOG_TRACE(priv, IRQ, "enter iwmct_irq_read_worker %p\n", ws);
196 196
197 /* --------------------- Handshake with device -------------------- */ 197 /* --------------------- Handshake with device -------------------- */
198 sdio_claim_host(priv->func); 198 sdio_claim_host(priv->func);
@@ -292,15 +292,6 @@ static void iwmct_irq_read_worker(struct work_struct *ws)
292 292
293 sdio_release_host(priv->func); 293 sdio_release_host(priv->func);
294 294
295
296 LOG_INFO(priv, IRQ, "barker download request 0x%x is:\n", priv->barker);
297 LOG_INFO(priv, IRQ, "******* Top FW %s requested ********\n",
298 (priv->barker & BARKER_DNLOAD_TOP_MSK) ? "was" : "not");
299 LOG_INFO(priv, IRQ, "******* GPS FW %s requested ********\n",
300 (priv->barker & BARKER_DNLOAD_GPS_MSK) ? "was" : "not");
301 LOG_INFO(priv, IRQ, "******* BT FW %s requested ********\n",
302 (priv->barker & BARKER_DNLOAD_BT_MSK) ? "was" : "not");
303
304 if (priv->dbg.fw_download) 295 if (priv->dbg.fw_download)
305 iwmct_fw_load(priv); 296 iwmct_fw_load(priv);
306 else 297 else
@@ -312,7 +303,7 @@ exit_release:
312 sdio_release_host(priv->func); 303 sdio_release_host(priv->func);
313exit: 304exit:
314 kfree(buf); 305 kfree(buf);
315 LOG_INFO(priv, IRQ, "exit iwmct_irq_read_worker\n"); 306 LOG_TRACE(priv, IRQ, "exit iwmct_irq_read_worker\n");
316} 307}
317 308
318static void iwmct_irq(struct sdio_func *func) 309static void iwmct_irq(struct sdio_func *func)
@@ -325,12 +316,12 @@ static void iwmct_irq(struct sdio_func *func)
325 316
326 priv = sdio_get_drvdata(func); 317 priv = sdio_get_drvdata(func);
327 318
328 LOG_INFO(priv, IRQ, "enter iwmct_irq\n"); 319 LOG_TRACE(priv, IRQ, "enter iwmct_irq\n");
329 320
330 /* read the function's status register */ 321 /* read the function's status register */
331 val = sdio_readb(func, IWMC_SDIO_INTR_STATUS_ADDR, &ret); 322 val = sdio_readb(func, IWMC_SDIO_INTR_STATUS_ADDR, &ret);
332 323
333 LOG_INFO(priv, IRQ, "iir value = %d, ret=%d\n", val, ret); 324 LOG_TRACE(priv, IRQ, "iir value = %d, ret=%d\n", val, ret);
334 325
335 if (!val) { 326 if (!val) {
336 LOG_ERROR(priv, IRQ, "iir = 0, exiting ISR\n"); 327 LOG_ERROR(priv, IRQ, "iir = 0, exiting ISR\n");
@@ -372,7 +363,7 @@ static void iwmct_irq(struct sdio_func *func)
372 363
373 queue_work(priv->wq, &priv->isr_worker); 364 queue_work(priv->wq, &priv->isr_worker);
374 365
375 LOG_INFO(priv, IRQ, "exit iwmct_irq\n"); 366 LOG_TRACE(priv, IRQ, "exit iwmct_irq\n");
376 367
377 return; 368 return;
378 369
@@ -660,7 +651,7 @@ static int __init iwmct_init(void)
660 651
661 /* Default log filter settings */ 652 /* Default log filter settings */
662 iwmct_log_set_filter(LOG_SRC_ALL, LOG_SEV_FILTER_RUNTIME); 653 iwmct_log_set_filter(LOG_SRC_ALL, LOG_SEV_FILTER_RUNTIME);
663 iwmct_log_set_filter(LOG_SRC_FW_MSG, LOG_SEV_FILTER_ALL); 654 iwmct_log_set_filter(LOG_SRC_FW_MSG, LOG_SEV_FW_FILTER_ALL);
664 iwmct_log_set_fw_filter(LOG_SRC_ALL, FW_LOG_SEV_FILTER_RUNTIME); 655 iwmct_log_set_fw_filter(LOG_SRC_ALL, FW_LOG_SEV_FILTER_RUNTIME);
665 656
666 rc = sdio_register_driver(&iwmct_driver); 657 rc = sdio_register_driver(&iwmct_driver);