Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
bnx2fc.h File Reference
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/kernel.h>
#include <linux/skbuff.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/if_ether.h>
#include <linux/if_vlan.h>
#include <linux/kthread.h>
#include <linux/crc32.h>
#include <linux/cpu.h>
#include <linux/types.h>
#include <linux/list.h>
#include <linux/delay.h>
#include <linux/timer.h>
#include <linux/errno.h>
#include <linux/pci.h>
#include <linux/init.h>
#include <linux/dma-mapping.h>
#include <linux/workqueue.h>
#include <linux/mutex.h>
#include <linux/spinlock.h>
#include <linux/bitops.h>
#include <linux/log2.h>
#include <linux/interrupt.h>
#include <linux/sched.h>
#include <linux/io.h>
#include <scsi/scsi.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_eh.h>
#include <scsi/scsi_tcq.h>
#include <scsi/libfc.h>
#include <scsi/libfcoe.h>
#include <scsi/fc_encode.h>
#include <scsi/scsi_transport.h>
#include <scsi/scsi_transport_fc.h>
#include <scsi/fc/fc_fip.h>
#include <scsi/fc/fc_fc2.h>
#include <scsi/fc_frame.h>
#include <scsi/fc/fc_fcoe.h>
#include <scsi/fc/fc_fcp.h>
#include "57xx_hsi_bnx2fc.h"
#include "../../net/ethernet/broadcom/cnic_if.h"
#include "../../net/ethernet/broadcom/bnx2x/bnx2x_mfw_req.h"
#include "bnx2fc_constants.h"
#include "bnx2fc_debug.h"

Go to the source code of this file.

Data Structures

struct  bnx2fc_percpu_s
 
struct  bnx2fc_hba
 
struct  bnx2fc_interface
 
struct  bnx2fc_lport
 
struct  bnx2fc_cmd_mgr
 
struct  bnx2fc_rport
 
struct  bnx2fc_mp_req
 
struct  bnx2fc_els_cb_arg
 
struct  bnx2fc_cmd
 
struct  io_bdt
 
struct  bnx2fc_work
 
struct  bnx2fc_unsol_els
 

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define BNX2FC_NAME   "bnx2fc"
 
#define BNX2FC_VERSION   "1.0.12"
 
#define PFX   "bnx2fc: "
 
#define BNX2X_DOORBELL_PCI_BAR   2
 
#define BNX2FC_MAX_BD_LEN   0xffff
 
#define BNX2FC_BD_SPLIT_SZ   0x8000
 
#define BNX2FC_MAX_BDS_PER_CMD   256
 
#define BNX2FC_SQ_WQES_MAX   256
 
#define BNX2FC_SCSI_MAX_SQES   ((3 * BNX2FC_SQ_WQES_MAX) / 8)
 
#define BNX2FC_TM_MAX_SQES   ((BNX2FC_SQ_WQES_MAX) / 2)
 
#define BNX2FC_ELS_MAX_SQES   (BNX2FC_TM_MAX_SQES - 1)
 
#define BNX2FC_RQ_WQES_MAX   16
 
#define BNX2FC_CQ_WQES_MAX   (BNX2FC_SQ_WQES_MAX + BNX2FC_RQ_WQES_MAX)
 
#define BNX2FC_NUM_MAX_SESS   1024
 
#define BNX2FC_NUM_MAX_SESS_LOG   (ilog2(BNX2FC_NUM_MAX_SESS))
 
#define BNX2FC_MAX_NPIV   256
 
#define BNX2FC_MAX_OUTSTANDING_CMNDS   2048
 
#define BNX2FC_CAN_QUEUE   BNX2FC_MAX_OUTSTANDING_CMNDS
 
#define BNX2FC_ELSTM_XIDS   BNX2FC_CAN_QUEUE
 
#define BNX2FC_MIN_PAYLOAD   256
 
#define BNX2FC_MAX_PAYLOAD   2048
 
#define BNX2FC_MFS   (BNX2FC_MAX_PAYLOAD + sizeof(struct fc_frame_header))
 
#define BNX2FC_MINI_JUMBO_MTU   2500
 
#define BNX2FC_RQ_BUF_SZ   256
 
#define BNX2FC_RQ_BUF_LOG_SZ   (ilog2(BNX2FC_RQ_BUF_SZ))
 
#define BNX2FC_SQ_WQE_SIZE   (sizeof(struct fcoe_sqe))
 
#define BNX2FC_CQ_WQE_SIZE   (sizeof(struct fcoe_cqe))
 
#define BNX2FC_RQ_WQE_SIZE   (BNX2FC_RQ_BUF_SZ)
 
#define BNX2FC_XFERQ_WQE_SIZE   (sizeof(struct fcoe_xfrqe))
 
#define BNX2FC_CONFQ_WQE_SIZE   (sizeof(struct fcoe_confqe))
 
#define BNX2FC_5771X_DB_PAGE_SIZE   128
 
#define BNX2FC_MAX_TASKS   (BNX2FC_MAX_OUTSTANDING_CMNDS + BNX2FC_ELSTM_XIDS)
 
#define BNX2FC_TASK_SIZE   128
 
#define BNX2FC_TASKS_PER_PAGE   (PAGE_SIZE/BNX2FC_TASK_SIZE)
 
#define BNX2FC_TASK_CTX_ARR_SZ   (BNX2FC_MAX_TASKS/BNX2FC_TASKS_PER_PAGE)
 
