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

Go to the source code of this file.

Macros

#define ScsiResult(host_code, scsi_code)   (((host_code) << 16) | scsi_code)
 
#define HBA_EVENT_RSCN   5
 
#define HBA_EVENT_LINK_UP   2
 
#define HBA_EVENT_LINK_DOWN   3
 

Typedefs

typedef int(* node_filter )(struct lpfc_nodelist *, void *)
 

Functions

void lpfc_down_link (struct lpfc_hba *, LPFC_MBOXQ_t *)
 
void lpfc_sli_read_link_ste (struct lpfc_hba *)
 
void lpfc_dump_mem (struct lpfc_hba *, LPFC_MBOXQ_t *, uint16_t, uint16_t)
 
void lpfc_dump_wakeup_param (struct lpfc_hba *, LPFC_MBOXQ_t *)
 
int lpfc_dump_static_vport (struct lpfc_hba *, LPFC_MBOXQ_t *, uint16_t)
 
int lpfc_sli4_dump_cfg_rg23 (struct lpfc_hba *, struct lpfcMboxq *)
 
void lpfc_read_nv (struct lpfc_hba *, LPFC_MBOXQ_t *)
 
void lpfc_config_async (struct lpfc_hba *, LPFC_MBOXQ_t *, uint32_t)
 
void lpfc_heart_beat (struct lpfc_hba *, LPFC_MBOXQ_t *)
 
int lpfc_read_topology (struct lpfc_hba *, LPFC_MBOXQ_t *, struct lpfc_dmabuf *)
 
void lpfc_clear_la (struct lpfc_hba *, LPFC_MBOXQ_t *)
 
void lpfc_issue_clear_la (struct lpfc_hba *, struct lpfc_vport *)
 
void lpfc_config_link (struct lpfc_hba *, LPFC_MBOXQ_t *)
 
int lpfc_config_msi (struct lpfc_hba *, LPFC_MBOXQ_t *)
 
int lpfc_read_sparam (struct lpfc_hba *, LPFC_MBOXQ_t *, int)
 
void lpfc_read_config (struct lpfc_hba *, LPFC_MBOXQ_t *)
 
void lpfc_read_lnk_stat (struct lpfc_hba *, LPFC_MBOXQ_t *)
 
int lpfc_reg_rpi (struct lpfc_hba *, uint16_t, uint32_t, uint8_t *, LPFC_MBOXQ_t *, uint16_t)
 
void lpfc_set_var (struct lpfc_hba *, LPFC_MBOXQ_t *, uint32_t, uint32_t)
 
void lpfc_unreg_login (struct lpfc_hba *, uint16_t, uint32_t, LPFC_MBOXQ_t *)
 
void lpfc_unreg_did (struct lpfc_hba *, uint16_t, uint32_t, LPFC_MBOXQ_t *)
 
void lpfc_sli4_unreg_all_rpis (struct lpfc_vport *)
 
void lpfc_reg_vpi (struct lpfc_vport *, LPFC_MBOXQ_t *)
 
void lpfc_register_new_vport (struct lpfc_hba *, struct lpfc_vport *, struct lpfc_nodelist *)
 
void lpfc_unreg_vpi (struct lpfc_hba *, uint16_t, LPFC_MBOXQ_t *)
 
void lpfc_init_link (struct lpfc_hba *, LPFC_MBOXQ_t *, uint32_t, uint32_t)
 
void lpfc_request_features (struct lpfc_hba *, struct lpfcMboxq *)
 
void lpfc_supported_pages (struct lpfcMboxq *)
 
void lpfc_pc_sli4_params (struct lpfcMboxq *)
 
int lpfc_pc_sli4_params_get (struct lpfc_hba *, LPFC_MBOXQ_t *)
 
int lpfc_sli4_mbox_rsrc_extent (struct lpfc_hba *, struct lpfcMboxq *, uint16_t, uint16_t, bool)
 
int lpfc_get_sli4_parameters (struct lpfc_hba *, LPFC_MBOXQ_t *)
 
struct lpfc_vportlpfc_find_vport_by_did (struct lpfc_hba *, uint32_t)
 
void lpfc_cleanup_rcv_buffers (struct lpfc_vport *)
 
void lpfc_rcv_seq_check_edtov (struct lpfc_vport *)
 
void lpfc_cleanup_rpis (struct lpfc_vport *, int)
 
void lpfc_cleanup_pending_mbox (struct lpfc_vport *)
 
int lpfc_linkdown (struct lpfc_hba *)
 
void lpfc_linkdown_port (struct lpfc_vport *)
 
void lpfc_port_link_failure (struct lpfc_vport *)
 
void lpfc_mbx_cmpl_read_topology (struct lpfc_hba *, LPFC_MBOXQ_t *)
 
void lpfc_init_vpi_cmpl (struct lpfc_hba *, LPFC_MBOXQ_t *)
 
void lpfc_cancel_all_vport_retry_delay_timer (struct lpfc_hba *)
 
void lpfc_retry_pport_discovery (struct lpfc_hba *)
 
void lpfc_release_rpi (struct lpfc_hba *, struct lpfc_vport *, uint16_t)
 
void lpfc_mbx_cmpl_reg_login (struct lpfc_hba *, LPFC_MBOXQ_t *)
 
void lpfc_mbx_cmpl_dflt_rpi (struct lpfc_hba *, LPFC_MBOXQ_t *)
 
void lpfc_mbx_cmpl_fabric_reg_login (struct lpfc_hba *, LPFC_MBOXQ_t *)
 
void lpfc_mbx_cmpl_ns_reg_login (struct lpfc_hba *, LPFC_MBOXQ_t *)
 
void lpfc_mbx_cmpl_fdmi_reg_login (struct lpfc_hba *, LPFC_MBOXQ_t *)
 
void lpfc_mbx_cmpl_reg_vfi (struct lpfc_hba *, LPFC_MBOXQ_t *)
 
void lpfc_unregister_vfi_cmpl (struct lpfc_hba *, LPFC_MBOXQ_t *)
 
void lpfc_enqueue_node (struct lpfc_vport *, struct lpfc_nodelist *)
 
void lpfc_dequeue_node (struct lpfc_vport *, struct lpfc_nodelist *)
 
struct lpfc_nodelistlpfc_enable_node (struct lpfc_vport *, struct lpfc_nodelist *, int)
 
void lpfc_nlp_set_state (struct lpfc_vport *, struct lpfc_nodelist *, int)
 
void lpfc_drop_node (struct lpfc_vport *, struct lpfc_nodelist *)
 
void lpfc_set_disctmo (struct lpfc_vport *)
 
int lpfc_can_disctmo (struct lpfc_vport *)
 
int lpfc_unreg_rpi (struct lpfc_vport *, struct lpfc_nodelist *)
 
void lpfc_unreg_all_rpis (struct lpfc_vport *)
 
void lpfc_unreg_hba_rpis (struct lpfc_hba *)
 
void lpfc_unreg_default_rpis (struct lpfc_vport *)
 
void lpfc_issue_reg_vpi (struct lpfc_hba *, struct lpfc_vport *)
 
int lpfc_check_sli_ndlp (struct lpfc_hba *, struct lpfc_sli_ring *, struct lpfc_iocbq *, struct lpfc_nodelist *)
 
void lpfc_nlp_init (struct lpfc_vport *, struct lpfc_nodelist *, uint32_t)
 
struct lpfc_nodelistlpfc_nlp_get (struct lpfc_nodelist *)
 
int lpfc_nlp_put (struct lpfc_nodelist *)
 
int lpfc_nlp_not_used (struct lpfc_nodelist *ndlp)
 
struct lpfc_nodelistlpfc_setup_disc_node (struct lpfc_vport *, uint32_t)
 
void lpfc_disc_list_loopmap (struct lpfc_vport *)
 
void lpfc_disc_start (struct lpfc_vport *)
 
void lpfc_cleanup_discovery_resources (struct lpfc_vport *)
 
void lpfc_cleanup (struct lpfc_vport *)
 
void lpfc_disc_timeout (unsigned long)
 
struct lpfc_nodelist__lpfc_findnode_rpi (struct lpfc_vport *, uint16_t)
 
struct lpfc_nodelistlpfc_findnode_rpi (struct lpfc_vport *, uint16_t)
 
void lpfc_worker_wake_up (struct lpfc_hba *)
 
int lpfc_workq_post_event (struct lpfc_hba *, void *, void *, uint32_t)
 
int lpfc_do_work (void *)
 
int lpfc_disc_state_machine (struct lpfc_vport *, struct lpfc_nodelist *, void *, uint32_t)
 
void lpfc_do_scr_ns_plogi (struct lpfc_hba *, struct lpfc_vport *)
 
int lpfc_check_sparm (struct lpfc_vport *, struct lpfc_nodelist *, struct serv_parm *, uint32_t, int)
 
int lpfc_els_abort (struct lpfc_hba *, struct lpfc_nodelist *)
 
void lpfc_more_plogi (struct lpfc_vport *)
 
void lpfc_more_adisc (struct lpfc_vport *)
 
void lpfc_end_rscn (struct lpfc_vport *)
 
int lpfc_els_chk_latt (struct lpfc_vport *)
 
int lpfc_els_abort_flogi (struct lpfc_hba *)
 
int lpfc_initial_flogi (struct lpfc_vport *)
 
void lpfc_issue_init_vfi (struct lpfc_vport *)
 
int lpfc_initial_fdisc (struct lpfc_vport *)
 
int lpfc_issue_els_plogi (struct lpfc_vport *, uint32_t, uint8_t)
 
int lpfc_issue_els_prli (struct lpfc_vport *, struct lpfc_nodelist *, uint8_t)
 
int lpfc_issue_els_adisc (struct lpfc_vport *, struct lpfc_nodelist *, uint8_t)
 
int lpfc_issue_els_logo (struct lpfc_vport *, struct lpfc_nodelist *, uint8_t)
 
int lpfc_issue_els_npiv_logo (struct lpfc_vport *, struct lpfc_nodelist *)
 
int lpfc_issue_els_scr (struct lpfc_vport *, uint32_t, uint8_t)
 
int lpfc_issue_fabric_reglogin (struct lpfc_vport *)
 
int lpfc_els_free_iocb (struct lpfc_hba *, struct lpfc_iocbq *)
 
int lpfc_ct_free_iocb (struct lpfc_hba *, struct lpfc_iocbq *)
 
int lpfc_els_rsp_acc (struct lpfc_vport *, uint32_t, struct lpfc_iocbq *, struct lpfc_nodelist *, LPFC_MBOXQ_t *)
 
int lpfc_els_rsp_reject (struct lpfc_vport *, uint32_t, struct lpfc_iocbq *, struct lpfc_nodelist *, LPFC_MBOXQ_t *)
 
int lpfc_els_rsp_adisc_acc (struct lpfc_vport *, struct lpfc_iocbq *, struct lpfc_nodelist *)
 
int lpfc_els_rsp_prli_acc (struct lpfc_vport *, struct lpfc_iocbq *, struct lpfc_nodelist *)
 
void lpfc_cancel_retry_delay_tmo (struct lpfc_vport *, struct lpfc_nodelist *)
 
void lpfc_els_retry_delay (unsigned long)
 
void lpfc_els_retry_delay_handler (struct lpfc_nodelist *)
 
void lpfc_els_unsol_event (struct lpfc_hba *, struct lpfc_sli_ring *, struct lpfc_iocbq *)
 
int lpfc_els_handle_rscn (struct lpfc_vport *)
 
void lpfc_els_flush_rscn (struct lpfc_vport *)
 
int lpfc_rscn_payload_check (struct lpfc_vport *, uint32_t)
 
void lpfc_els_flush_all_cmd (struct lpfc_hba *)
 
void lpfc_els_flush_cmd (struct lpfc_vport *)
 
int lpfc_els_disc_adisc (struct lpfc_vport *)
 
int lpfc_els_disc_plogi (struct lpfc_vport *)
 
void lpfc_els_timeout (unsigned long)
 
void lpfc_els_timeout_handler (struct lpfc_vport *)
 
struct lpfc_iocbqlpfc_prep_els_iocb (struct lpfc_vport *, uint8_t, uint16_t, uint8_t, struct lpfc_nodelist *, uint32_t, uint32_t)
 
void lpfc_hb_timeout_handler (struct lpfc_hba *)
 
void lpfc_ct_unsol_event (struct lpfc_hba *, struct lpfc_sli_ring *, struct lpfc_iocbq *)
 
void lpfc_sli4_ct_abort_unsol_event (struct lpfc_hba *, struct lpfc_sli_ring *, struct lpfc_iocbq *)
 
int lpfc_ns_cmd (struct lpfc_vport *, int, uint8_t, uint32_t)
 
int lpfc_fdmi_cmd (struct lpfc_vport *, struct lpfc_nodelist *, int)
 
void lpfc_fdmi_tmo (unsigned long)
 
void lpfc_fdmi_timeout_handler (struct lpfc_vport *)
 
void lpfc_delayed_disc_tmo (unsigned long)
 
void lpfc_delayed_disc_timeout_handler (struct lpfc_vport *)
 
int lpfc_config_port_prep (struct lpfc_hba *)
 
void lpfc_update_vport_wwn (struct lpfc_vport *vport)
 
int lpfc_config_port_post (struct lpfc_hba *)
 
int lpfc_hba_down_prep (struct lpfc_hba *)
 
int lpfc_hba_down_post (struct lpfc_hba *)
 
void lpfc_hba_init (struct lpfc_hba *, uint32_t *)
 
int lpfc_post_buffer (struct lpfc_hba *, struct lpfc_sli_ring *, int)
 
void lpfc_decode_firmware_rev (struct lpfc_hba *, char *, int)
 
int lpfc_online (struct lpfc_hba *)
 
void lpfc_unblock_mgmt_io (struct lpfc_hba *)
 
void lpfc_offline_prep (struct lpfc_hba *, int)
 
void lpfc_offline (struct lpfc_hba *)
 
void lpfc_reset_hba (struct lpfc_hba *)
 
int lpfc_sli_setup (struct lpfc_hba *)
 
int lpfc_sli_queue_setup (struct lpfc_hba *)
 
void lpfc_handle_eratt (struct lpfc_hba *)
 
void lpfc_handle_latt (struct lpfc_hba *)
 
irqreturn_t lpfc_sli_intr_handler (int, void *)
 
irqreturn_t lpfc_sli_sp_intr_handler (int, void *)
 
irqreturn_t lpfc_sli_fp_intr_handler (int, void *)
 
irqreturn_t lpfc_sli4_intr_handler (int, void *)
 
irqreturn_t lpfc_sli4_hba_intr_handler (int, void *)
 
void lpfc_read_rev (struct lpfc_hba *, LPFC_MBOXQ_t *)
 
void lpfc_sli4_swap_str (struct lpfc_hba *, LPFC_MBOXQ_t *)
 
void lpfc_config_ring (struct lpfc_hba *, int, LPFC_MBOXQ_t *)
 
void lpfc_config_port (struct lpfc_hba *, LPFC_MBOXQ_t *)
 
void lpfc_kill_board (struct lpfc_hba *, LPFC_MBOXQ_t *)
 
void lpfc_mbox_put (struct lpfc_hba *, LPFC_MBOXQ_t *)
 
LPFC_MBOXQ_tlpfc_mbox_get (struct lpfc_hba *)
 
void __lpfc_mbox_cmpl_put (struct lpfc_hba *, LPFC_MBOXQ_t *)
 
void lpfc_mbox_cmpl_put (struct lpfc_hba *, LPFC_MBOXQ_t *)
 
int lpfc_mbox_cmd_check (struct lpfc_hba *, LPFC_MBOXQ_t *)
 
int lpfc_mbox_dev_check (struct lpfc_hba *)
 
int lpfc_mbox_tmo_val (struct lpfc_hba *, LPFC_MBOXQ_t *)
 
void lpfc_init_vfi (struct lpfcMboxq *, struct lpfc_vport *)
 
void lpfc_reg_vfi (struct lpfcMboxq *, struct lpfc_vport *, dma_addr_t)
 
void lpfc_init_vpi (struct lpfc_hba *, struct lpfcMboxq *, uint16_t)
 
void lpfc_unreg_vfi (struct lpfcMboxq *, struct lpfc_vport *)
 
void lpfc_reg_fcfi (struct lpfc_hba *, struct lpfcMboxq *)
 
void lpfc_unreg_fcfi (struct lpfcMboxq *, uint16_t)
 
void lpfc_resume_rpi (struct lpfcMboxq *, struct lpfc_nodelist *)
 
int lpfc_check_pending_fcoe_event (struct lpfc_hba *, uint8_t)
 
void lpfc_issue_init_vpi (struct lpfc_vport *)
 
void lpfc_config_hbq (struct lpfc_hba *, uint32_t, struct lpfc_hbq_init *, uint32_t, LPFC_MBOXQ_t *)
 
struct hbq_dmabuflpfc_els_hbq_alloc (struct lpfc_hba *)
 
void lpfc_els_hbq_free (struct lpfc_hba *, struct hbq_dmabuf *)
 
struct hbq_dmabuflpfc_sli4_rb_alloc (struct lpfc_hba *)
 
void lpfc_sli4_rb_free (struct lpfc_hba *, struct hbq_dmabuf *)
 
void lpfc_sli4_build_dflt_fcf_record (struct lpfc_hba *, struct fcf_record *, uint16_t)
 
void lpfc_unregister_fcf (struct lpfc_hba *)
 
void lpfc_unregister_fcf_rescan (struct lpfc_hba *)
 
void lpfc_unregister_unused_fcf (struct lpfc_hba *)
 
int lpfc_sli4_redisc_fcf_table (struct lpfc_hba *)
 
void lpfc_fcf_redisc_wait_start_timer (struct lpfc_hba *)
 
void lpfc_sli4_fcf_dead_failthrough (struct lpfc_hba *)
 
uint16_t lpfc_sli4_fcf_rr_next_index_get (struct lpfc_hba *)
 
void lpfc_sli4_set_fcf_flogi_fail (struct lpfc_hba *, uint16_t)
 
int lpfc_sli4_fcf_rr_index_set (struct lpfc_hba *, uint16_t)
 
void lpfc_sli4_fcf_rr_index_clear (struct lpfc_hba *, uint16_t)
 
int lpfc_sli4_fcf_rr_next_proc (struct lpfc_vport *, uint16_t)
 
void lpfc_sli4_clear_fcf_rr_bmask (struct lpfc_hba *)
 
int lpfc_mem_alloc (struct lpfc_hba *, int align)
 
void lpfc_mem_free (struct lpfc_hba *)
 
void lpfc_mem_free_all (struct lpfc_hba *)
 
void lpfc_stop_vport_timers (struct lpfc_vport *)
 
void lpfc_poll_timeout (unsigned long ptr)
 
void lpfc_poll_start_timer (struct lpfc_hba *)
 
void lpfc_poll_eratt (unsigned long)
 
int lpfc_sli_handle_fast_ring_event (struct lpfc_hba *, struct lpfc_sli_ring *, uint32_t)
 
struct lpfc_iocbq__lpfc_sli_get_iocbq (struct lpfc_hba *)
 
struct lpfc_iocbqlpfc_sli_get_iocbq (struct lpfc_hba *)
 
void lpfc_sli_release_iocbq (struct lpfc_hba *, struct lpfc_iocbq *)
 
uint16_t lpfc_sli_next_iotag (struct lpfc_hba *, struct lpfc_iocbq *)
 
void lpfc_sli_cancel_iocbs (struct lpfc_hba *, struct list_head *, uint32_t, uint32_t)
 
void lpfc_sli_wake_mbox_wait (struct lpfc_hba *, LPFC_MBOXQ_t *)
 
int lpfc_selective_reset (struct lpfc_hba *)
 
void lpfc_reset_barrier (struct lpfc_hba *)
 
int lpfc_sli_brdready (struct lpfc_hba *, uint32_t)
 
int lpfc_sli_brdkill (struct lpfc_hba *)
 
int lpfc_sli_brdreset (struct lpfc_hba *)
 
int lpfc_sli_brdrestart (struct lpfc_hba *)
 
int lpfc_sli_hba_setup (struct lpfc_hba *)
 
int lpfc_sli_config_port (struct lpfc_hba *, int)
 
int lpfc_sli_host_down (struct lpfc_vport *)
 
int lpfc_sli_hba_down (struct lpfc_hba *)
 
int lpfc_sli_issue_mbox (struct lpfc_hba *, LPFC_MBOXQ_t *, uint32_t)
 
int lpfc_sli_handle_mb_event (struct lpfc_hba *)
 
void lpfc_sli_mbox_sys_shutdown (struct lpfc_hba *, int)
 
int lpfc_sli_check_eratt (struct lpfc_hba *)
 
void lpfc_sli_handle_slow_ring_event (struct lpfc_hba *, struct lpfc_sli_ring *, uint32_t)
 
void lpfc_sli4_handle_received_buffer (struct lpfc_hba *, struct hbq_dmabuf *)
 
void lpfc_sli_def_mbox_cmpl (struct lpfc_hba *, LPFC_MBOXQ_t *)
 
int lpfc_sli_issue_iocb (struct lpfc_hba *, uint32_t, struct lpfc_iocbq *, uint32_t)
 
void lpfc_sli_pcimem_bcopy (void *, void *, uint32_t)
 
void lpfc_sli_bemem_bcopy (void *, void *, uint32_t)
 
void lpfc_sli_abort_iocb_ring (struct lpfc_hba *, struct lpfc_sli_ring *)
 
void lpfc_sli_hba_iocb_abort (struct lpfc_hba *)
 
void lpfc_sli_flush_fcp_rings (struct lpfc_hba *)
 
int lpfc_sli_ringpostbuf_put (struct lpfc_hba *, struct lpfc_sli_ring *, struct lpfc_dmabuf *)
 
struct lpfc_dmabuflpfc_sli_ringpostbuf_get (struct lpfc_hba *, struct lpfc_sli_ring *, dma_addr_t)
 
uint32_t lpfc_sli_get_buffer_tag (struct lpfc_hba *)
 
struct lpfc_dmabuflpfc_sli_ring_taggedbuf_get (struct lpfc_hba *, struct lpfc_sli_ring *, uint32_t)
 
int lpfc_sli_hbq_count (void)
 
int lpfc_sli_hbqbuf_add_hbqs (struct lpfc_hba *, uint32_t)
 
void lpfc_sli_hbqbuf_free_all (struct lpfc_hba *)
 
int lpfc_sli_hbq_size (void)
 
int lpfc_sli_issue_abort_iotag (struct lpfc_hba *, struct lpfc_sli_ring *, struct lpfc_iocbq *)
 
int lpfc_sli_sum_iocb (struct lpfc_vport *, uint16_t, uint64_t, lpfc_ctx_cmd)
 
int lpfc_sli_abort_iocb (struct lpfc_vport *, struct lpfc_sli_ring *, uint16_t, uint64_t, lpfc_ctx_cmd)
 
void lpfc_mbox_timeout (unsigned long)
 
void lpfc_mbox_timeout_handler (struct lpfc_hba *)
 
struct lpfc_nodelistlpfc_findnode_did (struct lpfc_vport *, uint32_t)
 
struct lpfc_nodelistlpfc_findnode_wwpn (struct lpfc_vport *, struct lpfc_name *)
 
int lpfc_sli_issue_mbox_wait (struct lpfc_hba *, LPFC_MBOXQ_t *, uint32_t)
 
int lpfc_sli_issue_iocb_wait (struct lpfc_hba *, uint32_t, struct lpfc_iocbq *, struct lpfc_iocbq *, uint32_t)
 
void lpfc_sli_abort_fcp_cmpl (struct lpfc_hba *, struct lpfc_iocbq *, struct lpfc_iocbq *)
 
void lpfc_sli_free_hbq (struct lpfc_hba *, struct hbq_dmabuf *)
 
voidlpfc_mbuf_alloc (struct lpfc_hba *, int, dma_addr_t *)
 
void __lpfc_mbuf_free (struct lpfc_hba *, void *, dma_addr_t)
 
