Skip to content

Commit 839d33b

Browse files
committed
[nrf fromlist] Use new nRF71 interface files
nRF70 and nRF71 now use different interface files. Upstream PR #: 96807 Signed-off-by: Chaitanya Tata <[email protected]>
1 parent aeefba6 commit 839d33b

File tree

7 files changed

+33
-9
lines changed

7 files changed

+33
-9
lines changed

drivers/wifi/nrf_wifi/Kconfig.nrfwifi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ config NRF_WIFI_LOW_POWER
165165

166166
config NRF70_TCP_IP_CHECKSUM_OFFLOAD
167167
bool "TCP/IP checksum offload"
168+
depends on !NRF71_ON_IPC
168169
default y
169170

170171
config NRF70_REG_DOMAIN

drivers/wifi/nrf_wifi/inc/fmac_main.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,11 @@
3131
#else
3232
#include <radio_test/fmac_api.h>
3333
#endif /* !CONFIG_NRF70_RADIO_TEST */
34-
34+
#ifdef CONFIG_NRF71_ON_IPC
35+
#include <nrf71_wifi_ctrl.h>
36+
#else
3537
#include <host_rpu_umac_if.h>
38+
#endif /* CONFIG_NRF71_ON_IPC */
3639

3740
#define NRF70_DRIVER_VERSION "1."KERNEL_VERSION_STRING
3841

drivers/wifi/nrf_wifi/src/debug_shell.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@
99
*/
1010
#include <stdlib.h>
1111
#include <zephyr/shell/shell.h>
12+
#ifdef NRF71_ON_IPC
13+
#include <nrf71_wifi_ctrl.h>
14+
#else
1215
#include "host_rpu_umac_if.h"
16+
#endif
1317
#include "fmac_main.h"
1418

1519
extern struct nrf_wifi_drv_priv_zep rpu_drv_priv_zep;

drivers/wifi/nrf_wifi/src/fmac_main.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,10 @@ BUILD_ASSERT(CONFIG_NRF70_MAX_TX_AGGREGATION <= 15,
6969
"Max TX aggregation is 15");
7070
BUILD_ASSERT(CONFIG_NRF70_RX_NUM_BUFS >= 1,
7171
"At least one RX buffer is required");
72+
#ifndef CONFIG_NRF71_ON_IPC
7273
BUILD_ASSERT(RPU_PKTRAM_SIZE - TOTAL_RX_SIZE >= TOTAL_TX_SIZE,
7374
"Packet RAM overflow: not enough memory for TX");
74-
75+
#endif /* CONFIG_NRF71_ON_IPC */
7576
BUILD_ASSERT(CONFIG_NRF70_TX_MAX_DATA_SIZE >= MAX_TX_FRAME_SIZE,
7677
"TX buffer size must be at least as big as the MTU and headroom");
7778

@@ -503,12 +504,9 @@ void reg_change_callbk_fn(void *vif_ctx,
503504
}
504505
#endif /* !CONFIG_NRF70_RADIO_TEST */
505506

506-
#ifdef CONFIG_NRF71_ON_IPC
507-
#define MAX_TX_PWR(label) DT_PROP(DT_NODELABEL(wifi), label) * 4
508-
#else
507+
#ifndef CONFIG_NRF71_ON_IPC
509508
/* DTS uses 1dBm as the unit for TX power, while the RPU uses 0.25dBm */
510509
#define MAX_TX_PWR(label) DT_PROP(DT_NODELABEL(nrf70), label) * 4
511-
#endif /* CONFIG_NRF71_ON_IPC */
512510

513511
void configure_tx_pwr_settings(struct nrf_wifi_tx_pwr_ctrl_params *tx_pwr_ctrl_params,
514512
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)
587585
board_params->pcb_loss_5g_band3 = CONFIG_NRF70_PCB_LOSS_5G_BAND3;
588586
#endif /* CONFIG_NRF70_2_4G_ONLY */
589587
}
588+
#endif /* CONFIG_NRF71_ON_IPC */
590589

