2 deliverables, 1 open, 2 write – ADLINK CSA-5100 User Manual
Page 36: Deliverables, Open, Write
 
36
CSA-5100
6.2 Deliverables
The CSA-5100 SuperIO Watchdog Software deliver package (SuperIO_WDT-x.x.x.tar.gz) 
provides the following software components. 
 
superio_watchdog
(directory): Watchdog Driver
- src:
Watchdog Driver source code
- autorun.sh: Install script
- README: Quick guide
-
Makefile
superio_wdt_test
(directory): Watchdog Client
-watchdog-test.c:
Watchdog client source code
-Makefile
6.2.1 open
The watchdog provides an open() interface, which is “/dev/watchdog” handling. Seek is not 
supported in this feature. The Watchdog timer is started when a user application opens the 
watchdog module. The Watchdog Driver disables LAN bypass (BYPASS_LAN#) when the 
user opens the watchdog. 
 
PROTOTYPE 
static int open(struct inode *inode, struct file *file) 
 
DESCRIPTION 
This function is used to open “/dev/watchdog” handling. 
int open(const char *pathname, int flags) may be used in client to call this feature. 
 
PARAMETERS 
pathname
[IN] Pathname which locates watchdog device file.
flags
[IN] Access permission bits. “O_RDONLY” read only, “O_WRONLY” write only,
“O_RDWR” read/write. 
 
RETURN 
File descriptor: success 
-1: error 
6.2.2 write
The Watchdog Driver provides a write() interface. A write to a watchdog device is defined as 
a keepalive signal. After receiving a write call, the Watchdog Driver will do the watchdog 
feeding. 
 
As the content is not defined, any character will do except the character “V”, which is the 
signal for “Magic Close”. The driver will not disable the watchdog unless a specific magic 
character 'V' has been sent to “/dev/watchdog” just before closing the file. If the user space 
daemon closes the file without sending this special character, the driver will assume that the 
daemon (and user space in general) died, and will stop the watchdog without disabling it first. 
This will then cause a reboot if the watchdog is not re-opened in sufficient time.