From 3788e61a02655b1ec2762d5c009b08b47c7da737 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Thu, 28 Nov 2024 20:52:06 +0530 Subject: [PATCH 01/14] Revert "[nrf fromlist] drivers: nrfwifi: Fix passing of RAW scan results flag" This reverts commit 70877736ce7584c9e80378c6d5db1825660e227c. Signed-off-by: Chaitanya Tata --- drivers/wifi/nrfwifi/CMakeLists.txt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/wifi/nrfwifi/CMakeLists.txt b/drivers/wifi/nrfwifi/CMakeLists.txt index 57fcfc8b31d..5486031c715 100644 --- a/drivers/wifi/nrfwifi/CMakeLists.txt +++ b/drivers/wifi/nrfwifi/CMakeLists.txt @@ -309,10 +309,6 @@ 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} From 9ac172a9a7d7450e4e66dd917d59c39548abcd65 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Thu, 28 Nov 2024 20:54:48 +0530 Subject: [PATCH 02/14] Revert "[nrf fromlist] drivers: wifi: Fix offloaded raw TX feature flags" This reverts commit 0ee8c0a03f58e1bf9e010b4ea159a88c1370c61e. Signed-off-by: Chaitanya Tata --- drivers/wifi/nrfwifi/CMakeLists.txt | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/wifi/nrfwifi/CMakeLists.txt b/drivers/wifi/nrfwifi/CMakeLists.txt index 5486031c715..ad665916ceb 100644 --- a/drivers/wifi/nrfwifi/CMakeLists.txt +++ b/drivers/wifi/nrfwifi/CMakeLists.txt @@ -301,14 +301,6 @@ 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( -DNRF70_RX_NUM_BUFS=${CONFIG_NRF70_RX_NUM_BUFS} -DNRF70_MAX_TX_TOKENS=${CONFIG_NRF70_MAX_TX_TOKENS} From 7eda046420896f24ccd5c8bedf2d7f8512c8cd35 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Wed, 30 Oct 2024 01:38:47 +0530 Subject: [PATCH 03/14] [nrf fromtree] drivers: nrfwifi: Fix passing of RAW scan results flag The CONFIG_ prefix should be removed when passing to OSAL code. Signed-off-by: Chaitanya Tata (cherry picked from commit 4ae6520c3a28b33d598a5ede8d11ad82116a086a) --- drivers/wifi/nrfwifi/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/wifi/nrfwifi/CMakeLists.txt b/drivers/wifi/nrfwifi/CMakeLists.txt index ad665916ceb..65dfe9579fd 100644 --- a/drivers/wifi/nrfwifi/CMakeLists.txt +++ b/drivers/wifi/nrfwifi/CMakeLists.txt @@ -301,6 +301,10 @@ 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_WIFI_MGMT_RAW_SCAN_RESULTS + -DWIFI_MGMT_RAW_SCAN_RESULTS=${CONFIG_WIFI_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} From a4ca4d708ebee7b2868196e667d83c45baa8cce4 Mon Sep 17 00:00:00 2001 From: Kapil Bhatt Date: Wed, 23 Oct 2024 18:02:32 +0530 Subject: [PATCH 04/14] [nrf fromtree] drivers: wifi: Fix offloaded raw TX feature flags Pass passive scan and offloaded raw tx feature flags to OSAL. Signed-off-by: Kapil Bhatt (cherry picked from commit 62e06a50729a4890725716341743cb9e74df476f) --- drivers/wifi/nrfwifi/CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/wifi/nrfwifi/CMakeLists.txt b/drivers/wifi/nrfwifi/CMakeLists.txt index 65dfe9579fd..439263ec615 100644 --- a/drivers/wifi/nrfwifi/CMakeLists.txt +++ b/drivers/wifi/nrfwifi/CMakeLists.txt @@ -305,6 +305,14 @@ zephyr_compile_definitions_ifdef(CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS -DWIFI_MGMT_RAW_SCAN_RESULTS=${CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS} ) +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( -DNRF70_RX_NUM_BUFS=${CONFIG_NRF70_RX_NUM_BUFS} -DNRF70_MAX_TX_TOKENS=${CONFIG_NRF70_MAX_TX_TOKENS} From 5c64e2586ef39614e776e7d9d7ec27bdad558474 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Mon, 4 Nov 2024 23:22:52 +0530 Subject: [PATCH 05/14] [nrf fromtree] nrf_wifi: Fix the directory name Following the naming convention add an underscore and update path in the maintainers file too. Signed-off-by: Chaitanya Tata (cherry picked from commit 139ce48c8b9a82941cc224d7582e6dd95203f759) --- MAINTAINERS.yml | 2 +- drivers/wifi/CMakeLists.txt | 2 +- drivers/wifi/Kconfig | 2 +- drivers/wifi/{nrfwifi => nrf_wifi}/CMakeLists.txt | 4 ++-- drivers/wifi/{nrfwifi => nrf_wifi}/Kconfig.nrfwifi | 0 drivers/wifi/{nrfwifi => nrf_wifi}/inc/coex.h | 0 drivers/wifi/{nrfwifi => nrf_wifi}/inc/coex_struct.h | 0 drivers/wifi/{nrfwifi => nrf_wifi}/inc/fmac_main.h | 0 drivers/wifi/{nrfwifi => nrf_wifi}/inc/net_if.h | 0 drivers/wifi/{nrfwifi => nrf_wifi}/inc/wifi_mgmt.h | 0 drivers/wifi/{nrfwifi => nrf_wifi}/inc/wifi_mgmt_scan.h | 0 drivers/wifi/{nrfwifi => nrf_wifi}/inc/wpa_supp_if.h | 0 .../wifi/{nrfwifi => nrf_wifi}/off_raw_tx/inc/off_raw_tx.h | 0 .../{nrfwifi => nrf_wifi}/off_raw_tx/src/off_raw_tx_api.c | 2 +- drivers/wifi/{nrfwifi => nrf_wifi}/src/coex.c | 0 drivers/wifi/{nrfwifi => nrf_wifi}/src/fmac_main.c | 0 drivers/wifi/{nrfwifi => nrf_wifi}/src/fw_load.c | 0 drivers/wifi/{nrfwifi => nrf_wifi}/src/net_if.c | 0 drivers/wifi/{nrfwifi => nrf_wifi}/src/qspi/inc/ficr_prog.h | 0 drivers/wifi/{nrfwifi => nrf_wifi}/src/qspi/inc/qspi_if.h | 0 drivers/wifi/{nrfwifi => nrf_wifi}/src/qspi/inc/rpu_hw_if.h | 0 drivers/wifi/{nrfwifi => nrf_wifi}/src/qspi/inc/spi_if.h | 0 drivers/wifi/{nrfwifi => nrf_wifi}/src/qspi/inc/spi_nor.h | 0 drivers/wifi/{nrfwifi => nrf_wifi}/src/qspi/src/device.c | 0 drivers/wifi/{nrfwifi => nrf_wifi}/src/qspi/src/ficr_prog.c | 0 drivers/wifi/{nrfwifi => nrf_wifi}/src/qspi/src/qspi_if.c | 0 drivers/wifi/{nrfwifi => nrf_wifi}/src/qspi/src/rpu_hw_if.c | 0 drivers/wifi/{nrfwifi => nrf_wifi}/src/qspi/src/spi_if.c | 0 drivers/wifi/{nrfwifi => nrf_wifi}/src/shim.c | 0 drivers/wifi/{nrfwifi => nrf_wifi}/src/shim.h | 0 drivers/wifi/{nrfwifi => nrf_wifi}/src/timer.c | 0 drivers/wifi/{nrfwifi => nrf_wifi}/src/timer.h | 0 drivers/wifi/{nrfwifi => nrf_wifi}/src/wifi_mgmt.c | 0 drivers/wifi/{nrfwifi => nrf_wifi}/src/wifi_mgmt_scan.c | 0 drivers/wifi/{nrfwifi => nrf_wifi}/src/wifi_util.c | 0 drivers/wifi/{nrfwifi => nrf_wifi}/src/wifi_util.h | 0 drivers/wifi/{nrfwifi => nrf_wifi}/src/work.c | 0 drivers/wifi/{nrfwifi => nrf_wifi}/src/work.h | 0 drivers/wifi/{nrfwifi => nrf_wifi}/src/wpa_supp_if.c | 0 .../wifi/{nrfwifi => nrf_wifi}/off_raw_tx/off_raw_tx_api.h | 0 40 files changed, 6 insertions(+), 6 deletions(-) rename drivers/wifi/{nrfwifi => nrf_wifi}/CMakeLists.txt (99%) rename drivers/wifi/{nrfwifi => nrf_wifi}/Kconfig.nrfwifi (100%) rename drivers/wifi/{nrfwifi => nrf_wifi}/inc/coex.h (100%) rename drivers/wifi/{nrfwifi => nrf_wifi}/inc/coex_struct.h (100%) rename drivers/wifi/{nrfwifi => nrf_wifi}/inc/fmac_main.h (100%) rename drivers/wifi/{nrfwifi => nrf_wifi}/inc/net_if.h (100%) rename drivers/wifi/{nrfwifi => nrf_wifi}/inc/wifi_mgmt.h (100%) rename drivers/wifi/{nrfwifi => nrf_wifi}/inc/wifi_mgmt_scan.h (100%) rename drivers/wifi/{nrfwifi => nrf_wifi}/inc/wpa_supp_if.h (100%) rename drivers/wifi/{nrfwifi => nrf_wifi}/off_raw_tx/inc/off_raw_tx.h (100%) rename drivers/wifi/{nrfwifi => nrf_wifi}/off_raw_tx/src/off_raw_tx_api.c (99%) rename drivers/wifi/{nrfwifi => nrf_wifi}/src/coex.c (100%) rename drivers/wifi/{nrfwifi => nrf_wifi}/src/fmac_main.c (100%) rename drivers/wifi/{nrfwifi => nrf_wifi}/src/fw_load.c (100%) rename drivers/wifi/{nrfwifi => nrf_wifi}/src/net_if.c (100%) rename drivers/wifi/{nrfwifi => nrf_wifi}/src/qspi/inc/ficr_prog.h (100%) rename drivers/wifi/{nrfwifi => nrf_wifi}/src/qspi/inc/qspi_if.h (100%) rename drivers/wifi/{nrfwifi => nrf_wifi}/src/qspi/inc/rpu_hw_if.h (100%) rename drivers/wifi/{nrfwifi => nrf_wifi}/src/qspi/inc/spi_if.h (100%) rename drivers/wifi/{nrfwifi => nrf_wifi}/src/qspi/inc/spi_nor.h (100%) rename drivers/wifi/{nrfwifi => nrf_wifi}/src/qspi/src/device.c (100%) rename drivers/wifi/{nrfwifi => nrf_wifi}/src/qspi/src/ficr_prog.c (100%) rename drivers/wifi/{nrfwifi => nrf_wifi}/src/qspi/src/qspi_if.c (100%) rename drivers/wifi/{nrfwifi => nrf_wifi}/src/qspi/src/rpu_hw_if.c (100%) rename drivers/wifi/{nrfwifi => nrf_wifi}/src/qspi/src/spi_if.c (100%) rename drivers/wifi/{nrfwifi => nrf_wifi}/src/shim.c (100%) rename drivers/wifi/{nrfwifi => nrf_wifi}/src/shim.h (100%) rename drivers/wifi/{nrfwifi => nrf_wifi}/src/timer.c (100%) rename drivers/wifi/{nrfwifi => nrf_wifi}/src/timer.h (100%) rename drivers/wifi/{nrfwifi => nrf_wifi}/src/wifi_mgmt.c (100%) rename drivers/wifi/{nrfwifi => nrf_wifi}/src/wifi_mgmt_scan.c (100%) rename drivers/wifi/{nrfwifi => nrf_wifi}/src/wifi_util.c (100%) rename drivers/wifi/{nrfwifi => nrf_wifi}/src/wifi_util.h (100%) rename drivers/wifi/{nrfwifi => nrf_wifi}/src/work.c (100%) rename drivers/wifi/{nrfwifi => nrf_wifi}/src/work.h (100%) rename drivers/wifi/{nrfwifi => nrf_wifi}/src/wpa_supp_if.c (100%) rename include/zephyr/drivers/wifi/{nrfwifi => nrf_wifi}/off_raw_tx/off_raw_tx_api.h (100%) diff --git a/MAINTAINERS.yml b/MAINTAINERS.yml index a77bbf643c0..957302c5104 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 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/nrfwifi/CMakeLists.txt b/drivers/wifi/nrf_wifi/CMakeLists.txt similarity index 99% rename from drivers/wifi/nrfwifi/CMakeLists.txt rename to drivers/wifi/nrf_wifi/CMakeLists.txt index 439263ec615..302234d6d62 100644 --- a/drivers/wifi/nrfwifi/CMakeLists.txt +++ b/drivers/wifi/nrf_wifi/CMakeLists.txt @@ -4,7 +4,7 @@ # SPDX-License-Identifier: Apache-2.0 # -zephyr_library_named(nrfwifi) +zephyr_library_named(nrf_wifi) 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) @@ -192,7 +192,7 @@ elseif(CONFIG_NRF_WIFI_PATCHES_BUILTIN) zephyr_include_directories(${gen_inc_dir}) set(gen_dir ${gen_inc_dir}/nrf70_fw_patch) generate_inc_file_for_target( - nrfwifi + nrf_wifi ${NRF70_PATCH} ${gen_dir}/nrf70.bin.inc ) 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/shim.c b/drivers/wifi/nrf_wifi/src/shim.c similarity index 100% rename from drivers/wifi/nrfwifi/src/shim.c rename to drivers/wifi/nrf_wifi/src/shim.c diff --git a/drivers/wifi/nrfwifi/src/shim.h b/drivers/wifi/nrf_wifi/src/shim.h similarity index 100% rename from drivers/wifi/nrfwifi/src/shim.h rename to drivers/wifi/nrf_wifi/src/shim.h diff --git a/drivers/wifi/nrfwifi/src/timer.c b/drivers/wifi/nrf_wifi/src/timer.c similarity index 100% rename from drivers/wifi/nrfwifi/src/timer.c rename to drivers/wifi/nrf_wifi/src/timer.c diff --git a/drivers/wifi/nrfwifi/src/timer.h b/drivers/wifi/nrf_wifi/src/timer.h similarity index 100% rename from drivers/wifi/nrfwifi/src/timer.h rename to drivers/wifi/nrf_wifi/src/timer.h 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/work.c b/drivers/wifi/nrf_wifi/src/work.c similarity index 100% rename from drivers/wifi/nrfwifi/src/work.c rename to drivers/wifi/nrf_wifi/src/work.c diff --git a/drivers/wifi/nrfwifi/src/work.h b/drivers/wifi/nrf_wifi/src/work.h similarity index 100% rename from drivers/wifi/nrfwifi/src/work.h rename to drivers/wifi/nrf_wifi/src/work.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/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 From a80abfad6ed911ad742ed804db6d7dfaaffd0d1f Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Mon, 4 Nov 2024 23:23:40 +0530 Subject: [PATCH 06/14] [nrf fromtree] drivers: nrf_wifi: Fix the path to OSAL code The OSAL code now lives in it's own repo nrf_wifi. Signed-off-by: Chaitanya Tata (cherry picked from commit f7dc9f82d2790d2eea7cf67eb6da2c662138e528) --- drivers/wifi/nrf_wifi/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/wifi/nrf_wifi/CMakeLists.txt b/drivers/wifi/nrf_wifi/CMakeLists.txt index 302234d6d62..e1a76bf3d90 100644 --- a/drivers/wifi/nrf_wifi/CMakeLists.txt +++ b/drivers/wifi/nrf_wifi/CMakeLists.txt @@ -6,8 +6,8 @@ zephyr_library_named(nrf_wifi) -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) +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 From 6f2df1580eb647abace9ae68803f03f6fd48689c Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Fri, 8 Nov 2024 01:48:42 +0530 Subject: [PATCH 07/14] [nrf fromtree] modules: nrf_wifi: Add a new module for nRF70 Wi-Fi This is a Zephyr shim for the nrf-wifi module. Signed-off-by: Chaitanya Tata (cherry picked from commit 180df6675e895a1b4372e25e8f2d20162296e2cb) --- MAINTAINERS.yml | 10 ++ modules/nrf_wifi/CMakeLists.txt | 170 ++++++++++++++++++++++++++++++++ modules/nrf_wifi/Kconfig | 5 + west.yml | 3 + 4 files changed, 188 insertions(+) create mode 100644 modules/nrf_wifi/CMakeLists.txt create mode 100644 modules/nrf_wifi/Kconfig diff --git a/MAINTAINERS.yml b/MAINTAINERS.yml index 957302c5104..fdc0a25a5f1 100644 --- a/MAINTAINERS.yml +++ b/MAINTAINERS.yml @@ -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/modules/nrf_wifi/CMakeLists.txt b/modules/nrf_wifi/CMakeLists.txt new file mode 100644 index 00000000000..2d0e4c8a45e --- /dev/null +++ b/modules/nrf_wifi/CMakeLists.txt @@ -0,0 +1,170 @@ +# 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}> + 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 +) + +zephyr_library_sources_ifndef(CONFIG_NRF70_RADIO_TEST + ${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 +) + +zephyr_library_sources_ifdef(CONFIG_NRF70_RADIO_TEST + ${NRF_WIFI_DIR}/fw_if/umac_if/src/radio_test/fmac_api.c + ${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_util.c +) + +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 + ${OS_AGNOSTIC_BASE}/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 +) + +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/west.yml b/west.yml index 976de15f4ee..248d015f6ae 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 From 5cc7edfa867d1cf1ff41a4bcd1fb6bad42fe857f Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Fri, 8 Nov 2024 01:49:49 +0530 Subject: [PATCH 08/14] [nrf fromtree] drivers: nrf_wifi: Remove OSAL code handling This is now taken care by the Zephyr module shim. Signed-off-by: Chaitanya Tata (cherry picked from commit 459f9727856e55fef66eb37796a273658467667f) --- drivers/wifi/nrf_wifi/CMakeLists.txt | 225 +-------------------------- 1 file changed, 1 insertion(+), 224 deletions(-) diff --git a/drivers/wifi/nrf_wifi/CMakeLists.txt b/drivers/wifi/nrf_wifi/CMakeLists.txt index e1a76bf3d90..4e3878dfcfd 100644 --- a/drivers/wifi/nrf_wifi/CMakeLists.txt +++ b/drivers/wifi/nrf_wifi/CMakeLists.txt @@ -11,54 +11,20 @@ set(FW_BINS_BASE ${ZEPHYR_NRF_WIFI_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 @@ -77,11 +43,7 @@ zephyr_library_sources_ifdef(CONFIG_NRF_WIFI_PATCHES_BUILTIN 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() @@ -93,44 +55,18 @@ 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 -) + src/wpa_supp_if.c) zephyr_library_sources_ifdef(CONFIG_NRF70_ON_QSPI src/qspi/src/qspi_if.c @@ -197,162 +133,3 @@ elseif(CONFIG_NRF_WIFI_PATCHES_BUILTIN) ${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_WIFI_MGMT_RAW_SCAN_RESULTS - -DWIFI_MGMT_RAW_SCAN_RESULTS=${CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS} -) - -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( - -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} -) From c967e32d1a27c9d8f08e17906f82b02ba7d1df39 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Fri, 8 Nov 2024 02:14:53 +0530 Subject: [PATCH 09/14] [nrf fromtree] nrf_wifi: Move shim files from driver to module The shim files should be part of the Zephyr module directory within Zephyr, as they are coupled with the module implementation which os OS agnostic. Signed-off-by: Chaitanya Tata (cherry picked from commit da26d02d63a45dbe7825e44b686f125770dbf78d) --- drivers/wifi/nrf_wifi/CMakeLists.txt | 3 --- modules/nrf_wifi/CMakeLists.txt | 6 ++++++ {drivers/wifi/nrf_wifi/src => modules/nrf_wifi}/shim.c | 0 {drivers/wifi/nrf_wifi/src => modules/nrf_wifi}/shim.h | 0 {drivers/wifi/nrf_wifi/src => modules/nrf_wifi}/timer.c | 0 {drivers/wifi/nrf_wifi/src => modules/nrf_wifi}/timer.h | 0 {drivers/wifi/nrf_wifi/src => modules/nrf_wifi}/work.c | 0 {drivers/wifi/nrf_wifi/src => modules/nrf_wifi}/work.h | 0 8 files changed, 6 insertions(+), 3 deletions(-) rename {drivers/wifi/nrf_wifi/src => modules/nrf_wifi}/shim.c (100%) rename {drivers/wifi/nrf_wifi/src => modules/nrf_wifi}/shim.h (100%) rename {drivers/wifi/nrf_wifi/src => modules/nrf_wifi}/timer.c (100%) rename {drivers/wifi/nrf_wifi/src => modules/nrf_wifi}/timer.h (100%) rename {drivers/wifi/nrf_wifi/src => modules/nrf_wifi}/work.c (100%) rename {drivers/wifi/nrf_wifi/src => modules/nrf_wifi}/work.h (100%) diff --git a/drivers/wifi/nrf_wifi/CMakeLists.txt b/drivers/wifi/nrf_wifi/CMakeLists.txt index 4e3878dfcfd..443b54796cd 100644 --- a/drivers/wifi/nrf_wifi/CMakeLists.txt +++ b/drivers/wifi/nrf_wifi/CMakeLists.txt @@ -25,9 +25,6 @@ zephyr_library_sources_ifdef(CONFIG_NRF70_SR_COEX ) zephyr_library_sources( - 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 diff --git a/modules/nrf_wifi/CMakeLists.txt b/modules/nrf_wifi/CMakeLists.txt index 2d0e4c8a45e..ad04414b511 100644 --- a/modules/nrf_wifi/CMakeLists.txt +++ b/modules/nrf_wifi/CMakeLists.txt @@ -167,4 +167,10 @@ zephyr_library_sources_ifdef(CONFIG_NRF70_STA_MODE ${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/drivers/wifi/nrf_wifi/src/shim.c b/modules/nrf_wifi/shim.c similarity index 100% rename from drivers/wifi/nrf_wifi/src/shim.c rename to modules/nrf_wifi/shim.c diff --git a/drivers/wifi/nrf_wifi/src/shim.h b/modules/nrf_wifi/shim.h similarity index 100% rename from drivers/wifi/nrf_wifi/src/shim.h rename to modules/nrf_wifi/shim.h diff --git a/drivers/wifi/nrf_wifi/src/timer.c b/modules/nrf_wifi/timer.c similarity index 100% rename from drivers/wifi/nrf_wifi/src/timer.c rename to modules/nrf_wifi/timer.c diff --git a/drivers/wifi/nrf_wifi/src/timer.h b/modules/nrf_wifi/timer.h similarity index 100% rename from drivers/wifi/nrf_wifi/src/timer.h rename to modules/nrf_wifi/timer.h diff --git a/drivers/wifi/nrf_wifi/src/work.c b/modules/nrf_wifi/work.c similarity index 100% rename from drivers/wifi/nrf_wifi/src/work.c rename to modules/nrf_wifi/work.c diff --git a/drivers/wifi/nrf_wifi/src/work.h b/modules/nrf_wifi/work.h similarity index 100% rename from drivers/wifi/nrf_wifi/src/work.h rename to modules/nrf_wifi/work.h From f5f8a847d7dd9269f37d8c4bd8d2fb8525dfa34a Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Sat, 9 Nov 2024 17:06:59 +0530 Subject: [PATCH 10/14] [nrf fromtree] drivers: wifi: Fix blobs handling The blobs are now part of nrf_wifi module, and remove the manual check and add verifying the blobs and their integrity using helper function. Signed-off-by: Chaitanya Tata (cherry picked from commit b8cab9e144aa5a8c1308db895446e573697d312a) --- drivers/wifi/nrf_wifi/CMakeLists.txt | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/wifi/nrf_wifi/CMakeLists.txt b/drivers/wifi/nrf_wifi/CMakeLists.txt index 443b54796cd..e631e930e07 100644 --- a/drivers/wifi/nrf_wifi/CMakeLists.txt +++ b/drivers/wifi/nrf_wifi/CMakeLists.txt @@ -96,6 +96,7 @@ if (CONFIG_NRF_WIFI_BUILD_ONLY_MODE) ------------------------------------------------------------------------ ") 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) @@ -112,15 +113,6 @@ elseif(CONFIG_NRF_WIFI_PATCHES_BUILTIN) 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) From f7d81fec082a9bf09d8a6bcc037988c864a989b6 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Fri, 29 Nov 2024 17:24:59 +0530 Subject: [PATCH 11/14] [nrf fromlist] modules: nrf_wifi: Fix offloaded raw TX build For the C sources the offloaded raw TX mode wasn't considered and else case picks up system mode files causing build issues. Upstream PR #: 82335 Signed-off-by: Chaitanya Tata --- modules/nrf_wifi/CMakeLists.txt | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/modules/nrf_wifi/CMakeLists.txt b/modules/nrf_wifi/CMakeLists.txt index ad04414b511..e5c85cda679 100644 --- a/modules/nrf_wifi/CMakeLists.txt +++ b/modules/nrf_wifi/CMakeLists.txt @@ -131,17 +131,24 @@ zephyr_library_sources( ${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_api_common.c ) -zephyr_library_sources_ifndef(CONFIG_NRF70_RADIO_TEST - ${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 -) - -zephyr_library_sources_ifdef(CONFIG_NRF70_RADIO_TEST - ${NRF_WIFI_DIR}/fw_if/umac_if/src/radio_test/fmac_api.c - ${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_util.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 From 514167edf564110d45ecca66e57e6ff4041d49ad Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Fri, 29 Nov 2024 17:25:22 +0530 Subject: [PATCH 12/14] [nrf fromlist] modules: nrf_wifi: Fix the directory variable During cherry-pick the directory wasn't renamed. Upstream PR #: 82335 Signed-off-by: Chaitanya Tata --- modules/nrf_wifi/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nrf_wifi/CMakeLists.txt b/modules/nrf_wifi/CMakeLists.txt index e5c85cda679..41d48b50f7e 100644 --- a/modules/nrf_wifi/CMakeLists.txt +++ b/modules/nrf_wifi/CMakeLists.txt @@ -161,7 +161,7 @@ zephyr_library_sources_ifdef(CONFIG_NRF70_STA_MODE ) zephyr_library_sources_ifdef(CONFIG_NRF70_PROMISC_DATA_RX - ${OS_AGNOSTIC_BASE}/fw_if/umac_if/src/fmac_promisc.c + ${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_promisc.c ) zephyr_library_sources_ifdef(CONFIG_NRF70_AP_MODE From 2d0308ee04048f67fd03e13b0ab916ffefc37aaf Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Sat, 30 Nov 2024 13:55:53 +0530 Subject: [PATCH 13/14] [nrf fromlist] modules: nrf_wifi: Fix raw scan results build Fix the missing define to OSAL code. Upstream PR #: 82335 Signed-off-by: Chaitanya Tata --- modules/nrf_wifi/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/nrf_wifi/CMakeLists.txt b/modules/nrf_wifi/CMakeLists.txt index 41d48b50f7e..e3b96f0db7b 100644 --- a/modules/nrf_wifi/CMakeLists.txt +++ b/modules/nrf_wifi/CMakeLists.txt @@ -38,6 +38,7 @@ target_compile_definitions( $<$: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} From bc80cbda202a69435c7333544c9c5359e4aef0fc Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Fri, 29 Nov 2024 19:50:56 +0530 Subject: [PATCH 14/14] [nrf fromlist] tests: drivers: nrf_wifi: Add a build all test This helps maintaining of various modes in nRF Wi-Fi driver. Upstream PR #: 82335 Signed-off-by: Chaitanya Tata --- tests/drivers/wifi/nrf_wifi/CMakeLists.txt | 8 +++ tests/drivers/wifi/nrf_wifi/prj.conf | 84 ++++++++++++++++++++++ tests/drivers/wifi/nrf_wifi/src/main.c | 10 +++ tests/drivers/wifi/nrf_wifi/testcase.yaml | 46 ++++++++++++ 4 files changed, 148 insertions(+) create mode 100644 tests/drivers/wifi/nrf_wifi/CMakeLists.txt create mode 100644 tests/drivers/wifi/nrf_wifi/prj.conf create mode 100644 tests/drivers/wifi/nrf_wifi/src/main.c create mode 100644 tests/drivers/wifi/nrf_wifi/testcase.yaml 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