[PATCH rtw-next 0/6] wifi: rtlwifi: replace the 802.11 header helper macros with kernel ones

From: Rishik Yechuri

Date: Tue Nov 10 2026 - 13:52:41 EST


base.h and wifi.h carry a few helper macros that duplicate things the
kernel already provides. The reserved page builders in the fw.c files
write MAC addresses and the PS Poll AID into their frame templates at
hand counted byte offsets, there is a private alias for
msecs_to_jiffies(), a private rounding macro and a private frame type
test. Some more are defined but not used anywhere.

This series switches each of them over to the kernel equivalent and
then removes the macro.

Patch 1 uses struct ieee80211_pspoll for the PS Poll template. Its aid
member is __le16, so this one is more than a cleanup on big endian
hosts, where the old macro stored the AID in host byte order. On little
endian hosts the bytes written are the same as before.

Patch 2 uses struct ieee80211_hdr and ether_addr_copy() for the other
templates and removes CP_MACADDR() and the FRAME_OFFSET_* constants.

Patches 3 to 5 replace MSECS(), N_BYTE_ALIGMENT() and WLAN_FC_GET_TYPE()
with msecs_to_jiffies(), ALIGN() and ieee80211_is_ctl().

Patch 6 open codes the one use of byte() and removes it together with
two macros that have no users left.

Each patch builds cleanly with W=1 and sparse. I do not have any of
these chips, so this is compile tested only.

Rishik Yechuri (6):
wifi: rtlwifi: use struct ieee80211_pspoll for the PS Poll reserved
page
wifi: rtlwifi: use struct ieee80211_hdr for the reserved page headers
wifi: rtlwifi: call msecs_to_jiffies() directly
wifi: rtlwifi: rtl8192se: use ALIGN() for the H2C command length
wifi: rtlwifi: use ieee80211_is_ctl() instead of WLAN_FC_GET_TYPE()
wifi: rtlwifi: remove byte(), packet_get_type() and
FILL_OCTET_STRING()

drivers/net/wireless/realtek/rtlwifi/base.c | 2 +-
drivers/net/wireless/realtek/rtlwifi/base.h | 21 ----
drivers/net/wireless/realtek/rtlwifi/core.c | 2 +-
drivers/net/wireless/realtek/rtlwifi/ps.c | 6 +-
.../wireless/realtek/rtlwifi/rtl8188ee/dm.c | 2 +-
.../wireless/realtek/rtlwifi/rtl8188ee/fw.c | 38 +++---
.../wireless/realtek/rtlwifi/rtl8188ee/hw.c | 6 +-
.../realtek/rtlwifi/rtl8192c/fw_common.c | 38 +++---
.../wireless/realtek/rtlwifi/rtl8192ce/trx.c | 5 +-
.../wireless/realtek/rtlwifi/rtl8192cu/mac.c | 5 +-
.../realtek/rtlwifi/rtl8192d/trx_common.c | 5 +-
.../wireless/realtek/rtlwifi/rtl8192de/fw.c | 38 +++---
.../wireless/realtek/rtlwifi/rtl8192ee/fw.c | 58 ++++-----
.../wireless/realtek/rtlwifi/rtl8192ee/hw.c | 6 +-
.../wireless/realtek/rtlwifi/rtl8192se/fw.c | 6 +-
.../wireless/realtek/rtlwifi/rtl8192se/trx.c | 5 +-
.../wireless/realtek/rtlwifi/rtl8723ae/fw.c | 38 +++---
.../wireless/realtek/rtlwifi/rtl8723ae/trx.c | 5 +-
.../wireless/realtek/rtlwifi/rtl8723be/fw.c | 58 ++++-----
.../wireless/realtek/rtlwifi/rtl8723be/hw.c | 6 +-
.../wireless/realtek/rtlwifi/rtl8723be/trx.c | 5 +-
.../wireless/realtek/rtlwifi/rtl8821ae/fw.c | 116 +++++++++---------
.../wireless/realtek/rtlwifi/rtl8821ae/hw.c | 6 +-
drivers/net/wireless/realtek/rtlwifi/wifi.h | 30 -----
24 files changed, 225 insertions(+), 282 deletions(-)

--
2.43.0