Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
bnx2i.h File Reference
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/errno.h>
#include <linux/pci.h>
#include <linux/spinlock.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/sched.h>
#include <linux/in.h>
#include <linux/kfifo.h>
#include <linux/netdevice.h>
#include <linux/completion.h>
#include <linux/kthread.h>
#include <linux/cpu.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_eh.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi.h>
#include <scsi/iscsi_proto.h>
#include <scsi/libiscsi.h>
#include <scsi/scsi_transport_iscsi.h>
#include "../../net/ethernet/broadcom/cnic_if.h"
#include "57xx_iscsi_hsi.h"
#include "57xx_iscsi_constants.h"
#include "../../net/ethernet/broadcom/bnx2x/bnx2x_mfw_req.h"

Go to the source code of this file.

Data Structures

struct  generic_pdu_resc
 
struct  bd_resc_page
 
struct  io_bdt
 
struct  bnx2i_cmd
 
struct  bnx2i_conn
 
struct  iscsi_cid_queue
 
struct  bnx2i_stats_info
 
struct  bnx2i_hba
 
struct  sqe
 
struct  rqe
 
struct  cqe
 
struct  bnx2x_iscsi_cq_pend_cmpl
 
struct  bnx2i_5771x_cq_db
 
struct  bnx2i_5771x_sq_rq_db
 
struct  bnx2i_5771x_dbell_hdr
 
struct  bnx2i_5771x_dbell
 
struct  qp_info
 
struct  ep_handles
 
struct  bnx2i_endpoint
 
struct  bnx2i_work
 
struct  bnx2i_percpu_s
 

Macros

#define BNX2_ISCSI_DRIVER_NAME   "bnx2i"
 
#define BNX2I_MAX_ADAPTERS   8
 
#define ISCSI_MAX_CONNS_PER_HBA   128
 
#define ISCSI_MAX_SESS_PER_HBA   ISCSI_MAX_CONNS_PER_HBA
 
#define ISCSI_MAX_CMDS_PER_SESS   128
 
#define ISCSI_MAX_CMDS_PER_HBA_5708   (28 * (ISCSI_MAX_CMDS_PER_SESS - 1))
 
#define ISCSI_MAX_CMDS_PER_HBA_5709   (128 * (ISCSI_MAX_CMDS_PER_SESS - 1))
 
#define ISCSI_MAX_CMDS_PER_HBA_57710   (256 * (ISCSI_MAX_CMDS_PER_SESS - 1))
 
#define ISCSI_MAX_BDS_PER_CMD   32
 
#define MAX_PAGES_PER_CTRL_STRUCT_POOL   8
 
#define BNX2I_RESERVED_SLOW_PATH_CMD_SLOTS   4
 
#define BNX2I_5771X_DBELL_PAGE_SIZE   128
 
#define MAX_BD_LENGTH   65535
 
#define BD_SPLIT_SIZE   32768
 
#define BNX2I_SQ_WQES_MIN   16
 
#define BNX2I_570X_SQ_WQES_MAX   128
 
#define BNX2I_5770X_SQ_WQES_MAX   512
 
#define BNX2I_570X_SQ_WQES_DEFAULT   128
 
#define BNX2I_5770X_SQ_WQES_DEFAULT   128
 
#define BNX2I_570X_CQ_WQES_MAX   128
 
#define BNX2I_5770X_CQ_WQES_MAX   512
 
#define BNX2I_RQ_WQES_MIN   16
 
#define BNX2I_RQ_WQES_MAX   32
 
#define BNX2I_RQ_WQES_DEFAULT   16
 
#define BNX2I_CCELLS_MIN   16
 
#define BNX2I_CCELLS_MAX   96
 
#define BNX2I_CCELLS_DEFAULT   64
 
#define ITT_INVALID_SIGNATURE   0xFFFF
 
#define ISCSI_CMD_CLEANUP_TIMEOUT   100
 
#define BNX2I_CONN_CTX_BUF_SIZE   16384
 
#define BNX2I_SQ_WQE_SIZE   64
 
#define BNX2I_RQ_WQE_SIZE   256
 
#define BNX2I_CQE_SIZE   64
 
#define MB_KERNEL_CTX_SHIFT   8
 
#define MB_KERNEL_CTX_SIZE   (1 << MB_KERNEL_CTX_SHIFT)
 
#define CTX_SHIFT   7
 
#define GET_CID_NUM(cid_addr)   ((cid_addr) >> CTX_SHIFT)
 
#define CTX_OFFSET   0x10000
 
#define MAX_CID_CNT   0x4000
 
#define BNX2I_570X_PAGE_SIZE_DEFAULT   4096
 
#define BNX2_MQ_CONFIG2   0x00003d00
 
#define BNX2_MQ_CONFIG2_CONT_SZ   (0x7L<<4)
 
#define BNX2_MQ_CONFIG2_FIRST_L4L5   (0x1fL<<8)
 
#define BNX2X_DOORBELL_PCI_BAR   2
 
#define BNX2X_MAX_CQS   8
 
#define CNIC_ARM_CQE   1
 
