smbios.c (e25152834cdf3b353892835a4f3b157e066a8ed4) smbios.c (66c73af7ea59382ce5ca7cfb2eedb0491790276c)
1/*-
2 * Copyright (c) 2005-2009 Jung-uk Kim <jkim@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 284 unchanged lines hidden (view full) ---

293 return ("Undefined");
294}
295
296static caddr_t
297smbios_parse_table(const caddr_t addr)
298{
299 caddr_t cp;
300 int proc, size, osize, type;
1/*-
2 * Copyright (c) 2005-2009 Jung-uk Kim <jkim@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 284 unchanged lines hidden (view full) ---

293 return ("Undefined");
294}
295
296static caddr_t
297smbios_parse_table(const caddr_t addr)
298{
299 caddr_t cp;
300 int proc, size, osize, type;
301 uint8_t bios_minor, bios_major;
302 char buf[16];
301
302 type = SMBIOS_GET8(addr, 0); /* 3.1.2 Structure Header Format */
303 switch(type) {
304 case 0: /* 3.3.1 BIOS Information (Type 0) */
305 smbios_setenv("smbios.bios.vendor", addr, 0x04);
306 smbios_setenv("smbios.bios.version", addr, 0x05);
307 smbios_setenv("smbios.bios.reldate", addr, 0x08);
303
304 type = SMBIOS_GET8(addr, 0); /* 3.1.2 Structure Header Format */
305 switch(type) {
306 case 0: /* 3.3.1 BIOS Information (Type 0) */
307 smbios_setenv("smbios.bios.vendor", addr, 0x04);
308 smbios_setenv("smbios.bios.version", addr, 0x05);
309 smbios_setenv("smbios.bios.reldate", addr, 0x08);
310 bios_major = SMBIOS_GET8(addr, 0x14);
311 bios_minor = SMBIOS_GET8(addr, 0x15);
312 if (bios_minor != 0xFF && bios_major != 0xFF) {
313 snprintf(buf, sizeof(buf), "%u.%u",
314 bios_major, bios_minor);
315 setenv("smbios.bios.revision", buf, 1);
316 }
308 break;
309
310 case 1: /* 3.3.2 System Information (Type 1) */
311 smbios_setenv("smbios.system.maker", addr, 0x04);
312 smbios_setenv("smbios.system.product", addr, 0x05);
313 smbios_setenv("smbios.system.version", addr, 0x06);
314#ifdef SMBIOS_SERIAL_NUMBERS
315 smbios_setenv("smbios.system.serial", addr, 0x07);

--- 217 unchanged lines hidden ---
317 break;
318
319 case 1: /* 3.3.2 System Information (Type 1) */
320 smbios_setenv("smbios.system.maker", addr, 0x04);
321 smbios_setenv("smbios.system.product", addr, 0x05);
322 smbios_setenv("smbios.system.version", addr, 0x06);
323#ifdef SMBIOS_SERIAL_NUMBERS
324 smbios_setenv("smbios.system.serial", addr, 0x07);

--- 217 unchanged lines hidden ---