Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 48131
b: refs/heads/master
c: 39e3a05
h: refs/heads/master
i:
  48129: 76b1cdb
  48127: 80eb318
v: v3
  • Loading branch information
Wim Van Sebroeck committed Jan 7, 2007
1 parent 00c261f commit ff28ae1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9cd446198e7646431a7f2ce7dbeec8df9f77012b
refs/heads/master: 39e3a0556a1e2d33f9491d43bae9fdaa09b0308a
26 changes: 21 additions & 5 deletions trunk/drivers/char/watchdog/pcwd_pci.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Berkshire PCI-PC Watchdog Card Driver
*
* (c) Copyright 2003-2005 Wim Van Sebroeck <wim@iguana.be>.
* (c) Copyright 2003-2007 Wim Van Sebroeck <wim@iguana.be>.
*
* Based on source code of the following authors:
* Ken Hollis <kenji@bitgate.com>,
Expand Down Expand Up @@ -51,8 +51,8 @@
#include <asm/io.h> /* For inb/outb/... */

/* Module and version information */
#define WATCHDOG_VERSION "1.02"
#define WATCHDOG_DATE "03 Sep 2005"
#define WATCHDOG_VERSION "1.03"
#define WATCHDOG_DATE "06 Jan 2007"
#define WATCHDOG_DRIVER_NAME "PCI-PC Watchdog"
#define WATCHDOG_NAME "pcwd_pci"
#define PFX WATCHDOG_NAME ": "
Expand Down Expand Up @@ -96,6 +96,18 @@
#define CMD_WRITE_WATCHDOG_TIMEOUT 0x19
#define CMD_GET_CLEAR_RESET_COUNT 0x84

/* Watchdog's Dip Switch heartbeat values */
static const int heartbeat_tbl [] = {
5, /* OFF-OFF-OFF = 5 Sec */
10, /* OFF-OFF-ON = 10 Sec */
30, /* OFF-ON-OFF = 30 Sec */
60, /* OFF-ON-ON = 1 Min */
300, /* ON-OFF-OFF = 5 Min */
600, /* ON-OFF-ON = 10 Min */
1800, /* ON-ON-OFF = 30 Min */
3600, /* ON-ON-ON = 1 hour */
};

/* We can only use 1 card due to the /dev/watchdog restriction */
static int cards_found;

Expand All @@ -119,10 +131,10 @@ static int debug = QUIET;
module_param(debug, int, 0);
MODULE_PARM_DESC(debug, "Debug level: 0=Quiet, 1=Verbose, 2=Debug (default=0)");

#define WATCHDOG_HEARTBEAT 2 /* 2 sec default heartbeat */
#define WATCHDOG_HEARTBEAT 0 /* default heartbeat = delay-time from dip-switches */
static int heartbeat = WATCHDOG_HEARTBEAT;
module_param(heartbeat, int, 0);
MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (0<heartbeat<65536, default=" __MODULE_STRING(WATCHDOG_HEARTBEAT) ")");
MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (0<heartbeat<65536 or 0=delay-time from dip-switches, default=" __MODULE_STRING(WATCHDOG_HEARTBEAT) ")");

static int nowayout = WATCHDOG_NOWAYOUT;
module_param(nowayout, int, 0);
Expand Down Expand Up @@ -711,6 +723,10 @@ static int __devinit pcipcwd_card_init(struct pci_dev *pdev,
/* Show info about the card itself */
pcipcwd_show_card_info();

/* If heartbeat = 0 then we use the heartbeat from the dip-switches */
if (heartbeat == 0)
heartbeat = heartbeat_tbl[(pcipcwd_get_option_switches() & 0x07)];

/* Check that the heartbeat value is within it's range ; if not reset to the default */
if (pcipcwd_set_heartbeat(heartbeat)) {
pcipcwd_set_heartbeat(WATCHDOG_HEARTBEAT);
Expand Down

0 comments on commit ff28ae1

Please sign in to comment.