1.\" Copyright (c) 1998,1999 Alex Nash 2.\" All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution. 12.\" 13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23.\" SUCH DAMAGE. 24.\" 25.\" $OpenBSD: wdt.4,v 1.5 2003/07/09 13:26:20 jmc Exp $ 26.\" 27.Dd April 25, 1999 28.Dt WDT 4 i386 29.Os 30.Sh NAME 31.Nm wdt 32.Nd ICS PCI-WDT500/501 watchdog timer device driver 33.Sh SYNOPSIS 34.Cd "wdt0 at pci? dev ? function ?" 35.Cd "option WDT_DISABLE_BUZZER" 36.Sh DESCRIPTION 37The 38.Nm 39driver provides support for the Industrial Computer Source 40PCI-WDT500 and PCI-WDT501 boards. 41.Pp 42For PCI-WDT500 boards, basic watchdog timer functionality is supported. 43For PCI-WDT501 boards, additional access to the onboard buzzer, 44isolated inputs, temperature, and power supply monitors is provided. 45To disable the onboard buzzer on PCI-WDT501 boards, add 46.Ic option WDT_DISABLE_BUZZER 47to your kernel configuration. 48.Pp 49By default the watchdog timer is set to 30 seconds and is refreshed 50by the kernel's timeout processing. 51If the kernel crashes, the watchdog 52timer is not reset and the system will reboot (assuming a proper connection 53is made between the WDT50x and motherboard). 54Alternatively, the watchdog 55can be reinitialized via a userland process which ensures that process 56scheduling, not just kernel timeout processing, is still taking place. 57See the 58.Dv WIOCSCHED 59.Xr ioctl 2 60below for more information. 61.Sh INTERFACE 62The 63.Nm 64driver is controlled via 65.Xr ioctl 2 66calls to 67.Pa /dev/wdt0 . 68The following commands are supported: 69.Bl -tag -width WIOCGETSTATE 70.It Dv WIOCGETSTATE 71Returns the current temperature and board status into the 72wdt_state structure pointer passed to 73.Xr ioctl 2 . 74See 75.Aq Pa dev/pci/wdt50x.h 76for the definition of the wdt_state structure and state bits. 77.It Dv WIOCSCHED 78Places the process into an infinite loop (interrupted only via a signal) 79to guarantee process scheduling. 80The driver utilizes the process' context to reinitialize the watchdog timeout. 81Should process scheduling fail, the timeout will not be reinitialized and the 82system will be rebooted. 83Note that it is possible to force a reboot by sending a 84.Dv SIGSTOP 85signal to a process in 86.Dv WIOCSCHED 87and waiting for the watchdog timer to expire. 88Since 89.Dv WIOCSCHED 90can have such dramatic consequences, it may only be issued by superuser 91processes regardless of the permissions on 92.Pa /dev/wdt0 . 93.El 94.Sh FILES 95.Bl -tag -width /usr/include/dev/pci/wdt50x.h -compact 96.It Pa /dev/wdt0 97watchdog control device 98.It Pa /usr/include/dev/pci/wdt50x.h 99structure and ioctl definitions 100.El 101.Sh SEE ALSO 102.Xr ioctl 2 , 103.Xr intro 4 , 104.Xr pci 4 105.Sh HISTORY 106The 107.Nm 108driver first appeared in 109.Ox 2.6 . 110.Sh BUGS 111The ioctl interface isn't generic. 112.Pp 113It's unwise to combine 114.Nm 115with 116.Xr ddb 4 117since the latter may prevent the former from resetting the 118watchdog timeout before it expires. 119