summaryrefslogtreecommitdiffstats
path: root/src/fundamental/chid-fundamental.h
blob: 1e582932fd29335a0a71d0a8f1433c857dc3c366 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* SPDX-License-Identifier: BSD-3-Clause */

#pragma once

#if SD_BOOT
#  include "efi-string.h"
#else
#  include <uchar.h>
#endif

#include "efi-fundamental.h"
#include "string-util-fundamental.h"

#define CHID_TYPES_MAX 15

typedef enum ChidSmbiosFields {
        CHID_SMBIOS_MANUFACTURER,
        CHID_SMBIOS_FAMILY,
        CHID_SMBIOS_PRODUCT_NAME,
        CHID_SMBIOS_PRODUCT_SKU,
        CHID_SMBIOS_BASEBOARD_MANUFACTURER,
        CHID_SMBIOS_BASEBOARD_PRODUCT,
        _CHID_SMBIOS_FIELDS_MAX,
} ChidSmbiosFields;

/* CHID (also called HWID by fwupd) is described at https://github.com/fwupd/fwupd/blob/main/docs/hwids.md */
void chid_calculate(const char16_t *const smbios_fields[static _CHID_SMBIOS_FIELDS_MAX], EFI_GUID ret_chids[static CHID_TYPES_MAX]);