void lpfc_mbuf_free (struct lpfc_hba *, void *, dma_addr_t)
 
void lpfc_in_buf_free (struct lpfc_hba *, struct lpfc_dmabuf *)
 
const charlpfc_info (struct Scsi_Host *)
 
int lpfc_scan_finished (struct Scsi_Host *, unsigned long)
 
int lpfc_init_api_table_setup (struct lpfc_hba *, uint8_t)
 
int lpfc_sli_api_table_setup (struct lpfc_hba *, uint8_t)
 
int lpfc_scsi_api_table_setup (struct lpfc_hba *, uint8_t)
 
int lpfc_mbox_api_table_setup (struct lpfc_hba *, uint8_t)
 
int lpfc_api_table_setup (struct lpfc_hba *, uint8_t)
 
void lpfc_get_cfgparam (struct lpfc_hba *)
 
void lpfc_get_vport_cfgparam (struct lpfc_vport *)
 
int lpfc_alloc_sysfs_attr (struct lpfc_vport *)
 
void lpfc_free_sysfs_attr (struct lpfc_vport *)
 
int lpfc_vport_symbolic_node_name (struct lpfc_vport *, char *, size_t)
 
int lpfc_vport_symbolic_port_name (struct lpfc_vport *, char *, size_t)
 
void lpfc_terminate_rport_io (struct fc_rport *)
 
void lpfc_dev_loss_tmo_callbk (struct fc_rport *rport)
 
struct lpfc_vportlpfc_create_port (struct lpfc_hba *, int, struct device *)
 
int lpfc_vport_disable (struct fc_vport *fc_vport, bool disable)
 
int lpfc_mbx_unreg_vpi (struct lpfc_vport *)
 
void destroy_port (struct lpfc_vport *)
 
int lpfc_get_instance (void)
 
void lpfc_host_attrib_init (struct Scsi_Host *)
 
void lpfc_debugfs_initialize (struct lpfc_vport *)
 
void lpfc_debugfs_terminate (struct lpfc_vport *)
 
void lpfc_debugfs_disc_trc (struct lpfc_vport *, int, char *, uint32_t, uint32_t, uint32_t)
 
void lpfc_debugfs_slow_ring_trc (struct lpfc_hba *, char *, uint32_t, uint32_t, uint32_t)
 
int lpfc_sli4_alloc_resource_identifiers (struct lpfc_hba *)
 
int lpfc_sli4_dealloc_resource_identifiers (struct lpfc_hba *)
 
int lpfc_sli4_get_allocated_extnts (struct lpfc_hba *, uint16_t, uint16_t *, uint16_t *)
 
int lpfc_sli4_get_avail_extnt_rsrc (struct lpfc_hba *, uint16_t, uint16_t *, uint16_t *)
 
void lpfc_fabric_abort_nport (struct lpfc_nodelist *)
 
void lpfc_fabric_abort_hba (struct lpfc_hba *)
 
void lpfc_fabric_block_timeout (unsigned long)
 
void lpfc_unblock_fabric_iocbs (struct lpfc_hba *)
 
void lpfc_rampdown_queue_depth (struct lpfc_hba *)
 
void lpfc_ramp_down_queue_handler (struct lpfc_hba *)
 
void lpfc_ramp_up_queue_handler (struct lpfc_hba *)
 
void lpfc_scsi_dev_block (struct lpfc_hba *)
 
void lpfc_send_els_failure_event (struct lpfc_hba *, struct lpfc_iocbq *, struct lpfc_iocbq *)
 
struct lpfc_fast_path_eventlpfc_alloc_fast_evt (struct lpfc_hba *)
 
void lpfc_free_fast_evt (struct lpfc_hba *, struct lpfc_fast_path_event *)
 
void lpfc_create_static_vport (struct lpfc_hba *)
 
void lpfc_stop_hba_timers (struct lpfc_hba *)
 
void lpfc_stop_port (struct lpfc_hba *)
 
void __lpfc_sli4_stop_fcf_redisc_wait_timer (struct lpfc_hba *)
 
void lpfc_sli4_stop_fcf_redisc_wait_timer (struct lpfc_hba *)
 
void lpfc_parse_fcoe_conf (struct lpfc_hba *, uint8_t *, uint32_t)
 
int lpfc_parse_vpd (struct lpfc_hba *, uint8_t *, int)
 
void lpfc_start_fdiscs (struct lpfc_hba *phba)
 
struct lpfc_vportlpfc_find_vport_by_vpid (struct lpfc_hba *, uint16_t)
 
struct lpfc_sglq__lpfc_get_active_sglq (struct lpfc_hba *, uint16_t)
 
int lpfc_bsg_request (struct fc_bsg_job *)
 
int lpfc_bsg_timeout (struct fc_bsg_job *)
 
int lpfc_bsg_ct_unsol_event (struct lpfc_hba *, struct lpfc_sli_ring *, struct lpfc_iocbq *)
 
void __lpfc_sli_ringtx_put (struct lpfc_hba *, struct lpfc_sli_ring *, struct lpfc_iocbq *)
 
struct lpfc_iocbqlpfc_sli_ringtx_get (struct lpfc_hba *, struct lpfc_sli_ring *)
 
int __lpfc_sli_issue_iocb (struct lpfc_hba *, uint32_t, struct lpfc_iocbq *, uint32_t)
 
uint32_t lpfc_drain_txq (struct lpfc_hba *)
 
void lpfc_clr_rrq_active (struct lpfc_hba *, uint16_t, struct lpfc_node_rrq *)
 
int lpfc_test_rrq_active (struct lpfc_hba *, struct lpfc_nodelist *, uint16_t)
 
void lpfc_handle_rrq_active (struct lpfc_hba *)
 
int lpfc_send_rrq (struct lpfc_hba *, struct lpfc_node_rrq *)
 
int lpfc_set_rrq_active (struct lpfc_hba *, struct lpfc_nodelist *, uint16_t, uint16_t, uint16_t)
 
uint16_t lpfc_sli4_xri_inrange (struct lpfc_hba *, uint16_t)
 
void lpfc_cleanup_wt_rrqs (struct lpfc_hba *)
 
void lpfc_cleanup_vports_rrqs (struct lpfc_vport *, struct lpfc_nodelist *)
 
struct lpfc_node_rrqlpfc_get_active_rrq (struct lpfc_vport *, uint16_t, uint32_t)
 
void lpfc_idiag_mbxacc_dump_bsg_mbox (struct lpfc_hba *, enum nemb_type, enum mbox_type, enum dma_type, enum sta_type, struct lpfc_dmabuf *, uint32_t)
 
void lpfc_idiag_mbxacc_dump_issue_mbox (struct lpfc_hba *, MAILBOX_t *)
 
int lpfc_wr_object (struct lpfc_hba *, struct list_head *, uint32_t, uint32_t *)
 
int lpfc_sli_probe_sriov_nr_virtfn (struct lpfc_hba *, int)
 
uint16_t lpfc_sli_sriov_nr_virtfn_get (struct lpfc_hba *)
 
int lpfc_sli4_queue_create (struct lpfc_hba *)
 
void lpfc_sli4_queue_destroy (struct lpfc_hba *)
 
void lpfc_sli4_abts_err_handler (struct lpfc_hba *, struct lpfc_nodelist *, struct sli4_wcqe_xri_aborted *)
 
void lpfc_sli_abts_recover_port (struct lpfc_vport *, struct lpfc_nodelist *)
 
int lpfc_hba_init_link_fc_topology (struct lpfc_hba *, uint32_t, uint32_t)
 
int lpfc_issue_reg_vfi (struct lpfc_vport *)
 
int lpfc_issue_unreg_vfi (struct lpfc_vport *)
 
int lpfc_sli4_read_config (struct lpfc_hba *)
 
void lpfc_sli4_node_prep (struct lpfc_hba *)
 
int lpfc_sli4_xri_sgl_update (struct lpfc_hba *)
 
void lpfc_free_sgl_list (struct lpfc_hba *, struct list_head *)
 
uint32_t lpfc_sli_port_speed_get (struct lpfc_hba *)
 

Variables

struct device_attributelpfc_hba_attrs []
 
struct device_attributelpfc_vport_attrs []
 
struct scsi_host_template lpfc_template
 
struct scsi_host_template lpfc_vport_template
 
struct fc_function_template lpfc_transport_functions
 
struct fc_function_template lpfc_vport_transport_functions
 
int lpfc_sli_mode
 
int lpfc_enable_npiv
 
int lpfc_delay_discovery
 
struct lpfc_hbq_initlpfc_hbq_defs []
 
char_dump_buf_data
 
unsigned long _dump_buf_data_order
 
char_dump_buf_dif
 
unsigned long _dump_buf_dif_order
 
spinlock_t _dump_buf_lock
 
int _dump_buf_done
 
spinlock_t pgcnt_lock
 
unsigned int pgcnt
 
unsigned int lpfc_prot_mask
 
unsigned char lpfc_prot_guard
 
unsigned int lpfc_fcp_look_ahead
 

Macro Definition Documentation

#define HBA_EVENT_LINK_DOWN   3

Definition at line 423 of file lpfc_crtn.h.

#define HBA_EVENT_LINK_UP   2

Definition at line 422 of file lpfc_crtn.h.

#define HBA_EVENT_RSCN   5

Definition at line 421 of file lpfc_crtn.h.

#define ScsiResult (   host_code,
  scsi_code 
)    (((host_code) << 16) | scsi_code)

Definition at line 420 of file lpfc_crtn.h.

Typedef Documentation

typedef int(* node_filter)(struct lpfc_nodelist *, void *)

Definition at line 21 of file lpfc_crtn.h.

Function Documentation

struct lpfc_nodelist* __lpfc_findnode_rpi ( struct lpfc_vport ,
uint16_t   
)
read

Definition at line 5458 of file lpfc_hbadisc.c.

struct lpfc_sglq* __lpfc_get_active_sglq ( struct lpfc_hba phba,
uint16_t  xritag 
)
read

__lpfc_get_active_sglq - Get the active sglq for this XRI. : Pointer to HBA context object. : XRI value.

This function returns the sglq pointer from the array of acive sglq's. The xritag that is passed in is used to index into the array. Before the xritag can be used it needs to be adjusted by subtracting the xribase.

Returns sglq ponter = success, NULL = Failure.

Definition at line 583 of file lpfc_sli.c.

void __lpfc_mbox_cmpl_put ( struct lpfc_hba phba,
LPFC_MBOXQ_t mbq 
)

__lpfc_mbox_cmpl_put - Put mailbox cmd into mailbox cmd complete list : pointer to lpfc hba data structure. : pointer to the driver internal queue element for mailbox command.

This routine put the completed mailbox command into the mailbox command complete list. This is the unlocked version of the routine. The mailbox complete list is used by the driver worker thread to process mailbox complete callback functions outside the driver interrupt handler.

Definition at line 1515 of file lpfc_mbox.c.

void __lpfc_mbuf_free ( struct lpfc_hba phba,
void virt,
dma_addr_t  dma 
)

__lpfc_mbuf_free - Free an mbuf from the lpfc_mbuf_pool PCI pool (locked) : HBA which owns the pool to return to : mbuf to free : the DMA-mapped address of the lpfc_mbuf_pool to be freed

Description: Returns an mbuf lpfc_mbuf_pool to the lpfc_mbuf_safety_pool if it is below its max_count, frees the mbuf otherwise.

Notes: Must be called with phba->hbalock held to synchronize access to lpfc_mbuf_safety_pool.

Returns: None

Definition at line 340 of file lpfc_mem.c.

void __lpfc_sli4_stop_fcf_redisc_wait_timer ( struct lpfc_hba phba)

__lpfc_sli4_stop_fcf_redisc_wait_timer - Stop FCF rediscovery wait timer : pointer to lpfc hba data structure.

This routine stops the SLI4 FCF rediscover wait timer if it's on. The caller of this routine should already hold the host lock.

Definition at line 2463 of file lpfc_init.c.

struct lpfc_iocbq* __lpfc_sli_get_iocbq ( struct lpfc_hba phba)
read

__lpfc_sli_get_iocbq - Allocates an iocb object from iocb pool : Pointer to HBA context object.

This function is called with hbalock held. This function allocates a new driver iocb object from the iocb pool. If the allocation is successful, it returns pointer to the newly allocated iocb object else it returns NULL.

Definition at line 535 of file lpfc_sli.c.

int __lpfc_sli_issue_iocb ( struct lpfc_hba phba,
uint32_t  ring_number,
struct lpfc_iocbq piocb,
uint32_t  flag 
)

__lpfc_sli_issue_iocb - Wrapper func of lockless version for issuing iocb

This routine wraps the actual lockless version for issusing IOCB function pointer from the lpfc_hba struct.

Return codes: IOCB_ERROR - Error IOCB_SUCCESS - Success IOCB_BUSY - Busy

Definition at line 8414 of file lpfc_sli.c.

void __lpfc_sli_ringtx_put ( struct lpfc_hba phba,
struct lpfc_sli_ring pring,
struct lpfc_iocbq piocb 
)

__lpfc_sli_ringtx_put - Add an iocb to the txq : Pointer to HBA context object. : Pointer to driver SLI ring object. : Pointer to address of newly added command iocb.

This function is called with hbalock held to add a command iocb to the txq when SLI layer cannot submit the command iocb to the ring.

Definition at line 7567 of file lpfc_sli.c.

void destroy_port ( struct lpfc_vport vport)

destroy_port - destroy an FC port : pointer to an lpfc virtual N_Port data structure.

This routine destroys a FC port from the upper layer protocol. All the resources associated with the port are released.

Definition at line 3138 of file lpfc_init.c.

struct lpfc_fast_path_event* lpfc_alloc_fast_evt ( struct lpfc_hba phba)
read

lpfc_alloc_fast_evt - Allocates data structure for posting event : Pointer to hba context object.

This function is called from the functions which need to post events from interrupt context. This function allocates data structure required for posting event. It also keeps track of number of events pending and prevent event storm when there are too many events.

Definition at line 394 of file lpfc_hbadisc.c.

int lpfc_alloc_sysfs_attr ( struct lpfc_vport vport)

lpfc_alloc_sysfs_attr - Creates the ctlreg and mbox entries : address of lpfc vport structure.

Return codes: zero on success error return code from sysfs_create_bin_file()

Definition at line 4306 of file lpfc_attr.c.

int lpfc_api_table_setup ( struct lpfc_hba phba,
uint8_t  dev_grp 
)

lpfc_api_table_setup - Set up per hba pci-device group func api jump table : pointer to lpfc hba data structure. : The HBA PCI-Device group number.

This routine is invoked to set up the per HBA PCI-Device group function API jump table entries.

Return: 0 if success, otherwise -ENODEV

Definition at line 4395 of file lpfc_init.c.

int lpfc_bsg_ct_unsol_event ( struct lpfc_hba phba,
struct lpfc_sli_ring pring,
struct lpfc_iocbq piocbq 
)

lpfc_bsg_ct_unsol_event - process an unsolicited CT command : : :

This function is called when an unsolicited CT command is received. It forwards the event to any processes registered to receive CT events.

Definition at line 773 of file lpfc_bsg.c.

int lpfc_bsg_request ( struct fc_bsg_job job)

lpfc_bsg_request - handle a bsg request from the FC transport : fc_bsg_job to handle

Definition at line 5084 of file lpfc_bsg.c.

int lpfc_bsg_timeout ( struct fc_bsg_job job)

lpfc_bsg_timeout - handle timeout of a bsg request from the FC transport : fc_bsg_job that has timed out

This function just aborts the job's IOCB. The aborted IOCB will return to the waiting function which will handle passing the error back to userspace

Definition at line 5119 of file lpfc_bsg.c.

int lpfc_can_disctmo ( struct lpfc_vport )

Definition at line 4244 of file lpfc_hbadisc.c.

void lpfc_cancel_all_vport_retry_delay_timer ( struct lpfc_hba phba)

lpfc_cancel_all_vport_retry_delay_timer - Cancel all vport retry delay timer : pointer to lpfc hba data structure.

This routine cancels the retry delay timers to all the vports.

Definition at line 7204 of file lpfc_els.c.

void lpfc_cancel_retry_delay_tmo ( struct lpfc_vport vport,
struct lpfc_nodelist nlp 
)

lpfc_cancel_retry_delay_tmo - Cancel the timer with delayed iocb-cmd retry : pointer to a host virtual N_Port data structure. : pointer to a node-list data structure.

This routine cancels the timer with a delayed IOCB-command retry for a 's . It stops the timer for the delayed function retrial and removes the ELS retry event if it presents. In addition, if the NLP_NPR_2B_DISC bit is set in the 's nlp_flag bitmap, ADISC IOCB commands are sent for the 's nodes that require issuing discovery ADISC.

Definition at line 2845 of file lpfc_els.c.

int lpfc_check_pending_fcoe_event ( struct lpfc_hba phba,
uint8_t  unreg_fcf 
)

lpfc_check_pending_fcoe_event - Check if there is pending fcoe event. : pointer to lpfc hba data structure. : Unregister FCF if FCF table need to be re-scaned.

This function check if there is any fcoe event pending while driver scan FCF entries. If there is any pending event, it will restart the FCF saning and return 1 else return 0.

Definition at line 1673 of file lpfc_hbadisc.c.

int lpfc_check_sli_ndlp ( struct lpfc_hba ,
struct lpfc_sli_ring ,
struct lpfc_iocbq ,
struct lpfc_nodelist  
)

Definition at line 4278 of file lpfc_hbadisc.c.

int lpfc_check_sparm ( struct lpfc_vport ,
struct lpfc_nodelist ,
struct serv_parm ,
uint32_t  ,
int   
)

Definition at line 69 of file lpfc_nportdisc.c.

void lpfc_cleanup ( struct lpfc_vport vport)

lpfc_cleanup - Performs vport cleanups before deleting a vport : pointer to a virtual N_Port data structure.

This routine performs the necessary cleanups before deleting the . It invokes the discovery state machine to perform necessary state transitions and to release the ndlps associated with the . Note, the physical port is treated as 0.

Definition at line 2354 of file lpfc_init.c.

void lpfc_cleanup_discovery_resources ( struct lpfc_vport )

Definition at line 5100 of file lpfc_hbadisc.c.

void lpfc_cleanup_pending_mbox ( struct lpfc_vport vport)

lpfc_cleanup_pending_mbox - Free up vport discovery mailbox commands. : pointer to vport data structure.

This function iterate through the mailboxq and clean up all REG_LOGIN and REG_VPI mailbox commands associated with the vport. This function is called when driver want to restart discovery of the vport due to a Clear Virtual Link event.

Definition at line 15872 of file lpfc_sli.c.

void lpfc_cleanup_rcv_buffers ( struct lpfc_vport vport)

lpfc_cleanup_rcv_buffers - Cleans up all outstanding receive sequences. : The vport that the received sequences were sent to.

This function cleans up all outstanding received sequences. This is called by the driver when a link event or user action invalidates all the received sequences.

Definition at line 13868 of file lpfc_sli.c.

void lpfc_cleanup_rpis ( struct lpfc_vport ,
int   
)

Definition at line 792 of file lpfc_hbadisc.c.

void lpfc_cleanup_vports_rrqs ( struct lpfc_vport vport,
struct lpfc_nodelist ndlp 
)

lpfc_cleanup_vports_rrqs - Remove and clear the active RRQ for this vport. : Pointer to vport context object. : Pointer to the lpfc_node_list structure. If ndlp is NULL Remove all active RRQs for this vport from the phba->active_rrq_list and clear the rrq. If ndlp is not NULL then only remove rrqs for this vport & this ndlp.

Definition at line 719 of file lpfc_sli.c.

void lpfc_cleanup_wt_rrqs ( struct lpfc_hba phba)

lpfc_cleanup_wt_rrqs - Remove all rrq's from the active list. : Pointer to HBA context object.

Remove all rrqs from the phba->active_rrq_list and free them by calling __lpfc_clr_active_rrq

Definition at line 755 of file lpfc_sli.c.

void lpfc_clear_la ( struct lpfc_hba phba,
LPFC_MBOXQ_t pmb 
)

lpfc_clear_la - Prepare a mailbox command for clearing HBA link attention : pointer to lpfc hba data structure. : pointer to the driver internal queue element for mailbox command.

The clear link attention mailbox command is issued to clear the link event attention condition indicated by the Link Event bit of the Host Attention (HSTATT) register. The link event attention condition is cleared only if the event tag specified matches that of the current link event counter. The current event tag is read using the read link attention event mailbox command.

This routine prepares the mailbox command for clearing HBA link attention information.

Definition at line 327 of file lpfc_mbox.c.

void lpfc_clr_rrq_active ( struct lpfc_hba phba,
uint16_t  xritag,
struct lpfc_node_rrq rrq 
)

lpfc_clr_rrq_active - Clears RRQ active bit in xri_bitmap. : Pointer to HBA context object. : xri used in this exchange. : The RRQ to be cleared.

Definition at line 599 of file lpfc_sli.c.

void lpfc_config_async ( struct lpfc_hba phba,
LPFC_MBOXQ_t pmb,
uint32_t  ring 
)

lpfc_config_async - Prepare a mailbox command for enabling HBA async event : pointer to lpfc hba data structure. : pointer to the driver internal queue element for mailbox command. : ring number for the asynchronous event to be configured.

The asynchronous event enable mailbox command is used to enable the asynchronous event posting via the ASYNC_STATUS_CN IOCB response and specifies the default ring to which events are posted.

This routine prepares the mailbox command for enabling HBA asynchronous event support on a IOCB ring.

Definition at line 227 of file lpfc_mbox.c.

void lpfc_config_hbq ( struct lpfc_hba phba,
uint32_t  id,
struct lpfc_hbq_init hbq_desc,
uint32_t  hbq_entry_index,
LPFC_MBOXQ_t pmb 
)

lpfc_config_hbq - Prepare a mailbox command for configuring an HBQ : pointer to lpfc hba data structure. : HBQ identifier. : pointer to the HBA descriptor data structure. : index of the HBQ entry data structures. : pointer to the driver internal queue element for mailbox command.

The configure HBQ (Host Buffer Queue) mailbox command is used to configure an HBQ. The configuration binds events that require buffers to a particular ring and HBQ based on a selection profile.

This routine prepares the mailbox command for configuring an HBQ.

Definition at line 1122 of file lpfc_mbox.c.

void lpfc_config_link ( struct lpfc_hba phba,
LPFC_MBOXQ_t pmb 
)

lpfc_config_link - Prepare a mailbox command for configuring link on a HBA : pointer to lpfc hba data structure. : pointer to the driver internal queue element for mailbox command.

The configure link mailbox command is used before the initialize link mailbox command to override default value and to configure link-oriented parameters such as DID address and various timers. Typically, this command would be used after an F_Port login to set the returned DID address and the fabric timeout values. This command is not valid before a configure port command has configured the HBA port.

This routine prepares the mailbox command for configuring link on a HBA.

Definition at line 355 of file lpfc_mbox.c.

int lpfc_config_msi ( struct lpfc_hba phba,
LPFC_MBOXQ_t pmb 
)

lpfc_config_msi - Prepare a mailbox command for configuring msi-x : pointer to lpfc hba data structure. : pointer to the driver internal queue element for mailbox command.

The configure MSI-X mailbox command is used to configure the HBA's SLI-3 MSI-X multi-message interrupt vector association to interrupt attention conditions.

Return codes 0 - Success -EINVAL - Failure

Definition at line 402 of file lpfc_mbox.c.

void lpfc_config_port ( struct lpfc_hba phba,
LPFC_MBOXQ_t pmb 
)

lpfc_config_port - Prepare a mailbox command for configuring port : pointer to lpfc hba data structure. : pointer to the driver internal queue element for mailbox command.

The configure port mailbox command is used to identify the Port Control Block (PCB) in the driver memory. After this command is issued, the driver must not access the mailbox in the HBA without first resetting the HBA. The HBA may copy the PCB information to internal storage for subsequent use; the driver can not change the PCB information unless it resets the HBA.

