This directory contains the WLAN stack for Fuchsia. The stack follows a layered architecture, with components interconnected via FIDL.
Policy Layer (wlancfg or wlanix):
wlancfg: Standard Fuchsia WLAN policy. Implements fuchsia.wlan.policy.wlanix: Provides Android-compatible WiFi APIs for Starnix. Implements fuchsia.wlan.wlanix.wlandevicemonitor to manage interfaces and access the SME.Device Management Layer (wlandevicemonitor):
fuchsia.wlan.device.service.DeviceMonitor.Core / Stack Layer (SME & MLME):
src/connectivity/wlan/lib/sme): Shared logic across all hardware. Manages connection state, scanning, and security (RSN).src/connectivity/wlan/lib/mlme):mlme/rust). Manages the 802.11 state machine.mlme/fullmac). Converts standard MLME commands to vendor-specific fuchsia.wlan.fullmac calls.Driver Layer (drivers/):
wlanphy: Management of the physical device.wlansoftmac: Driver that hosts the SoftMAC SME/MLME and implements lower MAC functions.wlanif: Interface protocol between the stack and the driver.To plumb a new feature through the stack, follow this flow (using Android Packet Filter (APF) as an example):
Define the new types and methods in the appropriate FIDL libraries. See the classification in FIDL.md to determine where your changes belong based on stability and layer boundaries.
wlanix or wlancfg)wlanix: Handle requests in src/connectivity/wlan/wlanix/src/main.rs. Use an IfaceManager trait to forward calls to the SME.wlancfg: Add logic to state machines (e.g., client/state_machine.rs) to trigger the feature.src/connectivity/wlan/lib/sme)MlmeRequest enum in lib.rs to include the new command.ClientSme (e.g., src/client/mod.rs) to send the MlmeRequest.src/serve/client.rs to call the new SME methods.src/connectivity/wlan/lib/mlme)mlme/fullmac):src/convert/mlme_to_fullmac.rs (MLME -> FullMAC) and src/convert/fullmac_to_mlme.rs (FullMAC -> MLME).DeviceOps trait and FullmacDevice in src/device.rs to include the new driver calls.MlmeRequest in the main loop (src/mlme_main_loop.rs), perform the conversion, and call the driver via DeviceOps.brcmfmac).wlansoftmac.For a detailed list of key FIDL protocols and their stability guarantees, see FIDL.md.
src/connectivity/wlan/testing: Infrastructure like wlantap (virtual driver) and hw-sim.src/connectivity/wlan/tests: Integration and E2E tests.