2021-03-31 09:41:41

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 00/40] staging: rtl8723bs: replace RT_TRACE private macro

this patchset replace all RT_TRACE usages with public log functions
used for this pourpose

Fabio Aiuto (40):
staging: rtl8723bs: replace RT_TRACE with public printk wrappers in
core/rtw_xmit.c
staging: rtl8723bs: replace RT_TRACE with public printk wrappers in
core/rtw_security.c
staging: rtl8723bs: replace RT_TRACE with public printk wrappers in
core/rtw_eeprom.c
staging: rtl8723bs: replace RT_TRACE with public printk wrappers in
core/rtw_pwrctrl.c
staging: rtl8723bs: replace RT_TRACE with public printk wrappers in
core/rtw_cmd.c
staging: rtl8723bs: remove commented RT_TRACE calls in core/rtw_mlme.c
staging: rtl8723bs: replace RT_TRACE with public printk wrappers in
core/rtw_mlme.c
staging: rtl8723bs: replace RT_TRACE with public printk wrappers in
core/rtw_mlme_ext.c
staging: rtl8723bs: remove commented RT_TRACE calls in core/rtw_recv.c
staging: rtl8723bs: replace RT_TRACE with public printk wrappers in
core/rtw_recv.c
staging: rtl8723bs: remove commented RT_TRACE call in
core/rtw_ioctl_set.c
staging: rtl8723bs: replace RT_TRACE with public printk wrappers in
core/rtw_ioctl_set.c
staging: rtl8723bs: replace RT_TRACE with public printk wrappers in
core/rtw_wlan_util.c
staging: rtl8723bs: replace RT_TRACE with public printk wrappers in
core/rtw_sta_mgt.c
staging: rtl8723bs: replace RT_TRACE with public printk wrappers in
core/rtw_ieee80211.c
staging: rtl8723bs: replace RT_TRACE with public printk wrappers in
hal/HalPwrSeqCmd.c
staging: rtl8723bs: fix constant name in hal/rtl8723b_hal_init.c
staging: rtl8723bs: added driver prefix in log messages
staging: rtl8723bs: remove commented RT_TRACE call in
hal/rtl8723b_hal_init.c
staging: rtl8723bs: replace RT_TRACE with public printk wrappers in
hal/rtl8723b_hal_init.c
staging: rtl8723bs: replace RT_TRACE with public printk wrappers in
hal/sdio_ops.c
staging: rtl8723bs: remove commented code block in
hal/hal_com_phycfg.c
staging: rtl8723bs: replace RT_TRACE with public printk wrappers in
hal/rtl8723b_phycfg.c
staging: rtl8723bs: replace RT_TRACE with public printk wrappers in
hal/hal_intf.c
staging: rtl8723bs: replace RT_TRACE with public printk wrappers in
hal/rtl8723bs_xmit.c
staging: rtl8723bs: replace RT_TRACE with public printk wrappers in
hal/sdio_halinit.c
staging: rtl8723bs: replace RT_TRACE with public printk wrappers in
hal/rtl8723bs_recv.c
staging: rtl8723bs: remove commented RT_TRACE calls in
hal/HalPhyRf_8723B.c
staging: rtl8723bs: remove commented RT_TRACE calls in
hal/rtl8723b_rf6052.c
staging: rtl8723bs: remove commented RT_TRACE calls in
os_dep/ioctl_linux.c
staging: rtl8723bs: replace RT_TRACE with public printk wrappers in
os_dep/ioctl_linux.c
staging: rtl8723bs: replace RT_TRACE with public printk wrappers in
os_dep/mlme_linux.c
staging: rtl8723bs: fix string format in os_dep/ioctl_cfg80211.c
staging: rtl8723bs: replace RT_TRACE with public printk wrappers in
os_dep/ioctl_cfg80211.c
staging: rtl8723bs: replace RT_TRACE with public printk wrappers in
os_dep/os_intfs.c
staging: rtl8723bs: replace RT_TRACE with public printk wrappers in
os_dep/recv_linux.c
staging: rtl8723bs: replace RT_TRACE with public printk wrappers in
os_dep/sdio_intf.c
staging: rtl8723bs: replace RT_TRACE with public printk wrappers in
os_dep/xmit_linux.c
staging: rtl8723bs: replace RT_TRACE with public printk wrappers in
os_dep/osdep_service.c
staging: rtl8723bs: remove obsolete debug macro

drivers/staging/rtl8723bs/core/rtw_cmd.c | 55 ++--
drivers/staging/rtl8723bs/core/rtw_eeprom.c | 26 +-
.../staging/rtl8723bs/core/rtw_ieee80211.c | 116 +++++---
.../staging/rtl8723bs/core/rtw_ioctl_set.c | 129 +++++----
drivers/staging/rtl8723bs/core/rtw_mlme.c | 128 +++++----
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 39 +--
drivers/staging/rtl8723bs/core/rtw_pwrctrl.c | 62 ++---
drivers/staging/rtl8723bs/core/rtw_recv.c | 252 +++++++++++-------
drivers/staging/rtl8723bs/core/rtw_security.c | 38 ++-
drivers/staging/rtl8723bs/core/rtw_sta_mgt.c | 45 ++--
.../staging/rtl8723bs/core/rtw_wlan_util.c | 28 +-
drivers/staging/rtl8723bs/core/rtw_xmit.c | 168 ++++++++----
.../staging/rtl8723bs/hal/HalPhyRf_8723B.c | 3 -
drivers/staging/rtl8723bs/hal/HalPwrSeqCmd.c | 61 ++---
.../staging/rtl8723bs/hal/hal_com_phycfg.c | 20 --
drivers/staging/rtl8723bs/hal/hal_intf.c | 2 +-
.../staging/rtl8723bs/hal/rtl8723b_hal_init.c | 155 +++++------
.../staging/rtl8723bs/hal/rtl8723b_phycfg.c | 48 ++--
.../staging/rtl8723bs/hal/rtl8723b_rf6052.c | 2 -
.../staging/rtl8723bs/hal/rtl8723bs_recv.c | 5 +-
.../staging/rtl8723bs/hal/rtl8723bs_xmit.c | 42 +--
drivers/staging/rtl8723bs/hal/sdio_halinit.c | 49 ++--
drivers/staging/rtl8723bs/hal/sdio_ops.c | 42 +--
drivers/staging/rtl8723bs/include/rtw_debug.h | 17 --
.../staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 14 +-
.../staging/rtl8723bs/os_dep/ioctl_linux.c | 87 +++---
drivers/staging/rtl8723bs/os_dep/mlme_linux.c | 4 +-
drivers/staging/rtl8723bs/os_dep/os_intfs.c | 65 +++--
.../staging/rtl8723bs/os_dep/osdep_service.c | 2 +-
drivers/staging/rtl8723bs/os_dep/recv_linux.c | 22 +-
drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 19 +-
drivers/staging/rtl8723bs/os_dep/xmit_linux.c | 10 +-
32 files changed, 914 insertions(+), 841 deletions(-)

--
2.20.1


2021-03-31 09:41:46

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 01/40] staging: rtl8723bs: replace RT_TRACE with public printk wrappers in core/rtw_xmit.c

replace private macro RT_TRACE for tracing with in-kernel
pr_* printk wrappers

Signed-off-by: Fabio Aiuto <[email protected]>
---
drivers/staging/rtl8723bs/core/rtw_xmit.c | 168 +++++++++++++++-------
1 file changed, 113 insertions(+), 55 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c
index 2daf5c461a4d..6ea8d4ae90d1 100644
--- a/drivers/staging/rtl8723bs/core/rtw_xmit.c
+++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c
@@ -69,7 +69,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)

if (!pxmitpriv->pallocated_frame_buf) {
pxmitpriv->pxmit_frame_buf = NULL;
- RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("alloc xmit_frame fail!\n"));
+ pr_err("%s alloc xmit_frame fail!\n", DRIVER_PREFIX);
res = _FAIL;
goto exit;
}
@@ -105,7 +105,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
pxmitpriv->pallocated_xmitbuf = vzalloc(NR_XMITBUFF * sizeof(struct xmit_buf) + 4);

if (!pxmitpriv->pallocated_xmitbuf) {
- RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("alloc xmit_buf fail!\n"));
+ pr_err("%s alloc xmit_buf fail!\n", DRIVER_PREFIX);
res = _FAIL;
goto exit;
}
@@ -155,7 +155,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)

if (!pxmitpriv->xframe_ext_alloc_addr) {
pxmitpriv->xframe_ext = NULL;
- RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("alloc xframe_ext fail!\n"));
+ pr_err("%s alloc xframe_ext fail!\n", DRIVER_PREFIX);
res = _FAIL;
goto exit;
}
@@ -188,7 +188,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
pxmitpriv->pallocated_xmit_extbuf = vzalloc(NR_XMIT_EXTBUFF * sizeof(struct xmit_buf) + 4);

if (!pxmitpriv->pallocated_xmit_extbuf) {
- RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("alloc xmit_extbuf fail!\n"));
+ pr_err("%s alloc xmit_extbuf fail!\n", DRIVER_PREFIX);
res = _FAIL;
goto exit;
}
@@ -481,12 +481,13 @@ static s32 update_attrib_sec_info(struct adapter *padapter, struct pkt_attrib *p
pattrib->mac_id = psta->mac_id;

if (psta->ieee8021x_blocked == true) {
- RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("\n psta->ieee8021x_blocked == true\n"));
+ pr_err("%s psta->ieee8021x_blocked == true\n", DRIVER_PREFIX);

pattrib->encrypt = 0;

if ((pattrib->ether_type != 0x888e) && (check_fwstate(pmlmepriv, WIFI_MP_STATE) == false)) {
- RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("\npsta->ieee8021x_blocked == true, pattrib->ether_type(%.4x) != 0x888e\n", pattrib->ether_type));
+ pr_err("%s psta->ieee8021x_blocked == true, pattrib->ether_type(%.4x) != 0x888e\n",
+ DRIVER_PREFIX, pattrib->ether_type);
#ifdef DBG_TX_DROP_FRAME
DBG_871X("DBG_TX_DROP_FRAME %s psta->ieee8021x_blocked == true, pattrib->ether_type(%04x) != 0x888e\n", __func__, pattrib->ether_type);
#endif
@@ -568,19 +569,17 @@ static s32 update_attrib_sec_info(struct adapter *padapter, struct pkt_attrib *p
if (pattrib->encrypt > 0)
memcpy(pattrib->dot118021x_UncstKey.skey, psta->dot118021x_UncstKey.skey, 16);

- RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_,
- ("update_attrib: encrypt =%d securitypriv.sw_encrypt =%d\n",
- pattrib->encrypt, padapter->securitypriv.sw_encrypt));
+ pr_info("%s update_attrib: encrypt =%d securitypriv.sw_encrypt =%d\n", DRIVER_PREFIX,
+ pattrib->encrypt, padapter->securitypriv.sw_encrypt);

if (pattrib->encrypt &&
((padapter->securitypriv.sw_encrypt == true) || (psecuritypriv->hw_decrypted == false))) {
pattrib->bswenc = true;
- RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_,
- ("update_attrib: encrypt =%d securitypriv.hw_decrypted =%d bswenc =true\n",
- pattrib->encrypt, padapter->securitypriv.sw_encrypt));
+ pr_err("%s update_attrib: encrypt =%d securitypriv.hw_decrypted =%d bswenc =true\n",
+ DRIVER_PREFIX, pattrib->encrypt, padapter->securitypriv.sw_encrypt);
} else {
pattrib->bswenc = false;
- RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_, ("update_attrib: bswenc =false\n"));
+ pr_info("%s update_attrib: bswenc =false\n", DRIVER_PREFIX);
}

exit:
@@ -685,7 +684,8 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p
((tmp[21] == 67) && (tmp[23] == 68))) {
/* 68 : UDP BOOTP client */
/* 67 : UDP BOOTP server */
- RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("======================update_attrib: get DHCP Packet\n"));
+ pr_err("%s ======================%s: get DHCP Packet\n",
+ DRIVER_PREFIX, __func__);
pattrib->dhcp_pkt = 1;
}
}
@@ -720,7 +720,8 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p
} else {
psta = rtw_get_stainfo(pstapriv, pattrib->ra);
if (!psta) { /* if we cannot get psta => drop the pkt */
- RT_TRACE(_module_rtl871x_xmit_c_, _drv_alert_, ("\nupdate_attrib => get sta_info fail, ra:%pM\n", MAC_ARG(pattrib->ra)));
+ pr_alert("%s %s => get sta_info fail, ra:%pM\n",
+ DRIVER_PREFIX, __func__, MAC_ARG(pattrib->ra));
#ifdef DBG_TX_DROP_FRAME
DBG_871X("DBG_TX_DROP_FRAME %s get sta_info fail, ra:%pM\n", __func__, MAC_ARG(pattrib->ra));
#endif
@@ -734,7 +735,8 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p

if (!psta) {
/* if we cannot get psta => drop the pkt */
- RT_TRACE(_module_rtl871x_xmit_c_, _drv_alert_, ("\nupdate_attrib => get sta_info fail, ra:%pM\n", MAC_ARG(pattrib->ra)));
+ pr_alert("%s %s => get sta_info fail, ra:%pM\n",
+ DRIVER_PREFIX, __func__, MAC_ARG(pattrib->ra));
#ifdef DBG_TX_DROP_FRAME
DBG_871X("DBG_TX_DROP_FRAME %s get sta_info fail, ra:%pM\n", __func__, MAC_ARG(pattrib->ra));
#endif
@@ -842,11 +844,25 @@ static s32 xmitframe_addmic(struct adapter *padapter, struct xmit_frame *pxmitfr

for (curfragnum = 0; curfragnum < pattrib->nr_frags; curfragnum++) {
payload = (u8 *)round_up((SIZE_PTR)(payload), 4);
- RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("===curfragnum =%d, pframe = 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x,!!!\n",
- curfragnum, *payload, *(payload+1), *(payload+2), *(payload+3), *(payload+4), *(payload+5), *(payload+6), *(payload+7)));
+ pr_err("%s ===curfragnum =%d, pframe = 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x,!!!\n",
+ DRIVER_PREFIX,
+ curfragnum,
+ *payload,
+ *(payload+1),
+ *(payload+2),
+ *(payload+3),
+ *(payload+4),
+ *(payload+5),
+ *(payload+6),
+ *(payload+7));

payload = payload+pattrib->hdrlen+pattrib->iv_len;
- RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("curfragnum =%d pattrib->hdrlen =%d pattrib->iv_len =%d", curfragnum, pattrib->hdrlen, pattrib->iv_len));
+ pr_err("%s curfragnum =%d pattrib->hdrlen =%d pattrib->iv_len =%d",
+ DRIVER_PREFIX,
+ curfragnum,
+ pattrib->hdrlen,
+ pattrib->iv_len);
+
if ((curfragnum+1) == pattrib->nr_frags) {
length = pattrib->last_txcmdsz-pattrib->hdrlen-pattrib->iv_len-((pattrib->bswenc) ? pattrib->icv_len : 0);
rtw_secmicappend(&micdata, payload, length);
@@ -855,26 +871,53 @@ static s32 xmitframe_addmic(struct adapter *padapter, struct xmit_frame *pxmitfr
length = pxmitpriv->frag_len-pattrib->hdrlen-pattrib->iv_len-((pattrib->bswenc) ? pattrib->icv_len : 0);
rtw_secmicappend(&micdata, payload, length);
payload = payload+length+pattrib->icv_len;
- RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("curfragnum =%d length =%d pattrib->icv_len =%d", curfragnum, length, pattrib->icv_len));
+ pr_err("%s curfragnum =%d length =%d pattrib->icv_len =%d",
+ DRIVER_PREFIX,
+ curfragnum,
+ length,
+ pattrib->icv_len);
}
}
rtw_secgetmic(&micdata, &mic[0]);
- RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("xmitframe_addmic: before add mic code!!!\n"));
- RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("xmitframe_addmic: pattrib->last_txcmdsz =%d!!!\n", pattrib->last_txcmdsz));
- RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("xmitframe_addmic: mic[0]= 0x%.2x , mic[1]= 0x%.2x , mic[2]= 0x%.2x , mic[3]= 0x%.2x\n\
- mic[4]= 0x%.2x , mic[5]= 0x%.2x , mic[6]= 0x%.2x , mic[7]= 0x%.2x !!!!\n",
- mic[0], mic[1], mic[2], mic[3], mic[4], mic[5], mic[6], mic[7]));
+ pr_err("%s %s: before add mic code!!!\n", DRIVER_PREFIX, __func__);
+ pr_err("%s %s: pattrib->last_txcmdsz =%d!!!\n",
+ DRIVER_PREFIX, __func__, pattrib->last_txcmdsz);
+ pr_err("%s %s:"
+ " mic[0]= 0x%.2x , "
+ " mic[1]= 0x%.2x , "
+ " mic[2]= 0x%.2x , "
+ " mic[3]= 0x%.2x\n "
+ " mic[4]= 0x%.2x , "
+ " mic[5]= 0x%.2x , "
+ " mic[6]= 0x%.2x , "
+ " mic[7]= 0x%.2x !!!!\n",
+ DRIVER_PREFIX, __func__,
+ mic[0],
+ mic[1],
+ mic[2],
+ mic[3],
+ mic[4],
+ mic[5],
+ mic[6],
+ mic[7]);
/* add mic code and add the mic code length in last_txcmdsz */

memcpy(payload, &mic[0], 8);
pattrib->last_txcmdsz += 8;

- RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_, ("\n ========last pkt ========\n"));
+ pr_info("%s ========last pkt ========\n", DRIVER_PREFIX);
payload = payload-pattrib->last_txcmdsz+8;
for (curfragnum = 0; curfragnum < pattrib->last_txcmdsz; curfragnum = curfragnum+8)
- RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_, (" %.2x, %.2x, %.2x, %.2x, %.2x, %.2x, %.2x, %.2x ",
- *(payload+curfragnum), *(payload+curfragnum+1), *(payload+curfragnum+2), *(payload+curfragnum+3),
- *(payload+curfragnum+4), *(payload+curfragnum+5), *(payload+curfragnum+6), *(payload+curfragnum+7)));
+ pr_info("%s %.2x, %.2x, %.2x, %.2x, %.2x, %.2x, %.2x, %.2x ",
+ DRIVER_PREFIX,
+ *(payload+curfragnum),
+ *(payload+curfragnum+1),
+ *(payload+curfragnum+2),
+ *(payload+curfragnum+3),
+ *(payload+curfragnum+4),
+ *(payload+curfragnum+5),
+ *(payload+curfragnum+6),
+ *(payload+curfragnum+7));
}
/*
*/
@@ -887,7 +930,7 @@ static s32 xmitframe_swencrypt(struct adapter *padapter, struct xmit_frame *pxmi
struct pkt_attrib *pattrib = &pxmitframe->attrib;

if (pattrib->bswenc) {
- RT_TRACE(_module_rtl871x_xmit_c_, _drv_alert_, ("### xmitframe_swencrypt\n"));
+ pr_alert("%s ### %s\n", DRIVER_PREFIX, __func__);
switch (pattrib->encrypt) {
case _WEP40_:
case _WEP104_:
@@ -903,7 +946,7 @@ static s32 xmitframe_swencrypt(struct adapter *padapter, struct xmit_frame *pxmi
break;
}
} else {
- RT_TRACE(_module_rtl871x_xmit_c_, _drv_notice_, ("### xmitframe_hwencrypt\n"));
+ pr_notice("%s ### xmitframe_hwencrypt\n", DRIVER_PREFIX);
}

return _SUCCESS;
@@ -957,7 +1000,8 @@ s32 rtw_make_wlanhdr(struct adapter *padapter, u8 *hdr, struct pkt_attrib *pattr
if (pattrib->qos_en)
qos_option = true;
} else {
- RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("fw_state:%x is not allowed to xmit frame\n", get_fwstate(pmlmepriv)));
+ pr_err("%s fw_state:%x is not allowed to xmit frame\n", DRIVER_PREFIX,
+ get_fwstate(pmlmepriv));
res = _FAIL;
goto exit;
}
@@ -1111,7 +1155,7 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct
mem_start = pbuf_start + hw_hdr_offset;

if (rtw_make_wlanhdr(padapter, mem_start, pattrib) == _FAIL) {
- RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("rtw_xmitframe_coalesce: rtw_make_wlanhdr fail; drop pkt\n"));
+ pr_err("%s %s: rtw_make_wlanhdr fail; drop pkt\n", DRIVER_PREFIX, __func__);
DBG_8192C("rtw_xmitframe_coalesce: rtw_make_wlanhdr fail; drop pkt\n");
res = _FAIL;
goto exit;
@@ -1139,9 +1183,14 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct
if (pattrib->iv_len) {
memcpy(pframe, pattrib->iv, pattrib->iv_len);

- RT_TRACE(_module_rtl871x_xmit_c_, _drv_notice_,
- ("rtw_xmitframe_coalesce: keyid =%d pattrib->iv[3]=%.2x pframe =%.2x %.2x %.2x %.2x\n",
- padapter->securitypriv.dot11PrivacyKeyIndex, pattrib->iv[3], *pframe, *(pframe+1), *(pframe+2), *(pframe+3)));
+ pr_notice("%s %s: keyid =%d pattrib->iv[3]=%.2x pframe =%.2x %.2x %.2x %.2x\n",
+ DRIVER_PREFIX, __func__,
+ padapter->securitypriv.dot11PrivacyKeyIndex,
+ pattrib->iv[3],
+ *pframe,
+ *(pframe+1),
+ *(pframe+2),
+ *(pframe+3));

pframe += pattrib->iv_len;

@@ -1183,7 +1232,8 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct

break;
} else {
- RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("%s: There're still something in packet!\n", __func__));
+ pr_err("%s - %s: There're still something in packet!\n",
+ DRIVER_PREFIX, __func__);
}

addr = (SIZE_PTR)(pframe);
@@ -1193,7 +1243,7 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct
}

if (xmitframe_addmic(padapter, pxmitframe) == _FAIL) {
- RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("xmitframe_addmic(padapter, pxmitframe) == _FAIL\n"));
+ pr_err("%s xmitframe_addmic(padapter, pxmitframe) == _FAIL\n", DRIVER_PREFIX);
DBG_8192C("xmitframe_addmic(padapter, pxmitframe) == _FAIL\n");
res = _FAIL;
goto exit;
@@ -1718,7 +1768,8 @@ struct xmit_frame *rtw_alloc_xmitframe(struct xmit_priv *pxmitpriv)/* _queue *pf
spin_lock_bh(&pfree_xmit_queue->lock);

if (list_empty(&pfree_xmit_queue->queue)) {
- RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_, ("rtw_alloc_xmitframe:%d\n", pxmitpriv->free_xmitframe_cnt));
+ pr_info("%s %s:%d\n", DRIVER_PREFIX, __func__,
+ pxmitpriv->free_xmitframe_cnt);
pxframe = NULL;
} else {
phead = get_list_head(pfree_xmit_queue);
@@ -1729,7 +1780,8 @@ struct xmit_frame *rtw_alloc_xmitframe(struct xmit_priv *pxmitpriv)/* _queue *pf

list_del_init(&pxframe->list);
pxmitpriv->free_xmitframe_cnt--;
- RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_, ("rtw_alloc_xmitframe():free_xmitframe_cnt =%d\n", pxmitpriv->free_xmitframe_cnt));
+ pr_info("%s %s: free_xmitframe_cnt =%d\n", DRIVER_PREFIX, __func__,
+ pxmitpriv->free_xmitframe_cnt);
}

spin_unlock_bh(&pfree_xmit_queue->lock);
@@ -1747,7 +1799,8 @@ struct xmit_frame *rtw_alloc_xmitframe_ext(struct xmit_priv *pxmitpriv)
spin_lock_bh(&queue->lock);

if (list_empty(&queue->queue)) {
- RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_, ("rtw_alloc_xmitframe_ext:%d\n", pxmitpriv->free_xframe_ext_cnt));
+ pr_info("%s %s:%d\n", DRIVER_PREFIX, __func__,
+ pxmitpriv->free_xframe_ext_cnt);
pxframe = NULL;
} else {
phead = get_list_head(queue);
@@ -1756,7 +1809,8 @@ struct xmit_frame *rtw_alloc_xmitframe_ext(struct xmit_priv *pxmitpriv)

list_del_init(&pxframe->list);
pxmitpriv->free_xframe_ext_cnt--;
- RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_, ("rtw_alloc_xmitframe_ext():free_xmitframe_cnt =%d\n", pxmitpriv->free_xframe_ext_cnt));
+ pr_info("%s %s:free_xmitframe_cnt =%d\n", DRIVER_PREFIX,
+ __func__, pxmitpriv->free_xframe_ext_cnt);
}

spin_unlock_bh(&queue->lock);
@@ -1802,7 +1856,8 @@ s32 rtw_free_xmitframe(struct xmit_priv *pxmitpriv, struct xmit_frame *pxmitfram
struct sk_buff *pndis_pkt = NULL;

if (!pxmitframe) {
- RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("======rtw_free_xmitframe():pxmitframe == NULL!!!!!!!!!!\n"));
+ pr_err("%s ======%s:pxmitframe == NULL!!!!!!!!!!\n",
+ DRIVER_PREFIX, __func__);
goto exit;
}

@@ -1830,10 +1885,12 @@ s32 rtw_free_xmitframe(struct xmit_priv *pxmitpriv, struct xmit_frame *pxmitfram
list_add_tail(&pxmitframe->list, get_list_head(queue));
if (pxmitframe->ext_tag == 0) {
pxmitpriv->free_xmitframe_cnt++;
- RT_TRACE(_module_rtl871x_xmit_c_, _drv_debug_, ("rtw_free_xmitframe():free_xmitframe_cnt =%d\n", pxmitpriv->free_xmitframe_cnt));
+ pr_debug("%s %s:free_xmitframe_cnt =%d\n",
+ DRIVER_PREFIX, __func__, pxmitpriv->free_xmitframe_cnt);
} else if (pxmitframe->ext_tag == 1) {
pxmitpriv->free_xframe_ext_cnt++;
- RT_TRACE(_module_rtl871x_xmit_c_, _drv_debug_, ("rtw_free_xmitframe():free_xframe_ext_cnt =%d\n", pxmitpriv->free_xframe_ext_cnt));
+ pr_debug("%s %s:free_xframe_ext_cnt =%d\n",
+ DRIVER_PREFIX, __func__, pxmitpriv->free_xframe_ext_cnt);
} else {
}

@@ -1871,8 +1928,8 @@ void rtw_free_xmitframe_queue(struct xmit_priv *pxmitpriv, struct __queue *pfram
s32 rtw_xmitframe_enqueue(struct adapter *padapter, struct xmit_frame *pxmitframe)
{
if (rtw_xmit_classifier(padapter, pxmitframe) == _FAIL) {
- RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_,
- ("rtw_xmitframe_enqueue: drop xmit pkt for classifier fail\n"));
+ pr_err("%s %s: drop xmit pkt for classifier fail\n", DRIVER_PREFIX,
+ __func__);
return _FAIL;
}

@@ -1888,21 +1945,21 @@ struct tx_servq *rtw_get_sta_pending(struct adapter *padapter, struct sta_info *
case 2:
ptxservq = &psta->sta_xmitpriv.bk_q;
*(ac) = 3;
- RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_, ("rtw_get_sta_pending : BK\n"));
+ pr_info("%s %s : BK\n", DRIVER_PREFIX, __func__);
break;

case 4:
case 5:
ptxservq = &psta->sta_xmitpriv.vi_q;
*(ac) = 1;
- RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_, ("rtw_get_sta_pending : VI\n"));
+ pr_info("%s %s : VI\n", DRIVER_PREFIX, __func__);
break;

case 6:
case 7:
ptxservq = &psta->sta_xmitpriv.vo_q;
*(ac) = 0;
- RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_, ("rtw_get_sta_pending : VO\n"));
+ pr_info("%s %s : VO\n", DRIVER_PREFIX, __func__);
break;

case 0:
@@ -1910,7 +1967,7 @@ struct tx_servq *rtw_get_sta_pending(struct adapter *padapter, struct sta_info *
default:
ptxservq = &psta->sta_xmitpriv.be_q;
*(ac) = 2;
- RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_, ("rtw_get_sta_pending : BE\n"));
+ pr_info("%s %s : BE\n", DRIVER_PREFIX, __func__);
break;
}

@@ -1939,7 +1996,7 @@ s32 rtw_xmit_classifier(struct adapter *padapter, struct xmit_frame *pxmitframe)
if (!psta) {
res = _FAIL;
DBG_8192C("rtw_xmit_classifier: psta == NULL\n");
- RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("rtw_xmit_classifier: psta == NULL\n"));
+ pr_err("%s %s: psta == NULL\n", DRIVER_PREFIX, __func__);
goto exit;
}

@@ -2059,7 +2116,8 @@ static void do_queue_select(struct adapter *padapter, struct pkt_attrib *pattrib
u8 qsel;

qsel = pattrib->priority;
- RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_, ("### do_queue_select priority =%d , qsel = %d\n", pattrib->priority, qsel));
+ pr_info("%s ### %s priority =%d , qsel = %d\n",
+ DRIVER_PREFIX, __func__, pattrib->priority, qsel);

pattrib->qsel = qsel;
}
@@ -2096,14 +2154,14 @@ s32 rtw_xmit(struct adapter *padapter, struct sk_buff **ppkt)

if (!pxmitframe) {
drop_cnt++;
- RT_TRACE(_module_xmit_osdep_c_, _drv_err_, ("%s: no more pxmitframe\n", __func__));
+ pr_err("%s %s: no more pxmitframe\n", DRIVER_PREFIX, __func__);
return -1;
}

res = update_attrib(padapter, *ppkt, &pxmitframe->attrib);

if (res == _FAIL) {
- RT_TRACE(_module_xmit_osdep_c_, _drv_err_, ("%s: update attrib fail\n", __func__));
+ pr_err("%s %s: update attrib fail\n", DRIVER_PREFIX, __func__);
#ifdef DBG_TX_DROP_FRAME
DBG_871X("DBG_TX_DROP_FRAME %s update attrib fail\n", __func__);
#endif
--
2.20.1

2021-03-31 09:41:51

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 02/40] staging: rtl8723bs: replace RT_TRACE with public printk wrappers in core/rtw_security.c

replace private macro RT_TRACE for tracing with in-kernel
pr_* printk wrappers

Signed-off-by: Fabio Aiuto <[email protected]>
---
drivers/staging/rtl8723bs/core/rtw_security.c | 38 ++++++++-----------
1 file changed, 16 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_security.c b/drivers/staging/rtl8723bs/core/rtw_security.c
index 8a447e149438..5bdde7b8de01 100644
--- a/drivers/staging/rtl8723bs/core/rtw_security.c
+++ b/drivers/staging/rtl8723bs/core/rtw_security.c
@@ -237,14 +237,13 @@ void rtw_wep_decrypt(struct adapter *padapter, u8 *precvframe)
*((u32 *)crc) = le32_to_cpu(getcrc32(payload, length-4));

if (crc[3] != payload[length-1] || crc[2] != payload[length-2] || crc[1] != payload[length-3] || crc[0] != payload[length-4]) {
- RT_TRACE(_module_rtl871x_security_c_,
- _drv_err_,
- ("%s:icv error crc[3](%x)!=payload[length-1](%x) || crc[2](%x)!=payload[length-2](%x) || crc[1](%x)!=payload[length-3](%x) || crc[0](%x)!=payload[length-4](%x)\n",
+ pr_err("%s %s:icv error crc[3](%x)!=payload[length-1](%x) || crc[2](%x)!=payload[length-2](%x) || crc[1](%x)!=payload[length-3](%x) || crc[0](%x)!=payload[length-4](%x)\n",
+ DRIVER_PREFIX,
__func__,
crc[3], payload[length - 1],
crc[2], payload[length - 2],
crc[1], payload[length - 3],
- crc[0], payload[length - 4]));
+ crc[0], payload[length - 4]);
}
}
}
@@ -609,7 +608,7 @@ u32 rtw_tkip_encrypt(struct adapter *padapter, u8 *pxmitframe)
if (pattrib->encrypt == _TKIP_) {

{
- RT_TRACE(_module_rtl871x_security_c_, _drv_err_, ("%s: stainfo!= NULL!!!\n", __func__));
+ pr_err("%s %s: stainfo!= NULL!!!\n", DRIVER_PREFIX, __func__);

if (IS_MCAST(pattrib->ra))
prwskey = psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey;
@@ -631,7 +630,8 @@ u32 rtw_tkip_encrypt(struct adapter *padapter, u8 *pxmitframe)

if ((curfragnum+1) == pattrib->nr_frags) { /* 4 the last fragment */
length = pattrib->last_txcmdsz-pattrib->hdrlen-pattrib->iv_len-pattrib->icv_len;
- RT_TRACE(_module_rtl871x_security_c_, _drv_info_, ("pattrib->iv_len =%x, pattrib->icv_len =%x\n", pattrib->iv_len, pattrib->icv_len));
+ pr_info("%s %s: pattrib->iv_len =%x, pattrib->icv_len =%x\n",
+ DRIVER_PREFIX, __func__, pattrib->iv_len, pattrib->icv_len);
*((__le32 *)crc) = getcrc32(payload, length);/* modified by Amy*/

arcfour_init(&mycontext, rc4key, 16);
@@ -740,17 +740,16 @@ u32 rtw_tkip_decrypt(struct adapter *padapter, u8 *precvframe)
*((u32 *)crc) = le32_to_cpu(getcrc32(payload, length-4));

if (crc[3] != payload[length-1] || crc[2] != payload[length-2] || crc[1] != payload[length-3] || crc[0] != payload[length-4]) {
- RT_TRACE(_module_rtl871x_security_c_,
- _drv_err_,
- ("rtw_wep_decrypt:icv error crc[3](%x)!=payload[length-1](%x) || crc[2](%x)!=payload[length-2](%x) || crc[1](%x)!=payload[length-3](%x) || crc[0](%x)!=payload[length-4](%x)\n",
+ pr_err("%s %s:icv error crc[3](%x)!=payload[length-1](%x) || crc[2](%x)!=payload[length-2](%x) || crc[1](%x)!=payload[length-3](%x) || crc[0](%x)!=payload[length-4](%x)\n",
+ DRIVER_PREFIX, __func__,
crc[3], payload[length - 1],
crc[2], payload[length - 2],
crc[1], payload[length - 3],
- crc[0], payload[length - 4]));
+ crc[0], payload[length - 4]);
res = _FAIL;
}
} else {
- RT_TRACE(_module_rtl871x_security_c_, _drv_err_, ("%s: stainfo == NULL!!!\n", __func__));
+ pr_err("%s %s: stainfo == NULL!!!\n", DRIVER_PREFIX, __func__);
res = _FAIL;
}
}
@@ -1380,7 +1379,7 @@ u32 rtw_aes_encrypt(struct adapter *padapter, u8 *pxmitframe)