This routine prepares the mailbox command for configuring port.

Definition at line 1254 of file lpfc_mbox.c.

int lpfc_config_port_post ( struct lpfc_hba phba)

lpfc_config_port_post - Perform lpfc initialization after config port : pointer to lpfc hba data structure.

This routine will do LPFC initialization after the CONFIG_PORT mailbox command call. It performs all internal resource and state setups on the port: post IOCB buffers, enable appropriate host interrupt attentions, ELS ring timers, etc.

Return codes 0 - success. Any other value - error.

Definition at line 366 of file lpfc_init.c.

int lpfc_config_port_prep ( struct lpfc_hba phba)

lpfc_config_port_prep - Perform lpfc initialization prior to config port : pointer to lpfc hba data structure.

This routine will do LPFC initialization prior to issuing the CONFIG_PORT mailbox command. It retrieves the revision information from the HBA and collects the Vital Product Data (VPD) about the HBA for preparing the configuration of the HBA.

Return codes: 0 - success. -ERESTART - requests the SLI layer to reset the HBA and try again. Any other value - indicates an error.

Definition at line 98 of file lpfc_init.c.

void lpfc_config_ring ( struct lpfc_hba phba,
int  ring,
LPFC_MBOXQ_t pmb 
)

lpfc_config_ring - Prepare a mailbox command for configuring an IOCB ring : pointer to lpfc hba data structure. : : pointer to the driver internal queue element for mailbox command.

The configure ring mailbox command is used to configure an IOCB ring. This configuration binds from one to six of HBA RC_CTL/TYPE mask entries to the ring. This is used to map incoming sequences to a particular ring whose RC_CTL/TYPE mask entry matches that of the sequence. The driver should not attempt to configure a ring whose number is greater than the number specified in the Port Control Block (PCB). It is an error to issue the configure ring command more than once with the same ring number. The HBA returns an error if the driver attempts this.

This routine prepares the mailbox command for configuring IOCB ring.

Definition at line 1199 of file lpfc_mbox.c.

struct lpfc_vport* lpfc_create_port ( struct lpfc_hba phba,
int  instance,
struct device dev 
)
read

lpfc_create_port - Create an FC port : pointer to lpfc hba data structure. : a unique integer ID to this FC port. : pointer to the device data structure.

This routine creates a FC port for the upper layer protocol. The FC port can be created on top of either a physical port or a virtual port provided by the HBA. This routine also allocates a SCSI host data structure (shost) and associates the FC port created before adding the shost into the SCSI layer.

Return codes - pointer to the virtual N_Port data structure. NULL - port create failed.

Definition at line 3047 of file lpfc_init.c.

void lpfc_create_static_vport ( struct lpfc_hba phba)

lpfc_create_static_vport - Read HBA config region to create static vports. : pointer to lpfc hba data structure.

This routine issue a DUMP mailbox command for config region 22 to get the list of static vports to be created. The function create vports based on the information returned from the HBA.

Definition at line 3512 of file lpfc_hbadisc.c.

int lpfc_ct_free_iocb ( struct lpfc_hba ,
struct lpfc_iocbq  
)

Definition at line 273 of file lpfc_ct.c.

void lpfc_ct_unsol_event ( struct lpfc_hba ,
struct lpfc_sli_ring ,
struct lpfc_iocbq  
)

Definition at line 89 of file lpfc_ct.c.

void lpfc_debugfs_disc_trc ( struct lpfc_vport vport,
int  mask,
char fmt,
uint32_t  data1,
uint32_t  data2,
uint32_t  data3 
)
inline

lpfc_debugfs_disc_trc - Store discovery trace log : The vport to associate this trace string with for retrieval. : Log entry classification. : Format string to be displayed when dumping the log. : 1st data parameter to be applied to . : 2nd data parameter to be applied to . : 3rd data parameter to be applied to .

Description: This routine is used by the driver code to add a debugfs log entry to the discovery trace buffer associated with . Only entries with a that match the current debugfs discovery mask will be saved. Entries that do not match will be thrown away. , , , and are used like printf when displaying the log.

Definition at line 635 of file lpfc_debugfs.c.

void lpfc_debugfs_initialize ( struct lpfc_vport vport)
inline

lpfc_debugfs_initialize - Initialize debugfs for a vport : The vport pointer to initialize.

Description: When Debugfs is configured this routine sets up the lpfc debugfs file system. If not already created, this routine will create the lpfc directory, and lpfcX directory (for this HBA), and vportX directory for this vport. It will also create each file used to access lpfc specific debugfs information.

Definition at line 3938 of file lpfc_debugfs.c.

void lpfc_debugfs_slow_ring_trc ( struct lpfc_hba phba,
char fmt,
uint32_t  data1,
uint32_t  data2,
uint32_t  data3 
)
inline

lpfc_debugfs_slow_ring_trc - Store slow ring trace log : The phba to associate this trace string with for retrieval. : Format string to be displayed when dumping the log. : 1st data parameter to be applied to . : 2nd data parameter to be applied to . : 3rd data parameter to be applied to .

Description: This routine is used by the driver code to add a debugfs log entry to the discovery trace buffer associated with . , , , and are used like printf when displaying the log.

Definition at line 676 of file lpfc_debugfs.c.

void lpfc_debugfs_terminate ( struct lpfc_vport vport)
inline

lpfc_debugfs_terminate - Tear down debugfs infrastructure for this vport : The vport pointer to remove from debugfs.

Description: When Debugfs is configured this routine removes debugfs file system elements that are specific to this vport. It also checks to see if there are any users left for the debugfs directories associated with the HBA and driver. If this is the last user of the HBA directory or driver directory then it will remove those from the debugfs infrastructure as well.

Definition at line 4402 of file lpfc_debugfs.c.

void lpfc_decode_firmware_rev ( struct lpfc_hba ,
char ,
int   
)

Definition at line 1833 of file lpfc_ct.c.

void lpfc_delayed_disc_timeout_handler ( struct lpfc_vport vport)

lpfc_delayed_disc_timeout_handler - Function called by worker thread to handle delayed discovery. : pointer to a host virtual N_Port data structure.

This function start nport discovery of the vport.

Definition at line 1783 of file lpfc_ct.c.

void lpfc_delayed_disc_tmo ( unsigned long  ptr)

lpfc_delayed_disc_tmo - Timeout handler for delayed discovery timer. - Context object of the timer.

This function set the WORKER_DELAYED_DISC_TMO flag and wake up the worker thread.

Definition at line 1757 of file lpfc_ct.c.

void lpfc_dequeue_node ( struct lpfc_vport ,
struct lpfc_nodelist  
)

Definition at line 4068 of file lpfc_hbadisc.c.

void lpfc_dev_loss_tmo_callbk ( struct fc_rport rport)

Definition at line 104 of file lpfc_hbadisc.c.

void lpfc_disc_list_loopmap ( struct lpfc_vport )

Definition at line 4835 of file lpfc_hbadisc.c.

void lpfc_disc_start ( struct lpfc_vport )

Definition at line 4931 of file lpfc_hbadisc.c.

int lpfc_disc_state_machine ( struct lpfc_vport ,
struct lpfc_nodelist ,
void ,
uint32_t   
)

Definition at line 2471 of file lpfc_nportdisc.c.

void lpfc_disc_timeout ( unsigned  long)

Definition at line 5123 of file lpfc_hbadisc.c.

void lpfc_do_scr_ns_plogi ( struct lpfc_hba phba,
struct lpfc_vport vport 
)

lpfc_do_scr_ns_plogi - Issue a plogi to the name server for scr : pointer to lpfc hba data structure. : pointer to a virtual N_Port data structure.

This routine issues a Port Login (PLOGI) to the Name Server with State Change Request (SCR) for a . This routine will create an ndlp for the Name Server associated to the if such node does not already exist. The PLOGI to Name Server is issued by invoking the lpfc_issue_els_plogi() routine. If Fabric-Device Management Interface (FDMI) is configured to the , a FDMI node will be created and the PLOGI to FDMI is issued by invoking lpfc_issue_els_plogi() routine.

Definition at line 6954 of file lpfc_els.c.

int lpfc_do_work ( void )

Definition at line 727 of file lpfc_hbadisc.c.

void lpfc_down_link ( struct lpfc_hba phba,
LPFC_MBOXQ_t pmb 
)

lpfc_down_link - Bring down HBAs link. : pointer to lpfc hba data structure. : pointer to the driver internal queue element for mailbox command.

This routine prepares a mailbox command to bring down HBA link.

Definition at line 111 of file lpfc_mbox.c.

uint32_t lpfc_drain_txq ( struct lpfc_hba phba)

lpfc_drain_txq - Drain the txq : Pointer to HBA context object.

This function attempt to submit IOCBs on the txq to the adapter. For SLI4 adapters, the txq contains ELS IOCBs that have been deferred because the there are no SGLs. This congestion can occur with large vport counts during node discovery.

Definition at line 15986 of file lpfc_sli.c.

void lpfc_drop_node ( struct lpfc_vport ,
struct lpfc_nodelist  
)

Definition at line 4179 of file lpfc_hbadisc.c.

void lpfc_dump_mem ( struct lpfc_hba phba,
LPFC_MBOXQ_t pmb,
uint16_t  offset,
uint16_t  region_id 
)

lpfc_dump_mem - Prepare a mailbox command for reading a region. : pointer to lpfc hba data structure. : pointer to the driver internal queue element for mailbox command. : offset into the region. : config region id.

The dump mailbox command provides a method for the device driver to obtain various types of information from the HBA device.

This routine prepares the mailbox command for dumping HBA's config region.

Definition at line 133 of file lpfc_mbox.c.

int lpfc_dump_static_vport ( struct lpfc_hba phba,
LPFC_MBOXQ_t pmb,
uint16_t  offset 
)

lpfc_dump_static_vport - Dump HBA's static vport information. : pointer to lpfc hba data structure. : pointer to the driver internal queue element for mailbox command. : offset for dumping vport info.

The dump mailbox command provides a method for the device driver to obtain various types of information from the HBA device.

This routine prepares the mailbox command for dumping list of static vports to be created.

Definition at line 57 of file lpfc_mbox.c.

void lpfc_dump_wakeup_param ( struct lpfc_hba phba,
LPFC_MBOXQ_t pmb 
)

lpfc_dump_wakeup_param - Prepare mailbox command for retrieving wakeup params : pointer to lpfc hba data structure. : pointer to the driver internal queue element for mailbox command.

This function create a dump memory mailbox command to dump wake up parameters.

Definition at line 166 of file lpfc_mbox.c.

int lpfc_els_abort ( struct lpfc_hba ,
struct lpfc_nodelist  
)

Definition at line 204 of file lpfc_nportdisc.c.

int lpfc_els_abort_flogi ( struct lpfc_hba phba)

lpfc_els_abort_flogi - Abort all outstanding flogi iocbs : pointer to lpfc hba data structure.

This routine aborts all the outstanding Fabric Login (FLOGI) IOCBs with a . This routine walks all the outstanding IOCBs on the txcmplq list and issues an abort IOCB commond on each outstanding IOCB that contains a active Fabric_DID ndlp. Note that this function is to issue the abort IOCB command on all the outstanding IOCBs, thus when this function returns, it does not guarantee all the IOCBs are actually aborted.

Return code 0 - Successfully issued abort iocb on all outstanding flogis (Always 0)

Definition at line 1251 of file lpfc_els.c.

int lpfc_els_chk_latt ( struct lpfc_vport vport)

lpfc_els_chk_latt - Check host link attention event for a vport : pointer to a host virtual N_Port data structure.

This routine checks whether there is an outstanding host link attention event during the discovery process with the . It is done by reading the HBA's Host Attention (HA) register. If there is any host link attention events during this 's discovery process, the shall be marked as FC_ABORT_DISCOVERY, a host link attention clear shall be issued if the link state is not already in host link cleared state, and a return code shall indicate whether the host link attention event had happened.

Note that, if either the host link is in state LPFC_LINK_DOWN or state in LPFC_VPORT_READY, the request for checking host link attention event will be ignored and a return code shall indicate no host link attention event had happened.

Return codes 0 - no host link attention event happened 1 - host link attention event happened

Definition at line 80 of file lpfc_els.c.

int lpfc_els_disc_adisc ( struct lpfc_vport vport)

lpfc_els_disc_adisc - Issue remaining adisc iocbs to npr nodes of a vport : pointer to a host virtual N_Port data structure.

This routine issues Address Discover (ADISC) ELS commands to those N_Ports which are in node port recovery state and ADISC has not been issued for the . Each time an ELS ADISC IOCB is issued by invoking the lpfc_issue_els_adisc() routine, the per number of discover count (num_disc_nodes) shall be incremented. If the num_disc_nodes reaches a pre-configured threshold (cfg_discovery_threads), the fc_flag will be marked with FC_NLP_MORE bit and the process of issuing remaining ADISC IOCBs quit for later pick up. On the other hand, after walking through all the ndlps with the and there is none ADISC IOCB issued, the fc_flag shall be cleared with FC_NLP_MORE bit indicating there is no more ADISC need to be sent.

Return code The number of N_Ports with adisc issued.

Definition at line 4416 of file lpfc_els.c.

int lpfc_els_disc_plogi ( struct lpfc_vport vport)

lpfc_els_disc_plogi - Issue plogi for all npr nodes of a vport before adisc : pointer to a host virtual N_Port data structure.

This routine issues Port Login (PLOGI) ELS commands to all the N_Ports which are in node port recovery state, with a . Each time an ELS ADISC PLOGI IOCB is issued by invoking the lpfc_issue_els_plogi() routine, the per number of discover count (num_disc_nodes) shall be incremented. If the num_disc_nodes reaches a pre-configured threshold (cfg_discovery_threads), the fc_flag will be marked with FC_NLP_MORE bit set and quit the process of issuing remaining ADISC PLOGIN IOCBs for later pick up. On the other hand, after walking through all the ndlps with the and there is none ADISC PLOGI IOCB issued, the fc_flag shall be cleared with the FC_NLP_MORE bit indicating there is no more ADISC PLOGI need to be sent.

Return code The number of N_Ports with plogi issued.

Definition at line 4474 of file lpfc_els.c.

void lpfc_els_flush_all_cmd ( struct lpfc_hba phba)

lpfc_els_flush_all_cmd - Clean up all the outstanding els commands to a HBA : pointer to lpfc hba data structure.

This routine is used to clean up all the outstanding ELS commands on a . It first aborts the by invoking the lpfc_fabric_abort_hba() routine. After that, it walks the ELS transmit queue to remove all the IOCBs to the other than the QUE_RING and ABORT/CLOSE IOCBs. For the IOCBs with the completion callback function associated, the callback function will be invoked with the status set to IOSTAT_LOCAL_REJECT and un.ulpWord[4] set to IOERR_SLI_ABORTED. For IOCBs without the completion callback function associated, the IOCB will simply be released. Finally, it walks the ELS transmit completion queue to issue an abort IOCB to any transmit completion queue IOCB that is not an IOCB from libdfc (i.e., the management plane IOCBs that are not part of the discovery state machine) out to HBA by invoking the lpfc_sli_issue_abort_iotag() routine.

Definition at line 6311 of file lpfc_els.c.

void lpfc_els_flush_cmd ( struct lpfc_vport vport)

lpfc_els_flush_cmd - Clean up the outstanding els commands to a vport : pointer to a host virtual N_Port data structure.

This routine is used to clean up all the outstanding ELS commands on a . It first aborts the by invoking lpfc_fabric_abort_vport() routine. After that, it walks the ELS transmit queue to remove all the IOCBs with the other than the QUE_RING and ABORT/CLOSE IOCBs. For the IOCBs with a non-NULL completion callback function, the callback function will be invoked with the status set to IOSTAT_LOCAL_REJECT and un.ulpWord[4] set to IOERR_SLI_ABORTED. For IOCBs with a NULL completion callback function, the IOCB will simply be released. Finally, it walks the ELS transmit completion queue to issue an abort IOCB to any transmit completion queue IOCB that is associated with the and is not an IOCB from libdfc (i.e., the management plane IOCBs that are not part of the discovery state machine) out to HBA by invoking the lpfc_sli_issue_abort_iotag() routine. Note that this function issues the abort IOCB to any transmit completion queueed IOCB, it does not guarantee the IOCBs are aborted when this function returns.

Definition at line 6242 of file lpfc_els.c.

void lpfc_els_flush_rscn ( struct lpfc_vport vport)

lpfc_els_flush_rscn - Clean up any rscn activities with a vport : pointer to a host virtual N_Port data structure.

This routine cleans up any Registration State Change Notification (RSCN) activity with a . Note that the fc_rscn_flush flag of the together with the host_lock is used to prevent multiple thread trying to access the RSCN array on a same at the same time.

Definition at line 4523 of file lpfc_els.c.

int lpfc_els_free_iocb ( struct lpfc_hba phba,
struct lpfc_iocbq elsiocb 
)

lpfc_els_free_iocb - Free a command iocb and its associated resources : pointer to lpfc hba data structure. : pointer to lpfc els command iocb data structure.

This routine frees a command IOCB and its associated resources. The command IOCB data structure contains the reference to various associated resources, these fields must be set to NULL if the associated reference not present: context1 - reference to ndlp context2 - reference to cmd context2->next - reference to rsp context3 - reference to bpl

It first properly decrements the reference count held on ndlp for the IOCB completion callback function. If LPFC_DELAY_MEM_FREE flag is not set, it invokes the lpfc_els_free_data() routine to release the Direct Memory Access (DMA) buffers associated with the IOCB. Otherwise, it adds the DMA buffer the data structure for the delayed release. If reference to the Buffer Pointer List (BPL) is present, the lpfc_els_free_bpl() routine is invoked to release the DMA memory associated with BPL. Finally, the lpfc_sli_release_iocbq() routine is invoked to release the IOCB data structure back to IOCBQ list.

Return code 0 - Success (currently, always return 0)

Definition at line 3449 of file lpfc_els.c.

int lpfc_els_handle_rscn ( struct lpfc_vport vport)

lpfc_els_handle_rscn - Handle rscn for a vport : pointer to a host virtual N_Port data structure.

This routine handles the Registration State Configuration Notification (RSCN) for a . If login to NameServer does not exist, a new ndlp shall be created and a Port Login (PLOGI) to the NameServer is issued. Otherwise, if the ndlp to NameServer exists, a Common Transport (CT) command to the NameServer shall be issued. If CT command to the NameServer fails to be issued, the lpfc_els_flush_rscn() routine shall be invoked to clean up any RSCN activities with the .

Return code 0 - Cleaned up rscn on the 1 - Wait for plogi to name server before proceed

Definition at line 4914 of file lpfc_els.c.

struct hbq_dmabuf* lpfc_els_hbq_alloc ( struct lpfc_hba phba)
read

lpfc_els_hbq_alloc - Allocate an HBQ buffer : HBA to allocate HBQ buffer for

Description: Allocates a DMA-mapped HBQ buffer from the lpfc_hrb_pool PCI pool along a non-DMA-mapped container for it.

Notes: Not interrupt-safe. Must be called with no locks held.

Returns: pointer to HBQ on success NULL on failure

Definition at line 392 of file lpfc_mem.c.

void lpfc_els_hbq_free ( struct lpfc_hba phba,
struct hbq_dmabuf hbqbp 
)

lpfc_els_hbq_free - Frees an HBQ buffer allocated with lpfc_els_hbq_alloc : HBA buffer was allocated for : HBQ container returned by lpfc_els_hbq_alloc

Description: Frees both the container and the DMA-mapped buffer returned by lpfc_els_hbq_alloc.

Notes: Can be called with or without locks held.

Returns: None

Definition at line 423 of file lpfc_mem.c.

void lpfc_els_retry_delay ( unsigned long  ptr)

lpfc_els_retry_delay - Timer function with a ndlp delayed function timer : holder for the pointer to the timer function associated data (ndlp).

This routine is invoked by the ndlp delayed-function timer to check whether there is any pending ELS retry event(s) with the node. If not, it simply returns. Otherwise, if there is at least one ELS delayed event, it adds the delayed events to the HBA work list and invokes the lpfc_worker_wake_up() routine to wake up worker thread to process the event. Note that lpfc_nlp_get() is called before posting the event to the work list to hold reference count of ndlp so that it guarantees the reference to ndlp will still be available when the worker thread gets to the event associated with the ndlp.

Definition at line 2902 of file lpfc_els.c.

void lpfc_els_retry_delay_handler ( struct lpfc_nodelist ndlp)

lpfc_els_retry_delay_handler - Work thread handler for ndlp delayed function : pointer to a node-list data structure.

This routine is the worker-thread handler for processing the delayed event(s), posted by the lpfc_els_retry_delay() routine. It simply retrieves the last ELS command from the associated ndlp and invokes the proper ELS function according to the delayed ELS command to retry the command.

Definition at line 2939 of file lpfc_els.c.

int lpfc_els_rsp_acc ( struct lpfc_vport vport,
uint32_t  flag,
struct lpfc_iocbq oldiocb,
struct lpfc_nodelist ndlp,
LPFC_MBOXQ_t mbox 
)

lpfc_els_rsp_acc - Prepare and issue an acc response iocb command : pointer to a host virtual N_Port data structure. : the els command code to be accepted. : pointer to the original lpfc command iocb data structure. : pointer to a node-list data structure. : pointer to the driver internal queue element for mailbox command.

This routine prepares and issues an Accept (ACC) response IOCB command. It uses the to properly set up the IOCB field for the specific ACC response command to be issued and invokes the lpfc_sli_issue_iocb() routine to send out ACC response IOCB. If a pointer is passed in, it will be put into the context_un.mbox field of the IOCB for the completion callback function to issue the mailbox command to the HBA later when callback is invoked.

Note that, in lpfc_prep_els_iocb() routine, the reference count of ndlp will be incremented by 1 for holding the ndlp and the reference to ndlp will be stored into the context1 field of the IOCB for the completion callback function to the corresponding response ELS IOCB command.

Return code 0 - Successfully issued acc response 1 - Failed to issue acc response

Definition at line 3819 of file lpfc_els.c.

int lpfc_els_rsp_adisc_acc ( struct lpfc_vport vport,
struct lpfc_iocbq oldiocb,
struct lpfc_nodelist ndlp 
)

lpfc_els_rsp_adisc_acc - Prepare and issue acc response to adisc iocb cmd : pointer to a virtual N_Port data structure. : pointer to the original lpfc command iocb data structure. : pointer to a node-list data structure.

This routine prepares and issues an Accept (ACC) response to Address Discover (ADISC) ELS command. It simply prepares the payload of the IOCB and invokes the lpfc_sli_issue_iocb() routine to send out the command.

Note that, in lpfc_prep_els_iocb() routine, the reference count of ndlp will be incremented by 1 for holding the ndlp and the reference to ndlp will be stored into the context1 field of the IOCB for the completion callback function to the ADISC Accept response ELS IOCB command.

Return code 0 - Successfully issued acc adisc response 1 - Failed to issue adisc acc response

Definition at line 4033 of file lpfc_els.c.

int lpfc_els_rsp_prli_acc ( struct lpfc_vport vport,
struct lpfc_iocbq oldiocb,
struct lpfc_nodelist ndlp 
)

lpfc_els_rsp_prli_acc - Prepare and issue acc response to prli iocb cmd : pointer to a virtual N_Port data structure. : pointer to the original lpfc command iocb data structure. : pointer to a node-list data structure.

This routine prepares and issues an Accept (ACC) response to Process Login (PRLI) ELS command. It simply prepares the payload of the IOCB and invokes the lpfc_sli_issue_iocb() routine to send out the command.

Note that, in lpfc_prep_els_iocb() routine, the reference count of ndlp will be incremented by 1 for holding the ndlp and the reference to ndlp will be stored into the context1 field of the IOCB for the completion callback function to the PRLI Accept response ELS IOCB command.

Return code 0 - Successfully issued acc prli response 1 - Failed to issue acc prli response

Definition at line 4107 of file lpfc_els.c.

