Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
pcwd.c File Reference
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/timer.h>
#include <linux/jiffies.h>
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
#include <linux/reboot.h>
#include <linux/init.h>
#include <linux/fs.h>
#include <linux/isa.h>
#include <linux/ioport.h>
#include <linux/spinlock.h>
#include <linux/uaccess.h>
#include <linux/io.h>

Go to the source code of this file.

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define WATCHDOG_VERSION   "1.20"
 
#define WATCHDOG_DATE   "18 Feb 2007"
 
#define WATCHDOG_DRIVER_NAME   "ISA-PC Watchdog"
 
#define WATCHDOG_NAME   "pcwd"
 
#define DRIVER_VERSION   WATCHDOG_DRIVER_NAME " driver, v" WATCHDOG_VERSION "\n"
 
#define PCWD_REVISION_A   1
 
#define PCWD_REVISION_C   2
 
#define PCWD_ISA_NR_CARDS   3
 
#define WD_WDRST   0x01 /* Previously reset state */
 
#define WD_T110   0x02 /* Temperature overheat sense */
 
#define WD_HRTBT   0x04 /* Heartbeat sense */
 
#define WD_RLY2   0x08 /* External relay triggered */
 
#define WD_SRLY2   0x80 /* Software external relay triggered */
 
#define WD_REVC_WTRP   0x01 /* Watchdog Trip status */
 
#define WD_REVC_HRBT   0x02 /* Watchdog Heartbeat */
 
#define WD_REVC_TTRP   0x04 /* Temperature Trip status */
 
#define WD_REVC_RL2A
 
#define WD_REVC_RL1A   0x10 /* Relay 1 active */
 
#define WD_REVC_R2DS   0x40 /* Relay 2 disable */
 
#define WD_REVC_RLY2   0x80 /* Relay 2 activated? */
 
#define WD_WDIS   0x10 /* Watchdog Disabled */
 
#define WD_ENTP   0x20 /* Watchdog Enable Temperature Trip */
 
#define WD_SSEL
 
#define WD_WCMD   0x80 /* Watchdog Command Mode */
 
#define ISA_COMMAND_TIMEOUT   1000
 
#define CMD_ISA_IDLE   0x00
 
#define CMD_ISA_VERSION_INTEGER   0x01
 
#define CMD_ISA_VERSION_TENTH   0x02
 
#define CMD_ISA_VERSION_HUNDRETH   0x03
 
#define CMD_ISA_VERSION_MINOR   0x04
 
#define CMD_ISA_SWITCH_SETTINGS   0x05
 
#define CMD_ISA_RESET_PC   0x06
 
#define CMD_ISA_ARM_0   0x07
 
#define CMD_ISA_ARM_30   0x08
 
#define CMD_ISA_ARM_60   0x09
 
#define CMD_ISA_DELAY_TIME_2SECS   0x0A
 
#define CMD_ISA_DELAY_TIME_4SECS   0x0B
 
#define CMD_ISA_DELAY_TIME_8SECS   0x0C
 
#define CMD_ISA_RESET_RELAYS   0x0D
 
#define WDT_INTERVAL   (HZ/2+1)
 
#define QUIET   0 /* Default */
 
#define VERBOSE   1 /* Verbose */
 
#define DEBUG   2 /* print fancy stuff too */
 
#define WATCHDOG_HEARTBEAT   0
 

Functions

 module_param (debug, int, 0)
 
 MODULE_PARM_DESC (debug,"Debug level: 0=Quiet, 1=Verbose, 2=Debug (default=0)")
 
 module_param (heartbeat, int, 0)
 
 MODULE_PARM_DESC (heartbeat,"Watchdog heartbeat in seconds. ""(2 <= heartbeat <= 7200 or 0=delay-time from dip-switches, default="__MODULE_STRING(WATCHDOG_HEARTBEAT)")")
 
 module_param (nowayout, bool, 0)
 
 MODULE_PARM_DESC (nowayout,"Watchdog cannot be stopped once started (default="__MODULE_STRING(WATCHDOG_NOWAYOUT)")")
 
 module_init (pcwd_init_module)
 
 module_exit (pcwd_cleanup_module)
 
 MODULE_AUTHOR ("Ken Hollis <[email protected]>, ""Wim Van Sebroeck <[email protected]>")
 
 MODULE_DESCRIPTION ("Berkshire ISA-PC Watchdog driver")
 
 MODULE_VERSION (WATCHDOG_VERSION)
 
 MODULE_LICENSE ("GPL")
 
 MODULE_ALIAS_MISCDEV (WATCHDOG_MINOR)
 
 MODULE_ALIAS_MISCDEV (TEMP_MINOR)
 

Macro Definition Documentation

#define CMD_ISA_ARM_0   0x07

Definition at line 137 of file pcwd.c.

#define CMD_ISA_ARM_30   0x08

Definition at line 138 of file pcwd.c.

#define CMD_ISA_ARM_60   0x09

Definition at line 139 of file pcwd.c.

#define CMD_ISA_DELAY_TIME_2SECS   0x0A

Definition at line 140 of file pcwd.c.

#define CMD_ISA_DELAY_TIME_4SECS   0x0B

Definition at line 141 of file pcwd.c.

#define CMD_ISA_DELAY_TIME_8SECS   0x0C

Definition at line 142 of file pcwd.c.

#define CMD_ISA_IDLE   0x00

Definition at line 130 of file pcwd.c.

#define CMD_ISA_RESET_PC   0x06

Definition at line 136 of file pcwd.c.

#define CMD_ISA_RESET_RELAYS   0x0D

Definition at line 143 of file pcwd.c.

#define CMD_ISA_SWITCH_SETTINGS   0x05

Definition at line 135 of file pcwd.c.

