Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/HalModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,12 @@ bool HalModule::rtl8812au_hal_init() {
/* Initialise phydm thermal-meter pwrtrk state now that BB+RF tables
* have been applied. Mirrors phydm's `phydm_rf_init` ->
* `odm_txpowertracking_init`. The watchdog ticks themselves run from
* the channel-set path + RtlJaguarDevice background thread. */
_radioManagementModule->InitPwrTrack();
* the channel-set path + RtlJaguarDevice background thread.
* 8812A-only — see RadioManagementModule::phy_SwChnlAndSetBwMode8812
* for the gate rationale. */
if (_eepromManager->version_id.ICType == CHIP_8812) {
_radioManagementModule->InitPwrTrack();
}

/* Arm I/Q calibration so the initial channel-set runs a full IQK
* (TX-tone + RX-tone, ~50-100 ms). Mirrors upstream where
Expand Down
15 changes: 13 additions & 2 deletions src/RadioManagementModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,19 @@ void RadioManagementModule::phy_SwChnlAndSetBwMode8812() {
* upstream watchdog tick — reads RF[A][0x42], folds into the
* thermal-value rolling average, walks the delta-swing table for
* the (band, channel) bucket, and writes the resulting BB-swing
* index to 0xc1c[31:21] / 0xe1c[31:21]. */
_pwrTrk.TickThermalMeter(current_band_type, _currentChannel);
* index to 0xc1c[31:21] / 0xe1c[31:21].
*
* 8812A-only. The delta-swing tables + `PowerTracking8812a` logic
* came from `aircrack-ng/rtl8812au/hal/phydm/halrf/rtl8812a/
* halrf_8812a_ce.c`. The 8821AU has its own `halrf_8821a_ce.c`
* variant with different per-band tables and 1T1R-specific math —
* running 8812A code on 8821A produced wrong values at ch6 BB
* 0xc1c[31:21] (T1 8821 canary diff caught it as kern 0x200/0dB vs
* dev 0x1C8/-1dB). Until the 8821 pwrtrk is ported, skip the tick
* on non-8812 chips. */
if (_eepromManager->version_id.ICType == CHIP_8812) {
_pwrTrk.TickThermalMeter(current_band_type, _currentChannel);
}

/* T1 cross-validation oracle (TODO.md): when DEVOURER_DUMP_CANARY=1
* is set, dump the canary BB/MAC/RF registers after channel-set is
Expand Down
Loading