drivers/scsi/fnic/fcpio.h
Source file repositories/reference/linux-study-clean/drivers/scsi/fnic/fcpio.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/fnic/fcpio.h- Extension
.h- Size
- 22249 bytes
- Lines
- 769
- 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/if_ether.h
Detected Declarations
struct fcpio_tagstruct fcpio_headerstruct fcpio_icmnd_16struct fcpio_icmnd_32struct fcpio_itmfstruct fcpio_tdatastruct fcpio_txrdystruct fcpio_trspstruct fcpio_ttmf_ackstruct fcpio_tabortstruct fcpio_resetstruct fcpio_flogi_regstruct fcpio_echostruct fcpio_lunmap_reqstruct fcpio_flogi_fip_regstruct fcpio_host_reqstruct fcpio_icmnd_cmplstruct fcpio_itmf_cmplstruct fcpio_tcmnd_16struct fcpio_tcmnd_32struct fcpio_tdrsp_cmplstruct fcpio_ttmfstruct fcpio_tabort_cmplstruct fcpio_ackstruct fcpio_reset_cmplstruct fcpio_flogi_reg_cmplstruct fcpio_echo_cmplstruct fcpio_lunmap_chngstruct fcpio_lunmap_req_cmplstruct fcpio_fw_reqstruct fcpio_lunmap_entrystruct fcpio_lunmap_tblenum fcpio_typeenum fcpio_statusenum fcpio_itmf_tm_req_typeenum fcpio_flogi_reg_format_typefunction fcpio_tag_id_encfunction fcpio_tag_id_decfunction fcpio_tag_exid_encfunction fcpio_tag_exid_decfunction fcpio_header_encfunction fcpio_header_decfunction fcpio_color_encfunction fcpio_color_dec
Annotated Snippet
struct fcpio_tag {
union {
u32 req_id;
struct {
u16 rx_id;
u16 ox_id;
} ex_id;
} u;
};
static inline void
fcpio_tag_id_enc(struct fcpio_tag *tag, u32 id)
{
tag->u.req_id = id;
}
static inline void
fcpio_tag_id_dec(struct fcpio_tag *tag, u32 *id)
{
*id = tag->u.req_id;
}
static inline void
fcpio_tag_exid_enc(struct fcpio_tag *tag, u16 ox_id, u16 rx_id)
{
tag->u.ex_id.rx_id = rx_id;
tag->u.ex_id.ox_id = ox_id;
}
static inline void
fcpio_tag_exid_dec(struct fcpio_tag *tag, u16 *ox_id, u16 *rx_id)
{
*rx_id = tag->u.ex_id.rx_id;
*ox_id = tag->u.ex_id.ox_id;
}
/*
* The header for an fcpio request, whether from the firmware or from the
* host driver
*/
struct fcpio_header {
u8 type; /* enum fcpio_type */
u8 status; /* header status entry */
u16 _resvd; /* reserved */
struct fcpio_tag tag; /* header tag */
};
static inline void
fcpio_header_enc(struct fcpio_header *hdr,
u8 type, u8 status,
struct fcpio_tag tag)
{
hdr->type = type;
hdr->status = status;
hdr->_resvd = 0;
hdr->tag = tag;
}
static inline void
fcpio_header_dec(struct fcpio_header *hdr,
u8 *type, u8 *status,
struct fcpio_tag *tag)
{
*type = hdr->type;
*status = hdr->status;
*tag = hdr->tag;
}
#define CDB_16 16
#define CDB_32 32
#define LUN_ADDRESS 8
/*
* fcpio_icmnd_16: host -> firmware request
*
* used for sending out an initiator SCSI 16-byte command
*/
struct fcpio_icmnd_16 {
u32 lunmap_id; /* index into lunmap table */
u8 special_req_flags; /* special exchange request flags */
u8 _resvd0[3]; /* reserved */
u32 sgl_cnt; /* scatter-gather list count */
u32 sense_len; /* sense buffer length */
u64 sgl_addr; /* scatter-gather list addr */
u64 sense_addr; /* sense buffer address */
u8 crn; /* SCSI Command Reference No. */
u8 pri_ta; /* SCSI Priority and Task attribute */
u8 _resvd1; /* reserved: should be 0 */
u8 flags; /* command flags */
u8 scsi_cdb[CDB_16]; /* SCSI Cmnd Descriptor Block */
Annotation
- Immediate include surface: `linux/if_ether.h`.
- Detected declarations: `struct fcpio_tag`, `struct fcpio_header`, `struct fcpio_icmnd_16`, `struct fcpio_icmnd_32`, `struct fcpio_itmf`, `struct fcpio_tdata`, `struct fcpio_txrdy`, `struct fcpio_trsp`, `struct fcpio_ttmf_ack`, `struct fcpio_tabort`.
- 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.