int lpfc_els_rsp_reject ( struct lpfc_vport vport,
uint32_t  rejectError,
struct lpfc_iocbq oldiocb,
struct lpfc_nodelist ndlp,
LPFC_MBOXQ_t mbox 
)

lpfc_els_rsp_reject - Propare and issue a rjt response iocb command : pointer to a virtual N_Port data structure. : : pointer to the original lpfc command iocb data structure. : pointer to a node-list data structure. : pointer to the driver internal queue element for mailbox command.

This routine prepares and issue an Reject (RJT) response IOCB command. If a pointer is passed in, it will be put into the context_un.mbox field of the IOCB for the completion callback function to issue to the HBA later.

Note that, in lpfc_prep_els_iocb() routine, the reference count of ndlp will be incremented by 1 for holding the ndlp and the reference to ndlp will be stored into the context1 field of the IOCB for the completion callback function to the reject response ELS IOCB command.

Return code 0 - Successfully issued reject response 1 - Failed to issue reject response

Definition at line 3957 of file lpfc_els.c.

void lpfc_els_timeout ( unsigned long  ptr)

lpfc_els_timeout - Handler funciton to the els timer : holder for the timer function associated data.

This routine is invoked by the ELS timer after timeout. It posts the ELS timer timeout event by setting the WORKER_ELS_TMO bit to the work port event bitmap and then invokes the lpfc_worker_wake_up() routine to wake up the worker thread. It is for the worker thread to invoke the routine lpfc_els_timeout_handler() to work on the posted event WORKER_ELS_TMO.

Definition at line 6112 of file lpfc_els.c.

void lpfc_els_timeout_handler ( struct lpfc_vport vport)

lpfc_els_timeout_handler - Process an els timeout event : pointer to a virtual N_Port data structure.

This routine is the actual handler function that processes an ELS timeout event. It walks the ELS ring to get and abort all the IOCBs (except the ABORT/CLOSE/FARP/FARPR/FDISC), which are associated with the by invoking the lpfc_sli_issue_abort_iotag() routine.

Definition at line 6141 of file lpfc_els.c.

void lpfc_els_unsol_event ( struct lpfc_hba phba,
struct lpfc_sli_ring pring,
struct lpfc_iocbq elsiocb 
)

lpfc_els_unsol_event - Process an unsolicited event from an els sli ring : pointer to lpfc hba data structure. : pointer to a SLI ring. : pointer to lpfc els iocb data structure.

This routine is used to process an unsolicited event received from a SLI (Service Level Interface) ring. The actual processing of the data buffer associated with the unsolicited event is done by invoking the routine lpfc_els_unsol_buffer() after properly set up the iocb buffer from the SLI ring on which the unsolicited event was received.

Definition at line 6864 of file lpfc_els.c.

struct lpfc_nodelist* lpfc_enable_node ( struct lpfc_vport ,
struct lpfc_nodelist ,
int   
)
read

Definition at line 4127 of file lpfc_hbadisc.c.

void lpfc_end_rscn ( struct lpfc_vport vport)

lpfc_end_rscn - Check and handle more rscn for a vport : pointer to a host virtual N_Port data structure.

This routine checks whether more Registration State Change Notifications (RSCNs) came in while the discovery state machine was in the FC_RSCN_MODE. If so, the lpfc_els_handle_rscn() routine will be invoked to handle the additional RSCNs for the . Otherwise, the FC_RSCN_MODE bit will be cleared with the to mark as the end of handling the RSCNs.

Definition at line 1631 of file lpfc_els.c.

void lpfc_enqueue_node ( struct lpfc_vport ,
struct lpfc_nodelist  
)

Definition at line 4056 of file lpfc_hbadisc.c.

void lpfc_fabric_abort_hba ( struct lpfc_hba phba)

lpfc_fabric_abort_hba - Abort all iocbs on driver fabric iocb list : pointer to lpfc hba data structure.

This routine aborts all the IOCBs currently on the driver internal fabric IOCB list. The list contains fabric IOCBs to be issued to the ELS IOCB ring. This function takes the entire IOCB list off the fabric IOCB list, removes IOCBs off the list, set the status feild to IOSTAT_LOCAL_REJECT, and invokes the callback function associated with the IOCB.

Definition at line 7965 of file lpfc_els.c.

void lpfc_fabric_abort_nport ( struct lpfc_nodelist ndlp)

lpfc_fabric_abort_nport - Abort a ndlp's iocbs from driver fabric iocb list : pointer to a node-list data structure.

This routine aborts all the IOCBs associated with an from the driver internal fabric IOCB list. The list contains fabric IOCBs to be issued to the ELS IOCB ring. This abort function walks the fabric IOCB list, removes each IOCB associated with the off the list, set the status feild to IOSTAT_LOCAL_REJECT, and invokes the callback function associated with the IOCB.

Definition at line 7932 of file lpfc_els.c.

void lpfc_fabric_block_timeout ( unsigned long  ptr)

lpfc_fabric_block_timeout - Handler function to the fabric block timer : holder for the timer function associated data.

This routine is invoked by the fabric iocb block timer after timeout. It posts the fabric iocb block timeout event by setting the WORKER_FABRIC_BLOCK_TMO bit to work port event bitmap and then invokes lpfc_worker_wake_up() routine to wake up the worker thread. It is for the worker thread to invoke the lpfc_unblock_fabric_iocbs() on the posted event WORKER_FABRIC_BLOCK_TMO.

Definition at line 7646 of file lpfc_els.c.

void lpfc_fcf_redisc_wait_start_timer ( struct lpfc_hba phba)

lpfc_fcf_redisc_wait_start_timer - Start fcf rediscover wait timer : Pointer to hba for which this call is being executed.

This routine starts the timer waiting for the FCF rediscovery to complete.

Definition at line 3355 of file lpfc_init.c.

int lpfc_fdmi_cmd ( struct lpfc_vport ,
struct lpfc_nodelist ,
int   
)

Definition at line 1364 of file lpfc_ct.c.

void lpfc_fdmi_timeout_handler ( struct lpfc_vport )

Definition at line 1818 of file lpfc_ct.c.

void lpfc_fdmi_tmo ( unsigned  long)

Definition at line 1799 of file lpfc_ct.c.

struct lpfc_vport* lpfc_find_vport_by_did ( struct lpfc_hba ,
uint32_t   
)
read

Definition at line 421 of file lpfc_ct.c.

struct lpfc_vport* lpfc_find_vport_by_vpid ( struct lpfc_hba phba,
uint16_t  vpi 
)
read

lpfc_find_vport_by_vpid - Find a vport on a HBA through vport identifier : pointer to lpfc hba data structure. : the physical host virtual N_Port identifier.

This routine finds a vport on a HBA (referred by ) through a . The function walks the HBA's vport list and returns the address of the vport with the matching .

Return code NULL - No vport with the matching found Otherwise - Address to the vport with the matching .

Definition at line 5510 of file lpfc_hbadisc.c.

struct lpfc_nodelist* lpfc_findnode_did ( struct lpfc_vport ,
uint32_t   
)
read

Definition at line 4755 of file lpfc_hbadisc.c.

struct lpfc_nodelist* lpfc_findnode_rpi ( struct lpfc_vport ,
uint16_t   
)
read

Definition at line 5485 of file lpfc_hbadisc.c.

struct lpfc_nodelist* lpfc_findnode_wwpn ( struct lpfc_vport ,
struct lpfc_name  
)
read

Definition at line 5468 of file lpfc_hbadisc.c.

void lpfc_free_fast_evt ( struct lpfc_hba phba,
struct lpfc_fast_path_event evt 
)

lpfc_free_fast_evt - Frees event data structure : Pointer to hba context object. : Event object which need to be freed.

This function frees the data structure required for posting events.

Definition at line 420 of file lpfc_hbadisc.c.

void lpfc_free_sgl_list ( struct lpfc_hba phba,
struct list_head sglq_list 
)

lpfc_free_sgl_list - Free a given sgl list. : pointer to lpfc hba data structure. : pointer to the head of sgl list.

This routine is invoked to free a give sgl list and memory.

Definition at line 5382 of file lpfc_init.c.

void lpfc_free_sysfs_attr ( struct lpfc_vport vport)

lpfc_free_sysfs_attr - Removes the ctlreg and mbox entries : address of lpfc vport structure.

Definition at line 4343 of file lpfc_attr.c.

struct lpfc_node_rrq* lpfc_get_active_rrq ( struct lpfc_vport vport,
uint16_t  xri,
uint32_t  did 
)
read

lpfc_get_active_rrq - Get the active RRQ for this exchange. : Pointer to vport context object. : The xri used in the exchange. : The targets DID for this exchange.

returns NULL = rrq not found in the phba->active_rrq_list. rrq = rrq for this xri and target.

Definition at line 688 of file lpfc_sli.c.

void lpfc_get_cfgparam ( struct lpfc_hba phba)

lpfc_get_cfgparam - Used during probe_one to init the adapter structure : lpfc_hba pointer.

Definition at line 5019 of file lpfc_attr.c.

int lpfc_get_instance ( void  )

lpfc_get_instance - Get a unique integer ID

This routine allocates a unique integer ID from lpfc_hba_index pool. It uses the kernel idr facility to perform the task.

Return codes: instance - a unique integer ID allocated as the new instance. -1 - lpfc get instance failed.

Definition at line 3166 of file lpfc_init.c.

int lpfc_get_sli4_parameters ( struct lpfc_hba phba,
LPFC_MBOXQ_t mboxq 
)

lpfc_get_sli4_parameters - Get the SLI4 Config PARAMETERS. : Pointer to HBA context object. : Pointer to the mailboxq memory for the mailbox command response.

This function is called in the SLI4 code path to read the port's sli4 capabilities.

This function may be be called from any context that can block-wait for the completion. The expectation is that this routine is called typically from probe_one or from the online routine.

Definition at line 8736 of file lpfc_init.c.

void lpfc_get_vport_cfgparam ( struct lpfc_vport vport)

lpfc_get_vport_cfgparam - Used during port create, init the vport structure : lpfc_vport pointer.

Definition at line 5065 of file lpfc_attr.c.

void lpfc_handle_eratt ( struct lpfc_hba phba)

lpfc_handle_eratt - Wrapper func for handling hba error attention : pointer to lpfc HBA data structure.

This routine wraps the actual SLI3 or SLI4 hba error attention handling routine from the API jump table function pointer from the lpfc_hba struct.

Return codes 0 - success. Any other value - error.

Definition at line 1604 of file lpfc_init.c.

void lpfc_handle_latt ( struct lpfc_hba phba)

lpfc_handle_latt - The HBA link event handler : pointer to lpfc hba data structure.

This routine is invoked from the worker thread to handle a HBA host attention link event.

Definition at line 1617 of file lpfc_init.c.

void lpfc_handle_rrq_active ( struct lpfc_hba phba)

lpfc_handle_rrq_active - Checks if RRQ has waithed RATOV. : Pointer to HBA context object.

This function is called with hbalock held. This function Checks if stop_time (ratov from setting rrq active) has been reached, if it has and the send_rrq flag is set then it will call lpfc_send_rrq. If the send_rrq flag is not set then it will just call the routine to clear the rrq and free the rrq resource. The timer is set to the next rrq that is going to expire before leaving the routine.

Definition at line 642 of file lpfc_sli.c.

void lpfc_hb_timeout_handler ( struct lpfc_hba phba)

lpfc_hb_timeout_handler - The HBA-timer timeout handler : pointer to lpfc hba data structure.

This is the actual HBA-timer timeout handler to be invoked by the worker thread whenever the HBA timer fired and HBA-timeout event posted. This handler performs any periodic operations needed for the device. If such periodic event has already been attended to either in the interrupt handler or by processing slow-ring or fast-ring events within the HBA-timer timeout window (LPFC_HB_MBOX_INTERVAL), this handler just simply resets the timer for the next timeout period. If lpfc heart-beat mailbox command is configured and there is no heart-beat mailbox command outstanding, a heart-beat mailbox is issued and timer set properly. Otherwise, if there has been a heart-beat mailbox command outstanding, the HBA shall be put to offline.

Definition at line 1046 of file lpfc_init.c.

int lpfc_hba_down_post ( struct lpfc_hba phba)

lpfc_hba_down_post - Wrapper func for hba down post routine : pointer to lpfc HBA data structure.

This routine wraps the actual SLI3 or SLI4 routine for performing uninitialization after the HBA is reset when bring down the SLI Layer.

Return codes 0 - success. Any other value - error.

Definition at line 930 of file lpfc_init.c.

int lpfc_hba_down_prep ( struct lpfc_hba phba)

lpfc_hba_down_prep - Perform lpfc uninitialization prior to HBA reset : pointer to lpfc HBA data structure.

This routine will do LPFC uninitialization before the HBA is reset when bringing down the SLI Layer.

Return codes 0 - success. Any other value - error.

Definition at line 777 of file lpfc_init.c.

void lpfc_hba_init ( struct lpfc_hba phba,
uint32_t hbainit 
)

lpfc_hba_init - Perform special handling for LC HBA initialization : pointer to lpfc hba data structure. : pointer to an array of unsigned 32-bit integers.

This routine performs the special handling for LC HBA initialization.

Definition at line 2323 of file lpfc_init.c.

int lpfc_hba_init_link_fc_topology ( struct lpfc_hba phba,
uint32_t  fc_topology,
uint32_t  flag 
)

lpfc_hba_init_link_fc_topology - Initialize FC link with desired topology : pointer to lpfc hba data structure. : desired fc topology. : mailbox command issue mode - either MBX_POLL or MBX_NOWAIT

This routine will issue the INIT_LINK mailbox command call. It is available to other drivers through the lpfc_hba data structure for use as a delayed link up mechanism with the module parameter lpfc_suppress_link_up.

Return code 0 - success Any other value - error

Definition at line 653 of file lpfc_init.c.

void lpfc_heart_beat ( struct lpfc_hba phba,
LPFC_MBOXQ_t pmb 
)

lpfc_heart_beat - Prepare a mailbox command for heart beat : pointer to lpfc hba data structure. : pointer to the driver internal queue element for mailbox command.

The heart beat mailbox command is used to detect an unresponsive HBA, which is defined as any device where no error attention is sent and both mailbox and rings are not processed.

This routine prepares the mailbox command for issuing a heart beat in the form of mailbox command to the HBA. The timely completion of the heart beat mailbox command indicates the health of the HBA.

Definition at line 254 of file lpfc_mbox.c.

void lpfc_host_attrib_init ( struct Scsi_Host shost)

lpfc_host_attrib_init - Initialize SCSI host attributes on a FC port : pointer to SCSI host data structure.

This routine initializes a given SCSI host attributes on a FC port. The SCSI host can be either on top of a physical port or a virtual port.

Definition at line 3243 of file lpfc_init.c.

void lpfc_idiag_mbxacc_dump_bsg_mbox ( struct lpfc_hba ,
enum  nemb_type,
enum  mbox_type,
enum  dma_type,
enum  sta_type,
struct lpfc_dmabuf ,
uint32_t   
)

Definition at line 3740 of file lpfc_debugfs.c.

void lpfc_idiag_mbxacc_dump_issue_mbox ( struct lpfc_hba ,
MAILBOX_t  
)

Definition at line 3839 of file lpfc_debugfs.c.

void lpfc_in_buf_free ( struct lpfc_hba phba,
struct lpfc_dmabuf mp 
)

lpfc_in_buf_free - Free a DMA buffer : HBA buffer is associated with : Buffer to free

Description: Frees the given DMA buffer in the appropriate way given if the HBA is running in SLI3 mode with HBQs enabled.

Notes: Takes phba->hbalock. Can be called with or without other locks held.

Returns: None

Definition at line 504 of file lpfc_mem.c.

const char* lpfc_info ( struct Scsi_Host host)

lpfc_info - Info entry point of scsi_host_template data structure : The scsi host for which this call is being executed.

This routine provides module information about hba.

Reutrn code: Pointer to char - Success.

Definition at line 4162 of file lpfc_scsi.c.

int lpfc_init_api_table_setup ( struct lpfc_hba phba,
uint8_t  dev_grp 
)

lpfc_init_api_table_setup - Set up init api function jump table : The hba struct for which this call is being executed. : The HBA PCI-Device group number.

This routine sets up the device INIT interface API function jump table in struct.

Returns: 0 - success, -ENODEV - failure.

Definition at line 5184 of file lpfc_init.c.

void lpfc_init_link ( struct lpfc_hba phba,
LPFC_MBOXQ_t pmb,
uint32_t  topology,
uint32_t  linkspeed 
)

lpfc_init_link - Prepare a mailbox command for initialize link on a HBA : pointer to lpfc hba data structure. : pointer to the driver internal queue element for mailbox command. : the link topology for the link to be initialized to. : the link speed for the link to be initialized to.

The initialize link mailbox command is used to initialize the Fibre Channel link. This command must follow a configure port command that establishes the mode of operation.

This routine prepares the mailbox command for initializing link on a HBA with the specified link topology and speed.

Definition at line 481 of file lpfc_mbox.c.

void lpfc_init_vfi ( struct lpfcMboxq mbox,
struct lpfc_vport vport 
)

lpfc_init_vfi - Initialize the INIT_VFI mailbox command : pointer to lpfc mbox command to initialize. : Vport associated with the VF.

This routine initializes to all zeros and then fills in the mailbox fields from . INIT_VFI configures virtual fabrics identified by VFI in the context of an FCF. The driver issues this command to setup a VFI before issuing a FLOGI to login to the VSAN. The driver should also issue a REG_VFI after a successful VSAN login.

Definition at line 2095 of file lpfc_mbox.c.

void lpfc_init_vpi ( struct lpfc_hba phba,
struct lpfcMboxq mbox,
uint16_t  vpi 
)

lpfc_init_vpi - Initialize the INIT_VPI mailbox command : pointer to the hba structure to init the VPI for. : pointer to lpfc mbox command to initialize. : VPI to be initialized.

The INIT_VPI mailbox command supports virtual N_Ports. The driver uses the command to activate a virtual N_Port. The HBA assigns a MAC address to use with the virtual N Port. The SLI Host issues this command before issuing a FDISC to connect to the Fabric. The SLI Host should issue a REG_VPI after a successful virtual NPort login.

Definition at line 2171 of file lpfc_mbox.c.

void lpfc_init_vpi_cmpl ( struct lpfc_hba phba,
LPFC_MBOXQ_t mboxq 
)

lpfc_init_vpi_cmpl - Completion handler for init_vpi mbox command. : pointer to lpfc hba data structure. : pointer to mailbox data structure.

This function handles completion of init vpi mailbox command.

Definition at line 2739 of file lpfc_hbadisc.c.

int lpfc_initial_fdisc ( struct lpfc_vport vport)

lpfc_initial_fdisc - Issue an initial fabric discovery for a vport : pointer to a host virtual N_Port data structure.

This routine issues an initial Fabric Discover (FDISC) for the specified. It first searches the ndlp with the Fabric_DID (0xfffffe) from the 's ndlp list. If no such ndlp found, it will create an ndlp and put it into the 's ndlp list. If an inactive ndlp found on the list, it will just be enabled and made active. The lpfc_issue_els_fdisc() routine is then invoked with the and the ndlp to perform the FDISC for the .

Return code 0 - failed to issue initial fdisc for 1 - successfully issued initial fdisc for

Definition at line 1355 of file lpfc_els.c.

int lpfc_initial_flogi ( struct lpfc_vport vport)

lpfc_initial_flogi - Issue an initial fabric login for a vport : pointer to a host virtual N_Port data structure.

This routine issues an initial Fabric Login (FLOGI) for the specified. It first searches the ndlp with the Fabric_DID (0xfffffe) from the 's ndlp list. If no such ndlp found, it will create an ndlp and put it into the 's ndlp list. If an inactive ndlp found on the list, it will just be enabled and made active. The lpfc_issue_els_flogi() routine is then invoked with the and the ndlp to perform the FLOGI for the .

Return code 0 - failed to issue initial flogi for 1 - successfully issued initial flogi for

Definition at line 1301 of file lpfc_els.c.

void lpfc_issue_clear_la ( struct lpfc_hba ,
struct lpfc_vport  
)

Definition at line 4875 of file lpfc_hbadisc.c.

int lpfc_issue_els_adisc ( struct lpfc_vport vport,
struct lpfc_nodelist ndlp,
uint8_t  retry 
)

lpfc_issue_els_adisc - Issue an address discover iocb to an node on a vport : pointer to a virtual N_Port data structure. : pointer to a node-list data structure. : number of retries to the command IOCB.

This routine issues an Address Discover (ADISC) for an on a . It prepares the payload of the ADISC ELS command, updates the and states of the ndlp, and invokes the lpfc_sli_issue_iocb() routine to issue the ADISC ELS command.

Note that, in lpfc_prep_els_iocb() routine, the reference count of ndlp will be incremented by 1 for holding the ndlp and the reference to ndlp will be stored into the context1 field of the IOCB for the completion callback function to the ADISC ELS command.

Return code 0 - successfully issued adisc 1 - failed to issue adisc

Definition at line 2320 of file lpfc_els.c.

int lpfc_issue_els_logo ( struct lpfc_vport vport,
struct lpfc_nodelist ndlp,
uint8_t  retry 
)

lpfc_issue_els_logo - Issue a logo to an node on a vport : pointer to a virtual N_Port data structure. : pointer to a node-list data structure. : number of retries to the command IOCB.

This routine constructs and issues an ELS Logout (LOGO) iocb command to a remote node, referred by an on a . It constructs the payload of the IOCB, properly sets up the state, and invokes the lpfc_sli_issue_iocb() routine to send out the LOGO ELS command.

Note that, in lpfc_prep_els_iocb() routine, the reference count of ndlp will be incremented by 1 for holding the ndlp and the reference to ndlp will be stored into the context1 field of the IOCB for the completion callback function to the LOGO ELS command.

Return code 0 - successfully issued logo 1 - failed to issue logo

Definition at line 2517 of file lpfc_els.c.

int lpfc_issue_els_npiv_logo ( struct lpfc_vport vport,
struct lpfc_nodelist ndlp 
)

lpfc_issue_els_npiv_logo - Issue a logo off a vport : pointer to a virtual N_Port data structure. : pointer to a node-list data structure.

This routine issues a LOGO ELS command to an off a .

Note that, in lpfc_prep_els_iocb() routine, the reference count of ndlp will be incremented by 1 for holding the ndlp and the reference to ndlp will be stored into the context1 field of the IOCB for the completion callback function to the LOGO ELS command.

Return codes 0 - Successfully issued logo off the 1 - Failed to issue logo off the

Definition at line 7590 of file lpfc_els.c.

int lpfc_issue_els_plogi ( struct lpfc_vport vport,
uint32_t  did,
uint8_t  retry 
)

lpfc_issue_els_plogi - Issue an plogi iocb command for a vport : pointer to a host virtual N_Port data structure. : destination port identifier. : number of retries to the command IOCB.

This routine issues a Port Login (PLOGI) command to a remote N_Port (with the ) for a . Before issuing a PLOGI to a remote N_Port, the ndlp with the remote N_Port DID must exist on the 's ndlp list. This routine constructs the proper feilds of the PLOGI IOCB and invokes the lpfc_sli_issue_iocb() routine to send out PLOGI ELS command.

Note that, in lpfc_prep_els_iocb() routine, the reference count of ndlp will be incremented by 1 for holding the ndlp and the reference to ndlp will be stored into the context1 field of the IOCB for the completion callback function to the PLOGI ELS command.

Return code 0 - Successfully issued a plogi for 1 - failed to issue a plogi for

Definition at line 1873 of file lpfc_els.c.

int lpfc_issue_els_prli ( struct lpfc_vport vport,
struct lpfc_nodelist ndlp,
uint8_t  retry 
)

lpfc_issue_els_prli - Issue a prli iocb command for a vport : pointer to a host virtual N_Port data structure. : pointer to a node-list data structure. : number of retries to the command IOCB.