#define CNIC_ARM_CQE_FP   2
 
#define CNIC_DISARM_CQE   0
 
#define REG_RD(__hba, offset)   readl(__hba->regview + offset)
 
#define REG_WR(__hba, offset, val)   writel(val, __hba->regview + offset)
 
#define GET_STATS_64(__hba, dst, field)
 
#define ADD_STATS_64(__hba, field, len)
 
#define BNX2I_CID_RESERVED   0x5AFF
 
#define BNX2I_NX2_DEV_5706   0x0
 
#define BNX2I_NX2_DEV_5708   0x1
 
#define BNX2I_NX2_DEV_5709   0x2
 
#define BNX2I_NX2_DEV_57710   0x3
 
#define BNX2I_MQ_KERNEL_MODE   0x0
 
#define BNX2I_MQ_KERNEL_BYPASS_MODE   0x1
 
#define BNX2I_MQ_BIN_MODE   0x2
 
#define BNX2I_CNIC_REGISTERED   1
 
#define ADAPTER_STATE_UP   0
 
#define ADAPTER_STATE_GOING_DOWN   1
 
#define ADAPTER_STATE_LINK_DOWN   2
 
#define ADAPTER_STATE_INIT_FAILED   31
 
#define BNX2I_MAX_MTU_SUPPORTED   9000
 
#define B577XX_DOORBELL_HDR_RX   (0x1<<0)
 
#define B577XX_DOORBELL_HDR_RX_SHIFT   0
 
#define B577XX_DOORBELL_HDR_DB_TYPE   (0x1<<1)
 
#define B577XX_DOORBELL_HDR_DB_TYPE_SHIFT   1
 
#define B577XX_DOORBELL_HDR_DPM_SIZE   (0x3<<2)
 
#define B577XX_DOORBELL_HDR_DPM_SIZE_SHIFT   2
 
#define B577XX_DOORBELL_HDR_CONN_TYPE   (0xF<<4)
 
#define B577XX_DOORBELL_HDR_CONN_TYPE_SHIFT   4
 
#define DPM_TRIGER_TYPE   0x40
 
#define BNX2I_570x_QUE_DB_SIZE   0
 
#define BNX2I_5771x_QUE_DB_SIZE   16
 
#define ep_iscsi_cid   ids.drv_iscsi_cid
 
#define ep_cid   ids.fw_cid
 
#define ep_pg_cid   ids.pg_cid
 

Enumerations

enum  
 
enum  {
  EP_STATE_IDLE = 0x0, EP_STATE_PG_OFLD_START = 0x1, EP_STATE_PG_OFLD_COMPL = 0x2, EP_STATE_OFLD_START = 0x4,
  EP_STATE_OFLD_COMPL = 0x8, EP_STATE_CONNECT_START = 0x10, EP_STATE_CONNECT_COMPL = 0x20, EP_STATE_ULP_UPDATE_START = 0x40,
  EP_STATE_ULP_UPDATE_COMPL = 0x80, EP_STATE_DISCONN_START = 0x100, EP_STATE_DISCONN_COMPL = 0x200, EP_STATE_CLEANUP_START = 0x400,
  EP_STATE_CLEANUP_CMPL = 0x800, EP_STATE_TCP_FIN_RCVD = 0x1000, EP_STATE_TCP_RST_RCVD = 0x2000, EP_STATE_LOGOUT_SENT = 0x4000,
  EP_STATE_LOGOUT_RESP_RCVD = 0x8000, EP_STATE_PG_OFLD_FAILED = 0x1000000, EP_STATE_ULP_UPDATE_FAILED = 0x2000000, EP_STATE_CLEANUP_FAILED = 0x4000000,
  EP_STATE_OFLD_FAILED = 0x8000000, EP_STATE_CONNECT_FAILED = 0x10000000, EP_STATE_DISCONN_TIMEDOUT = 0x20000000, EP_STATE_OFLD_FAILED_CID_BUSY = 0x80000000
}
 

Functions

void bnx2i_identify_device (struct bnx2i_hba *hba)
 
void bnx2i_ulp_init (struct cnic_dev *dev)
 
void bnx2i_ulp_exit (struct cnic_dev *dev)
 
void bnx2i_start (void *handle)
 
void bnx2i_stop (void *handle)
 
int bnx2i_get_stats (void *handle)
 
struct bnx2i_hbaget_adapter_list_head (void)
 
struct bnx2i_connbnx2i_get_conn_from_id (struct bnx2i_hba *hba, u16 iscsi_cid)
 
int bnx2i_alloc_ep_pool (void)
 
void bnx2i_release_ep_pool (void)
 
struct bnx2i_endpointbnx2i_ep_ofld_list_next (struct bnx2i_hba *hba)
 
struct bnx2i_endpointbnx2i_ep_destroy_list_next (struct bnx2i_hba *hba)
 
struct bnx2i_hbabnx2i_find_hba_for_cnic (struct cnic_dev *cnic)
 
struct bnx2i_hbabnx2i_alloc_hba (struct cnic_dev *cnic)
 
