diff --git a/src/HalModule.cpp b/src/HalModule.cpp index 4c88780..8667d9a 100644 --- a/src/HalModule.cpp +++ b/src/HalModule.cpp @@ -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 diff --git a/src/RadioManagementModule.cpp b/src/RadioManagementModule.cpp index ef543d6..e18d1f1 100644 --- a/src/RadioManagementModule.cpp +++ b/src/RadioManagementModule.cpp @@ -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