drivers/target/loopback/tcm_loop.h
Source file repositories/reference/linux-study-clean/drivers/target/loopback/tcm_loop.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/target/loopback/tcm_loop.h- Extension
.h- Size
- 1440 bytes
- Lines
- 55
- Domain
- Driver Families
- Bucket
- drivers/target
- 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/types.hlinux/device.htarget/target_core_base.h
Detected Declarations
struct tcm_loop_cmdstruct tcm_loop_nexusstruct tcm_loop_tpgstruct tcm_loop_hba
Annotated Snippet
struct tcm_loop_cmd {
/* State of Linux/SCSI CDB+Data descriptor */
u32 sc_cmd_state;
/* Tagged command queueing */
u32 sc_cmd_tag;
/* Pointer to the CDB+Data descriptor from Linux/SCSI subsystem */
struct scsi_cmnd *sc;
/* The TCM I/O descriptor that is accessed via container_of() */
struct se_cmd tl_se_cmd;
struct completion tmr_done;
/* Sense buffer that will be mapped into outgoing status */
unsigned char tl_sense_buf[TRANSPORT_SENSE_BUFFER];
};
struct tcm_loop_nexus {
/*
* Pointer to TCM session for I_T Nexus
*/
struct se_session *se_sess;
};
#define TCM_TRANSPORT_ONLINE 0
#define TCM_TRANSPORT_OFFLINE 1
struct tcm_loop_tpg {
unsigned short tl_tpgt;
unsigned short tl_transport_status;
enum target_prot_type tl_fabric_prot_type;
atomic_t tl_tpg_port_count;
struct se_portal_group tl_se_tpg;
struct tcm_loop_hba *tl_hba;
struct tcm_loop_nexus *tl_nexus;
};
struct tcm_loop_hba {
u8 tl_proto_id;
unsigned char tl_wwn_address[TL_WWN_ADDR_LEN];
struct se_hba_s *se_hba;
struct se_lun *tl_hba_lun;
struct se_port *tl_hba_lun_sep;
struct device dev;
struct Scsi_Host *sh;
struct tcm_loop_tpg tl_hba_tpgs[TL_TPGS_PER_HBA];
struct se_wwn tl_hba_wwn;
};
Annotation
- Immediate include surface: `linux/types.h`, `linux/device.h`, `target/target_core_base.h`.
- Detected declarations: `struct tcm_loop_cmd`, `struct tcm_loop_nexus`, `struct tcm_loop_tpg`, `struct tcm_loop_hba`.
- Atlas domain: Driver Families / drivers/target.
- 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.