Skip to content

Commit 32393f8

Browse files
MaochenWang1dleach02
authored andcommitted
middleware: wifi_nxp: add wifi driver
Add wifi driver code. SHA: b39e5ea Signed-off-by: Maochen Wang <[email protected]>
1 parent 683c007 commit 32393f8

File tree

183 files changed

+156756
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

183 files changed

+156756
-0
lines changed
Lines changed: 310 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,310 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# Copyright 2022-2024 NXP
3+
4+
# define part number for this driver
5+
6+
zephyr_compile_definitions_ifdef(CONFIG_NXP_88W8987
7+
SD8987
8+
)
9+
10+
zephyr_compile_definitions_ifdef(CONFIG_NXP_IW416
11+
SD8978
12+
)
13+
14+
zephyr_compile_definitions_ifdef(CONFIG_NXP_IW61X
15+
SD9177
16+
)
17+
18+
zephyr_compile_definitions_ifdef(CONFIG_NXP_88W8801
19+
SD8801
20+
)
21+
22+
zephyr_compile_definitions_ifdef(CONFIG_NXP_RW610
23+
RW610
24+
WIFI_BT_TX_PWR_LIMITS="wlan_txpwrlimit_cfg_WW_rw610.h"
25+
)
26+
27+
zephyr_compile_definitions_ifdef(CONFIG_88W8987_AW_CM358_USD
28+
WIFI_BT_TX_PWR_LIMITS="wlan_txpwrlimit_cfg_WW.h"
29+
CONFIG_NXP_WIFI_ED_OFFSET_2G=0x09
30+
CONFIG_NXP_WIFI_ED_OFFSET_5G=0x0C
31+
WIFI_BT_USE_USD_INTERFACE
32+
)
33+
34+
zephyr_compile_definitions_ifdef(CONFIG_88W8987_AW_CM358MA_M2
35+
WIFI_BT_TX_PWR_LIMITS="wlan_txpwrlimit_cfg_WW.h"
36+
CONFIG_NXP_WIFI_ED_OFFSET_2G=0x09
37+
CONFIG_NXP_WIFI_ED_OFFSET_5G=0x0C
38+
WIFI_BT_USE_M2_INTERFACE
39+
)
40+
41+
zephyr_compile_definitions_ifdef(CONFIG_88W8987_MURATA_1ZM_USD
42+
WIFI_BT_TX_PWR_LIMITS="wlan_txpwrlimit_cfg_murata_1ZM_WW.h"
43+
CONFIG_NXP_WIFI_ED_OFFSET_2G=0x06
44+
CONFIG_NXP_WIFI_ED_OFFSET_5G=0x06
45+
WIFI_BT_USE_USD_INTERFACE
46+
)
47+
48+
zephyr_compile_definitions_ifdef(CONFIG_88W8987_MURATA_1ZM_M2
49+
WIFI_BT_TX_PWR_LIMITS="wlan_txpwrlimit_cfg_murata_1ZM_WW.h"
50+
CONFIG_NXP_WIFI_ED_OFFSET_2G=0x06
51+
CONFIG_NXP_WIFI_ED_OFFSET_5G=0x06
52+
WIFI_BT_USE_M2_INTERFACE
53+
)
54+
55+
zephyr_compile_definitions_ifdef(CONFIG_IW416_AW_AM457_USD
56+
WIFI_BT_TX_PWR_LIMITS="wlan_txpwrlimit_cfg_WW.h"
57+
CONFIG_NXP_WIFI_ED_OFFSET_2G=0x09
58+
CONFIG_NXP_WIFI_ED_OFFSET_5G=0x0C
59+
WIFI_BT_USE_USD_INTERFACE
60+
)
61+
62+
zephyr_compile_definitions_ifdef(CONFIG_IW416_AW_AM457MA_M2
63+
WIFI_BT_TX_PWR_LIMITS="wlan_txpwrlimit_cfg_WW.h"
64+
CONFIG_NXP_WIFI_ED_OFFSET_2G=0x09
65+
CONFIG_NXP_WIFI_ED_OFFSET_5G=0x0C
66+
WIFI_BT_USE_M2_INTERFACE
67+
)
68+
69+
zephyr_compile_definitions_ifdef(CONFIG_IW416_AW_AM510_USD
70+
WIFI_BT_TX_PWR_LIMITS="wlan_txpwrlimit_cfg_WW.h"
71+
CONFIG_NXP_WIFI_ED_OFFSET_2G=0x09
72+
CONFIG_NXP_WIFI_ED_OFFSET_5G=0x0C
73+
WIFI_BT_USE_USD_INTERFACE
74+
)
75+
76+
zephyr_compile_definitions_ifdef(CONFIG_IW416_AW_AM510MA_M2
77+
WIFI_BT_TX_PWR_LIMITS="wlan_txpwrlimit_cfg_murata_1XK_WW.h"
78+
CONFIG_NXP_WIFI_ED_OFFSET_2G=0x09
79+
CONFIG_NXP_WIFI_ED_OFFSET_5G=0x0C
80+
WIFI_BT_USE_M2_INTERFACE
81+
)
82+
83+
zephyr_compile_definitions_ifdef(CONFIG_IW416_MURATA_1XK_USD
84+
WIFI_BT_TX_PWR_LIMITS="wlan_txpwrlimit_cfg_murata_1XK_WW.h"
85+
CONFIG_NXP_WIFI_ED_OFFSET_2G=0x00
86+
CONFIG_NXP_WIFI_ED_OFFSET_5G=0x0C
87+
WIFI_BT_USE_USD_INTERFACE
88+
)
89+
90+
zephyr_compile_definitions_ifdef(CONFIG_IW416_MURATA_1XK_M2
91+
WIFI_BT_TX_PWR_LIMITS="wlan_txpwrlimit_cfg_murata_1XK_WW.h"
92+
CONFIG_NXP_WIFI_ED_OFFSET_2G=0x00
93+
CONFIG_NXP_WIFI_ED_OFFSET_5G=0x0C
94+
WIFI_BT_USE_M2_INTERFACE
95+
)
96+
97+
zephyr_compile_definitions_ifdef(CONFIG_IW612_MURATA_2EL_USD
98+
WIFI_BT_TX_PWR_LIMITS="wlan_txpwrlimit_cfg_murata_2EL_WW.h"
99+
CONFIG_NXP_WIFI_ED_OFFSET_2G=0x0A
100+
CONFIG_NXP_WIFI_ED_OFFSET_5G=0x0A
101+
WIFI_BT_USE_USD_INTERFACE
102+
)
103+
104+
zephyr_compile_definitions_ifdef(CONFIG_IW612_MURATA_2EL_M2
105+
WIFI_BT_TX_PWR_LIMITS="wlan_txpwrlimit_cfg_murata_2EL_WW.h"
106+
CONFIG_NXP_WIFI_ED_OFFSET_2G=0x0A
107+
CONFIG_NXP_WIFI_ED_OFFSET_5G=0x0A
108+
WIFI_BT_USE_M2_INTERFACE
109+
)
110+
111+
zephyr_compile_definitions_ifdef(CONFIG_IW611_MURATA_2DL_USD
112+
WIFI_BT_TX_PWR_LIMITS="wlan_txpwrlimit_cfg_murata_2EL_WW.h"
113+
CONFIG_NXP_WIFI_ED_OFFSET_2G=0x0A
114+
CONFIG_NXP_WIFI_ED_OFFSET_5G=0x0A
115+
WIFI_BT_USE_USD_INTERFACE
116+
)
117+
118+
zephyr_compile_definitions_ifdef(CONFIG_IW611_MURATA_2DL_M2
119+
WIFI_BT_TX_PWR_LIMITS="wlan_txpwrlimit_cfg_murata_2EL_WW.h"
120+
CONFIG_NXP_WIFI_ED_OFFSET_2G=0x0A
121+
CONFIG_NXP_WIFI_ED_OFFSET_5G=0x0A
122+
WIFI_BT_USE_M2_INTERFACE
123+
)
124+
125+
zephyr_compile_definitions_ifdef(CONFIG_88W8801_AW_NM191_USD
126+
WIFI_BT_TX_PWR_LIMITS="wlan_txpwrlimit_cfg_WW.h"
127+
CONFIG_NXP_WIFI_ED_OFFSET_2G=0x1B
128+
)
129+
130+
zephyr_compile_definitions_ifdef(CONFIG_88W8801_AW_NM191MA_M2
131+
WIFI_BT_TX_PWR_LIMITS="wlan_txpwrlimit_cfg_WW.h"
132+
CONFIG_NXP_WIFI_ED_OFFSET_2G=0x1B
133+
)
134+
135+
zephyr_compile_definitions_ifdef(CONFIG_88W8801_MURATA_2DS_USD
136+
WIFI_BT_TX_PWR_LIMITS="wlan_txpwrlimit_cfg_murata_2DS_WW.h"
137+
CONFIG_NXP_WIFI_ED_OFFSET_2G=0x0E
138+
)
139+
140+
zephyr_compile_definitions_ifdef(CONFIG_88W8801_MURATA_2DS_M2
141+
WIFI_BT_TX_PWR_LIMITS="wlan_txpwrlimit_cfg_murata_2DS_WW.h"
142+
CONFIG_NXP_WIFI_ED_OFFSET_2G=0x0E
143+
)
144+
145+
zephyr_compile_definitions_ifdef(CONFIG_NXP_WIFI_BT_USE_USD_INTERFACE
146+
WIFI_BT_USE_USD_INTERFACE
147+
)
148+
149+
zephyr_compile_definitions_ifdef(CONFIG_NXP_WIFI_BT_USE_M2_INTERFACE
150+
WIFI_BT_USE_M2_INTERFACE
151+
)
152+
153+
zephyr_library_compile_definitions(
154+
FSL_OSA_TASK_ENABLE=1
155+
CONFIG_FSL_RTOS_ZEPHYR=1
156+
CONFIG_OSA_DEBUG_ASSERT_ENABLED=1
157+
)
158+
159+
zephyr_library_sources(${ZEPHYR_HAL_NXP_MODULE_DIR}/mcux/mcux-sdk/utilities/misc_utilities/fsl_memcpy.S)
160+
161+
zephyr_library_sources(${ZEPHYR_HAL_NXP_MODULE_DIR}/mcux/mcux-sdk/components/lists/fsl_component_generic_list.c)
162+
163+
zephyr_library_sources(${ZEPHYR_HAL_NXP_MODULE_DIR}/mcux/mcux-sdk/components/osa/fsl_os_abstraction_zephyr.c)
164+
165+
zephyr_include_directories(
166+
incl
167+
incl/wifidriver
168+
incl/wlcmgr
169+
incl/port/osa
170+
incl/port/net/zephyr
171+
port/osa
172+
port/net/zephyr
173+
sdio_nxp_abs/incl
174+
firmware_dnld
175+
fwdnld_intf_abs
176+
wifidriver
177+
wifidriver/incl
178+
wifi_bt_firmware
179+
wifi_bt_firmware/8987
180+
wifi_bt_firmware/IW416
181+
wifi_bt_firmware/nw61x
182+
wifi_bt_firmware/8801
183+
cli
184+
${ZEPHYR_HAL_NXP_MODULE_DIR}/mcux/mcux-sdk/components/osa/
185+
${ZEPHYR_HAL_NXP_MODULE_DIR}/mcux/mcux-sdk/components/lists/
186+
${ZEPHYR_HAL_NXP_MODULE_DIR}/mcux/mcux-sdk/components/wifi_bt_module/AzureWave/tx_pwr_limits/
187+
${ZEPHYR_HAL_NXP_MODULE_DIR}/mcux/mcux-sdk/components/wifi_bt_module/Murata/tx_pwr_limits/
188+
${ZEPHYR_HAL_NXP_MODULE_DIR}/mcux/mcux-sdk/components/rpmsg/
189+
)
190+
191+
# OS abstraction layer source
192+
zephyr_library_sources(
193+
port/osa/osa.c
194+
port/osa/osa_zephyr.c
195+
)
196+
# net stack abstraction layer source
197+
zephyr_library_sources(port/net/zephyr/net.c)
198+
199+
file(GLOB WIFI_SRC ./wifidriver/*.c)
200+
list(FILTER WIFI_SRC EXCLUDE REGEX ".*imu.c$")
201+
list(FILTER WIFI_SRC EXCLUDE REGEX ".*sdio.c$")
202+
list(FILTER WIFI_SRC EXCLUDE REGEX ".*firmware_dnld.c$")
203+
204+
zephyr_library_sources_ifdef(CONFIG_NXP_RW610
205+
wifidriver/wifi-imu.c
206+
)
207+
208+
zephyr_library_sources_ifdef(CONFIG_SDIO_STACK
209+
wifidriver/sdio.c
210+
sdio_nxp_abs/fwdnld_sdio.c
211+
sdio_nxp_abs/mlan_sdio.c
212+
wifidriver/wifi-sdio.c
213+
firmware_dnld/firmware_dnld.c
214+
fwdnld_intf_abs/fwdnld_intf_abs.c
215+
)
216+
217+
zephyr_library_sources(${WIFI_SRC})
218+
219+
file(GLOB WLCMGR_SRC ./wlcmgr/*.c)
220+
221+
zephyr_library_sources(${WLCMGR_SRC})
222+
223+
# nxp wifi shell
224+
zephyr_library_sources(cli/wifi_shell.c)
225+
zephyr_library_sources(cli/cli_utils.c)
226+
227+
# macros for wpa_supplicant
228+
if(CONFIG_WIFI_NM_WPA_SUPPLICANT)
229+
zephyr_include_directories(
230+
certs
231+
wifidriver/wpa_supp_if/incl
232+
)
233+
234+
zephyr_library_include_directories(wifidriver/wpa_supp_if wifidriver/wpa_supp_if/incl)
235+
file(GLOB WIFI_SUPP_SRC ./wifidriver/wpa_supp_if/*.c)
236+
zephyr_library_sources(${WIFI_SUPP_SRC})
237+
endif()
238+
239+
zephyr_include_directories_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ALT
240+
incl/port/mbedtls
241+
)
242+
243+
zephyr_library_compile_definitions_ifdef(CONFIG_WIFI_NM_HOSTAPD_AP
244+
HOSTAPD
245+
)
246+
247+
if(CONFIG_CODE_DATA_RELOCATION)
248+
if(CONFIG_SPEED_OPTIMIZATIONS OR CONFIG_SIZE_OPTIMIZATIONS)
249+
# critical path code relocated to SRAM
250+
zephyr_code_relocate(FILES
251+
port/osa/osa.c
252+
port/osa/osa_zephyr.c
253+
port/net/zephyr/net.c
254+
wifidriver/mlan_11n.c
255+
wifidriver/mlan_11n_aggr.c
256+
wifidriver/mlan_11n_rxreorder.c
257+
wifidriver/mlan_wmm.c
258+
wifidriver/wifi.c
259+
LOCATION RAM_TEXT)
260+
261+
if(CONFIG_SDIO_STACK)
262+
zephyr_code_relocate(FILES
263+
sdio_nxp_abs/mlan_sdio.c
264+
wifidriver/wifi-sdio.c
265+
LOCATION RAM_TEXT)
266+
endif()
267+
268+
if(CONFIG_NXP_RW610)
269+
zephyr_code_relocate(FILES
270+
wifidriver/wifi-imu.c
271+
${ZEPHYR_HAL_NXP_MODULE_DIR}/mcux/mcux-sdk/drivers/imu/fsl_imu.c
272+
${ZEPHYR_HAL_NXP_MODULE_DIR}/mcux/mcux-sdk/components/rpmsg/fsl_adapter_rfimu.c
273+
LOCATION RAM_TEXT)
274+
endif()
275+
276+
zephyr_code_relocate(FILES
277+
${ZEPHYR_HAL_NXP_MODULE_DIR}/mcux/mcux-sdk/components/osa/fsl_os_abstraction_zephyr.c
278+
${ZEPHYR_HAL_NXP_MODULE_DIR}/mcux/mcux-sdk/utilities/misc_utilities/fsl_memcpy.S
279+
LOCATION RAM_TEXT)
280+
281+
file(GLOB ZPERF_SRC ${ZEPHYR_BASE}/subsys/net/lib/zperf/*.c)
282+
zephyr_code_relocate(FILES ${ZPERF_SRC} LOCATION RAM_TEXT)
283+
284+
file(GLOB SOCKET_SRC ${ZEPHYR_BASE}/subsys/net/lib/sockets/*.c)
285+
zephyr_code_relocate(FILES ${SOCKET_SRC} LOCATION RAM_TEXT)
286+
287+
file(GLOB NET_SRC ${ZEPHYR_BASE}/subsys/net/ip/*.c)
288+
zephyr_code_relocate(FILES ${NET_SRC} LOCATION RAM_TEXT)
289+
290+
file(GLOB ETH_SRC ${ZEPHYR_BASE}/subsys/net/l2/ethernet/*.c)
291+
zephyr_code_relocate(FILES ${ETH_SRC} LOCATION RAM_TEXT)
292+
293+
zephyr_code_relocate(FILES ${ZEPHYR_BASE}/lib/net_buf/buf.c LOCATION RAM_TEXT)
294+
295+
zephyr_code_relocate(FILES
296+
${ZEPHYR_BASE}/kernel/mem_slab.c
297+
${ZEPHYR_BASE}/kernel/mempool.c
298+
${ZEPHYR_BASE}/kernel/msg_q.c
299+
${ZEPHYR_BASE}/kernel/mutex.c
300+
${ZEPHYR_BASE}/kernel/queue.c
301+
${ZEPHYR_BASE}/kernel/sched.c
302+
${ZEPHYR_BASE}/kernel/sem.c
303+
${ZEPHYR_BASE}/kernel/thread.c
304+
${ZEPHYR_BASE}/kernel/work.c
305+
LOCATION RAM_TEXT)
306+
endif()
307+
endif()
308+
309+
zephyr_library_link_libraries_ifdef(CONFIG_MBEDTLS mbedTLS)
310+
zephyr_library_link_libraries_ifdef(CONFIG_WIFI_NM_WPA_SUPPLICANT hostap)

mcux/middleware/wifi_nxp/README.txt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Please start by looking at the documentation under
2+
doxy/refman/.
3+
4+
/* Doxygen related documentation */
5+
/**
6+
* \mainpage
7+
*
8+
* \section intro Introduction
9+
*
10+
* NXP's WiFi functionality enables customers to
11+
* quickly develop applications of interest to add connectivity to
12+
* different sensors and appliances.
13+
*
14+
* \subsection devdoc Developer Documentation
15+
*
16+
* This manual provides developer reference documentation for WiFi driver and
17+
* WLAN Connection Manager.
18+
*
19+
* In addition to the reference documentation in this manual, you can
20+
* also explore the source code.
21+
*
22+
* \note
23+
* The File Documentation provides documentation for all the APIs that are
24+
* available in WiFi driver and connection manager.
25+
*
26+
*/
27+
28+
29+
30+

0 commit comments

Comments
 (0)