void bnx2i_free_hba (struct bnx2i_hba *hba)
 
void bnx2i_get_rq_buf (struct bnx2i_conn *conn, char *ptr, int len)
 
void bnx2i_put_rq_buf (struct bnx2i_conn *conn, int count)
 
void bnx2i_iscsi_unmap_sg_list (struct bnx2i_cmd *cmd)
 
void bnx2i_drop_session (struct iscsi_cls_session *session)
 
int bnx2i_send_fw_iscsi_init_msg (struct bnx2i_hba *hba)
 
int bnx2i_send_iscsi_login (struct bnx2i_conn *conn, struct iscsi_task *mtask)
 
int bnx2i_send_iscsi_tmf (struct bnx2i_conn *conn, struct iscsi_task *mtask)
 
int bnx2i_send_iscsi_text (struct bnx2i_conn *conn, struct iscsi_task *mtask)
 
int bnx2i_send_iscsi_scsicmd (struct bnx2i_conn *conn, struct bnx2i_cmd *cmnd)
 
int bnx2i_send_iscsi_nopout (struct bnx2i_conn *conn, struct iscsi_task *mtask, char *datap, int data_len, int unsol)
 
int bnx2i_send_iscsi_logout (struct bnx2i_conn *conn, struct iscsi_task *mtask)
 
void bnx2i_send_cmd_cleanup_req (struct bnx2i_hba *hba, struct bnx2i_cmd *cmd)
 
int bnx2i_send_conn_ofld_req (struct bnx2i_hba *hba, struct bnx2i_endpoint *ep)
 
void bnx2i_update_iscsi_conn (struct iscsi_conn *conn)
 
int bnx2i_send_conn_destroy (struct bnx2i_hba *hba, struct bnx2i_endpoint *ep)
 
int bnx2i_alloc_qp_resc (struct bnx2i_hba *hba, struct bnx2i_endpoint *ep)
 
void bnx2i_free_qp_resc (struct bnx2i_hba *hba, struct bnx2i_endpoint *ep)
 
void bnx2i_ep_ofld_timer (unsigned long data)
 
struct bnx2i_endpointbnx2i_find_ep_in_ofld_list (struct bnx2i_hba *hba, u32 iscsi_cid)
 
struct bnx2i_endpointbnx2i_find_ep_in_destroy_list (struct bnx2i_hba *hba, u32 iscsi_cid)
 
int bnx2i_map_ep_dbell_regs (struct bnx2i_endpoint *ep)
 
int bnx2i_arm_cq_event_coalescing (struct bnx2i_endpoint *ep, u8 action)
 
int bnx2i_hw_ep_disconnect (struct bnx2i_endpoint *bnx2i_ep)
 
void bnx2i_print_pend_cmd_queue (struct bnx2i_conn *conn)
 
void bnx2i_print_active_cmd_queue (struct bnx2i_conn *conn)
 
void bnx2i_print_xmit_pdu_queue (struct bnx2i_conn *conn)
 
void bnx2i_print_recv_state (struct bnx2i_conn *conn)
 
int bnx2i_percpu_io_thread (void *arg)
 
int bnx2i_process_scsi_cmd_resp (struct iscsi_session *session, struct bnx2i_conn *bnx2i_conn, struct cqe *cqe)
 

Variables

unsigned int error_mask1
 
unsigned int error_mask2
 
u64 iscsi_error_mask
 
unsigned int en_tcp_dack
 
unsigned int event_coal_div
 
unsigned int event_coal_min
 
struct scsi_transport_templatebnx2i_scsi_xport_template
 
struct iscsi_transport bnx2i_iscsi_transport
 
struct cnic_ulp_ops bnx2i_cnic_cb
 
unsigned int sq_size
 
unsigned int rq_size
 
struct device_attributebnx2i_dev_attributes []
 

Macro Definition Documentation

#define ADAPTER_STATE_GOING_DOWN   1

Definition at line 420 of file bnx2i.h.

#define ADAPTER_STATE_INIT_FAILED   31

Definition at line 422 of file bnx2i.h.

#define ADAPTER_STATE_LINK_DOWN   2

Definition at line 421 of file bnx2i.h.

#define ADAPTER_STATE_UP   0

Definition at line 419 of file bnx2i.h.

#define ADD_STATS_64 (   __hba,
  field,
  len 
)
Value:
do { \
__hba->bnx2i_stats.field += len; \
} while (0)

Definition at line 163 of file bnx2i.h.

#define B577XX_DOORBELL_HDR_CONN_TYPE   (0xF<<4)

Definition at line 563 of file bnx2i.h.

#define B577XX_DOORBELL_HDR_CONN_TYPE_SHIFT   4

Definition at line 564 of file bnx2i.h.

#define B577XX_DOORBELL_HDR_DB_TYPE   (0x1<<1)

Definition at line 557 of file bnx2i.h.

#define B577XX_DOORBELL_HDR_DB_TYPE_SHIFT   1

Definition at line 558 of file bnx2i.h.

#define B577XX_DOORBELL_HDR_DPM_SIZE   (0x3<<2)

