Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
lpfc_sli4.h File Reference

Go to the source code of this file.

Data Structures

union  sli4_qe
 
struct  lpfc_queue
 
struct  lpfc_sli4_link
 
struct  lpfc_fcf_rec
 
struct  lpfc_fcf_pri_rec
 
struct  lpfc_fcf_pri
 
struct  lpfc_fcf
 
struct  lpfc_fip_param_hdr
 
struct  lpfc_fcoe_params
 
struct  lpfc_fcf_conn_hdr
 
struct  lpfc_fcf_conn_rec
 
struct  lpfc_fcf_conn_entry
 
struct  lpfc_bmbx
 
struct  lpfc_max_cfg_param
 
struct  lpfc_fcp_eq_hdl
 
struct  lpfc_pc_sli4_params
 
struct  lpfc_iov
 
struct  lpfc_sli4_lnk_info
 
struct  lpfc_sli4_hba
 
struct  lpfc_sglq
 
struct  lpfc_rpi_hdr
 
struct  lpfc_rsrc_blks
 

Macros

#define LPFC_ACTIVE_MBOX_WAIT_CNT   100
 
#define LPFC_XRI_EXCH_BUSY_WAIT_TMO   10000
 
#define LPFC_XRI_EXCH_BUSY_WAIT_T1   10
 
#define LPFC_XRI_EXCH_BUSY_WAIT_T2   30000
 
#define LPFC_RELEASE_NOTIFICATION_INTERVAL   32
 
#define LPFC_RPI_LOW_WATER_MARK   10
 
#define LPFC_UNREG_FCF   1
 
#define LPFC_SKIP_UNREG_FCF   0
 
#define LPFC_FCF_REDISCOVER_WAIT_TMO   2000 /* msec */
 
#define LPFC_NEMBED_MBOX_SGL_CNT   254
 
#define LPFC_FCP_IO_CHAN_DEF   4
 
#define LPFC_FCP_IO_CHAN_MIN   1
 
#define LPFC_FCP_IO_CHAN_MAX   16
 
#define LPFC_FCOE_FCF_DEF_INDEX   0
 
#define LPFC_FCOE_FCF_GET_FIRST   0xFFFF
 
#define LPFC_FCOE_FCF_NEXT_NONE   0xFFFF
 
#define LPFC_FCOE_NULL_VID   0xFFF
 
#define LPFC_FCOE_IGNORE_VID   0xFFFF
 
#define LPFC_FCOE_FCF_MAC3   0xFF
 
#define LPFC_FCOE_FCF_MAC4   0xFF
 
#define LPFC_FCOE_FCF_MAC5   0xFE
 
#define LPFC_FCOE_FCF_MAP0   0x0E
 
#define LPFC_FCOE_FCF_MAP1   0xFC
 
#define LPFC_FCOE_FCF_MAP2   0x00
 
#define LPFC_FCOE_MAX_RCV_SIZE   0x800
 
#define LPFC_FCOE_FKA_ADV_PER   0
 
#define LPFC_FCOE_FIP_PRIORITY   0x80
 
#define sli4_sid_from_fc_hdr(fc_hdr)
 
#define sli4_did_from_fc_hdr(fc_hdr)
 
#define sli4_fctl_from_fc_hdr(fc_hdr)
 
#define sli4_type_from_fc_hdr(fc_hdr)   ((fc_hdr)->fh_type)
 
#define LPFC_FW_RESET_MAXIMUM_WAIT_10MS_CNT   12000
 
#define LPFC_QUEUE_MIN_REPOST   8
 
#define EQ_max_eqe   q_cnt_1
 
#define EQ_no_entry   q_cnt_2
 
#define EQ_badstate   q_cnt_3
 
#define EQ_processed   q_cnt_4
 
#define CQ_mbox   q_cnt_1
 
#define CQ_max_cqe   q_cnt_1
 
#define CQ_release_wqe   q_cnt_2
 
#define CQ_xri_aborted   q_cnt_3
 
#define CQ_wq   q_cnt_4
 
#define WQ_overflow   q_cnt_1
 
#define WQ_posted   q_cnt_4
 
#define RQ_no_posted_buf   q_cnt_1
 
#define RQ_no_buf_found   q_cnt_2
 
#define RQ_buf_trunc   q_cnt_3
 
#define RQ_rcv_buf   q_cnt_4
 
#define BOOT_ENABLE   0x01
 
#define RECORD_VALID   0x02
 
#define LPFC_FCF_ON_PRI_LIST   0x0001
 
#define LPFC_FCF_FLOGI_FAILED   0x0002
 
#define LPFC_SLI4_FCF_TBL_INDX_MAX   32
 
#define FCF_AVAILABLE   0x01 /* FCF available for discovery */
 
#define FCF_REGISTERED   0x02 /* FCF registered with FW */
 
#define FCF_SCAN_DONE   0x04 /* FCF table scan done */
 
#define FCF_IN_USE   0x08 /* Atleast one discovery completed */
 
#define FCF_INIT_DISC   0x10 /* Initial FCF discovery */
 
#define FCF_DEAD_DISC   0x20 /* FCF DEAD fast FCF failover discovery */
 
#define FCF_ACVL_DISC   0x40 /* All CVL fast FCF failover discovery */
 
#define FCF_DISCOVERY   (FCF_INIT_DISC | FCF_DEAD_DISC | FCF_ACVL_DISC)
 
#define FCF_REDISC_PEND   0x80 /* FCF rediscovery pending */
 
#define FCF_REDISC_EVT   0x100 /* FCF rediscovery event to worker thread */
 
#define FCF_REDISC_FOV   0x200 /* Post FCF rediscovery fast failover */
 
#define FCF_REDISC_PROG   (FCF_REDISC_PEND | FCF_REDISC_EVT)
 
#define LPFC_REGION23_SIGNATURE   "RG23"
 
#define LPFC_REGION23_VERSION   1
 
#define LPFC_REGION23_LAST_REC   0xff
 
#define DRIVER_SPECIFIC_TYPE   0xA2
 
#define LINUX_DRIVER_ID   0x20
 
#define PORT_STE_TYPE   0x1
 
#define FCOE_PARAM_TYPE   0xA0
 
#define FCOE_PARAM_LENGTH   2
 
#define FIPP_VERSION   0x01
 
#define lpfc_fip_param_hdr_fipp_mode_SHIFT   6
 
#define lpfc_fip_param_hdr_fipp_mode_MASK   0x3
 
#define lpfc_fip_param_hdr_fipp_mode_WORD   parm_flags
 
#define FIPP_MODE_ON   0x1
 
#define FIPP_MODE_OFF   0x0
 
#define FIPP_VLAN_VALID   0x1
 
#define FCOE_CONN_TBL_TYPE   0xA1
 
#define FCFCNCT_VALID   0x0001
 
#define FCFCNCT_BOOT   0x0002
 
#define FCFCNCT_PRIMARY   0x0004 /* if not set, Secondary */
 
#define FCFCNCT_FBNM_VALID   0x0008
 
#define FCFCNCT_SWNM_VALID   0x0010
 
#define FCFCNCT_VLAN_VALID   0x0020
 
#define FCFCNCT_AM_VALID   0x0040
 
#define FCFCNCT_AM_PREFERRED   0x0080 /* if not set, AM Required */
 
#define FCFCNCT_AM_SPMA   0x0100 /* if not set, FPMA */
 
#define LPFC_EQE_SIZE   LPFC_EQE_SIZE_4
 
#define LPFC_EQE_SIZE_4B   4
 
#define LPFC_EQE_SIZE_16B   16
 
#define LPFC_CQE_SIZE   16
 
#define LPFC_WQE_SIZE   64
 
#define LPFC_MQE_SIZE   256
 
#define LPFC_RQE_SIZE   8
 
#define LPFC_EQE_DEF_COUNT   1024
 
#define LPFC_CQE_DEF_COUNT   1024
 
#define LPFC_WQE_DEF_COUNT   256
 
#define LPFC_MQE_DEF_COUNT   16
 
#define LPFC_RQE_DEF_COUNT   512
 
#define LPFC_QUEUE_NOARM   false
 
#define LPFC_QUEUE_REARM   true
 
#define SLI4_CT_RPI   0
 
#define SLI4_CT_VPI   1
 
#define SLI4_CT_VFI   2
 
#define SLI4_CT_FCFI   3
 
#define LPFC_SLI4_FL1_MAX_SEGMENT_SIZE   0x10000
 
#define LPFC_SLI4_FL1_MAX_BUF_SIZE   0X2000
 
#define LPFC_SLI4_MIN_BUF_SIZE   0x400
 
#define LPFC_SLI4_MAX_BUF_SIZE   0x20000
 
#define LPFC_SLI4_PROTO_FCOE   0x0000001
 
#define LPFC_SLI4_PROTO_FC   0x0000002
 
#define LPFC_SLI4_PROTO_NIC   0x0000004
 
#define LPFC_SLI4_PROTO_ISCSI   0x0000008
 
#define LPFC_SLI4_PROTO_RDMA   0x0000010
 
