From fd68a1191ac3553dfe9f55b26c4427474a2d27f9 Mon Sep 17 00:00:00 2001 From: Zhenzhong Duan Date: Thu, 20 Dec 2012 15:05:13 -0800 Subject: [PATCH] --- yaml --- r: 347871 b: refs/heads/master c: f1d8e614d74b09531b9a85e812485340f3df7b1c h: refs/heads/master i: 347869: 331b501380030f8abea7268d03a714dcaf9c7cf8 347867: ebd3cf5bd08568d19662efb8d10b27c99b1c3c27 347863: a6b0bbfc080b8e7ed9d65be66fb2bdb5a4de88bb 347855: b34bb18ef343b9ce4438b0eaac14ddaadddec9ba 347839: 829ff6e9dd801c902bcf1abb00d18fa53003ff49 v: v3 --- [refs] | 2 +- trunk/drivers/firmware/dmi_scan.c | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index f334526a9762..25692e491d65 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 038b358e5592eff9be175cf6601042ecc8b28179 +refs/heads/master: f1d8e614d74b09531b9a85e812485340f3df7b1c diff --git a/trunk/drivers/firmware/dmi_scan.c b/trunk/drivers/firmware/dmi_scan.c index b298158cb922..3714e3c03df6 100644 --- a/trunk/drivers/firmware/dmi_scan.c +++ b/trunk/drivers/firmware/dmi_scan.c @@ -16,6 +16,7 @@ */ static char dmi_empty_string[] = " "; +static u16 __initdata dmi_ver; /* * Catch too early calls to dmi_check_system(): */ @@ -161,8 +162,10 @@ static void __init dmi_save_uuid(const struct dmi_header *dm, int slot, int inde return; for (i = 0; i < 16 && (is_ff || is_00); i++) { - if(d[i] != 0x00) is_ff = 0; - if(d[i] != 0xFF) is_00 = 0; + if (d[i] != 0x00) + is_00 = 0; + if (d[i] != 0xFF) + is_ff = 0; } if (is_ff || is_00) @@ -172,7 +175,15 @@ static void __init dmi_save_uuid(const struct dmi_header *dm, int slot, int inde if (!s) return; - sprintf(s, "%pUB", d); + /* + * As of version 2.6 of the SMBIOS specification, the first 3 fields of + * the UUID are supposed to be little-endian encoded. The specification + * says that this is the defacto standard. + */ + if (dmi_ver >= 0x0206) + sprintf(s, "%pUL", d); + else + sprintf(s, "%pUB", d); dmi_ident[slot] = s; } @@ -414,6 +425,7 @@ static int __init dmi_present(const char __iomem *p) * DMI version 0.0 means that the real version is taken from * the SMBIOS version, which we don't know at this point. */ + dmi_ver = (buf[14] & 0xf0) << 4 | (buf[14] & 0x0f); if (buf[14] != 0) printk(KERN_INFO "DMI %d.%d present.\n", buf[14] >> 4, buf[14] & 0xF);