]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.sbin/bhyve/tpm_intf.h
zfs: merge openzfs/zfs@10e36e176
[FreeBSD/FreeBSD.git] / usr.sbin / bhyve / tpm_intf.h
1 /*-\r
2  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD\r
3  *\r
4  * Copyright (c) 2022 Beckhoff Automation GmbH & Co. KG\r
5  * Author: Corvin Köhne <c.koehne@beckhoff.com>\r
6  */\r
7 \r
8 #pragma once\r
9 \r
10 #include "config.h"\r
11 #include "tpm_device.h"\r
12 \r
13 #define TPM_INTF_TYPE_FIFO_PTP 0x0\r
14 #define TPM_INTF_TYPE_CRB 0x1\r
15 #define TPM_INTF_TYPE_FIFO_TIS 0xF\r
16 \r
17 #define TPM_INTF_VERSION_FIFO 0\r
18 #define TPM_INTF_VERSION_CRB 1\r
19 \r
20 #define TPM_INTF_CAP_CRB_DATA_XFER_SIZE_4 0\r
21 #define TPM_INTF_CAP_CRB_DATA_XFER_SIZE_8 1\r
22 #define TPM_INTF_CAP_CRB_DATA_XFER_SIZE_32 2\r
23 #define TPM_INTF_CAP_CRB_DATA_XFER_SIZE_64 3\r
24 \r
25 #define TPM_INTF_SELECTOR_FIFO 0\r
26 #define TPM_INTF_SELECTOR_CRB 1\r
27 \r
28 struct tpm_intf {\r
29         const char *name;\r
30 \r
31         int (*init)(void **sc);\r
32         void (*deinit)(void *sc);\r
33         int (*build_acpi_table)(void *sc);\r
34 };\r
35 #define TPM_INTF_SET(x) DATA_SET(tpm_intf_set, x)\r