drivers/scsi/snic/snic.h
Source file repositories/reference/linux-study-clean/drivers/scsi/snic/snic.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/snic/snic.h- Extension
.h- Size
- 10983 bytes
- Lines
- 404
- 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/module.hlinux/netdevice.hlinux/workqueue.hlinux/bitops.hlinux/mempool.hscsi/scsi_cmnd.hscsi/scsi.hscsi/scsi_host.hsnic_disc.hsnic_io.hsnic_res.hsnic_trc.hsnic_stats.hvnic_dev.hvnic_wq.hvnic_cq.hvnic_intr.hvnic_stats.hvnic_snic.h
Detected Declarations
struct snic_msix_entrystruct snic_fw_infostruct snic_workstruct snicstruct snic_globalenum snic_intx_intr_indexenum snic_msix_intr_indexenum snic_state
Annotated Snippet
struct snic_msix_entry {
int requested;
char devname[SNIC_INTRHDLR_NAMSZ];
irqreturn_t (*isr)(int, void *);
void *devid;
};
enum snic_state {
SNIC_INIT = 0,
SNIC_ERROR,
SNIC_ONLINE,
SNIC_OFFLINE,
SNIC_FWRESET,
};
#define SNIC_WQ_MAX 1
#define SNIC_CQ_IO_CMPL_MAX 1
#define SNIC_CQ_MAX (SNIC_WQ_MAX + SNIC_CQ_IO_CMPL_MAX)
/* firmware version information */
struct snic_fw_info {
u32 fw_ver;
u32 hid; /* u16 hid | u16 vnic id */
u32 max_concur_ios; /* max concurrent ios */
u32 max_sgs_per_cmd; /* max sgls per IO */
u32 max_io_sz; /* max io size supported */
u32 hba_cap; /* hba capabilities */
u32 max_tgts; /* max tgts supported */
u16 io_tmo; /* FW Extended timeout */
struct completion *wait; /* protected by snic lock*/
};
/*
* snic_work item : defined to process asynchronous events
*/
struct snic_work {
struct work_struct work;
u16 ev_id;
u64 *ev_data;
};
/*
* snic structure to represent SCSI vNIC
*/
struct snic {
/* snic specific members */
struct list_head list;
char name[IFNAMSIZ];
atomic_t state;
spinlock_t snic_lock;
struct completion *remove_wait;
bool in_remove;
bool stop_link_events; /* stop processing link events */
/* discovery related */
struct snic_disc disc;
/* Scsi Host info */
struct Scsi_Host *shost;
/* vnic related structures */
struct vnic_dev_bar bar0;
struct vnic_stats *stats;
unsigned long stats_time;
unsigned long stats_reset_time;
struct vnic_dev *vdev;
/* hw resource info */
unsigned int wq_count;
unsigned int cq_count;
unsigned int intr_count;
unsigned int err_intr_offset;
int link_status; /* retrieved from svnic_dev_link_status() */
u32 link_down_cnt;
/* pci related */
struct pci_dev *pdev;
struct snic_msix_entry msix[SNIC_MSIX_INTR_MAX];
/* io related info */
mempool_t *req_pool[SNIC_REQ_MAX_CACHES]; /* (??) */
____cacheline_aligned spinlock_t io_req_lock[SNIC_IO_LOCKS];
/* Maintain snic specific commands, cmds with no tag in spl_cmd_list */
____cacheline_aligned spinlock_t spl_cmd_lock;
struct list_head spl_cmd_list;
Annotation
- Immediate include surface: `linux/module.h`, `linux/netdevice.h`, `linux/workqueue.h`, `linux/bitops.h`, `linux/mempool.h`, `scsi/scsi_cmnd.h`, `scsi/scsi.h`, `scsi/scsi_host.h`.
- Detected declarations: `struct snic_msix_entry`, `struct snic_fw_info`, `struct snic_work`, `struct snic`, `struct snic_global`, `enum snic_intx_intr_index`, `enum snic_msix_intr_index`, `enum snic_state`.
- 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.