Definition at line 560 of file bnx2i.h.

#define B577XX_DOORBELL_HDR_DPM_SIZE_SHIFT   2

Definition at line 561 of file bnx2i.h.

#define B577XX_DOORBELL_HDR_RX   (0x1<<0)

Definition at line 554 of file bnx2i.h.

#define B577XX_DOORBELL_HDR_RX_SHIFT   0

Definition at line 555 of file bnx2i.h.

#define BD_SPLIT_SIZE   32768

Definition at line 71 of file bnx2i.h.

#define BNX2_ISCSI_DRIVER_NAME   "bnx2i"

Definition at line 49 of file bnx2i.h.

#define BNX2_MQ_CONFIG2   0x00003d00

Definition at line 114 of file bnx2i.h.

#define BNX2_MQ_CONFIG2_CONT_SZ   (0x7L<<4)

Definition at line 115 of file bnx2i.h.

#define BNX2_MQ_CONFIG2_FIRST_L4L5   (0x1fL<<8)

Definition at line 116 of file bnx2i.h.

#define BNX2I_570X_CQ_WQES_MAX   128

Definition at line 80 of file bnx2i.h.

#define BNX2I_570X_PAGE_SIZE_DEFAULT   4096

Definition at line 111 of file bnx2i.h.

#define BNX2I_570x_QUE_DB_SIZE   0

Definition at line 630 of file bnx2i.h.

#define BNX2I_570X_SQ_WQES_DEFAULT   128

Definition at line 77 of file bnx2i.h.

#define BNX2I_570X_SQ_WQES_MAX   128

Definition at line 75 of file bnx2i.h.

#define BNX2I_5770X_CQ_WQES_MAX   512

Definition at line 81 of file bnx2i.h.

#define BNX2I_5770X_SQ_WQES_DEFAULT   128

Definition at line 78 of file bnx2i.h.

#define BNX2I_5770X_SQ_WQES_MAX   512

Definition at line 76 of file bnx2i.h.

#define BNX2I_5771X_DBELL_PAGE_SIZE   128

Definition at line 67 of file bnx2i.h.

#define BNX2I_5771x_QUE_DB_SIZE   16

Definition at line 631 of file bnx2i.h.

#define BNX2I_CCELLS_DEFAULT   64

Definition at line 90 of file bnx2i.h.

#define BNX2I_CCELLS_MAX   96

Definition at line 89 of file bnx2i.h.

#define BNX2I_CCELLS_MIN   16

Definition at line 88 of file bnx2i.h.

#define BNX2I_CID_RESERVED   0x5AFF

Definition at line 287 of file bnx2i.h.

#define BNX2I_CNIC_REGISTERED   1

Definition at line 416 of file bnx2i.h.

#define BNX2I_CONN_CTX_BUF_SIZE   16384

Definition at line 96 of file bnx2i.h.

#define BNX2I_CQE_SIZE   64

Definition at line 100 of file bnx2i.h.

#define BNX2I_MAX_ADAPTERS   8

Definition at line 51 of file bnx2i.h.

#define BNX2I_MAX_MTU_SUPPORTED   9000

Definition at line 424 of file bnx2i.h.

#define BNX2I_MQ_BIN_MODE   0x2

Definition at line 414 of file bnx2i.h.

#define BNX2I_MQ_KERNEL_BYPASS_MODE   0x1

Definition at line 413 of file bnx2i.h.

#define BNX2I_MQ_KERNEL_MODE   0x0

Definition at line 412 of file bnx2i.h.

#define BNX2I_NX2_DEV_5706   0x0

Definition at line 407 of file bnx2i.h.

#define BNX2I_NX2_DEV_5708   0x1

Definition at line 408 of file bnx2i.h.

#define BNX2I_NX2_DEV_5709   0x2

Definition at line 409 of file bnx2i.h.

#define BNX2I_NX2_DEV_57710   0x3

Definition at line 410 of file bnx2i.h.

#define BNX2I_RESERVED_SLOW_PATH_CMD_SLOTS   4

Definition at line 65 of file bnx2i.h.

#define BNX2I_RQ_WQE_SIZE   256

Definition at line 99 of file bnx2i.h.

#define BNX2I_RQ_WQES_DEFAULT   16

Definition at line 85 of file bnx2i.h.

#define BNX2I_RQ_WQES_MAX   32

Definition at line 84 of file bnx2i.h.

#define BNX2I_RQ_WQES_MIN   16

Definition at line 83 of file bnx2i.h.

#define BNX2I_SQ_WQE_SIZE   64

Definition at line 98 of file bnx2i.h.

#define BNX2I_SQ_WQES_MIN   16

Definition at line 74 of file bnx2i.h.

#define BNX2X_DOORBELL_PCI_BAR   2

Definition at line 119 of file bnx2i.h.

#define BNX2X_MAX_CQS   8

Definition at line 120 of file bnx2i.h.

#define CNIC_ARM_CQE   1

Definition at line 122 of file bnx2i.h.

#define CNIC_ARM_CQE_FP   2

Definition at line 123 of file bnx2i.h.

