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.
- 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/acpi.hlinux/align.hlinux/bitfield.hlinux/bits.hlinux/cleanup.hlinux/firmware.hlinux/sizes.hlinux/slab.hlinux/string_helpers.hlinux/types.hlinux/unaligned.hvsc-tp.h
Detected Declarations
struct vsc_rom_cmdstruct vsc_rom_cmd_ackstruct vsc_fw_cmdstruct vsc_imgstruct vsc_fw_signstruct vsc_image_code_datastruct vsc_img_fragstruct vsc_fw_loaderfunction vsc_sum_crcfunction vsc_get_sensor_namefunction vsc_identify_siliconfunction vsc_identify_csi_imagefunction vsc_identify_ace_imagefunction vsc_identify_cfg_imagefunction vsc_download_bootloaderfunction vsc_download_firmwarefunction vsc_tp_init
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
- Immediate include surface: `linux/acpi.h`, `linux/align.h`, `linux/bitfield.h`, `linux/bits.h`, `linux/cleanup.h`, `linux/firmware.h`, `linux/sizes.h`, `linux/slab.h`.
- Detected declarations: `struct vsc_rom_cmd`, `struct vsc_rom_cmd_ack`, `struct vsc_fw_cmd`, `struct vsc_img`, `struct vsc_fw_sign`, `struct vsc_image_code_data`, `struct vsc_img_frag`, `struct vsc_fw_loader`, `function vsc_sum_crc`, `function vsc_get_sensor_name`.
- Atlas domain: Driver Families / drivers/misc.
- Implementation status: integration implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.