linux/drivers/char/tpm/tpm2-space.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (C) 2016 Intel Corporation
 *
 * Authors:
 * Jarkko Sakkinen <[email protected]>
 *
 * Maintained by: <[email protected]>
 *
 * This file contains TPM2 protocol implementations of the commands
 * used by the kernel internally.
 */

#include <linux/gfp.h>
#include <linux/unaligned.h>
#include "tpm.h"

enum tpm2_handle_types {};

struct tpm2_context {} __packed;

static void tpm2_flush_sessions(struct tpm_chip *chip, struct tpm_space *space)
{}

int tpm2_init_space(struct tpm_space *space, unsigned int buf_size)
{}

void tpm2_del_space(struct tpm_chip *chip, struct tpm_space *space)
{}

int tpm2_load_context(struct tpm_chip *chip, u8 *buf,
		      unsigned int *offset, u32 *handle)
{}

int tpm2_save_context(struct tpm_chip *chip, u32 handle, u8 *buf,
		      unsigned int buf_size, unsigned int *offset)
{}

void tpm2_flush_space(struct tpm_chip *chip)
{}

static int tpm2_load_space(struct tpm_chip *chip)
{}

static bool tpm2_map_to_phandle(struct tpm_space *space, void *handle)
{}

static int tpm2_map_command(struct tpm_chip *chip, u32 cc, u8 *cmd)
{}

static int tpm_find_and_validate_cc(struct tpm_chip *chip,
				    struct tpm_space *space,
				    const void *cmd, size_t len)
{}

int tpm2_prepare_space(struct tpm_chip *chip, struct tpm_space *space, u8 *cmd,
		       size_t cmdsiz)
{}

static bool tpm2_add_session(struct tpm_chip *chip, u32 handle)
{}

static u32 tpm2_map_to_vhandle(struct tpm_space *space, u32 phandle, bool alloc)
{}

static int tpm2_map_response_header(struct tpm_chip *chip, u32 cc, u8 *rsp,
				    size_t len)
{}

struct tpm2_cap_handles {} __packed;

static int tpm2_map_response_body(struct tpm_chip *chip, u32 cc, u8 *rsp,
				  size_t len)
{}

static int tpm2_save_space(struct tpm_chip *chip)
{}

int tpm2_commit_space(struct tpm_chip *chip, struct tpm_space *space,
		      void *buf, size_t *bufsiz)
{}

/*
 * Put the reference to the main device.
 */
static void tpm_devs_release(struct device *dev)
{}

/*
 * Remove the device file for exposed TPM spaces and release the device
 * reference. This may also release the reference to the master device.
 */
void tpm_devs_remove(struct tpm_chip *chip)
{}

/*
 * Add a device file to expose TPM spaces. Also take a reference to the
 * main device.
 */
int tpm_devs_add(struct tpm_chip *chip)
{}