Skip to content

Wi-Fi hardware-timestamping prototypes: USB RX SO_TIMESTAMPING + PCIe PHC/rtw88#232

Merged
josephnef merged 1 commit into
masterfrom
wifi-hwtstamp-prototypes
Jul 10, 2026
Merged

Wi-Fi hardware-timestamping prototypes: USB RX SO_TIMESTAMPING + PCIe PHC/rtw88#232
josephnef merged 1 commit into
masterfrom
wifi-hwtstamp-prototypes

Conversation

@josephnef

Copy link
Copy Markdown
Collaborator

Out-of-band reference tooling behind the timing findings in docs/timing-accuracy.md. None of it is part of the devourer library build — it's kernel-side experiments in tests/, so the library CI is unchanged.

USB — surface the vendor rtl88x2cu RX hardware timestamp

  • Submodule bump reference/rtl88x2cu → the merged CONFIG_RTW_HWTSTAMP driver (attaches the RX-descriptor TSF to skb_hwtstamps before delivery, so a SO_TIMESTAMPING socket reads the 802.11 hardware RX timestamp).
  • tests/rx_hwtstamp_probe.c — AF_PACKET + SO_TIMESTAMPING reader.
  • tests/rx_hwtstamp_validate.sh — capability check (driver swap + ethtool -T).
  • tests/rx_hwtstamp_onair.sh — on-air value check against a devourer open AP; verified the RX timestamps advance in step with real airtime.

PCIe — RTL8821CE (rtw88)

  • tests/pcie_phc/ — a passive PTP hardware clock (/dev/ptpN) off the MAC TSF over BAR2 MMIO (rtw88 stays bound; the module only ioremaps and reads), a gettime-latency probe (~3.7 µs MMIO floor), an Intel I226 cross-check (Wi-Fi TSF tracks a real IEEE-1588 clock to ~290 ns), and a one-hunk rtw88 RX skb_hwtstamps patch. See tests/pcie_phc/README.md.
  • tests/pcie_tsf_read.c — userspace BAR2 TSF reader.

Scope

RX hardware timestamping works on both transports; a real PHC is tractable on PCIe. Two-way ptp4l over the Wi-Fi radio stays blocked on a host-reported TX-egress timestamp (firmware limitation) — the board's I226 Ethernet is the real-PTP reference. All measured results and that limit are in docs/timing-accuracy.md.

🤖 Generated with Claude Code

… PHC/rtw88

Out-of-band reference tooling behind the timing findings in
docs/timing-accuracy.md. None of it is part of the devourer library build.

USB (surfaces the vendor rtl88x2cu RX hardware timestamp):
- Bump the reference/rtl88x2cu submodule to the merged CONFIG_RTW_HWTSTAMP driver
  (attaches the RX-descriptor TSF to skb_hwtstamps -> SO_TIMESTAMPING).
- tests/rx_hwtstamp_probe.c: AF_PACKET + SO_TIMESTAMPING reader.
- tests/rx_hwtstamp_validate.sh: capability check (driver swap + ethtool -T).
- tests/rx_hwtstamp_onair.sh: on-air value check against a devourer open AP.

PCIe (RTL8821CE, rtw88):
- tests/pcie_phc/: a passive PTP hardware clock off the MAC TSF over BAR2 MMIO
  (rtw88 stays bound), a gettime-latency probe, an Intel-I226 cross-check, and a
  one-hunk rtw88 RX skb_hwtstamps patch. See tests/pcie_phc/README.md.
- tests/pcie_tsf_read.c: userspace BAR2 TSF reader.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@josephnef josephnef merged commit 9a2263f into master Jul 10, 2026
15 checks passed
@josephnef josephnef deleted the wifi-hwtstamp-prototypes branch July 10, 2026 12:49
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.

1 participant