591590
enum nrf_wifi_status nrf_wifi_fmac_dev_add_zep(struct nrf_wifi_drv_priv_zep *drv_priv_zep)
592591
{
@@ -606,7 +605,6 @@ enum nrf_wifi_status nrf_wifi_fmac_dev_add_zep(struct nrf_wifi_drv_priv_zep *drv
606605
struct nrf_wifi_tx_pwr_ctrl_params tx_pwr_ctrl_params;
607606
struct nrf_wifi_tx_pwr_ceil_params tx_pwr_ceil_params;
608607
struct nrf_wifi_board_params board_params;
609-
610608
unsigned int fw_ver = 0;
611609

612610
#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
654652
NRF_WIFI_UMAC_VER_MIN(fw_ver),
655653
NRF_WIFI_UMAC_VER_EXTRA(fw_ver));
656654

655+
#ifndef CONFIG_NRF71_ON_IPC
657656
configure_tx_pwr_settings(&tx_pwr_ctrl_params,
658657
&tx_pwr_ceil_params);
659658

660659
configure_board_dep_params(&board_params);
660+
#endif /* CONFIG_NRF71_ON_IPC */
661661

662662
#if defined(CONFIG_NRF70_SR_COEX_SLEEP_CTRL_GPIO_CTRL) && \
663663
defined(CONFIG_NRF70_SYSTEM_MODE)
@@ -834,9 +834,14 @@ static int nrf_wifi_drv_main_zep(const struct device *dev)
834834
struct nrf_wifi_sys_fmac_priv *sys_fpriv = NULL;
835835

836836
sys_fpriv = wifi_fmac_priv(rpu_drv_priv_zep.fmac_priv);
837+
#ifdef CONFIG_NRF71_ON_IPC
838+
/* TODO: Revisit this */
839+
sys_fpriv->max_ampdu_len_per_token = 8192;
840+
#else
837841
sys_fpriv->max_ampdu_len_per_token =
838842
(RPU_PKTRAM_SIZE - (CONFIG_NRF70_RX_NUM_BUFS * CONFIG_NRF70_RX_MAX_DATA_SIZE)) /
839843
CONFIG_NRF70_MAX_TX_TOKENS;
844+
#endif /* CONFIG_NRF71_ON_IPC */
840845
/* Align to 4-byte */
841846
sys_fpriv->max_ampdu_len_per_token &= ~0x3;
842847

drivers/wifi/nrf_wifi/src/fw_load.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,33 @@
1717
LOG_MODULE_DECLARE(wifi_nrf, CONFIG_WIFI_NRF70_LOG_LEVEL);
1818

1919
#include <fmac_main.h>
20+
#ifndef CONFIG_NRF71_ON_IPC
2021
static const char fw_patch[] = {
2122
#include <nrf70_fw_patch/nrf70.bin.inc>
2223
};
24+
#endif /* CONFIG_NRF71_ON_IPC */
2325

2426
enum nrf_wifi_status nrf_wifi_fw_load(void *rpu_ctx)
2527
{
2628
enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL;
29+
30+
#ifndef CONFIG_NRF71_ON_IPC
2731
struct nrf_wifi_fmac_fw_info fw_info = { 0 };
2832

2933
status = nrf_wifi_fmac_fw_parse(rpu_ctx, fw_patch, sizeof(fw_patch), &fw_info);
3034
if (status != NRF_WIFI_STATUS_SUCCESS) {
3135
LOG_ERR("%s: nrf_wifi_fmac_fw_parse failed", __func__);
3236
return status;
3337
}
34-
#ifndef CONFIG_NRF71_ON_IPC
38+
3539
/* Load the FW patches to the RPU */
3640
status = nrf_wifi_fmac_fw_load(rpu_ctx, &fw_info);
3741

3842
if (status != NRF_WIFI_STATUS_SUCCESS) {
3943
LOG_ERR("%s: nrf_wifi_fmac_fw_load failed", __func__);
4044
}
45+
#else
46+
status = NRF_WIFI_STATUS_SUCCESS;
4147
#endif /* !CONFIG_NRF71_ON_IPC */
4248
return status;
4349
}

drivers/wifi/nrf_wifi/src/wifi_mgmt.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,8 +564,9 @@ int nrf_wifi_set_twt(const struct device *dev,
564564

565565
twt_info.dialog_token = twt_params->dialog_token;
566566
twt_info.twt_wake_ahead_duration = twt_params->setup.twt_wake_ahead_duration;
567+
#ifndef CONFIG_NRF71_ON_IPC
567568
twt_info.twt_req_timeout = CONFIG_NRF_WIFI_TWT_SETUP_TIMEOUT_MS;
568-
569+
#endif /* CONFIG_NRF71_ON_IPC */
569570
status = nrf_wifi_sys_fmac_twt_setup(rpu_ctx_zep->rpu_ctx,
570571
vif_ctx_zep->vif_idx,
571572
&twt_info);

drivers/wifi/nrf_wifi/src/wifi_util.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
* @brief NRF Wi-Fi util shell module
99
*/
1010
#include <stdlib.h>
11+
#ifdef NRF71_ON_IPC
12+
#include <nrf71_wifi_ctrl.h>
13+
#else
1114
#include "host_rpu_umac_if.h"
15+
#endif
1216
#include "common/fmac_util.h"
1317
#include "system/fmac_api.h"
1418
#include "fmac_main.h"

0 commit comments

Comments
 (0)