aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/firmware')
-rw-r--r--drivers/firmware/dmi_scan.c44
1 files changed, 27 insertions, 17 deletions
diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
index 4cd392dbf115..862b1d27a85b 100644
--- a/drivers/firmware/dmi_scan.c
+++ b/drivers/firmware/dmi_scan.c
@@ -22,6 +22,9 @@ static u16 __initdata dmi_ver;
22 */ 22 */
23static int dmi_initialized; 23static int dmi_initialized;
24 24
25/* DMI system identification string used during boot */
26static char dmi_ids_string[128] __initdata;
27
25static const char * __init dmi_string_nosave(const struct dmi_header *dm, u8 s) 28static const char * __init dmi_string_nosave(const struct dmi_header *dm, u8 s)
26{ 29{
27 const u8 *bp = ((u8 *) dm) + dm->length; 30 const u8 *bp = ((u8 *) dm) + dm->length;
@@ -376,38 +379,44 @@ static void __init dmi_decode(const struct dmi_header *dm, void *dummy)
376 } 379 }
377} 380}
378 381
379static void __init print_filtered(const char *info) 382static int __init print_filtered(char *buf, size_t len, const char *info)
380{ 383{
384 int c = 0;
381 const char *p; 385 const char *p;
382 386
383 if (!info) 387 if (!info)
384 return; 388 return c;
385 389
386 for (p = info; *p; p++) 390 for (p = info; *p; p++)
387 if (isprint(*p)) 391 if (isprint(*p))
388 printk(KERN_CONT "%c", *p); 392 c += scnprintf(buf + c, len - c, "%c", *p);
389 else 393 else
390 printk(KERN_CONT "\\x%02x", *p & 0xff); 394 c += scnprintf(buf + c, len - c, "\\x%02x", *p & 0xff);
395 return c;
391} 396}
392 397
393static void __init dmi_dump_ids(void) 398static void __init dmi_format_ids(char *buf, size_t len)
394{ 399{
400 int c = 0;
395 const char *board; /* Board Name is optional */ 401 const char *board; /* Board Name is optional */
396 402
397 printk(KERN_DEBUG "DMI: "); 403 c += print_filtered(buf + c, len - c,
398 print_filtered(dmi_get_system_info(DMI_SYS_VENDOR)); 404 dmi_get_system_info(DMI_SYS_VENDOR));
399 printk(KERN_CONT " "); 405 c += scnprintf(buf + c, len - c, " ");
400 print_filtered(dmi_get_system_info(DMI_PRODUCT_NAME)); 406 c += print_filtered(buf + c, len - c,
407 dmi_get_system_info(DMI_PRODUCT_NAME));
408
401 board = dmi_get_system_info(DMI_BOARD_NAME); 409 board = dmi_get_system_info(DMI_BOARD_NAME);
402 if (board) { 410 if (board) {
403 printk(KERN_CONT "/"); 411 c += scnprintf(buf + c, len - c, "/");
404 print_filtered(board); 412 c += print_filtered(buf + c, len - c, board);
405 } 413 }
406 printk(KERN_CONT ", BIOS "); 414 c += scnprintf(buf + c, len - c, ", BIOS ");
407 print_filtered(dmi_get_system_info(DMI_BIOS_VERSION)); 415 c += print_filtered(buf + c, len - c,
408 printk(KERN_CONT " "); 416 dmi_get_system_info(DMI_BIOS_VERSION));
409 print_filtered(dmi_get_system_info(DMI_BIOS_DATE)); 417 c += scnprintf(buf + c, len - c, " ");
410 printk(KERN_CONT "\n"); 418 c += print_filtered(buf + c, len - c,
419 dmi_get_system_info(DMI_BIOS_DATE));
411} 420}
412 421
413static int __init dmi_present(const char __iomem *p) 422static int __init dmi_present(const char __iomem *p)
@@ -431,7 +440,8 @@ static int __init dmi_present(const char __iomem *p)
431 pr_info("Legacy DMI %d.%d present.\n", 440 pr_info("Legacy DMI %d.%d present.\n",
432 dmi_ver >> 8, dmi_ver & 0xFF); 441 dmi_ver >> 8, dmi_ver & 0xFF);
433 } 442 }
434 dmi_dump_ids(); 443 dmi_format_ids(dmi_ids_string, sizeof(dmi_ids_string));
444 printk(KERN_DEBUG "DMI: %s\n", dmi_ids_string);
435 return 0; 445 return 0;
436 } 446 }
437 } 447 }