2021-11-29 00:22:54

by Phillip Potter

[permalink] [raw]
Subject: [PATCH 0/7] staging: r8188eu: DBG_88E_LEVEL removal

This patch series converts all in-driver calls of the DBG_88E_LEVEL
macro to use netdev_dbg/dev_dbg as appropriate, and then removes the
DBG_88E_LEVEL macro completely. This is part of the ongoing effort to
cleanup and standardise debugging code in r8188eu.

Phillip Potter (7):
staging: r8188eu: convert DBG_88E_LEVEL calls in core/rtw_mlme_ext.c
staging: r8188eu: convert DBG_88E_LEVEL calls in core/rtw_pwrctrl.c
staging: r8188eu: convert DBG_88E_LEVEL call in core/rtw_xmit.c
staging: r8188eu: convert DBG_88E_LEVEL calls in core/rtw_ioctl_set.c
staging: r8188eu: convert DBG_88E_LEVEL call in
hal/rtl8188e_hal_init.c
staging: r8188eu: convert DBG_88E_LEVEL calls in os_dep/ioctl_linux.c
staging: r8188eu: remove DBG_88E_LEVEL macro from include/rtw_debug.h

drivers/staging/r8188eu/core/rtw_ioctl_set.c | 6 +--
drivers/staging/r8188eu/core/rtw_mlme_ext.c | 46 +++++++++++--------
drivers/staging/r8188eu/core/rtw_pwrctrl.c | 13 ++++--
drivers/staging/r8188eu/core/rtw_xmit.c | 2 +-
.../staging/r8188eu/hal/rtl8188e_hal_init.c | 2 +-
drivers/staging/r8188eu/include/rtw_debug.h | 6 ---
drivers/staging/r8188eu/os_dep/ioctl_linux.c | 4 +-
7 files changed, 42 insertions(+), 37 deletions(-)

--
2.33.1



2021-11-29 00:22:56

by Phillip Potter

[permalink] [raw]
Subject: [PATCH 2/7] staging: r8188eu: convert DBG_88E_LEVEL calls in core/rtw_pwrctrl.c

Convert all DBG_88E_LEVEL macro calls in core/rtw_pwrctrl.c to plain
netdev_dbg calls, as although the information is potentially useful,
we should be exposing it using standard kernel debugging functionality.

Signed-off-by: Phillip Potter <[email protected]>
---
drivers/staging/r8188eu/core/rtw_pwrctrl.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_pwrctrl.c b/drivers/staging/r8188eu/core/rtw_pwrctrl.c
index 5d595cf2a47e..7fa4516af6ec 100644
--- a/drivers/staging/r8188eu/core/rtw_pwrctrl.c
+++ b/drivers/staging/r8188eu/core/rtw_pwrctrl.c
@@ -15,9 +15,12 @@ void ips_enter(struct adapter *padapter)

if (pxmit_priv->free_xmitbuf_cnt != NR_XMITBUFF ||
pxmit_priv->free_xmit_extbuf_cnt != NR_XMIT_EXTBUFF) {
- DBG_88E_LEVEL(_drv_info_, "There are some pkts to transmit\n");
- DBG_88E_LEVEL(_drv_info_, "free_xmitbuf_cnt: %d, free_xmit_extbuf_cnt: %d\n",
- pxmit_priv->free_xmitbuf_cnt, pxmit_priv->free_xmit_extbuf_cnt);
+ netdev_dbg(padapter->pnetdev,
+ "There are some pkts to transmit\n");
+ netdev_dbg(padapter->pnetdev,
+ "free_xmitbuf_cnt: %d, free_xmit_extbuf_cnt: %d\n",
+ pxmit_priv->free_xmitbuf_cnt,
+ pxmit_priv->free_xmit_extbuf_cnt);
return;
}

