aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVladimir Zapolskiy <vz@mleia.com>2011-08-20 17:15:55 -0400
committerDavid S. Miller <davem@davemloft.net>2011-08-20 17:15:55 -0400
commit2e025c71ce3dbfb5ddb7f2e4bb67ac11b65f8dd2 (patch)
treefe25f21d36a1aca3445ce6d88c4416494afdfa46
parent823dcd2506fa369aeb8cbd26da5663efe2fda9a9 (diff)
dm9000: define debug level as a module parameter
This change allows to get driver specific debug messages output providing a module parameter. As far as the maximum level of verbosity is too high, it is demoted by default. Signed-off-by: Vladimir Zapolskiy <vz@mleia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/davicom/Kconfig8
-rw-r--r--drivers/net/ethernet/davicom/dm9000.c11
2 files changed, 8 insertions, 11 deletions
diff --git a/drivers/net/ethernet/davicom/Kconfig b/drivers/net/ethernet/davicom/Kconfig
index 1809d25d6eda..73c5d2080f24 100644
--- a/drivers/net/ethernet/davicom/Kconfig
+++ b/drivers/net/ethernet/davicom/Kconfig
@@ -13,14 +13,6 @@ config DM9000
13 To compile this driver as a module, choose M here. The module 13 To compile this driver as a module, choose M here. The module
14 will be called dm9000. 14 will be called dm9000.
15 15
16config DM9000_DEBUGLEVEL
17 int "DM9000 maximum debug level"
18 depends on DM9000
19 default 4
20 ---help---
21 The maximum level of debugging code compiled into the DM9000
22 driver.
23
24config DM9000_FORCE_SIMPLE_PHY_POLL 16config DM9000_FORCE_SIMPLE_PHY_POLL
25 bool "Force simple NSR based PHY polling" 17 bool "Force simple NSR based PHY polling"
26 depends on DM9000 18 depends on DM9000
diff --git a/drivers/net/ethernet/davicom/dm9000.c b/drivers/net/ethernet/davicom/dm9000.c
index 24d61e14f9cd..438f4580bf66 100644
--- a/drivers/net/ethernet/davicom/dm9000.c
+++ b/drivers/net/ethernet/davicom/dm9000.c
@@ -56,6 +56,13 @@ static int watchdog = 5000;
56module_param(watchdog, int, 0400); 56module_param(watchdog, int, 0400);
57MODULE_PARM_DESC(watchdog, "transmit timeout in milliseconds"); 57MODULE_PARM_DESC(watchdog, "transmit timeout in milliseconds");
58 58
59/*
60 * Debug messages level
61 */
62static int debug;
63module_param(debug, int, 0644);
64MODULE_PARM_DESC(debug, "dm9000 debug level (0-4)");
65
59/* DM9000 register address locking. 66/* DM9000 register address locking.
60 * 67 *
61 * The DM9000 uses an address register to control where data written 68 * The DM9000 uses an address register to control where data written
@@ -103,7 +110,6 @@ typedef struct board_info {
103 unsigned int flags; 110 unsigned int flags;
104 unsigned int in_suspend :1; 111 unsigned int in_suspend :1;
105 unsigned int wake_supported :1; 112 unsigned int wake_supported :1;
106 int debug_level;
107 113
108 enum dm9000_type type; 114 enum dm9000_type type;
109 115
@@ -138,8 +144,7 @@ typedef struct board_info {
138/* debug code */ 144/* debug code */
139 145
140#define dm9000_dbg(db, lev, msg...) do { \ 146#define dm9000_dbg(db, lev, msg...) do { \
141 if ((lev) < CONFIG_DM9000_DEBUGLEVEL && \ 147 if ((lev) < debug) { \
142 (lev) < db->debug_level) { \
143 dev_dbg(db->dev, msg); \ 148 dev_dbg(db->dev, msg); \
144 } \ 149 } \
145} while (0) 150} while (0)