Skip to content

staging: rtl8723bs: replace private 802.11 header macros with generic helpers

Rishik Yechuri linux-staging lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest10 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10staging: rtl8723bs: use struct ieee80211_hdr for header addressesdrivers/staging/rtl8723bs/core/rtw_mlme_ext.c drivers/staging/rtl8723bs/core/rtw_recv.c drivers/staging/rtl8723bs/core/rtw_wlan_util.c +2 more+100 -810 replies
2/10staging: rtl8723bs: use ieee80211_has_*() to test frame control flagsdrivers/staging/rtl8723bs/core/rtw_mlme_ext.c drivers/staging/rtl8723bs/core/rtw_recv.c drivers/staging/rtl8723bs/include/wifi.h+23 -370 replies
3/10staging: rtl8723bs: set frame control flags with IEEE80211_FCTL_* masksdrivers/staging/rtl8723bs/core/rtw_mlme_ext.c drivers/staging/rtl8723bs/core/rtw_security.c drivers/staging/rtl8723bs/core/rtw_xmit.c +2 more+33 -680 replies
4/10staging: rtl8723bs: use ieee80211_is_*() for frame type testsdrivers/staging/rtl8723bs/core/rtw_mlme_ext.c drivers/staging/rtl8723bs/core/rtw_recv.c drivers/staging/rtl8723bs/core/rtw_xmit.c +4 more+17 -180 replies
5/10staging: rtl8723bs: use IEEE80211_FCTL_* masks for frame type dispatchdrivers/staging/rtl8723bs/core/rtw_mlme_ext.c drivers/staging/rtl8723bs/core/rtw_recv.c drivers/staging/rtl8723bs/core/rtw_security.c +3 more+65 -750 replies
6/10staging: rtl8723bs: remove unused num member from struct mlme_handlerdrivers/staging/rtl8723bs/core/rtw_mlme_ext.c drivers/staging/rtl8723bs/include/rtw_mlme_ext.h+15 -160 replies
7/10staging: rtl8723bs: use IEEE80211_FTYPE_* and IEEE80211_STYPE_* valuesdrivers/staging/rtl8723bs/core/rtw_mlme_ext.c drivers/staging/rtl8723bs/core/rtw_xmit.c drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c +2 more+32 -900 replies
8/10staging: rtl8723bs: use struct ieee80211_hdr for seq_ctrl and duration_iddrivers/staging/rtl8723bs/core/rtw_mlme_ext.c drivers/staging/rtl8723bs/core/rtw_recv.c drivers/staging/rtl8723bs/core/rtw_xmit.c +3 more+25 -500 replies
9/10staging: rtl8723bs: use IEEE80211_QOS_CTL_* masks for QoS controldrivers/staging/rtl8723bs/core/rtw_mlme_ext.c drivers/staging/rtl8723bs/core/rtw_recv.c drivers/staging/rtl8723bs/core/rtw_xmit.c +2 more+21 -320 replies
10/10staging: rtl8723bs: use ieee80211_get_DA() and ieee80211_get_SA()drivers/staging/rtl8723bs/core/rtw_mlme_ext.c drivers/staging/rtl8723bs/core/rtw_recv.c drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c +1 more+9 -750 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/10] staging: rtl8723bs: replace private 802.11 header macros with generic helpers

The rtl8723bs driver has its own set of macros and inline functions in wifi.h for working with 802.11 frame headers. They access the header through hardcoded byte offsets and pointer casts, and they duplicate struct ieee80211_hdr and the helpers in <linux/ieee80211.h> that mac80211, cfg80211 and other wireless drivers already use.

This series switches the driver over to the generic versions and deletes the private ones from wifi.h. Each patch converts one group of macros and removes their definitions once nothing uses them anymore, so the driver builds after every patch.

Patches 1 to 3 convert header address access and the Frame Control flag checks and updates.

Patches 4 and 5 convert the frame type and subtype checks. Single comparisons use the ieee80211_is_*() helpers, and switch statements mask frame_control with IEEE80211_FCTL_* and use IEEE80211_STYPE_* case labels, the same way mac80211 does.

Patch 6 removes an unused struct member. Its initialisers were the last users of a few private subtype constants that have no generic equivalent.

Patch 7 converts the frame subtype setter and removes the private WIFI_* frame type enum.

Patches 8 and 9 convert the Sequence Control, Duration/ID and QoS Control fields.

Patch 10 replaces the driver's destination and source address helpers with ieee80211_get_DA() and ieee80211_get_SA().

None of this should change behaviour. In the few places where a generic helper checks more than the code it replaces, or where the old macro kept bits that a plain assignment would overwrite, the commit message explains why the result is the same.

Compile tested with W=1 after each patch, and checked with checkpatch and smatch. I don't have a device with this chip, so it has not been tested on hardware.

Rishik Yechuri (10):
staging: rtl8723bs: use struct ieee80211_hdr for header addresses
staging: rtl8723bs: use ieee80211_has_*() to test frame control flags
staging: rtl8723bs: set frame control flags with IEEE80211_FCTL_*
masks
staging: rtl8723bs: use ieee80211_is_*() for frame type tests
staging: rtl8723bs: use IEEE80211_FCTL_* masks for frame type dispatch
staging: rtl8723bs: remove unused num member from struct mlme_handler
staging: rtl8723bs: use IEEE80211_FTYPE_* and IEEE80211_STYPE_* values
staging: rtl8723bs: use struct ieee80211_hdr for seq_ctrl and
duration_id
staging: rtl8723bs: use IEEE80211_QOS_CTL_* masks for QoS control
staging: rtl8723bs: use ieee80211_get_DA() and ieee80211_get_SA()

 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 254 ++++++++---------
 drivers/staging/rtl8723bs/core/rtw_recv.c     | 134 ++++-----
 drivers/staging/rtl8723bs/core/rtw_security.c |  41 +--
 .../staging/rtl8723bs/core/rtw_wlan_util.c    |   7 +-
 drivers/staging/rtl8723bs/core/rtw_xmit.c     |  75 +++---
 drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c  |  42 +--
 .../staging/rtl8723bs/hal/rtl8723bs_recv.c    |   9 +-
 .../staging/rtl8723bs/hal/rtl8723bs_xmit.c    |   3 +-
 .../staging/rtl8723bs/include/rtw_mlme_ext.h  |   1 -
 drivers/staging/rtl8723bs/include/wifi.h      | 255 +-----------------
 .../staging/rtl8723bs/os_dep/ioctl_cfg80211.c |  19 +-
 11 files changed, 319 insertions(+), 521 deletions(-)
Signature · 1 line
2.43.0