Commit graph

720 commits

Author SHA1 Message Date
Kapil Bhatt
62e06a5072 drivers: wifi: Fix offloaded raw TX feature flags
Pass passive scan and offloaded raw tx feature flags to OSAL.

Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
2024-11-17 19:06:34 -05:00
Gang Li
f8acf35ddc drivers: wifi: nxp: fix build failure after disabling 802.11ax
Fixed build error, when disabling 802.11ax, if-else does not match.
Fixes #81117

Signed-off-by: Gang Li <gang.li_1@nxp.com>
2024-11-16 15:09:22 -05:00
Nazar Palamar
7e1b00d35e Infineon: board: remove CONFIG_GPIO from defconfigs
Remove CONFIG_GPIO from defconfigs for Infineon boards.
Applications, drivers will enable GPIO if need.

Added 'select GPIO' from spi/Kconfig.ifx_cat1
Added 'select GPIO' from wifi/infineon/Kconfig.airoc

Signed-off-by: Nazar Palamar <nazar.palamar@infineon.com>
2024-11-14 17:27:06 -06:00
Hongquan Li
c5fa9af235 drivers/wifi/nrfwifi: Add buffer for discard bytes
Some spi drivers do not allow the send buffer
and receive buffer to be empty at the same time,
if this happens it will cause the spi to be unable
to communicate with the nrf7002, so add the receive
buffer for the discard byte in the spim_xfer_rx.

Fix #80686

Signed-off-by: Hongquan Li <hongquan.prog@gmail.com>
2024-11-08 14:01:23 -06:00
Chaitanya Tata
9561a0ac76 drivers: nrfwifi: Fix recovery for SAP
nRF70 recovery relies on power-management feature which isn't applicable
for SAP, so, we keep seeing false recovery causing interface restart.

Disabled recovery for SAP to fix the issue.

Fixes #81130.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-08 11:37:31 -06:00
Chaitanya Tata
073f68d248 drivers: nrfwifi: WAR for performance regression
With the newly introduced settling time for PLLS, we are seeing a peak
performance drop of 3Mbps in Zperf benchmarks, and also other
performance tests are also impacted.

This settling time was introduced based on observations in lab and not
because of any real problem or bug reported, so, for now, use zero
settling time (same as earlier) till we fully investigate and understand
the impacts and need.

Fixes #80951.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-07 18:04:44 -06:00
Chaitanya Tata
4ae6520c3a drivers: nrfwifi: Fix passing of RAW scan results flag
The CONFIG_ prefix should be removed when passing to OSAL code.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-07 09:00:35 -08:00
Chaitanya Tata
87a9363fa7 drivers: nrfiwif: Enable recovery by default
This is needed to ensure Wi-Fi can always be used.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-06 14:41:44 -06:00
Chaitanya Tata
c0a84524cd drivers: nrfwifi: Fix the undefined macro usage
This works because undefined macro in conditional is treated as zero,
but could end up choosing the wrong divider.

Fix the macro with the new name.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-06 09:58:37 -08:00
Chaitanya Tata
9705fc06b4 [nrf fromlist] drivers: nrfwifi: Fix CSUM support
With introduction of Raw modes, nRF70 driver now advertises get_c
onfig OP, but doesn't implement all types.

This causes problems two-fold with checksum calculations:
  1. The "config" isn't uninitialized, so, every call returns differnet
     values. So, for UDP header checksum would be done and
     pkt->chksumdone would be set. But for IPv4 header checksum might be
     skipped.
  2. Even if we initialize to zero, then network stack gets all zeros
     and calculates checksum by itself rendering offload moot.

There is another problem in #1, as there is only single flag for pkt for
all checksum, nRF70 driver sees this and tells UMAC to skip checksum for
the entire packet. The design isn't coherent, and should be converted to
communicate per-type checksum status (some are filled by network stack
and some HW).

But as nRF70 support all checksum offloads, advertise all types for both
RX and TX.

Upstream PR #: 80882

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-06 09:54:12 -08:00
Chaitanya Tata
c86225384a drivers: nrfwifi: Add a NULL check for FMAC context
In case the driver UP fails, the FMAC context will be NULL, so, add a
NULL check in the DOWN.

