Skip to content

Fix compatibility with Linux 6.9+ and 7.1+ - #369

Merged
CGarces merged 1 commit into
Mange:realtek-4.4.xfrom
Shnimlz:fix-kernel-7.1-compat
Jul 18, 2026
Merged

Fix compatibility with Linux 6.9+ and 7.1+#369
CGarces merged 1 commit into
Mange:realtek-4.4.xfrom
Shnimlz:fix-kernel-7.1-compat

Conversation

@Shnimlz

@Shnimlz Shnimlz commented Jul 17, 2026

Copy link
Copy Markdown

Summary

This Pull Request fixes compilation failures of the out-of-tree rtl8192eu-linux-driver when compiled against modern Linux kernels, specifically Linux 6.9+ and 7.1+.

Root Cause

  1. PPPoE Flexible Array Members (Linux 6.9+): The flexible array members of struct pppoe_tag and struct pppoe_hdr in <uapi/linux/if_pppox.h> were hidden behind #ifndef __KERNEL__ guards in recent kernel versions, breaking direct member access (tag->tag_data and ph->tag) in kernel-space.
  2. cfg80211 callback signatures (Linux 7.1+): The wireless configuration operations (in struct cfg80211_ops) and helper notification functions (cfg80211_new_sta and cfg80211_del_sta) were changed to take struct wireless_dev *wdev as an argument instead of struct net_device *ndev.

Changes Made

  • PPPoE helper macros: Added pppoe_tag_data(tag) and pppoe_hdr_tag(ph) macros in core/rtw_br_ext.c to compute offsets safely using sizeof when compiling on Linux >= 6.9.0, falling back to standard field access on older kernels.
  • cfg80211 clean macros: Introduced RTW_WDEV_ARG and RTW_WDEV_GET macros in os_dep/linux/ioctl_cfg80211.c to handle the signature change cleanly without code duplication.
  • Notifiers update: Updated the calls to cfg80211_new_sta and cfg80211_del_sta to use padapter->rtw_wdev on Linux >= 7.1.0.

Compatibility

  • Retains backwards compatibility with older LTS kernels (tested against Linux 6.6 LTS and 6.12 LTS).
  • Compiles cleanly on intermediate versions (Linux 6.15 and 7.0).

Verification

  • Successfully built the final 8192eu.ko module against Linux 7.1.3-cachyos headers using LLVM/Clang without introducing new warnings.

- Define pppoe_tag_data and pppoe_hdr_tag macros to resolve missing tag_data/tag members under __KERNEL__ in Linux 6.9+.
- Introduce RTW_WDEV_ARG and RTW_WDEV_GET macros to cleanly handle wireless_dev callback signatures on Linux 7.1+ without duplicating code.
- Adapt notifications (cfg80211_new_sta/cfg80211_del_sta) to use wireless_dev on Linux 7.1+.
- Maintain backwards compatibility with older kernel versions.
Copilot AI review requested due to automatic review settings July 17, 2026 02:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the out-of-tree rtl8192eu-linux-driver to compile against newer Linux kernels by adapting to upstream API/ABI changes in PPPoE header layouts (Linux 6.9+) and cfg80211 callback/helper signatures (Linux 7.1+).

Changes:

  • Added PPPoE accessor macros in core/rtw_br_ext.c to avoid direct access to flexible array members hidden from kernel-space in newer kernels.
  • Introduced RTW_WDEV_ARG / RTW_WDEV_GET in os_dep/linux/ioctl_cfg80211.c to handle cfg80211 ops signature changes without duplicating implementations.
  • Updated cfg80211_new_sta() / cfg80211_del_sta() notifier calls to pass padapter->rtw_wdev on Linux >= 7.1.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
os_dep/linux/ioctl_cfg80211.c Adapts cfg80211 ops signatures for Linux >= 7.1 and updates STA notifier calls to use wireless_dev.
core/rtw_br_ext.c Adds PPPoE helper macros to compute tag/data offsets safely for Linux >= 6.9.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 5398 to 5401
{
RTW_WDEV_GET;
int ret = 0;
_adapter *padapter = (_adapter *)rtw_netdev_priv(ndev);
@CGarces
CGarces merged commit da21d44 into Mange:realtek-4.4.x Jul 18, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants