diff --git a/drivers/CMakeLists.txt b/drivers/CMakeLists.txt index f0236ef653..e1dbab7e1a 100644 --- a/drivers/CMakeLists.txt +++ b/drivers/CMakeLists.txt @@ -35,6 +35,7 @@ add_subdirectory_ifdef(CONFIG_EDAC edac) add_subdirectory_ifdef(CONFIG_EEPROM eeprom) add_subdirectory_ifdef(CONFIG_ENTROPY_GENERATOR entropy) add_subdirectory_ifdef(CONFIG_ESPI espi) +add_subdirectory_ifdef(CONFIG_ETH_DRIVER ethernet) add_subdirectory_ifdef(CONFIG_FLASH flash) add_subdirectory_ifdef(CONFIG_FPGA fpga) add_subdirectory_ifdef(CONFIG_FUEL_GAUGE fuel_gauge) @@ -61,7 +62,6 @@ add_subdirectory_ifdef(CONFIG_MIPI_DSI mipi_dsi) add_subdirectory_ifdef(CONFIG_MM_DRV mm) add_subdirectory_ifdef(CONFIG_MODEM modem) add_subdirectory_ifdef(CONFIG_NET_DRIVERS net) -add_subdirectory_ifdef(CONFIG_NET_L2_ETHERNET ethernet) add_subdirectory_ifdef(CONFIG_PECI peci) add_subdirectory_ifdef(CONFIG_PINCTRL pinctrl) add_subdirectory_ifdef(CONFIG_PM_CPU_OPS pm_cpu_ops) diff --git a/drivers/ethernet/CMakeLists.txt b/drivers/ethernet/CMakeLists.txt index def0c5bf18..fcc43cf77f 100644 --- a/drivers/ethernet/CMakeLists.txt +++ b/drivers/ethernet/CMakeLists.txt @@ -2,6 +2,11 @@ zephyr_library() zephyr_library_property(ALLOW_EMPTY TRUE) +zephyr_library_include_directories(${ZEPHYR_BASE}/subsys/net/l2) + +zephyr_library_sources_ifdef(CONFIG_ETH_DRIVER_RAW_MODE + eth_raw.c + ) zephyr_library_sources_ifdef(CONFIG_ETH_GECKO eth_gecko.c diff --git a/drivers/ethernet/eth_raw.c b/drivers/ethernet/eth_raw.c new file mode 100644 index 0000000000..69ab3b528f --- /dev/null +++ b/drivers/ethernet/eth_raw.c @@ -0,0 +1,48 @@ +/** + * @file + * @brief Ethernet Driver raw mode + * + * This file contains a collection of functions called from the ethernet drivers + * to the missing upper layer. + */ + +/* + * Copyright 2024 Basalte bv + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +__weak void ethernet_init(struct net_if *iface) +{ + ARG_UNUSED(iface); +} + +__weak void net_eth_carrier_on(struct net_if *iface) +{ + ARG_UNUSED(iface); +} + +__weak void net_eth_carrier_off(struct net_if *iface) +{ + ARG_UNUSED(iface); +} + +__weak int net_recv_data(struct net_if *iface, struct net_pkt *pkt) +{ + ARG_UNUSED(iface); + ARG_UNUSED(pkt); + + return -ENOTSUP; +} + +__weak void net_if_carrier_on(struct net_if *iface) +{ + ARG_UNUSED(iface); +} + +__weak void net_if_carrier_off(struct net_if *iface) +{ + ARG_UNUSED(iface); +}