summaryrefslogtreecommitdiff
path: root/biosdecode.c
diff options
context:
space:
mode:
authorJean Delvare <jdelvare@suse.de>2003-12-24 19:59:56 +0000
committerJean Delvare <jdelvare@suse.de>2003-12-24 19:59:56 +0000
commit65ecaa531499bfee39b723d5039b447dce1fb6fa (patch)
tree5897ce462ae8d5d7cd7ffcd10861dc5166294af8 /biosdecode.c
parent431b243974ce0641918fe2a672b456b89a9009cf (diff)
downloaddmidecode-git-65ecaa531499bfee39b723d5039b447dce1fb6fa.tar.gz
Fix typo ("Bios" becomes "BIOS").
Handle longer VPD records as seen on xSeries.
Diffstat (limited to 'biosdecode.c')
-rw-r--r--biosdecode.c14
1 files changed, 11 insertions, 3 deletions
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;
}