can: add combined rx/tx LED trigger support
Add <ifname>-rxtx trigger, that will be activated both for tx as rx events. This trigger mimics "activity" LED for Ethernet devices. Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:

committed by
Marc Kleine-Budde

parent
fba6f9117a
commit
c54eb70e3b
@@ -61,6 +61,8 @@ struct can_priv {
|
||||
char tx_led_trig_name[CAN_LED_NAME_SZ];
|
||||
struct led_trigger *rx_led_trig;
|
||||
char rx_led_trig_name[CAN_LED_NAME_SZ];
|
||||
struct led_trigger *rxtx_led_trig;
|
||||
char rxtx_led_trig_name[CAN_LED_NAME_SZ];
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@@ -21,8 +21,10 @@ enum can_led_event {
|
||||
|
||||
#ifdef CONFIG_CAN_LEDS
|
||||
|
||||
/* keep space for interface name + "-tx"/"-rx" suffix and null terminator */
|
||||
#define CAN_LED_NAME_SZ (IFNAMSIZ + 4)
|
||||
/* keep space for interface name + "-tx"/"-rx"/"-rxtx"
|
||||
* suffix and null terminator
|
||||
*/
|
||||
#define CAN_LED_NAME_SZ (IFNAMSIZ + 6)
|
||||
|
||||
void can_led_event(struct net_device *netdev, enum can_led_event event);
|
||||
void devm_can_led_init(struct net_device *netdev);
|
||||
|
Reference in New Issue
Block a user