drivers/scsi/snic/snic_fwint.h
Source file repositories/reference/linux-study-clean/drivers/scsi/snic/snic_fwint.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/snic/snic_fwint.h- Extension
.h- Size
- 13659 bytes
- Lines
- 514
- 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
- No C-style include directives detected by the generator.
Detected Declarations
struct snic_io_hdrstruct snic_exch_ver_reqstruct snic_exch_ver_rspstruct snic_report_tgtsstruct snic_tgt_idstruct snic_report_tgts_cmplstruct snic_icmndstruct snic_icmnd_cmplstruct snic_itmfstruct snic_itmf_cmplstruct snic_hba_resetstruct snic_hba_reset_cmplstruct snic_notify_msgstruct snic_async_evnotifystruct snic_host_reqstruct snic_fw_reqenum snic_io_typeenum snic_io_statusenum snic_typeenum snic_tgt_typeenum snic_itmf_tm_typeenum snic_ev_typefunction snic_io_hdr_encfunction snic_io_hdr_decfunction snic_color_encfunction snic_color_dec
Annotated Snippet
struct snic_io_hdr {
__le32 hid;
__le32 cmnd_id; /* tag here */
ulong init_ctx; /* initiator context */
u8 type; /* request/response type */
u8 status; /* header status entry */
u8 protocol; /* Protocol specific, may needed for RoCE*/
u8 flags;
__le16 sg_cnt;
u16 resvd;
};
/* auxillary funciton for encoding the snic_io_hdr */
static inline void
snic_io_hdr_enc(struct snic_io_hdr *hdr, u8 typ, u8 status, u32 id, u32 hid,
u16 sg_cnt, ulong ctx)
{
hdr->type = typ;
hdr->status = status;
hdr->protocol = 0;
hdr->hid = cpu_to_le32(hid);
hdr->cmnd_id = cpu_to_le32(id);
hdr->sg_cnt = cpu_to_le16(sg_cnt);
hdr->init_ctx = ctx;
hdr->flags = 0;
}
/* auxillary funciton for decoding the snic_io_hdr */
static inline void
snic_io_hdr_dec(struct snic_io_hdr *hdr, u8 *typ, u8 *stat, u32 *cmnd_id,
u32 *hid, ulong *ctx)
{
*typ = hdr->type;
*stat = hdr->status;
*hid = le32_to_cpu(hdr->hid);
*cmnd_id = le32_to_cpu(hdr->cmnd_id);
*ctx = hdr->init_ctx;
}
/*
* snic_host_info: host -> firmware
*
* Used for sending host information to firmware, and request fw version
*/
struct snic_exch_ver_req {
__le32 drvr_ver; /* for debugging, when fw dump captured */
__le32 os_type; /* for OS specific features */
};
/*
* os_type flags
* Bit 0-7 : OS information
* Bit 8-31: Feature/Capability Information
*/
#define SNIC_OS_LINUX 0x1
#define SNIC_OS_WIN 0x2
#define SNIC_OS_ESX 0x3
/*
* HBA Capabilities
* Bit 1: Reserved.
* Bit 2: Dynamic Discovery of LUNs.
* Bit 3: Async event notifications on tgt online/offline events.
* Bit 4: IO timeout support in FW.
* Bit 5-31: Reserved.
*/
#define SNIC_HBA_CAP_DDL 0x02 /* Supports Dynamic Discovery of LUNs */
#define SNIC_HBA_CAP_AEN 0x04 /* Supports Async Event Noitifcation */
#define SNIC_HBA_CAP_TMO 0x08 /* Supports IO timeout in FW */
/*
* snic_exch_ver_rsp : firmware -> host
*
* Used by firmware to send response to version request
*/
struct snic_exch_ver_rsp {
__le32 version;
__le32 hid;
__le32 max_concur_ios; /* max concurrent ios */
__le32 max_sgs_per_cmd; /* max sgls per IO */
__le32 max_io_sz; /* max io size supported */
__le32 hba_cap; /* hba capabilities */
__le32 max_tgts; /* max tgts supported */
__le16 io_timeout; /* FW extended timeout */
u16 rsvd;
};
/*
* snic_report_tgts : host -> firmware request
Annotation
- Detected declarations: `struct snic_io_hdr`, `struct snic_exch_ver_req`, `struct snic_exch_ver_rsp`, `struct snic_report_tgts`, `struct snic_tgt_id`, `struct snic_report_tgts_cmpl`, `struct snic_icmnd`, `struct snic_icmnd_cmpl`, `struct snic_itmf`, `struct snic_itmf_cmpl`.
- 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.