Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions drivers/wifi/nrf_wifi/Kconfig.nrfwifi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion drivers/wifi/nrf_wifi/inc/fmac_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@
#else
#include <radio_test/fmac_api.h>
#endif /* !CONFIG_NRF70_RADIO_TEST */

#ifdef CONFIG_NRF71_ON_IPC
#include <nrf71_wifi_ctrl.h>
#else
#include <host_rpu_umac_if.h>
#endif /* CONFIG_NRF71_ON_IPC */

#define NRF70_DRIVER_VERSION "1."KERNEL_VERSION_STRING

Expand Down
4 changes: 4 additions & 0 deletions drivers/wifi/nrf_wifi/src/debug_shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
*/
#include <stdlib.h>
#include <zephyr/shell/shell.h>
#ifdef NRF71_ON_IPC
#include <nrf71_wifi_ctrl.h>
#else
#include "host_rpu_umac_if.h"
#endif
#include "fmac_main.h"

extern struct nrf_wifi_drv_priv_zep rpu_drv_priv_zep;
Expand Down
17 changes: 11 additions & 6 deletions drivers/wifi/nrf_wifi/src/fmac_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
{
Expand All @@ -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) && \
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;

Expand Down
8 changes: 7 additions & 1 deletion drivers/wifi/nrf_wifi/src/fw_load.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,33 @@
LOG_MODULE_DECLARE(wifi_nrf, CONFIG_WIFI_NRF70_LOG_LEVEL);

#include <fmac_main.h>
#ifndef CONFIG_NRF71_ON_IPC
static const char fw_patch[] = {
#include <nrf70_fw_patch/nrf70.bin.inc>
};
#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);
if (status != NRF_WIFI_STATUS_SUCCESS) {
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;
}
3 changes: 2 additions & 1 deletion drivers/wifi/nrf_wifi/src/wifi_mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
9 changes: 9 additions & 0 deletions drivers/wifi/nrf_wifi/src/wifi_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
* @brief NRF Wi-Fi util shell module
*/
#include <stdlib.h>
#ifdef NRF71_ON_IPC
#include <nrf71_wifi_ctrl.h>
#else
#include "host_rpu_umac_if.h"
#endif
#include "common/fmac_util.h"
#include "system/fmac_api.h"
#include "fmac_main.h"
Expand Down Expand Up @@ -973,6 +977,7 @@
}
#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,
Expand Down Expand Up @@ -1010,7 +1015,8 @@
return ret;
}


static int nrf_wifi_util_dump_rpu_stats_mem(const struct shell *sh,

Check notice on line 1019 in drivers/wifi/nrf_wifi/src/wifi_util.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/wifi/nrf_wifi/src/wifi_util.c:1019 -
size_t argc,
const char *argv[])
{
Expand Down Expand Up @@ -1095,6 +1101,7 @@
k_mutex_unlock(&ctx->rpu_lock);
return ret;
}
#endif /* !CONFIG_NRF71_ON_IPC */

SHELL_STATIC_SUBCMD_SET_CREATE(
nrf70_util,
Expand Down Expand Up @@ -1146,7 +1153,7 @@
#endif /* CONFIG_NRF70_STA_MODE */
SHELL_CMD_ARG(tx_rate,
NULL,
"Sets TX data rate to either a fixed value or AUTO\n"

Check notice on line 1156 in drivers/wifi/nrf_wifi/src/wifi_util.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/wifi/nrf_wifi/src/wifi_util.c:1156 - SHELL_CMD_ARG(he_ltf, - NULL, + SHELL_CMD_ARG(he_ltf, NULL, "0 - 1x HE LTF\n" "1 - 2x HE LTF\n" "2 - 4x HE LTF ", - nrf_wifi_util_set_he_ltf, - 2, - 0), - SHELL_CMD_ARG(he_gi, - NULL, + nrf_wifi_util_set_he_ltf, 2, 0), + SHELL_CMD_ARG(he_gi, NULL, "0 - 0.8 us\n" "1 - 1.6 us\n" "2 - 3.2 us ", - nrf_wifi_util_set_he_gi, - 2, - 0), - SHELL_CMD_ARG(set_he_ltf_gi, - NULL, + nrf_wifi_util_set_he_gi, 2, 0), + SHELL_CMD_ARG(set_he_ltf_gi, NULL, "0 - Disable\n" "1 - Enable", - nrf_wifi_util_set_he_ltf_gi, - 2, - 0), + nrf_wifi_util_set_he_ltf_gi, 2, 0), #ifdef CONFIG_NRF70_STA_MODE - SHELL_CMD_ARG(uapsd_queue, - NULL, - "<val> - 0 to 15", - nrf_wifi_util_set_uapsd_queue, - 2, - 0), + SHELL_CMD_ARG(uapsd_queue, NULL, "<val> - 0 to 15", nrf_wifi_util_set_uapsd_queue, 2, 0), #endif /* CONFIG_NRF70_STA_MODE */ - SHELL_CMD_ARG(show_config, - NULL, - "Display the current configuration values", - nrf_wifi_util_show_cfg, - 1, - 0), + SHELL_CMD_ARG(show_config, NULL, "Display the current configuration values", + nrf_wifi_util_show_cfg, 1, 0), #ifdef CONFIG_NRF70_STA_MODE - SHELL_CMD_ARG(tx_stats, - NULL, + SHELL_CMD_ARG(tx_stats, NULL, "Displays transmit statistics\n" - "vif_index: 0 - 1\n", - nrf_wifi_util_tx_stats, - 2, - 0), + "vif_index: 0 - 1\n", + nrf_wifi_util_tx_stats, 2, 0), #endif /* CONFIG_NRF70_STA_MODE */ - SHELL_CMD_ARG(tx_rate, - NULL, + SHELL_CMD_ARG(tx_rate, NULL,
"Parameters:\n"
" <rate_flag> : The TX data rate type to be set, where:\n"
" 0 - LEGACY\n"
Expand Down Expand Up @@ -1199,16 +1206,18 @@
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 "
"Parameters: umac or lmac or or all (default)",
nrf_wifi_util_dump_rpu_stats_mem,
1,
1),
#endif /* !CONFIG_NRF71_ON_IPC */
SHELL_SUBCMD_SET_END);


