b655892f | 19-Jun-2023 |
Christian Marangi <ansuelsmth@gmail.com> |
leds: trigger: netdev: expose hw_control status via sysfs
Expose hw_control status via sysfs for the netdev trigger to give userspace better understanding of the current state of the trigger and the
leds: trigger: netdev: expose hw_control status via sysfs
Expose hw_control status via sysfs for the netdev trigger to give userspace better understanding of the current state of the trigger and the LED.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> Acked-by: Lee Jones <lee@kernel.org> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
f22f95b9 | 19-Jun-2023 |
Christian Marangi <ansuelsmth@gmail.com> |
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 n
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 <ansuelsmth@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Acked-by: Lee Jones <lee@kernel.org> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
947acaca | 29-May-2023 |
Christian Marangi <ansuelsmth@gmail.com> |
leds: trigger: netdev: expose netdev trigger modes in linux include
Expose netdev trigger modes to make them accessible by LED driver that will support netdev trigger for hw control.
Signed-off-by:
leds: trigger: netdev: expose netdev trigger modes in linux include
Expose netdev trigger modes to make them accessible by LED driver that will support netdev trigger for hw control.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
0316cc56 | 29-May-2023 |
Christian Marangi <ansuelsmth@gmail.com> |
leds: trigger: netdev: init mode if hw control already active
On netdev trigger activation, hw control may be already active by default. If this is the case and a device is actually provided by hw_c
leds: trigger: netdev: init mode if hw control already active
On netdev trigger activation, hw control may be already active by default. If this is the case and a device is actually provided by hw_control_get_device(), init the already active mode and set the bool to hw_control bool to true to reflect the already set mode in the trigger_data.
Co-developed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
33ec0b53 | 29-May-2023 |
Andrew Lunn <andrew@lunn.ch> |
leds: trigger: netdev: validate configured netdev
The netdev which the LED should blink for is configurable in /sys/class/led/foo/device_name. Ensure when offloading that the configured netdev is th
leds: trigger: netdev: validate configured netdev
The netdev which the LED should blink for is configurable in /sys/class/led/foo/device_name. Ensure when offloading that the configured netdev is the same as the netdev the LED is associated with. If it is not, only perform software blinking.
Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
7c145a34 | 29-May-2023 |
Christian Marangi <ansuelsmth@gmail.com> |
leds: trigger: netdev: add support for LED hw control
Add support for LED hw control for the netdev trigger.
The trigger on calling set_baseline_state to configure a new mode, will do various check
leds: trigger: netdev: add support for LED hw control
Add support for LED hw control for the netdev trigger.
The trigger on calling set_baseline_state to configure a new mode, will do various check to verify if hw control can be used for the requested mode in can_hw_control() function.
It will first check if the LED driver supports hw control for the netdev trigger, then will use hw_control_is_supported() and finally will call hw_control_set() to apply the requested mode.
To use such mode, interval MUST be set to the default value and net_dev MUST be set. If one of these 2 value are not valid, hw control will never be used and normal software fallback is used.
The default interval value is moved to a define to make sure they are always synced.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
c84c80c7 | 29-May-2023 |
Christian Marangi <ansuelsmth@gmail.com> |
leds: trigger: netdev: reject interval store for hw_control
Reject interval store with hw_control enabled. It's are currently not supported and MUST be set to the default value with hw control enabl
leds: trigger: netdev: reject interval store for hw_control
Reject interval store with hw_control enabled. It's are currently not supported and MUST be set to the default value with hw control enabled.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
6352f25f | 29-May-2023 |
Christian Marangi <ansuelsmth@gmail.com> |
leds: trigger: netdev: add basic check for hw control support
Add basic check for hw control support. Check if the required API are defined and check if the defined trigger supported in hw control f
leds: trigger: netdev: add basic check for hw control support
Add basic check for hw control support. Check if the required API are defined and check if the defined trigger supported in hw control for the LED driver match netdev.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
4fd1b6d4 | 29-May-2023 |
Christian Marangi <ansuelsmth@gmail.com> |
leds: trigger: netdev: introduce check for possible hw control
Introduce function to check if the requested mode can use hw control in preparation for hw control support. Currently everything is han
leds: trigger: netdev: introduce check for possible hw control
Introduce function to check if the requested mode can use hw control in preparation for hw control support. Currently everything is handled in software so can_hw_control will always return false.
Add knob with the new value hw_control in trigger_data struct to set hw control possible. Useful for future implementation to implement in set_baseline_state() the required function to set the requested mode using LEDs hw control ops and in other function to reject set if hw control is currently active.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
af7320ec | 11-May-2023 |
Yang Li <yang.lee@linux.alibaba.com> |
leds: trigger: netdev: Remove NULL check before dev_{put, hold}
The call netdev_{put, hold} of dev_{put, hold} will check NULL, so there is no need to check before using dev_{put, hold}, remove it t
leds: trigger: netdev: Remove NULL check before dev_{put, hold}
The call netdev_{put, hold} of dev_{put, hold} will check NULL, so there is no need to check before using dev_{put, hold}, remove it to silence the warnings:
./drivers/leds/trigger/ledtrig-netdev.c:291:3-10: WARNING: NULL check before dev_{put, hold} functions is not needed. ./drivers/leds/trigger/ledtrig-netdev.c:401:2-9: WARNING: NULL check before dev_{put, hold} functions is not needed.
Reported-by: Abaci Robot <abaci@linux.alibaba.com> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=4929 Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Link: https://lore.kernel.org/r/20230511070820.52731-1-yang.lee@linux.alibaba.com Signed-off-by: Lee Jones <lee@kernel.org>
show more ...
|