Fixes a crash seen when working with unprogrammed OTP (no MAC) that
fails the interface UP.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-06 09:54:12 -08:00
Chaitanya Tata
580707ed4d drivers: nrfwifi: Fixes from doc review
Help text fixes from doc-team.

Signed-off-by: Richa Pandey <richa.pandey@nordicsemi.no>
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-11-05 10:53:24 -06:00
Chaitanya Tata
92985011b6 drivers: nrfwifi: Fix memory leak in TX path
During secure association, if we get any data packets from the
networking stack (as we switch off the dormancy) then they will be
dropped till the 802.1x port is authorized, but with recent changes the
corresponding network buffer isn't freed causing a memory leak.

Handle this case and free the network buffer (Using an OSAL API though
it's Zephyr to avoid duplication and also getting access to "struct
nwb");

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-30 09:43:41 -07:00
Sylvio Alves
b5c53d6ac4 wifi: esp32: move kconfig to driver area
Make sure all kconfig related to Wi-Fi is
in its driver area.
This commit also removes esp_timer_init() call
from Wi-Fi driver.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-10-27 20:53:48 -05:00
Alberto Escolar Piedras
9a50c10b34 drivers/wifi/winc1500: Fix build warnings with 64bit targets
Fix a set of warnings like:
drivers/wifi/winc1500/wifi_winc1500.c:332:25: error: cast from pointer
to integer of different size [-Werror=pointer-to-int-cast]
  332 |         SOCKET socket = (int)context->offload_context;

when int and void* do not have the same size, by casting the content
of context->offload_context to intptr_t which is whichever integer
size matches the pointer size.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-10-26 11:29:46 +02:00
Chaitanya Tata
7d696f5b69 drivers: nrfwifi: Fix label name
The label is used for both positive and negative cases, so, should be
called "out".

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-26 03:57:12 +01:00
Chaitanya Tata
2ea25ea238 drivers: nrfwifi: Fix regulatory domain regression
Recent WPA supplicant changes have broken nRF regulatory support,
implement the new set/get country WPA supplicant ops.

WPA supplicant: Regulatory SET through WPA supplicant, GET is direct to
the driver

Scan only: SET and GET direct calls to the driver

Fixes #79916.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-26 03:57:12 +01:00
Hui Bai
7c167c67c3 modules: hostap: add 11k cmd support
Add 11k cmds support. User can issue 11k cmds to enable/disable 11k and
send Neighbor Report Request packet.

Signed-off-by: Hui Bai <hui.bai@nxp.com>
2024-10-25 13:53:49 +02:00
James Roy
b443929f49 drivers: esp32: Fix esp_wifi_drv strncpy warning
Add '\0' to the end of the ssid to prevent warnings
or segmentation errors.

Signed-off-by: James Roy <rruuaanng@outlook.com>
2024-10-25 08:53:26 +02:00
Daniel DeGrasse
3d4f83aaac drivers: wifi: eswifi: fix casts for 64 bit pointers
The eswifi driver uses an integer to identify the socket used for each
connection, which must be cast to and from a `void *`. This causes
warnings on 64 bit platforms, as precision is lost when casting from a
`void *` to `int`. Use a `intptr_t` type to store the socket value to
resolve this warning. Also, fix a function signature for the `accept_cb`
to use `size_t` instead of `int` for the length

Fixes #80242

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-10-24 12:25:04 -05:00
Chaitanya Tata
3098c484cb drivers: nrfwifi: Fix a build error
The defines should explicitly be passed to nordic HAL as they dont' use
the CONFIG_ prefix.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-24 13:15:25 +01:00
Daniel DeGrasse
7bc316ba3c drivers: wifi: nxp: add CONFIG_NXP_WIFI_BUILD_ONLY_MODE for CI testing
Add CONFIG_NXP_WIFI_BUILD_ONLY_MODE, which allows the NXP WiFi driver to
be built without a binary blob. The built application will not be
functional, but this enables continuous integration to run upstream.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-10-24 09:29:21 +02:00
Daniel DeGrasse
8ea2c4f692 drivers: wifi: nxp: remove unused nxp_wifi_uap_status function
Remove unused function `nxp_wifi_uap_status`.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-10-24 09:29:21 +02:00
Daniel DeGrasse
4703fb0707 drivers: wifi: nxp: remove non-existent TWT fields
Remove references to TWT fields that did not exist, to resolve a build
error.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-10-24 09:29:21 +02:00
Daniel DeGrasse
452770f9e9 modules: hostap: remove set_btwt API
set_btwt API implementation is not complete. Remove the structure
definition and implementation from the NXP WiFi driver to fix a build
error.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-10-24 09:29:21 +02:00
Daniel DeGrasse
db271a7392 modules: hostap: remove ap_bandwidth API
ap_bandwidth API implementation is not complete. Remove the structure
definition and implementation from the NXP WiFi driver to fix a build
error.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-10-24 09:29:21 +02:00
Kapil Bhatt
7161a7a06a drivers: wifi: Add changes for regulatory domain
Add changes for offloaded raw tx regulatory domain.

Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
2024-10-23 16:50:15 +02:00
Kapil Bhatt
0b11b39461 drivers: wifi: Add Kconfig option for passive scan
Add kconfig option for forced passive scan, It will use for
only scan only mode.

Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
2024-10-22 20:40:01 +02:00
Chaitanya Tata
f7ef64df28 drivers: nrfwifi: Allow scan-only for all platforms
Though nRF7000 is a special Scan only chipset, scan only can work with
any nRF70 platforms, no need for this enforcement and we can keep things
flexible.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-22 20:38:48 +02:00
Chaitanya Tata
9a9f8998f9 drivers: nrfwifi: Remove non-existing member
Opriv was removed but the doxygen doc string was left.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-21 18:49:09 -05:00
Chaitanya Tata
a21648d7e6 drivers: wifi: Clean up exit path
Fix couple of bugs in exit path:

- In case of calloc failure, return's without unlocking
- memory is freed outside lock, in case of a tiny window of race, this
  can cause a crash when this function is called from two threads.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-21 18:49:09 -05:00
Chaitanya Tata
ea7d3bea93 drivers: wifi: Fix memory leak in regulatory processing
During Wi-Fi connection UMAC sends an unsolicited regulatory change
event but the driver code always assumes that this event is solicited
hence doesn't free the memory for the event.

Fix this by dropping the unsolicited event as it's not supported yet.

Fixes #79733.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-21 18:49:09 -05:00
Chaitanya Tata
f333e1f00f drivers: wifi: Add regulatory debug log
This log helps in identifing if the event is solicited or not.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-21 18:49:09 -05:00
Vivekananda Uppunda
da0c30d52a drivers: wifi: nrfwifi: Add promiscuous mode support functions
This adds promiscuous mode support functions into build for filter
operation when the configuration CONFIG_NRF70_PROMISC_DATA_RX
is enabled.

Signed-off-by: Vivekananda Uppunda <vivekananda.uppunda@nordicsemi.no>
2024-10-18 08:31:50 -04:00
Vivekananda Uppunda
c9b56de040 drivers: wifi: nrfwifi: Promiscuous mode filtering support in driver
This set of changes brings in promiscuous mode filtering support in
driver. Since, firmware would be unable to filter packets due to
connection issues, the filtering support for promiscuous mode is
moved to the driver.

Signed-off-by: Vivekananda Uppunda <vivekananda.uppunda@nordicsemi.no>
2024-10-18 08:31:50 -04:00
Chaitanya Tata
9eedb6d7c8 drivers: nrfwifi: Fix build error
This crept-in due to bad merge conflict resolution.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-17 09:45:34 +02:00
Chaitanya Tata
cd736558ef drivers: nrfwifi: Fix build errors when Util is enabled
This path is disabled by default.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-17 09:45:34 +02:00
Chaitanya Tata
d30161cd8b drivers: wifi: Fix mutex re-initialization
The mutex is used to protect RPU zephyr context which gets modified for
every interface down and up (including recovery), so, it was being
re-initialized but also used to protect down and up which is a bug.

Move the re-initialization to the driver entry so that it happens only
once and we can properly use the mutext for down and up protection.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-17 09:45:34 +02:00
Chaitanya Tata
ce9d71c476 drivers: wifi: Fix missing unlock for stats
The RPU context lock is not unlocked this is causing recovery to be
stuck waiting for the lock.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-17 09:45:34 +02:00
Chaitanya Tata
67216f1b5a drivers: wifi: Fix crash when recovery is triggered
There is a race condition when recovery is in progress and in parallel
Wi-Fi util commands are being executed (CTF), where the RPU context is
de-initialized as part of recovery but no checks are present in the
Wi-Fi util command processing causing a crash.

This needs a proper fix for all commands, but for maintenance branch
fix is added only for commonly used commands.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-17 09:45:34 +02:00
Ajay Parida
fe920fc9c9 drivers: wifi: Add PS exit strategy runtime configuration
Dynamically set power save exit strategy runtime configuration that
allows to switch b/w stratgies depending on conserving power and
low-latency traffic download.

Signed-off-by: Ajay Parida <ajay.parida@nordicsemi.no>
2024-10-17 09:45:34 +02:00
Chaitanya Tata
d0d659b675 drivers: wifi: Use mutex for spinlock
Ideally we should be using Zephyr spinlock APIs but that requires
changes to shim API, so, for this maintenance release just replace with
mutex to keep the context same and no API changes.

This solves the locking issue that we see when control and data path are
excited concurrently due to locking semantics of semaphores, the issue
is not root caused but mutex enforce strict locking semantics for
multiple threads and solve the issue.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-17 09:45:34 +02:00
Chaitanya Tata
5f6dca377a drivers: wifi: Fix shell hang
Add a null check for HAL context in the interrupt handler, this was
causing locking issue operating on null. The root cause of null is not
known, but this solves the locking issue when data and control paths are
excited in parallel.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-17 09:45:34 +02:00
Chaitanya Tata
7c3d342796 drivers: wifi: Add support for keepalive
To handle interoperability issue with few APs, add a feature to keep
sending keepalive frames periodically to avoid AP disconnecting the STA.

This is disabled by default to avoid unnecessary power consumption as
it's only seen with few old APs.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-17 09:45:34 +02:00
Chaitanya Tata
94f9fb95d9 drivers: wifi: Increase default PS active timeout interval
In crowded environments RPU is active for more than 10s due to too many
retries and this triggers a false RPU recovery. To avoid this, increase
the default to 50s to handle corner cases, as this will only impact the
recovery triggered case, higher timeout doesn't have any impact in
normal cases.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-17 09:45:34 +02:00
Chaitanya Tata
dbda09d3e5 drivers: wifi: Enable management buffers offload
With this offload, host doesn't need to manage RX buffers for management
frames, and this saves Host-RPU comms and thus giving RPU to sleep more
often and is essential to test RPU recovery.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-17 09:45:34 +02:00
Chaitanya Tata
a4537a7eea drivers: wifi: Add PS state debugs
These are very frequent, so, a separate debug is added for debugging
host RPU recovery logic.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-17 09:45:34 +02:00
Chaitanya Tata
9c36d97646 drivers: wifi: Fix TX buffers leak
During interface down in case TX has pending buffers in either TXQ or
Pending_Q then they are not freed instead the Q itself is freed.

Fix by traversing the Q and freeing all members.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-17 09:45:34 +02:00
Chaitanya Tata
5c8f1807c1 drivers: wifi: Fix RPU recovery disabled build failures
Fix RPU recovery protection to solve build failures when RPU recovery is
disabled.

As recovery is primarily based on power-management, add a Kconfig
dependency to enforce, this simplies the macros to protect the code.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-17 09:45:34 +02:00
Chaitanya Tata
9b105698ed drivers: wifi: Add RPU recovery retry mechanism
In case RPU is stuck in consecutive recovery over a time period then
that means it's not recoverable through RPU recovery, only thing left to
do is to trigger a system reboot. This feature is disabled by default,
so, either application can do their own implementatio or enable this
feature in the driver along with configurable retries and window period.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-10-17 09:45:34 +02:00