#define LPFC_LNK_DAT_INVAL   0
 
#define LPFC_LNK_DAT_VAL   1
 
#define LPFC_LNK_GE   0x0 /* FCoE */
 
#define LPFC_LNK_FC   0x1 /* FC */
 
#define LPFC_SLI4_HANDLER_NAME_SZ   16
 
#define SLIPORT_ERR1_REG_ERR_CODE_1   0x1
 
#define SLIPORT_ERR1_REG_ERR_CODE_2   0x2
 
#define SLIPORT_ERR2_REG_FW_RESTART   0x0
 
#define SLIPORT_ERR2_REG_FUNC_PROVISON   0x1
 
#define SLIPORT_ERR2_REG_FORCED_DUMP   0x2
 
#define SLIPORT_ERR2_REG_FAILURE_EQ   0x3
 
#define SLIPORT_ERR2_REG_FAILURE_CQ   0x4
 
#define SLIPORT_ERR2_REG_FAILURE_BUS   0x5
 
#define SLIPORT_ERR2_REG_FAILURE_RQ   0x6
 
#define LPFC_SP_EQ_MAX_INTR_SEC   10000
 
#define LPFC_FP_EQ_MAX_INTR_SEC   10000
 
#define LPFC_SLI4_PPNAME_NON   0
 
#define LPFC_SLI4_PPNAME_GET   1
 

Enumerations

enum  lpfc_sli4_queue_type {
  LPFC_EQ, LPFC_GCQ, LPFC_MCQ, LPFC_WCQ,
  LPFC_RCQ, LPFC_MQ, LPFC_WQ, LPFC_HRQ,
  LPFC_DRQ
}
 
enum  lpfc_sli4_queue_subtype {
  LPFC_NONE, LPFC_MBOX, LPFC_FCP, LPFC_ELS,
  LPFC_USOL
}
 
enum  lpfc_sge_type { GEN_BUFF_TYPE, SCSI_BUFF_TYPE }
 
enum  lpfc_sgl_state { SGL_FREED, SGL_ALLOCATED, SGL_XRI_ABORTED }
 

Functions

int lpfc_pci_function_reset (struct lpfc_hba *)
 
int lpfc_sli4_pdev_status_reg_wait (struct lpfc_hba *)
 
int lpfc_sli4_hba_setup (struct lpfc_hba *)
 
int lpfc_sli4_config (struct lpfc_hba *, struct lpfcMboxq *, uint8_t, uint8_t, uint32_t, bool)
 
void lpfc_sli4_mbox_cmd_free (struct lpfc_hba *, struct lpfcMboxq *)
 
void lpfc_sli4_mbx_sge_set (struct lpfcMboxq *, uint32_t, dma_addr_t, uint32_t)
 
void lpfc_sli4_mbx_sge_get (struct lpfcMboxq *, uint32_t, struct lpfc_mbx_sge *)
 
int lpfc_sli4_mbx_read_fcf_rec (struct lpfc_hba *, struct lpfcMboxq *, uint16_t)
 
void lpfc_sli4_hba_reset (struct lpfc_hba *)
 
struct lpfc_queuelpfc_sli4_queue_alloc (struct lpfc_hba *, uint32_t, uint32_t)
 
void lpfc_sli4_queue_free (struct lpfc_queue *)
 
uint32_t lpfc_eq_create (struct lpfc_hba *, struct lpfc_queue *, uint32_t)
 
uint32_t lpfc_modify_fcp_eq_delay (struct lpfc_hba *, uint16_t)
 
uint32_t lpfc_cq_create (struct lpfc_hba *, struct lpfc_queue *, struct lpfc_queue *, uint32_t, uint32_t)
 
int32_t lpfc_mq_create (struct lpfc_hba *, struct lpfc_queue *, struct lpfc_queue *, uint32_t)
 
uint32_t lpfc_wq_create (struct lpfc_hba *, struct lpfc_queue *, struct lpfc_queue *, uint32_t)
 
uint32_t lpfc_rq_create (struct lpfc_hba *, struct lpfc_queue *, struct lpfc_queue *, struct lpfc_queue *, uint32_t)
 
void lpfc_rq_adjust_repost (struct lpfc_hba *, struct lpfc_queue *, int)
 
uint32_t lpfc_eq_destroy (struct lpfc_hba *, struct lpfc_queue *)
 
uint32_t lpfc_cq_destroy (struct lpfc_hba *, struct lpfc_queue *)
 
uint32_t lpfc_mq_destroy (struct lpfc_hba *, struct lpfc_queue *)
 
uint32_t lpfc_wq_destroy (struct lpfc_hba *, struct lpfc_queue *)
 
uint32_t lpfc_rq_destroy (struct lpfc_hba *, struct lpfc_queue *, struct lpfc_queue *)
 
int lpfc_sli4_queue_setup (struct lpfc_hba *)
 
void lpfc_sli4_queue_unset (struct lpfc_hba *)
 
int lpfc_sli4_post_sgl (struct lpfc_hba *, dma_addr_t, dma_addr_t, uint16_t)
 
int lpfc_sli4_repost_scsi_sgl_list (struct lpfc_hba *)
 
uint16_t lpfc_sli4_next_xritag (struct lpfc_hba *)
 
int lpfc_sli4_post_async_mbox (struct lpfc_hba *)
 
int lpfc_sli4_post_scsi_sgl_block (struct lpfc_hba *, struct list_head *, int)
 
struct lpfc_cq_event__lpfc_sli4_cq_event_alloc (struct lpfc_hba *)
 
struct lpfc_cq_eventlpfc_sli4_cq_event_alloc (struct lpfc_hba *)
 
void __lpfc_sli4_cq_event_release (struct lpfc_hba *, struct lpfc_cq_event *)
 
void lpfc_sli4_cq_event_release (struct lpfc_hba *, struct lpfc_cq_event *)
 
int lpfc_sli4_init_rpi_hdrs (struct lpfc_hba *)
 
int lpfc_sli4_post_rpi_hdr (struct lpfc_hba *, struct lpfc_rpi_hdr *)
 
int lpfc_sli4_post_all_rpi_hdrs (struct lpfc_hba *)
 
struct lpfc_rpi_hdrlpfc_sli4_create_rpi_hdr (struct lpfc_hba *)
 
void lpfc_sli4_remove_rpi_hdrs (struct lpfc_hba *)
 
int lpfc_sli4_alloc_rpi (struct lpfc_hba *)
 
void lpfc_sli4_free_rpi (struct lpfc_hba *, int)
 
void lpfc_sli4_remove_rpis (struct lpfc_hba *)
 
void lpfc_sli4_async_event_proc (struct lpfc_hba *)
 
void lpfc_sli4_fcf_redisc_event_proc (struct lpfc_hba *)
 
int lpfc_sli4_resume_rpi (struct lpfc_nodelist *, void(*)(struct lpfc_hba *, LPFC_MBOXQ_t *), void *)
 
void lpfc_sli4_fcp_xri_abort_event_proc (struct lpfc_hba *)
 
void lpfc_sli4_els_xri_abort_event_proc (struct lpfc_hba *)
 
void lpfc_sli4_fcp_xri_aborted (struct lpfc_hba *, struct sli4_wcqe_xri_aborted *)
 
void lpfc_sli4_els_xri_aborted (struct lpfc_hba *, struct sli4_wcqe_xri_aborted *)
 
void lpfc_sli4_vport_delete_els_xri_aborted (struct lpfc_vport *)
 
void lpfc_sli4_vport_delete_fcp_xri_aborted (struct lpfc_vport *)
 
int lpfc_sli4_brdreset (struct lpfc_hba *)
 
int lpfc_sli4_add_fcf_record (struct lpfc_hba *, struct fcf_record *)
 
void lpfc_sli_remove_dflt_fcf (struct lpfc_hba *)
 
int lpfc_sli4_get_els_iocb_cnt (struct lpfc_hba *)
 
int lpfc_sli4_init_vpi (struct lpfc_vport *)
 
uint32_t lpfc_sli4_cq_release (struct lpfc_queue *, bool)
 
uint32_t lpfc_sli4_eq_release (struct lpfc_queue *, bool)
 
void lpfc_sli4_fcfi_unreg (struct lpfc_hba *, uint16_t)
 
int lpfc_sli4_fcf_scan_read_fcf_rec (struct lpfc_hba *, uint16_t)
 
int lpfc_sli4_fcf_rr_read_fcf_rec (struct lpfc_hba *, uint16_t)
 
int lpfc_sli4_read_fcf_rec (struct lpfc_hba *, uint16_t)
 
void lpfc_mbx_cmpl_fcf_scan_read_fcf_rec (struct lpfc_hba *, LPFC_MBOXQ_t *)
 
void lpfc_mbx_cmpl_fcf_rr_read_fcf_rec (struct lpfc_hba *, LPFC_MBOXQ_t *)
 
void lpfc_mbx_cmpl_read_fcf_rec (struct lpfc_hba *, LPFC_MBOXQ_t *)
 