/* 4 start to encrypt each fragment */
if (pattrib->encrypt == _AES_) {
- RT_TRACE(_module_rtl871x_security_c_, _drv_err_, ("%s: stainfo!= NULL!!!\n", __func__));
+ pr_err("%s %s: stainfo!= NULL!!!\n", DRIVER_PREFIX, __func__);

if (IS_MCAST(pattrib->ra))
prwskey = psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey;
@@ -1611,13 +1610,12 @@ static signed int aes_decipher(u8 *key, uint hdrlen,
/* compare the mic */
for (i = 0; i < 8; i++) {
if (pframe[hdrlen+8+plen-8+i] != message[hdrlen+8+plen-8+i]) {
- RT_TRACE(_module_rtl871x_security_c_,
- _drv_err_,
- ("%s:mic check error mic[%d]: pframe(%x) != message(%x)\n",
+ pr_err("%s %s:mic check error mic[%d]: pframe(%x) != message(%x)\n",
+ DRIVER_PREFIX,
__func__,
i,
pframe[hdrlen + 8 + plen - 8 + i],
- message[hdrlen + 8 + plen - 8 + i]));
+ message[hdrlen + 8 + plen - 8 + i]);
DBG_871X("%s:mic check error mic[%d]: pframe(%x) != message(%x)\n",
__func__,
i,
@@ -1649,9 +1647,7 @@ u32 rtw_aes_decrypt(struct adapter *padapter, u8 *precvframe)
if (prxattrib->encrypt == _AES_) {
stainfo = rtw_get_stainfo(&padapter->stapriv, &prxattrib->ta[0]);
if (stainfo) {
- RT_TRACE(_module_rtl871x_security_c_,
- _drv_err_,
- ("%s: stainfo!= NULL!!!\n", __func__));
+ pr_err("%s %s: stainfo!= NULL!!!\n", DRIVER_PREFIX, __func__);

if (IS_MCAST(prxattrib->ra)) {
static unsigned long start;
@@ -1706,9 +1702,7 @@ u32 rtw_aes_decrypt(struct adapter *padapter, u8 *precvframe)
res = aes_decipher(prwskey, prxattrib->hdrlen, pframe, length);

} else {
- RT_TRACE(_module_rtl871x_security_c_,
- _drv_err_,
- ("%s: stainfo == NULL!!!\n", __func__));
+ pr_err("%s %s: stainfo == NULL!!!\n", DRIVER_PREFIX, __func__);
res = _FAIL;
}
}
--
2.20.1

2021-03-31 09:42:12

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 04/40] staging: rtl8723bs: replace RT_TRACE with public printk wrappers in core/rtw_pwrctrl.c

replace private macro RT_TRACE for tracing with in-kernel
pr_* printk wrappers

Signed-off-by: Fabio Aiuto <[email protected]>
---
drivers/staging/rtl8723bs/core/rtw_pwrctrl.c | 62 +++++++++-----------
1 file changed, 27 insertions(+), 35 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c b/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c
index 8bf80e6f4a11..da967e819fcf 100644
--- a/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c
+++ b/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c
@@ -268,16 +268,16 @@ void rtw_set_rpwm(struct adapter *padapter, u8 pslv)
} else {
if ((pwrpriv->rpwm == pslv)
|| ((pwrpriv->rpwm >= PS_STATE_S2) && (pslv >= PS_STATE_S2))) {
- RT_TRACE(_module_rtl871x_pwrctrl_c_, _drv_err_,
- ("%s: Already set rpwm[0x%02X], new = 0x%02X!\n", __func__, pwrpriv->rpwm, pslv));
+ pr_err("%s %s: Already set rpwm[0x%02X], new = 0x%02X!\n",
+ DRIVER_PREFIX, __func__, pwrpriv->rpwm, pslv);
return;
}
}

if ((padapter->bSurpriseRemoved) || !(padapter->hw_init_completed)) {
- RT_TRACE(_module_rtl871x_pwrctrl_c_, _drv_err_,
- ("%s: SurpriseRemoved(%d) hw_init_completed(%d)\n",
- __func__, padapter->bSurpriseRemoved, padapter->hw_init_completed));
+ pr_err("%s %s: SurpriseRemoved(%d) hw_init_completed(%d)\n",
+ DRIVER_PREFIX, __func__, padapter->bSurpriseRemoved,
+ padapter->hw_init_completed);

pwrpriv->cpwm = PS_STATE_S4;

@@ -285,12 +285,12 @@ void rtw_set_rpwm(struct adapter *padapter, u8 pslv)
}

if (padapter->bDriverStopped) {
- RT_TRACE(_module_rtl871x_pwrctrl_c_, _drv_err_,
- ("%s: change power state(0x%02X) when DriverStopped\n", __func__, pslv));
+ pr_err("%s %s: change power state(0x%02X) when DriverStopped\n",
+ DRIVER_PREFIX, __func__, pslv);

if (pslv < PS_STATE_S2) {
- RT_TRACE(_module_rtl871x_pwrctrl_c_, _drv_err_,
- ("%s: Reject to enter PS_STATE(0x%02X) lower than S2 when DriverStopped!!\n", __func__, pslv));
+ pr_err("%s %s: Reject to enter PS_STATE(0x%02X) lower than S2 when DriverStopped!!\n",
+ DRIVER_PREFIX, __func__, pslv);
return;
}
}
@@ -299,8 +299,8 @@ void rtw_set_rpwm(struct adapter *padapter, u8 pslv)
/* only when from PS_STATE S0/S1 to S2 and higher needs ACK */
if ((pwrpriv->cpwm < PS_STATE_S2) && (pslv >= PS_STATE_S2))
rpwm |= PS_ACK;
- RT_TRACE(_module_rtl871x_pwrctrl_c_, _drv_notice_,
- ("rtw_set_rpwm: rpwm = 0x%02x cpwm = 0x%02x\n", rpwm, pwrpriv->cpwm));
+ pr_notice("%s %s: rpwm = 0x%02x cpwm = 0x%02x\n", DRIVER_PREFIX,
+ __func__, rpwm, pwrpriv->cpwm);

pwrpriv->rpwm = pslv;

@@ -382,12 +382,11 @@ void rtw_set_ps_mode(struct adapter *padapter, u8 ps_mode, u8 smart_ps, u8 bcn_a
{
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);

- RT_TRACE(_module_rtl871x_pwrctrl_c_, _drv_notice_,
- ("%s: PowerMode =%d Smart_PS =%d\n",
- __func__, ps_mode, smart_ps));
+ pr_notice("%s %s: PowerMode =%d Smart_PS =%d\n", DRIVER_PREFIX,
+ __func__, ps_mode, smart_ps);

if (ps_mode > PM_Card_Disable) {
- RT_TRACE(_module_rtl871x_pwrctrl_c_, _drv_err_, ("ps_mode:%d error\n", ps_mode));
+ pr_err("%s ps_mode:%d error\n", DRIVER_PREFIX, ps_mode);
return;
}

@@ -701,8 +700,7 @@ void cpwm_int_hdl(struct adapter *padapter, struct reportpwrstate_parm *preportp
exit:
mutex_unlock(&pwrpriv->lock);

- RT_TRACE(_module_rtl871x_pwrctrl_c_, _drv_notice_,
- ("cpwm_int_hdl: cpwm = 0x%02x\n", pwrpriv->cpwm));
+ pr_notice("%s %s: cpwm = 0x%02x\n", DRIVER_PREFIX, __func__, pwrpriv->cpwm);
}

static void cpwm_event_callback(struct work_struct *work)
@@ -817,9 +815,8 @@ s32 rtw_register_task_alive(struct adapter *padapter, u32 task)
register_task_alive(pwrctrl, task);

if (pwrctrl->bFwCurrentInPSMode) {
- RT_TRACE(_module_rtl871x_pwrctrl_c_, _drv_notice_,
- ("%s: task = 0x%x cpwm = 0x%02x alives = 0x%08x\n",
- __func__, task, pwrctrl->cpwm, pwrctrl->alives));
+ pr_notice("%s %s: task = 0x%x cpwm = 0x%02x alives = 0x%08x\n",
+ DRIVER_PREFIX, __func__, task, pwrctrl->cpwm, pwrctrl->alives);

if (pwrctrl->cpwm < pslv) {
if (pwrctrl->cpwm < PS_STATE_S2)
@@ -869,9 +866,8 @@ void rtw_unregister_task_alive(struct adapter *padapter, u32 task)
unregister_task_alive(pwrctrl, task);

if ((pwrctrl->pwr_mode != PS_MODE_ACTIVE) && pwrctrl->bFwCurrentInPSMode) {
- RT_TRACE(_module_rtl871x_pwrctrl_c_, _drv_notice_,
- ("%s: cpwm = 0x%02x alives = 0x%08x\n",
- __func__, pwrctrl->cpwm, pwrctrl->alives));
+ pr_notice("%s %s: cpwm = 0x%02x alives = 0x%08x\n", DRIVER_PREFIX,
+ __func__, pwrctrl->cpwm, pwrctrl->alives);

if (pwrctrl->cpwm > pslv)
if ((pslv >= PS_STATE_S2) || (pwrctrl->alives == 0))
@@ -910,9 +906,8 @@ s32 rtw_register_tx_alive(struct adapter *padapter)
register_task_alive(pwrctrl, XMIT_ALIVE);

if (pwrctrl->bFwCurrentInPSMode) {
- RT_TRACE(_module_rtl871x_pwrctrl_c_, _drv_notice_,
- ("rtw_register_tx_alive: cpwm = 0x%02x alives = 0x%08x\n",
- pwrctrl->cpwm, pwrctrl->alives));
+ pr_notice("%s %s: cpwm = 0x%02x alives = 0x%08x\n",
+ DRIVER_PREFIX, __func__, pwrctrl->cpwm, pwrctrl->alives);

if (pwrctrl->cpwm < pslv) {
if (pwrctrl->cpwm < PS_STATE_S2)
@@ -959,9 +954,8 @@ s32 rtw_register_cmd_alive(struct adapter *padapter)
register_task_alive(pwrctrl, CMD_ALIVE);

if (pwrctrl->bFwCurrentInPSMode) {
- RT_TRACE(_module_rtl871x_pwrctrl_c_, _drv_info_,
- ("rtw_register_cmd_alive: cpwm = 0x%02x alives = 0x%08x\n",
- pwrctrl->cpwm, pwrctrl->alives));
+ pr_info("%s %s: cpwm = 0x%02x alives = 0x%08x\n",
+ DRIVER_PREFIX, __func__, pwrctrl->cpwm, pwrctrl->alives);

if (pwrctrl->cpwm < pslv) {
if (pwrctrl->cpwm < PS_STATE_S2)
@@ -1008,9 +1002,8 @@ void rtw_unregister_tx_alive(struct adapter *padapter)
unregister_task_alive(pwrctrl, XMIT_ALIVE);

if ((pwrctrl->pwr_mode != PS_MODE_ACTIVE) && pwrctrl->bFwCurrentInPSMode) {
- RT_TRACE(_module_rtl871x_pwrctrl_c_, _drv_notice_,
- ("%s: cpwm = 0x%02x alives = 0x%08x\n",
- __func__, pwrctrl->cpwm, pwrctrl->alives));
+ pr_notice("%s %s: cpwm = 0x%02x alives = 0x%08x\n",
+ DRIVER_PREFIX, __func__, pwrctrl->cpwm, pwrctrl->alives);

if (pwrctrl->cpwm > pslv)
if ((pslv >= PS_STATE_S2) || (pwrctrl->alives == 0))
@@ -1048,9 +1041,8 @@ void rtw_unregister_cmd_alive(struct adapter *padapter)
unregister_task_alive(pwrctrl, CMD_ALIVE);

if ((pwrctrl->pwr_mode != PS_MODE_ACTIVE) && pwrctrl->bFwCurrentInPSMode) {
- RT_TRACE(_module_rtl871x_pwrctrl_c_, _drv_info_,
- ("%s: cpwm = 0x%02x alives = 0x%08x\n",
- __func__, pwrctrl->cpwm, pwrctrl->alives));
+ pr_info("%s %s: cpwm = 0x%02x alives = 0x%08x\n",
+ DRIVER_PREFIX, __func__, pwrctrl->cpwm, pwrctrl->alives);

if (pwrctrl->cpwm > pslv) {
if ((pslv >= PS_STATE_S2) || (pwrctrl->alives == 0))
--
2.20.1

2021-03-31 09:42:15

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 08/40] staging: rtl8723bs: replace RT_TRACE with public printk wrappers in core/rtw_mlme_ext.c

replace private macro RT_TRACE for tracing with in-kernel
pr_* printk wrappers

Signed-off-by: Fabio Aiuto <[email protected]>
---
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 39 ++++++++++---------
1 file changed, 20 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
index 8aadcf72a7ba..9ed216c58fa0 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
@@ -526,12 +526,12 @@ void mgt_dispatcher(struct adapter *padapter, union recv_frame *precv_frame)
struct dvobj_priv *psdpriv = padapter->dvobj;
struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;

- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_,
- ("+mgt_dispatcher: type(0x%x) subtype(0x%x)\n",
- GetFrameType(pframe), GetFrameSubType(pframe)));
+ pr_info("%s+%s: type(0x%x) subtype(0x%x)\n", DRIVER_PREFIX, __func__,
+ GetFrameType(pframe), GetFrameSubType(pframe));

if (GetFrameType(pframe) != WIFI_MGT_TYPE) {
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("mgt_dispatcher: type(0x%x) error!\n", GetFrameType(pframe)));
+ pr_err("%s %s: type(0x%x) error!\n", DRIVER_PREFIX, __func__,
+ GetFrameType(pframe));
return;
}

@@ -546,7 +546,8 @@ void mgt_dispatcher(struct adapter *padapter, union recv_frame *precv_frame)
index = GetFrameSubType(pframe) >> 4;

if (index >= ARRAY_SIZE(mlme_sta_tbl)) {
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("Currently we do not support reserved sub-fr-type =%d\n", index));
+ pr_err("%s Currently we do not support reserved sub-fr-type =%d\n",
+ DRIVER_PREFIX, index);
return;
}
ptable += index;
@@ -2675,7 +2676,7 @@ static int _issue_probereq(struct adapter *padapter,
int bssrate_len = 0;
u8 bc_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};

- RT_TRACE(_module_rtl871x_mlme_c_, _drv_notice_, ("+issue_probereq\n"));
+ pr_notice("%s+%s\n", DRIVER_PREFIX, __func__);

pmgntframe = alloc_mgtxmitframe(pxmitpriv);
if (!pmgntframe)
@@ -2743,7 +2744,8 @@ static int _issue_probereq(struct adapter *padapter,

pattrib->last_txcmdsz = pattrib->pktlen;

- RT_TRACE(_module_rtl871x_mlme_c_, _drv_notice_, ("issuing probe_req, tx_len =%d\n", pattrib->last_txcmdsz));
+ pr_notice("%s issuing probe_req, tx_len =%d\n",
+ DRIVER_PREFIX, pattrib->last_txcmdsz);

if (wait_ack) {
ret = dump_mgntframe_and_wait_ack(padapter, pmgntframe);
@@ -4441,7 +4443,7 @@ void start_create_ibss(struct adapter *padapter)

/* issue beacon */
if (send_beacon(padapter) == _FAIL) {
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("issuing beacon frame fail....\n"));
+ pr_err("%s issuing beacon frame fail....\n", DRIVER_PREFIX);

report_join_res(padapter, -1);
pmlmeinfo->state = WIFI_FW_NULL_STATE;
@@ -4622,8 +4624,8 @@ static void process_80211d(struct adapter *padapter, struct wlan_bssid_ex *bssid
memset(country, 0, 4);
memcpy(country, p, 3);
p += 3;
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_notice_,
- ("%s: 802.11d country =%s\n", __func__, country));
+ pr_notice("%s %s: 802.11d country =%s\n", DRIVER_PREFIX,
+ __func__, country);

i = 0;
while ((ie - p) >= 3) {
@@ -4813,9 +4815,8 @@ static void process_80211d(struct adapter *padapter, struct wlan_bssid_ex *bssid
break;

chplan_new[i].ScanType = SCAN_ACTIVE;
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_notice_,
- ("%s: change channel %d scan type from passive to active\n",
- __func__, channel));
+ pr_notice("%s %s: change channel %d scan type from passive to active\n",
+ DRIVER_PREFIX, __func__, channel);
}
break;
}
@@ -6332,9 +6333,9 @@ u8 mlme_evt_hdl(struct adapter *padapter, unsigned char *pbuf)
#ifdef CHECK_EVENT_SEQ
/* checking event sequence... */
if (evt_seq != (atomic_read(&pevt_priv->event_seq) & 0x7f)) {
- RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_,
- ("Event Seq Error! %d vs %d\n", (evt_seq & 0x7f),
- (atomic_read(&pevt_priv->event_seq) & 0x7f)));
+ pr_info("%s Event Seq Error! %d vs %d\n",
+ DRIVER_PREFIX, (evt_seq & 0x7f),
+ (atomic_read(&pevt_priv->event_seq) & 0x7f));

pevt_priv->event_seq = (evt_seq+1)&0x7f;

@@ -6344,7 +6345,7 @@ u8 mlme_evt_hdl(struct adapter *padapter, unsigned char *pbuf)

/* checking if event code is valid */
if (evt_code >= MAX_C2HEVT) {
- RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\nEvent Code(%d) mismatch!\n", evt_code));
+ pr_err("%s Event Code(%d) mismatch!\n", DRIVER_PREFIX, evt_code);
goto _abort_event_;
}

@@ -6352,8 +6353,8 @@ u8 mlme_evt_hdl(struct adapter *padapter, unsigned char *pbuf)
if ((wlanevents[evt_code].parmsize != 0) &&
(wlanevents[evt_code].parmsize != evt_sz)) {

- RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\nEvent(%d) Parm Size mismatch (%d vs %d)!\n",
- evt_code, wlanevents[evt_code].parmsize, evt_sz));
+ pr_err("%s Event(%d) Parm Size mismatch (%d vs %d)!\n",
+ DRIVER_PREFIX, evt_code, wlanevents[evt_code].parmsize, evt_sz);
goto _abort_event_;

}
--
2.20.1

2021-03-31 09:42:16

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 11/40] staging: rtl8723bs: remove commented RT_TRACE call in core/rtw_ioctl_set.c

remove commented RT_TRACE call in core/rtw_ioctl_set.c

Signed-off-by: Fabio Aiuto <[email protected]>
---
drivers/staging/rtl8723bs/core/rtw_ioctl_set.c | 3 ---
1 file changed, 3 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c b/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c
index 7d858cae2395..14eb01df69b0 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c
@@ -451,9 +451,6 @@ u8 rtw_set_802_11_infrastructure_mode(struct adapter *padapter,

/* SecClearAllKeys(adapter); */

- /* RT_TRACE(COMP_OID_SET, DBG_LOUD, ("set_infrastructure: fw_state:%x after changing mode\n", */
- /* get_fwstate(pmlmepriv))); */
-
spin_unlock_bh(&pmlmepriv->lock);
}
return true;
--
2.20.1

2021-03-31 09:42:15

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 05/40] staging: rtl8723bs: replace RT_TRACE with public printk wrappers in core/rtw_cmd.c

replace private macro RT_TRACE for tracing with in-kernel
pr_* printk wrappers

Signed-off-by: Fabio Aiuto <[email protected]>
---
drivers/staging/rtl8723bs/core/rtw_cmd.c | 55 +++++++++++++-----------
1 file changed, 31 insertions(+), 24 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c
index 2aaf25b48f96..63b5351d9f63 100644
--- a/drivers/staging/rtl8723bs/core/rtw_cmd.c
+++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c
@@ -221,7 +221,7 @@ int rtw_init_evt_priv(struct evt_priv *pevtpriv)

void _rtw_free_evt_priv(struct evt_priv *pevtpriv)
{
- RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("+_rtw_free_evt_priv\n"));
+ pr_info("%s+%s\n", DRIVER_PREFIX, __func__);

_cancel_workitem_sync(&pevtpriv->c2h_wk);
while (pevtpriv->c2h_wk_alive)
@@ -234,7 +234,7 @@ void _rtw_free_evt_priv(struct evt_priv *pevtpriv)
}
kfree(pevtpriv->c2h_queue);

- RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("-_rtw_free_evt_priv\n"));
+ pr_info("%s-%s\n", DRIVER_PREFIX, __func__);
}

void _rtw_free_cmd_priv(struct cmd_priv *pcmdpriv)
@@ -299,13 +299,13 @@ struct cmd_obj *_rtw_dequeue_cmd(struct __queue *queue)

void rtw_free_evt_priv(struct evt_priv *pevtpriv)
{
- RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("rtw_free_evt_priv\n"));
+ pr_info("%s %s\n", DRIVER_PREFIX, __func__);
_rtw_free_evt_priv(pevtpriv);
}

void rtw_free_cmd_priv(struct cmd_priv *pcmdpriv)
{
- RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("rtw_free_cmd_priv\n"));
+ pr_info("%s %s\n", DRIVER_PREFIX, __func__);
_rtw_free_cmd_priv(pcmdpriv);
}

@@ -415,7 +415,7 @@ int rtw_cmd_thread(void *context)
atomic_set(&(pcmdpriv->cmdthd_running), true);
complete(&pcmdpriv->terminate_cmdthread_comp);

- RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("start r871x rtw_cmd_thread !!!!\n"));
+ pr_info("%s start r871x %s !!!!\n", DRIVER_PREFIX, __func__);

while (1) {
if (wait_for_completion_interruptible(&pcmdpriv->cmd_queue_comp)) {
@@ -440,8 +440,7 @@ int rtw_cmd_thread(void *context)
}

if (rtw_register_cmd_alive(padapter) != _SUCCESS) {
- RT_TRACE(_module_hal_xmit_c_, _drv_notice_,
- ("%s: wait to leave LPS_LCLK\n", __func__));
+ pr_notice("%s %s: wait to leave LPS_LCLK\n", DRIVER_PREFIX, __func__);
continue;
}

@@ -512,14 +511,16 @@ int rtw_cmd_thread(void *context)
if (pcmd->cmdcode < ARRAY_SIZE(rtw_cmd_callback)) {
pcmd_callback = rtw_cmd_callback[pcmd->cmdcode].callback;
if (pcmd_callback == NULL) {
- RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("mlme_cmd_hdl(): pcmd_callback = 0x%p, cmdcode = 0x%x\n", pcmd_callback, pcmd->cmdcode));
+ pr_info("%s mlme_cmd_hdl(): pcmd_callback = 0x%p, cmdcode = 0x%x\n",
+ DRIVER_PREFIX, pcmd_callback, pcmd->cmdcode);
rtw_free_cmd_obj(pcmd);
} else {
/* todo: !!! fill rsp_buf to pcmd->rsp if (pcmd->rsp!= NULL) */
pcmd_callback(pcmd->padapter, pcmd);/* need consider that free cmd_obj in rtw_cmd_callback */
}
} else {
- RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("%s: cmdcode = 0x%x callback not defined!\n", __func__, pcmd->cmdcode));
+ pr_err("%s %s: cmdcode = 0x%x callback not defined!\n",
+ DRIVER_PREFIX, __func__, pcmd->cmdcode);
rtw_free_cmd_obj(pcmd);
}

@@ -583,7 +584,7 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid,

rtw_free_network_queue(padapter, false);

- RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("%s: flush network queue\n", __func__));
+ pr_info("%s %s: flush network queue\n", DRIVER_PREFIX, __func__);

init_h2fwcmd_w_parm_no_rsp(ph2c, psurveyPara, GEN_CMD_CODE(_SiteSurvey));

@@ -677,9 +678,11 @@ u8 rtw_createbss_cmd(struct adapter *padapter)
u8 res = _SUCCESS;

if (pmlmepriv->assoc_ssid.SsidLength == 0)
- RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, (" createbss for Any SSid:%s\n", pmlmepriv->assoc_ssid.Ssid));
+ pr_info("%s createbss for Any SSid:%s\n",
+ DRIVER_PREFIX, pmlmepriv->assoc_ssid.Ssid);
else
- RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, (" createbss for SSid:%s\n", pmlmepriv->assoc_ssid.Ssid));
+ pr_info("%s createbss for SSid:%s\n",
+ DRIVER_PREFIX, pmlmepriv->assoc_ssid.Ssid);

pcmd = rtw_zmalloc(sizeof(struct cmd_obj));
if (pcmd == NULL) {
@@ -767,14 +770,16 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network *pnetwork)
u8 *ptmp = NULL;

if (pmlmepriv->assoc_ssid.SsidLength == 0)
- RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("+Join cmd: Any SSid\n"));
+ pr_info("%s +Join cmd: Any SSid\n", DRIVER_PREFIX);
else
- RT_TRACE(_module_rtl871x_cmd_c_, _drv_notice_, ("+Join cmd: SSid =[%s]\n", pmlmepriv->assoc_ssid.Ssid));
+ pr_notice("%s +Join cmd: SSid =[%s]\n", DRIVER_PREFIX,
+ pmlmepriv->assoc_ssid.Ssid);

pcmd = rtw_zmalloc(sizeof(struct cmd_obj));
if (pcmd == NULL) {
res = _FAIL;
- RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("rtw_joinbss_cmd: memory allocate for cmd_obj fail!!!\n"));
+ pr_err("%s %s: memory allocate for cmd_obj fail!!!\n", DRIVER_PREFIX,
+ __func__);
goto exit;
}
/* for IEs is fix buf size */
@@ -883,7 +888,7 @@ u8 rtw_disassoc_cmd(struct adapter *padapter, u32 deauth_timeout_ms, bool enqueu
struct cmd_priv *cmdpriv = &padapter->cmdpriv;
u8 res = _SUCCESS;

- RT_TRACE(_module_rtl871x_cmd_c_, _drv_notice_, ("+rtw_disassoc_cmd\n"));
+ pr_notice("%s +%s\n", DRIVER_PREFIX, __func__);

/* prepare cmd parameter */
param = rtw_zmalloc(sizeof(*param));
@@ -1209,7 +1214,7 @@ u8 rtw_set_chplan_cmd(struct adapter *padapter, u8 chplan, u8 enqueue, u8 swconf

u8 res = _SUCCESS;

- RT_TRACE(_module_rtl871x_cmd_c_, _drv_notice_, ("+rtw_set_chplan_cmd\n"));
+ pr_notice("%s+%s\n", DRIVER_PREFIX, __func__);

/* check if allow software config */
if (swconfig && rtw_hal_is_disable_sw_channel_plan(padapter) == true) {
@@ -1981,7 +1986,7 @@ void rtw_survey_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd)
_set_timer(&pmlmepriv->scan_to_timer, 1);
} else if (pcmd->res != H2C_SUCCESS) {
_set_timer(&pmlmepriv->scan_to_timer, 1);
- RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\n ********Error: MgntActrtw_set_802_11_bssid_LIST_SCAN Fail ************\n\n."));
+ pr_err("%s ********Error: MgntActrtw_set_802_11_bssid_LIST_SCAN Fail ************\n\n.", DRIVER_PREFIX);
}

/* free cmd */
@@ -1997,7 +2002,7 @@ void rtw_disassoc_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd)
set_fwstate(pmlmepriv, _FW_LINKED);
spin_unlock_bh(&pmlmepriv->lock);

- RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\n ***Error: disconnect_cmd_callback Fail ***\n."));
+ pr_err("%s ***Error: disconnect_cmd_callback Fail ***\n.", DRIVER_PREFIX);
return;
}
/* free cmd */
@@ -2031,7 +2036,7 @@ void rtw_createbss_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd)
goto exit;

if ((pcmd->res != H2C_SUCCESS)) {
- RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\n ********Error: rtw_createbss_cmd_callback Fail ************\n\n."));
+ pr_err("%s ********Error: %s Fail ************\n\n.", DRIVER_PREFIX, __func__);
_set_timer(&pmlmepriv->assoc_timer, 1);
}

@@ -2045,7 +2050,8 @@ void rtw_createbss_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd)
if (!psta) {
psta = rtw_alloc_stainfo(&padapter->stapriv, pnetwork->MacAddress);
if (psta == NULL) {
- RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\nCan't alloc sta_info when createbss_cmd_callback\n"));
+ pr_err("%s Can't alloc sta_info when createbss_cmd_callback\n",
+ DRIVER_PREFIX);
goto createbss_cmd_fail;
}
}
@@ -2057,7 +2063,8 @@ void rtw_createbss_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd)
if (pwlan == NULL) {
pwlan = rtw_get_oldest_wlan_network(&pmlmepriv->scanned_queue);
if (pwlan == NULL) {
- RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\n Error: can't get pwlan in rtw_joinbss_event_callback\n"));
+ pr_err("%s Error: can't get pwlan in rtw_joinbss_event_callback\n",
+ DRIVER_PREFIX);
spin_unlock_bh(&(pmlmepriv->scanned_queue.lock));
goto createbss_cmd_fail;
}
@@ -2102,7 +2109,7 @@ void rtw_setstaKey_cmdrsp_callback(struct adapter *padapter, struct cmd_obj *pc
struct sta_info *psta = rtw_get_stainfo(pstapriv, psetstakey_rsp->addr);

if (psta == NULL) {
- RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\nERROR: rtw_setstaKey_cmdrsp_callback => can't get sta_info\n\n"));
+ pr_err("%s ERROR: %s => can't get sta_info\n", DRIVER_PREFIX, __func__);
goto exit;
}
exit:
@@ -2118,7 +2125,7 @@ void rtw_setassocsta_cmdrsp_callback(struct adapter *padapter, struct cmd_obj *
struct sta_info *psta = rtw_get_stainfo(pstapriv, passocsta_parm->addr);

if (psta == NULL) {
- RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\nERROR: setassocsta_cmdrsp_callbac => can't get sta_info\n\n"));
+ pr_err("%s ERROR: %s => can't get sta_info\n", DRIVER_PREFIX, __func__);
goto exit;
}

--
2.20.1

2021-03-31 09:42:16

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 06/40] staging: rtl8723bs: remove commented RT_TRACE calls in core/rtw_mlme.c

remove commented RT_TRACE calls in core/rtw_mlme.c

Signed-off-by: Fabio Aiuto <[email protected]>
---
drivers/staging/rtl8723bs/core/rtw_mlme.c | 6 ------
1 file changed, 6 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index 29d4b7493784..4289bf40aa73 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -356,7 +356,6 @@ static struct wlan_network *rtw_dequeue_network(struct __queue *queue)
void rtw_free_network_nolock(struct adapter *padapter, struct wlan_network *pnetwork);
void rtw_free_network_nolock(struct adapter *padapter, struct wlan_network *pnetwork)
{
- /* RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("rtw_free_network ==> ssid = %s\n\n" , pnetwork->network.Ssid.Ssid)); */
_rtw_free_network_nolock(&(padapter->mlmepriv), pnetwork);
rtw_cfg80211_unlink_bss(padapter, pnetwork);
}
@@ -393,8 +392,6 @@ int rtw_is_same_ibss(struct adapter *adapter, struct wlan_network *pnetwork)

inline int is_same_ess(struct wlan_bssid_ex *a, struct wlan_bssid_ex *b)
{
- /* RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("(%s,%d)(%s,%d)\n", */
- /* a->Ssid.Ssid, a->Ssid.SsidLength, b->Ssid.Ssid, b->Ssid.SsidLength)); */
return (a->Ssid.SsidLength == b->Ssid.SsidLength)
&& !memcmp(a->Ssid.Ssid, b->Ssid.Ssid, a->Ssid.SsidLength);
}
@@ -551,8 +548,6 @@ static void update_current_network(struct adapter *adapter, struct wlan_bssid_ex
&(pmlmepriv->cur_network.network));

if ((check_fwstate(pmlmepriv, _FW_LINKED) == true) && (is_same_network(&(pmlmepriv->cur_network.network), pnetwork, 0))) {
- /* RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_,"Same Network\n"); */
-
/* if (pmlmepriv->cur_network.network.IELength<= pnetwork->IELength) */
{
update_network(&(pmlmepriv->cur_network.network), pnetwork, adapter, true);
@@ -778,7 +773,6 @@ void rtw_survey_event_callback(struct adapter *adapter, u8 *pbuf)

/* update IBSS_network 's timestamp */
if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) == true) {
- /* RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_,"rtw_survey_event_callback : WIFI_ADHOC_MASTER_STATE\n\n"); */
if (!memcmp(&(pmlmepriv->cur_network.network.MacAddress), pnetwork->MacAddress, ETH_ALEN)) {
struct wlan_network *ibss_wlan = NULL;

--
2.20.1

2021-03-31 09:42:16

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 09/40] staging: rtl8723bs: remove commented RT_TRACE calls in core/rtw_recv.c

remove commented RT_TRACE calls in core/rtw_recv.c

Signed-off-by: Fabio Aiuto <[email protected]>
---
drivers/staging/rtl8723bs/core/rtw_recv.c | 12 ------------
1 file changed, 12 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c b/drivers/staging/rtl8723bs/core/rtw_recv.c
index 608a59286505..189f686a1f29 100644
--- a/drivers/staging/rtl8723bs/core/rtw_recv.c
+++ b/drivers/staging/rtl8723bs/core/rtw_recv.c
@@ -588,13 +588,11 @@ static union recv_frame *portctrl(struct adapter *adapter, union recv_frame *pre
prtnframe = precv_frame;
/* check is the EAPOL frame or not (Rekey) */
/* if (ether_type == eapol_type) { */
- /* RT_TRACE(_module_rtl871x_recv_c_, _drv_notice_, ("########portctrl:ether_type == 0x888e\n")); */
/* check Rekey */

/* prtnframe =precv_frame; */
/* */
/* else { */
- /* RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("########portctrl:ether_type = 0x%04x\n", ether_type)); */
/* */
}
} else
@@ -1693,7 +1691,6 @@ static signed int validate_recv_frame(struct adapter *adapter, union recv_frame
retval = validate_recv_data_frame(adapter, precv_frame);
if (retval == _FAIL) {
struct recv_priv *precvpriv = &adapter->recvpriv;
- /* RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("validate_recv_data_frame fail\n")); */
precvpriv->rx_drop++;
} else if (retval == _SUCCESS) {
#ifdef DBG_RX_DUMP_EAP
@@ -1889,7 +1886,6 @@ static int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_n

/* Drop out the packet which SeqNum is smaller than WinStart */
if (SN_LESS(seq_num, preorder_ctrl->indicate_seq)) {
- /* RT_TRACE(COMP_RX_REORDER, DBG_LOUD, ("CheckRxTsIndicateSeq(): Packet Drop! IndicateSeq: %d, NewSeq: %d\n", pTS->RxIndicateSeq, NewSeqNum)); */
/* DbgPrint("CheckRxTsIndicateSeq(): Packet Drop! IndicateSeq: %d, NewSeq: %d\n", precvpriv->indicate_seq, seq_num); */

#ifdef DBG_RX_DROP_FRAME
@@ -1914,7 +1910,6 @@ static int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_n
preorder_ctrl->indicate_seq, seq_num);
#endif
} else if (SN_LESS(wend, seq_num)) {
- /* RT_TRACE(COMP_RX_REORDER, DBG_LOUD, ("CheckRxTsIndicateSeq(): Window Shift! IndicateSeq: %d, NewSeq: %d\n", pTS->RxIndicateSeq, NewSeqNum)); */
/* DbgPrint("CheckRxTsIndicateSeq(): Window Shift! IndicateSeq: %d, NewSeq: %d\n", precvpriv->indicate_seq, seq_num); */

/* boundary situation, when seq_num cross 0xFFF */
@@ -1959,7 +1954,6 @@ static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, un
plist = get_next(plist);
else if (SN_EQUAL(pnextattrib->seq_num, pattrib->seq_num))
/* Duplicate entry is found!! Do not insert current entry. */
- /* RT_TRACE(COMP_RX_REORDER, DBG_TRACE, ("InsertRxReorderList(): Duplicate packet is dropped!! IndicateSeq: %d, NewSeq: %d\n", pTS->RxIndicateSeq, SeqNum)); */
/* spin_unlock_irqrestore(&ppending_recvframe_queue->lock, irql); */
return false;
else
@@ -1980,8 +1974,6 @@ static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, un
/* spin_unlock(&ppending_recvframe_queue->lock); */
/* spin_unlock_irqrestore(&ppending_recvframe_queue->lock, irql); */

-
- /* RT_TRACE(COMP_RX_REORDER, DBG_TRACE, ("InsertRxReorderList(): Pkt insert into buffer!! IndicateSeq: %d, NewSeq: %d\n", pTS->RxIndicateSeq, SeqNum)); */
return true;

}
@@ -2437,8 +2429,6 @@ s32 rtw_recv_entry(union recv_frame *precvframe)
struct recv_priv *precvpriv;
s32 ret = _SUCCESS;

- /* RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("+rtw_recv_entry\n")); */
-
padapter = precvframe->u.hdr.adapter;

precvpriv = &padapter->recvpriv;
@@ -2456,8 +2446,6 @@ s32 rtw_recv_entry(union recv_frame *precvframe)

_recv_entry_drop:

- /* RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("_recv_entry_drop\n")); */
-
return ret;
}

--
2.20.1

2021-03-31 09:42:16

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 10/40] staging: rtl8723bs: replace RT_TRACE with public printk wrappers in core/rtw_recv.c

replace private macro RT_TRACE for tracing with in-kernel
pr_* printk wrappers

Signed-off-by: Fabio Aiuto <[email protected]>
---
drivers/staging/rtl8723bs/core/rtw_recv.c | 240 ++++++++++++++--------
1 file changed, 157 insertions(+), 83 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c b/drivers/staging/rtl8723bs/core/rtw_recv.c
index 189f686a1f29..5b5fca291b99 100644
--- a/drivers/staging/rtl8723bs/core/rtw_recv.c
+++ b/drivers/staging/rtl8723bs/core/rtw_recv.c
@@ -325,9 +325,16 @@ static signed int recvframe_chkmic(struct adapter *adapter, union recv_frame *p
stainfo = rtw_get_stainfo(&adapter->stapriv, &prxattrib->ta[0]);

if (prxattrib->encrypt == _TKIP_) {
- RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("\n recvframe_chkmic:prxattrib->encrypt == _TKIP_\n"));
- RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("\n recvframe_chkmic:da = 0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x\n",
- prxattrib->ra[0], prxattrib->ra[1], prxattrib->ra[2], prxattrib->ra[3], prxattrib->ra[4], prxattrib->ra[5]));
+ pr_info("%s %s:prxattrib->encrypt == _TKIP_\n", DRIVER_PREFIX,
+ __func__);
+ pr_info("%s %s:da = 0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x\n",
+ DRIVER_PREFIX, __func__,
+ prxattrib->ra[0],
+ prxattrib->ra[1],
+ prxattrib->ra[2],
+ prxattrib->ra[3],
+ prxattrib->ra[4],
+ prxattrib->ra[5]);

/* calculate mic code */
if (stainfo) {
@@ -337,26 +344,28 @@ static signed int recvframe_chkmic(struct adapter *adapter, union recv_frame *p
/* rxdata_key_idx =(((iv[3])>>6)&0x3) ; */
mickey = &psecuritypriv->dot118021XGrprxmickey[prxattrib->key_index].skey[0];

- RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("\n recvframe_chkmic: bcmc key\n"));
+ pr_info("%s %s: bcmc key\n", DRIVER_PREFIX, __func__);
/* DBG_871X("\n recvframe_chkmic: bcmc key psecuritypriv->dot118021XGrpKeyid(%d), pmlmeinfo->key_index(%d) , recv key_id(%d)\n", */
/* psecuritypriv->dot118021XGrpKeyid, pmlmeinfo->key_index, rxdata_key_idx); */

if (psecuritypriv->binstallGrpkey == false) {
res = _FAIL;
- RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("\n recvframe_chkmic:didn't install group key!!!!!!!!!!\n"));
+ pr_err("%s %s:didn't install group key!!!!!!!!!!\n",
+ DRIVER_PREFIX, __func__);
DBG_871X("\n recvframe_chkmic:didn't install group key!!!!!!!!!!\n");
goto exit;
}
} else {
mickey = &stainfo->dot11tkiprxmickey.skey[0];
- RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("\n recvframe_chkmic: unicast key\n"));
+ pr_err("%s %s: unicast key\n", DRIVER_PREFIX, __func__);
}

datalen = precvframe->u.hdr.len-prxattrib->hdrlen-prxattrib->iv_len-prxattrib->icv_len-8;/* icv_len included the mic code */
pframe = precvframe->u.hdr.rx_data;
payload = pframe+prxattrib->hdrlen+prxattrib->iv_len;

- RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("\n prxattrib->iv_len =%d prxattrib->icv_len =%d\n", prxattrib->iv_len, prxattrib->icv_len));
+ pr_info("%s prxattrib->iv_len =%d prxattrib->icv_len =%d\n",
+ DRIVER_PREFIX, prxattrib->iv_len, prxattrib->icv_len);


rtw_seccalctkipmic(mickey, pframe, payload, datalen, &miccode[0], (unsigned char)prxattrib->priority); /* care the length of the data */
@@ -367,7 +376,9 @@ static signed int recvframe_chkmic(struct adapter *adapter, union recv_frame *p

for (i = 0; i < 8; i++) {
if (miccode[i] != *(pframemic+i)) {
- RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("recvframe_chkmic:miccode[%d](%02x) != *(pframemic+%d)(%02x) ", i, miccode[i], i, *(pframemic+i)));
+ pr_err("%s %s:miccode[%d](%02x) != *(pframemic+%d)(%02x) ",
+ DRIVER_PREFIX, __func__, i, miccode[i], i,
+ *(pframemic+i));
bmic_err = true;
}
}
@@ -375,28 +386,58 @@ static signed int recvframe_chkmic(struct adapter *adapter, union recv_frame *p

if (bmic_err == true) {

- RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("\n *(pframemic-8)-*(pframemic-1) = 0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x\n",
- *(pframemic-8), *(pframemic-7), *(pframemic-6), *(pframemic-5), *(pframemic-4), *(pframemic-3), *(pframemic-2), *(pframemic-1)));
- RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("\n *(pframemic-16)-*(pframemic-9) = 0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x\n",
- *(pframemic-16), *(pframemic-15), *(pframemic-14), *(pframemic-13), *(pframemic-12), *(pframemic-11), *(pframemic-10), *(pframemic-9)));
+ pr_err("%s *(pframemic-8)-*(pframemic-1) = "
+ "0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x\n",
+ DRIVER_PREFIX,
+ *(pframemic-8),
+ *(pframemic-7),
+ *(pframemic-6),
+ *(pframemic-5),
+ *(pframemic-4),
+ *(pframemic-3),
+ *(pframemic-2),
+ *(pframemic-1));
+
+ pr_err("%s *(pframemic-16)-*(pframemic-9) = "
+ "0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x\n",
+ DRIVER_PREFIX,
+ *(pframemic-16),
+ *(pframemic-15),
+ *(pframemic-14),
+ *(pframemic-13),
+ *(pframemic-12),
+ *(pframemic-11),
+ *(pframemic-10),
+ *(pframemic-9));

{
uint i;
- RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("\n ======demp packet (len =%d) ======\n", precvframe->u.hdr.len));
+ pr_err("%s ======demp packet (len =%d) ======\n",
+ DRIVER_PREFIX, precvframe->u.hdr.len);
for (i = 0; i < precvframe->u.hdr.len; i = i+8) {
- RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x:0x%02x",
- *(precvframe->u.hdr.rx_data+i), *(precvframe->u.hdr.rx_data+i+1),
- *(precvframe->u.hdr.rx_data+i+2), *(precvframe->u.hdr.rx_data+i+3),
- *(precvframe->u.hdr.rx_data+i+4), *(precvframe->u.hdr.rx_data+i+5),
- *(precvframe->u.hdr.rx_data+i+6), *(precvframe->u.hdr.rx_data+i+7)));
+ pr_err("%s 0x%02x:0x%02x:0x%02x:0x%02x:"
+ "0x%02x:0x%02x:0x%02x:0x%02x",
+ DRIVER_PREFIX,
+ *(precvframe->u.hdr.rx_data+i),
+ *(precvframe->u.hdr.rx_data+i+1),
+ *(precvframe->u.hdr.rx_data+i+2),
+ *(precvframe->u.hdr.rx_data+i+3),
+ *(precvframe->u.hdr.rx_data+i+4),
+ *(precvframe->u.hdr.rx_data+i+5),
+ *(precvframe->u.hdr.rx_data+i+6),
+ *(precvframe->u.hdr.rx_data+i+7));
}
- RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("\n ======demp packet end [len =%d]======\n", precvframe->u.hdr.len));
- RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("\n hrdlen =%d,\n", prxattrib->hdrlen));
+ pr_err("%s ======demp packet end [len =%d]======\n",
+ DRIVER_PREFIX, precvframe->u.hdr.len);
+ pr_err("%s hrdlen =%d,\n",
+ DRIVER_PREFIX, prxattrib->hdrlen);
}

- RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("ra = 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x psecuritypriv->binstallGrpkey =%d ",
- prxattrib->ra[0], prxattrib->ra[1], prxattrib->ra[2],
- prxattrib->ra[3], prxattrib->ra[4], prxattrib->ra[5], psecuritypriv->binstallGrpkey));
+ pr_err("%s ra = 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x "
+ "psecuritypriv->binstallGrpkey =%d ", DRIVER_PREFIX,
+ prxattrib->ra[0], prxattrib->ra[1], prxattrib->ra[2],
+ prxattrib->ra[3], prxattrib->ra[4], prxattrib->ra[5],
+ psecuritypriv->binstallGrpkey);

/* double check key_index for some timing issue , */
/* cannot compare with psecuritypriv->dot118021XGrpKeyid also cause timing issue */
@@ -405,10 +446,12 @@ static signed int recvframe_chkmic(struct adapter *adapter, union recv_frame *p

if ((prxattrib->bdecrypted == true) && (brpt_micerror == true)) {
rtw_handle_tkip_mic_err(adapter, (u8)IS_MCAST(prxattrib->ra));
- RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, (" mic error :prxattrib->bdecrypted =%d ", prxattrib->bdecrypted));
+ pr_err("%s mic error :prxattrib->bdecrypted =%d ",
+ DRIVER_PREFIX, prxattrib->bdecrypted);
DBG_871X(" mic error :prxattrib->bdecrypted =%d\n", prxattrib->bdecrypted);
} else {
- RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, (" mic error :prxattrib->bdecrypted =%d ", prxattrib->bdecrypted));
+ pr_err("%s mic error :prxattrib->bdecrypted =%d ",
+ DRIVER_PREFIX, prxattrib->bdecrypted);
DBG_871X(" mic error :prxattrib->bdecrypted =%d\n", prxattrib->bdecrypted);
}

@@ -418,12 +461,13 @@ static signed int recvframe_chkmic(struct adapter *adapter, union recv_frame *p
/* mic checked ok */
if ((psecuritypriv->bcheck_grpkey == false) && (IS_MCAST(prxattrib->ra) == true)) {
psecuritypriv->bcheck_grpkey = true;
- RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("psecuritypriv->bcheck_grpkey =true"));
+ pr_err("%s psecuritypriv->bcheck_grpkey =true",
+ DRIVER_PREFIX);
}
}

} else
- RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("recvframe_chkmic: rtw_get_stainfo == NULL!!!\n"));
+ pr_err("%s %s: rtw_get_stainfo == NULL!!!\n", DRIVER_PREFIX, __func__);

recvframe_pull_tail(precvframe, 8);

@@ -443,7 +487,8 @@ static union recv_frame *decryptor(struct adapter *padapter, union recv_frame *p
union recv_frame *return_packet = precv_frame;
u32 res = _SUCCESS;

- RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("prxstat->decrypted =%x prxattrib->encrypt = 0x%03x\n", prxattrib->bdecrypted, prxattrib->encrypt));
+ pr_info("%s prxstat->decrypted =%x prxattrib->encrypt = 0x%03x\n",
+ DRIVER_PREFIX, prxattrib->bdecrypted, prxattrib->encrypt);

if (prxattrib->encrypt > 0) {
u8 *iv = precv_frame->u.hdr.rx_data+prxattrib->hdrlen;
@@ -552,7 +597,8 @@ static union recv_frame *portctrl(struct adapter *adapter, union recv_frame *pre

psta = rtw_get_stainfo(pstapriv, psta_addr);

- RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("########portctrl:adapter->securitypriv.dot11AuthAlgrthm =%d\n", adapter->securitypriv.dot11AuthAlgrthm));
+ pr_info("%s ########%s: adapter->securitypriv.dot11AuthAlgrthm =%d\n",
+ DRIVER_PREFIX, __func__, adapter->securitypriv.dot11AuthAlgrthm);

if (auth_alg == 2) {
if ((psta) && (psta->ieee8021x_blocked)) {
@@ -560,7 +606,8 @@ static union recv_frame *portctrl(struct adapter *adapter, union recv_frame *pre

/* blocked */
/* only accept EAPOL frame */
- RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("########portctrl:psta->ieee8021x_blocked == 1\n"));
+ pr_info("%s ########%s: psta->ieee8021x_blocked == 1\n",
+ DRIVER_PREFIX, __func__);

prtnframe = precv_frame;

@@ -579,11 +626,14 @@ static union recv_frame *portctrl(struct adapter *adapter, union recv_frame *pre
} else {
/* allowed */
/* check decryption status, and decrypt the frame if needed */
- RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("########portctrl:psta->ieee8021x_blocked == 0\n"));
- RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("portctrl:precv_frame->hdr.attrib.privacy =%x\n", precv_frame->u.hdr.attrib.privacy));
+ pr_info("%s ########%s: psta->ieee8021x_blocked == 0\n",
+ DRIVER_PREFIX, __func__);
+ pr_info("%s %s: precv_frame->hdr.attrib.privacy =%x\n",
+ DRIVER_PREFIX, __func__, precv_frame->u.hdr.attrib.privacy);

if (pattrib->bdecrypted == 0)
- RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("portctrl:prxstat->decrypted =%x\n", pattrib->bdecrypted));
+ pr_info("%s %s:prxstat->decrypted =%x\n",
+ DRIVER_PREFIX, __func__, pattrib->bdecrypted);

prtnframe = precv_frame;
/* check is the EAPOL frame or not (Rekey) */
@@ -609,14 +659,16 @@ static signed int recv_decache(union recv_frame *precv_frame, u8 bretry, struct
(precv_frame->u.hdr.attrib.frag_num & 0xf);

if (tid > 15) {
- RT_TRACE(_module_rtl871x_recv_c_, _drv_notice_, ("recv_decache, (tid>15)! seq_ctrl = 0x%x, tid = 0x%x\n", seq_ctrl, tid));
+ pr_notice("%s %s, (tid>15)! seq_ctrl = 0x%x, tid = 0x%x\n",
+ DRIVER_PREFIX, __func__, seq_ctrl, tid);

return _FAIL;
}

if (1) { /* if (bretry) */
if (seq_ctrl == prxcache->tid_rxseq[tid]) {
- RT_TRACE(_module_rtl871x_recv_c_, _drv_notice_, ("recv_decache, seq_ctrl = 0x%x, tid = 0x%x, tid_rxseq = 0x%x\n", seq_ctrl, tid, prxcache->tid_rxseq[tid]));
+ pr_notice("%s %s, seq_ctrl = 0x%x, tid = 0x%x, tid_rxseq = 0x%x\n",
+ DRIVER_PREFIX, __func__, seq_ctrl, tid, prxcache->tid_rxseq[tid]);

return _FAIL;
}
@@ -766,7 +818,7 @@ static signed int sta2sta_data_frame(struct adapter *adapter, union recv_frame *

/* filter packets that SA is myself or multicast or broadcast */
if (!memcmp(myhwaddr, pattrib->src, ETH_ALEN)) {
- RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, (" SA ==myself\n"));
+ pr_err("%s SA ==myself\n", DRIVER_PREFIX);
ret = _FAIL;
goto exit;
}
@@ -788,7 +840,8 @@ static signed int sta2sta_data_frame(struct adapter *adapter, union recv_frame *
} else if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) {
/* For Station mode, sa and bssid should always be BSSID, and DA is my mac-address */
if (memcmp(pattrib->bssid, pattrib->src, ETH_ALEN)) {
- RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("bssid != TA under STATION_MODE; drop pkt\n"));
+ pr_err("%s bssid != TA under STATION_MODE; drop pkt\n",
+ DRIVER_PREFIX);
ret = _FAIL;
goto exit;
}
@@ -830,7 +883,8 @@ static signed int sta2sta_data_frame(struct adapter *adapter, union recv_frame *
*psta = rtw_get_stainfo(pstapriv, sta_addr); /* get ap_info */

if (!*psta) {
- RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("can't get psta under sta2sta_data_frame ; drop pkt\n"));
+ pr_err("%s can't get psta under %s; drop pkt\n",
+ DRIVER_PREFIX, __func__);
ret = _FAIL;
goto exit;
}
@@ -858,7 +912,7 @@ static signed int ap2sta_data_frame(struct adapter *adapter, union recv_frame *p

/* filter packets that SA is myself or multicast or broadcast */
if (!memcmp(myhwaddr, pattrib->src, ETH_ALEN)) {
- RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, (" SA ==myself\n"));
+ pr_err("%s SA ==myself\n", DRIVER_PREFIX);
#ifdef DBG_RX_DROP_FRAME
DBG_871X("DBG_RX_DROP_FRAME %s SA =%pM, myhwaddr =%pM\n",
__func__, MAC_ARG(pattrib->src), MAC_ARG(myhwaddr));
@@ -869,8 +923,8 @@ static signed int ap2sta_data_frame(struct adapter *adapter, union recv_frame *p

/* da should be for me */
if ((memcmp(myhwaddr, pattrib->dst, ETH_ALEN)) && (!bmcast)) {
- RT_TRACE(_module_rtl871x_recv_c_, _drv_info_,
- (" ap2sta_data_frame: compare DA fail; DA =%pM\n", MAC_ARG(pattrib->dst)));
+ pr_info("%s %s: compare DA fail; DA =%pM\n",
+ DRIVER_PREFIX, __func__, MAC_ARG(pattrib->dst));
#ifdef DBG_RX_DROP_FRAME
DBG_871X("DBG_RX_DROP_FRAME %s DA =%pM\n", __func__, MAC_ARG(pattrib->dst));
#endif
@@ -883,9 +937,9 @@ static signed int ap2sta_data_frame(struct adapter *adapter, union recv_frame *p
if (!memcmp(pattrib->bssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) ||
!memcmp(mybssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) ||
(memcmp(pattrib->bssid, mybssid, ETH_ALEN))) {
- RT_TRACE(_module_rtl871x_recv_c_, _drv_info_,
- (" ap2sta_data_frame: compare BSSID fail ; BSSID =%pM\n", MAC_ARG(pattrib->bssid)));
- RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("mybssid =%pM\n", MAC_ARG(mybssid)));
+ pr_info("%s %s: compare BSSID fail ; BSSID =%pM\n",
+ DRIVER_PREFIX, __func__, MAC_ARG(pattrib->bssid));
+ pr_info("%s mybssid =%pM\n",DRIVER_PREFIX, MAC_ARG(mybssid));
#ifdef DBG_RX_DROP_FRAME
DBG_871X("DBG_RX_DROP_FRAME %s BSSID =%pM, mybssid =%pM\n",
__func__, MAC_ARG(pattrib->bssid), MAC_ARG(mybssid));
@@ -907,7 +961,8 @@ static signed int ap2sta_data_frame(struct adapter *adapter, union recv_frame *p
*psta = rtw_get_stainfo(pstapriv, pattrib->bssid); /* get ap_info */

if (!*psta) {
- RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("ap2sta: can't get psta under STATION_MODE ; drop pkt\n"));
+ pr_err("%s %s: can't get psta under STATION_MODE ; drop pkt\n",
+ DRIVER_PREFIX, __func__);
#ifdef DBG_RX_DROP_FRAME
DBG_871X("DBG_RX_DROP_FRAME %s can't get psta under STATION_MODE ; drop pkt\n", __func__);
#endif
@@ -936,7 +991,8 @@ static signed int ap2sta_data_frame(struct adapter *adapter, union recv_frame *p

*psta = rtw_get_stainfo(pstapriv, pattrib->bssid); /* get sta_info */
if (!*psta) {
- RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("can't get psta under MP_MODE ; drop pkt\n"));
+ pr_err("%s can't get psta under MP_MODE ; drop pkt\n",
+ DRIVER_PREFIX);
#ifdef DBG_RX_DROP_FRAME
DBG_871X("DBG_RX_DROP_FRAME %s can't get psta under WIFI_MP_STATE ; drop pkt\n", __func__);
#endif
@@ -998,7 +1054,8 @@ static signed int sta2ap_data_frame(struct adapter *adapter, union recv_frame *p

*psta = rtw_get_stainfo(pstapriv, pattrib->src);
if (!*psta) {
- RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("can't get psta under AP_MODE; drop pkt\n"));
+ pr_err("%s can't get psta under AP_MODE; drop pkt\n",
+ DRIVER_PREFIX);
DBG_871X("issue_deauth to sta =%pM for the reason(7)\n", MAC_ARG(pattrib->src));

issue_deauth(adapter, pattrib->src, WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA);
@@ -1245,7 +1302,7 @@ static union recv_frame *recvframe_defrag(struct adapter *adapter,
/* free the defrag_q queue and return the prframe */
rtw_free_recvframe_queue(defrag_q, pfree_recv_queue);

- RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("Performance defrag!!!!!\n"));
+ pr_info("%s Performance defrag!!!!!\n", DRIVER_PREFIX);

return prframe;
}
@@ -1306,7 +1363,8 @@ static union recv_frame *recvframe_chk_defrag(struct adapter *padapter, union re
list_add_tail(&pfhdr->list, phead);
/* spin_unlock(&pdefrag_q->lock); */

- RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("Enqueuq: ismfrag = %d, fragnum = %d\n", ismfrag, fragnum));
+ pr_info("%s Enqueuq: ismfrag = %d, fragnum = %d\n",
+ DRIVER_PREFIX, ismfrag, fragnum);

prtnframe = NULL;

@@ -1314,7 +1372,8 @@ static union recv_frame *recvframe_chk_defrag(struct adapter *padapter, union re
/* can't find this ta's defrag_queue, so free this recv_frame */
rtw_free_recvframe(precv_frame, pfree_recv_queue);
prtnframe = NULL;
- RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("Free because pdefrag_q == NULL: ismfrag = %d, fragnum = %d\n", ismfrag, fragnum));
+ pr_err("%s Free because pdefrag_q == NULL: ismfrag = %d, fragnum = %d\n",
+ DRIVER_PREFIX, ismfrag, fragnum);
}

}
@@ -1329,7 +1388,8 @@ static union recv_frame *recvframe_chk_defrag(struct adapter *padapter, union re
/* spin_unlock(&pdefrag_q->lock); */

/* call recvframe_defrag to defrag */
- RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("defrag: ismfrag = %d, fragnum = %d\n", ismfrag, fragnum));
+ pr_info("%s defrag: ismfrag = %d, fragnum = %d\n",
+ DRIVER_PREFIX, ismfrag, fragnum);
precv_frame = recvframe_defrag(padapter, pdefrag_q);
prtnframe = precv_frame;

@@ -1337,7 +1397,8 @@ static union recv_frame *recvframe_chk_defrag(struct adapter *padapter, union re
/* can't find this ta's defrag_queue, so free this recv_frame */
rtw_free_recvframe(precv_frame, pfree_recv_queue);
prtnframe = NULL;
- RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("Free because pdefrag_q == NULL: ismfrag = %d, fragnum = %d\n", ismfrag, fragnum));
+ pr_err("%s Free because pdefrag_q == NULL: ismfrag = %d, fragnum = %d\n",
+ DRIVER_PREFIX, ismfrag, fragnum);
}

}
@@ -1346,7 +1407,8 @@ static union recv_frame *recvframe_chk_defrag(struct adapter *padapter, union re
if ((prtnframe) && (prtnframe->u.hdr.attrib.privacy)) {
/* after defrag we must check tkip mic code */
if (recvframe_chkmic(padapter, prtnframe) == _FAIL) {
- RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("recvframe_chkmic(padapter, prtnframe) == _FAIL\n"));
+ pr_err("%s recvframe_chkmic(padapter, prtnframe) == _FAIL\n",
+ DRIVER_PREFIX);
rtw_free_recvframe(prtnframe, pfree_recv_queue);
prtnframe = NULL;
}
@@ -1358,11 +1420,12 @@ static signed int validate_recv_mgnt_frame(struct adapter *padapter, union recv_
{
/* struct mlme_priv *pmlmepriv = &adapter->mlmepriv; */

- RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("+validate_recv_mgnt_frame\n"));
+ pr_info("%s +%s\n", DRIVER_PREFIX, __func__);

precv_frame = recvframe_chk_defrag(padapter, precv_frame);
if (!precv_frame) {
- RT_TRACE(_module_rtl871x_recv_c_, _drv_notice_, ("%s: fragment packet\n", __func__));
+ pr_notice("%s %s: fragment packet\n",
+ DRIVER_PREFIX, __func__);
return _SUCCESS;
}

@@ -1444,7 +1507,7 @@ static signed int validate_recv_data_frame(struct adapter *adapter, union recv_f
memcpy(pattrib->ra, GetAddr1Ptr(ptr), ETH_ALEN);
memcpy(pattrib->ta, GetAddr2Ptr(ptr), ETH_ALEN);
ret = _FAIL;
- RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, (" case 3\n"));
+ pr_err("%s case 3\n", DRIVER_PREFIX);
break;

default:
@@ -1464,7 +1527,7 @@ static signed int validate_recv_data_frame(struct adapter *adapter, union recv_f


if (!psta) {
- RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, (" after to_fr_ds_chk; psta == NULL\n"));
+ pr_err("%s after to_fr_ds_chk; psta == NULL\n", DRIVER_PREFIX);
#ifdef DBG_RX_DROP_FRAME
DBG_871X("DBG_RX_DROP_FRAME %s psta == NULL\n", __func__);
#endif
@@ -1502,7 +1565,7 @@ static signed int validate_recv_data_frame(struct adapter *adapter, union recv_f

/* decache, drop duplicate recv packets */
if (recv_decache(precv_frame, bretry, &psta->sta_recvpriv.rxcache) == _FAIL) {
- RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("decache : drop pkt\n"));
+ pr_err("%s decache : drop pkt\n", DRIVER_PREFIX);
#ifdef DBG_RX_DROP_FRAME
DBG_871X("DBG_RX_DROP_FRAME %s recv_decache return _FAIL\n", __func__);
#endif
@@ -1512,12 +1575,15 @@ static signed int validate_recv_data_frame(struct adapter *adapter, union recv_f

if (pattrib->privacy) {

- RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("validate_recv_data_frame:pattrib->privacy =%x\n", pattrib->privacy));
- RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("\n ^^^^^^^^^^^IS_MCAST(pattrib->ra(0x%02x)) =%d^^^^^^^^^^^^^^^6\n", pattrib->ra[0], IS_MCAST(pattrib->ra)));
+ pr_info("%s %s:pattrib->privacy =%x\n",
+ DRIVER_PREFIX, __func__, pattrib->privacy);
+ pr_info("%s ^^^^^^^^^^^IS_MCAST(pattrib->ra(0x%02x)) "
+ "=%d^^^^^^^^^^^^^^^6\n",
+ DRIVER_PREFIX, pattrib->ra[0], IS_MCAST(pattrib->ra));

GET_ENCRY_ALGO(psecuritypriv, psta, pattrib->encrypt, IS_MCAST(pattrib->ra));

- RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("\n pattrib->encrypt =%d\n", pattrib->encrypt));
+ pr_info("%s pattrib->encrypt =%d\n", DRIVER_PREFIX, pattrib->encrypt);

SET_ICE_IV_LEN(pattrib->iv_len, pattrib->icv_len, pattrib->encrypt);
} else {
@@ -1642,7 +1708,7 @@ static signed int validate_recv_frame(struct adapter *adapter, union recv_frame

/* add version chk */
if (ver != 0) {
- RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("validate_recv_data_frame fail! (ver!= 0)\n"));
+ pr_err("%s %s fail! (ver!= 0)\n", DRIVER_PREFIX, __func__);
retval = _FAIL;
goto exit;
}
@@ -1677,13 +1743,13 @@ static signed int validate_recv_frame(struct adapter *adapter, union recv_frame

retval = validate_recv_mgnt_frame(adapter, precv_frame);
if (retval == _FAIL)
- RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("validate_recv_mgnt_frame fail\n"));
+ pr_err("%s validate_recv_mgnt_frame fail\n", DRIVER_PREFIX);
retval = _FAIL; /* only data frame return _SUCCESS */
break;
case WIFI_CTRL_TYPE: /* ctrl */
retval = validate_recv_ctrl_frame(adapter, precv_frame);
if (retval == _FAIL)
- RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("validate_recv_ctrl_frame fail\n"));
+ pr_err("%s validate_recv_ctrl_frame fail\n", DRIVER_PREFIX);
retval = _FAIL; /* only data frame return _SUCCESS */
break;
case WIFI_DATA_TYPE: /* data */
@@ -1708,7 +1774,8 @@ static signed int validate_recv_frame(struct adapter *adapter, union recv_frame
}
break;
default:
- RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("validate_recv_data_frame fail! type = 0x%x\n", type));
+ pr_err("%s validate_recv_data_frame fail! type = 0x%x\n",
+ DRIVER_PREFIX, type);
#ifdef DBG_RX_DROP_FRAME
DBG_871X("DBG_RX_DROP_FRAME validate_recv_data_frame fail! type = 0x%x\n", type);
#endif
@@ -1755,7 +1822,8 @@ static signed int wlanhdr_to_ethhdr(union recv_frame *precvframe)
rmv_len = pattrib->hdrlen + pattrib->iv_len + (bsnaphdr?SNAP_SIZE:0);
len = precvframe->u.hdr.len - rmv_len;

- RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("\n ===pattrib->hdrlen: %x, pattrib->iv_len:%x ===\n\n", pattrib->hdrlen, pattrib->iv_len));
+ pr_info("%s ===pattrib->hdrlen: %x, pattrib->iv_len:%x ===\n",
+ DRIVER_PREFIX, pattrib->hdrlen, pattrib->iv_len);

memcpy(&be_tmp, ptr+rmv_len, 2);
eth_type = ntohs(be_tmp); /* pattrib->ether_type */
@@ -2036,9 +2104,9 @@ static int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reor
pattrib = &prframe->u.hdr.attrib;

if (!SN_LESS(preorder_ctrl->indicate_seq, pattrib->seq_num)) {
- RT_TRACE(_module_rtl871x_recv_c_, _drv_notice_,
- ("recv_indicatepkts_in_order: indicate =%d seq =%d amsdu =%d\n",
- preorder_ctrl->indicate_seq, pattrib->seq_num, pattrib->amsdu));
+ pr_notice("%s %s: indicate =%d seq =%d amsdu =%d\n",
+ DRIVER_PREFIX, __func__, preorder_ctrl->indicate_seq,
+ pattrib->seq_num, pattrib->amsdu);

plist = get_next(plist);
list_del_init(&(prframe->u.hdr.list));
@@ -2110,7 +2178,8 @@ static int recv_indicatepkt_reorder(struct adapter *padapter, union recv_frame *
if (pattrib->qos != 1) {
if ((padapter->bDriverStopped == false) &&
(padapter->bSurpriseRemoved == false)) {
- RT_TRACE(_module_rtl871x_recv_c_, _drv_notice_, ("@@@@ recv_indicatepkt_reorder -recv_func recv_indicatepkt\n"));
+ pr_notice("%s @@@@ %s -recv_func recv_indicatepkt\n",
+ DRIVER_PREFIX, __func__);

rtw_recv_indicatepkt(padapter, prframe);
return _SUCCESS;
@@ -2171,9 +2240,9 @@ static int recv_indicatepkt_reorder(struct adapter *padapter, union recv_frame *

spin_lock_bh(&ppending_recvframe_queue->lock);

- RT_TRACE(_module_rtl871x_recv_c_, _drv_notice_,
- ("recv_indicatepkt_reorder: indicate =%d seq =%d\n",
- preorder_ctrl->indicate_seq, pattrib->seq_num));
+ pr_notice("%s %s: indicate =%d seq =%d\n",
+ DRIVER_PREFIX, __func__, preorder_ctrl->indicate_seq,
+ pattrib->seq_num);

/* s2. check if winstart_b(indicate_seq) needs to been updated */
if (!check_indicate_seq(preorder_ctrl, pattrib->seq_num)) {
@@ -2272,7 +2341,7 @@ static int process_recv_indicatepkts(struct adapter *padapter, union recv_frame
} else { /* B/G mode */
retval = wlanhdr_to_ethhdr(prframe);
if (retval != _SUCCESS) {
- RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("wlanhdr_to_ethhdr: drop pkt\n"));
+ pr_err("%s wlanhdr_to_ethhdr: drop pkt\n", DRIVER_PREFIX);
#ifdef DBG_RX_DROP_FRAME
DBG_871X("DBG_RX_DROP_FRAME %s wlanhdr_to_ethhdr error!\n", __func__);
#endif
@@ -2281,14 +2350,18 @@ static int process_recv_indicatepkts(struct adapter *padapter, union recv_frame

if ((padapter->bDriverStopped == false) && (padapter->bSurpriseRemoved == false)) {
/* indicate this recv_frame */
- RT_TRACE(_module_rtl871x_recv_c_, _drv_notice_, ("@@@@ process_recv_indicatepkts- recv_func recv_indicatepkt\n"));
+ pr_notice("%s @@@@ %s- recv_func recv_indicatepkt\n",
+ DRIVER_PREFIX, __func__);
rtw_recv_indicatepkt(padapter, prframe);


} else {
- RT_TRACE(_module_rtl871x_recv_c_, _drv_notice_, ("@@@@ process_recv_indicatepkts- recv_func free_indicatepkt\n"));
+ pr_notice("%s @@@@ %s- recv_func free_indicatepkt\n",
+ DRIVER_PREFIX, __func__);

- RT_TRACE(_module_rtl871x_recv_c_, _drv_notice_, ("recv_func:bDriverStopped(%d) OR bSurpriseRemoved(%d)", padapter->bDriverStopped, padapter->bSurpriseRemoved));
+ pr_notice("%s recv_func:bDriverStopped(%d) OR bSurpriseRemoved(%d)",
+ DRIVER_PREFIX, padapter->bDriverStopped,
+ padapter->bSurpriseRemoved);
retval = _FAIL;
return retval;
}
@@ -2307,7 +2380,7 @@ static int recv_func_prehandle(struct adapter *padapter, union recv_frame *rfram
/* check the frame crtl field and decache */
ret = validate_recv_frame(padapter, rframe);
if (ret != _SUCCESS) {
- RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("recv_func: validate_recv_frame fail! drop pkt\n"));
+ pr_info("%s recv_func: validate_recv_frame fail! drop pkt\n", DRIVER_PREFIX);
rtw_free_recvframe(rframe, pfree_recv_queue);/* free this recv_frame */
goto exit;
}
@@ -2325,7 +2398,7 @@ static int recv_func_posthandle(struct adapter *padapter, union recv_frame *prfr

prframe = decryptor(padapter, prframe);
if (!prframe) {
- RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("decryptor: drop pkt\n"));
+ pr_err("%s decryptor: drop pkt\n", DRIVER_PREFIX);
#ifdef DBG_RX_DROP_FRAME
DBG_871X("DBG_RX_DROP_FRAME %s decryptor: drop pkt\n", __func__);
#endif
@@ -2335,7 +2408,7 @@ static int recv_func_posthandle(struct adapter *padapter, union recv_frame *prfr

prframe = recvframe_chk_defrag(padapter, prframe);
if (!prframe) {
- RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("recvframe_chk_defrag: drop pkt\n"));
+ pr_err("%s recvframe_chk_defrag: drop pkt\n", DRIVER_PREFIX);
#ifdef DBG_RX_DROP_FRAME
DBG_871X("DBG_RX_DROP_FRAME %s recvframe_chk_defrag: drop pkt\n", __func__);
#endif
@@ -2344,7 +2417,7 @@ static int recv_func_posthandle(struct adapter *padapter, union recv_frame *prfr

prframe = portctrl(padapter, prframe);
if (!prframe) {
- RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("portctrl: drop pkt\n"));
+ pr_err("%s portctrl: drop pkt\n", DRIVER_PREFIX);
#ifdef DBG_RX_DROP_FRAME
DBG_871X("DBG_RX_DROP_FRAME %s portctrl: drop pkt\n", __func__);
#endif
@@ -2356,7 +2429,7 @@ static int recv_func_posthandle(struct adapter *padapter, union recv_frame *prfr

ret = process_recv_indicatepkts(padapter, prframe);
if (ret != _SUCCESS) {
- RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("recv_func: process_recv_indicatepkts fail!\n"));
+ pr_err("%s recv_func: process_recv_indicatepkts fail!\n", DRIVER_PREFIX);
#ifdef DBG_RX_DROP_FRAME
DBG_871X("DBG_RX_DROP_FRAME %s process_recv_indicatepkts fail!\n", __func__);
#endif
@@ -2435,7 +2508,8 @@ s32 rtw_recv_entry(union recv_frame *precvframe)

ret = recv_func(padapter, precvframe);
if (ret == _FAIL) {
- RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, ("rtw_recv_entry: recv_func return fail!!!\n"));
+ pr_info("%s %s: recv_func return fail!!!\n",
+ DRIVER_PREFIX, __func__);
goto _recv_entry_drop;
}

--
2.20.1

2021-03-31 09:42:17

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 07/40] staging: rtl8723bs: replace RT_TRACE with public printk wrappers in core/rtw_mlme.c

replace private macro RT_TRACE for tracing with in-kernel
pr_* printk wrappers

Signed-off-by: Fabio Aiuto <[email protected]>
---
drivers/staging/rtl8723bs/core/rtw_mlme.c | 122 +++++++++++++---------
1 file changed, 72 insertions(+), 50 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index 4289bf40aa73..5e070ba6fb92 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -155,8 +155,7 @@ struct wlan_network *rtw_alloc_network(struct mlme_priv *pmlmepriv)

list_del_init(&pnetwork->list);

- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_,
- ("rtw_alloc_network: ptr =%p\n", plist));
+ pr_info("%s %s: ptr =%p\n", DRIVER_PREFIX, __func__, plist);
pnetwork->network_type = 0;
pnetwork->fixed = false;
pnetwork->last_scanned = jiffies;
@@ -299,7 +298,9 @@ signed int rtw_if_up(struct adapter *padapter)

if (padapter->bDriverStopped || padapter->bSurpriseRemoved ||
(check_fwstate(&padapter->mlmepriv, _FW_LINKED) == false)) {
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_if_up:bDriverStopped(%d) OR bSurpriseRemoved(%d)", padapter->bDriverStopped, padapter->bSurpriseRemoved));
+ pr_info("%s %s:bDriverStopped(%d) OR bSurpriseRemoved(%d)",
+ DRIVER_PREFIX, __func__, padapter->bDriverStopped,
+ padapter->bSurpriseRemoved);
res = false;
} else
res = true;
@@ -339,7 +340,7 @@ u8 *rtw_get_beacon_interval_from_ie(u8 *ie)

void rtw_free_mlme_priv(struct mlme_priv *pmlmepriv)
{
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("rtw_free_mlme_priv\n"));
+ pr_err("%s %s\n", DRIVER_PREFIX, __func__);
_rtw_free_mlme_priv(pmlmepriv);
}

@@ -608,7 +609,7 @@ void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *t
/* list_del_init(&oldest->list); */
pnetwork = oldest;
if (!pnetwork) {
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("\n\n\nsomething wrong here\n\n\n"));
+ pr_err("%s something wrong here\n", DRIVER_PREFIX);
goto exit;
}
memcpy(&(pnetwork->network), target, get_wlan_bssid_ex_sz(target));
@@ -629,7 +630,7 @@ void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *t
pnetwork = rtw_alloc_network(pmlmepriv); /* will update scan_time */

if (!pnetwork) {
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("\n\n\nsomething wrong here\n\n\n"));
+ pr_err("%s something wrong here\n", DRIVER_PREFIX);
goto exit;
}

@@ -750,7 +751,7 @@ int rtw_is_desired_network(struct adapter *adapter, struct wlan_network *pnetwor
/* TODO: Perry : For Power Management */
void rtw_atimdone_event_callback(struct adapter *adapter, u8 *pbuf)
{
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("receive atimdone_event\n"));
+ pr_err("%s receive atimdone_event\n", DRIVER_PREFIX);
}

void rtw_survey_event_callback(struct adapter *adapter, u8 *pbuf)
@@ -761,11 +762,11 @@ void rtw_survey_event_callback(struct adapter *adapter, u8 *pbuf)

pnetwork = (struct wlan_bssid_ex *)pbuf;

- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_survey_event_callback, ssid =%s\n", pnetwork->Ssid.Ssid));
+ pr_info("%s %s, ssid =%s\n", DRIVER_PREFIX, __func__, pnetwork->Ssid.Ssid);

len = get_wlan_bssid_ex_sz(pnetwork);
if (len > (sizeof(struct wlan_bssid_ex))) {
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("\n ****rtw_survey_event_callback: return a wrong bss ***\n"));
+ pr_err("%s ****%s: return a wrong bss ***\n", DRIVER_PREFIX, __func__);
return;
}

@@ -811,14 +812,15 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf)
pmlmepriv->wps_probe_req_ie = NULL;
}

- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_surveydone_event_callback: fw_state:%x\n\n", get_fwstate(pmlmepriv)));
+ pr_info("%s %s: fw_state:%x\n\n", DRIVER_PREFIX, __func__, get_fwstate(pmlmepriv));

if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY)) {
del_timer_sync(&pmlmepriv->scan_to_timer);
_clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY);
} else {

- RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("nic status =%x, survey done event comes too late!\n", get_fwstate(pmlmepriv)));
+ pr_err("%s nic status =%x, survey done event comes too late!\n",
+ DRIVER_PREFIX, get_fwstate(pmlmepriv));
}

rtw_set_signal_stat_timer(&adapter->recvpriv);
@@ -837,7 +839,7 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf)
/* pmlmepriv->fw_state ^= _FW_UNDER_SURVEY;because don't set assoc_timer */
_clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY);

- RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("switching to adhoc master\n"));
+ pr_err("%s switching to adhoc master\n", DRIVER_PREFIX);

memcpy(&pdev_network->Ssid, &pmlmepriv->assoc_ssid, sizeof(struct ndis_802_11_ssid));

@@ -847,7 +849,8 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf)
pmlmepriv->fw_state = WIFI_ADHOC_MASTER_STATE;

if (rtw_createbss_cmd(adapter) != _SUCCESS)
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("Error =>rtw_createbss_cmd status FAIL\n"));
+ pr_err("%s Error =>rtw_createbss_cmd status FAIL\n",
+ DRIVER_PREFIX);

