mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rishik Yechuri <epicrishik@gmail.com>
To: Ping-Ke Shih <pkshih@realtek.com>
Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
	Rishik Yechuri <rishik.yechuri.code@gmail.com>
Subject: [PATCH rtw-next 0/6] wifi: rtlwifi: replace the 802.11 header helper macros with kernel ones
Date: Tue, 10 Nov 2026 12:44:03 -0600	[thread overview]
Message-ID: <20261110184409.42205-1-rishik.yechuri.code@gmail.com> (raw)

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


             reply	other threads:[~2026-11-10 18:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-10 18:44 Rishik Yechuri [this message]
2026-11-10 18:44 ` [PATCH rtw-next 1/6] wifi: rtlwifi: use struct ieee80211_pspoll for the PS Poll reserved page Rishik Yechuri
2026-11-10 18:44 ` [PATCH rtw-next 2/6] wifi: rtlwifi: use struct ieee80211_hdr for the reserved page headers Rishik Yechuri
2026-11-10 18:44 ` [PATCH rtw-next 3/6] wifi: rtlwifi: call msecs_to_jiffies() directly Rishik Yechuri
2026-11-10 18:44 ` [PATCH rtw-next 4/6] wifi: rtlwifi: rtl8192se: use ALIGN() for the H2C command length Rishik Yechuri
2026-11-10 18:44 ` [PATCH rtw-next 5/6] wifi: rtlwifi: use ieee80211_is_ctl() instead of WLAN_FC_GET_TYPE() Rishik Yechuri
2026-11-10 18:44 ` [PATCH rtw-next 6/6] wifi: rtlwifi: remove byte(), packet_get_type() and FILL_OCTET_STRING() Rishik Yechuri

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261110184409.42205-1-rishik.yechuri.code@gmail.com \
    --to=epicrishik@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=pkshih@realtek.com \
    --cc=rishik.yechuri.code@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®