#define BNX2FC_MAX_ROWS_IN_HASH_TBL   8
 
#define BNX2FC_HASH_TBL_CHUNK_SIZE   (16 * 1024)
 
#define BNX2FC_MAX_SEQS   255
 
#define BNX2FC_MAX_RETRY_CNT   3
 
#define BNX2FC_MAX_RPORT_RETRY_CNT   255
 
#define BNX2FC_READ   (1 << 1)
 
#define BNX2FC_WRITE   (1 << 0)
 
#define BNX2FC_MIN_XID   0
 
#define BNX2FC_MAX_XID   (BNX2FC_MAX_OUTSTANDING_CMNDS + BNX2FC_ELSTM_XIDS - 1)
 
#define FCOE_MAX_NUM_XIDS   0x2000
 
#define FCOE_MIN_XID   (BNX2FC_MAX_XID + 1)
 
#define FCOE_MAX_XID   (FCOE_MIN_XID + FCOE_MAX_NUM_XIDS - 1)
 
#define FCOE_XIDS_PER_CPU   (FCOE_MIN_XID + (512 * nr_cpu_ids) - 1)
 
#define BNX2FC_MAX_LUN   0xFFFF
 
#define BNX2FC_MAX_FCP_TGT   256
 
#define BNX2FC_MAX_CMD_LEN   16
 
#define BNX2FC_TM_TIMEOUT   60 /* secs */
 
#define BNX2FC_IO_TIMEOUT   20000UL /* msecs */
 
#define BNX2FC_WAIT_CNT   1200
 
#define BNX2FC_FW_TIMEOUT   (3 * HZ)
 
#define PORT_MAX   2
 
#define CMD_SCSI_STATUS(Cmnd)   ((Cmnd)->SCp.Status)
 
#define FC_GOOD   0
 
#define BNX2FC_RNID_HBA   0x7
 
#define SRR_RETRY_COUNT   5
 
#define REC_RETRY_COUNT   1
 
#define BNX2FC_NUM_ERR_BITS   63
 
#define BNX2FC_RELOGIN_WAIT_TIME   200
 
#define BNX2FC_RELOGIN_WAIT_CNT   10
 
#define BNX2FC_CNIC_REGISTERED   1
 
#define ADAPTER_STATE_UP   0
 
#define ADAPTER_STATE_GOING_DOWN   1
 
#define ADAPTER_STATE_LINK_DOWN   2
 
#define ADAPTER_STATE_READY   3
 
#define BNX2FC_FLAG_FW_INIT_DONE   0
 
#define BNX2FC_FLAG_DESTROY_CMPL   1
 
#define BNX2FC_CTLR_INIT_DONE   0
 
#define bnx2fc_from_ctlr(x)   ((struct bnx2fc_interface *)((x) + 1))
 
#define bnx2fc_to_ctlr(x)   ((struct fcoe_ctlr *)(((struct fcoe_ctlr *)(x)) - 1))
 
#define DPM_TRIGER_TYPE   0x40
 
#define BNX2FC_FLAG_SESSION_READY   0x1
 
#define BNX2FC_FLAG_OFFLOADED   0x2
 
#define BNX2FC_FLAG_DISABLED   0x3
 
#define BNX2FC_FLAG_DESTROYED   0x4
 
#define BNX2FC_FLAG_OFLD_REQ_CMPL   0x5
 
#define BNX2FC_FLAG_CTX_ALLOC_FAILURE   0x6
 
#define BNX2FC_FLAG_UPLD_REQ_COMPL   0x7
 
#define BNX2FC_FLAG_EXPL_LOGO   0x8
 
#define BNX2FC_FLAG_DISABLE_FAILED   0x9
 
#define BNX2FC_SCSI_CMD   1
 
#define BNX2FC_TASK_MGMT_CMD   2
 
#define BNX2FC_ABTS   3
 
#define BNX2FC_ELS   4
 
#define BNX2FC_CLEANUP   5
 
#define BNX2FC_SEQ_CLEANUP   6
 
#define BNX2FC_FLAG_ISSUE_RRQ   0x1
 
#define BNX2FC_FLAG_ISSUE_ABTS   0x2
 
#define BNX2FC_FLAG_ABTS_DONE   0x3
 
#define BNX2FC_FLAG_TM_COMPL   0x4
 
#define BNX2FC_FLAG_TM_TIMEOUT   0x5
 
#define BNX2FC_FLAG_IO_CLEANUP   0x6
 
#define BNX2FC_FLAG_RETIRE_OXID   0x7
 
#define BNX2FC_FLAG_EH_ABORT   0x8
 
#define BNX2FC_FLAG_IO_COMPL   0x9
 
#define BNX2FC_FLAG_ELS_DONE   0xa
 
#define BNX2FC_FLAG_ELS_TIMEOUT   0xb
 
#define BNX2FC_FLAG_CMD_LOST   0xc
 
#define BNX2FC_FLAG_SRR_SENT   0xd
 

Functions

struct bnx2fc_cmdbnx2fc_cmd_alloc (struct bnx2fc_rport *tgt)
 
struct bnx2fc_cmdbnx2fc_elstm_alloc (struct bnx2fc_rport *tgt, int type)
 
void bnx2fc_cmd_release (struct kref *ref)
 
int bnx2fc_queuecommand (struct Scsi_Host *host, struct scsi_cmnd *sc_cmd)
 