#define CNIC_DISARM_CQE   0

Definition at line 124 of file bnx2i.h.

#define CTX_OFFSET   0x10000

Definition at line 108 of file bnx2i.h.

#define CTX_SHIFT   7

Definition at line 105 of file bnx2i.h.

#define DPM_TRIGER_TYPE   0x40

Definition at line 628 of file bnx2i.h.

#define ep_cid   ids.fw_cid

Definition at line 761 of file bnx2i.h.

#define ep_iscsi_cid   ids.drv_iscsi_cid

Definition at line 760 of file bnx2i.h.

#define ep_pg_cid   ids.pg_cid

Definition at line 762 of file bnx2i.h.

#define GET_CID_NUM (   cid_addr)    ((cid_addr) >> CTX_SHIFT)

Definition at line 106 of file bnx2i.h.

#define GET_STATS_64 (   __hba,
  dst,
  field 
)
Value:
do { \
u64 val, *out; \
\
val = __hba->bnx2i_stats.field; \
out = (u64 *)&__hba->stats.field##_lo; \
*out = cpu_to_le64(val); \
out = (u64 *)&dst->field##_lo; \
*out = cpu_to_le64(val); \
} while (0)

Definition at line 152 of file bnx2i.h.

#define ISCSI_CMD_CLEANUP_TIMEOUT   100

Definition at line 94 of file bnx2i.h.

#define ISCSI_MAX_BDS_PER_CMD   32

Definition at line 62 of file bnx2i.h.

#define ISCSI_MAX_CMDS_PER_HBA_5708   (28 * (ISCSI_MAX_CMDS_PER_SESS - 1))

Definition at line 58 of file bnx2i.h.

#define ISCSI_MAX_CMDS_PER_HBA_5709   (128 * (ISCSI_MAX_CMDS_PER_SESS - 1))

Definition at line 59 of file bnx2i.h.

#define ISCSI_MAX_CMDS_PER_HBA_57710   (256 * (ISCSI_MAX_CMDS_PER_SESS - 1))

Definition at line 60 of file bnx2i.h.

#define ISCSI_MAX_CMDS_PER_SESS   128

Definition at line 55 of file bnx2i.h.

#define ISCSI_MAX_CONNS_PER_HBA   128

Definition at line 53 of file bnx2i.h.

#define ISCSI_MAX_SESS_PER_HBA   ISCSI_MAX_CONNS_PER_HBA

Definition at line 54 of file bnx2i.h.

#define ITT_INVALID_SIGNATURE   0xFFFF

Definition at line 92 of file bnx2i.h.

#define MAX_BD_LENGTH   65535

Definition at line 70 of file bnx2i.h.

#define MAX_CID_CNT   0x4000

Definition at line 109 of file bnx2i.h.

#define MAX_PAGES_PER_CTRL_STRUCT_POOL   8

Definition at line 64 of file bnx2i.h.

#define MB_KERNEL_CTX_SHIFT   8

Definition at line 102 of file bnx2i.h.

#define MB_KERNEL_CTX_SIZE   (1 << MB_KERNEL_CTX_SHIFT)

Definition at line 103 of file bnx2i.h.

#define REG_RD (   __hba,
  offset 
)    readl(__hba->regview + offset)

Definition at line 126 of file bnx2i.h.

#define REG_WR (   __hba,
  offset,
  val 
)    writel(val, __hba->regview + offset)

Definition at line 128 of file bnx2i.h.

Enumeration Type Documentation

anonymous enum

Definition at line 509 of file bnx2i.h.

anonymous enum
Enumerator:
EP_STATE_IDLE 
EP_STATE_PG_OFLD_START 
EP_STATE_PG_OFLD_COMPL 
EP_STATE_OFLD_START 
EP_STATE_OFLD_COMPL 
EP_STATE_CONNECT_START 
EP_STATE_CONNECT_COMPL 
EP_STATE_ULP_UPDATE_START 
EP_STATE_ULP_UPDATE_COMPL 
EP_STATE_DISCONN_START 
EP_STATE_DISCONN_COMPL 
EP_STATE_CLEANUP_START 
EP_STATE_CLEANUP_CMPL 
EP_STATE_TCP_FIN_RCVD 
EP_STATE_TCP_RST_RCVD 
EP_STATE_LOGOUT_SENT 
EP_STATE_LOGOUT_RESP_RCVD 
EP_STATE_PG_OFLD_FAILED 
EP_STATE_ULP_UPDATE_FAILED 
EP_STATE_CLEANUP_FAILED 
EP_STATE_OFLD_FAILED 
EP_STATE_CONNECT_FAILED 
EP_STATE_DISCONN_TIMEDOUT 
EP_STATE_OFLD_FAILED_CID_BUSY 

Definition at line 696 of file bnx2i.h.

Function Documentation

int bnx2i_alloc_ep_pool ( void  )
struct bnx2i_hba* bnx2i_alloc_hba ( struct cnic_dev cnic)
read

bnx2i_alloc_hba - allocate and init adapter instance : cnic device pointer

allocate & initialize adapter structure and call other support routines to do per adapter initialization

