Skip to content

Commit

Permalink
rtlwifi: Change debug parameter to apply to individual drivers
Browse files Browse the repository at this point in the history
The current debug parameter is applied to rtlwifi, which means that all
loaded drivers have the same level of debugging applied. In addition,
the previous method requires a two-step load process to enable debugging.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Larry Finger authored and John W. Linville committed Oct 11, 2011
1 parent d529497 commit 73a253c
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 6 deletions.
6 changes: 0 additions & 6 deletions drivers/net/wireless/rtlwifi/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,11 @@

#include "wifi.h"

static unsigned int debug = DBG_EMERG;
module_param(debug, uint, 0);
MODULE_PARM_DESC(debug, "Set global debug level for rtlwifi (0,2-5)");

void rtl_dbgp_flag_init(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
u8 i;

rtlpriv->dbg.global_debuglevel = debug;

rtlpriv->dbg.global_debugcomponents =
COMP_ERR | COMP_FW | COMP_INIT | COMP_RECV | COMP_SEND |
COMP_MLME | COMP_SCAN | COMP_INTR | COMP_LED | COMP_SEC |
Expand Down
5 changes: 5 additions & 0 deletions drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ int rtl92c_init_sw_vars(struct ieee80211_hw *hw)

rtlpci->irq_mask[1] = (u32) (IMR_CPWM | IMR_C2HCMD | 0);

/* for debug level */
rtlpriv->dbg.global_debuglevel = rtlpriv->cfg->mod_params->debug;
/* for LPS & IPS */
rtlpriv->psc.inactiveps = rtlpriv->cfg->mod_params->inactiveps;
rtlpriv->psc.swctrl_lps = rtlpriv->cfg->mod_params->swctrl_lps;
Expand Down Expand Up @@ -245,6 +247,7 @@ static struct rtl_mod_params rtl92ce_mod_params = {
.inactiveps = true,
.swctrl_lps = false,
.fwctrl_lps = true,
.debug = DBG_EMERG,
};

static struct rtl_hal_cfg rtl92ce_hal_cfg = {
Expand Down Expand Up @@ -357,13 +360,15 @@ MODULE_DESCRIPTION("Realtek 8192C/8188C 802.11n PCI wireless");
MODULE_FIRMWARE("rtlwifi/rtl8192cfw.bin");

module_param_named(swenc, rtl92ce_mod_params.sw_crypto, bool, 0444);
module_param_named(debug, rtl92ce_mod_params.debug, int, 0444);
module_param_named(ips, rtl92ce_mod_params.inactiveps, bool, 0444);
module_param_named(swlps, rtl92ce_mod_params.swctrl_lps, bool, 0444);
module_param_named(fwlps, rtl92ce_mod_params.fwctrl_lps, bool, 0444);
MODULE_PARM_DESC(swenc, "Set to 1 for software crypto (default 0)\n");
MODULE_PARM_DESC(ips, "Set to 0 to not use link power save (default 1)\n");
MODULE_PARM_DESC(swlps, "Set to 1 to use SW control power save (default 0)\n");
MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 1)\n");
MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)");