This routine issues a Process Login (PRLI) ELS command for the . The PRLI service parameters are set up in the payload of the PRLI Request command and the pointer to lpfc_cmpl_els_prli() routine is put to the IOCB completion callback func field before invoking the routine lpfc_sli_issue_iocb() to send out PRLI command.

Note that, in lpfc_prep_els_iocb() routine, the reference count of ndlp will be incremented by 1 for holding the ndlp and the reference to ndlp will be stored into the context1 field of the IOCB for the completion callback function to the PRLI ELS command.

Return code 0 - successfully issued prli iocb command for 1 - failed to issue prli iocb command for

Definition at line 2032 of file lpfc_els.c.

int lpfc_issue_els_scr ( struct lpfc_vport vport,
uint32_t  nportid,
uint8_t  retry 
)

lpfc_issue_els_scr - Issue a scr to an node on a vport : pointer to a host virtual N_Port data structure. : N_Port identifier to the remote node. : number of retries to the command IOCB.

This routine issues a State Change Request (SCR) to a fabric node on a . The remote node is passed into the function. It first search the node list to find the matching ndlp. If no such ndlp is found, a new ndlp shall be created for this (SCR) purpose. An IOCB is allocated, payload prepared, and the lpfc_sli_issue_iocb() routine is invoked to send the SCR IOCB.

Note that, in lpfc_prep_els_iocb() routine, the reference count of ndlp will be incremented by 1 for holding the ndlp and the reference to ndlp will be stored into the context1 field of the IOCB for the completion callback function to the SCR ELS command.

Return code 0 - Successfully issued scr command 1 - Failed to issue scr command

Definition at line 2652 of file lpfc_els.c.

int lpfc_issue_fabric_reglogin ( struct lpfc_vport vport)

lpfc_issue_fabric_reglogin - Issue fabric registration login for a vport : pointer to a host virtual N_Port data structure.

This routine issues a fabric registration login for a . An active ndlp node with Fabric_DID must already exist for this . The routine invokes two mailbox commands to carry out fabric registration login through the HBA firmware: the first mailbox command requests the HBA to perform link configuration for the ; and the second mailbox command requests the HBA to perform the actual fabric registration login with the .

Return code 0 - successfully issued fabric registration login for -ENXIO – failed to issue fabric registration login for

Definition at line 356 of file lpfc_els.c.

void lpfc_issue_init_vfi ( struct lpfc_vport vport)

lpfc_issue_init_vfi - Issue init_vfi mailbox command. : pointer to lpfc_vport data structure.

This function issue a init_vfi mailbox command to initialize the VFI and VPI for the physical port.

Definition at line 2708 of file lpfc_hbadisc.c.

void lpfc_issue_init_vpi ( struct lpfc_vport vport)

lpfc_issue_init_vpi - Issue init_vpi mailbox command. : pointer to lpfc_vport data structure.

This function issue a init_vpi mailbox command to initialize VPI for the vport.

Definition at line 2791 of file lpfc_hbadisc.c.

int lpfc_issue_reg_vfi ( struct lpfc_vport vport)

lpfc_issue_reg_vfi - Register VFI for this vport's fabric login : pointer to a host virtual N_Port data structure.

This routine issues a REG_VFI mailbox for the vfi, vpi, fcfi triplet for the . This mailbox command is necessary for SLI4 port only.

Return code 0 - successfully issued REG_VFI for A failure code otherwise.

Definition at line 447 of file lpfc_els.c.

void lpfc_issue_reg_vpi ( struct lpfc_hba ,
struct lpfc_vport  
)

Definition at line 4913 of file lpfc_hbadisc.c.

int lpfc_issue_unreg_vfi ( struct lpfc_vport vport)

lpfc_issue_unreg_vfi - Unregister VFI for this vport's fabric login : pointer to a host virtual N_Port data structure.

This routine issues a UNREG_VFI mailbox with the vfi, vpi, fcfi triplet for the . This mailbox command is necessary for SLI4 port only.

Return code 0 - successfully issued REG_VFI for A failure code otherwise.

Definition at line 522 of file lpfc_els.c.

void lpfc_kill_board ( struct lpfc_hba phba,
LPFC_MBOXQ_t pmb 
)

lpfc_kill_board - Prepare a mailbox command for killing board : pointer to lpfc hba data structure. : pointer to the driver internal queue element for mailbox command.

The kill board mailbox command is used to tell firmware to perform a graceful shutdown of a channel on a specified board to prepare for reset. When the kill board mailbox command is received, the ER3 bit is set to 1 in the Host Status register and the ER Attention bit is set to 1 in the Host Attention register of the HBA function that received the kill board command.

This routine prepares the mailbox command for killing the board in preparation for a graceful shutdown.

Definition at line 1443 of file lpfc_mbox.c.

int lpfc_linkdown ( struct lpfc_hba )

Definition at line 869 of file lpfc_hbadisc.c.

void lpfc_linkdown_port ( struct lpfc_vport )

Definition at line 849 of file lpfc_hbadisc.c.

int lpfc_mbox_api_table_setup ( struct lpfc_hba phba,
uint8_t  dev_grp 
)

lpfc_mbox_api_table_setup - Set up mbox api function jump table : The hba struct for which this call is being executed. : The HBA PCI-Device group number.

This routine sets up the mbox interface API function jump table in struct. Returns: 0 - success, -ENODEV - failure.

Definition at line 7526 of file lpfc_sli.c.

int lpfc_mbox_cmd_check ( struct lpfc_hba phba,
LPFC_MBOXQ_t mboxq 
)

lpfc_mbox_cmd_check - Check the validality of a mailbox command : pointer to lpfc hba data structure. : pointer to the driver internal queue element for mailbox command.

This routine is to check whether a mailbox command is valid to be issued. This check will be performed by both the mailbox issue API when a client is to issue a mailbox command to the mailbox transport.

Return 0 - pass the check, -ENODEV - fail the check

Definition at line 1554 of file lpfc_mbox.c.

void lpfc_mbox_cmpl_put ( struct lpfc_hba phba,
LPFC_MBOXQ_t mbq 
)

lpfc_mbox_cmpl_put - Put mailbox command into mailbox command complete list : pointer to lpfc hba data structure. : pointer to the driver internal queue element for mailbox command.

This routine put the completed mailbox command into the mailbox command complete list. This is the locked version of the routine. The mailbox complete list is used by the driver worker thread to process mailbox complete callback functions outside the driver interrupt handler.

Definition at line 1531 of file lpfc_mbox.c.

int lpfc_mbox_dev_check ( struct lpfc_hba phba)

lpfc_mbox_dev_check - Check the device state for issuing a mailbox command : pointer to lpfc hba data structure.

This routine is to check whether the HBA device is ready for posting a mailbox command. It is used by the mailbox transport API at the time the to post a mailbox command to the device.

Return 0 - pass the check, -ENODEV - fail the check

Definition at line 1583 of file lpfc_mbox.c.

LPFC_MBOXQ_t* lpfc_mbox_get ( struct lpfc_hba phba)

lpfc_mbox_get - Remove a mailbox cmd from the head of driver's mailbox queue : pointer to lpfc hba data structure.

Driver maintains a internal mailbox command queue implemented as a linked list. When a mailbox command is issued, it shall be put into the mailbox command queue such that they shall be processed orderly as HBA can process one mailbox command at a time. After HBA finished processing a mailbox command, the driver will remove a pending mailbox command from the head of the mailbox command queue and send to the HBA for processing.

Return codes pointer to the driver internal queue element for mailbox command.

Definition at line 1492 of file lpfc_mbox.c.

void lpfc_mbox_put ( struct lpfc_hba phba,
LPFC_MBOXQ_t mbq 
)

lpfc_mbox_put - Put a mailbox cmd into the tail of driver's mailbox queue : pointer to lpfc hba data structure. : pointer to the driver internal queue element for mailbox command.

Driver maintains a internal mailbox command queue implemented as a linked list. When a mailbox command is issued, it shall be put into the mailbox command queue such that they shall be processed orderly as HBA can process one mailbox command at a time.

Definition at line 1464 of file lpfc_mbox.c.

void lpfc_mbox_timeout ( unsigned long  ptr)

lpfc_mbox_timeout - Timeout call back function for mbox timer : context object - pointer to hba structure.

This is the callback function for mailbox timer. The mailbox timer is armed when a new mailbox command is issued and the timer is deleted when the mailbox complete. The function is called by the kernel timer code when a mailbox does not complete within expected time. This function wakes up the worker thread to process the mailbox timeout and returns. All the processing is done by the worker thread function lpfc_mbox_timeout_handler.

Definition at line 6492 of file lpfc_sli.c.

void lpfc_mbox_timeout_handler ( struct lpfc_hba phba)

lpfc_mbox_timeout_handler - Worker thread function to handle mailbox timeout : Pointer to HBA context object.

This function is called from worker thread when a mailbox command times out. The caller is not required to hold any locks. This function will reset the HBA and recover all the pending commands.

Definition at line 6519 of file lpfc_sli.c.

int lpfc_mbox_tmo_val ( struct lpfc_hba phba,
LPFC_MBOXQ_t mboxq 
)

lpfc_mbox_tmo_val - Retrieve mailbox command timeout value : pointer to lpfc hba data structure. : mailbox command code.

This routine retrieves the proper timeout value according to the mailbox command code.

Return codes Timeout value to be used for the given mailbox command

Definition at line 1608 of file lpfc_mbox.c.

void* lpfc_mbuf_alloc ( struct lpfc_hba phba,
int  mem_flags,
dma_addr_t handle 
)

lpfc_mbuf_alloc - Allocate an mbuf from the lpfc_mbuf_pool PCI pool : HBA which owns the pool to allocate from : indicates if this is a priority (MEM_PRI) allocation : used to return the DMA-mapped address of the mbuf

Description: Allocates a DMA-mapped buffer from the lpfc_mbuf_pool PCI pool. Allocates from generic pci_pool_alloc function first and if that fails and mem_flags has MEM_PRI set (the only defined flag), returns an mbuf from the HBA's pool.

Notes: Not interrupt-safe. Must be called with no locks held. Takes phba->hbalock.

Returns: pointer to the allocated mbuf on success NULL on failure

Definition at line 307 of file lpfc_mem.c.

void lpfc_mbuf_free ( struct lpfc_hba phba,
void virt,
dma_addr_t  dma 
)

lpfc_mbuf_free - Free an mbuf from the lpfc_mbuf_pool PCI pool (unlocked) : HBA which owns the pool to return to : mbuf to free : the DMA-mapped address of the lpfc_mbuf_pool to be freed

Description: Returns an mbuf lpfc_mbuf_pool to the lpfc_mbuf_safety_pool if it is below its max_count, frees the mbuf otherwise.

Notes: Takes phba->hbalock. Can be called with or without other locks held.

Returns: None

Definition at line 368 of file lpfc_mem.c.

void lpfc_mbx_cmpl_dflt_rpi ( struct lpfc_hba phba,
LPFC_MBOXQ_t pmb 
)

lpfc_mbx_cmpl_dflt_rpi - Completion callbk func for unreg dflt rpi mbox cmd : pointer to lpfc hba data structure. : pointer to the driver internal queue element for mailbox command.

This routine is the completion callback function for unregister default RPI (Remote Port Index) mailbox command to the . It simply releases the associated lpfc Direct Memory Access (DMA) buffer back to the pool and decrements the ndlp reference count held for this completion callback function. After that, it invokes the lpfc_nlp_not_used() to check whether there is only one reference left on the ndlp. If so, it will perform one more decrement and trigger the release of the ndlp.

Definition at line 3595 of file lpfc_els.c.

void lpfc_mbx_cmpl_fabric_reg_login ( struct lpfc_hba ,
LPFC_MBOXQ_t  
)

Definition at line 3655 of file lpfc_hbadisc.c.

void lpfc_mbx_cmpl_fdmi_reg_login ( struct lpfc_hba ,
LPFC_MBOXQ_t  
)

Definition at line 5376 of file lpfc_hbadisc.c.

void lpfc_mbx_cmpl_ns_reg_login ( struct lpfc_hba ,
LPFC_MBOXQ_t  
)

Definition at line 3734 of file lpfc_hbadisc.c.

void lpfc_mbx_cmpl_read_topology ( struct lpfc_hba ,
LPFC_MBOXQ_t  
)

Definition at line 3209 of file lpfc_hbadisc.c.

void lpfc_mbx_cmpl_reg_login ( struct lpfc_hba ,
LPFC_MBOXQ_t  
)

Definition at line 3354 of file lpfc_hbadisc.c.

void lpfc_mbx_cmpl_reg_vfi ( struct lpfc_hba ,
LPFC_MBOXQ_t  
)

Definition at line 2863 of file lpfc_hbadisc.c.

int lpfc_mbx_unreg_vpi ( struct lpfc_vport )

Definition at line 3435 of file lpfc_hbadisc.c.

int lpfc_mem_alloc ( struct lpfc_hba phba,
int  align 
)

lpfc_mem_alloc - create and allocate all PCI and memory pools : HBA to allocate pools for

Description: Creates and allocates PCI pools lpfc_scsi_dma_buf_pool, lpfc_mbuf_pool, lpfc_hrb_pool. Creates and allocates kmalloc-backed mempools for LPFC_MBOXQ_t and lpfc_nodelist. Also allocates the VPI bitmask.

Notes: Not interrupt-safe. Must be called with no locks held. If any allocation fails, frees all successfully allocated memory before returning.

Returns: 0 on success -ENOMEM on failure (if any memory allocations fail)

Definition at line 62 of file lpfc_mem.c.

void lpfc_mem_free ( struct lpfc_hba phba)

lpfc_mem_free - Frees memory allocated by lpfc_mem_alloc : HBA to free memory for

Description: Free the memory allocated by lpfc_mem_alloc routine. This routine is a the counterpart of lpfc_mem_alloc.

Returns: None

Definition at line 179 of file lpfc_mem.c.

void lpfc_mem_free_all ( struct lpfc_hba phba)

lpfc_mem_free_all - Frees all PCI and driver memory : HBA to free memory for

Description: Free memory from PCI and driver memory pools and also those used : lpfc_scsi_dma_buf_pool, lpfc_mbuf_pool, lpfc_hrb_pool. Frees kmalloc-backed mempools for LPFC_MBOXQ_t and lpfc_nodelist. Also frees the VPI bitmask.

Returns: None

Definition at line 237 of file lpfc_mem.c.

void lpfc_more_adisc ( struct lpfc_vport vport)

lpfc_more_adisc - Issue more adisc as needed : pointer to a host virtual N_Port data structure.

This routine determines whether there are more ndlps on a node list need to have Address Discover (ADISC) issued. If so, it will invoke the lpfc_els_disc_adisc() routine to issue ADISC on the 's remaining nodes which need to have ADISC sent.

Definition at line 2184 of file lpfc_els.c.

void lpfc_more_plogi ( struct lpfc_vport vport)

lpfc_more_plogi - Check and issue remaining plogis for a vport : pointer to a host virtual N_Port data structure.

This routine checks whether there are more remaining Port Logins (PLOGI) to be issued for the . If so, it will invoke the routine lpfc_els_disc_plogi() to go through the Node Port Recovery (NPR) nodes to issue ELS PLOGIs up to the configured discover threads with the (->cfg_discovery_threads). The function also decrement the 's num_disc_node by 1 if it is not already 0.

Definition at line 1399 of file lpfc_els.c.

struct lpfc_nodelist* lpfc_nlp_get ( struct lpfc_nodelist )
read

Definition at line 5606 of file lpfc_hbadisc.c.

void lpfc_nlp_init ( struct lpfc_vport ,
struct lpfc_nodelist ,
uint32_t   
)

Definition at line 5547 of file lpfc_hbadisc.c.

int lpfc_nlp_not_used ( struct lpfc_nodelist ndlp)

Definition at line 5712 of file lpfc_hbadisc.c.

int lpfc_nlp_put ( struct lpfc_nodelist )

Definition at line 5644 of file lpfc_hbadisc.c.

void lpfc_nlp_set_state ( struct lpfc_vport ,
struct lpfc_nodelist ,
int   
)

Definition at line 4018 of file lpfc_hbadisc.c.

int lpfc_ns_cmd ( struct lpfc_vport ,
int  ,
uint8_t  ,
uint32_t   
)

Definition at line 1103 of file lpfc_ct.c.

void lpfc_offline ( struct lpfc_hba phba)

lpfc_offline - Bring a HBA offline : pointer to lpfc hba data structure.

This routine actually brings a HBA offline. It stops all the timers associated with the HBA, brings down the SLI layer, and eventually marks the HBA as in offline state for the upper layer protocol.

Definition at line 2786 of file lpfc_init.c.

void lpfc_offline_prep ( struct lpfc_hba phba,
int  mbx_action 
)

lpfc_offline_prep - Prepare a HBA to be brought offline : pointer to lpfc hba data structure.

This routine is invoked to prepare a HBA to be brought offline. It performs unregistration login to all the nodes on all vports and flushes the mailbox queue to make it ready to be brought offline.

Definition at line 2716 of file lpfc_init.c.

int lpfc_online ( struct lpfc_hba phba)

lpfc_online - Initialize and bring a HBA online : pointer to lpfc hba data structure.

This routine initializes the HBA and brings a HBA online. During this process, the management interface is blocked to prevent user space access to the HBA interfering with the driver initialization.

Return codes 0 - successful 1 - failed

Definition at line 2632 of file lpfc_init.c.

void lpfc_parse_fcoe_conf ( struct lpfc_hba phba,
uint8_t buff,
uint32_t  size 
)

lpfc_parse_fcoe_conf - Parse FCoE config data read from config region 23. : Pointer to lpfc_hba data structure. : Buffer containing config region 23 data. : Size of the data buffer.

This function parses the FCoE config parameters in config region 23 and populate driver data structure with the parameters.

Definition at line 6183 of file lpfc_hbadisc.c.

int lpfc_parse_vpd ( struct lpfc_hba phba,
uint8_t vpd,
int  len 
)

lpfc_parse_vpd - Parse VPD (Vital Product Data) : pointer to lpfc hba data structure. : pointer to the vital product data. : length of the vital product data in bytes.

This routine parses the Vital Product Data (VPD). The VPD is treated as an array of characters. In this routine, the ModelName, ProgramType, and ModelDesc, etc. fields of the phba data structure will be populated.

Return codes 0 - pointer to the VPD passed in is NULL 1 - success

Definition at line 1711 of file lpfc_init.c.

lpfc_pc_sli4_params - Initialize the PORT_CAPABILITIES SLI4 Params mbox cmd. : pointer to lpfc mbox command to initialize.

The PORT_CAPABILITIES SLI4 parameters mailbox command is issued to retrieve the particular SLI4 features supported by the port.

Definition at line 2348 of file lpfc_mbox.c.

int lpfc_pc_sli4_params_get ( struct lpfc_hba phba,
LPFC_MBOXQ_t mboxq 
)

lpfc_pc_sli4_params_get - Get the SLI4_PARAMS port capabilities. : Pointer to HBA context object. : Pointer to the mailboxq memory for the mailbox command response.

This function is called in the SLI4 code path to read the port's sli4 capabilities.

This function may be be called from any context that can block-wait for the completion. The expectation is that this routine is called typically from probe_one or from the online routine.

Definition at line 8664 of file lpfc_init.c.

void lpfc_poll_eratt ( unsigned long  ptr)

lpfc_poll_eratt - Error attention polling timer timeout handler : Pointer to address of HBA context object.

This function is invoked by the Error Attention polling timer when the timer times out. It will check the SLI Error Attention register for possible attention events. If so, it will post an Error Attention event and wake up worker thread to process it. Otherwise, it will set up the Error Attention polling timer for the next poll.

Definition at line 2847 of file lpfc_sli.c.

void lpfc_poll_start_timer ( struct lpfc_hba phba)

lpfc_poll_start_timer - Routine to start fcp_poll_timer of HBA : The Hba for which this call is being executed.

This routine starts the fcp_poll_timer of .

Definition at line 4226 of file lpfc_scsi.c.

void lpfc_poll_timeout ( unsigned long  ptr)

lpfc_poll_timeout - Restart polling timer : Map to lpfc_hba data structure pointer.

This routine restarts fcp_poll timer, when FCP ring polling is enable and FCP Ring interrupt is disable.

Definition at line 4239 of file lpfc_scsi.c.

void lpfc_port_link_failure ( struct lpfc_vport )

Definition at line 829 of file lpfc_hbadisc.c.

int lpfc_post_buffer ( struct lpfc_hba phba,
struct lpfc_sli_ring pring,
int  cnt 
)

lpfc_post_buffer - Post IOCB(s) with DMA buffer descriptor(s) to a IOCB ring : pointer to lpfc hba data structure. : pointer to a IOCB ring. : the number of IOCBs to be posted to the IOCB ring.

This routine posts a given number of IOCBs with the associated DMA buffer descriptors specified by the cnt argument to the given IOCB ring.

Return codes The number of IOCBs NOT able to be posted to the IOCB ring.

Definition at line 2111 of file lpfc_init.c.

struct lpfc_iocbq* lpfc_prep_els_iocb ( struct lpfc_vport vport,
uint8_t  expectRsp,
uint16_t  cmdSize,
uint8_t  retry,
struct lpfc_nodelist ndlp,
uint32_t  did,
uint32_t  elscmd 
)
read

lpfc_prep_els_iocb - Allocate and prepare a lpfc iocb data structure : pointer to a host virtual N_Port data structure. : flag indicating whether response is expected. : size of the ELS command. : number of retries to the command IOCB when it fails. : pointer to a node-list data structure. : destination identifier. : the ELS command code.

This routine is used for allocating a lpfc-IOCB data structure from the driver lpfc-IOCB free-list and prepare the IOCB with the parameters passed into the routine for discovery state machine to issue an Extended Link Service (ELS) commands. It is a generic lpfc-IOCB allocation and preparation routine that is used by all the discovery state machine routines and the ELS command-specific fields will be later set up by the individual discovery machine routines after calling this routine allocating and preparing a generic IOCB data structure. It fills in the Buffer Descriptor Entries (BDEs), allocates buffers for both command payload and response payload (if expected). The reference count on the ndlp is incremented by 1 and the reference to the ndlp is put into context1 of the IOCB data structure for this IOCB to hold the ndlp reference for the command's callback function to access later.

Return code Pointer to the newly allocated/prepared els iocb data structure NULL - when els iocb data structure allocation/preparation failed

Definition at line 149 of file lpfc_els.c.

void lpfc_ramp_down_queue_handler ( struct lpfc_hba phba)

lpfc_ramp_down_queue_handler - WORKER_RAMP_DOWN_QUEUE event handler : The Hba for which this call is being executed.

This routine is called to process WORKER_RAMP_DOWN_QUEUE event for worker thread.This routine reduces queue depth for all scsi device on each vport associated with .

Definition at line 384 of file lpfc_scsi.c.

void lpfc_ramp_up_queue_handler ( struct lpfc_hba phba)

lpfc_ramp_up_queue_handler - WORKER_RAMP_UP_QUEUE event handler : The Hba for which this call is being executed.

This routine is called to process WORKER_RAMP_UP_QUEUE event for worker thread.This routine increases queue depth for all scsi device on each vport associated with by 1. This routine also sets num_rsrc_err and num_cmd_success to zero.

Definition at line 436 of file lpfc_scsi.c.

void lpfc_rampdown_queue_depth ( struct lpfc_hba phba)

lpfc_rampdown_queue_depth - Post RAMP_DOWN_QUEUE event to worker thread : The Hba for which this call is being executed.

This routine is called when there is resource error in driver or firmware. This routine posts WORKER_RAMP_DOWN_QUEUE event for . This routine posts at most 1 event each second. This routine wakes up worker thread of to process WORKER_RAM_DOWN_EVENT event.

This routine should be called with no lock held.

Definition at line 302 of file lpfc_scsi.c.

void lpfc_rcv_seq_check_edtov ( struct lpfc_vport vport)

lpfc_rcv_seq_check_edtov - Cleans up timed out receive sequences. : The vport that the received sequences were sent to.

