acrn-hypervisor/devicemodel/hw/platform/tpm/tpm_internal.h
Geoffroy Van Cutsem 8b16be9185 Remove "All rights reserved" string headers
Many of the license and Intel copyright headers include the "All rights
reserved" string. It is not relevant in the context of the BSD-3-Clause
license that the code is released under. This patch removes those strings
throughout the code (hypervisor, devicemodel and misc).

Tracked-On: #7254
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
2022-04-06 13:21:02 +08:00

55 lines
1.4 KiB
C

/*
* Copyright (C) 2018 Intel Corporation
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef _TPM_INTERNAL_H_
#define _TPM_INTERNAL_H_
/* TPMCommBuffer will package TPM2 command and
* response which are handled by TPM emulator
*
* locty: the locality TPM emulator used
* in & in_len: To indicate the buffer and the
* size for TPM command
* out & out_len: To indicate the buffer and
* the size for TPM response
*/
typedef struct TPMCommBuffer {
uint8_t locty;
const uint8_t *in;
uint32_t in_len;
uint8_t *out;
uint32_t out_len;
bool selftest_done;
} TPMCommBuffer;
/* APIs by tpm_emulator.c */
/* Create Ctrl channel and Cmd channel so as to communicate with SWTPM */
int init_tpm_emulator(const char *sock_path);
/* Shutdown of SWTPM and close Ctrl channel and Cmd channel */
void deinit_tpm_emulator(void);
/* Send Ctrl channel command CMD_GET_TPMESTABLISHED to SWTPM */
bool swtpm_get_tpm_established_flag(void);
/* Send TPM2 command request to SWTPM by using Cmd channel */
int swtpm_handle_request(TPMCommBuffer *cmd);
/* Initialization for SWTPM */
int swtpm_startup(size_t buffersize);
/* Cancellation of the current TPM2 command */
void swtpm_cancel_cmd(void);
/* APIs by tpm_crb.c */
/* Initialize TPM CRB Virtual Device */
int init_tpm_crb(struct vmctx *ctx);
/* Deinitialize TPM CRB Virtual Device */
void deinit_tpm_crb(struct vmctx *ctx);
#endif