2016-12-15 18:24:02

by Larry Finger

[permalink] [raw]
Subject: [PATCH 00/14 V2] rtlwifi: Start reworking of debug system

Following the discussion regarding the patch entitled "rtlwifi: Add
BTC_TRACE_STRING to new btcoex", we are reworking the entire debug
system. This set of patches does the following:

1. Replaces every invocation of RT_ASSERT with WARN_ON. With this
change, triggering these conditions with now give a stack dump.
Note that the logical condition between RT_ASSERT and WARN_ON
is inverted. In making these changes, 6 logic errors were found.
2. Replaces every call of RT_TRACE with the level set to DBG_EMERG
with the equivalent pr_err() call. Future plans call for using
the COMP_xxx portion of the macro as a debug mask. If these changes
are not made, these error conditions might not be logged.
3. Removes some redundant logged conditions. For example, when the
failure of firmware to start is logged, it is not necessary to
log that the firmware did start.

The previous two patch sequences "[PATCH 00/14] rtlwifi: Various updates"
and "[PATCH 0/7] rtlwifi: btcoexist: Rewrite BT coexistence routines"
should be discarded. That material will be resubmitted later.

V2 removes those files that had rtlwifi_new in the subject. They should
not have been sent. It also removes the module name from the format as
it is specified by the pr_fmt macro in wifi.h as noted by Joe Perches.

Signed-off-by: Larry Finger <[email protected]>
Cc: Ping-Ke Shih <[email protected]>

Larry Finger (14):
rtlwifi: Replace local debug macro RT_ASSERT
rtlwifi_new: Remove RT_TRACE messages that use DBG_EMERG
rtlwifi_new: rtl8821ae: Remove all instances of DBG_EMERG
rtlwifi_new: rtl8723be: Remove all instances of DBG_EMERG
rtlwifi_new: rtl8723ae: Remove all instances of DBG_EMERG
rtlwifi_new: rtl8192ee: Remove all instances of DBG_EMERG
rtlwifi_new: rtl8723-common: Remove all instances of DBG_EMERG
rtlwifi_new: rtl8192se: Remove all instances of DBG_EMERG
rtlwifi_new: rtl8192de: Remove all instances of DBG_EMERG
rtlwifi_new: rtl8192cu: Remove all instances of DBG_EMERG
rtlwifi_new: rtl8192ce: Remove all instances of DBG_EMERG
rtlwifi_new: rtl8192c-common: Remove all instances of DBG_EMERG
rtlwifi_new: rtl8188ee: Remove all instances of DBG_EMERG
rtlwifi: Remove some redundant code

drivers/net/wireless/realtek/rtlwifi/base.c | 15 +++----
drivers/net/wireless/realtek/rtlwifi/cam.c | 14 +++---
drivers/net/wireless/realtek/rtlwifi/core.c | 29 +++++-------
drivers/net/wireless/realtek/rtlwifi/debug.c | 9 ++--
drivers/net/wireless/realtek/rtlwifi/debug.h | 18 +-------
drivers/net/wireless/realtek/rtlwifi/efuse.c | 3 +-
drivers/net/wireless/realtek/rtlwifi/pci.c | 48 ++++++++------------
drivers/net/wireless/realtek/rtlwifi/ps.c | 3 +-
drivers/net/wireless/realtek/rtlwifi/rc.c | 3 +-
.../net/wireless/realtek/rtlwifi/rtl8188ee/fw.c | 43 +++++-------------
.../net/wireless/realtek/rtlwifi/rtl8188ee/hw.c | 32 +++++---------
.../net/wireless/realtek/rtlwifi/rtl8188ee/phy.c | 32 ++++++--------
.../net/wireless/realtek/rtlwifi/rtl8188ee/rf.c | 3 +-
.../net/wireless/realtek/rtlwifi/rtl8188ee/sw.c | 8 ++--
.../net/wireless/realtek/rtlwifi/rtl8188ee/trx.c | 8 ++--
.../wireless/realtek/rtlwifi/rtl8192c/fw_common.c | 45 ++++++-------------
.../wireless/realtek/rtlwifi/rtl8192c/phy_common.c | 27 ++++++------
.../net/wireless/realtek/rtlwifi/rtl8192ce/hw.c | 38 ++++++----------
.../net/wireless/realtek/rtlwifi/rtl8192ce/led.c | 6 +--
.../net/wireless/realtek/rtlwifi/rtl8192ce/phy.c | 13 +++---
.../net/wireless/realtek/rtlwifi/rtl8192ce/rf.c | 3 +-
.../net/wireless/realtek/rtlwifi/rtl8192ce/sw.c | 8 ++--
.../net/wireless/realtek/rtlwifi/rtl8192ce/trx.c | 8 ++--
.../net/wireless/realtek/rtlwifi/rtl8192cu/hw.c | 35 +++++----------
.../net/wireless/realtek/rtlwifi/rtl8192cu/led.c | 6 +--
.../net/wireless/realtek/rtlwifi/rtl8192cu/mac.c | 12 ++---
.../net/wireless/realtek/rtlwifi/rtl8192cu/phy.c | 12 ++---
.../net/wireless/realtek/rtlwifi/rtl8192cu/rf.c | 3 +-
.../net/wireless/realtek/rtlwifi/rtl8192cu/sw.c | 5 +--
.../net/wireless/realtek/rtlwifi/rtl8192cu/trx.c | 2 +-
.../net/wireless/realtek/rtlwifi/rtl8192de/fw.c | 31 ++++---------
.../net/wireless/realtek/rtlwifi/rtl8192de/hw.c | 34 +++++----------
.../net/wireless/realtek/rtlwifi/rtl8192de/led.c | 6 +--
.../net/wireless/realtek/rtlwifi/rtl8192de/phy.c | 41 ++++++++---------
.../net/wireless/realtek/rtlwifi/rtl8192de/rf.c | 3 +-
.../net/wireless/realtek/rtlwifi/rtl8192de/sw.c | 10 ++---
.../net/wireless/realtek/rtlwifi/rtl8192de/trx.c | 8 ++--
.../net/wireless/realtek/rtlwifi/rtl8192ee/fw.c | 40 +++++------------
.../net/wireless/realtek/rtlwifi/rtl8192ee/hw.c | 13 +++---
.../net/wireless/realtek/rtlwifi/rtl8192ee/phy.c | 36 +++++++--------
.../net/wireless/realtek/rtlwifi/rtl8192ee/rf.c | 3 +-
.../net/wireless/realtek/rtlwifi/rtl8192ee/sw.c | 8 ++--
.../net/wireless/realtek/rtlwifi/rtl8192ee/trx.c | 15 ++++---
.../net/wireless/realtek/rtlwifi/rtl8192se/fw.c | 46 ++++++++-----------
.../net/wireless/realtek/rtlwifi/rtl8192se/hw.c | 42 +++++++-----------
.../net/wireless/realtek/rtlwifi/rtl8192se/led.c | 6 +--
.../net/wireless/realtek/rtlwifi/rtl8192se/phy.c | 42 +++++++-----------
.../net/wireless/realtek/rtlwifi/rtl8192se/rf.c | 3 +-
.../net/wireless/realtek/rtlwifi/rtl8192se/sw.c | 8 ++--
.../net/wireless/realtek/rtlwifi/rtl8192se/trx.c | 8 ++--
.../net/wireless/realtek/rtlwifi/rtl8723ae/fw.c | 13 +++---
.../net/wireless/realtek/rtlwifi/rtl8723ae/hw.c | 21 ++++-----
.../net/wireless/realtek/rtlwifi/rtl8723ae/led.c | 6 +--
.../net/wireless/realtek/rtlwifi/rtl8723ae/phy.c | 28 +++++-------
.../net/wireless/realtek/rtlwifi/rtl8723ae/rf.c | 3 +-
.../net/wireless/realtek/rtlwifi/rtl8723ae/sw.c | 8 ++--
.../net/wireless/realtek/rtlwifi/rtl8723ae/trx.c | 8 ++--
.../net/wireless/realtek/rtlwifi/rtl8723be/fw.c | 13 +++---
.../net/wireless/realtek/rtlwifi/rtl8723be/hw.c | 18 +++-----
.../net/wireless/realtek/rtlwifi/rtl8723be/led.c | 6 +--
.../net/wireless/realtek/rtlwifi/rtl8723be/phy.c | 30 ++++++-------
.../net/wireless/realtek/rtlwifi/rtl8723be/rf.c | 3 +-
.../net/wireless/realtek/rtlwifi/rtl8723be/sw.c | 8 ++--
.../net/wireless/realtek/rtlwifi/rtl8723be/trx.c | 14 +++---
.../realtek/rtlwifi/rtl8723com/fw_common.c | 25 +++--------
.../realtek/rtlwifi/rtl8723com/phy_common.c | 6 +--
.../net/wireless/realtek/rtlwifi/rtl8821ae/dm.c | 3 +-
.../net/wireless/realtek/rtlwifi/rtl8821ae/fw.c | 28 ++++--------
.../net/wireless/realtek/rtlwifi/rtl8821ae/hw.c | 31 ++++++-------
.../net/wireless/realtek/rtlwifi/rtl8821ae/phy.c | 51 +++++++++-------------
.../net/wireless/realtek/rtlwifi/rtl8821ae/rf.c | 5 +--
.../net/wireless/realtek/rtlwifi/rtl8821ae/sw.c | 14 +++---
.../net/wireless/realtek/rtlwifi/rtl8821ae/trx.c | 20 +++++----
drivers/net/wireless/realtek/rtlwifi/usb.c | 48 +++++++-------------
74 files changed, 488 insertions(+), 816 deletions(-)

--
2.10.2


2016-12-15 18:24:03

by Larry Finger

[permalink] [raw]
Subject: [PATCH 04/14 V2] rtlwifi: rtl8723be: Remove all instances of DBG_EMERG

This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger <[email protected]>
Cc: Ping-Ke Shih <[email protected]>
---
V2 - eliminate some files that should not have been sent, and remove the
module name from the format. It is already specified by a pr_fmt().
---
drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c | 9 +++------
drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c | 16 ++++++----------
drivers/net/wireless/realtek/rtlwifi/rtl8723be/led.c | 6 ++----
drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c | 18 +++++++-----------
drivers/net/wireless/realtek/rtlwifi/rtl8723be/rf.c | 3 +--
drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c | 8 +++-----
6 files changed, 22 insertions(+), 38 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c
index f9a2c8b..89bba11 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c
@@ -97,8 +97,7 @@ static void _rtl8723be_fill_h2c_command(struct ieee80211_hw *hw, u8 element_id,
while (!bwrite_sucess) {
wait_writeh2c_limmit--;
if (wait_writeh2c_limmit == 0) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Write H2C fail because no trigger for FW INT!\n");
+ pr_err("Write H2C fail because no trigger for FW INT!\n");
break;
}

@@ -121,8 +120,8 @@ static void _rtl8723be_fill_h2c_command(struct ieee80211_hw *hw, u8 element_id,
box_extreg = REG_HMEBOX_EXT_3;
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", boxnum);
+ pr_err("switch case %#x not processed\n",
+ boxnum);
break;
}

@@ -194,8 +192,8 @@ static void _rtl8723be_fill_h2c_command(struct ieee80211_hw *hw, u8 element_id,
}
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", cmd_len);
+ pr_err("switch case %#x not processed\n",
+ cmd_len);
break;
}

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c
index 0ae5562..2fb39f6 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c
@@ -747,9 +747,8 @@ static bool _rtl8723be_llt_write(struct ieee80211_hw *hw, u32 address, u32 data)
break;

if (count > POLLING_LLT_THRESHOLD) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Failed to polling write LLT done at address %d!\n",
- address);
+ pr_err("Failed to polling write LLT done at address %d!\n",
+ address);
status = false;
break;
}
@@ -1383,7 +1382,7 @@ int rtl8723be_hw_init(struct ieee80211_hw *hw)
}
rtstatus = _rtl8723be_init_mac(hw);
if (!rtstatus) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Init MAC failed\n");
+ pr_err("Init MAC failed\n");
err = 1;
goto exit;
}
@@ -1532,8 +1531,7 @@ static int _rtl8723be_set_media_status(struct ieee80211_hw *hw,
"Set Network type to AP!\n");
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Network type %d not support!\n", type);
+ pr_err("Network type %d not support!\n", type);
return 1;
}

@@ -2247,7 +2245,7 @@ void rtl8723be_read_eeprom_info(struct ieee80211_hw *hw)
rtlefuse->autoload_failflag = false;
_rtl8723be_read_adapter_info(hw, false);
} else {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Autoload ERR!!\n");
+ pr_err("Autoload ERR!!\n");
}
_rtl8723be_hal_customized_behavior(hw);
}
@@ -2584,9 +2582,7 @@ void rtl8723be_set_key(struct ieee80211_hw *hw, u32 key_index,
entry_id = rtl_cam_get_free_entry(hw,
p_macaddr);
if (entry_id >= TOTAL_CAM_ENTRY) {
- RT_TRACE(rtlpriv, COMP_SEC,
- DBG_EMERG,
- "Can not find free hw security cam entry\n");
+ pr_err("Can not find free hw security cam entry\n");
return;
}
} else {
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/led.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/led.c
index 497913e..193125b 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/led.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/led.c
@@ -57,8 +57,8 @@ void rtl8723be_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled)
rtl_write_byte(rtlpriv, REG_LEDCFG1, ledcfg & 0x10);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", pled->ledpin);
+ pr_err("switch case %#x not processed\n",
+ pled->ledpin);
break;
}
pled->ledon = true;
@@ -99,8 +98,8 @@ void rtl8723be_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled)

break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", pled->ledpin);
+ pr_err("switch case %#x not processed\n",
+ pled->ledpin);
break;
}
pled->ledon = false;
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c
index 0ee11cb..36acd1e 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c
@@ -467,7 +467,7 @@ static bool _rtl8723be_phy_bb8723b_config_parafile(struct ieee80211_hw *hw)
rtstatus = _rtl8723be_phy_config_bb_with_headerfile(hw,
BASEBAND_CONFIG_PHY_REG);
if (!rtstatus) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Write BB Reg Fail!!\n");
+ pr_err("Write BB Reg Fail!!\n");
return false;
}
_rtl8723be_phy_init_tx_power_by_rate(hw);
@@ -478,13 +478,13 @@ static bool _rtl8723be_phy_bb8723b_config_parafile(struct ieee80211_hw *hw)
}
phy_txpower_by_rate_config(hw);
if (!rtstatus) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "BB_PG Reg Fail!!\n");
+ pr_err("BB_PG Reg Fail!!\n");
return false;
}
rtstatus = _rtl8723be_phy_config_bb_with_headerfile(hw,
BASEBAND_CONFIG_AGC_TAB);
if (!rtstatus) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "AGC Table Fail\n");
+ pr_err("AGC Table Fail\n");
return false;
}
rtlphy->cck_high_power = (bool)(rtl_get_bbreg(hw,
@@ -1249,8 +1249,7 @@ void rtl8723be_phy_scan_operation_backup(struct ieee80211_hw *hw, u8 operation)
(u8 *)&iotype);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Unknown Scan Backup operation.\n");
+ pr_err("Unknown Scan Backup operation.\n");
break;
}
}
@@ -1291,8 +1290,8 @@ void rtl8723be_phy_set_bw_mode_callback(struct ieee80211_hw *hw)
rtl_write_byte(rtlpriv, REG_RRSR + 2, reg_prsr_rsc);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "unknown bandwidth: %#X\n", rtlphy->current_chan_bw);
+ pr_err("unknown bandwidth: %#X\n",
+ rtlphy->current_chan_bw);
break;
}

@@ -1316,8 +1314,8 @@ void rtl8723be_phy_set_bw_mode_callback(struct ieee80211_hw *hw)
HAL_PRIME_CHNL_OFFSET_LOWER) ? 2 : 1);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "unknown bandwidth: %#X\n", rtlphy->current_chan_bw);
+ pr_err("unknown bandwidth: %#X\n",
+ rtlphy->current_chan_bw);
break;
}
rtl8723be_phy_rf6052_set_bandwidth(hw, rtlphy->current_chan_bw);
@@ -1462,8 +1459,8 @@ static bool _rtl8723be_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,
currentcmd = &postcommoncmd[*step];
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Invalid 'stage' = %d, Check it!\n", *stage);
+ pr_err("Invalid 'stage' = %d, Check it!\n",
+ *stage);
return true;
}

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/rf.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/rf.c
index 78f4f18..4849145 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/rf.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/rf.c
@@ -51,8 +51,7 @@ void rtl8723be_phy_rf6052_set_bandwidth(struct ieee80211_hw *hw, u8 bandwidth)
rtlphy->rfreg_chnlval[0]);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "unknown bandwidth: %#X\n", bandwidth);
+ pr_err("unknown bandwidth: %#X\n", bandwidth);
break;
}
}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c
index 847644d..dd42c1a 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c
@@ -179,8 +179,7 @@ int rtl8723be_init_sw_vars(struct ieee80211_hw *hw)
/* for firmware buf */
rtlpriv->rtlhal.pfirmware = vzalloc(0x8000);
if (!rtlpriv->rtlhal.pfirmware) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Can't alloc buffer for fw.\n");
+ pr_err("Can't alloc buffer for fw.\n");
return 1;
}

@@ -190,8 +189,7 @@ int rtl8723be_init_sw_vars(struct ieee80211_hw *hw)
rtlpriv->io.dev, GFP_KERNEL, hw,
rtl_fw_cb);
if (err) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Failed to request firmware!\n");
+ pr_err("Failed to request firmware!\n");
return 1;
}
return 0;
@@ -273,7 +271,7 @@ static struct rtl_mod_params rtl8723be_mod_params = {
.fwctrl_lps = true,
.msi_support = false,
.disable_watchdog = false,
- .debug = DBG_EMERG,
+ .debug = 0,
.ant_sel = 0,
};

--
2.10.2

2016-12-30 13:53:08

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH 14/14 V2] rtlwifi: Remove some redundant code

Larry Finger <[email protected]> writes:

> The symbol DBG_EMERG is no longer used and is removed.
>
> In a number of places, the code has redundant messages. For example, if
> the failure for the firmware to run is logged, it is not necessary to
> log that the firmware has been started. In addition, extraneous braces are
> removed.
>
> Signed-off-by: Larry Finger <[email protected]>
> Cc: Ping-Ke Shih <[email protected]>

[...]

> --- wireless-drivers-next.orig/drivers/net/wireless/realtek/rtlwifi/debug.h
> +++ wireless-drivers-next/drivers/net/wireless/realtek/rtlwifi/debug.h
> @@ -36,7 +36,7 @@
> *unexpected HW behavior, HW BUG
> *and so on.
> */
> -#define DBG_EMERG 0
> +/*#define DBG_EMERG 0 */

You are not really removing, just commenting it out :) But this is good
enough for me, if you really want to remove it submit a followup patch.

--
Kalle Valo

2016-12-15 18:24:03

by Larry Finger

[permalink] [raw]
Subject: [PATCH 08/14] rtlwifi: rtl8192se: Remove all instances of DBG_EMERG

This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger <[email protected]>
Cc: Ping-Ke Shih <[email protected]>
---
V2 - eliminate some files that should not have been sent, and remove the
module name from the format. It is already specified by a pr_fmt().
---
.../net/wireless/realtek/rtlwifi/rtl8192se/fw.c | 46 ++++++++--------------
.../net/wireless/realtek/rtlwifi/rtl8192se/hw.c | 40 +++++++------------
.../net/wireless/realtek/rtlwifi/rtl8192se/led.c | 6 +--
.../net/wireless/realtek/rtlwifi/rtl8192se/phy.c | 36 ++++++-----------
.../net/wireless/realtek/rtlwifi/rtl8192se/rf.c | 3 +-
.../net/wireless/realtek/rtlwifi/rtl8192se/sw.c | 8 ++--
6 files changed, 51 insertions(+), 88 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/fw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/fw.c
index 32f9207..1922e78 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/fw.c
@@ -113,8 +113,7 @@ static u8 _rtl92s_firmware_header_map_rftype(struct ieee80211_hw *hw)
case RF_2T2R:
return 0x22;
default:
- RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, "Unknown RF type(%x)\n",
- rtlphy->rf_type);
+ pr_err("Unknown RF type(%x)\n", rtlphy->rf_type);
break;
}
return 0x22;
@@ -168,9 +167,7 @@ static bool _rtl92s_firmware_downloadcode(struct ieee80211_hw *hw,
_rtl92s_fw_set_rqpn(hw);

if (buffer_len >= MAX_FIRMWARE_CODE_SIZE) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Size over FIRMWARE_CODE_SIZE!\n");
-
+ pr_err("Size over FIRMWARE_CODE_SIZE!\n");
return false;
}

@@ -239,9 +236,8 @@ static bool _rtl92s_firmware_checkready(struct ieee80211_hw *hw,
} while (pollingcnt--);

if (!(cpustatus & IMEM_CHK_RPT) || (pollingcnt <= 0)) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "FW_STATUS_LOAD_IMEM FAIL CPU, Status=%x\n",
- cpustatus);
+ pr_err("FW_STATUS_LOAD_IMEM FAIL CPU, Status=%x\n",
+ cpustatus);
goto status_check_fail;
}
break;
@@ -257,17 +253,15 @@ static bool _rtl92s_firmware_checkready(struct ieee80211_hw *hw,
} while (pollingcnt--);

if (!(cpustatus & EMEM_CHK_RPT) || (pollingcnt <= 0)) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "FW_STATUS_LOAD_EMEM FAIL CPU, Status=%x\n",
- cpustatus);
+ pr_err("FW_STATUS_LOAD_EMEM FAIL CPU, Status=%x\n",
+ cpustatus);
goto status_check_fail;
}

/* Turn On CPU */
rtstatus = _rtl92s_firmware_enable_cpu(hw);
if (!rtstatus) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Enable CPU fail!\n");
+ pr_err("Enable CPU fail!\n");
goto status_check_fail;
}
break;
@@ -282,9 +276,8 @@ static bool _rtl92s_firmware_checkready(struct ieee80211_hw *hw,
} while (pollingcnt--);

if (!(cpustatus & DMEM_CODE_DONE) || (pollingcnt <= 0)) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Polling DMEM code done fail ! cpustatus(%#x)\n",
- cpustatus);
+ pr_err("Polling DMEM code done fail ! cpustatus(%#x)\n",
+ cpustatus);
goto status_check_fail;
}

@@ -308,9 +301,8 @@ static bool _rtl92s_firmware_checkready(struct ieee80211_hw *hw,

if (((cpustatus & LOAD_FW_READY) != LOAD_FW_READY) ||
(pollingcnt <= 0)) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Polling Load Firmware ready fail ! cpustatus(%x)\n",
- cpustatus);
+ pr_err("Polling Load Firmware ready fail ! cpustatus(%x)\n",
+ cpustatus);
goto status_check_fail;
}

@@ -331,8 +323,7 @@ static bool _rtl92s_firmware_checkready(struct ieee80211_hw *hw,
break;

default:
- RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG,
- "Unknown status check!\n");
+ pr_err("Unknown status check!\n");
rtstatus = false;
break;
}
@@ -380,8 +371,7 @@ int rtl92s_download_fw(struct ieee80211_hw *hw)
/* 2. Retrieve IMEM image. */
if ((pfwheader->img_imem_size == 0) || (pfwheader->img_imem_size >
sizeof(firmware->fw_imem))) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "memory for data image is less than IMEM required\n");
+ pr_err("memory for data image is less than IMEM required\n");
goto fail;
} else {
puc_mappedfile += fwhdr_size;
@@ -393,8 +383,7 @@ int rtl92s_download_fw(struct ieee80211_hw *hw)

/* 3. Retriecve EMEM image. */
if (pfwheader->img_sram_size > sizeof(firmware->fw_emem)) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "memory for data image is less than EMEM required\n");
+ pr_err("memory for data image is less than EMEM required\n");
goto fail;
} else {
puc_mappedfile += firmware->fw_imem_len;
@@ -428,8 +417,7 @@ int rtl92s_download_fw(struct ieee80211_hw *hw)
RT_8192S_FIRMWARE_HDR_EXCLUDE_PRI_SIZE;
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Unexpected Download step!!\n");
+ pr_err("Unexpected Download step!!\n");
goto fail;
}

@@ -438,14 +426,14 @@ int rtl92s_download_fw(struct ieee80211_hw *hw)
ul_filelength);

if (!rtstatus) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "fail!\n");
+ pr_err("fail!\n");
goto fail;
}

/* <3> Check whether load FW process is ready */
rtstatus = _rtl92s_firmware_checkready(hw, fwstatus);
if (!rtstatus) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "fail!\n");
+ pr_err("rtl8192se: firmware fail!\n");
goto fail;
}

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c
index d320118..c2ff879 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c
@@ -75,11 +75,9 @@ void rtl92se_get_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
}
case HAL_DEF_WOWLAN:
break;
- default: {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", variable);
- break;
- }
+ default:
+ pr_err("switch case %#x not processed\n", variable);
+ break;
}
}

@@ -294,9 +292,8 @@ void rtl92se_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
acm_ctrl &= (~AcmHw_VoqEn);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n",
- e_aci);
+ pr_err("switch case %#x not processed\n",
+ e_aci);
break;
}
}
@@ -431,8 +428,7 @@ void rtl92se_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
}
break; }
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", variable);
+ pr_err("switch case %#x not processed\n", variable);
break;
}