int bnx2fc_send_fw_fcoe_init_msg (struct bnx2fc_hba *hba)
 
int bnx2fc_send_fw_fcoe_destroy_msg (struct bnx2fc_hba *hba)
 
int bnx2fc_send_session_ofld_req (struct fcoe_port *port, struct bnx2fc_rport *tgt)
 
int bnx2fc_send_session_disable_req (struct fcoe_port *port, struct bnx2fc_rport *tgt)
 
int bnx2fc_send_session_destroy_req (struct bnx2fc_hba *hba, struct bnx2fc_rport *tgt)
 
int bnx2fc_map_doorbell (struct bnx2fc_rport *tgt)
 
void bnx2fc_indicate_kcqe (void *context, struct kcqe *kcq[], u32 num_cqe)
 
int bnx2fc_setup_task_ctx (struct bnx2fc_hba *hba)
 
void bnx2fc_free_task_ctx (struct bnx2fc_hba *hba)
 
int bnx2fc_setup_fw_resc (struct bnx2fc_hba *hba)
 
void bnx2fc_free_fw_resc (struct bnx2fc_hba *hba)
 
struct bnx2fc_cmd_mgrbnx2fc_cmd_mgr_alloc (struct bnx2fc_hba *hba, u16 min_xid, u16 max_xid)
 
void bnx2fc_cmd_mgr_free (struct bnx2fc_cmd_mgr *cmgr)
 
void bnx2fc_get_link_state (struct bnx2fc_hba *hba)
 
charbnx2fc_get_next_rqe (struct bnx2fc_rport *tgt, u8 num_items)
 
void bnx2fc_return_rqe (struct bnx2fc_rport *tgt, u8 num_items)
 
int bnx2fc_get_paged_crc_eof (struct sk_buff *skb, int tlen)
 
int bnx2fc_send_rrq (struct bnx2fc_cmd *aborted_io_req)
 
int bnx2fc_send_adisc (struct bnx2fc_rport *tgt, struct fc_frame *fp)
 
int bnx2fc_send_logo (struct bnx2fc_rport *tgt, struct fc_frame *fp)
 
int bnx2fc_send_rls (struct bnx2fc_rport *tgt, struct fc_frame *fp)
 
int bnx2fc_initiate_cleanup (struct bnx2fc_cmd *io_req)
 
int bnx2fc_initiate_abts (struct bnx2fc_cmd *io_req)
 
void bnx2fc_cmd_timer_set (struct bnx2fc_cmd *io_req, unsigned int timer_msec)
 
int bnx2fc_init_mp_req (struct bnx2fc_cmd *io_req)
 
void bnx2fc_init_cleanup_task (struct bnx2fc_cmd *io_req, struct fcoe_task_ctx_entry *task, u16 orig_xid)
 
void bnx2fc_init_seq_cleanup_task (struct bnx2fc_cmd *seq_clnup_req, struct fcoe_task_ctx_entry *task, struct bnx2fc_cmd *orig_io_req, u32 offset)
 
void bnx2fc_init_mp_task (struct bnx2fc_cmd *io_req, struct fcoe_task_ctx_entry *task)
 
void bnx2fc_init_task (struct bnx2fc_cmd *io_req, struct fcoe_task_ctx_entry *task)
 
void bnx2fc_add_2_sq (struct bnx2fc_rport *tgt, u16 xid)
 
void bnx2fc_ring_doorbell (struct bnx2fc_rport *tgt)
 
int bnx2fc_eh_abort (struct scsi_cmnd *sc_cmd)
 
int bnx2fc_eh_host_reset (struct scsi_cmnd *sc_cmd)
 
int bnx2fc_eh_target_reset (struct scsi_cmnd *sc_cmd)
 
int bnx2fc_eh_device_reset (struct scsi_cmnd *sc_cmd)
 
void bnx2fc_rport_event_handler (struct fc_lport *lport, struct fc_rport_priv *rport, enum fc_rport_event event)
 
void bnx2fc_process_scsi_cmd_compl (struct bnx2fc_cmd *io_req, struct fcoe_task_ctx_entry *task, u8 num_rq)
 
void bnx2fc_process_cleanup_compl (struct bnx2fc_cmd *io_req, struct fcoe_task_ctx_entry *task, u8 num_rq)
 
void bnx2fc_process_abts_compl (struct bnx2fc_cmd *io_req, struct fcoe_task_ctx_entry *task, u8 num_rq)
 
void bnx2fc_process_tm_compl (struct bnx2fc_cmd *io_req, struct fcoe_task_ctx_entry *task, u8 num_rq)
 
void bnx2fc_process_els_compl (struct bnx2fc_cmd *els_req, struct fcoe_task_ctx_entry *task, u8 num_rq)
 
void bnx2fc_build_fcp_cmnd (struct bnx2fc_cmd *io_req, struct fcp_cmnd *fcp_cmnd)
 
void bnx2fc_flush_active_ios (struct bnx2fc_rport *tgt)
 
struct fc_seqbnx2fc_elsct_send (struct fc_lport *lport, u32 did, struct fc_frame *fp, unsigned int op, void(*resp)(struct fc_seq *, struct fc_frame *, void *), void *arg, u32 timeout)
 
void bnx2fc_arm_cq (struct bnx2fc_rport *tgt)
 
int bnx2fc_process_new_cqes (struct bnx2fc_rport *tgt)
 
