Skip to content

Commit ffa8042

Browse files
committed
nrf_wifi: Add as a standlone library
Add cmake and kconfig files to make this module as a standlone library. Signed-off-by: Chaitanya Tata <[email protected]>
1 parent 37e2ac2 commit ffa8042

File tree

6 files changed

+183
-0
lines changed

6 files changed

+183
-0
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ add_subdirectory_ifdef(CONFIG_GZLL gzll)
2222
add_subdirectory_ifdef(CONFIG_NRF_DM nrf_dm)
2323
add_subdirectory_ifdef(CONFIG_NRF_FUEL_GAUGE nrf_fuel_gauge)
2424
add_subdirectory_ifdef(CONFIG_SW_CODEC_LC3_T2_SOFTWARE lc3)
25+
add_subdirectory_ifdef(CONFIG_NRF_WIFI nrf_wifi)

Kconfig.nrfxlib

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ rsource "gzll/Kconfig"
1818
rsource "nrf_dm/Kconfig"
1919
rsource "lc3/Kconfig"
2020
rsource "nrf_fuel_gauge/Kconfig"
21+
rsource "nrf_wifi/Kconfig"
2122

2223
endmenu

nrf_wifi/CMakeLists.txt

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
#
2+
# Copyright (c) 2024 Nordic Semiconductor
3+
#
4+
# SPDX-License-Identifier: BSD-3-Clause
5+
#
6+
7+
# Enable debug info by default
8+
# Set the CPU architecture to armv8-m.main (Cortex-M33), default is armv4t
9+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -mcpu=cortex-m33 -mthumb")
10+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -mcpu=cortex-m33 -mthumb")
11+
12+
add_library(nrf-wifi STATIC)
13+
14+
set(NRF_WIFI_DIR ${CMAKE_CURRENT_SOURCE_DIR})
15+
16+
target_include_directories(
17+
nrf-wifi
18+
PUBLIC
19+
${NRF_WIFI_DIR}/utils/inc
20+
${NRF_WIFI_DIR}/os_if/inc
21+
${NRF_WIFI_DIR}/bus_if/bus/qspi/inc
22+
${NRF_WIFI_DIR}/bus_if/bal/inc
23+
${NRF_WIFI_DIR}/fw_if/umac_if/inc
24+
${NRF_WIFI_DIR}/fw_load/mips/fw/inc
25+
${NRF_WIFI_DIR}/hw_if/hal/inc
26+
${NRF_WIFI_DIR}/hw_if/hal/inc/fw
27+
${NRF_WIFI_DIR}/fw_if/umac_if/inc/fw
28+
)
29+
30+
target_include_directories_ifdef(CONFIG_NRF700X_RADIO_TEST
31+
nrf-wifi
32+
PUBLIC
33+
${NRF_WIFI_DIR}/fw_if/umac_if/inc/radio_test
34+
)
35+
36+
target_include_directories_ifndef(CONFIG_NRF700X_RADIO_TEST
37+
nrf-wifi
38+
PUBLIC
39+
${NRF_WIFI_DIR}/fw_if/umac_if/inc/default
40+
)
41+
42+
target_sources(
43+
nrf-wifi
44+
PRIVATE
45+
${NRF_WIFI_DIR}/os_if/src/osal.c
46+
${NRF_WIFI_DIR}/utils/src/list.c
47+
${NRF_WIFI_DIR}/utils/src/queue.c
48+
${NRF_WIFI_DIR}/utils/src/util.c
49+
${NRF_WIFI_DIR}/hw_if/hal/src/hal_api.c
50+
${NRF_WIFI_DIR}/hw_if/hal/src/hal_fw_patch_loader.c
51+
${NRF_WIFI_DIR}/hw_if/hal/src/hal_interrupt.c
52+
${NRF_WIFI_DIR}/hw_if/hal/src/hal_mem.c
53+
${NRF_WIFI_DIR}/hw_if/hal/src/hal_reg.c
54+
${NRF_WIFI_DIR}/hw_if/hal/src/hpqm.c
55+
${NRF_WIFI_DIR}/hw_if/hal/src/pal.c
56+
${NRF_WIFI_DIR}/bus_if/bal/src/bal.c
57+
${NRF_WIFI_DIR}/bus_if/bus/qspi/src/qspi.c
58+
${NRF_WIFI_DIR}/fw_if/umac_if/src/cmd.c
59+
${NRF_WIFI_DIR}/fw_if/umac_if/src/event.c
60+
${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_api_common.c
61+
)
62+
63+
target_sources_ifndef(CONFIG_NRF700X_RADIO_TEST
64+
nrf-wifi
65+
PRIVATE
66+
${NRF_WIFI_DIR}/fw_if/umac_if/src/rx.c
67+
${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_vif.c
68+
${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_util.c
69+
${NRF_WIFI_DIR}/fw_if/umac_if/src/default/fmac_api.c
70+
)
71+
72+
target_sources_ifdef(CONFIG_NRF700X_RADIO_TEST
73+
nrf-wifi
74+
PRIVATE
75+
${NRF_WIFI_DIR}/fw_if/umac_if/src/radio_test/fmac_api.c
76+
${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_util.c
77+
)
78+
79+
target_sources_ifdef(CONFIG_NRF700X_DATA_TX
80+
nrf-wifi
81+
PRIVATE
82+
${NRF_WIFI_DIR}/fw_if/umac_if/src/tx.c
83+
${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_peer.c
84+
)
85+
86+
target_sources_ifdef(CONFIG_NRF700X_STA_MODE
87+
nrf-wifi
88+
PRIVATE
89+
${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_peer.c
90+
${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_util.c
91+
)
92+
93+
target_sources_ifdef(CONFIG_NRF700X_AP_MODE
94+
nrf-wifi
95+
PRIVATE
96+
${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_ap.c
97+
)
98+
99+
# Without WPA supplicant we only support scan
100+
target_sources_ifdef(CONFIG_NRF700X_STA_MODE
101+
nrf-wifi
102+
PRIVATE
103+
${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_peer.c
104+
${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_util.c
105+
)
106+
107+
target_compile_definitions(
108+
nrf-wifi
109+
PRIVATE
110+
-DCONFIG_NRF700X_LOG_VERBOSE=${CONFIG_NRF700X_LOG_VERBOSE}
111+
-DCONFIG_NRF700X_SCAN_ONLY=y
112+
-DCONFIG_WIFI_NRF700X_LOG_LEVEL=${CONFIG_WIFI_NRF700X_SHIM_LOG_LEVEL}
113+
-DCONFIG_NRF700X_MAX_TX_TOKENS=10
114+
-DCONFIG_NRF700X_MAX_TX_AGGREGATION=12
115+
-DCONFIG_NRF700X_RX_NUM_BUFS=63
116+
-DCONFIG_NRF700X_RX_MAX_DATA_SIZE=1600
117+
-DCONFIG_WIFI_MGMT_RAW_SCAN_RESULTS
118+
-DCONFIG_NRF700X_ANT_GAIN_2G=0
119+
-DCONFIG_NRF700X_ANT_GAIN_5G_BAND1=0
120+
-DCONFIG_NRF700X_ANT_GAIN_5G_BAND2=0
121+
-DCONFIG_NRF700X_ANT_GAIN_5G_BAND3=0
122+
-DCONFIG_NRF700X_BAND_2G_LOWER_EDGE_BACKOFF_DSSS=0
123+
-DCONFIG_NRF700X_BAND_2G_LOWER_EDGE_BACKOFF_HT=0
124+
-DCONFIG_NRF700X_BAND_2G_LOWER_EDGE_BACKOFF_HE=0
125+
-DCONFIG_NRF700X_BAND_2G_UPPER_EDGE_BACKOFF_DSSS=0
126+
-DCONFIG_NRF700X_BAND_2G_UPPER_EDGE_BACKOFF_HT=0
127+
-DCONFIG_NRF700X_BAND_2G_UPPER_EDGE_BACKOFF_HE=0
128+
-DCONFIG_NRF700X_BAND_UNII_1_LOWER_EDGE_BACKOFF_HT=0
129+
-DCONFIG_NRF700X_BAND_UNII_1_LOWER_EDGE_BACKOFF_HE=0
130+
-DCONFIG_NRF700X_BAND_UNII_1_UPPER_EDGE_BACKOFF_HT=0
131+
-DCONFIG_NRF700X_BAND_UNII_1_UPPER_EDGE_BACKOFF_HE=0
132+
-DCONFIG_NRF700X_BAND_UNII_2A_LOWER_EDGE_BACKOFF_HT=0
133+
-DCONFIG_NRF700X_BAND_UNII_2A_LOWER_EDGE_BACKOFF_HE=0
134+
-DCONFIG_NRF700X_BAND_UNII_2A_UPPER_EDGE_BACKOFF_HT=0
135+
-DCONFIG_NRF700X_BAND_UNII_2A_UPPER_EDGE_BACKOFF_HE=0
136+
-DCONFIG_NRF700X_BAND_UNII_2C_LOWER_EDGE_BACKOFF_HT=0
137+
-DCONFIG_NRF700X_BAND_UNII_2C_LOWER_EDGE_BACKOFF_HE=0
138+
-DCONFIG_NRF700X_BAND_UNII_2C_UPPER_EDGE_BACKOFF_HT=0
139+
-DCONFIG_NRF700X_BAND_UNII_2C_UPPER_EDGE_BACKOFF_HE=0
140+
-DCONFIG_NRF700X_BAND_UNII_3_LOWER_EDGE_BACKOFF_HT=0
141+
-DCONFIG_NRF700X_BAND_UNII_3_LOWER_EDGE_BACKOFF_HE=0
142+
-DCONFIG_NRF700X_BAND_UNII_3_UPPER_EDGE_BACKOFF_HT=0
143+
-DCONFIG_NRF700X_BAND_UNII_3_UPPER_EDGE_BACKOFF_HE=0
144+
-DCONFIG_NRF700X_BAND_UNII_4_LOWER_EDGE_BACKOFF_HT=0
145+
-DCONFIG_NRF700X_BAND_UNII_4_LOWER_EDGE_BACKOFF_HE=0
146+
-DCONFIG_NRF700X_BAND_UNII_4_UPPER_EDGE_BACKOFF_HT=0
147+
-DCONFIG_NRF700X_BAND_UNII_4_UPPER_EDGE_BACKOFF_HE=0
148+
-DCONFIG_NRF700X_REG_DOMAIN="00"
149+
-DCONFIG_NRF700X_TX_MAX_DATA_SIZE=1600
150+
-DCONFIG_NRF_WIFI_IFACE_MTU=1500
151+
-DCONFIG_NRF700X_MAX_TX_PENDING_QLEN=48
152+
-DCONFIG_NRF700X_RPU_PS_IDLE_TIMEOUT_MS=10
153+
-DCONFIG_NRF700X_PCB_LOSS_2G=0
154+
-DCONFIG_NRF700X_PCB_LOSS_5G_BAND1=0
155+
-DCONFIG_NRF700X_PCB_LOSS_5G_BAND2=0
156+
-DCONFIG_NRF700X_PCB_LOSS_5G_BAND3=0
157+
-DCONFIG_NRF_WIFI_AP_DEAD_DETECT_TIMEOUT=20
158+
)

nrf_wifi/Kconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#
2+
# Copyright (c) 2024 Nordic Semiconductor
3+
#
4+
# SPDX-License-Identifier: BSD-3-Clause
5+
#
6+
menu "Nordic nRF70 Wi-Fi configuration"
7+
8+
config NRF_WIFI
9+
bool "Enable nRF70 OS agnostic library"
10+
help
11+
Enable the nRF70 OS agnostic library.
12+
endmenu

nrf_wifi/hw_if/hal/inc/fw/pack_def.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@
1515
#include <zephyr/toolchain.h>
1616
#elif __KERNEL__
1717
#include <linux/compiler_attributes.h>
18+
#else
19+
#ifndef __packed
20+
#define __packed __attribute__((packed))
21+
#endif
22+
#ifndef __aligned
23+
#define __aligned(x) __attribute__((aligned(x)))
24+
#endif
1825
#endif
1926

2027
#define __NRF_WIFI_PKD __packed

nrf_wifi/os_if/inc/osal_structs.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
#include <linux/stddef.h>
2222
#include <linux/string.h>
2323
#include <linux/stdarg.h>
24+
#else
25+
#include <stddef.h>
26+
#include <stdbool.h>
27+
#include <stdarg.h>
2428
#endif
2529

2630
/**

0 commit comments

Comments
 (0)