Lines Matching +full:watchdog +full:- +full:enable
1 // SPDX-License-Identifier: GPL-2.0
3 * Watchdog Driver Test Program
4 * - Tests all ioctls
5 * - Tests Magic Close - CONFIG_WATCHDOG_NOWAYOUT
6 * - Could be tested against softdog driver on systems that
7 * don't have watchdog hardware.
8 * - TODO:
9 * - Enhance test to add coverage for WDIOC_GETTEMP.
11 * Reference: Documentation/watchdog/watchdog-api.rst
24 #include <linux/watchdog.h>
34 {"enable", no_argument, NULL, 'e'},
50 * the PC Watchdog card to reset its internal timer so it doesn't trigger
64 * The main program. Run the program with "-d" to disable the card,
65 * or "-e" to enable the card.
74 printf("\nStopping watchdog ticks failed (%d)...\n", errno); in term()
76 printf("\nStopping watchdog ticks...\n"); in term()
83 printf(" -f, --file\t\tOpen watchdog device file\n"); in usage()
84 printf("\t\t\tDefault is /dev/watchdog\n"); in usage()
85 printf(" -i, --info\t\tShow watchdog_info\n"); in usage()
86 printf(" -s, --status\t\tGet status & supported features\n"); in usage()
87 printf(" -b, --bootstatus\tGet last boot status (Watchdog/POR)\n"); in usage()
88 printf(" -d, --disable\t\tTurn off the watchdog timer\n"); in usage()
89 printf(" -e, --enable\t\tTurn on the watchdog timer\n"); in usage()
90 printf(" -h, --help\t\tPrint the help message\n"); in usage()
91 printf(" -p, --pingrate=P\tSet ping rate to P seconds (default %d)\n", in usage()
93 printf(" -t, --timeout=T\tSet timeout to T seconds\n"); in usage()
94 printf(" -T, --gettimeout\tGet the timeout\n"); in usage()
95 printf(" -n, --pretimeout=T\tSet the pretimeout to T seconds\n"); in usage()
96 printf(" -N, --getpretimeout\tGet the pretimeout\n"); in usage()
97 printf(" -L, --gettimeleft\tGet the time left until timer expires\n"); in usage()
99 printf("Parameters are parsed left-to-right in real-time.\n"); in usage()
100 printf("Example: %s -d -t 10 -p 5 -e\n", progname); in usage()
101 printf("Example: %s -t 12 -T -n 7 -N\n", progname); in usage()
115 {WDIOF_ALARMONLY, "Watchdog triggers a management or other external alarm not a reboot"},
117 {WDIOS_DISABLECARD, "Turn off the watchdog timer"},
118 {WDIOS_ENABLECARD, "Turn on the watchdog timer"},
160 printf("Last boot is caused by: Power-On-Reset\n"); in print_boot_status()
178 char *file = "/dev/watchdog"; in main()
184 while ((c = getopt_long(argc, argv, sopts, lopts, NULL)) != -1) { in main()
191 if (fd == -1) { in main()
193 printf("Watchdog device (%s) not found.\n", file); in main()
195 printf("Run watchdog as root.\n"); in main()
197 printf("Watchdog device open failed %s\n", in main()
199 exit(-1); in main()
203 * Validate that `file` is a watchdog device in main()
214 while ((c = getopt_long(argc, argv, sopts, lopts, NULL)) != -1) { in main()
229 printf("Watchdog card disabled.\n"); in main()
239 printf("Watchdog card enabled.\n"); in main()
249 printf("Watchdog ping rate set to %u seconds.\n", ping_rate); in main()
270 printf("Watchdog timeout set to %u seconds.\n", flags); in main()
288 printf("Watchdog pretimeout set to %u seconds.\n", flags); in main()
335 printf("Watchdog Ticking Away!\n"); in main()
352 * enabled to ensure watchdog gets disabled on close. in main()
356 printf("Stopping watchdog ticks failed (%d)...\n", errno); in main()