void bnx2fc_process_cq_compl (struct bnx2fc_rport *tgt, u16 wqe)
 
struct bnx2fc_rportbnx2fc_tgt_lookup (struct fcoe_port *port, u32 port_id)
 
void bnx2fc_process_l2_frame_compl (struct bnx2fc_rport *tgt, unsigned char *buf, u32 frame_len, u16 l2_oxid)
 
int bnx2fc_send_stat_req (struct bnx2fc_hba *hba)
 
int bnx2fc_post_io_req (struct bnx2fc_rport *tgt, struct bnx2fc_cmd *io_req)
 
int bnx2fc_send_rec (struct bnx2fc_cmd *orig_io_req)
 
int bnx2fc_send_srr (struct bnx2fc_cmd *orig_io_req, u32 offset, u8 r_ctl)
 
void bnx2fc_process_seq_cleanup_compl (struct bnx2fc_cmd *seq_clnup_req, struct fcoe_task_ctx_entry *task, u8 rx_state)
 
int bnx2fc_initiate_seq_cleanup (struct bnx2fc_cmd *orig_io_req, u32 offset, enum fc_rctl r_ctl)
 

Variables

struct fcoe_percpu_s bnx2fc_global
 
struct workqueue_structbnx2fc_wq
 

Macro Definition Documentation

#define ADAPTER_STATE_GOING_DOWN   1

Definition at line 182 of file bnx2fc.h.

#define ADAPTER_STATE_LINK_DOWN   2

Definition at line 183 of file bnx2fc.h.

#define ADAPTER_STATE_READY   3

Definition at line 184 of file bnx2fc.h.

#define ADAPTER_STATE_UP   0

Definition at line 181 of file bnx2fc.h.

#define BNX2FC_5771X_DB_PAGE_SIZE   128

Definition at line 109 of file bnx2fc.h.

#define BNX2FC_ABTS   3

Definition at line 393 of file bnx2fc.h.

#define BNX2FC_BD_SPLIT_SZ   0x8000

Definition at line 74 of file bnx2fc.h.

#define BNX2FC_CAN_QUEUE   BNX2FC_MAX_OUTSTANDING_CMNDS

Definition at line 92 of file bnx2fc.h.

#define BNX2FC_CLEANUP   5

Definition at line 395 of file bnx2fc.h.

#define BNX2FC_CNIC_REGISTERED   1

Definition at line 176 of file bnx2fc.h.

#define BNX2FC_CONFQ_WQE_SIZE   (sizeof(struct fcoe_confqe))

Definition at line 108 of file bnx2fc.h.

#define BNX2FC_CQ_WQE_SIZE   (sizeof(struct fcoe_cqe))

Definition at line 105 of file bnx2fc.h.

#define BNX2FC_CQ_WQES_MAX   (BNX2FC_SQ_WQES_MAX + BNX2FC_RQ_WQES_MAX)

Definition at line 84 of file bnx2fc.h.

#define BNX2FC_CTLR_INIT_DONE   0

Definition at line 229 of file bnx2fc.h.

#define BNX2FC_ELS   4

Definition at line 394 of file bnx2fc.h.

#define BNX2FC_ELS_MAX_SQES   (BNX2FC_TM_MAX_SQES - 1)

Definition at line 81 of file bnx2fc.h.

#define BNX2FC_ELSTM_XIDS   BNX2FC_CAN_QUEUE

Definition at line 93 of file bnx2fc.h.

#define BNX2FC_FLAG_ABTS_DONE   0x3

Definition at line 418 of file bnx2fc.h.

#define BNX2FC_FLAG_CMD_LOST   0xc

Definition at line 427 of file bnx2fc.h.

#define BNX2FC_FLAG_CTX_ALLOC_FAILURE   0x6

Definition at line 279 of file bnx2fc.h.

#define BNX2FC_FLAG_DESTROY_CMPL   1

Definition at line 187 of file bnx2fc.h.

#define BNX2FC_FLAG_DESTROYED   0x4

Definition at line 277 of file bnx2fc.h.

#define BNX2FC_FLAG_DISABLE_FAILED   0x9

Definition at line 282 of file bnx2fc.h.

#define BNX2FC_FLAG_DISABLED   0x3

Definition at line 276 of file bnx2fc.h.

#define BNX2FC_FLAG_EH_ABORT   0x8

Definition at line 423 of file bnx2fc.h.

#define BNX2FC_FLAG_ELS_DONE   0xa

Definition at line 425 of file bnx2fc.h.

#define BNX2FC_FLAG_ELS_TIMEOUT   0xb

Definition at line 426 of file bnx2fc.h.

#define BNX2FC_FLAG_EXPL_LOGO   0x8

Definition at line 281 of file bnx2fc.h.

#define BNX2FC_FLAG_FW_INIT_DONE   0

Definition at line 186 of file bnx2fc.h.

#define BNX2FC_FLAG_IO_CLEANUP   0x6

Definition at line 421 of file bnx2fc.h.

#define BNX2FC_FLAG_IO_COMPL   0x9

Definition at line 424 of file bnx2fc.h.

#define BNX2FC_FLAG_ISSUE_ABTS   0x2

Definition at line 417 of file bnx2fc.h.

#define BNX2FC_FLAG_ISSUE_RRQ   0x1

Definition at line 416 of file bnx2fc.h.

