Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
3c8ba560
Commit
3c8ba560
authored
Jan 09, 2003
by
Dave Jones
Committed by
Dave Jones
Jan 09, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[WATCHDOG] pcwd driver update from 2.4
parent
a9e7da60
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
12 deletions
+35
-12
drivers/char/watchdog/pcwd.c
drivers/char/watchdog/pcwd.c
+35
-12
No files found.
drivers/char/watchdog/pcwd.c
View file @
3c8ba560
...
@@ -40,6 +40,8 @@
...
@@ -40,6 +40,8 @@
* fairly useless proc entry.
* fairly useless proc entry.
* 990610 removed said useless proc code for the merge <alan>
* 990610 removed said useless proc code for the merge <alan>
* 000403 Removed last traces of proc code. <davej>
* 000403 Removed last traces of proc code. <davej>
* 011214 Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT <Matt_Domsch@dell.com>
* Added timeout module option to override default
*/
*/
#include <linux/module.h>
#include <linux/module.h>
...
@@ -76,7 +78,7 @@
...
@@ -76,7 +78,7 @@
*/
*/
static
int
pcwd_ioports
[]
=
{
0x270
,
0x350
,
0x370
,
0x000
};
static
int
pcwd_ioports
[]
=
{
0x270
,
0x350
,
0x370
,
0x000
};
#define WD_VER "1.1
0 (06/05/99
)"
#define WD_VER "1.1
2 (12/14/2001
)"
/*
/*
* It should be noted that PCWD_REVISION_B was removed because A and B
* It should be noted that PCWD_REVISION_B was removed because A and B
...
@@ -88,7 +90,22 @@ static int pcwd_ioports[] = { 0x270, 0x350, 0x370, 0x000 };
...
@@ -88,7 +90,22 @@ static int pcwd_ioports[] = { 0x270, 0x350, 0x370, 0x000 };
#define PCWD_REVISION_A 1
#define PCWD_REVISION_A 1
#define PCWD_REVISION_C 2
#define PCWD_REVISION_C 2
#define WD_TIMEOUT 3
/* 1 1/2 seconds for a timeout */
#define WD_TIMEOUT 4
/* 2 seconds for a timeout */
static
int
timeout_val
=
WD_TIMEOUT
;
static
int
timeout
=
2
;
MODULE_PARM
(
timeout
,
"i"
);
MODULE_PARM_DESC
(
timeout
,
"Watchdog timeout in seconds (default=2)"
);
#ifdef CONFIG_WATCHDOG_NOWAYOUT
static
int
nowayout
=
1
;
#else
static
int
nowayout
=
0
;
#endif
MODULE_PARM
(
nowayout
,
"i"
);
MODULE_PARM_DESC
(
nowayout
,
"Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"
);
/*
/*
* These are the defines for the PC Watchdog card, revision A.
* These are the defines for the PC Watchdog card, revision A.
...
@@ -121,7 +138,7 @@ static int __init pcwd_checkcard(void)
...
@@ -121,7 +138,7 @@ static int __init pcwd_checkcard(void)
if
(
prev_card_dat
==
0xFF
)
if
(
prev_card_dat
==
0xFF
)
return
0
;
return
0
;
while
(
count
<
WD_TIMEOUT
)
{
while
(
count
<
timeout_val
)
{
/* Read the raw card data from the port, and strip off the
/* Read the raw card data from the port, and strip off the
first 4 bits */
first 4 bits */
...
@@ -450,16 +467,16 @@ static int pcwd_close(struct inode *ino, struct file *filep)
...
@@ -450,16 +467,16 @@ static int pcwd_close(struct inode *ino, struct file *filep)
{
{
if
(
minor
(
ino
->
i_rdev
)
==
WATCHDOG_MINOR
)
if
(
minor
(
ino
->
i_rdev
)
==
WATCHDOG_MINOR
)
{
{
#ifndef CONFIG_WATCHDOG_NOWAYOUT
if
(
!
nowayout
)
{
/* Disable the board */
/* Disable the board */
if
(
revision
==
PCWD_REVISION_C
)
{
if
(
revision
==
PCWD_REVISION_C
)
{
spin_lock
(
&
io_lock
);
spin_lock
(
&
io_lock
);
outb_p
(
0xA5
,
current_readport
+
3
);
outb_p
(
0xA5
,
current_readport
+
3
);
outb_p
(
0xA5
,
current_readport
+
3
);
outb_p
(
0xA5
,
current_readport
+
3
);
spin_unlock
(
&
io_lock
);
spin_unlock
(
&
io_lock
);
}
atomic_inc
(
&
open_allowed
);
}
}
atomic_inc
(
&
open_allowed
);
#endif
}
}
return
0
;
return
0
;
}
}
...
@@ -560,9 +577,15 @@ static struct miscdevice temp_miscdev = {
...
@@ -560,9 +577,15 @@ static struct miscdevice temp_miscdev = {
&
pcwd_fops
&
pcwd_fops
};
};
static
void
__init
pcwd_validate_timeout
(
void
)
{
timeout_val
=
timeout
*
2
;
}
static
int
__init
pcwatchdog_init
(
void
)
static
int
__init
pcwatchdog_init
(
void
)
{
{
int
i
,
found
=
0
;
int
i
,
found
=
0
;
pcwd_validate_timeout
();
spin_lock_init
(
&
io_lock
);
spin_lock_init
(
&
io_lock
);
revision
=
PCWD_REVISION_A
;
revision
=
PCWD_REVISION_A
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment