Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
pcwd_pci.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/miscdevice.h>
#include <linux/watchdog.h>
#include <linux/notifier.h>
#include <linux/reboot.h>
#include <linux/init.h>
#include <linux/fs.h>
#include <linux/pci.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.03"
 
#define WATCHDOG_DRIVER_NAME   "PCI-PC Watchdog"
 
#define WATCHDOG_NAME   "pcwd_pci"
 
#define DRIVER_VERSION   WATCHDOG_DRIVER_NAME " driver, v" WATCHDOG_VERSION
 
#define PCI_VENDOR_ID_QUICKLOGIC   0x11e3
 
#define PCI_DEVICE_ID_WATCHDOG_PCIPCWD   0x5030
 
#define WD_PCI_WTRP   0x01 /* Watchdog Trip status */
 
#define WD_PCI_HRBT   0x02 /* Watchdog Heartbeat */
 
#define WD_PCI_TTRP   0x04 /* Temperature Trip status */
 
#define WD_PCI_RL2A   0x08 /* Relay 2 Active */
 
#define WD_PCI_RL1A   0x10 /* Relay 1 Active */
 
#define WD_PCI_R2DS
 
#define WD_PCI_RLY2   0x80 /* Activate Relay 2 on the board */
 
#define WD_PCI_WDIS   0x10 /* Watchdog Disable */
 
#define WD_PCI_ENTP   0x20 /* Enable Temperature Trip Reset */
 
#define WD_PCI_WRSP   0x40 /* Watchdog wrote response */
 
#define WD_PCI_PCMD   0x80 /* PC has sent command */
 
#define PCI_COMMAND_TIMEOUT   150
 
#define CMD_GET_STATUS   0x04
 
#define CMD_GET_FIRMWARE_VERSION   0x08
 
#define CMD_READ_WATCHDOG_TIMEOUT   0x18
 
#define CMD_WRITE_WATCHDOG_TIMEOUT   0x19
 
#define CMD_GET_CLEAR_RESET_COUNT   0x84
 
#define QUIET   0 /* Default */
 
#define VERBOSE   1 /* Verbose */
 
#define DEBUG   2 /* print fancy stuff too */
 
#define WATCHDOG_HEARTBEAT
 

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. ""(0<heartbeat<65536 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_DEVICE_TABLE (pci, pcipcwd_pci_tbl)
 
 module_pci_driver (pcipcwd_driver)
 
 MODULE_AUTHOR ("Wim Van Sebroeck <[email protected]>")
 
 MODULE_DESCRIPTION ("Berkshire PCI-PC Watchdog driver")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_ALIAS_MISCDEV (WATCHDOG_MINOR)
 
 MODULE_ALIAS_MISCDEV (TEMP_MINOR)
 

Macro Definition Documentation

#define CMD_GET_CLEAR_RESET_COUNT   0x84

Definition at line 97 of file pcwd_pci.c.

#define CMD_GET_FIRMWARE_VERSION   0x08

Definition at line 94 of file pcwd_pci.c.

#define CMD_GET_STATUS   0x04

Definition at line 93 of file pcwd_pci.c.

#define CMD_READ_WATCHDOG_TIMEOUT   0x18

Definition at line 95 of file pcwd_pci.c.

#define CMD_WRITE_WATCHDOG_TIMEOUT   0x19

Definition at line 96 of file pcwd_pci.c.

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

Definition at line 135 of file pcwd_pci.c.

#define DRIVER_VERSION   WATCHDOG_DRIVER_NAME " driver, v" WATCHDOG_VERSION

Definition at line 59 of file pcwd_pci.c.

#define PCI_COMMAND_TIMEOUT   150

Definition at line 90 of file pcwd_pci.c.

#define PCI_DEVICE_ID_WATCHDOG_PCIPCWD   0x5030

Definition at line 67 of file pcwd_pci.c.

#define PCI_VENDOR_ID_QUICKLOGIC   0x11e3

Definition at line 63 of file pcwd_pci.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 35 of file pcwd_pci.c.

#define QUIET   0 /* Default */

Definition at line 133 of file pcwd_pci.c.

#define VERBOSE   1 /* Verbose */

Definition at line 134 of file pcwd_pci.c.

#define WATCHDOG_DRIVER_NAME   "PCI-PC Watchdog"

Definition at line 57 of file pcwd_pci.c.

#define WATCHDOG_HEARTBEAT
Value:
0 /* default heartbeat =
delay-time from dip-switches */

Definition at line 140 of file pcwd_pci.c.

#define WATCHDOG_NAME   "pcwd_pci"

Definition at line 58 of file pcwd_pci.c.

#define WATCHDOG_VERSION   "1.03"

Definition at line 56 of file pcwd_pci.c.

#define WD_PCI_ENTP   0x20 /* Enable Temperature Trip Reset */

Definition at line 84 of file pcwd_pci.c.

#define WD_PCI_HRBT   0x02 /* Watchdog Heartbeat */

Definition at line 76 of file pcwd_pci.c.

#define WD_PCI_PCMD   0x80 /* PC has sent command */

Definition at line 86 of file pcwd_pci.c.

#define WD_PCI_R2DS
Value:
0x40 /* Relay 2 Disable Temperature-trip /
reset */

Definition at line 80 of file pcwd_pci.c.

#define WD_PCI_RL1A   0x10 /* Relay 1 Active */

Definition at line 79 of file pcwd_pci.c.

#define WD_PCI_RL2A   0x08 /* Relay 2 Active */

Definition at line 78 of file pcwd_pci.c.

#define WD_PCI_RLY2   0x80 /* Activate Relay 2 on the board */

Definition at line 81 of file pcwd_pci.c.

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

Definition at line 77 of file pcwd_pci.c.

#define WD_PCI_WDIS   0x10 /* Watchdog Disable */

Definition at line 83 of file pcwd_pci.c.

#define WD_PCI_WRSP   0x40 /* Watchdog wrote response */

Definition at line 85 of file pcwd_pci.c.

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

Definition at line 75 of file pcwd_pci.c.

Function Documentation

MODULE_ALIAS_MISCDEV ( WATCHDOG_MINOR  )
MODULE_ALIAS_MISCDEV ( TEMP_MINOR  )
MODULE_AUTHOR ( "Wim Van Sebroeck <[email protected]>"  )
MODULE_DESCRIPTION ( "Berkshire PCI-PC Watchdog driver )
MODULE_DEVICE_TABLE ( pci  ,
pcipcwd_pci_tbl   
)
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. ""(0<heartbeat<65536 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_pci_driver ( pcipcwd_driver  )

Variable Documentation

int boot_status

Definition at line 123 of file pcwd_pci.c.

unsigned long io_addr

Definition at line 125 of file pcwd_pci.c.

spinlock_t io_lock

Definition at line 127 of file pcwd_pci.c.

struct pci_dev* pdev

Definition at line 129 of file pcwd_pci.c.

int supports_temp

Definition at line 121 of file pcwd_pci.c.