Skip to content

Fix rtl8822c 2.4 GHz RX deafness (port vendor switch_channel omissions)#138

Open
josephnef wants to merge 1 commit into
masterfrom
fix-8822c-2g-rx
Open

Fix rtl8822c 2.4 GHz RX deafness (port vendor switch_channel omissions)#138
josephnef wants to merge 1 commit into
masterfrom
fix-8822c-2g-rx

Conversation

@josephnef

Copy link
Copy Markdown
Collaborator

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 kernel rtw88_8822cu driver receives fine on the same hardware, so it's a devourer bug.

Root cause

devourer's RadioManagementJaguar3::set_channel_bwmode is 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 by phydm_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_8822c HSSI-reset bracket around the RF writes, incl. 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 (vendor does RMW, not rebuild-from-scratch).
  • Per-band AGC-table select (phydm_ofdm/cck_agc_tab_sel: 0x18ac/0x41ac + 0x828).
  • CCK RX-IQ enable/revert (0x1a9c/0x1a14).

Validation

Hardware, controlled canonical-beacon RX (8812AU TX → DUT RX), hits over ~14 s:

DUT ch6 (2.4 GHz) ch36 (5 GHz)
RTL8812CU (c812) 0 → 69 65 (no regression)
RTL8812EU (a81a) 52 (no regression) 68 (no regression)

Builds across all per-chip CMake configs (all-on / 8822c-only / 8822e-only / jaguar1-only); ctest passes.

Fixes #126

🤖 Generated with Claude Code

… 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>
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.

RTL8812CU (rtl8822c) RX marginal on 2.4 GHz channel 6

1 participant