drivers/misc/ibmvmc.h

Source file repositories/reference/linux-study-clean/drivers/misc/ibmvmc.h

File Facts

System
Linux kernel
Corpus path
drivers/misc/ibmvmc.h
Extension
.h
Size
5297 bytes
Lines
210
Domain
Driver Families
Bucket
drivers/misc
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 ibmvmc_buffer {
	u8 valid;	/* 1 when DMA storage allocated to buffer          */
	u8 free;	/* 1 when buffer available for the Alpha Partition */
	u8 owner;
	u16 id;
	u32 size;
	u32 msg_len;
	dma_addr_t dma_addr_local;
	dma_addr_t dma_addr_remote;
	void *real_addr_local;
};

struct ibmvmc_admin_crq_msg {
	u8 valid;	/* RPA Defined           */
	u8 type;	/* ibmvmc msg type       */
	u8 status;	/* Response msg status. Zero is success and on failure,
			 * either 1 - General Failure, or 2 - Invalid Version is
			 * returned.
			 */
	u8 rsvd[2];
	u8 max_hmc;	/* Max # of independent HMC connections supported */
	__be16 pool_size;	/* Maximum number of buffers supported per HMC
				 * connection
				 */
	__be32 max_mtu;		/* Maximum message size supported (bytes) */
	__be16 crq_size;	/* # of entries available in the CRQ for the
				 * source partition. The target partition must
				 * limit the number of outstanding messages to
				 * one half or less.
				 */
	__be16 version;	/* Indicates the code level of the management partition
			 * or the hypervisor with the high-order byte
			 * indicating a major version and the low-order byte
			 * indicating a minor version.
			 */
};

struct ibmvmc_crq_msg {
	u8 valid;     /* RPA Defined           */
	u8 type;      /* ibmvmc msg type       */
	u8 status;    /* Response msg status   */
	union {
		u8 rsvd;  /* Reserved              */
		u8 owner;
	} var1;
	u8 hmc_session;	/* Session Identifier for the current VMC connection */
	u8 hmc_index;	/* A unique HMC Idx would be used if multiple management
			 * applications running concurrently were desired
			 */
	union {
		__be16 rsvd;
		__be16 buffer_id;
	} var2;
	__be32 rsvd;
	union {
		__be32 rsvd;
		__be32 lioba;
		__be32 msg_len;
	} var3;
};

/* an RPA command/response transport queue */
struct crq_queue {
	struct ibmvmc_crq_msg *msgs;
	int size, cur;
	dma_addr_t msg_token;
	spinlock_t lock;
};

/* VMC server adapter settings */
struct crq_server_adapter {
	struct device *dev;
	struct crq_queue queue;
	u32 liobn;
	u32 riobn;
	struct tasklet_struct work_task;
	wait_queue_head_t reset_wait_queue;
	struct task_struct *reset_task;
};

/* Driver wide settings */
struct ibmvmc_struct {
	u32 state;
	u32 max_mtu;
	u32 max_buffer_pool_size;
	u32 max_hmc_index;
	struct crq_server_adapter *adapter;
	struct cdev cdev;
	u32 vmc_drc_index;
};

Annotation

Implementation Notes