2021-03-31 09:36:07

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 0/2] staging: rtl8723bs: replace private macro with print_hex_dump_debug

this patchset replaces RT_PRINT_DATA private macro for dump hex values
with the kernel helper used for this pourpose.

Fabio Aiuto (2):
staging: rtl8723bs: use print_hex_dump_debug instead of private
RT_PRINT_DATA
staging: rtl8723bs: remove unused macro RT_PRINT_DATA

drivers/staging/rtl8723bs/hal/hal_com.c | 13 ++++-------
drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c | 22 ++++++++++++++-----
.../staging/rtl8723bs/hal/rtl8723b_hal_init.c | 3 ++-
drivers/staging/rtl8723bs/include/rtw_debug.h | 19 ----------------
4 files changed, 22 insertions(+), 35 deletions(-)

--
2.20.1


2021-03-31 09:36:16

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 1/2] staging: rtl8723bs: use print_hex_dump_debug instead of private RT_PRINT_DATA

replace private macro RT_PRINT_DATA with in-kernel helper
print_hex_dump_debug

Signed-off-by: Fabio Aiuto <[email protected]>
---
drivers/staging/rtl8723bs/hal/hal_com.c | 13 ++++-------
drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c | 22 ++++++++++++++-----
.../staging/rtl8723bs/hal/rtl8723b_hal_init.c | 3 ++-
3 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/hal_com.c b/drivers/staging/rtl8723bs/hal/hal_com.c
index 98a363698843..e74d7e21372d 100644
--- a/drivers/staging/rtl8723bs/hal/hal_com.c
+++ b/drivers/staging/rtl8723bs/hal/hal_com.c
@@ -924,13 +924,8 @@ s32 c2h_evt_read_88xx(struct adapter *adapter, u8 *buf)
c2h_evt->seq = rtw_read8(adapter, REG_C2HEVT_CMD_SEQ_88XX);
c2h_evt->plen = rtw_read8(adapter, REG_C2HEVT_CMD_LEN_88XX);

- RT_PRINT_DATA(
- _module_hal_init_c_,
- _drv_info_,
- "c2h_evt_read(): ",
- &c2h_evt,
- sizeof(c2h_evt)
- );
+ print_hex_dump_debug(DRIVER_PREFIX ": c2h_evt_read(): ", DUMP_PREFIX_NONE,
+ 16, 1, &c2h_evt, sizeof(c2h_evt), false);

