diff --git a/MAINTAINERS.yml b/MAINTAINERS.yml index a77bbf643c0..fdc0a25a5f1 100644 --- a/MAINTAINERS.yml +++ b/MAINTAINERS.yml @@ -2185,7 +2185,7 @@ Release Notes: collaborators: - sachinthegreen files: - - drivers/wifi/nrfwifi/ + - drivers/wifi/nrf_wifi/ - dts/bindings/wifi/nordic,nrf70.yaml - dts/bindings/wifi/nordic,nrf70-qspi.yaml - dts/bindings/wifi/nordic,nrf70-spi.yaml @@ -4980,6 +4980,16 @@ West: labels: - "area: native port" +"West project: nrf_wifi": + status: maintained + maintainers: + - krish2718 + - sachinthegreen + files: + - modules/nrf_wifi/ + labels: + - "area: Wi-Fi" + "West project: open-amp": status: odd fixes collaborators: diff --git a/drivers/wifi/CMakeLists.txt b/drivers/wifi/CMakeLists.txt index bd175b8e28f..c71e161d710 100644 --- a/drivers/wifi/CMakeLists.txt +++ b/drivers/wifi/CMakeLists.txt @@ -10,4 +10,4 @@ add_subdirectory_ifdef(CONFIG_WIFI_SIMPLELINK simplelink) add_subdirectory_ifdef(CONFIG_WIFI_WINC1500 winc1500) add_subdirectory_ifdef(CONFIG_WIFI_NXP nxp) add_subdirectory_ifdef(CONFIG_WIFI_AIROC infineon) -add_subdirectory_ifdef(CONFIG_WIFI_NRF70 nrfwifi) +add_subdirectory_ifdef(CONFIG_WIFI_NRF70 nrf_wifi) diff --git a/drivers/wifi/Kconfig b/drivers/wifi/Kconfig index 7ad7b530c74..55b2a943ff2 100644 --- a/drivers/wifi/Kconfig +++ b/drivers/wifi/Kconfig @@ -42,6 +42,6 @@ source "drivers/wifi/esp_at/Kconfig.esp_at" source "drivers/wifi/esp32/Kconfig.esp32" source "drivers/wifi/nxp/Kconfig.nxp" source "drivers/wifi/infineon/Kconfig.airoc" -source "drivers/wifi/nrfwifi/Kconfig.nrfwifi" +source "drivers/wifi/nrf_wifi/Kconfig.nrfwifi" endif # WIFI diff --git a/drivers/wifi/nrf_wifi/CMakeLists.txt b/drivers/wifi/nrf_wifi/CMakeLists.txt new file mode 100644 index 00000000000..e631e930e07 --- /dev/null +++ b/drivers/wifi/nrf_wifi/CMakeLists.txt @@ -0,0 +1,124 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# + +zephyr_library_named(nrf_wifi) + +set(OS_AGNOSTIC_BASE ${ZEPHYR_NRF_WIFI_MODULE_DIR}) +set(FW_BINS_BASE ${ZEPHYR_NRF_WIFI_MODULE_DIR}/zephyr/blobs/wifi_fw_bins) + +zephyr_include_directories( + inc + src/qspi/inc + # for net_sprint_ll_addr + ${ZEPHYR_BASE}/subsys/net/ip +) + +zephyr_include_directories_ifdef(CONFIG_NRF70_OFFLOADED_RAW_TX + off_raw_tx/inc +) + +zephyr_library_sources_ifdef(CONFIG_NRF70_SR_COEX + src/coex.c +) + +zephyr_library_sources( + src/qspi/src/device.c + src/qspi/src/rpu_hw_if.c + src/qspi/src/ficr_prog.c +) + +zephyr_library_sources_ifndef(CONFIG_NRF70_OFFLOADED_RAW_TX + src/fmac_main.c +) + +zephyr_library_sources_ifdef(CONFIG_NRF_WIFI_PATCHES_BUILTIN + src/fw_load.c +) + +if(NOT CONFIG_NRF70_RADIO_TEST AND NOT CONFIG_NRF70_OFFLOADED_RAW_TX) + zephyr_library_sources( + src/net_if.c +) +endif() + +zephyr_library_sources_ifdef(CONFIG_NET_L2_WIFI_MGMT + src/wifi_mgmt_scan.c +) + +zephyr_library_sources_ifdef(CONFIG_NRF70_SYSTEM_MODE_COMMON + src/wifi_mgmt.c +) + +zephyr_library_sources_ifdef(CONFIG_NRF70_OFFLOADED_RAW_TX + off_raw_tx/src/off_raw_tx_api.c +) + +zephyr_library_sources_ifdef(CONFIG_NRF70_STA_MODE + src/wpa_supp_if.c + src/wifi_mgmt.c +) + +# Without WPA supplicant we only support scan +zephyr_library_sources_ifdef(CONFIG_NRF70_STA_MODE + src/wpa_supp_if.c) + +zephyr_library_sources_ifdef(CONFIG_NRF70_ON_QSPI + src/qspi/src/qspi_if.c +) + +zephyr_library_sources_ifdef(CONFIG_NRF70_ON_SPI + src/qspi/src/spi_if.c +) + +zephyr_library_sources_ifdef(CONFIG_NRF70_UTIL + src/wifi_util.c +) + +zephyr_compile_definitions_ifdef(CONFIG_NRF70_ON_QSPI +# These are XIP related anomalies and aren't applicable for nRF7002 and cause +# throughput issues. + -DNRF53_ERRATA_43_ENABLE_WORKAROUND=0 + -DNRF52_ERRATA_215_ENABLE_WORKAROUND=0 +# nRF70 QSPI doesn't use 192MHz clock and most samples use 128MHz, this can cause anomaly 159 +# but as its rare and not seen in most cases, we can disable it. +# Alternative is 128MHz CPU should be disabled that impacts Wi-Fi performance. + -DNRF53_ERRATA_159_ENABLE_WORKAROUND=0 +) + +if (CONFIG_NRF_WIFI_BUILD_ONLY_MODE) + message(WARNING " + ------------------------------------------------------------------------ + Building only the nRF70 driver, skipping firmware patch. + This is only for building (CI) purposes and will not work on a real device. + ------------------------------------------------------------------------ + ") +elseif(CONFIG_NRF_WIFI_PATCHES_BUILTIN) + zephyr_blobs_verify(MODULE nrf_wifi REQUIRED) + # RPU FW patch binaries based on the selected configuration + if(CONFIG_NRF70_SYSTEM_MODE) + set(NRF70_PATCH ${FW_BINS_BASE}/default/nrf70.bin) + elseif(CONFIG_NRF70_RADIO_TEST) + set(NRF70_PATCH ${FW_BINS_BASE}/radio_test/nrf70.bin) + elseif(CONFIG_NRF70_SCAN_ONLY) + set(NRF70_PATCH ${FW_BINS_BASE}/scan_only/nrf70.bin) + elseif (CONFIG_NRF70_SYSTEM_WITH_RAW_MODES) + set(NRF70_PATCH ${FW_BINS_BASE}/system_with_raw/nrf70.bin) + elseif(CONFIG_NRF70_OFFLOADED_RAW_TX) + set(NRF70_PATCH ${FW_BINS_BASE}/offloaded_raw_tx/nrf70.bin) + else() + # Error + message(FATAL_ERROR "Unsupported nRF70 patch configuration") + endif() + + set(gen_inc_dir ${ZEPHYR_BINARY_DIR}/misc/generated) + zephyr_include_directories(${gen_inc_dir}) + set(gen_dir ${gen_inc_dir}/nrf70_fw_patch) + generate_inc_file_for_target( + nrf_wifi + ${NRF70_PATCH} + ${gen_dir}/nrf70.bin.inc + ) +endif() diff --git a/drivers/wifi/nrfwifi/Kconfig.nrfwifi b/drivers/wifi/nrf_wifi/Kconfig.nrfwifi similarity index 100% rename from drivers/wifi/nrfwifi/Kconfig.nrfwifi rename to drivers/wifi/nrf_wifi/Kconfig.nrfwifi diff --git a/drivers/wifi/nrfwifi/inc/coex.h b/drivers/wifi/nrf_wifi/inc/coex.h similarity index 100% rename from drivers/wifi/nrfwifi/inc/coex.h rename to drivers/wifi/nrf_wifi/inc/coex.h diff --git a/drivers/wifi/nrfwifi/inc/coex_struct.h b/drivers/wifi/nrf_wifi/inc/coex_struct.h similarity index 100% rename from drivers/wifi/nrfwifi/inc/coex_struct.h rename to drivers/wifi/nrf_wifi/inc/coex_struct.h diff --git a/drivers/wifi/nrfwifi/inc/fmac_main.h b/drivers/wifi/nrf_wifi/inc/fmac_main.h similarity index 100% rename from drivers/wifi/nrfwifi/inc/fmac_main.h rename to drivers/wifi/nrf_wifi/inc/fmac_main.h diff --git a/drivers/wifi/nrfwifi/inc/net_if.h b/drivers/wifi/nrf_wifi/inc/net_if.h similarity index 100% rename from drivers/wifi/nrfwifi/inc/net_if.h rename to drivers/wifi/nrf_wifi/inc/net_if.h diff --git a/drivers/wifi/nrfwifi/inc/wifi_mgmt.h b/drivers/wifi/nrf_wifi/inc/wifi_mgmt.h similarity index 100% rename from drivers/wifi/nrfwifi/inc/wifi_mgmt.h rename to drivers/wifi/nrf_wifi/inc/wifi_mgmt.h diff --git a/drivers/wifi/nrfwifi/inc/wifi_mgmt_scan.h b/drivers/wifi/nrf_wifi/inc/wifi_mgmt_scan.h similarity index 100% rename from drivers/wifi/nrfwifi/inc/wifi_mgmt_scan.h rename to drivers/wifi/nrf_wifi/inc/wifi_mgmt_scan.h diff --git a/drivers/wifi/nrfwifi/inc/wpa_supp_if.h b/drivers/wifi/nrf_wifi/inc/wpa_supp_if.h similarity index 100% rename from drivers/wifi/nrfwifi/inc/wpa_supp_if.h rename to drivers/wifi/nrf_wifi/inc/wpa_supp_if.h diff --git a/drivers/wifi/nrfwifi/off_raw_tx/inc/off_raw_tx.h b/drivers/wifi/nrf_wifi/off_raw_tx/inc/off_raw_tx.h similarity index 100% rename from drivers/wifi/nrfwifi/off_raw_tx/inc/off_raw_tx.h rename to drivers/wifi/nrf_wifi/off_raw_tx/inc/off_raw_tx.h diff --git a/drivers/wifi/nrfwifi/off_raw_tx/src/off_raw_tx_api.c b/drivers/wifi/nrf_wifi/off_raw_tx/src/off_raw_tx_api.c similarity index 99% rename from drivers/wifi/nrfwifi/off_raw_tx/src/off_raw_tx_api.c rename to drivers/wifi/nrf_wifi/off_raw_tx/src/off_raw_tx_api.c index 155c8a5cd5e..b714b902eeb 100644 --- a/drivers/wifi/nrfwifi/off_raw_tx/src/off_raw_tx_api.c +++ b/drivers/wifi/nrf_wifi/off_raw_tx/src/off_raw_tx_api.c @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/wifi/nrfwifi/src/coex.c b/drivers/wifi/nrf_wifi/src/coex.c similarity index 100% rename from drivers/wifi/nrfwifi/src/coex.c rename to drivers/wifi/nrf_wifi/src/coex.c diff --git a/drivers/wifi/nrfwifi/src/fmac_main.c b/drivers/wifi/nrf_wifi/src/fmac_main.c similarity index 100% rename from drivers/wifi/nrfwifi/src/fmac_main.c rename to drivers/wifi/nrf_wifi/src/fmac_main.c diff --git a/drivers/wifi/nrfwifi/src/fw_load.c b/drivers/wifi/nrf_wifi/src/fw_load.c similarity index 100% rename from drivers/wifi/nrfwifi/src/fw_load.c rename to drivers/wifi/nrf_wifi/src/fw_load.c diff --git a/drivers/wifi/nrfwifi/src/net_if.c b/drivers/wifi/nrf_wifi/src/net_if.c similarity index 100% rename from drivers/wifi/nrfwifi/src/net_if.c rename to drivers/wifi/nrf_wifi/src/net_if.c diff --git a/drivers/wifi/nrfwifi/src/qspi/inc/ficr_prog.h b/drivers/wifi/nrf_wifi/src/qspi/inc/ficr_prog.h similarity index 100% rename from drivers/wifi/nrfwifi/src/qspi/inc/ficr_prog.h rename to drivers/wifi/nrf_wifi/src/qspi/inc/ficr_prog.h diff --git a/drivers/wifi/nrfwifi/src/qspi/inc/qspi_if.h b/drivers/wifi/nrf_wifi/src/qspi/inc/qspi_if.h similarity index 100% rename from drivers/wifi/nrfwifi/src/qspi/inc/qspi_if.h rename to drivers/wifi/nrf_wifi/src/qspi/inc/qspi_if.h diff --git a/drivers/wifi/nrfwifi/src/qspi/inc/rpu_hw_if.h b/drivers/wifi/nrf_wifi/src/qspi/inc/rpu_hw_if.h similarity index 100% rename from drivers/wifi/nrfwifi/src/qspi/inc/rpu_hw_if.h rename to drivers/wifi/nrf_wifi/src/qspi/inc/rpu_hw_if.h diff --git a/drivers/wifi/nrfwifi/src/qspi/inc/spi_if.h b/drivers/wifi/nrf_wifi/src/qspi/inc/spi_if.h similarity index 100% rename from drivers/wifi/nrfwifi/src/qspi/inc/spi_if.h rename to drivers/wifi/nrf_wifi/src/qspi/inc/spi_if.h diff --git a/drivers/wifi/nrfwifi/src/qspi/inc/spi_nor.h b/drivers/wifi/nrf_wifi/src/qspi/inc/spi_nor.h similarity index 100% rename from drivers/wifi/nrfwifi/src/qspi/inc/spi_nor.h rename to drivers/wifi/nrf_wifi/src/qspi/inc/spi_nor.h diff --git a/drivers/wifi/nrfwifi/src/qspi/src/device.c b/drivers/wifi/nrf_wifi/src/qspi/src/device.c similarity index 100% rename from drivers/wifi/nrfwifi/src/qspi/src/device.c rename to drivers/wifi/nrf_wifi/src/qspi/src/device.c diff --git a/drivers/wifi/nrfwifi/src/qspi/src/ficr_prog.c b/drivers/wifi/nrf_wifi/src/qspi/src/ficr_prog.c similarity index 100% rename from drivers/wifi/nrfwifi/src/qspi/src/ficr_prog.c rename to drivers/wifi/nrf_wifi/src/qspi/src/ficr_prog.c diff --git a/drivers/wifi/nrfwifi/src/qspi/src/qspi_if.c b/drivers/wifi/nrf_wifi/src/qspi/src/qspi_if.c similarity index 100% rename from drivers/wifi/nrfwifi/src/qspi/src/qspi_if.c rename to drivers/wifi/nrf_wifi/src/qspi/src/qspi_if.c diff --git a/drivers/wifi/nrfwifi/src/qspi/src/rpu_hw_if.c b/drivers/wifi/nrf_wifi/src/qspi/src/rpu_hw_if.c similarity index 100% rename from drivers/wifi/nrfwifi/src/qspi/src/rpu_hw_if.c rename to drivers/wifi/nrf_wifi/src/qspi/src/rpu_hw_if.c diff --git a/drivers/wifi/nrfwifi/src/qspi/src/spi_if.c b/drivers/wifi/nrf_wifi/src/qspi/src/spi_if.c similarity index 100% rename from drivers/wifi/nrfwifi/src/qspi/src/spi_if.c rename to drivers/wifi/nrf_wifi/src/qspi/src/spi_if.c diff --git a/drivers/wifi/nrfwifi/src/wifi_mgmt.c b/drivers/wifi/nrf_wifi/src/wifi_mgmt.c similarity index 100% rename from drivers/wifi/nrfwifi/src/wifi_mgmt.c rename to drivers/wifi/nrf_wifi/src/wifi_mgmt.c diff --git a/drivers/wifi/nrfwifi/src/wifi_mgmt_scan.c b/drivers/wifi/nrf_wifi/src/wifi_mgmt_scan.c similarity index 100% rename from drivers/wifi/nrfwifi/src/wifi_mgmt_scan.c rename to drivers/wifi/nrf_wifi/src/wifi_mgmt_scan.c diff --git a/drivers/wifi/nrfwifi/src/wifi_util.c b/drivers/wifi/nrf_wifi/src/wifi_util.c similarity index 100% rename from drivers/wifi/nrfwifi/src/wifi_util.c rename to drivers/wifi/nrf_wifi/src/wifi_util.c diff --git a/drivers/wifi/nrfwifi/src/wifi_util.h b/drivers/wifi/nrf_wifi/src/wifi_util.h similarity index 100% rename from drivers/wifi/nrfwifi/src/wifi_util.h rename to drivers/wifi/nrf_wifi/src/wifi_util.h diff --git a/drivers/wifi/nrfwifi/src/wpa_supp_if.c b/drivers/wifi/nrf_wifi/src/wpa_supp_if.c similarity index 100% rename from drivers/wifi/nrfwifi/src/wpa_supp_if.c rename to drivers/wifi/nrf_wifi/src/wpa_supp_if.c diff --git a/drivers/wifi/nrfwifi/CMakeLists.txt b/drivers/wifi/nrfwifi/CMakeLists.txt deleted file mode 100644 index 57fcfc8b31d..00000000000 --- a/drivers/wifi/nrfwifi/CMakeLists.txt +++ /dev/null @@ -1,358 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: Apache-2.0 -# - -zephyr_library_named(nrfwifi) - -set(OS_AGNOSTIC_BASE ${ZEPHYR_HAL_NORDIC_MODULE_DIR}/drivers/nrf_wifi) -set(FW_BINS_BASE ${ZEPHYR_HAL_NORDIC_MODULE_DIR}/zephyr/blobs/wifi_fw_bins) - -zephyr_include_directories( - inc - ${OS_AGNOSTIC_BASE}/utils/inc - ${OS_AGNOSTIC_BASE}/os_if/inc - ${OS_AGNOSTIC_BASE}/bus_if/bus/qspi/inc - ${OS_AGNOSTIC_BASE}/bus_if/bal/inc - ${OS_AGNOSTIC_BASE}/fw_if/umac_if/inc - ${OS_AGNOSTIC_BASE}/fw_load/mips/fw/inc - ${OS_AGNOSTIC_BASE}/hw_if/hal/inc - src/qspi/inc - # for net_sprint_ll_addr - ${ZEPHYR_BASE}/subsys/net/ip - ${OS_AGNOSTIC_BASE}/hw_if/hal/inc/fw - ${OS_AGNOSTIC_BASE}/fw_if/umac_if/inc/fw -) - -zephyr_include_directories_ifdef(CONFIG_NRF70_RADIO_TEST - ${OS_AGNOSTIC_BASE}/fw_if/umac_if/inc/radio_test -) - -zephyr_include_directories_ifdef(CONFIG_NRF70_OFFLOADED_RAW_TX - ${OS_AGNOSTIC_BASE}/fw_if/umac_if/inc/offload_raw_tx - off_raw_tx/inc -) - -if(NOT CONFIG_NRF70_RADIO_TEST AND NOT CONFIG_NRF70_OFFLOADED_RAW_TX) - zephyr_include_directories(${OS_AGNOSTIC_BASE}/fw_if/umac_if/inc/default) -endif() - -zephyr_library_sources_ifdef(CONFIG_NRF70_SR_COEX - src/coex.c -) - -zephyr_library_sources( - ${OS_AGNOSTIC_BASE}/os_if/src/osal.c - ${OS_AGNOSTIC_BASE}/utils/src/list.c - ${OS_AGNOSTIC_BASE}/utils/src/queue.c - ${OS_AGNOSTIC_BASE}/utils/src/util.c - ${OS_AGNOSTIC_BASE}/hw_if/hal/src/hal_api.c - ${OS_AGNOSTIC_BASE}/hw_if/hal/src/hal_fw_patch_loader.c - ${OS_AGNOSTIC_BASE}/hw_if/hal/src/hal_interrupt.c - ${OS_AGNOSTIC_BASE}/hw_if/hal/src/hal_mem.c - ${OS_AGNOSTIC_BASE}/hw_if/hal/src/hal_reg.c - ${OS_AGNOSTIC_BASE}/hw_if/hal/src/hpqm.c - ${OS_AGNOSTIC_BASE}/hw_if/hal/src/pal.c - ${OS_AGNOSTIC_BASE}/bus_if/bal/src/bal.c - ${OS_AGNOSTIC_BASE}/bus_if/bus/qspi/src/qspi.c - ${OS_AGNOSTIC_BASE}/fw_if/umac_if/src/cmd.c - ${OS_AGNOSTIC_BASE}/fw_if/umac_if/src/event.c - ${OS_AGNOSTIC_BASE}/fw_if/umac_if/src/fmac_api_common.c - src/shim.c - src/work.c - src/timer.c - src/qspi/src/device.c - src/qspi/src/rpu_hw_if.c - src/qspi/src/ficr_prog.c -) - -zephyr_library_sources_ifndef(CONFIG_NRF70_OFFLOADED_RAW_TX - src/fmac_main.c -) - -zephyr_library_sources_ifdef(CONFIG_NRF_WIFI_PATCHES_BUILTIN - src/fw_load.c -) - -if(NOT CONFIG_NRF70_RADIO_TEST AND NOT CONFIG_NRF70_OFFLOADED_RAW_TX) - zephyr_library_sources( - ${OS_AGNOSTIC_BASE}/fw_if/umac_if/src/rx.c - ${OS_AGNOSTIC_BASE}/fw_if/umac_if/src/fmac_vif.c - ${OS_AGNOSTIC_BASE}/fw_if/umac_if/src/fmac_util.c - src/net_if.c - ${OS_AGNOSTIC_BASE}/fw_if/umac_if/src/default/fmac_api.c -) -endif() - -zephyr_library_sources_ifdef(CONFIG_NET_L2_WIFI_MGMT - src/wifi_mgmt_scan.c -) - -zephyr_library_sources_ifdef(CONFIG_NRF70_SYSTEM_MODE_COMMON - src/wifi_mgmt.c -) - -zephyr_library_sources_ifdef(CONFIG_NRF70_RADIO_TEST - ${OS_AGNOSTIC_BASE}/fw_if/umac_if/src/radio_test/fmac_api.c - ${OS_AGNOSTIC_BASE}/fw_if/umac_if/src/fmac_util.c -) - -zephyr_library_sources_ifdef(CONFIG_NRF70_OFFLOADED_RAW_TX - ${OS_AGNOSTIC_BASE}/fw_if/umac_if/src/offload_raw_tx/fmac_api.c - ${OS_AGNOSTIC_BASE}/fw_if/umac_if/src/fmac_util.c - off_raw_tx/src/off_raw_tx_api.c -) - -zephyr_library_sources_ifdef(CONFIG_NRF70_DATA_TX - ${OS_AGNOSTIC_BASE}/fw_if/umac_if/src/tx.c - ${OS_AGNOSTIC_BASE}/fw_if/umac_if/src/fmac_peer.c -) - -zephyr_library_sources_ifdef(CONFIG_NRF70_STA_MODE - src/wpa_supp_if.c - src/wifi_mgmt.c - ${OS_AGNOSTIC_BASE}/fw_if/umac_if/src/fmac_peer.c - ${OS_AGNOSTIC_BASE}/fw_if/umac_if/src/fmac_util.c -) - -zephyr_library_sources_ifdef(CONFIG_NRF70_AP_MODE - ${OS_AGNOSTIC_BASE}/fw_if/umac_if/src/fmac_ap.c -) - - -# Without WPA supplicant we only support scan -zephyr_library_sources_ifdef(CONFIG_NRF70_STA_MODE - src/wpa_supp_if.c - ${OS_AGNOSTIC_BASE}/fw_if/umac_if/src/fmac_peer.c - ${OS_AGNOSTIC_BASE}/fw_if/umac_if/src/fmac_util.c -) - -zephyr_library_sources_ifdef(CONFIG_NRF70_PROMISC_DATA_RX - ${OS_AGNOSTIC_BASE}/fw_if/umac_if/src/fmac_promisc.c -) - -zephyr_library_sources_ifdef(CONFIG_NRF70_ON_QSPI - src/qspi/src/qspi_if.c -) - -zephyr_library_sources_ifdef(CONFIG_NRF70_ON_SPI - src/qspi/src/spi_if.c -) - -zephyr_library_sources_ifdef(CONFIG_NRF70_UTIL - src/wifi_util.c -) - -zephyr_compile_definitions_ifdef(CONFIG_NRF70_ON_QSPI -# These are XIP related anomalies and aren't applicable for nRF7002 and cause -# throughput issues. - -DNRF53_ERRATA_43_ENABLE_WORKAROUND=0 - -DNRF52_ERRATA_215_ENABLE_WORKAROUND=0 -# nRF70 QSPI doesn't use 192MHz clock and most samples use 128MHz, this can cause anomaly 159 -# but as its rare and not seen in most cases, we can disable it. -# Alternative is 128MHz CPU should be disabled that impacts Wi-Fi performance. - -DNRF53_ERRATA_159_ENABLE_WORKAROUND=0 -) - -if (CONFIG_NRF_WIFI_BUILD_ONLY_MODE) - message(WARNING " - ------------------------------------------------------------------------ - Building only the nRF70 driver, skipping firmware patch. - This is only for building (CI) purposes and will not work on a real device. - ------------------------------------------------------------------------ - ") -elseif(CONFIG_NRF_WIFI_PATCHES_BUILTIN) - # RPU FW patch binaries based on the selected configuration - if(CONFIG_NRF70_SYSTEM_MODE) - set(NRF70_PATCH ${FW_BINS_BASE}/default/nrf70.bin) - elseif(CONFIG_NRF70_RADIO_TEST) - set(NRF70_PATCH ${FW_BINS_BASE}/radio_test/nrf70.bin) - elseif(CONFIG_NRF70_SCAN_ONLY) - set(NRF70_PATCH ${FW_BINS_BASE}/scan_only/nrf70.bin) - elseif (CONFIG_NRF70_SYSTEM_WITH_RAW_MODES) - set(NRF70_PATCH ${FW_BINS_BASE}/system_with_raw/nrf70.bin) - elseif(CONFIG_NRF70_OFFLOADED_RAW_TX) - set(NRF70_PATCH ${FW_BINS_BASE}/offloaded_raw_tx/nrf70.bin) - else() - # Error - message(FATAL_ERROR "Unsupported nRF70 patch configuration") - endif() - - if(NOT EXISTS ${NRF70_PATCH}) - message(FATAL_ERROR " - ------------------------------------------------------------------------ - Missing blobs for nRF70 device driver, please install by running: - $ west update - $ west blobs fetch hal_nordic - ------------------------------------------------------------------------") - endif() - - set(gen_inc_dir ${ZEPHYR_BINARY_DIR}/misc/generated) - zephyr_include_directories(${gen_inc_dir}) - set(gen_dir ${gen_inc_dir}/nrf70_fw_patch) - generate_inc_file_for_target( - nrfwifi - ${NRF70_PATCH} - ${gen_dir}/nrf70.bin.inc - ) -endif() - - - -# Translate the configuration to the OS agnostic code -zephyr_compile_definitions_ifdef(CONFIG_NRF_WIFI_LOW_POWER - -DNRF_WIFI_LOW_POWER -) - -zephyr_compile_definitions_ifdef(CONFIG_NRF_WIFI_RPU_RECOVERY - -DNRF_WIFI_RPU_RECOVERY -) - -zephyr_compile_definitions_ifdef(CONFIG_NRF_WIFI_AP_DEAD_DETECT_TIMEOUT - -DNRF_WIFI_AP_DEAD_DETECT_TIMEOUT=${CONFIG_NRF_WIFI_AP_DEAD_DETECT_TIMEOUT} -) - -zephyr_compile_definitions_ifdef(CONFIG_NRF_WIFI_IFACE_MTU - -DNRF_WIFI_IFACE_MTU=${CONFIG_NRF_WIFI_IFACE_MTU} -) - -zephyr_compile_definitions_ifdef(CONFIG_NRF70_STA_MODE - -DNRF70_STA_MODE -) - -zephyr_compile_definitions_ifdef(CONFIG_NRF70_DATA_TX - -DNRF70_DATA_TX -) - -zephyr_compile_definitions_ifdef(CONFIG_NRF70_RAW_DATA_TX - -DNRF70_RAW_DATA_TX -) - -zephyr_compile_definitions_ifdef(CONFIG_NRF70_RAW_DATA_RX - -DNRF70_RAW_DATA_RX -) - -zephyr_compile_definitions_ifdef(CONFIG_NRF70_PROMISC_DATA_RX - -DNRF70_PROMISC_DATA_RX -) - -zephyr_compile_definitions_ifdef(CONFIG_NRF70_TX_DONE_WQ_ENABLED - -DNRF70_TX_DONE_WQ_ENABLED -) - -zephyr_compile_definitions_ifdef(CONFIG_NRF70_RX_WQ_ENABLED - -DNRF70_RX_WQ_ENABLED -) - -zephyr_compile_definitions_ifdef(CONFIG_NRF70_UTIL - -DNRF70_UTIL -) - -zephyr_compile_definitions_ifdef(CONFIG_NRF70_RADIO_TEST - -DNRF70_RADIO_TEST -) - -zephyr_compile_definitions_ifdef(CONFIG_NRF70_OFFLOADED_RAW_TX - -DNRF70_OFFLOADED_RAW_TX -) - -zephyr_compile_definitions_ifdef(CONFIG_NRF70_TCP_IP_CHECKSUM_OFFLOAD - -DNRF70_TCP_IP_CHECKSUM_OFFLOAD -) - -zephyr_compile_definitions_ifdef(CONFIG_NRF70_RPU_EXTEND_TWT_SP - -DNRF70_RPU_EXTEND_TWT_SP -) - -zephyr_compile_definitions_ifdef(CONFIG_NRF70_SYSTEM_WITH_RAW_MODES - -DNRF70_SYSTEM_WITH_RAW_MODES -) - -zephyr_compile_definitions_ifdef(CONFIG_NRF70_SCAN_ONLY - -DNRF70_SCAN_ONLY -) - -zephyr_compile_definitions_ifdef(CONFIG_NRF70_SYSTEM_MODE - -DNRF70_SYSTEM_MODE -) - -zephyr_compile_definitions_ifdef(CONFIG_NRF70_2_4G_ONLY - -DNRF70_2_4G_ONLY -) - -zephyr_compile_definitions_ifdef(CONFIG_NRF70_LOG_VERBOSE - -DNRF70_LOG_VERBOSE -) - -zephyr_compile_definitions_ifdef(CONFIG_NRF70_AP_MODE - -DNRF70_AP_MODE -) - -zephyr_compile_definitions_ifdef(CONFIG_NRF_WIFI_MGMT_BUFF_OFFLOAD - -DNRF_WIFI_MGMT_BUFF_OFFLOAD -) - -zephyr_compile_definitions_ifdef(CONFIG_NRF_WIFI_FEAT_KEEPALIVE - -DNRF_WIFI_FEAT_KEEPALIVE -) - -zephyr_compile_definitions_ifdef(CONFIG_NRF_WIFI_FEAT_KEEPALIVE - -DNRF_WIFI_KEEPALIVE_PERIOD_S=${CONFIG_NRF_WIFI_KEEPALIVE_PERIOD_S} -) - -zephyr_compile_definitions_ifdef(CONFIG_NRF70_OFFLOADED_RAW_TX - -DNRF_NRF70_OFFLOADED_RAW_TX -) - -zephyr_compile_definitions_ifdef(CONFIG_NRF70_PASSIVE_SCAN_ONLY - -DNRF70_PASSIVE_SCAN_ONLY -) - -zephyr_compile_definitions_ifdef(CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS - -DWIFI_MGMT_RAW_SCAN_RESULTS -) - -zephyr_compile_definitions( - -DNRF70_RX_NUM_BUFS=${CONFIG_NRF70_RX_NUM_BUFS} - -DNRF70_MAX_TX_TOKENS=${CONFIG_NRF70_MAX_TX_TOKENS} - -DNRF70_RX_MAX_DATA_SIZE=${CONFIG_NRF70_RX_MAX_DATA_SIZE} - -DNRF70_MAX_TX_PENDING_QLEN=${CONFIG_NRF70_MAX_TX_PENDING_QLEN} - -DNRF70_RPU_PS_IDLE_TIMEOUT_MS=${CONFIG_NRF70_RPU_PS_IDLE_TIMEOUT_MS} - -DNRF70_BAND_2G_LOWER_EDGE_BACKOFF_DSSS=${CONFIG_NRF70_BAND_2G_LOWER_EDGE_BACKOFF_DSSS} - -DNRF70_BAND_2G_LOWER_EDGE_BACKOFF_HT=${CONFIG_NRF70_BAND_2G_LOWER_EDGE_BACKOFF_HT} - -DNRF70_BAND_2G_LOWER_EDGE_BACKOFF_HE=${CONFIG_NRF70_BAND_2G_LOWER_EDGE_BACKOFF_HE} - -DNRF70_BAND_2G_UPPER_EDGE_BACKOFF_DSSS=${CONFIG_NRF70_BAND_2G_UPPER_EDGE_BACKOFF_DSSS} - -DNRF70_BAND_2G_UPPER_EDGE_BACKOFF_HT=${CONFIG_NRF70_BAND_2G_UPPER_EDGE_BACKOFF_HT} - -DNRF70_BAND_2G_UPPER_EDGE_BACKOFF_HE=${CONFIG_NRF70_BAND_2G_UPPER_EDGE_BACKOFF_HE} - -DNRF70_BAND_UNII_1_LOWER_EDGE_BACKOFF_HT=${CONFIG_NRF70_BAND_UNII_1_LOWER_EDGE_BACKOFF_HT} - -DNRF70_BAND_UNII_1_LOWER_EDGE_BACKOFF_HE=${CONFIG_NRF70_BAND_UNII_1_LOWER_EDGE_BACKOFF_HE} - -DNRF70_BAND_UNII_1_UPPER_EDGE_BACKOFF_HT=${CONFIG_NRF70_BAND_UNII_1_UPPER_EDGE_BACKOFF_HT} - -DNRF70_BAND_UNII_1_UPPER_EDGE_BACKOFF_HE=${CONFIG_NRF70_BAND_UNII_1_UPPER_EDGE_BACKOFF_HE} - -DNRF70_BAND_UNII_2A_LOWER_EDGE_BACKOFF_HT=${CONFIG_NRF70_BAND_UNII_2A_LOWER_EDGE_BACKOFF_HT} - -DNRF70_BAND_UNII_2A_LOWER_EDGE_BACKOFF_HE=${CONFIG_NRF70_BAND_UNII_2A_LOWER_EDGE_BACKOFF_HE} - -DNRF70_BAND_UNII_2A_UPPER_EDGE_BACKOFF_HT=${CONFIG_NRF70_BAND_UNII_2A_UPPER_EDGE_BACKOFF_HT} - -DNRF70_BAND_UNII_2A_UPPER_EDGE_BACKOFF_HE=${CONFIG_NRF70_BAND_UNII_2A_UPPER_EDGE_BACKOFF_HE} - -DNRF70_BAND_UNII_2C_LOWER_EDGE_BACKOFF_HT=${CONFIG_NRF70_BAND_UNII_2C_LOWER_EDGE_BACKOFF_HT} - -DNRF70_BAND_UNII_2C_LOWER_EDGE_BACKOFF_HE=${CONFIG_NRF70_BAND_UNII_2C_LOWER_EDGE_BACKOFF_HE} - -DNRF70_BAND_UNII_2C_UPPER_EDGE_BACKOFF_HT=${CONFIG_NRF70_BAND_UNII_2C_UPPER_EDGE_BACKOFF_HT} - -DNRF70_BAND_UNII_2C_UPPER_EDGE_BACKOFF_HE=${CONFIG_NRF70_BAND_UNII_2C_UPPER_EDGE_BACKOFF_HE} - -DNRF70_BAND_UNII_3_LOWER_EDGE_BACKOFF_HT=${CONFIG_NRF70_BAND_UNII_3_LOWER_EDGE_BACKOFF_HT} - -DNRF70_BAND_UNII_3_LOWER_EDGE_BACKOFF_HE=${CONFIG_NRF70_BAND_UNII_3_LOWER_EDGE_BACKOFF_HE} - -DNRF70_BAND_UNII_3_UPPER_EDGE_BACKOFF_HT=${CONFIG_NRF70_BAND_UNII_3_UPPER_EDGE_BACKOFF_HT} - -DNRF70_BAND_UNII_3_UPPER_EDGE_BACKOFF_HE=${CONFIG_NRF70_BAND_UNII_3_UPPER_EDGE_BACKOFF_HE} - -DNRF70_BAND_UNII_4_LOWER_EDGE_BACKOFF_HT=${CONFIG_NRF70_BAND_UNII_4_LOWER_EDGE_BACKOFF_HT} - -DNRF70_BAND_UNII_4_LOWER_EDGE_BACKOFF_HE=${CONFIG_NRF70_BAND_UNII_4_LOWER_EDGE_BACKOFF_HE} - -DNRF70_BAND_UNII_4_UPPER_EDGE_BACKOFF_HT=${CONFIG_NRF70_BAND_UNII_4_UPPER_EDGE_BACKOFF_HT} - -DNRF70_BAND_UNII_4_UPPER_EDGE_BACKOFF_HE=${CONFIG_NRF70_BAND_UNII_4_UPPER_EDGE_BACKOFF_HE} - -DNRF70_PCB_LOSS_2G=${CONFIG_NRF70_PCB_LOSS_2G} - -DNRF70_PCB_LOSS_5G_BAND1=${CONFIG_NRF70_PCB_LOSS_5G_BAND1} - -DNRF70_PCB_LOSS_5G_BAND2=${CONFIG_NRF70_PCB_LOSS_5G_BAND2} - -DNRF70_PCB_LOSS_5G_BAND3=${CONFIG_NRF70_PCB_LOSS_5G_BAND3} - -DNRF70_ANT_GAIN_2G=${CONFIG_NRF70_ANT_GAIN_2G} - -DNRF70_ANT_GAIN_5G_BAND1=${CONFIG_NRF70_ANT_GAIN_5G_BAND1} - -DNRF70_ANT_GAIN_5G_BAND2=${CONFIG_NRF70_ANT_GAIN_5G_BAND2} - -DNRF70_ANT_GAIN_5G_BAND3=${CONFIG_NRF70_ANT_GAIN_5G_BAND3} - -DNRF_WIFI_PS_INT_PS=${CONFIG_NRF_WIFI_PS_INT_PS} - -DNRF_WIFI_RPU_RECOVERY_PS_ACTIVE_TIMEOUT_MS=${CONFIG_NRF_WIFI_RPU_RECOVERY_PS_ACTIVE_TIMEOUT_MS} -) diff --git a/include/zephyr/drivers/wifi/nrfwifi/off_raw_tx/off_raw_tx_api.h b/include/zephyr/drivers/wifi/nrf_wifi/off_raw_tx/off_raw_tx_api.h similarity index 100% rename from include/zephyr/drivers/wifi/nrfwifi/off_raw_tx/off_raw_tx_api.h rename to include/zephyr/drivers/wifi/nrf_wifi/off_raw_tx/off_raw_tx_api.h diff --git a/modules/nrf_wifi/CMakeLists.txt b/modules/nrf_wifi/CMakeLists.txt new file mode 100644 index 00000000000..e3b96f0db7b --- /dev/null +++ b/modules/nrf_wifi/CMakeLists.txt @@ -0,0 +1,184 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +if(NOT CONFIG_WIFI_NRF70) + return() +endif() +zephyr_interface_library_named(nrf-wifi-interface) +zephyr_library() + +set(NRF_WIFI_DIR ${ZEPHYR_CURRENT_MODULE_DIR}) + +# Translate the configuration to the OS agnostic code +target_compile_definitions( + nrf-wifi-interface + INTERFACE + $<$:NRF_WIFI_LOW_POWER> + $<$:NRF_WIFI_RPU_RECOVERY> + $<$:NRF_WIFI_AP_DEAD_DETECT_TIMEOUT=${CONFIG_NRF_WIFI_AP_DEAD_DETECT_TIMEOUT}> + $<$:NRF_WIFI_IFACE_MTU=${CONFIG_NRF_WIFI_IFACE_MTU}> + $<$:NRF70_STA_MODE> + $<$:NRF70_DATA_TX> + $<$:NRF70_RAW_DATA_TX> + $<$:NRF70_RAW_DATA_RX> + $<$:NRF70_PROMISC_DATA_RX> + $<$:NRF70_TX_DONE_WQ_ENABLED> + $<$:NRF70_RX_WQ_ENABLED> + $<$:NRF70_UTIL> + $<$:NRF70_RADIO_TEST> + $<$:NRF70_OFFLOADED_RAW_TX> + $<$:NRF70_TCP_IP_CHECKSUM_OFFLOAD> + $<$:NRF70_RPU_EXTEND_TWT_SP> + $<$:NRF70_SYSTEM_WITH_RAW_MODES> + $<$:NRF70_SCAN_ONLY> + $<$:NRF70_SYSTEM_MODE> + $<$:NRF70_2_4G_ONLY> + $<$:NRF70_LOG_VERBOSE> + $<$:NRF70_AP_MODE> + $<$:NRF_WIFI_MGMT_BUFF_OFFLOAD> + $<$:NRF_WIFI_FEAT_KEEPALIVE> + $<$:NRF_WIFI_KEEPALIVE_PERIOD_S=${CONFIG_NRF_WIFI_KEEPALIVE_PERIOD_S}> + $<$:WIFI_MGMT_RAW_SCAN_RESULTS> + NRF70_RX_NUM_BUFS=${CONFIG_NRF70_RX_NUM_BUFS} + NRF70_MAX_TX_TOKENS=${CONFIG_NRF70_MAX_TX_TOKENS} + NRF70_RX_MAX_DATA_SIZE=${CONFIG_NRF70_RX_MAX_DATA_SIZE} + NRF70_MAX_TX_PENDING_QLEN=${CONFIG_NRF70_MAX_TX_PENDING_QLEN} + NRF70_RPU_PS_IDLE_TIMEOUT_MS=${CONFIG_NRF70_RPU_PS_IDLE_TIMEOUT_MS} + NRF70_REG_DOMAIN=${CONFIG_NRF70_REG_DOMAIN} + NRF70_BAND_2G_LOWER_EDGE_BACKOFF_DSSS=${CONFIG_NRF70_BAND_2G_LOWER_EDGE_BACKOFF_DSSS} + NRF70_BAND_2G_LOWER_EDGE_BACKOFF_HT=${CONFIG_NRF70_BAND_2G_LOWER_EDGE_BACKOFF_HT} + NRF70_BAND_2G_LOWER_EDGE_BACKOFF_HE=${CONFIG_NRF70_BAND_2G_LOWER_EDGE_BACKOFF_HE} + NRF70_BAND_2G_UPPER_EDGE_BACKOFF_DSSS=${CONFIG_NRF70_BAND_2G_UPPER_EDGE_BACKOFF_DSSS} + NRF70_BAND_2G_UPPER_EDGE_BACKOFF_HT=${CONFIG_NRF70_BAND_2G_UPPER_EDGE_BACKOFF_HT} + NRF70_BAND_2G_UPPER_EDGE_BACKOFF_HE=${CONFIG_NRF70_BAND_2G_UPPER_EDGE_BACKOFF_HE} + NRF70_BAND_UNII_1_LOWER_EDGE_BACKOFF_HT=${CONFIG_NRF70_BAND_UNII_1_LOWER_EDGE_BACKOFF_HT} + NRF70_BAND_UNII_1_LOWER_EDGE_BACKOFF_HE=${CONFIG_NRF70_BAND_UNII_1_LOWER_EDGE_BACKOFF_HE} + NRF70_BAND_UNII_1_UPPER_EDGE_BACKOFF_HT=${CONFIG_NRF70_BAND_UNII_1_UPPER_EDGE_BACKOFF_HT} + NRF70_BAND_UNII_1_UPPER_EDGE_BACKOFF_HE=${CONFIG_NRF70_BAND_UNII_1_UPPER_EDGE_BACKOFF_HE} + NRF70_BAND_UNII_2A_LOWER_EDGE_BACKOFF_HT=${CONFIG_NRF70_BAND_UNII_2A_LOWER_EDGE_BACKOFF_HT} + NRF70_BAND_UNII_2A_LOWER_EDGE_BACKOFF_HE=${CONFIG_NRF70_BAND_UNII_2A_LOWER_EDGE_BACKOFF_HE} + NRF70_BAND_UNII_2A_UPPER_EDGE_BACKOFF_HT=${CONFIG_NRF70_BAND_UNII_2A_UPPER_EDGE_BACKOFF_HT} + NRF70_BAND_UNII_2A_UPPER_EDGE_BACKOFF_HE=${CONFIG_NRF70_BAND_UNII_2A_UPPER_EDGE_BACKOFF_HE} + NRF70_BAND_UNII_2C_LOWER_EDGE_BACKOFF_HT=${CONFIG_NRF70_BAND_UNII_2C_LOWER_EDGE_BACKOFF_HT} + NRF70_BAND_UNII_2C_LOWER_EDGE_BACKOFF_HE=${CONFIG_NRF70_BAND_UNII_2C_LOWER_EDGE_BACKOFF_HE} + NRF70_BAND_UNII_2C_UPPER_EDGE_BACKOFF_HT=${CONFIG_NRF70_BAND_UNII_2C_UPPER_EDGE_BACKOFF_HT} + NRF70_BAND_UNII_2C_UPPER_EDGE_BACKOFF_HE=${CONFIG_NRF70_BAND_UNII_2C_UPPER_EDGE_BACKOFF_HE} + NRF70_BAND_UNII_3_LOWER_EDGE_BACKOFF_HT=${CONFIG_NRF70_BAND_UNII_3_LOWER_EDGE_BACKOFF_HT} + NRF70_BAND_UNII_3_LOWER_EDGE_BACKOFF_HE=${CONFIG_NRF70_BAND_UNII_3_LOWER_EDGE_BACKOFF_HE} + NRF70_BAND_UNII_3_UPPER_EDGE_BACKOFF_HT=${CONFIG_NRF70_BAND_UNII_3_UPPER_EDGE_BACKOFF_HT} + NRF70_BAND_UNII_3_UPPER_EDGE_BACKOFF_HE=${CONFIG_NRF70_BAND_UNII_3_UPPER_EDGE_BACKOFF_HE} + NRF70_BAND_UNII_4_LOWER_EDGE_BACKOFF_HT=${CONFIG_NRF70_BAND_UNII_4_LOWER_EDGE_BACKOFF_HT} + NRF70_BAND_UNII_4_LOWER_EDGE_BACKOFF_HE=${CONFIG_NRF70_BAND_UNII_4_LOWER_EDGE_BACKOFF_HE} + NRF70_BAND_UNII_4_UPPER_EDGE_BACKOFF_HT=${CONFIG_NRF70_BAND_UNII_4_UPPER_EDGE_BACKOFF_HT} + NRF70_BAND_UNII_4_UPPER_EDGE_BACKOFF_HE=${CONFIG_NRF70_BAND_UNII_4_UPPER_EDGE_BACKOFF_HE} + NRF70_PCB_LOSS_2G=${CONFIG_NRF70_PCB_LOSS_2G} + NRF70_PCB_LOSS_5G_BAND1=${CONFIG_NRF70_PCB_LOSS_5G_BAND1} + NRF70_PCB_LOSS_5G_BAND2=${CONFIG_NRF70_PCB_LOSS_5G_BAND2} + NRF70_PCB_LOSS_5G_BAND3=${CONFIG_NRF70_PCB_LOSS_5G_BAND3} + NRF70_ANT_GAIN_2G=${CONFIG_NRF70_ANT_GAIN_2G} + NRF70_ANT_GAIN_5G_BAND1=${CONFIG_NRF70_ANT_GAIN_5G_BAND1} + NRF70_ANT_GAIN_5G_BAND2=${CONFIG_NRF70_ANT_GAIN_5G_BAND2} + NRF70_ANT_GAIN_5G_BAND3=${CONFIG_NRF70_ANT_GAIN_5G_BAND3} + NRF_WIFI_PS_INT_PS=${CONFIG_NRF_WIFI_PS_INT_PS} + NRF_WIFI_RPU_RECOVERY_PS_ACTIVE_TIMEOUT_MS=${CONFIG_NRF_WIFI_RPU_RECOVERY_PS_ACTIVE_TIMEOUT_MS} +) + +target_include_directories( + nrf-wifi-interface + INTERFACE + ${CMAKE_CURRENT_LIST_DIR} + ${NRF_WIFI_DIR}/utils/inc + ${NRF_WIFI_DIR}/os_if/inc + ${NRF_WIFI_DIR}/bus_if/bus/qspi/inc + ${NRF_WIFI_DIR}/bus_if/bal/inc + ${NRF_WIFI_DIR}/fw_if/umac_if/inc + ${NRF_WIFI_DIR}/fw_load/mips/fw/inc + ${NRF_WIFI_DIR}/hw_if/hal/inc + ${NRF_WIFI_DIR}/hw_if/hal/inc/fw + ${NRF_WIFI_DIR}/fw_if/umac_if/inc/fw +) + +if(CONFIG_NRF70_RADIO_TEST) + target_include_directories(nrf-wifi-interface INTERFACE + ${NRF_WIFI_DIR}/fw_if/umac_if/inc/radio_test + ) +elseif(CONFIG_NRF70_OFFLOADED_RAW_TX) + target_include_directories(nrf-wifi-interface INTERFACE + ${NRF_WIFI_DIR}/fw_if/umac_if/inc/offload_raw_tx + off_raw_tx/inc + ) +else() + target_include_directories(nrf-wifi-interface INTERFACE + ${NRF_WIFI_DIR}/fw_if/umac_if/inc/default + ) +endif() + +zephyr_library_sources( + ${NRF_WIFI_DIR}/os_if/src/osal.c + ${NRF_WIFI_DIR}/utils/src/list.c + ${NRF_WIFI_DIR}/utils/src/queue.c + ${NRF_WIFI_DIR}/utils/src/util.c + ${NRF_WIFI_DIR}/hw_if/hal/src/hal_api.c + ${NRF_WIFI_DIR}/hw_if/hal/src/hal_fw_patch_loader.c + ${NRF_WIFI_DIR}/hw_if/hal/src/hal_interrupt.c + ${NRF_WIFI_DIR}/hw_if/hal/src/hal_mem.c + ${NRF_WIFI_DIR}/hw_if/hal/src/hal_reg.c + ${NRF_WIFI_DIR}/hw_if/hal/src/hpqm.c + ${NRF_WIFI_DIR}/hw_if/hal/src/pal.c + ${NRF_WIFI_DIR}/bus_if/bal/src/bal.c + ${NRF_WIFI_DIR}/bus_if/bus/qspi/src/qspi.c + ${NRF_WIFI_DIR}/fw_if/umac_if/src/cmd.c + ${NRF_WIFI_DIR}/fw_if/umac_if/src/event.c + ${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_api_common.c +) + +if(CONFIG_NRF70_RADIO_TEST) + zephyr_library_sources( + ${NRF_WIFI_DIR}/fw_if/umac_if/src/radio_test/fmac_api.c + ${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_util.c + ) +elseif(CONFIG_NRF70_OFFLOADED_RAW_TX) + zephyr_library_sources( + ${NRF_WIFI_DIR}/fw_if/umac_if/src/offload_raw_tx/fmac_api.c + ${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_util.c + ) +else() + zephyr_library_sources( + ${NRF_WIFI_DIR}/fw_if/umac_if/src/rx.c + ${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_vif.c + ${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_util.c + ${NRF_WIFI_DIR}/fw_if/umac_if/src/default/fmac_api.c + ) +endif() + +zephyr_library_sources_ifdef(CONFIG_NRF70_DATA_TX + ${NRF_WIFI_DIR}/fw_if/umac_if/src/tx.c + ${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_peer.c +) + +zephyr_library_sources_ifdef(CONFIG_NRF70_STA_MODE + ${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_peer.c + ${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_util.c +) + +zephyr_library_sources_ifdef(CONFIG_NRF70_PROMISC_DATA_RX + ${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_promisc.c +) + +zephyr_library_sources_ifdef(CONFIG_NRF70_AP_MODE + ${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_ap.c +) + +# Without WPA supplicant we only support scan +zephyr_library_sources_ifdef(CONFIG_NRF70_STA_MODE + ${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_peer.c + ${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_util.c +) + +zephyr_library_sources( + shim.c + timer.c + work.c +) + +target_link_libraries(zephyr_interface INTERFACE nrf-wifi-interface) diff --git a/modules/nrf_wifi/Kconfig b/modules/nrf_wifi/Kconfig new file mode 100644 index 00000000000..9fe8172c68d --- /dev/null +++ b/modules/nrf_wifi/Kconfig @@ -0,0 +1,5 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +config ZEPHYR_NRF_WIFI_MODULE + bool diff --git a/drivers/wifi/nrfwifi/src/shim.c b/modules/nrf_wifi/shim.c similarity index 100% rename from drivers/wifi/nrfwifi/src/shim.c rename to modules/nrf_wifi/shim.c diff --git a/drivers/wifi/nrfwifi/src/shim.h b/modules/nrf_wifi/shim.h similarity index 100% rename from drivers/wifi/nrfwifi/src/shim.h rename to modules/nrf_wifi/shim.h diff --git a/drivers/wifi/nrfwifi/src/timer.c b/modules/nrf_wifi/timer.c similarity index 100% rename from drivers/wifi/nrfwifi/src/timer.c rename to modules/nrf_wifi/timer.c diff --git a/drivers/wifi/nrfwifi/src/timer.h b/modules/nrf_wifi/timer.h similarity index 100% rename from drivers/wifi/nrfwifi/src/timer.h rename to modules/nrf_wifi/timer.h diff --git a/drivers/wifi/nrfwifi/src/work.c b/modules/nrf_wifi/work.c similarity index 100% rename from drivers/wifi/nrfwifi/src/work.c rename to modules/nrf_wifi/work.c diff --git a/drivers/wifi/nrfwifi/src/work.h b/modules/nrf_wifi/work.h similarity index 100% rename from drivers/wifi/nrfwifi/src/work.h rename to modules/nrf_wifi/work.h diff --git a/tests/drivers/wifi/nrf_wifi/CMakeLists.txt b/tests/drivers/wifi/nrf_wifi/CMakeLists.txt new file mode 100644 index 00000000000..d9d097f0bc0 --- /dev/null +++ b/tests/drivers/wifi/nrf_wifi/CMakeLists.txt @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: Apache-2.0 + +cmake_minimum_required(VERSION 3.20.0) +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(build_nrf70_wifi_driver_all) + +FILE(GLOB app_sources src/*.c) +target_sources(app PRIVATE ${app_sources}) diff --git a/tests/drivers/wifi/nrf_wifi/prj.conf b/tests/drivers/wifi/nrf_wifi/prj.conf new file mode 100644 index 00000000000..04bda53a4a6 --- /dev/null +++ b/tests/drivers/wifi/nrf_wifi/prj.conf @@ -0,0 +1,84 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: Apache-2.0 +# +CONFIG_WIFI=y +CONFIG_WIFI_NRF70=y +CONFIG_WIFI_NM_WPA_SUPPLICANT=y +CONFIG_NRF_WIFI_BUILD_ONLY_MODE=y + +CONFIG_TEST_RANDOM_GENERATOR=y +# Networking +CONFIG_NETWORKING=y +CONFIG_NET_SOCKETS=y +CONFIG_NET_LOG=y +CONFIG_NET_IPV6=y +CONFIG_NET_IPV4=y +CONFIG_NET_UDP=y +CONFIG_NET_TCP=y +CONFIG_NET_DHCPV4=y +CONFIG_DNS_RESOLVER=y + +CONFIG_NET_STATISTICS=y +CONFIG_NET_STATISTICS_WIFI=y +CONFIG_NET_STATISTICS_USER_API=y + +CONFIG_NET_PKT_RX_COUNT=8 +CONFIG_NET_PKT_TX_COUNT=8 + +# Below section is the primary contributor to SRAM and is currently +# tuned for performance, but this will be revisited in the future. +CONFIG_NET_BUF_RX_COUNT=16 +CONFIG_NET_BUF_TX_COUNT=16 +CONFIG_NRF70_RX_NUM_BUFS=16 +CONFIG_NRF70_MAX_TX_AGGREGATION=4 +# nRF70 is main consumer: (16 + 8) * 1600 = ~40KB + ~40KB control path (experimental) +CONFIG_HEAP_MEM_POOL_SIZE=100000 +CONFIG_HEAP_MEM_POOL_IGNORE_MIN=y +CONFIG_NET_TC_TX_COUNT=1 + +CONFIG_NET_IF_UNICAST_IPV6_ADDR_COUNT=4 +CONFIG_NET_IF_MCAST_IPV6_ADDR_COUNT=5 +CONFIG_NET_MAX_CONTEXTS=5 +CONFIG_NET_CONTEXT_SYNC_RECV=y + +CONFIG_INIT_STACKS=y + +# Memories +CONFIG_MAIN_STACK_SIZE=5200 +CONFIG_SHELL_STACK_SIZE=5200 + +CONFIG_NET_TX_STACK_SIZE=4096 +CONFIG_NET_RX_STACK_SIZE=4096 + +# Debugging +CONFIG_STACK_SENTINEL=y +CONFIG_DEBUG_COREDUMP=y +CONFIG_DEBUG_COREDUMP_BACKEND_LOGGING=y +CONFIG_DEBUG_COREDUMP_MEMORY_DUMP_MIN=y +CONFIG_SHELL_CMDS_RESIZE=n +#CONFIG_DEBUG=y +CONFIG_WIFI_NM_WPA_SUPPLICANT_LOG_LEVEL_INF=y + +# Kernel options +CONFIG_ENTROPY_GENERATOR=y +CONFIG_REBOOT=y + +# Logging +CONFIG_LOG=y +CONFIG_PRINTK=y +CONFIG_SHELL=y +CONFIG_SHELL_GETOPT=y +CONFIG_DEVICE_SHELL=y +CONFIG_POSIX_CLOCK=y +CONFIG_DATE_SHELL=y +CONFIG_NET_CONFIG_AUTO_INIT=n +CONFIG_POSIX_API=y + +# printing of scan results puts pressure on queues in new locking +# design in net_mgmt. So, use a higher timeout for a crowded +# environment. +CONFIG_NET_MGMT_EVENT_QUEUE_TIMEOUT=5000 +CONFIG_NET_SOCKETS_POLL_MAX=12 +CONFIG_NET_MGMT_EVENT_QUEUE_SIZE=16 diff --git a/tests/drivers/wifi/nrf_wifi/src/main.c b/tests/drivers/wifi/nrf_wifi/src/main.c new file mode 100644 index 00000000000..a05ee591430 --- /dev/null +++ b/tests/drivers/wifi/nrf_wifi/src/main.c @@ -0,0 +1,10 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +int main(void) +{ + return 0; +} diff --git a/tests/drivers/wifi/nrf_wifi/testcase.yaml b/tests/drivers/wifi/nrf_wifi/testcase.yaml new file mode 100644 index 00000000000..f8dac0a1ea8 --- /dev/null +++ b/tests/drivers/wifi/nrf_wifi/testcase.yaml @@ -0,0 +1,46 @@ +common: + build_only: true + tags: + - drivers + - wifi + - net + platform_allow: + - nrf7002dk/nrf5340/cpuapp +tests: + nrf70.build.radio_test: + extra_configs: + - CONFIG_NRF70_RADIO_TEST=y + - CONFIG_NETWORKING=n + - CONFIG_WIFI_NM_WPA_SUPPLICANT=n + nrf70.build.scan_only: + extra_configs: + - CONFIG_NRF70_SCAN_ONLY=y + - CONFIG_NETWORKING=y + - CONFIG_NET_DHCPV4=n + - CONFIG_NET_NATIVE=n + - CONFIG_NET_OFFLOAD=y + - CONFIG_WIFI_NM_WPA_SUPPLICANT=n + nrf70.build.raw_scan_results: + extra_configs: + - CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS=y + - CONFIG_NRF70_SCAN_ONLY=y + - CONFIG_NETWORKING=y + - CONFIG_NET_DHCPV4=n + - CONFIG_NET_NATIVE=n + - CONFIG_NET_OFFLOAD=y + - CONFIG_WIFI_NM_WPA_SUPPLICANT=n + nrf70.build.raw_tx: + extra_configs: + - CONFIG_NRF70_RAW_DATA_TX=y + nrf70.build.raw_rx: + extra_configs: + - CONFIG_NRF70_RAW_DATA_RX=y + nrf70.build.promiscuous: + extra_configs: + - CONFIG_NRF70_PROMISC_DATA_RX=y + nrf70.build.offloaded_raw_tx: + extra_configs: + - CONFIG_NRF70_OFFLOADED_RAW_TX=y + - CONFIG_NETWORKING=n + - CONFIG_WIFI_NM_WPA_SUPPLICANT=n + - CONFIG_NET_L2_WIFI_MGMT=n diff --git a/west.yml b/west.yml index 6491ce5f8ab..e58c44fa223 100644 --- a/west.yml +++ b/west.yml @@ -302,6 +302,9 @@ manifest: - name: nrf_hw_models revision: 3cfca0192ff84da919e9bc7978bcc2239cd6a395 path: modules/bsim_hw_models/nrf_hw_models + - name: nrf_wifi + revision: f9e2abdb70761003912b1b929a37b536f68a91da + path: modules/lib/nrf_wifi - name: open-amp revision: b735edbc739ad59156eb55bb8ce2583d74537719 path: modules/lib/open-amp