From f22f95b9ff1551c9bab13104131929f33d51f23f Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Mon, 19 Jun 2023 22:46:59 +0200 Subject: leds: trigger: netdev: add additional specific link duplex mode Add additional modes for specific link duplex. Use ethtool APIs to get the current link duplex and enable the LED accordingly. Under netdev event handler the rtnl lock is already held and is not needed to be set to access ethtool APIs. This is especially useful for PHY and Switch that supports LEDs hw control for specific link duplex. Add additional modes: - half_duplex: Turn on LED when link is half duplex - full_duplex: Turn on LED when link is full duplex Signed-off-by: Christian Marangi Reviewed-by: Andrew Lunn Acked-by: Lee Jones Signed-off-by: Jakub Kicinski --- include/linux/leds.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/linux/leds.h') diff --git a/include/linux/leds.h b/include/linux/leds.h index 126b79019429..3a65ff72bb04 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h @@ -558,6 +558,8 @@ enum led_trigger_netdev_modes { TRIGGER_NETDEV_LINK_10, TRIGGER_NETDEV_LINK_100, TRIGGER_NETDEV_LINK_1000, + TRIGGER_NETDEV_HALF_DUPLEX, + TRIGGER_NETDEV_FULL_DUPLEX, TRIGGER_NETDEV_TX, TRIGGER_NETDEV_RX, -- cgit