DBG_871X(
"%s id:%u, len:%u, seq:%u, trigger:0x%02x\n",
@@ -945,8 +940,8 @@ s32 c2h_evt_read_88xx(struct adapter *adapter, u8 *buf)
for (i = 0; i < c2h_evt->plen; i++)
c2h_evt->payload[i] = rtw_read8(adapter, REG_C2HEVT_MSG_NORMAL + 2 + i);

- RT_PRINT_DATA(_module_hal_init_c_, _drv_info_, "c2h_evt_read(): Command Content:\n",
- c2h_evt->payload, c2h_evt->plen);
+ print_hex_dump_debug(DRIVER_PREFIX ": c2h_evt_read(): Command Content:\n",
+ DUMP_PREFIX_NONE, 16, 1, c2h_evt->payload, c2h_evt->plen, false);

ret = _SUCCESS;

diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c b/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c
index 202974ccb739..88f908fd14e3 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c
@@ -336,7 +336,9 @@ static void rtl8723b_set_FwRsvdPage_cmd(struct adapter *padapter, struct rsvdpag
SET_8723B_H2CCMD_RSVDPAGE_LOC_QOS_NULL_DATA(u1H2CRsvdPageParm, rsvdpageloc->LocQosNull);
SET_8723B_H2CCMD_RSVDPAGE_LOC_BT_QOS_NULL_DATA(u1H2CRsvdPageParm, rsvdpageloc->LocBTQosNull);

- RT_PRINT_DATA(_module_hal_init_c_, _drv_always_, "u1H2CRsvdPageParm:", u1H2CRsvdPageParm, H2C_RSVDPAGE_LOC_LEN);
+ print_hex_dump_debug(DRIVER_PREFIX ": u1H2CRsvdPageParm:", DUMP_PREFIX_NONE,
+ 16, 1, u1H2CRsvdPageParm, H2C_RSVDPAGE_LOC_LEN, false);
+
FillH2CCmd8723B(padapter, H2C_8723B_RSVD_PAGE, H2C_RSVDPAGE_LOC_LEN, u1H2CRsvdPageParm);
}

@@ -356,7 +358,9 @@ void rtl8723b_set_FwMediaStatusRpt_cmd(struct adapter *padapter, u8 mstatus, u8
SET_8723B_H2CCMD_MSRRPT_PARM_MACID(u1H2CMediaStatusRptParm, macid);
SET_8723B_H2CCMD_MSRRPT_PARM_MACID_END(u1H2CMediaStatusRptParm, macid_end);

- RT_PRINT_DATA(_module_hal_init_c_, _drv_always_, "u1H2CMediaStatusRptParm:", u1H2CMediaStatusRptParm, H2C_MEDIA_STATUS_RPT_LEN);
+ print_hex_dump_debug(DRIVER_PREFIX ": u1H2CMediaStatusRptParm:", DUMP_PREFIX_NONE,
+ 16, 1, u1H2CMediaStatusRptParm, H2C_MEDIA_STATUS_RPT_LEN, false);
+
FillH2CCmd8723B(padapter, H2C_8723B_MEDIA_STATUS_RPT, H2C_MEDIA_STATUS_RPT_LEN, u1H2CMediaStatusRptParm);
}

@@ -375,7 +379,9 @@ void rtl8723b_set_FwMacIdConfig_cmd(struct adapter *padapter, u8 mac_id, u8 raid
SET_8723B_H2CCMD_MACID_CFG_RATE_MASK2(u1H2CMacIdConfigParm, (u8)((mask & 0x00ff0000) >> 16));
SET_8723B_H2CCMD_MACID_CFG_RATE_MASK3(u1H2CMacIdConfigParm, (u8)((mask & 0xff000000) >> 24));

- RT_PRINT_DATA(_module_hal_init_c_, _drv_always_, "u1H2CMacIdConfigParm:", u1H2CMacIdConfigParm, H2C_MACID_CFG_LEN);
+ print_hex_dump_debug(DRIVER_PREFIX ": u1H2CMacIdConfigParm:", DUMP_PREFIX_NONE,
+ 16, 1, u1H2CMacIdConfigParm, H2C_MACID_CFG_LEN, false);
+
FillH2CCmd8723B(padapter, H2C_8723B_MACID_CFG, H2C_MACID_CFG_LEN, u1H2CMacIdConfigParm);
}

@@ -393,7 +399,9 @@ void rtl8723b_set_rssi_cmd(struct adapter *padapter, u8 *param)
SET_8723B_H2CCMD_RSSI_SETTING_RSSI(u1H2CRssiSettingParm, rssi);
SET_8723B_H2CCMD_RSSI_SETTING_ULDL_STATE(u1H2CRssiSettingParm, uldl_state);

- RT_PRINT_DATA(_module_hal_init_c_, _drv_notice_, "u1H2CRssiSettingParm:", u1H2CRssiSettingParm, H2C_RSSI_SETTING_LEN);
+ print_hex_dump_debug(DRIVER_PREFIX ": u1H2CRssiSettingParm:", DUMP_PREFIX_NONE,
+ 16, 1, u1H2CRssiSettingParm, H2C_RSSI_SETTING_LEN, false);
+
FillH2CCmd8723B(padapter, H2C_8723B_RSSI_SETTING, H2C_RSSI_SETTING_LEN, u1H2CRssiSettingParm);
}

@@ -514,7 +522,8 @@ void rtl8723b_set_FwPwrMode_cmd(struct adapter *padapter, u8 psmode)

hal_btcoex_RecordPwrMode(padapter, u1H2CPwrModeParm, H2C_PWRMODE_LEN);

- RT_PRINT_DATA(_module_hal_init_c_, _drv_always_, "u1H2CPwrModeParm:", u1H2CPwrModeParm, H2C_PWRMODE_LEN);
+ print_hex_dump_debug(DRIVER_PREFIX ": u1H2CPwrModeParm:", DUMP_PREFIX_NONE,
+ 16, 1, u1H2CPwrModeParm, H2C_PWRMODE_LEN, false);

FillH2CCmd8723B(padapter, H2C_8723B_SET_PWR_MODE, H2C_PWRMODE_LEN, u1H2CPwrModeParm);
}
@@ -535,7 +544,8 @@ void rtl8723b_set_FwPsTuneParam_cmd(struct adapter *padapter)
SET_8723B_H2CCMD_PSTUNE_PARM_ADOPT(u1H2CPsTuneParm, 1);
SET_8723B_H2CCMD_PSTUNE_PARM_DTIM_PERIOD(u1H2CPsTuneParm, dtim_period);

