drivers/misc/mei/hw.h

Source file repositories/reference/linux-study-clean/drivers/misc/mei/hw.h

File Facts

System
Linux kernel
Corpus path
drivers/misc/mei/hw.h
Extension
.h
Size
20474 bytes
Lines
837
Domain
Driver Families
Bucket
drivers/misc
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 mei_ext_hdr {
	u8 type;
	u8 length;
} __packed;

/**
 * struct mei_ext_meta_hdr - extend header meta data
 * @count: number of headers
 * @size: total size of the extended header list excluding meta header
 * @reserved: reserved
 * @hdrs: extended headers TLV list
 */
struct mei_ext_meta_hdr {
	u8 count;
	u8 size;
	u8 reserved[2];
	u8 hdrs[];
} __packed;

/**
 * struct mei_ext_hdr_vtag - extend header for vtag
 *
 * @hdr: standard extend header
 * @vtag: virtual tag
 * @reserved: reserved
 */
struct mei_ext_hdr_vtag {
	struct mei_ext_hdr hdr;
	u8 vtag;
	u8 reserved;
} __packed;

/*
 * Extended header iterator functions
 */
/**
 * mei_ext_begin - extended header iterator begin
 *
 * @meta: meta header of the extended header list
 *
 * Return: The first extended header
 */
static inline struct mei_ext_hdr *mei_ext_begin(struct mei_ext_meta_hdr *meta)
{
	return (struct mei_ext_hdr *)meta->hdrs;
}

/**
 * mei_ext_last - check if the ext is the last one in the TLV list
 *
 * @meta: meta header of the extended header list
 * @ext: a meta header on the list
 *
 * Return: true if ext is the last header on the list
 */
static inline bool mei_ext_last(struct mei_ext_meta_hdr *meta,
				struct mei_ext_hdr *ext)
{
	return (u8 *)ext >= (u8 *)meta + sizeof(*meta) + (meta->size * 4);
}

struct mei_gsc_sgl {
	u32 low;
	u32 high;
	u32 length;
} __packed;

#define GSC_HECI_MSG_KERNEL 0
#define GSC_HECI_MSG_USER   1

#define GSC_ADDRESS_TYPE_GTT   0
#define GSC_ADDRESS_TYPE_PPGTT 1
#define GSC_ADDRESS_TYPE_PHYSICAL_CONTINUOUS 2 /* max of 64K */
#define GSC_ADDRESS_TYPE_PHYSICAL_SGL 3

/**
 * struct mei_ext_hdr_gsc_h2f - extended header: gsc host to firmware interface
 *
 * @hdr: extended header
 * @client_id: GSC_HECI_MSG_KERNEL or GSC_HECI_MSG_USER
 * @addr_type: GSC_ADDRESS_TYPE_{GTT, PPGTT, PHYSICAL_CONTINUOUS, PHYSICAL_SGL}
 * @fence_id: synchronization marker
 * @input_address_count: number of input sgl buffers
 * @output_address_count: number of output sgl buffers
 * @reserved: reserved
 * @sgl: sg list
 */
struct mei_ext_hdr_gsc_h2f {
	struct mei_ext_hdr hdr;
	u8                 client_id;

Annotation

Implementation Notes