drivers/hid/intel-ish-hid/ishtp-fw-loader.c
Source file repositories/reference/linux-study-clean/drivers/hid/intel-ish-hid/ishtp-fw-loader.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/hid/intel-ish-hid/ishtp-fw-loader.c- Extension
.c- Size
- 30039 bytes
- Lines
- 1031
- Domain
- Driver Families
- Bucket
- drivers/hid
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/firmware.hlinux/module.hlinux/pci.hlinux/intel-ish-client-if.hlinux/property.hasm/cacheflush.h
Detected Declarations
struct loader_msg_hdrstruct loader_xfer_querystruct ish_fw_versionstruct loader_capabilitystruct shim_fw_infostruct loader_xfer_query_responsestruct loader_xfer_fragmentstruct loader_xfer_ipc_fragmentstruct loader_xfer_dma_fragmentstruct loader_startstruct response_infostruct ishtp_cl_dataenum ish_loader_commandsfunction get_firmware_variantfunction loader_cl_sendfunction process_recvfunction loader_cl_event_cbfunction ish_query_loader_propfunction ish_fw_xfer_ishtpfunction ish_fw_xfer_direct_dmafunction ish_fw_startfunction load_fw_from_hostfunction load_fw_from_host_handlerfunction loader_initfunction loader_deinitfunction reset_handlerfunction loader_ishtp_cl_probefunction loader_ishtp_cl_removefunction loader_ishtp_cl_resetfunction ish_loader_initfunction ish_loader_exit
Annotated Snippet
struct loader_msg_hdr {
u8 command;
u8 reserved[2];
u8 status;
} __packed;
struct loader_xfer_query {
struct loader_msg_hdr hdr;
u32 image_size;
} __packed;
struct ish_fw_version {
u16 major;
u16 minor;
u16 hotfix;
u16 build;
} __packed;
union loader_version {
u32 value;
struct {
u8 major;
u8 minor;
u8 hotfix;
u8 build;
};
} __packed;
struct loader_capability {
u32 max_fw_image_size;
u32 xfer_mode;
u32 max_dma_buf_size; /* only for dma mode, multiples of cacheline */
} __packed;
struct shim_fw_info {
struct ish_fw_version ish_fw_version;
u32 protocol_version;
union loader_version ldr_version;
struct loader_capability ldr_capability;
} __packed;
struct loader_xfer_query_response {
struct loader_msg_hdr hdr;
struct shim_fw_info fw_info;
} __packed;
struct loader_xfer_fragment {
struct loader_msg_hdr hdr;
u32 xfer_mode;
u32 offset;
u32 size;
u32 is_last;
} __packed;
struct loader_xfer_ipc_fragment {
struct loader_xfer_fragment fragment;
u8 data[] ____cacheline_aligned; /* variable length payload here */
} __packed;
struct loader_xfer_dma_fragment {
struct loader_xfer_fragment fragment;
u64 ddr_phys_addr;
} __packed;
struct loader_start {
struct loader_msg_hdr hdr;
} __packed;
/**
* struct response_info - Encapsulate firmware response related
* information for passing between function
* loader_cl_send() and process_recv() callback.
* @data: Copy the data received from firmware here.
* @max_size: Max size allocated for the @data buffer. If the
* received data exceeds this value, we log an
* error.
* @size: Actual size of data received from firmware.
* @error: Returns 0 for success, negative error code for a
* failure in function process_recv().
* @received: Set to true on receiving a valid firmware
* response to host command
* @wait_queue: Wait queue for Host firmware loading where the
* client sends message to ISH firmware and waits
* for response
*/
struct response_info {
void *data;
size_t max_size;
size_t size;
int error;
Annotation
- Immediate include surface: `linux/firmware.h`, `linux/module.h`, `linux/pci.h`, `linux/intel-ish-client-if.h`, `linux/property.h`, `asm/cacheflush.h`.
- Detected declarations: `struct loader_msg_hdr`, `struct loader_xfer_query`, `struct ish_fw_version`, `struct loader_capability`, `struct shim_fw_info`, `struct loader_xfer_query_response`, `struct loader_xfer_fragment`, `struct loader_xfer_ipc_fragment`, `struct loader_xfer_dma_fragment`, `struct loader_start`.
- Atlas domain: Driver Families / drivers/hid.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.