Linux Kernel
3.7.1
|
#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 |
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 } |
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_template * | bnx2i_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_attribute * | bnx2i_dev_attributes [] |
#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_SESS_PER_HBA ISCSI_MAX_CONNS_PER_HBA |
#define MB_KERNEL_CTX_SIZE (1 << MB_KERNEL_CTX_SHIFT) |
anonymous enum |
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.
|
read |
|
read |
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.
|
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.
|
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.
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.
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.
|
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.
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.
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.
bnx2i_percpu_io_thread - thread per cpu for ios
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.
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.
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.
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.
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.
bnx2i_ulp_exit - shuts down adapter instance and frees all resources : cnic device handle
Definition at line 359 of file bnx2i_init.c.
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.
get_adapter_list_head - returns head of adapter list
Definition at line 124 of file bnx2i_init.c.
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.