This function determines whether any received sequences have timed out by first checking the vport's rcv_buffer_time_stamp. If this time_stamp indicates that there is at least one timed out sequence this routine will go through the received sequences one at a time from most inactive to most active to determine which ones need to be cleaned up. Once it has determined that a sequence needs to be cleaned up it will simply free up the resources without sending an abort.

Definition at line 13900 of file lpfc_sli.c.

void lpfc_read_config ( struct lpfc_hba phba,
LPFC_MBOXQ_t pmb 
)

lpfc_read_config - Prepare a mailbox command for reading HBA configuration : pointer to lpfc hba data structure. : pointer to the driver internal queue element for mailbox command.

The read configuration mailbox command is used to read the HBA port configuration parameters. This mailbox command provides a method for seeing any parameters that may have changed via various configuration mailbox commands.

This routine prepares the mailbox command for reading out HBA configuration parameters.

Definition at line 671 of file lpfc_mbox.c.

void lpfc_read_lnk_stat ( struct lpfc_hba phba,
LPFC_MBOXQ_t pmb 
)

lpfc_read_lnk_stat - Prepare a mailbox command for reading HBA link stats : pointer to lpfc hba data structure. : pointer to the driver internal queue element for mailbox command.

The read link status mailbox command is used to read the link status from the HBA. Link status includes all link-related error counters. These counters are maintained by the HBA and originated in the link hardware unit. Note that all of these counters wrap.

This routine prepares the mailbox command for reading out HBA link status.

Definition at line 696 of file lpfc_mbox.c.

void lpfc_read_nv ( struct lpfc_hba phba,
LPFC_MBOXQ_t pmb 
)

lpfc_read_nv - Prepare a mailbox command for reading HBA's NVRAM param : pointer to lpfc hba data structure. : pointer to the driver internal queue element for mailbox command.

The read NVRAM mailbox command returns the HBA's non-volatile parameters that are used as defaults when the Fibre Channel link is brought on-line.

This routine prepares the mailbox command for reading information stored in the HBA's NVRAM. Specifically, the HBA's WWNN and WWPN.

Definition at line 202 of file lpfc_mbox.c.

void lpfc_read_rev ( struct lpfc_hba phba,
LPFC_MBOXQ_t pmb 
)

lpfc_read_rev - Prepare a mailbox command for reading HBA revision : pointer to lpfc hba data structure. : pointer to the driver internal queue element for mailbox command.

The read revision mailbox command is used to read the revision levels of the HBA components. These components include hardware units, resident firmware, and available firmware. HBAs that supports SLI-3 mode of operation provide different response information depending on the version requested by the driver.

This routine prepares the mailbox command for reading HBA revision information.

Definition at line 1012 of file lpfc_mbox.c.

int lpfc_read_sparam ( struct lpfc_hba phba,
LPFC_MBOXQ_t pmb,
int  vpi 
)

lpfc_read_sparam - Prepare a mailbox command for reading HBA parameters : pointer to lpfc hba data structure. : pointer to the driver internal queue element for mailbox command. : virtual N_Port identifier.

The read service parameter mailbox command is used to read the HBA port service parameters. The service parameters are read into the buffer specified directly by a BDE in the mailbox command. These service parameters may then be used to build the payload of an N_Port/F_POrt login request and reply (LOGI/ACC).

This routine prepares the mailbox command for reading HBA port service parameters. The DMA memory is allocated in this function and the addresses are populated into the mailbox command for the HBA to DMA the service parameters into.

Return codes 0 - Success 1 - DMA memory allocation failed

Definition at line 583 of file lpfc_mbox.c.

int lpfc_read_topology ( struct lpfc_hba phba,
LPFC_MBOXQ_t pmb,
struct lpfc_dmabuf mp 
)

lpfc_read_topology - Prepare a mailbox command for reading HBA topology : pointer to lpfc hba data structure. : pointer to the driver internal queue element for mailbox command. : DMA buffer memory for reading the link attention information into.

The read topology mailbox command is issued to read the link topology information indicated by the HBA port when the Link Event bit of the Host Attention (HSTATT) register is set to 1 (For SLI-3) or when an FC Link Attention ACQE is received from the port (For SLI-4). A Link Event Attention occurs based on an exception detected at the Fibre Channel link interface.

This routine prepares the mailbox command for reading HBA link topology information. A DMA memory has been set aside and address passed to the HBA through for the HBA to DMA link attention information into the memory as part of the execution of the mailbox command.

Return codes 0 - Success (currently always return 0)

Definition at line 287 of file lpfc_mbox.c.

void lpfc_reg_fcfi ( struct lpfc_hba phba,
struct lpfcMboxq mbox 
)

lpfc_reg_fcfi - Initialize the REG_FCFI mailbox command : pointer to the hba structure containing the FCF index and RQ ID. : pointer to lpfc mbox command to initialize.

The REG_FCFI mailbox command supports Fibre Channel Forwarders (FCFs). The SLI Host uses the command to activate an FCF after it has acquired FCF information via a READ_FCF mailbox command. This mailbox command also is used to indicate where received unsolicited frames from this FCF will be sent. By default this routine will set up the FCF to forward all unsolicited frames the the RQ ID passed in the . This can be overridden by the caller for more complicated setups.

Definition at line 2260 of file lpfc_mbox.c.

int lpfc_reg_rpi ( struct lpfc_hba phba,
uint16_t  vpi,
uint32_t  did,
uint8_t param,
LPFC_MBOXQ_t pmb,
uint16_t  rpi 
)

lpfc_reg_rpi - Prepare a mailbox command for registering remote login : pointer to lpfc hba data structure. : virtual N_Port identifier. : remote port identifier.

