Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
bnx2i_hwi.c File Reference
#include <linux/gfp.h>
#include <scsi/scsi_tcq.h>
#include <scsi/libiscsi.h>
#include "bnx2i.h"

Go to the source code of this file.

Macros

#define BNX2I_ERR_DESIRED_DATA_TRNS_LEN_0   ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_DESIRED_DATA_TRNS_LEN_0
 
#define BNX2I_ERR_DESIRED_DATA_TRNS_LEN_1   ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_DESIRED_DATA_TRNS_LEN_1
 
#define BNX2I_ERR_DATA_SEG_LEN_NOT_ZERO   ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_DATA_SEG_LEN_NOT_ZERO
 
#define BNX2_ERR_PEND_R2T_IN_CLEANUP   ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_PEND_R2T_IN_CLEANUP
 

Functions

 DECLARE_PER_CPU (struct bnx2i_percpu_s, bnx2i_percpu)
 
int bnx2i_arm_cq_event_coalescing (struct bnx2i_endpoint *ep, u8 action)
 
void bnx2i_get_rq_buf (struct bnx2i_conn *bnx2i_conn, char *ptr, int len)
 
void bnx2i_put_rq_buf (struct bnx2i_conn *bnx2i_conn, int count)
 
int bnx2i_send_iscsi_login (struct bnx2i_conn *bnx2i_conn, struct iscsi_task *task)
 
int bnx2i_send_iscsi_tmf (struct bnx2i_conn *bnx2i_conn, struct iscsi_task *mtask)
 
int bnx2i_send_iscsi_text (struct bnx2i_conn *bnx2i_conn, struct iscsi_task *mtask)
 
int bnx2i_send_iscsi_scsicmd (struct bnx2i_conn *bnx2i_conn, struct bnx2i_cmd *cmd)
 
int bnx2i_send_iscsi_nopout (struct bnx2i_conn *bnx2i_conn, struct iscsi_task *task, char *datap, int data_len, int unsol)
 
int bnx2i_send_iscsi_logout (struct bnx2i_conn *bnx2i_conn, struct iscsi_task *task)
 
void bnx2i_update_iscsi_conn (struct iscsi_conn *conn)
 
void bnx2i_ep_ofld_timer (unsigned long data)
 
void bnx2i_send_cmd_cleanup_req (struct bnx2i_hba *hba, struct bnx2i_cmd *cmd)
 
int bnx2i_send_conn_destroy (struct bnx2i_hba *hba, struct bnx2i_endpoint *ep)
 
int bnx2i_send_conn_ofld_req (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)
 
int bnx2i_send_fw_iscsi_init_msg (struct bnx2i_hba *hba)
 
int bnx2i_process_scsi_cmd_resp (struct iscsi_session *session, struct bnx2i_conn *bnx2i_conn, struct cqe *cqe)
 
int bnx2i_percpu_io_thread (void *arg)
 
int bnx2i_map_ep_dbell_regs (struct bnx2i_endpoint *ep)
 

Variables

struct cnic_ulp_ops bnx2i_cnic_cb
 

Macro Definition Documentation

#define BNX2_ERR_PEND_R2T_IN_CLEANUP   ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_PEND_R2T_IN_CLEANUP
#define BNX2I_ERR_DATA_SEG_LEN_NOT_ZERO   ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_DATA_SEG_LEN_NOT_ZERO
#define BNX2I_ERR_DESIRED_DATA_TRNS_LEN_0   ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_DESIRED_DATA_TRNS_LEN_0
#define BNX2I_ERR_DESIRED_DATA_TRNS_LEN_1   ISCSI_KCQE_COMPLETION_STATUS_PROTOCOL_ERR_DESIRED_DATA_TRNS_LEN_1

Function Documentation

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_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.

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.

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_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.

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_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_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.

DECLARE_PER_CPU ( struct bnx2i_percpu_s  ,
bnx2i_percpu   
)

Variable Documentation

struct cnic_ulp_ops bnx2i_cnic_cb
Initial value:
= {
.cnic_init = bnx2i_ulp_init,
.cnic_exit = bnx2i_ulp_exit,
.cnic_start = bnx2i_start,
.cnic_stop = bnx2i_stop,
.indicate_kcqes = bnx2i_indicate_kcqe,
.indicate_netevent = bnx2i_indicate_netevent,
.cm_connect_complete = bnx2i_cm_connect_cmpl,
.cm_close_complete = bnx2i_cm_close_cmpl,
.cm_abort_complete = bnx2i_cm_abort_cmpl,
.cm_remote_close = bnx2i_cm_remote_close,
.cm_remote_abort = bnx2i_cm_remote_abort,
.iscsi_nl_send_msg = bnx2i_send_nl_mesg,
.cnic_get_stats = bnx2i_get_stats,
.owner = THIS_MODULE
}

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

Definition at line 2701 of file bnx2i_hwi.c.