Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
lpfc_init.c File Reference
#include <linux/blkdev.h>
#include <linux/delay.h>
#include <linux/dma-mapping.h>
#include <linux/idr.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/kthread.h>
#include <linux/pci.h>
#include <linux/spinlock.h>
#include <linux/ctype.h>
#include <linux/aer.h>
#include <linux/slab.h>
#include <linux/firmware.h>
#include <linux/miscdevice.h>
#include <scsi/scsi.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_transport_fc.h>
#include "lpfc_hw4.h"
#include "lpfc_hw.h"
#include "lpfc_sli.h"
#include "lpfc_sli4.h"
#include "lpfc_nl.h"
#include "lpfc_disc.h"
#include "lpfc_scsi.h"
#include "lpfc.h"
#include "lpfc_logmsg.h"
#include "lpfc_crtn.h"
#include "lpfc_vport.h"
#include "lpfc_version.h"

Go to the source code of this file.

Macros

#define S(N, V)   (((V)<<(N))|((V)>>(32-(N))))
 

Functions

int lpfc_config_port_prep (struct lpfc_hba *phba)
 
void lpfc_update_vport_wwn (struct lpfc_vport *vport)
 
int lpfc_config_port_post (struct lpfc_hba *phba)
 
int lpfc_hba_init_link (struct lpfc_hba *phba, uint32_t flag)
 
int lpfc_hba_init_link_fc_topology (struct lpfc_hba *phba, uint32_t fc_topology, uint32_t flag)
 
int lpfc_hba_down_link (struct lpfc_hba *phba, uint32_t flag)
 
int lpfc_hba_down_prep (struct lpfc_hba *phba)
 
int lpfc_hba_down_post (struct lpfc_hba *phba)
 
void lpfc_hb_timeout_handler (struct lpfc_hba *phba)
 
void lpfc_handle_eratt (struct lpfc_hba *phba)
 
void lpfc_handle_latt (struct lpfc_hba *phba)
 
int lpfc_parse_vpd (struct lpfc_hba *phba, uint8_t *vpd, int len)
 
int lpfc_post_buffer (struct lpfc_hba *phba, struct lpfc_sli_ring *pring, int cnt)
 
void lpfc_hba_init (struct lpfc_hba *phba, uint32_t *hbainit)
 
void lpfc_cleanup (struct lpfc_vport *vport)
 
void lpfc_stop_vport_timers (struct lpfc_vport *vport)
 
void __lpfc_sli4_stop_fcf_redisc_wait_timer (struct lpfc_hba *phba)
 
void lpfc_sli4_stop_fcf_redisc_wait_timer (struct lpfc_hba *phba)
 
void lpfc_stop_hba_timers (struct lpfc_hba *phba)
 
void lpfc_sli4_node_prep (struct lpfc_hba *phba)
 
int lpfc_online (struct lpfc_hba *phba)
 
void lpfc_unblock_mgmt_io (struct lpfc_hba *phba)
 
void lpfc_offline_prep (struct lpfc_hba *phba, int mbx_action)
 
void lpfc_offline (struct lpfc_hba *phba)
 
int lpfc_sli4_xri_sgl_update (struct lpfc_hba *phba)
 
struct lpfc_vportlpfc_create_port (struct lpfc_hba *phba, int instance, struct device *dev)
 
void destroy_port (struct lpfc_vport *vport)
 
int lpfc_get_instance (void)
 
int lpfc_scan_finished (struct Scsi_Host *shost, unsigned long time)
 
void lpfc_host_attrib_init (struct Scsi_Host *shost)
 
void lpfc_stop_port (struct lpfc_hba *phba)
 
void lpfc_fcf_redisc_wait_start_timer (struct lpfc_hba *phba)
 
void lpfc_sli4_fcf_redisc_wait_tmo (unsigned long ptr)
 
uint32_t lpfc_sli_port_speed_get (struct lpfc_hba *phba)
 
void lpfc_sli4_async_event_proc (struct lpfc_hba *phba)
 
void lpfc_sli4_fcf_redisc_event_proc (struct lpfc_hba *phba)
 
int lpfc_api_table_setup (struct lpfc_hba *phba, uint8_t dev_grp)
 
void lpfc_reset_hba (struct lpfc_hba *phba)
 
uint16_t lpfc_sli_sriov_nr_virtfn_get (struct lpfc_hba *phba)
 
int lpfc_sli_probe_sriov_nr_virtfn (struct lpfc_hba *phba, int nr_vfn)
 
int lpfc_init_api_table_setup (struct lpfc_hba *phba, uint8_t dev_grp)
 
void lpfc_free_sgl_list (struct lpfc_hba *phba, struct list_head *sglq_list)
 
int lpfc_sli4_init_rpi_hdrs (struct lpfc_hba *phba)
 
struct lpfc_rpi_hdrlpfc_sli4_create_rpi_hdr (struct lpfc_hba *phba)
 
void lpfc_sli4_remove_rpi_hdrs (struct lpfc_hba *phba)
 
int lpfc_sli4_post_status_check (struct lpfc_hba *phba)
 
int lpfc_sli4_read_config (struct lpfc_hba *phba)
 
int lpfc_sli4_queue_create (struct lpfc_hba *phba)
 
void lpfc_sli4_queue_destroy (struct lpfc_hba *phba)
 
int lpfc_sli4_queue_setup (struct lpfc_hba *phba)
 
void lpfc_sli4_queue_unset (struct lpfc_hba *phba)
 
struct lpfc_cq_event__lpfc_sli4_cq_event_alloc (struct lpfc_hba *phba)
 