int lpfc_sli4_unregister_fcf (struct lpfc_hba *)
 
int lpfc_sli4_post_status_check (struct lpfc_hba *)
 
uint8_t lpfc_sli_config_mbox_subsys_get (struct lpfc_hba *, LPFC_MBOXQ_t *)
 
uint8_t lpfc_sli_config_mbox_opcode_get (struct lpfc_hba *, LPFC_MBOXQ_t *)
 

Macro Definition Documentation

#define BOOT_ENABLE   0x01

Definition at line 190 of file lpfc_sli4.h.

#define CQ_max_cqe   q_cnt_1

Definition at line 152 of file lpfc_sli4.h.

#define CQ_mbox   q_cnt_1

Definition at line 151 of file lpfc_sli4.h.

#define CQ_release_wqe   q_cnt_2

Definition at line 153 of file lpfc_sli4.h.

#define CQ_wq   q_cnt_4

Definition at line 155 of file lpfc_sli4.h.

#define CQ_xri_aborted   q_cnt_3

Definition at line 154 of file lpfc_sli4.h.

#define DRIVER_SPECIFIC_TYPE   0xA2

Definition at line 243 of file lpfc_sli4.h.

#define EQ_badstate   q_cnt_3

Definition at line 147 of file lpfc_sli4.h.

#define EQ_max_eqe   q_cnt_1

Definition at line 145 of file lpfc_sli4.h.

#define EQ_no_entry   q_cnt_2

Definition at line 146 of file lpfc_sli4.h.

#define EQ_processed   q_cnt_4

Definition at line 148 of file lpfc_sli4.h.

#define FCF_ACVL_DISC   0x40 /* All CVL fast FCF failover discovery */

Definition at line 222 of file lpfc_sli4.h.

#define FCF_AVAILABLE   0x01 /* FCF available for discovery */

Definition at line 216 of file lpfc_sli4.h.

#define FCF_DEAD_DISC   0x20 /* FCF DEAD fast FCF failover discovery */

Definition at line 221 of file lpfc_sli4.h.

#define FCF_DISCOVERY   (FCF_INIT_DISC | FCF_DEAD_DISC | FCF_ACVL_DISC)

Definition at line 223 of file lpfc_sli4.h.

#define FCF_IN_USE   0x08 /* Atleast one discovery completed */

Definition at line 219 of file lpfc_sli4.h.

#define FCF_INIT_DISC   0x10 /* Initial FCF discovery */

Definition at line 220 of file lpfc_sli4.h.

#define FCF_REDISC_EVT   0x100 /* FCF rediscovery event to worker thread */

Definition at line 225 of file lpfc_sli4.h.

#define FCF_REDISC_FOV   0x200 /* Post FCF rediscovery fast failover */

Definition at line 226 of file lpfc_sli4.h.

#define FCF_REDISC_PEND   0x80 /* FCF rediscovery pending */

Definition at line 224 of file lpfc_sli4.h.

#define FCF_REDISC_PROG   (FCF_REDISC_PEND | FCF_REDISC_EVT)

Definition at line 227 of file lpfc_sli4.h.

#define FCF_REGISTERED   0x02 /* FCF registered with FW */

Definition at line 217 of file lpfc_sli4.h.

#define FCF_SCAN_DONE   0x04 /* FCF table scan done */

Definition at line 218 of file lpfc_sli4.h.

#define FCFCNCT_AM_PREFERRED   0x0080 /* if not set, AM Required */

Definition at line 286 of file lpfc_sli4.h.

#define FCFCNCT_AM_SPMA   0x0100 /* if not set, FPMA */

Definition at line 287 of file lpfc_sli4.h.

#define FCFCNCT_AM_VALID   0x0040

Definition at line 285 of file lpfc_sli4.h.

#define FCFCNCT_BOOT   0x0002

Definition at line 280 of file lpfc_sli4.h.

#define FCFCNCT_FBNM_VALID   0x0008

Definition at line 282 of file lpfc_sli4.h.

#define FCFCNCT_PRIMARY   0x0004 /* if not set, Secondary */

Definition at line 281 of file lpfc_sli4.h.

#define FCFCNCT_SWNM_VALID   0x0010

Definition at line 283 of file lpfc_sli4.h.

#define FCFCNCT_VALID   0x0001

Definition at line 279 of file lpfc_sli4.h.

#define FCFCNCT_VLAN_VALID   0x0020

Definition at line 284 of file lpfc_sli4.h.

#define FCOE_CONN_TBL_TYPE   0xA1

Definition at line 272 of file lpfc_sli4.h.

#define FCOE_PARAM_LENGTH   2

Definition at line 251 of file lpfc_sli4.h.

#define FCOE_PARAM_TYPE   0xA0

Definition at line 249 of file lpfc_sli4.h.

#define FIPP_MODE_OFF   0x0

Definition at line 259 of file lpfc_sli4.h.

#define FIPP_MODE_ON   0x1

Definition at line 258 of file lpfc_sli4.h.

#define FIPP_VERSION   0x01

Definition at line 253 of file lpfc_sli4.h.

#define FIPP_VLAN_VALID   0x1

Definition at line 260 of file lpfc_sli4.h.

#define LINUX_DRIVER_ID   0x20

Definition at line 244 of file lpfc_sli4.h.

#define LPFC_ACTIVE_MBOX_WAIT_CNT   100

Definition at line 21 of file lpfc_sli4.h.

#define LPFC_CQE_DEF_COUNT   1024

Definition at line 325 of file lpfc_sli4.h.

#define LPFC_CQE_SIZE   16

Definition at line 319 of file lpfc_sli4.h.

#define LPFC_EQE_DEF_COUNT   1024

Definition at line 324 of file lpfc_sli4.h.

#define LPFC_EQE_SIZE   LPFC_EQE_SIZE_4

Definition at line 315 of file lpfc_sli4.h.

#define LPFC_EQE_SIZE_16B   16

Definition at line 318 of file lpfc_sli4.h.

#define LPFC_EQE_SIZE_4B   4

Definition at line 317 of file lpfc_sli4.h.

#define LPFC_FCF_FLOGI_FAILED   0x0002

Definition at line 197 of file lpfc_sli4.h.

#define LPFC_FCF_ON_PRI_LIST   0x0001

Definition at line 196 of file lpfc_sli4.h.

#define LPFC_FCF_REDISCOVER_WAIT_TMO   2000 /* msec */

Definition at line 32 of file lpfc_sli4.h.

#define LPFC_FCOE_FCF_DEF_INDEX   0

Definition at line 47 of file lpfc_sli4.h.

#define LPFC_FCOE_FCF_GET_FIRST   0xFFFF

Definition at line 48 of file lpfc_sli4.h.

#define LPFC_FCOE_FCF_MAC3   0xFF

Definition at line 55 of file lpfc_sli4.h.

#define LPFC_FCOE_FCF_MAC4   0xFF

Definition at line 56 of file lpfc_sli4.h.

#define LPFC_FCOE_FCF_MAC5   0xFE

Definition at line 57 of file lpfc_sli4.h.

#define LPFC_FCOE_FCF_MAP0   0x0E

Definition at line 58 of file lpfc_sli4.h.

#define LPFC_FCOE_FCF_MAP1   0xFC

Definition at line 59 of file lpfc_sli4.h.

#define LPFC_FCOE_FCF_MAP2   0x00

Definition at line 60 of file lpfc_sli4.h.

#define LPFC_FCOE_FCF_NEXT_NONE   0xFFFF

Definition at line 49 of file lpfc_sli4.h.

#define LPFC_FCOE_FIP_PRIORITY   0x80

Definition at line 63 of file lpfc_sli4.h.

#define LPFC_FCOE_FKA_ADV_PER   0

Definition at line 62 of file lpfc_sli4.h.

#define LPFC_FCOE_IGNORE_VID   0xFFFF

Definition at line 52 of file lpfc_sli4.h.

#define LPFC_FCOE_MAX_RCV_SIZE   0x800

Definition at line 61 of file lpfc_sli4.h.

#define LPFC_FCOE_NULL_VID   0xFFF

Definition at line 51 of file lpfc_sli4.h.

#define LPFC_FCP_IO_CHAN_DEF   4

Definition at line 38 of file lpfc_sli4.h.

#define LPFC_FCP_IO_CHAN_MAX   16

Definition at line 40 of file lpfc_sli4.h.

#define LPFC_FCP_IO_CHAN_MIN   1

Definition at line 39 of file lpfc_sli4.h.

#define lpfc_fip_param_hdr_fipp_mode_MASK   0x3

Definition at line 256 of file lpfc_sli4.h.

#define lpfc_fip_param_hdr_fipp_mode_SHIFT   6

Definition at line 255 of file lpfc_sli4.h.

#define lpfc_fip_param_hdr_fipp_mode_WORD   parm_flags

Definition at line 257 of file lpfc_sli4.h.

#define LPFC_FP_EQ_MAX_INTR_SEC   10000

Definition at line 520 of file lpfc_sli4.h.