@@ -745,9 +741,8 @@ static void _rtl92se_macconfig_before_fwdownload(struct ieee80211_hw *hw)
} while (pollingcnt--);

if (pollingcnt <= 0) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Polling TXDMA_INIT_VALUE timeout!! Current TCR(%#x)\n",
- tmpu1b);
+ pr_err("Polling TXDMA_INIT_VALUE timeout!! Current TCR(%#x)\n",
+ tmpu1b);
tmpu1b = rtl_read_byte(rtlpriv, CMDR);
rtl_write_byte(rtlpriv, CMDR, tmpu1b & (~TXDMA_EN));
udelay(2);
@@ -1004,7 +999,7 @@ int rtl92se_hw_init(struct ieee80211_hw *hw)

/* 3. Initialize MAC/PHY Config by MACPHY_reg.txt */
if (!rtl92s_phy_mac_config(hw)) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "MAC Config failed\n");
+ pr_err("MAC Config failed\n");
err = rtstatus;
goto exit;
}
@@ -1024,7 +1019,7 @@ int rtl92se_hw_init(struct ieee80211_hw *hw)

/* 4. Initialize BB After MAC Config PHY_reg.txt, AGC_Tab.txt */
if (!rtl92s_phy_bb_config(hw)) {
- RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, "BB Config failed\n");
+ pr_err("BB Config failed\n");
err = rtstatus;
goto exit;
}
@@ -1194,8 +1189,7 @@ static int _rtl92se_set_media_status(struct ieee80211_hw *hw,
"Set Network type to AP!\n");
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Network type %d not supported!\n", type);
+ pr_err("Network type %d not supported!\n", type);
return 1;

}
@@ -1685,8 +1679,7 @@ static void _rtl92se_read_adapter_info(struct ieee80211_hw *hw)
break;

case EEPROM_93C46:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "RTL819X Not boot from eeprom, check it !!\n");
+ pr_err("RTL819X Not boot from eeprom, check it !!\n");
return;

default:
@@ -2030,7 +2023,7 @@ void rtl92se_read_eeprom_info(struct ieee80211_hw *hw)
rtlefuse->autoload_failflag = false;
_rtl92se_read_adapter_info(hw);
} else {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Autoload ERR!!\n");
+ pr_err("Autoload ERR!!\n");
rtlefuse->autoload_failflag = true;
}
}
@@ -2463,8 +2456,8 @@ void rtl92se_set_key(struct ieee80211_hw *hw, u32 key_index, u8 *p_macaddr,
enc_algo = CAM_AES;
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", enc_algo);
+ pr_err("switch case %#x not processed\n",
+ enc_algo);
enc_algo = CAM_TKIP;
break;
}
@@ -2481,9 +2473,7 @@ void rtl92se_set_key(struct ieee80211_hw *hw, u32 key_index, u8 *p_macaddr,
entry_id = rtl_cam_get_free_entry(hw,
p_macaddr);
if (entry_id >= TOTAL_CAM_ENTRY) {
- RT_TRACE(rtlpriv,
- COMP_SEC, DBG_EMERG,
- "Can not find free hw security cam entry\n");
+ pr_err("Can not find free hw security cam entry\n");
return;
}
} else {
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/led.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/led.c
index 8700078..b6b890f 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/led.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/led.c
@@ -63,8 +63,8 @@ void rtl92se_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled)
rtl_write_byte(rtlpriv, LEDCFG, ledcfg & 0x0f);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", pled->ledpin);
+ pr_err("switch case %#x not processed\n",
+ pled->ledpin);
break;
}
pled->ledon = true;
@@ -99,8 +98,8 @@ void rtl92se_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled)
rtl_write_byte(rtlpriv, LEDCFG, (ledcfg | BIT(3)));
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", pled->ledpin);
+ pr_err("switch case %#x not processed\n",
+ pled->ledpin);
break;
}
pled->ledon = false;
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/phy.c
index 71b2f46e..f835d99 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/phy.c
@@ -235,7 +235,6 @@ void rtl92s_phy_set_rf_reg(struct ieee80211_hw *hw, enum radio_path rfpath,
void rtl92s_phy_scan_operation_backup(struct ieee80211_hw *hw,
u8 operation)
{
- struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));

if (!is_hal_stop(rtlhal)) {
@@ -247,8 +246,7 @@ void rtl92s_phy_scan_operation_backup(struct ieee80211_hw *hw,
rtl92s_phy_set_fw_cmd(hw, FW_CMD_RESUME_DM_BY_SCAN);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Unknown operation\n");
+ pr_err("Unknown operation\n");
break;
}
}
@@ -288,8 +286,8 @@ void rtl92s_phy_set_bw_mode(struct ieee80211_hw *hw,
rtl_write_byte(rtlpriv, BW_OPMODE, reg_bw_opmode);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "unknown bandwidth: %#X\n", rtlphy->current_chan_bw);
+ pr_err("unknown bandwidth: %#X\n",
+ rtlphy->current_chan_bw);
break;
}

@@ -313,8 +310,8 @@ void rtl92s_phy_set_bw_mode(struct ieee80211_hw *hw,
rtl_write_byte(rtlpriv, RFPGA0_ANALOGPARAMETER2, 0x18);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "unknown bandwidth: %#X\n", rtlphy->current_chan_bw);
+ pr_err("unknown bandwidth: %#X\n",
+ rtlphy->current_chan_bw);
break;
}

@@ -437,9 +433,8 @@ static bool _rtl92s_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,
}
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n",
- currentcmd->cmdid);
+ pr_err("switch case %#x not processed\n",
+ currentcmd->cmdid);
break;
}

@@ -644,8 +639,8 @@ bool rtl92s_phy_set_rf_power_state(struct ieee80211_hw *hw,
_rtl92se_phy_set_rf_sleep(hw);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", rfpwr_state);
+ pr_err("switch case %#x not processed\n",
+ rfpwr_state);
bresult = false;
break;
}
@@ -937,8 +931,7 @@ static bool _rtl92s_phy_bb_config_parafile(struct ieee80211_hw *hw)
}

if (!rtstatus) {
- RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG,
- "Write BB Reg Fail!!\n");
+ pr_err("Write BB Reg Fail!!\n");
goto phy_BB8190_Config_ParaFile_Fail;
}

@@ -951,8 +944,7 @@ static bool _rtl92s_phy_bb_config_parafile(struct ieee80211_hw *hw)
BASEBAND_CONFIG_PHY_REG);
}
if (!rtstatus) {
- RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG,
- "_rtl92s_phy_bb_config_parafile(): BB_PG Reg Fail!!\n");
+ pr_err("_rtl92s_phy_bb_config_parafile(): BB_PG Reg Fail!!\n");
goto phy_BB8190_Config_ParaFile_Fail;
}

@@ -1077,12 +1069,10 @@ bool rtl92s_phy_bb_config(struct ieee80211_hw *hw)
(rtlphy->rf_type == RF_1T2R && rf_num != 2) ||
(rtlphy->rf_type == RF_2T2R && rf_num != 2) ||
(rtlphy->rf_type == RF_2T2R_GREEN && rf_num != 2)) {
- RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG,
- "RF_Type(%x) does not match RF_Num(%x)!!\n",
- rtlphy->rf_type, rf_num);
- RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG,
- "path1 0x%x, path2 0x%x, pathmap 0x%x\n",
- path1, path2, pathmap);
+ pr_err("RF_Type(%x) does not match RF_Num(%x)!!\n",
+ rtlphy->rf_type, rf_num);
+ pr_err("path1 0x%x, path2 0x%x, pathmap 0x%x\n",
+ path1, path2, pathmap);
}

return rtstatus;
@@ -1221,7 +1211,7 @@ void rtl92s_phy_chk_fwcmd_iodone(struct ieee80211_hw *hw)
} while (--pollingcnt);

if (pollingcnt == 0)
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Set FW Cmd fail!!\n");
+ pr_err("Set FW Cmd fail!!\n");
}


diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/rf.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/rf.c
index bd2fa77..ea5b8ec 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/rf.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/rf.c
@@ -523,8 +523,7 @@ void rtl92s_phy_rf6052_set_bandwidth(struct ieee80211_hw *hw, u8 bandwidth)
rtlphy->rfreg_chnlval[0]);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "unknown bandwidth: %#X\n", bandwidth);
+ pr_err("unknown bandwidth: %#X\n", bandwidth);
break;
}
}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/sw.c
index 998cefb..3c66d00 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/sw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/sw.c
@@ -96,8 +96,7 @@ static void rtl92se_fw_cb(const struct firmware *firmware, void *context)
return;
}
if (firmware->size > rtlpriv->max_fw_size) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Firmware is too big!\n");
+ pr_err("Firmware is too big!\n");
rtlpriv->max_fw_size = 0;
release_firmware(firmware);
return;
@@ -218,8 +217,7 @@ static int rtl92s_init_sw_vars(struct ieee80211_hw *hw)
rtlpriv->io.dev, GFP_KERNEL, hw,
rtl92se_fw_cb);
if (err) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Failed to request firmware!\n");
+ pr_err("Failed to request firmware!\n");
return 1;
}

@@ -299,7 +297,7 @@ static struct rtl_mod_params rtl92se_mod_params = {
.inactiveps = true,
.swctrl_lps = true,
.fwctrl_lps = false,
- .debug = DBG_EMERG,
+ .debug = 0,
};

/* Because memory R/W bursting will cause system hang/crash
--
2.10.2

2016-12-15 18:24:03

by Larry Finger

[permalink] [raw]
Subject: [PATCH 11/14 V2] rtlwifi: rtl8192ce: Remove all instances of DBG_EMERG

This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger <[email protected]>
Cc: Ping-Ke Shih <[email protected]>
---
V2 - eliminate some files that should not have been sent, and remove the
module name from the format. It is already specified by a pr_fmt().
---
.../net/wireless/realtek/rtlwifi/rtl8192ce/hw.c | 36 ++++++++--------------
.../net/wireless/realtek/rtlwifi/rtl8192ce/led.c | 6 ++--
.../net/wireless/realtek/rtlwifi/rtl8192ce/phy.c | 13 +++-----
.../net/wireless/realtek/rtlwifi/rtl8192ce/rf.c | 3 +-
.../net/wireless/realtek/rtlwifi/rtl8192ce/sw.c | 8 ++---
5 files changed, 24 insertions(+), 42 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c
index ce07e5c..410d48bf 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c
@@ -140,8 +140,7 @@ void rtl92ce_get_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
case HAL_DEF_WOWLAN:
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", variable);
+ pr_err("switch case %#x not processed\n", variable);
break;
}
}
@@ -364,9 +363,8 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
acm_ctrl &= (~AcmHw_VoqEn);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n",
- e_aci);
+ pr_err("switch case %#x not processed\n",
+ e_aci);
break;
}
}
@@ -551,8 +549,7 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
rtl92c_fill_h2c_cmd(hw, H2C_92C_KEEP_ALIVE_CTRL, 2, array);
break; }
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %d not processed\n", variable);
+ pr_err("switch case %d not processed\n", variable);
break;
}
}
@@ -573,9 +570,8 @@ static bool _rtl92ce_llt_write(struct ieee80211_hw *hw, u32 address, u32 data)
break;

if (count > POLLING_LLT_THRESHOLD) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Failed to polling write LLT done at address %d!\n",
- address);
+ pr_err("Failed to polling write LLT done at address %d!\n",
+ address);
status = false;
break;
}
@@ -963,7 +959,7 @@ int rtl92ce_hw_init(struct ieee80211_hw *hw)
rtlpriv->intf_ops->disable_aspm(hw);
rtstatus = _rtl92ce_init_mac(hw);
if (!rtstatus) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Init MAC failed\n");
+ pr_err("Init MAC failed\n");
err = 1;
goto exit;
}
@@ -1128,8 +1124,7 @@ static enum version_8192c _rtl92ce_read_chip_version(struct ieee80211_hw *hw)
break;
}

- RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG,
- "Chip Version ID: %s\n", versionid);
+ pr_info("Chip Version ID: %s\n", versionid);

switch (version & 0x3) {
case CHIP_88C:
@@ -1143,8 +1138,7 @@ static enum version_8192c _rtl92ce_read_chip_version(struct ieee80211_hw *hw)
break;
default:
rtlphy->rf_type = RF_1T1R;
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "ERROR RF_Type is set!!\n");
+ pr_err("ERROR RF_Type is set!!\n");
break;
}

@@ -1193,8 +1187,7 @@ static int _rtl92ce_set_media_status(struct ieee80211_hw *hw,
"Set Network type to Mesh Point!\n");
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Network type %d not supported!\n", type);
+ pr_err("Network type %d not supported!\n", type);
return 1;

}
@@ -1780,7 +1773,7 @@ void rtl92ce_read_eeprom_info(struct ieee80211_hw *hw)
rtlefuse->autoload_failflag = false;
_rtl92ce_read_adapter_info(hw);
} else {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Autoload ERR!!\n");
+ pr_err("Autoload ERR!!\n");
}
_rtl92ce_hal_customized_behavior(hw);
}
@@ -2152,8 +2145,8 @@ void rtl92ce_set_key(struct ieee80211_hw *hw, u32 key_index,
enc_algo = CAM_AES;
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", enc_algo);
+ pr_err("switch case %#x not processed\n",
+ enc_algo);
enc_algo = CAM_TKIP;
break;
}
@@ -2171,9 +2163,7 @@ void rtl92ce_set_key(struct ieee80211_hw *hw, u32 key_index,
entry_id = rtl_cam_get_free_entry(hw,
p_macaddr);
if (entry_id >= TOTAL_CAM_ENTRY) {
- RT_TRACE(rtlpriv, COMP_SEC,
- DBG_EMERG,
- "Can not find free hw security cam entry\n");
+ pr_err("Can not find free hw security cam entry\n");
return;
}
} else {
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/led.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/led.c
index 833193b..b9d40be 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/led.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/led.c
@@ -57,8 +57,8 @@ void rtl92ce_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled)
rtl_write_byte(rtlpriv, REG_LEDCFG2, (ledcfg & 0x0f) | BIT(5));
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", pled->ledpin);
+ pr_err("switch case %#x not processed\n",
+ pled->ledpin);
break;
}
pled->ledon = true;
@@ -92,8 +91,7 @@ void rtl92ce_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled)
rtl_write_byte(rtlpriv, REG_LEDCFG2, (ledcfg | BIT(3)));
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", pled->ledpin);
+ pr_info("switch case %#x not processed\n", pled->ledpin);
break;
}
pled->ledon = false;
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/phy.c
index d1b6a8f..4b67358 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/phy.c
@@ -297,10 +297,10 @@ bool rtl92c_phy_config_rf_with_headerfile(struct ieee80211_hw *hw,
break;
case RF90_PATH_C:
case RF90_PATH_D:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", rfpath);
+ pr_info("Incorrect rfpath %#x\n", rfpath);
break;
default:
+ pr_info("switch case %#x not processed\n", rfpath);
break;
}
return true;
@@ -340,8 +340,7 @@ void rtl92ce_phy_set_bw_mode_callback(struct ieee80211_hw *hw)
rtl_write_byte(rtlpriv, REG_RRSR + 2, reg_prsr_rsc);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "unknown bandwidth: %#X\n", rtlphy->current_chan_bw);
+ pr_info("unknown bandwidth: %#X\n", rtlphy->current_chan_bw);
break;
}

@@ -365,8 +364,8 @@ void rtl92ce_phy_set_bw_mode_callback(struct ieee80211_hw *hw)
HAL_PRIME_CHNL_OFFSET_LOWER) ? 2 : 1);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "unknown bandwidth: %#X\n", rtlphy->current_chan_bw);
+ pr_err("unknown bandwidth: %#X\n",
+ rtlphy->current_chan_bw);
break;
}
rtl92ce_phy_rf6052_set_bandwidth(hw, rtlphy->current_chan_bw);
@@ -546,8 +544,8 @@ static bool _rtl92ce_phy_set_rf_power_state(struct ieee80211_hw *hw,
break;
}
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", rfpwr_state);
+ pr_err("switch case %#x not processed\n",
+ rfpwr_state);
bresult = false;
break;
}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/rf.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/rf.c
index 7cae635..e68ed7f 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/rf.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/rf.c
@@ -51,8 +51,7 @@ void rtl92ce_phy_rf6052_set_bandwidth(struct ieee80211_hw *hw, u8 bandwidth)
rtlphy->rfreg_chnlval[0]);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "unknown bandwidth: %#X\n", bandwidth);
+ pr_err("unknown bandwidth: %#X\n", bandwidth);
break;
}
}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/sw.c
index 691ddef..9bd2bff6 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/sw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/sw.c
@@ -158,8 +158,7 @@ int rtl92c_init_sw_vars(struct ieee80211_hw *hw)
/* for firmware buf */
rtlpriv->rtlhal.pfirmware = vzalloc(0x4000);
if (!rtlpriv->rtlhal.pfirmware) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Can't alloc buffer for fw\n");
+ pr_err("Can't alloc buffer for fw\n");
return 1;
}

@@ -173,8 +172,7 @@ int rtl92c_init_sw_vars(struct ieee80211_hw *hw)
rtlpriv->io.dev, GFP_KERNEL, hw,
rtl_fw_cb);
if (err) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Failed to request firmware!\n");
+ pr_err("Failed to request firmware!\n");
return 1;
}

@@ -249,7 +247,7 @@ static struct rtl_mod_params rtl92ce_mod_params = {
.inactiveps = true,
.swctrl_lps = false,
.fwctrl_lps = true,
- .debug = DBG_EMERG,
+ .debug = 0,
};

static const struct rtl_hal_cfg rtl92ce_hal_cfg = {
--
2.10.2

2016-12-15 18:24:03

by Larry Finger

[permalink] [raw]
Subject: [PATCH 07/14 V2] rtlwifi: rtl8723-common: Remove all instances of DBG_EMERG

This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger <[email protected]>
Cc: Ping-Ke Shih <[email protected]>
---
V2 - eliminate some files that should not have been sent, and remove the
module name from the format. It is already specified by a pr_fmt().
---
.../net/wireless/realtek/rtlwifi/rtl8723com/fw_common.c | 16 ++++++----------
.../net/wireless/realtek/rtlwifi/rtl8723com/phy_common.c | 4 ++--
2 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723com/fw_common.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723com/fw_common.c
index 108475e..a9cc67e 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723com/fw_common.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723com/fw_common.c
@@ -129,8 +129,8 @@ void rtl8723_write_fw(struct ieee80211_hw *hw,
remain_size = size % FW_8192C_PAGE_SIZE;

if (page_nums > max_page) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Page numbers should not greater than %d\n", max_page);
+ pr_err("Page numbers should not greater than %d\n",
+ max_page);
}
for (page = 0; page < page_nums; page++) {
offset = page * FW_8192C_PAGE_SIZE;
@@ -209,9 +208,8 @@ int rtl8723_fw_free_to_go(struct ieee80211_hw *hw, bool is_8723be,
(!(value32 & FWDL_CHKSUM_RPT)));

if (counter >= max_count) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "chksum report fail ! REG_MCUFWDL:0x%08x .\n",
- value32);
+ pr_err("chksum report fail ! REG_MCUFWDL:0x%08x .\n",
+ value32);
goto exit;
}
RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
@@ -239,9 +237,8 @@ int rtl8723_fw_free_to_go(struct ieee80211_hw *hw, bool is_8723be,

} while (counter++ < max_count);

- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Polling FW ready fail!! REG_MCUFWDL:0x%08x .\n",
- value32);
+ pr_err("Polling FW ready fail!! REG_MCUFWDL:0x%08x .\n",
+ value32);

exit:
return err;
@@ -294,8 +291,7 @@ int rtl8723_download_fw(struct ieee80211_hw *hw,

err = rtl8723_fw_free_to_go(hw, is_8723be, max_count);
if (err) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Firmware is not ready to run!\n");
+ pr_err("Firmware is not ready to run!\n");
} else {
RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
"Firmware is ready to run!\n");
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723com/phy_common.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723com/phy_common.c
index 0adae58..91a1ef0 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723com/phy_common.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723com/phy_common.c
@@ -99,7 +99,7 @@ u32 rtl8723_phy_rf_serial_read(struct ieee80211_hw *hw,
offset &= 0xff;
newoffset = offset;
if (RT_CANNOT_IO(hw)) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "return all one\n");
+ pr_err("return all one\n");
return 0xFFFFFFFF;
}
tmplong = rtl_get_bbreg(hw, RFPGA0_XA_HSSIPARAMETER2, MASKDWORD);
@@ -147,7 +147,7 @@ void rtl8723_phy_rf_serial_write(struct ieee80211_hw *hw,
struct bb_reg_def *pphyreg = &rtlphy->phyreg_def[rfpath];

if (RT_CANNOT_IO(hw)) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "stop\n");
+ pr_err("stop\n");
return;
}
offset &= 0xff;
--
2.10.2

2016-12-16 19:34:59

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH 03/14 V2] rtlwifi: rtl8821ae: Remove all instances of DBG_EMERG

On Thu, 2016-12-15 at 12:22 -0600, Larry Finger wrote:
> This is a step toward eliminating the RT_TRACE macros. Those calls that
> have DBG_EMERG as the level are always logged, and they represent error
> conditions, thus they are replaced with pr_err().

OK,

> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c
[]
> @@ -162,8 +161,8 @@ static int _rtl8821ae_fw_free_to_go(struct ieee80211_hw *hw)
> goto exit;
> }
>
> - RT_TRACE(rtlpriv, COMP_FW, DBG_EMERG,
> - "Checksum report OK ! REG_MCUFWDL:0x%08x .\n", value32);
> + pr_err("Checksum report OK! REG_MCUFWDL:0x%08x\n",
> + value32);
>
> value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL);
> value32 |= MCUFWDL_RDY;
> @@ -186,9 +184,8 @@ static int _rtl8821ae_fw_free_to_go(struct ieee80211_hw *hw)
> udelay(FW_8821AE_POLLING_DELAY);
> } while (counter++ < FW_8821AE_POLLING_TIMEOUT_COUNT);
>
> - RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "Polling FW ready fail!! REG_MCUFWDL:0x%08x .\n",
> - value32);
> + pr_err("Polling FW ready fail!! REG_MCUFWDL:0x%08x .\n",
> + value32);

It's odd to fix / remove " .\n" above but here and
the wrapping comment on the first patch applies too.

I didn't look at the rest and I won't comment on
other uses in any further patches in the series.

Thanks, Joe

2016-12-15 18:24:03

by Larry Finger

[permalink] [raw]
Subject: [PATCH 10/14 V2] rtlwifi: rtl8192cu: Remove all instances of DBG_EMERG

This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger <[email protected]>
Cc: Ping-Ke Shih <[email protected]>
---
V2 - eliminate some files that should not have been sent.
---
.../net/wireless/realtek/rtlwifi/rtl8192cu/hw.c | 33 ++++++++--------------
.../net/wireless/realtek/rtlwifi/rtl8192cu/led.c | 6 ++--
.../net/wireless/realtek/rtlwifi/rtl8192cu/mac.c | 12 +++-----
.../net/wireless/realtek/rtlwifi/rtl8192cu/phy.c | 12 +++-----
.../net/wireless/realtek/rtlwifi/rtl8192cu/rf.c | 3 +-
.../net/wireless/realtek/rtlwifi/rtl8192cu/sw.c | 5 ++--
6 files changed, 24 insertions(+), 47 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c
index aa3d559..dce13d6 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c
@@ -452,8 +452,7 @@ static int _rtl92cu_init_power_on(struct ieee80211_hw *hw)
break;
}
if (pollingCount++ > 100) {
- RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG,
- "Failed to polling REG_APS_FSMCO[PFM_ALDN] done!\n");
+ pr_err("Failed to polling REG_APS_FSMCO[PFM_ALDN] done!\n");
return -ENODEV;
}
} while (true);
@@ -486,8 +485,7 @@ static int _rtl92cu_init_power_on(struct ieee80211_hw *hw)
break;
}
if (pollingCount++ > 1000) {
- RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG,
- "Failed to polling REG_APS_FSMCO[APFM_ONMAC] done!\n");
+ pr_err("Failed to polling REG_APS_FSMCO[APFM_ONMAC] done!\n");
return -ENODEV;
}
} while (true);
@@ -687,7 +685,6 @@ static void _rtl92cu_init_chipN_three_out_ep_priority(struct ieee80211_hw *hw,
u8 queue_sel)
{
u16 beQ, bkQ, viQ, voQ, mgtQ, hiQ;
- struct rtl_priv *rtlpriv = rtl_priv(hw);

if (!wmm_enable) { /* typical setting */
beQ = QUEUE_LOW;
@@ -705,8 +702,7 @@ static void _rtl92cu_init_chipN_three_out_ep_priority(struct ieee80211_hw *hw,
hiQ = QUEUE_HIGH;
}
_rtl92c_init_chipN_reg_priority(hw, beQ, bkQ, viQ, voQ, mgtQ, hiQ);
- RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, "Tx queue select :0x%02x..\n",
- queue_sel);
+ pr_info("Tx queue select :0x%02x..\n", queue_sel);
}

