8814: run PHY_SwitchWirelessBand8814A at initial band-set (fixes 5GHz RX, #51)#93
Merged
Conversation
…band-set HalModule::rtl8812au_hal_init called PHY_SwitchWirelessBand8812 unconditionally for the initial band-set, even for CHIP_8814A. The 8812 band-switch marks the band already-set via the CCK-check register, so phy_SwBand8812's later per-chip dispatch sees BandToSW == Band and SKIPS PHY_SwitchWirelessBand8814A entirely. The 8814 therefore never ran its proper 5G band-switch: the path-C/D RFE pinmux (0xCB0/0xEB0/0x18B4/0x1AB4 via phy_SetRFEReg8814A), the 8814 AGC-table register, and the CCK clock-gate cycle stayed at frozen ch6-replay values, so the 5G RX front-end was misrouted and the chip surfaced 0 frames at 5GHz (bulk-IN LIBUSB_ERROR_TIMEOUT). Dispatch on chip type at the initial band-set, mirroring phy_SwBand8812. PHY_SwitchWirelessBand8814A made public for the call. Found via a kernel(aircrack-ng/rtl8814au)-vs-devourer usbmon register diff: devourer's runtime 0xCB0 read 0x77337717 instead of the correct type-1 5G value 0x33173317. On real hardware (RTL8814AU 0bda:8813) 8814 RX at ch100 goes 0 -> 34500 frames; ch6 unaffected (8800 -> 11000, no regression). Addresses #51. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What
The RTL8814AU received nothing at 5 GHz (#51): every devourer-RX cell on the 8814 returned 0 frames at 5 GHz while 2.4 GHz worked, with the bulk-IN endpoint timing out (
LIBUSB_ERROR_TIMEOUT).Root cause
HalModule::rtl8812au_hal_initranPHY_SwitchWirelessBand8812unconditionally at the initial band-set — even forCHIP_8814A. The 8812 band-switch marks the band already-set via the CCK-check register, sophy_SwBand8812's later per-chip dispatch (which does correctly choose the 8814A path) seesBandToSW == Bandand skipsPHY_SwitchWirelessBand8814Aentirely.The 8814 therefore never ran its 5 GHz band-switch: the path-C/D RFE pinmux (
0xCB0/0xEB0/0x18B4/0x1AB4viaphy_SetRFEReg8814A), the 8814 AGC-table register, and the CCK clock-gate cycle stayed at frozen ch6-replay values. The 5 GHz RX front-end was misrouted, so the chip never handed frames to the bulk pipe.Fix
Dispatch on chip type at the initial band-set, mirroring the dispatch already in
phy_SwBand8812.PHY_SwitchWirelessBand8814Ais made public for the call. (This also incidentally fixes a latent bug wherecurrent_band_typestayed at 2.4G on 5 GHz channels — it is set correctly insidePHY_SwitchWirelessBand8814A.)How it was found
A kernel (
aircrack-ng/rtl8814au, run in a pinned-kernel VM) vs. devourer usbmon register diff: devourer's runtime0xCB0read0x77337717instead of the correct type-1 5 GHz value0x33173317, provingphy_SetRFEReg8814Anever executed — which traced back to the wrong band-switch being called. A static source read alone was misleading:phy_SetRFEReg8814Ahad the right value; the function was simply never invoked.Validation — real hardware (RTL8814AU
0bda:8813)devourer-TX → devourer-RX, canonical-SA beacon:
Bulk-IN timeouts gone; 5 GHz RX surfaces tens of thousands of frames. The kernel
aircrack-ng/rtl8814audriver was used as the on-bench reference (it RXes this exact dongle fine at 5 GHz), confirming the dongle hardware is sound and the gate was software.Not covered by this PR
RF_MOD_AG=0x501sub-band) isn't yet validated on a fresh chip — it uses the identical channel-set path as ch36/ch100 (only two register constants differ), so it's expected to work.🤖 Generated with Claude Code