70aed850d13b4cd0b443230b3ea097e091421735
[openwrt/staging/pepe2k.git] /
1 From 947acacab5ea151291b861cdfbde16ff5cf1b08c Mon Sep 17 00:00:00 2001
2 From: Christian Marangi <ansuelsmth@gmail.com>
3 Date: Mon, 29 May 2023 18:32:41 +0200
4 Subject: [PATCH 11/13] leds: trigger: netdev: expose netdev trigger modes in
5 linux include
6
7 Expose netdev trigger modes to make them accessible by LED driver that
8 will support netdev trigger for hw control.
9
10 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
11 Reviewed-by: Andrew Lunn <andrew@lunn.ch>
12 Signed-off-by: David S. Miller <davem@davemloft.net>
13 ---
14 drivers/leds/trigger/ledtrig-netdev.c | 9 ---------
15 include/linux/leds.h | 10 ++++++++++
16 2 files changed, 10 insertions(+), 9 deletions(-)
17
18 --- a/drivers/leds/trigger/ledtrig-netdev.c
19 +++ b/drivers/leds/trigger/ledtrig-netdev.c
20 @@ -56,15 +56,6 @@ struct led_netdev_data {
21 bool hw_control;
22 };
23
24 -enum led_trigger_netdev_modes {
25 - TRIGGER_NETDEV_LINK = 0,
26 - TRIGGER_NETDEV_TX,
27 - TRIGGER_NETDEV_RX,
28 -
29 - /* Keep last */
30 - __TRIGGER_NETDEV_MAX,
31 -};
32 -
33 static void set_baseline_state(struct led_netdev_data *trigger_data)
34 {
35 int current_brightness;
36 --- a/include/linux/leds.h
37 +++ b/include/linux/leds.h
38 @@ -527,6 +527,16 @@ static inline void *led_get_trigger_data
39
40 #endif /* CONFIG_LEDS_TRIGGERS */
41
42 +/* Trigger specific enum */
43 +enum led_trigger_netdev_modes {
44 + TRIGGER_NETDEV_LINK = 0,
45 + TRIGGER_NETDEV_TX,
46 + TRIGGER_NETDEV_RX,
47 +
48 + /* Keep last */
49 + __TRIGGER_NETDEV_MAX,
50 +};
51 +
52 /* Trigger specific functions */
53 #ifdef CONFIG_LEDS_TRIGGER_DISK
54 void ledtrig_disk_activity(bool write);