STRUCT ISHTP_DEVICE(9)
β¨ NAME β¨
struct ishtp_device β ISHTP private device struct πΈ
okay so real quick before we dive in: this page comes from the Kernel API Manual, and it's literally just the definition of the private device struct for ISHTP. That's the whole vibe. No cap, it's one struct and it's packed π
π SYNOPSIS π
struct ishtp_device {
struct device *devc;
struct pci_dev *pdev;
struct ishtp_driver_data *driver_data;
wait_queue_head_t suspend_wait;
bool suspend_flag;
wait_queue_head_t resume_wait;
bool resume_flag;
spinlock_t device_lock;
bool recvd_hw_ready;
struct hbm_version version;
int transfer_path;
struct workqueue_struct *unbound_wq;
struct work_struct work_fw_loader;
wait_queue_head_t wait_loader_recvd_msg;
bool fw_loader_received;
void *fw_loader_rx_buf;
int fw_loader_rx_size;
enum ishtp_dev_state dev_state;
enum ishtp_hbm_state hbm_state;
struct ishtp_cl_rb read_list;
spinlock_t read_list_spinlock;
struct list_head cl_list;
spinlock_t cl_list_lock;
long open_handle_count;
struct list_head device_list;
spinlock_t device_list_lock;
wait_queue_head_t wait_hw_ready;
wait_queue_head_t wait_hbm_recvd_msg;
unsigned char rd_msg_fifo[RD_INT_FIFO_SIZE * IPC_PAYLOAD_SIZE];
unsigned int rd_msg_fifo_head, rd_msg_fifo_tail;
spinlock_t rd_msg_spinlock;
struct work_struct bh_hbm_work;
struct list_head wr_processing_list, wr_free_list;
spinlock_t wr_processing_spinlock;
struct ishtp_fw_client *fw_clients;
unsigned long fw_clients_map[BITS_TO_LONGS( ISHTP_CLIENTS_MAX)];
unsigned long host_clients_map[BITS_TO_LONGS( ISHTP_CLIENTS_MAX)];
uint8_t fw_clients_num;
uint8_t fw_client_presentation_num;
uint8_t fw_client_index;
spinlock_t fw_clients_lock;
int ishtp_host_dma_enabled;
void *ishtp_host_dma_tx_buf;
unsigned int ishtp_host_dma_tx_buf_size;
uint64_t ishtp_host_dma_tx_buf_phys;
int ishtp_dma_num_slots;
uint8_t *ishtp_dma_tx_map;
spinlock_t ishtp_dma_tx_lock;
void *ishtp_host_dma_rx_buf;
unsigned int ishtp_host_dma_rx_buf_size;
uint64_t ishtp_host_dma_rx_buf_phys;
ishtp_print_log print_log;
struct ish_version base_ver;
struct ish_version prj_ver;
unsigned int ipc_rx_cnt;
unsigned long long ipc_rx_bytes_cnt;
unsigned int ipc_tx_cnt;
unsigned long long ipc_tx_bytes_cnt;
unsigned long prev_sync;
const struct ishtp_hw_ops *ops;
size_t mtu;
uint32_t ishtp_msg_hdr;
char hw[];
};
likeβ¦ look at her. she's everything ππ«Ά
the way this struct has literally one of everything: pointers to struct device and struct pci_dev and struct ishtp_driver_data up top, a whole lil collection of wait_queue_head_ts (suspend_wait, resume_wait, wait_loader_recvd_msg, wait_hw_ready, wait_hbm_recvd_msg) with their matching bool flags and state enums β enum ishtp_dev_state dev_state, enum ishtp_hbm_state hbm_state β and then an iconic amount of locking. like there are so many spinlock_ts in here it's giving "i don't trust anybody" energy and honestly? valid. device_lock, read_list_spinlock, cl_list_lock, device_list_lock, rd_msg_spinlock, wr_processing_spinlock, fw_clients_lock, ishtp_dma_tx_lock. every list gets its own bodyguard fr fr π
also not me noticing there's a ring buffer just vibing in the middle: unsigned char rd_msg_fifo[RD_INT_FIFO_SIZE * IPC_PAYLOAD_SIZE]; with rd_msg_fifo_head and rd_msg_fifo_tail to keep track, plus struct work_struct bh_hbm_work;.
and the client bookkeeping is so organized bestie: struct ishtp_fw_client *fw_clients;, then fw_clients_map and host_clients_map (both BITS_TO_LONGS( ISHTP_CLIENTS_MAX) β yes, with the space, keep it exactly like that π), then the lil trio of uint8_ts: fw_clients_num, fw_client_presentation_num, fw_client_index.
the DMA block is highkey its own little chapter β ishtp_host_dma_enabled, then tx side (ishtp_host_dma_tx_buf, ishtp_host_dma_tx_buf_size, ishtp_host_dma_tx_buf_phys), ishtp_dma_num_slots, ishtp_dma_tx_map, ishtp_dma_tx_lock, then rx side (ishtp_host_dma_rx_buf, ishtp_host_dma_rx_buf_size, ishtp_host_dma_rx_buf_phys). symmetrical slay β¨
and down at the bottom she's got the counters row β ipc_rx_cnt, ipc_rx_bytes_cnt, ipc_tx_cnt, ipc_tx_bytes_cnt (yes the original keeps those extra spaces before the names, we're not touching them, character for character periodt) β plus prev_sync, const struct ishtp_hw_ops *ops;, size_t mtu;, uint32_t ishtp_msg_hdr; and a flexible array friend at the very end: char hw[]; π¦
π Members π
so the page has a Members section andβ¦ bestieβ¦ it is empty π like the heading is there, the listing is not. no per-field blurbs, no descriptions. nada. so if you came here for "what does prev_sync actually do," the manpage is gonna give you the β¨mysteryβ¨ treatment. everything we know is up there in the struct definition itself, so read the field names and enjoy the vibe check. π
π¦ SEE ALSO π¦
Kernel file ./drivers/hid/intel-ish-hid/ishtp/ishtp-dev.hstructishtp_fw_client(9),struct ishtp_driver_data(9)
like obviously go read ishtp_fw_client(9) and struct ishtp_driver_data(9) if you want the rest of the family, and the actual living source is ./drivers/hid/intel-ish-hid/ishtp/ishtp-dev.h β that's where she lives π
that's the whole page bestie, go forth and be iconic π«Ά this little writeup is dated October 2026, straight out of the source tree at ./drivers/hid/intel-ish-hid/ishtp β iykyk ππβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms