Messages in this thread Patch in this message | | | Date | Sat, 1 Aug 1998 13:08:05 +0200 | From | Pavel Machek <> | Subject | Making APM less verbose |
| |
Hi!
This is update for apm bios: it makes it less verbose in non-debugging case so you don't have your bootscreen full of unnecessary data. Who should I post this to for inclusion into main tree?
Pavel
--- clean//drivers/char/apm_bios.c Tue Jun 9 22:35:46 1998 +++ linux/drivers/char/apm_bios.c Mon Jun 15 18:46:42 1998 @@ -156,8 +156,9 @@ * * U: TI 4000M TravelMate: BIOS is *NOT* APM compliant * [Confirmed by TI representative] - * U: ACER 486DX4/75: uses dseg 0040, in violation of APM specification + * ?: ACER 486DX4/75: uses dseg 0040, in violation of APM specification * [Confirmed by BIOS disassembly] + * Should be ok now, we have workaround. Somebody test. <pavel@ucw.cz> * P: Toshiba 1950S: battery life information only gets updated after resume * P: Midwest Micro Soundbook Elite DX2/66 monochrome: screen blanking * broken in BIOS [Reported by Garst R. Reese <reese@isn.net>] @@ -547,11 +548,13 @@ { int i; +#ifdef APM_DEBUG for (i = 0; i < ERROR_COUNT; i++) if (error_table[i].key == err) break; if (i < ERROR_COUNT) printk(KERN_NOTICE "apm_bios: %s: %s\n", str, error_table[i].msg); else +#endif printk(KERN_NOTICE "apm_bios: %s: unknown error code %#2.2x\n", str, err); } @@ -639,7 +642,7 @@ static int notified; if (notified == 0) { - printk( "apm_bios: an event queue overflowed\n" ); + printk(KERN_ERR "apm_bios: an event queue overflowed\n" ); notified = 1; } as->event_tail = (as->event_tail + 1) % APM_MAX_EVENTS; @@ -1168,13 +1171,15 @@ printk(KERN_INFO "APM BIOS not found.\n"); return; } - printk(KERN_INFO "APM BIOS version %c.%c Flags 0x%02x (Driver version %s)\n", + printk(KERN_INFO "APM BIOS version %c.%c ", ((apm_bios_info.version >> 8) & 0xff) + '0', - (apm_bios_info.version & 0xff) + '0', - apm_bios_info.flags, - driver_version); + (apm_bios_info.version & 0xff) + '0'); + +#ifdef APM_DEBUG + printk( "Flags 0x%02x (Driver version %s)\n", apm_bios_info.flags, driver_version); +#endif if ((apm_bios_info.flags & APM_32_BIT_SUPPORT) == 0) { - printk(KERN_INFO " No 32 bit BIOS support\n"); + printk(KERN_INFO "APM BIOS has no 32 bit BIOS support\n"); return; } @@ -1189,6 +1194,7 @@ if (apm_bios_info.version < 0x102) apm_bios_info.cseg_16_len = 0xFFFF; /* 64k */ +#ifdef APM_DEBUG printk(KERN_INFO " Entry %x:%lx cseg16 %x dseg %x", apm_bios_info.cseg, apm_bios_info.offset, apm_bios_info.cseg_16, apm_bios_info.dseg); @@ -1197,6 +1203,7 @@ apm_bios_info.cseg_len, apm_bios_info.cseg_16_len, apm_bios_info.dseg_len); printk("\n"); +#endif /* * Set up a segment that references the real mode segment 0x40 @@ -1246,9 +1253,11 @@ apm_bios_info.version = 0x100; else { apm_engage_power_management(0x0001); +#ifdef APM_DEBUG printk( " Connection version %d.%d\n", (apm_bios_info.version >> 8) & 0xff, apm_bios_info.version & 0xff ); +#endif } } @@ -1262,6 +1271,7 @@ case 2: power_stat = "on backup power"; break; default: power_stat = "unknown"; break; } +#ifdef APM_DEBUG switch (bx & 0xff) { case 0: bat_stat = "high"; break; case 1: bat_stat = "low"; break; @@ -1269,12 +1279,15 @@ case 3: bat_stat = "charging"; break; default: bat_stat = "unknown"; break; } - printk(KERN_INFO " AC %s, battery status %s, battery life ", - power_stat, bat_stat); + printk(KERN_INFO " Battery status %s, ", bat_stat); +#endif + printk( "AC %s, battery ", power_stat ); if ((cx & 0xff) == 0xff) printk("unknown\n"); else printk("%d%%\n", cx & 0xff); + +#ifdef APM_DEBUG if (apm_bios_info.version > 0x100) { printk(" battery flag 0x%02x, battery life ", (cx >> 8) & 0xff); @@ -1287,6 +1300,7 @@ printk("%d seconds\n", dx & 0x7fff ); } } +#endif } #ifdef CONFIG_APM_DO_ENABLE -- I'm really pavel@atrey.karlin.mff.cuni.cz. Pavel Look at http://atrey.karlin.mff.cuni.cz/~pavel/ ;-).
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html
| |