#define CMD_ISA_VERSION_HUNDRETH   0x03

Definition at line 133 of file pcwd.c.

#define CMD_ISA_VERSION_INTEGER   0x01

Definition at line 131 of file pcwd.c.

#define CMD_ISA_VERSION_MINOR   0x04

Definition at line 134 of file pcwd.c.

#define CMD_ISA_VERSION_TENTH   0x02

Definition at line 132 of file pcwd.c.

#define DEBUG   2 /* print fancy stuff too */

Definition at line 191 of file pcwd.c.

#define DRIVER_VERSION   WATCHDOG_DRIVER_NAME " driver, v" WATCHDOG_VERSION "\n"

Definition at line 80 of file pcwd.c.

#define ISA_COMMAND_TIMEOUT   1000

Definition at line 127 of file pcwd.c.

#define PCWD_ISA_NR_CARDS   3

Definition at line 98 of file pcwd.c.

#define PCWD_REVISION_A   1

Definition at line 89 of file pcwd.c.

#define PCWD_REVISION_C   2

Definition at line 90 of file pcwd.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 54 of file pcwd.c.

#define QUIET   0 /* Default */

Definition at line 189 of file pcwd.c.

#define VERBOSE   1 /* Verbose */

Definition at line 190 of file pcwd.c.

#define WATCHDOG_DATE   "18 Feb 2007"

Definition at line 77 of file pcwd.c.

#define WATCHDOG_DRIVER_NAME   "ISA-PC Watchdog"

Definition at line 78 of file pcwd.c.

#define WATCHDOG_HEARTBEAT   0

Definition at line 198 of file pcwd.c.

#define WATCHDOG_NAME   "pcwd"

Definition at line 79 of file pcwd.c.

#define WATCHDOG_VERSION   "1.20"

Definition at line 76 of file pcwd.c.

#define WD_ENTP   0x20 /* Watchdog Enable Temperature Trip */

Definition at line 121 of file pcwd.c.

#define WD_HRTBT   0x04 /* Heartbeat sense */

Definition at line 108 of file pcwd.c.

#define WD_REVC_HRBT   0x02 /* Watchdog Heartbeat */

Definition at line 113 of file pcwd.c.

#define WD_REVC_R2DS   0x40 /* Relay 2 disable */

Definition at line 117 of file pcwd.c.

#define WD_REVC_RL1A   0x10 /* Relay 1 active */

Definition at line 116 of file pcwd.c.

#define WD_REVC_RL2A
Value:
0x08 /* Relay 2 activated by
on-board processor */

Definition at line 115 of file pcwd.c.

#define WD_REVC_RLY2   0x80 /* Relay 2 activated? */

Definition at line 118 of file pcwd.c.

#define WD_REVC_TTRP   0x04 /* Temperature Trip status */

Definition at line 114 of file pcwd.c.

#define WD_REVC_WTRP   0x01 /* Watchdog Trip status */

Definition at line 112 of file pcwd.c.

#define WD_RLY2   0x08 /* External relay triggered */

Definition at line 109 of file pcwd.c.

#define WD_SRLY2   0x80 /* Software external relay triggered */

Definition at line 110 of file pcwd.c.

#define WD_SSEL
Value:
0x40 /* Watchdog Switch Select
(1:SW1 <-> 0:SW2) */

Definition at line 122 of file pcwd.c.

#define WD_T110   0x02 /* Temperature overheat sense */

Definition at line 107 of file pcwd.c.

#define WD_WCMD   0x80 /* Watchdog Command Mode */

Definition at line 123 of file pcwd.c.

#define WD_WDIS   0x10 /* Watchdog Disabled */

Definition at line 120 of file pcwd.c.

#define WD_WDRST   0x01 /* Previously reset state */

Definition at line 106 of file pcwd.c.

#define WDT_INTERVAL   (HZ/2+1)

Definition at line 163 of file pcwd.c.

Function Documentation

MODULE_ALIAS_MISCDEV ( WATCHDOG_MINOR  )
MODULE_ALIAS_MISCDEV ( TEMP_MINOR  )
MODULE_AUTHOR ( "Ken Hollis <[email protected] ,
""Wim Van Sebroeck< wim @iguana.be >"   
)
MODULE_DESCRIPTION ( "Berkshire ISA-PC Watchdog driver )
module_exit ( pcwd_cleanup_module  )
module_init ( pcwd_init_module  )
MODULE_LICENSE ( "GPL"  )
module_param ( debug  ,
int  ,
 
)
module_param ( heartbeat  ,
int  ,
 
)
module_param ( nowayout  ,
bool  ,
 
)
MODULE_PARM_DESC ( debug  ,
"Debug level:  0 = Quiet,
= Verbose 
)
MODULE_PARM_DESC ( heartbeat  ,
"Watchdog heartbeat in seconds. ""(2 <= heartbeat <= 7200 or 0=delay-time from dip-switches, default="__MODULE_STRING(WATCHDOG_HEARTBEAT)")"   
)
MODULE_PARM_DESC ( nowayout  ,
"Watchdog cannot be stopped once started (default="__MODULE_STRING(WATCHDOG_NOWAYOUT)")"   
)
MODULE_VERSION ( WATCHDOG_VERSION  )

Variable Documentation

int boot_status

Definition at line 181 of file pcwd.c.

int command_mode

Definition at line 179 of file pcwd.c.

char fw_ver_str[6]

Definition at line 175 of file pcwd.c.

Definition at line 182 of file pcwd.c.

spinlock_t io_lock

Definition at line 183 of file pcwd.c.

unsigned long next_heartbeat

Definition at line 185 of file pcwd.c.

Definition at line 176 of file pcwd.c.

int supports_temp

Definition at line 177 of file pcwd.c.

Definition at line 184 of file pcwd.c.