- RT_PRINT_DATA(_module_hal_init_c_, _drv_always_, "u1H2CPsTuneParm:", u1H2CPsTuneParm, H2C_PSTUNEPARAM_LEN);
+ print_hex_dump_debug(DRIVER_PREFIX ": u1H2CPsTuneParm:", DUMP_PREFIX_NONE,
+ 16, 1, u1H2CPsTuneParm, H2C_PSTUNEPARAM_LEN, false);

FillH2CCmd8723B(padapter, H2C_8723B_PS_TUNING_PARA, H2C_PSTUNEPARAM_LEN, u1H2CPsTuneParm);
}
diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
index 0081fe0a431f..0273118e70af 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
@@ -3676,7 +3676,8 @@ void C2HPacketHandler_8723B(struct adapter *padapter, u8 *pbuffer, u16 length)

/* DBG_871X("%s C2hEvent.CmdID:%x C2hEvent.CmdLen:%x C2hEvent.CmdSeq:%x\n", */
/* __func__, C2hEvent.CmdID, C2hEvent.CmdLen, C2hEvent.CmdSeq); */
- RT_PRINT_DATA(_module_hal_init_c_, _drv_notice_, "C2HPacketHandler_8723B(): Command Content:\n", tmpBuf, C2hEvent.CmdLen);
+ print_hex_dump_debug(DRIVER_PREFIX ": C2HPacketHandler_8723B(): Command Content:\n",
+ DUMP_PREFIX_NONE, 16, 1, tmpBuf, C2hEvent.CmdLen, false);

process_c2h_event(padapter, &C2hEvent, tmpBuf);
/* c2h_handler_8723b(padapter,&C2hEvent); */
--
2.20.1

2021-03-31 09:36:32

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 2/2] staging: rtl8723bs: remove unused macro RT_PRINT_DATA

remove unused macro declaration: RT_PRINT_DATA

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

diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h
index d1c557818305..4c0857241922 100644
--- a/drivers/staging/rtl8723bs/include/rtw_debug.h
+++ b/drivers/staging/rtl8723bs/include/rtw_debug.h
@@ -231,25 +231,6 @@
} while (0)

#endif /* defined(_dbgdump) && defined(_MODULE_DEFINE_) */
-
-
-#if defined(_dbgdump)
- #undef RT_PRINT_DATA
- #define RT_PRINT_DATA(_Comp, _Level, _TitleString, _HexData, _HexDataLen) \
- if (((_Comp) & GlobalDebugComponents) && (_Level <= GlobalDebugLevel)) \
- { \
- int __i; \
- u8 *ptr = (u8 *)_HexData; \
- _dbgdump("%s", DRIVER_PREFIX); \
- _dbgdump(_TitleString); \
- for (__i = 0; __i < (int)_HexDataLen; __i++) \
- { \
- _dbgdump("%02X%s", ptr[__i], (((__i + 1) % 4) == 0)?" ":" "); \
- if (((__i + 1) % 16) == 0) _dbgdump("\n"); \
- } \
- _dbgdump("\n"); \
- }
-#endif /* defined(_dbgdump) */
#endif /* DEBUG_RTL871X */

void dump_drv_version(void *sel);
--
2.20.1

2021-04-01 09:03:57

by Fabio Aiuto

[permalink] [raw]
Subject: Re: [PATCH 0/2] staging: rtl8723bs: replace private macro with print_hex_dump_debug

On Wed, Mar 31, 2021 at 11:34:05AM +0200, Fabio Aiuto wrote:
> this patchset replaces RT_PRINT_DATA private macro for dump hex values
> with the kernel helper used for this pourpose.
>
> Fabio Aiuto (2):
> staging: rtl8723bs: use print_hex_dump_debug instead of private
> RT_PRINT_DATA
> staging: rtl8723bs: remove unused macro RT_PRINT_DATA
>
> drivers/staging/rtl8723bs/hal/hal_com.c | 13 ++++-------
> drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c | 22 ++++++++++++++-----
> .../staging/rtl8723bs/hal/rtl8723b_hal_init.c | 3 ++-
> drivers/staging/rtl8723bs/include/rtw_debug.h | 19 ----------------
> 4 files changed, 22 insertions(+), 35 deletions(-)
>
> --
> 2.20.1
>

Hi Greg,

please drop this, I will send you a v2 soon.

Thank you,

fabio