drivers/scsi/bnx2fc/bnx2fc.h

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

File Facts

System
Linux kernel
Corpus path
drivers/scsi/bnx2fc/bnx2fc.h
Extension
.h
Size
16879 bytes
Lines
605
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 bnx2fc_percpu_s {
	struct task_struct *iothread;
	struct list_head work_list;
	spinlock_t fp_work_lock;
};

struct bnx2fc_fw_stats {
	u64	fc_crc_cnt;
	u64	fcoe_tx_pkt_cnt;
	u64	fcoe_rx_pkt_cnt;
	u64	fcoe_tx_byte_cnt;
	u64	fcoe_rx_byte_cnt;
};

struct bnx2fc_hba {
	struct list_head list;
	struct cnic_dev *cnic;
	struct pci_dev *pcidev;
	struct net_device *phys_dev;
	unsigned long reg_with_cnic;
		#define BNX2FC_CNIC_REGISTERED           1
	struct bnx2fc_cmd_mgr *cmd_mgr;
	spinlock_t hba_lock;
	struct mutex hba_mutex;
	struct mutex hba_stats_mutex;
	unsigned long adapter_state;
		#define ADAPTER_STATE_UP		0
		#define ADAPTER_STATE_GOING_DOWN	1
		#define ADAPTER_STATE_LINK_DOWN		2
		#define ADAPTER_STATE_READY		3
	unsigned long flags;
		#define BNX2FC_FLAG_FW_INIT_DONE	0
		#define BNX2FC_FLAG_DESTROY_CMPL	1
	u32 next_conn_id;

	/* xid resources */
	u16 max_xid;
	u32 max_tasks;
	u32 max_outstanding_cmds;
	u32 elstm_xids;

	struct fcoe_task_ctx_entry **task_ctx;
	dma_addr_t *task_ctx_dma;
	struct regpair *task_ctx_bd_tbl;
	dma_addr_t task_ctx_bd_dma;

	int hash_tbl_segment_count;
	void **hash_tbl_segments;
	void *hash_tbl_pbl;
	dma_addr_t hash_tbl_pbl_dma;
	struct fcoe_t2_hash_table_entry *t2_hash_tbl;
	dma_addr_t t2_hash_tbl_dma;
	char *t2_hash_tbl_ptr;
	dma_addr_t t2_hash_tbl_ptr_dma;

	char *dummy_buffer;
	dma_addr_t dummy_buf_dma;

	/* Active list of offloaded sessions */
	struct bnx2fc_rport **tgt_ofld_list;

	/* statistics */
	struct bnx2fc_fw_stats bfw_stats;
	struct fcoe_statistics_params prev_stats;
	struct fcoe_statistics_params *stats_buffer;
	dma_addr_t stats_buf_dma;
	struct completion stat_req_done;
	struct fcoe_capabilities fcoe_cap;

	/*destroy handling */
	struct timer_list destroy_timer;
	wait_queue_head_t destroy_wait;

	/* linkdown handling */
	wait_queue_head_t shutdown_wait;
	int wait_for_link_down;
	int num_ofld_sess;
	struct list_head vports;

	char chip_num[BCM_CHIP_LEN];
};

struct bnx2fc_interface {
	struct list_head list;
	unsigned long if_flags;
		#define BNX2FC_CTLR_INIT_DONE		0
	struct bnx2fc_hba *hba;
	struct net_device *netdev;
	struct packet_type fcoe_packet_type;
	struct packet_type fip_packet_type;

Annotation

Implementation Notes