static void _rtl92cu_init_chipN_queue_priority(struct ieee80211_hw *hw,
@@ -765,8 +761,7 @@ static void _rtl92cu_init_chipT_queue_priority(struct ieee80211_hw *hw,
break;
}
rtl_write_byte(rtlpriv, (REG_TRXDMA_CTRL+1), hq_sele);
- RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, "Tx queue select :0x%02x..\n",
- hq_sele);
+ pr_info("Tx queue select :0x%02x..\n", hq_sele);
}

static void _rtl92cu_init_queue_priority(struct ieee80211_hw *hw,
@@ -848,8 +843,7 @@ static int _rtl92cu_init_mac(struct ieee80211_hw *hw)
err = _rtl92cu_init_power_on(hw);

if (err) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Failed to init power on!\n");
+ pr_err("Failed to init power on!\n");
return err;
}
if (!wmm_enable) {
@@ -860,8 +854,7 @@ static int _rtl92cu_init_mac(struct ieee80211_hw *hw)
: WMM_CHIP_A_TX_PAGE_BOUNDARY;
}
if (false == rtl92c_init_llt_table(hw, boundary)) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Failed to init LLT Table!\n");
+ pr_err("Failed to init LLT Table!\n");
return -EINVAL;
}
_rtl92cu_init_queue_reserved_page(hw, wmm_enable, out_ep_nums,
@@ -986,7 +979,7 @@ int rtl92cu_hw_init(struct ieee80211_hw *hw)
rtlhal->hw_type = HARDWARE_TYPE_RTL8192CU;
err = _rtl92cu_init_mac(hw);
if (err) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "init mac failed!\n");
+ pr_err("init mac failed!\n");
goto exit;
}
err = rtl92c_download_fw(hw);
@@ -1099,8 +1092,7 @@ static void _ResetDigitalProcedure1(struct ieee80211_hw *hw, bool bWithoutHWSM)
udelay(50);
}
if (retry_cnts >= 100) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "#####=> 8051 reset failed!.........................\n");
+ pr_err("8051 reset failed!.........................\n");
/* if 8051 reset fail, reset MAC. */
rtl_write_byte(rtlpriv,
REG_SYS_FUNC_EN + 1,
@@ -1340,8 +1332,7 @@ static int _rtl92cu_set_media_status(struct ieee80211_hw *hw,
"Set Network type to AP!\n");
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Network type %d not supported!\n", type);
+ pr_err("Network type %d not supported!\n", type);
goto error_out;
}
rtl_write_byte(rtlpriv, MSR, bt_msr);
@@ -1555,8 +1546,7 @@ void rtl92cu_get_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
case HAL_DEF_WOWLAN:
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", variable);
+ pr_err("switch case %#x not processed\n", variable);
break;
}
}
@@ -1926,8 +1916,7 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
break;
}
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", variable);
+ pr_err("switch case %#x not processed\n", variable);
break;
}
}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/led.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/led.c
index c624081..9d83f08 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/led.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/led.c
@@ -57,8 +57,8 @@ void rtl92cu_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled)
rtl_write_byte(rtlpriv, REG_LEDCFG2, (ledcfg & 0x0f) | BIT(5));
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", pled->ledpin);
+ pr_err("switch case %#x not processed\n",
+ pled->ledpin);
break;
}
pled->ledon = true;
@@ -90,8 +89,8 @@ void rtl92cu_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled)
rtl_write_byte(rtlpriv, REG_LEDCFG2, (ledcfg | BIT(3)));
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", pled->ledpin);
+ pr_err("switch case %#x not processed\n",
+ pled->ledpin);
break;
}
pled->ledon = false;
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c
index cf212f6..1b124ea 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c
@@ -157,9 +157,8 @@ bool rtl92c_llt_write(struct ieee80211_hw *hw, u32 address, u32 data)
if (_LLT_NO_ACTIVE == _LLT_OP_VALUE(value))
break;
if (count > POLLING_LLT_THRESHOLD) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Failed to polling write LLT done at address %d! _LLT_OP_VALUE(%x)\n",
- address, _LLT_OP_VALUE(value));
+ pr_err("Failed to polling write LLT done at address %d! _LLT_OP_VALUE(%x)\n",
+ address, _LLT_OP_VALUE(value));
status = false;
break;
}
@@ -262,8 +261,7 @@ void rtl92c_set_key(struct ieee80211_hw *hw, u32 key_index,
enc_algo = CAM_AES;
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "illegal switch case\n");
+ pr_err("illegal switch case\n");
enc_algo = CAM_TKIP;
break;
}
@@ -280,9 +278,7 @@ void rtl92c_set_key(struct ieee80211_hw *hw, u32 key_index,
entry_id = rtl_cam_get_free_entry(hw,
p_macaddr);
if (entry_id >= TOTAL_CAM_ENTRY) {
- RT_TRACE(rtlpriv, COMP_SEC,
- DBG_EMERG,
- "Can not find free hw security cam entry\n");
+ pr_err("Can not find free hw security cam entry\n");
return;
}
} else {
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/phy.c
index f35f435..452437f 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/phy.c
@@ -274,8 +274,7 @@ bool rtl92cu_phy_config_rf_with_headerfile(struct ieee80211_hw *hw,
break;
case RF90_PATH_C:
case RF90_PATH_D:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", rfpath);
+ pr_err("switch case %#x not processed\n", rfpath);
break;
default:
break;
@@ -314,8 +313,8 @@ void rtl92cu_phy_set_bw_mode_callback(struct ieee80211_hw *hw)
rtl_write_byte(rtlpriv, REG_RRSR + 2, reg_prsr_rsc);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "unknown bandwidth: %#X\n", rtlphy->current_chan_bw);
+ pr_err("unknown bandwidth: %#X\n",
+ rtlphy->current_chan_bw);
break;
}
switch (rtlphy->current_chan_bw) {
@@ -336,8 +334,8 @@ void rtl92cu_phy_set_bw_mode_callback(struct ieee80211_hw *hw)
HAL_PRIME_CHNL_OFFSET_LOWER) ? 2 : 1);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "unknown bandwidth: %#X\n", rtlphy->current_chan_bw);
+ pr_err("unknown bandwidth: %#X\n",
+ rtlphy->current_chan_bw);
break;
}
rtl92cu_phy_rf6052_set_bandwidth(hw, rtlphy->current_chan_bw);
@@ -509,8 +506,8 @@ static bool _rtl92cu_phy_set_rf_power_state(struct ieee80211_hw *hw,
_rtl92c_phy_set_rf_sleep(hw);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", rfpwr_state);
+ pr_err("switch case %#x not processed\n",
+ rfpwr_state);
bresult = false;
break;
}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/rf.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/rf.c
index 5e31830..9cff6bc 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/rf.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/rf.c
@@ -51,8 +51,7 @@ void rtl92cu_phy_rf6052_set_bandwidth(struct ieee80211_hw *hw, u8 bandwidth)
rtlphy->rfreg_chnlval[0]);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "unknown bandwidth: %#X\n", bandwidth);
+ pr_err("unknown bandwidth: %#X\n", bandwidth);
break;
}
}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/sw.c
index b84e13a..935e830 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/sw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/sw.c
@@ -68,8 +68,7 @@ static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw)
/* for firmware buf */
rtlpriv->rtlhal.pfirmware = vzalloc(0x4000);
if (!rtlpriv->rtlhal.pfirmware) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Can't alloc buffer for fw\n");
+ pr_err("Can't alloc buffer for fw\n");
return 1;
}
if (IS_VENDOR_UMC_A_CUT(rtlpriv->rtlhal.version) &&
@@ -158,7 +157,7 @@ static struct rtl_hal_ops rtl8192cu_hal_ops = {

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

module_param_named(swenc, rtl92cu_mod_params.sw_crypto, bool, 0444);
--
2.10.2

2016-12-15 18:24:03

by Larry Finger

[permalink] [raw]
Subject: [PATCH 13/14 V2] rtlwifi: rtl8188ee: Remove all instances of DBG_EMERG

This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger <[email protected]>
Cc: Ping-Ke Shih <[email protected]>
---
V2 - eliminate some files that should not have been sent, and remove the
module name from the format. It is already specified by a pr_fmt().
---
.../net/wireless/realtek/rtlwifi/rtl8188ee/fw.c | 33 ++++++----------------
.../net/wireless/realtek/rtlwifi/rtl8188ee/hw.c | 30 ++++++++------------
.../net/wireless/realtek/rtlwifi/rtl8188ee/phy.c | 22 ++++++---------
.../net/wireless/realtek/rtlwifi/rtl8188ee/rf.c | 3 +-
.../net/wireless/realtek/rtlwifi/rtl8188ee/sw.c | 8 ++----
5 files changed, 33 insertions(+), 63 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c
index c34cde2..009fd3b 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c
@@ -125,10 +125,8 @@ static void _rtl88e_write_fw(struct ieee80211_hw *hw,
pagenums = size / FW_8192C_PAGE_SIZE;
remainsize = size % FW_8192C_PAGE_SIZE;

- if (pagenums > 8) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Page numbers should not greater then 8\n");
- }
+ if (pagenums > 8)
+ pr_err("Page numbers should not greater then 8\n");

for (page = 0; page < pagenums; page++) {
offset = page * FW_8192C_PAGE_SIZE;
@@ -157,15 +155,10 @@ static int _rtl88e_fw_free_to_go(struct ieee80211_hw *hw)
(!(value32 & FWDL_CHKSUM_RPT)));

if (counter >= FW_8192C_POLLING_TIMEOUT_COUNT) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "chksum report faill ! REG_MCUFWDL:0x%08x .\n",
- value32);
+ pr_err("chksum report fail! REG_MCUFWDL:0x%08x .\n",
+ value32);
goto exit;
}
-
- RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
- "Checksum report OK ! REG_MCUFWDL:0x%08x .\n", value32);
-
value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL);
value32 |= MCUFWDL_RDY;
value32 &= ~WINTINI_RDY;
@@ -176,20 +169,15 @@ static int _rtl88e_fw_free_to_go(struct ieee80211_hw *hw)

do {
value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL);
- if (value32 & WINTINI_RDY) {
- RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
- "Polling FW ready success!! REG_MCUFWDL:0x%08x.\n",
- value32);
- err = 0;
- goto exit;
- }
+ if (value32 & WINTINI_RDY)
+ return 0;

udelay(FW_8192C_POLLING_DELAY);

} while (counter++ < FW_8192C_POLLING_TIMEOUT_COUNT);

- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Polling FW ready fail!! REG_MCUFWDL:0x%08x .\n", value32);
+ pr_err("Polling FW ready fail!! REG_MCUFWDL:0x%08x .\n",
+ value32);

exit:
return err;
@@ -235,8 +222,7 @@ int rtl88e_download_fw(struct ieee80211_hw *hw,

err = _rtl88e_fw_free_to_go(hw);
if (err) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Firmware is not ready to run!\n");
+ pr_err("Firmware is not ready to run!\n");
} else {
RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD,
"Firmware is ready to run!\n");
@@ -309,8 +295,7 @@ static void _rtl88e_fill_h2c_command(struct ieee80211_hw *hw,
while (!write_sucess) {
wait_writeh2c_limit--;
if (wait_writeh2c_limit == 0) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Write H2C fail because no trigger for FW INT!\n");
+ pr_err("Write H2C fail because no trigger for FW INT!\n");
break;
}

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
index d85fa67..6aa593d 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
@@ -358,8 +358,7 @@ void rtl88ee_get_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
case HAL_DEF_WOWLAN:
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", variable);
+ pr_err("switch case %#x not processed\n", variable);
break;
}
}
@@ -572,9 +571,8 @@ void rtl88ee_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
acm_ctrl &= (~ACMHW_VOQEN);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n",
- e_aci);
+ pr_err("switch case %#x not processed\n",
+ e_aci);
break;
}
}
@@ -737,8 +735,7 @@ void rtl88ee_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
2, array);
break; }
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", variable);
+ pr_err("switch case %#x not processed\n", variable);
break;
}
}
@@ -759,9 +756,8 @@ static bool _rtl88ee_llt_write(struct ieee80211_hw *hw, u32 address, u32 data)
break;

if (count > POLLING_LLT_THRESHOLD) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Failed to polling write LLT done at address %d!\n",
- address);
+ pr_err("Failed to polling write LLT done at address %d!\n",
+ address);
status = false;
break;
}
@@ -1096,7 +1092,7 @@ int rtl88ee_hw_init(struct ieee80211_hw *hw)

rtstatus = _rtl88ee_init_mac(hw);
if (rtstatus != true) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Init MAC failed\n");
+ pr_info("Init MAC failed\n");
err = 1;
goto exit;
}
@@ -1252,8 +1248,7 @@ static int _rtl88ee_set_media_status(struct ieee80211_hw *hw,
"Set Network type to AP!\n");
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Network type %d not support!\n", type);
+ pr_err("Network type %d not support!\n", type);
return 1;
break;
}
@@ -1987,7 +1982,7 @@ void rtl88ee_read_eeprom_info(struct ieee80211_hw *hw)
rtlefuse->autoload_failflag = false;
_rtl88ee_read_adapter_info(hw);
} else {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Autoload ERR!!\n");
+ pr_err("Autoload ERR!!\n");
}
_rtl88ee_hal_customized_behavior(hw);
}
@@ -2354,8 +2349,8 @@ void rtl88ee_set_key(struct ieee80211_hw *hw, u32 key_index,
enc_algo = CAM_AES;
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", enc_algo);
+ pr_err("switch case %#x not processed\n",
+ enc_algo);
enc_algo = CAM_TKIP;
break;
}
@@ -2373,9 +2367,7 @@ void rtl88ee_set_key(struct ieee80211_hw *hw, u32 key_index,
entry_id =
rtl_cam_get_free_entry(hw, p_macaddr);
if (entry_id >= TOTAL_CAM_ENTRY) {
- RT_TRACE(rtlpriv, COMP_SEC,
- DBG_EMERG,
- "Can not find free hw security cam entry\n");
+ pr_err("Can not find free hw security cam entry\n");
return;
}
} else {
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/phy.c
index 870d8202..925a43f 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/phy.c
@@ -176,7 +176,7 @@ static u32 _rtl88e_phy_rf_serial_read(struct ieee80211_hw *hw,
offset &= 0xff;
newoffset = offset;
if (RT_CANNOT_IO(hw)) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "return all one\n");
+ pr_err("return all one\n");
return 0xFFFFFFFF;
}
tmplong = rtl_get_bbreg(hw, RFPGA0_XA_HSSIPARAMETER2, MASKDWORD);
@@ -220,7 +220,7 @@ static void _rtl88e_phy_rf_serial_write(struct ieee80211_hw *hw,
struct bb_reg_def *pphyreg = &rtlphy->phyreg_def[rfpath];

if (RT_CANNOT_IO(hw)) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "stop\n");
+ pr_err("stop\n");
return;
}
offset &= 0xff;
@@ -373,7 +373,7 @@ static bool _rtl88e_phy_bb8188e_config_parafile(struct ieee80211_hw *hw)

rtstatus = phy_config_bb_with_headerfile(hw, BASEBAND_CONFIG_PHY_REG);
if (!rtstatus) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Write BB Reg Fail!!\n");
+ pr_err("Write BB Reg Fail!!\n");
return false;
}

@@ -383,13 +383,13 @@ static bool _rtl88e_phy_bb8188e_config_parafile(struct ieee80211_hw *hw)
phy_config_bb_with_pghdr(hw, BASEBAND_CONFIG_PHY_REG);
}
if (!rtstatus) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "BB_PG Reg Fail!!\n");
+ pr_err("BB_PG Reg Fail!!\n");
return false;
}
rtstatus =
phy_config_bb_with_headerfile(hw, BASEBAND_CONFIG_AGC_TAB);
if (!rtstatus) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "AGC Table Fail\n");
+ pr_err("AGC Table Fail\n");
return false;
}
rtlphy->cck_high_power =
@@ -1095,8 +1095,7 @@ void rtl88e_phy_scan_operation_backup(struct ieee80211_hw *hw, u8 operation)
(u8 *)&iotype);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Unknown Scan Backup operation.\n");
+ pr_err("Unknown Scan Backup operation.\n");
break;
}
}
@@ -1137,8 +1136,8 @@ void rtl88e_phy_set_bw_mode_callback(struct ieee80211_hw *hw)
rtl_write_byte(rtlpriv, REG_RRSR + 2, reg_prsr_rsc);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "unknown bandwidth: %#X\n", rtlphy->current_chan_bw);
+ pr_err("unknown bandwidth: %#X\n",
+ rtlphy->current_chan_bw);
break;
}

@@ -1162,8 +1160,8 @@ void rtl88e_phy_set_bw_mode_callback(struct ieee80211_hw *hw)
HAL_PRIME_CHNL_OFFSET_LOWER) ? 2 : 1);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "unknown bandwidth: %#X\n", rtlphy->current_chan_bw);
+ pr_err("unknown bandwidth: %#X\n",
+ rtlphy->current_chan_bw);
break;
}
rtl88e_phy_rf6052_set_bandwidth(hw, rtlphy->current_chan_bw);
@@ -1303,8 +1300,8 @@ static bool _rtl88e_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,
currentcmd = &postcommoncmd[*step];
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Invalid 'stage' = %d, Check it!\n", *stage);
+ pr_err("Invalid 'stage' = %d, Check it!\n",
+ *stage);
return true;
}

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/rf.c b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/rf.c
index 26ac4c2..30798b1 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/rf.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/rf.c
@@ -51,8 +51,7 @@ void rtl88e_phy_rf6052_set_bandwidth(struct ieee80211_hw *hw, u8 bandwidth)
rtlphy->rfreg_chnlval[0]);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "unknown bandwidth: %#X\n", bandwidth);
+ pr_err("unknown bandwidth: %#X\n", bandwidth);
break;
}
}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/sw.c
index f361808..276c745 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/sw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/sw.c
@@ -165,8 +165,7 @@ int rtl88e_init_sw_vars(struct ieee80211_hw *hw)
/* for firmware buf */
rtlpriv->rtlhal.pfirmware = vzalloc(0x8000);
if (!rtlpriv->rtlhal.pfirmware) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Can't alloc buffer for fw.\n");
+ pr_info("Can't alloc buffer for fw.\n");
return 1;
}

@@ -177,8 +176,7 @@ int rtl88e_init_sw_vars(struct ieee80211_hw *hw)
rtlpriv->io.dev, GFP_KERNEL, hw,
rtl_fw_cb);
if (err) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Failed to request firmware!\n");
+ pr_info("Failed to request firmware!\n");
return 1;
}

@@ -278,7 +276,7 @@ static struct rtl_mod_params rtl88ee_mod_params = {
.swctrl_lps = false,
.fwctrl_lps = false,
.msi_support = true,
- .debug = DBG_EMERG,
+ .debug = 0,
};

static const struct rtl_hal_cfg rtl88ee_hal_cfg = {
--
2.10.2

2016-12-16 19:31:25

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH 02/14 V2] rtlwifi: Remove RT_TRACE messages that use DBG_EMERG

On Thu, 2016-12-15 at 12:22 -0600, Larry Finger wrote:
> These messages are always logged and represent error conditions, thus
> we can use pr_err().

OK and some trivialities:

> diff --git a/drivers/net/wireless/realtek/rtlwifi/base.c b/drivers/net/wireless/realtek/rtlwifi/base.c
[]
> @@ -389,8 +388,8 @@ static void _rtl_init_mac80211(struct ieee80211_hw *hw)
> /* <4> set mac->sband to wiphy->sband */
> hw->wiphy->bands[NL80211_BAND_5GHZ] = sband;
> } else {
> - RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, "Err BAND %d\n",
> - rtlhal->current_bandtype);
> + pr_err("Err BAND %d\n",
> + rtlhal->current_bandtype);

It's nice to rewrap lines to 80 columns where possible.

> @@ -1886,8 +1883,7 @@ void rtl_phy_scan_operation_backup(struct ieee80211_hw *hw, u8 operation)
> (u8 *)&iotype);
> break;
> default:
> - RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
> - "Unknown Scan Backup operation.\n");
> + pr_err("Unknown Scan Backup operation.\n");

And it's also nice to remove unnecessary periods for
output message consistency. Most don't use it.

