drivers/hid/intel-ish-hid/ishtp-hid.h

Source file repositories/reference/linux-study-clean/drivers/hid/intel-ish-hid/ishtp-hid.h

File Facts

System
Linux kernel
Corpus path
drivers/hid/intel-ish-hid/ishtp-hid.h
Extension
.h
Size
5318 bytes
Lines
182
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.

Dependency Surface

Detected Declarations

Annotated Snippet

struct hostif_msg_hdr {
	uint8_t	command; /* Bit 7: is_response */
	uint8_t	device_id;
	uint8_t	status;
	uint8_t	flags;
	uint16_t size;
} __packed;

struct hostif_msg {
	struct hostif_msg_hdr	hdr;
	uint8_t payload[];
} __packed;

struct hostif_msg_to_sensor {
	struct hostif_msg_hdr	hdr;
	uint8_t	report_id;
} __packed;

struct device_info {
	uint32_t dev_id;
	uint8_t dev_class;
	uint16_t pid;
	uint16_t vid;
} __packed;

struct ishtp_version {
	uint8_t	major;
	uint8_t	minor;
	uint8_t	hotfix;
	uint16_t build;
} __packed;

struct report {
	uint16_t size;
	struct hostif_msg_hdr msg;
} __packed;

/* struct for ISHTP aggregated input data */
struct report_list {
	uint16_t total_size;
	uint8_t	num_of_reports;
	uint8_t	flags;
	struct report reports[];
} __packed;

/* HOSTIF commands */
#define	HOSTIF_HID_COMMAND_BASE			0
#define	HOSTIF_GET_HID_DESCRIPTOR		0
#define	HOSTIF_GET_REPORT_DESCRIPTOR		1
#define HOSTIF_GET_FEATURE_REPORT		2
#define	HOSTIF_SET_FEATURE_REPORT		3
#define	HOSTIF_GET_INPUT_REPORT			4
#define	HOSTIF_PUBLISH_INPUT_REPORT		5
#define	HOSTIF_PUBLISH_INPUT_REPORT_LIST	6
#define	HOSTIF_DM_COMMAND_BASE			32
#define	HOSTIF_DM_ENUM_DEVICES			33
#define	HOSTIF_DM_ADD_DEVICE			34

#define	MAX_HID_DEVICES				32

/**
 * struct ishtp_cl_data - Encapsulate per ISH TP HID Client
 * @enum_device_done:	Enum devices response complete flag
 * @hid_descr_done:	HID descriptor complete flag
 * @report_descr_done:	Get report descriptor complete flag
 * @init_done:		Init process completed successfully
 * @suspended:		System is under suspend state or in progress
 * @num_hid_devices:	Number of HID devices enumerated in this client
 * @cur_hid_dev:	This keeps track of the device index for which
 *			initialization and registration with HID core
 *			in progress.
 * @hid_devices:	Store vid/pid/devid for each enumerated HID device
 * @report_descr:	Stores the raw report descriptors for each HID device
 * @report_descr_size:	Report description of size of above repo_descr[]
 * @hid_sensor_hubs:	Pointer to hid_device for all HID device, so that
 *			when clients are removed, they can be freed
 * @hid_descr:		Pointer to hid descriptor for each enumerated hid
 *			device
 * @hid_descr_size:	Size of each above report descriptor
 * @init_wait:		Wait queue to wait during initialization, where the
 *			client send message to ISH FW and wait for response
 * @ishtp_hid_wait:	The wait for get report during wait callback from hid
 *			core
 * @bad_recv_cnt:	Running count of packets received with error
 * @multi_packet_cnt:	Count of fragmented packet count
 *
 * This structure is used to store completion flags and per client data like
 * report description, number of HID devices etc.
 */
struct ishtp_cl_data {

Annotation

Implementation Notes