Skip to content

Commit

Permalink
nrf_wifi: Add as a standlone library
Browse files Browse the repository at this point in the history
Add cmake and kconfig files to make this module as a standlone library.

Signed-off-by: Chaitanya Tata <[email protected]>
  • Loading branch information
krish2718 committed Sep 20, 2024
1 parent 37e2ac2 commit 51eae01
Show file tree
Hide file tree
Showing 6 changed files with 183 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ add_subdirectory_ifdef(CONFIG_GZLL gzll)
add_subdirectory_ifdef(CONFIG_NRF_DM nrf_dm)
add_subdirectory_ifdef(CONFIG_NRF_FUEL_GAUGE nrf_fuel_gauge)
add_subdirectory_ifdef(CONFIG_SW_CODEC_LC3_T2_SOFTWARE lc3)
add_subdirectory_ifdef(CONFIG_NRF_WIFI nrf_wifi)
1 change: 1 addition & 0 deletions Kconfig.nrfxlib
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ rsource "gzll/Kconfig"
rsource "nrf_dm/Kconfig"
rsource "lc3/Kconfig"
rsource "nrf_fuel_gauge/Kconfig"
rsource "nrf_wifi/Kconfig"

endmenu
158 changes: 158 additions & 0 deletions nrf_wifi/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
#
# Copyright (c) 2024 Nordic Semiconductor
#
# SPDX-License-Identifier: BSD-3-Clause
#

# Enable debug info by default
# Set the CPU architecture to armv8-m.main (Cortex-M33), default is armv4t
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -mcpu=cortex-m33 -mthumb")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -mcpu=cortex-m33 -mthumb")

add_library(nrf-wifi STATIC)

set(NRF_WIFI_DIR ${CMAKE_CURRENT_SOURCE_DIR})

