From 4aa492d06a1a43356188b1499afb5248bf9deb08 Mon Sep 17 00:00:00 2001 From: vasilito Date: Sat, 25 Jul 2026 16:53:18 +0900 Subject: [PATCH] AGENTS.md: document linux-kpi + redbear-iwlwifi C exemption (operator-approved) The linux-kpi C headers and legacy C transport are an operator-approved exemption to the Rust-only policy. C headers = firmware ABI contract (match Linux fw/api/*.h byte-for-byte). C transport = inherited legacy. Rust modules = driver logic. C MLD helpers = thin transport bridge. Documented with full architectural justification. --- AGENTS.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index c2cbf83173..36591a962e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -411,6 +411,25 @@ by size. The `local/reference/` directory is **NOT** optional. **Enforcement:** Any new file ending in `.c` under `local/recipes/*/source/` or `local/sources/*/` must justify its existence with an operator-approved exemption. The default answer is Rust. +### linux-kpi + redbear-iwlwifi exemption (operator-approved 2026-07-24) + +The linux-kpi C headers (`mac80211.h`, `ieee80211.h`, `cfg80211.h`, etc.) and the +legacy C transport layer (`linux_port.c`, `linux_mvm.c`) are an **exemption** to the +Rust-only policy. This subsystem is a C-to-Redox driver shim that talks directly to +Intel Wi-Fi firmware via PCI DMA rings. The C headers are the firmware ABI contract +(must match Linux `fw/api/*.h` struct layouts byte-for-byte). The C transport handles +DMA ring management, TFD queues, and firmware command submission. + +**Architecture:** C headers = ABI contract (match Linux source 1:1). C transport = +inherited legacy (proven working, untouched). Rust modules (`mld.rs`, `mac80211.rs`) = +driver logic, state management, callback dispatch. C MLD helpers (`linux_mld.c/h`) = +thin transport bridge between C transport types and Rust MLD logic. + +This exemption exists because rewriting the 2635-line proven C transport in Rust would +duplicate working code with zero functional gain, and the firmware expects `#[repr(C, +packed)]` struct layouts that are most reliably defined in C headers matching the Linux +source. + ## DURABILITY POLICY Every change to an upstream-owned source tree (anything under `recipes/*/source/`) **must** be