drivers/misc/mei/mei_lb.c
Source file repositories/reference/linux-study-clean/drivers/misc/mei/mei_lb.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/misc/mei/mei_lb.c- Extension
.c- Size
- 14599 bytes
- Lines
- 506
- 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.
- 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.
- 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/component.hlinux/mei_cl_bus.hlinux/module.hlinux/overflow.hlinux/pci.hlinux/slab.hlinux/uuid.hdrm/intel/i915_component.hdrm/intel/intel_lb_mei_interface.hmkhi.h
Detected Declarations
struct mei_lb_reqstruct mei_lb_rspstruct mei_lb2_headerstruct mei_lb2_rsp_headerstruct mei_lb2_reqstruct mei_lb2_rspfunction mei_lb_check_response_v1function mei_lb_push_payload_v1function mei_lb_check_response_v2function mei_lb_push_payload_v2function mei_lb_push_payloadfunction mei_lb_component_master_bindfunction mei_lb_component_master_unbindfunction mei_lb_component_matchfunction mei_lb_probefunction mei_lb_remove
Annotated Snippet
struct mei_lb_req {
struct mkhi_msg_hdr header;
__le32 type;
__le32 flags;
__le32 reserved[2];
__le32 payload_size;
u8 payload[] __counted_by(payload_size);
} __packed;
/**
* struct mei_lb_rsp - Late Binding response structure
* @header: MKHI message header (see struct mkhi_msg_hdr)
* @type: Type of the Late Binding payload
* @reserved: Reserved for future use by authentication firmware, must be set to 0
* @status: Status returned by authentication firmware (see &enum intel_lb_status)
*/
struct mei_lb_rsp {
struct mkhi_msg_hdr header;
__le32 type;
__le32 reserved[2];
__le32 status;
} __packed;
/* Late Binding version 2 */
#define MEI_LB2_CMD 0x01
#define MEI_LB2_HDR_FLAG_RSP 0x01
#define MEI_GUID_LB UUID_LE(0x4ed87243, 0x3980, 0x4d8e, \
0xb1, 0xf9, 0x6f, 0xb7, 0xc0, 0x14, 0x8c, 0x4d)
/**
* struct mei_lb2_header - Late Binding2 header
* @command_id:
* @flags: Flags for transport layer (e.g. MEI_LB2_HDR_FLAG_RSP)
* @reserved: Reserved for future use by authentication firmware, must be set to 0
*/
struct mei_lb2_header {
__le32 command_id;
u8 flags;
u8 reserved[3];
};
/**
* struct mei_lb2_rsp_header - Late Binding2 response header
* @header: Common command header
* @status: Status returned by authentication firmware (see &enum intel_lb_status)
*/
struct mei_lb2_rsp_header {
struct mei_lb2_header header;
__le32 status;
};
#define MEI_LB2_FLAG_FST_CHUNK 0x02
#define MEI_LB2_FLAG_LST_CHUNK 0x04
/**
* struct mei_lb2_req - Late Binding2 request
* @header: Common command header
* @type: Type of the Late Binding payload (see &enum intel_lb_type)
* @flags: Flags to be passed to the authentication firmware (MEI_LB2_FLAG_*)
* @reserved: Reserved for future use by authentication firmware, must be set to 0
* @total_payload_size: Size of whole Late Binding package in bytes
* @payload_size: Size of the payload chunk in bytes
* @payload: Data chunk to be sent to the authentication firmware
*/
struct mei_lb2_req {
struct mei_lb2_header header;
__le32 type;
__le32 flags;
__le32 reserved;
__le32 total_payload_size;
__le32 payload_size;
u8 payload[] __counted_by(payload_size);
};
/**
* struct mei_lb2_rsp - Late Binding2 response
* @rheader: Common response header
* @type: Type of the Late Binding payload (see &enum intel_lb_type)
* @reserved: Reserved for future use by authentication firmware, must be set to 0
*/
struct mei_lb2_rsp {
struct mei_lb2_rsp_header rheader;
__le32 type;
__le32 reserved[2];
};
static bool mei_lb_check_response_v1(const struct device *dev, ssize_t bytes,
Annotation
- Immediate include surface: `linux/component.h`, `linux/mei_cl_bus.h`, `linux/module.h`, `linux/overflow.h`, `linux/pci.h`, `linux/slab.h`, `linux/uuid.h`, `drm/intel/i915_component.h`.
- Detected declarations: `struct mei_lb_req`, `struct mei_lb_rsp`, `struct mei_lb2_header`, `struct mei_lb2_rsp_header`, `struct mei_lb2_req`, `struct mei_lb2_rsp`, `function mei_lb_check_response_v1`, `function mei_lb_push_payload_v1`, `function mei_lb_check_response_v2`, `function mei_lb_push_payload_v2`.
- Atlas domain: Driver Families / drivers/misc.
- Implementation status: source 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.