Repository navigation
Conversation
DeviceConfig::Tuning::wide_tx_igi_floor is fixed at construction. The edge below which a Jaguar3 transmitter loses 40 MHz capacity differs per unit and per channel, and the 0x35 default costs uplink sensitivity, so a caller that wants the lowest safe floor has to move it while the radio runs. IRtlRadio::SetWideTxIgiFloor(floor) records the new floor and re-applies it under _reg_mu, under the same rule as the construction-time value (after the session's first >= 40 MHz frame, while tuned that wide; every retune re-applies it). It is callable while another thread is blocked in bulk-OUT, and it can throw on a failed USB transfer; the floor is recorded first, so the DIG tick enforces it either way. Default: false (unsupported). PhydmRuntimeJaguar3::set_igi_floor now clamps IGI at once whenever the floor is lowered, not only when it is dropped to 0: a lowered non-zero floor pulls IGI down to max(floor, top of the channel's DIG window). The rule is a pure function (jaguar3/IgiFloor.h) with an igi_floor selftest. The TX arm in build_tx_block now runs on the first wide frame even when the floor is 0, so a floor set later still applies; with a floor of 0 the apply writes no register, and it takes _reg_mu once per session as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PR Summary by QodoAllow Jaguar3 wide-TX IGI floor changes at runtime
AI Description
Merge Risk
|
Code Review by Qodo
1. Failed floor writes look successful
|
josephnef
left a comment
There was a problem hiding this comment.
The setter behaves as described. I checked it on a second 8812EU (bare BL-M8812EU2, 0bda:a81a), channel 157(+) at 40 MHz, MCS2/40/LDPC, 1400-byte frames, with this PR merged together with #610 (clean merge, full build, ctest 96/96 with the two MT7612U generator checks skipped). IGI was read out of band (chipstate --no-claim --peek 0x1d70:4) while the probe held the interface.
Reproduced
| Step | IGI observed |
|---|---|
| Set 0x30 before any wide frame | unchanged (DIG window) |
| First wide frame, floor 0x35 | 0x35 |
| 0x35 → 0x24 | 0x24 at once |
| 0x24 → 0x1e | 0x22 at once, then DIG walks it to 0x1e |
| Raise to 0x22, 0x2c, 0x35 | at once |
| 0x80 | refused |
- No-gap flood: 2745–2780 frames/s at IGI 0x22 and above. At 0x1e it fell to 2381 with 15 send timeouts, then 1590 with 60, and was back at 2746 in the step that raised the floor to 0x22.
- A device constructed with
wide_tx_igi_floor = 0stalls at 0x1e (2026 frames/s, 21 timeouts) and takes a run-time 0x35 (2743 frames/s), so thebuild_tx_blockarming change works.
Requested before merge
- Land the measurements in the tree, not only in this description (inline on
DeviceConfig.h). - An in-tree caller. Nothing in the repo calls the setter, so neither table can be reproduced from the tree.
tests/cca_gates_probe.cppwas added for the same reason for the gate split; one small probe could cover this andGetTxQueuePagestogether.
Also
- Fork CI has not run on this PR; it needs a green run.
- Three non-blocking notes inline.
Limits of my check: one unit, one channel, one run per arm, TX power at −20 dB (this module's bench supply sags at full power under a no-gap flood, on master too), and host-side submitted rates rather than frames counted by a witness receiver. I did not reproduce the receiver-cost table.
| * 0x1e..0x22 non-DFS window. Lower it to a unit's own measured edge to | ||
| * buy that back. 80 MHz carries the same floor, only partially | ||
| * validated. docs/experiments/8822c-ht40-tx-stall.md. */ | ||
| /* Run-time changes: IRtlRadio::SetWideTxIgiFloor. */ |
There was a problem hiding this comment.
The comment just above this line still says the edge is "PER UNIT" and that the receiver cost is "estimated from the ~1 dB IGI step and NOT measured". This PR's description measures both: the edge moves with the channel on one unit (0x1f on 144, 0x1c on 157 and 100), and 0x35 costs at least ~12 dB of weak-frame sensitivity on that unit. With only this one line added, the tree contradicts the PR that motivated it.
Please update this comment and docs/experiments/8822c-ht40-tx-stall.md with the per-channel edge table and the receiver-cost table, including their scope (one 8812EU, cost rows down to RSSI 44 with the rest extrapolated). That is also what tells a caller why a run-time setter exists.
| uint8_t cur_igi, uint8_t window_hi) { | ||
| if (floor != 0 && cur_igi < floor) | ||
| return floor; | ||
| if (floor < prev_floor) { |
There was a problem hiding this comment.
Non-blocking, and narrower than the automated review makes it sound. set_igi_floor stores _igi_floor before get_igi(). If that read throws while the floor is being lowered, a retry of the same value arrives with prev_floor == floor, so this branch is skipped and IGI is not pulled down.
With DIG running it heals itself: the next dig() tick clamps to hi = max(window top, floor) within ~2 s. It only sticks when tuning.skip_dig is set. Either store the floor after the read, or document that a retry after a throw relies on the DIG tick.
| * thread is blocked in a bulk-OUT send. Returns false where unsupported or | ||
| * for a value the chip cannot take (Jaguar3: above 0x7f). | ||
| * | ||
| * THROWS on a failed USB transfer (the IGI read-modify-write is a register |
There was a problem hiding this comment.
Non-blocking wording. Only the read half of the read-modify-write throws. phy_set_bb_reg goes through PHY_SetBBReg8812, which drops the write's result, as every BB write in the tree does. So a failed write returns true here with the floor recorded but IGI unchanged until the next DIG tick. "THROWS on a failed register read" would be accurate.
Two behaviours I observed that the comment could state:
- A non-zero floor below the DIG minimum returns
trueand changes nothing: with0x1cset, IGI stayed at 0x1e. - The live value outlives the session.
Stop/Init/InitWriteclear_wide_tx_seenbut not_wide_tx_igi_floor, so a re-init keeps the last value set here rather than returning toDeviceConfig::Tuning::wide_tx_igi_floor. Fine if intended, but it should say so.
The gap
DeviceConfig::Tuning::wide_tx_igi_flooris fixed at construction. Its comment already says the edge is per unit, and that 0x35 costs idle-channel RX sensitivity that was estimated but not measured. One more 8812EU, measured below, shows the edge also moves with the channel, and that the cost is large. So no single construction-time value fits. A caller that wants the lowest safe floor has to start low and raise it while the radio runs, and today it cannot.The change
IRtlRadio::SetWideTxIgiFloor(uint8_t floor)(Jaguar3). It records the floor and re-applies it under_reg_mu, under the same rule as the construction-time value: after the session's first ≥ 40 MHz frame, while tuned that wide; every retune re-applies it. Values above 0x7f return false. Other generations return false (default virtual).PhydmRuntimeJaguar3::set_igi_floorclamps IGI at once whenever the floor is lowered, not only when it drops to 0. IGI goes to max(new floor, top of the channel's DIG window) instead of keeping the old floor's gain until DIG walks it down. The rule is a purejaguar3::igi_on_floor_change(IgiFloor.h) with anigi_floorselftest. The old dropped-to-0 behaviour is unchanged.build_tx_blockarms on the first wide frame even when the floor is 0, so a floor set later still applies. With 0 the apply writes no register; it is still one_reg_mutake per session, and the hot path stays lock-free.Measured
One 8812EU (USB high speed), MCS2/40/LDPC, 1400-byte frames, sent with no gap (ceiling ~2790 frames/s). IGI pinned with DIG off; share of the ceiling per value:
This unit's edge is 0x1f on 144 and 0x1c on 157 and 100. 20 MHz frames run at full rate at every IGI from 0x08 to 0x24.
What the floor costs the receiver. A second card sent MCS0/20 frames at three levels while the 8812EU transmitted at 40 MHz and counted them per floor. Reception falls from ~99 % to 0 in one floor step, about 19-23 IGI above the frames' RSSI (chip units):
Extended down, 0x35 is deaf below an RSSI of about 28-30 and 0x22-0x24 below about 9-11. The weakest frames either card decoded at IGI 0x1e-0x20 were at RSSI 16 (13-15 dB SNR). So on this unit 0x35 costs at least ~12 dB of sensitivity to weak frames, against 0-4 dB for a floor just above its edge.
A caller using the setter. It starts at a low floor and raises it when its TX stalls (longest send ≥ 30 ms, or PUB queue backlog ≥ 60 %). It reverts if the stall does not clear and keeps the value after 3 clean 1 s windows. Windows with CLM busy ≥ 20 % are not judged. A 60 fps video downlink at 40 MHz, 170 s runs (330 s with the jammer); "spread" is p99 − p50 frame arrival per 30 s slice:
161 is rough for its first minute at MCS2 whatever the floor (the 0x22 row never moves).
Build: full, no-Jaguar3 and Jaguar3-only configure + build;
ctest92/92 (83/83 Jaguar3-only). Theigi_floorselftest was revert-checked: with the old dropped-to-0-only clamp, the three "lowered" checks fail.Not covered
🤖 Generated with Claude Code