Definition at line 783 of file bnx2i_iscsi.c.

int bnx2i_alloc_qp_resc ( struct bnx2i_hba hba,
struct bnx2i_endpoint ep 
)

bnx2i_alloc_qp_resc - allocates required resources for QP. : adapter structure pointer : endpoint (transport indentifier) structure

Allocate QP (transport layer for iSCSI connection) resources, DMA'able memory for SQ/RQ/CQ and page tables. EP structure elements such as producer/consumer indexes/pointers, queue sizes and page table contents are setup

Definition at line 1056 of file bnx2i_hwi.c.

int bnx2i_arm_cq_event_coalescing ( struct bnx2i_endpoint ep,
u8  action 
)

bnx2i_arm_cq_event_coalescing - arms CQ to enable EQ notification : endpoint (transport indentifier) structure : action, ARM or DISARM. For now only ARM_CQE is used

Arm'ing CQ will enable chip to generate global EQ events inorder to interrupt the driver. EQ event is generated CQ index is hit or at least 1 CQ is outstanding and on chip timer expires

Definition at line 136 of file bnx2i_hwi.c.

void bnx2i_drop_session ( struct iscsi_cls_session cls_session)

bnx2i_drop_session - notifies iscsid of connection error. : adapter instance pointer : iscsi session pointer

This notifies iscsid that there is a error, so it can initiate recovery.

This relies on caller using the iscsi class iterator so the object is refcounted and does not disapper from under us.

Definition at line 591 of file bnx2i_iscsi.c.

struct bnx2i_endpoint* bnx2i_ep_destroy_list_next ( struct bnx2i_hba hba)
read
struct bnx2i_endpoint* bnx2i_ep_ofld_list_next ( struct bnx2i_hba hba)
read
void bnx2i_ep_ofld_timer ( unsigned long  data)

bnx2i_ep_ofld_timer - post iSCSI logout request WQE to hardware : endpoint (transport handle) structure pointer

routine to handle connection offload/destroy request timeout

Definition at line 699 of file bnx2i_hwi.c.

struct bnx2i_endpoint* bnx2i_find_ep_in_destroy_list ( struct bnx2i_hba hba,
u32  iscsi_cid 
)
read

bnx2i_find_ep_in_destroy_list - find iscsi_cid in destroy list : pointer to adapter instance : iscsi context ID to find

Definition at line 699 of file bnx2i_iscsi.c.

struct bnx2i_endpoint* bnx2i_find_ep_in_ofld_list ( struct bnx2i_hba hba,
u32  iscsi_cid 
)
read

bnx2i_find_ep_in_ofld_list - find iscsi_cid in pending list of endpoints

: pointer to adapter instance : iscsi context ID to find

Definition at line 671 of file bnx2i_iscsi.c.

struct bnx2i_hba* bnx2i_find_hba_for_cnic ( struct cnic_dev cnic)
read

bnx2i_find_hba_for_cnic - maps cnic device instance to bnx2i adapter instance : pointer to cnic device instance

Definition at line 150 of file bnx2i_init.c.

void bnx2i_free_hba ( struct bnx2i_hba hba)

bnx2i_free_hba- releases hba structure and resources held by the adapter : pointer to adapter instance

free adapter structure and call various cleanup routines.

Definition at line 907 of file bnx2i_iscsi.c.

void bnx2i_free_qp_resc ( struct bnx2i_hba hba,
struct bnx2i_endpoint ep 
)

bnx2i_free_qp_resc - free memory resources held by QP : adapter structure pointer : endpoint (transport indentifier) structure

Free QP resources - SQ/RQ/CQ memory and page tables.

Definition at line 1198 of file bnx2i_hwi.c.

struct bnx2i_conn* bnx2i_get_conn_from_id ( struct bnx2i_hba hba,
u16  iscsi_cid 
)
read

bnx2i_get_conn_from_id - maps an iscsi cid to corresponding conn ptr : pointer to adapter instance : iscsi context ID, range 0 - (MAX_CONN - 1)

Definition at line 256 of file bnx2i_iscsi.c.

void bnx2i_get_rq_buf ( struct bnx2i_conn bnx2i_conn,
char ptr,
int  len 
)

bnx2i_get_rq_buf - copy RQ buffer contents to driver buffer : iscsi connection on which RQ event occurred : driver buffer to which RQ buffer contents is to be copied : length of valid data inside RQ buf

