tpm.h (5ef924d9e2e81e55c6aec056449a269409e15f21) tpm.h (fd3ec3663718e5f89fbcbc18a67885203fd914a1)
1/*
2 * Copyright (C) 2004 IBM Corporation
3 * Copyright (C) 2015 Intel Corporation
4 *
5 * Authors:
6 * Leendert van Doorn <leendert@watson.ibm.com>
7 * Dave Safford <safford@watson.ibm.com>
8 * Reiner Sailer <sailer@watson.ibm.com>

--- 20 unchanged lines hidden (view full) ---

29#include <linux/mutex.h>
30#include <linux/sched.h>
31#include <linux/platform_device.h>
32#include <linux/io.h>
33#include <linux/tpm.h>
34#include <linux/acpi.h>
35#include <linux/cdev.h>
36#include <linux/highmem.h>
1/*
2 * Copyright (C) 2004 IBM Corporation
3 * Copyright (C) 2015 Intel Corporation
4 *
5 * Authors:
6 * Leendert van Doorn <leendert@watson.ibm.com>
7 * Dave Safford <safford@watson.ibm.com>
8 * Reiner Sailer <sailer@watson.ibm.com>

--- 20 unchanged lines hidden (view full) ---

29#include <linux/mutex.h>
30#include <linux/sched.h>
31#include <linux/platform_device.h>
32#include <linux/io.h>
33#include <linux/tpm.h>
34#include <linux/acpi.h>
35#include <linux/cdev.h>
36#include <linux/highmem.h>
37#include <linux/tpm_eventlog.h>
37#include <crypto/hash_info.h>
38
39#ifdef CONFIG_X86
40#include <asm/intel-family.h>
41#endif
42
43enum tpm_const {
44 TPM_MINOR = 224, /* officially assigned */

--- 335 unchanged lines hidden (view full) ---

380 struct tpm_getrandom_out getrandom_out;
381} tpm_cmd_params;
382
383struct tpm_cmd_t {
384 tpm_cmd_header header;
385 tpm_cmd_params params;
386} __packed;
387
38#include <crypto/hash_info.h>
39
40#ifdef CONFIG_X86
41#include <asm/intel-family.h>
42#endif
43
44enum tpm_const {
45 TPM_MINOR = 224, /* officially assigned */

--- 335 unchanged lines hidden (view full) ---

381 struct tpm_getrandom_out getrandom_out;
382} tpm_cmd_params;
383
384struct tpm_cmd_t {
385 tpm_cmd_header header;
386 tpm_cmd_params params;
387} __packed;
388
388struct tpm2_digest {
389 u16 alg_id;
390 u8 digest[SHA512_DIGEST_SIZE];
391} __packed;
392
393/* A string buffer type for constructing TPM commands. This is based on the
394 * ideas of string buffer code in security/keys/trusted.h but is heap based
395 * in order to keep the stack usage minimal.
396 */
397
398enum tpm_buf_flags {
399 TPM_BUF_OVERFLOW = BIT(0),

--- 168 unchanged lines hidden (view full) ---

568int tpm2_probe(struct tpm_chip *chip);
569int tpm2_find_cc(struct tpm_chip *chip, u32 cc);
570int tpm2_init_space(struct tpm_space *space);
571void tpm2_del_space(struct tpm_chip *chip, struct tpm_space *space);
572int tpm2_prepare_space(struct tpm_chip *chip, struct tpm_space *space, u32 cc,
573 u8 *cmd);
574int tpm2_commit_space(struct tpm_chip *chip, struct tpm_space *space,
575 u32 cc, u8 *buf, size_t *bufsiz);
389
390/* A string buffer type for constructing TPM commands. This is based on the
391 * ideas of string buffer code in security/keys/trusted.h but is heap based
392 * in order to keep the stack usage minimal.
393 */
394
395enum tpm_buf_flags {
396 TPM_BUF_OVERFLOW = BIT(0),

--- 168 unchanged lines hidden (view full) ---

565int tpm2_probe(struct tpm_chip *chip);
566int tpm2_find_cc(struct tpm_chip *chip, u32 cc);
567int tpm2_init_space(struct tpm_space *space);
568void tpm2_del_space(struct tpm_chip *chip, struct tpm_space *space);
569int tpm2_prepare_space(struct tpm_chip *chip, struct tpm_space *space, u32 cc,
570 u8 *cmd);
571int tpm2_commit_space(struct tpm_chip *chip, struct tpm_space *space,
572 u32 cc, u8 *buf, size_t *bufsiz);
573
574extern const struct seq_operations tpm2_binary_b_measurements_seqops;
575
576#if defined(CONFIG_ACPI)
577int tpm_read_log_acpi(struct tpm_chip *chip);
578#else
579static inline int tpm_read_log_acpi(struct tpm_chip *chip)
580{
581 return -ENODEV;
582}
576#endif
583#endif
584#if defined(CONFIG_OF)
585int tpm_read_log_of(struct tpm_chip *chip);
586#else
587static inline int tpm_read_log_of(struct tpm_chip *chip)
588{
589 return -ENODEV;
590}
591#endif
592
593int tpm_bios_log_setup(struct tpm_chip *chip);
594void tpm_bios_log_teardown(struct tpm_chip *chip);
595#endif