#include <linux/device.h>
#include "tpm.h"
struct tpm_readpubek_out { … } __packed;
#define READ_PUBEK_RESULT_MIN_BODY_SIZE …
#define TPM_ORD_READPUBEK …
static ssize_t pubek_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RO(pubek);
static ssize_t pcrs_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RO(pcrs);
static ssize_t enabled_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RO(enabled);
static ssize_t active_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RO(active);
static ssize_t owned_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RO(owned);
static ssize_t temp_deactivated_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(temp_deactivated);
static ssize_t caps_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RO(caps);
static ssize_t cancel_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_WO(cancel);
static ssize_t durations_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RO(durations);
static ssize_t timeouts_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RO(timeouts);
static ssize_t tpm_version_major_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(tpm_version_major);
#ifdef CONFIG_TCG_TPM2_HMAC
static ssize_t null_name_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR_RO(null_name);
#endif
static struct attribute *tpm1_dev_attrs[] = …;
static struct attribute *tpm2_dev_attrs[] = …;
static const struct attribute_group tpm1_dev_group = …;
static const struct attribute_group tpm2_dev_group = …;
struct tpm_pcr_attr { … };
#define to_tpm_pcr_attr(a) …
static ssize_t pcr_value_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
#define _TPM_HELPER(_alg, _hash, F) …
#define PCR_ATTR(_alg, _hash, _pcr) …
#define PCR_ATTRS(_alg, _hash) …
#define PCR_ATTR_VAL(_alg, _hash, _pcr) …
#define PCR_ATTR_GROUP_ARRAY(_alg, _hash) …
#define PCR_ATTR_GROUP(_alg, _hash) …
#define PCR_ATTR_BUILD(_alg, _hash) …
PCR_ATTR_BUILD(…);
PCR_ATTR_BUILD(…);
PCR_ATTR_BUILD(…);
PCR_ATTR_BUILD(…);
PCR_ATTR_BUILD(…);
void tpm_sysfs_add_device(struct tpm_chip *chip)
{ … }