pmlmepriv->to_join = false;
}
@@ -919,7 +922,7 @@ static void free_scanqueue(struct mlme_priv *pmlmepriv)
struct __queue *scan_queue = &pmlmepriv->scanned_queue;
struct list_head *plist, *phead, *ptemp;

- RT_TRACE(_module_rtl871x_mlme_c_, _drv_notice_, ("+free_scanqueue\n"));
+ pr_notice("%s+%s\n", DRIVER_PREFIX, __func__);
spin_lock_bh(&scan_queue->lock);
spin_lock_bh(&free_queue->lock);

@@ -957,7 +960,7 @@ static void find_network(struct adapter *adapter)
if (pwlan)
pwlan->fixed = false;
else
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("rtw_free_assoc_resources : pwlan == NULL\n\n"));
+ pr_err("%s rtw_free_assoc_resources : pwlan == NULL\n", DRIVER_PREFIX);

if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) &&
(adapter->stapriv.asoc_sta_count == 1))
@@ -975,9 +978,9 @@ void rtw_free_assoc_resources(struct adapter *adapter, int lock_scanned_queue)
struct dvobj_priv *psdpriv = adapter->dvobj;
struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;

- RT_TRACE(_module_rtl871x_mlme_c_, _drv_notice_, ("+rtw_free_assoc_resources\n"));
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("tgt_network->network.MacAddress =%pM ssid =%s\n",
- MAC_ARG(tgt_network->network.MacAddress), tgt_network->network.Ssid.Ssid));
+ pr_notice("%s+%s\n", DRIVER_PREFIX, __func__);
+ pr_info("%s tgt_network->network.MacAddress =%pM ssid =%s\n", DRIVER_PREFIX,
+ MAC_ARG(tgt_network->network.MacAddress), tgt_network->network.Ssid.Ssid);

if (check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_AP_STATE)) {
struct sta_info *psta;
@@ -1016,7 +1019,7 @@ void rtw_indicate_connect(struct adapter *padapter)
{
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;

- RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("+rtw_indicate_connect\n"));
+ pr_err("%s+%s\n", DRIVER_PREFIX, __func__);

pmlmepriv->to_join = false;

@@ -1030,7 +1033,7 @@ void rtw_indicate_connect(struct adapter *padapter)
rtw_set_to_roam(padapter, 0);
rtw_set_scan_deny(padapter, 3000);

- RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("-rtw_indicate_connect: fw_state = 0x%08x\n", get_fwstate(pmlmepriv)));
+ pr_err("%s-%s: fw_state = 0x%08x\n", DRIVER_PREFIX, __func__, get_fwstate(pmlmepriv));
}

/*
@@ -1040,7 +1043,7 @@ void rtw_indicate_disconnect(struct adapter *padapter)
{
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;

- RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("+rtw_indicate_disconnect\n"));
+ pr_err("%s+%s\n", DRIVER_PREFIX, __func__);

_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING|WIFI_UNDER_WPS);

@@ -1207,8 +1210,8 @@ static void rtw_joinbss_update_network(struct adapter *padapter, struct wlan_net
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
struct wlan_network *cur_network = &(pmlmepriv->cur_network);

- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("\nfw_state:%x, BSSID:%pM\n"
- , get_fwstate(pmlmepriv), MAC_ARG(pnetwork->network.MacAddress)));
+ pr_info("%s fw_state:%x, BSSID:%pM\n", DRIVER_PREFIX,
+ get_fwstate(pmlmepriv), MAC_ARG(pnetwork->network.MacAddress));

/* why not use ptarget_wlan?? */
memcpy(&cur_network->network, &pnetwork->network, pnetwork->network.Length);
@@ -1251,7 +1254,7 @@ static void rtw_joinbss_update_network(struct adapter *padapter, struct wlan_net
break;
default:
pmlmepriv->fw_state = WIFI_NULL_STATE;
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("Invalid network_mode\n"));
+ pr_err("%s Invalid network_mode\n", DRIVER_PREFIX);
break;
}

@@ -1280,20 +1283,23 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf)
struct wlan_network *pcur_wlan = NULL, *ptarget_wlan = NULL;
unsigned int the_same_macaddr = false;

- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("joinbss event call back received with res =%d\n", pnetwork->join_res));
+ pr_info("%s joinbss event call back received with res =%d\n",
+ DRIVER_PREFIX, pnetwork->join_res);

rtw_get_encrypt_decrypt_from_registrypriv(adapter);

if (pmlmepriv->assoc_ssid.SsidLength == 0)
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("@@@@@ joinbss event call back for Any SSid\n"));
+ pr_err("%s @@@@@ joinbss event call back for Any SSid\n", DRIVER_PREFIX);
else
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("@@@@@ rtw_joinbss_event_callback for SSid:%s\n", pmlmepriv->assoc_ssid.Ssid));
+ pr_err("%s @@@@@ rtw_joinbss_event_callback for SSid:%s\n",
+ DRIVER_PREFIX, pmlmepriv->assoc_ssid.Ssid);

the_same_macaddr = !memcmp(pnetwork->network.MacAddress, cur_network->network.MacAddress, ETH_ALEN);

pnetwork->network.Length = get_wlan_bssid_ex_sz(&pnetwork->network);
if (pnetwork->network.Length > sizeof(struct wlan_bssid_ex)) {
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("\n\n ***joinbss_evt_callback return a wrong bss ***\n\n"));
+ pr_err("%s ***joinbss_evt_callback return a wrong bss ***\n\n",
+ DRIVER_PREFIX);
return;
}

@@ -1302,7 +1308,7 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf)
pmlmepriv->LinkDetectInfo.TrafficTransitionCount = 0;
pmlmepriv->LinkDetectInfo.LowPowerTransitionCount = 0;

- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("\n rtw_joinbss_event_callback !! spin_lock_irqsave\n"));
+ pr_info("%s rtw_joinbss_event_callback !! spin_lock_irqsave\n", DRIVER_PREFIX);

if (pnetwork->join_res > 0) {
spin_lock_bh(&(pmlmepriv->scanned_queue.lock));
@@ -1349,7 +1355,8 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf)
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) {
ptarget_sta = rtw_joinbss_update_stainfo(adapter, pnetwork);
if (!ptarget_sta) {
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("Can't update stainfo when joinbss_event callback\n"));
+ pr_err("%s Can't update stainfo when joinbss_event callback\n",
+ DRIVER_PREFIX);
spin_unlock_bh(&(pmlmepriv->scanned_queue.lock));
goto ignore_joinbss_callback;
}
@@ -1361,16 +1368,18 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf)
rtw_indicate_connect(adapter);
} else {
/* adhoc mode will rtw_indicate_connect when rtw_stassoc_event_callback */
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("adhoc mode, fw_state:%x", get_fwstate(pmlmepriv)));
+ pr_info("%s adhoc mode, fw_state:%x",
+ DRIVER_PREFIX, get_fwstate(pmlmepriv));
}

/* s5. Cancel assoc_timer */
del_timer_sync(&pmlmepriv->assoc_timer);

- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("Cancel assoc_timer\n"));
+ pr_info("%s Cancel assoc_timer\n", DRIVER_PREFIX);

} else {
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("rtw_joinbss_event_callback err: fw_state:%x", get_fwstate(pmlmepriv)));
+ pr_err("%s rtw_joinbss_event_callback err: fw_state:%x",
+ DRIVER_PREFIX, get_fwstate(pmlmepriv));
spin_unlock_bh(&(pmlmepriv->scanned_queue.lock));
goto ignore_joinbss_callback;
}
@@ -1384,7 +1393,8 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf)
/* rtw_free_assoc_resources(adapter, 1); */

if ((check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) == true) {
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("fail! clear _FW_UNDER_LINKING ^^^fw_state =%x\n", get_fwstate(pmlmepriv)));
+ pr_err("%s fail! clear _FW_UNDER_LINKING ^^^fw_state =%x\n",
+ DRIVER_PREFIX, get_fwstate(pmlmepriv));
_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
}

@@ -1394,7 +1404,8 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf)
res = _FAIL;
if (retry < 2) {
res = rtw_select_and_join_from_scanned_queue(pmlmepriv);
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("rtw_select_and_join_from_scanned_queue again! res:%d\n", res));
+ pr_err("%s rtw_select_and_join_from_scanned_queue again! res:%d\n",
+ DRIVER_PREFIX, res);
}

if (res == _SUCCESS) {
@@ -1405,7 +1416,8 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf)
_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
rtw_indicate_connect(adapter);
} else {
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("Set Assoc_Timer = 1; can't find match ssid in scanned_q\n"));
+ pr_err("%s Set Assoc_Timer = 1; can't find match ssid in scanned_q\n",
+ DRIVER_PREFIX);
#endif

_set_timer(&pmlmepriv->assoc_timer, 1);
@@ -1495,14 +1507,16 @@ void rtw_stassoc_event_callback(struct adapter *adapter, u8 *pbuf)
if (psta) {
/* the sta have been in sta_info_queue => do nothing */

- RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("Error: rtw_stassoc_event_callback: sta has been in sta_hash_queue\n"));
+ pr_err("%s Error: %s: sta has been in sta_hash_queue\n",
+ DRIVER_PREFIX, __func__);

return; /* between drv has received this event before and fw have not yet to set key to CAM_ENTRY) */
}

psta = rtw_alloc_stainfo(&adapter->stapriv, pstassoc->macaddr);
if (!psta) {
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("Can't alloc sta_info when rtw_stassoc_event_callback\n"));
+ pr_err("%s Can't alloc sta_info when %s\n",
+ DRIVER_PREFIX, __func__);
return;
}

@@ -1653,7 +1667,8 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf)
}

if (rtw_createbss_cmd(adapter) != _SUCCESS)
- RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("***Error =>stadel_event_callback: rtw_createbss_cmd status FAIL***\n "));
+ pr_err("%s ***Error =>%s: rtw_createbss_cmd status FAIL***\n ",
+ DRIVER_PREFIX, __func__);
}

}
@@ -1665,7 +1680,7 @@ void rtw_cpwm_event_callback(struct adapter *padapter, u8 *pbuf)
{
struct reportpwrstate_parm *preportpwrstate;

- RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("+rtw_cpwm_event_callback !!!\n"));
+ pr_err("%s+%s !!!\n", DRIVER_PREFIX, __func__);
preportpwrstate = (struct reportpwrstate_parm *)pbuf;
preportpwrstate->state |= (u8)(adapter_to_pwrctl(padapter)->cpwm_tog + 0x80);
cpwm_int_hdl(padapter, preportpwrstate);
@@ -1931,7 +1946,7 @@ int rtw_select_roaming_candidate(struct mlme_priv *mlme)

pnetwork = container_of(mlme->pscanned, struct wlan_network, list);
if (!pnetwork) {
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("%s return _FAIL:(pnetwork == NULL)\n", __func__));
+ pr_err("%s %s return _FAIL:(pnetwork == NULL)\n", DRIVER_PREFIX, __func__);
ret = _FAIL;
goto exit;
}
@@ -2061,7 +2076,8 @@ int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv)

pnetwork = container_of(pmlmepriv->pscanned, struct wlan_network, list);
if (!pnetwork) {
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("%s return _FAIL:(pnetwork == NULL)\n", __func__));
+ pr_err("%s %s return _FAIL:(pnetwork == NULL)\n",
+ DRIVER_PREFIX, __func__);
ret = _FAIL;
goto exit;
}
@@ -2138,7 +2154,8 @@ signed int rtw_set_auth(struct adapter *adapter, struct security_priv *psecurity

INIT_LIST_HEAD(&pcmd->list);

- RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("after enqueue set_auth_cmd, auth_mode =%x\n", psecuritypriv->dot11AuthAlgrthm));
+ pr_err("%s after enqueue set_auth_cmd, auth_mode =%x\n",
+ DRIVER_PREFIX, psecuritypriv->dot11AuthAlgrthm);

res = rtw_enqueue_cmd(pcmdpriv, pcmd);

@@ -2162,10 +2179,12 @@ signed int rtw_set_key(struct adapter *adapter, struct security_priv *psecurityp

if (psecuritypriv->dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) {
psetkeyparm->algorithm = (unsigned char)psecuritypriv->dot118021XGrpPrivacy;
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("\n rtw_set_key: psetkeyparm->algorithm =(unsigned char)psecuritypriv->dot118021XGrpPrivacy =%d\n", psetkeyparm->algorithm));
+ pr_err("%s %s: psetkeyparm->algorithm =(unsigned char)psecuritypriv->dot118021XGrpPrivacy =%d\n",
+ DRIVER_PREFIX, __func__, psetkeyparm->algorithm);
} else {
psetkeyparm->algorithm = (u8)psecuritypriv->dot11PrivacyAlgrthm;
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("\n rtw_set_key: psetkeyparm->algorithm =(u8)psecuritypriv->dot11PrivacyAlgrthm =%d\n", psetkeyparm->algorithm));
+ pr_err("%s %s: psetkeyparm->algorithm =(u8)psecuritypriv->dot11PrivacyAlgrthm =%d\n",
+ DRIVER_PREFIX, __func__, psetkeyparm->algorithm);

}
psetkeyparm->keyid = (u8)keyid;/* 0~3 */
@@ -2174,7 +2193,8 @@ signed int rtw_set_key(struct adapter *adapter, struct security_priv *psecurityp
adapter->securitypriv.key_mask |= BIT(psetkeyparm->keyid);

DBG_871X("==> rtw_set_key algorithm(%x), keyid(%x), key_mask(%x)\n", psetkeyparm->algorithm, psetkeyparm->keyid, adapter->securitypriv.key_mask);
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("\n rtw_set_key: psetkeyparm->algorithm =%d psetkeyparm->keyid =(u8)keyid =%d\n", psetkeyparm->algorithm, keyid));
+ pr_err("%s %s: psetkeyparm->algorithm =%d psetkeyparm->keyid =(u8)keyid =%d\n",
+ DRIVER_PREFIX, __func__, psetkeyparm->algorithm, keyid);

switch (psetkeyparm->algorithm) {

@@ -2197,7 +2217,8 @@ signed int rtw_set_key(struct adapter *adapter, struct security_priv *psecurityp
psetkeyparm->grpkey = 1;
break;
default:
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("\n rtw_set_key:psecuritypriv->dot11PrivacyAlgrthm = %x (must be 1 or 2 or 4 or 5)\n", psecuritypriv->dot11PrivacyAlgrthm));
+ pr_err("%s %s:psecuritypriv->dot11PrivacyAlgrthm = %x (must be 1 or 2 or 4 or 5)\n",
+ DRIVER_PREFIX, __func__, psecuritypriv->dot11PrivacyAlgrthm);
res = _FAIL;
kfree(psetkeyparm);
goto exit;
@@ -2331,8 +2352,8 @@ signed int rtw_restruct_sec_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, u
struct security_priv *psecuritypriv = &adapter->securitypriv;
uint ndisauthmode = psecuritypriv->ndisauthtype;

- RT_TRACE(_module_rtl871x_mlme_c_, _drv_notice_,
- ("+rtw_restruct_sec_ie: ndisauthmode =%d\n", ndisauthmode));
+ pr_notice("%s+%s: ndisauthmode =%d\n", DRIVER_PREFIX,
+ __func__, ndisauthmode);

/* copy fixed ie only */
memcpy(out_ie, in_ie, 12);
@@ -2430,7 +2451,8 @@ void rtw_update_registrypriv_dev_network(struct adapter *adapter)
}

pdev_network->Configuration.DSConfig = (pregistrypriv->channel);
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("pregistrypriv->channel =%d, pdev_network->Configuration.DSConfig = 0x%x\n", pregistrypriv->channel, pdev_network->Configuration.DSConfig));
+ pr_info("%s pregistrypriv->channel =%d, pdev_network->Configuration.DSConfig = 0x%x\n",
+ DRIVER_PREFIX, pregistrypriv->channel, pdev_network->Configuration.DSConfig);

if (cur_network->network.InfrastructureMode == Ndis802_11IBSS)
pdev_network->Configuration.ATIMWindow = (0);
--
2.20.1

2021-03-31 09:42:18

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 12/40] staging: rtl8723bs: replace RT_TRACE with public printk wrappers in core/rtw_ioctl_set.c

replace private macro RT_TRACE for tracing with in-kernel
pr_* printk wrappers

Signed-off-by: Fabio Aiuto <[email protected]>
---
.../staging/rtl8723bs/core/rtw_ioctl_set.c | 126 ++++++++++--------
1 file changed, 74 insertions(+), 52 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c b/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c
index 14eb01df69b0..21409307bb66 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c
@@ -28,7 +28,7 @@ u8 rtw_validate_ssid(struct ndis_802_11_ssid *ssid)
u8 ret = true;

if (ssid->SsidLength > 32) {
- RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("ssid length >32\n"));
+ pr_err("%s ssid length >32\n", DRIVER_PREFIX);
ret = false;
goto exit;
}
@@ -49,7 +49,8 @@ u8 rtw_do_join(struct adapter *padapter)
phead = get_list_head(queue);
plist = get_next(phead);

- RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("\n rtw_do_join: phead = %p; plist = %p\n\n\n", phead, plist));
+ pr_info("%s %s: phead = %p; plist = %p\n",
+ DRIVER_PREFIX, __func__, phead, plist);

pmlmepriv->cur_network.join_res = -2;

@@ -69,12 +70,14 @@ u8 rtw_do_join(struct adapter *padapter)
if (pmlmepriv->LinkDetectInfo.bBusyTraffic == false
|| rtw_to_roam(padapter) > 0
) {
- RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("rtw_do_join(): site survey if scanned_queue is empty\n."));
+ pr_info("%s %s: site survey if scanned_queue is empty\n.",
+ DRIVER_PREFIX, __func__);
/* submit site_survey_cmd */
ret = rtw_sitesurvey_cmd(padapter, &pmlmepriv->assoc_ssid, 1, NULL, 0);
if (_SUCCESS != ret) {
pmlmepriv->to_join = false;
- RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("rtw_do_join(): site survey return error\n."));
+ pr_err("%s %s: site survey return error\n.",
+ DRIVER_PREFIX, __func__);
}
} else {
pmlmepriv->to_join = false;
@@ -107,14 +110,16 @@ u8 rtw_do_join(struct adapter *padapter)
rtw_generate_random_ibss(pibss);

if (rtw_createbss_cmd(padapter) != _SUCCESS) {
- RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("***Error =>do_goin: rtw_createbss_cmd status FAIL***\n "));
+ pr_err("%s ***Error => %s: rtw_createbss_cmd status FAIL***\n ",
+ DRIVER_PREFIX, __func__);
ret = false;
goto exit;
}

pmlmepriv->to_join = false;

- RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("***Error => rtw_select_and_join_from_scanned_queue FAIL under STA_Mode***\n "));
+ pr_info("%s ***Error => rtw_select_and_join_from_scanned_queue FAIL under STA_Mode***\n",
+ DRIVER_PREFIX);

} else {
/* can't associate ; reset under-linking */
@@ -129,7 +134,8 @@ u8 rtw_do_join(struct adapter *padapter)
ret = rtw_sitesurvey_cmd(padapter, &pmlmepriv->assoc_ssid, 1, NULL, 0);
if (_SUCCESS != ret) {
pmlmepriv->to_join = false;
- RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("do_join(): site survey return error\n."));
+ pr_err("%s %s: site survey return error\n.",
+ DRIVER_PREFIX, __func__);
}
} else {
ret = _FAIL;
@@ -169,15 +175,17 @@ u8 rtw_set_802_11_bssid(struct adapter *padapter, u8 *bssid)
goto release_mlme_lock;

if (check_fwstate(pmlmepriv, _FW_LINKED|WIFI_ADHOC_MASTER_STATE) == true) {
- RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("set_bssid: _FW_LINKED||WIFI_ADHOC_MASTER_STATE\n"));
+ pr_info("%s %s: _FW_LINKED||WIFI_ADHOC_MASTER_STATE\n",
+ DRIVER_PREFIX, __func__);

if (!memcmp(&pmlmepriv->cur_network.network.MacAddress, bssid, ETH_ALEN)) {
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == false)
goto release_mlme_lock;/* it means driver is in WIFI_ADHOC_MASTER_STATE, we needn't create bss again. */
} else {
- RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("Set BSSID not the same bssid\n"));
- RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("set_bssid =%pM\n", MAC_ARG(bssid)));
- RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("cur_bssid =%pM\n", MAC_ARG(pmlmepriv->cur_network.network.MacAddress)));
+ pr_info("%s Set BSSID not the same bssid\n", DRIVER_PREFIX);
+ pr_info("%s set_bssid =%pM\n", DRIVER_PREFIX, MAC_ARG(bssid));
+ pr_info("%s cur_bssid =%pM\n", DRIVER_PREFIX,
+ MAC_ARG(pmlmepriv->cur_network.network.MacAddress));

rtw_disassoc_cmd(padapter, 0, true);

@@ -212,8 +220,7 @@ u8 rtw_set_802_11_bssid(struct adapter *padapter, u8 *bssid)
spin_unlock_bh(&pmlmepriv->lock);

exit:
- RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_,
- ("rtw_set_802_11_bssid: status =%d\n", status));
+ pr_err("%s %s: status =%d\n", DRIVER_PREFIX, __func__, status);

return status;
}
@@ -229,8 +236,8 @@ u8 rtw_set_802_11_ssid(struct adapter *padapter, struct ndis_802_11_ssid *ssid)
ssid->Ssid, get_fwstate(pmlmepriv));

if (padapter->hw_init_completed == false) {
- RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_,
- ("set_ssid: hw_init_completed ==false =>exit!!!\n"));
+ pr_err("%s %s: hw_init_completed ==false =>exit!!!\n",
+ DRIVER_PREFIX, __func__);
status = _FAIL;
goto exit;
}
@@ -244,15 +251,14 @@ u8 rtw_set_802_11_ssid(struct adapter *padapter, struct ndis_802_11_ssid *ssid)
goto release_mlme_lock;

if (check_fwstate(pmlmepriv, _FW_LINKED|WIFI_ADHOC_MASTER_STATE) == true) {
- RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_,
- ("set_ssid: _FW_LINKED||WIFI_ADHOC_MASTER_STATE\n"));
+ pr_info("%s %s: _FW_LINKED||WIFI_ADHOC_MASTER_STATE\n",
+ DRIVER_PREFIX, __func__);

if ((pmlmepriv->assoc_ssid.SsidLength == ssid->SsidLength) &&
(!memcmp(&pmlmepriv->assoc_ssid.Ssid, ssid->Ssid, ssid->SsidLength))) {
if ((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == false)) {
- RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_,
- ("Set SSID is the same ssid, fw_state = 0x%08x\n",
- get_fwstate(pmlmepriv)));
+ pr_err("%s Set SSID is the same ssid, fw_state = 0x%08x\n",
+ DRIVER_PREFIX, get_fwstate(pmlmepriv));

if (rtw_is_same_ibss(padapter, pnetwork) == false) {
/* if in WIFI_ADHOC_MASTER_STATE | WIFI_ADHOC_STATE, create bss or rejoin again */
@@ -274,9 +280,13 @@ u8 rtw_set_802_11_ssid(struct adapter *padapter, struct ndis_802_11_ssid *ssid)
rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_JOINBSS, 1);
}
} else {
- RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("Set SSID not the same ssid\n"));
- RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("set_ssid =[%s] len = 0x%x\n", ssid->Ssid, (unsigned int)ssid->SsidLength));
- RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("assoc_ssid =[%s] len = 0x%x\n", pmlmepriv->assoc_ssid.Ssid, (unsigned int)pmlmepriv->assoc_ssid.SsidLength));
+ pr_info("%s Set SSID not the same ssid\n", DRIVER_PREFIX);
+ pr_info("%s %s =[%s] len = 0x%x\n",
+ DRIVER_PREFIX, __func__, ssid->Ssid,
+ (unsigned int)ssid->SsidLength);
+ pr_info("%s assoc_ssid =[%s] len = 0x%x\n", DRIVER_PREFIX,
+ pmlmepriv->assoc_ssid.Ssid,
+ (unsigned int)pmlmepriv->assoc_ssid.SsidLength);

rtw_disassoc_cmd(padapter, 0, true);

@@ -315,8 +325,7 @@ u8 rtw_set_802_11_ssid(struct adapter *padapter, struct ndis_802_11_ssid *ssid)
spin_unlock_bh(&pmlmepriv->lock);

exit:
- RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_,
- ("-rtw_set_802_11_ssid: status =%d\n", status));
+ pr_err("%s - %s: status =%d\n", DRIVER_PREFIX, __func__, status);

return status;
}
@@ -342,8 +351,8 @@ u8 rtw_set_802_11_connect(struct adapter *padapter, u8 *bssid, struct ndis_802_1
}

if (padapter->hw_init_completed == false) {
- RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_,
- ("set_ssid: hw_init_completed ==false =>exit!!!\n"));
+ pr_err("%s %s: hw_init_completed ==false =>exit!!!\n",
+ DRIVER_PREFIX, __func__);
status = _FAIL;
goto exit;
}
@@ -395,12 +404,12 @@ u8 rtw_set_802_11_infrastructure_mode(struct adapter *padapter,
struct wlan_network *cur_network = &pmlmepriv->cur_network;
enum ndis_802_11_network_infrastructure *pold_state = &(cur_network->network.InfrastructureMode);

- RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_notice_,
- ("+rtw_set_802_11_infrastructure_mode: old =%d new =%d fw_state = 0x%08x\n",
- *pold_state, networktype, get_fwstate(pmlmepriv)));
+ pr_notice("%s + %s: old =%d new =%d fw_state = 0x%08x\n",
+ DRIVER_PREFIX, __func__, *pold_state, networktype,
+ get_fwstate(pmlmepriv));

if (*pold_state != networktype) {
- RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, (" change mode!"));
+ pr_info("%s change mode!", DRIVER_PREFIX);
/* DBG_871X("change mode, old_mode =%d, new_mode =%d, fw_state = 0x%x\n", *pold_state, networktype, get_fwstate(pmlmepriv)); */

if (*pold_state == Ndis802_11APMode) {
@@ -464,7 +473,7 @@ u8 rtw_set_802_11_disassociate(struct adapter *padapter)
spin_lock_bh(&pmlmepriv->lock);

if (check_fwstate(pmlmepriv, _FW_LINKED) == true) {
- RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("MgntActrtw_set_802_11_disassociate: rtw_indicate_disconnect\n"));
+ pr_info("%s %s: rtw_indicate_disconnect\n", DRIVER_PREFIX, __func__);

rtw_disassoc_cmd(padapter, 0, true);
rtw_indicate_disconnect(padapter);
@@ -484,7 +493,8 @@ u8 rtw_set_802_11_bssid_list_scan(struct adapter *padapter, struct ndis_802_11_s
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
u8 res = true;

- RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("+rtw_set_802_11_bssid_list_scan(), fw_state =%x\n", get_fwstate(pmlmepriv)));
+ pr_err("%s + %s, fw_state =%x\n", DRIVER_PREFIX, __func__,
+ get_fwstate(pmlmepriv));

if (padapter == NULL) {
res = false;
@@ -492,20 +502,23 @@ u8 rtw_set_802_11_bssid_list_scan(struct adapter *padapter, struct ndis_802_11_s
}
if (padapter->hw_init_completed == false) {
res = false;
- RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("\n ===rtw_set_802_11_bssid_list_scan:hw_init_completed ==false ===\n"));
+ pr_err("%s === %s:hw_init_completed ==false ===\n",
+ DRIVER_PREFIX, __func__);
goto exit;
}

if ((check_fwstate(pmlmepriv, _FW_UNDER_SURVEY|_FW_UNDER_LINKING) == true) ||
(pmlmepriv->LinkDetectInfo.bBusyTraffic == true)) {
/* Scan or linking is in progress, do nothing. */
- RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("rtw_set_802_11_bssid_list_scan fail since fw_state = %x\n", get_fwstate(pmlmepriv)));
+ pr_err("%s %s: fail since fw_state = %x\n",
+ DRIVER_PREFIX, __func__, get_fwstate(pmlmepriv));
res = true;

if (check_fwstate(pmlmepriv, (_FW_UNDER_SURVEY|_FW_UNDER_LINKING)) == true)
- RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("\n###_FW_UNDER_SURVEY|_FW_UNDER_LINKING\n\n"));
+ pr_err("%s ###_FW_UNDER_SURVEY|_FW_UNDER_LINKING\n", DRIVER_PREFIX);
else
- RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("\n###pmlmepriv->sitesurveyctrl.traffic_busy ==true\n\n"));
+ pr_err("%s ###pmlmepriv->sitesurveyctrl.traffic_busy ==true\n",
+ DRIVER_PREFIX);
} else {
if (rtw_is_scan_deny(padapter)) {
DBG_871X(FUNC_ADPT_FMT": scan deny\n", FUNC_ADPT_ARG(padapter));
@@ -530,11 +543,12 @@ u8 rtw_set_802_11_authentication_mode(struct adapter *padapter, enum ndis_802_11
int res;
u8 ret;

- RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("set_802_11_auth.mode(): mode =%x\n", authmode));
+ pr_info("%s %s: mode =%x\n", DRIVER_PREFIX, __func__, authmode);

psecuritypriv->ndisauthtype = authmode;

- RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("rtw_set_802_11_authentication_mode:psecuritypriv->ndisauthtype =%d", psecuritypriv->ndisauthtype));
+ pr_info("%s %s:psecuritypriv->ndisauthtype =%d", DRIVER_PREFIX,
+ __func__, psecuritypriv->ndisauthtype);

if (psecuritypriv->ndisauthtype > 3)
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_8021X;
@@ -559,7 +573,7 @@ u8 rtw_set_802_11_add_wep(struct adapter *padapter, struct ndis_802_11_wep *wep)
keyid = wep->KeyIndex & 0x3fffffff;

if (keyid >= 4) {
- RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("MgntActrtw_set_802_11_add_wep:keyid>4 =>fail\n"));
+ pr_err("%s %s:keyid>4 =>fail\n", DRIVER_PREFIX, __func__);
ret = false;
goto exit;
}
@@ -567,21 +581,20 @@ u8 rtw_set_802_11_add_wep(struct adapter *padapter, struct ndis_802_11_wep *wep)
switch (wep->KeyLength) {
case 5:
psecuritypriv->dot11PrivacyAlgrthm = _WEP40_;
- RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("MgntActrtw_set_802_11_add_wep:wep->KeyLength =5\n"));
+ pr_info("%s %s:wep->KeyLength =5\n", DRIVER_PREFIX, __func__);
break;
case 13:
psecuritypriv->dot11PrivacyAlgrthm = _WEP104_;
- RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("MgntActrtw_set_802_11_add_wep:wep->KeyLength = 13\n"));
+ pr_info("%s %s:wep->KeyLength = 13\n", DRIVER_PREFIX, __func__);
break;
default:
psecuritypriv->dot11PrivacyAlgrthm = _NO_PRIVACY_;
- RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("MgntActrtw_set_802_11_add_wep:wep->KeyLength!=5 or 13\n"));
+ pr_info("%s %s:wep->KeyLength!=5 or 13\n", DRIVER_PREFIX, __func__);
break;
}

- RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_,
- ("rtw_set_802_11_add_wep:before memcpy, wep->KeyLength = 0x%x wep->KeyIndex = 0x%x keyid =%x\n",
- wep->KeyLength, wep->KeyIndex, keyid));
+ pr_info("%s %s:before memcpy, wep->KeyLength = 0x%x wep->KeyIndex = 0x%x keyid =%x\n",
+ DRIVER_PREFIX, __func__, wep->KeyLength, wep->KeyIndex, keyid);

memcpy(&(psecuritypriv->dot11DefKey[keyid].skey[0]), &(wep->KeyMaterial), wep->KeyLength);

@@ -589,12 +602,21 @@ u8 rtw_set_802_11_add_wep(struct adapter *padapter, struct ndis_802_11_wep *wep)

psecuritypriv->dot11PrivacyKeyIndex = keyid;

- RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, ("rtw_set_802_11_add_wep:security key material : %x %x %x %x %x %x %x %x %x %x %x %x %x\n",
- psecuritypriv->dot11DefKey[keyid].skey[0], psecuritypriv->dot11DefKey[keyid].skey[1], psecuritypriv->dot11DefKey[keyid].skey[2],
- psecuritypriv->dot11DefKey[keyid].skey[3], psecuritypriv->dot11DefKey[keyid].skey[4], psecuritypriv->dot11DefKey[keyid].skey[5],
- psecuritypriv->dot11DefKey[keyid].skey[6], psecuritypriv->dot11DefKey[keyid].skey[7], psecuritypriv->dot11DefKey[keyid].skey[8],
- psecuritypriv->dot11DefKey[keyid].skey[9], psecuritypriv->dot11DefKey[keyid].skey[10], psecuritypriv->dot11DefKey[keyid].skey[11],
- psecuritypriv->dot11DefKey[keyid].skey[12]));
+ pr_info("%s %s:security key material : %x %x %x %x %x %x %x %x %x %x %x %x %x\n",
+ DRIVER_PREFIX, __func__,
+ psecuritypriv->dot11DefKey[keyid].skey[0],
+ psecuritypriv->dot11DefKey[keyid].skey[1],
+ psecuritypriv->dot11DefKey[keyid].skey[2],
+ psecuritypriv->dot11DefKey[keyid].skey[3],
+ psecuritypriv->dot11DefKey[keyid].skey[4],
+ psecuritypriv->dot11DefKey[keyid].skey[5],
+ psecuritypriv->dot11DefKey[keyid].skey[6],
+ psecuritypriv->dot11DefKey[keyid].skey[7],
+ psecuritypriv->dot11DefKey[keyid].skey[8],
+ psecuritypriv->dot11DefKey[keyid].skey[9],
+ psecuritypriv->dot11DefKey[keyid].skey[10],
+ psecuritypriv->dot11DefKey[keyid].skey[11],
+ psecuritypriv->dot11DefKey[keyid].skey[12]);

res = rtw_set_key(padapter, psecuritypriv, keyid, 1, true);

--
2.20.1

2021-03-31 09:42:25

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 13/40] staging: rtl8723bs: replace RT_TRACE with public printk wrappers in core/rtw_wlan_util.c

replace private macro RT_TRACE for tracing with in-kernel
pr_* printk wrappers

Signed-off-by: Fabio Aiuto <[email protected]>
---
.../staging/rtl8723bs/core/rtw_wlan_util.c | 28 +++++++++----------
1 file changed, 13 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
index 760b0ea4e9bd..12566fbe1160 100644
--- a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
@@ -1334,10 +1334,11 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len)
memcpy(bssid->Ssid.Ssid, (p + 2), ssid_len);
bssid->Ssid.SsidLength = ssid_len;

- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("%s bssid.Ssid.Ssid:%s bssid.Ssid.SsidLength:%d "
- "cur_network->network.Ssid.Ssid:%s len:%d\n", __func__, bssid->Ssid.Ssid,
- bssid->Ssid.SsidLength, cur_network->network.Ssid.Ssid,
- cur_network->network.Ssid.SsidLength));
+ pr_info("%s %s bssid.Ssid.Ssid:%s bssid.Ssid.SsidLength:%d "
+ "cur_network->network.Ssid.Ssid:%s len:%d\n",
+ DRIVER_PREFIX, __func__, bssid->Ssid.Ssid,
+ bssid->Ssid.SsidLength, cur_network->network.Ssid.Ssid,
+ cur_network->network.Ssid.SsidLength);

if (memcmp(bssid->Ssid.Ssid, cur_network->network.Ssid.Ssid, 32) ||
bssid->Ssid.SsidLength != cur_network->network.Ssid.SsidLength) {
@@ -1355,9 +1356,8 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len)
else
bssid->Privacy = 0;

- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_,
- ("%s(): cur_network->network.Privacy is %d, bssid.Privacy is %d\n",
- __func__, cur_network->network.Privacy, bssid->Privacy));
+ pr_info("%s %s(): cur_network->network.Privacy is %d, bssid.Privacy is %d\n",
+ DRIVER_PREFIX, __func__, cur_network->network.Privacy, bssid->Privacy);
if (cur_network->network.Privacy != bssid->Privacy) {
DBG_871X("%s(), privacy is not match\n", __func__);
goto _mismatch;
@@ -1383,24 +1383,22 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len)
pbuf = rtw_get_wpa_ie(&bssid->IEs[12], &wpa_ielen, bssid->IELength-12);
if (pbuf && (wpa_ielen > 0)) {
if (_SUCCESS == rtw_parse_wpa_ie(pbuf, wpa_ielen+2, &group_cipher, &pairwise_cipher, &is_8021x)) {
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_,
- ("%s pnetwork->pairwise_cipher: %d, group_cipher is %d, is_8021x is %d\n", __func__,
- pairwise_cipher, group_cipher, is_8021x));
+ pr_info("%s %s pnetwork->pairwise_cipher: %d, group_cipher is %d, is_8021x is %d\n",
+ DRIVER_PREFIX, __func__, pairwise_cipher, group_cipher, is_8021x);
}
} else {
pbuf = rtw_get_wpa2_ie(&bssid->IEs[12], &wpa_ielen, bssid->IELength-12);

if (pbuf && (wpa_ielen > 0)) {
if (_SUCCESS == rtw_parse_wpa2_ie(pbuf, wpa_ielen+2, &group_cipher, &pairwise_cipher, &is_8021x)) {
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_,
- ("%s pnetwork->pairwise_cipher: %d, pnetwork->group_cipher is %d, is_802x is %d\n",
- __func__, pairwise_cipher, group_cipher, is_8021x));
+ pr_info("%s %s pnetwork->pairwise_cipher: %d, pnetwork->group_cipher is %d, is_802x is %d\n",
+ DRIVER_PREFIX, __func__, pairwise_cipher, group_cipher, is_8021x);
}
}
}

- RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_,
- ("%s cur_network->group_cipher is %d: %d\n", __func__, cur_network->BcnInfo.group_cipher, group_cipher));
+ pr_err("%s %s cur_network->group_cipher is %d: %d\n",
+ DRIVER_PREFIX, __func__, cur_network->BcnInfo.group_cipher, group_cipher);
if (pairwise_cipher != cur_network->BcnInfo.pairwise_cipher || group_cipher != cur_network->BcnInfo.group_cipher) {
DBG_871X("%s pairwise_cipher(%x:%x) or group_cipher(%x:%x) is not match\n", __func__,
pairwise_cipher, cur_network->BcnInfo.pairwise_cipher,
--
2.20.1

2021-03-31 09:42:29

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 16/40] staging: rtl8723bs: replace RT_TRACE with public printk wrappers in hal/HalPwrSeqCmd.c

replace private macro RT_TRACE for tracing with in-kernel
pr_* printk wrappers

Signed-off-by: Fabio Aiuto <[email protected]>
---
drivers/staging/rtl8723bs/hal/HalPwrSeqCmd.c | 61 +++++---------------
1 file changed, 16 insertions(+), 45 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/HalPwrSeqCmd.c b/drivers/staging/rtl8723bs/hal/HalPwrSeqCmd.c
index 932b31fda6ad..9abe37bf318f 100644
--- a/drivers/staging/rtl8723bs/hal/HalPwrSeqCmd.c
+++ b/drivers/staging/rtl8723bs/hal/HalPwrSeqCmd.c
@@ -53,21 +53,16 @@ u8 HalPwrSeqCmdParsing(
do {
PwrCfgCmd = PwrSeqCmd[AryIdx];

- RT_TRACE(
- _module_hal_init_c_,
- _drv_info_,
- (
- "HalPwrSeqCmdParsing: offset(%#x) cut_msk(%#x) fab_msk(%#x) interface_msk(%#x) base(%#x) cmd(%#x) msk(%#x) value(%#x)\n",
- GET_PWR_CFG_OFFSET(PwrCfgCmd),
- GET_PWR_CFG_CUT_MASK(PwrCfgCmd),
- GET_PWR_CFG_FAB_MASK(PwrCfgCmd),
- GET_PWR_CFG_INTF_MASK(PwrCfgCmd),
- GET_PWR_CFG_BASE(PwrCfgCmd),
- GET_PWR_CFG_CMD(PwrCfgCmd),
- GET_PWR_CFG_MASK(PwrCfgCmd),
- GET_PWR_CFG_VALUE(PwrCfgCmd)
- )
- );
+ pr_info("%s %s: offset(%#x) cut_msk(%#x) fab_msk(%#x) interface_msk(%#x) base(%#x) cmd(%#x) msk(%#x) value(%#x)\n",
+ DRIVER_PREFIX, __func__,
+ GET_PWR_CFG_OFFSET(PwrCfgCmd),
+ GET_PWR_CFG_CUT_MASK(PwrCfgCmd),
+ GET_PWR_CFG_FAB_MASK(PwrCfgCmd),
+ GET_PWR_CFG_INTF_MASK(PwrCfgCmd),
+ GET_PWR_CFG_BASE(PwrCfgCmd),
+ GET_PWR_CFG_CMD(PwrCfgCmd),
+ GET_PWR_CFG_MASK(PwrCfgCmd),
+ GET_PWR_CFG_VALUE(PwrCfgCmd));

/* 2 Only Handle the command whose FAB, CUT, and Interface are matched */
if (
@@ -77,19 +72,11 @@ u8 HalPwrSeqCmdParsing(
) {
switch (GET_PWR_CFG_CMD(PwrCfgCmd)) {
case PWR_CMD_READ:
- RT_TRACE(
- _module_hal_init_c_,
- _drv_info_,
- ("HalPwrSeqCmdParsing: PWR_CMD_READ\n")
- );
+ pr_info("%s %s: PWR_CMD_READ\n", DRIVER_PREFIX, __func__);
break;

case PWR_CMD_WRITE:
- RT_TRACE(
- _module_hal_init_c_,
- _drv_info_,
- ("HalPwrSeqCmdParsing: PWR_CMD_WRITE\n")
- );
+ pr_info("%s %s: PWR_CMD_WRITE\n", DRIVER_PREFIX, __func__);
offset = GET_PWR_CFG_OFFSET(PwrCfgCmd);

/* */
@@ -124,11 +111,7 @@ u8 HalPwrSeqCmdParsing(
break;

case PWR_CMD_POLLING:
- RT_TRACE(
- _module_hal_init_c_,
- _drv_info_,
- ("HalPwrSeqCmdParsing: PWR_CMD_POLLING\n")
- );
+ pr_info("%s %s: PWR_CMD_POLLING\n", DRIVER_PREFIX, __func__);

bPollingBit = false;
offset = GET_PWR_CFG_OFFSET(PwrCfgCmd);
@@ -160,11 +143,7 @@ u8 HalPwrSeqCmdParsing(
break;

case PWR_CMD_DELAY:
- RT_TRACE(
- _module_hal_init_c_,
- _drv_info_,
- ("HalPwrSeqCmdParsing: PWR_CMD_DELAY\n")
- );
+ pr_info("%s %s: PWR_CMD_DELAY\n", DRIVER_PREFIX, __func__);
if (GET_PWR_CFG_VALUE(PwrCfgCmd) == PWRSEQ_DELAY_US)
udelay(GET_PWR_CFG_OFFSET(PwrCfgCmd));
else
@@ -173,19 +152,11 @@ u8 HalPwrSeqCmdParsing(

case PWR_CMD_END:
/* When this command is parsed, end the process */
- RT_TRACE(
- _module_hal_init_c_,
- _drv_info_,
- ("HalPwrSeqCmdParsing: PWR_CMD_END\n")
- );
+ pr_info("%s %s: PWR_CMD_END\n", DRIVER_PREFIX, __func__);
return true;

default:
- RT_TRACE(
- _module_hal_init_c_,
- _drv_err_,
- ("HalPwrSeqCmdParsing: Unknown CMD!!\n")
- );
+ pr_err("%s %s: Unknown CMD!!\n", DRIVER_PREFIX, __func__);
break;
}
}
--
2.20.1

2021-03-31 09:43:00

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 17/40] staging: rtl8723bs: fix constant name in hal/rtl8723b_hal_init.c

fix constant name in log message call

Signed-off-by: Fabio Aiuto <[email protected]>
---
drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
index 0273118e70af..0f7da8dbd80c 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
@@ -412,7 +412,7 @@ s32 rtl8723b_FirmwareDownload(struct adapter *padapter, bool bUsedWoWLANFw)
RT_TRACE(
_module_hal_init_c_,
_drv_err_,
- ("Firmware size exceed 0x%X. Check it.\n", FW_8188E_SIZE)
+ ("Firmware size exceed 0x%X. Check it.\n", FW_8723B_SIZE)
);
goto exit;
}
--
2.20.1

2021-03-31 09:43:03

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 18/40] staging: rtl8723bs: added driver prefix in log messages

added driver prefix in log messages in hal/rtl8723b_hal_init.c

Signed-off-by: Fabio Aiuto <[email protected]>
---
drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
index 0f7da8dbd80c..7b92bc5ed1c7 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
@@ -396,13 +396,14 @@ s32 rtl8723b_FirmwareDownload(struct adapter *padapter, bool bUsedWoWLANFw)

rtStatus = request_firmware(&fw, fwfilepath, device);
if (rtStatus) {
- pr_err("Request firmware failed with error 0x%x\n", rtStatus);
+ pr_err("%s Request firmware failed with error 0x%x\n",
+ DRIVER_PREFIX, rtStatus);
rtStatus = _FAIL;
goto exit;
}

if (!fw) {
- pr_err("Firmware %s not available\n", fwfilepath);
+ pr_err("%s Firmware %s not available\n", DRIVER_PREFIX, fwfilepath);
rtStatus = _FAIL;
goto exit;
}
--
2.20.1

2021-03-31 09:43:07

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 03/40] staging: rtl8723bs: replace RT_TRACE with public printk wrappers in core/rtw_eeprom.c

replace private macro RT_TRACE for tracing with in-kernel
pr_* printk wrappers

Signed-off-by: Fabio Aiuto <[email protected]>
---
drivers/staging/rtl8723bs/core/rtw_eeprom.c | 26 ++++++++++-----------
1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_eeprom.c b/drivers/staging/rtl8723bs/core/rtw_eeprom.c
index 3cbd65dee741..6176d741d60e 100644
--- a/drivers/staging/rtl8723bs/core/rtw_eeprom.c
+++ b/drivers/staging/rtl8723bs/core/rtw_eeprom.c
@@ -36,7 +36,7 @@ void shift_out_bits(_adapter *padapter, u16 data, u16 count)
_func_enter_;

if (padapter->bSurpriseRemoved == true) {
- RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==true"));
+ pr_err("%s padapter->bSurpriseRemoved==true", DRIVER_PREFIX);
goto out;
}
mask = 0x01 << (count - 1);
@@ -49,8 +49,8 @@ _func_enter_;
if (data & mask)
x |= _EEDI;
if (padapter->bSurpriseRemoved == true) {
- RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==true"));
- goto out;
+ pr_err("%s padapter->bSurpriseRemoved==true", DRIVER_PREFIX);
+ goto out;
}
rtw_write8(padapter, EE_9346CR, (u8)x);
udelay(CLOCK_RATE);
@@ -59,7 +59,7 @@ _func_enter_;
mask = mask >> 1;
} while (mask);
if (padapter->bSurpriseRemoved == true) {
- RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==true"));
+ pr_err("%s padapter->bSurpriseRemoved==true", DRIVER_PREFIX);
goto out;
}
x &= ~_EEDI;
@@ -73,7 +73,7 @@ u16 shift_in_bits(_adapter *padapter)
u16 x, d = 0, i;
_func_enter_;
if (padapter->bSurpriseRemoved == true) {
- RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==true"));
+ pr_err("%s padapter->bSurpriseRemoved==true", DRIVER_PREFIX);
goto out;
}
x = rtw_read8(padapter, EE_9346CR);
@@ -85,7 +85,7 @@ _func_enter_;
d = d << 1;
up_clk(padapter, &x);
if (padapter->bSurpriseRemoved == true) {
- RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==true"));
+ pr_err("%s padapter->bSurpriseRemoved==true", DRIVER_PREFIX);
goto out;
}
x = rtw_read8(padapter, EE_9346CR);
@@ -123,23 +123,23 @@ void eeprom_clean(_adapter *padapter)
u16 x;
_func_enter_;
if (padapter->bSurpriseRemoved == true) {
- RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==true"));
+ pr_err("%s padapter->bSurpriseRemoved==true", DRIVER_PREFIX);
goto out;
}
x = rtw_read8(padapter, EE_9346CR);
if (padapter->bSurpriseRemoved == true) {
- RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==true"));
+ pr_err("%s padapter->bSurpriseRemoved==true", DRIVER_PREFIX);
goto out;
}
x &= ~(_EECS | _EEDI);
rtw_write8(padapter, EE_9346CR, (u8)x);
if (padapter->bSurpriseRemoved == true) {
- RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==true"));
+ pr_err("%s padapter->bSurpriseRemoved==true", DRIVER_PREFIX);
goto out;
}
up_clk(padapter, &x);
- if (padapter->bSurpriseRemoved == true) {
- RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==true"));
+ if (padapter->bSurpriseRemoved == true) {
+ pr_err("%s padapter->bSurpriseRemoved==true", DRIVER_PREFIX);
goto out;
}
down_clk(padapter, &x);
@@ -156,14 +156,14 @@ u16 eeprom_read16(_adapter *padapter, u16 reg) /*ReadEEprom*/
_func_enter_;

if (padapter->bSurpriseRemoved == true) {
- RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==true"));
+ pr_err("%s padapter->bSurpriseRemoved==true", DRIVER_PREFIX);
goto out;
}
/* select EEPROM, reset bits, set _EECS*/
x = rtw_read8(padapter, EE_9346CR);

if (padapter->bSurpriseRemoved == true) {
- RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==true"));
+ pr_err("%s padapter->bSurpriseRemoved==true", DRIVER_PREFIX);
goto out;
}

--
2.20.1

2021-03-31 09:43:22

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 19/40] staging: rtl8723bs: remove commented RT_TRACE call in hal/rtl8723b_hal_init.c

remove commented RT_TRACE call in hal/rtl8723b_hal_init.c

Signed-off-by: Fabio Aiuto <[email protected]>
---
drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c | 7 -------
1 file changed, 7 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
index 7b92bc5ed1c7..e9d107093942 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
@@ -2656,7 +2656,6 @@ void Hal_EfuseParseEEPROMVer_8723B(
{
struct hal_com_data *pHalData = GET_HAL_DATA(padapter);

-/* RT_TRACE(_module_hci_hal_init_c_, _drv_notice_, ("%s(): AutoLoadFail = %d\n", __func__, AutoLoadFail)); */
if (!AutoLoadFail)
pHalData->EEPROMVersion = hwinfo[EEPROM_VERSION_8723B];
else
@@ -2739,7 +2738,6 @@ void Hal_EfuseParseCustomerID_8723B(
{
struct hal_com_data *pHalData = GET_HAL_DATA(padapter);

-/* RT_TRACE(_module_hci_hal_init_c_, _drv_notice_, ("%s(): AutoLoadFail = %d\n", __func__, AutoLoadFail)); */
if (!AutoLoadFail)
pHalData->EEPROMCustomerID = hwinfo[EEPROM_CustomID_8723B];
else
@@ -2762,7 +2760,6 @@ void Hal_EfuseParseXtal_8723B(
{
struct hal_com_data *pHalData = GET_HAL_DATA(padapter);

-/* RT_TRACE(_module_hci_hal_init_c_, _drv_notice_, ("%s(): AutoLoadFail = %d\n", __func__, AutoLoadFail)); */
if (!AutoLoadFail) {
pHalData->CrystalCap = hwinfo[EEPROM_XTAL_8723B];
if (pHalData->CrystalCap == 0xFF)
@@ -2780,7 +2777,6 @@ void Hal_EfuseParseThermalMeter_8723B(
{
struct hal_com_data *pHalData = GET_HAL_DATA(padapter);

-/* RT_TRACE(_module_hci_hal_init_c_, _drv_notice_, ("%s(): AutoLoadFail = %d\n", __func__, AutoLoadFail)); */
/* */
/* ThermalMeter from EEPROM */
/* */
@@ -3084,7 +3080,6 @@ static void rtl8723b_fill_default_txdesc(

ptxdesc->usb_txagg_num = pxmitframe->agg_num;
} else if (pxmitframe->frame_tag == MGNT_FRAMETAG) {
-/* RT_TRACE(_module_hal_xmit_c_, _drv_notice_, ("%s: MGNT_FRAMETAG\n", __func__)); */

ptxdesc->macid = pattrib->mac_id; /* CAM_ID(MAC_ID) */
ptxdesc->qsel = pattrib->qsel;
@@ -3868,9 +3863,7 @@ void SetHwReg8723B(struct adapter *padapter, u8 variable, u8 *val)
ulCommand = ulCommand | CAM_POLLINIG | CAM_WRITE;
/* write content 0 is equall to mark invalid */
rtw_write32(padapter, WCAMI, ulContent); /* mdelay(40); */
- /* RT_TRACE(COMP_SEC, DBG_LOUD, ("CAM_empty_entry(): WRITE A4: %lx\n", ulContent)); */
rtw_write32(padapter, RWCAM, ulCommand); /* mdelay(40); */
- /* RT_TRACE(COMP_SEC, DBG_LOUD, ("CAM_empty_entry(): WRITE A0: %lx\n", ulCommand)); */
}
}
break;
--
2.20.1

2021-03-31 09:43:28

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 23/40] staging: rtl8723bs: replace RT_TRACE with public printk wrappers in hal/rtl8723b_phycfg.c

replace private macro RT_TRACE for tracing with in-kernel
pr_* printk wrappers

Signed-off-by: Fabio Aiuto <[email protected]>
---
.../staging/rtl8723bs/hal/rtl8723b_phycfg.c | 48 +++++++++----------
1 file changed, 22 insertions(+), 26 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c b/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c
index 2abff4673be2..59a659b76995 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c
@@ -551,7 +551,7 @@ void PHY_SetTxPowerIndex(
break;
}
} else {
- RT_TRACE(_module_hal_init_c_, _drv_err_, ("Invalid RFPath!!\n"));
+ pr_err("%s Invalid RFPath!!\n", DRIVER_PREFIX);
}
}

@@ -604,11 +604,11 @@ void PHY_SetTxPowerLevel8723B(struct adapter *Adapter, u8 Channel)
RFPath = pHalData->ant_path;
}

- RT_TRACE(_module_hal_init_c_, _drv_info_, ("==>PHY_SetTxPowerLevel8723B()\n"));
+ pr_info("%s ==> %s\n", DRIVER_PREFIX, __func__);

PHY_SetTxPowerLevelByPath(Adapter, Channel, RFPath);

- RT_TRACE(_module_hal_init_c_, _drv_info_, ("<==PHY_SetTxPowerLevel8723B()\n"));
+ pr_info("%s <== %s\n", DRIVER_PREFIX, __func__);
}

void PHY_GetTxPowerLevel8723B(struct adapter *Adapter, s32 *powerlevel)
@@ -648,23 +648,20 @@ static u8 phy_GetSecondaryChnl_8723B(struct adapter *Adapter)
u8 SCSettingOf40 = 0, SCSettingOf20 = 0;
struct hal_com_data *pHalData = GET_HAL_DATA(Adapter);

- RT_TRACE(
- _module_hal_init_c_,
- _drv_info_,
- (
- "SCMapping: VHT Case: pHalData->CurrentChannelBW %d, pHalData->nCur80MhzPrimeSC %d, pHalData->nCur40MhzPrimeSC %d\n",
- pHalData->CurrentChannelBW,
- pHalData->nCur80MhzPrimeSC,
- pHalData->nCur40MhzPrimeSC
- )
- );
+ pr_info("%s SCMapping: VHT Case: pHalData->CurrentChannelBW %d, "
+ "pHalData->nCur80MhzPrimeSC %d, pHalData->nCur40MhzPrimeSC %d\n",
+ DRIVER_PREFIX,
+ pHalData->CurrentChannelBW,
+ pHalData->nCur80MhzPrimeSC,
+ pHalData->nCur40MhzPrimeSC);
+
if (pHalData->CurrentChannelBW == CHANNEL_WIDTH_80) {
if (pHalData->nCur80MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_LOWER)
SCSettingOf40 = VHT_DATA_SC_40_LOWER_OF_80MHZ;
else if (pHalData->nCur80MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_UPPER)
SCSettingOf40 = VHT_DATA_SC_40_UPPER_OF_80MHZ;
else
- RT_TRACE(_module_hal_init_c_, _drv_err_, ("SCMapping: Not Correct Primary40MHz Setting\n"));
+ pr_err("%s SCMapping: Not Correct Primary40MHz Setting\n", DRIVER_PREFIX);

if (
(pHalData->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_LOWER) &&
@@ -687,27 +684,26 @@ static u8 phy_GetSecondaryChnl_8723B(struct adapter *Adapter)
)
SCSettingOf20 = VHT_DATA_SC_20_UPPERST_OF_80MHZ;
else
- RT_TRACE(_module_hal_init_c_, _drv_err_, ("SCMapping: Not Correct Primary40MHz Setting\n"));
+ pr_err("%s SCMapping: Not Correct Primary40MHz Setting\n",
+ DRIVER_PREFIX);
} else if (pHalData->CurrentChannelBW == CHANNEL_WIDTH_40) {
- RT_TRACE(
- _module_hal_init_c_,
- _drv_info_,
- (
- "SCMapping: VHT Case: pHalData->CurrentChannelBW %d, pHalData->nCur40MhzPrimeSC %d\n",
- pHalData->CurrentChannelBW,
- pHalData->nCur40MhzPrimeSC
- )
- );
+ pr_info("%s SCMapping: VHT Case: pHalData->CurrentChannelBW %d, "
+ "pHalData->nCur40MhzPrimeSC %d\n",
+ DRIVER_PREFIX, pHalData->CurrentChannelBW,
+ pHalData->nCur40MhzPrimeSC);

if (pHalData->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_UPPER)
SCSettingOf20 = VHT_DATA_SC_20_UPPER_OF_80MHZ;
else if (pHalData->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_LOWER)
SCSettingOf20 = VHT_DATA_SC_20_LOWER_OF_80MHZ;
else
- RT_TRACE(_module_hal_init_c_, _drv_err_, ("SCMapping: Not Correct Primary40MHz Setting\n"));
+ pr_err("%s SCMapping: Not Correct Primary40MHz Setting\n",
+ DRIVER_PREFIX);
}

- RT_TRACE(_module_hal_init_c_, _drv_info_, ("SCMapping: SC Value %x\n", ((SCSettingOf40 << 4) | SCSettingOf20)));
+ pr_info("%s SCMapping: SC Value %x\n",
+ DRIVER_PREFIX, ((SCSettingOf40 << 4) | SCSettingOf20));
+
return (SCSettingOf40 << 4) | SCSettingOf20;
}

--
2.20.1

2021-03-31 09:43:28

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 22/40] staging: rtl8723bs: remove commented code block in hal/hal_com_phycfg.c

remove commented 5G code block in hal/hal_com_phycfg.c

Signed-off-by: Fabio Aiuto <[email protected]>
---
.../staging/rtl8723bs/hal/hal_com_phycfg.c | 20 -------------------
1 file changed, 20 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c b/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
index 9b16265b543d..a7ecdf501a14 100644
--- a/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
+++ b/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
@@ -1780,26 +1780,6 @@ s8 phy_get_tx_pwr_lmt(struct adapter *adapter, u32 reg_pwr_tbl_sel,
DBG_871X("No power limit table of the specified band\n");
}

- /* combine 5G VHT & HT rate */
- /* 5G 20M and 40M HT and VHT can cross reference */
- /*
- if (band_type == BAND_ON_5G && pwr_lmt == MAX_POWER_INDEX) {
- if (idx_bandwidth == 0 || idx_bandwidth == 1) {
- RT_TRACE(COMP_INIT, DBG_LOUD, ("No power limit table of the specified band %d, bandwidth %d, ratesection %d, rf path %d\n",
- idx_band, idx_bandwidth,
- idx_rate_sctn, rf_path));
- if (idx_rate_sctn == 2)
- pwr_lmt = hal_data->TxPwrLimit_5G[idx_regulation][idx_bandwidth][4][idx_channel][rf_path];
- else if (idx_rate_sctn == 4)
- pwr_lmt = hal_data->TxPwrLimit_5G[idx_regulation][idx_bandwidth][2][idx_channel][rf_path];
- else if (idx_rate_sctn == 3)
- pwr_lmt = hal_data->TxPwrLimit_5G[idx_regulation][idx_bandwidth][5][idx_channel][rf_path];
- else if (idx_rate_sctn == 5)
- pwr_lmt = hal_data->TxPwrLimit_5G[idx_regulation][idx_bandwidth][3][idx_channel][rf_path];
- }
- }
- */
-
/* DBG_871X("TxPwrLmt[Regulation %d][Band %d][BW %d][RFPath %d][Rate 0x%x][Chnl %d] = %d\n", */
/* idx_regulation, hal_data->CurrentBandType, bandwidth, rf_path, data_rate, channel, pwr_lmt); */
return pwr_lmt;
--
2.20.1

2021-03-31 09:43:28

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 21/40] staging: rtl8723bs: replace RT_TRACE with public printk wrappers in hal/sdio_ops.c

replace private macro RT_TRACE for tracing with in-kernel
pr_* printk wrappers

Signed-off-by: Fabio Aiuto <[email protected]>
---
drivers/staging/rtl8723bs/hal/sdio_ops.c | 42 ++++++++----------------
1 file changed, 13 insertions(+), 29 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/sdio_ops.c b/drivers/staging/rtl8723bs/hal/sdio_ops.c
index a24a39e70454..34531d6a6810 100644
--- a/drivers/staging/rtl8723bs/hal/sdio_ops.c
+++ b/drivers/staging/rtl8723bs/hal/sdio_ops.c
@@ -777,29 +777,15 @@ void EnableInterrupt8723BSdio(struct adapter *adapter)
himr = cpu_to_le32(haldata->sdio_himr);
sdio_local_write(adapter, SDIO_REG_HIMR, 4, (u8 *)&himr);

- RT_TRACE(
- _module_hci_ops_c_,
- _drv_notice_,
- (
- "%s: enable SDIO HIMR = 0x%08X\n",
- __func__,
- haldata->sdio_himr
- )
- );
+ pr_notice("%s %s: enable SDIO HIMR = 0x%08X\n",
+ DRIVER_PREFIX, __func__, haldata->sdio_himr);

/* Update current system IMR settings */
tmp = rtw_read32(adapter, REG_HSIMR);
rtw_write32(adapter, REG_HSIMR, tmp | haldata->SysIntrMask);

- RT_TRACE(
- _module_hci_ops_c_,
- _drv_notice_,
- (
- "%s: enable HSIMR = 0x%08X\n",
- __func__,
- haldata->SysIntrMask
- )
- );
+ pr_notice("%s %s: enable HSIMR = 0x%08X\n",
+ DRIVER_PREFIX, __func__, haldata->SysIntrMask);

/* */
/* <Roger_Notes> There are some C2H CMDs have been sent before system interrupt is enabled, e.g., C2H, CPWM. */
@@ -894,7 +880,7 @@ static struct recv_buf *sd_recv_rxfifo(struct adapter *adapter, u32 size)
readbuf = recvbuf->pskb->data;
ret = sdio_read_port(&adapter->iopriv.intf, WLAN_RX0FF_DEVICE_ID, readsize, readbuf);
if (ret == _FAIL) {
- RT_TRACE(_module_hci_ops_os_c_, _drv_err_, ("%s: read port FAIL!\n", __func__));
+ pr_err("%s %s: read port FAIL!\n", DRIVER_PREFIX, __func__);
return NULL;
}

@@ -1062,9 +1048,8 @@ void sd_int_hdl(struct adapter *adapter)

sd_int_dpc(adapter);
} else {
- RT_TRACE(_module_hci_ops_c_, _drv_err_,
- ("%s: HISR(0x%08x) and HIMR(0x%08x) not match!\n",
- __func__, hal->sdio_hisr, hal->sdio_himr));
+ pr_err("%s %s: HISR(0x%08x) and HIMR(0x%08x) not match!\n",
+ DRIVER_PREFIX, __func__, hal->sdio_hisr, hal->sdio_himr);
}
}

@@ -1088,13 +1073,12 @@ u8 HalQueryTxBufferStatus8723BSdio(struct adapter *adapter)
numof_free_page = SdioLocalCmd53Read4Byte(adapter, SDIO_REG_FREE_TXPG);

memcpy(hal->SdioTxFIFOFreePage, &numof_free_page, 4);
- RT_TRACE(_module_hci_ops_c_, _drv_notice_,
- ("%s: Free page for HIQ(%#x), MIDQ(%#x), LOWQ(%#x), PUBQ(%#x)\n",
- __func__,
- hal->SdioTxFIFOFreePage[HI_QUEUE_IDX],
- hal->SdioTxFIFOFreePage[MID_QUEUE_IDX],
- hal->SdioTxFIFOFreePage[LOW_QUEUE_IDX],
- hal->SdioTxFIFOFreePage[PUBLIC_QUEUE_IDX]));
+ pr_notice("%s %s: Free page for HIQ(%#x), MIDQ(%#x), LOWQ(%#x), PUBQ(%#x)\n",
+ DRIVER_PREFIX, __func__,
+ hal->SdioTxFIFOFreePage[HI_QUEUE_IDX],
+ hal->SdioTxFIFOFreePage[MID_QUEUE_IDX],
+ hal->SdioTxFIFOFreePage[LOW_QUEUE_IDX],
+ hal->SdioTxFIFOFreePage[PUBLIC_QUEUE_IDX]);

return true;
}
--
2.20.1

2021-03-31 09:43:39

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 26/40] staging: rtl8723bs: replace RT_TRACE with public printk wrappers in hal/sdio_halinit.c

replace private macro RT_TRACE for tracing with in-kernel
pr_* printk wrappers

Signed-off-by: Fabio Aiuto <[email protected]>
---
drivers/staging/rtl8723bs/hal/sdio_halinit.c | 49 ++++++++++----------
1 file changed, 24 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/sdio_halinit.c b/drivers/staging/rtl8723bs/hal/sdio_halinit.c
index b1c4bbf29790..281713b4d5c9 100644
--- a/drivers/staging/rtl8723bs/hal/sdio_halinit.c
+++ b/drivers/staging/rtl8723bs/hal/sdio_halinit.c
@@ -57,11 +57,7 @@ u8 _InitPowerOn_8723BS(struct adapter *padapter)
/* only cmd52 can be used before power on(card enable) */
ret = CardEnable(padapter);
if (!ret) {
- RT_TRACE(
- _module_hci_hal_init_c_,
- _drv_emerg_,
- ("%s: run power on flow fail\n", __func__)
- );
+ pr_emerg("%s %s: run power on flow fail\n", DRIVER_PREFIX, __func__);
return _FAIL;
}

@@ -680,7 +676,7 @@ static u32 rtl8723bs_hal_init(struct adapter *padapter)

ret = _InitPowerOn_8723BS(padapter);
if (_FAIL == ret) {
- RT_TRACE(_module_hci_hal_init_c_, _drv_err_, ("Failed to init Power On!\n"));
+ pr_err("%s Failed to init Power On!\n", DRIVER_PREFIX);
return _FAIL;
}

@@ -688,12 +684,13 @@ static u32 rtl8723bs_hal_init(struct adapter *padapter)

ret = rtl8723b_FirmwareDownload(padapter, false);
if (ret != _SUCCESS) {
- RT_TRACE(_module_hci_hal_init_c_, _drv_err_, ("%s: Download Firmware failed!!\n", __func__));
+ pr_err("%s %s: Download Firmware failed!!\n", DRIVER_PREFIX, __func__);
padapter->bFWReady = false;
pHalData->fw_ractrl = false;
return ret;
} else {
- RT_TRACE(_module_hci_hal_init_c_, _drv_notice_, ("rtl8723bs_hal_init(): Download Firmware Success!!\n"));
+ pr_notice("%s %s: Download Firmware Success!!\n",
+ DRIVER_PREFIX, __func__);
padapter->bFWReady = true;
pHalData->fw_ractrl = true;
}
@@ -719,7 +716,8 @@ static u32 rtl8723bs_hal_init(struct adapter *padapter)
#if (HAL_MAC_ENABLE == 1)
ret = PHY_MACConfig8723B(padapter);
if (ret != _SUCCESS) {
- RT_TRACE(_module_hci_hal_init_c_, _drv_info_, ("Initializepadapter8192CSdio(): Fail to configure MAC!!\n"));
+ pr_info("%s Initializepadapter8192CSdio(): Fail to configure MAC!!\n",
+ DRIVER_PREFIX);
return ret;
}
#endif
@@ -729,7 +727,8 @@ static u32 rtl8723bs_hal_init(struct adapter *padapter)
#if (HAL_BB_ENABLE == 1)
ret = PHY_BBConfig8723B(padapter);
if (ret != _SUCCESS) {
- RT_TRACE(_module_hci_hal_init_c_, _drv_info_, ("Initializepadapter8192CSdio(): Fail to configure BB!!\n"));
+ pr_info("%s Initializepadapter8192CSdio(): Fail to configure BB!!\n",
+ DRIVER_PREFIX);
return ret;
}
#endif
@@ -741,7 +740,8 @@ static u32 rtl8723bs_hal_init(struct adapter *padapter)
#if (HAL_RF_ENABLE == 1)
ret = PHY_RFConfig8723B(padapter);
if (ret != _SUCCESS) {
- RT_TRACE(_module_hci_hal_init_c_, _drv_info_, ("Initializepadapter8192CSdio(): Fail to configure RF!!\n"));
+ pr_info("%s Initializepadapter8192CSdio(): Fail to configure RF!!\n",
+ DRIVER_PREFIX);
return ret;
}
#endif
@@ -893,7 +893,7 @@ static u32 rtl8723bs_hal_init(struct adapter *padapter)
/* Init BT hw config. */
hal_btcoex_InitHwConfig(padapter, false);

- RT_TRACE(_module_hci_hal_init_c_, _drv_info_, ("-%s\n", __func__));
+ pr_info("%s-%s\n", DRIVER_PREFIX, __func__);

return _SUCCESS;
}
@@ -1030,9 +1030,9 @@ static u32 rtl8723bs_inirp_init(struct adapter *padapter)

static u32 rtl8723bs_inirp_deinit(struct adapter *padapter)
{
- RT_TRACE(_module_hci_hal_init_c_, _drv_info_, ("+rtl8723bs_inirp_deinit\n"));
+ pr_info("%s+%s\n", DRIVER_PREFIX, __func__);

- RT_TRACE(_module_hci_hal_init_c_, _drv_info_, ("-rtl8723bs_inirp_deinit\n"));
+ pr_info("%s-%s\n", DRIVER_PREFIX, __func__);

return _SUCCESS;
}
@@ -1132,8 +1132,8 @@ static void Hal_EfuseParseMACAddr_8723BS(
}
/* NicIFSetMacAddress(padapter, padapter->PermanentAddress); */

- RT_TRACE(_module_hci_hal_init_c_, _drv_notice_,
- ("Hal_EfuseParseMACAddr_8723BS: Permanent Address = %pM\n", pEEPROM->mac_addr));
+ pr_notice("%s %s: Permanent Address = %pM\n", DRIVER_PREFIX, __func__,
+ pEEPROM->mac_addr);
}

static void Hal_EfuseParseBoardType_8723BS(
@@ -1148,7 +1148,7 @@ static void Hal_EfuseParseBoardType_8723BS(
pHalData->BoardType = (EEPROM_DEFAULT_BOARD_OPTION & 0xE0) >> 5;
} else
pHalData->BoardType = 0;
- RT_TRACE(_module_hci_hal_init_c_, _drv_info_, ("Board Type: 0x%2x\n", pHalData->BoardType));
+ pr_info("%s Board Type: 0x%2x\n", DRIVER_PREFIX, pHalData->BoardType);
}

static void _ReadEfuseInfo8723BS(struct adapter *padapter)
@@ -1156,7 +1156,7 @@ static void _ReadEfuseInfo8723BS(struct adapter *padapter)
struct eeprom_priv *pEEPROM = GET_EEPROM_EFUSE_PRIV(padapter);
u8 *hwinfo = NULL;

- RT_TRACE(_module_hci_hal_init_c_, _drv_info_, ("====>_ReadEfuseInfo8723BS()\n"));
+ pr_info("%s ====> %s\n", DRIVER_PREFIX, __func__);

/* */
/* This part read and parse the eeprom/efuse content */
@@ -1192,7 +1192,7 @@ static void _ReadEfuseInfo8723BS(struct adapter *padapter)

Hal_ReadRFGainOffset(padapter, hwinfo, pEEPROM->bautoload_fail_flag);

- RT_TRACE(_module_hci_hal_init_c_, _drv_info_, ("<==== _ReadEfuseInfo8723BS()\n"));
+ pr_info("%s <==== %s\n", DRIVER_PREFIX, __func__);
}

static void _ReadPROMContent(struct adapter *padapter)
@@ -1205,11 +1205,10 @@ static void _ReadPROMContent(struct adapter *padapter)
pEEPROM->EepromOrEfuse = (eeValue & BOOT_FROM_EEPROM) ? true : false;
pEEPROM->bautoload_fail_flag = (eeValue & EEPROM_EN) ? false : true;

- RT_TRACE(_module_hci_hal_init_c_, _drv_info_,
- ("%s: 9346CR = 0x%02X, Boot from %s, Autoload %s\n",
- __func__, eeValue,
- (pEEPROM->EepromOrEfuse ? "EEPROM" : "EFUSE"),
- (pEEPROM->bautoload_fail_flag ? "Fail" : "OK")));
+ pr_info("%s %s: 9346CR = 0x%02X, Boot from %s, Autoload %s\n",
+ DRIVER_PREFIX, __func__, eeValue,
+ (pEEPROM->EepromOrEfuse ? "EEPROM" : "EFUSE"),
+ (pEEPROM->bautoload_fail_flag ? "Fail" : "OK"));

/* pHalData->EEType = IS_BOOT_FROM_EEPROM(Adapter) ? EEPROM_93C46 : EEPROM_BOOT_EFUSE; */

@@ -1233,7 +1232,7 @@ static s32 _ReadAdapterInfo8723BS(struct adapter *padapter)
u8 val8;
unsigned long start;

- RT_TRACE(_module_hci_hal_init_c_, _drv_info_, ("+_ReadAdapterInfo8723BS\n"));
+ pr_info("%s+%s\n", DRIVER_PREFIX, __func__);

/* before access eFuse, make sure card enable has been called */
if (!padapter->hw_init_completed)
--
2.20.1

2021-03-31 09:43:55

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 29/40] staging: rtl8723bs: remove commented RT_TRACE calls in hal/rtl8723b_rf6052.c

remove commented RT_TRACE calls in hal/rtl8723b_rf6052.c

Signed-off-by: Fabio Aiuto <[email protected]>
---
drivers/staging/rtl8723bs/hal/rtl8723b_rf6052.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_rf6052.c b/drivers/staging/rtl8723bs/hal/rtl8723b_rf6052.c
index 73b47f053549..38228b46b1ee 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723b_rf6052.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723b_rf6052.c
@@ -74,7 +74,6 @@ void PHY_RF6052SetBandwidth8723B(
break;

default:
- /* RT_TRACE(COMP_DBG, DBG_LOUD, ("PHY_SetRF8225Bandwidth(): unknown Bandwidth: %#X\n", Bandwidth)); */
break;
}

@@ -153,7 +152,6 @@ static int phy_RF6052_Config_ParaFile(struct adapter *Adapter)

ODM_ConfigRFWithTxPwrTrackHeaderFile(&pHalData->odmpriv);

- /* RT_TRACE(COMP_INIT, DBG_LOUD, ("<---phy_RF6052_Config_ParaFile()\n")); */
return _SUCCESS;
}

--
2.20.1