> diff --git a/drivers/net/wireless/realtek/rtlwifi/cam.c b/drivers/net/wireless/realtek/rtlwifi/cam.c
[]
> @@ -285,8 +285,7 @@ u8 rtl_cam_get_free_entry(struct ieee80211_hw *hw, u8 *sta_addr)
> u8 i, *addr;
>
> if (NULL == sta_addr) {
> - RT_TRACE(rtlpriv, COMP_SEC, DBG_EMERG,
> - "sta_addr is NULL.\n");
> + pr_err("sta_addr is NULL.\n");

etc...

2016-12-15 18:24:03

by Larry Finger

[permalink] [raw]
Subject: [PATCH 14/14 V2] rtlwifi: Remove some redundant code

The symbol DBG_EMERG is no longer used and is removed.

In a number of places, the code has redundant messages. For example, if
the failure for the firmware to run is logged, it is not necessary to
log that the firmware has been started. In addition, extraneous braces are
removed.

Signed-off-by: Larry Finger <[email protected]>
Cc: Ping-Ke Shih <[email protected]>
---
V2 - eliminate some files that should not have been sent.
---
drivers/net/wireless/realtek/rtlwifi/debug.h | 2 +-
drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c | 6 +-----
.../net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c | 6 +-----
drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c | 10 ++--------
drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c | 19 ++-----------------
.../wireless/realtek/rtlwifi/rtl8723com/fw_common.c | 9 +--------
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c | 15 +++------------
7 files changed, 11 insertions(+), 56 deletions(-)

Index: wireless-drivers-next/drivers/net/wireless/realtek/rtlwifi/debug.h
===================================================================
--- wireless-drivers-next.orig/drivers/net/wireless/realtek/rtlwifi/debug.h
+++ wireless-drivers-next/drivers/net/wireless/realtek/rtlwifi/debug.h
@@ -36,7 +36,7 @@
*unexpected HW behavior, HW BUG
*and so on.
*/
-#define DBG_EMERG 0
+/*#define DBG_EMERG 0 */

/*
*Abnormal, rare, or unexpeted cases.
Index: wireless-drivers-next/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c
===================================================================
--- wireless-drivers-next.orig/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c
+++ wireless-drivers-next/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c
@@ -222,12 +222,8 @@ int rtl88e_download_fw(struct ieee80211_
_rtl88e_enable_fw_download(hw, false);

err = _rtl88e_fw_free_to_go(hw);
- if (err) {
+ if (err)
pr_err("Firmware is not ready to run!\n");
- } else {
- RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD,
- "Firmware is ready to run!\n");
- }

return 0;
}
Index: wireless-drivers-next/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c
===================================================================
--- wireless-drivers-next.orig/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c
+++ wireless-drivers-next/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c
@@ -238,12 +238,8 @@ int rtl92c_download_fw(struct ieee80211_
_rtl92c_enable_fw_download(hw, false);

err = _rtl92c_fw_free_to_go(hw);
- if (err) {
+ if (err)
pr_err("Firmware is not ready to run!\n");
- } else {
- RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
- "Firmware is ready to run!\n");
- }

return 0;
}
Index: wireless-drivers-next/drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c
===================================================================
--- wireless-drivers-next.orig/drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c
+++ wireless-drivers-next/drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c
@@ -125,9 +125,8 @@ static void _rtl92d_write_fw(struct ieee
_rtl92d_fill_dummy(bufferPtr, &size);
pagenums = size / FW_8192D_PAGE_SIZE;
remainSize = size % FW_8192D_PAGE_SIZE;
- if (pagenums > 8) {
+ if (pagenums > 8)
pr_err("Page numbers should not greater then 8\n");
- }
for (page = 0; page < pagenums; page++) {
offset = page * FW_8192D_PAGE_SIZE;
_rtl92d_fw_page_write(hw, page, (bufferPtr + offset),
@@ -156,8 +155,6 @@ static int _rtl92d_fw_free_to_go(struct
value32);
return -EIO;
}
- RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
- "Checksum report OK ! REG_MCUFWDL:0x%08x\n", value32);
value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL);
value32 |= MCUFWDL_RDY;
rtl_write_dword(rtlpriv, REG_MCUFWDL, value32);
@@ -324,12 +321,9 @@ int rtl92d_download_fw(struct ieee80211_
value &= (~BIT(5));
rtl_write_byte(rtlpriv, 0x1f, value);
spin_unlock_irqrestore(&globalmutex_for_fwdownload, flags);
- if (err) {
+ if (err)
pr_err("fw is not ready to run!\n");
goto exit;
- } else {
- RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE, "fw is ready to run!\n");
- }
exit:
err = _rtl92d_fw_init(hw);
return err;
Index: wireless-drivers-next/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c
===================================================================
--- wireless-drivers-next.orig/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c
+++ wireless-drivers-next/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c
@@ -157,10 +157,6 @@ static int _rtl92ee_fw_free_to_go(struct
value32);
goto exit;
}
-
- RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
- "Checksum report OK! REG_MCUFWDL:0x%08x\n", value32);
-
value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL);
value32 |= MCUFWDL_RDY;
value32 &= ~WINTINI_RDY;
@@ -171,13 +167,8 @@ static int _rtl92ee_fw_free_to_go(struct

do {
value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL);
- if (value32 & WINTINI_RDY) {
- RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD ,
- "Polling FW ready success!! REG_MCUFWDL:0x%08x. count = %d\n",
- value32, counter);
- err = 0;
- goto exit;
- }
+ if (value32 & WINTINI_RDY)
+ return 0;

udelay(FW_8192C_POLLING_DELAY*10);

@@ -236,12 +227,6 @@ int rtl92ee_download_fw(struct ieee80211
_rtl92ee_enable_fw_download(hw, false);

err = _rtl92ee_fw_free_to_go(hw);
- if (err) {
- pr_err("Firmware is not ready to run!\n");
- } else {
- RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD ,
- "Firmware is ready to run!\n");
- }

return 0;
}
Index: wireless-drivers-next/drivers/net/wireless/realtek/rtlwifi/rtl8723com/fw_common.c
===================================================================
--- wireless-drivers-next.orig/drivers/net/wireless/realtek/rtlwifi/rtl8723com/fw_common.c
+++ wireless-drivers-next/drivers/net/wireless/realtek/rtlwifi/rtl8723com/fw_common.c
@@ -213,9 +213,6 @@ int rtl8723_fw_free_to_go(struct ieee802
value32);
goto exit;
}
- RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
- "Checksum report OK ! REG_MCUFWDL:0x%08x .\n", value32);
-
value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL) | MCUFWDL_RDY;
value32 &= ~WINTINI_RDY;
rtl_write_dword(rtlpriv, REG_MCUFWDL, value32);
@@ -291,12 +288,8 @@ int rtl8723_download_fw(struct ieee80211
rtl8723_enable_fw_download(hw, false);

err = rtl8723_fw_free_to_go(hw, is_8723be, max_count);
- if (err) {
+ if (err)
pr_err("Firmware is not ready to run!\n");
- } else {
- RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
- "Firmware is ready to run!\n");
- }
return 0;
}
EXPORT_SYMBOL_GPL(rtl8723_download_fw);
Index: wireless-drivers-next/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c
===================================================================
--- wireless-drivers-next.orig/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c
+++ wireless-drivers-next/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c
@@ -124,9 +124,8 @@ static void _rtl8821ae_write_fw(struct i
pagenums = size / FW_8821AE_PAGE_SIZE;
remainsize = size % FW_8821AE_PAGE_SIZE;

- if (pagenums > 8) {
+ if (pagenums > 8)
pr_err("Page numbers should not greater then 8\n");
- }

for (page = 0; page < pagenums; page++) {
offset = page * FW_8821AE_PAGE_SIZE;
@@ -160,10 +159,6 @@ static int _rtl8821ae_fw_free_to_go(stru
value32);
goto exit;
}
-
- pr_err("Checksum report OK! REG_MCUFWDL:0x%08x\n",
- value32);
-
value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL);
value32 |= MCUFWDL_RDY;
value32 &= ~WINTINI_RDY;
@@ -174,13 +169,8 @@ static int _rtl8821ae_fw_free_to_go(stru
counter = 0;
do {
value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL);
- if (value32 & WINTINI_RDY) {
- RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD,
- "Polling FW ready success!! REG_MCUFWDL:0x%08x .\n",
- value32);
- err = 0;
- goto exit;
- }
+ if (value32 & WINTINI_RDY)
+ return 0;

udelay(FW_8821AE_POLLING_DELAY);
} while (counter++ < FW_8821AE_POLLING_TIMEOUT_COUNT);

2016-12-30 13:55:20

by Kalle Valo

[permalink] [raw]
Subject: Re: [01/14,V2] rtlwifi: Replace local debug macro RT_ASSERT

Larry Finger <[email protected]> wrote:
> This macro can be replaced with WARN_ONCE. In addition to using a
> standard debugging macro for these critical errors, we also get
> a stack dump.
>
> In rtl8821ae/hw.c, a senseless comment was removed, and an incorrect
> indentation was fixed.
>
> This patch also fixes two places in each of rtl8192ee, rtl8723be,
> and rtl8821ae where the logical condition was incorrect.
>
> Signed-off-by: Larry Finger <[email protected]>
> Cc: Ping-Ke Shih <[email protected]>

14 patches applied to wireless-drivers-next.git, thanks.

531940f9644d rtlwifi: Replace local debug macro RT_ASSERT
b03d968b6644 rtlwifi: Remove RT_TRACE messages that use DBG_EMERG
004a1e167905 rtlwifi: rtl8821ae: Remove all instances of DBG_EMERG
4e2b4378f9d7 rtlwifi: rtl8723be: Remove all instances of DBG_EMERG
a67005bc46d9 rtlwifi: rtl8723ae: Remove all instances of DBG_EMERG
a44f59d60365 rtlwifi: rtl8192ee: Remove all instances of DBG_EMERG
c7532b87653b rtlwifi: rtl8723-common: Remove all instances of DBG_EMERG
2d15acac2354 rtlwifi: rtl8192se: Remove all instances of DBG_EMERG
b8c79f454880 rtlwifi: rtl8192de: Remove all instances of DBG_EMERG
c38af3f06af4 rtlwifi: rtl8192cu: Remove all instances of DBG_EMERG
e40a005652ad rtlwifi: rtl8192ce: Remove all instances of DBG_EMERG
0fc30e9350be rtlwifi: rtl8192c-common: Remove all instances of DBG_EMERG
02527a73beb3 rtlwifi: rtl8188ee: Remove all instances of DBG_EMERG
c93ac39da006 rtlwifi: Remove some redundant code

--
https://patchwork.kernel.org/patch/9476703/

Documentation about submitting wireless patches and checking status
from patchwork:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

2016-12-15 18:24:03

by Larry Finger

[permalink] [raw]
Subject: [PATCH 09/14 V2] rtlwifi: rtl8192de: Remove all instances of DBG_EMERG

This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger <[email protected]>
Cc: Ping-Ke Shih <[email protected]>
---
V2 - eliminate some files that should not have been sent, and remove the
module name from the format. It is already specified by a pr_fmt().
---
.../net/wireless/realtek/rtlwifi/rtl8192de/fw.c | 19 ++++--------
.../net/wireless/realtek/rtlwifi/rtl8192de/hw.c | 34 ++++++++--------------
.../net/wireless/realtek/rtlwifi/rtl8192de/led.c | 6 ++--
.../net/wireless/realtek/rtlwifi/rtl8192de/phy.c | 31 ++++++++------------
.../net/wireless/realtek/rtlwifi/rtl8192de/rf.c | 3 +-
.../net/wireless/realtek/rtlwifi/rtl8192de/sw.c | 8 ++---
6 files changed, 36 insertions(+), 65 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c
index ddbb7e8..ed6aba0 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c
@@ -126,8 +126,7 @@ static void _rtl92d_write_fw(struct ieee80211_hw *hw,
pagenums = size / FW_8192D_PAGE_SIZE;
remainSize = size % FW_8192D_PAGE_SIZE;
if (pagenums > 8) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Page numbers should not greater then 8\n");
+ pr_err("Page numbers should not greater then 8\n");
}
for (page = 0; page < pagenums; page++) {
offset = page * FW_8192D_PAGE_SIZE;
@@ -153,9 +152,8 @@ static int _rtl92d_fw_free_to_go(struct ieee80211_hw *hw)
} while ((counter++ < FW_8192D_POLLING_TIMEOUT_COUNT) &&
(!(value32 & FWDL_ChkSum_rpt)));
if (counter >= FW_8192D_POLLING_TIMEOUT_COUNT) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "chksum report faill ! REG_MCUFWDL:0x%08x\n",
- value32);
+ pr_err("chksum report fail! REG_MCUFWDL:0x%08x\n",
+ value32);
return -EIO;
}
RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
@@ -327,8 +324,7 @@ int rtl92d_download_fw(struct ieee80211_hw *hw)
rtl_write_byte(rtlpriv, 0x1f, value);
spin_unlock_irqrestore(&globalmutex_for_fwdownload, flags);
if (err) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "fw is not ready to run!\n");
+ pr_err("fw is not ready to run!\n");
goto exit;
} else {
RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE, "fw is ready to run!\n");
@@ -407,8 +403,7 @@ static void _rtl92d_fill_h2c_command(struct ieee80211_hw *hw,
while (!bwrite_success) {
wait_writeh2c_limmit--;
if (wait_writeh2c_limmit == 0) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Write H2C fail because no trigger for FW INT!\n");
+ pr_err("Write H2C fail because no trigger for FW INT!\n");
break;
}
boxnum = rtlhal->last_hmeboxnum;
@@ -430,8 +425,8 @@ static void _rtl92d_fill_h2c_command(struct ieee80211_hw *hw,
box_extreg = REG_HMEBOX_EXT_3;
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", boxnum);
+ pr_err("switch case %#x not processed\n",
+ boxnum);
break;
}
isfw_read = _rtl92d_check_fw_read_last_h2c(hw, boxnum);
@@ -507,8 +501,8 @@ static void _rtl92d_fill_h2c_command(struct ieee80211_hw *hw,
boxcontent[idx]);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", cmd_len);
+ pr_err("switch case %#x not processed\n",
+ cmd_len);
break;
}
bwrite_success = true;
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c
index fcb14c5..2c92c33 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c
@@ -163,8 +163,7 @@ void rtl92de_get_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
case HAL_DEF_WOWLAN:
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", variable);
+ pr_err("switch case %#x not processed\n", variable);
break;
}
}
@@ -358,9 +357,8 @@ void rtl92de_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
acm_ctrl &= (~ACMHW_VOQEN);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n",
- e_aci);
+ pr_err("switch case %#x not processed\n",
+ e_aci);
break;
}
}
@@ -500,8 +498,7 @@ void rtl92de_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
break;
}
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", variable);
+ pr_err("switch case %#x not processed\n", variable);
break;
}
}
@@ -520,9 +517,8 @@ static bool _rtl92de_llt_write(struct ieee80211_hw *hw, u32 address, u32 data)
if (_LLT_NO_ACTIVE == _LLT_OP_VALUE(value))
break;
if (count > POLLING_LLT_THRESHOLD) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Failed to polling write LLT done at address %d!\n",
- address);
+ pr_err("Failed to polling write LLT done at address %d!\n",
+ address);
status = false;
break;
}
@@ -920,7 +916,7 @@ int rtl92de_hw_init(struct ieee80211_hw *hw)
/* rtlpriv->intf_ops->disable_aspm(hw); */
rtstatus = _rtl92de_init_mac(hw);
if (!rtstatus) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Init MAC failed\n");
+ pr_err("Init MAC failed\n");
err = 1;
spin_unlock_irqrestore(&globalmutex_for_power_and_efuse, flags);
return err;
@@ -1119,11 +1115,8 @@ static int _rtl92de_set_media_status(struct ieee80211_hw *hw,
"Set Network type to AP!\n");
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Network type %d not supported!\n", type);
+ pr_err("Network type %d not supported!\n", type);
return 1;
- break;
-
}
rtl_write_byte(rtlpriv, MSR, bt_msr);
rtlpriv->cfg->ops->led_control(hw, ledaction);
@@ -1732,7 +1725,7 @@ static void _rtl92de_efuse_update_chip_version(struct ieee80211_hw *hw)
break;
default:
chipver |= CHIP_92D_D_CUT;
- RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, "Unknown CUT!\n");
+ pr_err("Unknown CUT!\n");
break;
}
rtlpriv->rtlhal.version = chipver;
@@ -1816,7 +1809,7 @@ void rtl92de_read_eeprom_info(struct ieee80211_hw *hw)
rtlefuse->autoload_failflag = false;
_rtl92de_read_adapter_info(hw);
} else {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Autoload ERR!!\n");
+ pr_err("Autoload ERR!!\n");
}
return;
}
@@ -2169,8 +2162,8 @@ void rtl92de_set_key(struct ieee80211_hw *hw, u32 key_index,
enc_algo = CAM_AES;
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", enc_algo);
+ pr_err("switch case %#x not processed\n",
+ enc_algo);
enc_algo = CAM_TKIP;
break;
}
@@ -2186,9 +2178,7 @@ void rtl92de_set_key(struct ieee80211_hw *hw, u32 key_index,
entry_id = rtl_cam_get_free_entry(hw,
p_macaddr);
if (entry_id >= TOTAL_CAM_ENTRY) {
- RT_TRACE(rtlpriv, COMP_SEC,
- DBG_EMERG,
- "Can not find free hw security cam entry\n");
+ pr_err("Can not find free hw security cam entry\n");
return;
}
} else {
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/led.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/led.c
index c22b8a2..58ec4fc 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/led.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/led.c
@@ -66,8 +66,8 @@ void rtl92de_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled)
rtl_write_byte(rtlpriv, REG_LEDCFG2, (ledcfg & 0x0f) | BIT(5));
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", pled->ledpin);
+ pr_err("switch case %#x not processed\n",
+ pled->ledpin);
break;
}
pled->ledon = true;
@@ -101,8 +100,8 @@ void rtl92de_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled)
rtl_write_byte(rtlpriv, REG_LEDCFG2, (ledcfg | BIT(3)));
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", pled->ledpin);
+ pr_err("switch case %#x not processed\n",
+ pled->ledpin);
break;
}
pled->ledon = false;
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
index fbd127b..90a3443 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
@@ -716,7 +716,7 @@ static bool _rtl92d_phy_bb_config(struct ieee80211_hw *hw)
rtstatus = _rtl92d_phy_config_bb_with_headerfile(hw,
BASEBAND_CONFIG_PHY_REG);
if (!rtstatus) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Write BB Reg Fail!!\n");
+ pr_err("Write BB Reg Fail!!\n");
return false;
}

@@ -731,13 +731,13 @@ static bool _rtl92d_phy_bb_config(struct ieee80211_hw *hw)
BASEBAND_CONFIG_PHY_REG);
}
if (!rtstatus) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "BB_PG Reg Fail!!\n");
+ pr_err("BB_PG Reg Fail!!\n");
return false;
}
rtstatus = _rtl92d_phy_config_bb_with_headerfile(hw,
BASEBAND_CONFIG_AGC_TAB);
if (!rtstatus) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "AGC Table Fail\n");
+ pr_err("AGC Table Fail\n");
return false;
}
rtlphy->cck_high_power = (bool) (rtl_get_bbreg(hw,
@@ -833,8 +833,7 @@ bool rtl92d_phy_config_rf_with_headerfile(struct ieee80211_hw *hw,
break;
case RF90_PATH_C:
case RF90_PATH_D:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", rfpath);
+ pr_err("switch case %#x not processed\n", rfpath);
break;
}
return true;
@@ -987,8 +986,8 @@ void rtl92d_phy_set_bw_mode(struct ieee80211_hw *hw,
rtl_write_byte(rtlpriv, REG_RRSR + 2, reg_prsr_rsc);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "unknown bandwidth: %#X\n", rtlphy->current_chan_bw);
+ pr_err("unknown bandwidth: %#X\n",
+ rtlphy->current_chan_bw);
break;
}
switch (rtlphy->current_chan_bw) {
@@ -1019,8 +1017,8 @@ void rtl92d_phy_set_bw_mode(struct ieee80211_hw *hw,
HAL_PRIME_CHNL_OFFSET_LOWER) ? 2 : 1);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "unknown bandwidth: %#X\n", rtlphy->current_chan_bw);
+ pr_err("unknown bandwidth: %#X\n",
+ rtlphy->current_chan_bw);
break;

}
@@ -2842,9 +2839,8 @@ static bool _rtl92d_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,
rtl92d_phy_reload_iqk_setting(hw, channel);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n",
- currentcmd->cmdid);
+ pr_err("switch case %#x not processed\n",
+ currentcmd->cmdid);
break;
}
break;
@@ -2956,9 +2952,8 @@ static void rtl92d_phy_set_io(struct ieee80211_hw *hw)
rtl92d_dm_write_dig(hw);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n",
- rtlphy->current_io_type);
+ pr_err("switch case %#x not processed\n",
+ rtlphy->current_io_type);
break;
}
rtlphy->set_io_inprogress = false;
@@ -2988,8 +2983,8 @@ bool rtl92d_phy_set_io_cmd(struct ieee80211_hw *hw, enum io_type iotype)
postprocessing = true;
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", iotype);
+ pr_err("switch case %#x not processed\n",
+ iotype);
break;
}
} while (false);
@@ -3176,8 +3170,8 @@ bool rtl92d_phy_set_rf_power_state(struct ieee80211_hw *hw,
_rtl92d_phy_set_rfsleep(hw);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", rfpwr_state);
+ pr_err("switch case %#x not processed\n",
+ rfpwr_state);
bresult = false;
break;
}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/rf.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/rf.c
index 9dc9e91..021d3c5 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/rf.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/rf.c
@@ -63,8 +63,7 @@ void rtl92d_phy_rf6052_set_bandwidth(struct ieee80211_hw *hw, u8 bandwidth)
}
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "unknown bandwidth: %#X\n", bandwidth);
+ pr_err("unknown bandwidth: %#X\n", bandwidth);
break;
}
}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c
index 63e942b..0fb014e 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c
@@ -171,8 +171,7 @@ static int rtl92d_init_sw_vars(struct ieee80211_hw *hw)
/* for firmware buf */
rtlpriv->rtlhal.pfirmware = vzalloc(0x8000);
if (!rtlpriv->rtlhal.pfirmware) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Can't alloc buffer for fw\n");
+ pr_err("Can't alloc buffer for fw\n");
return 1;
}

@@ -185,8 +184,7 @@ static int rtl92d_init_sw_vars(struct ieee80211_hw *hw)
rtlpriv->io.dev, GFP_KERNEL, hw,
rtl_fw_cb);
if (err) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Failed to request firmware!\n");
+ pr_err("Failed to request firmware!\n");
return 1;
}

@@ -256,7 +254,7 @@ static struct rtl_mod_params rtl92de_mod_params = {
.inactiveps = true,
.swctrl_lps = true,
.fwctrl_lps = false,
- .debug = DBG_EMERG,
+ .debug = 0,
};

