drivers/s390/cio/qdio.h

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

File Facts

System
Linux kernel
Corpus path
drivers/s390/cio/qdio.h
Extension
.h
Size
9895 bytes
Lines
349
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 qdio_dev_perf_stat {
	unsigned int adapter_int;
	unsigned int qdio_int;

	unsigned int siga_read;
	unsigned int siga_write;
	unsigned int siga_sync;

	unsigned int inbound_call;
	unsigned int stop_polling;
	unsigned int inbound_queue_full;
	unsigned int outbound_call;
	unsigned int outbound_queue_full;
	unsigned int fast_requeue;
	unsigned int target_full;
	unsigned int eqbs;
	unsigned int eqbs_partial;
	unsigned int sqbs;
	unsigned int sqbs_partial;
	unsigned int int_discarded;
} ____cacheline_aligned;

struct qdio_queue_perf_stat {
	/* Sorted into order-2 buckets: 1, 2-3, 4-7, ... 64-127, 128. */
	unsigned int nr_sbals[8];
	unsigned int nr_sbal_error;
	unsigned int nr_sbal_nop;
	unsigned int nr_sbal_total;
};

enum qdio_irq_poll_states {
	QDIO_IRQ_DISABLED,
};

struct qdio_input_q {
	/* Batch of SBALs that we processed while polling the queue: */
	unsigned int batch_start;
	unsigned int batch_count;
};

struct qdio_output_q {
};

/*
 * Note on cache alignment: grouped slsb and write mostly data at the beginning
 * sbal[] is read-only and starts on a new cacheline followed by read mostly.
 */
struct qdio_q {
	struct slsb slsb;

	union {
		struct qdio_input_q in;
		struct qdio_output_q out;
	} u;

	/*
	 * inbound: next buffer the program should check for
	 * outbound: next buffer to check if adapter processed it
	 */
	int first_to_check;

	/* number of buffers in use by the adapter */
	atomic_t nr_buf_used;

	/* last scan of the queue */
	u64 timestamp;

	struct qdio_queue_perf_stat q_stats;

	struct qdio_buffer *sbal[QDIO_MAX_BUFFERS_PER_Q] ____cacheline_aligned;

	/* queue number */
	int nr;

	/* bitmask of queue number */
	int mask;

	/* input or output queue */
	int is_input_q;

	/* upper-layer program handler */
	qdio_handler_t (*handler);

	struct qdio_irq *irq_ptr;

	/* memory page (PAGE_SIZE) used to place slib and sl on */
	void *sl_page;
	struct sl *sl;
	struct slib *slib;
} __attribute__ ((aligned(256)));

Annotation

Implementation Notes