2021-03-31 09:44:09

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 30/40] staging: rtl8723bs: remove commented RT_TRACE calls in os_dep/ioctl_linux.c

remove commented RT_TRACE calls in os_dep/ioctl_linux.c

Signed-off-by: Fabio Aiuto <[email protected]>
---
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 6 ------
1 file changed, 6 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
index 354441e6a667..aee4932162a9 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
@@ -4231,7 +4231,6 @@ static int rtw_wx_set_priv(struct net_device *dev,
struct adapter *padapter = rtw_netdev_priv(dev);
struct iw_point *dwrq = (struct iw_point *)awrq;

- /* RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_notice_, ("+rtw_wx_set_priv\n")); */
if (dwrq->length == 0)
return -EFAULT;

@@ -4245,11 +4244,6 @@ static int rtw_wx_set_priv(struct net_device *dev,
return -EFAULT;
}

-
- /* RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_notice_, */
- /* ("rtw_wx_set_priv: %s req =%s\n", */
- /* dev->name, ext)); */
-
#ifdef DEBUG_RTW_WX_SET_PRIV
ext_dbg = vmalloc(len);
if (!ext_dbg) {
--
2.20.1

2021-03-31 09:44:11

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 31/40] staging: rtl8723bs: replace RT_TRACE with public printk wrappers in os_dep/ioctl_linux.c

replace private macro RT_TRACE for tracing with in-kernel
pr_* printk wrappers

Signed-off-by: Fabio Aiuto <[email protected]>
---
.../staging/rtl8723bs/os_dep/ioctl_linux.c | 81 ++++++++++---------
1 file changed, 44 insertions(+), 37 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
index aee4932162a9..c67064ddc88a 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
@@ -232,8 +232,10 @@ static char *translate_scan(struct adapter *padapter,
u16 wpa_len = 0, rsn_len = 0;
u8 *p;
rtw_get_sec_ie(pnetwork->network.IEs, pnetwork->network.IELength, rsn_ie, &rsn_len, wpa_ie, &wpa_len);
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_wx_get_scan: ssid =%s\n", pnetwork->network.Ssid.Ssid));
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_wx_get_scan: wpa_len =%d rsn_len =%d\n", wpa_len, rsn_len));
+ pr_info("%s rtw_wx_get_scan: ssid =%s\n", DRIVER_PREFIX,
+ pnetwork->network.Ssid.Ssid);
+ pr_info("%s rtw_wx_get_scan: wpa_len =%d rsn_len =%d\n",
+ DRIVER_PREFIX, wpa_len, rsn_len);

buf = kzalloc(MAX_WPA_IE_LEN*2, GFP_ATOMIC);
if (!buf)
@@ -423,7 +425,7 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param,
}

if (strcmp(param->u.crypt.alg, "WEP") == 0) {
- RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_err_, ("wpa_set_encryption, crypt.alg = WEP\n"));
+ pr_err("%s %s, crypt.alg = WEP\n", DRIVER_PREFIX, __func__);
DBG_871X("wpa_set_encryption, crypt.alg = WEP\n");

padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled;
@@ -433,20 +435,21 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param,
wep_key_idx = param->u.crypt.idx;
wep_key_len = param->u.crypt.key_len;

- RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_info_, ("(1)wep_key_idx =%d\n", wep_key_idx));
+ pr_info("%s (1)wep_key_idx =%d\n", DRIVER_PREFIX, wep_key_idx);
DBG_871X("(1)wep_key_idx =%d\n", wep_key_idx);

if (wep_key_idx > WEP_KEYS)
return -EINVAL;

- RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_info_, ("(2)wep_key_idx =%d\n", wep_key_idx));
+ pr_info("%s (2)wep_key_idx =%d\n", DRIVER_PREFIX, wep_key_idx);

if (wep_key_len > 0) {
wep_key_len = wep_key_len <= 5 ? 5 : 13;
wep_total_len = wep_key_len + FIELD_OFFSET(struct ndis_802_11_wep, KeyMaterial);
pwep = kzalloc(wep_total_len, GFP_KERNEL);
if (pwep == NULL) {
- RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_err_, (" wpa_set_encryption: pwep allocate fail !!!\n"));
+ pr_err("%s %s: pwep allocate fail !!!\n",
+ DRIVER_PREFIX, __func__);
goto exit;
}

@@ -612,7 +615,7 @@ static int rtw_set_wpa_ie(struct adapter *padapter, char *pie, unsigned short ie
}

if (ielen < RSN_HEADER_LEN) {
- RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_err_, ("Ie len too short %d\n", ielen));
+ pr_err("%s Ie len too short %d\n", DRIVER_PREFIX, ielen);
ret = -1;
goto exit;
}
@@ -715,9 +718,12 @@ static int rtw_set_wpa_ie(struct adapter *padapter, char *pie, unsigned short ie
/* check_fwstate(&padapter->mlmepriv, WIFI_UNDER_WPS) == true) */
rtw_hal_set_hwreg(padapter, HW_VAR_OFF_RCR_AM, null_addr);

- RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_info_,
- ("rtw_set_wpa_ie: pairwise_cipher = 0x%08x padapter->securitypriv.ndisencryptstatus =%d padapter->securitypriv.ndisauthtype =%d\n",
- pairwise_cipher, padapter->securitypriv.ndisencryptstatus, padapter->securitypriv.ndisauthtype));
+ pr_info("%s %s: pairwise_cipher = 0x%08x "
+ "padapter->securitypriv.ndisencryptstatus =%d "
+ "padapter->securitypriv.ndisauthtype =%d\n",
+ DRIVER_PREFIX, __func__, pairwise_cipher,
+ padapter->securitypriv.ndisencryptstatus,
+ padapter->securitypriv.ndisauthtype);

exit:

@@ -738,7 +744,7 @@ static int rtw_wx_get_name(struct net_device *dev,
struct wlan_bssid_ex *pcur_bss = &pmlmepriv->cur_network.network;
NDIS_802_11_RATES_EX *prates = NULL;

- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("cmd_code =%x\n", info->cmd));
+ pr_info("%s cmd_code =%x\n", DRIVER_PREFIX, info->cmd);

if (check_fwstate(pmlmepriv, _FW_LINKED|WIFI_ADHOC_MASTER_STATE) == true) {
/* parsing HT_CAP_IE */
@@ -785,7 +791,7 @@ static int rtw_wx_set_freq(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra)
{
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_notice_, ("+rtw_wx_set_freq\n"));
+ pr_notice("%s+%s\n", DRIVER_PREFIX, __func__);

return 0;
}
@@ -850,7 +856,8 @@ static int rtw_wx_set_mode(struct net_device *dev, struct iw_request_info *a,
break;
default:
ret = -EINVAL;
- RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_err_, ("\n Mode: %s is not supported \n", iw_operation_mode[wrqu->mode]));
+ pr_err("%s Mode: %s is not supported\n", DRIVER_PREFIX,
+ iw_operation_mode[wrqu->mode]);
goto exit;
}

@@ -884,7 +891,7 @@ static int rtw_wx_get_mode(struct net_device *dev, struct iw_request_info *a,
struct adapter *padapter = rtw_netdev_priv(dev);
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);

- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, (" rtw_wx_get_mode\n"));
+ pr_info("%s %s\n", DRIVER_PREFIX, __func__);

if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) {
wrqu->mode = IW_MODE_INFRA;
@@ -999,7 +1006,7 @@ static int rtw_wx_get_range(struct net_device *dev,
u16 val;
int i;

- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_wx_get_range. cmd_code =%x\n", info->cmd));
+ pr_info("%s %s. cmd_code =%x\n", DRIVER_PREFIX, __func__, info->cmd);

wrqu->data.length = sizeof(*range);
memset(range, 0, sizeof(*range));
@@ -1178,7 +1185,7 @@ static int rtw_wx_get_wap(struct net_device *dev,

eth_zero_addr(wrqu->ap_addr.sa_data);

- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_wx_get_wap\n"));
+ pr_info("%s %s\n", DRIVER_PREFIX, __func__);

if (((check_fwstate(pmlmepriv, _FW_LINKED)) == true) ||
((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) == true) ||
@@ -1232,7 +1239,7 @@ static int rtw_wx_set_scan(struct net_device *dev, struct iw_request_info *a,
struct adapter *padapter = rtw_netdev_priv(dev);
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct ndis_802_11_ssid ssid[RTW_SSID_SCAN_AMOUNT];
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_wx_set_scan\n"));
+ pr_info("%s %s\n", DRIVER_PREFIX, __func__);

#ifdef DBG_IOCTL
DBG_871X("DBG_IOCTL %s:%d\n", __func__, __LINE__);
@@ -1393,8 +1400,8 @@ static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a,
u32 ret = 0;
signed int wait_status;

- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_wx_get_scan\n"));
- RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_info_, (" Start of Query SIOCGIWSCAN .\n"));
+ pr_info("%s %s\n", DRIVER_PREFIX, __func__);
+ pr_info("%s Start of Query SIOCGIWSCAN .\n", DRIVER_PREFIX);

#ifdef DBG_IOCTL
DBG_871X("DBG_IOCTL %s:%d\n", __func__, __LINE__);
@@ -1477,8 +1484,8 @@ static int rtw_wx_set_essid(struct net_device *dev,
DBG_871X("DBG_IOCTL %s:%d\n", __func__, __LINE__);
#endif

- RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_info_,
- ("+rtw_wx_set_essid: fw_state = 0x%08x\n", get_fwstate(pmlmepriv)));
+ pr_info("%s+%s: fw_state = 0x%08x\n", DRIVER_PREFIX, __func__,
+ get_fwstate(pmlmepriv));

rtw_ps_deny(padapter, PS_DENY_JOIN);
if (_FAIL == rtw_pwr_wakeup(padapter)) {
@@ -1513,15 +1520,15 @@ static int rtw_wx_set_essid(struct net_device *dev,
memcpy(ndis_ssid.Ssid, extra, len);
src_ssid = ndis_ssid.Ssid;

- RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_info_, ("rtw_wx_set_essid: ssid =[%s]\n", src_ssid));
+ pr_info("%s %s: ssid =[%s]\n", DRIVER_PREFIX, __func__, src_ssid);
spin_lock_bh(&queue->lock);
phead = get_list_head(queue);
pmlmepriv->pscanned = get_next(phead);

while (1) {
if (phead == pmlmepriv->pscanned) {
- RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_warning_,
- ("rtw_wx_set_essid: scan_q is empty, set ssid to check if scanning again!\n"));
+ pr_warn("%s %s: scan_q is empty, set ssid to check if scanning again!\n",
+ DRIVER_PREFIX, __func__);

break;
}
@@ -1532,14 +1539,13 @@ static int rtw_wx_set_essid(struct net_device *dev,

dst_ssid = pnetwork->network.Ssid.Ssid;

- RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_info_,
- ("rtw_wx_set_essid: dst_ssid =%s\n",
- pnetwork->network.Ssid.Ssid));
+ pr_info("%s %s: dst_ssid =%s\n", DRIVER_PREFIX, __func__,
+ pnetwork->network.Ssid.Ssid);

if ((!memcmp(dst_ssid, src_ssid, ndis_ssid.SsidLength)) &&
(pnetwork->network.Ssid.SsidLength == ndis_ssid.SsidLength)) {
- RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_info_,
- ("rtw_wx_set_essid: find match, set infra mode\n"));
+ pr_info("%s %s: find match, set infra mode\n",
+ DRIVER_PREFIX, __func__);

if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) {
if (pnetwork->network.InfrastructureMode != pmlmepriv->cur_network.network.InfrastructureMode)
@@ -1556,8 +1562,7 @@ static int rtw_wx_set_essid(struct net_device *dev,
}
}
spin_unlock_bh(&queue->lock);
- RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_info_,
- ("set ssid: set_802_11_auth. mode =%d\n", authmode));
+ pr_info("%s set ssid: set_802_11_auth. mode =%d\n", DRIVER_PREFIX, authmode);
rtw_set_802_11_authentication_mode(padapter, authmode);
/* set_802_11_encryption_mode(padapter, padapter->securitypriv.ndisencryptstatus); */
if (rtw_set_802_11_ssid(padapter, &ndis_ssid) == false) {
@@ -1588,7 +1593,7 @@ static int rtw_wx_get_essid(struct net_device *dev,
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
struct wlan_bssid_ex *pcur_bss = &pmlmepriv->cur_network.network;

- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_wx_get_essid\n"));
+ pr_info("%s %s\n", DRIVER_PREFIX, __func__);

if ((check_fwstate(pmlmepriv, _FW_LINKED) == true) ||
(check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true)) {
@@ -1620,8 +1625,9 @@ static int rtw_wx_set_rate(struct net_device *dev,
u32 ratevalue = 0;
u8 mpdatarate[NumRates] = {11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0xff};

- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, (" rtw_wx_set_rate\n"));
- RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_info_, ("target_rate = %d, fixed = %d\n", target_rate, fixed));
+ pr_info("%s %s\n", DRIVER_PREFIX, __func__);
+ pr_info("%s target_rate = %d, fixed = %d\n", DRIVER_PREFIX,
+ target_rate, fixed);

if (target_rate == -1) {
ratevalue = 11;
@@ -1682,11 +1688,11 @@ static int rtw_wx_set_rate(struct net_device *dev,
datarates[i] = 0xff;
}

- RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_info_, ("datarate_inx =%d\n", datarates[i]));
+ pr_info("%s datarate_inx =%d\n", DRIVER_PREFIX, datarates[i]);
}

if (rtw_setdatarate_cmd(padapter, datarates) != _SUCCESS) {
- RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_err_, ("rtw_wx_set_rate Fail!!!\n"));
+ pr_err("%s %s Fail!!!\n", DRIVER_PREFIX, __func__);
ret = -1;
}
return ret;
@@ -3180,7 +3186,8 @@ static int wpa_set_param(struct net_device *dev, u8 name, u32 value)
break;
}

- RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_info_, ("wpa_set_param:padapter->securitypriv.ndisauthtype =%d\n", padapter->securitypriv.ndisauthtype));
+ pr_info("%s %s:padapter->securitypriv.ndisauthtype =%d\n",
+ DRIVER_PREFIX, __func__, padapter->securitypriv.ndisauthtype);

break;

--
2.20.1

2021-03-31 09:44:13

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 34/40] staging: rtl8723bs: replace RT_TRACE with public printk wrappers in os_dep/ioctl_cfg80211.c

replace private macro RT_TRACE for tracing with in-kernel
pr_* printk wrappers

Signed-off-by: Fabio Aiuto <[email protected]>
---
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
index 260d9fa739ef..6df2f1e12bd3 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
@@ -875,7 +875,7 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, struct ieee_param

if (strcmp(param->u.crypt.alg, "WEP") == 0)
{
- RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_err_, ("wpa_set_encryption, crypt.alg = WEP\n"));
+ pr_err("%s wpa_set_encryption, crypt.alg = WEP\n", DRIVER_PREFIX);
DBG_8192C("wpa_set_encryption, crypt.alg = WEP\n");

wep_key_idx = param->u.crypt.idx;
@@ -1797,7 +1797,7 @@ static int rtw_cfg80211_set_wpa_ie(struct adapter *padapter, u8 *pie, size_t iel
}

if (ielen < RSN_HEADER_LEN) {
- RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_err_, ("Ie len too short %ld\n", ielen));
+ pr_err("%s Ie len too short %ld\n", DRIVER_PREFIX, ielen);
ret = -1;
goto exit;
}
@@ -1901,9 +1901,13 @@ static int rtw_cfg80211_set_wpa_ie(struct adapter *padapter, u8 *pie, size_t iel
/* check_fwstate(&padapter->mlmepriv, WIFI_UNDER_WPS) == true) */
rtw_hal_set_hwreg(padapter, HW_VAR_OFF_RCR_AM, null_addr);

- RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_info_,
- ("rtw_set_wpa_ie: pairwise_cipher = 0x%08x padapter->securitypriv.ndisencryptstatus =%d padapter->securitypriv.ndisauthtype =%d\n",
- pairwise_cipher, padapter->securitypriv.ndisencryptstatus, padapter->securitypriv.ndisauthtype));
+ pr_info("%s rtw_set_wpa_ie: pairwise_cipher = 0x%08x "
+ "padapter->securitypriv.ndisencryptstatus =%d "
+ "padapter->securitypriv.ndisauthtype =%d\n",
+ DRIVER_PREFIX,
+ pairwise_cipher,
+ padapter->securitypriv.ndisencryptstatus,
+ padapter->securitypriv.ndisauthtype);

exit:
kfree(buf);
--
2.20.1

2021-03-31 09:44:19

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 33/40] staging: rtl8723bs: fix string format in os_dep/ioctl_cfg80211.c

fix string format in log message in os_dep/ioctl_cfg80211.c

Signed-off-by: Fabio Aiuto <[email protected]>
---
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
index 4f6398f86b75..260d9fa739ef 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
@@ -1797,7 +1797,7 @@ static int rtw_cfg80211_set_wpa_ie(struct adapter *padapter, u8 *pie, size_t iel
}

if (ielen < RSN_HEADER_LEN) {
- RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_err_, ("Ie len too short %d\n", ielen));
+ RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_err_, ("Ie len too short %ld\n", ielen));
ret = -1;
goto exit;
}
--
2.20.1

2021-03-31 09:44:19

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 14/40] staging: rtl8723bs: replace RT_TRACE with public printk wrappers in core/rtw_sta_mgt.c

replace private macro RT_TRACE for tracing with in-kernel
pr_* printk wrappers

Signed-off-by: Fabio Aiuto <[email protected]>
---
drivers/staging/rtl8723bs/core/rtw_sta_mgt.c | 45 ++++++++++----------
1 file changed, 22 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
index f96dd0b40e04..7febeff7308d 100644
--- a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
+++ b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
@@ -216,10 +216,11 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)

index = wifi_mac_hash(hwaddr);

- RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_info_, ("rtw_alloc_stainfo: index = %x", index));
+ pr_info("%s %s: index = %x", DRIVER_PREFIX, __func__, index);

if (index >= NUM_STA) {
- RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_err_, ("ERROR => rtw_alloc_stainfo: index >= NUM_STA"));
+ pr_err("%s ERROR => %s: index >= NUM_STA",
+ DRIVER_PREFIX, __func__);
spin_unlock_bh(&(pstapriv->sta_hash_lock));
psta = NULL;
goto exit;
@@ -242,16 +243,15 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
for (i = 0; i < 16; i++)
memcpy(&psta->sta_recvpriv.rxcache.tid_rxseq[i], &wRxSeqInitialValue, 2);

- RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_info_,
- ("alloc number_%d stainfo with hwaddr = %x %x %x %x %x %x \n",
- pstapriv->asoc_sta_count,
- hwaddr[0],
- hwaddr[1],
- hwaddr[2],
- hwaddr[3],
- hwaddr[4],
- hwaddr[5])
- );
+ pr_info("%s alloc number_%d stainfo with hwaddr = %x %x %x %x %x %x\n",
+ DRIVER_PREFIX,
+ pstapriv->asoc_sta_count,
+ hwaddr[0],
+ hwaddr[1],
+ hwaddr[2],
+ hwaddr[3],
+ hwaddr[4],
+ hwaddr[5]);

init_addba_retry_timer(pstapriv->padapter, psta);

@@ -363,16 +363,15 @@ u32 rtw_free_stainfo(struct adapter *padapter, struct sta_info *psta)
spin_unlock_bh(&pxmitpriv->lock);

list_del_init(&psta->hash_list);
- RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_err_,
- ("\n free number_%d stainfo with hwaddr = 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x \n",
- pstapriv->asoc_sta_count,
- psta->hwaddr[0],
- psta->hwaddr[1],
- psta->hwaddr[2],
- psta->hwaddr[3],
- psta->hwaddr[4],
- psta->hwaddr[5])
- );
+ pr_err("%s free number_%d stainfo with hwaddr = 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x\n",
+ DRIVER_PREFIX,
+ pstapriv->asoc_sta_count,
+ psta->hwaddr[0],
+ psta->hwaddr[1],
+ psta->hwaddr[2],
+ psta->hwaddr[3],
+ psta->hwaddr[4],
+ psta->hwaddr[5]);
pstapriv->asoc_sta_count--;

/* re-init sta_info; 20061114 will be init in alloc_stainfo */
@@ -543,7 +542,7 @@ u32 rtw_init_bcmc_stainfo(struct adapter *padapter)

if (!psta) {
res = _FAIL;
- RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_err_, ("rtw_alloc_stainfo fail"));
+ pr_err("%s rtw_alloc_stainfo fail", DRIVER_PREFIX);
goto exit;
}

--
2.20.1

2021-03-31 09:44:20

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 36/40] staging: rtl8723bs: replace RT_TRACE with public printk wrappers in os_dep/recv_linux.c

replace private macro RT_TRACE for tracing with in-kernel
pr_* printk wrappers

Signed-off-by: Fabio Aiuto <[email protected]>
---
drivers/staging/rtl8723bs/os_dep/recv_linux.c | 22 ++++++++++++++-----
1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/recv_linux.c b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
index fbdbcd04d44a..5e1ee9783c32 100644
--- a/drivers/staging/rtl8723bs/os_dep/recv_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
@@ -202,13 +202,19 @@ int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame

skb = precv_frame->u.hdr.pkt;
if (skb == NULL) {
- RT_TRACE(_module_recv_osdep_c_, _drv_err_, ("rtw_recv_indicatepkt():skb == NULL something wrong!!!!\n"));
+ pr_err("%s %s:skb == NULL something wrong!!!!\n",
+ DRIVER_PREFIX, __func__);
goto _recv_indicatepkt_drop;
}

- RT_TRACE(_module_recv_osdep_c_, _drv_info_, ("rtw_recv_indicatepkt():skb != NULL !!!\n"));
- RT_TRACE(_module_recv_osdep_c_, _drv_info_, ("rtw_recv_indicatepkt():precv_frame->u.hdr.rx_head =%p precv_frame->hdr.rx_data =%p\n", precv_frame->u.hdr.rx_head, precv_frame->u.hdr.rx_data));
- RT_TRACE(_module_recv_osdep_c_, _drv_info_, ("precv_frame->hdr.rx_tail =%p precv_frame->u.hdr.rx_end =%p precv_frame->hdr.len =%d\n", precv_frame->u.hdr.rx_tail, precv_frame->u.hdr.rx_end, precv_frame->u.hdr.len));
+ pr_info("%s %s:skb != NULL !!!\n", DRIVER_PREFIX, __func__);
+ pr_info("%s %s:precv_frame->u.hdr.rx_head =%p "
+ "precv_frame->hdr.rx_data =%p\n", DRIVER_PREFIX, __func__,
+ precv_frame->u.hdr.rx_head, precv_frame->u.hdr.rx_data);
+ pr_info("%s precv_frame->hdr.rx_tail =%p precv_frame->u.hdr.rx_end =%p "
+ "precv_frame->hdr.len =%d\n", DRIVER_PREFIX,
+ precv_frame->u.hdr.rx_tail, precv_frame->u.hdr.rx_end,
+ precv_frame->u.hdr.len);

skb->data = precv_frame->u.hdr.rx_data;

@@ -216,7 +222,10 @@ int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame

skb->len = precv_frame->u.hdr.len;

- RT_TRACE(_module_recv_osdep_c_, _drv_info_, ("\n skb->head =%p skb->data =%p skb->tail =%p skb->end =%p skb->len =%d\n", skb->head, skb->data, skb_tail_pointer(skb), skb_end_pointer(skb), skb->len));
+ pr_info("%s skb->head =%p skb->data =%p skb->tail =%p "
+ "skb->end =%p skb->len =%d\n", DRIVER_PREFIX,
+ skb->head, skb->data, skb_tail_pointer(skb),
+ skb_end_pointer(skb), skb->len);

rtw_os_recv_indicate_pkt(padapter, skb, pattrib);

@@ -225,7 +234,8 @@ int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame

rtw_free_recvframe(precv_frame, pfree_recv_queue);

- RT_TRACE(_module_recv_osdep_c_, _drv_info_, ("\n rtw_recv_indicatepkt :after rtw_os_recv_indicate_pkt!!!!\n"));
+ pr_info("%s %s: after rtw_os_recv_indicate_pkt!!!!\n",
+ DRIVER_PREFIX, __func__);

return _SUCCESS;

--
2.20.1

2021-03-31 09:44:24

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 25/40] staging: rtl8723bs: replace RT_TRACE with public printk wrappers in hal/rtl8723bs_xmit.c

replace private macro RT_TRACE for tracing with in-kernel
pr_* printk wrappers

Signed-off-by: Fabio Aiuto <[email protected]>
---
.../staging/rtl8723bs/hal/rtl8723bs_xmit.c | 42 ++++++-------------
1 file changed, 13 insertions(+), 29 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c b/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c
index 597cf3a88c51..ad27ba1592ed 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c
@@ -102,11 +102,8 @@ static s32 rtl8723_dequeue_writeport(struct adapter *padapter)
(padapter->bSurpriseRemoved) ||
(padapter->bDriverStopped)
) {
- RT_TRACE(
- _module_hal_xmit_c_,
- _drv_notice_,
- ("%s: bSurpriseRemoved(write port)\n", __func__)
- );
+ pr_notice("%s %s: bSurpriseRemoved(write port)\n",
+ DRIVER_PREFIX, __func__);
goto free_xmitbuf;
}

@@ -151,16 +148,9 @@ s32 rtl8723bs_xmit_buf_handler(struct adapter *padapter)

ret = (padapter->bDriverStopped) || (padapter->bSurpriseRemoved);
if (ret) {
- RT_TRACE(
- _module_hal_xmit_c_,
- _drv_err_,
- (
- "%s: bDriverStopped(%d) bSurpriseRemoved(%d)!\n",
- __func__,
- padapter->bDriverStopped,
- padapter->bSurpriseRemoved
- )
- );
+ pr_err("%s %s: bDriverStopped(%d) bSurpriseRemoved(%d)!\n",
+ DRIVER_PREFIX, __func__, padapter->bDriverStopped,
+ padapter->bSurpriseRemoved);
return _FAIL;
}

@@ -374,7 +364,8 @@ static s32 xmit_xmitframes(struct adapter *padapter, struct xmit_priv *pxmitpriv

/* dump xmit_buf to hw tx fifo */
if (pxmitbuf) {
- RT_TRACE(_module_hal_xmit_c_, _drv_info_, ("pxmitbuf->len =%d enqueue\n", pxmitbuf->len));
+ pr_info("%s pxmitbuf->len =%d enqueue\n",
+ DRIVER_PREFIX, pxmitbuf->len);

if (pxmitbuf->len > 0) {
struct xmit_frame *pframe;
@@ -424,16 +415,9 @@ static s32 rtl8723bs_xmit_handler(struct adapter *padapter)
(padapter->bDriverStopped) ||
(padapter->bSurpriseRemoved)
) {
- RT_TRACE(
- _module_hal_xmit_c_,
- _drv_notice_,
- (
- "%s: bDriverStopped(%d) bSurpriseRemoved(%d)\n",
- __func__,
- padapter->bDriverStopped,
- padapter->bSurpriseRemoved
- )
- );
+ pr_notice("%s %s: bDriverStopped(%d) bSurpriseRemoved(%d)\n",
+ DRIVER_PREFIX, __func__, padapter->bDriverStopped,
+ padapter->bSurpriseRemoved);
return _FAIL;
}

@@ -492,7 +476,7 @@ int rtl8723bs_xmit_thread(void *context)

complete(&pxmitpriv->SdioXmitTerminate);

- RT_TRACE(_module_hal_xmit_c_, _drv_notice_, ("-%s\n", __func__));
+ pr_notice("%s-%s\n", DRIVER_PREFIX, __func__);

thread_exit();
}
@@ -509,7 +493,7 @@ s32 rtl8723bs_mgnt_xmit(
u8 *pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
u8 txdesc_size = TXDESC_SIZE;

- RT_TRACE(_module_hal_xmit_c_, _drv_info_, ("+%s\n", __func__));
+ pr_info("%s+%s\n", DRIVER_PREFIX, __func__);

pattrib = &pmgntframe->attrib;
pxmitbuf = pmgntframe->pxmitbuf;
@@ -572,7 +556,7 @@ s32 rtl8723bs_hal_xmit(
err = rtw_xmitframe_enqueue(padapter, pxmitframe);
spin_unlock_bh(&pxmitpriv->lock);
if (err != _SUCCESS) {
- RT_TRACE(_module_hal_xmit_c_, _drv_err_, ("rtl8723bs_hal_xmit: enqueue xmitframe fail\n"));
+ pr_err("%s %s: enqueue xmitframe fail\n", DRIVER_PREFIX, __func__);
rtw_free_xmitframe(pxmitpriv, pxmitframe);

pxmitpriv->tx_drop++;
--
2.20.1

2021-03-31 09:44:25

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 37/40] staging: rtl8723bs: replace RT_TRACE with public printk wrappers in os_dep/sdio_intf.c

replace private macro RT_TRACE for tracing with in-kernel
pr_* printk wrappers

Signed-off-by: Fabio Aiuto <[email protected]>
---
drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
index b6be1423ef75..e99c6f72cff6 100644
--- a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
+++ b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
@@ -160,7 +160,7 @@ static void sdio_deinit(struct dvobj_priv *dvobj)
int err;


- RT_TRACE(_module_hci_intfs_c_, _drv_notice_, ("+sdio_deinit\n"));
+ pr_notice("%s+%s\n", DRIVER_PREFIX, __func__);

func = dvobj->intf_data.func;

@@ -201,7 +201,7 @@ static struct dvobj_priv *sdio_dvobj_init(struct sdio_func *func)
psdio->func = func;

if (sdio_init(dvobj) != _SUCCESS) {
- RT_TRACE(_module_hci_intfs_c_, _drv_err_, ("%s: initialize SDIO Failed!\n", __func__));
+ pr_err("%s %s: initialize SDIO Failed!\n", DRIVER_PREFIX, __func__);
goto free_dvobj;
}
rtw_reset_continual_io_error(dvobj);
@@ -306,8 +306,7 @@ static struct adapter *rtw_sdio_if1_init(struct dvobj_priv *dvobj, const struct
padapter->intf_free_irq = &sdio_free_irq;

if (rtw_init_io_priv(padapter, sdio_set_intf_ops) == _FAIL) {
- RT_TRACE(_module_hci_intfs_c_, _drv_err_,
- ("rtw_drv_init: Can't init io_priv\n"));
+ pr_err("%s rtw_drv_init: Can't init io_priv\n", DRIVER_PREFIX);
goto free_hal_data;
}

@@ -322,8 +321,8 @@ static struct adapter *rtw_sdio_if1_init(struct dvobj_priv *dvobj, const struct

/* 3 7. init driver common data */
if (rtw_init_drv_sw(padapter) == _FAIL) {
- RT_TRACE(_module_hci_intfs_c_, _drv_err_,
- ("rtw_drv_init: Initialize driver software resource Failed!\n"));
+ pr_err("%s rtw_drv_init: Initialize driver software resource Failed!\n",
+ DRIVER_PREFIX);
goto free_hal_data;
}

@@ -406,7 +405,7 @@ static int rtw_drv_init(

dvobj = sdio_dvobj_init(func);
if (dvobj == NULL) {
- RT_TRACE(_module_hci_intfs_c_, _drv_err_, ("initialize device object priv Failed!\n"));
+ pr_err("%s initialize device object priv Failed!\n", DRIVER_PREFIX);
goto exit;
}

@@ -424,7 +423,7 @@ static int rtw_drv_init(
if (sdio_alloc_irq(dvobj) != _SUCCESS)
goto free_if2;

- RT_TRACE(_module_hci_intfs_c_, _drv_err_, ("-871x_drv - drv_init, success!\n"));
+ pr_err("%s-871x_drv - drv_init, success!\n", DRIVER_PREFIX);

rtw_ndev_notifier_register();
status = _SUCCESS;
@@ -447,7 +446,7 @@ static void rtw_dev_remove(struct sdio_func *func)
struct dvobj_priv *dvobj = sdio_get_drvdata(func);
struct adapter *padapter = dvobj->if1;

- RT_TRACE(_module_hci_intfs_c_, _drv_notice_, ("+rtw_dev_remove\n"));
+ pr_notice("%s+%s\n", DRIVER_PREFIX, __func__);

dvobj->processing_dev_remove = true;

@@ -479,7 +478,7 @@ static void rtw_dev_remove(struct sdio_func *func)

sdio_dvobj_deinit(func);

- RT_TRACE(_module_hci_intfs_c_, _drv_notice_, ("-rtw_dev_remove\n"));
+ pr_notice("%s - %s\n", DRIVER_PREFIX, __func__);
}

static int rtw_sdio_suspend(struct device *dev)
--
2.20.1

2021-03-31 09:44:28

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 15/40] staging: rtl8723bs: replace RT_TRACE with public printk wrappers in core/rtw_ieee80211.c

replace private macro RT_TRACE for tracing with in-kernel
pr_* printk wrappers

Signed-off-by: Fabio Aiuto <[email protected]>
---
.../staging/rtl8723bs/core/rtw_ieee80211.c | 116 +++++++++++-------
1 file changed, 74 insertions(+), 42 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
index e931afc3ba22..a7589f919c35 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
@@ -489,7 +489,8 @@ int rtw_parse_wpa_ie(u8 *wpa_ie, int wpa_ie_len, int *group_cipher, int *pairwis
left -= WPA_SELECTOR_LEN;

} else if (left > 0) {
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("%s: ie length mismatch, %u too much", __func__, left));
+ pr_err("%s %s: ie length mismatch, %u too much",
+ DRIVER_PREFIX, __func__, left);

return _FAIL;
}
@@ -502,8 +503,9 @@ int rtw_parse_wpa_ie(u8 *wpa_ie, int wpa_ie_len, int *group_cipher, int *pairwis
left -= 2;

if (count == 0 || left < count * WPA_SELECTOR_LEN) {
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("%s: ie count botch (pairwise), "
- "count %u left %u", __func__, count, left));
+ pr_err("%s %s: ie count botch (pairwise), "
+ "count %u left %u", DRIVER_PREFIX,
+ __func__, count, left);
return _FAIL;
}

@@ -515,7 +517,7 @@ int rtw_parse_wpa_ie(u8 *wpa_ie, int wpa_ie_len, int *group_cipher, int *pairwis
}

} else if (left == 1) {
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("%s: ie too short (for key mgmt)", __func__));
+ pr_err("%s %s: ie too short (for key mgmt)", DRIVER_PREFIX, __func__);
return _FAIL;
}

@@ -523,7 +525,8 @@ int rtw_parse_wpa_ie(u8 *wpa_ie, int wpa_ie_len, int *group_cipher, int *pairwis
if (left >= 6) {
pos += 2;
if (!memcmp(pos, SUITE_1X, 4)) {
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("%s : there has 802.1x auth\n", __func__));
+ pr_info("%s %s : there has 802.1x auth\n",
+ DRIVER_PREFIX, __func__);
*is_8021x = 1;
}
}
@@ -560,7 +563,8 @@ int rtw_parse_wpa2_ie(u8 *rsn_ie, int rsn_ie_len, int *group_cipher, int *pairwi
left -= RSN_SELECTOR_LEN;

} else if (left > 0) {
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("%s: ie length mismatch, %u too much", __func__, left));
+ pr_err("%s %s: ie length mismatch, %u too much",
+ DRIVER_PREFIX, __func__, left);
return _FAIL;
}

@@ -572,8 +576,9 @@ int rtw_parse_wpa2_ie(u8 *rsn_ie, int rsn_ie_len, int *group_cipher, int *pairwi
left -= 2;

if (count == 0 || left < count * RSN_SELECTOR_LEN) {
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("%s: ie count botch (pairwise), "
- "count %u left %u", __func__, count, left));
+ pr_err("%s %s: ie count botch (pairwise), "
+ "count %u left %u",
+ DRIVER_PREFIX, __func__, count, left);
return _FAIL;
}

@@ -585,7 +590,8 @@ int rtw_parse_wpa2_ie(u8 *rsn_ie, int rsn_ie_len, int *group_cipher, int *pairwi
}

} else if (left == 1) {
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("%s: ie too short (for key mgmt)", __func__));
+ pr_err("%s %s: ie too short (for key mgmt)",
+ DRIVER_PREFIX, __func__);

return _FAIL;
}
@@ -594,7 +600,8 @@ int rtw_parse_wpa2_ie(u8 *rsn_ie, int rsn_ie_len, int *group_cipher, int *pairwi
if (left >= 6) {
pos += 2;
if (!memcmp(pos, SUITE_1X, 4)) {
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("%s (): there has 802.1x auth\n", __func__));
+ pr_info("%s %s: there has 802.1x auth\n",
+ DRIVER_PREFIX, __func__);
*is_8021x = 1;
}
}
@@ -630,9 +637,16 @@ int rtw_get_wapi_ie(u8 *in_ie, uint in_len, u8 *wapi_ie, u16 *wapi_len)
memcpy(wapi_ie, &in_ie[cnt], in_ie[cnt+1]+2);

for (i = 0; i < (in_ie[cnt+1]+2); i = i+8) {
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("\n %2x,%2x,%2x,%2x,%2x,%2x,%2x,%2x\n",
- wapi_ie[i], wapi_ie[i+1], wapi_ie[i+2], wapi_ie[i+3], wapi_ie[i+4],
- wapi_ie[i+5], wapi_ie[i+6], wapi_ie[i+7]));
+ pr_info("%s %2x,%2x,%2x,%2x,%2x,%2x,%2x,%2x\n",
+ DRIVER_PREFIX,
+ wapi_ie[i],
+ wapi_ie[i+1],
+ wapi_ie[i+2],
+ wapi_ie[i+3],
+ wapi_ie[i+4],
+ wapi_ie[i+5],
+ wapi_ie[i+6],
+ wapi_ie[i+7]);
}
}

