jaguar3: honour rx.keep_corrupted in the monitor RCR (ACRC32|AICV) - #416
jaguar3: honour rx.keep_corrupted in the monitor RCR (ACRC32|AICV)#416gilankpam wants to merge 1 commit into
Conversation
PR Summary by QodoHonor keep_corrupted in Jaguar3 monitor receive configuration
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can commit Qodo's fix in one click with committable suggestions (GitHub & GitLab) |
The monitor_rx_cfg comment claimed the RCR base accepted CRC/ICV-error frames; per halmac_bit_8822c.h / halmac_bit_8822e.h the literal 0xF410400F leaves ACRC32 (BIT8) and AICV (BIT9) clear, so the WMAC was dropping FCS-failed frames and DeviceConfig::rx.keep_corrupted was a no-op on Jaguar3. Gate the two bits on the field, as Jaguar1/2 and the RTL8733B do, and fix both comments. Verified on one 8812EU unit: bits set => FCS-failed frames reach the host with crc_err marked; bits clear => zero, always. While correcting the field's documented scope, also name the RTL8733B (Halmac8733bMac::configure_monitor_rx already gates the same two bits) and say plainly that Kestrel has no port, where the knob is inert. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JiAS32956Z3cmTbnmcXYkT
8bf7d8b to
870f076
Compare
DEVOURER_RX_KEEP_CORRUPTED was a silent no-op on Jaguar3 — the hardcoded monitor RCR left ACRC32/AICV clear despite a comment claiming otherwise, so the WMAC dropped every FCS-failed frame and the fused-FEC salvage layer had nothing to work on. Submitted upstream as OpenIPC#416. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JiAS32956Z3cmTbnmcXYkT
josephnef
left a comment
There was a problem hiding this comment.
Correct fix, and the decode in the new comment holds up.
I checked 0xF410400F | BIT28 against reference/rtl88x2cu/hal/halmac/halmac_bit_8822c.h:15954-15986: APP_FCS(31) APP_MIC(30) APP_ICV(29) APP_PHYSTS(28) VHT_DACK(26) PKTCTL_DLEN(20) HTC_LOC_CTRL(14) AB(3) AM(2) APM(1) AAP(0). ACRC32(8) and AICV(9) are genuinely absent, and the old comment's ACF was never in the literal either — the correction is right on both counts.
Downstream is wired, so the RCR bits really are the whole gate: FrameParserJaguar3.h:242-243 decodes crc_err/icv_err, RtlJaguar3Device.cpp:299-300 propagates them into RxAtrib, and the RX loop delivers the frame to the packetProcessor without a software drop (only the PHY-status fold at :343 gates on crc_err). The fix does reach the salvage layer.
Two things beyond the inline note:
A behaviour change the description doesn't cover. examples/doctor/main.cpp:229 sets cfg.rx.keep_corrupted = true unconditionally. On Jaguar3 the doctor's rx_frames_crc goes from structurally-always-0 to a real count. No verdict flip — ClassifyAdapterHealth reads rx_frames_ok separately — but the printed report changes on this generation, and "default behaviour is unchanged" reads as covering the shipped tools. Worth a line in the body.
Needs a rebase. The branch is BEHIND master; #415 renamed IRtlDevice→IRadio. Trivial here since this diff touches neither.
No objection to merging once rebased.
| * (whose arm programs the self-MAC to the NDPA RA) saw sounding frames while | ||
| * a plain monitor did not. */ | ||
| _device.rtw_write32(REG_RCR_8822C, 0xF410400F | (1u << 28)); | ||
| uint32_t rcr = 0xF410400F | (1u << 28); |
There was a problem hiding this comment.
| (1u << 28) is redundant — bit 28 is already in the leading 0xF nibble of 0xF410400F, which is exactly what the new comment above now spells out (... + APP_FCS/APP_MIC/APP_ICV/APP_PHYSTS). Pre-existing, but now that the base is decoded in the comment the separate OR reads as if APP_PHYSTS were being added on top. Drop one or the other.
DEVOURER_RX_KEEP_CORRUPTED/DeviceConfig::rx.keep_corruptedwas a silentno-op on Jaguar3 (RTL8812CU/8822CU, RTL8812EU/8822EU).
monitor_rx_cfgwrote a hardcoded RCR of0xF410400F | BIT28, and its commentclaimed that value already accepted CRC/ICV-error frames — it listed
AAP/APM/AM/AB/ACF/AICV/ACRC32 + APP_PHYSTS. Decoding the literal againsthalmac_bit_8822c.h/halmac_bit_8822e.hshows ACRC32 (BIT8) and AICV (BIT9)are not in it. The WMAC filter therefore dropped every FCS-failed frame no
matter how the config field was set, so the corrupted-frame retention the
fused-FEC salvage layer is built on never worked on this generation.
The fix gates the two bits on
_cfg.rx.keep_corrupted, which is what Jaguar1(
RadioManagementModule.cpp), Jaguar2 (HalJaguar2.cpp) and the RTL8733B(
Halmac8733bMac::configure_monitor_rx) already do. Both misleading commentsare corrected, including a full decode of the base literal so the next reader
does not have to redo it.
Default behaviour is unchanged:
keep_corrupteddefaults tofalse, so anunconfigured Jaguar3 monitor session programs exactly the RCR it programmed
before this patch.
Also widens the
keep_corrupteddoc comment inDeviceConfig.h, which said"Jaguar1 + Jaguar2": it now names Jaguar3 and the RTL8733B, and states that
Kestrel has no port and the knob is inert there.
Validation
Bench-verified on one RTL8812EU unit: with the bits set, FCS-failed frames
reach the host with
crc_errmarked in the RX descriptor; with them clear thecount is zero regardless of channel conditions. One unit, one bench — the A/B
is its own control, but the result is not replicated across parts.
No headless selftest:
monitor_rx_cfgwrites straight to the device with noseam to assert against, which is also why the Jaguar1 and Jaguar2 equivalents
have none.
cmake --build+ctestgreen (55/55,la_csi_mathskipped — itneeds python numpy/scipy).
Note the Jaguar1 measurement in
docs/pseudo-preamble-puncturing.md("zeroFCS-failed frames" under a jammed slice) is unaffected — that experiment used
an 8814AU receiver, whose path already gated correctly.
🤖 Generated with Claude Code
https://claude.ai/code/session_01JiAS32956Z3cmTbnmcXYkT