drivers/hv/hv_utils_transport.h

Source file repositories/reference/linux-study-clean/drivers/hv/hv_utils_transport.h

File Facts

System
Linux kernel
Corpus path
drivers/hv/hv_utils_transport.h
Extension
.h
Size
1689 bytes
Lines
46
Domain
Driver Families
Bucket
drivers/hv
Inferred role
Driver Families: operation-table or driver-model contract
Status
pattern 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 file_operations fops;        /* file operations */
	struct miscdevice mdev;             /* misc device */
	struct cb_id cn_id;                 /* CN_*_IDX/CN_*_VAL */
	struct list_head list;              /* hvt_list */
	int (*on_msg)(void *, int);         /* callback on new user message */
	void (*on_reset)(void);             /* callback when userspace drops */
	void (*on_read)(void);              /* callback on message read */
	u8 *outmsg;                         /* message to the userspace */
	int outmsg_len;                     /* its length */
	wait_queue_head_t outmsg_q;         /* poll/read wait queue */
	struct mutex lock;                  /* protects struct members */
	struct completion release;          /* synchronize with fd release */
};

struct hvutil_transport *hvutil_transport_init(const char *name,
					       u32 cn_idx, u32 cn_val,
					       int (*on_msg)(void *, int),
					       void (*on_reset)(void));
int hvutil_transport_send(struct hvutil_transport *hvt, void *msg, int len,
			  void (*on_read_cb)(void));
void hvutil_transport_destroy(struct hvutil_transport *hvt);

#endif /* _HV_UTILS_TRANSPORT_H */

Annotation

Implementation Notes