#define LPFC_FW_RESET_MAXIMUM_WAIT_10MS_CNT   12000

Definition at line 83 of file lpfc_sli4.h.

#define LPFC_LNK_DAT_INVAL   0

Definition at line 426 of file lpfc_sli4.h.

#define LPFC_LNK_DAT_VAL   1

Definition at line 427 of file lpfc_sli4.h.

#define LPFC_LNK_FC   0x1 /* FC */

Definition at line 430 of file lpfc_sli4.h.

#define LPFC_LNK_GE   0x0 /* FCoE */

Definition at line 429 of file lpfc_sli4.h.

#define LPFC_MQE_DEF_COUNT   16

Definition at line 327 of file lpfc_sli4.h.

#define LPFC_MQE_SIZE   256

Definition at line 321 of file lpfc_sli4.h.

#define LPFC_NEMBED_MBOX_SGL_CNT   254

Definition at line 35 of file lpfc_sli4.h.

#define LPFC_QUEUE_MIN_REPOST   8

Definition at line 129 of file lpfc_sli4.h.

#define LPFC_QUEUE_NOARM   false

Definition at line 330 of file lpfc_sli4.h.

#define LPFC_QUEUE_REARM   true

Definition at line 331 of file lpfc_sli4.h.

#define LPFC_REGION23_LAST_REC   0xff

Definition at line 242 of file lpfc_sli4.h.

#define LPFC_REGION23_SIGNATURE   "RG23"

Definition at line 240 of file lpfc_sli4.h.

#define LPFC_REGION23_VERSION   1

Definition at line 241 of file lpfc_sli4.h.

#define LPFC_RELEASE_NOTIFICATION_INTERVAL   32

Definition at line 25 of file lpfc_sli4.h.

#define LPFC_RPI_LOW_WATER_MARK   10

Definition at line 26 of file lpfc_sli4.h.

#define LPFC_RQE_DEF_COUNT   512

Definition at line 328 of file lpfc_sli4.h.

#define LPFC_RQE_SIZE   8

Definition at line 322 of file lpfc_sli4.h.

#define LPFC_SKIP_UNREG_FCF   0

Definition at line 29 of file lpfc_sli4.h.

#define LPFC_SLI4_FCF_TBL_INDX_MAX   32

Definition at line 211 of file lpfc_sli4.h.

#define LPFC_SLI4_FL1_MAX_BUF_SIZE   0X2000

Definition at line 343 of file lpfc_sli4.h.

#define LPFC_SLI4_FL1_MAX_SEGMENT_SIZE   0x10000

Definition at line 342 of file lpfc_sli4.h.

#define LPFC_SLI4_HANDLER_NAME_SZ   16

Definition at line 434 of file lpfc_sli4.h.

#define LPFC_SLI4_MAX_BUF_SIZE   0x20000

Definition at line 345 of file lpfc_sli4.h.

#define LPFC_SLI4_MIN_BUF_SIZE   0x400

Definition at line 344 of file lpfc_sli4.h.

#define LPFC_SLI4_PPNAME_GET   1

Definition at line 561 of file lpfc_sli4.h.

#define LPFC_SLI4_PPNAME_NON   0

Definition at line 560 of file lpfc_sli4.h.

#define LPFC_SLI4_PROTO_FC   0x0000002

Definition at line 389 of file lpfc_sli4.h.

#define LPFC_SLI4_PROTO_FCOE   0x0000001

Definition at line 388 of file lpfc_sli4.h.

#define LPFC_SLI4_PROTO_ISCSI   0x0000008

Definition at line 391 of file lpfc_sli4.h.

#define LPFC_SLI4_PROTO_NIC   0x0000004

Definition at line 390 of file lpfc_sli4.h.

#define LPFC_SLI4_PROTO_RDMA   0x0000010

Definition at line 392 of file lpfc_sli4.h.

#define LPFC_SP_EQ_MAX_INTR_SEC   10000

Definition at line 519 of file lpfc_sli4.h.

#define LPFC_UNREG_FCF   1

Definition at line 28 of file lpfc_sli4.h.

#define LPFC_WQE_DEF_COUNT   256

Definition at line 326 of file lpfc_sli4.h.

#define LPFC_WQE_SIZE   64

Definition at line 320 of file lpfc_sli4.h.

#define LPFC_XRI_EXCH_BUSY_WAIT_T1   10

Definition at line 23 of file lpfc_sli4.h.

#define LPFC_XRI_EXCH_BUSY_WAIT_T2   30000

Definition at line 24 of file lpfc_sli4.h.

#define LPFC_XRI_EXCH_BUSY_WAIT_TMO   10000

Definition at line 22 of file lpfc_sli4.h.

#define PORT_STE_TYPE   0x1

Definition at line 245 of file lpfc_sli4.h.

#define RECORD_VALID   0x02

Definition at line 191 of file lpfc_sli4.h.

#define RQ_buf_trunc   q_cnt_3

Definition at line 164 of file lpfc_sli4.h.

#define RQ_no_buf_found   q_cnt_2

Definition at line 163 of file lpfc_sli4.h.

#define RQ_no_posted_buf   q_cnt_1

Definition at line 162 of file lpfc_sli4.h.

#define RQ_rcv_buf   q_cnt_4

Definition at line 165 of file lpfc_sli4.h.

#define SLI4_CT_FCFI   3

Definition at line 340 of file lpfc_sli4.h.

#define SLI4_CT_RPI   0

Definition at line 337 of file lpfc_sli4.h.

#define SLI4_CT_VFI   2

Definition at line 339 of file lpfc_sli4.h.

#define SLI4_CT_VPI   1

Definition at line 338 of file lpfc_sli4.h.

#define sli4_did_from_fc_hdr (   fc_hdr)
Value:
((fc_hdr)->fh_d_id[0] << 16 | \
(fc_hdr)->fh_d_id[1] << 8 | \
(fc_hdr)->fh_d_id[2])

Definition at line 70 of file lpfc_sli4.h.

#define sli4_fctl_from_fc_hdr (   fc_hdr)
Value:
((fc_hdr)->fh_f_ctl[0] << 16 | \
(fc_hdr)->fh_f_ctl[1] << 8 | \
(fc_hdr)->fh_f_ctl[2])

Definition at line 75 of file lpfc_sli4.h.

#define sli4_sid_from_fc_hdr (   fc_hdr)
Value:
((fc_hdr)->fh_s_id[0] << 16 | \
(fc_hdr)->fh_s_id[1] << 8 | \
(fc_hdr)->fh_s_id[2])

Definition at line 65 of file lpfc_sli4.h.

#define sli4_type_from_fc_hdr (   fc_hdr)    ((fc_hdr)->fh_type)

Definition at line 80 of file lpfc_sli4.h.

#define SLIPORT_ERR1_REG_ERR_CODE_1   0x1

Definition at line 457 of file lpfc_sli4.h.

#define SLIPORT_ERR1_REG_ERR_CODE_2   0x2

Definition at line 458 of file lpfc_sli4.h.

#define SLIPORT_ERR2_REG_FAILURE_BUS   0x5

Definition at line 465 of file lpfc_sli4.h.

#define SLIPORT_ERR2_REG_FAILURE_CQ   0x4

Definition at line 464 of file lpfc_sli4.h.

#define SLIPORT_ERR2_REG_FAILURE_EQ   0x3

Definition at line 463 of file lpfc_sli4.h.

#define SLIPORT_ERR2_REG_FAILURE_RQ   0x6

Definition at line 466 of file lpfc_sli4.h.

#define SLIPORT_ERR2_REG_FORCED_DUMP   0x2

Definition at line 462 of file lpfc_sli4.h.

#define SLIPORT_ERR2_REG_FUNC_PROVISON   0x1

Definition at line 461 of file lpfc_sli4.h.

#define SLIPORT_ERR2_REG_FW_RESTART   0x0

Definition at line 460 of file lpfc_sli4.h.

#define WQ_overflow   q_cnt_1

Definition at line 158 of file lpfc_sli4.h.

#define WQ_posted   q_cnt_4

Definition at line 159 of file lpfc_sli4.h.

Enumeration Type Documentation

Enumerator:
GEN_BUFF_TYPE 
SCSI_BUFF_TYPE 

Definition at line 567 of file lpfc_sli4.h.

Enumerator:
SGL_FREED 
SGL_ALLOCATED 
SGL_XRI_ABORTED 

Definition at line 572 of file lpfc_sli4.h.

Enumerator:
LPFC_NONE 
LPFC_MBOX 
LPFC_FCP 
LPFC_ELS 
LPFC_USOL 

Definition at line 98 of file lpfc_sli4.h.

Enumerator:
LPFC_EQ 
LPFC_GCQ 
LPFC_MCQ 
LPFC_WCQ 
LPFC_RCQ 
LPFC_MQ 
LPFC_WQ 
LPFC_HRQ 
LPFC_DRQ 

Definition at line 85 of file lpfc_sli4.h.

Function Documentation

struct lpfc_cq_event* __lpfc_sli4_cq_event_alloc ( struct lpfc_hba phba)
read

