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
nexedi
linux
Commits
d3484261
Commit
d3484261
authored
Jan 14, 2003
by
Dave Jones
Browse files
Options
Browse Files
Download
Plain Diff
Merge tetrachloride.(none):/mnt/stuff/kernel/2.5/bk-linus
into tetrachloride.(none):/mnt/stuff/kernel/2.5/watchdog
parents
9552d6bc
d87b6141
Changes
23
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
266 additions
and
310 deletions
+266
-310
drivers/char/watchdog/acquirewdt.c
drivers/char/watchdog/acquirewdt.c
+4
-10
drivers/char/watchdog/advantechwdt.c
drivers/char/watchdog/advantechwdt.c
+115
-95
drivers/char/watchdog/alim7101_wdt.c
drivers/char/watchdog/alim7101_wdt.c
+4
-10
drivers/char/watchdog/eurotechwdt.c
drivers/char/watchdog/eurotechwdt.c
+73
-83
drivers/char/watchdog/i810-tco.c
drivers/char/watchdog/i810-tco.c
+0
-3
drivers/char/watchdog/ib700wdt.c
drivers/char/watchdog/ib700wdt.c
+47
-26
drivers/char/watchdog/indydog.c
drivers/char/watchdog/indydog.c
+0
-1
drivers/char/watchdog/machzwd.c
drivers/char/watchdog/machzwd.c
+3
-9
drivers/char/watchdog/mixcomwd.c
drivers/char/watchdog/mixcomwd.c
+0
-4
drivers/char/watchdog/pcwd.c
drivers/char/watchdog/pcwd.c
+0
-10
drivers/char/watchdog/sa1100_wdt.c
drivers/char/watchdog/sa1100_wdt.c
+0
-1
drivers/char/watchdog/sbc60xxwdt.c
drivers/char/watchdog/sbc60xxwdt.c
+4
-9
drivers/char/watchdog/sc1200wdt.c
drivers/char/watchdog/sc1200wdt.c
+4
-5
drivers/char/watchdog/sc520_wdt.c
drivers/char/watchdog/sc520_wdt.c
+4
-10
drivers/char/watchdog/scx200_wdt.c
drivers/char/watchdog/scx200_wdt.c
+2
-4
drivers/char/watchdog/shwdt.c
drivers/char/watchdog/shwdt.c
+0
-1
drivers/char/watchdog/softdog.c
drivers/char/watchdog/softdog.c
+0
-4
drivers/char/watchdog/w83877f_wdt.c
drivers/char/watchdog/w83877f_wdt.c
+3
-9
drivers/char/watchdog/wafer5823wdt.c
drivers/char/watchdog/wafer5823wdt.c
+2
-3
drivers/char/watchdog/wdt.c
drivers/char/watchdog/wdt.c
+1
-6
drivers/char/watchdog/wdt285.c
drivers/char/watchdog/wdt285.c
+0
-1
drivers/char/watchdog/wdt977.c
drivers/char/watchdog/wdt977.c
+0
-1
drivers/char/watchdog/wdt_pci.c
drivers/char/watchdog/wdt_pci.c
+0
-5
No files found.
drivers/char/watchdog/acquirewdt.c
View file @
d3484261
...
...
@@ -24,24 +24,18 @@
#include <linux/config.h>
#include <linux/module.h>
#include <linux/version.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
#include <linux/slab.h>
#include <linux/ioport.h>
#include <linux/fcntl.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <asm/system.h>
#include <linux/notifier.h>
#include <linux/reboot.h>
#include <linux/init.h>
#include <linux/spinlock.h>
#include <linux/smp_lock.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <asm/system.h>
static
int
acq_is_open
;
static
spinlock_t
acq_lock
;
...
...
drivers/char/watchdog/advantechwdt.c
View file @
d3484261
...
...
@@ -22,55 +22,40 @@
*
* 14-Dec-2001 Matt Domsch <Matt_Domsch@dell.com>
* Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT
* Added timeout module option to override default
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/version.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
#include <linux/slab.h>
#include <linux/ioport.h>
#include <linux/fcntl.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <asm/system.h>
#include <linux/notifier.h>
#include <linux/reboot.h>
#include <linux/init.h>
#include <linux/spinlock.h>
#include <linux/smp_lock.h>
static
int
advwdt_is_open
;
#include <asm/io.h>
#include <asm/uaccess.h>
#include <asm/system.h>
static
unsigned
long
advwdt_is_open
;
static
char
adv_expect_close
;
static
spinlock_t
advwdt_lock
;
/*
* You must set these - there is no sane way to probe for this board.
*
* To enable or restart, write the timeout value in seconds (1 to 63)
* to I/O port
WDT_START. To disable, read I/O port WDT_STOP
.
* to I/O port
wdt_start. To disable, read I/O port wdt_stop
.
* Both are 0x443 for most boards (tested on a PCA-6276VE-00B1), but
* check your manual (at least the PCA-6159 seems to be different -
* the manual says
WDT_STOP
is 0x43, not 0x443).
* the manual says
wdt_stop
is 0x43, not 0x443).
* (0x43 is also a write-only control register for the 8254 timer!)
*
* TODO: module parameters to set the I/O port addresses
*/
#define WDT_STOP 0x443
#define WDT_START 0x443
#define WD_TIMO 60
/* 1 minute */
static
int
wdt_stop
=
0x443
;
static
int
wdt_start
=
0x443
;
static
int
timeout
=
WD_TIMO
;
/* in seconds */
MODULE_PARM
(
timeout
,
"i"
);
MODULE_PARM_DESC
(
timeout
,
"Watchdog timeout in seconds (default=60)"
);
static
int
wd_margin
=
60
;
/* 60 sec default timeout */
#ifdef CONFIG_WATCHDOG_NOWAYOUT
static
int
nowayout
=
1
;
...
...
@@ -85,11 +70,43 @@ MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CON
* Kernel methods.
*/
#ifndef MODULE
static
int
__init
adv_setup
(
char
*
str
)
{
int
ints
[
4
];
str
=
get_options
(
str
,
ARRAY_SIZE
(
ints
),
ints
);
if
(
ints
[
0
]
>
0
){
wdt_stop
=
ints
[
1
];
if
(
ints
[
0
]
>
1
)
wdt_start
=
ints
[
2
];
}
return
1
;
}
__setup
(
"advwdt="
,
adv_setup
);
#endif
/* !MODULE */
MODULE_PARM
(
wdt_stop
,
"i"
);
MODULE_PARM_DESC
(
wdt_stop
,
"Advantech WDT 'stop' io port (default 0x443)"
);
MODULE_PARM
(
wdt_start
,
"i"
);
MODULE_PARM_DESC
(
wdt_start
,
"Advantech WDT 'start' io port (default 0x443)"
);
static
void
advwdt_ping
(
void
)
{
/* Write a watchdog value */
outb_p
(
timeout
,
WDT_START
);
outb_p
(
wd_margin
,
wdt_start
);
}
static
void
advwdt_disable
(
void
)
{
inb_p
(
wdt_stop
);
}
static
ssize_t
...
...
@@ -118,16 +135,11 @@ advwdt_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
return
count
;
}
static
ssize_t
advwdt_read
(
struct
file
*
file
,
char
*
buf
,
size_t
count
,
loff_t
*
ppos
)
{
return
-
EINVAL
;
}
static
int
advwdt_ioctl
(
struct
inode
*
inode
,
struct
file
*
file
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
int
new_margin
;
static
struct
watchdog_info
ident
=
{
.
options
=
WDIOF_KEEPALIVEPING
|
WDIOF_SETTIMEOUT
|
WDIOF_MAGICCLOSE
,
.
firmware_version
=
1
,
...
...
@@ -141,14 +153,45 @@ advwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
break
;
case
WDIOC_GETSTATUS
:
if
(
copy_to_user
((
int
*
)
arg
,
&
advwdt_is_open
,
sizeof
(
int
)))
return
-
EFAULT
;
break
;
case
WDIOC_GETBOOTSTATUS
:
return
put_user
(
0
,
(
int
*
)
arg
);
case
WDIOC_KEEPALIVE
:
advwdt_ping
();
break
;
case
WDIOC_SETTIMEOUT
:
if
(
get_user
(
new_margin
,
(
int
*
)
arg
))
return
-
EFAULT
;
if
((
new_margin
<
1
)
||
(
new_margin
>
63
))
return
-
EINVAL
;
wd_margin
=
new_margin
;
advwdt_ping
();
/* Fall */
case
WDIOC_GETTIMEOUT
:
return
put_user
(
wd_margin
,
(
int
*
)
arg
);
case
WDIOC_SETOPTIONS
:
{
int
options
,
retval
=
-
EINVAL
;
if
(
get_user
(
options
,
(
int
*
)
arg
))
return
-
EFAULT
;
if
(
options
&
WDIOS_DISABLECARD
)
{
advwdt_disable
();
retval
=
0
;
}
if
(
options
&
WDIOS_ENABLECARD
)
{
advwdt_ping
();
retval
=
0
;
}
return
retval
;
}
default:
return
-
ENOTTY
;
}
...
...
@@ -158,37 +201,27 @@ advwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
static
int
advwdt_open
(
struct
inode
*
inode
,
struct
file
*
file
)
{
if
(
minor
(
inode
->
i_rdev
)
==
WATCHDOG_MINOR
)
{
spin_lock
(
&
advwdt_lock
);
if
(
advwdt_is_open
)
{
spin_unlock
(
&
advwdt_lock
);
if
(
test_and_set_bit
(
0
,
&
advwdt_is_open
))
return
-
EBUSY
;
}
if
(
nowayout
)
MOD_INC_USE_COUNT
;
/*
* Activate
*/
/* Activate */
advwdt_is_open
=
1
;
advwdt_ping
();
spin_unlock
(
&
advwdt_lock
);
return
0
;
}
else
{
return
-
ENODEV
;
}
}
static
int
advwdt_close
(
struct
inode
*
inode
,
struct
file
*
file
)
{
if
(
minor
(
inode
->
i_rdev
)
==
WATCHDOG_MINOR
)
{
spin_lock
(
&
advwdt_lock
);
if
(
!
nowayout
)
inb_p
(
WDT_STOP
);
advwdt_is_open
=
0
;
spin_unlock
(
&
advwdt_lock
);
if
(
adv_expect_close
==
42
)
{
advwdt_disable
();
}
else
{
printk
(
KERN_CRIT
"advancetechwdt: Unexpected close, not stopping watchdog!
\n
"
);
advwdt_ping
();
}
clear_bit
(
0
,
&
advwdt_is_open
);
adv_expect_close
=
0
;
return
0
;
}
...
...
@@ -200,10 +233,10 @@ static int
advwdt_notify_sys
(
struct
notifier_block
*
this
,
unsigned
long
code
,
void
*
unused
)
{
if
(
code
==
SYS_DOWN
||
code
==
SYS_HALT
)
if
(
code
==
SYS_DOWN
||
code
==
SYS_HALT
)
{
/* Turn the WDT off */
inb_p
(
WDT_STOP
);
advwdt_disable
(
);
}
return
NOTIFY_DONE
;
}
...
...
@@ -213,7 +246,6 @@ advwdt_notify_sys(struct notifier_block *this, unsigned long code,
static
struct
file_operations
advwdt_fops
=
{
.
owner
=
THIS_MODULE
,
.
read
=
advwdt_read
,
.
write
=
advwdt_write
,
.
ioctl
=
advwdt_ioctl
,
.
open
=
advwdt_open
,
...
...
@@ -237,35 +269,22 @@ static struct notifier_block advwdt_notifier = {
.
priority
=
0
};
static
void
__init
advwdt_validate_timeout
(
void
)
{
if
(
timeout
<
1
||
timeout
>
63
)
{
timeout
=
WD_TIMO
;
printk
(
KERN_INFO
"advantechwdt: timeout value must be 1 <= x <= 63, using %d
\n
"
,
timeout
);
}
}
static
int
__init
advwdt_init
(
void
)
{
printk
(
"WDT driver for Advantech single board computer initialising.
\n
"
);
printk
(
KERN_INFO
"WDT driver for Advantech single board computer initialising.
\n
"
);
advwdt_validate_timeout
();
spin_lock_init
(
&
advwdt_lock
);
if
(
misc_register
(
&
advwdt_miscdev
))
return
-
ENODEV
;
#if WDT_START != WDT_STOP
if
(
!
request_region
(
WDT_STOP
,
1
,
"Advantech WDT"
))
{
if
(
wdt_stop
!=
wdt_start
)
if
(
!
request_region
(
wdt_stop
,
1
,
"Advantech WDT"
))
{
misc_deregister
(
&
advwdt_miscdev
);
return
-
EIO
;
}
#endif
if
(
!
request_region
(
WDT_START
,
1
,
"Advantech WDT"
))
{
if
(
!
request_region
(
wdt_start
,
1
,
"Advantech WDT"
))
{
misc_deregister
(
&
advwdt_miscdev
);
#if WDT_START != WDT_STOP
release_region
(
WDT_STOP
,
1
);
#endif
if
(
wdt_stop
!=
wdt_start
)
release_region
(
wdt_stop
,
1
);
return
-
EIO
;
}
register_reboot_notifier
(
&
advwdt_notifier
);
...
...
@@ -277,14 +296,15 @@ advwdt_exit(void)
{
misc_deregister
(
&
advwdt_miscdev
);
unregister_reboot_notifier
(
&
advwdt_notifier
);
#if WDT_START != WDT_STOP
release_region
(
WDT_STOP
,
1
);
#endif
release_region
(
WDT_START
,
1
);
if
(
wdt_stop
!=
wdt_start
)
release_region
(
wdt_stop
,
1
);
release_region
(
wdt_start
,
1
);
}
module_init
(
advwdt_init
);
module_exit
(
advwdt_exit
);
MODULE_LICENSE
(
"GPL"
);
MODULE_AUTHOR
(
"Marek Michalkiewicz <marekm@linux.org.pl>"
);
MODULE_DESCRIPTION
(
"Advantech Single Board Computer WDT driver"
);
drivers/char/watchdog/alim7101_wdt.c
View file @
d3484261
...
...
@@ -30,26 +30,20 @@
*/
#include <linux/module.h>
#include <linux/version.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/timer.h>
#include <linux/sched.h>
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
#include <linux/slab.h>
#include <linux/ioport.h>
#include <linux/fcntl.h>
#include <linux/smp_lock.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <asm/system.h>
#include <linux/notifier.h>
#include <linux/reboot.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <asm/system.h>
#define OUR_NAME "alim7101_wdt"
#define WDT_ENABLE 0x9C
...
...
drivers/char/watchdog/eurotechwdt.c
View file @
d3484261
...
...
@@ -3,6 +3,7 @@
*
* (c) Copyright 2001 Ascensit <support@ascensit.com>
* (c) Copyright 2001 Rodolfo Giometti <giometti@ascensit.com>
* (c) Copyright 2002 Rob Radez <rob@osinvestor.com>
*
* Based on wdt.c.
* Original copyright messages:
...
...
@@ -19,41 +20,48 @@
* warranty for any of this software. This material is provided
* "AS-IS" and at no charge.
*
* (c) Copyright 1995 Alan Cox <alan@lxorguk.ukuu.org.uk>
* (c) Copyright 1995 Alan Cox <alan@lxorguk.ukuu.org.uk>*
*/
/* Changelog:
*
* 2002/04/25 - Rob Radez
* clean up #includes
* clean up locking
* make __setup param unique
* proper options in watchdog_info
* add WDIOC_GETSTATUS and WDIOC_SETOPTIONS ioctls
* add expect_close support
*
* 14-Dec-2001 Matt Domsch <Matt_Domsch@dell.com>
* Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT
* Added timeout module option to override default
* 2001 - Rodolfo Giometti
* Initial release
*
* 2002.05.30 - Joel Becker <joel.becker@oracle.com>
* Added Matt Domsch's nowayout module option.
*/
#include <linux/config.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/version.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
#include <linux/slab.h>
#include <linux/ioport.h>
#include <linux/fcntl.h>
#include <linux/notifier.h>
#include <linux/reboot.h>
#include <linux/init.h>
#include <linux/spinlock.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <asm/system.h>
static
int
eurwdt_is_open
;
static
spinlock_t
eurwdt_lock
;
static
unsigned
long
eurwdt_is_open
;
static
int
eurwdt_timeout
;
static
char
eur_expect_close
;
/*
* You must set these - there is no sane way to probe for this board.
* You can use wdt=x,y to set these now.
* You can use
eur
wdt=x,y to set these now.
*/
static
int
io
=
0x3f0
;
...
...
@@ -61,20 +69,16 @@ static int irq = 10;
static
char
*
ev
=
"int"
;
#define WDT_TIMEOUT 60
/* 1 minute */
static
int
timeout
=
WDT_TIMEOUT
;
MODULE_PARM
(
timeout
,
"i"
);
MODULE_PARM_DESC
(
timeout
,
"Eurotech WDT timeout in seconds (default=60)"
);
#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)"
);
/*
* Some symbolic names
*/
...
...
@@ -115,7 +119,7 @@ str = get_options (str, ARRAY_SIZE(ints), ints);
return
1
;
}
__setup
(
"wdt="
,
eurwdt_setup
);
__setup
(
"
eur
wdt="
,
eurwdt_setup
);
#endif
/* !MODULE */
...
...
@@ -124,22 +128,13 @@ MODULE_PARM_DESC(io, "Eurotech WDT io port (default=0x3f0)");
MODULE_PARM
(
irq
,
"i"
);
MODULE_PARM_DESC
(
irq
,
"Eurotech WDT irq (default=10)"
);
MODULE_PARM
(
ev
,
"s"
);
MODULE_PARM_DESC
(
ev
,
"Eurotech WDT event type (default is `
reboo
t')"
);
MODULE_PARM_DESC
(
ev
,
"Eurotech WDT event type (default is `
in
t')"
);
/*
* Programming support
*/
static
void
__init
eurwdt_validate_timeout
(
void
)
{
if
(
timeout
<
0
||
timeout
>
255
)
{
timeout
=
WDT_TIMEOUT
;
printk
(
KERN_INFO
"eurwdt: timeout must be 0 < x < 255, using %d
\n
"
,
timeout
);
}
}
static
inline
void
eurwdt_write_reg
(
u8
index
,
u8
data
)
{
outb
(
index
,
io
);
...
...
@@ -214,7 +209,7 @@ void eurwdt_interrupt(int irq, void *dev_id, struct pt_regs *regs)
static
void
eurwdt_ping
(
void
)
{
/* Write the watchdog default value */
eurwdt_set_timeout
(
timeout
);
eurwdt_set_timeout
(
eurwdt_
timeout
);
}
/**
...
...
@@ -250,10 +245,9 @@ loff_t *ppos)
}
}
eurwdt_ping
();
/* the default timeout */
return
1
;
}
return
0
;
return
count
;
}
/**
...
...
@@ -271,12 +265,13 @@ static int eurwdt_ioctl(struct inode *inode, struct file *file,
unsigned
int
cmd
,
unsigned
long
arg
)
{
static
struct
watchdog_info
ident
=
{
.
options
=
WDIOF_
CARDRESET
,
.
options
=
WDIOF_
KEEPALIVEPING
|
WDIOF_SETTIMEOUT
|
WDIOF_MAGICCLOSE
,
.
firmware_version
=
1
,
.
identity
=
"WDT Eurotech CPU-1220/1410"
,
};
int
time
;
int
options
,
retval
=
-
EINVAL
;
switch
(
cmd
)
{
default:
...
...
@@ -286,6 +281,7 @@ static int eurwdt_ioctl(struct inode *inode, struct file *file,
return
copy_to_user
((
struct
watchdog_info
*
)
arg
,
&
ident
,
sizeof
(
ident
))
?
-
EFAULT
:
0
;
case
WDIOC_GETSTATUS
:
case
WDIOC_GETBOOTSTATUS
:
return
put_user
(
0
,
(
int
*
)
arg
);
...
...
@@ -301,9 +297,26 @@ static int eurwdt_ioctl(struct inode *inode, struct file *file,
if
(
time
<
0
||
time
>
255
)
return
-
EINVAL
;
timeout
=
time
;
eurwdt_
timeout
=
time
;
eurwdt_set_timeout
(
time
);
return
0
;
/* Fall */
case
WDIOC_GETTIMEOUT
:
return
put_user
(
eurwdt_timeout
,
(
int
*
)
arg
);
case
WDIOC_SETOPTIONS
:
if
(
get_user
(
options
,
(
int
*
)
arg
))
return
-
EFAULT
;
if
(
options
&
WDIOS_DISABLECARD
)
{
eurwdt_disable_timer
();
retval
=
0
;
}
if
(
options
&
WDIOS_ENABLECARD
)
{
eurwdt_activate_timer
();
eurwdt_ping
();
retval
=
0
;
}
return
retval
;
}
}
...
...
@@ -318,32 +331,12 @@ static int eurwdt_ioctl(struct inode *inode, struct file *file,
static
int
eurwdt_open
(
struct
inode
*
inode
,
struct
file
*
file
)
{
switch
(
minor
(
inode
->
i_rdev
))
{
case
WATCHDOG_MINOR
:
spin_lock
(
&
eurwdt_lock
);
if
(
eurwdt_is_open
)
{
spin_unlock
(
&
eurwdt_lock
);
if
(
test_and_set_bit
(
0
,
&
eurwdt_is_open
))
return
-
EBUSY
;
}
if
(
nowayout
)
MOD_INC_USE_COUNT
;
eurwdt_is_open
=
1
;
eurwdt_timeout
=
WDT_TIMEOUT
;
/* initial timeout */
/* Activate the WDT */
eurwdt_activate_timer
();
spin_unlock
(
&
eurwdt_lock
);
MOD_INC_USE_COUNT
;
return
0
;
case
TEMP_MINOR
:
return
0
;
default:
return
-
ENODEV
;
}
}
/**
...
...
@@ -360,14 +353,14 @@ static int eurwdt_open(struct inode *inode, struct file *file)
static
int
eurwdt_release
(
struct
inode
*
inode
,
struct
file
*
file
)
{
if
(
minor
(
inode
->
i_rdev
)
==
WATCHDOG_MINOR
)
{
if
(
!
nowayout
)
if
(
eur_expect_close
==
42
)
{
eurwdt_disable_timer
();
eurwdt_is_open
=
0
;
MOD_DEC_USE_COUNT
;
}
else
{
printk
(
KERN_CRIT
"eurwdt: Unexpected close, not stopping watchdog!
\n
"
)
;
eurwdt_ping
()
;
}
clear_bit
(
0
,
&
eurwdt_is_open
);
eur_expect_close
=
0
;
return
0
;
}
...
...
@@ -456,7 +449,6 @@ static int __init eurwdt_init(void)
{
int
ret
;
eurwdt_validate_timeout
();
ret
=
misc_register
(
&
eurwdt_miscdev
);
if
(
ret
)
{
printk
(
KERN_ERR
"eurwdt: can't misc_register on minor=%d
\n
"
,
...
...
@@ -489,8 +481,6 @@ static int __init eurwdt_init(void)
" - timeout event: %s
\n
"
,
io
,
irq
,
(
!
strcmp
(
"int"
,
ev
)
?
"int"
:
"reboot"
));
spin_lock_init
(
&
eurwdt_lock
);
out:
return
ret
;
...
...
drivers/char/watchdog/i810-tco.c
View file @
d3484261
...
...
@@ -47,9 +47,6 @@
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/mm.h>
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
#include <linux/reboot.h>
...
...
drivers/char/watchdog/ib700wdt.c
View file @
d3484261
...
...
@@ -33,24 +33,18 @@
#include <linux/config.h>
#include <linux/module.h>
#include <linux/version.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
#include <linux/slab.h>
#include <linux/ioport.h>
#include <linux/fcntl.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <asm/system.h>
#include <linux/notifier.h>
#include <linux/reboot.h>
#include <linux/init.h>
#include <linux/spinlock.h>
#include <linux/smp_lock.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <asm/system.h>
static
int
ibwdt_is_open
;
static
spinlock_t
ibwdt_lock
;
...
...
@@ -92,15 +86,32 @@ static int expect_close = 0;
*
*/
static
int
wd_times
[]
=
{
30
,
/* 0x0 */
28
,
/* 0x1 */
26
,
/* 0x2 */
24
,
/* 0x3 */
22
,
/* 0x4 */
20
,
/* 0x5 */
18
,
/* 0x6 */
16
,
/* 0x7 */
14
,
/* 0x8 */
12
,
/* 0x9 */
10
,
/* 0xA */
8
,
/* 0xB */
6
,
/* 0xC */
4
,
/* 0xD */
2
,
/* 0xE */
0
,
/* 0xF */
};
#define WDT_STOP 0x441
#define WDT_START 0x443
/* Default timeout */
#define WD_TIMO 0
/* 30 seconds +/- 20%, from table */
static
int
timeout_val
=
WD_TIMO
;
/* value in table */
static
int
timeout
=
30
;
/* in seconds */
MODULE_PARM
(
timeout
,
"i"
);
MODULE_PARM_DESC
(
timeout
,
"Watchdog timeout in seconds, 0 < n < 30, must be even (default=30)"
);
static
int
wd_margin
=
WD_TIMO
;
#ifdef CONFIG_WATCHDOG_NOWAYOUT
static
int
nowayout
=
1
;
...
...
@@ -111,22 +122,16 @@ static int nowayout = 0;
MODULE_PARM
(
nowayout
,
"i"
);
MODULE_PARM_DESC
(
nowayout
,
"Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"
);
/*
* Kernel methods.
*/
static
void
__init
ibwdt_validate_timeout
(
void
)
{
timeout_val
=
(
30
-
timeout
)
/
2
;
if
(
timeout_val
<
0
||
timeout_val
>
0xF
)
timeout_val
=
WD_TIMO
;
}
static
void
ibwdt_ping
(
void
)
{
/* Write a watchdog value */
outb_p
(
timeout_val
,
WDT_START
);
outb_p
(
wd_times
[
wd_margin
]
,
WDT_START
);
}
static
ssize_t
...
...
@@ -145,7 +150,6 @@ ibwdt_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
for
(
i
=
0
;
i
!=
count
;
i
++
)
{
char
c
;
if
(
get_user
(
c
,
buf
+
i
))
return
-
EFAULT
;
if
(
c
==
'V'
)
...
...
@@ -168,6 +172,8 @@ static int
ibwdt_ioctl
(
struct
inode
*
inode
,
struct
file
*
file
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
int
i
,
new_margin
;
static
struct
watchdog_info
ident
=
{
.
options
=
WDIOF_KEEPALIVEPING
|
WDIOF_SETTIMEOUT
|
WDIOF_MAGICCLOSE
,
.
firmware_version
=
1
,
...
...
@@ -189,6 +195,22 @@ ibwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
ibwdt_ping
();
break
;
case
WDIOC_SETTIMEOUT
:
if
(
get_user
(
new_margin
,
(
int
*
)
arg
))
return
-
EFAULT
;
if
((
new_margin
<
0
)
||
(
new_margin
>
30
))
return
-
EINVAL
;
for
(
i
=
0x0F
;
i
>
-
1
;
i
--
)
if
(
wd_times
[
i
]
>
new_margin
)
break
;
wd_margin
=
i
;
ibwdt_ping
();
/* Fall */
case
WDIOC_GETTIMEOUT
:
return
put_user
(
wd_times
[
wd_margin
],
(
int
*
)
arg
);
break
;
default:
return
-
ENOTTY
;
}
...
...
@@ -223,7 +245,7 @@ ibwdt_close(struct inode *inode, struct file *file)
if
(
minor
(
inode
->
i_rdev
)
==
WATCHDOG_MINOR
)
{
spin_lock
(
&
ibwdt_lock
);
if
(
expect_close
)
outb_p
(
timeout_val
,
WDT_STOP
);
outb_p
(
wd_times
[
wd_margin
]
,
WDT_STOP
);
else
printk
(
KERN_CRIT
"WDT device closed unexpectedly. WDT will not stop!
\n
"
);
...
...
@@ -243,7 +265,7 @@ ibwdt_notify_sys(struct notifier_block *this, unsigned long code,
{
if
(
code
==
SYS_DOWN
||
code
==
SYS_HALT
)
{
/* Turn the WDT off */
outb_p
(
timeout_val
,
WDT_STOP
);
outb_p
(
wd_times
[
wd_margin
]
,
WDT_STOP
);
}
return
NOTIFY_DONE
;
}
...
...
@@ -283,7 +305,6 @@ ibwdt_init(void)
{
printk
(
"WDT driver for IB700 single board computer initialising.
\n
"
);
ibwdt_validate_timeout
();
spin_lock_init
(
&
ibwdt_lock
);
if
(
misc_register
(
&
ibwdt_miscdev
))
return
-
ENODEV
;
...
...
drivers/char/watchdog/indydog.c
View file @
d3484261
...
...
@@ -19,7 +19,6 @@
#include <linux/mm.h>
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
#include <linux/smp_lock.h>
#include <linux/init.h>
#include <asm/uaccess.h>
#include <asm/sgi/sgimc.h>
...
...
drivers/char/watchdog/machzwd.c
View file @
d3484261
...
...
@@ -30,25 +30,19 @@
#include <linux/config.h>
#include <linux/module.h>
#include <linux/version.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/timer.h>
#include <linux/jiffies.h>
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
#include <linux/slab.h>
#include <linux/ioport.h>
#include <linux/fcntl.h>
#include <linux/smp_lock.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <asm/system.h>
#include <linux/notifier.h>
#include <linux/reboot.h>
#include <linux/init.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <asm/system.h>
/* ports */
#define ZF_IOBASE 0x218
...
...
drivers/char/watchdog/mixcomwd.c
View file @
d3484261
...
...
@@ -38,15 +38,11 @@
#include <linux/module.h>
#include <linux/config.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/mm.h>
#include <linux/miscdevice.h>
#include <linux/ioport.h>
#include <linux/watchdog.h>
#include <linux/reboot.h>
#include <linux/init.h>
#include <linux/smp_lock.h>
#include <asm/uaccess.h>
#include <asm/io.h>
...
...
drivers/char/watchdog/pcwd.c
View file @
d3484261
...
...
@@ -45,27 +45,17 @@
*/
#include <linux/module.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/tty.h>
#include <linux/timer.h>
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/wait.h>
#include <linux/string.h>
#include <linux/slab.h>
#include <linux/ioport.h>
#include <linux/delay.h>
#include <linux/miscdevice.h>
#include <linux/fs.h>
#include <linux/mm.h>
#include <linux/watchdog.h>
#include <linux/init.h>
#include <linux/proc_fs.h>
#include <linux/spinlock.h>
#include <linux/smp_lock.h>
#include <asm/uaccess.h>
#include <asm/io.h>
...
...
drivers/char/watchdog/sa1100_wdt.c
View file @
d3484261
...
...
@@ -24,7 +24,6 @@
#include <linux/fs.h>
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
#include <linux/smp_lock.h>
#include <linux/init.h>
#include <asm/hardware.h>
...
...
drivers/char/watchdog/sbc60xxwdt.c
View file @
d3484261
...
...
@@ -56,25 +56,20 @@
*/
#include <linux/module.h>
#include <linux/version.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/timer.h>
#include <linux/jiffies.h>
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
#include <linux/slab.h>
#include <linux/ioport.h>
#include <linux/fcntl.h>
#include <linux/smp_lock.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <asm/system.h>
#include <linux/notifier.h>
#include <linux/reboot.h>
#include <linux/init.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <asm/system.h>
#define OUR_NAME "sbc60xxwdt"
/*
...
...
drivers/char/watchdog/sc1200wdt.c
View file @
d3484261
...
...
@@ -28,21 +28,20 @@
#include <linux/config.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
#include <linux/ioport.h>
#include <linux/spinlock.h>
#include <linux/ioport.h>
#include <asm/semaphore.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <linux/notifier.h>
#include <linux/reboot.h>
#include <linux/init.h>
#include <linux/isapnp.h>
#include <linux/pci.h>
#include <asm/semaphore.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#define SC1200_MODULE_VER "build 20020303"
#define SC1200_MODULE_NAME "sc1200wdt"
#define PFX SC1200_MODULE_NAME ": "
...
...
drivers/char/watchdog/sc520_wdt.c
View file @
d3484261
...
...
@@ -49,25 +49,19 @@
*/
#include <linux/module.h>
#include <linux/version.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/timer.h>
#include <linux/sched.h>
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
#include <linux/slab.h>
#include <linux/ioport.h>
#include <linux/fcntl.h>
#include <linux/smp_lock.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <asm/system.h>
#include <linux/notifier.h>
#include <linux/reboot.h>
#include <linux/init.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <asm/system.h>
/*
* The SC520 can timeout anywhere from 492us to 32.21s.
* If we reset the watchdog every ~250ms we should be safe.
...
...
drivers/char/watchdog/scx200_wdt.c
View file @
d3484261
...
...
@@ -19,19 +19,17 @@
#include <linux/config.h>
#include <linux/module.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
#include <linux/notifier.h>
#include <linux/reboot.h>
#include <linux/pci.h>
#include <linux/scx200.h>
#include <asm/uaccess.h>
#include <asm/io.h>
#include <linux/scx200.h>
#define NAME "scx200_wdt"
MODULE_AUTHOR
(
"Christer Weinigel <wingel@nano-system.com>"
);
...
...
drivers/char/watchdog/shwdt.c
View file @
d3484261
...
...
@@ -16,7 +16,6 @@
#include <linux/config.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
...
...
drivers/char/watchdog/softdog.c
View file @
d3484261
...
...
@@ -35,13 +35,9 @@
#include <linux/module.h>
#include <linux/config.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/mm.h>
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
#include <linux/reboot.h>
#include <linux/smp_lock.h>
#include <linux/init.h>
#include <asm/uaccess.h>
...
...
drivers/char/watchdog/w83877f_wdt.c
View file @
d3484261
...
...
@@ -42,24 +42,18 @@
*/
#include <linux/module.h>
#include <linux/version.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/timer.h>
#include <linux/jiffies.h>
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
#include <linux/slab.h>
#include <linux/ioport.h>
#include <linux/fcntl.h>
#include <linux/smp_lock.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <asm/system.h>
#include <linux/notifier.h>
#include <linux/reboot.h>
#include <linux/init.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <asm/system.h>
#define OUR_NAME "w83877f_wdt"
...
...
drivers/char/watchdog/wafer5823wdt.c
View file @
d3484261
...
...
@@ -27,16 +27,15 @@
*/
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
#include <linux/ioport.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <linux/notifier.h>
#include <linux/reboot.h>
#include <linux/init.h>
#include <linux/spinlock.h>
#include <asm/io.h>
#include <asm/uaccess.h>
static
unsigned
long
wafwdt_is_open
;
static
spinlock_t
wafwdt_lock
;
...
...
drivers/char/watchdog/wdt.c
View file @
d3484261
...
...
@@ -33,16 +33,10 @@
#include <linux/config.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/version.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
#include "wd501p.h"
#include <linux/slab.h>
#include <linux/ioport.h>
#include <linux/fcntl.h>
#include <linux/notifier.h>
#include <linux/reboot.h>
#include <linux/init.h>
...
...
@@ -50,6 +44,7 @@
#include <asm/io.h>
#include <asm/uaccess.h>
#include <asm/system.h>
#include "wd501p.h"
static
unsigned
long
wdt_is_open
;
static
int
expect_close
;
...
...
drivers/char/watchdog/wdt285.c
View file @
d3484261
...
...
@@ -25,7 +25,6 @@
#include <linux/reboot.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/smp_lock.h>
#include <asm/irq.h>
#include <asm/uaccess.h>
...
...
drivers/char/watchdog/wdt977.c
View file @
d3484261
...
...
@@ -25,7 +25,6 @@
#include <linux/fs.h>
#include <linux/miscdevice.h>
#include <linux/init.h>
#include <linux/smp_lock.h>
#include <linux/watchdog.h>
#include <asm/io.h>
...
...
drivers/char/watchdog/wdt_pci.c
View file @
d3484261
...
...
@@ -36,15 +36,10 @@
#include <linux/config.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/version.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
#include <linux/slab.h>
#include <linux/ioport.h>
#include <linux/fcntl.h>
#include <linux/notifier.h>
#include <linux/reboot.h>
#include <linux/init.h>
...
...
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