#
# Copyright (c) 2022 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#
CONFIG_I2C=y

# WIFI 
CONFIG_WIFI=y
CONFIG_WIFI_NRF70=y
# the fact its a 7002 and on SPI should come from DTS config
#CONFIG_WIFI_NRF7002=y
#CONFIG_NRF70_ON_SPI=y
CONFIG_WIFI_NRF70_LOG_LEVEL_WRN=y
CONFIG_WIFI_LOG_LEVEL_WRN=y
# for L4 connection events
CONFIG_NET_CONNECTION_MANAGER=y
# WPA supplicant
CONFIG_WIFI_NM_WPA_SUPPLICANT=y
# WPA2-Enterprise, WPA3-SAE, WPA3-Enterprise for at least EAP-TLS
CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE=y
#CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ALT=y
CONFIG_WIFI_NM_WPA_SUPPLICANT_WPA3=y
# EAPoL aka 802.1X : EAP in wifi or lan frames. Auto selected when enterprise enabled
#CONFIG_WIFI_NM_WPA_SUPPLICANT_EAPOL=y
# PEAP aka Protected EAP ie EAP in TLS tunnel
# Only support EAP TLS method
CONFIG_EAP_ALL=n
CONFIG_EAP_TLS=y

CONFIG_WIFI_NM_WPA_SUPPLICANT_AP=n
CONFIG_WIFI_NM_WPA_SUPPLICANT_ADVANCED_FEATURES=n
CONFIG_WIFI_NM_WPA_SUPPLICANT_WEP=n
CONFIG_WIFI_NM_WPA_SUPPLICANT_P2P=n
CONFIG_WIFI_NM_WPA_SUPPLICANT_CLI=n
CONFIG_WIFI_NM_WPA_SUPPLICANT_NO_DEBUG=n
#CONFIG_WIFI_NM_WPA_SUPPLICANT_ROAMING=n
#CONFIG_WIFI_NM_HOSTAPD_WPS=n
#CONFIG_WIFI_NM_HOSTAPD_CRYPTO_ENTERPRISE=n
CONFIG_WIFI_NM_HOSTAPD_AP=n

# 2=DEBUG, 3=INFO, 4=WARNING
#CONFIG_WIFI_NM_WPA_SUPPLICANT_DEBUG_LEVEL=2
CONFIG_WIFI_NM_WPA_SUPPLICANT_LOG_LEVEL_DBG=y
CONFIG_WIFI_NM_LOG_LEVEL_WRN=y

CONFIG_WIFI_READY_LIB=n
CONFIG_NRF_WIFI_RPU_RECOVERY=y
CONFIG_WIFI_MGMT_EXT=n
CONFIG_WIFI_CREDENTIALS=n

#CONFIG_NRF700X_RADIO_COEX=y
CONFIG_NRF70_SR_COEX=y
CONFIG_NRF_WIFI_LOW_POWER=y
CONFIG_NRF_WIFI_IF_AUTO_START=y

CONFIG_NRF70_STA_MODE=y

CONFIG_NRF70_AP_MODE=n
CONFIG_NRF70_P2P_MODE=n
CONFIG_NRF70_SYSTEM_MODE=y
CONFIG_NRF70_UTIL=n

# Config moved into main.c to avoid rebuilding entire project each time they are changed!
# Below configs need to be modified based on security
# CONFIG_STA_KEY_MGMT_NONE=y
# CONFIG_STA_KEY_MGMT_WPA2=y
# CONFIG_STA_KEY_MGMT_WPA2_256=y
# CONFIG_STA_KEY_MGMT_WPA3=y

# System settings
CONFIG_NEWLIB_LIBC=y
CONFIG_NEWLIB_LIBC_NANO=n
# use malloc that maps to k_malloc(), and allocate all remaing RAM to heap (-1)
CONFIG_RESET_ON_FATAL_ERROR=n

# Networking
CONFIG_NETWORKING=y
CONFIG_NET_SOCKETS=y
CONFIG_NET_LOG=y
CONFIG_NET_IPV4=y
CONFIG_NET_UDP=y
CONFIG_NET_TCP=y
CONFIG_NET_DHCPV4=y

# Below section is the primary contributor to SRAM and is currently
# tuned for performance, but this will be revisited in the future.
CONFIG_NET_PKT_RX_COUNT=36
CONFIG_NET_PKT_TX_COUNT=36
CONFIG_NET_BUF_RX_COUNT=36
CONFIG_NET_BUF_TX_COUNT=72

#CONFIG_NET_BUF_DATA_SIZE=128
CONFIG_HEAP_MEM_POOL_SIZE=153600
CONFIG_NET_TC_TX_COUNT=1

CONFIG_NET_IF_UNICAST_IPV4_ADDR_COUNT=1
CONFIG_NET_MAX_CONTEXTS=5
CONFIG_NET_CONTEXT_SYNC_RECV=y

CONFIG_INIT_STACKS=y

CONFIG_NET_L2_ETHERNET=y

#CONFIG_NET_CONFIG_SETTINGS=y
CONFIG_NET_CONFIG_SETTINGS=n
#CONFIG_NET_CONFIG_INIT_TIMEOUT=0

CONFIG_NET_SOCKETS_POLL_MAX=10

# Memories
CONFIG_MAIN_STACK_SIZE=8192
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=8192
CONFIG_NET_TX_STACK_SIZE=8192
CONFIG_NET_RX_STACK_SIZE=8192
CONFIG_NET_MGMT_EVENT_STACK_SIZE=8192

# 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


# Kernel options
CONFIG_ENTROPY_GENERATOR=y

# Logging
CONFIG_LOG=y
CONFIG_LOG_BUFFER_SIZE=32000
CONFIG_POSIX_CLOCK=y

#CONFIG_NET_CONFIG_MY_IPV4_ADDR="192.168.1.99"
#CONFIG_NET_CONFIG_MY_IPV4_NETMASK="255.255.255.0"
#CONFIG_NET_CONFIG_MY_IPV4_GW="192.168.1.1"

# 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