@@ -32,7 +35,7 @@ void ips_enter(struct adapter *padapter)
DBG_88E("==>ips_enter cnts:%d\n", pwrpriv->ips_enter_cnts);
if (rf_off == pwrpriv->change_rfpwrstate) {
pwrpriv->bpower_saving = true;
- DBG_88E_LEVEL(_drv_info_, "nolinked power save enter\n");
+ netdev_dbg(padapter->pnetdev, "nolinked power save enter\n");

if (pwrpriv->ips_mode == IPS_LEVEL_2)
pwrpriv->bkeepfwalive = true;
@@ -65,7 +68,7 @@ int ips_leave(struct adapter *padapter)
if (result == _SUCCESS) {
pwrpriv->rf_pwrstate = rf_on;
}
- DBG_88E_LEVEL(_drv_info_, "nolinked power save leave\n");
+ netdev_dbg(padapter->pnetdev, "nolinked power save leave\n");

if ((_WEP40_ == psecuritypriv->dot11PrivacyAlgrthm) || (_WEP104_ == psecuritypriv->dot11PrivacyAlgrthm)) {
DBG_88E("==>%s, channel(%d), processing(%x)\n", __func__, padapter->mlmeextpriv.cur_channel, pwrpriv->bips_processing);
--
2.33.1


2021-11-29 00:22:59

by Phillip Potter

[permalink] [raw]
Subject: [PATCH 3/7] staging: r8188eu: convert DBG_88E_LEVEL call in core/rtw_xmit.c

Convert single DBG_88E_LEVEL macro call in core/rtw_xmit.c to plain
netdev_dbg call, as although the information is potentially useful,
we should be exposing it using standard kernel debugging functionality.

Signed-off-by: Phillip Potter <[email protected]>
---
drivers/staging/r8188eu/core/rtw_xmit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c
index 0c033a077bf9..8503059edc46 100644
--- a/drivers/staging/r8188eu/core/rtw_xmit.c
+++ b/drivers/staging/r8188eu/core/rtw_xmit.c
@@ -461,7 +461,7 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p
}
}
} else if (0x888e == pattrib->ether_type) {
- DBG_88E_LEVEL(_drv_info_, "send eapol packet\n");
+ netdev_dbg(padapter->pnetdev, "send eapol packet\n");
}

if ((pattrib->ether_type == 0x888e) || (pattrib->dhcp_pkt == 1))
--
2.33.1


2021-11-29 00:23:01

by Phillip Potter

[permalink] [raw]
Subject: [PATCH 4/7] staging: r8188eu: convert DBG_88E_LEVEL calls in core/rtw_ioctl_set.c

Convert all DBG_88E_LEVEL macro calls in core/rtw_ioctl_set.c to plain
netdev_dbg calls, as although the information is potentially useful,
we should be exposing it using standard kernel debugging functionality.

Signed-off-by: Phillip Potter <[email protected]>
---
drivers/staging/r8188eu/core/rtw_ioctl_set.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_ioctl_set.c b/drivers/staging/r8188eu/core/rtw_ioctl_set.c
index 84c320d4a478..eadfbdb94dd5 100644
--- a/drivers/staging/r8188eu/core/rtw_ioctl_set.c
+++ b/drivers/staging/r8188eu/core/rtw_ioctl_set.c
@@ -110,7 +110,7 @@ u8 rtw_set_802_11_bssid(struct adapter *padapter, u8 *bssid)
u32 cur_time = 0;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;

- DBG_88E_LEVEL(_drv_info_, "set bssid:%pM\n", bssid);
+ netdev_dbg(padapter->pnetdev, "set bssid:%pM\n", bssid);

