Skip to contentSkip to conversation

rtlwifi: add module parameter to set global debug level

PATCH Superseded Stefan Assmann 2 participants 3 messages Aug 12, 2011 – Aug 13, 2011 Networking drivers (wireless)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rtlwifi: add module parameter to set global debug level

Adding a module parameter to allow setting the global debug level. No need to recompile the module anymore to set the debug level.

---
 drivers/net/wireless/rtlwifi/debug.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
drivers/net/wireless/rtlwifi/debug.c +5 -1
index 5fa7385..1d82639 100644
@@ -28,12 +28,16 @@
 
 #include "wifi.h"
 
+static unsigned int debug = DBG_EMERG;
+module_param(debug, uint, 0);
+MODULE_PARM_DESC(debug, "Set global debug level for rtlwifi (uint)");
+
 void rtl_dbgp_flag_init(struct ieee80211_hw *hw)
 {
 	struct rtl_priv *rtlpriv = rtl_priv(hw);
 	u8 i;
 
-	rtlpriv->dbg.global_debuglevel = DBG_EMERG;
+	rtlpriv->dbg.global_debuglevel = debug;
 
 	rtlpriv->dbg.global_debugcomponents =
 	    COMP_ERR | COMP_FW | COMP_INIT | COMP_RECV | COMP_SEND |
Signature · 1 line
1.7.6
#1 lore raw
Quoted 13 lines · Stefan Assmann

Adding a module parameter to allow setting the global debug level. No need to recompile the module anymore to set the debug level.

---
  drivers/net/wireless/rtlwifi/debug.c |    6 +++++-
  1 files changed, 5 insertions(+), 1 deletions(-)
drivers/net/wireless/rtlwifi/debug.c +0 -0
index 5fa7385..1d82639 100644

drivers/net/wireless/rtlwifi/debug.c line 33

Quoted 6 lines
drivers/net/wireless/rtlwifi/debug.c +3 -0
@@ -28,12 +28,16 @@
 
  #include "wifi.h"
 
+static unsigned int debug = DBG_EMERG;
+module_param(debug, uint, 0);
+MODULE_PARM_DESC(debug, "Set global debug level for rtlwifi (uint)");

As the system puts a (uint) following the description when the modinfo command is used, the one above is redundant. Replace it with (0,2-5) instead. I have no idea why there is a hole in the debug levels, but I hesitate to close it. Also, send patches to John Linville with Cc to wireless.

Thanks for doing this. I'll sign off on it when you send V2.

Larry

Quoted 11 lines
drivers/net/wireless/rtlwifi/debug.c +2 -1
+
  void rtl_dbgp_flag_init(struct ieee80211_hw *hw)
  {
  	struct rtl_priv *rtlpriv = rtl_priv(hw);
  	u8 i;
 
-	rtlpriv->dbg.global_debuglevel = DBG_EMERG;
+	rtlpriv->dbg.global_debuglevel = debug;
 
  	rtlpriv->dbg.global_debugcomponents =
  	    COMP_ERR | COMP_FW | COMP_INIT | COMP_RECV | COMP_SEND |
#2 lore raw
Quoted 26 lines · Larry Finger
Quoted 13 lines · Stefan Assmann

Adding a module parameter to allow setting the global debug level. No need to recompile the module anymore to set the debug level.

---
  drivers/net/wireless/rtlwifi/debug.c |    6 +++++-
  1 files changed, 5 insertions(+), 1 deletions(-)
drivers/net/wireless/rtlwifi/debug.c +0 -0
index 5fa7385..1d82639 100644

drivers/net/wireless/rtlwifi/debug.c line 33

Quoted 6 lines
drivers/net/wireless/rtlwifi/debug.c +3 -0
@@ -28,12 +28,16 @@
 
  #include "wifi.h"
 
+static unsigned int debug = DBG_EMERG;
+module_param(debug, uint, 0);
+MODULE_PARM_DESC(debug, "Set global debug level for rtlwifi (uint)");

As the system puts a (uint) following the description when the modinfo command is used, the one above is redundant. Replace it with (0,2-5) instead. I have no idea why there is a hole in the debug levels, but I hesitate to close it. Also, send patches to John Linville with Cc to wireless.

Quoted 1 line

Thanks for doing this. I'll sign off on it when you send V2.

Snap, I missed that. Thanks for pointing it out. V2 should be coming around shortly.

Stefan