Skip to content

Commit c6a3d62

Browse files
committed
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.
1 parent 55ad82a commit c6a3d62

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

vpddecode.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,8 @@ static int decode(const u8 *p)
267267
if(p[5]<0x30)
268268
return 0;
269269

270-
/* XSeries have longer records. */
271-
if(!(p[5]>=0x46 && checksum(p, 0x46))
270+
/* XSeries have longer records, exact length seems to vary. */
271+
if(!(p[5]>=0x45 && checksum(p, p[5]))
272272
/* Some Netvista seem to work with this. */
273273
&& !(checksum(p, 0x30))
274274
/* The Thinkpad/Thinkcentre checksum does *not* include the first
@@ -291,7 +291,10 @@ static int decode(const u8 *p)
291291
return 1;
292292

293293
print_entry("BIOS Release Date", p+0x30, 8);
294-
print_entry("Default Flash Image File Name", p+0x38, 13);
294+
/* This one seems to be a variable length field, it is usually 13
295+
byte long but was seen 12 byte long on an xSeries 440. */
296+
print_entry("Default Flash Image File Name", p+0x38,
297+
0x38+13<p[5]-1?13:p[5]-1-0x38);
295298

296299
return 1;
297300
}

0 commit comments

Comments
 (0)