Mwifiex
WiFi extensions
Install / Use
/learn @nxp-imx/MwifiexREADME
MXM Wi-Fi Driver
================================================================================ U S E R M A N U A L
Copyright 2008-2025 NXP
-
FOR DRIVER BUILD
Goto source code directory. make [clean] build The driver and utility binaries can be found in bin_wlan directory. The driver source code is compatible with hosts running Linux kernel versions ranging from 2.6.32 to 6.17.0.
-
FOR INTEGRATING DRIVER INTO LINUX KERNEL (BUILT-IN SUPPORT)
a) mkdir -p <Linux_Kernel_Repo>/drivers/net/wireless/nxp b) Clone the WLAN source code from nxp-imx/mwifiex repo to the drivers/net/wireless/nxp directory in the kernel repo. cd <Linux_Kernel_Repo>/drivers/net/wireless/nxp git clone https://github.com/nxp-imx/mwifiex.git c) Make sure the directories mlan/, mlinux/ as well as the files Makefile, Kconfig are present in drivers/net/wireless/nxp/mwifiex. d) In <Linux_Kernel_Repo>/drivers/net/wireless/Kconfig, add the following line: 'source "drivers/net/wireless/nxp/mwifiex/Kconfig"' e) In <Linux_Kernel_Repo>/drivers/net/wireless/Makefile, add the following line: 'obj-$(CONFIG_WLAN_VENDOR_NXP) += nxp/mwifiex/' f) Run make defconfig or menuconfig to enable support for NXP WLAN devices: Device Drivers > Network device support > Wireless LAN [] "NXP WLAN devices" g) To configure the driver as a module: <M> "NXP WLAN Driver" Or to configure the driver as inbuilt: <> "NXP WLAN Driver" h) Save. Verify the kernel .config file for CONFIG_WLAN_VENDOR_NXP and CONFIG_NXP_WLAN_DRIVER flags. i) source <toolchain> j) make
There is a high chance that the inbuilt NXP WLAN driver would be loaded before rootfs is mounted. In such scenario, the firmware files can also be added to the linux kernel Image using the following steps: a) mkdir -p <Linux_Kernel_Repo>/kernel/firmware/nxp b) Copy FW files to <Linux_Kernel_Repo>/kernel/firmware/nxp/ c) In kernel .config, add 2 new config flags: i) CONFIG_EXTRA_FIRMWARE="nxp/wifi_mod_para.conf nxp/pcieuartaw693_combo_v1.bin nxp/sduart_nw61x_v1.bin.se" ii) CONFIG_EXTRA_FIRMWARE_DIR="kernel/firmware" d) make
To pass module parameters to the inbuilt NXP WLAN driver, append the kernel bootargs with: moal.<param>=<value> For Example: moal.mod_para=nxp/wifi_mod_para.conf moal.ps_mode=2 moal.drvdbg=0x37
To speed up driver loading, WLAN interface creation and reduce boot time, append the kernel bootargs with: loglevel=2
Performance Comparison - WLAN Interface Creation Time (Example measurements): Test Platform: iMX8MQ + PCIE AW693 on Linux 6.12.32 iMX BSP a) WLAN drivers as loadable modules (rc.local/init script): 10 seconds b) WLAN drivers as auto-load modules (modprobe.d/modules-load.d): 7 seconds c) WLAN drivers built into kernel: 5 seconds d) WLAN drivers built into kernel with loglevel=2: 3 seconds Note: Option 2 is the default configuration in iMX Linux BSP from kernel version 6.12.xx onwards.
-
FOR DRIVER INSTALL
a) Copy firmware image to /lib/firmware/nxp/, copy wifi_mod_para.conf to /lib/firmware/nxp/. b) Install WLAN driver There are drv_mode, max_sta_bss, max_uap_bss etc. module parameters. The bit settings of drv_mode are, Bit 0 : STA Bit 1 : uAP Bit 2 : WIFIDIRECT Bit 4 : NAN Bit 7 : Zero-Wait DFS max_sta_bss: Maximum number of STA BSS (default 1, max 1) sta_name: Name of the STA interface (default: "mlan") max_uap_bss: Maximum number of uAP BSS (default 1, max 2) uap_name: Name of the uAP interface (default: "uap") max_wfd_bss: Maximum number of WIFIDIRECT BSS (default 1, max 1) wfd_name: Name of the WIFIDIRECT interface (default: "wfd") max_vir_bss: Number of Virtual interfaces (default 1) nan_name: Name of the NAN interface (default: "nan") max_nan_bss: Number of NAN interfaces (default 1) uap_oper_ctrl: uAP operation control when in-STA disconnect with ext-AP 0: default do nothing, 2: uAP stops and restarts automatically For example, to install multi-chip driver, insmod mlan.ko insmod moal.ko mod_para=nxp/wifi_mod_para.conf [drvdbg=0x7] wifi_mod_para.conf is used to support multi-chips which has different load module parameters. It contains the module parameters for different chips. c) Uninstall WLAN driver, ifconfig mlanX down ifconfig uapX down rmmod moal rmmod mlan
pref_dbc This load time parameter is used to config preferred DBC mode and takes effect when dmcs is enabled This parameter only used for AW693(BB)
Usage: pref_dbc=[value] insmod mlan.ko; insmod pcieaw693.ko fw_name=aw693w.bin dmcs=1 pref_dbc=1 <value = 0> : default preferred DBC mode <value = 1> : Enable preferred DBC mode <value = 2> : Disable preferred DBC mode
Example : insmod mlan.ko; insmod pcieaw693.ko fw_name=aw693w.bin dmcs=1 pref_dbc=1 : Enable preferred DBC mode insmod mlan.ko; insmod pcieaw693.ko fw_name=aw693w.bin dmcs=1 pref_dbc=2 : Disable preferred DBC mode
To load driver with MFG firmware file, use mfg_mode=1 when insmod WLAN driver and specify MFG firmware name if needed.
To load driver with rf_test firmware file, use rf_test_mode=1 when insmod WLAN driver. This parameter only used for 9177(FC)
There are some other parameters for debugging purpose etc. Use modinfo to check details. drvdbg=<bit mask of driver debug message control> dev_cap_mask=<Bit mask of the device capability> This load parameter is uses to configure device features support Usage: dev_cap_mask=<value to be configured> <BIT0-BIT15> : Represents features supported <BIT16>: Indicates support for 11AX <BIT17>: Indicates support for 6G Example: To disable 11AX and 6G support: dev_cap_mask=0xfffcffff
mac_addr=xx:xx:xx:xx:xx:xx <override the MAC address (in hex)> auto_ds=0|1|2 <use MLAN default | enable auto deepsleep | disable auto deepsleep> ext_scan=0|1|2 <use MLAN default | Enable Extended Scan| Enable Enhanced Extended Scan> p2a_scan=0|1|2 <MLAN default | Enable passive to active scan for DFS channel | Disable passive to active scan for DFS channel> scan_chan_gap=x <Time gap between two scans in milliseconds when connected to AP (max value 500ms)> net_rx=0|1 <use netif_rx/netif_rx_ni in rx | use netif_receive_skb in rx (default)> amsdu_deaggr=0|1 <buf copy in amsud deaggregation | avoid buf copy in amsud deaggregation (default)> bootup_cal_ctrl=0|1 <disable boot time config default | enable boot time config> ps_mode=0|1|2 <use MLAN default | enable IEEE PS mode | disable IEEE PS mode> tcpackenh=0|1 <disable TCP ACK enhancement | enable TCP ACK enhancement (default)> sched_scan=0|1 <disable sched_scan | enable sched_scan default> max_tx_buf=2048|4096|8192 <maximum AMSDU Tx buffer size> pm_keep_power=1|0 <PM keep power in suspend (default) | PM no power in suspend> shutdown_hs=1|0 <Enable HS when shutdown | No HS when shutdown (default)> cfg_11d=0|1|2 <use MLAN default | enable 11d | disable 11d> disable_11h_tpc=0|1 <enable 80211h TPC (default) | disable 80211h TPC of uAP and STA both> (Note: This feature will be supported for IW416 and IW610x chipsets with host_mlme=1 case as of now.) tpe_ie_ignore=0|1 <obey TPE IEs from ex-AP (default) | ignore TPE IEs from ex-AP> make_before_break=0|1, <No make before break during roam (default) | make_before_break during roam)> dts_enable=0|1 <Disable DTS | Enable DTS (default)> fw_name = <FW file name> e.g. copy pcieuart9098_combo_v1.bin to firmware directory, fw_name=nxp/pcieuart9098_combo_v1.bin hw_name = <hardware name> reg_work=0|1 <Disable register work queue| Enable register work queue> hw_test=0|1 <Disable hardware test (default) | Enable hardware test> fw_serial=0|1 <support parallel download FW | support serial download FW (default)> req_fw_nowait=0|1 <use request_firmware API (default) | use request_firmware_nowait API> dfs53cfg=0|1|2 <use Fw Default | New W53 | Old W53> mcs32=0|1 <disable HT MCS32 support | enable HT MCS32 (default)> For 9097/9098: antcfg=0x101|0x303|.. <Bit0: Tx/Rx Path A for 2G, Bit1: Tx/Rx Path B for 2G, Bit8: Tx/Rx Path A for 5G, Bit9: Tx/Rx Path B for 5G> For IW624/AW693: antcfg=0x10101|0x30303|.. <Bit0: Tx/Rx Path A for 2G, Bit1: Tx/Rx Path B for 2G, Bit8: Tx/Rx Path A for 5G, Bit9: Tx/Rx Path B for 5G, Bit16: Tx/Rx Path A for 6G, Bit17: Tx/Rx Path B for 6G> For AW693, it's recommended to use mod_para configuration file for antcfg as MAC1 supports 2x2 and MAC2 supports only 1x1. For 8897/8997: antcfg=0x11|0x13|0x33 <Bit0:Rx Path A, Bit1:Rx Path B, Bit 4:Tx Path A, Bit 5:Tx Path B> For others: antcfg=0|1|2|0xffff <default | Tx/Rx antenna 1 | Tx/Rx antenna 2 | enable antenna diversity> plinkstats=0|1|2 <Disable plinkstats (default) | Enable plinkstats | Restore plinkstats> Example usage: insmod moal.ko plinkstats=0 : Disable link statistics prints insmod moal.ko plinkstats=1 : Enable link statistics prints insmod moal.ko plinkstats=2 : Reset link statistics prints insmod moal.ko plinkstats=1,0x7,5,0 : Enable Num TX Packets, Num RX Packets and Channel prints on dmesg. insmod moal.ko plinkstats=1,0xf,5,1 : Enable Num TX Packets, Num RX Packets, Channel and Region prints on dmesg, and netlink event also enabled. Note: 1. For more details about plinkstats parameters, refer plinkstats command details in README_MLAN file. 2. When changing drvdbg mask dynamically while running test, set MLSTATS bit(0x800) along with the change, if wifi logging feature is enabled. slew_rate: Slew Rate Control value = 0|1|2|3 (0 is the slowest slew rate and 03 has the highest slew rate (default)) init_cfg=<init config (MAC addresses, registers etc.) file name> e.g. copy init_cfg.conf to firmware directory, init_cfg=nxp/init_cfg.conf cal_data_cfg=<CAL data config file name> e.g. copy cal_data.conf to firmware directory, cal_data_cfg=nxp/cal_data.conf Note: Loading driver with 8887 must include correct c
