瀏覽代碼

[smbios] Add asset tag setting

Add SMBIOS asset tag as a named setting.

Signed-off-by: Michael Brown <mcb30@etherboot.org>
tags/v0.9.8
Timothy Stack 15 年之前
父節點
當前提交
cc4363acca
共有 2 個文件被更改,包括 27 次插入0 次删除
  1. 19
    0
      src/include/gpxe/smbios.h
  2. 8
    0
      src/interface/smbios/smbios_settings.c

+ 19
- 0
src/include/gpxe/smbios.h 查看文件

@@ -113,6 +113,25 @@ struct smbios_system_information {
113 113
 /** SMBIOS system information structure type */
114 114
 #define SMBIOS_TYPE_SYSTEM_INFORMATION 1
115 115
 
116
+/** SMBIOS enclosure information structure */
117
+struct smbios_enclosure_information {
118
+	/** SMBIOS structure header */
119
+	struct smbios_header header;
120
+	/** Manufacturer string */
121
+	uint8_t manufacturer;
122
+	/** Type string */
123
+	uint8_t type;
124
+	/** Version string */
125
+	uint8_t version;
126
+	/** Serial number string */
127
+	uint8_t serial;
128
+	/** Asset tag */
129
+	uint8_t asset_tag;
130
+} __attribute__ (( packed ));
131
+
132
+/** SMBIOS enclosure information structure type */
133
+#define SMBIOS_TYPE_ENCLOSURE_INFORMATION 3
134
+
116 135
 /**
117 136
  * SMBIOS entry point descriptor
118 137
  *

+ 8
- 0
src/interface/smbios/smbios_settings.c 查看文件

@@ -198,4 +198,12 @@ struct setting smbios_named_settings[] __setting = {
198 198
 					   serial ),
199 199
 		.type = &setting_type_string,
200 200
 	},
201
+	{
202
+		.name = "asset",
203
+		.description = "Asset tag",
204
+		.tag = SMBIOS_STRING_TAG ( SMBIOS_TYPE_ENCLOSURE_INFORMATION,
205
+					   struct smbios_enclosure_information,
206
+					   asset_tag ),
207
+		.type = &setting_type_string,
208
+	},
201 209
 };

Loading…
取消
儲存