Skip to content

Commit 6be9666

Browse files
jkrautmacherfabiobaltieri
authored andcommitted
drivers: eth: Enable LLDP on STM32
With the current LLDP implementation in Zephyr the support for it has to be enabled in the ethernet driver. This commit adds exactly this capability to the STM32 HAL based ethernet driver. Signed-off-by: Jan Krautmacher <[email protected]>
1 parent 7a3e1a7 commit 6be9666

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/ethernet/eth_stm32_hal.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME);
2929
#include <zephyr/drivers/clock_control/stm32_clock_control.h>
3030
#include <zephyr/drivers/pinctrl.h>
3131
#include <zephyr/irq.h>
32+
#include <zephyr/net/lldp.h>
3233

3334
#if defined(CONFIG_PTP_CLOCK_STM32_HAL)
3435
#include <zephyr/drivers/ptp_clock.h>
@@ -959,6 +960,8 @@ static void eth_iface_init(struct net_if *iface)
959960

960961
net_if_carrier_off(iface);
961962

963+
net_lldp_set_lldpdu(iface);
964+
962965
if (is_first_init) {
963966
const struct eth_stm32_hal_dev_cfg *cfg = dev->config;
964967
/* Now that the iface is setup, we are safe to enable IRQs. */
@@ -980,6 +983,9 @@ static enum ethernet_hw_caps eth_stm32_hal_get_capabilities(const struct device
980983
#endif
981984
#if defined(CONFIG_PTP_CLOCK_STM32_HAL)
982985
| ETHERNET_PTP
986+
#endif
987+
#if defined(CONFIG_NET_LLDP)
988+
| ETHERNET_LLDP
983989
#endif
984990
;
985991
}

0 commit comments

Comments
 (0)