emlxs_dfc.c revision bb63f56ebeb244bd34f5e8d50900e3420f01b394
/*
* 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>
#ifdef DFC_SUPPORT
/* Required for EMLXS_CONTEXT in EMLXS_MSGF calls */
#ifdef SFCT_SUPPORT
#endif /* SFCT_SUPPORT */
#ifdef NPIV_SUPPORT
#endif /* NPIV_SUPPORT */
#ifdef DHCHAP_SUPPORT
#endif /* DHCHAP_SUPPORT */
#ifdef SAN_DIAG_SUPPORT
#endif
#ifdef FCIO_SUPPORT
#endif /* FCIO_SUPPORT */
emlxs_table_t emlxs_dfc_table[] = {
{EMLXS_GET_HBAINFO, "GET_HBAINFO"},
{EMLXS_GET_REV, "GET_REV"},
{EMLXS_SET_DIAG, "SET_DIAG"},
{EMLXS_SEND_MBOX, "SEND_MBOX"},
{EMLXS_READ_PCI, "READ_PCI"},
{EMLXS_WRITE_PCI, "WRITE_PCI"},
{EMLXS_GET_CFG, "GET_CFG"},
{EMLXS_SET_CFG, "SET_CFG"},
{EMLXS_SEND_CT, "SEND_CT"},
{EMLXS_SEND_CT_RSP, "SEND_CT_RSP"},
{EMLXS_SEND_MENLO, "SEND_MENLO"},
{EMLXS_WRITE_FLASH, "WRITE_FLASH"},
{EMLXS_READ_FLASH, "READ_FLASH"},
{EMLXS_SEND_ELS, "SEND_ELS"},
{EMLXS_LOOPBACK_TEST, "LOOPBACK_TEST"},
{EMLXS_GET_DUMPREGION, "GET_DUMPREGION"},
{EMLXS_LOOPBACK_MODE, "LOOPBACK_MODE"},
{EMLXS_GET_IOINFO, "GET_IOINFO"},
{EMLXS_GET_LINKINFO, "GET_LINKINFO"},
{EMLXS_GET_NODEINFO, "GET_NODEINFO"},
{EMLXS_READ_MEM, "READ_MEM"},
{EMLXS_WRITE_MEM, "WRITE_MEM"},
{EMLXS_WRITE_CTLREG, "WRITE_CTLREG"},
{EMLXS_READ_CTLREG, "READ_CTLREG"},
{EMLXS_SEND_SCSI, "SEND_SCSI"},
{EMLXS_GET_EVENT, "GET_EVENT"},
{EMLXS_SET_EVENT, "SET_EVENT"},
{EMLXS_GET_EVENTINFO, "GET_EVENTINFO"},
{EMLXS_GET_HBASTATS, "GET_HBASTATS"},
{EMLXS_GET_DRVSTATS, "GET_DRVSTATS"},
{EMLXS_CREATE_VPORT, "CREATE_VPORT"},
{EMLXS_DESTROY_VPORT, "DESTROY_VPORT"},
{EMLXS_GET_VPORTINFO, "GET_VPORTINFO"},
{EMLXS_NPIV_RESOURCE, "NPIV_RESOURCE"},
{EMLXS_NPIV_TEST, "NPIV_TEST"},
{EMLXS_INIT_AUTH, "INIT_AUTH"},
{EMLXS_GET_AUTH_CFG, "GET_AUTH_CFG"},
{EMLXS_SET_AUTH_CFG, "SET_AUTH_CFG"},
{EMLXS_GET_AUTH_PASSWORD, "GET_AUTH_PASSWORD"},
{EMLXS_SET_AUTH_PASSWORD, "SET_AUTH_PASSWORD"},
{EMLXS_GET_AUTH_STATUS, "GET_AUTH_STATUS"},
{EMLXS_GET_AUTH_CFG_TABLE, "GET_AUTH_CFG_TABLE"},
{EMLXS_GET_AUTH_KEY_TABLE, "GET_AUTH_KEY_TABLE"},
{EMLXS_FCIO_CMD, "FCIO_CMD"},
{EMLXS_GET_FCTSTAT, "GET_FCTSTAT"},
}; /* emlxs_dfc_table */
{FC_REG_LINK_EVENT, "LINK_EVENT"},
{FC_REG_RSCN_EVENT, "RSCN_EVENT"},
{FC_REG_CT_EVENT, "CT_EVENT"},
{FC_REG_DUMP_EVENT, "DUMP_EVENT"},
{FC_REG_TEMP_EVENT, "TEMP_EVENT"},
{FC_REG_VPORTRSCN_EVENT, "VPORTRSCN_EVENT"},
{FC_REG_FCOE_EVENT, "FCOE_EVENT"},
}; /* emlxs_dfc_event_table */
#ifdef SAN_DIAG_SUPPORT
#endif
extern char *
{
static char buffer[32];
uint32_t i;
for (i = 0; i < count; i++) {
return (emlxs_dfc_table[i].string);
}
}
return (buffer);
} /* emlxs_dfc_xlate() */
extern char *
{
static char buffer[32];
uint32_t i;
for (i = 0; i < count; i++) {
return (emlxs_dfc_event_table[i].string);
}
}
return (buffer);
} /* emlxs_dfc_event_xlate() */
extern int32_t
{
int rval = 0;
"%s: Unable to allocate dfc buffer.",
return (DFC_SYSRES_ERROR);
}
#ifdef _MULTI_DATAMODEL
case DDI_MODEL_ILP32:
{
"%s: ddi_copyin failed.",
break;
}
break;
}
case DDI_MODEL_NONE:
mode)) {
"%s: ddi_copyin failed.",
}
break;
}
#else /* _MULTI_DATAMODEL */
}
#endif /* _MULTI_DATAMODEL */
case EMLXS_GET_HBAINFO:
{
break;
}
case EMLXS_GET_HBASTATS:
{
break;
}
case EMLXS_GET_DRVSTATS:
{
break;
}
case EMLXS_GET_NODEINFO:
{
break;
}
case EMLXS_SET_DIAG:
{
break;
}
case EMLXS_SEND_MBOX:
{
break;
}
case EMLXS_READ_PCI:
{
break;
}
case EMLXS_WRITE_PCI:
{
break;
}
case EMLXS_GET_CFG:
{
break;
}
case EMLXS_SET_CFG:
{
break;
}
case EMLXS_SEND_CT:
{
break;
}
case EMLXS_SEND_CT_RSP:
{
break;
}
#ifdef MENLO_SUPPORT
case EMLXS_SEND_MENLO:
{
break;
}
#endif /* MENLO_SUPPORT */
case EMLXS_WRITE_FLASH:
{
break;
}
case EMLXS_READ_FLASH:
{
break;
}
case EMLXS_SEND_ELS:
{
break;
}
case EMLXS_LOOPBACK_TEST:
{
break;
}
case EMLXS_GET_DUMPREGION:
{
break;
}
case EMLXS_LOOPBACK_MODE:
{
break;
}
case EMLXS_GET_IOINFO:
{
break;
}
case EMLXS_GET_LINKINFO:
{
break;
}
#ifdef SFCT_SUPPORT
case EMLXS_GET_FCTSTAT:
{
break;
}
#endif /* SFCT_SUPPORT */
case EMLXS_READ_MEM:
{
break;
}
case EMLXS_WRITE_MEM:
{
break;
}
case EMLXS_WRITE_CTLREG:
{
break;
}
case EMLXS_READ_CTLREG:
{
break;
}
case EMLXS_GET_EVENTINFO:
{
break;
}
case EMLXS_GET_EVENT:
{
break;
}
case EMLXS_SET_EVENT:
{
break;
}
case EMLXS_GET_REV:
{
break;
}
case EMLXS_SEND_SCSI:
{
break;
}
#ifdef NPIV_SUPPORT
case EMLXS_CREATE_VPORT:
{
break;
}
case EMLXS_DESTROY_VPORT:
{
break;
}
case EMLXS_GET_VPORTINFO:
{
break;
}
case EMLXS_NPIV_RESOURCE:
{
break;
}
case EMLXS_NPIV_TEST:
{
break;
}
#endif /* NPIV_SUPPORT */
#ifdef DHCHAP_SUPPORT
case EMLXS_INIT_AUTH:
{
break;
}
case EMLXS_GET_AUTH_CFG:
{
break;
}
case EMLXS_SET_AUTH_CFG:
{
break;
}
case EMLXS_GET_AUTH_PASSWORD:
{
break;
}
case EMLXS_SET_AUTH_PASSWORD:
{
break;
}
case EMLXS_GET_AUTH_STATUS:
{
break;
}
case EMLXS_GET_AUTH_CFG_TABLE:
{
break;
}
case EMLXS_GET_AUTH_KEY_TABLE:
{
break;
}
#endif /* DHCHAP_SUPPORT */
#ifdef FCIO_SUPPORT
case EMLXS_FCIO_CMD:
break;
#endif /* FCIO_SUPPORT */
#ifdef SAN_DIAG_SUPPORT
case EMLXS_SD_SET_BUCKET:
break;
case EMLXS_SD_DESTROY_BUCKET:
break;
case EMLXS_SD_GET_BUCKET:
break;
break;
break;
break;
case EMLXS_SD_GET_DATA:
break;
case EMLXS_SD_SET_EVENT:
break;
case EMLXS_SD_GET_EVENT:
break;
#endif
default:
} /* switch() */
return (rval);
} /* emlxs_dfc_manage() */
#ifdef FCIO_SUPPORT
{FCIO_GET_NUM_DEVS, "GET_NUM_DEVS"},
{FCIO_GET_DEV_LIST, "GET_DEV_LIST"},
{FCIO_GET_SYM_PNAME, "GET_SYM_PNAME"},
{FCIO_GET_SYM_NNAME, "GET_SYM_NNAME"},
{FCIO_SET_SYM_PNAME, "SET_SYM_PNAME"},
{FCIO_SET_SYM_NNAME, "SET_SYM_NNAME"},
{FCIO_GET_LOGI_PARAMS, "GET_LOGI_PARAMS"},
{FCIO_DEV_LOGIN, "DEV_LOGIN"},
{FCIO_DEV_LOGOUT, "DEV_LOGOUT"},
{FCIO_GET_STATE, "GET_STATE"},
{FCIO_DEV_REMOVE, "DEV_REMOVE"},
{FCIO_GET_FCODE_REV, "GET_FCODE_REV"},
{FCIO_GET_FW_REV, "GET_FW_REV"},
{FCIO_GET_DUMP_SIZE, "GET_DUMP_SIZE"},
{FCIO_FORCE_DUMP, "FORCE_DUMP"},
{FCIO_GET_DUMP, "GET_DUMP"},
{FCIO_GET_TOPOLOGY, "GET_TOPOLOGY"},
{FCIO_RESET_LINK, "RESET_LINK"},
{FCIO_RESET_HARD, "RESET_HARD"},
{FCIO_RESET_HARD_CORE, "RESET_HARD_CORE"},
{FCIO_DIAG, "DIAG"},
{FCIO_NS, "NS"},
{FCIO_DOWNLOAD_FW, "DOWNLOAD_FW"},
{FCIO_GET_HOST_PARAMS, "GET_HOST_PARAMS"},
{FCIO_LINK_STATUS, "LINK_STATUS"},
{FCIO_DOWNLOAD_FCODE, "DOWNLOAD_FCODE"},
{FCIO_GET_NODE_ID, "GET_NODE_ID"},
{FCIO_SET_NODE_ID, "SET_NODE_ID"},
{FCIO_SEND_NODE_ID, "SEND_NODE_ID"},
{FCIO_GET_ADAPTER_ATTRIBUTES, "GET_ADAPTER_ATTRIBUTES"},
{FCIO_GET_OTHER_ADAPTER_PORTS, "GET_OTHER_ADAPTER_PORTS"},
{FCIO_GET_ADAPTER_PORT_ATTRIBUTES, "GET_ADAPTER_PORT_ATTRIBUTES"},
{FCIO_GET_DISCOVERED_PORT_ATTRIBUTES, "GET_DISCOVERED_PORT_ATTRIBUTES"},
{FCIO_GET_PORT_ATTRIBUTES, "GET_PORT_ATTRIBUTES"},
{FCIO_GET_ADAPTER_PORT_STATS, "GET_ADAPTER_PORT_STATS"},
}; /* emlxs_fcio_table */
extern char *
{
static char buffer[32];
uint32_t i;
for (i = 0; i < count; i++) {
return (emlxs_fcio_table[i].string);
}
}
return (buffer);
} /* emlxs_fcio_xlate() */
static int32_t
{
int rval = 0;
&emlxs_dfc_error_msg, "%s: %s: Null buffer4 found.",
return (EFAULT);
}
"%s: %s: Buffer4 too small. (size=%d)",
return (EFAULT);
}
/* Map DFC to FCIO */
"%s: %s: Unable to allocate ibuf. (size=%d)",
goto done;
}
mode)) {
"%s: %s: ddi_copyin failed. (size=%d)",
goto done;
}
}
"%s: %s: Unable to allocate obuf. (size=%d)",
goto done;
}
mode)) {
"%s: %s: ddi_copyin failed. (size=%d)",
goto done;
}
}
"%s: %s: Unable to allocate abuf. (size=%d)",
goto done;
}
mode)) {
"%s: %s: ddi_copyin failed. (size=%d)",
goto done;
}
}
#ifdef _MULTI_DATAMODEL
use32 = 1;
}
#endif /* _MULTI_DATAMODEL */
/* FCIO command */
case FCIO_DIAG:
{
if (rval != FC_SUCCESS) {
if (rval == FC_INVALID_REQUEST) {
} else {
}
}
break;
}
case FCIO_GET_HOST_PARAMS:
{
uint32_t i;
if (use32) {
break;
}
port_dev->
(uint8_t)(i & 0xff);
break;
}
}
}
} else {
break;
}
port_dev->
(uint8_t)(i & 0xff);
break;
}
}
}
}
break;
}
case FCIO_RESET_LINK:
{
break;
}
if (rval != FC_SUCCESS) {
}
} else {
}
break;
}
case FCIO_RESET_HARD:
case FCIO_RESET_HARD_CORE:
{
if (rval != FC_SUCCESS) {
}
break;
}
case FCIO_DOWNLOAD_FW:
{
break;
}
if (rval != FC_SUCCESS) {
}
break;
}
case FCIO_GET_FW_REV:
{
break;
}
if (rval != FC_SUCCESS) {
}
break;
}
case FCIO_GET_FCODE_REV:
{
break;
}
if (rval != FC_SUCCESS) {
}
break;
}
case FCIO_DOWNLOAD_FCODE:
{
break;
}
if (rval != FC_SUCCESS) {
}
break;
}
{
if (use32) {
sizeof (fc_hba_adapter_attributes32_t)) {
break;
}
sizeof (hba_attrs->Manufacturer));
sizeof (hba_attrs->SerialNumber));
sizeof (hba_attrs->ModelDescription));
sizeof (hba_attrs->NodeSymbolicName));
sizeof (hba_attrs->OptionROMVersion));
sizeof (hba_attrs->DriverName));
} else {
sizeof (fc_hba_adapter_attributes_t)) {
break;
}
sizeof (hba_attrs->Manufacturer));
sizeof (hba_attrs->SerialNumber));
sizeof (hba_attrs->ModelDescription));
sizeof (hba_attrs->NodeSymbolicName));
sizeof (hba_attrs->OptionROMVersion));
sizeof (hba_attrs->DriverName));
}
break;
}
{
if (use32) {
sizeof (fc_hba_port_attributes32_t)) {
break;
}
port_attrs->lastChange = 0;
port_attrs->fp_minor = 0;
/* port_attrs->PortFcId */
/* port_attrs->PortType */
/* port_attrs->PortSpeed */
/* port_attrs->FabricName */
} else {
} else {
}
if (ndlp) {
sizeof (port_attrs->FabricName));
}
case 0:
break;
case LA_1GHZ_LINK:
break;
case LA_2GHZ_LINK:
break;
case LA_4GHZ_LINK:
break;
case LA_8GHZ_LINK:
break;
case LA_10GHZ_LINK:
break;
default:
}
}
sizeof (port_attrs->PortSymbolicName));
/* Set the hba speed limit */
}
}
}
}
}
value1 = 0x00000120;
value2 = 0x00000001;
} else {
sizeof (fc_hba_port_attributes_t)) {
break;
}
port_attrs->lastChange = 0;
port_attrs->fp_minor = 0;
/* port_attrs->PortFcId */
/* port_attrs->PortType */
/* port_attrs->PortSpeed */
/* port_attrs->FabricName */
} else {
} else {
}
if (ndlp) {
sizeof (port_attrs->FabricName));
}
case 0:
break;
case LA_1GHZ_LINK:
break;
case LA_2GHZ_LINK:
break;
case LA_4GHZ_LINK:
break;
case LA_8GHZ_LINK:
break;
case LA_10GHZ_LINK:
break;
default:
}
}
sizeof (port_attrs->PortSymbolicName));
/* Set the hba speed limit */
}
}
}
}
}
value1 = 0x00000120;
value2 = 0x00000001;
}
break;
}
case FCIO_GET_NODE_ID:
{
break;
}
if (rval != FC_SUCCESS) {
}
break;
}
case FCIO_SET_NODE_ID:
{
break;
}
if (rval != FC_SUCCESS) {
}
break;
}
case FCIO_GET_NUM_DEVS:
{
break;
}
break;
}
case FCIO_GET_DEV_LIST:
{
uint32_t i;
uint32_t j;
break;
}
if (use32) {
if (nport_count == 0) {
break;
}
if (nport_count > max_count) {
break;
}
for (i = 0; i < EMLXS_NUM_HASH_QUES; i++) {
0xFFF000) {
SWAP_LONG(0x00000100);
port_dev->
dev_did.priv_lilp_posit = 0;
port_dev->
dev_hard_addr.hard_addr = 0;
break;
}
}
}
&nlp->nlp_portname,
(caddr_t)
8);
&nlp->nlp_nodename,
(caddr_t)
8);
port_dev++;
}
}
}
} else {
if (nport_count == 0) {
break;
}
if (nport_count > max_count) {
break;
}
for (i = 0; i < EMLXS_NUM_HASH_QUES; i++) {
0xFFF000) {
SWAP_LONG(0x00000100);
port_dev->
dev_did.priv_lilp_posit = 0;
port_dev->
dev_hard_addr.hard_addr = 0;
break;
}
}
}
&nlp->nlp_portname,
(caddr_t)
8);
&nlp->nlp_nodename,
(caddr_t)&
8);
port_dev++;
}
}
}
}
break;
}
case FCIO_GET_LOGI_PARAMS:
{
break;
}
} else {
if (ndlp) {
} else {
}
}
break;
}
case FCIO_GET_STATE:
{
break;
}
} else {
if (ndlp) {
} else {
}
}
break;
}
case FCIO_GET_TOPOLOGY:
{
break;
}
*tp = FC_TOP_UNKNOWN;
} else {
if (ndlp) {
*tp = FC_TOP_PUBLIC_LOOP;
} else {
}
} else {
if (ndlp) {
*tp = FC_TOP_FABRIC;
} else {
*tp = FC_TOP_PT_PT;
}
}
}
break;
}
case FCIO_LINK_STATUS:
{
break;
}
break;
}
if (rval != FC_SUCCESS) {
}
} else {
}
break;
}
{
char *path;
break;
}
break;
}
break;
}
{
break;
}
if (!ndlp) {
break;
}
goto get_node_attrs;
}
/* Same as FCIO_GET_DISCOVERED_PORT_ATTRIBUTES */
/* except WWPN is used instead of index */
case FCIO_GET_PORT_ATTRIBUTES:
{
break;
}
if (!ndlp) {
break;
}
/* Filter fabric ports */
break;
}
/* port_attrs->lastChange */
/* port_attrs->fp_minor */
/* no switch */
if (!ndlp2) {
} else {
}
/* We share a common speed */
case 0:
break;
case LA_1GHZ_LINK:
break;
case LA_2GHZ_LINK:
break;
case LA_4GHZ_LINK:
break;
case LA_8GHZ_LINK:
break;
case LA_10GHZ_LINK:
break;
}
}
/* public loop */
/* Check for common area and domain */
/* We share a common speed */
case 0:
break;
case LA_1GHZ_LINK:
break;
case LA_2GHZ_LINK:
break;
case LA_4GHZ_LINK:
break;
case LA_8GHZ_LINK:
break;
case LA_10GHZ_LINK:
break;
}
}
}
}
/* port_attrs->PortSymbolicName */
/* port_attrs->PortSupportedSpeed */
/* port_attrs->PortSupportedFc4Types */
/* port_attrs->PortActiveFc4Types */
/* port_attrs->PortMaxFrameSize */
/* port_attrs->NumberofDiscoveredPorts */
break;
}
case FCIO_GET_SYM_PNAME:
{
break;
}
break;
}
case FCIO_GET_SYM_NNAME:
{
break;
}
break;
}
case FCIO_FORCE_DUMP:
{
if (rval != FC_SUCCESS) {
break;
}
break;
}
case FCIO_GET_DUMP_SIZE:
{
break;
}
if (rval != FC_SUCCESS) {
if (rval == FC_INVALID_REQUEST) {
} else {
}
}
break;
}
case FCIO_GET_DUMP:
{
break;
}
if (rval != FC_SUCCESS) {
if (rval == FC_INVALID_REQUEST) {
} else {
}
break;
}
break;
}
if (rval != FC_SUCCESS) {
if (rval == FC_INVALID_REQUEST) {
} else {
}
}
break;
}
case FCIO_SET_SYM_PNAME:
case FCIO_SET_SYM_NNAME:
case FCIO_DEV_LOGIN:
case FCIO_DEV_LOGOUT:
case FCIO_DEV_REMOVE:
case FCIO_NS:
case FCIO_SEND_NODE_ID:
"%s: Unsupported FCIO command.",
break;
default:
} /* switch() */
done:
}
mode)) {
"%s: %s: ddi_copyout failed. (size=%d)",
}
}
mode)) {
"%s: %s: ddi_copyout failed. (size=%d)",
}
}
mode)) {
"%s: %s: ddi_copyout failed. (size=%d)",
}
}
"%s: %s: ddi_copyout failed. (size=%d)",
}
return (rval);
} /* emlxs_fcio_manage() */
#endif /* FCIO_SUPPORT */
#ifdef NPIV_SUPPORT
static int32_t
{
char name[256];
return (DFC_ARG_NULL);
}
"%s: Buffer1 too small. (size=%d)",
return (DFC_ARG_TOOSMALL);
}
/* Read the dfc_vport object */
sizeof (dfc_vportinfo_t), mode) != 0) {
return (DFC_COPYIN_ERROR);
}
if (!(options & VPORT_OPT_AUTORETRY)) {
"%s: NPIV currently not enabled.",
return (DFC_NPIV_DISABLED);
}
"%s: NPIV currently not supported.",
return (DFC_NPIV_UNSUPPORTED);
}
}
/*
* Only the same WWNN and WWPN can be re-created
*/
break;
} else {
"%s: VPI already in use.",
return (DFC_ARG_INVALID);
}
}
}
}
/* else auto assign */
/* Acquire a VPI */
/* Auto Assign VPI */
break;
}
}
"%s: Out of resources.",
return (DFC_DRVRES_ERROR);
}
}
/* Establish a WWPN */
/* Generate new WWPN */
} else { /* use one provided */
/* Make sure WWPN is unique */
"%s: WWPN already exists. vpi=%d",
return (DFC_ARG_INVALID);
}
}
/* Establish a WWNN */
/* Generate new WWNN */
}
/* else use WWNN provided */
/* Generate the symbolic node name */
} else {
}
/* Generate the symbolic port name */
} else {
}
/* Set the highest configured vpi */
}
/* Configure the port object */
/* Adjust restricted flags */
if (options & VPORT_OPT_RESTRICT) {
} else if (options & VPORT_OPT_UNRESTRICT) {
}
#ifdef SFCT_SUPPORT
}
#endif /* SFCT_SUPPORT */
sizeof (dfc_vportinfo_t), mode) != 0) {
return (DFC_COPYOUT_ERROR);
}
/*
* The same WWNN, WWPN and VPI has been re-created.
* Bring up the vport now!
*/
}
return (0);
} /* emlxs_dfc_create_vport() */
static int32_t
{
char buffer[256];
rval = DFC_ARG_NULL;
goto done;
}
"%s: Buffer1 too small. (size=%d)",
goto done;
}
/* Read the wwn object */
goto done;
}
/* Make sure WWPN is unique */
/* Physical does not have EMLXS_PORT_CONFIG set */
goto done;
}
/* Fabric Logout */
sizeof (FCP_RSP), 0, KM_NOSLEEP))) {
"%s: Unable to allocate packet.",
goto done;
}
/* Make this a polled IO */
/* Build the fc header */
/* Build the command */
/*
* Just send LOGO. Don't worry about result.
* This is just a courtesy anyway.
*/
/* Take the port offline */
}
rval = 0;
done:
if (pkt) {
}
return (rval);
} /* emlxs_dfc_destroy_vport() */
static int32_t
{
uint32_t i;
return (DFC_ARG_NULL);
}
if (!(dfc_vport_list =
"%s: Unable to allocate memory.",
return (DFC_SYSRES_ERROR);
}
max_count = 0;
dfc_vport = &dfc_vport_list[i];
continue;
}
}
}
}
}
max_count++;
}
max_count *= sizeof (dfc_vportinfo_t);
"%s: Buffer1 too small. (%d > %d)",
goto done;
}
goto done;
}
done:
if (dfc_vport_list) {
}
return (rval);
} /* emlxs_dfc_get_vportinfo() */
static emlxs_port_t *
{
int i, j;
/* Check Local N-port, including physical port */
return (port);
}
/* Check Remote N-port */
for (j = 0; j < EMLXS_NUM_HASH_QUES; j++) {
/* Check Local N-port */
return (port);
}
}
}
}
return (0);
} /* emlxs_vport_find_wwpn() */
static int32_t
{
return (DFC_ARG_NULL);
}
"%s: Buffer1 too small. (size=%d)",
return (DFC_ARG_TOOSMALL);
}
if ((mbq =
"%s: Unable to allocate mailbox buffer.",
return (DFC_SYSRES_ERROR);
}
if (rval == MBX_TIMEOUT) {
"%s: Mailbox timed out. cmd=%x",
rval = DFC_TIMEOUT;
goto done;
}
if (rval) {
rval = DFC_IO_ERROR;
goto done;
}
sizeof (dfc_vport_resource_t), mode) != 0) {
}
done:
/* Free allocated mbox memory */
if (mbq) {
}
return (rval);
} /* emlxs_dfc_npiv_resource() */
static int32_t
{
int i;
return (DFC_ARG_NULL);
}
"%s: Buffer1 too small. (size=%d)",
return (DFC_ARG_TOOSMALL);
}
}
}
}
}
goto done;
}
goto done;
}
goto done;
}
goto done;
}
mask =
/*
* Check if those four conditions are met
*/
/*
* One or more conditions are not met
*/
goto done;
}
/* Now check if fabric have resources */
goto done;
}
}
0, KM_NOSLEEP))) {
"Unable to allocate packet.");
goto done;
}
/* Build (FDISC) the fc header */
/* Build the command (FDISC) */
/* by the drive (See emlxs_send_els()) */
wwn[0] = 0x28;
wwn[0] = 0x20;
sizeof (SERV_PARM));
/* Make this a polled IO */
goto done;
}
0, KM_NOSLEEP))) {
"Unable to allocate LOGO packet.");
goto free_resc;
}
/* Make this a polled IO */
/* Build (LOGO) the fc header */
/* Build the command (LOGO) */
wwn[0] = 0x20;
"%s: Unable to send packet.",
goto free_resc;
}
"%s: Pkt Transport error. Pkt Timeout.",
} else {
"%s: Pkt Transport error. state=%x",
}
goto free_resc;
}
}
}
/*
* Free up default RPIs and VPI
*/
(void) emlxs_mb_unreg_vpi(vport);
done:
}
if (pkt) {
/* Free the pkt */
}
if (pkt1) {
/* Free the pkt */
}
return (rval);
} /* emlxs_dfc_npiv_test() */
#endif /* NPIV_SUPPORT */
static int32_t
{
return (DFC_ARG_NULL);
}
"%s: Buffer1 too small. (size=%d)",
return (DFC_ARG_TOOSMALL);
}
mode) != 0) {
return (DFC_COPYOUT_ERROR);
}
return (0);
} /* emlxs_dfc_get_rev() */
static int32_t
{
char pathname[256];
return (DFC_ARG_NULL);
}
"%s: Buffer1 too small. (size=%d)",
return (DFC_ARG_TOOSMALL);
}
sizeof (hbainfo.vpd_serial_num));
sizeof (hbainfo.vpd_part_num));
sizeof (hbainfo.vpd_port_num));
sizeof (hbainfo.vpd_eng_change));
sizeof (hbainfo.vpd_manufacturer));
sizeof (hbainfo.vpd_model_desc));
sizeof (hbainfo.vpd_prog_types));
/* Set support flags */
#ifdef NPIV_SUPPORT
#endif /* NPIV_SUPPORT */
#ifdef DHCHAP_SUPPORT
}
#endif /* DHCHAP_SUPPORT */
#ifdef SFCT_SUPPORT
}
#endif /* SFCT_SUPPORT */
sizeof (hbainfo.fcode_version));
sizeof (hbainfo.boot_version));
sizeof (hbainfo.fw_version));
sizeof (hbainfo.drv_module));
sizeof (hbainfo.drv_version));
sizeof (hbainfo.drv_revision));
}
#ifdef MENLO_SUPPORT
} else
#endif /* MENLO_SUPPORT */
if (ndlp) {
} else {
}
} else {
if (ndlp) {
} else {
}
}
if (ndlp) {
sizeof (hbainfo.fabric_wwnn));
sizeof (hbainfo.fabric_wwpn));
}
} else {
}
}
}
}
}
}
}
}
}
}
#ifdef MENLO_SUPPORT
}
#endif /* MENLO_SUPPORT */
else {
}
} else {
} else {
}
}
sizeof (dfc_hbainfo_t), mode) != 0) {
return (DFC_COPYOUT_ERROR);
}
return (0);
} /* emlxs_dfc_get_hbainfo() */
static int32_t
{
return (DFC_ARG_NULL);
}
"%s: Buffer1 too small. (size=%d)",
return (DFC_ARG_TOOSMALL);
}
if ((mbq =
"%s: Unable to allocate mailbox buffer.",
return (DFC_SYSRES_ERROR);
}
if (rval == MBX_TIMEOUT) {
"%s: Mailbox timed out. cmd=%x",
rval = DFC_TIMEOUT;
goto done;
}
if (rval) {
rval = DFC_IO_ERROR;
goto done;
}
if (rval == MBX_TIMEOUT) {
"%s: Mailbox timed out. cmd=%x",
rval = DFC_TIMEOUT;
goto done;
}
if (rval) {
rval = DFC_IO_ERROR;
goto done;
}
#ifdef MENLO_SUPPORT
} else
#endif /* MENLO_SUPPORT */
} else {
}
} else {
} else {
}
}
} else {
}
}
sizeof (dfc_hbastats_t), mode) != 0) {
return (DFC_COPYOUT_ERROR);
}
done:
/* Free allocated mbox memory */
if (mbq) {
}
return (rval);
} /* emlxs_dfc_get_hbastats() */
static int32_t
{
return (DFC_ARG_NULL);
}
#if (DFC_REV >= 2)
#endif
mode) != 0) {
return (DFC_COPYOUT_ERROR);
}
return (rval);
} /* emlxs_dfc_get_drvstats() */
extern uint32_t
{
uint32_t i;
/* Wait if adapter is in transition */
i = 0;
if (i++ > 30) {
break;
}
}
switch (mode) {
case DDI_SHOW:
break;
case DDI_ONDI:
(void) emlxs_online(hba);
}
break;
/* Killed + Restart state */
case DDI_OFFDI:
(void) emlxs_offline(hba);
/* Reset with restart */
/* Reset with restart */
}
break;
/* Killed + Reset state */
case DDI_WARMDI:
(void) emlxs_offline(hba);
/* Reset with no restart */
emlxs_sli_hba_reset(hba, 0, 0);
/* Reset with no restart */
emlxs_sli_hba_reset(hba, 0, 0);
}
break;
/* Killed */
case DDI_DIAGDI:
(void) emlxs_offline(hba);
}
break;
default:
"emlxs_set_hba_mode: Invalid mode. mode%x", mode);
}
/* Wait if adapter is in transition */
i = 0;
if (i++ > 30) {
break;
}
}
/* Return current state */
mode = DDI_DIAGDI;
mode = DDI_WARMDI;
} else {
}
return (mode);
} /* emlxs_set_hba_mode() */
static int32_t
{
return (DFC_ARG_NULL);
}
"%s: Buffer1 too small. (size=%d)",
return (DFC_ARG_TOOSMALL);
}
mode) != 0) {
return (DFC_COPYOUT_ERROR);
}
return (rval);
} /* emlxs_dfc_set_diag() */
static int32_t
{
return (DFC_ARG_NULL);
}
return (DFC_ARG_NULL);
}
"%s: Buffer1 too large. (size=%d)",
return (DFC_ARG_TOOBIG);
}
#ifdef MBOX_EXT_SUPPORT
"%s: Null buffer3 found.",
return (DFC_ARG_NULL);
}
"%s: buffer3 too large. (size=%d)",
return (DFC_ARG_TOOBIG);
}
"%s: Null buffer4 found.",
return (DFC_ARG_NULL);
}
"%s: buffer4 too large. (size=%d)",
return (DFC_ARG_TOOBIG);
}
extsize =
if ((extbuf =
"%s: Unable to allocate mailbox extension buffer.",
return (DFC_SYSRES_ERROR);
}
"%s: ddi_copyin mbox extension data "
goto done;
}
}
}
#endif /* MBOX_EXT_SUPPORT */
if ((mbq =
"%s: Unable to allocate mailbox buffer.",
goto done;
}
mode) != 0) {
goto done;
}
#ifdef _LP64
"%s: Invalid mailbox command. Must use 64bit version. "
/* Must use 64 bit versions of these mbox cmds */
goto done;
}
#endif
lptr = 0;
size = 0;
switch (mb->mbxCommand) {
/* Offline only */
case MBX_CONFIG_LINK: /* 0x07 */
case MBX_PART_SLIM: /* 0x08 */
case MBX_CONFIG_RING: /* 0x09 */
case MBX_DUMP_CONTEXT: /* 0x18 */
case MBX_RUN_DIAGS: /* 0x19 */
case MBX_RESTART: /* 0x1A */
case MBX_SET_MASK: /* 0x20 */
case MBX_FLASH_WR_ULA: /* 0x98 */
"%s: Adapter not offline. cmd=%x",
goto done;
}
break;
/* Online / Offline */
case MBX_UNREG_LOGIN: /* 0x14 */
if (ndlp) {
/* remove it */
/*
* If we just unregistered the host node then
* clear the host DID
*/
}
} else {
"%s: Node not found. cmd=%x rpi=%x",
/* Node does not exist */
goto done;
}
/* Send it */
break;
case MBX_UNREG_D_ID: /* 0x23 */
if (did == 0) {
"%s: Node not found. cmd=%x did=%x",
goto done;
}
if (did == 0xffffffff) {
break;
}
/* Check for base node */
/* just flush base node */
0, 0, 0);
0);
/* Return now */
rval = 0;
goto done;
}
/* Make sure the node does already exist */
if (ndlp) {
/* remove it */
/*
* If we just unregistered the host node then
* clear the host DID
*/
}
} else {
"%s: Node not found. cmd=%x did=%x",
/* Node does not exist */
goto done;
}
/* Send it */
break;
/* Online / Offline - with DMA */
case MBX_READ_EVENT_LOG: /* 0x38 */
lptr =
"%s: Invalid BDE. cmd=%x",
goto done;
}
/* Allocate receive buffer */
"%s: Unable to allocate receive buffer. cmd=%x",
goto done;
}
break;
case MBX_READ_SPARM: /* 0x0D */
case MBX_READ_SPARM64: /* 0x8D */
lptr =
"%s: Invalid BDE. cmd=%x",
goto done;
}
/* Allocate receive buffer */
"%s: Unable to allocate receive buffer. cmd=%x",
goto done;
}
break;
case MBX_READ_RPI: /* 0x0F */
case MBX_READ_RPI64: /* 0x8F */
lptr =
"%s: Invalid BDE. cmd=%x",
goto done;
}
/* Allocate receive buffer */
"%s: Unable to allocate receive buffer. cmd=%x",
goto done;
}
break;
case MBX_RUN_BIU_DIAG: /* 0x04 */
case MBX_RUN_BIU_DIAG64: /* 0x84 */
lptr =
"%s: Invalid xmit BDE. cmd=%x",
goto done;
}
/* Allocate xmit buffer */
"%s: Unable to allocate xmit buffer. cmd=%x",
goto done;
}
/* Initialize the xmit buffer */
mode) != 0) {
"%s: ddi_copyin failed. cmd=%x",
goto done;
}
/* Initialize the receive buffer */
lptr =
"%s: Invalid rcv BDE. cmd=%x",
goto done;
}
/* Allocate receive buffer */
"%s: Unable to allocate receive buffer. cmd=%x",
goto done;
}
break;
case MBX_REG_LOGIN: /* 0x13 */
case MBX_REG_LOGIN64: /* 0x93 */
/* Check for invalid node ids to register */
"%s: Invalid node id. cmd=%x did=%x",
goto done;
}
/* Check if the node limit has been reached */
"%s: Too many nodes. cmd=%x",
goto done;
}
lptr =
"%s: Invalid BDE. cmd=%x",
goto done;
}
/* Allocate xmit buffer */
"%s: Unable to allocate xmit buffer. cmd=%x",
goto done;
}
/* Initialize the xmit buffer */
mode) != 0) {
"%s: Unable to allocate xmit buffer. cmd=%x",
goto done;
}
break;
case MBX_READ_LA: /* 0x15 */
case MBX_READ_LA64: /* 0x95 */
lptr =
"%s: Invalid BDE. cmd=%x",
goto done;
}
/* Allocate receive buffer */
"%s: Unable to allocate receive buffer. cmd=%x",
goto done;
}
break;
/* Do not allow these commands */
case MBX_CONFIG_PORT: /* 0x88 */
"%s: Command not allowed. cmd=%x",
goto done;
/* Online / Offline */
default:
break;
} /* switch() */
/* Set or don't set the PASSTHRU bit. */
/* Setting will prevent the driver from processing it as its own */
switch (mb->mbxCommand) {
case MBX_REG_LOGIN: /* 0x13 */
case MBX_REG_LOGIN64: /* 0x93 */
break;
default:
}
#ifdef MBOX_EXT_SUPPORT
if (extbuf) {
}
#endif /* MBOX_EXT_SUPPORT */
/* issue the mbox cmd to the sli */
if (mbxstatus) {
"%s: %s failed. mbxstatus=0x%x",
}
mode) != 0) {
"%s: ddi_copyout failed. cmd=%x",
goto done;
}
if (rx_mp) {
mode) != 0) {
"%s: ddi_copyout failed for receive buffer. cmd=%x",
goto done;
}
}
#ifdef MBOX_EXT_SUPPORT
/* Any data needs to copy to mbox extension area */
"%s: ddi_copyout failed for mbox extension data.",
goto done;
}
}
#endif /* MBOX_EXT_SUPPORT */
rval = 0;
done:
/* Free allocated mbox memory */
if (extbuf) {
}
/* Free allocated mbox memory */
if (mbq) {
}
/* Free allocated mbuf memory */
if (rx_mp) {
}
if (tx_mp) {
}
return (rval);
} /* emlxs_dfc_send_mbox() */
static int32_t
{
uint32_t i;
return (DFC_ARG_NULL);
}
if (offset & 0x3) {
"%s: Offset misaligned. (offset=%d)",
return (DFC_ARG_MISALIGNED);
}
if (cnt & 0x3) {
"%s: Count misaligned. (count=%d)",
return (DFC_ARG_MISALIGNED);
}
if (outsz & 0x3) {
"%s: Output size misaligned. (size=%d)",
return (DFC_ARG_MISALIGNED);
}
/* Get max PCI config range */
max = 256;
} else {
max = 4096;
}
"%s: Offset+Count too large. (offset=%d count=%d max=%d)",
return (DFC_ARG_TOOBIG);
}
}
}
"%s: Unable to allocate buffer.",
return (DFC_SYSRES_ERROR);
}
value =
}
return (DFC_COPYOUT_ERROR);
}
return (0);
} /* emlxs_dfc_read_pci() */
static int32_t
{
uint32_t i;
return (DFC_ARG_NULL);
}
if (offset & 0x3) {
"%s: Offset misaligned. (offset=%d)",
return (DFC_ARG_MISALIGNED);
}
"%s: Count too large. (count=%d)",
return (DFC_ARG_TOOBIG);
}
if (cnt & 0x3) {
"%s: Count misaligned. (count=%d)",
return (DFC_ARG_MISALIGNED);
}
/* Get max PCI config range */
max = 256;
} else {
max = 4096;
}
"%s: Count+Offset too large. (offset=%d count=%d max=%d)",
return (DFC_ARG_TOOBIG);
}
return (DFC_COPYIN_ERROR);
}
/*
* EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_dfc_debug_msg,
* "%s: Writing. offset=%x cnt=%d value=%08x %04x %04x",
* emlxs_dfc_xlate(dfc->cmd), i, value, word0, word1);
*/
/* word0 = PCIMEM_SHORT(word0); */
/* word1 = PCIMEM_SHORT(word1); */
}
return (0);
} /* emlxs_dfc_write_pci() */
static int32_t
{
uint32_t i;
return (DFC_ARG_NULL);
}
if (count > MAX_CFG_PARAM) {
}
if (count > NUM_CFG_PARAM) {
}
"%s: Unable to allocate cfgparm buffer.",
return (DFC_SYSRES_ERROR);
}
for (i = 0; i < count; i++) {
}
} else {
}
} else {
}
}
}
rval = 0;
return (rval);
} /* emlxs_dfc_get_cfg() */
/* ARGSUSED */
static int32_t
{
if (rc) {
"%s: Unable to set parameter. code=%d",
switch (rc) {
case 2:
return (DFC_NPIV_ACTIVE);
default:
return (DFC_ARG_INVALID);
}
}
return (0);
} /* emlxs_dfc_set_cfg() */
static int32_t
{
char buffer[128];
}
rsp_size);
rval = DFC_ARG_NULL;
goto done;
}
rval = DFC_ARG_NULL;
goto done;
}
rval = DFC_ARG_NULL;
goto done;
}
rval = DFC_ARG_NULL;
goto done;
}
if (rsp_size > MAX_CT_PAYLOAD) {
"%s: Buffer2 too large. size=%d",
goto done;
}
if (cmd_size > MAX_CT_PAYLOAD) {
"%s: Buffer1 too large. size=%d",
goto done;
}
"%s: Buffer3 too small. (size=%d)",
goto done;
}
"%s: Buffer4 too small. (size=%d)",
goto done;
}
sizeof (dfc_destid_t), mode) != 0) {
"%s: Unable to read destination id.",
goto done;
}
"%s: WWPN does not exists. %s",
goto done;
}
} else {
"%s: DID does not exist. did=%x",
goto done;
}
}
if (did == 0) {
}
"%s: Unable to allocate packet.",
goto done;
}
/* Make this a polled IO */
/* Build the fc header */
/* Copy in the command buffer */
mode) != 0) {
"%s: Unable to read command buffer.",
goto done;
}
rval = DFC_IO_ERROR;
goto done;
}
"Pkt Transport error. Pkt Timeout.");
rval = DFC_TIMEOUT;
} else {
rval = DFC_IO_ERROR;
}
goto done;
}
mode) != 0) {
"%s: Unable to read response.",
goto done;
}
mode) != 0) {
"%s: Unable to write response.",
goto done;
}
rval = 0;
done:
if (pkt) {
}
return (rval);
} /* emlxs_dfc_send_ct() */
static int32_t
{
rval = DFC_ARG_NULL;
goto done;
}
"%s: Unable to allocate packet.",
goto done;
}
/* Make this a polled IO */
/* Build the fc header */
/* Copy in the command buffer */
mode) != 0) {
"%s: Unable to read command buffer.",
goto done;
}
rval = DFC_IO_ERROR;
goto done;
}
"Pkt Transport error. Pkt Timeout.");
rval = DFC_TIMEOUT;
} else {
rval = DFC_IO_ERROR;
}
goto done;
}
rval = 0;
done:
if (pkt) {
}
return (rval);
} /* emlxs_dfc_send_ct_rsp() */
#ifdef MENLO_SUPPORT
static int32_t
{
"%s: Menlo device not present. device=%x,%x",
goto done;
}
rval = DFC_ARG_NULL;
goto done;
}
rval = DFC_ARG_NULL;
goto done;
}
rval = DFC_ARG_NULL;
goto done;
}
"%s: Buffer3 too small. %d < %d",
sizeof (uint32_t));
goto done;
}
KM_SLEEP)) == 0) {
"%s: Unable to allocate command buffer.",
goto done;
}
KM_SLEEP)) == 0) {
"%s: Unable to allocate response buffer.",
goto done;
}
/* Read the command buffer */
"%s: Unable to read command buffer.",
goto done;
}
/* Send the command */
if (rval == 0) {
/* Return the response */
"%s: Unable to write response.",
goto done;
}
/* Return the response size */
"%s: Unable to write response size.",
goto done;
}
}
done:
if (cmd_buf) {
}
if (rsp_buf) {
}
return (rval);
} /* emlxs_dfc_send_menlo() */
extern int32_t
{
/* Look for Zephyr specific commands */
if (cmd_code & 0x80000000) {
/* Validate response buffer */
"emlxs_send_menlo_cmd: Response overrun.");
goto done;
}
/* All of these responses will be 4 bytes only */
rsp_code = 0;
/* Validate command buffer */
switch (cmd_code) {
case MENLO_CMD_RESET:
if (cmd_size < sizeof (menlo_reset_cmd_t)) {
"emlxs_send_menlo_cmd: "
"Invalid command size. %d < %d",
sizeof (menlo_reset_cmd_t));
goto done;
}
cmd_size = sizeof (menlo_reset_cmd_t);
/* Read the command buffer */
/* MENLO_FW_GOLDEN */
value = 1;
"emlxs_send_menlo_cmd: Reset with Golden "
"firmware requested.");
} else {
/* MENLO_FW_OPERATIONAL */
value = 0;
"emlxs_send_menlo_cmd: Reset with "
"Operational firmware requested.");
}
addr = 0x103007;
break;
case MENLO_CMD_SET_MODE:
if (cmd_size < sizeof (menlo_set_cmd_t)) {
"emlxs_send_menlo_cmd: "
"Invalid command size. %d < %d",
sizeof (menlo_set_cmd_t));
goto done;
}
cmd_size = sizeof (menlo_set_cmd_t);
/* Read the command buffer */
"emlxs_send_menlo_cmd: "
"Maintenance mode enable requested.");
/* Make sure the mode flag is cleared */
}
mm_mode = 1;
} else {
"emlxs_send_menlo_cmd: "
"Maintenance mode disable requested.");
}
addr = 0x103107;
break;
default:
"emlxs_send_menlo_cmd: "
"Invalid command. cmd=%x", cmd_code);
goto done;
}
KM_SLEEP)) == 0) {
"emlxs_send_menlo_cmd: "
"Unable to allocate mailbox buffer.");
goto done;
}
/* Create the set_variable mailbox request */
/* issue the mbox cmd to the sli */
if (mbxstatus) {
"emlxs_send_menlo_cmd: %s failed. mbxstatus=0x%x",
if (mbxstatus == MBX_TIMEOUT) {
rval = DFC_TIMEOUT;
} else {
rval = DFC_IO_ERROR;
}
goto done;
}
/* Check if we need to wait for maintenance mode */
/* Wait for link to come up in maintenance mode */
rval = 0;
rval =
}
if (rval == -1) {
"emlxs_send_menlo_cmd: "
"Menlo maintenance mode error. Timeout.");
rval = DFC_TIMEOUT;
goto done;
}
}
} else { /* Standard commands */
"emlxs_send_menlo_cmd: Adapter link down.");
goto done;
}
if (cmd_code == MENLO_CMD_FW_DOWNLOAD) {
/* Check cmd size */
/* Must be at least 12 bytes of command */
/* plus 4 bytes of data */
"emlxs_send_menlo_cmd: "
"Invalid command size. %d < %d",
(12 + 4));
goto done;
}
/* Extract data buffer from command buffer */
cmd_size = 12;
}
KM_NOSLEEP))) {
"emlxs_send_menlo_cmd: Unable to allocate packet.");
goto done;
}
/* Make this a polled IO */
/* Build the fc header */
/* Copy in the command buffer */
"emlxs_send_menlo_cmd: Unable to send packet.");
rval = DFC_IO_ERROR;
goto done;
}
"emlxs_send_menlo_cmd: "
"Pkt Transport error. Pkt Timeout.");
rval = DFC_TIMEOUT;
"emlxs_send_menlo_cmd: "
"Pkt Transport error. Response overrun.");
} else {
"emlxs_send_menlo_cmd: "
"Pkt Transport error. state=%x",
rval = DFC_IO_ERROR;
}
goto done;
}
if (cmd_code == MENLO_CMD_FW_DOWNLOAD) {
/* Check response code */
if (rsp_code == MENLO_RSP_SUCCESS) {
/* Now transmit the data phase */
/* Save last rx_id */
/* Free old pkt */
/* Allocate data pkt */
*rsp_size, 0, KM_NOSLEEP))) {
"emlxs_send_menlo_cmd: "
"Unable to allocate data "
"packet.");
goto done;
}
/* Make this a polled IO */
/* Build the fc header */
/* Copy in the data buffer */
"emlxs_send_menlo_cmd: "
"Unable to send data packet.");
rval = DFC_IO_ERROR;
goto done;
}
"emlxs_send_menlo_cmd: "
"Data Pkt Transport "
"error. Pkt Timeout.");
rval = DFC_TIMEOUT;
FC_PKT_LOCAL_RJT) &&
(pkt->pkt_reason ==
"emlxs_send_menlo_cmd: "
"Data Pkt Transport "
"error. Response overrun.");
} else {
"emlxs_send_menlo_cmd: "
"Data Pkt Transport "
"error. state=%x",
rval = DFC_IO_ERROR;
}
goto done;
}
}
}
}
rval = 0;
done:
if (pkt) {
}
if (mbq) {
}
return (rval);
} /* emlxs_send_menlo_cmd() */
/* ARGSUSED */
extern void
{
sizeof (menlo_init_rsp_t), 0, KM_NOSLEEP))) {
"FCoE attention: Unable to allocate packet.");
return;
}
/* Make this a polled IO */
/* Build the fc header */
/* Little Endian Swap */
"FCoE attention: Unable to send packet.");
goto done;
}
"FCoE attention: Pkt Transport error. state=%x",
goto done;
}
/* Check response code */
goto done;
}
/* Little Endian Swap */
/* Log the event */
/* Perform attention checks */
if (rsp->fru_data_valid == 0) {
"Invalid FRU data found on adapter. "
"Return adapter to Emulex for repair.");
}
case MENLO_FW_TYPE_GOLDEN:
"FCoE chip is running Golden firmware. "
"Update FCoE firmware immediately.");
break;
case MENLO_FW_TYPE_DIAG:
"FCoE chip is running Diagnostic firmware. "
"Operational use of the adapter is suspended.");
break;
}
done:
if (pkt) {
}
return;
} /* emlxs_fcoe_attention_thread() */
#endif /* MENLO_SUPPORT */
static int32_t
{
uint32_t i;
"%s: Invalid bus_type. (bus_type=%x)",
return (DFC_ARG_INVALID);
}
return (DFC_ONLINE_ERROR);
}
return (DFC_ARG_NULL);
}
"%s: Offset too large. (offset=%d)",
return (DFC_ARG_TOOBIG);
}
"%s: Count too large. (count=%d)",
return (DFC_ARG_TOOBIG);
}
"%s: Count+Offset too large. (count=%d offset=%d)",
return (DFC_ARG_TOOBIG);
}
if (cnt == 0) {
return (0);
}
"%s: Unable to allocate buffer.",
return (DFC_SYSRES_ERROR);
}
return (DFC_COPYIN_ERROR);
}
for (i = 0; i < cnt; i++) {
offset++;
bptr++;
}
return (0);
} /* emlxs_dfc_write_flash() */
static int32_t
{
uint32_t i;
"%s: Invalid bus_type. (bus_type=%x)",
return (DFC_ARG_INVALID);
}
return (DFC_ONLINE_ERROR);
}
return (DFC_ARG_NULL);
}
"%s: Offset too large. (offset=%d)",
return (DFC_ARG_TOOBIG);
}
"%s: Count+Offset too large. (count=%d offset=%d)",
return (DFC_ARG_TOOBIG);
}
}
"%s: Unable to allocate buffer.",
return (DFC_SYSRES_ERROR);
}
for (i = 0; i < outsz; i++) {
}
return (DFC_COPYOUT_ERROR);
}
return (0);
} /* emlxs_dfc_read_flash() */
static int32_t
{
char buffer[128];
rval = DFC_ARG_NULL;
goto done;
}
rval = DFC_ARG_NULL;
goto done;
}
rval = DFC_ARG_NULL;
goto done;
}
"%s: Buffer3 too small. (size=%d)",
goto done;
}
rval = DFC_ARG_NULL;
goto done;
}
"%s: Buffer4 too small. (size=%d)",
goto done;
}
sizeof (dfc_destid_t), mode) != 0) {
goto done;
}
"%s: WWPN does not exists. %s",
goto done;
}
} else {
"%s: DID does not exist. did=%x",
goto done;
}
}
if (did == 0) {
}
"%s: Unable to allocate packet.",
goto done;
}
/* Make this a polled IO */
/* Build the fc header */
/* Copy in the command buffer */
mode) != 0) {
goto done;
}
rval = DFC_IO_ERROR;
goto done;
}
"Pkt Transport error. Pkt Timeout.");
rval = DFC_TIMEOUT;
} else {
rval = DFC_IO_ERROR;
}
goto done;
}
mode) != 0) {
"%s: rsp_buf ddi_copyout failed.",
goto done;
}
"%s: rsp_size ddi_copyout failed.",
goto done;
}
rval = 0;
done:
if (pkt) {
}
return (rval);
} /* emlxs_dfc_send_els() */
static int32_t
{
uint32_t i;
return (DFC_ARG_NULL);
}
"%s: Buffer1 too small. (size=%d)",
return (DFC_ARG_TOOSMALL);
}
for (i = 0; i < MAX_RINGS; i++) {
}
sizeof (dfc_ioinfo_t), mode) != 0) {
return (DFC_COPYOUT_ERROR);
}
return (0);
} /* emlxs_dfc_get_ioinfo() */
static int32_t
{
return (DFC_ARG_NULL);
}
"%s: Buffer1 too small. (size=%d)",
return (DFC_ARG_TOOSMALL);
}
linkinfo.a_topology = 0;
}
#ifdef MENLO_SUPPORT
}
#endif /* MENLO_SUPPORT */
} else {
}
} else {
}
}
} else {
} else {
}
}
}
sizeof (dfc_linkinfo_t), mode) != 0) {
return (DFC_COPYOUT_ERROR);
}
return (0);
} /* emlxs_dfc_get_linkinfo() */
#ifdef SFCT_SUPPORT
static int32_t
{
return (DFC_ARG_NULL);
}
"%s: Buffer1 too small. (size=%d)",
return (DFC_ARG_TOOSMALL);
}
(sizeof (uint64_t) * MAX_TGTPORT_IOCNT));
(sizeof (uint64_t) * MAX_TGTPORT_IOCNT));
(sizeof (uint64_t) * MAX_TGTPORT_IOCNT));
(sizeof (uint64_t) * MAX_TGTPORT_IOCNT));
statp->FctIOCmdCnt = 0;
statp->FctReadBytes = 0;
statp->FctWriteBytes = 0;
statp->FctCmdReceived = 0;
}
}
#ifdef MENLO_SUPPORT
}
#endif /* MENLO_SUPPORT */
} else {
}
sizeof (dfc_tgtport_stat_t), mode) != 0) {
return (DFC_COPYOUT_ERROR);
}
return (0);
} /* emlxs_dfc_get_fctstat() */
#endif /* SFCT_SUPPORT */
static int32_t
{
uint32_t i;
return (DFC_ARG_NULL);
}
"%s: Buffer1 too small. (size=%d)",
return (DFC_ARG_TOOSMALL);
}
return (DFC_ARG_NULL);
}
"%s: Buffer2 too small. (size=%d)",
return (DFC_ARG_TOOSMALL);
}
if (node_count == 0) {
return (0);
}
if (node_count > MAX_NODES) {
}
"%s: Unable to allocate dfc_node.",
return (DFC_SYSRES_ERROR);
}
for (i = 0; i < EMLXS_NUM_HASH_QUES; i++) {
}
}
}
}
}
dnp++;
}
}
return (DFC_COPYOUT_ERROR);
}
return (DFC_COPYOUT_ERROR);
}
return (0);
} /* emlxs_dfc_get_nodeinfo() */
static int32_t
{
return (DFC_ARG_NULL);
}
}
if (offset % 4) {
"%s: Offset misaligned. (offset=%d)",
return (DFC_ARG_MISALIGNED);
}
if (size % 4) {
"%s: Size misaligned. (size=%d)",
return (DFC_ARG_MISALIGNED);
}
} else {
max_size = 4096;
}
"%s: Offset too large. (offset=%d)",
return (DFC_ARG_TOOBIG);
}
}
"%s: Unable to allocate buffer.",
return (DFC_SYSRES_ERROR);
}
size);
} else {
(size / 4));
}
return (DFC_COPYOUT_ERROR);
}
return (0);
} /* emlxs_dfc_read_mem() */
static int32_t
{
return (DFC_ARG_NULL);
}
}
if (offset % 4) {
"%s: Offset misaligned. (offset=%d)",
return (DFC_ARG_MISALIGNED);
}
if (size % 4) {
"%s: Size misaligned. (szie=%d)",
return (DFC_ARG_MISALIGNED);
}
} else {
max_size = 4096;
}
"%s: Offset too large. (offset=%d)",
return (DFC_ARG_TOOBIG);
}
}
"%s: Unable to allocate buffer.",
return (DFC_SYSRES_ERROR);
}
return (DFC_COPYIN_ERROR);
}
size);
} else {
(size / 4));
}
return (0);
} /* emlxs_dfc_write_mem() */
/* ARGSUSED */
static int32_t
{
return (DFC_ONLINE_ERROR);
}
if (offset % 4) {
"%s: Offset misaligned. (offset=%d)",
return (DFC_ARG_MISALIGNED);
}
if (offset > 255) {
"%s: Offset too large. (offset=%d)",
return (DFC_ARG_TOOBIG);
}
return (0);
} /* emlxs_dfc_write_ctlreg() */
static int32_t
{
if (offset % 4) {
"%s: Offset misaligned. (offset=%d)",
return (DFC_ARG_MISALIGNED);
}
if (offset > 255) {
"%s: Offset too large. (offset=%d)",
return (DFC_ARG_TOOBIG);
}
return (DFC_ARG_NULL);
}
"%s: Buffer1 too small. (size=%d)",
return (DFC_ARG_TOOSMALL);
}
mode) != 0) {
return (DFC_COPYOUT_ERROR);
}
return (0);
} /* emlxs_dfc_read_ctlreg() */
static int32_t
{
uint32_t i;
switch (event) {
case FC_REG_LINK_EVENT:
case FC_REG_RSCN_EVENT:
case FC_REG_CT_EVENT:
case FC_REG_DUMP_EVENT:
case FC_REG_TEMP_EVENT:
case FC_REG_VPORTRSCN_EVENT:
case FC_REG_FCOE_EVENT:
break;
case FC_REG_MULTIPULSE_EVENT:
default:
"%s: %s. Invalid event. pid=%d enable=%d",
return (DFC_ARG_INVALID);
}
if (enable) {
}
for (i = 0; i < MAX_DFC_EVENTS; i++) {
break;
}
}
if (i == MAX_DFC_EVENTS) {
/* Find next available event object */
for (i = 0; i < MAX_DFC_EVENTS; i++) {
break;
}
}
/* Return if all event objects are busy */
if (i == MAX_DFC_EVENTS) {
"%s: %s. Too many events registered. "
"pid=%d enable=%d",
enable);
return (DFC_DRVRES_ERROR);
}
}
/* Initialize */
"%s: ddi_copyout failed.",
return (DFC_COPYOUT_ERROR);
}
}
/*
* EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_dfc_debug_msg,
* "%s: %s. Enabled. pid=%d id=%d", emlxs_dfc_xlate(dfc->cmd),
* emlxs_dfc_event_xlate(event), pid, dfc_event->last_id);
*/
} else { /* Disable */
/* Find the event entry */
for (i = 0; i < MAX_DFC_EVENTS; i++) {
break;
}
}
if (i == MAX_DFC_EVENTS) {
"%s: %s. Event not registered. pid=%d enable=%d",
return (DFC_ARG_INVALID);
}
/* Kill the event thread if it is sleeping */
/* Count the number of pids still registered for this event */
count = 0;
for (i = 0; i < MAX_DFC_EVENTS; i++) {
count++;
}
}
/* If no more pids need this event, */
/* then disable logging for this event */
if (count == 0) {
}
}
return (0);
} /* emlxs_dfc_set_event() */
static int32_t
{
uint32_t event_count = 0;
return (DFC_ARG_NULL);
}
if (!event_count) {
"%s: Buffer1 too small. (size=%d)",
return (DFC_ARG_TOOSMALL);
}
return (DFC_ARG_NULL);
}
"%s: Buffer2 too small. (size=%d)",
return (DFC_ARG_TOOSMALL);
}
return (DFC_ARG_NULL);
}
"%s: Buffer3 too small. (size=%d)",
return (DFC_ARG_TOOSMALL);
}
"%s: Unable to allocate buffer. size=%d",
return (DFC_SYSRES_ERROR);
}
&missed) != 0) {
"%s: emlxs_get_dfc_eventinfo failed.",
goto done;
}
if (event_count) {
"%s: ddi_copyout failed.",
goto done;
}
}
mode) != 0) {
goto done;
}
mode) != 0) {
goto done;
}
"%s: events=%d missed=%d new=%d last_id=%d",
done:
if (event_buffer) {
}
return (rval);
} /* emlxs_dfc_get_eventinfo() */
static int32_t
{
uint32_t i;
}
}
}
"%s: %s. pid=%d size=%d,%p rcv_size=%d,%p id=%d",
/* Find the event entry */
for (i = 0; i < MAX_DFC_EVENTS; i++) {
break;
}
}
if (i == MAX_DFC_EVENTS) {
"%s: %s. Event not registered. pid=%d",
pid);
return (DFC_ARG_INVALID);
}
"%s: %s. Event not registered. pid=%d",
pid);
return (DFC_ARG_INVALID);
}
/* Initialize event buffer pointers */
"%s: %s. Exiting. pid=%d rsize=%d id=%d rval=%d",
return (rval);
}
"%s: ddi_copyout failed.",
return (DFC_COPYOUT_ERROR);
}
}
"%s: ddi_copyout failed.",
return (DFC_COPYOUT_ERROR);
}
}
"%s: %s. Completed. pid=%d rsize=%d id=%d",
return (rval);
} /* emlxs_dfc_get_event() */
extern uint32_t
{
size_only = 1;
size = 0xffffffff;
} else {
size_only = 0;
}
switch (region) {
case 0: /* SLI Registers */
"emlxs_get_dump_region: Buffer too small. "
"(SLI Registers: size=%d)", size);
goto done;
}
if (size_only) {
break;
}
break;
case 1: /* SLIM */
} else {
}
if (size_only) {
break;
}
} else {
}
break;
case 2: /* Port Control Block */
"emlxs_get_dump_region: Buffer too small. "
"(PCB: size=%d)", size);
goto done;
}
if (size_only) {
break;
}
size);
break;
case 3: /* MailBox */
if (size < MAILBOX_CMD_BSIZE) {
"emlxs_get_dump_region: Buffer too small. "
"(Mailbox: size=%d)", size);
goto done;
}
if (size_only) {
break;
}
} else {
}
break;
"emlxs_get_dump_region: Buffer too small. "
"(HGP: size=%d)", size);
goto done;
}
if (size_only) {
break;
}
{
memptr =
}
break;
"emlxs_get_dump_region: Buffer too small. "
"(PGP: size=%d)", size);
goto done;
}
if (size_only) {
break;
}
memptr =
size);
break;
if (size < SLI_IOCB_MAX_SIZE) {
"emlxs_get_dump_region: Buffer too small. "
"(Rings: size=%d)", size);
goto done;
}
if (size_only) {
break;
}
size);
break;
case 7: /* All driver specific structures */
if (size < sizeof (emlxs_hba_t)) {
"emlxs_get_dump_region: Buffer too small. "
"(Driver: size=%d)", size);
goto done;
}
size = sizeof (emlxs_hba_t);
if (size_only) {
break;
}
break;
default:
"emlxs_get_dump_region: Invalid region. (id=%d)", region);
}
done:
return (rval);
} /* emlxs_get_dump_region() */
static int32_t
{
"%s: region=%d size=%d",
size_only = 1;
}
return (DFC_ARG_NULL);
}
"%s: Buffer2 too small. (size=%d)",
return (DFC_ARG_TOOSMALL);
}
/* First get region size only */
size = 0;
if (rval != 0) {
goto done;
}
if (!size_only) {
"%s: Buffer1 too small. (size: %d < %d)",
goto done;
}
"%s: Unable to allocate buffer. size=%d",
goto done;
}
/* Get the region data */
if (rval != 0) {
goto done;
}
/* Return the region data */
"%s: ddi_copyout failed.",
goto done;
}
}
/* Return the region size */
goto done;
}
done:
if (buffer) {
}
return (rval);
} /* emlxs_dfc_get_dump_region() */
#ifdef MENLO_SUPPORT
static int32_t
{
char pathname[256];
return (0);
return (1);
}
static int32_t
{
uint32_t i;
KM_SLEEP)) == 0) {
"%s: Unable to allocate mailbox buffer.",
goto done;
}
/* SET MENLO maint mode */
/* Create the set_variable mailbox request */
/* issue the mbox cmd to the sli */
if (mbxstatus) {
"%s: %s failed. mbxstatus=0x%x",
rval = DFC_IO_ERROR;
if (mbxstatus == MBX_TIMEOUT)
rval = DFC_TIMEOUT;
goto done;
}
/* Wait 30 sec for maint mode */
i = 0;
do {
if (i++ > 300) {
break;
}
"%s: Unable to enter maint mode.",
goto done;
}
"%s: Entered maint mode. Port offset: %d",
/* Issue Menlo loopback command */
sizeof (uint32_t), 0, KM_NOSLEEP))) {
"%s: Unable to allocate packet.",
goto done;
}
/* Make this a polled IO */
/* Build the fc header */
"%s: Unable to send packet.",
rval = DFC_IO_ERROR;
goto done;
}
"%s: Pkt Transport error. Pkt Timeout.",
rval = DFC_TIMEOUT;
"%s: Pkt Transport error. Rsp overrun.",
} else {
"%s: Pkt Transport error. state=%x",
rval = DFC_IO_ERROR;
}
goto done;
}
/* CLEAR MENLO maint mode */
/* Create the set_variable mailbox request */
/* issue the mbox cmd to the sli */
if (mbxstatus) {
"%s: %s failed. mbxstatus=0x%x",
rval = DFC_IO_ERROR;
if (mbxstatus == MBX_TIMEOUT)
rval = DFC_TIMEOUT;
}
i = 0;
i++;
if (i == 300) {
rval = DFC_TIMEOUT;
"%s: Linkup timeout.",
goto done;
}
}
done:
/* Free allocated mbox memory */
if (mbq) {
}
if (pkt) {
}
return (rval);
}
static int32_t
{
/* Issue Menlo loopback command */
sizeof (uint32_t), 0, KM_NOSLEEP))) {
"%s: Unable to allocate packet.",
goto done;
}
/* Make this a polled IO */
/* Build the fc header */
"%s: Unable to send packet.",
rval = DFC_IO_ERROR;
goto done;
}
"%s: Pkt Transport error. Pkt Timeout.",
rval = DFC_TIMEOUT;
"%s: Pkt Transport error. Rsp overrun.",
} else {
"%s: Pkt Transport error. state=%x",
rval = DFC_IO_ERROR;
}
goto done;
}
done:
if (pkt) {
}
return (rval);
}
static int32_t
{
KM_SLEEP)) == 0) {
"%s: Unable to allocate mailbox buffer.",
goto done;
}
/* RESET MENLO */
/* Create the set_variable mailbox request */
/* issue the mbox cmd to the sli */
if (mbxstatus) {
"%s: %s failed. mbxstatus=0x%x",
rval = DFC_IO_ERROR;
if (mbxstatus == MBX_TIMEOUT)
rval = DFC_TIMEOUT;
goto done;
}
done:
/* Free allocated mbox memory */
if (mbq) {
}
return (rval);
}
#endif /* MENLO_SUPPORT */
/* ARGSUSED */
static int32_t
{
uint32_t i;
/* Reinitialize the link */
case 0: /* Disable */
"%s: Loopback already disabled.",
return (rval);
}
goto resetdone;
case 1: /* Internal loopback */
speed = 0;
/* Check if mode already set */
"%s: ILB mode already enabled.",
return (rval);
}
break;
case 2: /* External loopback */
/* Check if mode already set */
"%s: ELB mode already enabled.",
return (rval);
}
break;
default:
"%s: Invalid loopback mode. (mode=%x)",
return (DFC_ARG_INVALID);
}
/* Make sure adapter is online */
if (emlxs_online(hba)) {
"%s: Unable to bring adapter online.",
return (DFC_OFFLINE_ERROR);
}
#ifdef MENLO_SUPPORT
"%s: Menlo support detected: mode:x%x",
if (new_mode == FC_ILB_MODE) {
if (rval)
goto done;
}
}
#endif /* MENLO_SUPPORT */
KM_SLEEP)) == 0) {
"%s: Unable to allocate mailbox buffer.",
goto done;
}
/* Take the link down */
if (rval == MBX_TIMEOUT) {
"%s: Mailbox timed out. cmd=%x",
rval = DFC_TIMEOUT;
goto done;
}
if (rval) {
rval = DFC_IO_ERROR;
goto done;
}
/* Reinitialize the link */
/* Set the loopback mode and timer */
if (rval == MBX_TIMEOUT) {
"%s: Mailbox timed out. cmd=%x",
rval = DFC_TIMEOUT;
goto done;
}
if (rval) {
rval = DFC_IO_ERROR;
goto done;
}
/*
* Wait for adapter to come online.
* Need *2 since we wait 1/2 sec in while loop.
*/
if (!timeout) {
} else {
}
i = 0;
i++;
if (i == timeout) {
rval = DFC_TIMEOUT;
goto done;
}
}
/* Create host node */
"%s: Unable to register host node.",
goto done;
}
i = 0;
do {
if (i++ > 300) {
break;
}
if (!ndlp) {
"%s: Unable to create host node.",
goto done;
}
#ifdef MENLO_SUPPORT
"%s: Menlo support detected: mode:x%x",
if (rval)
goto done;
}
#endif /* MENLO_SUPPORT */
/* Create host XRI */
i = 0;
do {
if (i++ > 300) {
break;
}
goto done;
}
done:
/* Free allocated mbox memory */
if (mbq) {
}
if (rval) {
/* Reset the adapter */
#ifdef MENLO_SUPPORT
"%s: Menlo reset: rval:x%x",
}
#endif /* MENLO_SUPPORT */
/* Reset link whether we are bound to ULP or not */
}
return (rval);
} /* emlxs_dfc_loopback_mode() */
static int32_t
{
"%s: Adapter not in loopback mode.",
goto done;
}
goto done;
}
goto done;
}
rval = DFC_ARG_NULL;
goto done;
}
rval = DFC_ARG_NULL;
goto done;
}
"%s: Buffer1 too large. (size=%d)",
goto done;
}
/* Check if we have a node for ourselves */
if (!ndlp) {
goto done;
}
goto done;
}
goto done;
}
goto done;
}
if (hba->loopback_pkt) {
rval = 0;
rval =
timeout);
}
if (rval == -1) {
"Loopback busy timeout.");
rval = DFC_TIMEOUT;
goto done;
}
}
/* Send polled command */
"Pkt Transport error. ret=%x state=%x", rval,
rval = DFC_IO_ERROR;
goto done;
}
"Pkt Transport error. Pkt Timeout.");
rval = DFC_TIMEOUT;
} else {
rval = DFC_IO_ERROR;
}
goto done;
}
/* Wait for sequence completion */
rval = 0;
}
if (rval == -1) {
"Loopback sequence timeout.");
rval = DFC_TIMEOUT;
goto done;
}
goto done;
}
rval = 0;
done:
if (rval) {
}
/* Reset the adapter */
}
if (pkt) {
}
return (rval);
} /* emlxs_dfc_loopback_test() */
extern int32_t
{
if (!sbp) {
"Stray interrupt. cmd=0x%x iotag=0x%x status=0x%x "
return (DFC_ARG_INVALID);
}
iocbq);
return (DFC_ARG_INVALID);
}
switch (cmd->ulpCommand) {
case CMD_XMIT_SEQUENCE_CR:
case CMD_XMIT_SEQUENCE64_CR:
case CMD_XMIT_SEQUENCE_CX:
case CMD_XMIT_SEQUENCE64_CX:
"XMIT_SEQUENCE comp: status=0x%x",
} else {
"XMIT_SEQUENCE comp: status=0x%x [%08x,%08x]",
}
break;
default:
break;
} /* switch(cmd->ulpCommand) */
return (0);
} /* emlxs_dfc_handle_event() */
/* ARGSUSED */
extern int
{
"CT Receive: cmd=%x status=0x%x ",
/*
* EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_dfc_debug_msg,
* "CT Receive: payload=%p size=%d [%02x,%02x, %02x, %02x]", bp,
* size, bp[0], bp[1], bp[2],bp[3]);
*/
/* Return payload */
if (hba->loopback_pkt) {
}
return (0);
} /* emlxs_dfc_handle_unsol_req() */
#ifdef DHCHAP_SUPPORT
static int32_t
{
return (DFC_ARG_NULL);
}
"%s: Buffer1 too small. (size=%d)",
return (DFC_ARG_TOOSMALL);
}
return (DFC_ARG_NULL);
}
"%s: Buffer2 too small. (size=%d)",
return (DFC_ARG_TOOSMALL);
}
/* Read the lwwpn */
return (DFC_COPYIN_ERROR);
}
/* Read the rwwpn */
return (DFC_COPYIN_ERROR);
}
/* Initiate authentication here */
return (rval);
} /* emlxs_dfc_init_auth() */
static int32_t
{
return (DFC_ARG_NULL);
}
"%s: Buffer1 too small. (size=%d)",
return (DFC_ARG_TOOSMALL);
}
/* Read the fcsp_config */
sizeof (dfc_fcsp_config_t), mode) != 0) {
return (DFC_COPYIN_ERROR);
}
return (rval);
}
sizeof (dfc_fcsp_config_t), mode) != 0) {
return (DFC_COPYOUT_ERROR);
}
return (0);
} /* emlxs_dfc_get_auth_cfg() */
static int32_t
{
return (DFC_ARG_NULL);
}
"%s: Buffer1 too small. (size=%d)",
return (DFC_ARG_TOOSMALL);
}
return (DFC_ARG_NULL);
}
"%s: Buffer2 too small. (size=%d)",
return (DFC_ARG_TOOSMALL);
}
/* Read the fcsp_config */
sizeof (dfc_fcsp_config_t), mode) != 0) {
return (DFC_COPYIN_ERROR);
}
/* Read the password */
sizeof (dfc_password_t), mode) != 0) {
return (DFC_COPYIN_ERROR);
}
case EMLXS_AUTH_CFG_ADD:
break;
case EMLXS_AUTH_CFG_DELETE:
break;
}
if (rval) {
return (rval);
}
sizeof (dfc_fcsp_config_t), mode) != 0) {
return (DFC_COPYOUT_ERROR);
}
return (0);
} /* emlxs_dfc_set_auth_cfg() */
static int32_t
{
return (DFC_ARG_NULL);
}
"%s: Buffer1 too small. (size=%d)",
return (DFC_ARG_TOOSMALL);
}
/* Read the auth password */
sizeof (dfc_auth_password_t), mode) != 0) {
return (DFC_COPYIN_ERROR);
}
return (rval);
}
sizeof (dfc_auth_password_t), mode) != 0) {
return (DFC_COPYOUT_ERROR);
}
return (0);
} /* emlxs_dfc_get_auth_pwd() */
static int32_t
{
return (DFC_ARG_NULL);
}
"%s: Buffer1 too small. (size=%d)",
return (DFC_ARG_TOOSMALL);
}
/* Read the auth password */
sizeof (dfc_auth_password_t), mode) != 0) {
return (DFC_COPYIN_ERROR);
}
return (rval);
}
sizeof (dfc_auth_password_t), mode) != 0) {
return (DFC_COPYOUT_ERROR);
}
return (0);
} /* emlxs_dfc_set_auth_pwd() */
static int32_t
{
&emlxs_dfc_error_msg, "%s: Null buffer1 found.",
return (DFC_ARG_NULL);
}
&emlxs_dfc_error_msg, "%s: Buffer too small. (size=%d)",
return (DFC_ARG_TOOSMALL);
}
/* Read the fcsp_config */
sizeof (dfc_auth_status_t), mode) != 0) {
return (DFC_COPYIN_ERROR);
}
return (rval);
}
sizeof (dfc_auth_status_t), mode) != 0) {
&emlxs_dfc_error_msg, "%s: ddi_copyout failed.",
return (DFC_COPYOUT_ERROR);
}
return (0);
} /* emlxs_dfc_get_auth_status() */
static int32_t
{
/* Lock cfg table while we do this */
/* This prevents the table from changing while we get a copy */
&emlxs_dfc_error_msg, "%s: Null buffer2 found.",
return (DFC_ARG_NULL);
}
&emlxs_dfc_error_msg, "%s: Buffer2 too small. (size=%d)",
return (DFC_ARG_TOOSMALL);
}
"%s: ddi_copyout failed for table count. count=%d",
return (DFC_COPYOUT_ERROR);
}
return (DFC_SUCCESS);
}
/* Check table size */
&emlxs_dfc_error_msg, "%s: Buffer1 too small. (%d < %d)",
return (DFC_ARG_TOOSMALL);
}
"%s: Unable to allocate table buffer.",
return (DFC_SYSRES_ERROR);
}
return (rval);
}
&emlxs_dfc_error_msg, "%s: ddi_copyout failed.",
return (DFC_COPYOUT_ERROR);
}
return (0);
} /* emlxs_dfc_get_auth_cfg_table() */
static int32_t
{
/* Lock cfg table while we do this */
/* This prevents the table from changing while we get a copy */
&emlxs_dfc_error_msg, "%s: Null buffer2 found.",
return (DFC_ARG_NULL);
}
&emlxs_dfc_error_msg, "%s: Buffer2 too small. (size=%d)",
return (DFC_ARG_TOOSMALL);
}
"%s: ddi_copyout failed for table count. count=%d",
return (DFC_COPYOUT_ERROR);
}
return (DFC_SUCCESS);
}
/* Check table size */
&emlxs_dfc_error_msg, "%s: Buffer1 too small. (%d < %d)",
return (DFC_ARG_TOOSMALL);
}
"%s: Unable to allocate table buffer.",
return (DFC_SYSRES_ERROR);
}
return (rval);
}
&emlxs_dfc_error_msg, "%s: ddi_copyout failed.",
return (DFC_COPYOUT_ERROR);
}
return (0);
} /* emlxs_dfc_get_auth_key_table() */
#endif /* DHCHAP_SUPPORT */
#ifdef SAN_DIAG_SUPPORT
static int32_t
{
if (state == SD_COLLECTING)
else if ((search_type < SD_SEARCH_LINEAR) ||
else if (type != SD_SCSI_IO_LATENCY_TYPE)
else {
sizeof (sd_bucket_info_t), mode);
}
return (rval);
}
static int32_t
{
if (sd_bucket.search_type == 0)
else if (type != SD_SCSI_IO_LATENCY_TYPE)
else
return (rval);
}
static int32_t
{
if (sd_bucket.search_type == 0)
else if (type != SD_SCSI_IO_LATENCY_TYPE)
else
sizeof (sd_bucket_info_t), mode);
return (rval);
}
static int32_t
{
int i;
goto start_collect_exit;
}
if (sd_bucket.search_type == 0) {
goto start_collect_exit;
}
/* Read the wwn object */
/* Make sure WWPN is unique */
if (!vport) {
goto start_collect_exit;
}
/* traverse list of nodes for this vport and reset counter */
goto start_collect_exit;
}
for (i = 0; i < EMLXS_NUM_HASH_QUES; i++) {
sizeof (struct SD_time_stats_v0) *
}
}
return (rval);
}
static int32_t
{
int i, j;
goto stop_collect_exit;
}
if (sd_bucket.search_type == 0) {
goto stop_collect_exit;
}
/* Read the wwn object */
/* Make sure WWPN is unique */
if (!vport) {
goto stop_collect_exit;
}
goto stop_collect_exit;
}
/* see if any other port is collecting io latency */
for (i = 0; i < emlxs_device.hba_count; i++) {
for (j = 0; j < temp_hba->num_of_ports; j++) {
goto stop_collect_exit;
}
}
/*
* if we get here, that means no one else is collecting
* io latency data.
*/
return (rval);
}
static int32_t
{
int i;
goto reset_collect_exit;
}
if (sd_bucket.search_type == 0) {
goto reset_collect_exit;
}
/* Read the wwn object */
/* Make sure WWPN is unique */
if (!vport) {
goto reset_collect_exit;
}
/* traverse list of nodes for this vport and reset counter */
for (i = 0; i < EMLXS_NUM_HASH_QUES; i++) {
sizeof (struct SD_time_stats_v0) *
}
}
return (rval);
}
static int32_t
{
int i, skip_bytes;
goto get_data_exit;
}
if (sd_bucket.search_type == 0) {
goto get_data_exit;
}
/* Read the wwn object */
/* Make sure WWPN is unique */
if (!vport) {
goto get_data_exit;
}
/*
* count # of targets to see if buffer is big enough
*/
count = 0;
for (i = 0; i < EMLXS_NUM_HASH_QUES; i++) {
count++;
}
}
sizeof (struct SD_time_stats_v0) * SD_IO_LATENCY_MAX_BUCKETS);
if (bufsize < size_needed) {
goto update_count; /* not enough space, return */
}
/*
* return data collected, reset counter.
*/
count = 0;
skip_bytes = 0;
for (i = 0; i < EMLXS_NUM_HASH_QUES; i++) {
/* copy port name */
skip_bytes += sizeof (HBA_WWN);
/* copy bucket data */
sizeof (struct SD_time_stats_v0) *
skip_bytes += sizeof (struct SD_time_stats_v0) *
sizeof (struct SD_time_stats_v0) *
count++;
bufsize -= sizeof (struct SD_IO_Latency_Response);
}
}
return (rval);
}
static int32_t
{
int i, count;
/*
* The value of "event" has been shifted left based on
* the category that the application gave to libdfc.
*
* This is so the old Event handling code won't mistakenly
* grab an SD Event.
*/
/* Read the wwn object */
/* Make sure WWPN is unique */
if (!vport) {
goto set_sd_event_exit;
}
if (enable) {
/* Find next available event object */
for (i = 0; i < MAX_DFC_EVENTS; i++) {
break;
}
/* Return if all event objects are busy */
if (i == MAX_DFC_EVENTS) {
goto set_sd_event_exit;
}
/* Initialize */
/* TODO: Should we add SUBCAT in dfc_event ??? */
} else { /* Disable */
/* find event entry */
for (i = 0; i < MAX_DFC_EVENTS; i++) {
break;
}
/* Return if not found */
if (i == MAX_DFC_EVENTS) {
goto set_sd_event_exit;
}
/* Kill the event thread if it is sleeping */
/* Count the number of pids still registered for this event */
count = 0;
for (i = 0; i < MAX_DFC_EVENTS; i++) {
count++;
}
/*
* If no more pids need this event,
* then disable logging for this event
*/
if (count == 0)
}
return (rval);
} /* emlxs_dfc_sd_set_event */
static int32_t
{
/* Read the wwn object */
/* Make sure WWPN is unique */
if (!vport) {
goto get_sd_event_exit;
}
/* Find the event entry */
for (i = 0; i < MAX_DFC_EVENTS; i++) {
break;
}
if (i == MAX_DFC_EVENTS) {
goto get_sd_event_exit;
}
goto get_sd_event_exit;
}
/* Initialize event buffer pointers */
return (DFC_SD_ERROR_GENERIC);
/*
* update rcv_size.
*/
/*
* update index
*/
return (rval);
} /* emlxs_dfc_sd_get_event */
#endif
static int32_t
{
void *ptr;
char buffer[64];
/* cmd info */
rval = DFC_ARG_NULL;
goto done;
}
/* reqBuffer info */
rval = DFC_ARG_NULL;
goto done;
}
/* rspBuffer info, could be 0 for SCSI commands like TUR */
rval = DFC_ARG_NULL;
goto done;
}
/* senseBuffer info */
rval = DFC_ARG_NULL;
goto done;
}
sizeof (dfc_send_scsi_fcp_cmd_info_t), mode) != 0) {
goto done;
}
#ifdef NPIV_SUPPORT
port =
"%s: WWPN does not exists. %s",
goto done;
}
}
#endif /* NPIV_SUPPORT */
goto done;
}
"%s: Unable to allocate packet.",
goto done;
}
/* Copy in the command buffer */
mode) != 0) {
goto done;
}
/* Make this a polled IO */
/* Build the fc header */
"%s: ddi_copyin failed.",
goto done;
}
} else {
}
rval = DFC_IO_ERROR;
goto done;
}
"Pkt Transport error. Pkt Timeout.");
rval = DFC_TIMEOUT;
} else {
rval = DFC_IO_ERROR;
}
goto done;
}
if (pkt->pkt_data_resid) {
else
}
/*
* This is sense count for flag = 0.
* It is fcp response size for flag = 1.
*/
} else {
}
sizeof (dfc_send_scsi_fcp_cmd_info_t), mode) != 0) {
"%s: rsp_buf ddi_copyout failed.",
goto done;
}
if (SCSI_SNS_CNT(cmdinfo)) {
mode) != 0) {
"%s: rsp_size ddi_copyout failed.",
goto done;
}
}
if (SCSI_RSP_CNT(cmdinfo)) {
"%s: rsp_size ddi_copyout failed.",
goto done;
}
}
rval = 0;
done:
if (pkt) {
}
return (rval);
} /* emlxs_dfc_send_scsi_fcp() */
#endif /* DFC_SUPPORT */