# 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> $<$:NRF_WIFI_COEX_DISABLE_PRIORITY_WINDOW_FOR_SCAN> 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_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} NRF_WIFI_DISPLAY_SCAN_BSS_LIMIT=${CONFIG_NRF_WIFI_DISPLAY_SCAN_BSS_LIMIT} ) target_include_directories( nrf-wifi-interface INTERFACE ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../bus ${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) target_link_libraries(nrf_wifi PRIVATE nrf70-buslib)