mirror of
https://github.com/morrownr/8812au-20210820.git
synced 2026-10-14 21:38:30 +00:00
[PR #62] [MERGED] core: rtw_xmit: gate scan_state TX-block by _FW_UNDER_SURVEY to prevent permanent TX stall #63
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/morrownr/8812au-20210820/pull/62
Author: @breakneck-git
Created: 4/25/2026
Status: ✅ Merged
Merged: 4/25/2026
Merged by: @morrownr
Base:
main← Head:fix-tx-stall-scan-state-desync📝 Commits (1)
9e91355core: rtw_xmit: gate scan_state TX-block by _FW_UNDER_SURVEY to prevent permanent TX stall📊 Changes
1 file changed (+10 additions, -3 deletions)
View changed files
📝
core/rtw_xmit.c(+10 -3)📄 Description
Summary
Fixes a permanent TX stall caused by a race between the upper-level (
mlmepriv._FW_UNDER_SURVEY) and low-level (mlmeextpriv.scan_state) MLME state when a scan times out.Same root cause and identical patch shape was also submitted to:
aircrack-ng/rtl8812au(referencing their open issue #778 — "Radio scans introduce lag spikes")morrownr/8821au-20210708(sister repo with shared MLME code)Root cause
rtw_scan_timeout_handler()(core/rtw_mlme.c) clears the upper-level_FW_UNDER_SURVEYflag and notifies cfg80211, but does not resetmlmeext->scan_state. The only place that resetsscan_statetoSCAN_DISABLEin the normal completion path is theSCAN_COMPLETEhandler incore/rtw_mlme_ext.c, which a stalled scan never reaches.After this race,
rtw_xmit_ac_blocked()(core/rtw_xmit.c) permanently returns_TRUEfor the scan-state check, blocking all TX. RX continues unaffected (no scan gate on the RX path), beacons arrive, the station stays associated —wpa_supplicantreportsCOMPLETED, signal is fine, but no traffic flows.wpa_cli reconnectis the user-visible workaround because a full re-assoc goes throughinit_mlme_ext_priv()which unconditionally resetsscan_statetoSCAN_DISABLE.Fix
Gate the scan-state TX-block check by
_FW_UNDER_SURVEY. If the upper layer no longer thinks a scan is in progress, do not block TX even if the low-levelscan_stateis stuck.The new condition is strictly a subset of the old one — when both layers agree a scan is in progress, behaviour is unchanged. Defensive: doesn't touch the state machine, doesn't risk HW init inconsistency.
Test environment
Tested on the 8821AU sister chip (8821au-20210708 fork). The 8812AU and 8821AU share
core/rtw_xmit.cverbatim, so the fix applies identically. If a maintainer of this repo wants to verify on actual 8812AU hardware before merging, that's reasonable — the change is small and the code path identical._FW_UNDER_SURVEY=1,scan_state∉ {DISABLE, BACKOP}_FW_UNDER_SURVEY=0,scan_state∉ {DISABLE, BACKOP} (the desync)_FW_UNDER_SURVEY=1,scan_state ∈ {DISABLE, BACKOP}_FW_UNDER_SURVEY=0,scan_state = DISABLE🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.