Kestrel per-packet TX power: radiotap DBM_TX_POWER via fixed-dBm rewrite#302
Merged
Conversation
The AX WD descriptor carries no per-frame power field (both wd_body layouts; vendor mac_ax has none either), but Kestrel's power write is the cheapest in the tree: the fixed-dBm BB target (halbb_set_txpwr_dbm form, 0x09a4[16] arm + 0x4594[30:22] s(9,2)) is 2 RMWs at 0.25 dB resolution. Since Kestrel submits one bulk transfer per frame, send_packet now honours a radiotap DBM_TX_POWER dB-delta by rewriting that target between frames when the requested level changes — free while it stays constant, no run-splitting machinery needed. A field-less frame restores the SetTxPowerOffsetQdb session offset; the trim is clamped to the same [0, 23] dBm PA window; the hal offset member stays the single source of truth, so the existing set_channel/fast_retune re-apply keeps the last-written level sticky across channel switches. Global, like the J1 BB-swing lever: a HW beacon airing between frames follows. Caps: per_packet_txpower=true, steps=0 (continuous), step_qdb=1, min/max derived from the PA window around the session base. DEVOURER_TX_PKT_OFSET now fans out to Kestrel too (nominal LUT dB onto the session fixed-dBm offset, radiotap still overriding per frame); the on-air harness gains a TX_PWR knob (Kestrel reads DEVOURER_TX_PWR as whole dBm — 14 gives the sweep headroom the Jaguar index 40 default would clamp away). On-air (ch36, MCS3, 14 dBm base, 8822BU chip-RSSI ground): 8852BU 5/5 LUT-mapped cells + 2/2 radiotap cells correct (+3/+6 exact; deep cuts over-deliver ~3 raw at the uncalibrated low-dBm end); 8832CU 5/5 + 2/2 near-exact (+3->+3, +6->+6, -3->-3, -7->-6, -11->-10). 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.
What
Per-packet TX power for the Kestrel generation (RTL8852BU/8832BU + RTL8852CU/8832CU) — the last family without a per-packet or fast power lever.
The AX WD descriptor carries no per-frame power field (both
wd_bodylayouts; the vendor mac_ax tree has none either), so the descriptor-LUT/bank approach of the 11ac families doesn't apply. Instead this uses the cheapest power write in the tree: the fixed-dBm BB target (0x09a4[16]arm +0x4594[30:22]s(9,2)) is 2 register RMWs at 0.25 dB resolution. Since Kestrel submits one bulk transfer per frame,send_packetnow honours a radiotapDBM_TX_POWERdB-delta by rewriting that target between frames when the requested level changes:SetTxPowerOffsetQdbsession offsetDEVOURER_TX_PWRbase (whole dBm on this family)SetMonitorChannel/FastRetunefor free — the hal offset member is the single source of truth and both re-apply paths already fold itPlumbing:
AdapterCaps:per_packet_txpower=true,per_pkt_txpwr_steps=0(continuous),step_qdb=1(0.25 dB), min/max from the PA window,measured=trueDEVOURER_TX_PKT_OFSETfans out to Kestrel too (nominal LUT dB onto the session fixed-dBm offset; radiotap still overrides per frame) — the shared on-air harness drives Kestrel DUTs unchangedtests/txpkt_pwr_ofset_onair.shgains aTX_PWRknob (Kestrel readsDEVOURER_TX_PWRas dBm — the Jaguar-index default 40 would clamp;TX_PWR=14gives the ±sweep headroom)Validation
On-air, ch36, MCS3, 14 dBm base, 8822BU chip-RSSI ground, windowed medians:
Headless: full ctest 27/27; kestrel-only subset config builds and passes 26/26.
With this, every supported generation has a validated per-packet or fast TX-power lever.
🤖 Generated with Claude Code