drivers/scsi/fnic/fnic.h
Source file repositories/reference/linux-study-clean/drivers/scsi/fnic/fnic.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/fnic/fnic.h- Extension
.h- Size
- 20634 bytes
- Lines
- 632
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/interrupt.hlinux/netdevice.hlinux/workqueue.hlinux/bitops.hscsi/scsi_cmnd.hscsi/scsi_transport.hscsi/scsi_transport_fc.hscsi/fc_frame.hfnic_io.hfnic_res.hfnic_trace.hfnic_stats.hvnic_dev.hvnic_wq.hvnic_rq.hvnic_cq.hvnic_wq_copy.hvnic_intr.hvnic_stats.hvnic_scsi.hfnic_fdls.h
Detected Declarations
struct fnic_pcie_devicestruct fnic_cmd_privstruct fnic_msix_entrystruct fnic_frame_liststruct fnic_eventstruct fnic_cpy_wqstruct fnicstruct fnic_scsi_iter_dataenum reset_statesenum rscn_typeenum pc_rscn_handling_statusenum pc_rscn_handling_featureenum fnic_intx_intr_indexenum fnic_msix_intr_indexenum fnic_stateenum fnic_role_eenum fnic_evtfunction fnic_flags_and_statefunction fnic_chk_state_flags_lockedfunction fnic_io_iter_handlerfunction fnic_scsi_io_iterfunction fnic_debug_dumpfunction fnic_debug_dump_fc_framefunction fnic_debug_dump
Annotated Snippet
struct fnic_pcie_device {
u32 device;
u8 *desc;
u32 subsystem_device;
u8 *subsys_desc;
};
/*
* fnic private data per SCSI command.
* These fields are locked by the hashed io_req_lock.
*/
struct fnic_cmd_priv {
struct fnic_io_req *io_req;
enum fnic_ioreq_state state;
u32 flags;
u16 abts_status;
u16 lr_status;
};
static inline struct fnic_cmd_priv *fnic_priv(struct scsi_cmnd *cmd)
{
return scsi_cmd_priv(cmd);
}
static inline u64 fnic_flags_and_state(struct scsi_cmnd *cmd)
{
struct fnic_cmd_priv *fcmd = fnic_priv(cmd);
return ((u64)fcmd->flags << 32) | fcmd->state;
}
#define FCPIO_INVALID_CODE 0x100 /* hdr_status value unused by firmware */
#define FNIC_LUN_RESET_TIMEOUT 10000 /* mSec */
#define FNIC_HOST_RESET_TIMEOUT 10000 /* mSec */
#define FNIC_RMDEVICE_TIMEOUT 1000 /* mSec */
#define FNIC_HOST_RESET_SETTLE_TIME 30 /* Sec */
#define FNIC_ABT_TERM_DELAY_TIMEOUT 500 /* mSec */
#define FNIC_MAX_FCP_TARGET 256
#define FNIC_PCI_OFFSET 2
/**
* state_flags to identify host state along along with fnic's state
**/
#define __FNIC_FLAGS_FWRESET BIT(0) /* fwreset in progress */
#define __FNIC_FLAGS_BLOCK_IO BIT(1) /* IOs are blocked */
#define FNIC_FLAGS_NONE (0)
#define FNIC_FLAGS_FWRESET (__FNIC_FLAGS_FWRESET | \
__FNIC_FLAGS_BLOCK_IO)
#define FNIC_FLAGS_IO_BLOCKED (__FNIC_FLAGS_BLOCK_IO)
#define fnic_set_state_flags(fnicp, st_flags) \
__fnic_set_state_flags(fnicp, st_flags, 0)
#define fnic_clear_state_flags(fnicp, st_flags) \
__fnic_set_state_flags(fnicp, st_flags, 1)
enum reset_states {
NOT_IN_PROGRESS = 0,
IN_PROGRESS,
RESET_ERROR
};
enum rscn_type {
NOT_PC_RSCN = 0,
PC_RSCN
};
enum pc_rscn_handling_status {
PC_RSCN_HANDLING_NOT_IN_PROGRESS = 0,
PC_RSCN_HANDLING_IN_PROGRESS
};
enum pc_rscn_handling_feature {
PC_RSCN_HANDLING_FEATURE_OFF = 0,
PC_RSCN_HANDLING_FEATURE_ON
};
extern unsigned int fnic_fdmi_support;
extern unsigned int fnic_log_level;
extern unsigned int io_completions;
extern struct workqueue_struct *fnic_event_queue;
extern unsigned int pc_rscn_handling_feature_flag;
extern spinlock_t reset_fnic_list_lock;
extern struct list_head reset_fnic_list;
extern struct workqueue_struct *reset_fnic_work_queue;
extern struct work_struct reset_fnic_work;
Annotation
- Immediate include surface: `linux/interrupt.h`, `linux/netdevice.h`, `linux/workqueue.h`, `linux/bitops.h`, `scsi/scsi_cmnd.h`, `scsi/scsi_transport.h`, `scsi/scsi_transport_fc.h`, `scsi/fc_frame.h`.
- Detected declarations: `struct fnic_pcie_device`, `struct fnic_cmd_priv`, `struct fnic_msix_entry`, `struct fnic_frame_list`, `struct fnic_event`, `struct fnic_cpy_wq`, `struct fnic`, `struct fnic_scsi_iter_data`, `enum reset_states`, `enum rscn_type`.
- Atlas domain: Driver Families / drivers/scsi.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.