__lpfc_sli4_cq_event_alloc - Allocate a completion-queue event from free pool : pointer to lpfc hba data structure.

This routine is the lock free version of the API invoked to allocate a completion-queue event from the free pool.

Return: Pointer to the newly allocated completion-queue event if successful NULL otherwise.

Definition at line 7427 of file lpfc_init.c.

void __lpfc_sli4_cq_event_release ( struct lpfc_hba phba,
struct lpfc_cq_event cq_event 
)

__lpfc_sli4_cq_event_release - Release a completion-queue event to free pool : pointer to lpfc hba data structure. : pointer to the completion queue event to be freed.

This routine is the lock free version of the API invoked to release a completion-queue event back into the free pool.

Definition at line 7467 of file lpfc_init.c.

uint32_t lpfc_cq_create ( struct lpfc_hba phba,
struct lpfc_queue cq,
struct lpfc_queue eq,
uint32_t  type,
uint32_t  subtype 
)

lpfc_cq_create - Create a Completion Queue on the HBA : HBA structure that indicates port to create a queue on. : The queue structure to use to create the completion queue. : The event queue to bind this completion queue to.

This function creates a completion queue, as detailed in , on a port, described by by sending a CQ_CREATE mailbox command to the HBA.

The struct is used to send mailbox command to HBA. The struct is used to get the entry count and entry size that are necessary to determine the number of pages to allocate and use for this queue. The is used to indicate which event queue to bind this completion queue to. This function will send the CQ_CREATE mailbox command to the HBA to setup the completion queue. This function is asynchronous and will wait for the mailbox command to finish before continuing.

On success this function will return a zero. If unable to allocate enough memory this function will return -ENOMEM. If the queue create mailbox command fails this function will return -ENXIO.

Definition at line 12324 of file lpfc_sli.c.

uint32_t lpfc_cq_destroy ( struct lpfc_hba phba,
struct lpfc_queue cq 
)

lpfc_cq_destroy - Destroy a Completion Queue on the HBA : The queue structure associated with the queue to destroy.

This function destroys a queue, as detailed in by sending an mailbox command, specific to the type of queue, to the HBA.

The struct is used to get the queue ID of the queue to destroy.

On success this function will return a zero. If the queue destroy mailbox command fails this function will return -ENXIO.

Definition at line 13077 of file lpfc_sli.c.

uint32_t lpfc_eq_create ( struct lpfc_hba phba,
struct lpfc_queue eq,
uint32_t  imax 
)

lpfc_eq_create - Create an Event Queue on the HBA : HBA structure that indicates port to create a queue on. : The queue structure to use to create the event queue. : The maximum interrupt per second limit.

This function creates an event queue, as detailed in , on a port, described by by sending an EQ_CREATE mailbox command to the HBA.

The struct is used to send mailbox command to HBA. The struct is used to get the entry count and entry size that are necessary to determine the number of pages to allocate and use for this queue. This function will send the EQ_CREATE mailbox command to the HBA to setup the event queue. This function is asynchronous and will wait for the mailbox command to finish before continuing.

On success this function will return a zero. If unable to allocate enough memory this function will return -ENOMEM. If the queue create mailbox command fails this function will return -ENXIO.

Definition at line 12202 of file lpfc_sli.c.

uint32_t lpfc_eq_destroy ( struct lpfc_hba phba,
struct lpfc_queue eq 
)

lpfc_eq_destroy - Destroy an event Queue on the HBA : The queue structure associated with the queue to destroy.

This function destroys a queue, as detailed in by sending an mailbox command, specific to the type of queue, to the HBA.

The struct is used to get the queue ID of the queue to destroy.

On success this function will return a zero. If the queue destroy mailbox command fails this function will return -ENXIO.

Definition at line 13021 of file lpfc_sli.c.

void lpfc_mbx_cmpl_fcf_rr_read_fcf_rec ( struct lpfc_hba phba,
LPFC_MBOXQ_t mboxq 
)

lpfc_mbx_cmpl_fcf_rr_read_fcf_rec - fcf roundrobin read_fcf mbox cmpl hdler : pointer to lpfc hba data structure. : pointer to mailbox object.

This is the callback function for FLOGI failure roundrobin FCF failover read FCF record mailbox command from the eligible FCF record bmask for performing the failover. If the FCF read back is not valid/available, it fails through to retrying FLOGI to the currently registered FCF again. Otherwise, if the FCF read back is valid and available, it will set the newly read FCF record to the failover FCF record, unregister currently registered FCF record, copy the failover FCF record to the current FCF record, and then register the current FCF record before proceeding to trying FLOGI on the new failover FCF.

Definition at line 2517 of file lpfc_hbadisc.c.

void lpfc_mbx_cmpl_fcf_scan_read_fcf_rec ( struct lpfc_hba phba,
LPFC_MBOXQ_t mboxq 
)

lpfc_mbx_cmpl_fcf_scan_read_fcf_rec - fcf scan read_fcf mbox cmpl handler. : pointer to lpfc hba data structure. : pointer to mailbox object.

This function iterates through all the fcf records available in HBA and chooses the optimal FCF record for discovery. After finding the FCF for discovery it registers the FCF record and kicks start discovery. If FCF_IN_USE flag is set in currently used FCF, the routine tries to use an FCF record which matches fabric name and mac address of the currently used FCF record. If the driver supports only one FCF, it will try to use the FCF record used by BOOT_BIOS.

Definition at line 2140 of file lpfc_hbadisc.c.

void lpfc_mbx_cmpl_read_fcf_rec ( struct lpfc_hba phba,
LPFC_MBOXQ_t mboxq 
)

lpfc_mbx_cmpl_read_fcf_rec - read fcf completion handler. : pointer to lpfc hba data structure. : pointer to mailbox object.

This is the callback function of read FCF record mailbox command for updating the eligible FCF bmask for FLOGI failure roundrobin FCF failover when a new FCF event happened. If the FCF read back is valid/available and it passes the connection list check, it updates the bmask for the eligible FCF record for roundrobin failover.

Definition at line 2620 of file lpfc_hbadisc.c.

uint32_t lpfc_modify_fcp_eq_delay ( struct lpfc_hba phba,
uint16_t  startq 
)

lpfc_modify_fcp_eq_delay - Modify Delay Multiplier on FCP EQs : HBA structure that indicates port to create a queue on. : The starting FCP EQ to modify

This function sends an MODIFY_EQ_DELAY mailbox command to the HBA.

The struct is used to send mailbox command to HBA. The is used to get the starting FCP EQ to change. This function is asynchronous and will wait for the mailbox command to finish before continuing.

On success this function will return a zero. If unable to allocate enough memory this function will return -ENOMEM. If the queue create mailbox command fails this function will return -ENXIO.

Definition at line 12116 of file lpfc_sli.c.

int32_t lpfc_mq_create ( struct lpfc_hba phba,
struct lpfc_queue mq,
struct lpfc_queue cq,
uint32_t  subtype 
)

lpfc_mq_create - Create a mailbox Queue on the HBA : HBA structure that indicates port to create a queue on. : The queue structure to use to create the mailbox queue. : The completion queue to associate with this cq. : The queue's subtype.

This function creates a mailbox queue, as detailed in , on a port, described by by sending a MQ_CREATE mailbox command to the HBA.

The struct is used to send mailbox command to HBA. The struct is used to get the entry count and entry size that are necessary to determine the number of pages to allocate and use for this queue. This function will send the MQ_CREATE mailbox command to the HBA to setup the mailbox queue. This function is asynchronous and will wait for the mailbox command to finish before continuing.

On success this function will return a zero. If unable to allocate enough memory this function will return -ENOMEM. If the queue create mailbox command fails this function will return -ENXIO.

Definition at line 12510 of file lpfc_sli.c.

uint32_t lpfc_mq_destroy ( struct lpfc_hba phba,
struct lpfc_queue mq 
)

lpfc_mq_destroy - Destroy a Mailbox Queue on the HBA : The queue structure associated with the queue to destroy.

This function destroys a queue, as detailed in by sending an mailbox command, specific to the type of queue, to the HBA.

The struct is used to get the queue ID of the queue to destroy.

On success this function will return a zero. If the queue destroy mailbox command fails this function will return -ENXIO.

Definition at line 13131 of file lpfc_sli.c.

int lpfc_pci_function_reset ( struct lpfc_hba phba)

lpfc_pci_function_reset - Reset pci function. : pointer to lpfc hba data structure.

This routine is invoked to request a PCI function reset. It will destroys all resources assigned to the PCI function which originates this request.

Return codes 0 - successful -ENOMEM - No available memory -EIO - The mailbox failed to complete successfully.

Definition at line 7537 of file lpfc_init.c.

void lpfc_rq_adjust_repost ( struct lpfc_hba phba,
struct lpfc_queue rq,
int  qno 
)

lpfc_rq_adjust_repost - Adjust entry_repost for an RQ : HBA structure that indicates port to create a queue on. : The queue structure to use for the receive queue. : The associated HBQ number