target_include_directories(
nrf-wifi
PUBLIC
${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
)

target_include_directories_ifdef(CONFIG_NRF700X_RADIO_TEST
nrf-wifi
PUBLIC
${NRF_WIFI_DIR}/fw_if/umac_if/inc/radio_test
)

target_include_directories_ifndef(CONFIG_NRF700X_RADIO_TEST
nrf-wifi
PUBLIC
${NRF_WIFI_DIR}/fw_if/umac_if/inc/default
)

target_sources(
nrf-wifi
PRIVATE
${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
)

target_sources_ifndef(CONFIG_NRF700X_RADIO_TEST
nrf-wifi
PRIVATE
${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
)

target_sources_ifdef(CONFIG_NRF700X_RADIO_TEST
nrf-wifi
PRIVATE
${NRF_WIFI_DIR}/fw_if/umac_if/src/radio_test/fmac_api.c
${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_util.c
)

target_sources_ifdef(CONFIG_NRF700X_DATA_TX
nrf-wifi
PRIVATE
${NRF_WIFI_DIR}/fw_if/umac_if/src/tx.c
${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_peer.c
)

target_sources_ifdef(CONFIG_NRF700X_STA_MODE
nrf-wifi
PRIVATE
${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_peer.c
${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_util.c
)

target_sources_ifdef(CONFIG_NRF700X_AP_MODE
nrf-wifi
PRIVATE
${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_ap.c
)

# Without WPA supplicant we only support scan
target_sources_ifdef(CONFIG_NRF700X_STA_MODE
nrf-wifi
PRIVATE
${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_peer.c
${NRF_WIFI_DIR}/fw_if/umac_if/src/fmac_util.c
)

target_compile_definitions(
nrf-wifi
PRIVATE
-DCONFIG_NRF700X_LOG_VERBOSE=${CONFIG_NRF700X_LOG_VERBOSE}
-DCONFIG_NRF700X_SCAN_ONLY=y
-DCONFIG_WIFI_NRF700X_LOG_LEVEL=${CONFIG_WIFI_NRF700X_SHIM_LOG_LEVEL}
-DCONFIG_NRF700X_MAX_TX_TOKENS=10
-DCONFIG_NRF700X_MAX_TX_AGGREGATION=12
-DCONFIG_NRF700X_RX_NUM_BUFS=63
-DCONFIG_NRF700X_RX_MAX_DATA_SIZE=1600
-DCONFIG_WIFI_MGMT_RAW_SCAN_RESULTS
-DCONFIG_NRF700X_ANT_GAIN_2G=0
-DCONFIG_NRF700X_ANT_GAIN_5G_BAND1=0
-DCONFIG_NRF700X_ANT_GAIN_5G_BAND2=0
-DCONFIG_NRF700X_ANT_GAIN_5G_BAND3=0
-DCONFIG_NRF700X_BAND_2G_LOWER_EDGE_BACKOFF_DSSS=0
-DCONFIG_NRF700X_BAND_2G_LOWER_EDGE_BACKOFF_HT=0
-DCONFIG_NRF700X_BAND_2G_LOWER_EDGE_BACKOFF_HE=0
-DCONFIG_NRF700X_BAND_2G_UPPER_EDGE_BACKOFF_DSSS=0
-DCONFIG_NRF700X_BAND_2G_UPPER_EDGE_BACKOFF_HT=0
-DCONFIG_NRF700X_BAND_2G_UPPER_EDGE_BACKOFF_HE=0
-DCONFIG_NRF700X_BAND_UNII_1_LOWER_EDGE_BACKOFF_HT=0
-DCONFIG_NRF700X_BAND_UNII_1_LOWER_EDGE_BACKOFF_HE=0
-DCONFIG_NRF700X_BAND_UNII_1_UPPER_EDGE_BACKOFF_HT=0
-DCONFIG_NRF700X_BAND_UNII_1_UPPER_EDGE_BACKOFF_HE=0
-DCONFIG_NRF700X_BAND_UNII_2A_LOWER_EDGE_BACKOFF_HT=0
-DCONFIG_NRF700X_BAND_UNII_2A_LOWER_EDGE_BACKOFF_HE=0
-DCONFIG_NRF700X_BAND_UNII_2A_UPPER_EDGE_BACKOFF_HT=0
-DCONFIG_NRF700X_BAND_UNII_2A_UPPER_EDGE_BACKOFF_HE=0
-DCONFIG_NRF700X_BAND_UNII_2C_LOWER_EDGE_BACKOFF_HT=0
-DCONFIG_NRF700X_BAND_UNII_2C_LOWER_EDGE_BACKOFF_HE=0
-DCONFIG_NRF700X_BAND_UNII_2C_UPPER_EDGE_BACKOFF_HT=0
-DCONFIG_NRF700X_BAND_UNII_2C_UPPER_EDGE_BACKOFF_HE=0
-DCONFIG_NRF700X_BAND_UNII_3_LOWER_EDGE_BACKOFF_HT=0
-DCONFIG_NRF700X_BAND_UNII_3_LOWER_EDGE_BACKOFF_HE=0
-DCONFIG_NRF700X_BAND_UNII_3_UPPER_EDGE_BACKOFF_HT=0
-DCONFIG_NRF700X_BAND_UNII_3_UPPER_EDGE_BACKOFF_HE=0
-DCONFIG_NRF700X_BAND_UNII_4_LOWER_EDGE_BACKOFF_HT=0
-DCONFIG_NRF700X_BAND_UNII_4_LOWER_EDGE_BACKOFF_HE=0
-DCONFIG_NRF700X_BAND_UNII_4_UPPER_EDGE_BACKOFF_HT=0
-DCONFIG_NRF700X_BAND_UNII_4_UPPER_EDGE_BACKOFF_HE=0
-DCONFIG_NRF700X_REG_DOMAIN="00"
-DCONFIG_NRF700X_TX_MAX_DATA_SIZE=1600
-DCONFIG_NRF_WIFI_IFACE_MTU=1500
-DCONFIG_NRF700X_MAX_TX_PENDING_QLEN=48
-DCONFIG_NRF700X_RPU_PS_IDLE_TIMEOUT_MS=10
-DCONFIG_NRF700X_PCB_LOSS_2G=0
-DCONFIG_NRF700X_PCB_LOSS_5G_BAND1=0
-DCONFIG_NRF700X_PCB_LOSS_5G_BAND2=0
-DCONFIG_NRF700X_PCB_LOSS_5G_BAND3=0
-DCONFIG_NRF_WIFI_AP_DEAD_DETECT_TIMEOUT=20
)
12 changes: 12 additions & 0 deletions nrf_wifi/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#
# Copyright (c) 2024 Nordic Semiconductor
#
# SPDX-License-Identifier: BSD-3-Clause
#
menu "Nordic nRF70 Wi-Fi configuration"

config NRF_WIFI
bool "Enable nRF70 OS agnostic library"
help
Enable the nRF70 OS agnostic library.
endmenu
7 changes: 7 additions & 0 deletions nrf_wifi/hw_if/hal/inc/fw/pack_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@
#include <zephyr/toolchain.h>
#elif __KERNEL__
#include <linux/compiler_attributes.h>
#else
#ifndef __packed
#define __packed __attribute__((packed))
#endif
#ifndef __aligned
#define __aligned(x) __attribute__((aligned(x)))
#endif
#endif

#define __NRF_WIFI_PKD __packed
Expand Down
4 changes: 4 additions & 0 deletions nrf_wifi/os_if/inc/osal_structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
#include <linux/stddef.h>
#include <linux/string.h>
#include <linux/stdarg.h>
#else
#include <stddef.h>
#include <stdbool.h>
#include <stdarg.h>
#endif

/**
Expand Down

0 comments on commit 51eae01

Please sign in to comment.