#define BNX2FC_FLAG_OFFLOADED   0x2

Definition at line 275 of file bnx2fc.h.

#define BNX2FC_FLAG_OFLD_REQ_CMPL   0x5

Definition at line 278 of file bnx2fc.h.

#define BNX2FC_FLAG_RETIRE_OXID   0x7

Definition at line 422 of file bnx2fc.h.

#define BNX2FC_FLAG_SESSION_READY   0x1

Definition at line 274 of file bnx2fc.h.

#define BNX2FC_FLAG_SRR_SENT   0xd

Definition at line 428 of file bnx2fc.h.

#define BNX2FC_FLAG_TM_COMPL   0x4

Definition at line 419 of file bnx2fc.h.

#define BNX2FC_FLAG_TM_TIMEOUT   0x5

Definition at line 420 of file bnx2fc.h.

#define BNX2FC_FLAG_UPLD_REQ_COMPL   0x7

Definition at line 280 of file bnx2fc.h.

#define bnx2fc_from_ctlr (   x)    ((struct bnx2fc_interface *)((x) + 1))

Definition at line 241 of file bnx2fc.h.

#define BNX2FC_FW_TIMEOUT   (3 * HZ)

Definition at line 142 of file bnx2fc.h.

#define BNX2FC_HASH_TBL_CHUNK_SIZE   (16 * 1024)

Definition at line 118 of file bnx2fc.h.

#define BNX2FC_IO_TIMEOUT   20000UL /* msecs */

Definition at line 139 of file bnx2fc.h.

#define BNX2FC_MAX_BD_LEN   0xffff

Definition at line 73 of file bnx2fc.h.

#define BNX2FC_MAX_BDS_PER_CMD   256

Definition at line 75 of file bnx2fc.h.

#define BNX2FC_MAX_CMD_LEN   16

Definition at line 136 of file bnx2fc.h.

#define BNX2FC_MAX_FCP_TGT   256

Definition at line 135 of file bnx2fc.h.

#define BNX2FC_MAX_LUN   0xFFFF

Definition at line 134 of file bnx2fc.h.

#define BNX2FC_MAX_NPIV   256

Definition at line 89 of file bnx2fc.h.

#define BNX2FC_MAX_OUTSTANDING_CMNDS   2048

Definition at line 91 of file bnx2fc.h.

#define BNX2FC_MAX_PAYLOAD   2048

Definition at line 95 of file bnx2fc.h.

#define BNX2FC_MAX_RETRY_CNT   3

Definition at line 121 of file bnx2fc.h.

#define BNX2FC_MAX_ROWS_IN_HASH_TBL   8

Definition at line 117 of file bnx2fc.h.

#define BNX2FC_MAX_RPORT_RETRY_CNT   255

Definition at line 122 of file bnx2fc.h.

#define BNX2FC_MAX_SEQS   255

Definition at line 120 of file bnx2fc.h.

#define BNX2FC_MAX_TASKS   (BNX2FC_MAX_OUTSTANDING_CMNDS + BNX2FC_ELSTM_XIDS)

Definition at line 111 of file bnx2fc.h.

#define BNX2FC_MAX_XID   (BNX2FC_MAX_OUTSTANDING_CMNDS + BNX2FC_ELSTM_XIDS - 1)

Definition at line 128 of file bnx2fc.h.

#define BNX2FC_MFS   (BNX2FC_MAX_PAYLOAD + sizeof(struct fc_frame_header))

Definition at line 96 of file bnx2fc.h.

#define BNX2FC_MIN_PAYLOAD   256

Definition at line 94 of file bnx2fc.h.

#define BNX2FC_MIN_XID   0

Definition at line 127 of file bnx2fc.h.

#define BNX2FC_MINI_JUMBO_MTU   2500

Definition at line 98 of file bnx2fc.h.

#define BNX2FC_NAME   "bnx2fc"

Definition at line 66 of file bnx2fc.h.

#define BNX2FC_NUM_ERR_BITS   63

Definition at line 154 of file bnx2fc.h.

#define BNX2FC_NUM_MAX_SESS   1024

Definition at line 86 of file bnx2fc.h.

#define BNX2FC_NUM_MAX_SESS_LOG   (ilog2(BNX2FC_NUM_MAX_SESS))

Definition at line 87 of file bnx2fc.h.

#define BNX2FC_READ   (1 << 1)

Definition at line 124 of file bnx2fc.h.

#define BNX2FC_RELOGIN_WAIT_CNT   10

Definition at line 157 of file bnx2fc.h.

#define BNX2FC_RELOGIN_WAIT_TIME   200

Definition at line 156 of file bnx2fc.h.

#define BNX2FC_RNID_HBA   0x7

Definition at line 150 of file bnx2fc.h.

#define BNX2FC_RQ_BUF_LOG_SZ   (ilog2(BNX2FC_RQ_BUF_SZ))

Definition at line 102 of file bnx2fc.h.

#define BNX2FC_RQ_BUF_SZ   256

Definition at line 101 of file bnx2fc.h.

#define BNX2FC_RQ_WQE_SIZE   (BNX2FC_RQ_BUF_SZ)

Definition at line 106 of file bnx2fc.h.

#define BNX2FC_RQ_WQES_MAX   16

Definition at line 83 of file bnx2fc.h.

#define BNX2FC_SCSI_CMD   1

Definition at line 391 of file bnx2fc.h.

