diff --git a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi index 9b37c302872..06690e87427 100644 --- a/drivers/wifi/nrf_wifi/Kconfig.nrfwifi +++ b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi @@ -165,6 +165,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 7a863d8b614..409a0cc8018 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 70fb77d6ed0..b6ac79bf772 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 125ffd7a9a1..918eec1f39f 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) @@ -834,9 +834,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 f09643a585a..cce5a98372f 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 e48ae31734a..6bb31241b29 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 57bda1f4ff4..844ea4203af 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" @@ -973,6 +977,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 +1015,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 +1101,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 +1206,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 +1214,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/west.yml b/west.yml index d0e76dbc576..32a282cb5dc 100644 --- a/west.yml +++ b/west.yml @@ -337,7 +337,7 @@ manifest: revision: 40403f5f2805cca210d2a47c8717d89c4e816cda path: modules/bsim_hw_models/nrf_hw_models - name: nrf_wifi - revision: 5fffeab6496932abb10f9dae53ed3686967aa050 + revision: pull/78/head path: modules/lib/nrf_wifi - name: open-amp revision: c30a6d8b92fcebdb797fc1a7698e8729e250f637