staging: rtl8723bs: monolithic HAL cleanup and tx power limit fix
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest61 patches 5 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/61 | staging: rtl8723bs: remove redundant rtw_ap_set_group_key wrapperdrivers/ drivers/ drivers/ | +8 | 2 replies | |
| 2/61 | staging: rtl8723bs: replace is_same_ess with rtw_ssid_differdrivers/ | +7 | 0 replies | |
| 3/61 | staging: rtl8723bs: remove redundant rtw_to_roam wrapperdrivers/ drivers/ drivers/ +1 more | +13 | 0 replies | |
| 4/61 | staging: rtl8723bs: remove redundant rtw_dec_to_roam helperdrivers/ drivers/ | +5 | 0 replies | |
| 5/61 | staging: rtl8723bs: remove unused OnAtim stub functiondrivers/ drivers/ | +1 | 0 replies | |
| 6/61 | staging: rtl8723bs: remove DoReserved stub and clean up OnAction_tbldrivers/ drivers/ | +3 | 0 replies | |
| 7/61 | staging: rtl8723bs: remove redundant issue_deauth wrapperdrivers/ drivers/ drivers/ +1 more | +22 | 0 replies | |
| 8/61 | staging: rtl8723bs: remove unused NULL_hdl functiondrivers/ drivers/ drivers/ | +7 | 0 replies | |
| 9/61 | staging: rtl8723bs: remove unused set_csa_hdl functiondrivers/ drivers/ drivers/ | +1 | 0 replies | |
| 10/61 | staging: rtl8723bs: remove unused tdls_hdl functiondrivers/ drivers/ drivers/ | +2 | 0 replies | |
| 11/61 | staging: rtl8723bs: inline rtw_ps_deny_get() and remove dead codedrivers/ drivers/ | +1 | 0 replies | |
| 12/61 | staging: rtl8723bs: replace custom CMAC with kernel Crypto API helperdrivers/ drivers/ drivers/ | +18 | 0 replies | |
| 13/61 | staging: rtl8723bs: remove redundant rtw_get_oper_ch() wrapperdrivers/ drivers/ drivers/ +2 more | +8 | 0 replies | |
| 14/61 | staging: rtl8723bs: remove ODM_CheckPowerStatus and dead branchesdrivers/ | +0 | 0 replies | |
| 15/61 | staging: rtl8723bs: remove unimplemented halbtcoutsrc_GetBtReg helperdrivers/ | +1 | 0 replies | |
| 16/61 | staging: rtl8723bs: remove rtw_free_evt_priv wrapper and rename helperdrivers/ drivers/ | +1 | 0 replies | |
| 17/61 | staging: rtl8723bs: remove rtw_free_cmd_priv wrapper and rename helperdrivers/ drivers/ | +1 | 0 replies | |
| 18/61 | staging: rtl8723bs: replace rtw_dm_in_lps_hdl with direct hal calldrivers/ | +1 | 0 replies | |
| 19/61 | staging: rtl8723bs: make lps_ctrl_wk_hdl() staticdrivers/ | +1 | 0 replies | |
| 20/61 | staging: rtl8723bs: sanitize and align efuse read function headersdrivers/ | +4 | 0 replies | |
| 21/61 | staging: rtl8723bs: replace rtw_reset_continual_io_error with atomic_setdrivers/ drivers/ drivers/ +1 more | +4 | 0 replies | |
| 22/61 | staging: rtl8723bs: inline single-use init_mlme_default_rate_setdrivers/ drivers/ | +20 | 0 replies | |
| 23/61 | staging: rtl8723bs: remove issue_probereq wrapper and rename helperdrivers/ drivers/ | +15 | 0 replies | |
| 24/61 | staging: rtl8723bs: remove register_task_alive inline helperdrivers/ | +3 | 0 replies | |
| 25/61 | staging: rtl8723bs: remove unregister_task_alive inline helperdrivers/ | +3 | 0 replies | |
| 26/61 | staging: rtl8723bs: clean up Michael MIC pseudo header logicdrivers/ drivers/ drivers/ | +26 | 0 replies | |
| 27/61 | staging: rtl8723bs: replace rtw_set_oper_bw with direct assignmentdrivers/ drivers/ | +2 | 0 replies | |
| 28/61 | staging: rtl8723bs: inline single-use _clear_cam_entry helperdrivers/ drivers/ | +4 | 0 replies | |
| 29/61 | staging: rtl8723bs: collapse set_sta_rate and Update_RA_Entry wrappersdrivers/ drivers/ drivers/ +2 more | +4 | 0 replies | |
| 30/61 | staging: rtl8723bs: replace correct_TSF with direct HAL calldrivers/ drivers/ drivers/ | +2 | 0 replies | |
| 31/61 | staging: rtl8723bs: replace rtw_sctx_done with direct status calldrivers/ drivers/ drivers/ | +1 | 0 replies | |
| 32/61 | staging: rtl8723bs: remove rtw_free_mlme_priv wrapper and rename helperdrivers/ drivers/ | +1 | 0 replies | |
| 33/61 | staging: rtl8723bs: remove duplicate prototype of rtw_free_network_nolockdrivers/ | +0 | 0 replies | |
| 34/61 | staging: rtl8723bs: replace rtw_get_beacon_interval_from_ie with definedrivers/ drivers/ drivers/ +3 more | +11 | 0 replies | |
| 35/61 | staging: rtl8723bs: inline _rtw_free_network_nolock into wrapperdrivers/ drivers/ | +12 | 0 replies | |
| 36/61 | staging: rtl8723bs: remove rtw_wmm_event_callback and update handlerdrivers/ drivers/ drivers/ +2 more | +4 | 0 replies | |
| 37/61 | staging: rtl8723bs: replace halbtc8723b1ant_SwMechanism with direct calldrivers/ | +5 | 0 replies | |
| 38/61 | staging: rtl8723bs: remove redundant ternary operators from bool returnsdrivers/ drivers/ drivers/ +8 more | +25 | 0 replies | |
| 39/61 | staging: rtl8723bs: remove redundant DM wrapperdrivers/ drivers/ drivers/ | +2 | 0 replies | |
| 40/61 | staging: rtl8723bs: remove EXhalbtc8723b2ant_InitHwConfigdrivers/ drivers/ drivers/ | +7 | 0 replies | |
| 41/61 | staging: rtl8723bs: remove EXhalbtc8723b1ant_InitHwConfigdrivers/ drivers/ drivers/ | +4 | 0 replies | |
| 42/61 | staging: rtl8723bs: remove ConfigureTxpowerTrack wrapperdrivers/ drivers/ | +2 | 0 replies | |
| 43/61 | staging: rtl8723bs: remove hal_init_macaddr wrapperdrivers/ drivers/ drivers/ | +2 | 0 replies | |
| 44/61 | staging: rtl8723bs: remove rtw_init_hal_com_default_valuedrivers/ drivers/ drivers/ | +5 | 0 replies | |
| 45/61 | staging: rtl8723bs: remove c2h_evt_clear wrapperdrivers/ drivers/ drivers/ | +2 | 0 replies | |
| 46/61 | staging: rtl8723bs: remove rtw_get_mgntframe_raid helperdrivers/ drivers/ drivers/ | +1 | 0 replies | |
| 47/61 | staging: rtl8723bs: clean up phy power conversion functiondrivers/ | +11 | 0 replies | |
| 48/61 | staging: rtl8723bs: remove PHY_TxPowerByRateConfiguration wrapperdrivers/ drivers/ drivers/ +1 more | +10 | 0 replies | |
| 49/61 | staging: rtl8723bs: remove phy_GetChannelIndexOfTxPowerLimit helperdrivers/ | +3 | 0 replies | |
| 50/61 | staging: rtl8723bs: inline SetHwReg8723BS into rtw_hal_set_hwregdrivers/ drivers/ drivers/ +2 more | +37 | 0 replies | |
| 51/61 | staging: rtl8723bs: inline GetHwReg8723BS into rtw_hal_get_hwregdrivers/ drivers/ drivers/ | +15 | 0 replies | |
| 52/61 | staging: rtl8723bs: inline SetHwRegWithBuf8723B into helperdrivers/ drivers/ drivers/ | +7 | 0 replies | |
| 53/61 | staging: rtl8723bs: inline GetHalDefVar8723BSDIO into helperdrivers/ drivers/ drivers/ | +18 | 0 replies | |
| 54/61 | staging: rtl8723bs: inline SetHalODMVar into rtw_hal_set_odm_vardrivers/ drivers/ drivers/ | +32 | 0 replies | |
| 55/61 | staging: rtl8723bs: inline CheckIPSStatus logic with definesdrivers/ drivers/ drivers/ | +4 | 0 replies | |
| 56/61 | staging: rtl8723bs: inline rtl8723bs_hal_xmitframe_enqueue helperdrivers/ drivers/ drivers/ | +13 | 0 replies | |
| 57/61 | staging: rtl8723bs: inline rtl8723bs_hal_xmit into rtw_hal_xmitdrivers/ drivers/ drivers/ | +27 | 0 replies | |
| 58/61 | staging: rtl8723bs: extend rtw_hal_mgnt_xmit functionalitydrivers/ drivers/ drivers/ +1 more | +7 | 0 replies | |
| 59/61 | staging: rtl8723bs: inline rtl8723bs_init_xmit_priv helperdrivers/ drivers/ drivers/ +3 more | +121 | 0 replies | |
| 60/61 | staging: rtl8723bs: inline recv private data freeing helperdrivers/ drivers/ drivers/ +4 more | +50 | 0 replies | |
| 61/61 | staging: rtl8723bs: fix tx power limit lookup by using correct channel indexdrivers/ | +1 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 00/61] staging: rtl8723bs: monolithic HAL cleanup and tx power limit fix
Hello,
This patch series performs a massive, systematic cleanup of the legacy vendor HAL layer and redundant abstraction wrappers in the rtl8723bs driver, concluding with a functional fix for the TX power limit lookup.
The primary goal of this refactoring is to drastically improve the readability and maintainability of the codebase, transforming the highly tangled, Windows-legacy Realtek abstractions into a cleaner, more idiomatic Linux driver structure.
KEY CHANGES IN THIS SERIES:
1. Dead Code & Stub Removal: Eliminated several unimplemented functions, empty stubs (like OnAtim, DoReserved), duplicate prototypes, and completely unused helpers (NULL_hdl, set_csa_hdl, tdls_hdl).
2. Wrapper Collapse & Inlining: Removed multiple layers of superficial wrappers around core operations (e.g., rtw_ap_set_group_key, issue_deauth, issue_probereq, rtw_free_mlme_priv, etc.). High-frequency or single-use HAL entry points (like SetHwReg8723BS, GetHwReg8723BS, and xmit helpers) have been carefully inlined directly into their respective dispatchers to enhance readability.
3. Scope & Warning Fixes: Restructured local functions (like lps_ctrl_wk_hdl) by marking them static and aligning headers, which resolves missing-prototypes compiler warnings.
4. Logical Fixes: In the final patch, a critical copy-paste bug in phy_get_tx_pwr_lmt() was resolved. The computed channel index from phy_GetChannelIndexOfTxPowerLimit() was mistakenly assigned back to the 'channel' parameter and discarded, leaving 'idx_channel' at -1. This caused the function to always fail validation and return MAX_POWER_INDEX. Correcting this restores the intended hardware tx power limit logic and resolves a compiler warning.
5. Refined Abstractions: In places where removing a wrapper would decrease overall elegance or require awkward type workarounds, the cleanest architectural approach was intentionally preserved.
TESTING & VERIFICATION:
- Hardware: I do not possess the physical rtl8723bs hardware, so real-world runtime wireless testing was not performed.
- Compilation: The entire series compiles flawlessly against the latest tree.
- Code Style: All 61 patches have been fully validated with scripts/checkpatch.pl and return 0 errors / 0 warnings per patch. (Note: A few pre-existing vendor style warnings remain in the modified files, but no new ones were introduced).
This cleanup significantly reduces the boilerplate footprint, making future maintenance and eventual mac80211 migration tasks much more approachable.
Please review.
Thanks,
Arsenii
Arsenii Pashchenko (61):
staging: rtl8723bs: remove redundant rtw_ap_set_group_key wrapper
staging: rtl8723bs: replace is_same_ess with rtw_ssid_differ
staging: rtl8723bs: remove redundant rtw_to_roam wrapper
staging: rtl8723bs: remove redundant rtw_dec_to_roam helper
staging: rtl8723bs: remove unused OnAtim stub function
staging: rtl8723bs: remove DoReserved stub and clean up OnAction_tbl
staging: rtl8723bs: remove redundant issue_deauth wrapper
staging: rtl8723bs: remove unused NULL_hdl function
staging: rtl8723bs: remove unused set_csa_hdl function
staging: rtl8723bs: remove unused tdls_hdl function
staging: rtl8723bs: inline rtw_ps_deny_get() and remove dead code
staging: rtl8723bs: replace custom CMAC with kernel Crypto API helper
staging: rtl8723bs: remove redundant rtw_get_oper_ch() wrapper
staging: rtl8723bs: remove ODM_CheckPowerStatus and dead branches
staging: rtl8723bs: remove unimplemented halbtcoutsrc_GetBtReg helper
staging: rtl8723bs: remove rtw_free_evt_priv wrapper and rename helper
staging: rtl8723bs: remove rtw_free_cmd_priv wrapper and rename helper
staging: rtl8723bs: replace rtw_dm_in_lps_hdl with direct hal call
staging: rtl8723bs: make lps_ctrl_wk_hdl() static
staging: rtl8723bs: sanitize and align efuse read function headers
staging: rtl8723bs: replace rtw_reset_continual_io_error with
atomic_set
staging: rtl8723bs: inline single-use init_mlme_default_rate_set
staging: rtl8723bs: remove issue_probereq wrapper and rename helper
staging: rtl8723bs: remove register_task_alive inline helper
staging: rtl8723bs: remove unregister_task_alive inline helper
staging: rtl8723bs: clean up Michael MIC pseudo header logic
staging: rtl8723bs: replace rtw_set_oper_bw with direct assignment
staging: rtl8723bs: inline single-use _clear_cam_entry helper
staging: rtl8723bs: collapse set_sta_rate and Update_RA_Entry wrappers
staging: rtl8723bs: replace correct_TSF with direct HAL call
staging: rtl8723bs: replace rtw_sctx_done with direct status call
staging: rtl8723bs: remove rtw_free_mlme_priv wrapper and rename
helper
staging: rtl8723bs: remove duplicate prototype of
rtw_free_network_nolock
staging: rtl8723bs: replace rtw_get_beacon_interval_from_ie with
define
staging: rtl8723bs: inline _rtw_free_network_nolock into wrapper
staging: rtl8723bs: remove rtw_wmm_event_callback and update handler
staging: rtl8723bs: replace halbtc8723b1ant_SwMechanism with direct
call
staging: rtl8723bs: remove redundant ternary operators from bool
returns
staging: rtl8723bs: remove redundant DM wrapper
staging: rtl8723bs: remove EXhalbtc8723b2ant_InitHwConfig
staging: rtl8723bs: remove EXhalbtc8723b1ant_InitHwConfig
staging: rtl8723bs: remove ConfigureTxpowerTrack wrapper
staging: rtl8723bs: remove hal_init_macaddr wrapper
staging: rtl8723bs: remove rtw_init_hal_com_default_value
staging: rtl8723bs: remove c2h_evt_clear wrapper
staging: rtl8723bs: remove rtw_get_mgntframe_raid helper
staging: rtl8723bs: clean up phy power conversion function
staging: rtl8723bs: remove PHY_TxPowerByRateConfiguration wrapper
staging: rtl8723bs: remove phy_GetChannelIndexOfTxPowerLimit helper
staging: rtl8723bs: inline SetHwReg8723BS into rtw_hal_set_hwreg
staging: rtl8723bs: inline GetHwReg8723BS into rtw_hal_get_hwreg
staging: rtl8723bs: inline SetHwRegWithBuf8723B into helper
staging: rtl8723bs: inline GetHalDefVar8723BSDIO into helper
staging: rtl8723bs: inline SetHalODMVar into rtw_hal_set_odm_var
staging: rtl8723bs: inline CheckIPSStatus logic with defines
staging: rtl8723bs: inline rtl8723bs_hal_xmitframe_enqueue helper
staging: rtl8723bs: inline rtl8723bs_hal_xmit into rtw_hal_xmit
staging: rtl8723bs: extend rtw_hal_mgnt_xmit functionality
staging: rtl8723bs: inline rtl8723bs_init_xmit_priv helper
staging: rtl8723bs: inline recv private data freeing helper
staging: rtl8723bs: fix tx power limit lookup by using correct channel
index
drivers/staging/rtl8723bs/core/rtw_ap.c | 19 +- drivers/staging/rtl8723bs/core/rtw_cmd.c | 43 +-- drivers/staging/rtl8723bs/core/rtw_efuse.c | 30 +- drivers/staging/rtl8723bs/core/rtw_io.c | 6 - .../staging/rtl8723bs/core/rtw_ioctl_set.c | 4 +- drivers/staging/rtl8723bs/core/rtw_mlme.c | 99 ++---- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 144 +++----- drivers/staging/rtl8723bs/core/rtw_pwrctrl.c | 34 +- drivers/staging/rtl8723bs/core/rtw_recv.c | 47 ++- drivers/staging/rtl8723bs/core/rtw_security.c | 142 +------- .../staging/rtl8723bs/core/rtw_wlan_util.c | 56 +-- drivers/staging/rtl8723bs/core/rtw_xmit.c | 7 +- .../staging/rtl8723bs/hal/HalBtc8723b1Ant.c | 25 +- .../staging/rtl8723bs/hal/HalBtc8723b1Ant.h | 5 +- .../staging/rtl8723bs/hal/HalBtc8723b2Ant.c | 18 +- .../staging/rtl8723bs/hal/HalBtc8723b2Ant.h | 5 +- drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h | 11 +- drivers/staging/rtl8723bs/hal/HalPhyRf.c | 7 +- drivers/staging/rtl8723bs/hal/HalPhyRf.h | 1 - .../staging/rtl8723bs/hal/HalPhyRf_8723B.c | 8 - drivers/staging/rtl8723bs/hal/hal_btcoex.c | 13 +- drivers/staging/rtl8723bs/hal/hal_com.c | 66 +--- .../staging/rtl8723bs/hal/hal_com_phycfg.c | 40 +-- drivers/staging/rtl8723bs/hal/hal_intf.c | 334 +++++++++++++++++- drivers/staging/rtl8723bs/hal/odm_HWConfig.c | 2 +- drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c | 32 +- .../staging/rtl8723bs/hal/rtl8723b_hal_init.c | 4 +- .../staging/rtl8723bs/hal/rtl8723b_phycfg.c | 7 +- .../staging/rtl8723bs/hal/rtl8723bs_recv.c | 123 +------ .../staging/rtl8723bs/hal/rtl8723bs_xmit.c | 115 ------ drivers/staging/rtl8723bs/hal/sdio_halinit.c | 110 +----- drivers/staging/rtl8723bs/hal/sdio_ops.c | 16 - drivers/staging/rtl8723bs/include/cmd_osdep.h | 2 - drivers/staging/rtl8723bs/include/hal_com.h | 10 +- .../rtl8723bs/include/hal_com_phycfg.h | 1 - drivers/staging/rtl8723bs/include/hal_intf.h | 4 - drivers/staging/rtl8723bs/include/ieee80211.h | 6 +- .../staging/rtl8723bs/include/rtl8723b_cmd.h | 1 - .../staging/rtl8723bs/include/rtl8723b_hal.h | 6 + .../staging/rtl8723bs/include/rtl8723b_recv.h | 3 +- .../staging/rtl8723bs/include/rtl8723b_xmit.h | 5 +- drivers/staging/rtl8723bs/include/rtw_ap.h | 2 +- drivers/staging/rtl8723bs/include/rtw_io.h | 2 +- drivers/staging/rtl8723bs/include/rtw_mlme.h | 11 +- .../staging/rtl8723bs/include/rtw_mlme_ext.h | 23 +- .../staging/rtl8723bs/include/rtw_pwrctrl.h | 3 +- .../staging/rtl8723bs/include/rtw_security.h | 10 +- drivers/staging/rtl8723bs/include/rtw_xmit.h | 2 +- drivers/staging/rtl8723bs/include/sdio_ops.h | 4 +- .../staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 16 +- drivers/staging/rtl8723bs/os_dep/os_intfs.c | 7 +- .../staging/rtl8723bs/os_dep/osdep_service.c | 4 +- drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 2 +- .../staging/rtl8723bs/os_dep/sdio_ops_linux.c | 4 +- 54 files changed, 626 insertions(+), 1075 deletions(-)
Signature · 1 line
2.55.0