struct lpfc_cq_eventlpfc_sli4_cq_event_alloc (struct lpfc_hba *phba)
 
void __lpfc_sli4_cq_event_release (struct lpfc_hba *phba, struct lpfc_cq_event *cq_event)
 
void lpfc_sli4_cq_event_release (struct lpfc_hba *phba, struct lpfc_cq_event *cq_event)
 
int lpfc_pci_function_reset (struct lpfc_hba *phba)
 
int lpfc_pc_sli4_params_get (struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq)
 
int lpfc_get_sli4_parameters (struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq)
 
int lpfc_sli4_get_els_iocb_cnt (struct lpfc_hba *phba)
 
 MODULE_DEVICE_TABLE (pci, lpfc_id_table)
 
 module_init (lpfc_init)
 
 module_exit (lpfc_exit)
 
 MODULE_LICENSE ("GPL")
 
 MODULE_DESCRIPTION (LPFC_MODULE_DESC)
 
 MODULE_AUTHOR ("Emulex Corporation - tech.support@emulex.com")
 
 MODULE_VERSION ("0:"LPFC_DRIVER_VERSION)
 

Variables

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
 

Macro Definition Documentation

#define S (   N,
  V 
)    (((V)<<(N))|((V)>>(32-(N))))

Definition at line 2223 of file lpfc_init.c.

Function Documentation

struct lpfc_cq_event* __lpfc_sli4_cq_event_alloc ( struct lpfc_hba phba)
read

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

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

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

Definition at line 7427 of file lpfc_init.c.

void __lpfc_sli4_cq_event_release ( struct lpfc_hba phba,
struct lpfc_cq_event cq_event 
)

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

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

Definition at line 7467 of file lpfc_init.c.

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.

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.

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.

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.

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.

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

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.

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_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_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_link ( struct lpfc_hba phba,
uint32_t  flag 
)

lpfc_hba_down_link - this routine downs the FC link : pointer to lpfc hba data structure. : mailbox command issue mode - either MBX_POLL or MBX_NOWAIT

This routine will issue the DOWN_LINK mailbox command call. It is available to other drivers through the lpfc_hba data structure for use to stop the link.

Return code 0 - success Any other value - error

Definition at line 733 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 ( struct lpfc_hba phba,
uint32_t  flag 
)

lpfc_hba_init_link - Initialize the FC link : pointer to lpfc hba data structure. : 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 632 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_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.

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

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.

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.

int lpfc_pci_function_reset ( struct lpfc_hba phba)

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

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

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

Definition at line 7537 of file lpfc_init.c.

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.

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.

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.

void lpfc_sli4_async_event_proc ( struct lpfc_hba phba)

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

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

Definition at line 4304 of file lpfc_init.c.

struct lpfc_cq_event* lpfc_sli4_cq_event_alloc ( struct lpfc_hba phba)
read

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

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

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

Definition at line 7447 of file lpfc_init.c.

void lpfc_sli4_cq_event_release ( struct lpfc_hba phba,
struct lpfc_cq_event cq_event 
)

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

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

Definition at line 7482 of file lpfc_init.c.

struct lpfc_rpi_hdr* lpfc_sli4_create_rpi_hdr ( struct lpfc_hba phba)
read

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

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

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

Definition at line 5521 of file lpfc_init.c.

void lpfc_sli4_fcf_redisc_event_proc ( struct lpfc_hba phba)

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

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

Definition at line 4361 of file lpfc_init.c.

void lpfc_sli4_fcf_redisc_wait_tmo ( unsigned long  ptr)

lpfc_sli4_fcf_redisc_wait_tmo - FCF table rediscover wait timeout : Map to lpfc_hba data structure pointer.

This routine is invoked when waiting for FCF table rediscover has been timed out. If new FCF record(s) has (have) been discovered during the wait period, a new FCF event shall be added to the FCOE async event list, and then worker thread shall be waked up for processing from the worker thread context.

Definition at line 3380 of file lpfc_init.c.

int lpfc_sli4_get_els_iocb_cnt ( struct lpfc_hba phba)

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

returns the number of ELS/CT IOCBs to reserve

Definition at line 9413 of file lpfc_init.c.

int lpfc_sli4_init_rpi_hdrs ( struct lpfc_hba phba)

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

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

Return codes 0 - successful -ERROR - otherwise.

Definition at line 5485 of file lpfc_init.c.

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_post_status_check ( struct lpfc_hba phba)

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

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

Return 0 if successful, otherwise -ENODEV.

Definition at line 6066 of file lpfc_init.c.

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.

int lpfc_sli4_queue_setup ( struct lpfc_hba phba)

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

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

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

Definition at line 7046 of file lpfc_init.c.

void lpfc_sli4_queue_unset ( struct lpfc_hba phba)

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

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

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

Definition at line 7324 of file lpfc_init.c.

int lpfc_sli4_read_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.

void lpfc_sli4_remove_rpi_hdrs ( struct lpfc_hba phba)

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

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

Definition at line 5626 of file lpfc_init.c.

void lpfc_sli4_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.

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.

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.

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.

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

MODULE_AUTHOR ( "Emulex Corporation - tech.support@emulex.com"  )
MODULE_DESCRIPTION ( LPFC_MODULE_DESC  )
MODULE_DEVICE_TABLE ( pci  ,
lpfc_id_table   
)
module_exit ( lpfc_exit  )
module_init ( lpfc_init  )
MODULE_LICENSE ( "GPL"  )
MODULE_VERSION ( "0:"  LPFC_DRIVER_VERSION)

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.

spinlock_t _dump_buf_lock

Definition at line 59 of file lpfc_init.c.