From 8a7bd9f7c3d0451ce95c05f6b3cb5d9e6d03c3d0 Mon Sep 17 00:00:00 2001 From: Marcelo Roberto Jimenez Date: Sat, 11 Oct 2025 13:24:45 -0300 Subject: [PATCH 1/2] drivers: ethernet: Run clang-format before applying a patch This patch just formats the file before the real patch so that whitespace changes do not mix with the real code changes. Signed-off-by: Marcelo Roberto Jimenez --- drivers/ethernet/eth_slip_tap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/ethernet/eth_slip_tap.c b/drivers/ethernet/eth_slip_tap.c index 8af5f587d7947..11c929348545b 100644 --- a/drivers/ethernet/eth_slip_tap.c +++ b/drivers/ethernet/eth_slip_tap.c @@ -6,7 +6,7 @@ */ #define LOG_MODULE_NAME eth_slip_tap -#define LOG_LEVEL CONFIG_ETHERNET_LOG_LEVEL +#define LOG_LEVEL CONFIG_ETHERNET_LOG_LEVEL #include LOG_MODULE_REGISTER(LOG_MODULE_NAME); @@ -22,7 +22,7 @@ static enum ethernet_hw_caps eth_capabilities(const struct device *dev) return ETHERNET_HW_VLAN #if defined(CONFIG_NET_LLDP) - | ETHERNET_LLDP + | ETHERNET_LLDP #endif ; } @@ -34,7 +34,7 @@ static const struct ethernet_api slip_if_api = { .send = slip_send, }; -#define _SLIP_L2_LAYER ETHERNET_L2 +#define _SLIP_L2_LAYER ETHERNET_L2 #define _SLIP_L2_CTX_TYPE NET_L2_GET_CTX_TYPE(ETHERNET_L2) ETH_NET_DEVICE_INIT(slip, CONFIG_SLIP_DRV_NAME, From 28f7cb1ced251a7cd9397df70b2cf5f8f87ba9f3 Mon Sep 17 00:00:00 2001 From: Marcelo Roberto Jimenez Date: Sat, 11 Oct 2025 13:27:49 -0300 Subject: [PATCH 2/2] drivers: ethernet: Add promiscuous mode to slip interface Slip is naturally promiscuous, so this patch does nothing but acknowledge that. Promiscuous mode in slip is important to allow the interface to be added to a bridge. Signed-off-by: Marcelo Roberto Jimenez --- drivers/ethernet/eth_slip_tap.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/ethernet/eth_slip_tap.c b/drivers/ethernet/eth_slip_tap.c index 11c929348545b..537ce74af0ef1 100644 --- a/drivers/ethernet/eth_slip_tap.c +++ b/drivers/ethernet/eth_slip_tap.c @@ -23,15 +23,34 @@ static enum ethernet_hw_caps eth_capabilities(const struct device *dev) return ETHERNET_HW_VLAN #if defined(CONFIG_NET_LLDP) | ETHERNET_LLDP +#endif +#if defined(CONFIG_NET_PROMISCUOUS_MODE) + | ETHERNET_PROMISC_MODE #endif ; } +static int eth_slip_tap_set_config(const struct device *dev, enum ethernet_config_type type, + const struct ethernet_config *config) +{ + switch (type) { +#if defined(CONFIG_NET_PROMISCUOUS_MODE) + case ETHERNET_CONFIG_TYPE_PROMISC_MODE: + return 0; +#endif /* CONFIG_NET_PROMISCUOUS_MODE */ + default: + break; + } + + return -ENOTSUP; +} + static const struct ethernet_api slip_if_api = { .iface_api.init = slip_iface_init, .get_capabilities = eth_capabilities, .send = slip_send, + .set_config = eth_slip_tap_set_config, }; #define _SLIP_L2_LAYER ETHERNET_L2