Skip to content

RTL8189FS: fix compile on Linux 7.3 - #146

Merged
CGarces merged 2 commits into
jwrdegoede:rtl8189fsfrom
iav:fix/linux-7.3-cookie-fs
Sep 11, 2026
Merged

CGarces merged 2 commits into
jwrdegoede:rtl8189fsfrom
iav:fix/linux-7.3-cookie-fs

Conversation

@iav

@iav iav commented Sep 10, 2026

Copy link
Copy Markdown

Linux 7.3 changed the cfg80211 remain_on_channel() and mgmt_tx() ops to take the cookie by value (cfg80211 assigns it); the driver still stores it through the u64 pointer, so cfg80211_rtw_ops fails to compile on 7.3.

Two commits taken from the Armbian fork with their authorship: EvilOlaf's 7.3 compat, plus the follow-up that keeps the cookie output parameter on kernels before 7.3 (his version dropped the *cookie store, which left nl80211's cookie uninitialised on <= 7.2).

Compile tested against 7.2.4 and 7.3-rc2 (arm64, gcc 14.2): base fails on 7.3 with two initialisation errors in cfg80211_rtw_ops, this branch builds on both with no new warnings.

EvilOlaf and others added 2 commits September 10, 2026 23:00
(cherry picked from commit a797e3a)
Before 7.3, cfg80211_rtw_remain_on_channel() and cfg80211_rtw_mgmt_tx()
receive `u64 *cookie` as an output parameter: cfg80211 passes an
uninitialised stack variable and reads back whatever the driver stores
there. The 7.3 compatibility rework generates the value into local
roc_cookie / tx_cookie variables and never writes it back, so on every
kernel below 7.3 nl80211 reports a garbage cookie to userspace and the
later cancel_remain_on_channel() / mgmt_tx_cancel_wait() lookups no
longer match the ROC or mgmt-TX entry.

Write the generated value back through the pointer on the pre-7.3 path.
The compiler gives no diagnostic for this, so the driver builds clean
while P2P and mgmt-TX cancellation silently break.

Both cookie variables move up into the declaration block, so that the
driver keeps building on kernels that still use -std=gnu89, where a
declaration after a statement is not accepted.

(cherry picked from commit 8f5799f)
@CGarces
CGarces merged commit abf4dd1 into jwrdegoede:rtl8189fs Sep 11, 2026
9 of 10 checks passed
@iav
iav deleted the fix/linux-7.3-cookie-fs branch September 11, 2026 14:19
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