drivers/misc/mei/vsc-fw-loader.c

Source file repositories/reference/linux-study-clean/drivers/misc/mei/vsc-fw-loader.c

File Facts

System
Linux kernel
Corpus path
drivers/misc/mei/vsc-fw-loader.c
Extension
.c
Size
18443 bytes
Lines
777
Domain
Driver Families
Bucket
drivers/misc
Inferred role
Driver Families: exported/initcall integration point
Status
integration 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 vsc_rom_cmd {
	__le32 magic;
	__u8 cmd_id;
	union {
		/* download start */
		struct {
			__u8 img_type;
			__le16 option;
			__le32 img_len;
			__le32 img_loc;
			__le32 crc;
			DECLARE_FLEX_ARRAY(__u8, res);
		} __packed dl_start;
		/* download set */
		struct {
			__u8 option;
			__le16 img_cnt;
			DECLARE_FLEX_ARRAY(__le32, payload);
		} __packed dl_set;
		/* download continue */
		struct {
			__u8 end_flag;
			__le16 len;
			/* 8 is the offset of payload */
			__u8 payload[VSC_ROM_PKG_SIZE - 8];
		} __packed dl_cont;
		/* dump memory */
		struct {
			__u8 res;
			__le16 len;
			__le32 addr;
			DECLARE_FLEX_ARRAY(__u8, payload);
		} __packed dump_mem;
		/* 5 is the offset of padding */
		__u8 padding[VSC_ROM_PKG_SIZE - 5];
	} data;
};

struct vsc_rom_cmd_ack {
	__le32 magic;
	__u8 token;
	__u8 type;
	__u8 res[2];
	__u8 payload[];
};

struct vsc_fw_cmd {
	__le32 magic;
	__u8 cmd_id;
	union {
		struct {
			__le16 option;
			__u8 img_type;
			__le32 img_len;
			__le32 img_loc;
			__le32 crc;
			DECLARE_FLEX_ARRAY(__u8, res);
		} __packed dl_start;
		struct {
			__le16 option;
			__u8 img_cnt;
			DECLARE_FLEX_ARRAY(__le32, payload);
		} __packed dl_set;
		struct {
			__le32 addr;
			__u8 len;
			DECLARE_FLEX_ARRAY(__u8, payload);
		} __packed dump_mem;
		struct {
			__u8 resv[3];
			__le32 crc;
			DECLARE_FLEX_ARRAY(__u8, payload);
		} __packed boot;
		/* 5 is the offset of padding */
		__u8 padding[VSC_FW_PKG_SIZE - 5];
	} data;
};

struct vsc_img {
	__le32 magic;
	__le32 option;
	__le32 image_count;
	__le32 image_location[VSC_IMG_CNT_MAX];
};

struct vsc_fw_sign {
	__le32 magic;
	__le32 image_size;
	__u8 image[];
};

Annotation

Implementation Notes