Copies RQ buffer contents from shared (DMA'able) memory region to driver buffer. RQ is used to DMA unsolicitated iscsi pdu's and scsi sense info

Definition at line 191 of file bnx2i_hwi.c.

int bnx2i_get_stats ( void handle)

bnx2i_get_stats - Retrieve various statistic from iSCSI offload : bnx2i_hba

function callback exported via bnx2i - cnic driver interface to retrieve various iSCSI offload related statistics.

Definition at line 390 of file bnx2i_init.c.

int bnx2i_hw_ep_disconnect ( struct bnx2i_endpoint bnx2i_ep)

Definition at line 2023 of file bnx2i_iscsi.c.

void bnx2i_identify_device ( struct bnx2i_hba hba)

bnx2i_identify_device - identifies NetXtreme II device type : Adapter structure pointer

This function identifies the NX2 device type and sets appropriate queue mailbox register access method, 5709 requires driver to access MBOX regs using bin mode

Definition at line 87 of file bnx2i_init.c.

void bnx2i_iscsi_unmap_sg_list ( struct bnx2i_cmd cmd)

bnx2i_iscsi_unmap_sg_list - unmaps SG list : iscsi cmd struct pointer

unmap IO buffers and invalidate the BD table

Definition at line 205 of file bnx2i_iscsi.c.

int bnx2i_map_ep_dbell_regs ( struct bnx2i_endpoint ep)

bnx2i_map_ep_dbell_regs - map connection doorbell registers : bnx2i endpoint

maps connection's SQ and RQ doorbell registers, 5706/5708/5709 hosts these register in BAR #0. Whereas in 57710 these register are accessed by mapping BAR #1

Definition at line 2727 of file bnx2i_hwi.c.

int bnx2i_percpu_io_thread ( void arg)

bnx2i_percpu_io_thread - thread per cpu for ios

  • : ptr to bnx2i_percpu_info structure

Definition at line 1867 of file bnx2i_hwi.c.

void bnx2i_print_active_cmd_queue ( struct bnx2i_conn conn)
void bnx2i_print_pend_cmd_queue ( struct bnx2i_conn conn)
void bnx2i_print_recv_state ( struct bnx2i_conn conn)
void bnx2i_print_xmit_pdu_queue ( struct bnx2i_conn conn)
int bnx2i_process_scsi_cmd_resp ( struct iscsi_session session,
struct bnx2i_conn bnx2i_conn,
struct cqe cqe 
)

bnx2i_process_scsi_cmd_resp - this function handles scsi cmd completion. : iscsi session : bnx2i connection : pointer to newly DMA'ed CQE entry for processing

process SCSI CMD Response CQE & complete the request to SCSI-ML

Definition at line 1351 of file bnx2i_hwi.c.

void bnx2i_put_rq_buf ( struct bnx2i_conn bnx2i_conn,
int  count 
)

bnx2i_put_rq_buf - Replenish RQ buffer, if required ring on chip doorbell : iscsi connection on which event to post : number of RQ buffer being posted to chip

No need to ring hardware doorbell for 57710 family of devices

Definition at line 229 of file bnx2i_hwi.c.

void bnx2i_release_ep_pool ( void  )
void bnx2i_send_cmd_cleanup_req ( struct bnx2i_hba hba,
struct bnx2i_cmd cmd 
)

bnx2i_send_cmd_cleanup_req - send iscsi cmd context clean-up request : adapter structure pointer : driver command structure which is requesting a WQE to sent to chip for further processing

prepares and posts CONN_OFLD_REQ1/2 KWQE

Definition at line 740 of file bnx2i_hwi.c.

int bnx2i_send_conn_destroy ( struct bnx2i_hba hba,
struct bnx2i_endpoint ep 
)

bnx2i_send_conn_destroy - initiates iscsi connection teardown process : adapter structure pointer : endpoint (transport indentifier) structure

this routine prepares and posts CONN_OFLD_REQ1/2 KWQE to initiate iscsi connection context clean-up process

Definition at line 764 of file bnx2i_hwi.c.

int bnx2i_send_conn_ofld_req ( struct bnx2i_hba hba,
struct bnx2i_endpoint ep 
)

bnx2i_send_conn_ofld_req - initiates iscsi connection context setup process

: adapter structure pointer : endpoint (transport indentifier) structure

this routine prepares and posts CONN_OFLD_REQ1/2 KWQE

Definition at line 927 of file bnx2i_hwi.c.

int bnx2i_send_fw_iscsi_init_msg ( struct bnx2i_hba hba)

bnx2i_send_fw_iscsi_init_msg - initiates initial handshake with iscsi f/w : adapter structure pointer

Send down iscsi_init KWQEs which initiates the initial handshake with the f/w This results in iSCSi support validation and on-chip context manager initialization. Firmware completes this handshake with a CQE carrying the result of iscsi support validation. Parameter carried by iscsi init request determines the number of offloaded connection and tolerance level for iscsi protocol violation this hba/chip can support

Definition at line 1259 of file bnx2i_hwi.c.

int bnx2i_send_iscsi_login ( struct bnx2i_conn bnx2i_conn,
struct iscsi_task task 
)

bnx2i_send_iscsi_login - post iSCSI login request MP WQE to hardware : iscsi connection : driver command structure which is requesting a WQE to sent to chip for further processing

prepare and post an iSCSI Login request WQE to CNIC firmware

Definition at line 330 of file bnx2i_hwi.c.

int bnx2i_send_iscsi_logout ( struct bnx2i_conn bnx2i_conn,
struct iscsi_task task 
)

bnx2i_send_iscsi_logout - post iSCSI logout request WQE to hardware : iscsi connection : driver command structure which is requesting a WQE to sent to chip for further processing

prepare and post logout request WQE to CNIC firmware

Definition at line 600 of file bnx2i_hwi.c.

int bnx2i_send_iscsi_nopout ( struct bnx2i_conn bnx2i_conn,
struct iscsi_task task,
char datap,
int  data_len,
int  unsol 
)

bnx2i_send_iscsi_nopout - post iSCSI NOPOUT request WQE to hardware : iscsi connection : driver command structure which is requesting a WQE to sent to chip for further processing : payload buffer pointer : payload data length : indicated whether nopout pdu is unsolicited pdu or in response to target's NOPIN w/ TTT != FFFFFFFF

prepare and post a nopout request WQE to CNIC firmware

Definition at line 537 of file bnx2i_hwi.c.

int bnx2i_send_iscsi_scsicmd ( struct bnx2i_conn bnx2i_conn,
struct bnx2i_cmd cmd 
)

bnx2i_send_iscsi_scsicmd - post iSCSI scsicmd request WQE to hardware : iscsi connection : driver command structure which is requesting a WQE to sent to chip for further processing

prepare and post an iSCSI SCSI-CMD request WQE to CNIC firmware

Definition at line 511 of file bnx2i_hwi.c.

int bnx2i_send_iscsi_text ( struct bnx2i_conn bnx2i_conn,
struct iscsi_task mtask 
)

bnx2i_send_iscsi_text - post iSCSI text WQE to hardware : iscsi connection : driver command structure which is requesting a WQE to sent to chip for further processing

prepare and post an iSCSI Text request WQE to CNIC firmware

Definition at line 461 of file bnx2i_hwi.c.

int bnx2i_send_iscsi_tmf ( struct bnx2i_conn bnx2i_conn,
struct iscsi_task mtask 
)

bnx2i_send_iscsi_tmf - post iSCSI task management request MP WQE to hardware : iscsi connection : driver command structure which is requesting a WQE to sent to chip for further processing

prepare and post an iSCSI Login request WQE to CNIC firmware

Definition at line 385 of file bnx2i_hwi.c.

void bnx2i_start ( void handle)

bnx2i_start - cnic callback to initialize & start adapter instance : transparent handle pointing to adapter structure

This function maps adapter structure to pcidev structure and initiates firmware handshake to enable/initialize on chip iscsi components This bnx2i - cnic interface api callback is issued after following 2 conditions are met - a) underlying network interface is up (marked by event 'NETDEV_UP' from netdev b) bnx2i adapter instance is registered

