emlxs_mbox.c revision e2ca2865a6870e9c6cbef6becbcc68cafde64537
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Emulex. All rights reserved.
* Use is subject to license terms.
*/
#include <emlxs.h>
/* Required for EMLXS_CONTEXT in EMLXS_MSGF calls */
{MBX_SHUTDOWN, "SHUTDOWN"},
{MBX_LOAD_SM, "LOAD_SM"},
{MBX_READ_NV, "READ_NV"},
{MBX_WRITE_NV, "WRITE_NV"},
{MBX_RUN_BIU_DIAG, "RUN_BIU_DIAG"},
{MBX_INIT_LINK, "INIT_LINK"},
{MBX_DOWN_LINK, "DOWN_LINK"},
{MBX_CONFIG_LINK, "CONFIG_LINK"},
{MBX_PART_SLIM, "PART_SLIM"},
{MBX_CONFIG_RING, "CONFIG_RING"},
{MBX_RESET_RING, "RESET_RING"},
{MBX_READ_CONFIG, "READ_CONFIG"},
{MBX_READ_RCONFIG, "READ_RCONFIG"},
{MBX_READ_SPARM, "READ_SPARM"},
{MBX_READ_STATUS, "READ_STATUS"},
{MBX_READ_RPI, "READ_RPI"},
{MBX_READ_XRI, "READ_XRI"},
{MBX_READ_REV, "READ_REV"},
{MBX_READ_LNK_STAT, "READ_LNK_STAT"},
{MBX_REG_LOGIN, "REG_LOGIN"},
{MBX_UNREG_LOGIN, "UNREG_LOGIN"},
{MBX_READ_LA, "READ_LA"},
{MBX_CLEAR_LA, "CLEAR_LA"},
{MBX_DUMP_MEMORY, "DUMP_MEMORY"},
{MBX_DUMP_CONTEXT, "DUMP_CONTEXT"},
{MBX_RUN_DIAGS, "RUN_DIAGS"},
{MBX_RESTART, "RESTART"},
{MBX_UPDATE_CFG, "UPDATE_CFG"},
{MBX_DOWN_LOAD, "DOWN_LOAD"},
{MBX_DEL_LD_ENTRY, "DEL_LD_ENTRY"},
{MBX_RUN_PROGRAM, "RUN_PROGRAM"},
{MBX_SET_MASK, "SET_MASK"},
{MBX_SET_VARIABLE, "SET_VARIABLE"},
{MBX_UNREG_D_ID, "UNREG_D_ID"},
{MBX_KILL_BOARD, "KILL_BOARD"},
{MBX_CONFIG_FARP, "CONFIG_FARP"},
{MBX_LOAD_AREA, "LOAD_AREA"},
{MBX_RUN_BIU_DIAG64, "RUN_BIU_DIAG64"},
{MBX_CONFIG_PORT, "CONFIG_PORT"},
{MBX_READ_SPARM64, "READ_SPARM64"},
{MBX_READ_RPI64, "READ_RPI64"},
{MBX_CONFIG_MSI, "CONFIG_MSI"},
{MBX_CONFIG_MSIX, "CONFIG_MSIX"},
{MBX_REG_LOGIN64, "REG_LOGIN64"},
{MBX_READ_LA64, "READ_LA64"},
{MBX_FLASH_WR_ULA, "FLASH_WR_ULA"},
{MBX_SET_DEBUG, "SET_DEBUG"},
{MBX_GET_DEBUG, "GET_DEBUG"},
{MBX_LOAD_EXP_ROM, "LOAD_EXP_ROM"},
{MBX_BEACON, "BEACON"},
{MBX_ASYNC_EVENT, "ASYNC_EVENT"},
{MBX_HEARTBEAT, "HEARTBEAT"},
{MBX_READ_EVENT_LOG_STATUS, "READ_EVENT_LOG_STATUS"},
{MBX_READ_EVENT_LOG, "READ_EVENT_LOG"},
{MBX_WRITE_EVENT_LOG, "WRITE_EVENT_LOG"},
{MBX_NV_LOG, "NV_LOG"},
{MBX_PORT_CAPABILITIES, "PORT_CAPABILITIES"},
{MBX_IOV_CONTROL, "IOV_CONTROL"},
{MBX_IOV_MBX, "IOV_MBX"},
{MBX_SLI_CONFIG, "SLI_CONFIG"},
{MBX_REQUEST_FEATURES, "REQUEST_FEATURES"},
{MBX_RESUME_RPI, "RESUME_RPI"},
{MBX_REG_VFI, "REG_VFI"},
{MBX_REG_FCFI, "REG_FCFI"},
{MBX_UNREG_VFI, "UNREG_VFI"},
{MBX_UNREG_FCFI, "UNREG_FCFI"},
{MBX_INIT_VFI, "INIT_VFI"},
{MBX_INIT_VPI, "INIT_VPI"}
}; /* emlxs_mb_cmd_table */
/*
* emlxs_mb_resetport Issue a Port Reset mailbox command
*/
/*ARGSUSED*/
extern void
{
/*
* Signifies an embedded command
*/
return;
} /* emlxs_mb_resetport() */
/*
* emlxs_mb_request_features Issue a REQUEST FEATURES mailbox command
*/
/*ARGSUSED*/
extern void
{
}
} /* emlxs_mb_request_features() */
/*
* emlxs_mb_resume_rpi Issue a RESUME_RPI mailbox command
*/
/*ARGSUSED*/
extern int
{
return (1);
}
}
return (rval);
} /* emlxs_mb_resume_rpi() */
/*ARGSUSED*/
extern void
{
/*
* Signifies an embedded command
*/
sizeof (IOCTL_COMMON_NOP);
return;
} /* emlxs_mb_noop() */
/*ARGSUSED*/
extern int
{
return (1);
}
/*
* Save address for completion
* Signifies a non-embedded command
*/
return (0);
} /* emlxs_mbext_noop() */
int
{
int rc;
"CMPL read fcf: stats: %x %x %x",
/* Wait for FCF found async event */
return (0);
}
/*
* Only support 1 FCF for now, so we don't need to walk
* thru the FCF table.
*/
/* Fix up data in FCF record */
i = *iptr;
s = *sptr;
#ifdef EMLXS_BIG_ENDIAN
#endif
/* Assign a FCFI object for the fcf_index */
if (!fcfp) {
return (0);
}
"CMPL read fcf: info: x%x x%x",
if (emlxs_sli4_bind_fcfi(hba)) {
/*
* In this phase, if we successfully bind to just
* 1 FCFI we are done.
*/
return (0);
}
"Waiting for a valid FCF to be discovered");
return (0);
}
/* Get the next one */
return (0);
}
if (rc == 0) {
return (0);
}
}
return (0);
} /* emlxs_cmpl_read_fcf_table() */
extern int
{
return (0);
}
/*
* Save address for completion
* Signifies a non-embedded command
*/
return (1);
} /* emlxs_mbext_read_fcf_table() */
int
{
"CMPL add fcf: stats: %x %x %x",
}
/* In nonFIP mode, FCF Entries are persistent */
return (0);
}
}
/*
* Now that we have a fcf table entry, read it back
* to fall into the normal link up processing.
*/
"CMPL add fcf: Cannot alloc mbox");
return (0);
}
if (rc == 0) {
"CMPL add fcf: Cannot build read fcf mbox");
return (0);
}
"CMPL add fcf: Cannot issue read fcf mbox");
}
return (0);
} /* emlxs_cmpl_add_fcf_table() */
extern int
{
return (0);
}
/*
* Save address for completion
* Signifies a non-embedded command
*/
fcfrec->fka_adv_period = 0;
#ifdef EMLXS_BIG_ENDIAN
#endif
#ifdef EMLXS_LITTLE_ENDIAN
#endif
uint16_t i;
}
"ADD FCF %d: av: %x %x ste %x macp %x "
"addr: %02x:%02x:%02x:%02x:%02x:%02x",
fcfrec->fcf_mac_address_hi[0],
return (1);
} /* emlxs_mbext_add_fcf_table() */
/*ARGSUSED*/
extern void
{
/*
* Signifies an embedded command
*/
sizeof (IOCTL_COMMON_EQ_CREATE) + IOCTL_HEADER_SZ;
sizeof (IOCTL_COMMON_EQ_CREATE);
/* 1024 * 4 bytes = 4K */
return;
} /* emlxs_mb_eq_create() */
/*ARGSUSED*/
extern void
{
/*
* Signifies an embedded command
*/
sizeof (IOCTL_COMMON_CQ_CREATE) + IOCTL_HEADER_SZ;
sizeof (IOCTL_COMMON_CQ_CREATE);
/* 256 * 16 bytes = 4K */
return;
} /* emlxs_mb_cq_create() */
/*ARGSUSED*/
extern void
{
int i;
/*
* Signifies an embedded command
*/
sizeof (IOCTL_FCOE_WQ_CREATE) + IOCTL_HEADER_SZ;
sizeof (IOCTL_FCOE_WQ_CREATE);
for (i = 0; i < EMLXS_NUM_WQ_PAGES; i++) {
addr += 4096;
}
return;
} /* emlxs_mb_wq_create() */
/*ARGSUSED*/
extern void
{
/*
* Signifies an embedded command
*/
sizeof (IOCTL_FCOE_RQ_CREATE) + IOCTL_HEADER_SZ;
sizeof (IOCTL_FCOE_RQ_CREATE);
return;
} /* emlxs_mb_rq_create() */
/*ARGSUSED*/
extern void
{
/*
* Signifies an embedded command
*/
sizeof (IOCTL_COMMON_MQ_CREATE) + IOCTL_HEADER_SZ;
sizeof (IOCTL_COMMON_MQ_CREATE);
return;
} /* emlxs_mb_mq_create() */
static int
{
"Unable to register FCFI for FCFI %d index %d",
return (0);
}
if (!vfip) {
"Unable to alloc VFI for Fabric, fcf index %d",
return (0);
}
}
}
/* Declare the linkup here */
}
return (0);
} /* emlxs_cmpl_reg_fcfi() */
/*ARGSUSED*/
extern void
{
}
/* Ignore the fcf record and force FPMA */
return;
} /* emlxs_mb_reg_fcfi() */
/* SLI4 */
static int
{
"Unable to unregister FCFI %d index %d",
}
/* Make sure link is declared down */
return (0);
} /* emlxs_cmpl_unreg_fcfi() */
/* ARGSUSED */
extern int
{
return (1);
}
}
return (0);
} /* emlxs_mb_unreg_fcfi() */
int
{
int32_t i;
return (0);
}
}
if (!mp) {
return (0);
}
ldid = FABRIC_DID;
if (!ndlp) {
/* Attempt to create a node */
sizeof (SERV_PARM));
sizeof (NAME_TYPE));
sizeof (NAME_TYPE));
/* Add the node */
/* Open the node */
} else {
"Unable to allocate node. did=%06x "
"wwpn=%02x%02x%02x%02x%02x%02x%02x%02x",
return (0);
}
} else {
"node=%p did=%06x rpi=%x "
"wwpn=%02x%02x%02x%02x%02x%02x%02x%02x",
/* Open the node */
}
if (sp->VALID_VENDOR_VERSION) {
}
}
/* If link not already down then */
/* declare it down now */
} else {
}
}
/* Since this is a fabric login */
/*
* If NPIV Fabric support has just been established on
* the physical port, then notify the vports of the
* link up
*/
/* Skip the physical port */
for (i = 1; i < MAX_VPORTS; i++) {
continue;
}
}
}
#ifdef SFCT_SUPPORT
}
}
#endif /* SFCT_SUPPORT */
return (0);
} /* emlxs_mb_cmpl_reg_vfi */
/*ARGSUSED*/
extern int
{
return (0);
}
}
/* in ms */
/* Convert to seconds */
999) / 1000;
/*
* save address for completion
*/
return (1);
} /* emlxs_mb_reg_vfi() */
/*ARGSUSED*/
extern int
{
return (1);
}
return (1);
}
}
}
return (1);
} /* emlxs_mb_unreg_vfi() */
/*ARGSUSED*/
extern void
{
return;
} /* emlxs_mb_async_event() */
/*ARGSUSED*/
extern void
{
return;
} /* emlxs_mb_heartbeat() */
#ifdef MSI_SUPPORT
/*ARGSUSED*/
extern void
{
uint32_t i;
/* Set the default message id to zero */
for (i = 1; i < intr_count; i++) {
#ifdef EMLXS_BIG_ENDIAN
}
}
}
}
}
}
}
#endif /* EMLXS_BIG_ENDIAN */
#ifdef EMLXS_LITTLE_ENDIAN
/* Accounts for half word swap of LE architecture */
}
}
}
}
}
}
}
#endif /* EMLXS_LITTLE_ENDIAN */
}
return;
} /* emlxs_mb_config_msi() */
/*ARGSUSED*/
extern void
{
uint32_t i;
/* Set the default message id to zero */
for (i = 1; i < intr_count; i++) {
#ifdef EMLXS_BIG_ENDIAN
}
}
}
}
}
}
}
#endif /* EMLXS_BIG_ENDIAN */
#ifdef EMLXS_LITTLE_ENDIAN
/* Accounts for word swap of LE architecture */
}
}
}
}
}
}
}
#endif /* EMLXS_LITTLE_ENDIAN */
}
return;
} /* emlxs_mb_config_msix() */
#endif /* MSI_SUPPORT */
/*ARGSUSED*/
extern void
{
return;
} /* emlxs_mb_reset_ring() */
/*ARGSUSED*/
extern void
{
/* Clear the local dump_region */
} else {
/* limited by mailbox size */
}
} /* emlxs_mb_dump_vpd() */
/*ARGSUSED*/
extern void
{
return;
}
/* Clear the local dump_region */
} /* emlxs_mb_dump_fcoe() */
/*ARGSUSED*/
extern void
{
/* Clear the local dump_region */
} else {
}
return;
} /* emlxs_mb_dump() */
/*
* emlxs_mb_read_nv Issue a READ NVPARAM mailbox command
*/
/*ARGSUSED*/
extern void
{
} /* emlxs_mb_read_nv() */
/*
* emlxs_mb_read_rev Issue a READ REV mailbox command
*/
/*ARGSUSED*/
extern void
{
} else {
if (v3) {
}
}
} /* emlxs_mb_read_rev() */
/*
* emlxs_mb_run_biu_diag Issue a RUN_BIU_DIAG mailbox command
*/
/*ARGSUSED*/
extern uint32_t
{
return (0);
} /* emlxs_mb_run_biu_diag() */
/* This should only be called with active MBX_NOWAIT mailboxes */
void
{
int rc;
if (!mbox) {
return;
}
} else {
}
hba->mbox_queue_flag = 0;
}
return;
} /* emlxs_mb_retry() */
int
{
int i;
if (control == 0) {
}
return (1);
}
/* Enable Link Attention interrupts */
#ifdef FMA_SUPPORT
/* Access handle validation */
#endif /* FMA_SUPPORT */
}
return (0);
}
if (mp) {
} else {
}
"tag=%d -> %d ALPA=%x",
} else {
"tag=%d -> %d ALPA=%x",
}
} else {
}
/* Make sure link is declared down */
}
/* If link not already up then declare it up now */
#ifdef MENLO_SUPPORT
la.granted_AL_PA = 0;
}
#endif /* MENLO_SUPPORT */
/* Save the linkspeed */
/* Check for old model adapters that only */
/* supported 1Gb */
}
} else {
}
if (i == 0) {
} else {
uint32_t j;
/* Check number of devices in map */
}
"alpa_map: %d device(s): "
"%02x %02x %02x %02x %02x %02x "
"alpa_map: "
"%02x %02x %02x %02x %02x "
"%02x %02x %02x",
alpa_map[j],
alpa_map[j + 1],
alpa_map[j + 2],
alpa_map[j + 3],
alpa_map[j + 4],
alpa_map[j + 5],
alpa_map[j + 6],
alpa_map[j + 7]);
}
}
}
#ifdef MENLO_SUPPORT
/* Check if Menlo maintenance mode is enabled */
"Maintenance Mode enabled.");
} else {
"Maintenance Mode disabled.");
}
/* Check FCoE attention bit */
}
}
#endif /* MENLO_SUPPORT */
MEM_MBOX, 1))) {
/* This should turn on DELAYED ABTS for */
/* ELS timeouts */
}
MEM_MBOX, 1))) {
/* If link not already down then */
/* declare it down now */
} else {
}
}
MEM_MBOX, 1))) {
}
/* Declare the linkup here */
}
/* If link not already down then declare it down now */
/* Make sure link is declared down */
}
/* Enable Link attention interrupt */
#ifdef FMA_SUPPORT
/* Access handle validation */
#endif /* FMA_SUPPORT */
}
/* Log the link event */
return (0);
} /* emlxs_cmpl_read_la() */
/*
* emlxs_mb_read_la Issue a READ LA mailbox command
*/
extern uint32_t
{
return (1);
}
/*
* save address for completion
*/
return (0);
} /* emlxs_mb_read_la() */
int
{
int i, rc;
la_enable = 1;
/* Get a buffer which will be used for */
/* mailbox commands */
MEM_MBOX, 1))) {
/* Get link attention message */
(rc != MBX_SUCCESS)) {
(void) emlxs_mem_put(hba,
}
la_enable = 0;
} else {
}
}
}
if (la_enable) {
/* Enable Link Attention interrupts */
#ifdef FMA_SUPPORT
/* Access handle validation */
#endif /* FMA_SUPPORT */
}
} else {
/* Disable Link Attention interrupts */
#ifdef FMA_SUPPORT
/* Access handle validation */
#endif /* FMA_SUPPORT */
}
}
return (0);
}
/* Enable on Link Attention interrupts */
#ifdef FMA_SUPPORT
/* Access handle validation */
#endif /* FMA_SUPPORT */
}
}
/* Adapter is now ready for FCP traffic */
/* Register vpi's for all ports that have did's */
for (i = 0; i < MAX_VPORTS; i++) {
continue;
}
}
/* Attempt to send any pending IO */
}
return (0);
} /* emlxs_cmpl_clear_la() */
/*
* emlxs_mb_clear_la Issue a CLEAR LA mailbox command
*/
extern void
{
#ifdef FC_RPI_CHECK
#endif /* FC_RPI_CHECK */
return;
} /* emlxs_mb_clear_la() */
/*
* emlxs_mb_read_status Issue a READ STATUS mailbox command
*/
/*ARGSUSED*/
extern void
{
} /* fc_read_status() */
/*
* emlxs_mb_read_lnk_stat Issue a LINK STATUS mailbox command
*/
/*ARGSUSED*/
extern void
{
} /* emlxs_mb_read_lnk_stat() */
/*
* emlxs_mb_write_nv Issue a WRITE NVPARAM mailbox command
*/
static void
{
int32_t i;
for (i = 0; i < 21; i++) {
}
} /* emlxs_mb_write_nv() */
/*
* emlxs_mb_part_slim Issue a PARTITION SLIM mailbox command
*/
static void
{
} /* emlxs_mb_part_slim() */
/*
* emlxs_mb_config_ring Issue a CONFIG RING mailbox command
*/
extern void
{
int32_t i;
int32_t j;
j = 0;
for (i = 0; i < ring; i++) {
}
if ((j + i) >= 6) {
break;
}
}
return;
} /* emlxs_mb_config_ring() */
/*
* emlxs_mb_config_link Issue a CONFIG LINK mailbox command
*/
extern void
{
/*
* NEW_FEATURE SLI-2, Coalescing Response Feature.
*/
}
return;
} /* emlxs_mb_config_link() */
int
{
/* Retry only MBX_NOWAIT requests */
"Retrying. %s: status=%x. Auto-speed set.",
return (1);
}
}
}
return (0);
} /* emlxs_cmpl_init_link() */
/*
* emlxs_mb_init_link Issue an INIT LINK mailbox command
*/
extern void
{
return;
}
switch (topology) {
case FLAGS_LOCAL_LB:
break;
break;
break;
case FLAGS_TOPOLOGY_MODE_LOOP:
break;
break;
}
}
/*
* Setting up the link speed
*/
switch (linkspeed) {
case 0:
break;
case 1:
linkspeed = 0;
}
break;
case 2:
linkspeed = 0;
}
break;
case 4:
linkspeed = 0;
}
break;
case 8:
linkspeed = 0;
}
break;
case 10:
linkspeed = 0;
}
break;
default:
linkspeed = 0;
break;
}
}
return;
} /* emlxs_mb_init_link() */
/*
* emlxs_mb_down_link Issue a DOWN LINK mailbox command
*/
/*ARGSUSED*/
extern void
{
return;
} /* emlxs_mb_down_link() */
int
{
int32_t i;
if (control == 0) {
}
return (1);
}
return (0);
}
if (!mp) {
return (0);
}
/* Initialize the node name and port name only once */
} else {
}
"SPARAM: EDTOV hba=x%x mbox_csp=x%x, BBC=x%x",
/* Initialize the physical port */
sizeof (NAME_TYPE));
sizeof (NAME_TYPE));
/* Initialize the virtual ports */
for (i = 1; i < MAX_VPORTS; i++) {
continue;
}
sizeof (SERV_PARM));
sizeof (NAME_TYPE));
sizeof (NAME_TYPE));
}
return (0);
} /* emlxs_cmpl_read_sparam() */
/*
* emlxs_mb_read_sparam Issue a READ SPARAM mailbox command
*/
extern uint32_t
{
return (1);
}
/*
* save address for completion
*/
return (0);
} /* emlxs_mb_read_sparam() */
/*
* emlxs_mb_read_rpi Issue a READ RPI mailbox command
*/
/*ARGSUSED*/
extern uint32_t
{
/*
* Set flag to issue action on cmpl
*/
return (0);
} /* emlxs_mb_read_rpi() */
/*
* emlxs_mb_read_xri Issue a READ XRI mailbox command
*/
/*ARGSUSED*/
extern uint32_t
{
/*
* Set flag to issue action on cmpl
*/
return (0);
} /* emlxs_mb_read_xri() */
/*ARGSUSED*/
extern int32_t
{
return (0);
}
/* Validate the service parameters */
return (1);
}
return (2);
}
/* If the receive data length is zero then set it to */
/* the CSP value */
if (!nsp_value) {
return (0);
}
}
/* If the receive data length is zero then set it to */
/* the CSP value */
if (!nsp_value) {
return (0);
}
}
return (0);
} /* emlxs_mb_check_sparm() */
int
{
int32_t i;
if (control == 0) {
/* Special handle for vport PLOGI */
}
return (0);
}
return (1);
}
}
/* Special handle for vport PLOGI */
}
return (0);
}
if (!mp) {
return (0);
}
/* First copy command data */
if (!ndlp) {
/* Attempt to create a node */
sizeof (SERV_PARM));
sizeof (NAME_TYPE));
sizeof (NAME_TYPE));
/* Add the node */
/* Open the node */
} else {
"Unable to allocate node. did=%06x rpi=%x "
"wwpn=%02x%02x%02x%02x%02x%02x%02x%02x",
return (0);
}
} else {
"node=%p did=%06x rpi=%x "
"wwpn=%02x%02x%02x%02x%02x%02x%02x%02x",
/* Open the node */
}
if (sp->VALID_VENDOR_VERSION) {
}
}
}
/* If this was a fabric login */
/* If CLEAR_LA has been sent, then attempt to */
/* register the vpi now */
}
/*
* If NPIV Fabric support has just been established on
* the physical port, then notify the vports of the
* link up
*/
if ((lvpi == 0) &&
/* Skip the physical port */
for (i = 1; i < MAX_VPORTS; i++) {
continue;
}
}
}
}
}
#ifdef DHCHAP_SUPPORT
/* Auth started - auth completion will */
/* handle sbp and ubp now */
}
}
#endif /* DHCHAP_SUPPORT */
#ifdef SFCT_SUPPORT
}
}
#endif /* SFCT_SUPPORT */
return (0);
} /* emlxs_cmpl_reg_did() */
/*
* emlxs_mb_reg_did Issue a REG_LOGIN mailbox command
*/
extern uint32_t
{
/* Check for invalid node ids to register */
return (1);
}
if (did & 0xff000000) {
return (1);
}
"Invalid service parameters. did=%06x rval=%d", did,
rval);
return (1);
}
/* Check if the node limit has been reached */
"Limit reached. did=%06x count=%d", did,
port->node_count);
return (1);
}
"Unable to allocate mailbox. did=%x", did);
return (1);
}
/* Build login request */
"Unable to allocate buffer. did=%x", did);
return (1);
}
/*
* If we are SLI4, the RPI number gets assigned by the driver.
* For SLI3, the firmware assigns the RPI number.
*/
if (!rp) {
}
if (!rp) {
"Unable to get an rpi. did=%x", did);
return (1);
}
}
if (rp) {
}
}
return (0);
} /* emlxs_mb_reg_did() */
/*
* emlxs_mb_unreg_rpi Issue a UNREG_LOGIN mailbox command
*/
extern uint32_t
{
int rval;
if (rpi != 0xffff) {
/* Make sure the node does already exist */
if (ndlp) {
/*
* If we just unregistered the host node then
* clear the host DID
*/
}
/* remove it */
} else {
return (1);
}
} else { /* Unreg all */
}
return (1);
}
#define INDEX_INDICATOR_VPI 1
} else {
}
}
port->outstandingRPIs--;
if ((port->outstandingRPIs == 0) &&
/* No more RPIs so unreg the VPI */
(void) emlxs_mb_unreg_vpi(port);
}
}
return (0);
} /* emlxs_mb_unreg_rpi() */
/*
* emlxs_mb_unreg_did Issue a UNREG_DID mailbox command
*/
extern uint32_t
{
int rval = 0;
/*
* Unregister all default RPIs if did == 0xffffffff
*/
if (did != 0xffffffff) {
/* Check for base node */
/* just flush base node */
0, 0, 0);
(void) emlxs_chipq_node_flush(port, 0,
/* Return now */
return (1);
}
/*
* A zero DID means that we are trying to unreg the host node
* after a link bounce
*/
/*
* If the prev_did == 0 then the adapter has been reset and
* there is no need in unregistering
*/
/*
* If the prev_did != 0 then we can look for the hosts
* last known DID node
*/
if (did == 0) {
return (1);
}
}
/* Make sure the node does already exist */
if (ndlp) {
/* Use UNREG_RPI for SLI4 */
}
return (rval);
}
/* remove it */
/*
* If we just unregistered the host node then
* clear the host DID
*/
}
} else {
return (1);
}
} else {
/* SLI4 doesn't have dflt RPIs in SLI Port */
return (0);
}
}
return (1);
}
}
return (0);
} /* emlxs_mb_unreg_did() */
/*
* emlxs_mb_set_mask Issue a SET MASK mailbox command
*/
/*ARGSUSED*/
static void
{
} /* emlxs_mb_set_mask() */
/*
* emlxs_mb_set_debug Issue a special debug mailbox command
*/
/*ARGSUSED*/
static void
{
} /* emlxs_mb_set_debug() */
/*
* emlxs_mb_set_var Issue a special debug mbox command to write slim
*/
/*ARGSUSED*/
extern void
{
/* addr = 0x090597 is AUTO ABTS disable for ELS commands */
/* addr = 0x052198 is DELAYED ABTS enable for ELS commands */
/* addr = 0x100506 is for setting PCI MAX READ value */
/*
* Always turn on DELAYED ABTS for ELS timeouts
*/
value = 1;
}
} /* emlxs_mb_set_var() */
/*
* Disable Traffic Cop
*/
/*ARGSUSED*/
extern void
{
} /* emlxs_disable_tc() */
extern void
{
int i;
/* Copy info for profiles 2,3,5. Other profiles this area is reserved */
}
/* Return if no rctl / type masks for this HBQ */
if (!hbq->HBQ_num_mask) {
return;
}
/* Otherwise we setup specific rctl / type masks for this HBQ */
for (i = 0; i < hbq->HBQ_num_mask; i++) {
}
return;
} /* emlxs_mb_config_hbq() */
int
{
}
return (0);
} /* emlxs_cmpl_init_vpi() */
extern uint32_t
{
int rval;
return (0);
}
return (1);
}
}
return (0);
} /* emlxs_mb_init_vpi() */
/* Leadville wll start sending PLOGI right after */
/* FDISC completion, we need to wait for REG_VPI */
/* completion, before sending back the FDISK request */
/* Also, allocate a node structure for Fabric port */
int
{
return (0);
}
if (!sbp) {
return (0);
}
ldid = FABRIC_DID;
if (!ndlp) {
/* Attempt to create a node */
sizeof (SERV_PARM));
sizeof (NAME_TYPE));
sizeof (NAME_TYPE));
/* Add the node */
/* Open the node */
} else {
"Unable to allocate node. did=%06x "
"wwpn=%02x%02x%02x%02x%02x%02x%02x%02x",
return (0);
}
} else {
"node=%p did=%06x rpi=%x "
"wwpn=%02x%02x%02x%02x%02x%02x%02x%02x",
/* Open the node */
}
return (0);
} /* emlxs_cmpl_reg_vpi */
extern uint32_t
{
int rval;
return (0);
}
/* Can't reg vpi until ClearLA is sent */
return (1);
}
/* Must have port id */
return (1);
}
return (1);
}
} else {
}
if (sbp) {
}
}
return (0);
} /* emlxs_mb_reg_vpi() */
int
{
}
return (0);
} /* emlxs_cmpl_unreg_vpi() */
extern uint32_t
{
int rval;
return (0);
}
return (1);
}
} else {
}
}
}
vfip->outstandingVPIs--;
if ((vfip->outstandingVPIs == 0) &&
/* No more VPIs so unreg the VFI */
} else {
}
}
}
return (0);
} /* emlxs_mb_unreg_vpi() */
/*
* emlxs_mb_config_farp Issue a CONFIG FARP mailbox command
*/
extern void
{
} /* emlxs_mb_config_farp() */
/*
* emlxs_mb_read_nv Issue a READ CONFIG mailbox command
*/
/*ARGSUSED*/
extern void
{
} else {
}
} /* emlxs_mb_read_config() */
/*
* NAME: emlxs_mb_put
*
* FUNCTION: put mailbox cmd onto the mailbox queue.
*
* EXECUTION ENVIRONMENT: process and interrupt level.
*
* NOTES:
*
* CALLED FROM: EMLXS_SLI_ISSUE_MBOX_CMD
*
* INPUT: hba - pointer to the device info area
* mbp - pointer to mailbox queue entry of mailbox cmd
*
* RETURNS: NULL - command queued
*/
extern void
{
/*
* queue command to end of list
*/
} else {
/*
* add command to empty list
*/
}
} /* emlxs_mb_put() */
/*
* NAME: emlxs_mb_get
*
* FUNCTION: get a mailbox command from mailbox command queue
*
* EXECUTION ENVIRONMENT: interrupt level.
*
* NOTES:
*
* CALLED FROM: emlxs_handle_mb_event
*
* INPUT: hba - pointer to the device info area
*
* RETURNS: NULL - no match found mb pointer - pointer to a mailbox command
*/
extern MAILBOXQ *
{
} else {
}
}
return (p_first);
} /* emlxs_mb_get() */
/* EMLXS_PORT_LOCK must be held when calling this */
void
{
#ifdef FMA_SUPPORT
#endif /* FMA_SUPPORT */
/* Set the Mailbox timer */
/* Initialize mailbox */
}
}
return;
} /* emlxs_mb_init() */
extern void
{
if (hba->mbox_queue_flag) {
if (mbxStatus != MBX_SUCCESS) {
} else {
}
}
if (mbox_mbq) {
} else {
mbox_iocbq = NULL;
}
hba->mbox_queue_flag = 0;
hba->mbox_timer = 0;
if (mbox_queue_flag == MBX_NOWAIT) {
/* Check for deferred MBUF cleanup */
if (mbox_bp) {
}
if (mbox_nonembed) {
(uint8_t *)mbox_nonembed);
}
if (mbox_mbq) {
}
} else { /* MBX_WAIT */
if (mbox_mbq) {
if (mb) {
/* Copy the local mailbox provided back into */
/* the original mailbox */
} else {
}
}
/* Mark mailbox complete */
}
/* Wake up the sleeping thread */
if (mbox_queue_flag == MBX_SLEEP) {
}
}
#ifdef SFCT_SUPPORT
"FCT mailbox: %s: status=%x",
}
#endif /* SFCT_SUPPORT */
/* Check for deferred pkt completion */
if (mbox_sbp) {
if (mbxStatus != MBX_SUCCESS) {
/* Set error status */
IOERR_NO_RESOURCES, 1);
}
}
/* Check for deferred ub completion */
if (mbox_ubp) {
}
/* Special handling for vport PLOGI */
mbox_iocbq = NULL;
}
/* Check for deferred iocb tx */
if (mbox_iocbq) {
/* Check for driver special codes */
/* These indicate the mailbox is being flushed */
if (mbxStatus >= MBX_DRIVER_RESERVED) {
/* Set the error status and return it */
} else {
}
}
return;
} /* emlxs_mb_fini() */
extern void
{
/* Flush out the active mbox command */
/* Flush out the queued mbox commands */
}
return;
} /* emlxs_mb_flush */
extern char *
{
static char buffer[32];
uint32_t i;
for (i = 0; i < count; i++) {
return (emlxs_mb_cmd_table[i].string);
}
}
return (buffer);
} /* emlxs_mb_cmd_xlate() */