Parameters
pointer to memory holding the server parameters. : pointer to the driver internal queue element for mailbox command. : the rpi to use in the registration (usually only used for SLI4.

The registration login mailbox command is used to register an N_Port or F_Port login. This registration allows the HBA to cache the remote N_Port service parameters internally and thereby make the appropriate FC-2 decisions. The remote port service parameters are handed off by the driver to the HBA using a descriptor entry that directly identifies a buffer in host memory. In exchange, the HBA returns an RPI identifier.

This routine prepares the mailbox command for registering remote port login. The function allocates DMA buffer for passing the service parameters to the HBA with the mailbox command.

Return codes 0 - Success 1 - DMA memory allocation failed

Definition at line 733 of file lpfc_mbox.c.

void lpfc_reg_vfi ( struct lpfcMboxq mbox,
struct lpfc_vport vport,
dma_addr_t  phys 
)

lpfc_reg_vfi - Initialize the REG_VFI mailbox command : pointer to lpfc mbox command to initialize. : vport associated with the VF. : BDE DMA bus address used to send the service parameters to the HBA.

This routine initializes to all zeros and then fills in the mailbox fields from , and uses as a DMAable buffer to send the vport's fc service parameters to the HBA for this VFI. REG_VFI configures virtual fabrics identified by VFI in the context of an FCF.

Definition at line 2126 of file lpfc_mbox.c.

void lpfc_reg_vpi ( struct lpfc_vport vport,
LPFC_MBOXQ_t pmb 
)

lpfc_reg_vpi - Prepare a mailbox command for registering vport identifier : pointer to lpfc hba data structure. : virtual N_Port identifier. : Fibre Channel S_ID (N_Port_ID assigned to a virtual N_Port). : pointer to the driver internal queue element for mailbox command.

The registration vport identifier mailbox command is used to activate a virtual N_Port after it has acquired an N_Port_ID. The HBA validates the N_Port_ID against the information in the selected virtual N_Port context block and marks it active to allow normal processing of IOCB commands and received unsolicited exchanges.

This routine prepares the mailbox command for registering a virtual N_Port.

Definition at line 867 of file lpfc_mbox.c.

void lpfc_register_new_vport ( struct lpfc_hba phba,
struct lpfc_vport vport,
struct lpfc_nodelist ndlp 
)

lpfc_register_new_vport - Register a new vport with a HBA : pointer to lpfc hba data structure. : pointer to a host virtual N_Port data structure. : pointer to a node-list data structure.

This routine registers the as a new virtual port with a HBA. It is done through a registering vpi mailbox command.

Definition at line 7158 of file lpfc_els.c.

void lpfc_release_rpi ( struct lpfc_hba phba,
struct lpfc_vport vport,
uint16_t  rpi 
)

lpfc_release_rpi - Release a RPI by issuing unreg_login mailbox cmd. : Pointer to lpfc_hba structure. : Pointer to lpfc_vport structure. : rpi to be release.

This function will send a unreg_login mailbox command to the firmware to release a rpi.

Definition at line 750 of file lpfc_nportdisc.c.

void lpfc_request_features ( struct lpfc_hba phba,
struct lpfcMboxq mboxq 
)

lpfc_request_features: Configure SLI4 REQUEST_FEATURES mailbox : pointer to lpfc mbox command.

This routine sets up the mailbox for an SLI4 REQUEST_FEATURES mailbox command.

Definition at line 2062 of file lpfc_mbox.c.

void lpfc_reset_barrier ( struct lpfc_hba phba)

lpfc_reset_barrier - Make HBA ready for HBA reset : Pointer to HBA context object.

This function is called before resetting an HBA. This function is called with hbalock held and requests HBA to quiesce DMAs before a reset.

Definition at line 3667 of file lpfc_sli.c.

void lpfc_reset_hba ( struct lpfc_hba phba)

lpfc_reset_hba - Reset a hba : pointer to lpfc hba data structure.

This routine is invoked to reset a hba device. It brings the HBA offline, performs a board restart, and then brings the board back online. The lpfc_offline calls lpfc_sli_hba_down which will clean up on outstanding mailbox commands.

Definition at line 4545 of file lpfc_init.c.

void lpfc_resume_rpi ( struct lpfcMboxq mbox,
struct lpfc_nodelist ndlp 
)

lpfc_resume_rpi - Initialize the RESUME_RPI mailbox command : pointer to lpfc mbox command to initialize. : The nodelist structure that describes the RPI to resume.

The RESUME_RPI mailbox command is used to restart I/O to an RPI after a link event.

Definition at line 2307 of file lpfc_mbox.c.

void lpfc_retry_pport_discovery ( struct lpfc_hba phba)

lpfc_retry_pport_discovery - Start timer to retry FLOGI. : pointer to lpfc hba data structure.

This routine abort all pending discovery commands and start a timer to retry FLOGI for the physical port discovery.

Definition at line 7238 of file lpfc_els.c.

int lpfc_rscn_payload_check ( struct lpfc_vport vport,
uint32_t  did 
)

lpfc_rscn_payload_check - Check whether there is a pending rscn to a did : pointer to a host virtual N_Port data structure. : remote destination port identifier.

This routine checks whether there is any pending Registration State Configuration Notification (RSCN) to a on .

Return code None zero - The matched with a pending rscn 0 - not able to match with a pending rscn

Definition at line 4565 of file lpfc_els.c.

int lpfc_scan_finished ( struct Scsi_Host shost,
unsigned long  time 
)

lpfc_scan_finished - method for SCSI layer to detect whether scan is done : pointer to SCSI host data structure. : elapsed time of the scan in jiffies.

This routine is called by the SCSI layer with a SCSI host to determine whether the scan host is finished.

Note: there is no scan_start function as adapter initialization will have asynchronously kicked off the link initialization.

Return codes 0 - SCSI host scan is not over yet. 1 - SCSI host scan is over.

Definition at line 3193 of file lpfc_init.c.

int lpfc_scsi_api_table_setup ( struct lpfc_hba phba,
uint8_t  dev_grp 
)

lpfc_scsi_api_table_setup - Set up scsi api function jump table : The hba struct for which this call is being executed. : The HBA PCI-Device group number.

This routine sets up the SCSI interface API function jump table in struct. Returns: 0 - success, -ENODEV - failure.

Definition at line 4098 of file lpfc_scsi.c.

void lpfc_scsi_dev_block ( struct lpfc_hba phba)

lpfc_scsi_dev_block - set all scsi hosts to block state : Pointer to HBA context object.

This function walks vport list and set each SCSI host to block state by invoking fc_remote_port_delete() routine. This function is invoked with EEH when device's PCI slot has been permanently disabled.

Definition at line 470 of file lpfc_scsi.c.

int lpfc_selective_reset ( struct lpfc_hba )

lpfc_selective_reset - Offline then onlines the port : lpfc_hba pointer.

Description: If the port is configured to allow a reset then the hba is brought offline then online.

Notes: Assumes any error from lpfc_do_offline() will be negative. Do not make this function static.

Returns: lpfc_do_offline() return code if not zero -EIO reset not configured or error posting the event zero for success

Definition at line 738 of file lpfc_attr.c.

void lpfc_send_els_failure_event ( struct lpfc_hba phba,
struct lpfc_iocbq cmdiocbp,
struct lpfc_iocbq rspiocbp 
)

lpfc_send_els_failure_event - Posts an ELS command failure event : Pointer to hba context object. : Pointer to command iocb which reported error. : Pointer to response iocb which reported error.

This function sends an event when there is an ELS command failure.

Definition at line 6357 of file lpfc_els.c.

int lpfc_send_rrq ( struct lpfc_hba phba,
struct lpfc_node_rrq rrq 
)

lpfc_send_rrq - Sends ELS RRQ if needed. : pointer to lpfc hba data structure. : pointer to the active rrq.

This routine will call the lpfc_issue_els_rrq if the rrq is still active for the xri. If this function returns a failure then the caller needs to clean up the RRQ by calling lpfc_clr_active_rrq.

Returns 0 Success. 1 Failure.

Definition at line 5784 of file lpfc_els.c.

void lpfc_set_disctmo ( struct lpfc_vport )

Definition at line 4201 of file lpfc_hbadisc.c.

int lpfc_set_rrq_active ( struct lpfc_hba phba,
struct lpfc_nodelist ndlp,
uint16_t  xritag,
uint16_t  rxid,
uint16_t  send_rrq 
)

lpfc_set_rrq_active - set RRQ active bit in xri_bitmap. : Pointer to HBA context object. : nodelist pointer for this target. : xri used in this exchange. : Remote Exchange ID. : Flag used to determine if we should send rrq els cmd.

This function takes the hbalock. The active bit is always set in the active rrq xri_bitmap even if there is no slot avaiable for the other rrq information.

returns 0 rrq actived for this xri < 0 No memory or invalid ndlp.

Definition at line 818 of file lpfc_sli.c.

void lpfc_set_var ( struct lpfc_hba ,
LPFC_MBOXQ_t ,
uint32_t  ,
uint32_t   
)
struct lpfc_nodelist* lpfc_setup_disc_node ( struct lpfc_vport ,
uint32_t   
)
read

Definition at line 4768 of file lpfc_hbadisc.c.

void lpfc_sli4_abts_err_handler ( struct lpfc_hba ,
struct lpfc_nodelist ,
struct sli4_wcqe_xri_aborted  
)

Definition at line 8640 of file lpfc_sli.c.

int lpfc_sli4_alloc_resource_identifiers ( struct lpfc_hba phba)

lpfc_sli4_alloc_resource_identifiers - Allocate all SLI4 resource extents. : Pointer to HBA context object.

This function allocates all SLI4 resource identifiers.

Definition at line 5530 of file lpfc_sli.c.

void lpfc_sli4_build_dflt_fcf_record ( struct lpfc_hba phba,
struct fcf_record fcf_record,
uint16_t  fcf_index 
)

lpfc_sli4_build_dflt_fcf_record - Build the driver's default FCF Record. : pointer to lpfc hba data structure. : pointer to the fcf record to write the default data. : FCF table entry index.

This routine is invoked to build the driver's default FCF record. The values used are hardcoded. This routine handles memory initialization.

Definition at line 15025 of file lpfc_sli.c.

void lpfc_sli4_clear_fcf_rr_bmask ( struct lpfc_hba phba)

lpfc_sli4_clear_fcf_rr_bmask pointer to the struct lpfc_hba for this port. This fucnction resets the round robin bit mask and clears the fcf priority list. The list deletions are done while holding the hbalock. The ON_LIST flag and the FLOGI_FAILED flags are cleared from the lpfc_fcf_pri record.

Definition at line 1145 of file lpfc_hbadisc.c.

void lpfc_sli4_ct_abort_unsol_event ( struct lpfc_hba phba,
struct lpfc_sli_ring pring,
struct lpfc_iocbq piocbq 
)

lpfc_sli4_ct_abort_unsol_event - Default handle for sli4 unsol abort : Pointer to HBA context object. : Pointer to the driver internal I/O ring. : Pointer to the IOCBQ.

This function serves as the default handler for the sli4 unsolicited abort event. It shall be invoked when there is no application interface registered unsolicited abort handler. This handler does nothing but just simply releases the dma buffer used by the unsol abort event.

Definition at line 178 of file lpfc_ct.c.

int lpfc_sli4_dealloc_resource_identifiers ( struct lpfc_hba phba)

lpfc_sli4_dealloc_resource_identifiers - Deallocate all SLI4 resource extents. : Pointer to HBA context object.

This function allocates the number of elements for the specified resource type.

Definition at line 5747 of file lpfc_sli.c.

int lpfc_sli4_dump_cfg_rg23 ( struct lpfc_hba phba,
struct lpfcMboxq mbox 
)

lpfc_sli4_dump_cfg_rg23 - Dump sli4 port config region 23 : pointer to the hba structure containing. : pointer to lpfc mbox command to initialize.

This function create a SLI4 dump mailbox command to dump configure region 23.

Definition at line 2210 of file lpfc_mbox.c.

void lpfc_sli4_fcf_dead_failthrough ( struct lpfc_hba phba)

lpfc_sli4_fcf_dead_failthrough - Failthrough routine to fcf dead event : pointer to lpfc hba data structure.

This function is the failover routine as a last resort to the FCF DEAD event when driver failed to perform fast FCF failover.

Definition at line 15547 of file lpfc_sli.c.

void lpfc_sli4_fcf_rr_index_clear ( struct lpfc_hba phba,
uint16_t  fcf_index 
)

lpfc_sli4_fcf_rr_index_clear - Clear bmask from eligible fcf record index : pointer to lpfc hba data structure.

This routine clears the FCF record index from the eligible bmask for roundrobin failover search. It checks to make sure that the index does not go beyond the range of the driver allocated bmask dimension before clearing the bit.

Definition at line 15408 of file lpfc_sli.c.

int lpfc_sli4_fcf_rr_index_set ( struct lpfc_hba phba,
uint16_t  fcf_index 
)

lpfc_sli4_fcf_rr_index_set - Set bmask with eligible fcf record index : pointer to lpfc hba data structure.

This routine sets the FCF record index in to the eligible bmask for roundrobin failover search. It checks to make sure that the index does not go beyond the range of the driver allocated bmask dimension before setting the bit.

Returns 0 if the index bit successfully set, otherwise, it returns -EINVAL.

Definition at line 15379 of file lpfc_sli.c.

uint16_t lpfc_sli4_fcf_rr_next_index_get ( struct lpfc_hba phba)

lpfc_sli4_fcf_rr_next_index_get - Get next eligible fcf record index : pointer to lpfc hba data structure.

This routine is to get the next eligible FCF record index in a round robin fashion. If the next eligible FCF record index equals to the initial roundrobin FCF record index, LPFC_FCOE_FCF_NEXT_NONE (0xFFFF) shall be returned, otherwise, the next eligible FCF record's index shall be returned.

Definition at line 15306 of file lpfc_sli.c.

int lpfc_sli4_fcf_rr_next_proc ( struct lpfc_vport vport,
uint16_t  fcf_index 
)

lpfc_sli4_fcf_rr_next_proc - processing next roundrobin fcf : Pointer to vport object. : index to next fcf.

This function processing the roundrobin fcf failover to next fcf index. When this function is invoked, there will be a current fcf registered for flogi. Return: 0 for continue retrying flogi on currently registered fcf; 1 for stop flogi on currently registered fcf;

Definition at line 1930 of file lpfc_hbadisc.c.

int lpfc_sli4_get_allocated_extnts ( struct lpfc_hba phba,
uint16_t  type,
uint16_t extnt_cnt,
uint16_t extnt_size 
)

lpfc_sli4_get_allocated_extnts - Get the port's allocated extents. : Pointer to HBA context object. : The resource extent type. : buffer to hold port extent count response : buffer to hold port extent size response.

This function calls the port to read the host allocated extents for a particular type.

Definition at line 5780 of file lpfc_sli.c.

int lpfc_sli4_get_avail_extnt_rsrc ( struct lpfc_hba phba,
uint16_t  type,
uint16_t extnt_count,
uint16_t extnt_size 
)

lpfc_sli4_get_avail_extnt_rsrc - Get available resource extent count. : Pointer to HBA context object. : The resource extent type. : buffer to hold port available extent count. : buffer to hold element count per extent.

This function calls the port and retrievs the number of available extents and their size for a particular extent type.

Returns: 0 if successful. Nonzero otherwise.

Definition at line 4974 of file lpfc_sli.c.

void lpfc_sli4_handle_received_buffer ( struct lpfc_hba phba,
struct hbq_dmabuf dmabuf 
)

lpfc_sli4_handle_received_buffer - Handle received buffers from firmware : Pointer to HBA context object.

This function is called with no lock held. This function processes all the received buffers and gives it to upper layers when a received buffer indicates that it is the final frame in the sequence. The interrupt service routine processes received buffers at interrupt contexts and adds received dma buffers to the rb_pend_list queue and signals the worker thread. Worker thread calls lpfc_sli4_handle_received_buffer, which will call the appropriate receive function when the final frame in a sequence is received.

Definition at line 14495 of file lpfc_sli.c.

irqreturn_t lpfc_sli4_hba_intr_handler ( int  irq,
void dev_id 
)

lpfc_sli4_hba_intr_handler - HBA interrupt handler to SLI-4 device : Interrupt number. : The device context pointer.

This function is directly called from the PCI layer as an interrupt service routine when device with SLI-4 interface spec is enabled with MSI-X multi-message interrupt mode and there is a fast-path FCP IOCB ring event in the HBA. However, when the device is enabled with either MSI or Pin-IRQ interrupt mode, this function is called as part of the device-level interrupt handler. When the PCI slot is in error recovery or the HBA is undergoing initialization, the interrupt handler will not process the interrupt. The SCSI FCP fast-path ring event are handled in the intrrupt context. This function is called without any lock held. It gets the hbalock to access and update SLI data structures. Note that, the FCP EQ to FCP CQ are one-to-one map such that the FCP EQ index is equal to that of FCP CQ index.

The link attention and ELS ring attention events are handled by the worker thread. The interrupt handler signals the worker thread and returns for these events. This function is called without any lock held. It gets the hbalock to access and update SLI data structures.

This function returns IRQ_HANDLED when interrupt is handled else it returns IRQ_NONE.

Definition at line 11868 of file lpfc_sli.c.

irqreturn_t lpfc_sli4_intr_handler ( int  irq,
void dev_id 
)

lpfc_sli4_intr_handler - Device-level interrupt handler for SLI-4 device : Interrupt number. : The device context pointer.

This function is the device-level interrupt handler to device with SLI-4 interface spec, called from the PCI layer when either MSI or Pin-IRQ interrupt mode is enabled and there is an event in the HBA which requires driver attention. This function invokes the slow-path interrupt attention handling function and fast-path interrupt attention handling function in turn to process the relevant HBA attention events. This function is called without any lock held. It gets the hbalock to access and update SLI data structures.

This function returns IRQ_HANDLED when interrupt is handled, else it returns IRQ_NONE.

Definition at line 11973 of file lpfc_sli.c.

int lpfc_sli4_mbox_rsrc_extent ( struct lpfc_hba phba,
struct lpfcMboxq mbox,
uint16_t  exts_count,
uint16_t  rsrc_type,
bool  emb 
)

lpfc_sli4_mbox_rsrc_extent - Initialize the opcode resource extent. : pointer to lpfc hba data structure. : pointer to an allocated lpfc mbox resource. : the number of extents, if required, to allocate. : the resource extent type. : true if LPFC_SLI4_MBX_EMBED. false if LPFC_SLI4_MBX_NEMBED.

This routine completes the subcommand header for SLI4 resource extent mailbox commands. It is called after lpfc_sli4_config. The caller must pass an allocated mailbox and the attributes required to initialize the mailbox correctly.

Return: the actual length of the mbox command allocated.

Definition at line 1869 of file lpfc_mbox.c.

void lpfc_sli4_node_prep ( struct lpfc_hba phba)

lpfc_sli4_node_prep - Assign RPIs for active nodes. : pointer to lpfc hba data structure.

Allocate RPIs for all active remote nodes. This is needed whenever an SLI4 adapter is reset and the driver is not unloading. Its purpose is to fixup the temporary rpi assignments.

Definition at line 2592 of file lpfc_init.c.

int lpfc_sli4_queue_create ( struct lpfc_hba phba)

lpfc_sli4_queue_create - Create all the SLI4 queues : pointer to lpfc hba data structure.

This routine is invoked to allocate all the SLI4 queues for the FCoE HBA operation. For each SLI4 queue type, the parameters such as queue entry count (queue depth) shall be taken from the module parameter. For now, we just use some constant number as place holder.

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

Definition at line 6750 of file lpfc_init.c.

void lpfc_sli4_queue_destroy ( struct lpfc_hba phba)

lpfc_sli4_queue_destroy - Destroy all the SLI4 queues : pointer to lpfc hba data structure.

This routine is invoked to release 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 6947 of file lpfc_init.c.

struct hbq_dmabuf* lpfc_sli4_rb_alloc ( struct lpfc_hba phba)
read

lpfc_sli4_rb_alloc - Allocate an SLI4 Receive buffer : HBA to allocate a receive buffer for

Description: Allocates a DMA-mapped receive buffer from the lpfc_hrb_pool PCI pool along a non-DMA-mapped container for it.

Notes: Not interrupt-safe. Must be called with no locks held.

Returns: pointer to HBQ on success NULL on failure

Definition at line 444 of file lpfc_mem.c.

void lpfc_sli4_rb_free ( struct lpfc_hba phba,
struct hbq_dmabuf dmab 
)

lpfc_sli4_rb_free - Frees a receive buffer : HBA buffer was allocated for : DMA Buffer container returned by lpfc_sli4_hbq_alloc

Description: Frees both the container and the DMA-mapped buffers returned by lpfc_sli4_rb_alloc.

Notes: Can be called with or without locks held.

Returns: None

Definition at line 483 of file lpfc_mem.c.

int lpfc_sli4_read_config ( struct lpfc_hba phba)

lpfc_sli4_read_config - Get the config parameters. : pointer to lpfc hba data structure.

This routine is invoked to read the configuration parameters from the HBA. The configuration parameters are used to set the base and maximum values for RPI's XRI's VPI's VFI's and FCFIs. These values also affect the resource allocation for the port.

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

Definition at line 6420 of file lpfc_init.c.

int lpfc_sli4_redisc_fcf_table ( struct lpfc_hba phba)

lpfc_sli4_redisc_fcf_table - Request to rediscover entire FCF table by port. : pointer to lpfc hba data structure.

This routine is invoked to request for rediscovery of the entire FCF table by the port.

Definition at line 15500 of file lpfc_sli.c.

void lpfc_sli4_set_fcf_flogi_fail ( struct lpfc_hba phba,
uint16_t  fcf_index 
)

lpfc_sli4_set_fcf_flogi_fail : pointer to lpfc hba data structure. the index of the fcf record to update This routine acquires the hbalock and then set the LPFC_FCF_FLOGI_FAILED flag so the the round robin slection for the particular priority level will try a different fcf record that does not have this bit set. If the fcf record is re-read for any reason this flag is cleared brfore adding it to the priority list.

Definition at line 2019 of file lpfc_hbadisc.c.

void lpfc_sli4_stop_fcf_redisc_wait_timer ( struct lpfc_hba phba)

lpfc_sli4_stop_fcf_redisc_wait_timer - Stop FCF rediscovery wait timer : pointer to lpfc hba data structure.

This routine stops the SLI4 FCF rediscover wait timer if it's on. It checks whether the FCF rediscovery wait timer is pending with the host lock held before proceeding with disabling the timer and clearing the wait timer pendig flag.

Definition at line 2482 of file lpfc_init.c.

void lpfc_sli4_swap_str ( struct lpfc_hba ,
LPFC_MBOXQ_t  
)

Definition at line 1024 of file lpfc_mbox.c.

void lpfc_sli4_unreg_all_rpis ( struct lpfc_vport vport)

lpfc_sli4_unreg_all_rpis - unregister all RPIs for a vport on SLI4 HBA. : pointer to a vport object.

This routine sends mailbox command to unregister all active RPIs for a vport.

Definition at line 824 of file lpfc_mbox.c.

uint16_t lpfc_sli4_xri_inrange ( struct lpfc_hba phba,
uint16_t  xri 
)

lpfc_sli4_xri_inrange - check xri is in range of xris owned by driver. : Pointer to HBA context object. : xri id in transaction.

This function validates the xri maps to the known range of XRIs allocated an used by the driver.

Definition at line 14100 of file lpfc_sli.c.

int lpfc_sli4_xri_sgl_update ( struct lpfc_hba phba)

lpfc_sli4_xri_sgl_update - update xri-sgl sizing and mapping : pointer to lpfc hba data structure.

This routine first calculates the sizes of the current els and allocated scsi sgl lists, and then goes through all sgls to updates the physical XRIs assigned due to port function reset. During port initialization, the current els and allocated scsi sgl lists are 0s.

Return codes 0 - successful (for now, it always returns 0)

Definition at line 2871 of file lpfc_init.c.

void lpfc_sli_abort_fcp_cmpl ( struct lpfc_hba phba,
struct lpfc_iocbq cmdiocb,
struct lpfc_iocbq rspiocb 
)

lpfc_sli_abort_fcp_cmpl - Completion handler function for aborted FCP IOCBs : Pointer to HBA context object : Pointer to command iocb object. : Pointer to response iocb object.

This function is called when an aborted FCP iocb completes. This function is called by the ring event handler with no lock held. This function frees the iocb.

Definition at line 9719 of file lpfc_sli.c.

int lpfc_sli_abort_iocb ( struct lpfc_vport vport,
struct lpfc_sli_ring pring,
uint16_t  tgt_id,
uint64_t  lun_id,
lpfc_ctx_cmd  abort_cmd 
)

lpfc_sli_abort_iocb - issue abort for all commands on a host/target/LUN : Pointer to virtual port. : Pointer to driver SLI ring object. : SCSI ID of the target. : LUN ID of the scsi device. : LPFC_CTX_LUN/LPFC_CTX_TGT/LPFC_CTX_HOST.

This function sends an abort command for every SCSI command associated with the given virtual port pending on the ring filtered by lpfc_sli_validate_fcp_iocb function. When abort_cmd == LPFC_CTX_LUN, the function sends abort only to the FCP iocbs associated with lun specified by tgt_id and lun_id parameters When abort_cmd == LPFC_CTX_TGT, the function sends abort only to the FCP iocbs associated with SCSI target specified by tgt_id parameter. When abort_cmd == LPFC_CTX_HOST, the function sends abort to all FCP iocbs associated with virtual port. This function returns number of iocbs it failed to abort. This function is called with no locks held.

Definition at line 9756 of file lpfc_sli.c.

void lpfc_sli_abort_iocb_ring ( struct lpfc_hba phba,
struct lpfc_sli_ring pring 
)

lpfc_sli_abort_iocb_ring - Abort all iocbs in the ring : Pointer to HBA context object. : Pointer to driver SLI ring object.

This function aborts all iocbs in the given ring and frees all the iocb objects in txq. This function issues an abort iocb for all the iocb commands in txcmplq. The iocbs in the txcmplq is not guaranteed to complete before the return of this function. The caller is not required to hold any locks.

Definition at line 3470 of file lpfc_sli.c.

void lpfc_sli_abts_recover_port ( struct lpfc_vport ,
struct lpfc_nodelist  
)

Definition at line 8074 of file lpfc_els.c.

int lpfc_sli_api_table_setup ( struct lpfc_hba phba,
uint8_t  dev_grp 
)

lpfc_sli_api_table_setup - Set up sli api function jump table : The hba struct for which this call is being executed. : The HBA PCI-Device group number.

This routine sets up the SLI interface API function jump table in struct. Returns: 0 - success, -ENODEV - failure.

Definition at line 8430 of file lpfc_sli.c.

void lpfc_sli_bemem_bcopy ( void srcp,
void destp,
uint32_t  cnt 
)

lpfc_sli_bemem_bcopy - SLI memory copy function : Source memory pointer. : Destination memory pointer. : Number of words required to be copied.

This function is used for copying data between a data structure with big endian representation to local endianness. This function can be called with or without lock.

Definition at line 9160 of file lpfc_sli.c.

int lpfc_sli_brdkill ( struct lpfc_hba phba)

lpfc_sli_brdkill - Issue a kill_board mailbox command : Pointer to HBA context object.

This function issues a kill_board mailbox command and waits for the error attention interrupt. This function is called for stopping the firmware processing. The caller is not required to hold any locks. This function calls lpfc_hba_down_post function to free any pending commands after the kill. The function will return 1 when it fails to kill the board else will return 0.

Definition at line 3775 of file lpfc_sli.c.

int lpfc_sli_brdready ( struct lpfc_hba phba,
uint32_t  mask 
)

lpfc_sli_brdready - Wrapper func for checking the hba readyness : Pointer to HBA context object. : Bit mask to be checked.

This routine wraps the actual SLI3 or SLI4 hba readyness check routine from the API jump table function pointer from the lpfc_hba struct.

Definition at line 3653 of file lpfc_sli.c.

int lpfc_sli_brdreset ( struct lpfc_hba phba)

lpfc_sli_brdreset - Reset a sli-2 or sli-3 HBA : Pointer to HBA context object.

This function resets the HBA by writing HC_INITFF to the control register. After the HBA resets, this function resets all the iocb ring indices. This function disables PCI layer parity checking during the reset. This function returns 0 always. The caller is not required to hold any locks.

Definition at line 3872 of file lpfc_sli.c.

int lpfc_sli_brdrestart ( struct lpfc_hba phba)

lpfc_sli_brdrestart - Wrapper func for restarting hba : Pointer to HBA context object.

This routine wraps the actual SLI3 or SLI4 hba restart routine from the API jump table function pointer from the lpfc_hba struct.

Definition at line 4104 of file lpfc_sli.c.

void lpfc_sli_cancel_iocbs ( struct lpfc_hba phba,
struct list_head iocblist,
uint32_t  ulpstatus,
uint32_t  ulpWord4 
)

lpfc_sli_cancel_iocbs - Cancel all iocbs from a list. : Pointer to HBA context object. : List of IOCBs. : ULP status in IOCB command field. : ULP word-4 in IOCB command field.

This function is called with a list of IOCBs to cancel. It cancels the IOCB on the list by invoking the complete callback function associated with the IOCB with the provided and set to the IOCB commond fields.

Definition at line 1100 of file lpfc_sli.c.

int lpfc_sli_check_eratt ( struct lpfc_hba phba)

lpfc_sli_check_eratt - check error attention events : Pointer to HBA context.

This function is called from timer soft interrupt context to check HBA's error attention register bit for error attention events.

This function returns 1 when there is Error Attention in the Host Attention Register and returns 0 otherwise.

Definition at line 10285 of file lpfc_sli.c.

int lpfc_sli_config_port ( struct lpfc_hba phba,
int  sli_mode 
)

lpfc_sli_config_port - Issue config port mailbox command : Pointer to HBA context object. : sli mode - 2/3

This function is called by the sli intialization code path to issue config_port mailbox command. This function restarts the HBA firmware and issues a config_port mailbox command to configure the SLI interface in the sli mode specified by sli_mode variable. The caller is not required to hold any locks. The function returns 0 if successful, else returns negative error code.

Definition at line 4355 of file lpfc_sli.c.

void lpfc_sli_def_mbox_cmpl ( struct lpfc_hba phba,
LPFC_MBOXQ_t pmb 
)

lpfc_sli_def_mbox_cmpl - Default mailbox completion handler : Pointer to HBA context object. : Pointer to mailbox object.

This function is the default mailbox completion handler. It frees the memory resources associated with the completed mailbox command. If the completed command is a REG_LOGIN mailbox command, this function will issue a UREG_LOGIN to re-claim the RPI.

Definition at line 2142 of file lpfc_sli.c.

void lpfc_sli_flush_fcp_rings ( struct lpfc_hba phba)

lpfc_sli_flush_fcp_rings - flush all iocbs in the fcp ring : Pointer to HBA context object.

This function flushes all iocbs in the fcp ring and frees all the iocb objects in txq and txcmplq. This function will not issue abort iocbs for all the iocb commands in txcmplq, they will just be returned with IOERR_SLI_DOWN. This function is invoked with EEH when device's PCI slot has been permanently disabled.

Definition at line 3508 of file lpfc_sli.c.

irqreturn_t lpfc_sli_fp_intr_handler ( int  irq,
void dev_id 
)

lpfc_sli_fp_intr_handler - Fast-path interrupt handler to SLI-3 device. : Interrupt number. : The device context pointer.

This function is directly called from the PCI layer as an interrupt service routine when device with SLI-3 interface spec is enabled with MSI-X multi-message interrupt mode and there is a fast-path FCP IOCB ring event in the HBA. However, when the device is enabled with either MSI or Pin-IRQ interrupt mode, this function is called as part of the device-level interrupt handler. When the PCI slot is in error recovery or the HBA is undergoing initialization, the interrupt handler will not process the interrupt. The SCSI FCP fast-path ring event are handled in the intrrupt context. This function is called without any lock held. It gets the hbalock to access and update SLI data structures.

This function returns IRQ_HANDLED when interrupt is handled else it returns IRQ_NONE.

Definition at line 10689 of file lpfc_sli.c.

void lpfc_sli_free_hbq ( struct lpfc_hba phba,
struct hbq_dmabuf hbq_buffer 
)

lpfc_sli_free_hbq - Give back the hbq buffer to firmware : Pointer to HBA context object. : Pointer to HBQ buffer.

This function is called with hbalock. This function gives back the hbq buffer to firmware. If the HBQ does not have space to post the buffer, it will free the buffer.

Definition at line 2000 of file lpfc_sli.c.

uint32_t lpfc_sli_get_buffer_tag ( struct lpfc_hba phba)

lpfc_sli_get_buffer_tag - allocates a tag for a CMD_QUE_XRI64_CX buffer : Pointer to HBA context object.

When HBQ is enabled, buffers are searched based on tags. This function allocates a tag for buffer posted using CMD_QUE_XRI64_CX iocb. The tag is bit wise or-ed with QUE_BUFTAG_BIT to make sure that the tag does not conflict with tags of buffer posted for unsolicited events. The function returns the allocated tag. The function is called with no locks held.

Definition at line 9211 of file lpfc_sli.c.

struct lpfc_iocbq* lpfc_sli_get_iocbq ( struct lpfc_hba phba)
read

lpfc_sli_get_iocbq - Allocates an iocb object from iocb pool : Pointer to HBA context object.

This function is called with no lock held. This function allocates a new driver iocb object from the iocb pool. If the allocation is successful, it returns pointer to the newly allocated iocb object else it returns NULL.

Definition at line 952 of file lpfc_sli.c.

int lpfc_sli_handle_fast_ring_event ( struct lpfc_hba phba,
struct lpfc_sli_ring pring,
uint32_t  mask 
)

lpfc_sli_handle_fast_ring_event - Handle ring events on FCP ring : Pointer to HBA context object. : Pointer to driver SLI ring object. : Host attention register mask for this ring.

This function is called from the interrupt context when there is a ring event for the fcp ring. The caller does not hold any lock. The function processes each response iocb in the response ring until it finds an iocb with LE bit set and chains all the iocbs up to the iocb with LE bit set. The function will call the completion handler of the command iocb if the response iocb indicates a completion for a command iocb or it is an abort completion. The function will call lpfc_sli_process_unsol_iocb function if this is an unsolicited iocb. This routine presumes LPFC_FCP_RING handling and doesn't bother to check it explicitly.

Definition at line 2902 of file lpfc_sli.c.

int lpfc_sli_handle_mb_event ( struct lpfc_hba phba)

lpfc_sli_handle_mb_event - Handle mailbox completions from firmware : Pointer to HBA context object.

This function is called with no lock held. This function processes all the completed mailbox commands and gives it to upper layers. The interrupt service routine processes mailbox completion interrupt and adds completed mailbox commands to the mboxq_cmpl queue and signals the worker thread. Worker thread call lpfc_sli_handle_mb_event, which will return the completed mailbox commands in mboxq_cmpl queue to the upper layers. This function returns the mailbox commands to the upper layer by calling the completion handler function of each mailbox.

Definition at line 2217 of file lpfc_sli.c.

void lpfc_sli_handle_slow_ring_event ( struct lpfc_hba phba,
struct lpfc_sli_ring pring,
uint32_t  mask 
)

lpfc_sli_handle_slow_ring_event - Wrapper func for handling slow-path iocbs : Pointer to HBA context object. : Pointer to driver SLI ring object. : Host attention register mask for this ring.

This routine wraps the actual slow_ring event process routine from the API jump table function pointer from the lpfc_hba struct.

Definition at line 3264 of file lpfc_sli.c.

int lpfc_sli_hba_down ( struct lpfc_hba phba)

lpfc_sli_hba_down - Resource cleanup function for the HBA : Pointer to HBA context object.

This function cleans up all iocb, buffers, mailbox commands while shutting down the HBA. This function is called with no lock held and always returns 1. This function does the following to cleanup driver resources:

  • Free discovery resources for each virtual port
  • Cleanup any pending fabric iocbs
  • Iterate through the iocb txq and free each entry in the list.
  • Free up any buffer posted to the HBA
  • Free mailbox commands in the mailbox queue.

Definition at line 9056 of file lpfc_sli.c.

void lpfc_sli_hba_iocb_abort ( struct lpfc_hba phba)

lpfc_sli_hba_iocb_abort - Abort all iocbs to an hba. : pointer to lpfc HBA data structure.

This routine will abort all pending and outstanding iocbs to an HBA.

Definition at line 9593 of file lpfc_sli.c.

int lpfc_sli_hba_setup ( struct lpfc_hba phba)

lpfc_sli_hba_setup - SLI intialization function : Pointer to HBA context object.

This function is the main SLI intialization 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. This function issues config_port mailbox command to configure the SLI, setup iocb rings and HBQ rings. In the end the function calls the config_port_post function to issue init_link mailbox command and to start the discovery. The function will return zero if successful, else it will return negative error code.

Definition at line 4499 of file lpfc_sli.c.

int lpfc_sli_hbq_count ( void  )

lpfc_sli_hbq_count - Get the number of HBQs to be configured

This function calculates and returns the number of HBQs required to be configured.

Definition at line 4216 of file lpfc_sli.c.

int lpfc_sli_hbq_size ( void  )

lpfc_sli_hbq_size - Calculate memory required for all hbq entries

This function calculates amount of memory required for all hbq entries to be configured and returns the total memory required.

Definition at line 4247 of file lpfc_sli.c.

int lpfc_sli_hbqbuf_add_hbqs ( struct lpfc_hba phba,
uint32_t  qno 
)

lpfc_sli_hbqbuf_add_hbqs - Post more HBQ buffers to firmware : Pointer to HBA context object. : HBQ number.

This function posts more buffers to the HBQ. This function is called with no lock held. The function returns the number of HBQ entries successfully allocated.

Definition at line 1906 of file lpfc_sli.c.

void lpfc_sli_hbqbuf_free_all ( struct lpfc_hba phba)

lpfc_sli_hbqbuf_free_all - Free all the hbq buffers : Pointer to HBA context object.

This function is called with no lock held to free all the hbq buffers while uninitializing the SLI interface. It also frees the HBQ buffers returned by the firmware but not yet processed by the upper layers.

Definition at line 1672 of file lpfc_sli.c.

int lpfc_sli_host_down ( struct lpfc_vport vport)

lpfc_sli_host_down - Vport cleanup function : Pointer to virtual port object.

lpfc_sli_host_down is called to clean up the resources associated with a vport before destroying virtual port data structures. This function does following operations:

  • Free discovery resources associated with this virtual port.
  • Free iocbs associated with this virtual port in the txq.
  • Send abort for all iocb commands associated with this vport in txcmplq.

This function is called with no lock held and always returns 1.

Definition at line 8987 of file lpfc_sli.c.

irqreturn_t lpfc_sli_intr_handler ( int  irq,
void dev_id 
)

lpfc_sli_intr_handler - Device-level interrupt handler to SLI-3 device : Interrupt number. : The device context pointer.

This function is the HBA device-level interrupt handler to device with SLI-3 interface spec, called from the PCI layer when either MSI or Pin-IRQ interrupt mode is enabled and there is an event in the HBA which requires driver attention. This function invokes the slow-path interrupt attention handling function and fast-path interrupt attention handling function in turn to process the relevant HBA attention events. This function is called without any lock held. It gets the hbalock to access and update SLI data structures.

This function returns IRQ_HANDLED when interrupt is handled, else it returns IRQ_NONE.

Definition at line 10778 of file lpfc_sli.c.

int lpfc_sli_issue_abort_iotag ( struct lpfc_hba phba,
struct lpfc_sli_ring pring,
struct lpfc_iocbq cmdiocb 
)

lpfc_sli_issue_abort_iotag - Abort function for a command iocb : Pointer to HBA context object. : Pointer to driver SLI ring object. : Pointer to driver command iocb object.

This function issues an abort iocb for the provided command iocb. In case of unloading, the abort iocb will not be issued to commands on the ELS ring. Instead, the callback function shall be changed to those commands so that nothing happens when them finishes. This function is called with hbalock held. The function returns 0 when the command iocb is an abort request.

Definition at line 9506 of file lpfc_sli.c.

int lpfc_sli_issue_iocb ( struct lpfc_hba phba,
uint32_t  ring_number,
struct lpfc_iocbq piocb,
uint32_t  flag 
)

lpfc_sli_issue_iocb - Wrapper function for __lpfc_sli_issue_iocb : Pointer to HBA context object. : Pointer to driver SLI ring object. : Pointer to command iocb. : Flag indicating if this command can be put into txq.

lpfc_sli_issue_iocb is a wrapper around __lpfc_sli_issue_iocb function. This function gets the hbalock and calls __lpfc_sli_issue_iocb function and will return the error returned by __lpfc_sli_issue_iocb function. This wrapper is used by functions which do not hold hbalock.

Definition at line 8467 of file lpfc_sli.c.

int lpfc_sli_issue_iocb_wait ( struct lpfc_hba phba,
uint32_t  ring_number,
struct lpfc_iocbq piocb,
struct lpfc_iocbq prspiocbq,
uint32_t  timeout 
)

lpfc_sli_issue_iocb_wait - Synchronous function to issue iocb commands : Pointer to HBA context object.. : Pointer to sli ring. : Pointer to command iocb. : Pointer to response iocb. : Timeout in number of seconds.

This function issues the iocb to firmware and waits for the iocb to complete. If the iocb command is not completed within timeout seconds, it returns IOCB_TIMEDOUT. Caller should not free the iocb resources if this function returns IOCB_TIMEDOUT. The function waits for the iocb completion using an non-interruptible wait. This function will sleep while waiting for iocb completion. So, this function should not be called from any context which does not allow sleeping. Due to the same reason, this function cannot be called with interrupt disabled. This function assumes that the iocb completions occur while this function sleep. So, this function cannot be called from the thread which process iocb completion for this ring. This function clears the iocb_flag of the iocb object before issuing the iocb and the iocb completion handler sets this flag and wakes this thread when the iocb completes. The contents of the response iocb will be copied to prspiocbq by the completion handler when the command completes. This function returns IOCB_SUCCESS when success. This function is called with no lock held.

Definition at line 9919 of file lpfc_sli.c.

int lpfc_sli_issue_mbox ( struct lpfc_hba phba,
LPFC_MBOXQ_t pmbox,
uint32_t  flag 
)

lpfc_sli_issue_mbox - Wrapper func for issuing mailbox command : Pointer to HBA context object. : Pointer to mailbox object. : Flag indicating how the mailbox need to be processed.

This routine wraps the actual SLI3 or SLI4 mailbox issuing routine from the API jump table function pointer from the lpfc_hba struct.

Return codes the caller owns the mailbox command after the return of the function.

Definition at line 7511 of file lpfc_sli.c.

int lpfc_sli_issue_mbox_wait ( struct lpfc_hba phba,
LPFC_MBOXQ_t pmboxq,
uint32_t  timeout 
)

lpfc_sli_issue_mbox_wait - Synchronous function to issue mailbox : Pointer to HBA context object. : Pointer to driver mailbox object. : Timeout in number of seconds.

This function issues the mailbox to firmware and waits for the mailbox command to complete. If the mailbox command is not completed within timeout seconds, it returns MBX_TIMEOUT. The function waits for the mailbox completion using an interruptible wait. If the thread is woken up due to a signal, MBX_TIMEOUT error is returned to the caller. Caller should not free the mailbox resources, if this function returns MBX_TIMEOUT. This function will sleep while waiting for mailbox completion. So, this function should not be called from any context which does not allow sleeping. Due to the same reason, this function cannot be called with interrupt disabled. This function assumes that the mailbox completion occurs while this function sleep. So, this function cannot be called from the worker thread which processes mailbox completion. This function is called in the context of HBA management applications. This function returns MBX_SUCCESS when successful. This function is called with no lock held.

Definition at line 10030 of file lpfc_sli.c.

void lpfc_sli_mbox_sys_shutdown ( struct lpfc_hba phba,
int  mbx_action 
)

lpfc_sli_mbox_sys_shutdown - shutdown mailbox command sub-system : Pointer to HBA context.

This function is called to shutdown the driver's mailbox sub-system. It first marks the mailbox sub-system is in a block state to prevent the asynchronous mailbox command from issued off the pending mailbox command queue. If the mailbox command sub-system shutdown is due to HBA error conditions such as EEH or ERATT, this routine shall invoke the mailbox sub-system flush routine to forcefully bring down the mailbox sub-system. Otherwise, if it is due to normal condition (such as with offline or HBA function reset), this routine will wait for the outstanding mailbox command to complete before invoking the mailbox sub-system flush routine to gracefully bring down mailbox sub-system.

Definition at line 10089 of file lpfc_sli.c.

uint16_t lpfc_sli_next_iotag ( struct lpfc_hba phba,
struct lpfc_iocbq iocbq 
)

lpfc_sli_next_iotag - Get an iotag for the iocb : Pointer to HBA context object. : Pointer to driver iocb object.

This function gets an iotag for the iocb. If there is no unused iotag and the iocbq_lookup_len < 0xffff, this function allocates a bigger iotag_lookup array and assigns a new iotag. The function returns the allocated iotag if successful, else returns zero. Zero is not a valid iotag. The caller is not required to hold any lock.

Definition at line 1403 of file lpfc_sli.c.

void lpfc_sli_pcimem_bcopy ( void srcp,
void destp,
uint32_t  cnt 
)

lpfc_sli_pcimem_bcopy - SLI memory copy function : Source memory pointer. : Destination memory pointer. : Number of words required to be copied.

This function is used for copying data between driver memory and the SLI memory. This function also changes the endianness of each word if native endianness is different from SLI endianness. This function can be called with or without lock.

Definition at line 9132 of file lpfc_sli.c.

uint32_t lpfc_sli_port_speed_get ( struct lpfc_hba phba)

lpfc_sli_port_speed_get - Get sli3 link speed code to link speed : pointer to lpfc hba data structure.

This routine is to get an SLI3 FC port's link speed in Mbps.

Return: link speed in terms of Mbps.

Definition at line 3519 of file lpfc_init.c.

int lpfc_sli_probe_sriov_nr_virtfn ( struct lpfc_hba phba,
int  nr_vfn 
)

lpfc_sli_probe_sriov_nr_virtfn - Enable a number of sr-iov virtual functions : pointer to lpfc hba data structure. : number of virtual functions to be enabled.

This function enables the PCI SR-IOV virtual functions to a physical function. It invokes the PCI SR-IOV api with the provided to enable the number of virtual functions to the physical function. As not all devices support SR-IOV, the return code from the pci_enable_sriov() API call does not considered as an error condition for most of the device.

Definition at line 4596 of file lpfc_init.c.

int lpfc_sli_queue_setup ( struct lpfc_hba phba)

lpfc_sli_queue_setup - Queue initialization function : Pointer to HBA context object.

lpfc_sli_queue_setup sets up mailbox queues and iocb queues for each ring. This function also initializes ring indices of each ring. This function is called during the initialization of the SLI interface of an HBA. This function is called with no lock held and always returns 1.

Definition at line 8895 of file lpfc_sli.c.

void lpfc_sli_read_link_ste ( struct lpfc_hba phba)

lpfc_sli_read_link_ste - Read region 23 to decide if link is disabled. : pointer to lpfc hba data structure.

This function read region 23 and parse TLV for port status to decide if the user disaled the port. If the TLV indicates the port is disabled, the hba_flag is set accordingly.

Definition at line 15683 of file lpfc_sli.c.

void lpfc_sli_release_iocbq ( struct lpfc_hba phba,
struct lpfc_iocbq iocbq 
)

lpfc_sli_release_iocbq - Release iocb to the iocb pool : Pointer to HBA context object. : Pointer to driver iocb object.

This function is called with no lock held to release the iocb to iocb pool.

Definition at line 1075 of file lpfc_sli.c.

struct lpfc_dmabuf* lpfc_sli_ring_taggedbuf_get ( struct lpfc_hba phba,
struct lpfc_sli_ring pring,
uint32_t  tag 
)
read

lpfc_sli_ring_taggedbuf_get - find HBQ buffer associated with given tag : Pointer to HBA context object. : Pointer to driver SLI ring object. : Buffer tag.

Buffers posted using CMD_QUE_XRI64_CX iocb are in pring->postbufq list. After HBA DMA data to these buffers, CMD_IOCB_RET_XRI64_CX iocb is posted to the response ring with the tag of the buffer. This function searches the pring->postbufq list using the tag to find buffer associated with CMD_IOCB_RET_XRI64_CX iocb. If the buffer is found then lpfc_dmabuf object of the buffer is returned to the caller else NULL is returned. This function is called with no lock held.

Definition at line 9240 of file lpfc_sli.c.

struct lpfc_dmabuf* lpfc_sli_ringpostbuf_get ( struct lpfc_hba phba,
struct lpfc_sli_ring pring,
dma_addr_t  phys 
)
read

lpfc_sli_ringpostbuf_get - search buffers for unsolicited CT and ELS events : Pointer to HBA context object. : Pointer to driver SLI ring object. : DMA address of the buffer.

This function searches the buffer list using the dma_address of unsolicited event to find the driver's lpfc_dmabuf object corresponding to the dma_address. The function returns the lpfc_dmabuf object if a buffer is found else it returns NULL. This function is called by the ct and els unsolicited event handlers to get the buffer associated with the unsolicited event.

This function is called with no lock held.

Definition at line 9284 of file lpfc_sli.c.

int lpfc_sli_ringpostbuf_put ( struct lpfc_hba phba,
struct lpfc_sli_ring pring,
struct lpfc_dmabuf mp 
)

lpfc_sli_ringpostbuf_put - Function to add a buffer to postbufq : Pointer to HBA context object. : Pointer to driver SLI ring object. : Pointer to driver buffer object.

This function is called with no lock held. It always return zero after adding the buffer to the postbufq buffer list.

Definition at line 9187 of file lpfc_sli.c.

struct lpfc_iocbq* lpfc_sli_ringtx_get ( struct lpfc_hba phba,
struct lpfc_sli_ring pring 
)
read

lpfc_sli_ringtx_get - Get first element of the txq : Pointer to HBA context object. : Pointer to driver SLI ring object.

This function is called with hbalock held to get next iocb in txq of the given ring. If there is any iocb in the txq, the function returns first iocb in the list after removing the iocb from the list, else it returns NULL.

Definition at line 1324 of file lpfc_sli.c.

int lpfc_sli_setup ( struct lpfc_hba phba)

lpfc_sli_setup - SLI ring setup function : Pointer to HBA context object.

lpfc_sli_setup sets up rings of the SLI interface with number of iocbs per ring and iotags. This function is called while driver attach to the HBA and before the interrupts are enabled. So there is no need for locking.

This function always returns 0.

Definition at line 8760 of file lpfc_sli.c.

irqreturn_t lpfc_sli_sp_intr_handler ( int  irq,
void dev_id 
)

lpfc_sli_sp_intr_handler - Slow-path interrupt handler to SLI-3 device : Interrupt number. : The device context pointer.

This function is directly called from the PCI layer as an interrupt service routine when device with SLI-3 interface spec is enabled with MSI-X multi-message interrupt mode and there are slow-path events in the HBA. However, when the device is enabled with either MSI or Pin-IRQ interrupt mode, this function is called as part of the device-level interrupt handler. When the PCI slot is in error recovery or the HBA is undergoing initialization, the interrupt handler will not process the interrupt. The link attention and ELS ring attention events are handled by the worker thread. The interrupt handler signals the worker thread and returns for these events. This function is called without any lock held. It gets the hbalock to access and update SLI data structures.

This function returns IRQ_HANDLED when interrupt is handled else it returns IRQ_NONE.

Definition at line 10389 of file lpfc_sli.c.

uint16_t lpfc_sli_sriov_nr_virtfn_get ( struct lpfc_hba phba)

lpfc_sli_sriov_nr_virtfn_get - Get the number of sr-iov virtual functions : pointer to lpfc hba data structure.

This function enables the PCI SR-IOV virtual functions to a physical function. It invokes the PCI SR-IOV api with the provided to enable the number of virtual functions to the physical function. As not all devices support SR-IOV, the return code from the pci_enable_sriov() API call does not considered as an error condition for most of the device.

Definition at line 4570 of file lpfc_init.c.

int lpfc_sli_sum_iocb ( struct lpfc_vport vport,
uint16_t  tgt_id,
uint64_t  lun_id,
lpfc_ctx_cmd  ctx_cmd 
)

lpfc_sli_sum_iocb - Function to count the number of FCP iocbs pending : Pointer to virtual port. : SCSI ID of the target. : LUN ID of the scsi device. : LPFC_CTX_LUN/LPFC_CTX_TGT/LPFC_CTX_HOST.

This function returns number of FCP commands pending for the vport. When ctx_cmd == LPFC_CTX_LUN, the function returns number of FCP commands pending on the vport associated with SCSI device specified by tgt_id and lun_id parameters. When ctx_cmd == LPFC_CTX_TGT, the function returns number of FCP commands pending on the vport associated with SCSI target specified by tgt_id parameter. When ctx_cmd == LPFC_CTX_HOST, the function returns number of FCP commands pending on the vport. This function returns the number of iocbs which satisfy the filter. This function is called without any lock held.

Definition at line 9690 of file lpfc_sli.c.

void lpfc_sli_wake_mbox_wait ( struct lpfc_hba phba,
LPFC_MBOXQ_t pmboxq 
)

lpfc_sli_wake_mbox_wait - lpfc_sli_issue_mbox_wait mbox completion handler : Pointer to HBA context object. : Pointer to mailbox command.

This is completion handler function for mailbox commands issued from lpfc_sli_issue_mbox_wait function. This function is called by the mailbox event handler function with no lock held. This function will wake up thread waiting on the wait queue pointed by context1 of the mailbox.

Definition at line 2112 of file lpfc_sli.c.

void lpfc_start_fdiscs ( struct lpfc_hba phba)

lpfc_start_fdiscs - send fdiscs for each vports on this port. : pointer to lpfc hba data structure.

This function loops through the list of vports on the and issues an FDISC if possible.

Definition at line 2822 of file lpfc_hbadisc.c.

void lpfc_stop_hba_timers ( struct lpfc_hba phba)

lpfc_stop_hba_timers - Stop all the timers associated with an HBA : pointer to lpfc hba data structure.

This routine stops all the timers associated with a HBA. This function is invoked before either putting a HBA offline or unloading the driver.

Definition at line 2504 of file lpfc_init.c.

void lpfc_stop_port ( struct lpfc_hba phba)

lpfc_stop_port - Wrapper function for stopping hba port : Pointer to HBA context object.

This routine wraps the actual SLI3 or SLI4 hba stop port routine from the API jump table function pointer from the lpfc_hba struct.

Definition at line 3343 of file lpfc_init.c.

void lpfc_stop_vport_timers ( struct lpfc_vport vport)

lpfc_stop_vport_timers - Stop all the timers associated with a vport : pointer to a virtual N_Port data structure.

This routine stops all the timers associated with a . This function is invoked before disabling or deleting a . Note that the physical port is treated as 0.

Definition at line 2446 of file lpfc_init.c.

void lpfc_supported_pages ( struct lpfcMboxq mbox)

lpfc_supported_pages - Initialize the PORT_CAPABILITIES supported pages mailbox command. : pointer to lpfc mbox command to initialize.

The PORT_CAPABILITIES supported pages mailbox command is issued to retrieve the particular feature pages supported by the port.

Definition at line 2330 of file lpfc_mbox.c.

void lpfc_terminate_rport_io ( struct fc_rport )

Definition at line 70 of file lpfc_hbadisc.c.

int lpfc_test_rrq_active ( struct lpfc_hba phba,
struct lpfc_nodelist ndlp,
uint16_t  xritag 
)

lpfc_test_rrq_active - Test RRQ bit in xri_bitmap. : Pointer to HBA context object. : Targets nodelist pointer for this exchange. the xri in the bitmap to test.

This function is called with hbalock held. This function returns 0 = rrq not active for this xri 1 = rrq is valid for this xri.

Definition at line 791 of file lpfc_sli.c.

void lpfc_unblock_fabric_iocbs ( struct lpfc_hba phba)

lpfc_unblock_fabric_iocbs - Unblock issuing fabric iocb command : pointer to lpfc hba data structure.

This routine unblocks the issuing fabric iocb command. The function will clear the fabric iocb block bit and then invoke the routine lpfc_resume_fabric_iocbs() to issue one of the pending fabric iocb from the driver internal fabric iocb list.

Definition at line 7731 of file lpfc_els.c.

void lpfc_unblock_mgmt_io ( struct lpfc_hba phba)

lpfc_unblock_mgmt_io - Mark a HBA's management interface to be not blocked : pointer to lpfc hba data structure.

This routine marks a HBA's management interface as not blocked. Once the HBA's management interface is marked as not blocked, all the user space access to the HBA, whether they are from sysfs interface or libdfc interface will be allowed. The HBA is set to block the management interface when the driver prepares the HBA interface for online or offline and then set to unblock the management interface afterwards.

Definition at line 2698 of file lpfc_init.c.

void lpfc_unreg_all_rpis ( struct lpfc_vport )

Definition at line 4478 of file lpfc_hbadisc.c.

void lpfc_unreg_default_rpis ( struct lpfc_vport )

Definition at line 4508 of file lpfc_hbadisc.c.

void lpfc_unreg_did ( struct lpfc_hba phba,
uint16_t  vpi,
uint32_t  did,
LPFC_MBOXQ_t pmb 
)

lpfc_unreg_did - Prepare a mailbox command for unregistering DID : pointer to lpfc hba data structure. : virtual N_Port identifier. : remote port identifier. : pointer to the driver internal queue element for mailbox command.

The unregister DID mailbox command is used to unregister an N_Port/F_Port login for an unknown RPI by specifying the DID of a remote port. This command frees an RPI context in the HBA port. This has the effect of performing an implicit N_Port/F_Port logout.

This routine prepares the mailbox command for unregistering a remote N_Port/F_Port (DID) login.

Definition at line 638 of file lpfc_mbox.c.

void lpfc_unreg_fcfi ( struct lpfcMboxq mbox,
uint16_t  fcfi 
)

lpfc_unreg_fcfi - Initialize the UNREG_FCFI mailbox command : pointer to lpfc mbox command to initialize. : FCFI to be unregistered.

The UNREG_FCFI mailbox command supports Fibre Channel Forwarders (FCFs). The SLI Host uses the command to inactivate an FCFI.

Definition at line 2291 of file lpfc_mbox.c.

void lpfc_unreg_hba_rpis ( struct lpfc_hba phba)

lpfc_unreg_hba_rpis - Unregister rpis registered to the hba. : pointer to lpfc hba data structure.

This routine is invoked to unregister all the currently registered RPIs to the HBA.

Definition at line 4448 of file lpfc_hbadisc.c.

void lpfc_unreg_login ( struct lpfc_hba phba,
uint16_t  vpi,
uint32_t  rpi,
LPFC_MBOXQ_t pmb 
)

lpfc_unreg_login - Prepare a mailbox command for unregistering remote login : pointer to lpfc hba data structure. : virtual N_Port identifier. : remote port identifier : pointer to the driver internal queue element for mailbox command.

The unregistration login mailbox command is used to unregister an N_Port or F_Port login. This command frees an RPI context in the HBA. It has the effect of performing an implicit N_Port/F_Port logout.

This routine prepares the mailbox command for unregistering remote port login.

For SLI4 ports, the rpi passed to this function must be the physical rpi value, not the logical index.

Definition at line 797 of file lpfc_mbox.c.

int lpfc_unreg_rpi ( struct lpfc_vport ,
struct lpfc_nodelist  
)

Definition at line 4401 of file lpfc_hbadisc.c.

void lpfc_unreg_vfi ( struct lpfcMboxq mbox,
struct lpfc_vport vport 
)

lpfc_unreg_vfi - Initialize the UNREG_VFI mailbox command : pointer to lpfc mbox command to initialize. : vport associated with the VF.

The UNREG_VFI mailbox command causes the SLI Host to put a virtual fabric (logical NPort) into the inactive state. The SLI Host must have logged out and unregistered all remote N_Ports to abort any activity on the virtual fabric. The SLI Port posts the mailbox response after marking the virtual fabric inactive.

Definition at line 2193 of file lpfc_mbox.c.

void lpfc_unreg_vpi ( struct lpfc_hba phba,
uint16_t  vpi,
LPFC_MBOXQ_t pmb 
)

lpfc_unreg_vpi - Prepare a mailbox command for unregistering vport id : pointer to lpfc hba data structure. : virtual N_Port identifier. : pointer to the driver internal queue element for mailbox command.

The unregistration vport identifier mailbox command is used to inactivate a virtual N_Port. The driver must have logged out and unregistered all remote N_Ports to abort any activity on the virtual N_Port. The HBA will unregisters any default RPIs associated with the specified vpi, aborting any active exchanges. The HBA will post the mailbox response after making the virtual N_Port inactive.

This routine prepares the mailbox command for unregistering a virtual N_Port.

Definition at line 914 of file lpfc_mbox.c.

void lpfc_unregister_fcf ( struct lpfc_hba phba)

lpfc_unregister_fcf - Unregister the currently registered fcf record : Pointer to hba context object.

This function just unregisters the currently reigstered FCF. It does not try to find another FCF for discovery.

Definition at line 5987 of file lpfc_hbadisc.c.

void lpfc_unregister_fcf_rescan ( struct lpfc_hba phba)

lpfc_unregister_fcf_rescan - Unregister currently registered fcf and rescan : Pointer to hba context object.

This function unregisters the currently reigstered FCF. This function also tries to find another FCF for discovery by rescan the HBA FCF table.

Definition at line 5929 of file lpfc_hbadisc.c.

void lpfc_unregister_unused_fcf ( struct lpfc_hba phba)

lpfc_unregister_unused_fcf - Unregister FCF if all devices are disconnected. : Pointer to hba context object.

This function check if there are any connected remote port for the FCF and if all the devices are disconnected, this function unregister FCFI. This function also tries to use another FCF for discovery.

Definition at line 6019 of file lpfc_hbadisc.c.

void lpfc_unregister_vfi_cmpl ( struct lpfc_hba phba,
LPFC_MBOXQ_t mboxq 
)

lpfc_unregister_vfi_cmpl - Completion handler for unreg vfi. : Pointer to hba context object. : Pointer to mailbox object.

This function frees memory associated with the mailbox command.

Definition at line 5792 of file lpfc_hbadisc.c.

void lpfc_update_vport_wwn ( struct lpfc_vport vport)

lpfc_update_vport_wwn - Updates the fc_nodename, fc_portname, cfg_soft_wwnn, cfg_soft_wwpn : pointer to lpfc vport data structure.

Return codes None.

Definition at line 323 of file lpfc_init.c.

int lpfc_vport_disable ( struct fc_vport fc_vport,
bool  disable 
)

Definition at line 554 of file lpfc_vport.c.

int lpfc_vport_symbolic_node_name ( struct lpfc_vport ,
char ,
size_t   
)

Definition at line 1082 of file lpfc_ct.c.

int lpfc_vport_symbolic_port_name ( struct lpfc_vport ,
char ,
size_t   
)

Definition at line 1057 of file lpfc_ct.c.

void lpfc_worker_wake_up ( struct lpfc_hba )
int lpfc_workq_post_event ( struct lpfc_hba ,
void ,
void ,
uint32_t   
)

Definition at line 764 of file lpfc_hbadisc.c.

int lpfc_wr_object ( struct lpfc_hba phba,
struct list_head dmabuf_list,
uint32_t  size,
uint32_t offset 
)

lpfc_wr_object - write an object to the firmware : HBA structure that indicates port to create a queue on. : list of dmabufs to write to the port. : the total byte value of the objects to write to the port. : the current offset to be used to start the transfer.

This routine will create a wr_object mailbox command to send to the port. the mailbox command will be constructed using the dma buffers described in to create a list of BDEs. This routine will fill in as many BDEs that the imbedded mailbox can support. The variable will be used to indicate the starting offset of the transfer and will also return the offset after the write object mailbox has completed. is used to determine the end of the object and whether the eof bit should be set.

Return 0 is successful and offset will contain the the new offset to use for the next write. Return negative value for error cases.

Definition at line 15792 of file lpfc_sli.c.

Variable Documentation

char* _dump_buf_data

Definition at line 55 of file lpfc_init.c.

unsigned long _dump_buf_data_order

Definition at line 56 of file lpfc_init.c.

char* _dump_buf_dif

Definition at line 57 of file lpfc_init.c.

unsigned long _dump_buf_dif_order

Definition at line 58 of file lpfc_init.c.

int _dump_buf_done

Definition at line 51 of file lpfc_scsi.c.

spinlock_t _dump_buf_lock

Definition at line 59 of file lpfc_init.c.

int lpfc_delay_discovery

Definition at line 3979 of file lpfc_attr.c.

int lpfc_enable_npiv

Definition at line 2295 of file lpfc_attr.c.

unsigned int lpfc_fcp_look_ahead

Definition at line 3926 of file lpfc_attr.c.

struct device_attribute* lpfc_hba_attrs[]

Definition at line 3998 of file lpfc_attr.c.

struct lpfc_hbq_init* lpfc_hbq_defs[]

Definition at line 1831 of file lpfc_sli.c.

unsigned char lpfc_prot_guard

Definition at line 3961 of file lpfc_attr.c.

unsigned int lpfc_prot_mask

Definition at line 3946 of file lpfc_attr.c.

int lpfc_sli_mode

Definition at line 2288 of file lpfc_attr.c.

struct scsi_host_template lpfc_template

Definition at line 5114 of file lpfc_scsi.c.

struct fc_function_template lpfc_transport_functions

Definition at line 4886 of file lpfc_attr.c.

struct device_attribute* lpfc_vport_attrs[]

Definition at line 4085 of file lpfc_attr.c.

struct scsi_host_template lpfc_vport_template

Definition at line 5138 of file lpfc_scsi.c.

struct fc_function_template lpfc_vport_transport_functions

Definition at line 4953 of file lpfc_attr.c.

unsigned int pgcnt
spinlock_t pgcnt_lock