Fix rtl8822c 2.4 GHz RX deafness (port vendor switch_channel omissions)#138
Open
josephnef wants to merge 1 commit into
Open
Fix rtl8822c 2.4 GHz RX deafness (port vendor switch_channel omissions)#138josephnef wants to merge 1 commit into
josephnef wants to merge 1 commit into
Conversation
… omissions) The RTL8812CU/RTL8822CU (rtl8822c) received nothing on 2.4 GHz — the PHY CCA counter read 0 (no RF energy detected) — while 5 GHz worked. Root cause: devourer's set_channel_bwmode was a partial port of the vendor (reference/ rtl88x2cu) config_phydm_switch_channel_8822c / config_phydm_switch_bandwidth_8822c and dropped several 8822c steps. The decisive one: RF register writes were not bracketed by phydm_rstb_3wire_8822c — in particular the closing "force update anapar" (0x1830[29]/0x4130[29]) that pushes the RF/analog shadow to hardware. Without it the per-channel RF config never reached the 2.4 GHz analog front-end, so the receiver was deaf; 5 GHz happened to survive on the init-table defaults. Ported the missing 8822c steps, gated to the C8822C variant (8822e uses its own phydm path + config_channel_8822e, so it is untouched): - phydm_rstb_3wire_8822c HSSI-reset bracket around the RF writes, incl. the force-update-anapar (0x1c90[8], 0x1830[29]/0x4130[29]). - Gated RXBB write (RF 0xee[2]=1, RF 0x33[4:0]=0x12, RF 0x3f, RF 0xee[2]=0). - RF18 read-modify-write preserving bits [15:10] + BW20 bits. - Per-band AGC-table select (phydm_ofdm/cck_agc_tab_sel: 0x18ac/0x41ac + 0x828). - CCK RX-IQ enable/revert (0x1a9c/0x1a14). Validated on hardware (controlled canonical-beacon RX, hits): RTL8812CU (c812) ch6: 0 -> 69 ch36: 65 (no regression) RTL8812EU (a81a) ch6: 52 ch36: 68 (no regression) Builds across all per-chip CMake configs; ctest passes. Fixes #126 Co-Authored-By: Claude Opus 4.8 <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.
Problem
RTL8812CU / RTL8822CU (rtl8822c,
0bda:c812) received nothing on 2.4 GHz while 5 GHz worked (issue #126). Instrumenting the PHY false-alarm/CCA counters showed CCA = 0 on ch6 even with a strong local beacon present (ch36 counted ~1900 CCA/s) — i.e. the RF front-end detected no energy at all. The kernelrtw88_8822cudriver receives fine on the same hardware, so it's a devourer bug.Root cause
devourer's
RadioManagementJaguar3::set_channel_bwmodeis a port of the vendor (reference/rtl88x2cu)config_phydm_switch_channel_8822c/config_phydm_switch_bandwidth_8822c, but it dropped several 8822c steps. The decisive one: RF register writes were not bracketed byphydm_rstb_3wire_8822c— specifically the closing "force update anapar" writes (0x1830[29]/0x4130[29]) that push the RF/analog shadow registers to hardware. Without that, the per-channel RF configuration never reached the 2.4 GHz analog front-end, so the receiver stayed deaf. 5 GHz survived on the init-table defaults.Fix
Ported the missing 8822c steps faithfully from the vendor source, gated to the C8822C variant (rtl8822e uses its own phydm path +
config_channel_8822e, so it is untouched):phydm_rstb_3wire_8822cHSSI-reset bracket around the RF writes, incl. force-update-anapar (0x1c90[8],0x1830[29]/0x4130[29]).RF 0xee[2]=1,RF 0x33[4:0]=0x12,RF 0x3f,RF 0xee[2]=0).[15:10]+ BW20 bits (vendor does RMW, not rebuild-from-scratch).phydm_ofdm/cck_agc_tab_sel:0x18ac/0x41ac+0x828).0x1a9c/0x1a14).Validation
Hardware, controlled canonical-beacon RX (8812AU TX → DUT RX), hits over ~14 s:
Builds across all per-chip CMake configs (all-on / 8822c-only / 8822e-only / jaguar1-only);
ctestpasses.Fixes #126
🤖 Generated with Claude Code