Definition at line 178 of file bnx2i_init.c.

void bnx2i_stop ( void handle)

bnx2i_stop - cnic callback to shutdown adapter instance : transparent handle pointing to adapter structure

driver checks if adapter is already in shutdown mode, if not start the shutdown process

Definition at line 237 of file bnx2i_init.c.

void bnx2i_ulp_exit ( struct cnic_dev dev)

bnx2i_ulp_exit - shuts down adapter instance and frees all resources : cnic device handle

Definition at line 359 of file bnx2i_init.c.

void bnx2i_ulp_init ( struct cnic_dev dev)

bnx2i_ulp_init - initialize an adapter instance : cnic device handle

Called from cnic_register_driver() context to initialize all enumerated cnic devices. This routine allocate adapter structure and other device specific resources.

Definition at line 334 of file bnx2i_init.c.

void bnx2i_update_iscsi_conn ( struct iscsi_conn conn)

bnx2i_update_iscsi_conn - post iSCSI logout request WQE to hardware : iscsi connection which requires iscsi parameter update

sends down iSCSI Conn Update request to move iSCSI conn to FFP

Definition at line 643 of file bnx2i_hwi.c.

struct bnx2i_hba* get_adapter_list_head ( void  )
read

get_adapter_list_head - returns head of adapter list

Definition at line 124 of file bnx2i_init.c.

Variable Documentation

struct cnic_ulp_ops bnx2i_cnic_cb

bnx2i_cnic_cb - global template of bnx2i - cnic driver interface structure carrying callback function pointers

Definition at line 2701 of file bnx2i_hwi.c.

struct device_attribute* bnx2i_dev_attributes[]

Definition at line 139 of file bnx2i_sysfs.c.

struct iscsi_transport bnx2i_iscsi_transport

Definition at line 2268 of file bnx2i_iscsi.c.

struct scsi_transport_template* bnx2i_scsi_xport_template

Definition at line 21 of file bnx2i_iscsi.c.

unsigned int en_tcp_dack

Definition at line 47 of file bnx2i_init.c.

unsigned int error_mask1

Definition at line 51 of file bnx2i_init.c.

unsigned int error_mask2

Definition at line 55 of file bnx2i_init.c.

unsigned int event_coal_div

Definition at line 43 of file bnx2i_init.c.

unsigned int event_coal_min

Definition at line 39 of file bnx2i_init.c.

u64 iscsi_error_mask

Definition at line 67 of file bnx2i_init.c.

unsigned int rq_size

Definition at line 63 of file bnx2i_init.c.

unsigned int sq_size

Definition at line 59 of file bnx2i_init.c.