drivers/scsi/bfa/bfad_drv.h

Source file repositories/reference/linux-study-clean/drivers/scsi/bfa/bfad_drv.h

File Facts

System
Linux kernel
Corpus path
drivers/scsi/bfa/bfad_drv.h
Extension
.h
Size
9086 bytes
Lines
355
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 bfad_msix_s {
	struct bfad_s *bfad;
	struct msix_entry msix;
	char name[32];
};

/*
 * Only append to the enums defined here to avoid any versioning
 * needed between trace utility and driver version
 */
enum {
	BFA_TRC_LDRV_BFAD		= 1,
	BFA_TRC_LDRV_IM			= 2,
	BFA_TRC_LDRV_BSG		= 3,
};

enum bfad_port_pvb_type {
	BFAD_PORT_PHYS_BASE = 0,
	BFAD_PORT_PHYS_VPORT = 1,
	BFAD_PORT_VF_BASE = 2,
	BFAD_PORT_VF_VPORT = 3,
};

/*
 * PORT data structure
 */
struct bfad_port_s {
	struct list_head list_entry;
	struct bfad_s	*bfad;
	struct bfa_fcs_lport_s *fcs_port;
	u32	roles;
	s32		flags;
	u32	supported_fc4s;
	enum bfad_port_pvb_type pvb_type;
	struct bfad_im_port_s *im_port;	/* IM specific data */
	/* port debugfs specific data */
	struct dentry *port_debugfs_root;
};

/*
 * VPORT data structure
 */
struct bfad_vport_s {
	struct bfad_port_s     drv_port;
	struct bfa_fcs_vport_s fcs_vport;
	struct completion *comp_del;
	struct list_head list_entry;
};

/*
 * VF data structure
 */
struct bfad_vf_s {
	bfa_fcs_vf_t    fcs_vf;
	struct bfad_port_s    base_port;	/* base port for vf */
	struct bfad_s   *bfad;
};

struct bfad_cfg_param_s {
	u32	rport_del_timeout;
	u32	ioc_queue_depth;
	u32	lun_queue_depth;
	u32	io_max_sge;
	u32	binding_method;
};

union bfad_tmp_buf {
	/* From struct bfa_adapter_attr_s */
	char		manufacturer[BFA_ADAPTER_MFG_NAME_LEN];
	char		serial_num[BFA_ADAPTER_SERIAL_NUM_LEN];
	char		model[BFA_ADAPTER_MODEL_NAME_LEN];
	char		fw_ver[BFA_VERSION_LEN];
	char		optrom_ver[BFA_VERSION_LEN];

	/* From struct bfa_ioc_pci_attr_s */
	u8		chip_rev[BFA_IOC_CHIP_REV_LEN];  /*  chip revision */

	wwn_t		wwn[BFA_FCS_MAX_LPORTS];
};

/* BFAD state machine events */
enum bfad_sm_event {
	BFAD_E_CREATE			= 1,
	BFAD_E_KTHREAD_CREATE_FAILED	= 2,
	BFAD_E_INIT			= 3,
	BFAD_E_INIT_SUCCESS		= 4,
	BFAD_E_HAL_INIT_FAILED		= 5,
	BFAD_E_INIT_FAILED		= 6,
	BFAD_E_FCS_EXIT_COMP		= 7,
	BFAD_E_EXIT_COMP		= 8,

Annotation

Implementation Notes