GetTxCaps + STBC-on-1T1R guard — stop airing malformed frames#197
Merged
Conversation
The adaptive-link recipes flag a real footgun: "LDPC/STBC forced on a card that
lacks them => link dies" (8811AU/8821AU/8821CU are 1T1R; STBC needs >=2 TX
chains). devourer set the STBC descriptor bit unconditionally from the radiotap
flag, even on 1T1R parts, producing a PPDU that never decodes.
Measured A/B on the 8821AU (MCS1/STBC): forcing STBC delivered 0 frames; with
the guard (STBC dropped to clean MCS1) it delivered 7000. Real correctness fix,
not just defensive.
- src/TxCaps.h — devourer::TxCaps {n_ss, stbc_ok, ldpc_ok, sgi_ok, bw_max_mhz}
+ tx_caps_for_chains() (the load-bearing rule: stbc_ok = chains >= 2).
- IRtlDevice::GetTxCaps() default; per-family override from the chip identity
devourer already resolves (Jaguar1 EepromManager numTotalRfPath; Jaguar2
ChipVariant C8821C=1T1R vs C8822B=2T2R; Jaguar3 8822C/E 2T2R).
- send_packet drops STBC + warns once when !stbc_ok (each family; a no-op on
2T2R/4T4R, byte-identical when STBC isn't requested).
Validated: TxCapsSelftest (ctest + mingw list) on the chains->caps rule;
tests/stbc_1t1r_check.sh 4/4 on-air — 8821AU + 8821CU (1T1R) drop STBC and
deliver (6500/6000 hits) with the warning; 8812AU + 8822BU (2T2R) honour STBC,
no warning, deliver. Full build + J1-only subset green.
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.
Why
From
/tmp/adaptive-link-recipes.md(§10 pitfalls): "LDPC/STBC forced on a card that lacks them → link dies" — the 8811AU/8821AU/8821CU are 1T1R, and STBC needs ≥2 TX chains. devourer set the STBC descriptor bit unconditionally from the radiotap flag, even on 1T1R parts, producing a PPDU that never decodes.Measured — it's a real delivery bug, not just spec-illegal
A/B on the 8821AU injecting
MCS1/STBC, second-adapter delivery count:The recipe's "link dies" is literal.
What
src/TxCaps.h—devourer::TxCaps {n_ss, stbc_ok, ldpc_ok, sgi_ok, bw_max_mhz}+tx_caps_for_chains()(the load-bearing rule:stbc_ok = chains >= 2).IRtlDevice::GetTxCaps()default + per-family override from the chip identity devourer already resolves: Jaguar1EepromManagernumTotalRfPath, Jaguar2ChipVariant(C8821C 1T1R vs C8822B 2T2R), Jaguar3 8822C/E 2T2R.send_packetdrops STBC + warns once when!stbc_ok(each family). A no-op on 2T2R/4T4R; byte-identical when STBC isn't requested.Validation
ctest+ mingw list):TxCapsSelftest— thechains → {n_ss, stbc_ok}rule (1T1R→no STBC, 2T2R/4T4R→STBC ok).tests/stbc_1t1r_check.sh): 4/4 — 8821AU + 8821CU (1T1R) drop STBC and deliver (6500/6000 hits) with the warning; 8812AU + 8822BU (2T2R) honour STBC, no warning, deliver.Full all-chips build + J1-only subset green.
GetTxCapsalso gives an adaptive controller a clean way to query STBC/LDPC/n_ss/bw before requesting a feature.🤖 Generated with Claude Code