#define BNX2FC_SCSI_MAX_SQES   ((3 * BNX2FC_SQ_WQES_MAX) / 8)

Definition at line 79 of file bnx2fc.h.

#define BNX2FC_SEQ_CLEANUP   6

Definition at line 396 of file bnx2fc.h.

#define BNX2FC_SQ_WQE_SIZE   (sizeof(struct fcoe_sqe))

Definition at line 104 of file bnx2fc.h.

#define BNX2FC_SQ_WQES_MAX   256

Definition at line 77 of file bnx2fc.h.

#define BNX2FC_TASK_CTX_ARR_SZ   (BNX2FC_MAX_TASKS/BNX2FC_TASKS_PER_PAGE)

Definition at line 115 of file bnx2fc.h.

#define BNX2FC_TASK_MGMT_CMD   2

Definition at line 392 of file bnx2fc.h.

#define BNX2FC_TASK_SIZE   128

Definition at line 113 of file bnx2fc.h.

#define BNX2FC_TASKS_PER_PAGE   (PAGE_SIZE/BNX2FC_TASK_SIZE)

Definition at line 114 of file bnx2fc.h.

#define BNX2FC_TM_MAX_SQES   ((BNX2FC_SQ_WQES_MAX) / 2)

Definition at line 80 of file bnx2fc.h.

#define BNX2FC_TM_TIMEOUT   60 /* secs */

Definition at line 138 of file bnx2fc.h.

#define bnx2fc_to_ctlr (   x)    ((struct fcoe_ctlr *)(((struct fcoe_ctlr *)(x)) - 1))

Definition at line 244 of file bnx2fc.h.

#define BNX2FC_VERSION   "1.0.12"

Definition at line 67 of file bnx2fc.h.

#define BNX2FC_WAIT_CNT   1200

Definition at line 141 of file bnx2fc.h.

#define BNX2FC_WRITE   (1 << 0)

Definition at line 125 of file bnx2fc.h.

#define BNX2FC_XFERQ_WQE_SIZE   (sizeof(struct fcoe_xfrqe))

Definition at line 107 of file bnx2fc.h.

#define BNX2X_DOORBELL_PCI_BAR   2

Definition at line 71 of file bnx2fc.h.

#define CMD_SCSI_STATUS (   Cmnd)    ((Cmnd)->SCp.Status)

Definition at line 145 of file bnx2fc.h.

#define DPM_TRIGER_TYPE   0x40

Definition at line 266 of file bnx2fc.h.

#define FC_GOOD   0

Definition at line 148 of file bnx2fc.h.

#define FCOE_MAX_NUM_XIDS   0x2000

Definition at line 130 of file bnx2fc.h.

#define FCOE_MAX_XID   (FCOE_MIN_XID + FCOE_MAX_NUM_XIDS - 1)

Definition at line 132 of file bnx2fc.h.

#define FCOE_MIN_XID   (BNX2FC_MAX_XID + 1)

Definition at line 131 of file bnx2fc.h.

#define FCOE_XIDS_PER_CPU   (FCOE_MIN_XID + (512 * nr_cpu_ids) - 1)

Definition at line 133 of file bnx2fc.h.

#define PFX   "bnx2fc: "

Definition at line 69 of file bnx2fc.h.

#define PORT_MAX   2

Definition at line 143 of file bnx2fc.h.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 14 of file bnx2fc.h.

#define REC_RETRY_COUNT   1

Definition at line 153 of file bnx2fc.h.

#define SRR_RETRY_COUNT   5

Definition at line 152 of file bnx2fc.h.

Function Documentation

void bnx2fc_add_2_sq ( struct bnx2fc_rport tgt,
u16  xid 
)

Definition at line 1395 of file bnx2fc_hwi.c.

void bnx2fc_arm_cq ( struct bnx2fc_rport tgt)

Definition at line 982 of file bnx2fc_hwi.c.

void bnx2fc_build_fcp_cmnd ( struct bnx2fc_cmd io_req,
struct fcp_cmnd fcp_cmnd 
)

Definition at line 1698 of file bnx2fc_io.c.

struct bnx2fc_cmd* bnx2fc_cmd_alloc ( struct bnx2fc_rport tgt)
read

Definition at line 492 of file bnx2fc_io.c.

struct bnx2fc_cmd_mgr* bnx2fc_cmd_mgr_alloc ( struct bnx2fc_hba hba,
u16  min_xid,
u16  max_xid 
)
read

Definition at line 242 of file bnx2fc_io.c.

void bnx2fc_cmd_mgr_free ( struct bnx2fc_cmd_mgr cmgr)

Definition at line 364 of file bnx2fc_io.c.

void bnx2fc_cmd_release ( struct kref ref)

Definition at line 547 of file bnx2fc_io.c.

void bnx2fc_cmd_timer_set ( struct bnx2fc_cmd io_req,
unsigned int  timer_msec 
)

Definition at line 27 of file bnx2fc_io.c.

int bnx2fc_eh_abort ( struct scsi_cmnd sc_cmd)

bnx2fc_eh_abort - eh_abort_handler api to abort an outstanding SCSI command

: SCSI_ML command pointer

SCSI abort request handler

Definition at line 1155 of file bnx2fc_io.c.

int bnx2fc_eh_device_reset ( struct scsi_cmnd sc_cmd)

bnx2fc_eh_device_reset - Reset a single LUN

: SCSI command

