diff --git a/boards/Kconfig b/boards/Kconfig index 03064790fb63c4..b295e23cad76fd 100644 --- a/boards/Kconfig +++ b/boards/Kconfig @@ -14,6 +14,13 @@ config QEMU_TARGET Mark all QEMU targets with this variable for checking whether we are running in an emulated environment. +config NET_DRIVERS + bool + default y if QEMU_TARGET && NETWORKING + help + When building for a qemu target then NET_DRIVERS will be default + enabled to allow for easy use of SLIP or PPP + # Note: $BOARD_DIR might be a glob pattern choice diff --git a/drivers/CMakeLists.txt b/drivers/CMakeLists.txt index f6ee4d621f8b16..ce280174dd2df6 100644 --- a/drivers/CMakeLists.txt +++ b/drivers/CMakeLists.txt @@ -50,7 +50,7 @@ add_subdirectory_ifdef(CONFIG_PM_CPU_OPS pm_cpu_ops) add_subdirectory_ifdef(CONFIG_FLASH_HAS_DRIVER_ENABLED flash) add_subdirectory_ifdef(CONFIG_SERIAL_HAS_DRIVER serial) add_subdirectory_ifdef(CONFIG_BT_DRIVERS bluetooth) -add_subdirectory_ifdef(CONFIG_NETWORKING net) +add_subdirectory_ifdef(CONFIG_NET_DRIVERS net) add_subdirectory_ifdef(CONFIG_NET_L2_ETHERNET ethernet) add_subdirectory_ifdef(CONFIG_ENTROPY_HAS_DRIVER entropy) add_subdirectory_ifdef(CONFIG_SYS_CLOCK_EXISTS timer) diff --git a/drivers/ethernet/phy/CMakeLists.txt b/drivers/ethernet/phy/CMakeLists.txt index 57f312a8efa189..2592f9d4778e38 100644 --- a/drivers/ethernet/phy/CMakeLists.txt +++ b/drivers/ethernet/phy/CMakeLists.txt @@ -1,5 +1,3 @@ # SPDX-License-Identifier: Apache-2.0 -zephyr_library() - zephyr_library_sources_ifdef(CONFIG_PHY_GENERIC_MII phy_mii.c) diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index cd0153c6d2f664..cff0a84be10411 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig @@ -1,6 +1,11 @@ # Misc network drivers configuration options # SPDX-License-Identifier: Apache-2.0 +menuconfig NET_DRIVERS + bool "Network Drivers" + +if NET_DRIVERS + # # PPP options # @@ -90,8 +95,7 @@ endif # NET_PPP # SLIP options # menuconfig SLIP - bool "SLIP driver" - depends on (!QEMU_TARGET || NET_QEMU_SLIP) + bool "SLIP driver" if !QEMU_TARGET depends on NET_NATIVE select UART_PIPE select UART_INTERRUPT_DRIVEN @@ -149,3 +153,5 @@ module-help = Sets log level for network loopback driver. source "subsys/net/Kconfig.template.log_config.net" endif + +endif # NET_DRIVERS diff --git a/samples/net/cloud/tagoio_http_post/overlay-modem.conf b/samples/net/cloud/tagoio_http_post/overlay-modem.conf index cc14875d751440..4256d82f6da8a6 100644 --- a/samples/net/cloud/tagoio_http_post/overlay-modem.conf +++ b/samples/net/cloud/tagoio_http_post/overlay-modem.conf @@ -14,6 +14,7 @@ CONFIG_NET_CONNECTION_MANAGER=y # PPP networking support CONFIG_NET_NATIVE=y +CONFIG_NET_DRIVERS=y CONFIG_NET_PPP=y CONFIG_NET_L2_PPP=y CONFIG_NET_L2_PPP_TIMEOUT=10000 diff --git a/samples/net/gsm_modem/prj.conf b/samples/net/gsm_modem/prj.conf index 36e5996e08e569..3bb6689386ec1b 100644 --- a/samples/net/gsm_modem/prj.conf +++ b/samples/net/gsm_modem/prj.conf @@ -6,6 +6,7 @@ CONFIG_MODEM=y CONFIG_MODEM_GSM_PPP=y # PPP networking support +CONFIG_NET_DRIVERS=y CONFIG_NET_PPP=y CONFIG_NET_L2_PPP=y CONFIG_NET_NATIVE=y diff --git a/samples/net/sockets/echo_server/overlay-ppp.conf b/samples/net/sockets/echo_server/overlay-ppp.conf index 84237bea9bf642..156b981eb00924 100644 --- a/samples/net/sockets/echo_server/overlay-ppp.conf +++ b/samples/net/sockets/echo_server/overlay-ppp.conf @@ -1,3 +1,4 @@ +CONFIG_NET_DRIVERS=y CONFIG_NET_PPP=y CONFIG_NET_L2_PPP=y CONFIG_NET_STATISTICS_PPP=y diff --git a/samples/subsys/mgmt/updatehub/overlay-modem.conf b/samples/subsys/mgmt/updatehub/overlay-modem.conf index c21f4f1ce137b6..75ecbb3f58c409 100644 --- a/samples/subsys/mgmt/updatehub/overlay-modem.conf +++ b/samples/subsys/mgmt/updatehub/overlay-modem.conf @@ -18,6 +18,7 @@ CONFIG_MODEM_GSM_PPP=y CONFIG_MODEM_GSM_APN="" # PPP networking support +CONFIG_NET_DRIVERS=y CONFIG_NET_NATIVE=y CONFIG_NET_PPP=y CONFIG_NET_L2_PPP=y diff --git a/tests/drivers/build_all/modem/modem.conf b/tests/drivers/build_all/modem/modem.conf index 7e2494597d3e4d..5bdfb9415c2ffb 100644 --- a/tests/drivers/build_all/modem/modem.conf +++ b/tests/drivers/build_all/modem/modem.conf @@ -5,6 +5,7 @@ CONFIG_SERIAL=y CONFIG_TEST_UART=y CONFIG_NETWORKING=y CONFIG_NET_IPV4=y +CONFIG_NET_DRIVERS=y CONFIG_NET_PPP=y CONFIG_NET_L2_PPP=y CONFIG_MODEM=y diff --git a/tests/net/all/prj.conf b/tests/net/all/prj.conf index 69d49b4ff0e5f2..0afdb163ff566e 100644 --- a/tests/net/all/prj.conf +++ b/tests/net/all/prj.conf @@ -321,6 +321,7 @@ CONFIG_NET_LLDP_TX_HOLD=2 CONFIG_NET_LLDP_TX_INTERVAL=3 # Loopback +CONFIG_NET_DRIVERS=y CONFIG_NET_LOOPBACK_LOG_LEVEL_DBG=y CONFIG_NET_LOOPBACK=y diff --git a/tests/net/lib/dns_sd/prj-no-ipv6.conf b/tests/net/lib/dns_sd/prj-no-ipv6.conf index 34d3e7f111391d..0f04600e46b435 100644 --- a/tests/net/lib/dns_sd/prj-no-ipv6.conf +++ b/tests/net/lib/dns_sd/prj-no-ipv6.conf @@ -1,6 +1,7 @@ # Networking config CONFIG_NETWORKING=y CONFIG_NET_TEST=y +CONFIG_NET_DRIVERS=y CONFIG_NET_LOOPBACK=y CONFIG_NET_IPV4=y CONFIG_NET_IPV6=y diff --git a/tests/net/lib/dns_sd/prj.conf b/tests/net/lib/dns_sd/prj.conf index 4b49f7c53badae..523912e9f31de3 100644 --- a/tests/net/lib/dns_sd/prj.conf +++ b/tests/net/lib/dns_sd/prj.conf @@ -1,6 +1,7 @@ # Networking config CONFIG_NETWORKING=y CONFIG_NET_TEST=y +CONFIG_NET_DRIVERS=y CONFIG_NET_LOOPBACK=y CONFIG_NET_IPV4=y CONFIG_NET_IPV6=y diff --git a/tests/net/ppp/driver/prj.conf b/tests/net/ppp/driver/prj.conf index c3bde73c8afe50..1b60d3980f2075 100644 --- a/tests/net/ppp/driver/prj.conf +++ b/tests/net/ppp/driver/prj.conf @@ -5,6 +5,7 @@ CONFIG_NET_UDP=y CONFIG_NET_TCP=n CONFIG_NET_IPV4=y CONFIG_NET_MAX_CONTEXTS=4 +CONFIG_NET_DRIVERS=y CONFIG_NET_PPP=y CONFIG_NET_L2_PPP=y CONFIG_NET_L2_DUMMY=n diff --git a/tests/net/socket/getaddrinfo/prj.conf b/tests/net/socket/getaddrinfo/prj.conf index 957244b34ad9d7..924379f785edf4 100644 --- a/tests/net/socket/getaddrinfo/prj.conf +++ b/tests/net/socket/getaddrinfo/prj.conf @@ -4,6 +4,7 @@ CONFIG_NEWLIB_LIBC=y # Networking config CONFIG_NETWORKING=y CONFIG_NET_TEST=y +CONFIG_NET_DRIVERS=y CONFIG_NET_LOOPBACK=y CONFIG_NET_IPV4=y CONFIG_NET_IPV6=y diff --git a/tests/net/socket/getnameinfo/prj.conf b/tests/net/socket/getnameinfo/prj.conf index 4a1c4ed644097f..d65db776fe1efd 100644 --- a/tests/net/socket/getnameinfo/prj.conf +++ b/tests/net/socket/getnameinfo/prj.conf @@ -4,6 +4,7 @@ CONFIG_NEWLIB_LIBC=y # Networking config CONFIG_NETWORKING=y CONFIG_NET_TEST=y +CONFIG_NET_DRIVERS=y CONFIG_NET_LOOPBACK=y CONFIG_NET_IPV4=y CONFIG_NET_IPV6=y diff --git a/tests/net/socket/misc/prj.conf b/tests/net/socket/misc/prj.conf index 78e88cd83cf3db..5e44dcb913e8fd 100644 --- a/tests/net/socket/misc/prj.conf +++ b/tests/net/socket/misc/prj.conf @@ -4,6 +4,7 @@ CONFIG_NEWLIB_LIBC=y # Networking config CONFIG_NETWORKING=y CONFIG_NET_TEST=y +CONFIG_NET_DRIVERS=y CONFIG_NET_LOOPBACK=y CONFIG_NET_IPV4=y CONFIG_NET_IPV6=y diff --git a/tests/net/socket/poll/prj.conf b/tests/net/socket/poll/prj.conf index 35b357e0bde19e..966109ee2e243f 100644 --- a/tests/net/socket/poll/prj.conf +++ b/tests/net/socket/poll/prj.conf @@ -25,4 +25,5 @@ CONFIG_ZTEST_STACKSIZE=1280 CONFIG_ZTEST=y CONFIG_NET_TEST=y +CONFIG_NET_DRIVERS=y CONFIG_NET_LOOPBACK=y diff --git a/tests/net/socket/register/prj.conf b/tests/net/socket/register/prj.conf index 3d66ea421b47e7..d2b3e01b6c0cf8 100644 --- a/tests/net/socket/register/prj.conf +++ b/tests/net/socket/register/prj.conf @@ -1,6 +1,7 @@ CONFIG_ZTEST=y CONFIG_NETWORKING=y CONFIG_NET_TEST=y +CONFIG_NET_DRIVERS=y CONFIG_NET_LOOPBACK=y CONFIG_NET_IPV4=y CONFIG_NET_IPV6=y diff --git a/tests/net/socket/select/prj.conf b/tests/net/socket/select/prj.conf index 1f909cc9ef61ca..2db9280d99f13a 100644 --- a/tests/net/socket/select/prj.conf +++ b/tests/net/socket/select/prj.conf @@ -4,6 +4,7 @@ CONFIG_NEWLIB_LIBC=y # Networking config CONFIG_NETWORKING=y CONFIG_NET_TEST=y +CONFIG_NET_DRIVERS=y CONFIG_NET_LOOPBACK=y CONFIG_NET_IPV4=n CONFIG_NET_IPV6=y diff --git a/tests/net/socket/socketpair/prj.conf b/tests/net/socket/socketpair/prj.conf index 97fa3bf991fe2d..fb3971ca0fe64b 100644 --- a/tests/net/socket/socketpair/prj.conf +++ b/tests/net/socket/socketpair/prj.conf @@ -4,6 +4,7 @@ CONFIG_NEWLIB_LIBC=y # Networking config CONFIG_NETWORKING=y CONFIG_NET_TEST=y +CONFIG_NET_DRIVERS=y CONFIG_NET_LOOPBACK=y CONFIG_NET_IPV4=y CONFIG_NET_IPV6=y diff --git a/tests/net/socket/tcp/prj.conf b/tests/net/socket/tcp/prj.conf index 2c4c44b3b95289..18b54307ecc4ed 100644 --- a/tests/net/socket/tcp/prj.conf +++ b/tests/net/socket/tcp/prj.conf @@ -14,6 +14,7 @@ CONFIG_NET_SOCKETS_POSIX_NAMES=y CONFIG_POSIX_MAX_FDS=20 # Network driver config +CONFIG_NET_DRIVERS=y CONFIG_NET_LOOPBACK=y CONFIG_TEST_RANDOM_GENERATOR=y diff --git a/tests/net/socket/tls/prj.conf b/tests/net/socket/tls/prj.conf index 45d43ab7342d82..6bc80878d08815 100644 --- a/tests/net/socket/tls/prj.conf +++ b/tests/net/socket/tls/prj.conf @@ -20,6 +20,7 @@ CONFIG_NET_CONTEXT_RCVTIMEO=y CONFIG_POSIX_MAX_FDS=20 # Network driver config +CONFIG_NET_DRIVERS=y CONFIG_NET_LOOPBACK=y CONFIG_TEST_RANDOM_GENERATOR=y diff --git a/tests/net/socket/tls_ext/prj.conf b/tests/net/socket/tls_ext/prj.conf index 9cf33523521fb0..faf6d1e345da3b 100644 --- a/tests/net/socket/tls_ext/prj.conf +++ b/tests/net/socket/tls_ext/prj.conf @@ -6,6 +6,7 @@ CONFIG_ZTEST=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_NETWORKING=y CONFIG_NET_TEST=y +CONFIG_NET_DRIVERS=y CONFIG_NET_LOOPBACK=y CONFIG_NET_IPV4=y CONFIG_NET_TCP=y diff --git a/tests/net/socket/websocket/prj.conf b/tests/net/socket/websocket/prj.conf index e6a50262e166a2..fbf14edf9a96bf 100644 --- a/tests/net/socket/websocket/prj.conf +++ b/tests/net/socket/websocket/prj.conf @@ -6,6 +6,7 @@ CONFIG_NET_IPV6=y CONFIG_NET_TCP=y CONFIG_NET_SHELL=y CONFIG_NET_STATISTICS=y +CONFIG_NET_DRIVERS=y CONFIG_NET_LOOPBACK=y # Sockets diff --git a/tests/net/trickle/prj.conf b/tests/net/trickle/prj.conf index d2ff49ce183104..a8f32d5fb9b9ce 100644 --- a/tests/net/trickle/prj.conf +++ b/tests/net/trickle/prj.conf @@ -16,5 +16,6 @@ CONFIG_NET_BUF_TX_COUNT=5 CONFIG_NET_TRICKLE=y CONFIG_ZTEST=y CONFIG_ZTEST_STACKSIZE=1024 +CONFIG_NET_DRIVERS=y CONFIG_NET_LOOPBACK=y CONFIG_NET_IPV6_MLD=n