Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
pcwd_usb.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/usb.h>
#include <linux/slab.h>
#include <linux/mutex.h>
#include <linux/hid.h>
#include <linux/uaccess.h>

Go to the source code of this file.

Data Structures

struct  usb_pcwd_private
 

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define DEBUG
 
#define dbg(format,...)
 
#define DRIVER_VERSION   "1.02"
 
#define DRIVER_AUTHOR   "Wim Van Sebroeck <[email protected]>"
 
#define DRIVER_DESC   "Berkshire USB-PC Watchdog driver"
 
#define DRIVER_LICENSE   "GPL"
 
#define DRIVER_NAME   "pcwd_usb"
 
#define WATCHDOG_HEARTBEAT
 
#define USB_PCWD_VENDOR_ID   0x0c98
 
#define USB_PCWD_PRODUCT_ID   0x1140
 
#define USB_COMMAND_TIMEOUT   250
 
#define CMD_READ_TEMP
 
#define CMD_TRIGGER   CMD_READ_TEMP
 
#define CMD_GET_STATUS   0x04 /* Get Status Information */
 
#define CMD_GET_FIRMWARE_VERSION   0x08 /* Get Firmware Version */
 
#define CMD_GET_DIP_SWITCH_SETTINGS   0x0c /* Get Dip Switch Settings */
 
#define CMD_READ_WATCHDOG_TIMEOUT   0x18 /* Read Current Watchdog Time */
 
#define CMD_WRITE_WATCHDOG_TIMEOUT   0x19 /* Write Current WatchdogTime */
 
#define CMD_ENABLE_WATCHDOG   0x30 /* Enable / Disable Watchdog */
 
#define CMD_DISABLE_WATCHDOG   CMD_ENABLE_WATCHDOG
 

Functions

 MODULE_AUTHOR (DRIVER_AUTHOR)
 
 MODULE_DESCRIPTION (DRIVER_DESC)
 
 MODULE_LICENSE (DRIVER_LICENSE)
 
 MODULE_ALIAS_MISCDEV (WATCHDOG_MINOR)
 
 MODULE_ALIAS_MISCDEV (TEMP_MINOR)
 
 module_param (debug, int, 0)
 
 MODULE_PARM_DESC (debug,"Debug enabled or not")
 
 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 (usb, usb_pcwd_table)
 
 module_usb_driver (usb_pcwd_driver)
 

Macro Definition Documentation

#define CMD_DISABLE_WATCHDOG   CMD_ENABLE_WATCHDOG

Definition at line 118 of file pcwd_usb.c.

#define CMD_ENABLE_WATCHDOG   0x30 /* Enable / Disable Watchdog */

Definition at line 117 of file pcwd_usb.c.

#define CMD_GET_DIP_SWITCH_SETTINGS   0x0c /* Get Dip Switch Settings */

Definition at line 114 of file pcwd_usb.c.

#define CMD_GET_FIRMWARE_VERSION   0x08 /* Get Firmware Version */

Definition at line 113 of file pcwd_usb.c.

#define CMD_GET_STATUS   0x04 /* Get Status Information */

Definition at line 112 of file pcwd_usb.c.

#define CMD_READ_TEMP
Value:
0x02 /* Read Temperature;
Re-trigger Watchdog */

Definition at line 110 of file pcwd_usb.c.

#define CMD_READ_WATCHDOG_TIMEOUT   0x18 /* Read Current Watchdog Time */

Definition at line 115 of file pcwd_usb.c.

#define CMD_TRIGGER   CMD_READ_TEMP

Definition at line 111 of file pcwd_usb.c.

#define CMD_WRITE_WATCHDOG_TIMEOUT   0x19 /* Write Current WatchdogTime */

Definition at line 116 of file pcwd_usb.c.

#define dbg (   format,
  ... 
)
Value:
do { \
if (debug) \
pr_debug(format "\n", ##__VA_ARGS__); \
} while (0)

Definition at line 59 of file pcwd_usb.c.

#define DEBUG

Definition at line 57 of file pcwd_usb.c.

#define DRIVER_AUTHOR   "Wim Van Sebroeck <[email protected]>"

Definition at line 67 of file pcwd_usb.c.

#define DRIVER_DESC   "Berkshire USB-PC Watchdog driver"

Definition at line 68 of file pcwd_usb.c.

#define DRIVER_LICENSE   "GPL"

Definition at line 69 of file pcwd_usb.c.

#define DRIVER_NAME   "pcwd_usb"

Definition at line 70 of file pcwd_usb.c.

#define DRIVER_VERSION   "1.02"

Definition at line 66 of file pcwd_usb.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 27 of file pcwd_usb.c.

#define USB_COMMAND_TIMEOUT   250

Definition at line 107 of file pcwd_usb.c.

#define USB_PCWD_PRODUCT_ID   0x1140

Definition at line 96 of file pcwd_usb.c.

#define USB_PCWD_VENDOR_ID   0x0c98

Definition at line 95 of file pcwd_usb.c.

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

Definition at line 82 of file pcwd_usb.c.

Function Documentation

MODULE_ALIAS_MISCDEV ( WATCHDOG_MINOR  )
MODULE_ALIAS_MISCDEV ( TEMP_MINOR  )
MODULE_AUTHOR ( DRIVER_AUTHOR  )
MODULE_DESCRIPTION ( DRIVER_DESC  )
MODULE_DEVICE_TABLE ( usb  ,
usb_pcwd_table   
)
MODULE_LICENSE ( DRIVER_LICENSE  )
module_param ( debug  ,
int  ,
 
)
module_param ( heartbeat  ,
int  ,
 
)
module_param ( nowayout  ,
bool  ,
 
)
MODULE_PARM_DESC ( debug  ,
"Debug enabled or not"   
)
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_usb_driver ( usb_pcwd_driver  )