From fb9066c77d0c443530895ab12a762bdf3093cd8f Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Tue, 30 Sep 2025 20:56:48 +0530 Subject: [PATCH 1/4] manifest: nrf_wifi: Pull nRF71 support Pull nRF71 OSAL support, full support is till TBD. Signed-off-by: Chaitanya Tata --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 46bb9e82bd0ac..312c119202fc6 100644 --- a/west.yml +++ b/west.yml @@ -342,7 +342,7 @@ manifest: revision: 40403f5f2805cca210d2a47c8717d89c4e816cda path: modules/bsim_hw_models/nrf_hw_models - name: nrf_wifi - revision: b822726084f55df19aa6660dc46cf602757e8645 + revision: e269670cd17fb8ccc4b7004544276bc7d9578496 path: modules/lib/nrf_wifi - name: open-amp revision: c30a6d8b92fcebdb797fc1a7698e8729e250f637 From e6b7ec642e65568722c79df614a5166dfd51749c Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Wed, 20 Aug 2025 01:45:18 +0530 Subject: [PATCH 2/4] drivers: nrf_wifi: Fix NRF71 build NRF71 doesn't have direct memory access, so, disabled the rpu stats memory variant. Signed-off-by: Chaitanya Tata --- drivers/wifi/nrf_wifi/src/wifi_util.c | 7 +++++++ drivers/wifi/nrf_wifi/src/wifi_util.h | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/drivers/wifi/nrf_wifi/src/wifi_util.c b/drivers/wifi/nrf_wifi/src/wifi_util.c index 57bda1f4ff4f2..4a83094347948 100644 --- a/drivers/wifi/nrf_wifi/src/wifi_util.c +++ b/drivers/wifi/nrf_wifi/src/wifi_util.c @@ -14,8 +14,10 @@ #include "fmac_main.h" #include "wifi_util.h" +#ifndef CONFIG_NRF71_ON_IPC #include "rpu_lmac_phy_stats.h" #include "rpu_umac_stats.h" +#endif extern struct nrf_wifi_drv_priv_zep rpu_drv_priv_zep; struct nrf_wifi_ctx_zep *ctx = &rpu_drv_priv_zep.rpu_ctx_zep; @@ -973,6 +975,7 @@ static int nrf_wifi_util_rpu_recovery_info(const struct shell *sh, } #endif /* CONFIG_NRF_WIFI_RPU_RECOVERY */ +#ifndef CONFIG_NRF71_ON_IPC static int nrf_wifi_dump_stats(const struct shell *sh, struct nrf_wifi_hal_dev_ctx *hal_dev_ctx, const char *name, @@ -1010,6 +1013,7 @@ static int nrf_wifi_dump_stats(const struct shell *sh, return ret; } + static int nrf_wifi_util_dump_rpu_stats_mem(const struct shell *sh, size_t argc, const char *argv[]) @@ -1095,6 +1099,7 @@ static int nrf_wifi_util_dump_rpu_stats_mem(const struct shell *sh, k_mutex_unlock(&ctx->rpu_lock); return ret; } +#endif /* !CONFIG_NRF71_ON_IPC */ SHELL_STATIC_SUBCMD_SET_CREATE( nrf70_util, @@ -1199,6 +1204,7 @@ SHELL_STATIC_SUBCMD_SET_CREATE( 1, 0), #endif /* CONFIG_NRF_WIFI_RPU_RECOVERY */ +#ifndef CONFIG_NRF71_ON_IPC SHELL_CMD_ARG(rpu_stats_mem, NULL, "Display RPU stats by reading from memory " @@ -1206,6 +1212,7 @@ SHELL_STATIC_SUBCMD_SET_CREATE( nrf_wifi_util_dump_rpu_stats_mem, 1, 1), +#endif /* !CONFIG_NRF71_ON_IPC */ SHELL_SUBCMD_SET_END); diff --git a/drivers/wifi/nrf_wifi/src/wifi_util.h b/drivers/wifi/nrf_wifi/src/wifi_util.h index 303d5feac99fb..a2490a1df24c5 100644 --- a/drivers/wifi/nrf_wifi/src/wifi_util.h +++ b/drivers/wifi/nrf_wifi/src/wifi_util.h @@ -14,7 +14,11 @@ #include #include #include +#ifdef CONFIG_NRF71_ON_IPC +#include +#else #include +#endif #include #include From 868b7e7bb3820c1058d54097307dda2ccc5d594f Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Tue, 23 Sep 2025 21:49:41 +0530 Subject: [PATCH 3/4] drivers: nrf_wifi: Use new nRF71 interface files nRF70 and nRF71 now use different interface files, fix the build. Signed-off-by: Chaitanya Tata --- drivers/wifi/nrf_wifi/Kconfig.nrfwifi | 1 + drivers/wifi/nrf_wifi/inc/fmac_main.h | 5 ++++- drivers/wifi/nrf_wifi/src/debug_shell.c | 4 ++++ drivers/wifi/nrf_wifi/src/fmac_main.c | 17 +++++++++++------ drivers/wifi/nrf_wifi/src/fw_load.c | 8 +++++++- drivers/wifi/nrf_wifi/src/wifi_mgmt.c | 3 ++- drivers/wifi/nrf_wifi/src/wifi_util.c | 4 ++++ 7 files changed, 33 insertions(+), 9 deletions(-) diff --git a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi index 29f8c86250a33..df4414a316e0e 100644 --- a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi +++ b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi @@ -174,6 +174,7 @@ config NRF_WIFI_LOW_POWER config NRF70_TCP_IP_CHECKSUM_OFFLOAD bool "TCP/IP checksum offload" + depends on !NRF71_ON_IPC default y config NRF70_REG_DOMAIN diff --git a/drivers/wifi/nrf_wifi/inc/fmac_main.h b/drivers/wifi/nrf_wifi/inc/fmac_main.h index 48d3791961e39..799beff1fbaf5 100644 --- a/drivers/wifi/nrf_wifi/inc/fmac_main.h +++ b/drivers/wifi/nrf_wifi/inc/fmac_main.h @@ -31,8 +31,11 @@ #else #include #endif /* !CONFIG_NRF70_RADIO_TEST */ - +#ifdef CONFIG_NRF71_ON_IPC +#include +#else #include +#endif /* CONFIG_NRF71_ON_IPC */ #define NRF70_DRIVER_VERSION "1."KERNEL_VERSION_STRING diff --git a/drivers/wifi/nrf_wifi/src/debug_shell.c b/drivers/wifi/nrf_wifi/src/debug_shell.c index 70fb77d6ed0df..b6ac79bf77245 100644 --- a/drivers/wifi/nrf_wifi/src/debug_shell.c +++ b/drivers/wifi/nrf_wifi/src/debug_shell.c @@ -9,7 +9,11 @@ */ #include #include +#ifdef NRF71_ON_IPC +#include +#else #include "host_rpu_umac_if.h" +#endif #include "fmac_main.h" extern struct nrf_wifi_drv_priv_zep rpu_drv_priv_zep; diff --git a/drivers/wifi/nrf_wifi/src/fmac_main.c b/drivers/wifi/nrf_wifi/src/fmac_main.c index 9cef8202f9ebf..272008f6aea5c 100644 --- a/drivers/wifi/nrf_wifi/src/fmac_main.c +++ b/drivers/wifi/nrf_wifi/src/fmac_main.c @@ -69,9 +69,10 @@ BUILD_ASSERT(CONFIG_NRF70_MAX_TX_AGGREGATION <= 15, "Max TX aggregation is 15"); BUILD_ASSERT(CONFIG_NRF70_RX_NUM_BUFS >= 1, "At least one RX buffer is required"); +#ifndef CONFIG_NRF71_ON_IPC BUILD_ASSERT(RPU_PKTRAM_SIZE - TOTAL_RX_SIZE >= TOTAL_TX_SIZE, "Packet RAM overflow: not enough memory for TX"); - +#endif /* CONFIG_NRF71_ON_IPC */ BUILD_ASSERT(CONFIG_NRF70_TX_MAX_DATA_SIZE >= MAX_TX_FRAME_SIZE, "TX buffer size must be at least as big as the MTU and headroom"); @@ -503,12 +504,9 @@ void reg_change_callbk_fn(void *vif_ctx, } #endif /* !CONFIG_NRF70_RADIO_TEST */ -#ifdef CONFIG_NRF71_ON_IPC -#define MAX_TX_PWR(label) DT_PROP(DT_NODELABEL(wifi), label) * 4 -#else +#ifndef CONFIG_NRF71_ON_IPC /* DTS uses 1dBm as the unit for TX power, while the RPU uses 0.25dBm */ #define MAX_TX_PWR(label) DT_PROP(DT_NODELABEL(nrf70), label) * 4 -#endif /* CONFIG_NRF71_ON_IPC */ void configure_tx_pwr_settings(struct nrf_wifi_tx_pwr_ctrl_params *tx_pwr_ctrl_params, struct nrf_wifi_tx_pwr_ceil_params *tx_pwr_ceil_params) @@ -587,6 +585,7 @@ void configure_board_dep_params(struct nrf_wifi_board_params *board_params) board_params->pcb_loss_5g_band3 = CONFIG_NRF70_PCB_LOSS_5G_BAND3; #endif /* CONFIG_NRF70_2_4G_ONLY */ } +#endif /* CONFIG_NRF71_ON_IPC */ enum nrf_wifi_status nrf_wifi_fmac_dev_add_zep(struct nrf_wifi_drv_priv_zep *drv_priv_zep) { @@ -606,7 +605,6 @@ enum nrf_wifi_status nrf_wifi_fmac_dev_add_zep(struct nrf_wifi_drv_priv_zep *drv struct nrf_wifi_tx_pwr_ctrl_params tx_pwr_ctrl_params; struct nrf_wifi_tx_pwr_ceil_params tx_pwr_ceil_params; struct nrf_wifi_board_params board_params; - unsigned int fw_ver = 0; #if defined(CONFIG_NRF70_SR_COEX_SLEEP_CTRL_GPIO_CTRL) && \ @@ -654,10 +652,12 @@ enum nrf_wifi_status nrf_wifi_fmac_dev_add_zep(struct nrf_wifi_drv_priv_zep *drv NRF_WIFI_UMAC_VER_MIN(fw_ver), NRF_WIFI_UMAC_VER_EXTRA(fw_ver)); +#ifndef CONFIG_NRF71_ON_IPC configure_tx_pwr_settings(&tx_pwr_ctrl_params, &tx_pwr_ceil_params); configure_board_dep_params(&board_params); +#endif /* CONFIG_NRF71_ON_IPC */ #if defined(CONFIG_NRF70_SR_COEX_SLEEP_CTRL_GPIO_CTRL) && \ defined(CONFIG_NRF70_SYSTEM_MODE) @@ -853,9 +853,14 @@ static int nrf_wifi_drv_main_zep(const struct device *dev) struct nrf_wifi_sys_fmac_priv *sys_fpriv = NULL; sys_fpriv = wifi_fmac_priv(rpu_drv_priv_zep.fmac_priv); +#ifdef CONFIG_NRF71_ON_IPC + /* TODO: Revisit this */ + sys_fpriv->max_ampdu_len_per_token = 8192; +#else sys_fpriv->max_ampdu_len_per_token = (RPU_PKTRAM_SIZE - (CONFIG_NRF70_RX_NUM_BUFS * CONFIG_NRF70_RX_MAX_DATA_SIZE)) / CONFIG_NRF70_MAX_TX_TOKENS; +#endif /* CONFIG_NRF71_ON_IPC */ /* Align to 4-byte */ sys_fpriv->max_ampdu_len_per_token &= ~0x3; diff --git a/drivers/wifi/nrf_wifi/src/fw_load.c b/drivers/wifi/nrf_wifi/src/fw_load.c index f09643a585a89..cce5a98372fcd 100644 --- a/drivers/wifi/nrf_wifi/src/fw_load.c +++ b/drivers/wifi/nrf_wifi/src/fw_load.c @@ -17,13 +17,17 @@ LOG_MODULE_DECLARE(wifi_nrf, CONFIG_WIFI_NRF70_LOG_LEVEL); #include +#ifndef CONFIG_NRF71_ON_IPC static const char fw_patch[] = { #include }; +#endif /* CONFIG_NRF71_ON_IPC */ enum nrf_wifi_status nrf_wifi_fw_load(void *rpu_ctx) { enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; + +#ifndef CONFIG_NRF71_ON_IPC struct nrf_wifi_fmac_fw_info fw_info = { 0 }; status = nrf_wifi_fmac_fw_parse(rpu_ctx, fw_patch, sizeof(fw_patch), &fw_info); @@ -31,13 +35,15 @@ enum nrf_wifi_status nrf_wifi_fw_load(void *rpu_ctx) LOG_ERR("%s: nrf_wifi_fmac_fw_parse failed", __func__); return status; } -#ifndef CONFIG_NRF71_ON_IPC + /* Load the FW patches to the RPU */ status = nrf_wifi_fmac_fw_load(rpu_ctx, &fw_info); if (status != NRF_WIFI_STATUS_SUCCESS) { LOG_ERR("%s: nrf_wifi_fmac_fw_load failed", __func__); } +#else + status = NRF_WIFI_STATUS_SUCCESS; #endif /* !CONFIG_NRF71_ON_IPC */ return status; } diff --git a/drivers/wifi/nrf_wifi/src/wifi_mgmt.c b/drivers/wifi/nrf_wifi/src/wifi_mgmt.c index e48ae31734a73..6bb31241b295f 100644 --- a/drivers/wifi/nrf_wifi/src/wifi_mgmt.c +++ b/drivers/wifi/nrf_wifi/src/wifi_mgmt.c @@ -564,8 +564,9 @@ int nrf_wifi_set_twt(const struct device *dev, twt_info.dialog_token = twt_params->dialog_token; twt_info.twt_wake_ahead_duration = twt_params->setup.twt_wake_ahead_duration; +#ifndef CONFIG_NRF71_ON_IPC twt_info.twt_req_timeout = CONFIG_NRF_WIFI_TWT_SETUP_TIMEOUT_MS; - +#endif /* CONFIG_NRF71_ON_IPC */ status = nrf_wifi_sys_fmac_twt_setup(rpu_ctx_zep->rpu_ctx, vif_ctx_zep->vif_idx, &twt_info); diff --git a/drivers/wifi/nrf_wifi/src/wifi_util.c b/drivers/wifi/nrf_wifi/src/wifi_util.c index 4a83094347948..50c9e947229b2 100644 --- a/drivers/wifi/nrf_wifi/src/wifi_util.c +++ b/drivers/wifi/nrf_wifi/src/wifi_util.c @@ -8,7 +8,11 @@ * @brief NRF Wi-Fi util shell module */ #include +#ifdef NRF71_ON_IPC +#include +#else #include "host_rpu_umac_if.h" +#endif #include "common/fmac_util.h" #include "system/fmac_api.h" #include "fmac_main.h" From f7546ed37e34c2eaa7e9b41df8c143c9a5f7032c Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Mon, 13 Oct 2025 22:13:38 +0530 Subject: [PATCH 4/4] drivers: nrf_wifi: Rejig band config nRF71 supports tri-band, so, to cater both nRF70 and nRF71, rejig the configuration and add a helper to convert from Kconfig to the interface structs. Signed-off-by: Chaitanya Tata --- drivers/wifi/nrf_wifi/Kconfig.nrfwifi | 31 +++++++++---------- .../nrf_wifi/off_raw_tx/src/off_raw_tx_api.c | 22 ++++++++++++- drivers/wifi/nrf_wifi/src/fmac_main.c | 22 ++++++++++++- 3 files changed, 57 insertions(+), 18 deletions(-) diff --git a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi index df4414a316e0e..2021d25580aeb 100644 --- a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi +++ b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi @@ -665,28 +665,27 @@ config WIFI_NRF70_SCAN_TIMEOUT_S int "Scan timeout in seconds" default 30 -menu "nRF Wi-Fi operation band(s)" - visible if !NRF70_2_4G_ONLY +choice NRF_WIFI_OP_BAND + prompt "nRF Wi-Fi operation bands" + default NRF_WIFI_2G_BAND if NRF70_2_4G_ONLY + default NRF_WIFI_ALL_BAND + +config NRF_WIFI_ALL_BAND + bool "Set operation band to all supported bands" config NRF_WIFI_2G_BAND bool "Set operation band to 2.4GHz" - default y if NRF70_2_4G_ONLY config NRF_WIFI_5G_BAND bool "Set operation band to 5GHz" - depends on !NRF70_2_4G_ONLY - -config NRF_WIFI_OP_BAND - int "Options to set operation band" - default 1 if NRF_WIFI_2G_BAND - default 2 if NRF_WIFI_5G_BAND - default 3 - help - Set this option to select frequency band - 1 - 2.4GHz - 2 - 5GHz - 3 - All ( 2.4GHz and 5GHz ) -endmenu +if NRF71_ON_IPC +config NRF_WIFI_6G_BAND + bool "Set operation band to 6GHz" + +config NRF_WIFI_DUAL_BAND + bool "Set operation band to 2.4GHz and 5GHz" +endif # NRF71_ON_IPC +endchoice config NRF_WIFI_IFACE_MTU int "MTU for Wi-Fi interface" diff --git a/drivers/wifi/nrf_wifi/off_raw_tx/src/off_raw_tx_api.c b/drivers/wifi/nrf_wifi/off_raw_tx/src/off_raw_tx_api.c index 17825511787ba..1e53f70c111f7 100644 --- a/drivers/wifi/nrf_wifi/off_raw_tx/src/off_raw_tx_api.c +++ b/drivers/wifi/nrf_wifi/off_raw_tx/src/off_raw_tx_api.c @@ -128,6 +128,25 @@ static int bytes_from_str(uint8_t *buf, int buf_len, const char *src) } #endif /* CONFIG_WIFI_FIXED_MAC_ADDRESS_ENABLED */ +static enum op_band get_nrf_wifi_op_band(void) +{ + if (IS_ENABLED(CONFIG_NRF_WIFI_2G_BAND)) { + return BAND_24G; + } +#ifdef CONFIG_NRF71_ON_IPC + if (IS_ENABLED(CONFIG_NRF_WIFI_5G_BAND)) { + return BAND_5G; + } + if (IS_ENABLED(CONFIG_NRF_WIFI_6G_BAND)) { + return BAND_6G; + } + if (IS_ENABLED(CONFIG_NRF_WIFI_DUAL_BAND)) { + return BAND_DUAL; + } +#endif /* CONFIG_NRF71_ON_IPC */ + return BAND_ALL; +} + int nrf70_off_raw_tx_init(uint8_t *mac_addr, unsigned char *country_code) { enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; @@ -138,6 +157,7 @@ int nrf70_off_raw_tx_init(uint8_t *mac_addr, unsigned char *country_code) struct nrf_wifi_board_params board_params; unsigned int fw_ver = 0; k_spinlock_key_t key; + enum op_band op_band = get_nrf_wifi_op_band(); /* The OSAL layer needs to be initialized before any other initialization * so that other layers (like FW IF,HW IF etc) have access to OS ops @@ -202,7 +222,7 @@ int nrf70_off_raw_tx_init(uint8_t *mac_addr, unsigned char *country_code) HW_SLEEP_ENABLE, #endif /* CONFIG_NRF_WIFI_LOW_POWER */ NRF_WIFI_DEF_PHY_CALIB, - CONFIG_NRF_WIFI_OP_BAND, + op_band, IS_ENABLED(CONFIG_NRF_WIFI_BEAMFORMING), &ctrl_params, &ceil_params, diff --git a/drivers/wifi/nrf_wifi/src/fmac_main.c b/drivers/wifi/nrf_wifi/src/fmac_main.c index 272008f6aea5c..71635514aa9da 100644 --- a/drivers/wifi/nrf_wifi/src/fmac_main.c +++ b/drivers/wifi/nrf_wifi/src/fmac_main.c @@ -587,12 +587,32 @@ void configure_board_dep_params(struct nrf_wifi_board_params *board_params) } #endif /* CONFIG_NRF71_ON_IPC */ +static enum op_band get_nrf_wifi_op_band(void) +{ + if (IS_ENABLED(CONFIG_NRF_WIFI_2G_BAND)) { + return BAND_24G; + } +#ifdef CONFIG_NRF71_ON_IPC + if (IS_ENABLED(CONFIG_NRF_WIFI_5G_BAND)) { + return BAND_5G; + } + + if (IS_ENABLED(CONFIG_NRF_WIFI_6G_BAND)) { + return BAND_6G; + } + if (IS_ENABLED(CONFIG_NRF_WIFI_DUAL_BAND)) { + return BAND_DUAL; + } +#endif /* CONFIG_NRF71_ON_IPC */ + return BAND_ALL; +} + enum nrf_wifi_status nrf_wifi_fmac_dev_add_zep(struct nrf_wifi_drv_priv_zep *drv_priv_zep) { enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL; struct nrf_wifi_ctx_zep *rpu_ctx_zep = NULL; void *rpu_ctx = NULL; - enum op_band op_band = CONFIG_NRF_WIFI_OP_BAND; + enum op_band op_band = get_nrf_wifi_op_band(); #ifdef CONFIG_NRF_WIFI_LOW_POWER int sleep_type = -1;