Set from SCSI host template to send task mgmt command to the target and wait for the response

Definition at line 1100 of file bnx2fc_io.c.

int bnx2fc_eh_host_reset ( struct scsi_cmnd sc_cmd)
int bnx2fc_eh_target_reset ( struct scsi_cmnd sc_cmd)

bnx2fc_eh_target_reset: Reset a target

: SCSI command

Set from SCSI host template to send task mgmt command to the target and wait for the response

Definition at line 1087 of file bnx2fc_io.c.

struct fc_seq* bnx2fc_elsct_send ( struct fc_lport lport,
u32  did,
struct fc_frame fp,
unsigned int  op,
void(*)(struct fc_seq *, struct fc_frame *, void *)  resp,
void arg,
u32  timeout 
)
read

Definition at line 894 of file bnx2fc_els.c.

struct bnx2fc_cmd* bnx2fc_elstm_alloc ( struct bnx2fc_rport tgt,
int  type 
)
read

Definition at line 422 of file bnx2fc_io.c.

void bnx2fc_flush_active_ios ( struct bnx2fc_rport tgt)

Definition at line 150 of file bnx2fc_tgt.c.

void bnx2fc_free_fw_resc ( struct bnx2fc_hba hba)

Definition at line 2162 of file bnx2fc_hwi.c.

void bnx2fc_free_task_ctx ( struct bnx2fc_hba hba)

Definition at line 1947 of file bnx2fc_hwi.c.

void bnx2fc_get_link_state ( struct bnx2fc_hba hba)

bnx2fc_get_link_state - get network link state

: adapter instance pointer

updates adapter structure flag based on netdev state

Definition at line 790 of file bnx2fc_fcoe.c.

char* bnx2fc_get_next_rqe ( struct bnx2fc_rport tgt,
u8  num_items 
)

Definition at line 1445 of file bnx2fc_hwi.c.

int bnx2fc_get_paged_crc_eof ( struct sk_buff skb,
int  tlen 
)

Definition at line 182 of file bnx2fc_fcoe.c.

void bnx2fc_indicate_kcqe ( void context,
struct kcqe kcq[],
u32  num_cqe 
)

bnx2fc_indicae_kcqe - process KCQE

: adapter structure pointer : kcqe pointer : Number of completion queue elements

Generic KCQ event handler

Definition at line 1323 of file bnx2fc_hwi.c.

void bnx2fc_init_cleanup_task ( struct bnx2fc_cmd io_req,
struct fcoe_task_ctx_entry task,
u16  orig_xid 
)

Definition at line 1562 of file bnx2fc_hwi.c.

int bnx2fc_init_mp_req ( struct bnx2fc_cmd io_req)

Definition at line 609 of file bnx2fc_io.c.

void bnx2fc_init_mp_task ( struct bnx2fc_cmd io_req,
struct fcoe_task_ctx_entry task 
)

Definition at line 1600 of file bnx2fc_hwi.c.

void bnx2fc_init_seq_cleanup_task ( struct bnx2fc_cmd seq_clnup_req,
struct fcoe_task_ctx_entry task,
struct bnx2fc_cmd orig_io_req,
u32  offset 
)

Definition at line 1472 of file bnx2fc_hwi.c.

void bnx2fc_init_task ( struct bnx2fc_cmd io_req,
struct fcoe_task_ctx_entry task 
)

Definition at line 1696 of file bnx2fc_hwi.c.

int bnx2fc_initiate_abts ( struct bnx2fc_cmd io_req)

Definition at line 842 of file bnx2fc_io.c.

int bnx2fc_initiate_cleanup ( struct bnx2fc_cmd io_req)

Definition at line 1021 of file bnx2fc_io.c.

int bnx2fc_initiate_seq_cleanup ( struct bnx2fc_cmd orig_io_req,
u32  offset,
enum fc_rctl  r_ctl 
)

Definition at line 951 of file bnx2fc_io.c.

int bnx2fc_map_doorbell ( struct bnx2fc_rport tgt)

Definition at line 1426 of file bnx2fc_hwi.c.

int bnx2fc_post_io_req ( struct bnx2fc_rport tgt,
struct bnx2fc_cmd io_req 
)

Definition at line 1966 of file bnx2fc_io.c.

void bnx2fc_process_abts_compl ( struct bnx2fc_cmd io_req,
struct fcoe_task_ctx_entry task,
u8  num_rq 
)

Definition at line 1344 of file bnx2fc_io.c.

void bnx2fc_process_cleanup_compl ( struct bnx2fc_cmd io_req,
struct fcoe_task_ctx_entry task,
u8  num_rq 
)

Definition at line 1331 of file bnx2fc_io.c.

void bnx2fc_process_cq_compl ( struct bnx2fc_rport tgt,
u16  wqe 
)

Definition at line 871 of file bnx2fc_hwi.c.

void bnx2fc_process_els_compl ( struct bnx2fc_cmd els_req,
struct fcoe_task_ctx_entry task,
u8  num_rq 
)

Definition at line 798 of file bnx2fc_els.c.

void bnx2fc_process_l2_frame_compl ( struct bnx2fc_rport tgt,
unsigned char buf,
u32  frame_len,
u16  l2_oxid 
)

Definition at line 542 of file bnx2fc_hwi.c.

int bnx2fc_process_new_cqes ( struct bnx2fc_rport tgt)

Definition at line 1009 of file bnx2fc_hwi.c.

