#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)
{ … }
static void tpm_devs_release(struct device *dev)
{ … }
void tpm_devs_remove(struct tpm_chip *chip)
{ … }
int tpm_devs_add(struct tpm_chip *chip)
{ … }