dmidecode/dmidecode-2.11-chassis_fix.patch

43 lines
1.6 KiB
Diff
Raw Normal View History

diff -up dmidecode-2.11/AUTHORS.chassis_fix dmidecode-2.11/AUTHORS
--- dmidecode-2.11/AUTHORS.chassis_fix 2010-11-24 10:29:09.000000000 +0100
+++ dmidecode-2.11/AUTHORS 2011-11-14 14:56:08.000000000 +0100
@@ -81,3 +81,5 @@ Murlin Wenzel
Harald Mueller-Ney
Lars Mueller
Thomas Mingarelli
+Andrey Matveyev
+Stefan Tauner
diff -up dmidecode-2.11/CHANGELOG.chassis_fix dmidecode-2.11/CHANGELOG
--- dmidecode-2.11/CHANGELOG.chassis_fix 2011-11-14 14:56:39.804855909 +0100
+++ dmidecode-2.11/CHANGELOG 2011-11-14 14:56:15.000000000 +0100
@@ -1,3 +1,8 @@
+2011-11-14 Anton Arapov <anton@redhat.com>
+
+ * dmidecode.c: Make dmi_chassis_type aware of the lock bit.
+ Patch from Stefan Tauner.
+
2011-04-20 Jean Delvare <khali@linux-fr.org>
Update to support SMBIOS specification version 2.7.1.
diff -up dmidecode-2.11/dmidecode.c.chassis_fix dmidecode-2.11/dmidecode.c
--- dmidecode-2.11/dmidecode.c.chassis_fix 2011-11-14 14:56:39.805855910 +0100
+++ dmidecode-2.11/dmidecode.c 2011-11-14 14:55:12.000000000 +0100
@@ -532,6 +532,8 @@ static const char *dmi_chassis_type(u8 c
"Blade Enclosing" /* 0x1D */
};
+ code &= 0x7F; /* bits 6:0 are chassis type, 7th bit is the lock bit */
+
if (code >= 0x01 && code <= 0x1D)
return type[code - 0x01];
return out_of_spec;
@@ -3237,7 +3239,7 @@ static void dmi_decode(const struct dmi_
printf("\tManufacturer: %s\n",
dmi_string(h, data[0x04]));
printf("\tType: %s\n",
- dmi_chassis_type(data[0x05] & 0x7F));
+ dmi_chassis_type(data[0x05]));
printf("\tLock: %s\n",
dmi_chassis_lock(data[0x05] >> 7));
printf("\tVersion: %s\n",