Commit 2bf5020
RTL8814AU: post-fwdl chip-state parity (MAC addr, RRSR, RA-table) (#27)
## Summary
Three independent chip-init parity bugs found via live pyusb register
readback (kernel-driver vs devourer state) + usbmon trace diff. Each
brings devourer's post-init chip state closer to what the working
kernel-driver leaves in the chip.
1. **`REG_TXPKTBUF_BCNQ1_BDNY_8814A` address: `0x0426` → `0x0456`** (per
`hal/rtl8814a_spec.h:262`). The previous "spec calls it +2" comment was
wrong; BCNQ1 lives at `0x0456`, not BCNQ+2. The bad write scribbled some
queue/protocol register instead.
2. **`REG_MACID` (`0x0610..0x0615`) now programmed.** Kernel-driver
writes 6 individual bytes carrying the chip's MAC address; devourer
never wrote `REG_MACID` at all, leaving it `00:00:00:00:00:00`.
Hardcoded locally-administered address (`02:0d:b0:c7:e4:b3`) for now —
proper EFUSE-read is a follow-up.
3. **Trace-derived post-fwdl init batch** — writes the kernel driver
makes that devourer skipped:
- `REG_RRSR (0x0440) = 0xff0f0000` — Response Rate Set
- `REG_QUEUE_CTRL (0x04c6) = 0x04`
- `REG_TX_PTCL_CTRL (0x0520) = 0x0f2f0000`
- `REG_RD_CTRL (0x0524) = 0x0f4fff00`
- `0x0670 = 0x000000c0` — NAV-related
- RA-table init at `0x0990-0x09a4`
## What this does NOT fix
End-to-end 8814 TX. Bulk OUT EP `0x02` still times out post-init. Usbmon
diff shows kernel does **~4464 post-fwdl vendor writes**; this PR adds
~12 of them. Most of the remaining ~4400 are BB/PHY programming in the
`0x800-0x1FFF` register range (table-driven, deterministic) that
devourer doesn't yet replicate. That's the next layer of work.
## Test plan
- [x] Build green on macOS (`cmake --build build`)
- [x] Build green on Arch Linux 6.18 (trainer-arch)
- [x] 8814 RX regression on CF-938AC (`0bda:8813`), channel 6: 10+
packets received in demo window
- [x] Live pyusb readback confirms these registers now hold the
kernel-driver values
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent adea8b7 commit 2bf5020
1 file changed
Lines changed: 42 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
400 | 400 | | |
401 | 401 | | |
402 | 402 | | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
403 | 444 | | |
404 | 445 | | |
405 | 446 | | |
| |||
0 commit comments