Skip to content

RTL8814AU: align TX descriptor with aircrack-ng monitor-injection format#54

Merged
josephnef merged 1 commit into
masterfrom
8814-tx-descriptor-align
May 26, 2026
Merged

RTL8814AU: align TX descriptor with aircrack-ng monitor-injection format#54
josephnef merged 1 commit into
masterfrom
8814-tx-descriptor-align

Conversation

@josephnef
Copy link
Copy Markdown
Collaborator

Summary

  • The SET_TX_DESC_*_8812 macros are bit-identical to SET_TX_DESC_*_8814A (verified against hal/rtl8814a_xmit.h), so devourer can keep using the 8812 macro set on 8814A. But a usbmon byte-diff against a working VM-passthrough 88XXau monitor-injection session surfaced three field-value mismatches on the 8814A path. Each represents devourer writing a value that 88XXau leaves at zero for monitor-injected frames:
    • Dword 0 bit 31 — 8812 calls it OWN, 8814A calls it DISQSELSEQ. 88XXau leaves it 0 for monitor injection; devourer's SET_TX_DESC_OWN_8812(..., 1) sets it to 1, which on 8814A means disable queue-select-based sequence numbering.
    • Dword 2 bits 24-29 (GID) — 88XXau leaves at 0 for injection; devourer writes 0x3F.
    • Dword 4 bits 18-23 (DATA_RETRY_LIMIT) — 88XXau leaves at 0 for injection; devourer writes 12. (RETRY_LIMIT_ENABLE stays 1 in both.)
  • Skip those three writes when ICType == CHIP_8814A. New env gate DEVOURER_TX_LEGACY_8812_DESC=1 restores the old descriptor for emergency rollback without rebuilding.

Scope

  • This does NOT resolve RTL8814AU: devourer-TX produces 0 on-air frames despite 100% URB completion (post-#36) #50 (8814AU on-air silence). Both sessions on 2026-05-26 ruled out 9 distinct hypotheses including a binary URB-flag diff — the on-air gate is structurally below what vendor-control-write replay can reach. See #50 closing comment-4546974748.
  • Change is purely about descriptor correctness — aligning devourer's TX descriptor format with the byte-level reference produced by the working kernel driver. Strictly more correct even though it doesn't change observable behaviour on the current rig.
  • 8812AU and 8821AU paths are bit-for-bit identical to current master (is_8814a is false there and all writes fire as before).

Test plan

  • 8812AU WiFiDriverTxDemo: 760 submits / 760 complete / 0 fail (no regression — different code path).
  • 8814AU WiFiDriverTxDemo (new descriptor): 3572 submits / 3572 complete / 0 fail.
  • 8814AU with DEVOURER_TX_LEGACY_8812_DESC=1: matches current master's behaviour.
  • Build clean on Linux.
  • CI matrix builds (GCC/Clang/MSVC on Ubuntu/macOS/Windows) — <cstdlib> is portable, no platform-specific guards changed.
  • On-air capture: still 0 frames at AR9271 ch6 — expected, this PR doesn't claim to fix the on-air gate (that's RTL8814AU: devourer-TX produces 0 on-air frames despite 100% URB completion (post-#36) #50, structurally unfixable per the closing comment).

Refs #50 (partial — descriptor alignment only).

🤖 Generated with Claude Code

@josephnef josephnef force-pushed the 8814-tx-descriptor-align branch from 8959073 to 9c63d8a Compare May 26, 2026 17:53
In RtlJaguarDevice::send_packet the SET_TX_DESC_*_8812 macros are
bit-identical to the SET_TX_DESC_*_8814A macros (verified against
hal/rtl8814a_xmit.h), so devourer can keep using the 8812 macro set
on 8814A. But a usbmon byte-diff against a working VM-passthrough
88XXau monitor-injection session (qemu USB-host-passthrough → VM
kernel 88XXau → bulk-OUT URBs back through host xhci) shows three
field-value mismatches on 8814A:

  Dword 0 bit 31 — 8812 calls it OWN, 8814A calls it DISQSELSEQ.
    88XXau leaves bit 31 = 0 for monitor-injected frames; devourer's
    SET_TX_DESC_OWN_8812(..., 1) sets it to 1, which on 8814A means
    DISQSELSEQ=1 (disable queue-select-based sequence numbering).
  Dword 2 bits 24-29 (GID) — 88XXau leaves at 0 for injection;
    devourer writes 0x3F.
  Dword 4 bits 18-23 (DATA_RETRY_LIMIT) — 88XXau leaves at 0 for
    injection; devourer writes 12 (RETRY_LIMIT_ENABLE stays 1 in both).

Skip those writes on 8814A so the emitted descriptor byte-matches
aircrack-ng's reference monitor-injection format. Add a
DEVOURER_TX_LEGACY_8812_DESC=1 env-gate to restore the old behaviour
without rebuilding, in case anything downstream depends on it.

This does NOT resolve #50 (8814AU on-air silence has a separate root
cause that vendor-control-write replay cannot reach — both sessions on
2026-05-26 ruled out 9 distinct hypotheses including a binary
URB-flag diff, see comment-4546974748). The change is purely about
descriptor correctness — aligning devourer's TX descriptor format
with the byte-level reference that the working kernel driver produces.

8812AU and 8821AU paths are bit-for-bit identical to current master
(is_8814a is false there and all writes fire as before). Smoke-tested
on the live bench:

  8812AU: 760 submits / 760 complete / 0 fail
  8814AU (new): 3572 submits / 3572 complete / 0 fail (vs current
                master's behaviour, which is identical at libusb level
                because devourer's descriptor differences from 88XXau
                are no-ops at the bulk-OUT path post-PR-#49)
  8814AU (DEVOURER_TX_LEGACY_8812_DESC=1): same as without env

Refs #50 (partial — descriptor alignment only, not the on-air gate).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@josephnef josephnef force-pushed the 8814-tx-descriptor-align branch from 9c63d8a to 83ca75b Compare May 26, 2026 17:57
@josephnef josephnef merged commit ac4a89c into master May 26, 2026
5 checks passed
@josephnef josephnef deleted the 8814-tx-descriptor-align branch May 26, 2026 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RTL8814AU: devourer-TX produces 0 on-air frames despite 100% URB completion (post-#36)

1 participant