diff options
Diffstat (limited to 'drivers/firmware/dmi_scan.c')
-rw-r--r-- | drivers/firmware/dmi_scan.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c index b3d22d659990..e28e41668177 100644 --- a/drivers/firmware/dmi_scan.c +++ b/drivers/firmware/dmi_scan.c | |||
@@ -2,6 +2,7 @@ | |||
2 | #include <linux/string.h> | 2 | #include <linux/string.h> |
3 | #include <linux/init.h> | 3 | #include <linux/init.h> |
4 | #include <linux/module.h> | 4 | #include <linux/module.h> |
5 | #include <linux/ctype.h> | ||
5 | #include <linux/dmi.h> | 6 | #include <linux/dmi.h> |
6 | #include <linux/efi.h> | 7 | #include <linux/efi.h> |
7 | #include <linux/bootmem.h> | 8 | #include <linux/bootmem.h> |
@@ -361,6 +362,33 @@ static void __init dmi_decode(const struct dmi_header *dm, void *dummy) | |||
361 | } | 362 | } |
362 | } | 363 | } |
363 | 364 | ||
365 | static void __init print_filtered(const char *info) | ||
366 | { | ||
367 | const char *p; | ||
368 | |||
369 | if (!info) | ||
370 | return; | ||
371 | |||
372 | for (p = info; *p; p++) | ||
373 | if (isprint(*p)) | ||
374 | printk(KERN_CONT "%c", *p); | ||
375 | else | ||
376 | printk(KERN_CONT "\\x%02x", *p & 0xff); | ||
377 | } | ||
378 | |||
379 | static void __init dmi_dump_ids(void) | ||
380 | { | ||
381 | printk(KERN_DEBUG "DMI: "); | ||
382 | print_filtered(dmi_get_system_info(DMI_BOARD_NAME)); | ||
383 | printk(KERN_CONT "/"); | ||
384 | print_filtered(dmi_get_system_info(DMI_PRODUCT_NAME)); | ||
385 | printk(KERN_CONT ", BIOS "); | ||
386 | print_filtered(dmi_get_system_info(DMI_BIOS_VERSION)); | ||
387 | printk(KERN_CONT " "); | ||
388 | print_filtered(dmi_get_system_info(DMI_BIOS_DATE)); | ||
389 | printk(KERN_CONT "\n"); | ||
390 | } | ||
391 | |||
364 | static int __init dmi_present(const char __iomem *p) | 392 | static int __init dmi_present(const char __iomem *p) |
365 | { | 393 | { |
366 | u8 buf[15]; | 394 | u8 buf[15]; |
@@ -381,8 +409,10 @@ static int __init dmi_present(const char __iomem *p) | |||
381 | buf[14] >> 4, buf[14] & 0xF); | 409 | buf[14] >> 4, buf[14] & 0xF); |
382 | else | 410 | else |
383 | printk(KERN_INFO "DMI present.\n"); | 411 | printk(KERN_INFO "DMI present.\n"); |
384 | if (dmi_walk_early(dmi_decode) == 0) | 412 | if (dmi_walk_early(dmi_decode) == 0) { |
413 | dmi_dump_ids(); | ||
385 | return 0; | 414 | return 0; |
415 | } | ||
386 | } | 416 | } |
387 | return 1; | 417 | return 1; |
388 | } | 418 | } |