For SLI4 we need to adjust the RQ repost value based on the number of buffers that are initially posted to the RQ.

Definition at line 12768 of file lpfc_sli.c.

uint32_t lpfc_rq_create ( struct lpfc_hba phba,
struct lpfc_queue hrq,
struct lpfc_queue drq,
struct lpfc_queue cq,
uint32_t  subtype 
)

lpfc_rq_create - Create a Receive Queue on the HBA : HBA structure that indicates port to create a queue on. : The queue structure to use to create the header receive queue. : The queue structure to use to create the data receive queue. : The completion queue to bind this work queue to.

This function creates a receive buffer queue pair , as detailed in and , on a port, described by by sending a RQ_CREATE mailbox command to the HBA.

The struct is used to send mailbox command to HBA. The and struct is used to get the entry count that is necessary to determine the number of pages to use for this queue. The is used to indicate which completion queue to bind received buffers that are posted to these queues to. This function will send the RQ_CREATE mailbox command to the HBA to setup the receive queue pair. This function is asynchronous and will wait for the mailbox command to finish before continuing.

On success this function will return a zero. If unable to allocate enough memory this function will return -ENOMEM. If the queue create mailbox command fails this function will return -ENXIO.

Definition at line 12809 of file lpfc_sli.c.

uint32_t lpfc_rq_destroy ( struct lpfc_hba phba,
struct lpfc_queue hrq,
struct lpfc_queue drq 
)

lpfc_rq_destroy - Destroy a Receive Queue on the HBA : The queue structure associated with the queue to destroy.

This function destroys a queue, as detailed in by sending an mailbox command, specific to the type of queue, to the HBA.

The struct is used to get the queue ID of the queue to destroy.

On success this function will return a zero. If the queue destroy mailbox command fails this function will return -ENXIO.

Definition at line 13238 of file lpfc_sli.c.

int lpfc_sli4_add_fcf_record ( struct lpfc_hba phba,
struct fcf_record fcf_record 
)

lpfc_sli4_add_fcf_record - Manually add an FCF Record. : pointer to lpfc hba data structure. : pointer to the initialized fcf record to add.

This routine is invoked to manually add a single FCF record. The caller must pass a completely initialized FCF_Record. This routine takes care of the nonembedded mailbox operations.

Definition at line 14943 of file lpfc_sli.c.

int lpfc_sli4_alloc_rpi ( struct lpfc_hba phba)

lpfc_sli4_alloc_rpi - Get an available rpi in the device's range : pointer to lpfc hba data structure.

This routine is invoked to post rpi header templates to the HBA consistent with the SLI-4 interface spec. This routine posts a SLI4_PAGE_SIZE memory region to the port to hold up to SLI4_PAGE_SIZE modulo 64 rpi context headers.

Returns A nonzero rpi defined as rpi_base <= rpi < max_rpi if successful LPFC_RPI_ALLOC_ERROR if no rpis are available.

Definition at line 14710 of file lpfc_sli.c.

void lpfc_sli4_async_event_proc ( struct lpfc_hba phba)

lpfc_sli4_async_event_proc - Process all the pending asynchronous event : pointer to lpfc hba data structure.

This routine is invoked by the worker thread to process all the pending SLI4 asynchronous events.

Definition at line 4304 of file lpfc_init.c.

int lpfc_sli4_brdreset ( struct lpfc_hba phba)

lpfc_sli4_brdreset - Reset a sli-4 HBA : Pointer to HBA context object.

This function resets a SLI4 HBA. This function disables PCI layer parity checking during resets the device. The caller is not required to hold any locks.

This function returns 0 always.

Definition at line 3936 of file lpfc_sli.c.

int lpfc_sli4_config ( struct lpfc_hba phba,
struct lpfcMboxq mbox,
uint8_t  subsystem,
uint8_t  opcode,
uint32_t  length,
bool  emb 
)

lpfc_sli4_config - Initialize the SLI4 Config Mailbox command : pointer to lpfc hba data structure. : pointer to lpfc mbox command. : The sli4 config sub mailbox subsystem. : The sli4 config sub mailbox command opcode. : Length of the sli4 config mailbox command (including sub-header).

This routine sets up the header fields of SLI4 specific mailbox command for sending IOCTL command.

Return: the actual length of the mbox command allocated (mostly useful for none embedded mailbox command).

Definition at line 1761 of file lpfc_mbox.c.

struct lpfc_cq_event* lpfc_sli4_cq_event_alloc ( struct lpfc_hba phba)
read

lpfc_sli4_cq_event_alloc - Allocate a completion-queue event from free pool : pointer to lpfc hba data structure.

This routine is the lock version of the API invoked to allocate a completion-queue event from the free pool.

Return: Pointer to the newly allocated completion-queue event if successful NULL otherwise.

Definition at line 7447 of file lpfc_init.c.

void lpfc_sli4_cq_event_release ( struct lpfc_hba phba,
struct lpfc_cq_event cq_event 
)

lpfc_sli4_cq_event_release - Release a completion-queue event to free pool : pointer to lpfc hba data structure. : pointer to the completion queue event to be freed.

This routine is the lock version of the API invoked to release a completion-queue event back into the free pool.

Definition at line 7482 of file lpfc_init.c.

uint32_t lpfc_sli4_cq_release ( struct lpfc_queue q,
bool  arm 
)

lpfc_sli4_cq_release - Indicates the host has finished processing a CQ : The Completion Queue that the host has completed processing for. : Indicates whether the host wants to arms this CQ.

This routine will mark all Completion queue entries on , from the last known completed entry to the last entry that was processed, as completed by clearing the valid bit for each completion queue entry. Then it will notify the HBA, by ringing the doorbell, that the CQEs have been processed. The internal host index in the will be updated by this routine to indicate that the host has finished processing the entries. The parameter indicates that the queue should be rearmed when ringing the doorbell.

This function will return the number of CQEs that were released.

Definition at line 383 of file lpfc_sli.c.

struct lpfc_rpi_hdr* lpfc_sli4_create_rpi_hdr ( struct lpfc_hba phba)
read

lpfc_sli4_create_rpi_hdr - Allocate an rpi header memory region : pointer to lpfc hba data structure.

This routine is invoked to allocate a single 4KB memory region to support rpis and stores them in the phba. This single region provides support for up to 64 rpis. The region is used globally by the device.

Returns: A valid rpi hdr on success. A NULL pointer on any failure.

Definition at line 5521 of file lpfc_init.c.

void lpfc_sli4_els_xri_abort_event_proc ( struct lpfc_hba phba)

lpfc_sli4_els_xri_abort_event_proc - Process els xri abort event : pointer to lpfc hba data structure.

This routine is invoked by the worker thread to process all the pending SLI4 els abort xri events.

Definition at line 10913 of file lpfc_sli.c.

void lpfc_sli4_els_xri_aborted ( struct lpfc_hba phba,
struct sli4_wcqe_xri_aborted axri 
)

lpfc_sli4_els_xri_aborted - Slow-path process of els xri abort : pointer to lpfc hba data structure. : pointer to the els xri abort wcqe structure.

This routine is invoked by the worker thread to process a SLI4 slow-path ELS aborted xri.

Definition at line 8013 of file lpfc_els.c.

uint32_t lpfc_sli4_eq_release ( struct lpfc_queue q,
bool  arm 
)

lpfc_sli4_eq_release - Indicates the host has finished processing an EQ : The Event Queue that the host has completed processing for. : Indicates whether the host wants to arms this CQ.

This routine will mark all Event Queue Entries on , from the last known completed entry to the last entry that was processed, as completed by clearing the valid bit for each completion queue entry. Then it will notify the HBA, by ringing the doorbell, that the EQEs have been processed. The internal host index in the will be updated by this routine to indicate that the host has finished processing the entries. The parameter indicates that the queue should be rearmed when ringing the doorbell.

This function will return the number of EQEs that were popped.

Definition at line 297 of file lpfc_sli.c.

void lpfc_sli4_fcf_redisc_event_proc ( struct lpfc_hba phba)

lpfc_sli4_fcf_redisc_event_proc - Process fcf table rediscovery event : pointer to lpfc hba data structure.

This routine is invoked by the worker thread to process FCF table rediscovery pending completion event.

Definition at line 4361 of file lpfc_init.c.

int lpfc_sli4_fcf_rr_read_fcf_rec ( struct lpfc_hba phba,
uint16_t  fcf_index 
)

lpfc_sli4_fcf_rr_read_fcf_rec - Read hba fcf record for roundrobin fcf. : pointer to lpfc hba data structure. : FCF table entry offset.

This routine is invoked to read an FCF record indicated by and to use it for FLOGI roundrobin FCF failover.

Return 0 if the mailbox command is submitted successfully, none 0 otherwise.

Definition at line 15129 of file lpfc_sli.c.

int lpfc_sli4_fcf_scan_read_fcf_rec ( struct lpfc_hba phba,
uint16_t  fcf_index 
)

lpfc_sli4_fcf_scan_read_fcf_rec - Read hba fcf record for fcf scan. : pointer to lpfc hba data structure. : FCF table entry offset.

