Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull wifi drivers and nrf_wifi changes to ncs #2519

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
d63df05
[nrf fromtree] manifest: nrf_wifi: Pull standalone lib support
krish2718 Dec 24, 2024
4883346
[nrf fromtree] nrf_wifi: Build OSAL as a standalone library
krish2718 Dec 23, 2024
f2661a1
[nrf fromtree] drivers: nrf_wifi: Remove unused macros
krish2718 Dec 24, 2024
120a807
[nrf fromtree] tests: boards: nrf70: Add tags
krish2718 Dec 24, 2024
b4a0fa2
[nrf fromtree] west.yml: update `nrf_wifi` to ignore binary blobs
JordanYates Jan 20, 2025
555b042
[nrf fromtree] manfiest: nrf_wifi: Pull fix for NULL checks
krish2718 Jan 21, 2025
490ef98
[nrf fromtree] drivers: nrf_wifi: Use mode specific data structures
sachinthegreen Feb 6, 2025
cc850b3
[nrf fromtree] wifi: nrf_wifi: extract `NRF70_SYSTEM_WITH_RAW_MODES`
JordanYates Jan 22, 2025
84f5399
[nrf fromtree] wifi: nrf_wifi: eliminate `NRF70_SYSTEM_MODE_COMMON`
JordanYates Jan 22, 2025
6365294
[nrf fromtree] drivers: nrf_wifi: Use mode specific APIs
sachinthegreen Feb 6, 2025
4aaea8a
[nrf fromtree] drivers: nrf_wifi: Add missing test cases
sachinthegreen Feb 10, 2025
6f9379a
[nrf fromtree] drivers: nrf_wifi: Fix compilation issues for SoftAP m…
sachinthegreen Feb 10, 2025
1475e6a
[nrf fromtree] manifest: nrf_wifi: Pull in fix for SAP and P2P build
sachinthegreen Feb 10, 2025
efc0924
[nrf fromtree] dts: nordic: Add wifi_spi label
bama-nordic Feb 10, 2025
64dd46e
[nrf fromlist] manifest: nrf_wifi: Pull fixes for raw scan and DSSS s…
karun2796 Feb 11, 2025
b8795c0
[nrf fromlist] drivers: nrf_wifi: Disable mgmt buffer offload
kapbh Feb 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20-common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@
&lfxo {
status = "okay";
};

/* Get a node label for wi-fi spi to use in shield files */
wifi_spi: &spi130 {};
3 changes: 3 additions & 0 deletions boards/nordic/nrf54l15dk/nrf54l15dk_common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,6 @@
pinctrl-1 = <&pwm20_sleep>;
pinctrl-names = "default", "sleep";
};

/* Get a node label for wi-fi spi to use in shield files */
wifi_spi: &spi22 {};
12 changes: 7 additions & 5 deletions drivers/wifi/nrf_wifi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ zephyr_library_sources_ifdef(CONFIG_NET_L2_WIFI_MGMT
src/wifi_mgmt_scan.c
)

