diff mbox series

[v3,6/9] tftp: implement support for LED status activity

Message ID 20240611231435.10366-7-ansuelsmth@gmail.com
State Changes Requested
Delegated to: Tom Rini
Headers show
Series misc: introduce STATUS LED activity function | expand

Commit Message

Christian Marangi June 11, 2024, 11:14 p.m. UTC
Implement support for LED status activity. If the feature is enabled,
make the defined ACTIVITY LED to signal traffic.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
 net/tftp.c | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/net/tftp.c b/net/tftp.c
index 2e335413492..0515dc34d4b 100644
--- a/net/tftp.c
+++ b/net/tftp.c
@@ -19,6 +19,7 @@ 
 #include <asm/global_data.h>
 #include <net/tftp.h>
 #include "bootp.h"
+#include <status_led.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -193,6 +194,9 @@  static void new_transfer(void)
 #ifdef CONFIG_CMD_TFTPPUT
 	tftp_put_final_block_sent = 0;
 #endif
+#ifdef CONFIG_LED_STATUS_ACTIVITY_ENABLE
+	status_led_activity_start(CONFIG_LED_STATUS_ACTIVITY);
+#endif
 }
 
 #ifdef CONFIG_CMD_TFTPPUT
@@ -302,6 +306,9 @@  static void tftp_complete(void)
 			time_start * 1000, "/s");
 	}
 	puts("\ndone\n");
+#ifdef CONFIG_LED_STATUS_ACTIVITY_ENABLE
+	status_led_activity_stop(CONFIG_LED_STATUS_ACTIVITY);
+#endif
 	if (!tftp_put_active)
 		efi_set_bootdev("Net", "", tftp_filename,
 				map_sysmem(tftp_load_addr, 0),