This routine is invoked to scan the entire FCF table by reading FCF record and processing it one at a time starting from the for initial FCF discovery or fast FCF failover rediscovery.

Return 0 if the mailbox command is submitted successfully, none 0 otherwise.

Definition at line 15067 of file lpfc_sli.c.

void lpfc_sli4_fcfi_unreg ( struct lpfc_hba ,
uint16_t   
)
void lpfc_sli4_fcp_xri_abort_event_proc ( struct lpfc_hba phba)

lpfc_sli4_fcp_xri_abort_event_proc - Process fcp xri abort event : pointer to lpfc hba data structure.

This routine is invoked by the worker thread to process all the pending SLI4 FCP abort XRI events.

Definition at line 10884 of file lpfc_sli.c.

void lpfc_sli4_fcp_xri_aborted ( struct lpfc_hba phba,
struct sli4_wcqe_xri_aborted axri 
)

lpfc_sli4_fcp_xri_aborted - Fast-path process of fcp xri abort : pointer to lpfc hba data structure. : pointer to the fcp xri abort wcqe structure.

This routine is invoked by the worker thread to process a SLI4 fast-path FCP aborted xri.

Definition at line 662 of file lpfc_scsi.c.

void lpfc_sli4_free_rpi ( struct lpfc_hba phba,
int  rpi 
)

lpfc_sli4_free_rpi - Release an rpi for reuse. : pointer to lpfc hba data structure.

This routine is invoked to release an rpi to the pool of available rpis maintained by the driver.

Definition at line 14801 of file lpfc_sli.c.

int lpfc_sli4_get_els_iocb_cnt ( struct lpfc_hba phba)

lpfc_sli4_get_els_iocb_cnt - Calculate the # of ELS IOCBs to reserve : pointer to lpfc hba data structure.

returns the number of ELS/CT IOCBs to reserve

Definition at line 9413 of file lpfc_init.c.

void lpfc_sli4_hba_reset ( struct lpfc_hba )
int lpfc_sli4_hba_setup ( struct lpfc_hba phba)

lpfc_sli4_hba_setup - SLI4 device intialization PCI function : Pointer to HBA context object.

This function is the main SLI4 device intialization PCI function. This function is called by the HBA intialization code, HBA reset code and HBA error attention handler code. Caller is not required to hold any locks.

Definition at line 6070 of file lpfc_sli.c.

int lpfc_sli4_init_rpi_hdrs ( struct lpfc_hba phba)

lpfc_sli4_init_rpi_hdrs - Post the rpi header memory region to the port : pointer to lpfc hba data structure.

This routine is invoked to post rpi header templates to the port for those SLI4 ports that do not support extents. This routine posts a PAGE_SIZE memory region to the port to hold up to PAGE_SIZE modulo 64 rpi context headers. This is an initialization routine and should be called only when interrupts are disabled.

Return codes 0 - successful -ERROR - otherwise.

Definition at line 5485 of file lpfc_init.c.

int lpfc_sli4_init_vpi ( struct lpfc_vport vport)

lpfc_sli4_init_vpi - Initialize a vpi with the port : Pointer to the vport for which the vpi is being initialized

This routine is invoked to activate a vpi with the port.

Returns: 0 success -Evalue otherwise

Definition at line 14875 of file lpfc_sli.c.

void lpfc_sli4_mbox_cmd_free ( struct lpfc_hba phba,
struct lpfcMboxq mbox 
)

lpfc_sli4_mbox_cmd_free - Free a sli4 mailbox command : pointer to lpfc hba data structure. : pointer to lpfc mbox command.

This routine frees SLI4 specific mailbox command for sending IOCTL command.

Definition at line 1711 of file lpfc_mbox.c.

int lpfc_sli4_mbx_read_fcf_rec ( struct lpfc_hba phba,
struct lpfcMboxq mboxq,
uint16_t  fcf_index 
)

lpfc_sli4_mbx_read_fcf_rec - Allocate and construct read fcf mbox cmd : pointer to lpfc hba data structure. : index to fcf table.

This routine routine allocates and constructs non-embedded mailbox command for reading a FCF table entry referred by .

Return: pointer to the mailbox command constructed if successful, otherwise NULL.

Definition at line 2007 of file lpfc_mbox.c.

void lpfc_sli4_mbx_sge_get ( struct lpfcMboxq mbox,
uint32_t  sgentry,
struct lpfc_mbx_sge sge 
)

lpfc_sli4_mbx_sge_get - Get a sge entry from non-embedded mailbox command : pointer to lpfc mbox command. : sge entry index.

This routine gets an entry from the non-embedded mailbox command at the sge index location.

Definition at line 1691 of file lpfc_mbox.c.

void lpfc_sli4_mbx_sge_set ( struct lpfcMboxq mbox,
uint32_t  sgentry,
dma_addr_t  phyaddr,
uint32_t  length 
)

lpfc_sli4_mbx_sge_set - Set a sge entry in non-embedded mailbox command : pointer to lpfc mbox command. : sge entry index. : physical address for the sge : Length of the sge.

This routine sets up an entry in the non-embedded mailbox command at the sge index location.

Definition at line 1670 of file lpfc_mbox.c.

uint16_t lpfc_sli4_next_xritag ( struct lpfc_hba phba)

lpfc_sli4_next_xritag - Get an xritag for the io : Pointer to HBA context object.

This function gets an xritag for the iocb. If there is no unused xritag it will return 0xffff. The function returns the allocated xritag if successful, else returns zero. Zero is not a valid xritag. The caller is not required to hold any lock.

Definition at line 13459 of file lpfc_sli.c.

int lpfc_sli4_pdev_status_reg_wait ( struct lpfc_hba phba)

lpfc_sli4_pdev_status_reg_wait - Wait for pdev status register for readyness : lpfc_hba pointer.

Description: SLI4 interface type-2 device to wait on the sliport status register for the readyness after performing a firmware reset.

Returns: zero for success, -EPERM when port does not have privilage to perform the reset, -EIO when port timeout from recovering from the reset.

Note: As the caller will interpret the return code by value, be careful in making change or addition to return codes.

Definition at line 825 of file lpfc_attr.c.

int lpfc_sli4_post_all_rpi_hdrs ( struct lpfc_hba phba)

lpfc_sli4_post_all_rpi_hdrs - Post the rpi header memory region to the port : pointer to lpfc hba data structure.

This routine is invoked to post rpi header templates to the HBA consistent with the SLI-4 interface spec. This routine posts a SLI4_PAGE_SIZE memory region to the port to hold up to SLI4_PAGE_SIZE modulo 64 rpi context headers.

This routine does not require any locks. It's usage is expected to be driver load or reset recovery when the driver is sequential.

Return codes 0 - successful -EIO - The mailbox failed to complete successfully. When this error occurs, the driver is not guaranteed to have any rpi regions posted to the device and must either attempt to repost the regions or take a fatal error.

Definition at line 14587 of file lpfc_sli.c.

int lpfc_sli4_post_async_mbox ( struct lpfc_hba phba)

lpfc_sli4_post_async_mbox - Post an SLI4 mailbox command to device : Pointer to HBA context object.

This function is called by worker thread to send a mailbox command to SLI4 HBA firmware.

Definition at line 7385 of file lpfc_sli.c.

int lpfc_sli4_post_rpi_hdr ( struct lpfc_hba phba,
struct lpfc_rpi_hdr rpi_page 
)

lpfc_sli4_post_rpi_hdr - Post an rpi header memory region to the port : pointer to lpfc hba data structure. : pointer to the rpi memory region.

This routine is invoked to post a single rpi header to the HBA consistent with the SLI-4 interface spec. This memory region maps up to 64 rpi context regions.

Return codes 0 - successful -ENOMEM - No available memory -EIO - The mailbox failed to complete successfully.

Definition at line 14640 of file lpfc_sli.c.

int lpfc_sli4_post_scsi_sgl_block ( struct lpfc_hba phba,
struct list_head sblist,
int  count 
)

lpfc_sli4_post_scsi_sgl_block - post a block of scsi sgl list to firmware : pointer to lpfc hba data structure. : pointer to scsi buffer list. : number of scsi buffers on the list.

This routine is invoked to post a block of scsi sgl pages from a SCSI buffer list to the HBA using non-embedded mailbox command. No Lock is held.

Definition at line 13588 of file lpfc_sli.c.

int lpfc_sli4_post_sgl ( struct lpfc_hba phba,
dma_addr_t  pdma_phys_addr0,
dma_addr_t  pdma_phys_addr1,
uint16_t  xritag 
)

lpfc_sli4_post_sgl - Post scatter gather list for an XRI to HBA : The virtual port for which this call being executed. : Physical address of the 1st SGL page. : Physical address of the 2nd SGL page. : the xritag that ties this io to the SGL pages.

