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.

Dependency Surface

Detected Declarations

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

Implementation Notes