From 65ecaa531499bfee39b723d5039b447dce1fb6fa Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Wed, 24 Dec 2003 19:59:56 +0000 Subject: Fix typo ("Bios" becomes "BIOS"). Handle longer VPD records as seen on xSeries. --- biosdecode.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'biosdecode.c') diff --git a/biosdecode.c b/biosdecode.c index 7fc33e7..a2756be 100644 --- a/biosdecode.c +++ b/biosdecode.c @@ -463,17 +463,25 @@ static size_t vpd_length(const u8 *p) static int vpd_decode(const u8 *p, size_t len) { - /* The checksum does *not* include the first 13 bytes. */ - if(len<0x30 || !checksum(p+0x0D, 0x30-0x0D)) + /* XSeries have longer records and a different checksumming method. */ + if(!(len>=0x46 && checksum(p, 0x46)) + /* The Thinkpad checksum does *not* include the first 13 bytes. */ + && !(len>=0x30 && checksum(p+0x0D, 0x30-0x0D))) return 0; printf("VPD present.\n"); - vpd_print_entry("Bios Build ID", p+0x0D, 9); + vpd_print_entry("BIOS Build ID", p+0x0D, 9); vpd_print_entry("Box Serial Number", p+0x16, 7); vpd_print_entry("Motherboard Serial Number", p+0x1D, 11); vpd_print_entry("Machine Type/Model", p+0x28, 7); + if(len<0x45) + return 1; + + vpd_print_entry("BIOS Release Date", p+0x30, 8); + vpd_print_entry("Default Flash Image File Name", p+0x38, 13); + return 1; } -- cgit v1.2.1