@@ -668,31 +682,47 @@ void rtw_get_sec_ie(u8 *in_ie, uint in_len, u8 *rsn_ie, u16 *rsn_len, u8 *wpa_ie
authmode = in_ie[cnt];

if ((authmode == WLAN_EID_VENDOR_SPECIFIC) && (!memcmp(&in_ie[cnt+2], &wpa_oui[0], 4))) {
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("\n rtw_get_wpa_ie: sec_idx =%d in_ie[cnt+1]+2 =%d\n", sec_idx, in_ie[cnt+1]+2));
+ pr_info("%s %s: sec_idx =%d in_ie[cnt+1]+2 =%d\n",
+ DRIVER_PREFIX, __func__, sec_idx, in_ie[cnt+1]+2);

- if (wpa_ie) {
+ if (wpa_ie) {
memcpy(wpa_ie, &in_ie[cnt], in_ie[cnt+1]+2);

for (i = 0; i < (in_ie[cnt+1]+2); i = i+8) {
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("\n %2x,%2x,%2x,%2x,%2x,%2x,%2x,%2x\n",
- wpa_ie[i], wpa_ie[i+1], wpa_ie[i+2], wpa_ie[i+3], wpa_ie[i+4],
- wpa_ie[i+5], wpa_ie[i+6], wpa_ie[i+7]));
- }
+ pr_info("%s %2x,%2x,%2x,%2x,%2x,%2x,%2x,%2x\n",
+ DRIVER_PREFIX,
+ wpa_ie[i],
+ wpa_ie[i+1],
+ wpa_ie[i+2],
+ wpa_ie[i+3],
+ wpa_ie[i+4],
+ wpa_ie[i+5],
+ wpa_ie[i+6],
+ wpa_ie[i+7]);
}
+ }

- *wpa_len = in_ie[cnt+1]+2;
- cnt += in_ie[cnt+1]+2; /* get next */
+ *wpa_len = in_ie[cnt+1]+2;
+ cnt += in_ie[cnt+1]+2; /* get next */
} else {
if (authmode == WLAN_EID_RSN) {
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("\n get_rsn_ie: sec_idx =%d in_ie[cnt+1]+2 =%d\n", sec_idx, in_ie[cnt+1]+2));
+ pr_info("%s %s: sec_idx =%d in_ie[cnt+1]+2 =%d\n",
+ DRIVER_PREFIX, __func__, sec_idx, in_ie[cnt+1]+2);

if (rsn_ie) {
memcpy(rsn_ie, &in_ie[cnt], in_ie[cnt+1]+2);

- for (i = 0; i < (in_ie[cnt+1]+2); i = i+8) {
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("\n %2x,%2x,%2x,%2x,%2x,%2x,%2x,%2x\n",
- rsn_ie[i], rsn_ie[i+1], rsn_ie[i+2], rsn_ie[i+3], rsn_ie[i+4],
- rsn_ie[i+5], rsn_ie[i+6], rsn_ie[i+7]));
+ for (i = 0; i < (in_ie[cnt+1]+2); i = i+8) {
+ pr_info("%s %2x,%2x,%2x,%2x,%2x,%2x,%2x,%2x\n",
+ DRIVER_PREFIX,
+ rsn_ie[i],
+ rsn_ie[i+1],
+ rsn_ie[i+2],
+ rsn_ie[i+3],
+ rsn_ie[i+4],
+ rsn_ie[i+5],
+ rsn_ie[i+6],
+ rsn_ie[i+7]);
}
}

@@ -1138,28 +1168,30 @@ static int rtw_get_cipher_info(struct wlan_network *pnetwork)
pbuf = rtw_get_wpa_ie(&pnetwork->network.IEs[12], &wpa_ielen, pnetwork->network.IELength-12);

if (pbuf && (wpa_ielen > 0)) {
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_get_cipher_info: wpa_ielen: %d", wpa_ielen));
+ pr_info("%s %s: wpa_ielen: %d", DRIVER_PREFIX, __func__, wpa_ielen);
if (_SUCCESS == rtw_parse_wpa_ie(pbuf, wpa_ielen+2, &group_cipher, &pairwise_cipher, &is8021x)) {
pnetwork->BcnInfo.pairwise_cipher = pairwise_cipher;
pnetwork->BcnInfo.group_cipher = group_cipher;
pnetwork->BcnInfo.is_8021x = is8021x;
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("%s: pnetwork->pairwise_cipher: %d, is_8021x is %d",
- __func__, pnetwork->BcnInfo.pairwise_cipher, pnetwork->BcnInfo.is_8021x));
+ pr_info("%s %s: pnetwork->pairwise_cipher: %d, is_8021x is %d",
+ DRIVER_PREFIX, __func__, pnetwork->BcnInfo.pairwise_cipher,
+ pnetwork->BcnInfo.is_8021x);
ret = _SUCCESS;
}
} else {
pbuf = rtw_get_wpa2_ie(&pnetwork->network.IEs[12], &wpa_ielen, pnetwork->network.IELength-12);

if (pbuf && (wpa_ielen > 0)) {
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("get RSN IE\n"));
+ pr_info("%s get RSN IE\n", DRIVER_PREFIX);
if (_SUCCESS == rtw_parse_wpa2_ie(pbuf, wpa_ielen+2, &group_cipher, &pairwise_cipher, &is8021x)) {
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("get RSN IE OK!!!\n"));
+ pr_info("%s get RSN IE OK!!!\n", DRIVER_PREFIX);
pnetwork->BcnInfo.pairwise_cipher = pairwise_cipher;
pnetwork->BcnInfo.group_cipher = group_cipher;
pnetwork->BcnInfo.is_8021x = is8021x;
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("%s: pnetwork->pairwise_cipher: %d,"
- "pnetwork->group_cipher is %d, is_8021x is %d", __func__, pnetwork->BcnInfo.pairwise_cipher,
- pnetwork->BcnInfo.group_cipher, pnetwork->BcnInfo.is_8021x));
+ pr_info("%s %s: pnetwork->pairwise_cipher: %d,"
+ "pnetwork->group_cipher is %d, is_8021x is %d",
+ DRIVER_PREFIX, __func__, pnetwork->BcnInfo.pairwise_cipher,
+ pnetwork->BcnInfo.group_cipher, pnetwork->BcnInfo.is_8021x);
ret = _SUCCESS;
}
}
@@ -1189,10 +1221,10 @@ void rtw_get_bcn_info(struct wlan_network *pnetwork)
pnetwork->BcnInfo.encryp_protocol = ENCRYP_PROTOCOL_OPENSYS;
}
rtw_get_sec_ie(pnetwork->network.IEs, pnetwork->network.IELength, NULL, &rsn_len, NULL, &wpa_len);
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_get_bcn_info: ssid =%s\n", pnetwork->network.Ssid.Ssid));
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_get_bcn_info: wpa_len =%d rsn_len =%d\n", wpa_len, rsn_len));
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_get_bcn_info: ssid =%s\n", pnetwork->network.Ssid.Ssid));
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_get_bcn_info: wpa_len =%d rsn_len =%d\n", wpa_len, rsn_len));
+ pr_info("%s %s: ssid =%s\n", DRIVER_PREFIX, __func__, pnetwork->network.Ssid.Ssid);
+ pr_info("%s %s: wpa_len =%d rsn_len =%d\n", DRIVER_PREFIX, __func__, wpa_len, rsn_len);
+ pr_info("%s %s: ssid =%s\n", DRIVER_PREFIX, __func__, pnetwork->network.Ssid.Ssid);
+ pr_info("%s %s: wpa_len =%d rsn_len =%d\n", DRIVER_PREFIX, __func__, wpa_len, rsn_len);

if (rsn_len > 0) {
pnetwork->BcnInfo.encryp_protocol = ENCRYP_PROTOCOL_WPA2;
@@ -1202,10 +1234,10 @@ void rtw_get_bcn_info(struct wlan_network *pnetwork)
if (bencrypt)
pnetwork->BcnInfo.encryp_protocol = ENCRYP_PROTOCOL_WEP;
}
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_get_bcn_info: pnetwork->encryp_protocol is %x\n",
- pnetwork->BcnInfo.encryp_protocol));
- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_get_bcn_info: pnetwork->encryp_protocol is %x\n",
- pnetwork->BcnInfo.encryp_protocol));
+ pr_info("%s %s: pnetwork->encryp_protocol is %x\n",
+ DRIVER_PREFIX, __func__, pnetwork->BcnInfo.encryp_protocol);
+ pr_info("%s %s: pnetwork->encryp_protocol is %x\n",
+ DRIVER_PREFIX, __func__, pnetwork->BcnInfo.encryp_protocol);
rtw_get_cipher_info(pnetwork);

/* get bwmode and ch_offset */
--
2.20.1

2021-03-31 09:44:29

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 40/40] staging: rtl8723bs: remove obsolete debug macro

remove obsolete debug macro RT_TRACE

Signed-off-by: Fabio Aiuto <[email protected]>
---
drivers/staging/rtl8723bs/include/rtw_debug.h | 17 -----------------
1 file changed, 17 deletions(-)

diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h
index 4c0857241922..f539d8e7f89f 100644
--- a/drivers/staging/rtl8723bs/include/rtw_debug.h
+++ b/drivers/staging/rtl8723bs/include/rtw_debug.h
@@ -131,7 +131,6 @@
#define _MODULE_DEFINE_ _module_efuse_
#endif

-#define RT_TRACE(_Comp, _Level, Fmt) do {} while (0)
#define RT_PRINT_DATA(_Comp, _Level, _TitleString, _HexData, _HexDataLen) do {} while (0)

#define DBG_871X(x, ...) do {} while (0)
@@ -217,22 +216,6 @@
#endif /* defined(_dbgdump) */
#endif /* DEBUG */

-#ifdef DEBUG_RTL871X
-
-#if defined(_dbgdump) && defined(_MODULE_DEFINE_)
-
- #undef RT_TRACE
- #define RT_TRACE(_Comp, _Level, Fmt)\
- do {\
- if ((_Comp & GlobalDebugComponents) && (_Level <= GlobalDebugLevel)) {\
- _dbgdump("%s [0x%08x,%d]", DRIVER_PREFIX, (unsigned int)_Comp, _Level);\
- _dbgdump Fmt;\
- } \
- } while (0)
-
-#endif /* defined(_dbgdump) && defined(_MODULE_DEFINE_) */
-#endif /* DEBUG_RTL871X */
-
void dump_drv_version(void *sel);
void dump_log_level(void *sel);

--
2.20.1

2021-03-31 09:44:37

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 39/40] staging: rtl8723bs: replace RT_TRACE with public printk wrappers in os_dep/osdep_service.c

replace private macro RT_TRACE for tracing with in-kernel
pr_* printk wrappers

Signed-off-by: Fabio Aiuto <[email protected]>
---
drivers/staging/rtl8723bs/os_dep/osdep_service.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/osdep_service.c b/drivers/staging/rtl8723bs/os_dep/osdep_service.c
index 843003b91ea2..db979403e16a 100644
--- a/drivers/staging/rtl8723bs/os_dep/osdep_service.c
+++ b/drivers/staging/rtl8723bs/os_dep/osdep_service.c
@@ -161,7 +161,7 @@ int rtw_change_ifname(struct adapter *padapter, const char *ifname)
ret = register_netdevice(pnetdev);

if (ret != 0) {
- RT_TRACE(_module_hci_intfs_c_, _drv_err_, ("register_netdev() failed\n"));
+ pr_err("%s register_netdev() failed\n", DRIVER_PREFIX);
goto error;
}

--
2.20.1

2021-03-31 09:44:37

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 20/40] staging: rtl8723bs: replace RT_TRACE with public printk wrappers in hal/rtl8723b_hal_init.c

replace private macro RT_TRACE for tracing with in-kernel
pr_* printk wrappers

Signed-off-by: Fabio Aiuto <[email protected]>
---
.../staging/rtl8723bs/hal/rtl8723b_hal_init.c | 143 +++++++++---------
1 file changed, 68 insertions(+), 75 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
index e9d107093942..fa904061a9c3 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
@@ -65,17 +65,12 @@ static int _BlockWrite(struct adapter *padapter, void *buffer, u32 buffSize)
remainSize_p1 = buffSize % blockSize_p1;

if (blockCount_p1) {
- RT_TRACE(
- _module_hal_init_c_,
- _drv_notice_,
- (
- "_BlockWrite: [P1] buffSize(%d) blockSize_p1(%d) blockCount_p1(%d) remainSize_p1(%d)\n",
- buffSize,
- blockSize_p1,
- blockCount_p1,
- remainSize_p1
- )
- );
+ pr_notice("%s %s: [P1] buffSize(%d) blockSize_p1(%d) blockCount_p1(%d) remainSize_p1(%d)\n",
+ DRIVER_PREFIX, __func__,
+ buffSize,
+ blockSize_p1,
+ blockCount_p1,
+ remainSize_p1);
}

for (i = 0; i < blockCount_p1; i++) {
@@ -94,17 +89,12 @@ static int _BlockWrite(struct adapter *padapter, void *buffer, u32 buffSize)
remainSize_p2 = remainSize_p1%blockSize_p2;

if (blockCount_p2) {
- RT_TRACE(
- _module_hal_init_c_,
- _drv_notice_,
- (
- "_BlockWrite: [P2] buffSize_p2(%d) blockSize_p2(%d) blockCount_p2(%d) remainSize_p2(%d)\n",
- (buffSize-offset),
- blockSize_p2,
- blockCount_p2,
- remainSize_p2
- )
- );
+ pr_notice("%s %s: [P2] buffSize_p2(%d) blockSize_p2(%d) blockCount_p2(%d) remainSize_p2(%d)\n",
+ DRIVER_PREFIX, __func__,
+ (buffSize-offset),
+ blockSize_p2,
+ blockCount_p2,
+ remainSize_p2);
}

}
@@ -115,9 +105,9 @@ static int _BlockWrite(struct adapter *padapter, void *buffer, u32 buffSize)

blockCount_p3 = remainSize_p2 / blockSize_p3;

- RT_TRACE(_module_hal_init_c_, _drv_notice_,
- ("_BlockWrite: [P3] buffSize_p3(%d) blockSize_p3(%d) blockCount_p3(%d)\n",
- (buffSize-offset), blockSize_p3, blockCount_p3));
+ pr_notice("%s %s: [P3] buffSize_p3(%d) blockSize_p3(%d) blockCount_p3(%d)\n",
+ DRIVER_PREFIX, __func__, (buffSize-offset), blockSize_p3,
+ blockCount_p3);

for (i = 0; i < blockCount_p3; i++) {
ret = rtw_write8(padapter, (FW_8723B_START_ADDRESS + offset + i), *(bufferPtr + offset + i));
@@ -181,7 +171,7 @@ static int _WriteFW(struct adapter *padapter, void *buffer, u32 size)
goto exit;
}
}
- RT_TRACE(_module_hal_init_c_, _drv_info_, ("_WriteFW Done- for Normal chip.\n"));
+ pr_info("%s %s Done- for Normal chip.\n", DRIVER_PREFIX, __func__);

exit:
return ret;
@@ -334,10 +324,10 @@ void rtl8723b_FirmwareSelfReset(struct adapter *padapter)
udelay(50);
u1bTmp = rtw_read8(padapter, REG_SYS_FUNC_EN+1);
}
- RT_TRACE(_module_hal_init_c_, _drv_notice_, ("-%s: 8051 reset success (%d)\n", __func__, Delay));
+ pr_notice("%s-%s: 8051 reset success (%d)\n", DRIVER_PREFIX, __func__, Delay);

if (Delay == 0) {
- RT_TRACE(_module_hal_init_c_, _drv_notice_, ("%s: Force 8051 reset!!!\n", __func__));
+ pr_notice("%s %s: Force 8051 reset!!!\n", DRIVER_PREFIX, __func__);
/* force firmware reset */
u1bTmp = rtw_read8(padapter, REG_SYS_FUNC_EN+1);
rtw_write8(padapter, REG_SYS_FUNC_EN+1, u1bTmp&(~BIT2));
@@ -368,7 +358,7 @@ s32 rtl8723b_FirmwareDownload(struct adapter *padapter, bool bUsedWoWLANFw)
struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;
u8 tmp_ps;

- RT_TRACE(_module_hal_init_c_, _drv_info_, ("+%s\n", __func__));
+ pr_info("%s+%s\n", DRIVER_PREFIX, __func__);
pFirmware = kzalloc(sizeof(struct rt_firmware), GFP_KERNEL);
if (!pFirmware)
return _FAIL;
@@ -410,11 +400,7 @@ s32 rtl8723b_FirmwareDownload(struct adapter *padapter, bool bUsedWoWLANFw)

if (fw->size > FW_8723B_SIZE) {
rtStatus = _FAIL;
- RT_TRACE(
- _module_hal_init_c_,
- _drv_err_,
- ("Firmware size exceed 0x%X. Check it.\n", FW_8723B_SIZE)
- );
+ pr_err("%s Firmware size exceed 0x%X. Check it.\n", DRIVER_PREFIX, FW_8723B_SIZE);
goto exit;
}

@@ -1953,7 +1939,7 @@ static void ResumeTxBeacon(struct adapter *padapter)
/* 2010.03.01. Marked by tynli. No need to call workitem beacause we record the value */
/* which should be read from register to a global variable. */

- RT_TRACE(_module_hci_hal_init_c_, _drv_info_, ("+ResumeTxBeacon\n"));
+ pr_info("%s+%s\n", DRIVER_PREFIX, __func__);

pHalData->RegFwHwTxQCtrl |= BIT(6);
rtw_write8(padapter, REG_FWHW_TXQ_CTRL+2, pHalData->RegFwHwTxQCtrl);
@@ -1970,7 +1956,7 @@ static void StopTxBeacon(struct adapter *padapter)
/* 2010.03.01. Marked by tynli. No need to call workitem beacause we record the value */
/* which should be read from register to a global variable. */

- RT_TRACE(_module_hci_hal_init_c_, _drv_info_, ("+StopTxBeacon\n"));
+ pr_info("%s+%s\n", DRIVER_PREFIX, __func__);

pHalData->RegFwHwTxQCtrl &= ~BIT(6);
rtw_write8(padapter, REG_FWHW_TXQ_CTRL+2, pHalData->RegFwHwTxQCtrl);
@@ -2315,7 +2301,8 @@ static bool Hal_GetChnlGroup8723B(u8 Channel, u8 *pGroup)
else if (12 <= Channel && Channel <= 14)
*pGroup = 4;
else {
- RT_TRACE(_module_hci_hal_init_c_, _drv_notice_, ("==>Hal_GetChnlGroup8723B in 2.4 G, but Channel %d in Group not found\n", Channel));
+ pr_notice("%s ==> %s in 2.4 G, but Channel %d in Group not found\n",
+ DRIVER_PREFIX, __func__, Channel);
}
} else {
bIn24G = false;
@@ -2349,20 +2336,16 @@ static bool Hal_GetChnlGroup8723B(u8 Channel, u8 *pGroup)
else if (173 <= Channel && Channel <= 177)
*pGroup = 13;
else {
- RT_TRACE(_module_hci_hal_init_c_, _drv_notice_, ("==>Hal_GetChnlGroup8723B in 5G, but Channel %d in Group not found\n", Channel));
+ pr_notice("%s ==> %s in 5G, but Channel %d in Group not found\n",
+ DRIVER_PREFIX, __func__, Channel);
}

}
- RT_TRACE(
- _module_hci_hal_init_c_,
- _drv_info_,
- (
- "<==Hal_GetChnlGroup8723B, (%s) Channel = %d, Group =%d,\n",
- bIn24G ? "2.4G" : "5G",
- Channel,
- *pGroup
- )
- );
+ pr_info("%s <== %s, (%s) Channel = %d, Group =%d,\n",
+ DRIVER_PREFIX, __func__,
+ bIn24G ? "2.4G" : "5G",
+ Channel,
+ *pGroup);
return bIn24G;
}

@@ -2377,7 +2360,7 @@ void Hal_InitPGData(struct adapter *padapter, u8 *PROMContent)
memcpy((void *)PROMContent, (void *)pEEPROM->efuse_eeprom_data, HWSET_MAX_SIZE_8723B);
}
} else {/* autoload fail */
- RT_TRACE(_module_hci_hal_init_c_, _drv_notice_, ("AutoLoad Fail reported from CR9346!!\n"));
+ pr_notice("%s AutoLoad Fail reported from CR9346!!\n", DRIVER_PREFIX);
if (!pEEPROM->EepromOrEfuse)
EFUSE_ShadowMapUpdate(padapter, EFUSE_WIFI, false);
memcpy((void *)PROMContent, (void *)pEEPROM->efuse_eeprom_data, HWSET_MAX_SIZE_8723B);
@@ -2399,7 +2382,7 @@ void Hal_EfuseParseIDCode(struct adapter *padapter, u8 *hwinfo)
} else
pEEPROM->bautoload_fail_flag = false;

- RT_TRACE(_module_hal_init_c_, _drv_notice_, ("EEPROM ID = 0x%04x\n", EEPROMId));
+ pr_notice("%s EEPROM ID = 0x%04x\n", DRIVER_PREFIX, EEPROMId);
}

static void Hal_ReadPowerValueFromPROM_8723B(
@@ -2541,9 +2524,12 @@ void Hal_EfuseParseTxPowerInfo_8723B(
pHalData->Index24G_BW40_Base[rfPath][ch] = pwrInfo24G.IndexBW40_Base[rfPath][group];
}
#ifdef DEBUG
- RT_TRACE(_module_hci_hal_init_c_, _drv_info_, ("======= Path %d, ChannelIndex %d, Group %d =======\n", rfPath, ch, group));
- RT_TRACE(_module_hci_hal_init_c_, _drv_info_, ("Index24G_CCK_Base[%d][%d] = 0x%x\n", rfPath, ch, pHalData->Index24G_CCK_Base[rfPath][ch]));
- RT_TRACE(_module_hci_hal_init_c_, _drv_info_, ("Index24G_BW40_Base[%d][%d] = 0x%x\n", rfPath, ch, pHalData->Index24G_BW40_Base[rfPath][ch]));
+ pr_info("%s ======= Path %d, ChannelIndex %d, Group %d =======\n",
+ DRIVER_PREFIX, rfPath, ch, group);
+ pr_info("%s Index24G_CCK_Base[%d][%d] = 0x%x\n", DRIVER_PREFIX,
+ rfPath, ch, pHalData->Index24G_CCK_Base[rfPath][ch]);
+ pr_info("%s Index24G_BW40_Base[%d][%d] = 0x%x\n", DRIVER_PREFIX,
+ rfPath, ch, pHalData->Index24G_BW40_Base[rfPath][ch]);
#endif
}

@@ -2554,11 +2540,16 @@ void Hal_EfuseParseTxPowerInfo_8723B(
pHalData->BW40_24G_Diff[rfPath][TxCount] = pwrInfo24G.BW40_Diff[rfPath][TxCount];

#ifdef DEBUG
- RT_TRACE(_module_hci_hal_init_c_, _drv_info_, ("--------------------------------------- 2.4G ---------------------------------------\n"));
- RT_TRACE(_module_hci_hal_init_c_, _drv_info_, ("CCK_24G_Diff[%d][%d]= %d\n", rfPath, TxCount, pHalData->CCK_24G_Diff[rfPath][TxCount]));
- RT_TRACE(_module_hci_hal_init_c_, _drv_info_, ("OFDM_24G_Diff[%d][%d]= %d\n", rfPath, TxCount, pHalData->OFDM_24G_Diff[rfPath][TxCount]));
- RT_TRACE(_module_hci_hal_init_c_, _drv_info_, ("BW20_24G_Diff[%d][%d]= %d\n", rfPath, TxCount, pHalData->BW20_24G_Diff[rfPath][TxCount]));
- RT_TRACE(_module_hci_hal_init_c_, _drv_info_, ("BW40_24G_Diff[%d][%d]= %d\n", rfPath, TxCount, pHalData->BW40_24G_Diff[rfPath][TxCount]));
+ pr_info("%s --------------------------------------- 2.4G ---------------------------------------\n",
+ DRIVER_PREFIX);
+ pr_info("%s CCK_24G_Diff[%d][%d]= %d\n", DRIVER_PREFIX, rfPath, TxCount,
+ pHalData->CCK_24G_Diff[rfPath][TxCount]);
+ pr_info("%s OFDM_24G_Diff[%d][%d]= %d\n", DRIVER_PREFIX, rfPath, TxCount,
+ pHalData->OFDM_24G_Diff[rfPath][TxCount]);
+ pr_info("%s BW20_24G_Diff[%d][%d]= %d\n", DRIVER_PREFIX, rfPath, TxCount,
+ pHalData->BW20_24G_Diff[rfPath][TxCount]);
+ pr_info("%s BW40_24G_Diff[%d][%d]= %d\n", DRIVER_PREFIX, rfPath, TxCount,
+ pHalData->BW40_24G_Diff[rfPath][TxCount]);
#endif
}
}
@@ -2571,7 +2562,7 @@ void Hal_EfuseParseTxPowerInfo_8723B(
} else
pHalData->EEPROMRegulatory = 0;

- RT_TRACE(_module_hci_hal_init_c_, _drv_notice_, ("EEPROMRegulatory = 0x%x\n", pHalData->EEPROMRegulatory));
+ pr_info("%s EEPROMRegulatory = 0x%x\n", DRIVER_PREFIX, pHalData->EEPROMRegulatory);
}

void Hal_EfuseParseBTCoexistInfo_8723B(
@@ -2660,8 +2651,7 @@ void Hal_EfuseParseEEPROMVer_8723B(
pHalData->EEPROMVersion = hwinfo[EEPROM_VERSION_8723B];
else
pHalData->EEPROMVersion = 1;
- RT_TRACE(_module_hci_hal_init_c_, _drv_notice_, ("Hal_EfuseParseEEPROMVer(), EEVer = %d\n",
- pHalData->EEPROMVersion));
+ pr_notice("%s %s, EEVer = %d\n", DRIVER_PREFIX, __func__, pHalData->EEPROMVersion);
}


@@ -2729,7 +2719,7 @@ void Hal_EfuseParseChnlPlan_8723B(

Hal_ChannelPlanToRegulation(padapter, padapter->mlmepriv.ChannelPlan);

- RT_TRACE(_module_hci_hal_init_c_, _drv_notice_, ("EEPROM ChannelPlan = 0x%02x\n", padapter->mlmepriv.ChannelPlan));
+ pr_notice("%s EEPROM ChannelPlan = 0x%02x\n", DRIVER_PREFIX, padapter->mlmepriv.ChannelPlan);
}

void Hal_EfuseParseCustomerID_8723B(
@@ -2743,7 +2733,7 @@ void Hal_EfuseParseCustomerID_8723B(
else
pHalData->EEPROMCustomerID = 0;

- RT_TRACE(_module_hci_hal_init_c_, _drv_notice_, ("EEPROM Customer ID: 0x%2x\n", pHalData->EEPROMCustomerID));
+ pr_notice("%s EEPROM Customer ID: 0x%2x\n", DRIVER_PREFIX, pHalData->EEPROMCustomerID);
}

void Hal_EfuseParseAntennaDiversity_8723B(
@@ -2767,7 +2757,7 @@ void Hal_EfuseParseXtal_8723B(
} else
pHalData->CrystalCap = EEPROM_Default_CrystalCap_8723B;

- RT_TRACE(_module_hci_hal_init_c_, _drv_notice_, ("EEPROM CrystalCap: 0x%2x\n", pHalData->CrystalCap));
+ pr_notice("%s EEPROM CrystalCap: 0x%2x\n", DRIVER_PREFIX, pHalData->CrystalCap);
}


@@ -2790,7 +2780,7 @@ void Hal_EfuseParseThermalMeter_8723B(
pHalData->EEPROMThermalMeter = EEPROM_Default_ThermalMeter_8723B;
}

- RT_TRACE(_module_hci_hal_init_c_, _drv_notice_, ("EEPROM ThermalMeter = 0x%x\n", pHalData->EEPROMThermalMeter));
+ pr_notice("%s EEPROM ThermalMeter = 0x%x\n", DRIVER_PREFIX, pHalData->EEPROMThermalMeter);
}


@@ -3107,9 +3097,10 @@ static void rtl8723b_fill_default_txdesc(
ptxdesc->sw_define = (u8)(GET_PRIMARY_ADAPTER(padapter)->xmitpriv.seq_no);
}
} else if (pxmitframe->frame_tag == TXAGG_FRAMETAG) {
- RT_TRACE(_module_hal_xmit_c_, _drv_warning_, ("%s: TXAGG_FRAMETAG\n", __func__));
+ pr_warn("%s %s: TXAGG_FRAMETAG\n", DRIVER_PREFIX, __func__);
} else {
- RT_TRACE(_module_hal_xmit_c_, _drv_warning_, ("%s: frame_tag = 0x%x\n", __func__, pxmitframe->frame_tag));
+ pr_warn("%s %s: frame_tag = 0x%x\n", DRIVER_PREFIX, __func__,
+ pxmitframe->frame_tag);

ptxdesc->macid = pattrib->mac_id; /* CAM_ID(MAC_ID) */
ptxdesc->rate_id = pattrib->raid; /* Rate ID */
@@ -3584,7 +3575,7 @@ s32 c2h_handler_8723b(struct adapter *padapter, u8 *buf)
break;
case C2H_DBG:
{
- RT_TRACE(_module_hal_init_c_, _drv_info_, ("c2h_handler_8723b: %s\n", pC2hEvent->payload));
+ pr_info("%s %s: %s\n", DRIVER_PREFIX, __func__, pC2hEvent->payload);
}
break;

@@ -3597,9 +3588,10 @@ s32 c2h_handler_8723b(struct adapter *padapter, u8 *buf)
break;

case C2H_HW_INFO_EXCH:
- RT_TRACE(_module_hal_init_c_, _drv_info_, ("[BT], C2H_HW_INFO_EXCH\n"));
+ pr_info("%s [BT], C2H_HW_INFO_EXCH\n", DRIVER_PREFIX);
for (index = 0; index < pC2hEvent->plen; index++) {
- RT_TRACE(_module_hal_init_c_, _drv_info_, ("[BT], tmpBuf[%d]= 0x%x\n", index, pC2hEvent->payload[index]));
+ pr_info("%s [BT], tmpBuf[%d]= 0x%x\n", DRIVER_PREFIX,
+ index, pC2hEvent->payload[index]);
}
break;

@@ -3633,7 +3625,7 @@ static void process_c2h_event(struct adapter *padapter, struct c2h_evt_hdr_t *pC
break;
case C2H_DBG:
{
- RT_TRACE(_module_hal_init_c_, _drv_info_, ("C2HCommandHandler: %s\n", c2hBuf));
+ pr_info("%s C2HCommandHandler: %s\n", DRIVER_PREFIX, c2hBuf);
}
break;

@@ -3646,9 +3638,9 @@ static void process_c2h_event(struct adapter *padapter, struct c2h_evt_hdr_t *pC
break;

case C2H_HW_INFO_EXCH:
- RT_TRACE(_module_hal_init_c_, _drv_info_, ("[BT], C2H_HW_INFO_EXCH\n"));
+ pr_info("%s [BT], C2H_HW_INFO_EXCH\n", DRIVER_PREFIX);
for (index = 0; index < pC2hEvent->CmdLen; index++) {
- RT_TRACE(_module_hal_init_c_, _drv_info_, ("[BT], tmpBuf[%d]= 0x%x\n", index, c2hBuf[index]));
+ pr_info("%s [BT], tmpBuf[%d]= 0x%x\n", DRIVER_PREFIX, index, c2hBuf[index]);
}
break;

@@ -4049,7 +4041,8 @@ void SetHwReg8723B(struct adapter *padapter, u8 variable, u8 *val)
u32 usNavUpper = *((u32 *)val);

if (usNavUpper > HAL_NAV_UPPER_UNIT_8723B * 0xFF) {
- RT_TRACE(_module_hal_init_c_, _drv_notice_, ("The setting value (0x%08X us) of NAV_UPPER is larger than (%d * 0xFF)!!!\n", usNavUpper, HAL_NAV_UPPER_UNIT_8723B));
+ pr_notice("%s The setting value (0x%08X us) of NAV_UPPER is larger than (%d * 0xFF)!!!\n",
+ DRIVER_PREFIX, usNavUpper, HAL_NAV_UPPER_UNIT_8723B);
break;
}

@@ -4353,7 +4346,7 @@ void rtl8723b_start_thread(struct adapter *padapter)

xmitpriv->SdioXmitThread = kthread_run(rtl8723bs_xmit_thread, padapter, "RTWHALXT");
if (IS_ERR(xmitpriv->SdioXmitThread)) {
- RT_TRACE(_module_hal_xmit_c_, _drv_err_, ("%s: start rtl8723bs_xmit_thread FAIL!!\n", __func__));
+ pr_err("%s %s: start rtl8723bs_xmit_thread FAIL!!\n", DRIVER_PREFIX, __func__);
}
}

--
2.20.1

2021-03-31 09:45:27

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 27/40] staging: rtl8723bs: replace RT_TRACE with public printk wrappers in hal/rtl8723bs_recv.c

replace private macro RT_TRACE for tracing with in-kernel
pr_* printk wrappers

Signed-off-by: Fabio Aiuto <[email protected]>
---
drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c b/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
index 17a3e7bf66ef..7c8e0402f150 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
@@ -346,7 +346,8 @@ static void rtl8723bs_recv_tasklet(struct tasklet_struct *t)
update_recvframe_phyinfo(precvframe, (struct phy_stat *)ptr);

if (rtw_recv_entry(precvframe) != _SUCCESS) {
- RT_TRACE(_module_rtl871x_recv_c_, _drv_dump_, ("%s: rtw_recv_entry(precvframe) != _SUCCESS\n", __func__));
+ pr_devel("%s %s: rtw_recv_entry(precvframe) != _SUCCESS\n",
+ DRIVER_PREFIX, __func__);
}
} else if (pattrib->pkt_rpt_type == C2H_PACKET) {
struct c2h_evt_hdr_t C2hEvent;
@@ -404,7 +405,7 @@ s32 rtl8723bs_init_recv_priv(struct adapter *padapter)
precvpriv->pallocated_recv_buf = rtw_zmalloc(n);
if (!precvpriv->pallocated_recv_buf) {
res = _FAIL;
- RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("alloc recv_buf fail!\n"));
+ pr_err("%s alloc recv_buf fail!\n", DRIVER_PREFIX);
goto exit;
}

--
2.20.1

2021-03-31 09:45:41

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 24/40] staging: rtl8723bs: replace RT_TRACE with public printk wrappers in hal/hal_intf.c

replace private macro RT_TRACE for tracing with in-kernel
pr_* printk wrappers

Signed-off-by: Fabio Aiuto <[email protected]>
---
drivers/staging/rtl8723bs/hal/hal_intf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/hal/hal_intf.c b/drivers/staging/rtl8723bs/hal/hal_intf.c
index aa4356327636..87de2a3bda4e 100644
--- a/drivers/staging/rtl8723bs/hal/hal_intf.c
+++ b/drivers/staging/rtl8723bs/hal/hal_intf.c
@@ -108,7 +108,7 @@ uint rtw_hal_init(struct adapter *padapter)
DBG_871X("rtw_hal_init: hal__init fail\n");
}

- RT_TRACE(_module_hal_init_c_, _drv_err_, ("-rtl871x_hal_init:status = 0x%x\n", status));
+ pr_err("%s -%s:status = 0x%x\n", DRIVER_PREFIX, __func__, status);

return status;
}
--
2.20.1

2021-03-31 09:45:47

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 28/40] staging: rtl8723bs: remove commented RT_TRACE calls in hal/HalPhyRf_8723B.c

remove commented RT_TRACE calls in hal/HalPhyRf_8723B.c

Signed-off-by: Fabio Aiuto <[email protected]>
---
drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c | 3 ---
1 file changed, 3 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c b/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c
index 12f0e3601531..c36513812d9d 100644
--- a/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c
+++ b/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c
@@ -1847,7 +1847,6 @@ void PHY_IQCalibrate_8723B(
bResult = FAIL;
break;
}
- /* RT_TRACE(_module_mp_, _drv_notice_, ("Switch to S1 TxIQC(offset, data) = (0x%X, 0x%X)\n", offset, data)); */
PHY_SetBBReg(pDM_Odm->Adapter, offset, bMaskDWord, data);
}

@@ -1864,7 +1863,6 @@ void PHY_IQCalibrate_8723B(
bResult = FAIL;
break;
}
- /* RT_TRACE(_module_mp_, _drv_notice_, ("Switch to S1 RxIQC (offset, data) = (0x%X, 0x%X)\n", offset, data)); */
PHY_SetBBReg(pDM_Odm->Adapter, offset, bMaskDWord, data);
}

@@ -1950,7 +1948,6 @@ void PHY_IQCalibrate_8723B(
}
}
}
-/* RT_TRACE(COMP_INIT, DBG_LOUD, ("Release Mutex in IQCalibrate\n")); */

for (i = 0; i < 4; i++) {
RegE94 = result[i][0];
--
2.20.1

2021-03-31 09:46:09

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 32/40] staging: rtl8723bs: replace RT_TRACE with public printk wrappers in os_dep/mlme_linux.c

replace private macro RT_TRACE for tracing with in-kernel
pr_* printk wrappers

Signed-off-by: Fabio Aiuto <[email protected]>
---
drivers/staging/rtl8723bs/os_dep/mlme_linux.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/mlme_linux.c b/drivers/staging/rtl8723bs/os_dep/mlme_linux.c
index ba4d3789a41e..bda0c34f2086 100644
--- a/drivers/staging/rtl8723bs/os_dep/mlme_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/mlme_linux.c
@@ -145,11 +145,11 @@ void rtw_report_sec_ie(struct adapter *adapter, u8 authmode, u8 *sec_ie)
u8 *buff, *p, i;
union iwreq_data wrqu;

- RT_TRACE(_module_mlme_osdep_c_, _drv_info_, ("+rtw_report_sec_ie, authmode =%d\n", authmode));
+ pr_info("%s+%s, authmode =%d\n", DRIVER_PREFIX, __func__, authmode);