if ((bssid[0] == 0x00 && bssid[1] == 0x00 && bssid[2] == 0x00 &&
bssid[3] == 0x00 && bssid[4] == 0x00 && bssid[5] == 0x00) ||
@@ -185,8 +185,8 @@ u8 rtw_set_802_11_ssid(struct adapter *padapter, struct ndis_802_11_ssid *ssid)
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct wlan_network *pnetwork = &pmlmepriv->cur_network;

- DBG_88E_LEVEL(_drv_info_, "set ssid [%s] fw_state=0x%08x\n",
- ssid->Ssid, get_fwstate(pmlmepriv));
+ netdev_dbg(padapter->pnetdev, "set ssid [%s] fw_state=0x%08x\n",
+ ssid->Ssid, get_fwstate(pmlmepriv));

if (!padapter->hw_init_completed) {
status = _FAIL;
--
2.33.1


2021-11-29 00:23:03

by Phillip Potter

[permalink] [raw]
Subject: [PATCH 6/7] staging: r8188eu: convert DBG_88E_LEVEL calls in os_dep/ioctl_linux.c

Convert all DBG_88E_LEVEL macro calls in os_dep/ioctl_linux.c to plain
netdev_dbg calls, as although the information is potentially useful,
we should be exposing it using standard kernel debugging functionality.

Signed-off-by: Phillip Potter <[email protected]>
---
drivers/staging/r8188eu/os_dep/ioctl_linux.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/r8188eu/os_dep/ioctl_linux.c b/drivers/staging/r8188eu/os_dep/ioctl_linux.c
index 52d42e576443..90fcb74ef828 100644
--- a/drivers/staging/r8188eu/os_dep/ioctl_linux.c
+++ b/drivers/staging/r8188eu/os_dep/ioctl_linux.c
@@ -60,7 +60,7 @@ void rtw_indicate_wx_assoc_event(struct adapter *padapter)

memcpy(wrqu.ap_addr.sa_data, pmlmepriv->cur_network.network.MacAddress, ETH_ALEN);

- DBG_88E_LEVEL(_drv_always_, "assoc success\n");
+ netdev_dbg(padapter->pnetdev, "assoc success\n");
wireless_send_event(padapter->pnetdev, SIOCGIWAP, &wrqu, NULL);
}

@@ -73,7 +73,7 @@ void rtw_indicate_wx_disassoc_event(struct adapter *padapter)
wrqu.ap_addr.sa_family = ARPHRD_ETHER;
memset(wrqu.ap_addr.sa_data, 0, ETH_ALEN);

- DBG_88E_LEVEL(_drv_always_, "indicate disassoc\n");
+ netdev_dbg(padapter->pnetdev, "indicate disassoc\n");
wireless_send_event(padapter->pnetdev, SIOCGIWAP, &wrqu, NULL);
}

--
2.33.1


2021-11-29 00:23:05

by Phillip Potter

[permalink] [raw]
Subject: [PATCH 5/7] staging: r8188eu: convert DBG_88E_LEVEL call in hal/rtl8188e_hal_init.c

Convert DBG_88E_LEVEL macro call in hal/rtl8188e_hal_init.c to plain
dev_dbg call, as although the information is potentially useful, we should
be exposing it using standard kernel debugging functionality.

Signed-off-by: Phillip Potter <[email protected]>
---
drivers/staging/r8188eu/hal/rtl8188e_hal_init.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
index 001e4a198630..db87e91ab8c6 100644
--- a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
+++ b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
@@ -541,7 +541,7 @@ static int load_firmware(struct rt_firmware *pFirmware, struct device *device)
memcpy(pFirmware->szFwBuffer, fw->data, fw->size);
pFirmware->ulFwLength = fw->size;
release_firmware(fw);
- DBG_88E_LEVEL(_drv_info_, "+%s: !bUsedWoWLANFw, FmrmwareLen:%d+\n", __func__, pFirmware->ulFwLength);
+ dev_dbg(device, "!bUsedWoWLANFw, FmrmwareLen:%d+\n", pFirmware->ulFwLength);

Exit:
return rtStatus;
--
2.33.1


2021-11-29 00:23:06

by Phillip Potter

[permalink] [raw]
Subject: [PATCH 7/7] staging: r8188eu: remove DBG_88E_LEVEL macro from include/rtw_debug.h

Remove the DBG_88E_LEVEL macro definition from include/rtw_debug.h, as
it has no callers and is surplus to requirements. This is motivated by
ongoing efforts to remove all non-standard debugging code from the
driver.

Signed-off-by: Phillip Potter <[email protected]>
---
drivers/staging/r8188eu/include/rtw_debug.h | 6 ------
1 file changed, 6 deletions(-)

diff --git a/drivers/staging/r8188eu/include/rtw_debug.h b/drivers/staging/r8188eu/include/rtw_debug.h
index 39b69b9ad0a3..311051757715 100644
--- a/drivers/staging/r8188eu/include/rtw_debug.h
+++ b/drivers/staging/r8188eu/include/rtw_debug.h
@@ -54,12 +54,6 @@

extern u32 GlobalDebugLevel;

-#define DBG_88E_LEVEL(_level, fmt, arg...) \
- do { \
- if (_level <= GlobalDebugLevel) \
- pr_info(DRIVER_PREFIX"INFO " fmt, ##arg); \
- } while (0)
-
#define DBG_88E(...) \
do { \
if (_drv_err_ <= GlobalDebugLevel) \
--
2.33.1