drivers/s390/cio/vfio_ccw_private.h

Source file repositories/reference/linux-study-clean/drivers/s390/cio/vfio_ccw_private.h

File Facts

System
Linux kernel
Corpus path
drivers/s390/cio/vfio_ccw_private.h
Extension
.h
Size
5878 bytes
Lines
201
Domain
Driver Families
Bucket
drivers/s390
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 vfio_ccw_regops {
	ssize_t	(*read)(struct vfio_ccw_private *private, char __user *buf,
			size_t count, loff_t *ppos);
	ssize_t	(*write)(struct vfio_ccw_private *private,
			 const char __user *buf, size_t count, loff_t *ppos);
	void	(*release)(struct vfio_ccw_private *private,
			   struct vfio_ccw_region *region);
};

struct vfio_ccw_region {
	u32				type;
	u32				subtype;
	const struct vfio_ccw_regops	*ops;
	void				*data;
	size_t				size;
	u32				flags;
};

int vfio_ccw_register_dev_region(struct vfio_ccw_private *private,
				 unsigned int subtype,
				 const struct vfio_ccw_regops *ops,
				 size_t size, u32 flags, void *data);
void vfio_ccw_unregister_dev_regions(struct vfio_ccw_private *private);

int vfio_ccw_register_async_dev_regions(struct vfio_ccw_private *private);
int vfio_ccw_register_schib_dev_regions(struct vfio_ccw_private *private);
int vfio_ccw_register_crw_dev_regions(struct vfio_ccw_private *private);

struct vfio_ccw_crw {
	struct list_head	next;
	struct crw		crw;
};

/**
 * struct vfio_ccw_parent
 *
 * @dev: embedded device struct
 * @parent: parent data structures for mdevs created
 * @mdev_type(s): identifying information for mdevs created
 */
struct vfio_ccw_parent {
	struct device		dev;

	struct mdev_parent	parent;
	struct mdev_type	mdev_type;
	struct mdev_type	*mdev_types;
};

/**
 * struct vfio_ccw_private
 * @vdev: Embedded VFIO device
 * @state: internal state of the device
 * @completion: synchronization helper of the I/O completion
 * @io_region: MMIO region to input/output I/O arguments/results
 * @io_mutex: protect against concurrent update of I/O regions
 * @region: additional regions for other subchannel operations
 * @cmd_region: MMIO region for asynchronous I/O commands other than START
 * @schib_region: MMIO region for SCHIB information
 * @crw_region: MMIO region for getting channel report words
 * @num_regions: number of additional regions
 * @cp: channel program for the current I/O operation
 * @irb: irb info received from interrupt
 * @scsw: scsw info
 * @io_trigger: eventfd ctx for signaling userspace I/O results
 * @crw_trigger: eventfd ctx for signaling userspace CRW information
 * @req_trigger: eventfd ctx for signaling userspace to return device
 * @io_work: work for deferral process of I/O handling
 * @crw_work: work for deferral process of CRW handling
 */
struct vfio_ccw_private {
	struct vfio_device vdev;
	int			state;
	struct completion	*completion;
	struct ccw_io_region	*io_region;
	struct mutex		io_mutex;
	struct vfio_ccw_region *region;
	struct ccw_cmd_region	*cmd_region;
	struct ccw_schib_region *schib_region;
	struct ccw_crw_region	*crw_region;
	int num_regions;

	struct channel_program	cp;
	struct irb		irb;
	union scsw		scsw;
	struct list_head	crw;

	struct eventfd_ctx	*io_trigger;
	struct eventfd_ctx	*crw_trigger;
	struct eventfd_ctx	*req_trigger;
	struct work_struct	io_work;

Annotation

Implementation Notes