Check notice on line 1220 in drivers/wifi/nrf_wifi/src/wifi_util.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/wifi/nrf_wifi/src/wifi_util.c:1220 - nrf_wifi_util_tx_rate, - 2, - 1), + nrf_wifi_util_tx_rate, 2, 1), #ifdef CONFIG_NRF_WIFI_LOW_POWER - SHELL_CMD_ARG(sleep_state, - NULL, - "Display current sleep status", - nrf_wifi_util_show_host_rpu_ps_ctrl_state, - 1, - 0), + SHELL_CMD_ARG(sleep_state, NULL, "Display current sleep status", + nrf_wifi_util_show_host_rpu_ps_ctrl_state, 1, 0), #endif /* CONFIG_NRF_WIFI_LOW_POWER */ - SHELL_CMD_ARG(show_vers, - NULL, - "Display the driver and the firmware versions", - nrf_wifi_util_show_vers, - 1, - 0), + SHELL_CMD_ARG(show_vers, NULL, "Display the driver and the firmware versions", + nrf_wifi_util_show_vers, 1, 0), #if !defined(CONFIG_NRF70_RADIO_TEST) && !defined(CONFIG_NRF70_OFFLOADED_RAW_TX) - SHELL_CMD_ARG(rpu_stats, - NULL, + SHELL_CMD_ARG(rpu_stats, NULL, "Display RPU stats " "Parameters: umac or lmac or phy or all (default)", - nrf_wifi_util_dump_rpu_stats, - 1, - 1), + nrf_wifi_util_dump_rpu_stats, 1, 1), #endif /* !CONFIG_NRF70_RADIO_TEST && !CONFIG_NRF70_OFFLOADED_RAW_TX*/ #ifdef CONFIG_NRF_WIFI_RPU_RECOVERY - SHELL_CMD_ARG(rpu_recovery_test, - NULL, - "Trigger RPU recovery", - nrf_wifi_util_trigger_rpu_recovery, - 1, - 0), - SHELL_CMD_ARG(rpu_recovery_info, - NULL, - "Dump RPU recovery information", - nrf_wifi_util_rpu_recovery_info, - 1, - 0), + SHELL_CMD_ARG(rpu_recovery_test, NULL, "Trigger RPU recovery", + nrf_wifi_util_trigger_rpu_recovery, 1, 0), + SHELL_CMD_ARG(rpu_recovery_info, NULL, "Dump RPU recovery information", + nrf_wifi_util_rpu_recovery_info, 1, 0), #endif /* CONFIG_NRF_WIFI_RPU_RECOVERY */ #ifndef CONFIG_NRF71_ON_IPC - SHELL_CMD_ARG(rpu_stats_mem, - NULL, + SHELL_CMD_ARG(rpu_stats_mem, NULL, "Display RPU stats by reading from memory " "Parameters: umac or lmac or or all (default)", - nrf_wifi_util_dump_rpu_stats_mem, - 1, - 1), + nrf_wifi_util_dump_rpu_stats_mem, 1, 1), #endif /* !CONFIG_NRF71_ON_IPC */ SHELL_SUBCMD_SET_END); -
SHELL_SUBCMD_ADD((nrf70), util, &nrf70_util, "nRF70 utility commands\n", NULL, 0, 0);


Expand Down
2 changes: 1 addition & 1 deletion west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading