drivers/platform/x86/intel/ishtp_eclite.c
Source file repositories/reference/linux-study-clean/drivers/platform/x86/intel/ishtp_eclite.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/platform/x86/intel/ishtp_eclite.c- Extension
.c- Size
- 17983 bytes
- Lines
- 704
- Domain
- Driver Families
- Bucket
- drivers/platform
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/bitops.hlinux/device.hlinux/errno.hlinux/intel-ish-client-if.hlinux/kernel.hlinux/module.hlinux/mutex.hlinux/slab.hlinux/suspend.hlinux/types.hlinux/uuid.hlinux/uaccess.h
Detected Declarations
struct opregion_cmdstruct opregion_datastruct opregion_contextstruct ecl_message_headerstruct ecl_messagestruct ishtp_opregion_devfunction ecl_ish_cl_readfunction ecl_ish_cl_writefunction ecl_opregion_cmd_handlerfunction ecl_opregion_data_handlerfunction acpi_find_eclite_devicefunction acpi_opregion_initfunction acpi_opregion_deinitfunction ecl_acpi_invoke_dsmfunction ecl_ish_process_rx_datafunction ecl_ish_process_rx_eventfunction ecl_ish_cl_enable_eventsfunction ecl_ishtp_cl_event_cbfunction ecl_ishtp_cl_initfunction ecl_ishtp_cl_deinitfunction ecl_ishtp_cl_reset_handlerfunction ecl_ishtp_cl_probefunction ecl_ishtp_cl_removefunction ecl_ishtp_cl_resetfunction ecl_ishtp_cl_suspendfunction ecl_ishtp_cl_resumefunction ecl_ishtp_initfunction ecl_ishtp_exit
Annotated Snippet
struct opregion_cmd {
unsigned int command;
unsigned int offset;
unsigned int length;
unsigned int event_id;
};
struct opregion_data {
char data[ECL_DATA_OPR_BUFLEN];
};
struct opregion_context {
struct opregion_cmd cmd_area;
struct opregion_data data_area;
};
struct ecl_message_header {
unsigned int version:2;
unsigned int data_type:2;
unsigned int request_type:2;
unsigned int offset:9;
unsigned int data_len:9;
unsigned int event:8;
};
struct ecl_message {
struct ecl_message_header header;
char payload[ECL_DATA_OPR_BUFLEN];
};
struct ishtp_opregion_dev {
struct opregion_context opr_context;
struct ishtp_cl *ecl_ishtp_cl;
struct ishtp_cl_device *cl_device;
struct ishtp_fw_client *fw_client;
struct ishtp_cl_rb *rb;
struct acpi_device *adev;
unsigned int dsm_event_id;
unsigned int ish_link_ready;
unsigned int ish_read_done;
unsigned int acpi_init_done;
wait_queue_head_t read_wait;
struct work_struct event_work;
struct work_struct reset_work;
/* lock for opregion context */
struct mutex lock;
};
/* eclite ishtp client UUID: 6a19cc4b-d760-4de3-b14d-f25ebd0fbcd9 */
static const struct ishtp_device_id ecl_ishtp_id_table[] = {
{ .guid = GUID_INIT(0x6a19cc4b, 0xd760, 0x4de3,
0xb1, 0x4d, 0xf2, 0x5e, 0xbd, 0xf, 0xbc, 0xd9), },
{ }
};
MODULE_DEVICE_TABLE(ishtp, ecl_ishtp_id_table);
/* ACPI DSM UUID: 91d936a7-1f01-49c6-a6b4-72f00ad8d8a5 */
static const guid_t ecl_acpi_guid =
GUID_INIT(0x91d936a7, 0x1f01, 0x49c6, 0xa6,
0xb4, 0x72, 0xf0, 0x0a, 0xd8, 0xd8, 0xa5);
/**
* ecl_ish_cl_read() - Read data from eclite FW
*
* @opr_dev: pointer to opregion device
*
* This function issues a read request to eclite FW and waits until it
* receives a response. When response is received the read data is copied to
* opregion buffer.
*/
static int ecl_ish_cl_read(struct ishtp_opregion_dev *opr_dev)
{
struct ecl_message_header header;
int len, rv;
if (!opr_dev->ish_link_ready)
return -EIO;
if ((opr_dev->opr_context.cmd_area.offset +
opr_dev->opr_context.cmd_area.length) > ECL_DATA_OPR_BUFLEN) {
return -EINVAL;
}
header.version = ECL_ISH_HEADER_VERSION;
header.data_type = ECL_MSG_DATA;
header.request_type = ECL_ISH_READ;
header.offset = opr_dev->opr_context.cmd_area.offset;
header.data_len = opr_dev->opr_context.cmd_area.length;
header.event = opr_dev->opr_context.cmd_area.event_id;
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/bitops.h`, `linux/device.h`, `linux/errno.h`, `linux/intel-ish-client-if.h`, `linux/kernel.h`, `linux/module.h`, `linux/mutex.h`.
- Detected declarations: `struct opregion_cmd`, `struct opregion_data`, `struct opregion_context`, `struct ecl_message_header`, `struct ecl_message`, `struct ishtp_opregion_dev`, `function ecl_ish_cl_read`, `function ecl_ish_cl_write`, `function ecl_opregion_cmd_handler`, `function ecl_opregion_data_handler`.
- Atlas domain: Driver Families / drivers/platform.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.