zephyr_library_sources_ifdef(CONFIG_NRF70_SYSTEM_MODE_COMMON
zephyr_library_sources_ifdef(CONFIG_NRF70_SYSTEM_MODE
src/wifi_mgmt.c
)

Expand Down Expand Up @@ -73,19 +73,21 @@ zephyr_compile_definitions_ifdef(CONFIG_NRF70_ON_QSPI
-DNRF53_ERRATA_159_ENABLE_WORKAROUND=0
)

target_link_libraries(nrf_wifi PRIVATE nrf70-buslib)
zephyr_library_link_libraries(nrf70-buslib nrf-wifi-shim)

if (CONFIG_NRF_WIFI_PATCHES_BUILTIN)
zephyr_blobs_verify(MODULE nrf_wifi REQUIRED)
# RPU FW patch binaries based on the selected configuration
if(CONFIG_NRF70_SYSTEM_MODE)
set(NRF70_PATCH ${FW_BINS_BASE}/default/nrf70.bin)
if (CONFIG_NRF70_SYSTEM_WITH_RAW_MODES)
set(NRF70_PATCH ${FW_BINS_BASE}/system_with_raw/nrf70.bin)
else()
set(NRF70_PATCH ${FW_BINS_BASE}/default/nrf70.bin)
endif()
elseif(CONFIG_NRF70_RADIO_TEST)
set(NRF70_PATCH ${FW_BINS_BASE}/radio_test/nrf70.bin)
elseif(CONFIG_NRF70_SCAN_ONLY)
set(NRF70_PATCH ${FW_BINS_BASE}/scan_only/nrf70.bin)
elseif (CONFIG_NRF70_SYSTEM_WITH_RAW_MODES)
set(NRF70_PATCH ${FW_BINS_BASE}/system_with_raw/nrf70.bin)
elseif(CONFIG_NRF70_OFFLOADED_RAW_TX)
set(NRF70_PATCH ${FW_BINS_BASE}/offloaded_raw_tx/nrf70.bin)
else()
Expand Down
57 changes: 21 additions & 36 deletions drivers/wifi/nrf_wifi/Kconfig.nrfwifi
Original file line number Diff line number Diff line change
Expand Up @@ -40,43 +40,29 @@ config NRF70_QSPI_LOW_POWER

choice NRF70_OPER_MODES
bool "nRF70 operating modes"
default NRF70_SYSTEM_WITH_RAW_MODES if !WIFI_NRF7000 && \
(NRF70_RAW_DATA_TX || NRF70_RAW_DATA_RX || NRF70_PROMISC_DATA_RX)
default NRF70_SYSTEM_MODE if !WIFI_NRF7000
default NRF70_SCAN_ONLY if WIFI_NRF7000
help
Select the operating mode of the nRF70 driver

config NRF70_SYSTEM_MODE
bool "nRF70 system mode"
depends on WIFI_NRF7002 || WIFI_NRF7001
select WIFI_NM_WPA_SUPPLICANT
help
Select this option to enable system mode of the nRF70 driver

config NRF70_SCAN_ONLY
bool "nRF70 scan only mode"
help
Select this option to enable scan only mode of the nRF70 driver

config NRF70_SYSTEM_MODE
bool "System mode of the nRF70 driver"
help
Select this option to enable system mode of the nRF70 driver

config NRF70_RADIO_TEST
bool "Radio test mode of the nRF70 driver"

config NRF70_OFFLOADED_RAW_TX
bool "Offloaded raw TX mode of the nRF70 driver"

config NRF70_SYSTEM_WITH_RAW_MODES
bool "nRF70 system mode with raw modes"
depends on WIFI_NRF7002 || WIFI_NRF7001
select WIFI_NM_WPA_SUPPLICANT
help
Select this option to enable system mode of the nRF70 driver with raw modes.
endchoice

config NRF70_SYSTEM_MODE_COMMON
bool
default y if NRF70_SYSTEM_MODE || NRF70_SYSTEM_WITH_RAW_MODES

config NET_L2_ETHERNET
default y if (!NRF70_RADIO_TEST && !NRF70_OFFLOADED_RAW_TX)

Expand All @@ -86,21 +72,31 @@ config HEAP_MEM_POOL_ADD_SIZE_NRF70
def_int 25000 if NRF70_SCAN_ONLY
def_int 150000

if NRF70_SYSTEM_MODE || NRF70_SYSTEM_WITH_RAW_MODES
if NRF70_SYSTEM_MODE
config NRF70_STA_MODE
bool "nRF70 STA mode"
default y
depends on WIFI_NRF7002 || WIFI_NRF7001
select WIFI_NM_WPA_SUPPLICANT
select NRF70_DATA_TX
help
Select this option to enable STA mode of the nRF70 driver.

config NRF70_AP_MODE
bool "Access point mode"
depends on WIFI_NRF7002 || WIFI_NRF7001
select NRF70_DATA_TX
depends on WIFI_NM_WPA_SUPPLICANT_AP
default y if WIFI_NM_WPA_SUPPLICANT_AP

config NRF70_P2P_MODE
bool "P2P support in driver"
endif # NRF70_SYSTEM_MODE || NRF70_SYSTEM_WITH_RAW_MODES

config NRF70_SYSTEM_WITH_RAW_MODES
bool
default y if (NRF70_RAW_DATA_TX || NRF70_RAW_DATA_RX || NRF70_PROMISC_DATA_RX)
depends on WIFI_NRF7002 || WIFI_NRF7001
help
Select this option to enable system mode of the nRF70 driver with raw modes.

config NRF70_RAW_DATA_TX
bool "RAW TX data path in the driver"
Expand All @@ -117,8 +113,8 @@ config NRF70_PROMISC_DATA_RX
select NET_PROMISCUOUS_MODE

config NRF70_DATA_TX
bool "TX data path in the driver"
default y if NRF70_SYSTEM_MODE || NRF70_SYSTEM_WITH_RAW_MODES
bool
endif # NRF70_SYSTEM_MODE

config NRF_WIFI_IF_AUTO_START
bool "Wi-Fi interface auto start on boot"
Expand Down Expand Up @@ -175,18 +171,6 @@ config WIFI_NRF70_LOG_LEVEL
# Enable error by default
default 1

config NRF70_ON_QSPI
def_bool DT_HAS_NORDIC_NRF7002_QSPI_ENABLED || \
DT_HAS_NORDIC_NRF7001_QSPI_ENABLED || \
DT_HAS_NORDIC_NRF7000_QSPI_ENABLED
select NRFX_QSPI

config NRF70_ON_SPI
def_bool DT_HAS_NORDIC_NRF7002_SPI_ENABLED || \
DT_HAS_NORDIC_NRF7001_SPI_ENABLED || \
DT_HAS_NORDIC_NRF7000_SPI_ENABLED
select SPI

config NRF70_2_4G_ONLY
def_bool y if WIFI_NRF7001

Expand Down Expand Up @@ -757,6 +741,7 @@ endchoice

config NRF_WIFI_MGMT_BUFF_OFFLOAD
bool "Management buffer offload"
depends on !WIFI_MGMT_RAW_SCAN_RESULTS
default y
help
This option offloads the refilling of management buffers to the UMAC, saving the host
Expand Down
4 changes: 3 additions & 1 deletion drivers/wifi/nrf_wifi/inc/fmac_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@
#ifdef CONFIG_NRF70_STA_MODE
#include <drivers/driver_zephyr.h>
#endif /* CONFIG_NRF70_STA_MODE */
#include <system/fmac_api.h>
#else
#include <radio_test/fmac_api.h>
#endif /* !CONFIG_NRF70_RADIO_TEST */

#include <fmac_api.h>
#include <host_rpu_umac_if.h>

#define NRF70_DRIVER_VERSION "1."KERNEL_VERSION_STRING
Expand Down
2 changes: 1 addition & 1 deletion drivers/wifi/nrf_wifi/inc/net_if.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#include <zephyr/net/net_pkt.h>
#include <zephyr/net/net_if.h>
#include <zephyr/net/ethernet.h>
#include <fmac_structs.h>
#include <zephyr/net/wifi_mgmt.h>
#include <system/fmac_structs.h>

#define UNICAST_MASK GENMASK(7, 1)
#define LOCAL_BIT BIT(1)
Expand Down
2 changes: 1 addition & 1 deletion drivers/wifi/nrf_wifi/off_raw_tx/inc/off_raw_tx.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @brief File containing internal structures for the offloaded raw TX feature in the driver.
*/

#include "fmac_structs_common.h"
#include "offload_raw_tx/fmac_structs.h"
#include "osal_api.h"

struct nrf_wifi_ctx_zep {
Expand Down
30 changes: 16 additions & 14 deletions drivers/wifi/nrf_wifi/off_raw_tx/src/off_raw_tx_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <zephyr/logging/log.h>
#include <zephyr/drivers/wifi/nrf_wifi/off_raw_tx/off_raw_tx_api.h>
#include <off_raw_tx.h>
#include <fmac_api.h>
#include <offload_raw_tx/fmac_api.h>

#define DT_DRV_COMPAT nordic_wlan
LOG_MODULE_DECLARE(wifi_nrf, CONFIG_WIFI_NRF70_LOG_LEVEL);
Expand Down Expand Up @@ -146,7 +146,7 @@ int nrf70_off_raw_tx_init(uint8_t *mac_addr, unsigned char *country_code)

key = k_spin_lock(&off_raw_tx_drv_priv.lock);

off_raw_tx_drv_priv.fmac_priv = nrf_wifi_fmac_off_raw_tx_init();
off_raw_tx_drv_priv.fmac_priv = nrf_wifi_off_raw_tx_fmac_init();

if (off_raw_tx_drv_priv.fmac_priv == NULL) {
LOG_ERR("%s: Failed to initialize nRF70 driver",
Expand All @@ -158,8 +158,8 @@ int nrf70_off_raw_tx_init(uint8_t *mac_addr, unsigned char *country_code)

rpu_ctx_zep->drv_priv_zep = &off_raw_tx_drv_priv;

rpu_ctx = nrf_wifi_fmac_dev_add(off_raw_tx_drv_priv.fmac_priv,
rpu_ctx_zep);
rpu_ctx = nrf_wifi_off_raw_tx_fmac_dev_add(off_raw_tx_drv_priv.fmac_priv,
rpu_ctx_zep);
if (!rpu_ctx) {
LOG_ERR("%s: Failed to add nRF70 device", __func__);
rpu_ctx_zep = NULL;
Expand Down Expand Up @@ -197,7 +197,7 @@ int nrf70_off_raw_tx_init(uint8_t *mac_addr, unsigned char *country_code)

configure_board_dep_params(&board_params);

status = nrf_wifi_fmac_off_raw_tx_dev_init(rpu_ctx_zep->rpu_ctx,
status = nrf_wifi_off_raw_tx_fmac_dev_init(rpu_ctx_zep->rpu_ctx,
#ifdef CONFIG_NRF_WIFI_LOW_POWER
HW_SLEEP_ENABLE,
#endif /* CONFIG_NRF_WIFI_LOW_POWER */
Expand Down Expand Up @@ -257,7 +257,7 @@ int nrf70_off_raw_tx_init(uint8_t *mac_addr, unsigned char *country_code)
return 0;
err:
if (rpu_ctx) {
nrf_wifi_fmac_off_raw_tx_dev_rem(rpu_ctx);
nrf_wifi_fmac_dev_rem(rpu_ctx);
rpu_ctx_zep->rpu_ctx = NULL;
}

Expand All @@ -278,7 +278,7 @@ void nrf70_off_raw_tx_deinit(void)
return;
}

nrf_wifi_fmac_off_raw_tx_deinit(off_raw_tx_drv_priv.fmac_priv);
nrf_wifi_fmac_deinit(off_raw_tx_drv_priv.fmac_priv);

k_spin_unlock(&off_raw_tx_drv_priv.lock, key);
}
Expand Down Expand Up @@ -361,7 +361,7 @@ int nrf70_off_raw_tx_conf_update(struct nrf_wifi_off_raw_tx_conf *conf)
goto out;
}

status = nrf_wifi_fmac_off_raw_tx_conf(fmac_dev_ctx,
status = nrf_wifi_off_raw_tx_fmac_conf(fmac_dev_ctx,
off_ctrl_params,
off_tx_params);
if (status != NRF_WIFI_STATUS_SUCCESS) {
Expand Down Expand Up @@ -398,7 +398,7 @@ int nrf70_off_raw_tx_start(struct nrf_wifi_off_raw_tx_conf *conf)
goto out;
}

status = nrf_wifi_fmac_off_raw_tx_start(off_raw_tx_drv_priv.rpu_ctx_zep.rpu_ctx);
status = nrf_wifi_off_raw_tx_fmac_start(off_raw_tx_drv_priv.rpu_ctx_zep.rpu_ctx);
if (status != NRF_WIFI_STATUS_SUCCESS) {
LOG_ERR("%s: nRF70 offloaded raw TX start failed",
__func__);
Expand All @@ -425,7 +425,7 @@ int nrf70_off_raw_tx_stop(void)
goto out;
}

status = nrf_wifi_fmac_off_raw_tx_stop(off_raw_tx_drv_priv.rpu_ctx_zep.rpu_ctx);
status = nrf_wifi_off_raw_tx_fmac_stop(off_raw_tx_drv_priv.rpu_ctx_zep.rpu_ctx);
if (status != NRF_WIFI_STATUS_SUCCESS) {
LOG_ERR("%s: nRF70 offloaded raw TX stop failed",
__func__);
Expand Down Expand Up @@ -454,10 +454,10 @@ int nrf70_off_raw_tx_stats(struct nrf_wifi_off_raw_tx_stats *off_raw_tx_stats)
{
int ret = -1;
enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL;
struct rpu_op_stats stats;
struct rpu_off_raw_tx_op_stats stats;
k_spinlock_key_t key;

memset(&stats, 0, sizeof(struct rpu_op_stats));
memset(&stats, 0, sizeof(stats));

key = k_spin_lock(&off_raw_tx_drv_priv.lock);

Expand All @@ -466,14 +466,16 @@ int nrf70_off_raw_tx_stats(struct nrf_wifi_off_raw_tx_stats *off_raw_tx_stats)
goto out;
}

status = nrf_wifi_fmac_stats_get(off_raw_tx_drv_priv.rpu_ctx_zep.rpu_ctx, 0, &stats);
status = nrf_wifi_off_raw_tx_fmac_stats_get(off_raw_tx_drv_priv.rpu_ctx_zep.rpu_ctx,
0,
&stats);
if (status != NRF_WIFI_STATUS_SUCCESS) {
LOG_ERR("%s: nRF70 offloaded raw TX stats failed",
__func__);
goto out;
}

off_raw_tx_stats->off_raw_tx_pkt_sent = stats.fw.offloaded_raw_tx.offload_raw_tx_cnt;
off_raw_tx_stats->off_raw_tx_pkt_sent = stats.fw.offload_raw_tx_cnt;

ret = 0;
out:
Expand Down
Loading
Loading