buff = NULL;
if (authmode == WLAN_EID_VENDOR_SPECIFIC) {
- RT_TRACE(_module_mlme_osdep_c_, _drv_info_, ("rtw_report_sec_ie, authmode =%d\n", authmode));
+ pr_info("%s %s, authmode =%d\n", DRIVER_PREFIX, __func__, authmode);

buff = rtw_zmalloc(IW_CUSTOM_MAX);
if (NULL == buff) {
--
2.20.1

2021-03-31 09:46:17

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 35/40] staging: rtl8723bs: replace RT_TRACE with public printk wrappers in os_dep/os_intfs.c

replace private macro RT_TRACE for tracing with in-kernel
pr_* printk wrappers

Signed-off-by: Fabio Aiuto <[email protected]>
---
drivers/staging/rtl8723bs/os_dep/os_intfs.c | 65 ++++++++++-----------
1 file changed, 32 insertions(+), 33 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
index 405aa95af579..1c6530d34cb8 100644
--- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c
+++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
@@ -479,7 +479,7 @@ struct net_device *rtw_init_netdev(struct adapter *old_padapter)
struct adapter *padapter;
struct net_device *pnetdev;

- RT_TRACE(_module_os_intfs_c_, _drv_info_, ("+init_net_dev\n"));
+ pr_info("%s+%s\n", DRIVER_PREFIX, __func__);

if (old_padapter)
pnetdev = rtw_alloc_etherdev_with_old_priv(sizeof(struct adapter), (void *)old_padapter);
@@ -529,7 +529,7 @@ u32 rtw_start_drv_threads(struct adapter *padapter)
{
u32 _status = _SUCCESS;

- RT_TRACE(_module_os_intfs_c_, _drv_info_, ("+rtw_start_drv_threads\n"));
+ pr_info("%s+%s\n", DRIVER_PREFIX, __func__);
padapter->xmitThread = kthread_run(rtw_xmit_thread, padapter, "RTW_XMIT_THREAD");
if (IS_ERR(padapter->xmitThread))
_status = _FAIL;
@@ -546,14 +546,14 @@ u32 rtw_start_drv_threads(struct adapter *padapter)

void rtw_stop_drv_threads(struct adapter *padapter)
{
- RT_TRACE(_module_os_intfs_c_, _drv_info_, ("+rtw_stop_drv_threads\n"));
+ pr_info("%s+%s\n", DRIVER_PREFIX, __func__);

rtw_stop_cmd_thread(padapter);

/* Below is to termindate tx_thread... */
complete(&padapter->xmitpriv.xmit_comp);
wait_for_completion(&padapter->xmitpriv.terminate_xmitthread_comp);
- RT_TRACE(_module_os_intfs_c_, _drv_info_, ("\n drv_halt: rtw_xmit_thread can be terminated !\n"));
+ pr_info("%s drv_halt: rtw_xmit_thread can be terminated !\n", DRIVER_PREFIX);

rtw_hal_stop_thread(padapter);
}
@@ -697,14 +697,14 @@ u8 rtw_init_drv_sw(struct adapter *padapter)
{
u8 ret8 = _SUCCESS;

- RT_TRACE(_module_os_intfs_c_, _drv_info_, ("+rtw_init_drv_sw\n"));
+ pr_info("%s+%s\n", DRIVER_PREFIX, __func__);

rtw_init_default_value(padapter);

rtw_init_hal_com_default_value(padapter);

if (rtw_init_cmd_priv(&padapter->cmdpriv)) {
- RT_TRACE(_module_os_intfs_c_, _drv_err_, ("\n Can't init cmd_priv\n"));
+ pr_err("%s %s Can't init cmd_priv\n", DRIVER_PREFIX, __func__);
ret8 = _FAIL;
goto exit;
}
@@ -712,14 +712,14 @@ u8 rtw_init_drv_sw(struct adapter *padapter)
padapter->cmdpriv.padapter = padapter;

if (rtw_init_evt_priv(&padapter->evtpriv)) {
- RT_TRACE(_module_os_intfs_c_, _drv_err_, ("\n Can't init evt_priv\n"));
+ pr_err("%s Can't init evt_priv\n", DRIVER_PREFIX);
ret8 = _FAIL;
goto exit;
}


if (rtw_init_mlme_priv(padapter) == _FAIL) {
- RT_TRACE(_module_os_intfs_c_, _drv_err_, ("\n Can't init mlme_priv\n"));
+ pr_err("%s Can't init mlme_priv\n", DRIVER_PREFIX);
ret8 = _FAIL;
goto exit;
}
@@ -760,29 +760,29 @@ u8 rtw_init_drv_sw(struct adapter *padapter)

exit:

- RT_TRACE(_module_os_intfs_c_, _drv_info_, ("-rtw_init_drv_sw\n"));
+ pr_info("%s-%s\n", DRIVER_PREFIX, __func__);

return ret8;
}

void rtw_cancel_all_timer(struct adapter *padapter)
{
- RT_TRACE(_module_os_intfs_c_, _drv_info_, ("+rtw_cancel_all_timer\n"));
+ pr_info("%s+%s\n", DRIVER_PREFIX, __func__);

del_timer_sync(&padapter->mlmepriv.assoc_timer);
- RT_TRACE(_module_os_intfs_c_, _drv_info_, ("rtw_cancel_all_timer:cancel association timer complete!\n"));
+ pr_info("%s %s:cancel association timer complete!\n", DRIVER_PREFIX, __func__);

del_timer_sync(&padapter->mlmepriv.scan_to_timer);
- RT_TRACE(_module_os_intfs_c_, _drv_info_, ("rtw_cancel_all_timer:cancel scan_to_timer!\n"));
+ pr_info("%s %s:cancel scan_to_timer!\n", DRIVER_PREFIX, __func__);

del_timer_sync(&padapter->mlmepriv.dynamic_chk_timer);
- RT_TRACE(_module_os_intfs_c_, _drv_info_, ("rtw_cancel_all_timer:cancel dynamic_chk_timer!\n"));
+ pr_info("%s %s:cancel dynamic_chk_timer!\n", DRIVER_PREFIX, __func__);

del_timer_sync(&(adapter_to_pwrctl(padapter)->pwr_state_check_timer));

del_timer_sync(&padapter->mlmepriv.set_scan_deny_timer);
rtw_clear_scan_deny(padapter);
- RT_TRACE(_module_os_intfs_c_, _drv_info_, ("rtw_cancel_all_timer:cancel set_scan_deny_timer!\n"));
+ pr_info("%s %s:cancel set_scan_deny_timer!\n", DRIVER_PREFIX, __func__);

del_timer_sync(&padapter->recvpriv.signal_stat_timer);

@@ -792,7 +792,7 @@ void rtw_cancel_all_timer(struct adapter *padapter)

u8 rtw_free_drv_sw(struct adapter *padapter)
{
- RT_TRACE(_module_os_intfs_c_, _drv_info_, ("==>rtw_free_drv_sw"));
+ pr_info("%s ==> %s", DRIVER_PREFIX, __func__);

free_mlme_ext_priv(&padapter->mlmeextpriv);

@@ -816,7 +816,7 @@ u8 rtw_free_drv_sw(struct adapter *padapter)

rtw_hal_free_data(padapter);

- RT_TRACE(_module_os_intfs_c_, _drv_info_, ("<==rtw_free_drv_sw\n"));
+ pr_info("%s <== %s\n", DRIVER_PREFIX, __func__);

/* free the old_pnetdev */
if (padapter->rereg_nd_name_priv.old_pnetdev) {
@@ -828,7 +828,7 @@ u8 rtw_free_drv_sw(struct adapter *padapter)
if (padapter->pbuddy_adapter)
padapter->pbuddy_adapter->pbuddy_adapter = NULL;

- RT_TRACE(_module_os_intfs_c_, _drv_info_, ("-rtw_free_drv_sw\n"));
+ pr_info("%s-%s\n", DRIVER_PREFIX, __func__);

return _SUCCESS;
}
@@ -879,7 +879,7 @@ static int _netdev_open(struct net_device *pnetdev)
struct adapter *padapter = rtw_netdev_priv(pnetdev);
struct pwrctrl_priv *pwrctrlpriv = adapter_to_pwrctl(padapter);

- RT_TRACE(_module_os_intfs_c_, _drv_info_, ("+871x_drv - dev_open\n"));
+ pr_info("%s+871x_drv - dev_open\n", DRIVER_PREFIX);
DBG_871X("+871x_drv - drv_open, bup =%d\n", padapter->bup);

padapter->netif_up = true;
@@ -896,7 +896,7 @@ static int _netdev_open(struct net_device *pnetdev)

status = rtw_hal_init(padapter);
if (status == _FAIL) {
- RT_TRACE(_module_os_intfs_c_, _drv_err_, ("rtl871x_hal_init(): Can't init h/w!\n"));
+ pr_err("%s rtl871x_hal_init(): Can't init h/w!\n", DRIVER_PREFIX);
goto netdev_open_error;
}

@@ -927,7 +927,7 @@ static int _netdev_open(struct net_device *pnetdev)

netdev_open_normal_process:

- RT_TRACE(_module_os_intfs_c_, _drv_info_, ("-871x_drv - dev_open\n"));
+ pr_info("%s -871x_drv - dev_open\n", DRIVER_PREFIX);
DBG_871X("-871x_drv - drv_open, bup =%d\n", padapter->bup);

return 0;
@@ -939,7 +939,7 @@ static int _netdev_open(struct net_device *pnetdev)
netif_carrier_off(pnetdev);
rtw_netif_stop_queue(pnetdev);

- RT_TRACE(_module_os_intfs_c_, _drv_err_, ("-871x_drv - dev_open, fail!\n"));
+ pr_err("%s -871x_drv - dev_open, fail!\n", DRIVER_PREFIX);
DBG_871X("-871x_drv - drv_open fail, bup =%d\n", padapter->bup);

return (-1);
@@ -978,7 +978,7 @@ static int ips_netdrv_open(struct adapter *padapter)

status = rtw_hal_init(padapter);
if (status == _FAIL) {
- RT_TRACE(_module_os_intfs_c_, _drv_err_, ("ips_netdrv_open(): Can't init h/w!\n"));
+ pr_err("%s %s: Can't init h/w!\n", DRIVER_PREFIX, __func__);
goto netdev_open_error;
}

@@ -1050,7 +1050,7 @@ static int netdev_close(struct net_device *pnetdev)
struct adapter *padapter = rtw_netdev_priv(pnetdev);
struct pwrctrl_priv *pwrctl = adapter_to_pwrctl(padapter);

- RT_TRACE(_module_os_intfs_c_, _drv_info_, ("+871x_drv - drv_close\n"));
+ pr_info("%s+871x_drv - drv_close\n", DRIVER_PREFIX);

if (pwrctl->bInternalAutoSuspend) {
/* rtw_pwr_wakeup(padapter); */
@@ -1092,7 +1092,7 @@ static int netdev_close(struct net_device *pnetdev)
rtw_scan_abort(padapter);
adapter_wdev_data(padapter)->bandroid_scan = false;

- RT_TRACE(_module_os_intfs_c_, _drv_info_, ("-871x_drv - drv_close\n"));
+ pr_info("%s-871x_drv - drv_close\n", DRIVER_PREFIX);
DBG_871X("-871x_drv - drv_close, bup =%d\n", padapter->bup);

return 0;
@@ -1113,7 +1113,7 @@ void rtw_dev_unload(struct adapter *padapter)
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
u8 cnt = 0;

- RT_TRACE(_module_hci_intfs_c_, _drv_notice_, ("+%s\n", __func__));
+ pr_notice("%s+%s\n", DRIVER_PREFIX, __func__);

if (padapter->bup) {

@@ -1124,7 +1124,7 @@ void rtw_dev_unload(struct adapter *padapter)
if (padapter->intf_stop)
padapter->intf_stop(padapter);

- RT_TRACE(_module_hci_intfs_c_, _drv_notice_, ("@ rtw_dev_unload: stop intf complete!\n"));
+ pr_notice("%s @ %s: stop intf complete!\n", DRIVER_PREFIX, __func__);

if (!pwrctl->bInternalAutoSuspend)
rtw_stop_drv_threads(padapter);
@@ -1140,7 +1140,7 @@ void rtw_dev_unload(struct adapter *padapter)
}
}

- RT_TRACE(_module_hci_intfs_c_, _drv_notice_, ("@ %s: stop thread complete!\n", __func__));
+ pr_notice("%s @ %s: stop thread complete!\n", DRIVER_PREFIX, __func__);

/* check the status of IPS */
if (rtw_hal_check_ips_status(padapter) || pwrctl->rf_pwrstate == rf_off) {
@@ -1160,17 +1160,16 @@ void rtw_dev_unload(struct adapter *padapter)

padapter->bSurpriseRemoved = true;
}
- RT_TRACE(_module_hci_intfs_c_, _drv_notice_,
- ("@ %s: deinit hal complete!\n", __func__));
+ pr_notice("%s @ %s: deinit hal complete!\n", DRIVER_PREFIX, __func__);

padapter->bup = false;

} else {
- RT_TRACE(_module_hci_intfs_c_, _drv_notice_, ("%s: bup ==false\n", __func__));
+ pr_notice("%s %s: bup ==false\n", DRIVER_PREFIX, __func__);
DBG_871X("%s: bup ==false\n", __func__);
}

- RT_TRACE(_module_hci_intfs_c_, _drv_notice_, ("-%s\n", __func__));
+ pr_notice("%s-%s\n", DRIVER_PREFIX, __func__);
}

static int rtw_suspend_free_assoc_resource(struct adapter *padapter)
@@ -1329,14 +1328,14 @@ static int rtw_resume_process_normal(struct adapter *padapter)
/* if (sdio_init(adapter_to_dvobj(padapter)) != _SUCCESS) */
if ((padapter->intf_init) && (padapter->intf_init(adapter_to_dvobj(padapter)) != _SUCCESS)) {
ret = -1;
- RT_TRACE(_module_hci_intfs_c_, _drv_err_, ("%s: initialize SDIO Failed!!\n", __func__));
+ pr_err("%s %s: initialize SDIO Failed!!\n", DRIVER_PREFIX, __func__);
goto exit;
}
rtw_hal_disable_interrupt(padapter);
/* if (sdio_alloc_irq(adapter_to_dvobj(padapter)) != _SUCCESS) */
if ((padapter->intf_alloc_irq) && (padapter->intf_alloc_irq(adapter_to_dvobj(padapter)) != _SUCCESS)) {
ret = -1;
- RT_TRACE(_module_hci_intfs_c_, _drv_err_, ("%s: sdio_alloc_irq Failed!!\n", __func__));
+ pr_err("%s %s: sdio_alloc_irq Failed!!\n", DRIVER_PREFIX, __func__);
goto exit;
}

--
2.20.1

2021-03-31 09:46:27

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 38/40] staging: rtl8723bs: replace RT_TRACE with public printk wrappers in os_dep/xmit_linux.c

replace private macro RT_TRACE for tracing with in-kernel
pr_* printk wrappers

Signed-off-by: Fabio Aiuto <[email protected]>
---
drivers/staging/rtl8723bs/os_dep/xmit_linux.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/xmit_linux.c b/drivers/staging/rtl8723bs/os_dep/xmit_linux.c
index 216b2f62eefd..50c381d7e734 100644
--- a/drivers/staging/rtl8723bs/os_dep/xmit_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/xmit_linux.c
@@ -196,10 +196,10 @@ int _rtw_xmit_entry(struct sk_buff *pkt, struct net_device *pnetdev)
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
s32 res = 0;

- RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("+xmit_enry\n"));
+ pr_info("%s+%s\n", DRIVER_PREFIX, __func__);

if (rtw_if_up(padapter) == false) {
- RT_TRACE(_module_xmit_osdep_c_, _drv_err_, ("rtw_xmit_entry: rtw_if_up fail\n"));
+ pr_err("%s %s: rtw_if_up fail\n", DRIVER_PREFIX, __func__);
#ifdef DBG_TX_DROP_FRAME
DBG_871X("DBG_TX_DROP_FRAME %s if_up fail\n", __func__);
#endif
@@ -232,13 +232,15 @@ int _rtw_xmit_entry(struct sk_buff *pkt, struct net_device *pnetdev)
goto drop_packet;
}

- RT_TRACE(_module_xmit_osdep_c_, _drv_info_, ("rtw_xmit_entry: tx_pkts =%d\n", (u32)pxmitpriv->tx_pkts));
+ pr_info("%s %s: tx_pkts =%d\n", DRIVER_PREFIX, __func__,
+ (u32)pxmitpriv->tx_pkts);
goto exit;

drop_packet:
pxmitpriv->tx_drop++;
dev_kfree_skb_any(pkt);
- RT_TRACE(_module_xmit_osdep_c_, _drv_notice_, ("rtw_xmit_entry: drop, tx_drop =%d\n", (u32)pxmitpriv->tx_drop));
+ pr_notice("%s %s: drop, tx_drop =%d\n", DRIVER_PREFIX,
+ __func__, (u32)pxmitpriv->tx_drop);

exit:
return 0;
--
2.20.1

2021-03-31 10:21:29

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH 01/40] staging: rtl8723bs: replace RT_TRACE with public printk wrappers in core/rtw_xmit.c

I'm sorry but we can't accept this patch.

> @@ -481,12 +481,13 @@ static s32 update_attrib_sec_info(struct adapter *padapter, struct pkt_attrib *p
> pattrib->mac_id = psta->mac_id;
>
> if (psta->ieee8021x_blocked == true) {
> - RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("\n psta->ieee8021x_blocked == true\n"));
> + pr_err("%s psta->ieee8021x_blocked == true\n", DRIVER_PREFIX);

Here we have change debug code that's never printed into an error
message.

A bunch of the rest are technically "wrong" but harmless.

> if (!pxmitpriv->pallocated_frame_buf) {
> pxmitpriv->pxmit_frame_buf = NULL;
> - RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("alloc xmit_frame fail!\n"));
> + pr_err("%s alloc xmit_frame fail!\n", DRIVER_PREFIX);

We don't print warning messages for allocation failures. Checkpatch
is supposed to complain.

I always encourage people to think about everything deeply and look at
the context and read the error messages. But if you send a patch which
mindlessly deletes all these RT_TRACE() messages, then we will apply
that.

It's unfortunate that you have to re-write the first patch in a 40
patch series. :/

regards,
dan carpenter

2021-03-31 10:29:44

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 03/40] staging: rtl8723bs: replace RT_TRACE with public printk wrappers in core/rtw_eeprom.c

On Wed, Mar 31, 2021 at 11:39:31AM +0200, Fabio Aiuto wrote:
> replace private macro RT_TRACE for tracing with in-kernel
> pr_* printk wrappers
>
> Signed-off-by: Fabio Aiuto <[email protected]>
> ---
> drivers/staging/rtl8723bs/core/rtw_eeprom.c | 26 ++++++++++-----------
> 1 file changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/core/rtw_eeprom.c b/drivers/staging/rtl8723bs/core/rtw_eeprom.c
> index 3cbd65dee741..6176d741d60e 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_eeprom.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_eeprom.c
> @@ -36,7 +36,7 @@ void shift_out_bits(_adapter *padapter, u16 data, u16 count)
> _func_enter_;
>
> if (padapter->bSurpriseRemoved == true) {
> - RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==true"));
> + pr_err("%s padapter->bSurpriseRemoved==true", DRIVER_PREFIX);

As Dan said, this is not the same thing. You are now always printing
out this mess, when before you were not unless you explicitly enabled
"tracing".

And you are sending it to the error log?

And finally, drivers should never be using pr_*() for messages, they
should be using dev_*() instead as they are a driver and have access to
a device pointer.

thanks,

greg k-h

2021-03-31 10:38:09

by Fabio Aiuto

[permalink] [raw]
Subject: Re: [PATCH 03/40] staging: rtl8723bs: replace RT_TRACE with public printk wrappers in core/rtw_eeprom.c

On Wed, Mar 31, 2021 at 12:27:20PM +0200, Greg KH wrote:
> On Wed, Mar 31, 2021 at 11:39:31AM +0200, Fabio Aiuto wrote:
> > replace private macro RT_TRACE for tracing with in-kernel
> > pr_* printk wrappers
> >
> > Signed-off-by: Fabio Aiuto <[email protected]>
> > ---
> > drivers/staging/rtl8723bs/core/rtw_eeprom.c | 26 ++++++++++-----------
> > 1 file changed, 13 insertions(+), 13 deletions(-)
> >
> > diff --git a/drivers/staging/rtl8723bs/core/rtw_eeprom.c b/drivers/staging/rtl8723bs/core/rtw_eeprom.c
> > index 3cbd65dee741..6176d741d60e 100644
> > --- a/drivers/staging/rtl8723bs/core/rtw_eeprom.c
> > +++ b/drivers/staging/rtl8723bs/core/rtw_eeprom.c
> > @@ -36,7 +36,7 @@ void shift_out_bits(_adapter *padapter, u16 data, u16 count)
> > _func_enter_;
> >
> > if (padapter->bSurpriseRemoved == true) {
> > - RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==true"));

I looked at this ---------------------------------------^
and so I thought that pr_err was good...

> > + pr_err("%s padapter->bSurpriseRemoved==true", DRIVER_PREFIX);
>
> As Dan said, this is not the same thing. You are now always printing
> out this mess, when before you were not unless you explicitly enabled
> "tracing".
>
> And you are sending it to the error log?
>
> And finally, drivers should never be using pr_*() for messages, they
> should be using dev_*() instead as they are a driver and have access to
> a device pointer.
>

thank you, I didn't know about dev_*

> thanks,
>
> greg k-h

my aim was remove private macros replicating component tracing and log levels...

so what's best? Keep a simplyfied RT_TRACE encapsulating a dev_* call?

thank you,

fabio

2021-03-31 10:52:40

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 03/40] staging: rtl8723bs: replace RT_TRACE with public printk wrappers in core/rtw_eeprom.c

On Wed, Mar 31, 2021 at 12:36:31PM +0200, Fabio Aiuto wrote:
> On Wed, Mar 31, 2021 at 12:27:20PM +0200, Greg KH wrote:
> > On Wed, Mar 31, 2021 at 11:39:31AM +0200, Fabio Aiuto wrote:
> > > replace private macro RT_TRACE for tracing with in-kernel
> > > pr_* printk wrappers
> > >
> > > Signed-off-by: Fabio Aiuto <[email protected]>
> > > ---
> > > drivers/staging/rtl8723bs/core/rtw_eeprom.c | 26 ++++++++++-----------
> > > 1 file changed, 13 insertions(+), 13 deletions(-)
> > >
> > > diff --git a/drivers/staging/rtl8723bs/core/rtw_eeprom.c b/drivers/staging/rtl8723bs/core/rtw_eeprom.c
> > > index 3cbd65dee741..6176d741d60e 100644
> > > --- a/drivers/staging/rtl8723bs/core/rtw_eeprom.c
> > > +++ b/drivers/staging/rtl8723bs/core/rtw_eeprom.c
> > > @@ -36,7 +36,7 @@ void shift_out_bits(_adapter *padapter, u16 data, u16 count)
> > > _func_enter_;
> > >
> > > if (padapter->bSurpriseRemoved == true) {
> > > - RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==true"));
>
> I looked at this ---------------------------------------^
> and so I thought that pr_err was good...

But you missed the fact that RT_TRACE() does not always spit this stuff
out.

And I don't know what _drv_err_ is, but tracing messages should never go
to an error log :)

> my aim was remove private macros replicating component tracing and log levels...

That's a great goal!

> so what's best? Keep a simplyfied RT_TRACE encapsulating a dev_* call?

replace them with dev_dbg() is one way, if they really are even needed
at all. At this point in time, I would strongly just recommend removing
them all as no one is using them for anything.

thanks,

greg k-h

2021-03-31 10:58:13

by Fabio Aiuto

[permalink] [raw]
Subject: Re: [PATCH 03/40] staging: rtl8723bs: replace RT_TRACE with public printk wrappers in core/rtw_eeprom.c

On Wed, Mar 31, 2021 at 12:27:20PM +0200, Greg KH wrote:
> On Wed, Mar 31, 2021 at 11:39:31AM +0200, Fabio Aiuto wrote:
> > replace private macro RT_TRACE for tracing with in-kernel
> > pr_* printk wrappers
> >
> > Signed-off-by: Fabio Aiuto <[email protected]>
> > ---
> > drivers/staging/rtl8723bs/core/rtw_eeprom.c | 26 ++++++++++-----------
> > 1 file changed, 13 insertions(+), 13 deletions(-)
> >
> > diff --git a/drivers/staging/rtl8723bs/core/rtw_eeprom.c b/drivers/staging/rtl8723bs/core/rtw_eeprom.c
> > index 3cbd65dee741..6176d741d60e 100644
> > --- a/drivers/staging/rtl8723bs/core/rtw_eeprom.c
> > +++ b/drivers/staging/rtl8723bs/core/rtw_eeprom.c
> > @@ -36,7 +36,7 @@ void shift_out_bits(_adapter *padapter, u16 data, u16 count)
> > _func_enter_;
> >
> > if (padapter->bSurpriseRemoved == true) {
> > - RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==true"));
> > + pr_err("%s padapter->bSurpriseRemoved==true", DRIVER_PREFIX);
>
> As Dan said, this is not the same thing. You are now always printing
> out this mess, when before you were not unless you explicitly enabled
> "tracing".

RT_TRACE is enabled if is defined the symbol DEBUG_RTL871X. It doesn't seem to be related
to tracing. DEBUG_RTL871X is never declared, is commented out in rtl8723bs/include/autoconf.h

that's why RT_TRACE is never printed. If we try to uncomment the symbol definition we have some
comiling errors..

>
> And you are sending it to the error log?
>
> And finally, drivers should never be using pr_*() for messages, they
> should be using dev_*() instead as they are a driver and have access to
> a device pointer.
>
> thanks,
>
> greg k-h

I still wonder what's best...

thanks,

fabio

2021-03-31 11:16:28

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 03/40] staging: rtl8723bs: replace RT_TRACE with public printk wrappers in core/rtw_eeprom.c

On Wed, Mar 31, 2021 at 12:55:51PM +0200, Fabio Aiuto wrote:
> On Wed, Mar 31, 2021 at 12:27:20PM +0200, Greg KH wrote:
> > On Wed, Mar 31, 2021 at 11:39:31AM +0200, Fabio Aiuto wrote:
> > > replace private macro RT_TRACE for tracing with in-kernel
> > > pr_* printk wrappers
> > >
> > > Signed-off-by: Fabio Aiuto <[email protected]>
> > > ---
> > > drivers/staging/rtl8723bs/core/rtw_eeprom.c | 26 ++++++++++-----------
> > > 1 file changed, 13 insertions(+), 13 deletions(-)
> > >
> > > diff --git a/drivers/staging/rtl8723bs/core/rtw_eeprom.c b/drivers/staging/rtl8723bs/core/rtw_eeprom.c
> > > index 3cbd65dee741..6176d741d60e 100644
> > > --- a/drivers/staging/rtl8723bs/core/rtw_eeprom.c
> > > +++ b/drivers/staging/rtl8723bs/core/rtw_eeprom.c
> > > @@ -36,7 +36,7 @@ void shift_out_bits(_adapter *padapter, u16 data, u16 count)
> > > _func_enter_;
> > >
> > > if (padapter->bSurpriseRemoved == true) {
> > > - RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==true"));
> > > + pr_err("%s padapter->bSurpriseRemoved==true", DRIVER_PREFIX);
> >
> > As Dan said, this is not the same thing. You are now always printing
> > out this mess, when before you were not unless you explicitly enabled
> > "tracing".
>
> RT_TRACE is enabled if is defined the symbol DEBUG_RTL871X. It doesn't seem to be related
> to tracing. DEBUG_RTL871X is never declared, is commented out in rtl8723bs/include/autoconf.h

That's a good sign this is never used and should just all be removed.

> that's why RT_TRACE is never printed. If we try to uncomment the symbol definition we have some
> comiling errors..

What errors do you get?

> > And you are sending it to the error log?
> >
> > And finally, drivers should never be using pr_*() for messages, they
> > should be using dev_*() instead as they are a driver and have access to
> > a device pointer.
> >
> > thanks,
> >
> > greg k-h
>
> I still wonder what's best...

Just delete them all please, they are obviously not used as no one
rebuilds the source just for this type of thing.

thanks,

greg k-h

2021-03-31 12:19:21

by Fabio Aiuto

[permalink] [raw]
Subject: Re: [PATCH 03/40] staging: rtl8723bs: replace RT_TRACE with public printk wrappers in core/rtw_eeprom.c

On Wed, Mar 31, 2021 at 01:14:18PM +0200, Greg KH wrote:
> On Wed, Mar 31, 2021 at 12:55:51PM +0200, Fabio Aiuto wrote:
> > On Wed, Mar 31, 2021 at 12:27:20PM +0200, Greg KH wrote:
> > > On Wed, Mar 31, 2021 at 11:39:31AM +0200, Fabio Aiuto wrote:
> > > > replace private macro RT_TRACE for tracing with in-kernel
> > > > pr_* printk wrappers
> > > >
> > > > Signed-off-by: Fabio Aiuto <[email protected]>
> > > > ---
> > > > drivers/staging/rtl8723bs/core/rtw_eeprom.c | 26 ++++++++++-----------
> > > > 1 file changed, 13 insertions(+), 13 deletions(-)
> > > >
> > > > diff --git a/drivers/staging/rtl8723bs/core/rtw_eeprom.c b/drivers/staging/rtl8723bs/core/rtw_eeprom.c
> > > > index 3cbd65dee741..6176d741d60e 100644
> > > > --- a/drivers/staging/rtl8723bs/core/rtw_eeprom.c
> > > > +++ b/drivers/staging/rtl8723bs/core/rtw_eeprom.c
> > > > @@ -36,7 +36,7 @@ void shift_out_bits(_adapter *padapter, u16 data, u16 count)
> > > > _func_enter_;
> > > >
> > > > if (padapter->bSurpriseRemoved == true) {
> > > > - RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==true"));
> > > > + pr_err("%s padapter->bSurpriseRemoved==true", DRIVER_PREFIX);
> > >
> > > As Dan said, this is not the same thing. You are now always printing
> > > out this mess, when before you were not unless you explicitly enabled
> > > "tracing".
> >
> > RT_TRACE is enabled if is defined the symbol DEBUG_RTL871X. It doesn't seem to be related
> > to tracing. DEBUG_RTL871X is never declared, is commented out in rtl8723bs/include/autoconf.h
>
> That's a good sign this is never used and should just all be removed.
>
> > that's why RT_TRACE is never printed. If we try to uncomment the symbol definition we have some
> > comiling errors..
>
> What errors do you get?

If I declare DEBUG and DEBUG_RTL871X to activate private tracing..

diff --git a/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c b/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
index 9b16265b543d..f84e0e54cc9c 100644
--- a/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
+++ b/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
@@ -1717,7 +1717,7 @@ s8 phy_get_tx_pwr_lmt(struct adapter *adapter, u32 reg_pwr_tbl_sel,
idx_rate_sctn = get_rate_sctn_idx(data_rate);

if (band_type == BAND_ON_5G && idx_rate_sctn == 0)
- DBG_871X("Wrong rate 0x%x: No CCK in 5G Band\n", DataRate);
+ DBG_871X("Wrong rate 0x%x: No CCK in 5G Band\n", data_rate);

here I have to fix a variable name -----------------------------------^
to let the code compile.

but it won't compile yet, there are more of those errors, in both DBG_871X and
RT_TRACE macro.


/* workaround for wrong index combination to obtain tx power limit, */
/* OFDM only exists in BW 20M */
diff --git a/drivers/staging/rtl8723bs/include/autoconf.h b/drivers/staging/rtl8723bs/include/autoconf.h
index 996198750814..bece2ed1ef88 100644
--- a/drivers/staging/rtl8723bs/include/autoconf.h
+++ b/drivers/staging/rtl8723bs/include/autoconf.h
@@ -45,10 +45,10 @@
* Debug Related Config
*/
#undef DEBUG
-
+#define DEBUG
#ifdef DEBUG
#define DBG 1 /* for ODM & BTCOEX debug */
-/*#define DEBUG_RTL871X */
+#define DEBUG_RTL871X
#else /* !DEBUG */
#define DBG 0 /* for ODM & BTCOEX debug */
#endif /* !DEBUG */

^^^^^^^^^^^^^^^^^------------here hand declaration to reproduce
compiling errors


>
> > > And you are sending it to the error log?
> > >
> > > And finally, drivers should never be using pr_*() for messages, they
> > > should be using dev_*() instead as they are a driver and have access to
> > > a device pointer.
> > >
> > > thanks,
> > >
> > > greg k-h
> >
> > I still wonder what's best...
>
> Just delete them all please, they are obviously not used as no one
> rebuilds the source just for this type of thing.
>
> thanks,
>
> greg k-h

ok I will delete all RT_TRACE call, and even DBG_871X if you agree...

thank you,

fabio

2021-03-31 12:24:34

by Fabio Aiuto

[permalink] [raw]
Subject: Re: [PATCH 03/40] staging: rtl8723bs: replace RT_TRACE with public printk wrappers in core/rtw_eeprom.c

On Wed, Mar 31, 2021 at 12:48:20PM +0200, Greg KH wrote:
> On Wed, Mar 31, 2021 at 12:36:31PM +0200, Fabio Aiuto wrote:
> > On Wed, Mar 31, 2021 at 12:27:20PM +0200, Greg KH wrote:
> > > On Wed, Mar 31, 2021 at 11:39:31AM +0200, Fabio Aiuto wrote:
> > > > replace private macro RT_TRACE for tracing with in-kernel
> > > > pr_* printk wrappers
> > > >
> > > > Signed-off-by: Fabio Aiuto <[email protected]>
> > > > ---
> > > > drivers/staging/rtl8723bs/core/rtw_eeprom.c | 26 ++++++++++-----------
> > > > 1 file changed, 13 insertions(+), 13 deletions(-)
> > > >
> > > > diff --git a/drivers/staging/rtl8723bs/core/rtw_eeprom.c b/drivers/staging/rtl8723bs/core/rtw_eeprom.c
> > > > index 3cbd65dee741..6176d741d60e 100644
> > > > --- a/drivers/staging/rtl8723bs/core/rtw_eeprom.c
> > > > +++ b/drivers/staging/rtl8723bs/core/rtw_eeprom.c
> > > > @@ -36,7 +36,7 @@ void shift_out_bits(_adapter *padapter, u16 data, u16 count)
> > > > _func_enter_;
> > > >
> > > > if (padapter->bSurpriseRemoved == true) {
> > > > - RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==true"));
> >
> > I looked at this ---------------------------------------^
> > and so I thought that pr_err was good...
>
> But you missed the fact that RT_TRACE() does not always spit this stuff
> out.
>
> And I don't know what _drv_err_ is, but tracing messages should never go
> to an error log :)

ok, got it

>
> > my aim was remove private macros replicating component tracing and log levels...
>
> That's a great goal!
>
> > so what's best? Keep a simplyfied RT_TRACE encapsulating a dev_* call?
>
> replace them with dev_dbg() is one way, if they really are even needed
> at all. At this point in time, I would strongly just recommend removing
> them all as no one is using them for anything.
>
> thanks,
>
> greg k-h

I will remove then,

thank you,

fabio

2021-04-01 09:12:35

by Fabio Aiuto

[permalink] [raw]
Subject: Re: [PATCH 03/40] staging: rtl8723bs: replace RT_TRACE with public printk wrappers in core/rtw_eeprom.c

On Wed, Mar 31, 2021 at 01:14:18PM +0200, Greg KH wrote:
> On Wed, Mar 31, 2021 at 12:55:51PM +0200, Fabio Aiuto wrote:
> > On Wed, Mar 31, 2021 at 12:27:20PM +0200, Greg KH wrote:
> > > On Wed, Mar 31, 2021 at 11:39:31AM +0200, Fabio Aiuto wrote:
> > > > replace private macro RT_TRACE for tracing with in-kernel
> > > > pr_* printk wrappers
> > > >
> > > > Signed-off-by: Fabio Aiuto <[email protected]>
> > > > ---
> > > > drivers/staging/rtl8723bs/core/rtw_eeprom.c | 26 ++++++++++-----------
> > > > 1 file changed, 13 insertions(+), 13 deletions(-)
> > > >
> > > > diff --git a/drivers/staging/rtl8723bs/core/rtw_eeprom.c b/drivers/staging/rtl8723bs/core/rtw_eeprom.c
> > > > index 3cbd65dee741..6176d741d60e 100644
> > > > --- a/drivers/staging/rtl8723bs/core/rtw_eeprom.c
> > > > +++ b/drivers/staging/rtl8723bs/core/rtw_eeprom.c
> > > > @@ -36,7 +36,7 @@ void shift_out_bits(_adapter *padapter, u16 data, u16 count)
> > > > _func_enter_;
> > > >
> > > > if (padapter->bSurpriseRemoved == true) {
> > > > - RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==true"));
> > > > + pr_err("%s padapter->bSurpriseRemoved==true", DRIVER_PREFIX);
> > >
> > > As Dan said, this is not the same thing. You are now always printing
> > > out this mess, when before you were not unless you explicitly enabled
> > > "tracing".
> >
> > RT_TRACE is enabled if is defined the symbol DEBUG_RTL871X. It doesn't seem to be related
> > to tracing. DEBUG_RTL871X is never declared, is commented out in rtl8723bs/include/autoconf.h
>
> That's a good sign this is never used and should just all be removed.
>
> > that's why RT_TRACE is never printed. If we try to uncomment the symbol definition we have some
> > comiling errors..
>
> What errors do you get?
>
> > > And you are sending it to the error log?
> > >
> > > And finally, drivers should never be using pr_*() for messages, they
> > > should be using dev_*() instead as they are a driver and have access to
> > > a device pointer.
> > >
> > > thanks,
> > >
> > > greg k-h
> >
> > I still wonder what's best...
>
> Just delete them all please, they are obviously not used as no one
> rebuilds the source just for this type of thing.
>
> thanks,
>
> greg k-h

Hi Greg,

I will send a brand new patchset, not a v2, for the pourpose is changed.

Thank you,

fabio