SMBIOS: Introduce struct for SMBIOS table header

All SMBIOS `type X` tables start with the same 4-byte header. Add a
struct definition for it, and use it where applicable. The union is
temporary and allows doing the necessary changes in smaller commits.

Change-Id: Ibd9a80010f83fd7ebefc014b981d430f5723808c
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/55906
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
This commit is contained in:
Angel Pons
2021-06-28 16:06:28 +02:00
committed by Patrick Georgi
parent 631cd29efb
commit ca01baa065
2 changed files with 148 additions and 52 deletions

View File

@ -10,9 +10,14 @@
static int smbios_write_intel_wifi(struct device *dev, int *handle, unsigned long *current)
{
struct smbios_type_intel_wifi {
u8 type;
u8 length;
u16 handle;
union {
struct {
u8 type;
u8 length;
u16 handle;
};
struct smbios_header header;
};
u8 str;
u8 eos[2];
} __packed;