]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
smbios: fill wake-up type
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sat, 10 Feb 2024 11:06:48 +0000 (12:06 +0100)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Wed, 27 Mar 2024 08:23:30 +0000 (09:23 +0100)
We should not use the reserved value 0x00 for the wake up type but
use 0x02 (Unknown).

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
include/smbios.h
lib/smbios.c

index 3df8827b60d401055c22641f509f9d61c9e39589..a4fda9df7bd0e96f938c2e249ce025c96a4628cd 100644 (file)
@@ -108,6 +108,33 @@ struct __packed smbios_type0 {
        char eos[SMBIOS_STRUCT_EOS_BYTES];
 };
 
+/**
+ * enum smbios_wakeup_type - wake-up type
+ *
+ * These constants are used for the Wake-Up Type field in the SMBIOS
+ * System Information (Type 1) structure.
+ */
+enum smbios_wakeup_type {
+       /** @SMBIOS_WAKEUP_TYPE_RESERVED: Reserved */
+       SMBIOS_WAKEUP_TYPE_RESERVED,
+       /** @SMBIOS_WAKEUP_TYPE_OTHER: Other */
+       SMBIOS_WAKEUP_TYPE_OTHER,
+       /** @SMBIOS_WAKEUP_TYPE_UNKNOWN: Unknown */
+       SMBIOS_WAKEUP_TYPE_UNKNOWN,
+       /** @SMBIOS_WAKEUP_TYPE_APM_TIMER: APM Timer */
+       SMBIOS_WAKEUP_TYPE_APM_TIMER,
+       /** @SMBIOS_WAKEUP_TYPE_MODEM_RING: Modem Ring */
+       SMBIOS_WAKEUP_TYPE_MODEM_RING,
+       /** @SMBIOS_WAKEUP_TYPE_LAN_REMOTE: LAN Remote */
+       SMBIOS_WAKEUP_TYPE_LAN_REMOTE,
+       /** @SMBIOS_WAKEUP_TYPE_POWER_SWITCH: Power Switch */
+       SMBIOS_WAKEUP_TYPE_POWER_SWITCH,
+       /** @SMBIOS_WAKEUP_TYPE_PCI_PME: PCI PME# */
+       SMBIOS_WAKEUP_TYPE_PCI_PME,
+       /** @SMBIOS_WAKEUP_TYPE_AC_POWER_RESTORED: AC Power Restored */
+       SMBIOS_WAKEUP_TYPE_AC_POWER_RESTORED,
+};
+
 struct __packed smbios_type1 {
        u8 type;
        u8 length;
index c83af730a916c59f99308790267bd5f8ce307589..b190b010f30f31a615b49528615a602b70a1a3b4 100644 (file)
@@ -394,6 +394,7 @@ static int smbios_write_type1(ulong *current, int handle,
        } else {
                t->serial_number = smbios_add_prop(ctx, "serial", NULL);
        }
+       t->wakeup_type = SMBIOS_WAKEUP_TYPE_UNKNOWN;
        t->sku_number = smbios_add_prop(ctx, "sku", NULL);
        t->family = smbios_add_prop(ctx, "family", NULL);