Commit graph

816 commits

Author SHA1 Message Date
Chaitanya Tata
40b7b87ad7 drivers: nrf_wifi: Fix defaults to avoid false recovery
In case of a busy environment and if STA is far, then we see many
retries for the frames that cause the RPU to be awake though host has
de-asserted wakeup_now signal, this leads to WDT interrupt and host
thinks that it has given sleep opportunity to RPU and initiates a
recovery.

To handle this, increase the sleep opportunity window to 5s to cover all
the retries, this solves the false recovery problem. While at it, also
increase the range, no reason to limit to lower window. And update the
help text with the warning about power consumption.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2025-07-28 08:34:49 -04:00
Ajay Parida
3e9b7cbeb4 drivers: wifi: Pass the connection type
Firmware needs to know the connection type to be established.
use the wpa_proto field to derive the connection type.

Signed-off-by: Ajay Parida <ajay.parida@nordicsemi.no>
2025-07-25 17:03:38 +01:00
Ajay Parida
c70b3504bb net: l2: wifi: Configure BSS max idle period
Support to configure BSS max idle period at runtime.

Signed-off-by: Ajay Parida <ajay.parida@nordicsemi.no>
2025-07-25 17:03:38 +01:00
Chaitanya Tata
be51ddcf08 nrf_wifi: Fix the DTS compat for nRF71
Use specific chipset for compat instead of a generic Series.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2025-07-25 07:50:09 -04:00
Chaitanya Tata
90717047e0 drivers: nrf_wifi: Fix deadlock in display scan and recovery
When running Zperf traffic + scan in the background eventual we hit a
deadlock:

 * sysworkq: recovery->stop_zep->vif_lock->hal_disable->wait lock_rx
 * nrf70_bh_wq: event_tasklet->lock_rx->disp_scan_done->
             disp_scan_res_get_zep-> waiting on vif_lock

The traffic triggers recovery (another bug) and conflicts with display
scan.

Fix by moving scan results processing to system workqueue instead of
doing it in the FMAC event callback context, this is how supplicant scan
also works.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2025-07-24 17:00:17 +01:00
Kapil Bhatt
0d4472ae44 drivers: nrf_wifi: Remove station mode from monitor mode
Monitor mode doesn't require station mode. Disabling station mode
require necessary changes to work monitor mode.

Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
2025-07-22 19:36:37 -04:00
Pieter De Gendt
c5a2542ad9 drivers: wifi: esp_hosted: select NANOPB_ENABLE_MALLOC
Use Kconfig symbol instead of the manual definition.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-07-19 15:46:08 -04:00
Jordan Yates
79edfc0128 wifi: nrf_wifi: ignore interface if TX disabled
Automatically hide the nRF7x interface from the connection manager if
the TX path is disabled (scan only mode). This prevents function calls
like `conn_mgr_all_if_up(true)` from bringing up the interface which
can never result in a connection.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-07-19 15:35:31 -04:00
Kapil Bhatt
dd7413d269 drivers: nrf_wifi: Fix rpu recovery debug info
Rpu recovey debug stats are stored in hal_dev_ctx which is not
persistent in case of interface is brought down/up. Need to add
in nrf_wifi_ctx_zep and update before interface goes down.

Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
2025-07-19 13:47:04 -04:00
Chaitanya Tata
001f34d84c drivers: nrf_wifi: Fix return codes for xmit
Return proper error codes for xmit instead of generic -1.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2025-07-19 13:44:58 -04:00
Gaetan Perrot
bac20e419e drivers: wifi: nrf_wifi: wifi_mgmt: remove redundant null check
Deleted a redundant check for 'rpu_ctx_zep' pointer after it was already
dereferenced.

Clarifies code logic in nrf_wifi_get_power_save_config function.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2025-07-11 16:32:06 -05:00
Marcin Niestroj
5e25a3e24a drivers: esp_at: fix net_if_get_by_iface() typo
s/net_if_get_by_ifindex/net_if_get_by_iface/