This routine will post the sgl pages for the IO that has the xritag that is in the iocbq structure. The xritag is assigned during iocbq creation and persists for as long as the driver is loaded. if the caller has fewer than 256 scatter gather segments to map then pdma_phys_addr1 should be 0. If the caller needs to map more than 256 scatter gather segment then pdma_phys_addr1 should be a valid physical address. physical address for SGLs must be 64 byte aligned. If you are going to map 2 SGL's then the first one must have 256 entries the second sgl can have between 1 and 256 entries.

Return codes: 0 - Success -ENXIO, -ENOMEM - Failure

Definition at line 13319 of file lpfc_sli.c.

int lpfc_sli4_post_status_check ( struct lpfc_hba phba)

lpfc_sli4_post_status_check - Wait for SLI4 POST done and check status : pointer to lpfc hba data structure.

This routine is invoked to wait for SLI4 device Power On Self Test (POST) done and check status.

Return 0 if successful, otherwise -ENODEV.

Definition at line 6066 of file lpfc_init.c.

struct lpfc_queue* lpfc_sli4_queue_alloc ( struct lpfc_hba phba,
uint32_t  entry_size,
uint32_t  entry_count 
)
read

lpfc_sli4_queue_alloc - Allocate and initialize a queue structure : The HBA that this queue is being created on. : The size of each queue entry for this queue. count: The number of entries that this queue will handle.

This function allocates a queue structure and the DMAable memory used for the host resident queue. This function must be called before creating the queue on the HBA.

Definition at line 12037 of file lpfc_sli.c.

void lpfc_sli4_queue_free ( struct lpfc_queue queue)

lpfc_sli4_queue_free - free a queue structure and associated memory : The queue structure to free.

This function frees a queue structure and the DMAable memory used for the host resident queue. This function must be called after destroying the queue on the HBA.

Definition at line 12008 of file lpfc_sli.c.

int lpfc_sli4_queue_setup ( struct lpfc_hba phba)

lpfc_sli4_queue_setup - Set up all the SLI4 queues : pointer to lpfc hba data structure.

This routine is invoked to set up all the SLI4 queues for the FCoE HBA operation.

Return codes 0 - successful -ENOMEM - No available memory -EIO - The mailbox failed to complete successfully.

Definition at line 7046 of file lpfc_init.c.

void lpfc_sli4_queue_unset ( struct lpfc_hba phba)

lpfc_sli4_queue_unset - Unset all the SLI4 queues : pointer to lpfc hba data structure.

This routine is invoked to unset all the SLI4 queues with the FCoE HBA operation.

Return codes 0 - successful -ENOMEM - No available memory -EIO - The mailbox failed to complete successfully.

Definition at line 7324 of file lpfc_init.c.

int lpfc_sli4_read_fcf_rec ( struct lpfc_hba phba,
uint16_t  fcf_index 
)

lpfc_sli4_read_fcf_rec - Read hba fcf record for update eligible fcf bmask. : pointer to lpfc hba data structure. : FCF table entry offset.

This routine is invoked to read an FCF record indicated by to determine whether it's eligible for FLOGI roundrobin failover list.

Return 0 if the mailbox command is submitted successfully, none 0 otherwise.

Definition at line 15175 of file lpfc_sli.c.

void lpfc_sli4_remove_rpi_hdrs ( struct lpfc_hba phba)

lpfc_sli4_remove_rpi_hdrs - Remove all rpi header memory regions : pointer to lpfc hba data structure.

This routine is invoked to remove all memory resources allocated to support rpis for SLI4 ports not supporting extents. This routine presumes the caller has released all rpis consumed by fabric or port logins and is prepared to have the header pages removed.

Definition at line 5626 of file lpfc_init.c.

void lpfc_sli4_remove_rpis ( struct lpfc_hba phba)

lpfc_sli4_remove_rpis - Remove the rpi bitmask region : pointer to lpfc hba data structure.

This routine is invoked to remove the memory region that provided rpi via a bitmask.

Definition at line 14816 of file lpfc_sli.c.

int lpfc_sli4_repost_scsi_sgl_list ( struct lpfc_hba phba)

lpfc_sli4_repost_scsi_sgl_list - Repsot all the allocated scsi buffer sgls : pointer to lpfc hba data structure.

This routine walks the list of scsi buffers that have been allocated and repost them to the port by using SGL block post. This is needed after a pci_function_reset/warm_start or start. The lpfc_hba_down_post_s4 routine is responsible for moving all scsi buffers on the lpfc_abts_scsi_sgl_list to the lpfc_scsi_buf_list. If the repost fails, reject all scsi buffers.

Returns: 0 = success, non-zero failure.

Definition at line 862 of file lpfc_scsi.c.

int lpfc_sli4_resume_rpi ( struct lpfc_nodelist ndlp,
void(*)(struct lpfc_hba *, LPFC_MBOXQ_t *)  cmpl,
void arg 
)

lpfc_sli4_resume_rpi - Remove the rpi bitmask region : pointer to lpfc hba data structure.

This routine is invoked to remove the memory region that provided rpi via a bitmask.

Definition at line 14831 of file lpfc_sli.c.

int lpfc_sli4_unregister_fcf ( struct lpfc_hba phba)

lpfc_sli4_unregister_fcf - Unregister currently registered FCF record : Pointer to hba context object.

This function issues synchronous unregister FCF mailbox command to HBA to unregister the currently registered FCF record. The driver does not reset the driver FCF usage state flags.

Return 0 if successfully issued, none-zero otherwise.

Definition at line 5894 of file lpfc_hbadisc.c.

void lpfc_sli4_vport_delete_els_xri_aborted ( struct lpfc_vport vport)

lpfc_sli4_vport_delete_els_xri_aborted -Remove all ndlp references for vport : pointer to lpfc vport data structure.

This routine is invoked by the vport cleanup for deletions and the cleanup for an ndlp on removal.

Definition at line 7986 of file lpfc_els.c.

void lpfc_sli4_vport_delete_fcp_xri_aborted ( struct lpfc_vport vport)

lpfc_sli4_vport_delete_fcp_xri_aborted -Remove all ndlp references for vport : pointer to lpfc vport data structure.

This routine is invoked by the vport cleanup for deletions and the cleanup for an ndlp on removal.

Definition at line 635 of file lpfc_scsi.c.

uint8_t lpfc_sli_config_mbox_opcode_get ( struct lpfc_hba phba,
LPFC_MBOXQ_t mbox 
)

lpfc_sli_config_mbox_opcode_get - Get opcode from a sli_config mbox cmd : pointer to lpfc hba data structure. : pointer to lpfc mbox command queue entry.

This routine gets the opcode from a SLI4 specific SLI_CONFIG mailbox command. If the mailbox command is not MBX_SLI4_CONFIG (0x9B) or if the sub-header is not present, opcode LPFC_MBOX_OPCODE_NA (0x0) be returned.

Definition at line 1973 of file lpfc_mbox.c.

uint8_t lpfc_sli_config_mbox_subsys_get ( struct lpfc_hba phba,
LPFC_MBOXQ_t mbox 
)

lpfc_sli_config_mbox_subsys_get - Get subsystem from a sli_config mbox cmd : pointer to lpfc hba data structure. : pointer to lpfc mbox command queue entry.

This routine gets the subsystem from a SLI4 specific SLI_CONFIG mailbox command. If the mailbox command is not MBX_SLI4_CONFIG (0x9B) or if the sub-header is not present, subsystem LPFC_MBOX_SUBSYSTEM_NA (0x0) shall be returned.

Definition at line 1940 of file lpfc_mbox.c.

void lpfc_sli_remove_dflt_fcf ( struct lpfc_hba )
uint32_t lpfc_wq_create ( struct lpfc_hba phba,
struct lpfc_queue wq,
struct lpfc_queue cq,
uint32_t  subtype 
)

lpfc_wq_create - Create a Work Queue on the HBA : HBA structure that indicates port to create a queue on. : The queue structure to use to create the work queue. : The completion queue to bind this work queue to. : The subtype of the work queue indicating its functionality.

This function creates a work queue, as detailed in , on a port, described by by sending a WQ_CREATE mailbox command to the HBA.

The struct is used to send mailbox command to HBA. The struct is used to get the entry count and entry size that are necessary to determine the number of pages to allocate and use for this queue. The is used to indicate which completion queue to bind this work queue to. This function will send the WQ_CREATE mailbox command to the HBA to setup the work queue. This function is asynchronous and will wait for the mailbox command to finish before continuing.

On success this function will return a zero. If unable to allocate enough memory this function will return -ENOMEM. If the queue create mailbox command fails this function will return -ENXIO.

Definition at line 12665 of file lpfc_sli.c.

uint32_t lpfc_wq_destroy ( struct lpfc_hba phba,
struct lpfc_queue wq 
)

lpfc_wq_destroy - Destroy a Work Queue on the HBA : The queue structure associated with the queue to destroy.

This function destroys a queue, as detailed in by sending an mailbox command, specific to the type of queue, to the HBA.

The struct is used to get the queue ID of the queue to destroy.

On success this function will return a zero. If the queue destroy mailbox command fails this function will return -ENXIO.

Definition at line 13185 of file lpfc_sli.c.