void bnx2fc_process_scsi_cmd_compl ( struct bnx2fc_cmd io_req,
struct fcoe_task_ctx_entry task,
u8  num_rq 
)

Definition at line 1879 of file bnx2fc_io.c.

void bnx2fc_process_seq_cleanup_compl ( struct bnx2fc_cmd seq_clnup_req,
struct fcoe_task_ctx_entry task,
u8  rx_state 
)

Definition at line 1296 of file bnx2fc_io.c.

void bnx2fc_process_tm_compl ( struct bnx2fc_cmd io_req,
struct fcoe_task_ctx_entry task,
u8  num_rq 
)

Definition at line 1503 of file bnx2fc_io.c.

int bnx2fc_queuecommand ( struct Scsi_Host host,
struct scsi_cmnd sc_cmd 
)

bnx2fc_queuecommand - Queuecommand function of the scsi template

: The Scsi_Host the command was issued to : struct scsi_cmnd to be executed

This is the IO strategy routine, called by SCSI-ML

Definition at line 1828 of file bnx2fc_io.c.

void bnx2fc_return_rqe ( struct bnx2fc_rport tgt,
u8  num_items 
)

Definition at line 1460 of file bnx2fc_hwi.c.

void bnx2fc_ring_doorbell ( struct bnx2fc_rport tgt)

Definition at line 1412 of file bnx2fc_hwi.c.

void bnx2fc_rport_event_handler ( struct fc_lport lport,
struct fc_rport_priv rdata,
enum fc_rport_event  event 
)

This event_callback is called after successful completion of libfc initiated target login. bnx2fc can proceed with initiating the session establishment.

Definition at line 429 of file bnx2fc_tgt.c.

int bnx2fc_send_adisc ( struct bnx2fc_rport tgt,
struct fc_frame fp 
)

Definition at line 173 of file bnx2fc_els.c.

int bnx2fc_send_fw_fcoe_destroy_msg ( struct bnx2fc_hba hba)

Definition at line 140 of file bnx2fc_hwi.c.

int bnx2fc_send_fw_fcoe_init_msg ( struct bnx2fc_hba hba)

bnx2fc_send_fw_fcoe_init_msg - initiates initial handshake with FCoE f/w

: adapter structure pointer

Send down FCoE firmware init KWQEs which initiates the initial handshake with the f/w.

Definition at line 60 of file bnx2fc_hwi.c.

int bnx2fc_send_logo ( struct bnx2fc_rport tgt,
struct fc_frame fp 
)

Definition at line 201 of file bnx2fc_els.c.

int bnx2fc_send_rec ( struct bnx2fc_cmd orig_io_req)

Definition at line 575 of file bnx2fc_els.c.

int bnx2fc_send_rls ( struct bnx2fc_rport tgt,
struct fc_frame fp 
)

Definition at line 229 of file bnx2fc_els.c.

int bnx2fc_send_rrq ( struct bnx2fc_cmd aborted_io_req)

Definition at line 58 of file bnx2fc_els.c.

int bnx2fc_send_session_destroy_req ( struct bnx2fc_hba hba,
struct bnx2fc_rport tgt 
)

bnx2fc_send_session_destroy_req - initiates FCoE Session destroy

: port structure pointer : bnx2fc_rport structure pointer

Definition at line 485 of file bnx2fc_hwi.c.

int bnx2fc_send_session_disable_req ( struct fcoe_port port,
struct bnx2fc_rport tgt 
)

bnx2fc_send_session_disable_req - initiates FCoE Session disable

: port structure pointer : bnx2fc_rport structure pointer

Definition at line 420 of file bnx2fc_hwi.c.

int bnx2fc_send_session_ofld_req ( struct fcoe_port port,
struct bnx2fc_rport tgt 
)

bnx2fc_send_session_ofld_req - initiates FCoE Session offload process

: port structure pointer : bnx2fc_rport structure pointer

Definition at line 165 of file bnx2fc_hwi.c.

int bnx2fc_send_srr ( struct bnx2fc_cmd orig_io_req,
u32  offset,
u8  r_ctl 
)

Definition at line 617 of file bnx2fc_els.c.

int bnx2fc_send_stat_req ( struct bnx2fc_hba hba)

Definition at line 28 of file bnx2fc_hwi.c.

int bnx2fc_setup_fw_resc ( struct bnx2fc_hba hba)

bnx2fc_setup_fw_resc - Allocate and map hash table and dummy buffer

: Pointer to adapter structure

Definition at line 2101 of file bnx2fc_hwi.c.

int bnx2fc_setup_task_ctx ( struct bnx2fc_hba hba)

bnx2fc_setup_task_ctx - allocate and map task context

: pointer to adapter structure

allocate memory for task context, and associated BD table to be used by firmware

Definition at line 1857 of file bnx2fc_hwi.c.

struct bnx2fc_rport* bnx2fc_tgt_lookup ( struct fcoe_port port,
u32  port_id 
)
read

bnx2fc_tgt_lookup() - Lookup a bnx2fc_rport by port_id

: fcoe_port struct to lookup the target port on : The remote port ID to look up

Definition at line 577 of file bnx2fc_tgt.c.

Variable Documentation

struct fcoe_percpu_s bnx2fc_global

Definition at line 50 of file bnx2fc_fcoe.c.

Definition at line 45 of file bnx2fc_fcoe.c.