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

# Overlay to use nRF7002 EK on top of nrf9160 DK for Wi-Fi scanning

# Disable modem traces as UART1 is disabled
CONFIG_NRF_MODEM_LIB_TRACE=n

CONFIG_LOCATION_METHOD_WIFI=y

# Align this with CONFIG_WIFI_MGMT_SCAN_MAX_BSS_CNT.
# Also see comments for CONFIG_HEAP_MEM_POOL_SIZE.
CONFIG_LOCATION_METHOD_WIFI_SCANNING_RESULTS_MAX_CNT=50
CONFIG_LOCATION_WORKQUEUE_STACK_SIZE=8192

# Does not work with buttons&LEDs
CONFIG_DK_LIBRARY=n

# Not for LTE throughput testing
CONFIG_NRF_MODEM_LIB_SHMEM_TX_SIZE=4096
CONFIG_NRF_MODEM_LIB_SHMEM_RX_SIZE=4096

# Disable throughput tools to save memory
CONFIG_MOSH_IPERF3=n
CONFIG_MOSH_CURL=n

# Actual configs for the Wi-Fi
CONFIG_WIFI=y
CONFIG_WIFI_NRF700X=y
# Align this with CONFIG_LOCATION_METHOD_WIFI_SCANNING_RESULTS_MAX_CNT.
# Also see comments for CONFIG_HEAP_MEM_POOL_SIZE.
CONFIG_WIFI_MGMT_SCAN_MAX_BSS_CNT=50

# Wi-Fi subsystem uses Zephyr's getopt.
CONFIG_GETOPT_LIB=n
CONFIG_NET_L2_WIFI_SHELL=y
# Should be set when CONFIG_NET_L2_WIFI_SHELL is enabled.
# Printing 'wifi scan' command results puts pressure on queues in new locking design in net_mgmt.
# So, use a typical number of networks in a crowded environment as the queue depth.
CONFIG_NET_MGMT_EVENT_QUEUE_SIZE=50

# System settings
CONFIG_NEWLIB_LIBC=y

# Scan only using offload API
CONFIG_WPA_SUPP=n

# For nRF9160 the default is socket interface
CONFIG_NET_DEFAULT_IF_ETHERNET=y
CONFIG_MBEDTLS=n
CONFIG_NORDIC_SECURITY_BACKEND=n

# Networking
CONFIG_NET_L2_ETHERNET=y
CONFIG_NET_SHELL=y
CONFIG_NET_NATIVE=y
CONFIG_NET_IPV4=y
CONFIG_NET_DHCPV4=y
CONFIG_NET_IPV6=y
CONFIG_NET_STATISTICS=y
CONFIG_NET_STATISTICS_WIFI=y
CONFIG_NET_STATISTICS_USER_API=y
CONFIG_NET_CONTEXT_SYNC_RECV=y

# Memory configurations
CONFIG_NET_BUF_RX_COUNT=8
CONFIG_NET_BUF_TX_COUNT=8
CONFIG_NET_PKT_RX_COUNT=1
CONFIG_NET_PKT_TX_COUNT=1
CONFIG_NET_TX_STACK_SIZE=4096
CONFIG_NET_RX_STACK_SIZE=4096
CONFIG_NET_TC_TX_COUNT=1
CONFIG_NET_MAX_CONTEXTS=5
CONFIG_NET_MGMT_EVENT_STACK_SIZE=1024

# Wi-Fi shell sample has 25000 heap size. We need a bit more for location request purposes.
# Heap allocation should be changed when CONFIG_LOCATION_METHOD_WIFI_SCANNING_RESULTS_MAX_CNT
# and CONFIG_WIFI_MGMT_SCAN_MAX_BSS_CNT (which should be the same value) are changed.
# In modem shell, it looks like 10 APs requires ~4500 bytes to give some rough numbers.
CONFIG_HEAP_MEM_POOL_SIZE=40000