static const struct rtl_hal_cfg rtl92de_hal_cfg = {
--
2.10.2

2016-12-15 18:24:03

by Larry Finger

[permalink] [raw]
Subject: [PATCH 01/14 V2] rtlwifi: Replace local debug macro RT_ASSERT

This macro can be replaced with WARN_ONCE. In addition to using a
standard debugging macro for these critical errors, we also get
a stack dump.

In rtl8821ae/hw.c, a senseless comment was removed, and an incorrect
indentation was fixed.

This patch also fixes two places in each of rtl8192ee, rtl8723be,
and rtl8821ae where the logical condition was incorrect.

Signed-off-by: Larry Finger <[email protected]>
Cc: Ping-Ke Shih <[email protected]>
---
V2 - eliminate some files that should not have been sent.
---
drivers/net/wireless/realtek/rtlwifi/core.c | 8 ++++----
drivers/net/wireless/realtek/rtlwifi/debug.h | 14 --------------
drivers/net/wireless/realtek/rtlwifi/pci.c | 12 ++++++------
drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c | 4 ++--
drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c | 2 +-
drivers/net/wireless/realtek/rtlwifi/rtl8188ee/phy.c | 10 +++++-----
drivers/net/wireless/realtek/rtlwifi/rtl8188ee/trx.c | 8 ++++----
.../wireless/realtek/rtlwifi/rtl8192c/fw_common.c | 6 +++---
.../wireless/realtek/rtlwifi/rtl8192c/phy_common.c | 14 +++++++-------
drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c | 2 +-
drivers/net/wireless/realtek/rtlwifi/rtl8192ce/trx.c | 8 ++++----
drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c | 2 +-
drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c | 2 +-
drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c | 2 +-
drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c | 10 +++++-----
drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c | 2 +-
drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.c | 8 ++++----
drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c | 4 ++--
drivers/net/wireless/realtek/rtlwifi/rtl8192ee/hw.c | 2 +-
drivers/net/wireless/realtek/rtlwifi/rtl8192ee/phy.c | 14 +++++++-------
drivers/net/wireless/realtek/rtlwifi/rtl8192ee/trx.c | 15 +++++++++------
drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c | 2 +-
drivers/net/wireless/realtek/rtlwifi/rtl8192se/phy.c | 6 +++---
drivers/net/wireless/realtek/rtlwifi/rtl8192se/trx.c | 8 ++++----
drivers/net/wireless/realtek/rtlwifi/rtl8723ae/fw.c | 4 ++--
drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c | 2 +-
drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c | 10 +++++-----
drivers/net/wireless/realtek/rtlwifi/rtl8723ae/trx.c | 8 ++++----
drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c | 4 ++--
drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c | 2 +-
drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c | 12 ++++++------
drivers/net/wireless/realtek/rtlwifi/rtl8723be/trx.c | 14 +++++++-------
.../wireless/realtek/rtlwifi/rtl8723com/phy_common.c | 2 +-
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c | 4 ++--
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c | 16 ++++++++--------
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c | 8 ++++----
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/trx.c | 20 ++++++++++++--------
drivers/net/wireless/realtek/rtlwifi/usb.c | 2 +-
38 files changed, 133 insertions(+), 140 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/core.c b/drivers/net/wireless/realtek/rtlwifi/core.c
index 2caa4ad..7ae774d 100644
--- a/drivers/net/wireless/realtek/rtlwifi/core.c
+++ b/drivers/net/wireless/realtek/rtlwifi/core.c
@@ -1613,8 +1613,8 @@ static int rtl_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG,
"set pairwise key\n");
if (!sta) {
- RT_ASSERT(false,
- "pairwise key without mac_addr\n");
+ WARN_ONCE(true,
+ "rtlwifi: pairwise key without mac_addr\n");

err = -EOPNOTSUPP;
goto out_unlock;
@@ -1804,8 +1804,8 @@ bool rtl_hal_pwrseqcmdparsing(struct rtl_priv *rtlpriv, u8 cut_version,
"rtl_hal_pwrseqcmdparsing(): PWR_CMD_END\n");
return true;
default:
- RT_ASSERT(false,
- "rtl_hal_pwrseqcmdparsing(): Unknown CMD!!\n");
+ WARN_ONCE(true,
+ "rtlwifi: rtl_hal_pwrseqcmdparsing(): Unknown CMD!!\n");
break;
}
}
diff --git a/drivers/net/wireless/realtek/rtlwifi/debug.h b/drivers/net/wireless/realtek/rtlwifi/debug.h
index 6156a79..6f2e2b9 100644
--- a/drivers/net/wireless/realtek/rtlwifi/debug.h
+++ b/drivers/net/wireless/realtek/rtlwifi/debug.h
@@ -166,15 +166,6 @@ enum dbgp_flag_e {

#ifdef CONFIG_RTLWIFI_DEBUG

-#define RT_ASSERT(_exp, fmt, ...) \
-do { \
- if (!(_exp)) { \
- printk(KERN_DEBUG KBUILD_MODNAME ":%s(): " fmt, \
- __func__, ##__VA_ARGS__); \
- } \
-} while (0)
-
-
struct rtl_priv;

__printf(5, 6)
@@ -210,11 +201,6 @@ do { \

struct rtl_priv;

-__printf(2, 3)
-static inline void RT_ASSERT(int exp, const char *fmt, ...)
-{
-}
-
__printf(4, 5)
static inline void RT_TRACE(struct rtl_priv *rtlpriv,
int comp, int level,
diff --git a/drivers/net/wireless/realtek/rtlwifi/pci.c b/drivers/net/wireless/realtek/rtlwifi/pci.c
index 8bfe020..bb767186 100644
--- a/drivers/net/wireless/realtek/rtlwifi/pci.c
+++ b/drivers/net/wireless/realtek/rtlwifi/pci.c
@@ -2174,15 +2174,15 @@ int rtl_pci_probe(struct pci_dev *pdev,

err = pci_enable_device(pdev);
if (err) {
- RT_ASSERT(false, "%s : Cannot enable new PCI device\n",
+ WARN_ONCE(true, "%s : Cannot enable new PCI device\n",
pci_name(pdev));
return err;
}

if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) {
if (pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32))) {
- RT_ASSERT(false,
- "Unable to obtain 32bit DMA for consistent allocations\n");
+ WARN_ONCE(true,
+ "rtlwifi: Unable to obtain 32bit DMA for consistent allocations\n");
err = -ENOMEM;
goto fail1;
}
@@ -2193,7 +2193,7 @@ int rtl_pci_probe(struct pci_dev *pdev,
hw = ieee80211_alloc_hw(sizeof(struct rtl_pci_priv) +
sizeof(struct rtl_priv), &rtl_ops);
if (!hw) {
- RT_ASSERT(false,
+ WARN_ONCE(true,
"%s : ieee80211 alloc failed\n", pci_name(pdev));
err = -ENOMEM;
goto fail1;
@@ -2232,7 +2232,7 @@ int rtl_pci_probe(struct pci_dev *pdev,
/* MEM map */
err = pci_request_regions(pdev, KBUILD_MODNAME);
if (err) {
- RT_ASSERT(false, "Can't obtain PCI resources\n");
+ WARN_ONCE(true, "rtlwifi: Can't obtain PCI resources\n");
goto fail1;
}

@@ -2245,7 +2245,7 @@ int rtl_pci_probe(struct pci_dev *pdev,
(unsigned long)pci_iomap(pdev,
rtlpriv->cfg->bar_id, pmem_len);
if (rtlpriv->io.pci_mem_start == 0) {
- RT_ASSERT(false, "Can't map PCI mem\n");
+ WARN_ONCE(true, "rtlwifi: Can't map PCI mem\n");
err = -ENOMEM;
goto fail2;
}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c
index c66a2d1..fbd3eea 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c
@@ -434,8 +434,8 @@ void rtl88e_fill_h2c_cmd(struct ieee80211_hw *hw,
u32 tmp_cmdbuf[2];

if (!rtlhal->fw_ready) {
- RT_ASSERT(false,
- "return H2C cmd because of Fw download fail!!!\n");
+ WARN_ONCE(true,
+ "rtl8188ee: error H2C cmd because of Fw download fail!!!\n");
return;
}

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
index 37d6efc..1a17dfe 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
@@ -1352,7 +1352,7 @@ void rtl88ee_set_qos(struct ieee80211_hw *hw, int aci)
rtl_write_dword(rtlpriv, REG_EDCA_VO_PARAM, 0x2f3222);
break;
default:
- RT_ASSERT(false, "invalid aci: %d !\n", aci);
+ WARN_ONCE(true, "rtl8188ee: invalid aci: %d !\n", aci);
break;
}
}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/phy.c
index fffaa92..ece8691 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/phy.c
@@ -1231,8 +1231,8 @@ u8 rtl88e_phy_sw_chnl(struct ieee80211_hw *hw)
return 0;
if (rtlphy->set_bwmode_inprogress)
return 0;
- RT_ASSERT((rtlphy->current_channel <= 14),
- "WIRELESS_MODE_G but channel>14");
+ WARN_ONCE((rtlphy->current_channel > 14),
+ "rtl8188ee: WIRELESS_MODE_G but channel>14");
rtlphy->sw_chnl_inprogress = true;
rtlphy->sw_chnl_stage = 0;
rtlphy->sw_chnl_step = 0;
@@ -1280,8 +1280,8 @@ static bool _rtl88e_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,

rfdependcmdcnt = 0;

- RT_ASSERT((channel >= 1 && channel <= 14),
- "illegal channel for Zebra: %d\n", channel);
+ WARN_ONCE((channel < 1 || channel > 14),
+ "rtl8188ee: illegal channel for Zebra: %d\n", channel);

_rtl88e_phy_set_sw_chnl_cmdarray(rfdependcmd, rfdependcmdcnt++,
MAX_RFDEPENDCMD_CNT, CMDID_RF_WRITEREG,
@@ -1367,7 +1367,7 @@ static bool _rtl88e_phy_set_sw_chnl_cmdarray(struct swchnlcmd *cmdtable,
struct swchnlcmd *pcmd;

if (cmdtable == NULL) {
- RT_ASSERT(false, "cmdtable cannot be NULL.\n");
+ WARN_ONCE(true, "rtl8188ee: cmdtable cannot be NULL.\n");
return false;
}

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/trx.c b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/trx.c
index 3e3b886..09c908d 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/trx.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/trx.c
@@ -760,7 +760,7 @@ void rtl88ee_set_desc(struct ieee80211_hw *hw, u8 *pdesc,
SET_TX_DESC_NEXT_DESC_ADDRESS(pdesc, *(u32 *)val);
break;
default:
- RT_ASSERT(false, "ERR txdesc :%d not process\n",
+ WARN_ONCE(true, "rtl8188ee: ERR txdesc :%d not processed\n",
desc_name);
break;
}
@@ -779,7 +779,7 @@ void rtl88ee_set_desc(struct ieee80211_hw *hw, u8 *pdesc,
SET_RX_DESC_EOR(pdesc, 1);
break;
default:
- RT_ASSERT(false, "ERR rxdesc :%d not process\n",
+ WARN_ONCE(true, "rtl8188ee: ERR rxdesc :%d not processed\n",
desc_name);
break;
}
@@ -799,7 +799,7 @@ u32 rtl88ee_get_desc(u8 *pdesc, bool istx, u8 desc_name)
ret = GET_TX_DESC_TX_BUFFER_ADDRESS(pdesc);
break;
default:
- RT_ASSERT(false, "ERR txdesc :%d not process\n",
+ WARN_ONCE(true, "rtl8188ee: ERR txdesc :%d not processed\n",
desc_name);
break;
}
@@ -815,7 +815,7 @@ u32 rtl88ee_get_desc(u8 *pdesc, bool istx, u8 desc_name)
ret = GET_RX_DESC_BUFF_ADDR(pdesc);
break;
default:
- RT_ASSERT(false, "ERR rxdesc :%d not process\n",
+ WARN_ONCE(true, "rtl8188ee: ERR rxdesc :%d not processed\n",
desc_name);
break;
}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c
index ceacbf2..54fcf5a 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c
@@ -485,8 +485,8 @@ void rtl92c_fill_h2c_cmd(struct ieee80211_hw *hw,
u32 tmp_cmdbuf[2];

if (!rtlhal->fw_ready) {
- RT_ASSERT(false,
- "return H2C cmd because of Fw download fail!!!\n");
+ WARN_ONCE(true,
+ "rtl8192c-common: return H2C cmd because of Fw download fail!!!\n");
return;
}

@@ -510,7 +510,7 @@ void rtl92c_firmware_selfreset(struct ieee80211_hw *hw)
while (u1b_tmp & BIT(2)) {
delay--;
if (delay == 0) {
- RT_ASSERT(false, "8051 reset fail.\n");
+ WARN_ONCE(true, "rtl8192c-common: 8051 reset fail.\n");
break;
}
udelay(50);
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/phy_common.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/phy_common.c
index 94dd25c..32fc4b6 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/phy_common.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/phy_common.c
@@ -77,7 +77,7 @@ EXPORT_SYMBOL(rtl92c_phy_set_bb_reg);
u32 _rtl92c_phy_fw_rf_serial_read(struct ieee80211_hw *hw,
enum radio_path rfpath, u32 offset)
{
- RT_ASSERT(false, "deprecated!\n");
+ WARN_ONCE(true, "rtl8192c-common: _rtl92c_phy_fw_rf_serial_read deprecated!\n");
return 0;
}
EXPORT_SYMBOL(_rtl92c_phy_fw_rf_serial_read);
@@ -86,7 +86,7 @@ void _rtl92c_phy_fw_rf_serial_write(struct ieee80211_hw *hw,
enum radio_path rfpath, u32 offset,
u32 data)
{
- RT_ASSERT(false, "deprecated!\n");
+ WARN_ONCE(true, "rtl8192c-common: _rtl92c_phy_fw_rf_serial_write deprecated!\n");
}
EXPORT_SYMBOL(_rtl92c_phy_fw_rf_serial_write);

@@ -745,8 +745,8 @@ u8 rtl92c_phy_sw_chnl(struct ieee80211_hw *hw)
return 0;
if (rtlphy->set_bwmode_inprogress)
return 0;
- RT_ASSERT((rtlphy->current_channel <= 14),
- "WIRELESS_MODE_G but channel>14");
+ WARN_ONCE((rtlphy->current_channel > 14),
+ "rtl8192c-common: WIRELESS_MODE_G but channel>14");
rtlphy->sw_chnl_inprogress = true;
rtlphy->sw_chnl_stage = 0;
rtlphy->sw_chnl_step = 0;
@@ -792,7 +792,7 @@ static bool _rtl92c_phy_set_sw_chnl_cmdarray(struct swchnlcmd *cmdtable,
struct swchnlcmd *pcmd;

if (cmdtable == NULL) {
- RT_ASSERT(false, "cmdtable cannot be NULL.\n");
+ WARN_ONCE(true, "rtl8192c-common: cmdtable cannot be NULL.\n");
return false;
}

@@ -837,8 +837,8 @@ bool _rtl92c_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,

rfdependcmdcnt = 0;

- RT_ASSERT((channel >= 1 && channel <= 14),
- "illegal channel for Zebra: %d\n", channel);
+ WARN_ONCE((channel < 1 || channel > 14),
+ "rtl8192c-common: illegal channel for Zebra: %d\n", channel);

_rtl92c_phy_set_sw_chnl_cmdarray(rfdependcmd, rfdependcmdcnt++,
MAX_RFDEPENDCMD_CNT, CMDID_RF_WRITEREG,
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c
index 4483d40..b757a74 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c
@@ -1292,7 +1292,7 @@ void rtl92ce_set_qos(struct ieee80211_hw *hw, int aci)
rtl_write_dword(rtlpriv, REG_EDCA_VO_PARAM, 0x2f3222);
break;
default:
- RT_ASSERT(false, "invalid aci: %d !\n", aci);
+ WARN_ONCE(true, "rtl8192ce: invalid aci: %d !\n", aci);
break;
}
}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/trx.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/trx.c
index 2ab4a00..3616ba2 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/trx.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/trx.c
@@ -670,7 +670,7 @@ void rtl92ce_set_desc(struct ieee80211_hw *hw, u8 *pdesc, bool istx,
SET_TX_DESC_NEXT_DESC_ADDRESS(pdesc, *(u32 *) val);
break;
default:
- RT_ASSERT(false, "ERR txdesc :%d not process\n",
+ WARN_ONCE(true, "rtl8192ce: ERR txdesc :%d not processed\n",
desc_name);
break;
}
@@ -690,7 +690,7 @@ void rtl92ce_set_desc(struct ieee80211_hw *hw, u8 *pdesc, bool istx,
SET_RX_DESC_EOR(pdesc, 1);
break;
default:
- RT_ASSERT(false, "ERR rxdesc :%d not process\n",
+ WARN_ONCE(true, "rtl8192ce: ERR rxdesc :%d not processed\n",
desc_name);
break;
}
@@ -710,7 +710,7 @@ u32 rtl92ce_get_desc(u8 *p_desc, bool istx, u8 desc_name)
ret = GET_TX_DESC_TX_BUFFER_ADDRESS(p_desc);
break;
default:
- RT_ASSERT(false, "ERR txdesc :%d not process\n",
+ WARN_ONCE(true, "rtl8192ce: ERR txdesc :%d not processed\n",
desc_name);
break;
}
@@ -726,7 +726,7 @@ u32 rtl92ce_get_desc(u8 *p_desc, bool istx, u8 desc_name)
ret = GET_RX_DESC_BUFF_ADDR(p_desc);
break;
default:
- RT_ASSERT(false, "ERR rxdesc :%d not process\n",
+ WARN_ONCE(true, "rtl8192ce: ERR rxdesc :%d not processed\n",
desc_name);
break;
}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c
index 5c7da0c..ddfcf994 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c
@@ -1790,7 +1790,7 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
u4b_ac_param);
break;
default:
- RT_ASSERT(false, "invalid aci: %d !\n",
+ WARN_ONCE(true, "rtl8192cu: invalid aci: %d !\n",
e_aci);
break;
}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c
index 1ea878f..6da6e2a 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c
@@ -241,7 +241,7 @@ u16 rtl8192cu_mq_to_hwq(__le16 fc, u16 mac80211_queue_index)
break;
default:
hw_queue_index = RTL_TXQ_BE;
- RT_ASSERT(false, "QSLT_BE queue, skb_queue:%d\n",
+ WARN_ONCE(true, "rtl8192cu: QSLT_BE queue, skb_queue:%d\n",
mac80211_queue_index);
break;
}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c
index 83a87eb..452de25 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c
@@ -182,7 +182,7 @@ void rtl92d_firmware_selfreset(struct ieee80211_hw *hw)
udelay(50);
u1b_tmp = rtl_read_byte(rtlpriv, REG_SYS_FUNC_EN + 1);
}
- RT_ASSERT((delay > 0), "8051 reset failed!\n");
+ WARN_ONCE((delay <= 0), "rtl8192de: 8051 reset failed!\n");
RT_TRACE(rtlpriv, COMP_FW, DBG_DMESG,
"=====> 8051 reset success (%d)\n", delay);
}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
index 424f54b..b0dc189 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
@@ -2700,7 +2700,7 @@ static bool _rtl92d_phy_set_sw_chnl_cmdarray(struct swchnlcmd *cmdtable,
struct swchnlcmd *pcmd;

if (cmdtable == NULL) {
- RT_ASSERT(false, "cmdtable cannot be NULL\n");
+ WARN_ONCE(true, "rtl8192de: cmdtable cannot be NULL\n");
return false;
}
if (cmdtableidx >= cmdtablesz)
@@ -2893,17 +2893,17 @@ u8 rtl92d_phy_sw_chnl(struct ieee80211_hw *hw)
* 5G and 2.4G band. */
if (channel <= 14)
return 0;
- RT_ASSERT((channel > 14), "5G but channel<=14\n");
+ WARN_ONCE((channel <= 14), "rtl8192de: 5G but channel<=14\n");
break;
case BAND_ON_2_4G:
/* Get first channel error when change between
* 5G and 2.4G band. */
if (channel > 14)
return 0;
- RT_ASSERT((channel <= 14), "2G but channel>14\n");
+ WARN_ONCE((channel > 14), "rtl8192de: 2G but channel>14\n");
break;
default:
- RT_ASSERT(false, "Invalid WirelessMode(%#x)!!\n",
+ WARN_ONCE(true, "rtl8192de: Invalid WirelessMode(%#x)!!\n",
rtlpriv->mac80211.mode);
break;
}
@@ -3336,7 +3336,7 @@ void rtl92d_phy_set_poweron(struct ieee80211_hw *hw)
}
}
if (i == 200)
- RT_ASSERT(false, "Another mac power off over time\n");
+ WARN_ONCE(true, "rtl8192de: Another mac power off over time\n");
}
}

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c
index 2d65e40..0d98b34 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c
@@ -402,7 +402,7 @@ static int __init rtl92de_module_init(void)

ret = pci_register_driver(&rtl92de_driver);
if (ret)
- RT_ASSERT(false, "No device found\n");
+ WARN_ONCE(true, "rtl8192de: No device found\n");
return ret;
}

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.c
index 5fb3756..5c9c874 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.c
@@ -794,7 +794,7 @@ void rtl92de_set_desc(struct ieee80211_hw *hw, u8 *pdesc, bool istx,
SET_TX_DESC_NEXT_DESC_ADDRESS(pdesc, *(u32 *) val);
break;
default:
- RT_ASSERT(false, "ERR txdesc :%d not process\n",
+ WARN_ONCE(true, "rtl8192de: ERR txdesc :%d not processed\n",
desc_name);
break;
}
@@ -814,7 +814,7 @@ void rtl92de_set_desc(struct ieee80211_hw *hw, u8 *pdesc, bool istx,
SET_RX_DESC_EOR(pdesc, 1);
break;
default:
- RT_ASSERT(false, "ERR rxdesc :%d not process\n",
+ WARN_ONCE(true, "rtl8192de: ERR rxdesc :%d not processed\n",
desc_name);
break;
}
@@ -834,7 +834,7 @@ u32 rtl92de_get_desc(u8 *p_desc, bool istx, u8 desc_name)
ret = GET_TX_DESC_TX_BUFFER_ADDRESS(p_desc);
break;
default:
- RT_ASSERT(false, "ERR txdesc :%d not process\n",
+ WARN_ONCE(true, "rtl8192de: ERR txdesc :%d not processed\n",
desc_name);
break;
}
@@ -848,7 +848,7 @@ u32 rtl92de_get_desc(u8 *p_desc, bool istx, u8 desc_name)
ret = GET_RX_DESC_PKT_LEN(pdesc);
break;
default:
- RT_ASSERT(false, "ERR rxdesc :%d not process\n",
+ WARN_ONCE(true, "rtl8192de: ERR rxdesc :%d not processed\n",
desc_name);
break;
}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c
index a4aa239..9dfd74b 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c
@@ -462,8 +462,8 @@ void rtl92ee_fill_h2c_cmd(struct ieee80211_hw *hw,
u32 tmp_cmdbuf[2];

if (!rtlhal->fw_ready) {
- RT_ASSERT(false,
- "return H2C cmd because of Fw download fail!!!\n");
+ WARN_ONCE(true,
+ "rtl8192ee: error H2C cmd because of Fw download fail!!!\n");
return;
}

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/hw.c
index ebf663e..00b211b 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/hw.c
@@ -1582,7 +1582,7 @@ void rtl92ee_set_qos(struct ieee80211_hw *hw, int aci)
rtl_write_dword(rtlpriv, REG_EDCA_VO_PARAM, 0x2f3222);
break;
default:
- RT_ASSERT(false, "invalid aci: %d !\n", aci);
+ WARN_ONCE(true, "rtl8192ee: invalid aci: %d !\n", aci);
break;
}
}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/phy.c
index 5ad7e75..c35ba76 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/phy.c
@@ -1176,7 +1176,7 @@ static u8 _rtl92ee_phy_get_ratesection_intxpower_byrate(enum radio_path path,
rate_section = 7;
break;
default:
- RT_ASSERT(true, "Rate_Section is Illegal\n");
+ WARN_ONCE(true, "rtl8192ee: Rate_Section is Illegal\n");
break;
}
return rate_section;
@@ -1239,7 +1239,7 @@ static u8 _rtl92ee_get_txpower_by_rate(struct ieee80211_hw *hw,
shift = 24;
break;
default:
- RT_ASSERT(true, "Rate_Section is Illegal\n");
+ WARN_ONCE(true, "rtl8192ee: Rate_Section is Illegal\n");
break;
}

@@ -1811,8 +1811,8 @@ u8 rtl92ee_phy_sw_chnl(struct ieee80211_hw *hw)
return 0;
if (rtlphy->set_bwmode_inprogress)
return 0;
- RT_ASSERT((rtlphy->current_channel <= 14),
- "WIRELESS_MODE_G but channel>14");
+ WARN_ONCE((rtlphy->current_channel > 14),
+ "rtl8192ee: WIRELESS_MODE_G but channel>14");
rtlphy->sw_chnl_inprogress = true;
rtlphy->sw_chnl_stage = 0;
rtlphy->sw_chnl_step = 0;
@@ -1860,8 +1860,8 @@ static bool _rtl92ee_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,

rfdependcmdcnt = 0;

- RT_ASSERT((channel >= 1 && channel <= 14),
- "illegal channel for Zebra: %d\n", channel);
+ WARN_ONCE((channel < 1 || channel > 14),
+ "rtl8192ee: illegal channel for Zebra: %d\n", channel);

_rtl92ee_phy_set_sw_chnl_cmdarray(rfdependcmd, rfdependcmdcnt++,
MAX_RFDEPENDCMD_CNT,
@@ -1948,7 +1948,7 @@ static bool _rtl92ee_phy_set_sw_chnl_cmdarray(struct swchnlcmd *cmdtable,
struct swchnlcmd *pcmd;

if (cmdtable == NULL) {
- RT_ASSERT(false, "cmdtable cannot be NULL.\n");
+ WARN_ONCE(true, "rtl8192ee: cmdtable cannot be NULL.\n");
return false;
}

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/trx.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/trx.c
index 2d48ccd..07440e9 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/trx.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/trx.c
@@ -991,8 +991,9 @@ void rtl92ee_set_desc(struct ieee80211_hw *hw, u8 *pdesc, bool istx,
SET_RX_DESC_EOR(pdesc, 1);
break;
default:
- RT_ASSERT(false,
- "ERR rxdesc :%d not process\n", desc_name);
+ WARN_ONCE(true,
+ "rtl8192ee: ERR rxdesc :%d not processed\n",
+ desc_name);
break;
}
}
@@ -1011,8 +1012,9 @@ u32 rtl92ee_get_desc(u8 *pdesc, bool istx, u8 desc_name)
ret = GET_TXBUFFER_DESC_ADDR_LOW(pdesc, 1);
break;
default:
- RT_ASSERT(false,
- "ERR txdesc :%d not process\n", desc_name);
+ WARN_ONCE(true,
+ "rtl8192ee: ERR txdesc :%d not processed\n",
+ desc_name);
break;
}
} else {
@@ -1027,8 +1029,9 @@ u32 rtl92ee_get_desc(u8 *pdesc, bool istx, u8 desc_name)
ret = GET_RX_DESC_BUFF_ADDR(pdesc);
break;
default:
- RT_ASSERT(false,
- "ERR rxdesc :%d not process\n", desc_name);
+ WARN_ONCE(true,
+ "rtl8192ee: ERR rxdesc :%d not processed\n",
+ desc_name);
break;
}
}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c
index 26e06b2..f4ab721 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c
@@ -1251,7 +1251,7 @@ void rtl92se_set_qos(struct ieee80211_hw *hw, int aci)
rtl_write_dword(rtlpriv, EDCAPARA_VO, 0x2f3222);
break;
default:
- RT_ASSERT(false, "invalid aci: %d !\n", aci);
+ WARN_ONCE(true, "rtl8192se: invalid aci: %d !\n", aci);
break;
}
}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/phy.c
index fcb9216..6299dc1 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/phy.c
@@ -330,7 +330,7 @@ static bool _rtl92s_phy_set_sw_chnl_cmdarray(struct swchnlcmd *cmdtable,
struct swchnlcmd *pcmd;

if (cmdtable == NULL) {
- RT_ASSERT(false, "cmdtable cannot be NULL\n");
+ WARN_ONCE(true, "rtl8192se: cmdtable cannot be NULL\n");
return false;
}

@@ -374,8 +374,8 @@ static bool _rtl92s_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,

rfdependcmdcnt = 0;

- RT_ASSERT((channel >= 1 && channel <= 14),
- "invalid channel for Zebra: %d\n", channel);
+ WARN_ONCE((channel < 1 || channel > 14),
+ "rtl8192se: invalid channel for Zebra: %d\n", channel);

_rtl92s_phy_set_sw_chnl_cmdarray(rfdependcmd, rfdependcmdcnt++,
MAX_RFDEPENDCMD_CNT, CMDID_RF_WRITEREG,
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/trx.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/trx.c
index 9a5a113..12cef01 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/trx.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/trx.c
@@ -583,7 +583,7 @@ void rtl92se_set_desc(struct ieee80211_hw *hw, u8 *pdesc, bool istx,
SET_TX_DESC_NEXT_DESC_ADDRESS(pdesc, *(u32 *) val);
break;
default:
- RT_ASSERT(false, "ERR txdesc :%d not process\n",
+ WARN_ONCE(true, "rtl8192se: ERR txdesc :%d not processed\n",
desc_name);
break;
}
@@ -603,7 +603,7 @@ void rtl92se_set_desc(struct ieee80211_hw *hw, u8 *pdesc, bool istx,
SET_RX_STATUS_DESC_EOR(pdesc, 1);
break;
default:
- RT_ASSERT(false, "ERR rxdesc :%d not process\n",
+ WARN_ONCE(true, "rtl8192se: ERR rxdesc :%d not processed\n",
desc_name);
break;
}
@@ -623,7 +623,7 @@ u32 rtl92se_get_desc(u8 *desc, bool istx, u8 desc_name)
ret = GET_TX_DESC_TX_BUFFER_ADDRESS(desc);
break;
default:
- RT_ASSERT(false, "ERR txdesc :%d not process\n",
+ WARN_ONCE(true, "rtl8192se: ERR txdesc :%d not processed\n",
desc_name);
break;
}
@@ -639,7 +639,7 @@ u32 rtl92se_get_desc(u8 *desc, bool istx, u8 desc_name)
ret = GET_RX_STATUS_DESC_BUFF_ADDR(desc);
break;
default:
- RT_ASSERT(false, "ERR rxdesc :%d not process\n",
+ WARN_ONCE(true, "rtl8192se: ERR rxdesc :%d not processed\n",
desc_name);
break;
}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/fw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/fw.c
index 1186755..164a27e 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/fw.c
@@ -259,8 +259,8 @@ void rtl8723e_fill_h2c_cmd(struct ieee80211_hw *hw,
u32 tmp_cmdbuf[2];

if (!rtlhal->fw_ready) {
- RT_ASSERT(false,
- "return H2C cmd because of Fw download fail!!!\n");
+ WARN_ONCE(true,
+ "rtl8723ae: error H2C cmd because of Fw download fail!!!\n");
return;
}
memset(tmp_cmdbuf, 0, 8);
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c
index f8be0bd..e0da8dc 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c
@@ -1256,7 +1256,7 @@ void rtl8723e_set_qos(struct ieee80211_hw *hw, int aci)
rtl_write_dword(rtlpriv, REG_EDCA_VO_PARAM, 0x2f3222);
break;
default:
- RT_ASSERT(false, "invalid aci: %d !\n", aci);
+ WARN_ONCE(true, "rtl8723ae: invalid aci: %d !\n", aci);
break;
}
}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c
index 17b58cb..8001dce 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c
@@ -133,7 +133,7 @@ static void _rtl8723e_phy_fw_rf_serial_write(struct ieee80211_hw *hw,
enum radio_path rfpath, u32 offset,
u32 data)
{
- RT_ASSERT(false, "deprecated!\n");
+ WARN_ONCE(true, "rtl8723ae: _rtl8723e_phy_fw_rf_serial_write deprecated!\n");
}

static void _rtl8723e_phy_bb_config_1t(struct ieee80211_hw *hw)
@@ -885,8 +885,8 @@ u8 rtl8723e_phy_sw_chnl(struct ieee80211_hw *hw)
return 0;
if (rtlphy->set_bwmode_inprogress)
return 0;
- RT_ASSERT((rtlphy->current_channel <= 14),
- "WIRELESS_MODE_G but channel>14");
+ WARN_ONCE((rtlphy->current_channel > 14),
+ "rtl8723ae: WIRELESS_MODE_G but channel>14");
rtlphy->sw_chnl_inprogress = true;
rtlphy->sw_chnl_stage = 0;
rtlphy->sw_chnl_step = 0;
@@ -954,8 +954,8 @@ static bool _rtl8723e_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,

rfdependcmdcnt = 0;

- RT_ASSERT((channel >= 1 && channel <= 14),
- "illegal channel for Zebra: %d\n", channel);
+ WARN_ONCE((channel < 1 || channel > 14),
+ "rtl8723ae: illegal channel for Zebra: %d\n", channel);

rtl8723_phy_set_sw_chnl_cmdarray(rfdependcmd, rfdependcmdcnt++,
MAX_RFDEPENDCMD_CNT, CMDID_RF_WRITEREG,
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/trx.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/trx.c
index e93125e..c9838f5 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/trx.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/trx.c
@@ -617,7 +617,7 @@ void rtl8723e_set_desc(struct ieee80211_hw *hw, u8 *pdesc,
SET_TX_DESC_NEXT_DESC_ADDRESS(pdesc, *(u32 *) val);
break;
default:
- RT_ASSERT(false, "ERR txdesc :%d not process\n",
+ WARN_ONCE(true, "rtl8723ae: ERR txdesc :%d not processed\n",
desc_name);
break;
}
@@ -636,7 +636,7 @@ void rtl8723e_set_desc(struct ieee80211_hw *hw, u8 *pdesc,
SET_RX_DESC_EOR(pdesc, 1);
break;
default:
- RT_ASSERT(false, "ERR rxdesc :%d not process\n",
+ WARN_ONCE(true, "rtl8723ae: ERR rxdesc :%d not processed\n",
desc_name);
break;
}
@@ -656,7 +656,7 @@ u32 rtl8723e_get_desc(u8 *pdesc, bool istx, u8 desc_name)
ret = GET_TX_DESC_TX_BUFFER_ADDRESS(pdesc);
break;
default:
- RT_ASSERT(false, "ERR txdesc :%d not process\n",
+ WARN_ONCE(true, "rtl8723ae: ERR txdesc :%d not processed\n",
desc_name);
break;
}
@@ -672,7 +672,7 @@ u32 rtl8723e_get_desc(u8 *pdesc, bool istx, u8 desc_name)
ret = GET_RX_DESC_BUFF_ADDR(pdesc);
break;
default:
- RT_ASSERT(false, "ERR rxdesc :%d not process\n",
+ WARN_ONCE(true, "rtl8723ae: ERR rxdesc :%d not processed\n",
desc_name);
break;
}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c
index 8c5c27c..6b03c7f 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c
@@ -224,8 +224,8 @@ void rtl8723be_fill_h2c_cmd(struct ieee80211_hw *hw, u8 element_id,
u32 tmp_cmdbuf[2];

if (!rtlhal->fw_ready) {
- RT_ASSERT(false,
- "return H2C cmd because of Fw download fail!!!\n");
+ WARN_ONCE(true,
+ "rtl8723be: error H2C cmd because of Fw download fail!!!\n");
return;
}

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c
index aba60c3..56a1ae4 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c
@@ -1631,7 +1631,7 @@ void rtl8723be_set_qos(struct ieee80211_hw *hw, int aci)
rtl_write_dword(rtlpriv, REG_EDCA_VO_PARAM, 0x2f3222);
break;
default:
- RT_ASSERT(false, "invalid aci: %d !\n", aci);
+ WARN_ONCE(true, "rtl8723be: invalid aci: %d !\n", aci);
break;
}
}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c
index 3cc2232..b4e0a58 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c
@@ -939,7 +939,7 @@ static u8 _rtl8723be_phy_get_ratesection_intxpower_byrate(enum radio_path path,
break;

default:
- RT_ASSERT(true, "Rate_Section is Illegal\n");
+ WARN_ONCE(true, "rtl8723be: Rate_Section is Illegal\n");
break;
}

@@ -1004,7 +1004,7 @@ static u8 _rtl8723be_get_txpower_by_rate(struct ieee80211_hw *hw,
shift = 24;
break;
default:
- RT_ASSERT(true, "Rate_Section is Illegal\n");
+ WARN_ONCE(true, "rtl8723be: Rate_Section is Illegal\n");
break;
}
tx_pwr_diff = (u8)(rtlphy->tx_power_by_rate_offset[band][rfpath][tx_num]
@@ -1387,8 +1387,8 @@ u8 rtl8723be_phy_sw_chnl(struct ieee80211_hw *hw)
return 0;
if (rtlphy->set_bwmode_inprogress)
return 0;
- RT_ASSERT((rtlphy->current_channel <= 14),
- "WIRELESS_MODE_G but channel>14");
+ WARN_ONCE((rtlphy->current_channel > 14),
+ "rtl8723be: WIRELESS_MODE_G but channel>14");
rtlphy->sw_chnl_inprogress = true;
rtlphy->sw_chnl_stage = 0;
rtlphy->sw_chnl_step = 0;
@@ -1438,8 +1438,8 @@ static bool _rtl8723be_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,

rfdependcmdcnt = 0;

- RT_ASSERT((channel >= 1 && channel <= 14),
- "illegal channel for Zebra: %d\n", channel);
+ WARN_ONCE((channel < 1 || channel > 14),
+ "rtl8723be: illegal channel for Zebra: %d\n", channel);

rtl8723_phy_set_sw_chnl_cmdarray(rfdependcmd, rfdependcmdcnt++,
MAX_RFDEPENDCMD_CNT,
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/trx.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/trx.c
index 2175aec..6f65003 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/trx.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/trx.c
@@ -666,8 +666,8 @@ void rtl8723be_set_desc(struct ieee80211_hw *hw, u8 *pdesc,
SET_TX_DESC_NEXT_DESC_ADDRESS(pdesc, *(u32 *)val);
break;
default:
- RT_ASSERT(false, "ERR txdesc :%d not process\n",
- desc_name);
+ WARN_ONCE(true, "rtl8723be: ERR txdesc :%d not processed\n",
+ desc_name);
break;
}
} else {
@@ -685,8 +685,8 @@ void rtl8723be_set_desc(struct ieee80211_hw *hw, u8 *pdesc,
SET_RX_DESC_EOR(pdesc, 1);
break;
default:
- RT_ASSERT(false, "ERR rxdesc :%d not process\n",
- desc_name);
+ WARN_ONCE(true, "rtl8723be: ERR rxdesc :%d not process\n",
+ desc_name);
break;
}
}
@@ -705,8 +705,8 @@ u32 rtl8723be_get_desc(u8 *pdesc, bool istx, u8 desc_name)
ret = GET_TX_DESC_TX_BUFFER_ADDRESS(pdesc);
break;
default:
- RT_ASSERT(false, "ERR txdesc :%d not process\n",
- desc_name);
+ WARN_ONCE(true, "rtl8723be: ERR txdesc :%d not process\n",
+ desc_name);
break;
}
} else {
@@ -721,7 +721,7 @@ u32 rtl8723be_get_desc(u8 *pdesc, bool istx, u8 desc_name)
ret = GET_RX_DESC_BUFF_ADDR(pdesc);
break;
default:
- RT_ASSERT(false, "ERR rxdesc :%d not process\n",
+ WARN_ONCE(true, "rtl8723be: ERR rxdesc :%d not processed\n",
desc_name);
break;
}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723com/phy_common.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723com/phy_common.c
index 75cbd15..6b80ddc 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723com/phy_common.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723com/phy_common.c
@@ -283,7 +283,7 @@ bool rtl8723_phy_set_sw_chnl_cmdarray(struct swchnlcmd *cmdtable,
struct swchnlcmd *pcmd;

if (cmdtable == NULL) {
- RT_ASSERT(false, "cmdtable cannot be NULL.\n");
+ WARN_ONCE(true, "rtl8723-common: cmdtable cannot be NULL.\n");
return false;
}

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c
index 2f598dd..e8688f4 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c
@@ -510,8 +510,8 @@ void rtl8821ae_fill_h2c_cmd(struct ieee80211_hw *hw,
u32 tmp_cmdbuf[2];

if (!rtlhal->fw_ready) {
- RT_ASSERT(false,
- "return H2C cmd because of Fw download fail!!!\n");
+ WARN_ONCE(true,
+ "rtl8821ae: error H2C cmd because of Fw download fail!!!\n");
return;
}

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c
index 1281ebe..b045dd0 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c
@@ -2249,7 +2249,7 @@ void rtl8821ae_set_qos(struct ieee80211_hw *hw, int aci)
rtl_write_dword(rtlpriv, REG_EDCA_VO_PARAM, 0x2f3222);
break;
default:
- RT_ASSERT(false, "invalid aci: %d !\n", aci);
+ WARN_ONCE(true, "rtl8821ae: invalid aci: %d !\n", aci);
break;
}
}
@@ -2601,11 +2601,10 @@ static u8 _rtl8821ae_get_chnl_group(u8 chnl)
group = 12;
else if (173 <= chnl && chnl <= 177)
group = 13;
- else
- /*RT_TRACE(rtlpriv, COMP_EFUSE,DBG_LOUD,
- "5G, Channel %d in Group not found\n",chnl);*/
- RT_ASSERT(!COMP_EFUSE,
- "5G, Channel %d in Group not found\n", chnl);
+ else
+ WARN_ONCE(true,
+ "rtl8821ae: 5G, Channel %d in Group not found\n",
+ chnl);
}
return group;
}
@@ -4135,8 +4134,9 @@ void rtl8821ae_add_wowlan_pattern(struct ieee80211_hw *hw,
count++;
} while (tmp && count < 100);

- RT_ASSERT((count < 100),
- "Write wake up frame mask FAIL %d value!\n", tmp);
+ WARN_ONCE((count >= 100),
+ "rtl8821ae: Write wake up frame mask FAIL %d value!\n",
+ tmp);
}
/* Disable Rx packet buffer access. */
rtl_write_byte(rtlpriv, REG_PKT_BUFF_ACCESS_CTRL,
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
index 5dad402..7e2f7b0 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
@@ -1870,8 +1870,8 @@ static u8 _rtl8821ae_get_rate_section_index(u32 regaddr)
else if (regaddr >= 0xE20 && regaddr <= 0xE4C)
index = (u8)((regaddr - 0xE20) / 4);
else
- RT_ASSERT(!COMP_INIT,
- "Invalid RegAddr 0x%x\n", regaddr);
+ WARN_ONCE(true,
+ "rtl8821ae: Invalid RegAddr 0x%x\n", regaddr);
return index;
}

@@ -2322,7 +2322,7 @@ static s8 _rtl8821ae_phy_get_ratesection_intxpower_byrate(u8 path, u8 rate)
rate_section = 11;
break;
default:
- RT_ASSERT(true, "Rate_Section is Illegal\n");
+ WARN_ONCE(true, "rtl8821ae: Rate_Section is Illegal\n");
break;
}

@@ -2588,7 +2588,7 @@ static s8 _rtl8821ae_phy_get_txpower_by_rate(struct ieee80211_hw *hw,
shift = 24;
break;
default:
- RT_ASSERT(true, "Rate_Section is Illegal\n");
+ WARN_ONCE(true, "rtl8821ae: Rate_Section is Illegal\n");
break;
}

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/trx.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/trx.c
index 2772718..1080981 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/trx.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/trx.c
@@ -904,8 +904,9 @@ void rtl8821ae_set_desc(struct ieee80211_hw *hw, u8 *pdesc,
SET_TX_DESC_NEXT_DESC_ADDRESS(pdesc, *(u32 *)val);
break;
default:
- RT_ASSERT(false,
- "ERR txdesc :%d not process\n", desc_name);
+ WARN_ONCE(true,
+ "rtl8821ae: ERR txdesc :%d not processed\n",
+ desc_name);
break;
}
} else {
@@ -923,8 +924,9 @@ void rtl8821ae_set_desc(struct ieee80211_hw *hw, u8 *pdesc,
SET_RX_DESC_EOR(pdesc, 1);
break;
default:
- RT_ASSERT(false,
- "ERR rxdesc :%d not process\n", desc_name);
+ WARN_ONCE(true,
+ "rtl8821ae: ERR rxdesc :%d not processed\n",
+ desc_name);
break;
}
}
@@ -943,8 +945,9 @@ u32 rtl8821ae_get_desc(u8 *pdesc, bool istx, u8 desc_name)
ret = GET_TX_DESC_TX_BUFFER_ADDRESS(pdesc);
break;
default:
- RT_ASSERT(false,
- "ERR txdesc :%d not process\n", desc_name);
+ WARN_ONCE(true,
+ "rtl8821ae: ERR txdesc :%d not processed\n",
+ desc_name);
break;
}
} else {
@@ -959,8 +962,9 @@ u32 rtl8821ae_get_desc(u8 *pdesc, bool istx, u8 desc_name)
ret = GET_RX_DESC_BUFF_ADDR(pdesc);
break;
default:
- RT_ASSERT(false,
- "ERR rxdesc :%d not process\n", desc_name);
+ WARN_ONCE(true,
+ "rtl8821ae: ERR rxdesc :%d not processed\n",
+ desc_name);
break;
}
}
diff --git a/drivers/net/wireless/realtek/rtlwifi/usb.c b/drivers/net/wireless/realtek/rtlwifi/usb.c
index 0a508649..1558f54 100644
--- a/drivers/net/wireless/realtek/rtlwifi/usb.c
+++ b/drivers/net/wireless/realtek/rtlwifi/usb.c
@@ -1059,7 +1059,7 @@ int rtl_usb_probe(struct usb_interface *intf,
hw = ieee80211_alloc_hw(sizeof(struct rtl_priv) +
sizeof(struct rtl_usb_priv), &rtl_ops);
if (!hw) {
- RT_ASSERT(false, "ieee80211 alloc failed\n");
+ WARN_ONCE(true, "rtl_usb: ieee80211 alloc failed\n");
return -ENOMEM;
}
rtlpriv = hw->priv;
--
2.10.2

2016-12-15 18:24:02

by Larry Finger

[permalink] [raw]
Subject: [PATCH 02/14 V2] rtlwifi: Remove RT_TRACE messages that use DBG_EMERG

These messages are always logged and represent error conditions, thus
we can use pr_err().

Signed-off-by: Larry Finger <[email protected]>
Cc: Ping-Ke Shih <[email protected]>
---
V2 - eliminate some files that should not have been sent, and remove the
module name from the format. It is already specified by a pr_fmt().
---
drivers/net/wireless/realtek/rtlwifi/base.c | 14 +++------
drivers/net/wireless/realtek/rtlwifi/cam.c | 14 +++------
drivers/net/wireless/realtek/rtlwifi/core.c | 20 +++++-------
drivers/net/wireless/realtek/rtlwifi/efuse.c | 3 +-
drivers/net/wireless/realtek/rtlwifi/pci.c | 36 ++++++++--------------
drivers/net/wireless/realtek/rtlwifi/ps.c | 3 +-
drivers/net/wireless/realtek/rtlwifi/rc.c | 3 +-
drivers/net/wireless/realtek/rtlwifi/usb.c | 46 +++++++++-------------------
8 files changed, 47 insertions(+), 92 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/base.c b/drivers/net/wireless/realtek/rtlwifi/base.c
index 4ac928b..0a8553e 100644
--- a/drivers/net/wireless/realtek/rtlwifi/base.c
+++ b/drivers/net/wireless/realtek/rtlwifi/base.c
@@ -207,8 +207,7 @@ static void _rtl_init_hw_ht_capab(struct ieee80211_hw *hw,
*highest supported RX rate
*/
if (rtlpriv->dm.supp_phymode_switch) {
- RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG,
- "Support phy mode switch\n");
+ pr_info("Support phy mode switch\n");

ht_cap->mcs.rx_mask[0] = 0xFF;
ht_cap->mcs.rx_mask[1] = 0xFF;
@@ -389,8 +388,8 @@ static void _rtl_init_mac80211(struct ieee80211_hw *hw)
/* <4> set mac->sband to wiphy->sband */
hw->wiphy->bands[NL80211_BAND_5GHZ] = sband;
} else {
- RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, "Err BAND %d\n",
- rtlhal->current_bandtype);
+ pr_err("Err BAND %d\n",
+ rtlhal->current_bandtype);
}
}
/* <5> set hw caps */
@@ -544,7 +542,7 @@ int rtl_init_core(struct ieee80211_hw *hw)
* mac80211 hw in _rtl_init_mac80211.
*/
if (rtl_regd_init(hw, rtl_reg_notifier)) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "REGD init failed\n");
+ pr_err("REGD init failed\n");
return 1;
}

