drivers/target/tcm_fc/tcm_fc.h

Source file repositories/reference/linux-study-clean/drivers/target/tcm_fc/tcm_fc.h

File Facts

System
Linux kernel
Corpus path
drivers/target/tcm_fc/tcm_fc.h
Extension
.h
Size
4248 bytes
Lines
169
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.

Dependency Surface

Detected Declarations

Annotated Snippet

struct ft_transport_id {
	__u8	format;
	__u8	__resvd1[7];
	__u8	wwpn[8];
	__u8	__resvd2[8];
} __attribute__((__packed__));

/*
 * Session (remote port).
 */
struct ft_sess {
	u32 port_id;			/* for hash lookup use only */
	u32 params;
	u16 max_frame;			/* maximum frame size */
	u64 port_name;			/* port name for transport ID */
	struct ft_tport *tport;
	struct se_session *se_sess;
	struct hlist_node hash;		/* linkage in ft_sess_hash table */
	struct rcu_head rcu;
	struct kref kref;		/* ref for hash and outstanding I/Os */
};

/*
 * Hash table of sessions per local port.
 * Hash lookup by remote port FC_ID.
 */
#define	FT_SESS_HASH_BITS	6
#define	FT_SESS_HASH_SIZE	(1 << FT_SESS_HASH_BITS)

/*
 * Per local port data.
 * This is created only after a TPG exists that allows target function
 * for the local port.  If the TPG exists, this is allocated when
 * we're notified that the local port has been created, or when
 * the first PRLI provider callback is received.
 */
struct ft_tport {
	struct fc_lport *lport;
	struct ft_tpg *tpg;		/* NULL if TPG deleted before tport */
	u32	sess_count;		/* number of sessions in hash */
	struct rcu_head rcu;
	struct hlist_head hash[FT_SESS_HASH_SIZE];	/* list of sessions */
};

/*
 * Node ID and authentication.
 */
struct ft_node_auth {
	u64	port_name;
	u64	node_name;
};

/*
 * Node ACL for FC remote port session.
 */
struct ft_node_acl {
	struct se_node_acl se_node_acl;
	struct ft_node_auth node_auth;
};

struct ft_lun {
	u32 index;
	char name[FT_LUN_NAMELEN];
};

/*
 * Target portal group (local port).
 */
struct ft_tpg {
	u32 index;
	struct ft_lport_wwn *lport_wwn;
	struct ft_tport *tport;		/* active tport or NULL */
	struct list_head lun_list;	/* head of LUNs */
	struct se_portal_group se_tpg;
	struct workqueue_struct *workqueue;
};

struct ft_lport_wwn {
	u64 wwpn;
	char name[FT_NAMELEN];
	struct list_head ft_wwn_node;
	struct ft_tpg *tpg;
	struct se_wwn se_wwn;
};

/*
 * Commands
 */
struct ft_cmd {
	struct ft_sess *sess;		/* session held for cmd */

Annotation

Implementation Notes