Fix compatibility with Linux 6.9+ and 7.1+ - #369
Merged
Conversation
- 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.
There was a problem hiding this comment.
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.cto avoid direct access to flexible array members hidden from kernel-space in newer kernels. - Introduced
RTW_WDEV_ARG/RTW_WDEV_GETinos_dep/linux/ioctl_cfg80211.cto handle cfg80211 ops signature changes without duplicating implementations. - Updated
cfg80211_new_sta()/cfg80211_del_sta()notifier calls to passpadapter->rtw_wdevon 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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
struct pppoe_tagandstruct pppoe_hdrin<uapi/linux/if_pppox.h>were hidden behind#ifndef __KERNEL__guards in recent kernel versions, breaking direct member access (tag->tag_dataandph->tag) in kernel-space.struct cfg80211_ops) and helper notification functions (cfg80211_new_staandcfg80211_del_sta) were changed to takestruct wireless_dev *wdevas an argument instead ofstruct net_device *ndev.Changes Made
pppoe_tag_data(tag)andpppoe_hdr_tag(ph)macros incore/rtw_br_ext.cto compute offsets safely usingsizeofwhen compiling on Linux >= 6.9.0, falling back to standard field access on older kernels.RTW_WDEV_ARGandRTW_WDEV_GETmacros inos_dep/linux/ioctl_cfg80211.cto handle the signature change cleanly without code duplication.cfg80211_new_staandcfg80211_del_stato usepadapter->rtw_wdevon Linux >= 7.1.0.Compatibility
Verification
8192eu.komodule against Linux 7.1.3-cachyos headers using LLVM/Clang without introducing new warnings.