@@ -1694,8 +1692,7 @@ void rtl_watchdog_wq_callback(void *data)
* we should reconnect this AP
*/
if (rtlpriv->link_info.roam_times >= 5) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "AP off, try to reconnect now\n");
+ pr_err("AP off, try to reconnect now\n");
rtlpriv->link_info.roam_times = 0;
ieee80211_connection_loss(
rtlpriv->mac80211.vif);
@@ -1886,8 +1883,7 @@ void rtl_phy_scan_operation_backup(struct ieee80211_hw *hw, u8 operation)
(u8 *)&iotype);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Unknown Scan Backup operation.\n");
+ pr_err("Unknown Scan Backup operation.\n");
break;
}
}
diff --git a/drivers/net/wireless/realtek/rtlwifi/cam.c b/drivers/net/wireless/realtek/rtlwifi/cam.c
index 8fe8b4c..a0605d8 100644
--- a/drivers/net/wireless/realtek/rtlwifi/cam.c
+++ b/drivers/net/wireless/realtek/rtlwifi/cam.c
@@ -285,8 +285,7 @@ u8 rtl_cam_get_free_entry(struct ieee80211_hw *hw, u8 *sta_addr)
u8 i, *addr;

if (NULL == sta_addr) {
- RT_TRACE(rtlpriv, COMP_SEC, DBG_EMERG,
- "sta_addr is NULL.\n");
+ pr_err("sta_addr is NULL.\n");
return TOTAL_CAM_ENTRY;
}
/* Does STA already exist? */
@@ -298,9 +297,8 @@ u8 rtl_cam_get_free_entry(struct ieee80211_hw *hw, u8 *sta_addr)
/* Get a free CAM entry. */
for (entry_idx = 4; entry_idx < TOTAL_CAM_ENTRY; entry_idx++) {
if ((bitmap & BIT(0)) == 0) {
- RT_TRACE(rtlpriv, COMP_SEC, DBG_EMERG,
- "-----hwsec_cam_bitmap: 0x%x entry_idx=%d\n",
- rtlpriv->sec.hwsec_cam_bitmap, entry_idx);
+ pr_err("-----hwsec_cam_bitmap: 0x%x entry_idx=%d\n",
+ rtlpriv->sec.hwsec_cam_bitmap, entry_idx);
rtlpriv->sec.hwsec_cam_bitmap |= BIT(0) << entry_idx;
memcpy(rtlpriv->sec.hwsec_cam_sta_addr[entry_idx],
sta_addr, ETH_ALEN);
@@ -319,14 +317,12 @@ void rtl_cam_del_entry(struct ieee80211_hw *hw, u8 *sta_addr)
u8 i, *addr;

if (NULL == sta_addr) {
- RT_TRACE(rtlpriv, COMP_SEC, DBG_EMERG,
- "sta_addr is NULL.\n");
+ pr_err("sta_addr is NULL.\n");
return;
}

if (is_zero_ether_addr(sta_addr)) {
- RT_TRACE(rtlpriv, COMP_SEC, DBG_EMERG,
- "sta_addr is %pM\n", sta_addr);
+ pr_err("sta_addr is %pM\n", sta_addr);
return;
}
/* Does STA already exist? */
diff --git a/drivers/net/wireless/realtek/rtlwifi/core.c b/drivers/net/wireless/realtek/rtlwifi/core.c
index 6aad64c..77d7baa 100644
--- a/drivers/net/wireless/realtek/rtlwifi/core.c
+++ b/drivers/net/wireless/realtek/rtlwifi/core.c
@@ -117,8 +117,7 @@ static void rtl_fw_do_work(const struct firmware *firmware, void *context,
}
found_alt:
if (firmware->size > rtlpriv->max_fw_size) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Firmware is too big!\n");
+ pr_err("Firmware is too big!\n");
release_firmware(firmware);
return;
}
@@ -303,8 +302,8 @@ static int rtl_op_add_interface(struct ieee80211_hw *hw,
(u8 *)(&mac->basic_rates));
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "operation mode %d is not support!\n", vif->type);
+ pr_err("operation mode %d is not supported!\n",
+ vif->type);
err = -EOPNOTSUPP;
goto out;
}
@@ -764,9 +762,8 @@ static int rtl_op_config(struct ieee80211_hw *hw, u32 changed)
default:
mac->bw_40 = false;
mac->bw_80 = false;
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n",
- channel_type);
+ pr_err("switch case %#x not processed\n",
+ channel_type);
break;
}
}
@@ -1399,8 +1396,7 @@ static int rtl_op_ampdu_action(struct ieee80211_hw *hw,
"IEEE80211_AMPDU_RX_STOP:TID:%d\n", tid);
return rtl_rx_agg_stop(hw, sta, tid);
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "IEEE80211_AMPDU_ERR!!!!:\n");
+ pr_err("IEEE80211_AMPDU_ERR!!!!:\n");
return -EOPNOTSUPP;
}
return 0;
@@ -1536,8 +1532,7 @@ static int rtl_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
err = -EOPNOTSUPP;
goto out_unlock;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "alg_err:%x!!!!:\n", key->cipher);
+ pr_err("alg_err:%x!!!!:\n", key->cipher);
goto out_unlock;
}
if (key_type == WEP40_ENCRYPTION ||
@@ -1662,8 +1657,7 @@ static int rtl_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
rtl_cam_delete_one_entry(hw, mac_addr, key_idx);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "cmd_err:%x!!!!:\n", cmd);
+ pr_err("cmd_err:%x!!!!:\n", cmd);
}
out_unlock:
mutex_unlock(&rtlpriv->locks.conf_mutex);
diff --git a/drivers/net/wireless/realtek/rtlwifi/efuse.c b/drivers/net/wireless/realtek/rtlwifi/efuse.c
index 7becfef..afc7550 100644
--- a/drivers/net/wireless/realtek/rtlwifi/efuse.c
+++ b/drivers/net/wireless/realtek/rtlwifi/efuse.c
@@ -1259,8 +1259,7 @@ int rtl_get_hwinfo(struct ieee80211_hw *hw, struct rtl_priv *rtlpriv,
break;

case EEPROM_93C46:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "RTL8XXX did not boot from eeprom, check it !!\n");
+ pr_err("RTL8XXX did not boot from eeprom, check it !!\n");
return 1;

default:
diff --git a/drivers/net/wireless/realtek/rtlwifi/pci.c b/drivers/net/wireless/realtek/rtlwifi/pci.c
index 661c66f..f8bfa73 100644
--- a/drivers/net/wireless/realtek/rtlwifi/pci.c
+++ b/drivers/net/wireless/realtek/rtlwifi/pci.c
@@ -174,9 +174,8 @@ static void _rtl_pci_update_default_setting(struct ieee80211_hw *hw)
}
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n",
- rtlpci->const_support_pciaspm);
+ pr_err("switch case %#x not processed\n",
+ rtlpci->const_support_pciaspm);
break;
}

@@ -1247,9 +1246,8 @@ static int _rtl_pci_init_tx_ring(struct ieee80211_hw *hw,
&buffer_desc_dma);

if (!buffer_desc || (unsigned long)buffer_desc & 0xFF) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Cannot allocate TX ring (prio = %d)\n",
- prio);
+ pr_err("Cannot allocate TX ring (prio = %d)\n",
+ prio);
return -ENOMEM;
}

@@ -1266,8 +1264,7 @@ static int _rtl_pci_init_tx_ring(struct ieee80211_hw *hw,
sizeof(*desc) * entries, &desc_dma);

if (!desc || (unsigned long)desc & 0xFF) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Cannot allocate TX ring (prio = %d)\n", prio);
+ pr_err("Cannot allocate TX ring (prio = %d)\n", prio);
return -ENOMEM;
}

@@ -1314,8 +1311,7 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw, int rxring_idx)
&rtlpci->rx_ring[rxring_idx].dma);
if (!rtlpci->rx_ring[rxring_idx].buffer_desc ||
(ulong)rtlpci->rx_ring[rxring_idx].buffer_desc & 0xFF) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Cannot allocate RX ring\n");
+ pr_err("Cannot allocate RX ring\n");
return -ENOMEM;
}

@@ -1338,8 +1334,7 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw, int rxring_idx)
&rtlpci->rx_ring[rxring_idx].dma);
if (!rtlpci->rx_ring[rxring_idx].desc ||
(unsigned long)rtlpci->rx_ring[rxring_idx].desc & 0xFF) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Cannot allocate RX ring\n");
+ pr_err("Cannot allocate RX ring\n");
return -ENOMEM;
}

