drivers/scsi/ibmvscsi_tgt/libsrp.h
Source file repositories/reference/linux-study-clean/drivers/scsi/ibmvscsi_tgt/libsrp.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/ibmvscsi_tgt/libsrp.h- Extension
.h- Size
- 2490 bytes
- Lines
- 128
- Domain
- Driver Families
- Bucket
- drivers/scsi
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/list.hlinux/kfifo.hscsi/srp.h
Detected Declarations
struct srp_bufstruct srp_queuestruct srp_targetstruct iu_entrystruct ibmvscsis_cmdenum srp_validenum srp_formatenum srp_init_msgenum srp_trans_eventenum srp_statusenum srp_mad_versionenum srp_os_typeenum srp_task_attributesfunction srp_cmd_direction
Annotated Snippet
struct srp_buf {
dma_addr_t dma;
void *buf;
};
struct srp_queue {
void *pool;
void *items;
struct kfifo queue;
spinlock_t lock;
};
struct srp_target {
struct device *dev;
spinlock_t lock;
struct list_head cmd_queue;
size_t srp_iu_size;
struct srp_queue iu_queue;
size_t rx_ring_size;
struct srp_buf **rx_ring;
void *ldata;
};
struct iu_entry {
struct srp_target *target;
struct list_head ilist;
dma_addr_t remote_token;
unsigned long flags;
struct srp_buf *sbuf;
u16 iu_len;
};
struct ibmvscsis_cmd;
typedef int (srp_rdma_t)(struct ibmvscsis_cmd *, struct scatterlist *, int,
struct srp_direct_buf *, int,
enum dma_data_direction, unsigned int);
int srp_target_alloc(struct srp_target *, struct device *, size_t, size_t);
void srp_target_free(struct srp_target *);
struct iu_entry *srp_iu_get(struct srp_target *);
void srp_iu_put(struct iu_entry *);
int srp_transfer_data(struct ibmvscsis_cmd *, struct srp_cmd *,
srp_rdma_t, int, int);
u64 srp_data_length(struct srp_cmd *cmd, enum dma_data_direction dir);
int srp_get_desc_table(struct srp_cmd *srp_cmd, enum dma_data_direction *dir,
u64 *data_len);
static inline int srp_cmd_direction(struct srp_cmd *cmd)
{
return (cmd->buf_fmt >> 4) ? DMA_TO_DEVICE : DMA_FROM_DEVICE;
}
#endif
Annotation
- Immediate include surface: `linux/list.h`, `linux/kfifo.h`, `scsi/srp.h`.
- Detected declarations: `struct srp_buf`, `struct srp_queue`, `struct srp_target`, `struct iu_entry`, `struct ibmvscsis_cmd`, `enum srp_valid`, `enum srp_format`, `enum srp_init_msg`, `enum srp_trans_event`, `enum srp_status`.
- Atlas domain: Driver Families / drivers/scsi.
- Implementation status: source implementation candidate.
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.