Skip to content

Add Unix socket Air backend (radio_link), 2x2 VHT 80MHz TLV, and buffered staging - #138

Open
YiHoooong wants to merge 1 commit into
t4t5:mainfrom
YiHoooong:feat/socket-air-vht80
Open

YiHoooong wants to merge 1 commit into
t4t5:mainfrom
YiHoooong:feat/socket-air-vht80

Conversation

@YiHoooong

Copy link
Copy Markdown

Summary

This PR adds three improvements motivated by bringing up MediaTek MT7922 (14c3:0616 / RZ616) on 5 GHz channel 149 (working around the Linux mt7921e kernel driver limitations noted in #14 via a user-space radio daemon):

  1. Unix Socket Air backend (owly-radio/src/native.rs + examples/mtkradio.rs):

    • Adds Native::start_socket() and a cancel-safe, 64 KiB buffered SocketAir implementing owly_awdl::driver::Air over the radio_link framing protocol (compatible with user-space radio daemons such as nekodrop's mtkradio / iwxradio).
    • Reuses a pre-allocated TX scratch buffer and tunes SO_RCVBUF/SO_SNDBUF to 4 MiB to avoid per-frame allocations and syscall overhead.
    • Adds unit tests socket_air_recv_batches_and_is_cancel_safe, socket_air_send_frames_correctly, and write_tx_radiotap_matches_radiotap_tx_header.
  2. 2x2 HT + 80 MHz VHT Capabilities TLV (owly-awdl/src/tlv.rs, node.rs):

    • Adds HtCapabilities::TWO_STREAM (rx_mcs = 0xffff, 2-byte LE encoding when rx_mcs > 0xff, keeping 1-byte length 8 for ONE_STREAM).
    • Adds VhtCapabilities (TWO_STREAM_80MHZ: 80 MHz 2x2 MCS 0–9, Max MPDU 3895 B, Max A-MPDU Exp 7) emitted as TLV 17 (IEEE80211_CONTAINER, 14 bytes matching iOS 26 captures) on 5 GHz channels (channel > 14).
    • Adds vht_capabilities_wire_bytes_and_roundtrip unit test.
  3. Buffered file staging (owly-airdrop/src/driver/staging.rs):

    • Wraps staged tokio::fs::File writes in a 256 KiB tokio::io::BufWriter (flushed cleanly on end_file() / create_file()).

Hardware & Test Results

  • Tested live on MediaTek MT7922 (14c3:0616) on 5 GHz channel 149 (80 MHz) against iPhone & iPad (iOS 26) via mtkradio_linux:
    • Hardware RX Block Ack (STA_REC_BA, 64-frame window) negotiated and active with both iPhone and iPad.
    • 4 MB photos transfer in ~1–2 seconds; sustained large-file streaming with 0 queue drops (90,755 RX data frames, radio full 0, dropped queue 0).
  • All unit & simulation tests pass (cargo test -p owly-awdl: 56/56, cargo test -p owly-airdrop: 78/78, cargo test -p owly-radio --lib: 38/38) and cargo build --release --locked succeeds with 0 warnings.

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