drivers/s390/scsi/zfcp_qdio.h
Source file repositories/reference/linux-study-clean/drivers/s390/scsi/zfcp_qdio.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/s390/scsi/zfcp_qdio.h- Extension
.h- Size
- 7480 bytes
- Lines
- 268
- 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.
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/interrupt.hasm/qdio.h
Detected Declarations
struct zfcp_qdiostruct zfcp_qdio_reqfunction zfcp_qdio_sbale_reqfunction zfcp_qdio_sbale_currfunction zfcp_qdio_req_initfunction zfcp_qdio_fill_nextfunction zfcp_qdio_set_sbale_lastfunction zfcp_qdio_sg_one_sbalefunction zfcp_qdio_skip_to_last_sbalefunction zfcp_qdio_sbal_limitfunction zfcp_qdio_set_data_divfunction zfcp_qdio_real_bytesfunction zfcp_qdio_set_scount
Annotated Snippet
struct zfcp_qdio {
struct qdio_buffer *res_q[QDIO_MAX_BUFFERS_PER_Q];
struct qdio_buffer *req_q[QDIO_MAX_BUFFERS_PER_Q];
u8 req_q_idx;
atomic_t req_q_free;
spinlock_t stat_lock;
spinlock_t req_q_lock;
unsigned long long req_q_time;
u64 req_q_util;
atomic_t req_q_full;
wait_queue_head_t req_q_wq;
struct tasklet_struct irq_tasklet;
struct tasklet_struct request_tasklet;
struct timer_list request_timer;
struct zfcp_adapter *adapter;
u16 max_sbale_per_sbal;
u16 max_sbale_per_req;
};
/**
* struct zfcp_qdio_req - qdio queue related values for a request
* @sbtype: sbal type flags for sbale 0
* @sbal_number: number of free sbals
* @sbal_first: first sbal for this request
* @sbal_last: last sbal for this request
* @sbal_limit: last possible sbal for this request
* @sbale_curr: current sbale at creation of this request
* @qdio_outb_usage: usage of outbound queue
*/
struct zfcp_qdio_req {
u8 sbtype;
u8 sbal_number;
u8 sbal_first;
u8 sbal_last;
u8 sbal_limit;
u8 sbale_curr;
u16 qdio_outb_usage;
};
/**
* zfcp_qdio_sbale_req - return pointer to sbale on req_q for a request
* @qdio: pointer to struct zfcp_qdio
* @q_req: pointer to struct zfcp_qdio_req
* Returns: pointer to qdio_buffer_element (sbale) structure
*/
static inline struct qdio_buffer_element *
zfcp_qdio_sbale_req(struct zfcp_qdio *qdio, struct zfcp_qdio_req *q_req)
{
return &qdio->req_q[q_req->sbal_last]->element[0];
}
/**
* zfcp_qdio_sbale_curr - return current sbale on req_q for a request
* @qdio: pointer to struct zfcp_qdio
* @q_req: pointer to struct zfcp_qdio_req
* Returns: pointer to qdio_buffer_element (sbale) structure
*/
static inline struct qdio_buffer_element *
zfcp_qdio_sbale_curr(struct zfcp_qdio *qdio, struct zfcp_qdio_req *q_req)
{
return &qdio->req_q[q_req->sbal_last]->element[q_req->sbale_curr];
}
/**
* zfcp_qdio_req_init - initialize qdio request
* @qdio: request queue where to start putting the request
* @q_req: the qdio request to start
* @req_id: The request id
* @sbtype: type flags to set for all sbals
* @data: First data block
* @len: Length of first data block
*
* This is the start of putting the request into the queue, the last
* step is passing the request to zfcp_qdio_send. The request queue
* lock must be held during the whole process from init to send.
*/
static inline
void zfcp_qdio_req_init(struct zfcp_qdio *qdio, struct zfcp_qdio_req *q_req,
u64 req_id, u8 sbtype, void *data, u32 len)
{
struct qdio_buffer_element *sbale;
int count = min(atomic_read(&qdio->req_q_free),
ZFCP_QDIO_MAX_SBALS_PER_REQ);
q_req->sbal_first = q_req->sbal_last = qdio->req_q_idx;
q_req->sbal_number = 1;
q_req->sbtype = sbtype;
q_req->sbale_curr = 1;
q_req->sbal_limit = (q_req->sbal_first + count - 1)
% QDIO_MAX_BUFFERS_PER_Q;
Annotation
- Immediate include surface: `linux/interrupt.h`, `asm/qdio.h`.
- Detected declarations: `struct zfcp_qdio`, `struct zfcp_qdio_req`, `function zfcp_qdio_sbale_req`, `function zfcp_qdio_sbale_curr`, `function zfcp_qdio_req_init`, `function zfcp_qdio_fill_next`, `function zfcp_qdio_set_sbale_last`, `function zfcp_qdio_sg_one_sbale`, `function zfcp_qdio_skip_to_last_sbale`, `function zfcp_qdio_sbal_limit`.
- Atlas domain: Driver Families / drivers/s390.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.