[smbios] Add asset tag setting
authorTimothy Stack <tstack@vmware.com>
Tue, 31 Mar 2009 22:20:07 +0000 (15:20 -0700)
committerMichael Brown <mcb30@etherboot.org>
Wed, 15 Apr 2009 16:23:18 +0000 (17:23 +0100)
Add SMBIOS asset tag as a named setting.

Signed-off-by: Michael Brown <mcb30@etherboot.org>
src/include/gpxe/smbios.h
src/interface/smbios/smbios_settings.c

index 2b0fcbd..a294236 100644 (file)
@@ -113,6 +113,25 @@ struct smbios_system_information {
 /** SMBIOS system information structure type */
 #define SMBIOS_TYPE_SYSTEM_INFORMATION 1
 
+/** SMBIOS enclosure information structure */
+struct smbios_enclosure_information {
+       /** SMBIOS structure header */
+       struct smbios_header header;
+       /** Manufacturer string */
+       uint8_t manufacturer;
+       /** Type string */
+       uint8_t type;
+       /** Version string */
+       uint8_t version;
+       /** Serial number string */
+       uint8_t serial;
+       /** Asset tag */
+       uint8_t asset_tag;
+} __attribute__ (( packed ));
+
+/** SMBIOS enclosure information structure type */
+#define SMBIOS_TYPE_ENCLOSURE_INFORMATION 3
+
 /**
  * SMBIOS entry point descriptor
  *
index 61c2d91..ec594c5 100644 (file)
@@ -198,4 +198,12 @@ struct setting smbios_named_settings[] __setting = {
                                           serial ),
                .type = &setting_type_string,
        },
+       {
+               .name = "asset",
+               .description = "Asset tag",
+               .tag = SMBIOS_STRING_TAG ( SMBIOS_TYPE_ENCLOSURE_INFORMATION,
+                                          struct smbios_enclosure_information,
+                                          asset_tag ),
+               .type = &setting_type_string,
+       },
 };