drivers/platform/x86/intel/ifs/ifs.h

Source file repositories/reference/linux-study-clean/drivers/platform/x86/intel/ifs/ifs.h

File Facts

System
Linux kernel
Corpus path
drivers/platform/x86/intel/ifs/ifs.h
Extension
.h
Size
11669 bytes
Lines
418
Domain
Driver Families
Bucket
drivers/platform
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct ifs_test_caps {
	int	integrity_cap_bit;
	int	test_num;
	char	image_suffix[IFS_SUFFIX_SZ];
};

/**
 * struct ifs_test_msrs - MSRs used in IFS tests
 * @copy_hashes: Copy test hash data
 * @copy_hashes_status: Status of copied test hash data
 * @copy_chunks: Copy chunks of the test data
 * @copy_chunks_status: Status of the copied test data chunks
 * @test_ctrl: Control the test attributes
 */
struct ifs_test_msrs {
	u32	copy_hashes;
	u32	copy_hashes_status;
	u32	copy_chunks;
	u32	copy_chunks_status;
	u32	test_ctrl;
};

/**
 * struct ifs_data - attributes related to intel IFS driver
 * @loaded_version: stores the currently loaded ifs image version.
 * @loaded: If a valid test binary has been loaded into the memory
 * @loading_error: Error occurred on another CPU while loading image
 * @valid_chunks: number of chunks which could be validated.
 * @status: it holds simple status pass/fail/untested
 * @scan_details: opaque scan status code from h/w
 * @cur_batch: number indicating the currently loaded test file
 * @generation: IFS test generation enumerated by hardware
 * @chunk_size: size of a test chunk
 * @array_gen: test generation of array test
 * @max_bundle: maximum bundle index
 */
struct ifs_data {
	int	loaded_version;
	bool	loaded;
	bool	loading_error;
	int	valid_chunks;
	int	status;
	u64	scan_details;
	u32	cur_batch;
	u32	generation;
	u32	chunk_size;
	u32	array_gen;
	u32	max_bundle;
};

struct ifs_work {
	struct work_struct w;
	struct device *dev;
};

struct ifs_device {
	const struct ifs_test_caps *test_caps;
	const struct ifs_test_msrs *test_msrs;
	struct ifs_data rw_data;
	struct miscdevice misc;
};

static inline struct ifs_data *ifs_get_data(struct device *dev)
{
	struct miscdevice *m = dev_get_drvdata(dev);
	struct ifs_device *d = container_of(m, struct ifs_device, misc);

	return &d->rw_data;
}

static inline const struct ifs_test_caps *ifs_get_test_caps(struct device *dev)
{
	struct miscdevice *m = dev_get_drvdata(dev);
	struct ifs_device *d = container_of(m, struct ifs_device, misc);

	return d->test_caps;
}

static inline const struct ifs_test_msrs *ifs_get_test_msrs(struct device *dev)
{
	struct miscdevice *m = dev_get_drvdata(dev);
	struct ifs_device *d = container_of(m, struct ifs_device, misc);

	return d->test_msrs;
}

extern bool *ifs_pkg_auth;
int ifs_load_firmware(struct device *dev);
int do_core_test(int cpu, struct device *dev);
extern struct attribute *plat_ifs_attrs[];

Annotation

Implementation Notes