@@ -1799,15 +1794,13 @@ static void rtl_pci_deinit(struct ieee80211_hw *hw)

static int rtl_pci_init(struct ieee80211_hw *hw, struct pci_dev *pdev)
{
- struct rtl_priv *rtlpriv = rtl_priv(hw);
int err;

_rtl_pci_init_struct(hw, pdev);

err = _rtl_pci_init_trx_ring(hw);
if (err) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "tx ring initialization failed\n");
+ pr_err("tx ring initialization failed\n");
return err;
}

@@ -2275,7 +2268,7 @@ int rtl_pci_probe(struct pci_dev *pdev,
rtlpriv->cfg->ops->read_eeprom_info(hw);

if (rtlpriv->cfg->ops->init_sw_vars(hw)) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Can't init_sw_vars\n");
+ pr_err("Can't init_sw_vars\n");
err = -ENODEV;
goto fail3;
}
@@ -2287,22 +2280,20 @@ int rtl_pci_probe(struct pci_dev *pdev,
/* Init mac80211 sw */
err = rtl_init_core(hw);
if (err) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Can't allocate sw for mac80211\n");
+ pr_err("Can't allocate sw for mac80211\n");
goto fail3;
}

/* Init PCI sw */
err = rtl_pci_init(hw, pdev);
if (err) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Failed to init PCI\n");
+ pr_err("Failed to init PCI\n");
goto fail3;
}

err = ieee80211_register_hw(hw);
if (err) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Can't register mac80211 hw.\n");
+ pr_err("Can't register mac80211 hw.\n");
err = -ENODEV;
goto fail3;
}
@@ -2310,8 +2301,7 @@ int rtl_pci_probe(struct pci_dev *pdev,

err = sysfs_create_group(&pdev->dev.kobj, &rtl_attribute_group);
if (err) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "failed to create sysfs device attributes\n");
+ pr_err("failed to create sysfs device attributes\n");
goto fail3;
}

diff --git a/drivers/net/wireless/realtek/rtlwifi/ps.c b/drivers/net/wireless/realtek/rtlwifi/ps.c
index d0ffc4d..4f83270 100644
--- a/drivers/net/wireless/realtek/rtlwifi/ps.c
+++ b/drivers/net/wireless/realtek/rtlwifi/ps.c
@@ -150,8 +150,7 @@ static bool rtl_ps_set_rf_state(struct ieee80211_hw *hw,
break;

default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", state_toset);
+ pr_err("switch case %#x not processed\n", state_toset);
break;
}

diff --git a/drivers/net/wireless/realtek/rtlwifi/rc.c b/drivers/net/wireless/realtek/rtlwifi/rc.c
index ce8621a..951d257 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rc.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rc.c
@@ -267,8 +267,7 @@ static void *rtl_rate_alloc_sta(void *ppriv,

rate_priv = kzalloc(sizeof(struct rtl_rate_priv), gfp);
if (!rate_priv) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Unable to allocate private rc structure\n");
+ pr_err("Unable to allocate private rc structure\n");
return NULL;
}

diff --git a/drivers/net/wireless/realtek/rtlwifi/usb.c b/drivers/net/wireless/realtek/rtlwifi/usb.c
index dc58aa6..14d68e9 100644
--- a/drivers/net/wireless/realtek/rtlwifi/usb.c
+++ b/drivers/net/wireless/realtek/rtlwifi/usb.c
@@ -421,14 +421,12 @@ static void _rtl_rx_completed(struct urb *urb);
static int _rtl_prep_rx_urb(struct ieee80211_hw *hw, struct rtl_usb *rtlusb,
struct urb *urb, gfp_t gfp_mask)
{
- struct rtl_priv *rtlpriv = rtl_priv(hw);
void *buf;

buf = usb_alloc_coherent(rtlusb->udev, rtlusb->rx_max_size, gfp_mask,
&urb->transfer_dma);
if (!buf) {
- RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG,
- "Failed to usb_alloc_coherent!!\n");
+ pr_err("Failed to usb_alloc_coherent!!\n");
return -ENOMEM;
}

@@ -613,8 +611,6 @@ static unsigned int _rtl_rx_get_padding(struct ieee80211_hdr *hdr,
static void _rtl_rx_completed(struct urb *_urb)
{
struct rtl_usb *rtlusb = (struct rtl_usb *)_urb->context;
- struct ieee80211_hw *hw = usb_get_intfdata(rtlusb->intf);
- struct rtl_priv *rtlpriv = rtl_priv(hw);
int err = 0;

if (unlikely(IS_USB_STOP(rtlusb)))
@@ -628,17 +624,15 @@ static void _rtl_rx_completed(struct urb *_urb)
struct ieee80211_hdr *hdr;

if (size < RTL_RX_DESC_SIZE + sizeof(struct ieee80211_hdr)) {
- RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG,
- "Too short packet from bulk IN! (len: %d)\n",
- size);
+ pr_err("Too short packet from bulk IN! (len: %d)\n",
+ size);
goto resubmit;
}

qlen = skb_queue_len(&rtlusb->rx_queue);
if (qlen >= __RX_SKB_MAX_QUEUED) {
- RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG,
- "Pending RX skbuff queue full! (qlen: %d)\n",
- qlen);
+ pr_err("Pending RX skbuff queue full! (qlen: %d)\n",
+ qlen);
goto resubmit;
}

@@ -647,8 +641,7 @@ static void _rtl_rx_completed(struct urb *_urb)

skb = dev_alloc_skb(size + __RADIO_TAP_SIZE_RSV + padding);
if (!skb) {
- RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG,
- "Can't allocate skb for bulk IN!\n");
+ pr_err("Can't allocate skb for bulk IN!\n");
goto resubmit;
}

@@ -725,7 +718,6 @@ static int _rtl_usb_receive(struct ieee80211_hw *hw)
struct urb *urb;
int err;
int i;
- struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_usb *rtlusb = rtl_usbdev(rtl_usbpriv(hw));

WARN_ON(0 == rtlusb->rx_urb_num);
@@ -740,8 +732,7 @@ static int _rtl_usb_receive(struct ieee80211_hw *hw)

err = _rtl_prep_rx_urb(hw, rtlusb, urb, GFP_KERNEL);
if (err < 0) {
- RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG,
- "Failed to prep_rx_urb!!\n");
+ pr_err("Failed to prep_rx_urb!!\n");
usb_free_urb(urb);
goto err_out;
}
@@ -839,7 +830,6 @@ static void rtl_usb_stop(struct ieee80211_hw *hw)
static void _rtl_submit_tx_urb(struct ieee80211_hw *hw, struct urb *_urb)
{
int err;
- struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_usb *rtlusb = rtl_usbdev(rtl_usbpriv(hw));

usb_anchor_urb(_urb, &rtlusb->tx_submitted);
@@ -847,8 +837,7 @@ static void _rtl_submit_tx_urb(struct ieee80211_hw *hw, struct urb *_urb)
if (err < 0) {
struct sk_buff *skb;

- RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG,
- "Failed to submit urb\n");
+ pr_err("Failed to submit urb\n");
usb_unanchor_urb(_urb);
skb = (struct sk_buff *)_urb->context;
kfree_skb(skb);
@@ -859,7 +848,6 @@ static void _rtl_submit_tx_urb(struct ieee80211_hw *hw, struct urb *_urb)
static int _usb_tx_post(struct ieee80211_hw *hw, struct urb *urb,
struct sk_buff *skb)
{
- struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_usb *rtlusb = rtl_usbdev(rtl_usbpriv(hw));
struct ieee80211_tx_info *txinfo;

@@ -870,8 +858,7 @@ static int _usb_tx_post(struct ieee80211_hw *hw, struct urb *urb,
txinfo->flags |= IEEE80211_TX_STAT_ACK;

if (urb->status) {
- RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG,
- "Urb has error status 0x%X\n", urb->status);
+ pr_err("Urb has error status 0x%X\n", urb->status);
goto out;
}
/* TODO: statistics */
@@ -919,7 +906,6 @@ static struct urb *_rtl_usb_tx_urb_setup(struct ieee80211_hw *hw,
static void _rtl_usb_transmit(struct ieee80211_hw *hw, struct sk_buff *skb,
enum rtl_txq qnum)
{
- struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_usb *rtlusb = rtl_usbdev(rtl_usbpriv(hw));
u32 ep_num;
struct urb *_urb = NULL;
@@ -927,8 +913,7 @@ static void _rtl_usb_transmit(struct ieee80211_hw *hw, struct sk_buff *skb,

WARN_ON(NULL == rtlusb->usb_tx_aggregate_hdl);
if (unlikely(IS_USB_STOP(rtlusb))) {
- RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG,
- "USB device is stopping...\n");
+ pr_err("USB device is stopping...\n");
kfree_skb(skb);
return;
}
@@ -936,8 +921,7 @@ static void _rtl_usb_transmit(struct ieee80211_hw *hw, struct sk_buff *skb,
_skb = skb;
_urb = _rtl_usb_tx_urb_setup(hw, _skb, ep_num);
if (unlikely(!_urb)) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Can't allocate urb. Drop skb!\n");
+ pr_err("Can't allocate urb. Drop skb!\n");
kfree_skb(skb);
return;
}
@@ -1102,20 +1086,18 @@ int rtl_usb_probe(struct usb_interface *intf,
/* Init mac80211 sw */
err = rtl_init_core(hw);
if (err) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Can't allocate sw for mac80211\n");
+ pr_err("Can't allocate sw for mac80211\n");
goto error_out;
}
if (rtlpriv->cfg->ops->init_sw_vars(hw)) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Can't init_sw_vars\n");
+ pr_err("Can't init_sw_vars\n");
goto error_out;
}
rtlpriv->cfg->ops->init_sw_leds(hw);

err = ieee80211_register_hw(hw);
if (err) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Can't register mac80211 hw.\n");
+ pr_err("Can't register mac80211 hw.\n");
err = -ENODEV;
goto error_out;
}
--
2.10.2

2016-12-15 18:24:02

by Larry Finger

[permalink] [raw]
Subject: [PATCH 03/14 V2] rtlwifi: rtl8821ae: Remove all instances of DBG_EMERG

This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger <[email protected]>
Cc: Ping-Ke Shih <[email protected]>
---
V2 - eliminate some files that should not have been sent, and remove the
module name from the format. It is already specified by a pr_fmt().
---
.../net/wireless/realtek/rtlwifi/rtl8821ae/dm.c | 3 +-
.../net/wireless/realtek/rtlwifi/rtl8821ae/fw.c | 11 ++----
.../net/wireless/realtek/rtlwifi/rtl8821ae/hw.c | 15 +++-----
.../net/wireless/realtek/rtlwifi/rtl8821ae/phy.c | 43 ++++++++--------------
.../net/wireless/realtek/rtlwifi/rtl8821ae/rf.c | 5 +--
.../net/wireless/realtek/rtlwifi/rtl8821ae/sw.c | 14 +++----
6 files changed, 33 insertions(+), 58 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c
index bdfd444..32900c5 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c
@@ -604,8 +604,7 @@ static void rtl8821ae_dm_find_minimum_rssi(struct ieee80211_hw *hw)
if ((mac->link_state < MAC80211_LINKED) &&
(rtlpriv->dm.entry_min_undec_sm_pwdb == 0)) {
rtl_dm_dig->min_undec_pwdb_for_dm = 0;
- RT_TRACE(rtlpriv, COMP_BB_POWERSAVING, DBG_LOUD,
- "Not connected to any\n");
+ pr_debug("rtl8821ae: Not connected to any AP\n");
}
if (mac->link_state >= MAC80211_LINKED) {
if (mac->opmode == NL80211_IFTYPE_AP ||
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c
index c70face..602ac86 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c
@@ -125,8 +125,7 @@ static void _rtl8821ae_write_fw(struct ieee80211_hw *hw,
remainsize = size % FW_8821AE_PAGE_SIZE;

if (pagenums > 8) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Page numbers should not greater then 8\n");
+ pr_err("Page numbers should not greater then 8\n");
}

for (page = 0; page < pagenums; page++) {
@@ -162,8 +161,8 @@ static int _rtl8821ae_fw_free_to_go(struct ieee80211_hw *hw)
goto exit;
}

- RT_TRACE(rtlpriv, COMP_FW, DBG_EMERG,
- "Checksum report OK ! REG_MCUFWDL:0x%08x .\n", value32);
+ pr_err("Checksum report OK! REG_MCUFWDL:0x%08x\n",
+ value32);

value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL);
value32 |= MCUFWDL_RDY;
@@ -186,9 +184,8 @@ static int _rtl8821ae_fw_free_to_go(struct ieee80211_hw *hw)
udelay(FW_8821AE_POLLING_DELAY);
} while (counter++ < FW_8821AE_POLLING_TIMEOUT_COUNT);

- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Polling FW ready fail!! REG_MCUFWDL:0x%08x .\n",
- value32);
+ pr_err("Polling FW ready fail!! REG_MCUFWDL:0x%08x .\n",
+ value32);

exit:
return err;
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c
index b6dc2f3..3932a5d 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c
@@ -822,9 +822,8 @@ static bool _rtl8821ae_llt_write(struct ieee80211_hw *hw, u32 address, u32 data)
break;

if (count > POLLING_LLT_THRESHOLD) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Failed to polling write LLT done at address %d!\n",
- address);
+ pr_err("Failed to polling write LLT done at address %d!\n",
+ address);
status = false;
break;
}
@@ -1927,7 +1926,7 @@ int rtl8821ae_hw_init(struct ieee80211_hw *hw)

rtstatus = _rtl8821ae_init_mac(hw);
if (rtstatus != true) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Init MAC failed\n");
+ pr_err("Init MAC failed\n");
err = 1;
return err;
}
@@ -2174,8 +2173,7 @@ static int _rtl8821ae_set_media_status(struct ieee80211_hw *hw,
"Set Network type to AP!\n");
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Network type %d not support!\n", type);
+ pr_err("Network type %d not support!\n", type);
return 1;
}

@@ -3274,7 +3272,7 @@ void rtl8821ae_read_eeprom_info(struct ieee80211_hw *hw)
rtlefuse->autoload_failflag = false;
_rtl8821ae_read_adapter_info(hw, false);
} else {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Autoload ERR!!\n");
+ pr_err("Autoload ERR!!\n");
}
/*hal_ReadRFType_8812A()*/
/* _rtl8821ae_hal_customized_behavior(hw); */
@@ -3949,8 +3947,7 @@ void rtl8821ae_set_key(struct ieee80211_hw *hw, u32 key_index,
if (mac->opmode == NL80211_IFTYPE_AP) {
entry_id = rtl_cam_get_free_entry(hw, p_macaddr);
if (entry_id >= TOTAL_CAM_ENTRY) {
- RT_TRACE(rtlpriv, COMP_SEC, DBG_EMERG,
- "Can not find free hwsecurity cam entry\n");
+ pr_err("an not find free hwsecurity cam entry\n");
return;
}
} else {
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
index bd1a546..42c2802 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
@@ -215,7 +215,6 @@ void rtl8821ae_phy_set_rf_reg(struct ieee80211_hw *hw,
static u32 _rtl8821ae_phy_rf_serial_read(struct ieee80211_hw *hw,
enum radio_path rfpath, u32 offset)
{
- struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
bool is_pi_mode = false;
u32 retvalue = 0;
@@ -223,7 +222,7 @@ static u32 _rtl8821ae_phy_rf_serial_read(struct ieee80211_hw *hw,
/* 2009/06/17 MH We can not execute IO for power
save or other accident mode.*/
if (RT_CANNOT_IO(hw)) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "return all one\n");
+ pr_err("return all one\n");
return 0xFFFFFFFF;
}
/* <20120809, Kordan> CCA OFF(when entering),
@@ -284,7 +283,7 @@ static void _rtl8821ae_phy_rf_serial_write(struct ieee80211_hw *hw,
u32 newoffset;

if (RT_CANNOT_IO(hw)) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "stop\n");
+ pr_err("stop\n");
return;
}
offset &= 0xff;
@@ -1665,7 +1664,7 @@ static bool _rtl8821ae_phy_bb8821a_config_parafile(struct ieee80211_hw *hw)
rtstatus = _rtl8821ae_phy_config_bb_with_headerfile(hw,
BASEBAND_CONFIG_PHY_REG);
if (rtstatus != true) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Write BB Reg Fail!!\n");
+ pr_err("Write BB Reg Fail!!\n");
return false;
}
_rtl8821ae_phy_init_tx_power_by_rate(hw);
@@ -1674,7 +1673,7 @@ static bool _rtl8821ae_phy_bb8821a_config_parafile(struct ieee80211_hw *hw)
BASEBAND_CONFIG_PHY_REG);
}
if (rtstatus != true) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "BB_PG Reg Fail!!\n");
+ pr_err("BB_PG Reg Fail!!\n");
return false;
}

@@ -1688,7 +1687,7 @@ static bool _rtl8821ae_phy_bb8821a_config_parafile(struct ieee80211_hw *hw)
BASEBAND_CONFIG_AGC_TAB);

if (rtstatus != true) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "AGC Table Fail\n");
+ pr_err("AGC Table Fail\n");
return false;
}
rtlphy->cck_high_power = (bool)(rtl_get_bbreg(hw,
@@ -2064,8 +2063,7 @@ bool rtl8812ae_phy_config_rf_with_headerfile(struct ieee80211_hw *hw,
break;
case RF90_PATH_C:
case RF90_PATH_D:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", rfpath);
+ pr_err("switch case %#x not processed\n", rfpath);
break;
}
return true;
@@ -2132,8 +2130,7 @@ bool rtl8821ae_phy_config_rf_with_headerfile(struct ieee80211_hw *hw,
case RF90_PATH_B:
case RF90_PATH_C:
case RF90_PATH_D:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", rfpath);
+ pr_err("switch case %#x not processed\n", rfpath);
break;
}
return true;
@@ -3336,8 +3333,7 @@ void rtl8821ae_phy_scan_operation_backup(struct ieee80211_hw *hw, u8 operation)
(u8 *)&iotype);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Unknown Scan Backup operation.\n");
+ pr_err("Unknown Scan Backup operation.\n");
break;
}
}
@@ -3378,8 +3374,7 @@ static u8 _rtl8821ae_phy_get_secondary_chnl(struct rtl_priv *rtlpriv)
else if (mac->cur_80_prime_sc == PRIME_CHNL_OFFSET_UPPER)
sc_set_40 = VHT_DATA_SC_40_UPPER_OF_80MHZ;
else
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "SCMapping: Not Correct Primary40MHz Setting\n");
+ pr_err("SCMapping: Not Correct Primary40MHz Setting\n");

if ((mac->cur_40_prime_sc == PRIME_CHNL_OFFSET_LOWER) &&
(mac->cur_80_prime_sc == HAL_PRIME_CHNL_OFFSET_LOWER))
@@ -3394,16 +3389,14 @@ static u8 _rtl8821ae_phy_get_secondary_chnl(struct rtl_priv *rtlpriv)
(mac->cur_80_prime_sc == HAL_PRIME_CHNL_OFFSET_UPPER))
sc_set_20 = VHT_DATA_SC_20_UPPERST_OF_80MHZ;
else
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "SCMapping: Not Correct Primary40MHz Setting\n");
+ pr_err("SCMapping: Not Correct Primary40MHz Setting\n");
} else if (rtlphy->current_chan_bw == HT_CHANNEL_WIDTH_20_40) {
if (mac->cur_40_prime_sc == PRIME_CHNL_OFFSET_UPPER)
sc_set_20 = VHT_DATA_SC_20_UPPER_OF_80MHZ;
else if (mac->cur_40_prime_sc == PRIME_CHNL_OFFSET_LOWER)
sc_set_20 = VHT_DATA_SC_20_LOWER_OF_80MHZ;
else
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "SCMapping: Not Correct Primary40MHz Setting\n");
+ pr_err("SCMapping: Not Correct Primary40MHz Setting\n");
}
return (sc_set_40 << 4) | sc_set_20;
}
@@ -3479,8 +3472,8 @@ void rtl8821ae_phy_set_bw_mode_callback(struct ieee80211_hw *hw)

break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "unknown bandwidth: %#X\n", rtlphy->current_chan_bw);
+ pr_err("unknown bandwidth: %#X\n",
+ rtlphy->current_chan_bw);
break;
}

@@ -4660,8 +4652,8 @@ bool rtl8821ae_phy_set_io_cmd(struct ieee80211_hw *hw, enum io_type iotype)
postprocessing = true;
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", iotype);
+ pr_err("switch case %#x not processed\n",
+ iotype);
break;
}
} while (false);
@@ -4704,9 +4695,8 @@ static void rtl8821ae_phy_set_io(struct ieee80211_hw *hw)
case IO_CMD_PAUSE_BAND1_DM_BY_SCAN:
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n",
- rtlphy->current_io_type);
+ pr_err("switch case %#x not processed\n",
+ rtlphy->current_io_type);
break;
}
rtlphy->set_io_inprogress = false;
@@ -4811,8 +4801,8 @@ static bool _rtl8821ae_phy_set_rf_power_state(struct ieee80211_hw *hw,
}
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", rfpwr_state);
+ pr_err("switch case %#x not processed\n",
+ rfpwr_state);
bresult = false;
break;
}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/rf.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/rf.c
index c6ab957..95489f4 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/rf.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/rf.c
@@ -34,8 +34,6 @@ static bool _rtl8821ae_phy_rf6052_config_parafile(struct ieee80211_hw *hw);

void rtl8821ae_phy_rf6052_set_bandwidth(struct ieee80211_hw *hw, u8 bandwidth)
{
- struct rtl_priv *rtlpriv = rtl_priv(hw);
-
switch (bandwidth) {
case HT_CHANNEL_WIDTH_20:
rtl_set_rfreg(hw, RF90_PATH_A, RF_CHNLBW, BIT(11)|BIT(10), 3);
@@ -50,8 +48,7 @@ void rtl8821ae_phy_rf6052_set_bandwidth(struct ieee80211_hw *hw, u8 bandwidth)
rtl_set_rfreg(hw, RF90_PATH_B, RF_CHNLBW, BIT(11)|BIT(10), 0);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "unknown bandwidth: %#X\n", bandwidth);
+ pr_err("unknown bandwidth: %#X\n", bandwidth);
break;
}
}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/sw.c
index 297938e..8ec7ab2 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/sw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/sw.c
@@ -192,14 +192,12 @@ int rtl8821ae_init_sw_vars(struct ieee80211_hw *hw)
/* for firmware buf */
rtlpriv->rtlhal.pfirmware = vzalloc(0x8000);
if (!rtlpriv->rtlhal.pfirmware) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Can't alloc buffer for fw.\n");
+ pr_err("Can't alloc buffer for fw.\n");
return 1;
}
rtlpriv->rtlhal.wowlan_firmware = vzalloc(0x8000);
if (!rtlpriv->rtlhal.wowlan_firmware) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Can't alloc buffer for wowlan fw.\n");
+ pr_err("Can't alloc buffer for wowlan fw.\n");
return 1;
}

@@ -218,8 +216,7 @@ int rtl8821ae_init_sw_vars(struct ieee80211_hw *hw)
rtlpriv->io.dev, GFP_KERNEL, hw,
rtl_fw_cb);
if (err) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Failed to request normal firmware!\n");
+ pr_err("Failed to request normal firmware!\n");
return 1;
}
/*load wowlan firmware*/
@@ -229,8 +226,7 @@ int rtl8821ae_init_sw_vars(struct ieee80211_hw *hw)
rtlpriv->io.dev, GFP_KERNEL, hw,
rtl_wowlan_fw_cb);
if (err) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Failed to request wowlan firmware!\n");
+ pr_err("Failed to request wowlan firmware!\n");
return 1;
}
return 0;
@@ -313,7 +309,7 @@ static struct rtl_mod_params rtl8821ae_mod_params = {
.fwctrl_lps = true,
.msi_support = true,
.int_clear = true,
- .debug = DBG_EMERG,
+ .debug = 0,
.disable_watchdog = 0,
};

--
2.10.2

2016-12-15 18:24:02

by Larry Finger

[permalink] [raw]
Subject: [PATCH 05/14 V2] rtlwifi: rtl8723ae: Remove all instances of DBG_EMERG

This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger <[email protected]>
Cc: Ping-Ke Shih <[email protected]>
---
V2 - eliminate some files that should not have been sent.
---
drivers/net/wireless/realtek/rtlwifi/rtl8723ae/fw.c | 9 +++------
drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c | 19 +++++++------------
drivers/net/wireless/realtek/rtlwifi/rtl8723ae/led.c | 6 ++----
drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c | 18 +++++++-----------
drivers/net/wireless/realtek/rtlwifi/rtl8723ae/rf.c | 3 +--
drivers/net/wireless/realtek/rtlwifi/rtl8723ae/sw.c | 8 +++-----
6 files changed, 23 insertions(+), 40 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/fw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/fw.c
index 2f398da..9136fb3 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/fw.c
@@ -99,8 +99,7 @@ static void _rtl8723e_fill_h2c_command(struct ieee80211_hw *hw, u8 element_id,
while (!bwrite_sucess) {
wait_writeh2c_limmit--;
if (wait_writeh2c_limmit == 0) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Write H2C fail because no trigger for FW INT!\n");
+ pr_err("Write H2C fail because no trigger for FW INT!\n");
break;
}

@@ -123,8 +122,8 @@ static void _rtl8723e_fill_h2c_command(struct ieee80211_hw *hw, u8 element_id,
box_extreg = REG_HMEBOX_EXT_3;
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", boxnum);
+ pr_err("switch case %#x not processed\n",
+ boxnum);
break;
}

@@ -229,8 +227,8 @@ static void _rtl8723e_fill_h2c_command(struct ieee80211_hw *hw, u8 element_id,
}
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", cmd_len);
+ pr_err("switch case %#x not processed\n",
+ cmd_len);
break;
}

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c
index 6c51483..dff9ebb 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c
@@ -570,9 +570,8 @@ static bool _rtl8723e_llt_write(struct ieee80211_hw *hw, u32 address, u32 data)
break;

