Commit c3fac651 authored by Torsten Rasmussen's avatar Torsten Rasmussen Committed by Christopher Friedt
Browse files

drivers: net: adding NET_DRIVERS menuconfig



Fixes: #38403

Adding NET_DRIVERS menuconfig so that network drivers are grouped
together in its own menu entry under drivers, similar to most other
drivers.

This further has the advantages that `CONFIG_NET_DRIVERS` can be used
for testing to determine if network drivers has been selected.

This changed revealed a dependency loop where both `select` (for SLIP)
and `depends` (for PPP) which both depends on NET_DRIVERS` where in use
in the dependency tree for Qemu networking, especially NET_SLIP_TAP.

This is handled by defaulting `NET_DRIVERS` to `y` when building for a
Qemu target.
`SLIP` had a dependency to `!QEMU_TARGET || NET_QEMU_SLIP`. This is
changed so that SLIP prompt depends on `!QEMU_TARGET` which provides
full user control in hardware but makes the symbol promptless on Qemu
targets.

Signed-off-by: default avatarTorsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
parent 30eadf75
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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
+1 −1
Original line number Diff line number Diff line
@@ -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)
+0 −2
Original line number Diff line number Diff line
# SPDX-License-Identifier: Apache-2.0

zephyr_library()

zephyr_library_sources_ifdef(CONFIG_PHY_GENERIC_MII	 phy_mii.c)
+8 −2
Original line number Diff line number Diff line
# 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
+1 −0
Original line number Diff line number Diff line
@@ -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
Loading