Repository navigation
jaguar2: a defined AGC table, fc and RF 0xBE for every 5 GHz channel - #501
Conversation
The 8822B/8821C channel set only wrote the AGC table index (0x958 / 0xc1c), the CFO-tracking fc (0x860[28:17]) and, on the 8822B, the RF 0xBE VCO band for channels in the vendor buckets (36..64 / 100..144 / 149+). Anything else - the 65..99 gap between the UNII-2 groups, 145..148, the unlisted fc channels 49..51 / 117, and the vendor's unwritten RF 0xBE entries at centrals 50/114/130/163 (a 40 MHz tune at 5255 MHz is central 51) - kept whatever the previous channel left, so a receiver tuned there depended on its tuning history. Measured on one 8812BU (40 MHz, fixed gain), same unit before and after: 5350 / 5450 MHz read 3.6 / 4.5 dB apart (noise floor and a fixed carrier alike, SNR unchanged) depending on whether they were reached from 5180 or from 5510/5745. After: 0.4 / 0.7 dB, inside an in-table control's 0.8 dB. The AGC table was what mattered: a stale RF 0xBE alone (centrals 51, 163) showed nothing beyond noise, so the RF 0xBE values written there are untested either way. - agc_table_5g: the vendor buckets, the channels between them taking the RF18 sub-band they tune in (mid from 80 on the 8822B, 100 on the 8821C). - cfo_fc_5g: the vendor buckets, unlisted channels assigned as the 8822C's contiguous sco table does. - rf_be_for_8822b: 15..148 from the 6-step cycle that all 35 defined entries of the vendor's 36..144 tables follow (only the unwritten ones change); the high table with 163 filled from 151/175. It never returns the 0xff no-write sentinel now, so the sentinel and its guards go. - The full path, the 8821C full path and fast_retune share the helpers. Checked against config_phydm_switch_channel_8822b/_8821c for every cch 15..253: no vendor-defined channel changes value. - A firmware fast hop (fastretune_fw) now invalidates the write-on-change caches on every hop, not only on a band change: the firmware rewrites the same registers, and a later software hop could otherwise skip a write and keep the firmware's value. - The uncharacterized-channel warning tests the central channel and covers 65..99, on Jaguar2 and Jaguar3. The 8821C changes are code-covered only. The 8822C needed no change: its rf18_for / select_agc_tables / sco_for are contiguous, and a measured 8812CU showed no history dependence in the gap. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The uncharacterized-channel warning tests the central channel, which central_ch wraps for out-of-spec 2.4 GHz HT40 configs (ch 13 HT40+ -> 15): gate it on a 5 GHz primary, on Jaguar2 and Jaguar3. The jaguar2 notes state what the after-fix spread can and cannot show, and record the RX-only full-vs-fast parity run (20/40 MHz, gap channels). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PR Summary by QodoDefine Jaguar2 5 GHz tuning values for previously skipped channels
AI Description
Diagram
High-Level Assessment
Files changed (4)
|
Code Review by Qodo
1.
|
josephnef
left a comment
There was a problem hiding this comment.
Checked the helpers against the old tables for every central channel 15..253 (odd ones included, both AGC split points): 0 mismatches on vendor-defined channels; only the gap channels get new values. The fw-hop cache invalidation and the channel > 14 gate on the warning both look right. Two nits inline. The two pre-existing fast-path gaps (0x838[7:4] DFS CCA tweak, leftover spur_calibration notch) should go into a follow-up issue.
|
/review |
|
Code review by qodo was updated up to the latest commit bbd44ee |
- warn_uncharacterized (Jaguar2, Jaguar3): the one-shot extended-channel warning is a helper called by the full channel set and both fast paths (software and firmware), so a fast hop into 65..99 (or below 36 / above 177) warns like a full set does (Qodo). It runs once a destination is accepted; after the first warning it is a bool test. - set_channel_bw computes cch once, before the 8821C dispatch (review). - src/jaguar2/CLAUDE.md: the bullet states what holds now (the gap's assignments, the measured spread with its control, what is untested) instead of the history, at about half the length (review). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Hardware check on an RTL8812BU-class 8822BU ( Retune history, full path. The same target reached from two different predecessors, registers compared on the target:
Fast vs full, every dwell.
Not covered here: the 8821C, the firmware hop and its cache invalidation, and anything on air (this shows register state only). Same single-unit caveat as the PR's own numbers. |
A second 8812BU-class unit (maintainer's RX-only canary dumps) matches full-path registers at four filled targets across predecessors, and full-vs-fast parity at 20/40/80 MHz except the pre-existing 0x838[7:4] DFS CCA tweak. The firmware hop and the 8821C stay untested. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for the hardware run. The 80 MHz result and the register-level history check go beyond what I could cover here. Both are now in the PR body and in |
What this is
On the 8822B and 8821C (Jaguar2), the channel set writes the AGC table index (
0x958[4:0]/0xc1c[11:8]), the CFO-tracking fc (0x860[28:17]) and, on the 8822B, the RF0xBE[17:15]VCO band only for channels in the vendor buckets (36..64 / 100..144 / 149+). Any other 5 GHz channel the synthesizer tunes kept whatever the previous channel left, so a receiver tuned there depended on its tuning history. The affected channels:This PR gives every 5 GHz channel defined values. No vendor-defined channel changes value.
What changed
fast_retune:agc_table_5g: the vendor buckets. The channels between them take the RF18 sub-band they tune in: mid from cch 80 on the 8822B (RF18 bit 17), from 100 on the 8821C (its own RF18 split). 145..148 take high.cfo_fc_5g: the vendor buckets, with the unlisted channels assigned as the 8822C's contiguoussco_fortable does.rf_be_for_8822b: for 15..148, the 6-step cycle that all 35 defined entries of the vendor's 36..144 tables follow, so only the unwritten entries change. The high table is kept, with 163 filled from 151/175 (both 0x5). It never returns the 0xff no-write sentinel now, so the sentinel and its two guards go.fastretune_fw): now invalidates the write-on-change caches on every hop, not only on a band change. The firmware rewrites the same registers, so a later software hop could skip a write and keep the firmware's value.central_chwraps for out-of-spec 2.4 GHz HT40 configs (ch 13 HT40+ gives 15).src/jaguar2/CLAUDE.md: one bullet with the facts and their caveats.The 8822C (Jaguar3) needed no fix. Its
rf18_for,select_agc_tablesandsco_forare contiguous range checks.Verification
Tables. A script reproducing
config_phydm_switch_channel_8822b/_8821cwas compared with the helpers for every cch from 15 to 253. There are 0 mismatches on vendor-defined channels, odd channels included.Retune history, on hardware.
Before the fix, the fixed external carriers in the span moved with the floor while the SNR stayed the same, so this was a gain offset. The stale AGC table is what mattered.
The counterpart: the in-table control itself spreads 0.8 dB, so the "after" figures mean "no longer resolvable", not zero. It is also one unit at one width.
Stale RF 0xBE alone (centrals 51 and 163, before their fill): nothing resolvable, below ~1.5 dB. So the RF 0xBE values written there are untested either way.
Full-vs-fast register parity, RX-only. Same 8812BU, same canary set as
tests/hop_parity_check.sh. That script injects frames with txdemo, and most of these channels are outside any allocation, so rxdemo was used instead:DEVOURER_RX_SWEEP(FastRetune) againstDEVOURER_RX_SWEEP_FULL=1twice (the full-vs-full control).The counterpart: no 80 MHz on this unit (the second unit below covers it), and the firmware hop is not covered. The 20 MHz targets avoid 52..64 and 100..144 on purpose, where the pre-existing 0x838 gap below would show.
A second unit (josephnef's hardware check, RX-only, 8822BU
0bda:b812): on the full path, canary registers at four affected targets (20 MHz ch 72/92, 40 MHz centrals 70/50) match across two predecessors each; master differs in0x860,0x958, RF0xbe. Fast vs full, all 38 canary registers with two full runs as control, matched on every dwell at 40 MHz (81) and 80 MHz (67); at 20 MHz (87 dwells) the only difference was0x838on ch 117, the pre-existing DFS CCA tweak below (master shows the same two values). That adds 80 MHz, on one unit.8812CU (8822C) in the gap: spread by predecessor 0.1..0.4 dB at 20 MHz width, against a 0.1 dB in-table control. No change needed (one unit).
ctest: 100 % passed (83, 2 skipped as on master).
The raw data and the scripts are in snokvist/wifi-sdr (
evidence/gap-ch65-99.txt,tools/retune_history.py).Not verified
fw_switch_confirmfalls back to the full path there.Pre-existing, not in this PR
A review turned up two fast-path gaps that this PR does not touch:
fast_retunenever rewrites the 20 MHz DFS-channel CCA tweak in0x838[7:4].fast_retunedoes not clear aspur_calibrationnotch left by a full set.Both are full-path-only state that a software fast hop carries along.
tests/hop_parity_check.shat BW=20 with INIT=36 TARGET=52 should show the first.🤖 Generated with Claude Code