How open-sdr/openwifi works
Project type and purpose
• This is not a typical web app but a full-stack SDR (Software Defined Radio) Wi-Fi system combining FPGA hardware, a custom Linux kernel driver, kernel-boot configs, and user-space tooling/scripts to expose an IEEE802.11 compatible network device (sdr0) on a Zynq/ARM board.
High-level file‐structure analysis
• top‐level “driver/” – the kernel modules implementing the SDR MAC/PHY driver
• “kernel_boot/” – patches, device trees, and boot scripts to build u-boot/boot binaries
• “user_space/” – shell scripts, C/Python/Matlab user tools, sdrctl, webserver, configuration helpers
• “.gitmodules”, “doc/” – pointers to the separate FPGA HDL repo (openwifi-hw), documentation, app notes
Main components
A. Hardware Platform
• Zynq-based SoC with ARM cores + FPGA fabric
• AD936x RF front-end boards (e.g., FMCOMMS2, ADRV9361)
B. Bootloader & Kernel Image
• u-boot / BOOT.BIN built via kernel_boot scripts
• Device Tree Blobs (.dtb) describing FPGA peripherals
C. FPGA Bitstream (openwifi-hw)
• OFDM PHY, low-MAC (CSMA/CA in FPGA), DMA engines
D. Linux Kernel & Driver
• mac80211 stack (in-kernel)
• openwifi driver modules (driver/*.ko) exposing netdev “sdr0”
• sysfs & netlink interfaces for control/status
E. User-space Tools & Services
• sdrctl (netlink-based CLI)
• hostapd / wpa_supplicant (standard Wi-Fi daemons bound to sdr0)
• helper scripts (setup_once.sh, wgd.sh, cw_disable.sh, etc.)
• onboard webserver (static HTML UI)
• Matlab/Python apps for IQ capture, CSI display
F. External PC
• SSH control, FTP/TFTP (for updates)
• NAT/routing to give clients Internet access
Relationships & data/control flows
• Antenna ↔ RF transceiver → ADC/DAC ↔ FPGA fabric
• FPGA MAC/PHY ↔ AXI-DMA ↔ ARM DDR memory
• ARM Linux kernel modules read/write packets → mac80211 → network stack
• hostapd/wpa_supplicant ↔ kernel netdev “sdr0” (SSID broadcasting, association)
• sdrctl ↔ netlink/sysfs ↔ driver ↔ FPGA registers (frequency, gain, timing)
• User scripts orchestrate FPGA bitstream loading + driver insertion via wgd.sh
• Web UI ↔ HTTP server ↔ shell scripts ↔ sdrctl
Architectural patterns & design principles
• Layered design: Hardware / bootloader / kernel driver / user space
• Clear abstraction: FPGA implements time-critical MAC/PHY, Linux handles higher-level MAC and network stack
• Modular drivers (separate driver sub-dirs for TX, RX, side-channel, DMA, sysfs)
• Use of standard Linux interfaces (Device Tree, mac80211, netlink, sysfs) for portability
• Scripts automate build, deploy, update cycles (CI/CD style for FPGA/driver/images)
Technologies & frameworks to annotate
• Xilinx Vivado/Vitis for FPGA bitstream (.bit.bin)
• Device Tree Compiler (dtc)
• Linux kernel (Analog Devices custom branch)
• mac80211 Wi-Fi stack, hostapd, wpa_supplicant
• AXI-DMA, AXI-GPIO, AXI-Timer on FPGA
• netlink, sysfs, udev
• Shell, C, Python, Matlab for user tools