The Espressif WiFi driver is an 802.11 wireless network driver for the Linux kernel, supporting Espressif WiFi chips.
Espressif WiFi Driver Architecture:
+---------------------------------+
| Linux |
| |
| iw / wpa / hostapd / tools |
| | |
| (user space) |
| | nl80211 |
| --------------+-------------- |
| (kernel space) |
| | cfg80211_ops |
| v |
| mac80211 |
+----------------+----------------+
|
| ieee80211_ops
v
+---------------------------------+
| espwl_core |
+---------------------------------+
| TRANS Layer |
+---------------------------------+
| HIF (Host Interface) |
+---------------------------------+
| usb | sdio | pci |
+----------------+----------------+
|
| (USB/SDIO/PCIe)
v
WiFi Chip
- core: Core driver module implementing main driver logic
- fw: Firmware management
- hw: Hardware abstraction layer
- trans: Transport layer
- mac: MAC layer implementation
- phy: Physical layer implementation
- wow: Wake-on-Wireless support
- sip: SIP related functionality
- pci: PCIe interface support
- sdio: SDIO interface support
- usb: USB interface support
- debug: Debug functionality
- debugfs: Debug filesystem interface
- testmode: Test mode support
Install pre-commit and enable the Git hook so commits run the same checks as CI (clang-format --dry-run --Werror on tracked *.c / *.h, excluding espwl_test/include/libnl3/, plus light hygiene on C/H sources):
python3 -m pip install --user pre-commit
export PATH="$HOME/.local/bin:$PATH"
pre-commit installRun once on the whole tree: pre-commit run --all-files. Requires clang-format on PATH (Ubuntu: sudo apt install clang-format).
This project provides two build methods controlled by the BUILD variable:
Used for cross-compilation scenarios, requires specifying the kernel source path. This is the default build mode (BUILD=cross).
- Compiled Linux kernel source (requires
vmlinuxorModule.symvers) - Cross-compilation toolchain (default:
aarch64-linux-gnu-)
# Basic build (PCI enabled by default, SDIO and USB disabled)
# BUILD=cross is the default, so it can be omitted
make KSRC=/path/to/kernel/source
# Specify architecture and cross-compilation toolchain
make KSRC=/path/to/kernel/source ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
# Enable specific interfaces
make KSRC=/path/to/kernel/source PCI=y SDIO=n USB=n
# Explicitly specify cross build mode
make BUILD=cross KSRC=/path/to/kernel/source
# Clean build files
make cleanKSRC: Linux kernel source directory (required)ARCH: Target architecture (default:arm64)CROSS_COMPILE: Cross-compilation toolchain prefix (default:aarch64-linux-gnu-)PCI: Enable PCIe interface (default:y)SDIO: Enable SDIO interface (default:n)USB: Enable USB interface (default:n)E22_ECO0: Build the legacy E22 ECO0 PCIe driver path (default:n; ECO1 is default)
ESPWL_DEBUG:y(default) orn— only compile-time switch: whether to build in verbose logging (espwl_dbg, hex helpers, debugfsdebug_level, module parameterdebug=). The bitmask itself is not set at compile time.- Debug filesystem:
CONFIG_ESPWL_DEBUGFS(always enabled from Makefile; seedebugfsdirectory under the driver’s debugfs root). - Generic Netlink test mode:
CONFIG_ESPWL_GENETLINK_TESTMODE - Git version information: Automatically embeds Git commit hash
Used for directly compiling and installing the driver on the target system.
- Linux kernel headers (usually located at
/lib/modules/$(uname -r)/build) - Compiled kernel module symbol files
# Build driver modules
make BUILD=host
# Build and install driver
make BUILD=host install
# Uninstall driver
make BUILD=host uninstall
# Sign driver modules (for secure boot)
make BUILD=host sign
# Build, sign and install
make BUILD=host sign-install
# Clean build files
make BUILD=host clean- Module installation path:
/lib/modules/$(uname -r)/kernel/drivers/net/wireless/espressif/ - Firmware path:
/lib/firmware/espressif
If the system has secure boot enabled, you can use the sign target to sign driver modules:
- First run will generate MOK (Machine Owner Key) key (
MOK.privandMOK.der) - Import the key using
mokutil --import MOK.der - Reboot the system and complete MOK enrollment
- Afterward, you can use the generated key to sign modules
- If
MOK.deralready exists, key creation will be skipped
# Cross-compilation example
make KSRC=/home/user/linux ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
# Native build example
make BUILD=host
sudo make BUILD=host install# Load mac80211 etc.
sudo modprobe mac80211
# Load core module
sudo insmod espwl_core
# Load interface module (choose based on interface used)
sudo modprobe espwl_pci # PCIe interface# Unload interface modules
sudo modprobe -r espwl_pci
# Unload core module
sudo modprobe -r espwl_coreThe driver supports debugging through debugfs:
# Mount debugfs (if not mounted)
sudo mount -t debugfs none /sys/kernel/debug
# Access driver debug information
ls /sys/kernel/debug/espwl/- Compile time:
make ESPWL_DEBUG=nstripsespwl_dbgand related debug code. Default build (ESPWL_DEBUG=y) includes log support; initial mask is0until you change it at runtime. - Runtime (log level / mask): module parameter
debug=0x<hex>oninsmod/modprobe, or read/writedebug_levelunder the driver’s debugfs directory (same bitmask; see that file for bit names). Do not use the Makefile for the mask.
Kernel driver sources in this repository are distributed under GNU General
Public License v2.0 or the 3-Clause BSD License, at your option
(GPL-2.0 OR BSD-3-Clause; see SPDX tags in individual source files). Built
modules use MODULE_LICENSE("Dual BSD/GPL"), consistent with common Linux
dual-licensed drivers.
Full texts: LICENSE (overview), LICENSE.GPL-2.0, LICENSE.BSD-3-Clause.
Other directories (for example user-space test code or vendored headers) may carry different licenses; check the notices in those files.
Copyright (C) 2026 Espressif Systems (Shanghai) CO LTD