summaryrefslogtreecommitdiff
path: root/vpddecode.c
diff options
context:
space:
mode:
authorJean Delvare <jdelvare@suse.de>2005-09-13 16:34:08 +0000
committerJean Delvare <jdelvare@suse.de>2005-09-13 16:34:08 +0000
commitc6a3d622f1ce43b0a9cef45403bd129b23f3c083 (patch)
tree42e64b79d40856df07a01754690f2f905ca09131 /vpddecode.c
parent55ad82a9e47f80c33b44edf718ba9a23154b0d76 (diff)
downloaddmidecode-git-c6a3d622f1ce43b0a9cef45403bd129b23f3c083.tar.gz
Slightly change the xSeries checksumming method to accomodate a strange
xSeries 440 VPD record. Also tweak the decoding of the "Default Flash Image File Name" entry. Thanks to Torsten Seemann for providing a test VPD record.
Diffstat (limited to 'vpddecode.c')
-rw-r--r--vpddecode.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/vpddecode.c b/vpddecode.c
index cafc6ee..06c5118 100644
--- a/vpddecode.c
+++ b/vpddecode.c
@@ -267,8 +267,8 @@ static int decode(const u8 *p)
if(p[5]<0x30)
return 0;
- /* XSeries have longer records. */
- if(!(p[5]>=0x46 && checksum(p, 0x46))
+ /* XSeries have longer records, exact length seems to vary. */
+ if(!(p[5]>=0x45 && checksum(p, p[5]))
/* Some Netvista seem to work with this. */
&& !(checksum(p, 0x30))
/* The Thinkpad/Thinkcentre checksum does *not* include the first
@@ -291,7 +291,10 @@ static int decode(const u8 *p)
return 1;
print_entry("BIOS Release Date", p+0x30, 8);
- print_entry("Default Flash Image File Name", p+0x38, 13);
+ /* This one seems to be a variable length field, it is usually 13
+ byte long but was seen 12 byte long on an xSeries 440. */
+ print_entry("Default Flash Image File Name", p+0x38,
+ 0x38+13<p[5]-1?13:p[5]-1-0x38);
return 1;
}