include/scsi/fc_frame.h
Source file repositories/reference/linux-study-clean/include/scsi/fc_frame.h
File Facts
- System
- Linux kernel
- Corpus path
include/scsi/fc_frame.h- Extension
.h- Size
- 7199 bytes
- Lines
- 280
- 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/scatterlist.hlinux/skbuff.hscsi/scsi_cmnd.hscsi/fc/fc_fs.hscsi/fc/fc_fcp.hscsi/fc/fc_encaps.hlinux/if_ether.h
Detected Declarations
struct fc_framestruct fcoe_rcv_infofunction Copyrightfunction hton24function fc_frame_initfunction fc_frame_freefunction fc_frame_is_linearfunction FC_IDfunction FC_IDfunction opcodefunction fc_frame_classfunction fc_frame_rctlfunction fc_frame_is_cmdfunction __fc_fill_fc_hdrfunction fc_fill_fc_hdr
Annotated Snippet
struct fc_frame {
struct sk_buff skb;
};
struct fcoe_rcv_info {
struct fc_lport *fr_dev; /* transport layer private pointer */
struct fc_seq *fr_seq; /* for use with exchange manager */
struct fc_fcp_pkt *fr_fsp; /* for the corresponding fcp I/O */
u32 fr_crc;
u16 fr_max_payload; /* max FC payload */
u8 fr_sof; /* start of frame delimiter */
u8 fr_eof; /* end of frame delimiter */
u8 fr_flags; /* flags - see below */
u8 fr_encaps; /* LLD encapsulation info (e.g. FIP) */
u8 granted_mac[ETH_ALEN]; /* FCoE MAC address */
};
/*
* Get fc_frame pointer for an skb that's already been imported.
*/
static inline struct fcoe_rcv_info *fcoe_dev_from_skb(const struct sk_buff *skb)
{
BUILD_BUG_ON(sizeof(struct fcoe_rcv_info) > sizeof(skb->cb));
return (struct fcoe_rcv_info *) skb->cb;
}
/*
* fr_flags.
*/
#define FCPHF_CRC_UNCHECKED 0x01 /* CRC not computed, still appended */
/*
* Initialize a frame.
* We don't do a complete memset here for performance reasons.
* The caller must set fr_free, fr_hdr, fr_len, fr_sof, and fr_eof eventually.
*/
static inline void fc_frame_init(struct fc_frame *fp)
{
fr_dev(fp) = NULL;
fr_seq(fp) = NULL;
fr_flags(fp) = 0;
fr_encaps(fp) = 0;
}
struct fc_frame *fc_frame_alloc_fill(struct fc_lport *, size_t payload_len);
struct fc_frame *_fc_frame_alloc(size_t payload_len);
/*
* Allocate fc_frame structure and buffer. Set the initial length to
* payload_size + sizeof (struct fc_frame_header).
*/
static inline struct fc_frame *fc_frame_alloc(struct fc_lport *dev, size_t len)
{
struct fc_frame *fp;
/*
* Note: Since len will often be a constant multiple of 4,
* this check will usually be evaluated and eliminated at compile time.
*/
if (len && len % 4)
fp = fc_frame_alloc_fill(dev, len);
else
fp = _fc_frame_alloc(len);
return fp;
}
/*
* Free the fc_frame structure and buffer.
*/
static inline void fc_frame_free(struct fc_frame *fp)
{
kfree_skb(fp_skb(fp));
}
static inline int fc_frame_is_linear(struct fc_frame *fp)
{
return !skb_is_nonlinear(fp_skb(fp));
}
/*
* Get frame header from message in fc_frame structure.
* This version doesn't do a length check.
*/
static inline
struct fc_frame_header *__fc_frame_header_get(const struct fc_frame *fp)
{
return (struct fc_frame_header *)fr_hdr(fp);
}
Annotation
- Immediate include surface: `linux/scatterlist.h`, `linux/skbuff.h`, `scsi/scsi_cmnd.h`, `scsi/fc/fc_fs.h`, `scsi/fc/fc_fcp.h`, `scsi/fc/fc_encaps.h`, `linux/if_ether.h`.
- Detected declarations: `struct fc_frame`, `struct fcoe_rcv_info`, `function Copyright`, `function hton24`, `function fc_frame_init`, `function fc_frame_free`, `function fc_frame_is_linear`, `function FC_ID`, `function FC_ID`, `function opcode`.
- 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.