Fixes: 0e57844b2d ("drivers: wifi: esp_at: Bind DNS to device net
  interface")
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2025-07-11 08:19:06 -10:00
Chaitanya Tata
e728f80416 drivers: nrf_wifi: Fix TX drop statistics
In case FMAC API fails, increment the TX drop counter, helpful in
debug.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2025-07-08 13:39:17 -05:00
Chaitanya Tata
4bd1d39c67 wifi: nrf70: Fix system work queue stack size override
Defaults cannot be overidden (even with configdefault extension), they
only work if the original symbol is defined after the override e.g.,
"drivers and then subsys/net" but for kernel symbols,the default value
overrides don't work due "kernel and drivers" order, the kernel defines
the original symbol with the default and then it cannot be overridden.

Move the kernel symbol override to the original definition to make it
affect. Else any sample that uses nRF70 but doesn't enable WPA
supplicant ends up with 1024 and crashes.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2025-07-01 19:04:00 -05:00
Qiankun Li
d5a9a0fa87 drivers: wifi: nxp: Fix embedded supplicant stations link mode issue.
The link mode of legacy staions is specifically
divided into Wi-Fi_1, Wi-Fi_2 and Wi-Fi_3.

Signed-off-by: Qiankun Li <qiankun.li@nxp.com>
2025-06-26 22:07:09 -05:00
Qiankun Li
26f4d9b551 drivers: wifi: nxp: Fix getting error stations twt capability issue.
When external station connects to soft ap,
fill ap_sta_info.twt_capable with external
station HE capability.

Signed-off-by: Qiankun Li <qiankun.li@nxp.com>
2025-06-26 22:07:09 -05:00
Qiankun Li
f1b781577e drivers: wifi: nxp: Fix embedded supplicant link mode issue.
1. When external stations connect to soft ap,
   Wi-Fi driver will send UAP_CLIENT_ASSOC event with data.
   nxp_wifi_wlan_event_callback will be called to process this event.
2. The data should include some basic station information
   but not only mac address of station.
3. Fill ap_sta_info with information of
   connected station but not soft ap self.
4. Fix: Wi-Fi driver send UAP_CLIENT_ASSOC event
   with basic station information.
5. Fix: ap_sta_info with information of connected station.

Signed-off-by: Qiankun Li <qiankun.li@nxp.com>
2025-06-26 22:07:09 -05:00
Jérôme Pouiller
ffebf73079 drivers: wifi: siwx91x: Assign variable on declaration
When a variable is assigned once, we try to assign it during the
declaration.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-06-26 11:03:08 -05:00
Jérôme Pouiller
8d1d8d2b86 drivers: wifi: siwx91x: Prefer WIFI_MAC_ADDR_LEN
The preferred way to reference the size of the MAC address is
WIFI_MAC_ADDR_LEN.

For consistency, replace ARRAY_SIZE(mac.octet) with WIFI_MAC_ADDR_LEN.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-06-26 11:03:08 -05:00
Jérôme Pouiller
2ae23f7c58 drivers: wifi: siwx91x: Do not set unused values
We avoid to assign unused values during declaration. Hence, the reader
knows that every value assigned are meaningful. It also allow compile to
raise true warning if a value is used uninitialized.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-06-26 11:03:08 -05:00
Jérôme Pouiller
0b8f7d85bc drivers: wifi: siwx91x: Uniformize error management
Usually, the exception are treated in a condition before the nominal
case:

    ret = f();
    if (ret) {
        return -EXXX;
    }
    ... nominal case ...

siwx91x_on_join_ipv4() and siwx91x_on_join_ipv6() didn't follow this
pattern.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-06-26 11:03:08 -05:00
Jérôme Pouiller
a89dc21a2b drivers: wifi: siwx91x: Uniformize declaration of 'interface'
sl_wifi_interface_t interface is always initialized with
sl_wifi_get_default_interface().

Let's assign the value during the declaration everywhere.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-06-26 11:03:08 -05:00
Jérôme Pouiller
56fb22fba8 drivers: wifi: siwx91x: Group ARG_UNUSED() after declarations
We want to avoid declarations after statements.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-06-26 11:03:08 -05:00
Jérôme Pouiller
db2472209a drivers: wifi: siwx91x: Align the ways errors are managed
Unify the way the error code are tested:
  - sl_status_t is an alias to an int. The compiler won't complain if an
    int is assigned or compared to a sl_status_t. In the other hand,
    "int" is well known to manage error code. So, just use "int"
    everywhere.
  - Always name the return code "ret"
  - Unless it is meaningful, test the value of ret against 0
    (SL_STATUS_OK is just a convoluted way to say 0).

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-06-26 11:03:08 -05:00
Jérôme Pouiller
dd0afec087 drivers: wifi: siwx91x: Clean up included files
To avoid confusion, we prefer to only keep header files really used by the
source file.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-06-26 11:03:08 -05:00
Jérôme Pouiller
9cee7a1e57 drivers: wifi: siwx91x: Extract station related functions
siwx91x_wifi.c starts to contains to much code. Let' simplify it by
grouping all the station related functions in a separated file.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-06-26 11:03:08 -05:00
Jérôme Pouiller
5818738668 drivers: wifi: siwx91x: Extract Power Save related functions
siwx91x_wifi.c starts to contains to much code. Let's simplify it by
grouping all the power-save related functions in a separated file.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-06-26 11:03:08 -05:00
Jérôme Pouiller
9a1ebee72b drivers: wifi: siwx91x: Extract AP related functions
siwx91x_wifi.c starts to contains to much code. Let' simplify it by
grouping all the Access Point related functions in a separated file.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-06-26 11:03:08 -05:00
Jérôme Pouiller
6dd601c9f1 drivers: wifi: siwx91x: Extract scan related functions
siwx91x_wifi.c starts to contains to much code. Let's simplify it by
grouping all the scan related functions in a separated file.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-06-26 11:03:08 -05:00
Jérôme Pouiller
f6f387993f drivers: wifi: siwx91x: Fix siwx91x_wifi_socket.h syntax
Functions in siwx91x_wifi_socket.h are not declared static. So it create
duplicated symbols if the file is included twice.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-06-26 11:03:08 -05:00
Jukka Rissanen
cdc6c324d7 net: dns: Save info about source when configuring DNS servers
Remember which DNS server was added by a source like DHCPv4 or v6
message. This will allow system to remove DNS servers that were added by
that source. Then when stopping for example DHCP, we can remove those
specific DNS servers and not leaving DNS servers hanging in the system.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-06-26 14:08:19 +02:00
Chun-Chieh Li
2fd79998d0 drivers: wifi: esp_at: fix +CIPRECVDATA parsing for AT 1.7
This fixes +CIPRECVDATA parsing for AT 1.7. Per AT 1.7 spec,
remote ip/port is not replied.

Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
2025-06-26 11:19:56 +02:00
Qiankun Li
702221da2d drivers: wifi: nxp: Fix TWT setup issue.
When try to set twt, system will try to
get interface status firstly.
In shim driver, miss filling twt_capable field.
The twt_capable is set as false by default.
Failed to set twt because of incorrect
twt_capable.

Add enhance code to fill twt_capable field
in shim driver.

Signed-off-by: Qiankun Li <qiankun.li@nxp.com>
2025-06-26 11:19:48 +02:00
Chun-Chieh Li
8a9dc13e91 drivers: wifi: esp_at: fix rx_sock not ref-counted
This fixes rx_sock is not reference-counted, or crash error on reference
to released socket.

Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
2025-06-25 15:49:26 -10:00
Chun-Chieh Li
db59acba5e drivers: wifi: esp_at: fix deadlock in socket close path
This fixes deadlock in socket close path. In the scenario:
1. on_cmd_ipd/esp_socket_rx invokes esp_socket_ref_from_link_id
   and increments refcount.
2. zvfs_close/esp_put locks cond.lock.
3. zvfs_close/esp_put waits on sem_free.
4. on_cmd_ipd/esp_socket_rx waits on cond.lock before esp_socket_unref.
5. sem_free waits on esp_socket_unref for refcount reaching zero.

As we detect socket is closing, we can ignore last rx data and escape
from the trap.

Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
2025-06-25 15:49:26 -10:00
Chun-Chieh Li
622fddb0b8 drivers: wifi: esp_at: fix premature socket release
This fixes premature socket release. Without this fix, system will crash
because esp_rx thread can still hold reference to the socket in the
following cases:
1. esp_rx thread has got the socket reference but hasn't unref'ed
   via esp_socket_unref.
2. esp_rx thread can still get the socket reference for refcount not
   being zero in esp_socket_ref.

Signed-off-by: Chun-Chieh Li <ccli8@nuvoton.com>
2025-06-25 15:49:26 -10:00
Gang Li
75ac644ee3 drivers: wifi: nxp: enable net monitor mode on IW610
Enable CONFIG_NXP_WIFI_NET_MONITOR,
       CONFIG_NXP_WIFI_HOST_TXRX_MGMT_FRAME,
       CONFIG_NXP_WIFI_MMSF on IW610.

Signed-off-by: Gang Li <gang.li_1@nxp.com>
2025-06-24 15:36:04 -05:00
Maochen Wang
1e5b21f487 drivers: wifi: nxp: add Kconfig of NXP_WIFI_AUTO_INIT
Automatically initialize NXP Wi-Fi driver and FW for Wi-Fi networking
operation. Disable this setting if Wi-Fi module will be used for
non-Wi-Fi use cases (manufacturing/calibration/test).

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2025-06-24 14:20:02 +02:00
Maochen Wang
f4a0beb2b7 samples: net: wifi: Enable NXP_WIFI_TX_RX_ZERO_COPY for IW610
Enable NXP_WIFI_TX_RX_ZERO_COPY for IW610, which will reduce extra memcpy
between net stack and driver in TX data path and avoid the allocation of
RXPD and mlan_buffer in RX data path, to improve the throughput
performance.
Increase CONFIG_NET_BUF_DATA_SIZE to hold one packet in one buffer.
NXP_WIFI_TX_RX_ZERO_COPY can be enabled not only for NXP_RW610 case.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2025-06-24 09:17:03 +02:00
Pisit Sawangvonganan
d0b9a4e43e drivers: wifi: nxp: use IS_ENABLED() for CONFIG_NXP_WIFI_SOFTAP_SUPPORT
Replaced conditional compilation of `CONFIG_NXP_WIFI_SOFTAP_SUPPORT`
where applicable with IS_ENABLED() macro to improve code readability.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2025-06-24 09:13:58 +02:00
Pisit Sawangvonganan
2265dd7a93 drivers: wifi: nxp: fix include guard typo in nxp_wifi_drv.h
Fix include guard name and added trailing comment to final #endif.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2025-06-24 09:13:58 +02:00
Ravi Dondaputi
11a3969221 drivers: wifi: Introduce option to use K_HEAP
Provide option to revert to K_HEAP instead of using
dedicated heaps in Wi-Fi driver.

Signed-off-by: Ravi Dondaputi <ravi.dondaputi@nordicsemi.no>
2025-06-24 09:13:20 +02:00
Benjamin Cabé
533fcc9a3f drivers: wifi: update non-inclusive language
use "Accept/block List" terminology instead of white/black list

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-06-23 16:31:16 -05:00
Muzaffar Ahmed
56a0160e30 drivers: wifi: siwx91x: Fix buffer overflow in client disconnect
Copy only WIFI_MAC_ADDR_LEN bytes to sta_info.mac instead of dynamic
length

Signed-off-by: Muzaffar Ahmed <muzaffar.ahmed@silabs.com>
2025-06-23 12:46:10 -07:00
Muzaffar Ahmed
73a1bef079 drivers: wifi: siwx91x: Raise AP enable event from driver
Raising event from driver itself after successful AP start,
instead of waiting for an event from SDK/TA FW. TA used to send an
asynchronous event earlier but currently does not.

Signed-off-by: Muzaffar Ahmed <muzaffar.ahmed@silabs.com>
2025-06-23 12:46:10 -07:00
Kapil Bhatt
39e6f0170f drivers: nrf_wifi: Add Kconfig for Dynamic ED
Add Kconfig to enable/disable Dynamic ED which add support for
proprietary algorithm to enhance performance in high-traffic channels.

Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
2025-06-23 09:46:47 +02:00
Jérôme Pouiller
fbc70337e8 modules: hal_silabs: Update WiseConnect SDK
Import the new version of the WiseConnect SDK.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-06-20 13:22:57 -04:00
Maochen Wang
7e3f5814e4 drivers: wifi: nxp: only enable NXP_WIFI_TC_RELOCATE for RW612
Only by default enable NXP_WIFI_TC_RELOCATE for RW612, which will
relocate traffic API into RAM. But for other platform, for example
the RT series, the ITCM/DTCM is a more suitable place for critical
code.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
2025-06-20 16:23:52 +02:00
Qingling Wu
2016f05860 drivers: nxp: wifi: Enable 11AX density config by default for IW610
Enable NXP_WIFI_MMSF by default for IW610

Signed-off-by: Qingling Wu <qingling.wu@nxp.com>
2025-06-20 08:52:53 +02:00
Marek Matej
720db7bf5e drivers: wifi: esp32: Fix buffer config
Prevent to allocate buffers cache if Wi-Fi heap is not used.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2025-06-18 17:46:03 -04:00