if (count > POLLING_LLT_THRESHOLD) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Failed to polling write LLT done at address %d!\n",
- address);
+ pr_err("Failed to polling write LLT done at address %d!\n",
+ address);
status = false;
break;
}
@@ -961,7 +960,7 @@ int rtl8723e_hw_init(struct ieee80211_hw *hw)
rtlpriv->intf_ops->disable_aspm(hw);
rtstatus = _rtl8712e_init_mac(hw);
if (rtstatus != true) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Init MAC failed\n");
+ pr_err("Init MAC failed\n");
err = 1;
goto exit;
}
@@ -1107,8 +1106,7 @@ static enum version_8723e _rtl8723e_read_chip_version(struct ieee80211_hw *hw)
"Chip Version ID: VERSION_NORMAL_UMC_CHIP_8723_1T1R_B_CUT.\n");
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Chip Version ID: Unknown. Bug?\n");
+ pr_err("Chip Version ID: Unknown. Bug?\n");
break;
}

@@ -1157,8 +1155,7 @@ static int _rtl8723e_set_media_status(struct ieee80211_hw *hw,
"Set Network type to AP!\n");
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Network type %d not support!\n", type);
+ pr_err("Network type %d not support!\n", type);
return 1;
break;
}
@@ -1852,7 +1849,7 @@ void rtl8723e_read_eeprom_info(struct ieee80211_hw *hw)
} else {
rtlefuse->autoload_failflag = true;
_rtl8723e_read_adapter_info(hw, false);
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Autoload ERR!!\n");
+ pr_err("Autoload ERR!!\n");
}
_rtl8723e_hal_customized_behavior(hw);
}
@@ -2245,9 +2242,7 @@ void rtl8723e_set_key(struct ieee80211_hw *hw, u32 key_index,
entry_id =
rtl_cam_get_free_entry(hw, p_macaddr);
if (entry_id >= TOTAL_CAM_ENTRY) {
- RT_TRACE(rtlpriv, COMP_SEC,
- DBG_EMERG,
- "Can not find free hw security cam entry\n");
+ pr_err("Can not find free hw security cam entry\n");
return;
}
} else {
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/led.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/led.c
index 77c1004..c2a6b2c 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/led.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/led.c
@@ -58,8 +58,8 @@ void rtl8723e_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled)
rtl_write_byte(rtlpriv, REG_LEDCFG1, ledcfg & 0x10);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", pled->ledpin);
+ pr_err("switch case %#x not processed\n",
+ pled->ledpin);
break;
}
pled->ledon = true;
@@ -100,8 +99,8 @@ void rtl8723e_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled)

break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "switch case %#x not processed\n", pled->ledpin);
+ pr_err("switch case %#x not processed\n",
+ pled->ledpin);
break;
}
pled->ledon = false;
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c
index 5dd4c74..25615e1 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c
@@ -213,7 +213,7 @@ static bool _rtl8723e_phy_bb8192c_config_parafile(struct ieee80211_hw *hw)
rtstatus = _rtl8723e_phy_config_bb_with_headerfile(hw,
BASEBAND_CONFIG_PHY_REG);
if (rtstatus != true) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Write BB Reg Fail!!\n");
+ pr_err("Write BB Reg Fail!!\n");
return false;
}

@@ -227,13 +227,13 @@ static bool _rtl8723e_phy_bb8192c_config_parafile(struct ieee80211_hw *hw)
BASEBAND_CONFIG_PHY_REG);
}
if (rtstatus != true) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "BB_PG Reg Fail!!\n");
+ pr_err("BB_PG Reg Fail!!\n");
return false;
}
rtstatus =
_rtl8723e_phy_config_bb_with_headerfile(hw, BASEBAND_CONFIG_AGC_TAB);
if (rtstatus != true) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "AGC Table Fail\n");
+ pr_err("AGC Table Fail\n");
return false;
}
rtlphy->cck_high_power = (bool) (rtl_get_bbreg(hw,
@@ -749,8 +749,7 @@ void rtl8723e_phy_scan_operation_backup(struct ieee80211_hw *hw, u8 operation)
(u8 *)&iotype);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Unknown Scan Backup operation.\n");
+ pr_err("Unknown Scan Backup operation.\n");
break;
}
}
@@ -791,8 +790,8 @@ void rtl8723e_phy_set_bw_mode_callback(struct ieee80211_hw *hw)
rtl_write_byte(rtlpriv, REG_RRSR + 2, reg_prsr_rsc);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "unknown bandwidth: %#X\n", rtlphy->current_chan_bw);
+ pr_err("unknown bandwidth: %#X\n",
+ rtlphy->current_chan_bw);
break;
}

@@ -816,8 +814,8 @@ void rtl8723e_phy_set_bw_mode_callback(struct ieee80211_hw *hw)
HAL_PRIME_CHNL_OFFSET_LOWER) ? 2 : 1);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "unknown bandwidth: %#X\n", rtlphy->current_chan_bw);
+ pr_err("unknown bandwidth: %#X\n",
+ rtlphy->current_chan_bw);
break;
}
rtl8723e_phy_rf6052_set_bandwidth(hw, rtlphy->current_chan_bw);
@@ -977,8 +974,8 @@ static bool _rtl8723e_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,
currentcmd = &postcommoncmd[*step];
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Invalid 'stage' = %d, Check it!\n", *stage);
+ pr_err("Invalid 'stage' = %d, Check it!\n",
+ *stage);
return true;
}

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/rf.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/rf.c
index 4227717..89958b6 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/rf.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/rf.c
@@ -51,8 +51,7 @@ void rtl8723e_phy_rf6052_set_bandwidth(struct ieee80211_hw *hw, u8 bandwidth)
rtlphy->rfreg_chnlval[0]);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "unknown bandwidth: %#X\n", bandwidth);
+ pr_err("unknown bandwidth: %#X\n", bandwidth);
break;
}
}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/sw.c
index c51a9e8..401f542 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/sw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/sw.c
@@ -172,8 +172,7 @@ int rtl8723e_init_sw_vars(struct ieee80211_hw *hw)
/* for firmware buf */
rtlpriv->rtlhal.pfirmware = vzalloc(0x6000);
if (!rtlpriv->rtlhal.pfirmware) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Can't alloc buffer for fw.\n");
+ pr_err("Can't alloc buffer for fw.\n");
return 1;
}

@@ -186,8 +185,7 @@ int rtl8723e_init_sw_vars(struct ieee80211_hw *hw)
rtlpriv->io.dev, GFP_KERNEL, hw,
rtl_fw_cb);
if (err) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Failed to request firmware!\n");
+ pr_err("Failed to request firmware!\n");
return 1;
}
return 0;
@@ -270,7 +268,7 @@ static struct rtl_mod_params rtl8723e_mod_params = {
.inactiveps = true,
.swctrl_lps = false,
.fwctrl_lps = true,
- .debug = DBG_EMERG,
+ .debug = 0,
.msi_support = false,
.disable_watchdog = false,
};
--
2.10.2

2016-12-15 18:24:03

by Larry Finger

[permalink] [raw]
Subject: [PATCH 06/14 V2] rtlwifi: rtl8192ee: Remove all instances of DBG_EMERG

This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger <[email protected]>
Cc: Ping-Ke Shih <[email protected]>
---
V2 - eliminate some files that should not have been sent, and remove the
module name from the format. It is already specified by a pr_fmt().
---
.../net/wireless/realtek/rtlwifi/rtl8192ee/fw.c | 21 ++++++++-------------
.../net/wireless/realtek/rtlwifi/rtl8192ee/hw.c | 11 ++++-------
.../net/wireless/realtek/rtlwifi/rtl8192ee/phy.c | 22 +++++++++-------------
.../net/wireless/realtek/rtlwifi/rtl8192ee/rf.c | 3 +--
.../net/wireless/realtek/rtlwifi/rtl8192ee/sw.c | 8 +++-----
5 files changed, 25 insertions(+), 40 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c
index c2dc26d..27f9608 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c
@@ -122,10 +122,8 @@ static void _rtl92ee_write_fw(struct ieee80211_hw *hw,
pagenums = size / FW_8192C_PAGE_SIZE;
remainsize = size % FW_8192C_PAGE_SIZE;

- if (pagenums > 8) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Page numbers should not greater then 8\n");
- }
+ if (pagenums > 8)
+ pr_err("Page numbers should not greater then 8\n");

for (page = 0; page < pagenums; page++) {
offset = page * FW_8192C_PAGE_SIZE;
@@ -155,14 +153,13 @@ static int _rtl92ee_fw_free_to_go(struct ieee80211_hw *hw)
(!(value32 & FWDL_CHKSUM_RPT)));

if (counter >= FW_8192C_POLLING_TIMEOUT_COUNT) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "chksum report faill ! REG_MCUFWDL:0x%08x .\n",
- value32);
+ pr_err("chksum report fail! REG_MCUFWDL:0x%08x\n",
+ value32);
goto exit;
}

RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
- "Checksum report OK ! REG_MCUFWDL:0x%08x .\n", value32);
+ "Checksum report OK! REG_MCUFWDL:0x%08x\n", value32);

value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL);
value32 |= MCUFWDL_RDY;
@@ -186,9 +183,8 @@ static int _rtl92ee_fw_free_to_go(struct ieee80211_hw *hw)

} while (counter++ < FW_8192C_POLLING_TIMEOUT_COUNT);

- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Polling FW ready fail!! REG_MCUFWDL:0x%08x. count = %d\n",
- value32, counter);
+ pr_err("Polling FW ready fail!! REG_MCUFWDL:0x%08x. count = %d\n",
+ value32, counter);

exit:
return err;
@@ -241,8 +237,7 @@ int rtl92ee_download_fw(struct ieee80211_hw *hw, bool buse_wake_on_wlan_fw)

err = _rtl92ee_fw_free_to_go(hw);
if (err) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Firmware is not ready to run!\n");
+ pr_err("Firmware is not ready to run!\n");
} else {
RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD ,
"Firmware is ready to run!\n");
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/hw.c
index bd416b8..c2a7666 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/hw.c
@@ -1320,7 +1320,7 @@ int rtl92ee_hw_init(struct ieee80211_hw *hw)
rtl_write_byte(rtlpriv, 0x65, 1);
}
if (!rtstatus) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Init MAC failed\n");
+ pr_err("Init MAC failed\n");
err = 1;
return err;
}
@@ -1485,8 +1485,7 @@ static int _rtl92ee_set_media_status(struct ieee80211_hw *hw,
"Set Network type to AP!\n");
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Network type %d not support!\n", type);
+ pr_err("Network type %d not support!\n", type);
return 1;
}

@@ -2206,7 +2205,7 @@ void rtl92ee_read_eeprom_info(struct ieee80211_hw *hw)
rtlefuse->autoload_failflag = false;
_rtl92ee_read_adapter_info(hw);
} else {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Autoload ERR!!\n");
+ pr_err("Autoload ERR!!\n");
}
_rtl92ee_hal_customized_behavior(hw);

@@ -2484,9 +2483,7 @@ void rtl92ee_set_key(struct ieee80211_hw *hw, u32 key_index,
entry_id = rtl_cam_get_free_entry(hw,
p_macaddr);
if (entry_id >= TOTAL_CAM_ENTRY) {
- RT_TRACE(rtlpriv, COMP_SEC,
- DBG_EMERG,
- "Can not find free hw security cam entry\n");
+ pr_err("Can not find free hw security cam entry\n");
return;
}
} else {
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/phy.c
index 5e476af..e95efba 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/phy.c
@@ -170,7 +170,7 @@ static u32 _rtl92ee_phy_rf_serial_read(struct ieee80211_hw *hw,
offset &= 0xff;
newoffset = offset;
if (RT_CANNOT_IO(hw)) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "return all one\n");
+ pr_err("return all one\n");
return 0xFFFFFFFF;
}
tmplong = rtl_get_bbreg(hw, RFPGA0_XA_HSSIPARAMETER2, MASKDWORD);
@@ -214,7 +214,7 @@ static void _rtl92ee_phy_rf_serial_write(struct ieee80211_hw *hw,
struct bb_reg_def *pphyreg = &rtlphy->phyreg_def[rfpath];

if (RT_CANNOT_IO(hw)) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "stop\n");
+ pr_err("stop\n");
return;
}
offset &= 0xff;
@@ -650,7 +650,7 @@ static bool _rtl92ee_phy_bb8192ee_config_parafile(struct ieee80211_hw *hw)

rtstatus = phy_config_bb_with_hdr_file(hw, BASEBAND_CONFIG_PHY_REG);
if (!rtstatus) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Write BB Reg Fail!!\n");
+ pr_err("Write BB Reg Fail!!\n");
return false;
}

@@ -662,12 +662,12 @@ static bool _rtl92ee_phy_bb8192ee_config_parafile(struct ieee80211_hw *hw)
}
_rtl92ee_phy_txpower_by_rate_configuration(hw);
if (!rtstatus) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "BB_PG Reg Fail!!\n");
+ pr_err("BB_PG Reg Fail!!\n");
return false;
}
rtstatus = phy_config_bb_with_hdr_file(hw, BASEBAND_CONFIG_AGC_TAB);
if (!rtstatus) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "AGC Table Fail\n");
+ pr_err("AGC Table Fail\n");
return false;
}
rtlphy->cck_high_power = (bool)(rtl_get_bbreg(hw,
@@ -1675,8 +1675,7 @@ void rtl92ee_phy_scan_operation_backup(struct ieee80211_hw *hw, u8 operation)
(u8 *)&iotype);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Unknown Scan Backup operation.\n");
+ pr_err("Unknown Scan Backup operation.\n");
break;
}
}
@@ -1717,8 +1716,8 @@ void rtl92ee_phy_set_bw_mode_callback(struct ieee80211_hw *hw)
rtl_write_byte(rtlpriv, REG_RRSR + 2, reg_prsr_rsc);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "unknown bandwidth: %#X\n", rtlphy->current_chan_bw);
+ pr_err("unknown bandwidth: %#X\n",
+ rtlphy->current_chan_bw);
break;
}

@@ -1742,8 +1740,8 @@ void rtl92ee_phy_set_bw_mode_callback(struct ieee80211_hw *hw)
HAL_PRIME_CHNL_OFFSET_LOWER) ? 2 : 1);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "unknown bandwidth: %#X\n", rtlphy->current_chan_bw);
+ pr_err("unknown bandwidth: %#X\n",
+ rtlphy->current_chan_bw);
break;
}
rtl92ee_phy_rf6052_set_bandwidth(hw, rtlphy->current_chan_bw);
@@ -1884,8 +1881,8 @@ static bool _rtl92ee_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,
currentcmd = &postcommoncmd[*step];
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Invalid 'stage' = %d, Check it!\n" , *stage);
+ pr_err("Invalid 'stage' = %d, Check it!\n",
+ *stage);
return true;
}

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/rf.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/rf.c
index 73716c0..bc76a91 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/rf.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/rf.c
@@ -55,8 +55,7 @@ void rtl92ee_phy_rf6052_set_bandwidth(struct ieee80211_hw *hw, u8 bandwidth)
rtlphy->rfreg_chnlval[0]);
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "unknown bandwidth: %#X\n", bandwidth);
+ pr_err("unknown bandwidth: %#X\n", bandwidth);
break;
}
}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/sw.c
index 46b605de3..eddc704 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/sw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/sw.c
@@ -165,8 +165,7 @@ int rtl92ee_init_sw_vars(struct ieee80211_hw *hw)
/* for firmware buf */
rtlpriv->rtlhal.pfirmware = vzalloc(0x8000);
if (!rtlpriv->rtlhal.pfirmware) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Can't alloc buffer for fw\n");
+ pr_err("Can't alloc buffer for fw\n");
return 1;
}

@@ -179,8 +178,7 @@ int rtl92ee_init_sw_vars(struct ieee80211_hw *hw)
rtlpriv->io.dev, GFP_KERNEL, hw,
rtl_fw_cb);
if (err) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Failed to request firmware!\n");
+ pr_err("Failed to request firmware!\n");
return 1;
}

@@ -260,7 +258,7 @@ static struct rtl_mod_params rtl92ee_mod_params = {
.swctrl_lps = false,
.fwctrl_lps = true,
.msi_support = true,
- .debug = DBG_EMERG,
+ .debug = 0,
};

static const struct rtl_hal_cfg rtl92ee_hal_cfg = {
--
2.10.2

2016-12-15 18:24:03

by Larry Finger

[permalink] [raw]
Subject: [PATCH 12/14 V2] rtlwifi: rtl8192c-common: Remove all instances of DBG_EMERG

This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger <[email protected]>
Cc: Ping-Ke Shih <[email protected]>
---
V2 - eliminate some files that should not have been sent.
---
.../wireless/realtek/rtlwifi/rtl8192c/fw_common.c | 33 ++++++----------------
.../wireless/realtek/rtlwifi/rtl8192c/phy_common.c | 13 ++++-----
2 files changed, 15 insertions(+), 31 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c
index 4a49e66..e739e56 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c
@@ -145,10 +145,8 @@ static void _rtl92c_write_fw(struct ieee80211_hw *hw,
pageNums = size / FW_8192C_PAGE_SIZE;
remainsize = size % FW_8192C_PAGE_SIZE;

- if (pageNums > 4) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Page numbers should not greater then 4\n");
- }
+ if (pageNums > 4)
+ pr_err("Page numbers should not greater then 4\n");

for (page = 0; page < pageNums; page++) {
offset = page * FW_8192C_PAGE_SIZE;
@@ -180,15 +178,10 @@ static int _rtl92c_fw_free_to_go(struct ieee80211_hw *hw)
(!(value32 & FWDL_ChkSum_rpt)));

if (counter >= FW_8192C_POLLING_TIMEOUT_COUNT) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "chksum report faill ! REG_MCUFWDL:0x%08x .\n",
- value32);
+ pr_err("chksum report fail! REG_MCUFWDL:0x%08x .\n",
+ value32);
goto exit;
}
-
- RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
- "Checksum report OK ! REG_MCUFWDL:0x%08x .\n", value32);
-
value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL);
value32 |= MCUFWDL_RDY;
value32 &= ~WINTINI_RDY;
@@ -198,20 +191,15 @@ static int _rtl92c_fw_free_to_go(struct ieee80211_hw *hw)

do {
value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL);
- if (value32 & WINTINI_RDY) {
- RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
- "Polling FW ready success!! REG_MCUFWDL:0x%08x .\n",
- value32);
- err = 0;
- goto exit;
- }
+ if (value32 & WINTINI_RDY)
+ return 0;

mdelay(FW_8192C_POLLING_DELAY);

} while (counter++ < FW_8192C_POLLING_TIMEOUT_COUNT);

- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Polling FW ready fail!! REG_MCUFWDL:0x%08x .\n", value32);
+ pr_err("Polling FW ready fail! REG_MCUFWDL:0x%08x.\n",
+ value32);

exit:
return err;
@@ -251,8 +238,7 @@ int rtl92c_download_fw(struct ieee80211_hw *hw)

err = _rtl92c_fw_free_to_go(hw);
if (err) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Firmware is not ready to run!\n");
+ pr_err("Firmware is not ready to run!\n");
} else {
RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
"Firmware is ready to run!\n");
@@ -327,8 +313,7 @@ static void _rtl92c_fill_h2c_command(struct ieee80211_hw *hw,
while (!bwrite_sucess) {
wait_writeh2c_limmit--;
if (wait_writeh2c_limmit == 0) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Write H2C fail because no trigger for FW INT!\n");
+ pr_err("Write H2C fail because no trigger for FW INT!\n");
break;
}

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/phy_common.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/phy_common.c
index 30c2d12..5f8fa4a 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/phy_common.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/phy_common.c
@@ -104,7 +104,7 @@ u32 _rtl92c_phy_rf_serial_read(struct ieee80211_hw *hw,
offset &= 0x3f;
newoffset = offset;
if (RT_CANNOT_IO(hw)) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "return all one\n");
+ pr_err("return all one\n");
return 0xFFFFFFFF;
}
tmplong = rtl_get_bbreg(hw, RFPGA0_XA_HSSIPARAMETER2, MASKDWORD);
@@ -152,7 +152,7 @@ void _rtl92c_phy_rf_serial_write(struct ieee80211_hw *hw,
struct bb_reg_def *pphyreg = &rtlphy->phyreg_def[rfpath];

if (RT_CANNOT_IO(hw)) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "stop\n");
+ pr_err("stop\n");
return;
}
offset &= 0x3f;
@@ -209,7 +209,7 @@ bool _rtl92c_phy_bb8192c_config_parafile(struct ieee80211_hw *hw)
rtstatus = rtlpriv->cfg->ops->config_bb_with_headerfile(hw,
BASEBAND_CONFIG_PHY_REG);
if (!rtstatus) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Write BB Reg Fail!!\n");
+ pr_err("Write BB Reg Fail!!\n");
return false;
}
if (rtlphy->rf_type == RF_1T2R) {
@@ -222,13 +222,13 @@ bool _rtl92c_phy_bb8192c_config_parafile(struct ieee80211_hw *hw)
BASEBAND_CONFIG_PHY_REG);
}
if (!rtstatus) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "BB_PG Reg Fail!!\n");
+ pr_err("BB_PG Reg Fail!!\n");
return false;
}
rtstatus = rtlpriv->cfg->ops->config_bb_with_headerfile(hw,
BASEBAND_CONFIG_AGC_TAB);
if (!rtstatus) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "AGC Table Fail\n");
+ pr_err("AGC Table Fail\n");
return false;
}
rtlphy->cck_high_power =
@@ -860,8 +860,8 @@ bool _rtl92c_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,
currentcmd = &postcommoncmd[*step];
break;
default:
- RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
- "Invalid 'stage' = %d, Check it!\n", *stage);
+ pr_err("Invalid 'stage' = %d, Check it!\n",
+ *stage);
return true;
}

--
2.10.2

2017-01-10 09:55:34

by Vincent Stehlé

[permalink] [raw]
Subject: [PATCH next] rtlwifi: rtl8192de: fix missing curly braces

Restore some curly braces that have been removed in commit c93ac39da006457f
("rtlwifi: Remove some redundant code") while removing redundant messages
and extraneous braces.

This fixes the following smatch warning:

drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c:326 rtl92d_download_fw() warn: curly braces intended?

...and the following coccinelle warning:

drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c:325:2-38: code aligned with following code on line 326

Fixes: c93ac39da006457f ("rtlwifi: Remove some redundant code")
Signed-off-by: Vincent Stehlé <[email protected]>
Cc: Larry Finger <[email protected]>
Cc: Kalle Valo <[email protected]>
Cc: Joe Perches <[email protected]>
Cc: Ping-Ke Shih <[email protected]>
---


Hi,

I saw that in Linux next-20170110.

Best regards,

Vincent.


drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c
index aa1e51c871df..bcde4da4e593 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c
@@ -321,9 +321,10 @@ int rtl92d_download_fw(struct ieee80211_hw *hw)
value &= (~BIT(5));
rtl_write_byte(rtlpriv, 0x1f, value);
spin_unlock_irqrestore(&globalmutex_for_fwdownload, flags);
- if (err)
+ if (err) {
pr_err("fw is not ready to run!\n");
goto exit;
+ }
exit:
err = _rtl92d_fw_init(hw);
return err;
--
2.11.0

2017-01-12 15:11:05

by Kalle Valo

[permalink] [raw]
Subject: Re: [next] rtlwifi: rtl8192de: fix missing curly braces

Vincent <[email protected]> wrote:
> Restore some curly braces that have been removed in commit c93ac39da006457f
> ("rtlwifi: Remove some redundant code") while removing redundant messages
> and extraneous braces.
>
> This fixes the following smatch warning:
>
> drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c:326 rtl92d_download_fw() warn: curly braces intended?
>
> ...and the following coccinelle warning:
>
> drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c:325:2-38: code aligned with following code on line 326
>
> Fixes: c93ac39da006457f ("rtlwifi: Remove some redundant code")
> Signed-off-by: Vincent Stehlé <[email protected]>
> Cc: Larry Finger <[email protected]>
> Cc: Kalle Valo <[email protected]>
> Cc: Joe Perches <[email protected]>
> Cc: Ping-Ke Shih <[email protected]>

Larry also sent a fix:

rtlwifi: rtl8192de: Remove a pointless goto
https://patchwork.kernel.org/patch/9508121/

Patch set to Superseded.

--
https://patchwork.kernel.org/patch/9506837/

Documentation about submitting wireless patches and checking status
from patchwork:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches