Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
lpfc_mbox.c File Reference
#include <linux/blkdev.h>
#include <linux/pci.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_transport_fc.h>
#include <scsi/scsi.h>
#include <scsi/fc/fc_fs.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_compat.h"

Go to the source code of this file.

Functions

int lpfc_dump_static_vport (struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb, uint16_t offset)
 
void lpfc_down_link (struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
 
void lpfc_dump_mem (struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb, uint16_t offset, uint16_t region_id)
 
void lpfc_dump_wakeup_param (struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
 
void lpfc_read_nv (struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
 
void lpfc_config_async (struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb, uint32_t ring)
 
void lpfc_heart_beat (struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
 
int lpfc_read_topology (struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb, struct lpfc_dmabuf *mp)
 
void lpfc_clear_la (struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
 
void lpfc_config_link (struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
 
int lpfc_config_msi (struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
 
void lpfc_init_link (struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb, uint32_t topology, uint32_t linkspeed)
 
int lpfc_read_sparam (struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb, int vpi)
 
void lpfc_unreg_did (struct lpfc_hba *phba, uint16_t vpi, uint32_t did, LPFC_MBOXQ_t *pmb)
 
void lpfc_read_config (struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
 
void lpfc_read_lnk_stat (struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
 
int lpfc_reg_rpi (struct lpfc_hba *phba, uint16_t vpi, uint32_t did, uint8_t *param, LPFC_MBOXQ_t *pmb, uint16_t rpi)
 
void lpfc_unreg_login (struct lpfc_hba *phba, uint16_t vpi, uint32_t rpi, LPFC_MBOXQ_t *pmb)
 
void lpfc_sli4_unreg_all_rpis (struct lpfc_vport *vport)
 
void lpfc_reg_vpi (struct lpfc_vport *vport, LPFC_MBOXQ_t *pmb)
 
void lpfc_unreg_vpi (struct lpfc_hba *phba, uint16_t vpi, LPFC_MBOXQ_t *pmb)
 
void lpfc_read_rev (struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
 
void lpfc_sli4_swap_str (struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
 
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)
 
void lpfc_config_ring (struct lpfc_hba *phba, int ring, LPFC_MBOXQ_t *pmb)
 
void lpfc_config_port (struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
 
void lpfc_kill_board (struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
 
void lpfc_mbox_put (struct lpfc_hba *phba, LPFC_MBOXQ_t *mbq)
 
LPFC_MBOXQ_tlpfc_mbox_get (struct lpfc_hba *phba)
 
void __lpfc_mbox_cmpl_put (struct lpfc_hba *phba, LPFC_MBOXQ_t *mbq)
 
void lpfc_mbox_cmpl_put (struct lpfc_hba *phba, LPFC_MBOXQ_t *mbq)
 
int lpfc_mbox_cmd_check (struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq)
 
int lpfc_mbox_dev_check (struct lpfc_hba *phba)
 
int lpfc_mbox_tmo_val (struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq)
 
void lpfc_sli4_mbx_sge_set (struct lpfcMboxq *mbox, uint32_t sgentry, dma_addr_t phyaddr, uint32_t length)
 
void lpfc_sli4_mbx_sge_get (struct lpfcMboxq *mbox, uint32_t sgentry, struct lpfc_mbx_sge *sge)
 
void lpfc_sli4_mbox_cmd_free (struct lpfc_hba *phba, struct lpfcMboxq *mbox)
 
int lpfc_sli4_config (struct lpfc_hba *phba, struct lpfcMboxq *mbox, uint8_t subsystem, uint8_t opcode, uint32_t length, bool emb)
 
int lpfc_sli4_mbox_rsrc_extent (struct lpfc_hba *phba, struct lpfcMboxq *mbox, uint16_t exts_count, uint16_t rsrc_type, bool emb)
 
uint8_t lpfc_sli_config_mbox_subsys_get (struct lpfc_hba *phba, LPFC_MBOXQ_t *mbox)
 
uint8_t lpfc_sli_config_mbox_opcode_get (struct lpfc_hba *phba, LPFC_MBOXQ_t *mbox)
 
int lpfc_sli4_mbx_read_fcf_rec (struct lpfc_hba *phba, struct lpfcMboxq *mboxq, uint16_t fcf_index)
 
void lpfc_request_features (struct lpfc_hba *phba, struct lpfcMboxq *mboxq)
 
void lpfc_init_vfi (struct lpfcMboxq *mbox, struct lpfc_vport *vport)
 
void lpfc_reg_vfi (struct lpfcMboxq *mbox, struct lpfc_vport *vport, dma_addr_t phys)
 
void lpfc_init_vpi (struct lpfc_hba *phba, struct lpfcMboxq *mbox, uint16_t vpi)
 
void lpfc_unreg_vfi (struct lpfcMboxq *mbox, struct lpfc_vport *vport)
 
int lpfc_sli4_dump_cfg_rg23 (struct lpfc_hba *phba, struct lpfcMboxq *mbox)
 
void lpfc_reg_fcfi (struct lpfc_hba *phba, struct lpfcMboxq *mbox)
 
void lpfc_unreg_fcfi (struct lpfcMboxq *mbox, uint16_t fcfi)
 
void lpfc_resume_rpi (struct lpfcMboxq *mbox, struct lpfc_nodelist *ndlp)
 
void lpfc_supported_pages (struct lpfcMboxq *mbox)
 
void lpfc_pc_sli4_params (struct lpfcMboxq *mbox)
 

Function Documentation

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

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.

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.

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.

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

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.

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.

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

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

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

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

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

Definition at line 1761 of file lpfc_mbox.c.

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_mbox_cmd_free ( struct lpfc_hba phba,
struct lpfcMboxq mbox 
)

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

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

Definition at line 1711 of file lpfc_mbox.c.

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

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

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

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

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

Definition at line 2007 of file lpfc_mbox.c.

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

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

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

Definition at line 1691 of file lpfc_mbox.c.

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

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

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

Definition at line 1670 of file lpfc_mbox.c.

void lpfc_sli4_swap_str ( struct lpfc_hba phba,
LPFC_MBOXQ_t pmb 
)

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.

uint8_t lpfc_sli_config_mbox_opcode_get ( struct lpfc_hba phba,
LPFC_MBOXQ_t mbox 
)

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

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

Definition at line 1973 of file lpfc_mbox.c.

uint8_t lpfc_sli_config_mbox_subsys_get ( struct lpfc_hba phba,
LPFC_MBOXQ_t mbox 
)

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

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

Definition at line 1940 of file lpfc_mbox.c.

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

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.