diff --git a/drivers/ethernet/Kconfig b/drivers/ethernet/Kconfig index dcc1ac1934b..4d7facdfff0 100644 --- a/drivers/ethernet/Kconfig +++ b/drivers/ethernet/Kconfig @@ -5,12 +5,21 @@ menuconfig ETH_DRIVER bool "Ethernet drivers" - default y - depends on NET_L2_ETHERNET + depends on NETWORKING depends on !NET_TEST + default y if NET_L2_ETHERNET if ETH_DRIVER +config ETH_DRIVER_RAW_MODE + bool "Ethernet driver without the MAC stack" + select NET_RAW_MODE + depends on !NET_L2_ETHERNET + help + This option enables using the drivers in a so-called "raw" mode, + i.e. without a MAC stack (the net L2 layer for ethernet will not + be built). + module = ETHERNET module-dep = LOG module-str = Log level for Ethernet driver @@ -74,7 +83,7 @@ endif # "Ethernet Drivers" config ETH_INIT_PRIORITY int "Ethernet driver init priority" default 80 - depends on NET_L2_ETHERNET + depends on NET_L2_ETHERNET || ETH_DRIVER help Ethernet device driver initialization priority. Do not mess with it unless you know what you are doing. diff --git a/drivers/ethernet/phy/Kconfig b/drivers/ethernet/phy/Kconfig index e14a27a398d..26446974995 100644 --- a/drivers/ethernet/phy/Kconfig +++ b/drivers/ethernet/phy/Kconfig @@ -3,8 +3,11 @@ # Copyright (c) 2021 IP-Logix Inc. # SPDX-License-Identifier: Apache-2.0 -menu "Ethernet PHY Drivers" - depends on NET_L2_ETHERNET +menuconfig ETH_PHY_DRIVER + bool "Ethernet PHY drivers" + default y if NET_L2_ETHERNET || ETH_DRIVER + +if ETH_PHY_DRIVER module = PHY module-dep = LOG @@ -63,4 +66,4 @@ config PHY_MONITOR_PERIOD periodically executed to detect and report any changes in the PHY link status to the operating system. -endmenu # "Ethernet PHY Drivers" +endif # "Ethernet PHY Drivers" diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index c83f0f42a08..e0167e80ccb 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig @@ -153,7 +153,6 @@ config SLIP_STATISTICS config SLIP_TAP bool "Use TAP interface to host" default y - select NET_L2_ETHERNET help In TAP the Ethernet frames are transferred over SLIP. diff --git a/include/zephyr/net/ethernet.h b/include/zephyr/net/ethernet.h index 6891a96efcd..0fb7c43c8ef 100644 --- a/include/zephyr/net/ethernet.h +++ b/include/zephyr/net/ethernet.h @@ -932,6 +932,7 @@ static inline bool net_eth_get_vlan_status(struct net_if *iface) } #endif +#if !defined(CONFIG_ETH_DRIVER_RAW_MODE) #if defined(CONFIG_NET_VLAN) #define Z_ETH_NET_DEVICE_INIT_INSTANCE(node_id, dev_id, name, instance, \ @@ -957,6 +958,17 @@ static inline bool net_eth_get_vlan_status(struct net_if *iface) NET_L2_GET_CTX_TYPE(ETHERNET_L2), mtu) #endif /* CONFIG_NET_VLAN */ +#else /* CONFIG_ETH_DRIVER_RAW_MODE */ + +#define Z_ETH_NET_DEVICE_INIT_INSTANCE(node_id, dev_id, name, instance, \ + init_fn, pm, data, config, prio, \ + api, mtu) \ + Z_DEVICE_STATE_DEFINE(dev_id); \ + Z_DEVICE_DEFINE(node_id, dev_id, name, init_fn, pm, data, \ + config, POST_KERNEL, prio, api, \ + &Z_DEVICE_STATE_NAME(dev_id)); +#endif /* CONFIG_ETH_DRIVER_RAW_MODE */ + #define Z_ETH_NET_DEVICE_INIT(node_id, dev_id, name, init_fn, pm, data, \ config, prio, api, mtu) \ Z_ETH_NET_DEVICE_INIT_INSTANCE(node_id, dev_id, name, 0, \ diff --git a/subsys/net/ip/Kconfig b/subsys/net/ip/Kconfig index a673c6524b0..4de15ada6d9 100644 --- a/subsys/net/ip/Kconfig +++ b/subsys/net/ip/Kconfig @@ -583,12 +583,6 @@ config NET_CONTEXT_RECV_PKTINFO This way user can get extra information about the received data in the socket. -config NET_TEST - bool "Network Testing" - help - Used for self-contained networking tests that do not require a - network device. - config NET_SLIP_TAP bool "TAP SLIP driver" depends on NET_QEMU_SLIP @@ -606,6 +600,12 @@ config NET_SLIP_TAP endif # NET_RAW_MODE +config NET_TEST + bool "Network Testing" + help + Used for self-contained networking tests that do not require a + network device. + config NET_PKT_RX_COUNT int "How many packet receives can be pending at the same time" default 14 if NET_L2_ETHERNET