include/scsi/scsi_transport_fc.h
Source file repositories/reference/linux-study-clean/include/scsi/scsi_transport_fc.h
File Facts
- System
- Linux kernel
- Corpus path
include/scsi/scsi_transport_fc.h- Extension
.h- Size
- 28723 bytes
- Lines
- 890
- Domain
- Repository Root And Misc
- Bucket
- include
- Inferred role
- Repository Root And Misc: implementation source
- Status
- source implementation candidate
Why This File Exists
Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/sched.hlinux/bsg-lib.hlinux/unaligned.hscsi/scsi.hscsi/scsi_netlink.hscsi/scsi_host.h
Detected Declarations
struct scsi_transport_templatestruct fc_vport_identifiersstruct fc_vportstruct fc_rport_identifiersstruct fc_fpin_statsstruct fc_encryption_infostruct fc_rportstruct fc_starget_attrsstruct fc_host_statisticsstruct fc_host_attrsstruct fc_function_templateenum fc_port_typeenum fc_port_stateenum fc_vport_stateenum fc_tgtid_binding_typeenum fc_host_event_codefunction fc_remote_port_chkreadyfunction wwn_to_u64function u64_to_wwnfunction fc_vport_set_state
Annotated Snippet
struct fc_vport_identifiers {
u64 node_name;
u64 port_name;
u32 roles;
bool disable;
enum fc_port_type vport_type; /* only FC_PORTTYPE_NPIV allowed */
char symbolic_name[FC_VPORT_SYMBOLIC_NAMELEN];
};
/*
* FC Virtual Port Attributes
*
* This structure exists for each FC port is a virtual FC port. Virtual
* ports share the physical link with the Physical port. Each virtual
* ports has a unique presence on the SAN, and may be instantiated via
* NPIV, Virtual Fabrics, or via additional ALPAs. As the vport is a
* unique presence, each vport has it's own view of the fabric,
* authentication privilege, and priorities.
*
* A virtual port may support 1 or more FC4 roles. Typically it is a
* FCP Initiator. It could be a FCP Target, or exist sole for an IP over FC
* roles. FC port attributes for the vport will be reported on any
* fc_host class object allocated for an FCP Initiator.
*
* --
*
* Fixed attributes are not expected to change. The driver is
* expected to set these values after receiving the fc_vport structure
* via the vport_create() call from the transport.
* The transport fully manages all get functions w/o driver interaction.
*
* Dynamic attributes are expected to change. The driver participates
* in all get/set operations via functions provided by the driver.
*
* Private attributes are transport-managed values. They are fully
* managed by the transport w/o driver interaction.
*/
struct fc_vport {
/* Fixed Attributes */
/* Dynamic Attributes */
/* Private (Transport-managed) Attributes */
enum fc_vport_state vport_state;
enum fc_vport_state vport_last_state;
u64 node_name;
u64 port_name;
u32 roles;
u32 vport_id; /* Admin Identifier for the vport */
enum fc_port_type vport_type;
char symbolic_name[FC_VPORT_SYMBOLIC_NAMELEN];
/* exported data */
void *dd_data; /* Used for driver-specific storage */
/* internal data */
struct Scsi_Host *shost; /* Physical Port Parent */
unsigned int channel;
u32 number;
u8 flags;
struct list_head peers;
struct device dev;
struct work_struct vport_delete_work;
} __attribute__((aligned(sizeof(unsigned long))));
/* bit field values for struct fc_vport "flags" field: */
#define FC_VPORT_CREATING 0x01
#define FC_VPORT_DELETING 0x02
#define FC_VPORT_DELETED 0x04
#define FC_VPORT_DEL 0x06 /* Any DELETE state */
#define dev_to_vport(d) \
container_of(d, struct fc_vport, dev)
#define transport_class_to_vport(dev) \
dev_to_vport(dev->parent)
#define vport_to_shost(v) \
(v->shost)
#define vport_to_shost_channel(v) \
(v->channel)
#define vport_to_parent(v) \
(v->dev.parent)
/* Error return codes for vport_create() callback */
#define VPCERR_UNSUPPORTED -ENOSYS /* no driver/adapter
support */
#define VPCERR_BAD_WWN -ENOTUNIQ /* driver validation
of WWNs failed */
#define VPCERR_NO_FABRIC_SUPP -EOPNOTSUPP /* Fabric connection
Annotation
- Immediate include surface: `linux/sched.h`, `linux/bsg-lib.h`, `linux/unaligned.h`, `scsi/scsi.h`, `scsi/scsi_netlink.h`, `scsi/scsi_host.h`.
- Detected declarations: `struct scsi_transport_template`, `struct fc_vport_identifiers`, `struct fc_vport`, `struct fc_rport_identifiers`, `struct fc_fpin_stats`, `struct fc_encryption_info`, `struct fc_rport`, `struct fc_starget_attrs`, `struct fc_host_statistics`, `struct fc_host_attrs`.
- Atlas domain: Repository Root And Misc / include.
- 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.