static struct pci_driver rtl92ce_driver = {
.name = KBUILD_MODNAME,
Expand Down
7 changes: 7 additions & 0 deletions drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw)
rtlpriv->dm.dm_flag = 0;
rtlpriv->dm.disable_framebursting = 0;
rtlpriv->dm.thermalvalue = 0;
rtlpriv->dbg.global_debuglevel = rtlpriv->cfg->mod_params->debug;
rtlpriv->rtlhal.pfirmware = vmalloc(0x4000);
if (!rtlpriv->rtlhal.pfirmware) {
RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
Expand Down Expand Up @@ -149,8 +150,14 @@ static struct rtl_hal_ops rtl8192cu_hal_ops = {

static struct rtl_mod_params rtl92cu_mod_params = {
.sw_crypto = 0,
.debug = DBG_EMERG,
};

module_param_named(swenc, rtl92cu_mod_params.sw_crypto, bool, 0444);
module_param_named(debug, rtl92cu_mod_params.debug, int, 0444);
MODULE_PARM_DESC(swenc, "Set to 1 for software crypto (default 0)\n");
MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)");

static struct rtl_hal_usbint_cfg rtl92cu_interface_cfg = {
/* rx */
.in_ep_num = RTL92C_USB_BULK_IN_NUM,
Expand Down
5 changes: 5 additions & 0 deletions drivers/net/wireless/rtlwifi/rtl8192de/sw.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ static int rtl92d_init_sw_vars(struct ieee80211_hw *hw)

rtlpci->irq_mask[1] = (u32) (IMR_CPWM | IMR_C2HCMD);

/* for debug level */
rtlpriv->dbg.global_debuglevel = rtlpriv->cfg->mod_params->debug;
/* for LPS & IPS */
rtlpriv->psc.inactiveps = rtlpriv->cfg->mod_params->inactiveps;
rtlpriv->psc.swctrl_lps = rtlpriv->cfg->mod_params->swctrl_lps;
Expand Down Expand Up @@ -267,6 +269,7 @@ static struct rtl_mod_params rtl92de_mod_params = {
.inactiveps = true,
.swctrl_lps = true,
.fwctrl_lps = false,
.debug = DBG_EMERG,
};

static struct rtl_hal_cfg rtl92de_hal_cfg = {
Expand Down Expand Up @@ -377,13 +380,15 @@ MODULE_DESCRIPTION("Realtek 8192DE 802.11n Dual Mac PCI wireless");
MODULE_FIRMWARE("rtlwifi/rtl8192defw.bin");

module_param_named(swenc, rtl92de_mod_params.sw_crypto, bool, 0444);
module_param_named(debug, rtl92de_mod_params.debug, int, 0444);
module_param_named(ips, rtl92de_mod_params.inactiveps, bool, 0444);
module_param_named(swlps, rtl92de_mod_params.swctrl_lps, bool, 0444);
module_param_named(fwlps, rtl92de_mod_params.fwctrl_lps, bool, 0444);
MODULE_PARM_DESC(swenc, "Set to 1 for software crypto (default 0)\n");
MODULE_PARM_DESC(ips, "Set to 0 to not use link power save (default 1)\n");
MODULE_PARM_DESC(swlps, "Set to 1 to use SW control power save (default 0)\n");
MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 1)\n");
MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)");

static struct pci_driver rtl92de_driver = {
.name = KBUILD_MODNAME,
Expand Down
5 changes: 5 additions & 0 deletions drivers/net/wireless/rtlwifi/rtl8192se/sw.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ static int rtl92s_init_sw_vars(struct ieee80211_hw *hw)

rtlpci->first_init = true;

/* for debug level */
rtlpriv->dbg.global_debuglevel = rtlpriv->cfg->mod_params->debug;
/* for LPS & IPS */
rtlpriv->psc.inactiveps = rtlpriv->cfg->mod_params->inactiveps;
rtlpriv->psc.swctrl_lps = rtlpriv->cfg->mod_params->swctrl_lps;
Expand Down Expand Up @@ -272,6 +274,7 @@ static struct rtl_mod_params rtl92se_mod_params = {
.inactiveps = true,
.swctrl_lps = true,
.fwctrl_lps = false,
.debug = DBG_EMERG,
};

/* Because memory R/W bursting will cause system hang/crash
Expand Down Expand Up @@ -388,13 +391,15 @@ MODULE_DESCRIPTION("Realtek 8192S/8191S 802.11n PCI wireless");
MODULE_FIRMWARE("rtlwifi/rtl8192sefw.bin");

module_param_named(swenc, rtl92se_mod_params.sw_crypto, bool, 0444);
module_param_named(debug, rtl92se_mod_params.debug, int, 0444);
module_param_named(ips, rtl92se_mod_params.inactiveps, bool, 0444);
module_param_named(swlps, rtl92se_mod_params.swctrl_lps, bool, 0444);
module_param_named(fwlps, rtl92se_mod_params.fwctrl_lps, bool, 0444);
MODULE_PARM_DESC(swenc, "Set to 1 for software crypto (default 0)\n");
MODULE_PARM_DESC(ips, "Set to 0 to not use link power save (default 1)\n");
MODULE_PARM_DESC(swlps, "Set to 1 to use SW control power save (default 0)\n");
MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 1)\n");
MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)");

static struct pci_driver rtl92se_driver = {
.name = KBUILD_MODNAME,
Expand Down
3 changes: 3 additions & 0 deletions drivers/net/wireless/rtlwifi/wifi.h
Original file line number Diff line number Diff line change
Expand Up @@ -1485,6 +1485,9 @@ struct rtl_mod_params {
/* default: 0 = using hardware encryption */
int sw_crypto;

/* default: 0 = DBG_EMERG (0)*/
int debug;

/* default: 1 = using no linked power save */
bool inactiveps;

Expand Down

0 comments on commit 73a253c

Please sign in to comment.