diff options
author | Michael Brown | 2007-11-21 03:27:07 +0100 |
---|---|---|
committer | Michael Brown | 2007-11-21 03:27:07 +0100 |
commit | 899f5b8ab233987646e6f5012f462a19a833d8d4 (patch) | |
tree | cee5ca8745e7e84f9f2612c3eeb732d31e5c5f24 /src/arch | |
parent | Update SMBIOS internal API to be easier to use, and not to require (diff) | |
download | ipxe-899f5b8ab233987646e6f5012f462a19a833d8d4.tar.gz ipxe-899f5b8ab233987646e6f5012f462a19a833d8d4.tar.xz ipxe-899f5b8ab233987646e6f5012f462a19a833d8d4.zip |
Added definition of a UUID and uuid_ntoa() (for debugging), and
implemented smbios_get_uuid().
Diffstat (limited to 'src/arch')
-rw-r--r-- | src/arch/i386/firmware/pcbios/smbios.c | 27 | ||||
-rw-r--r-- | src/arch/i386/include/smbios.h | 2 |
2 files changed, 10 insertions, 19 deletions
diff --git a/src/arch/i386/firmware/pcbios/smbios.c b/src/arch/i386/firmware/pcbios/smbios.c index 78a74804..d8be6f8b 100644 --- a/src/arch/i386/firmware/pcbios/smbios.c +++ b/src/arch/i386/firmware/pcbios/smbios.c @@ -21,6 +21,7 @@ #include <stdio.h> #include <errno.h> #include <gpxe/uaccess.h> +#include <gpxe/uuid.h> #include <realmode.h> #include <pnpbios.h> #include <smbios.h> @@ -301,34 +302,22 @@ int find_smbios_string ( struct smbios_strings *strings, unsigned int index, } /** - * Find SMBIOS serial number + * Get UUID from SMBIOS * + * @v uuid UUID to fill in + * @ret rc Return status code */ -int dump_smbios_info ( void ) { +int smbios_get_uuid ( union uuid *uuid ) { struct smbios_system_information sysinfo; - struct smbios_strings strings; - char buf[64]; int rc; if ( ( rc = find_smbios_structure ( SMBIOS_TYPE_SYSTEM_INFORMATION, &sysinfo, sizeof ( sysinfo ), - &strings ) ) != 0 ) - return rc; - - DBG_HD ( &sysinfo, sizeof ( sysinfo ) ); - - if ( ( rc = find_smbios_string ( &strings, sysinfo.manufacturer, - buf, sizeof ( buf ) ) ) != 0 ) - return rc; - DBG ( "Manufacturer: \"%s\"\n", buf ); - - if ( ( rc = find_smbios_string ( &strings, sysinfo.product, - buf, sizeof ( buf ) ) ) != 0 ) + NULL ) ) != 0 ) return rc; - DBG ( "Product: \"%s\"\n", buf ); - DBG ( "UUID:\n" ); - DBG_HD ( &sysinfo.uuid, sizeof ( sysinfo.uuid ) ); + memcpy ( uuid, sysinfo.uuid, sizeof ( *uuid ) ); + DBG ( "SMBIOS found UUID %s\n", uuid_ntoa ( uuid ) ); return 0; } diff --git a/src/arch/i386/include/smbios.h b/src/arch/i386/include/smbios.h index a0a7a222..f5f0b5c2 100644 --- a/src/arch/i386/include/smbios.h +++ b/src/arch/i386/include/smbios.h @@ -32,6 +32,8 @@ struct smbios_system_information { uint8_t serial; /** UUID */ uint8_t uuid[16]; + /** Wake-up type */ + uint8_t wakeup; } __attribute__ (( packed )); /** SMBIOS system information structure type */ |