25 #undef PDC_CHASSIS_DEBUG
26 #ifdef PDC_CHASSIS_DEBUG
27 #define DPRINTK(fmt, args...) printk(fmt, ## args)
29 #define DPRINTK(fmt, args...)
33 #include <linux/kernel.h>
34 #include <linux/reboot.h>
40 #include <asm/processor.h>
44 #define PDC_CHASSIS_VER "0.05"
46 #ifdef CONFIG_PDC_CHASSIS
56 static int __init pdc_chassis_setup(
char *
str)
62 __setup(
"pdcchassis=", pdc_chassis_setup);
73 static void __init pdc_chassis_checkold(
void)
86 DPRINTK(
KERN_DEBUG "%s: pdc_chassis_checkold(); pdc_chassis_old = %d\n", __FILE__, pdc_chassis_old);
137 #ifdef CONFIG_PDC_CHASSIS
138 if (
likely(pdc_chassis_enabled)) {
148 &pdc_chassis_panic_block);
175 #ifdef CONFIG_PDC_CHASSIS
176 if (
likely(pdc_chassis_enabled)) {
245 #ifdef CONFIG_PDC_CHASSIS_WARN
246 #ifdef CONFIG_PROC_FS
247 static int pdc_chassis_warn_pread(
char *
page,
char **
start,
off_t off,
259 warnreg = (warn & 0xFFFFFFFF);
261 if ((warnreg >> 24) & 0xFF)
262 out +=
sprintf(out,
"Chassis component failure! (eg fan or PSU): 0x%.2x\n", ((warnreg >> 24) & 0xFF));
264 out +=
sprintf(out,
"Battery: %s\n", (warnreg & 0x04) ?
"Low!" :
"OK");
265 out +=
sprintf(out,
"Temp low: %s\n", (warnreg & 0x02) ?
"Exceeded!" :
"OK");
266 out +=
sprintf(out,
"Temp mid: %s\n", (warnreg & 0x01) ?
"Exceeded!" :
"OK");
268 len = out - page - off;
271 if (len <= 0)
return 0;
279 static int __init pdc_chassis_create_procfs(
void)
293 create_proc_read_entry(
"chassis", 0400,
NULL, pdc_chassis_warn_pread,