Skip to content

wifi: rtlwifi: replace the 802.11 header helper macros with kernel ones

Rishik Yechuri linux-wireless lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6wifi: rtlwifi: use struct ieee80211_pspoll for the PS Poll reserved pagedrivers/net/wireless/realtek/rtlwifi/base.h drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c +5 more+40 -471 reply
2/6wifi: rtlwifi: use struct ieee80211_hdr for the reserved page headersdrivers/net/wireless/realtek/rtlwifi/base.h drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c +6 more+152 -1711 reply
3/6wifi: rtlwifi: call msecs_to_jiffies() directlydrivers/net/wireless/realtek/rtlwifi/base.c drivers/net/wireless/realtek/rtlwifi/core.c drivers/net/wireless/realtek/rtlwifi/ps.c +6 more+18 -191 reply
4/6wifi: rtlwifi: rtl8192se: use ALIGN() for the H2C command lengthdrivers/net/wireless/realtek/rtlwifi/rtl8192se/fw.c drivers/net/wireless/realtek/rtlwifi/wifi.h+2 -151 reply
5/6wifi: rtlwifi: use ieee80211_is_ctl() instead of WLAN_FC_GET_TYPE()drivers/net/wireless/realtek/rtlwifi/rtl8192ce/trx.c drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c drivers/net/wireless/realtek/rtlwifi/rtl8192d/trx_common.c +4 more+12 -221 reply
6/6wifi: rtlwifi: remove byte(), packet_get_type() and FILL_OCTET_STRING()drivers/net/wireless/realtek/rtlwifi/rtl8192se/fw.c drivers/net/wireless/realtek/rtlwifi/wifi.h+1 -81 reply

Reviews trailers per patch

1 of 6 patches has a Reviewed-by or Acked-by.

PatchPing-Ke Shih
1/6
2/6
3/6A-b
4/6
5/6
6/6

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

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

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(-)
Signature · 1 line
2.43.0