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

Go to the source code of this file.

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define ZF_IOBASE   0x218
 
#define INDEX   0x218
 
#define DATA_B   0x219
 
#define DATA_W   0x21A
 
#define DATA_D   0x21A
 
#define ZFL_VERSION   0x02 /* 16 */
 
#define CONTROL   0x10 /* 16 */
 
#define STATUS   0x12 /* 8 */
 
#define COUNTER_1   0x0C /* 16 */
 
#define COUNTER_2   0x0E /* 8 */
 
#define PULSE_LEN   0x0F /* 8 */
 
#define ENABLE_WD1   0x0001
 
#define ENABLE_WD2   0x0002
 
#define RESET_WD1   0x0010
 
#define RESET_WD2   0x0020
 
#define GEN_SCI   0x0100
 
#define GEN_NMI   0x0200
 
#define GEN_SMI   0x0400
 
#define GEN_RESET   0x0800
 
#define WD1   0
 
#define WD2   1
 
#define zf_writew(port, data)   { outb(port, INDEX); outw(data, DATA_W); }
 
#define zf_writeb(port, data)   { outb(port, INDEX); outb(data, DATA_B); }
 
#define zf_get_ZFL_version()   zf_readw(ZFL_VERSION)
 
#define PFX   "machzwd"
 
#define ZF_USER_TIMEO   (HZ*10)
 
#define ZF_HW_TIMEO   (HZ/2)
 
#define ZF_CTIMEOUT   0xffff
 
#define dprintk(format, args...)
 

Functions

 MODULE_AUTHOR ("Fernando Fuganti <[email protected]>")
 
 MODULE_DESCRIPTION ("MachZ ZF-Logic Watchdog driver")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_ALIAS_MISCDEV (WATCHDOG_MINOR)
 
 module_param (nowayout, bool, 0)
 
 MODULE_PARM_DESC (nowayout,"Watchdog cannot be stopped once started (default="__MODULE_STRING(WATCHDOG_NOWAYOUT)")")
 
 module_param (action, int, 0)
 
 MODULE_PARM_DESC (action,"after watchdog resets, generate: ""0 = RESET(*) 1 = SMI 2 = NMI 3 = SCI")
 
 module_init (zf_init)
 
 module_exit (zf_exit)
 

Macro Definition Documentation

#define CONTROL   0x10 /* 16 */

Definition at line 58 of file machzwd.c.

#define COUNTER_1   0x0C /* 16 */

Definition at line 60 of file machzwd.c.

#define COUNTER_2   0x0E /* 8 */

Definition at line 61 of file machzwd.c.

#define DATA_B   0x219

Definition at line 52 of file machzwd.c.

#define DATA_D   0x21A

Definition at line 54 of file machzwd.c.

#define DATA_W   0x21A

Definition at line 53 of file machzwd.c.

#define dprintk (   format,
  args... 
)

Definition at line 145 of file machzwd.c.

#define ENABLE_WD1   0x0001

Definition at line 65 of file machzwd.c.

#define ENABLE_WD2   0x0002

Definition at line 66 of file machzwd.c.

#define GEN_NMI   0x0200

Definition at line 70 of file machzwd.c.

#define GEN_RESET   0x0800

Definition at line 72 of file machzwd.c.

#define GEN_SCI   0x0100

Definition at line 69 of file machzwd.c.

#define GEN_SMI   0x0400

Definition at line 71 of file machzwd.c.

#define INDEX   0x218

Definition at line 51 of file machzwd.c.

#define PFX   "machzwd"

Definition at line 103 of file machzwd.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 31 of file machzwd.c.

#define PULSE_LEN   0x0F /* 8 */

Definition at line 62 of file machzwd.c.

#define RESET_WD1   0x0010

Definition at line 67 of file machzwd.c.

#define RESET_WD2   0x0020

Definition at line 68 of file machzwd.c.

#define STATUS   0x12 /* 8 */

Definition at line 59 of file machzwd.c.

#define WD1   0

Definition at line 77 of file machzwd.c.

#define WD2   1

Definition at line 78 of file machzwd.c.

#define ZF_CTIMEOUT   0xffff

Definition at line 142 of file machzwd.c.

#define zf_get_ZFL_version ( )    zf_readw(ZFL_VERSION)

Definition at line 82 of file machzwd.c.

#define ZF_HW_TIMEO   (HZ/2)

Definition at line 139 of file machzwd.c.

#define ZF_IOBASE   0x218

Definition at line 50 of file machzwd.c.

#define ZF_USER_TIMEO   (HZ*10)

Definition at line 136 of file machzwd.c.

#define zf_writeb (   port,
  data 
)    { outb(port, INDEX); outb(data, DATA_B); }

Definition at line 81 of file machzwd.c.

#define zf_writew (   port,
  data 
)    { outb(port, INDEX); outw(data, DATA_W); }

Definition at line 80 of file machzwd.c.

#define ZFL_VERSION   0x02 /* 16 */

Definition at line 57 of file machzwd.c.

Function Documentation

MODULE_ALIAS_MISCDEV ( WATCHDOG_MINOR  )
MODULE_AUTHOR ( "Fernando Fuganti <[email protected]>"  )
MODULE_DESCRIPTION ( "MachZ ZF-Logic Watchdog driver )
module_exit ( zf_exit  )
module_init ( zf_init  )
MODULE_LICENSE ( "GPL"  )
module_param ( nowayout  ,
bool  ,
 
)
module_param ( action  ,
int  ,
 
)
MODULE_PARM_DESC ( nowayout  ,
"Watchdog cannot be stopped once started (default="__MODULE_STRING(WATCHDOG_NOWAYOUT)")"   
)
MODULE_PARM_DESC ( action  ,
"after watchdog  resets 
)