Commit 0e6fa3fb authored by Alan Cox's avatar Alan Cox Committed by Wim Van Sebroeck

[WATCHDOG 18/57] iTCO: unlocked_ioctl, coding style and cleanup

Review and switch to unlocked_ioctl
Signed-off-by: default avatarAlan Cox <alan@redhat.com>
Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
parent 30abcec1
/* iTCO Vendor Specific Support hooks */
#ifdef CONFIG_ITCO_VENDOR_SUPPORT
extern void iTCO_vendor_pre_start(unsigned long, unsigned int);
extern void iTCO_vendor_pre_stop(unsigned long);
extern void iTCO_vendor_pre_keepalive(unsigned long, unsigned int);
extern void iTCO_vendor_pre_set_heartbeat(unsigned int);
extern int iTCO_vendor_check_noreboot_on(void);
#else
#define iTCO_vendor_pre_start(acpibase, heartbeat) {}
#define iTCO_vendor_pre_stop(acpibase) {}
#define iTCO_vendor_pre_keepalive(acpibase, heartbeat) {}
#define iTCO_vendor_pre_set_heartbeat(heartbeat) {}
#define iTCO_vendor_check_noreboot_on() 1
/* 1=check noreboot; 0=don't check */
#endif
...@@ -32,7 +32,9 @@ ...@@ -32,7 +32,9 @@
#include <linux/init.h> /* For __init/__exit/... */ #include <linux/init.h> /* For __init/__exit/... */
#include <linux/ioport.h> /* For io-port access */ #include <linux/ioport.h> /* For io-port access */
#include <asm/io.h> /* For inb/outb/... */ #include <linux/io.h> /* For inb/outb/... */
#include "iTCO_vendor.h"
/* iTCO defines */ /* iTCO defines */
#define SMI_EN acpibase + 0x30 /* SMI Control and Enable Register */ #define SMI_EN acpibase + 0x30 /* SMI Control and Enable Register */
...@@ -40,10 +42,12 @@ ...@@ -40,10 +42,12 @@
#define TCO1_STS TCOBASE + 0x04 /* TCO1 Status Register */ #define TCO1_STS TCOBASE + 0x04 /* TCO1 Status Register */
/* List of vendor support modes */ /* List of vendor support modes */
#define SUPERMICRO_OLD_BOARD 1 /* SuperMicro Pentium 3 Era 370SSE+-OEM1/P3TSSE */ /* SuperMicro Pentium 3 Era 370SSE+-OEM1/P3TSSE */
#define SUPERMICRO_NEW_BOARD 2 /* SuperMicro Pentium 4 / Xeon 4 / EMT64T Era Systems */ #define SUPERMICRO_OLD_BOARD 1
/* SuperMicro Pentium 4 / Xeon 4 / EMT64T Era Systems */
#define SUPERMICRO_NEW_BOARD 2
static int vendorsupport = 0; static int vendorsupport;
module_param(vendorsupport, int, 0); module_param(vendorsupport, int, 0);
MODULE_PARM_DESC(vendorsupport, "iTCO vendor specific support mode, default=0 (none), 1=SuperMicro Pent3, 2=SuperMicro Pent4+"); MODULE_PARM_DESC(vendorsupport, "iTCO vendor specific support mode, default=0 (none), 1=SuperMicro Pent3, 2=SuperMicro Pent4+");
...@@ -167,10 +171,11 @@ static void supermicro_old_pre_keepalive(unsigned long acpibase) ...@@ -167,10 +171,11 @@ static void supermicro_old_pre_keepalive(unsigned long acpibase)
static void supermicro_new_unlock_watchdog(void) static void supermicro_new_unlock_watchdog(void)
{ {
outb(SM_WATCHPAGE, SM_REGINDEX); /* Write 0x87 to port 0x2e twice */ /* Write 0x87 to port 0x2e twice */
outb(SM_WATCHPAGE, SM_REGINDEX); outb(SM_WATCHPAGE, SM_REGINDEX);
outb(SM_WATCHPAGE, SM_REGINDEX);
outb(SM_CTLPAGESW, SM_REGINDEX); /* Switch to watchdog control page */ /* Switch to watchdog control page */
outb(SM_CTLPAGESW, SM_REGINDEX);
outb(SM_CTLPAGE, SM_DATAIO); outb(SM_CTLPAGE, SM_DATAIO);
} }
...@@ -192,7 +197,7 @@ static void supermicro_new_pre_start(unsigned int heartbeat) ...@@ -192,7 +197,7 @@ static void supermicro_new_pre_start(unsigned int heartbeat)
outb(val, SM_DATAIO); outb(val, SM_DATAIO);
/* Write heartbeat interval to WDOG */ /* Write heartbeat interval to WDOG */
outb (SM_WATCHTIMER, SM_REGINDEX); outb(SM_WATCHTIMER, SM_REGINDEX);
outb((heartbeat & 255), SM_DATAIO); outb((heartbeat & 255), SM_DATAIO);
/* Make sure keyboard/mouse interrupts don't interfere */ /* Make sure keyboard/mouse interrupts don't interfere */
...@@ -277,7 +282,7 @@ EXPORT_SYMBOL(iTCO_vendor_pre_set_heartbeat); ...@@ -277,7 +282,7 @@ EXPORT_SYMBOL(iTCO_vendor_pre_set_heartbeat);
int iTCO_vendor_check_noreboot_on(void) int iTCO_vendor_check_noreboot_on(void)
{ {
switch(vendorsupport) { switch (vendorsupport) {
case SUPERMICRO_OLD_BOARD: case SUPERMICRO_OLD_BOARD:
return 0; return 0;
default: default:
...@@ -288,13 +293,13 @@ EXPORT_SYMBOL(iTCO_vendor_check_noreboot_on); ...@@ -288,13 +293,13 @@ EXPORT_SYMBOL(iTCO_vendor_check_noreboot_on);
static int __init iTCO_vendor_init_module(void) static int __init iTCO_vendor_init_module(void)
{ {
printk (KERN_INFO PFX "vendor-support=%d\n", vendorsupport); printk(KERN_INFO PFX "vendor-support=%d\n", vendorsupport);
return 0; return 0;
} }
static void __exit iTCO_vendor_exit_module(void) static void __exit iTCO_vendor_exit_module(void)
{ {
printk (KERN_INFO PFX "Module Unloaded\n"); printk(KERN_INFO PFX "Module Unloaded\n");
} }
module_init(iTCO_vendor_init_module); module_init(iTCO_vendor_init_module);
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment