emlxs_dfc.c revision fcf3ce441efd61da9bb2884968af01cb7c1452cc
/*
* 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 2008 Emulex. All rights reserved.
* Use is subject to License terms.
*/
#include "emlxs.h"
#define HBA_10GBIT HBA_PORTSPEED_10GBIT
#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 FCIO_SUPPORT
#endif /* FCIO_SUPPORT */
{
{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_FCOE_EVENT, "FCOE_EVENT"},
}; /* emlxs_dfc_event_table */
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:
"%s: ddi_copyin failed.",
}
break;
}
#else /* _MULTI_DATAMODEL */
"%s: ddi_copyin failed.",
}
#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:
{
"%s requested.",
break;
}
case EMLXS_SEND_MBOX:
{
break;
}
case EMLXS_READ_PCI:
{
break;
}
case EMLXS_WRITE_PCI:
{
break;
}
case EMLXS_GET_CFG:
{
"%s requested.",
break;
}
case EMLXS_SET_CFG:
{
"%s requested.",
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:
{
"%s requested.",
break;
}
case EMLXS_READ_FLASH:
{
"%s requested.",
break;
}
case EMLXS_SEND_ELS:
{
"%s requested.",
break;
}
case EMLXS_LOOPBACK_TEST:
{
break;
}
case EMLXS_GET_DUMPREGION:
{
break;
}
case EMLXS_LOOPBACK_MODE:
{
break;
}
case EMLXS_GET_IOINFO:
{
"%s requested.",
break;
}
case EMLXS_GET_LINKINFO:
{
"%s requested.",
break;
}
#ifdef SFCT_SUPPORT
case EMLXS_GET_FCTSTAT:
{
"%s requested.",
break;
}
#endif /* SFCT_SUPPORT */
case EMLXS_READ_MEM:
{
"%s requested.",
break;
}
case EMLXS_WRITE_MEM:
{
"%s requested.",
break;
}
case EMLXS_WRITE_CTLREG:
{
"%s requested.",
break;
}
case EMLXS_READ_CTLREG:
{
"%s requested.",
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:
{
"%s requested.",
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 */
default:
"Unknown command received. (0x%x)",
} /* 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;
"%s: %s: requested.",
"%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;
}
"%s: %s: ddi_copyin failed. (size=%d)",
goto done;
}
}
"%s: %s: Unable to allocate obuf. (size=%d)",
goto done;
}
"%s: %s: ddi_copyin failed. (size=%d)",
goto done;
}
}
"%s: %s: Unable to allocate abuf. (size=%d)",
goto done;
}
"%s: %s: ddi_copyin failed. (size=%d)",
goto done;
}
}
/* FCIO command */
case FCIO_DIAG:
{
/* uint32_t ret; */
if (rval != FC_SUCCESS) {
if (rval == FC_INVALID_REQUEST) {
} else {
}
}
break;
}
case FCIO_GET_HOST_PARAMS:
{
uint32_t i;
break;
}
(uint8_t)(i & 0xff);
break;
}
}
}
break;
}
case FCIO_RESET_LINK:
{
break;
}
null_wwn, 8) == 0) {
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;
}
{
sizeof (fc_hba_adapter_attributes_t)) {
break;
}
sizeof (hba_attrs->SerialNumber));
sizeof (hba_attrs->ModelDescription));
sizeof (hba_attrs->NodeSymbolicName));
sizeof (hba_attrs->OptionROMVersion));
sizeof (hba_attrs->DriverName));
break;
}
{
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;
4);
4);
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 (nport_count == 0) {
break;
}
if (nport_count > max_count) {
break;
}
break; \
} \
}
for (i = 0; i < EMLXS_NUM_HASH_QUES; i++) {
0xFFF000) {
SWAP_LONG(0x00000100);
PRIV_LILP_POSIT(port_dev) = 0;
break;
}
}
}
&nlp->nlp_portname;
&nlp->nlp_nodename;
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;
}
if ((fcio->fcio_cmd_flags !=
(fcio->fcio_cmd_flags !=
break;
}
if (rval != FC_SUCCESS) {
}
} else {
}
break;
}
{
char *path;
break;
}
break;
}
break;
}
{
sizeof (fc_hba_port_attributes_t)) {
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:
{
/* uint32_t value1; */
sizeof (fc_hba_port_attributes_t)) {
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_SET_SYM_PNAME:
case FCIO_SET_SYM_NNAME:
case FCIO_DEV_LOGIN:
case FCIO_DEV_LOGOUT:
case FCIO_DEV_REMOVE:
case FCIO_GET_DUMP_SIZE:
case FCIO_FORCE_DUMP:
case FCIO_GET_DUMP:
case FCIO_NS:
case FCIO_SEND_NODE_ID:
"%s: Unsupported FCIO command.",
break;
default:
"Unknown FCIO command. (0x%x)",
} /* switch() */
done:
if (rval == 0) {
fcio->fcio_errno = 0;
}
"%s: %s: ddi_copyout failed. (size=%d)",
}
}
"%s: %s: ddi_copyout failed. (size=%d)",
}
}
"%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];
"%s requested.",
"%s: Null buffer1 found.",
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) {
"%s: ddi_copyin failed.",
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) {
"%s: ddi_copyout failed.",
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];
"%s requested.",
"%s: Null buffer1 found.",
rval = DFC_ARG_NULL;
goto done;
}
"%s: Buffer1 too small. (size=%d)",
goto done;
}
/* Read the wwn object */
"%s: ddi_copyin failed.",
goto done;
}
/* Make sure WWPN is unique */
if (!vport) {
"%s: WWPN does not exists. %s",
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;
/* uint32_t j; */
"%s requested.",
"%s: Null buffer1 found.",
return (DFC_ARG_NULL);
}
if (!(dfc_vport_list = (dfc_vportinfo_t *)
"%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;
}
"%s: ddi_copyout failed.",
goto done;
}
done:
if (dfc_vport_list) {
}
return (rval);
} /* emlxs_dfc_get_vportinfo() */
static emlxs_port_t *
{
int i, j;
continue;
}
/* Check Local N-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
{
"%s: Null buffer1 found.",
return (DFC_ARG_NULL);
}
"%s: Buffer1 too small. (size=%d)",
return (DFC_ARG_TOOSMALL);
}
"%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) {
"%s: %s failed. status=%x",
rval = DFC_IO_ERROR;
goto done;
}
sizeof (dfc_vport_resource_t), mode) != 0) {
"%s: ddi_copyout failed.",
}
done:
/* Free allocated mbox memory */
if (mbq) {
}
return (rval);
} /* emlxs_dfc_npiv_resource() */
static int32_t
{
/* SERV_PARM *sp; */
int i;
"%s: Null buffer1 found.",
return (DFC_ARG_NULL);
}
"%s: Buffer1 too small. (size=%d)",
return (DFC_ARG_TOOSMALL);
}
}
}
}
}
goto done;
}
goto done;
}
goto done;
}
goto done;
}
/* Does fabric have resources? */
/* Check if we have resources */
if (!(checklist & CL_HBA_HAS_RESOURCES)) {
/*
* If we're out of resources then it doesn't matter if fabric
* has resources
*/
goto done;
} else {
/* Now check if fabric have resources */
goto done;
}
}
}
sizeof (FCP_RSP), 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 */
"%s: Unable to send packet.",
goto done;
}
sizeof (FCP_RSP), 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:
"%s: ddi_copyout failed.",
}
if (pkt) {
/* Free the pkt */
}
if (pkt1) {
/* Free the pkt */
}
return (rval);
} /* emlxs_dfc_npiv_test() */
#endif /* NPIV_SUPPORT */
static int32_t
{
"%s requested.",
"%s: Null buffer1 found.",
return (DFC_ARG_NULL);
}
"%s: Buffer1 too small. (size=%d)",
return (DFC_ARG_TOOSMALL);
}
"%s: ddi_copyout failed.",
return (DFC_COPYOUT_ERROR);
}
return (0);
} /* emlxs_dfc_get_rev() */
static int32_t
{
char pathname[256];
"%s requested.",
"%s: Null buffer1 found.",
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 */
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) {
"%s: ddi_copyout failed.",
return (DFC_COPYOUT_ERROR);
}
return (0);
} /* emlxs_dfc_get_hbainfo() */
static int32_t
{
"%s requested.",
"%s: Null buffer1 found.",
return (DFC_ARG_NULL);
}
"%s: Buffer1 too small. (size=%d)",
return (DFC_ARG_TOOSMALL);
}
"%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) {
"%s: %s failed. status=%x",
rval);
rval = DFC_IO_ERROR;
goto done;
}
if (rval == MBX_TIMEOUT) {
"%s: Mailbox timed out. cmd=%x",
rval = DFC_TIMEOUT;
goto done;
}
if (rval) {
"%s: %s failed. status=%x",
rval);
rval = DFC_IO_ERROR;
goto done;
}
#ifdef MENLO_SUPPORT
} else
#endif /* MENLO_SUPPORT */
} else {
}
} else {
} else {
}
}
} else {
}
}
sizeof (dfc_hbastats_t), mode) != 0) {
"%s: ddi_copyout failed.",
return (DFC_COPYOUT_ERROR);
}
done:
/* Free allocated mbox memory */
if (mbq) {
}
return (rval);
} /* emlxs_dfc_get_hbastats() */
static int32_t
{
"%s requested.",
"%s: Null buffer1 found.",
return (DFC_ARG_NULL);
}
#if (DFC_REV >= 2)
#endif
"%s: ddi_copyout failed.",
return (DFC_COPYOUT_ERROR);
}
return (rval);
} /* emlxs_dfc_get_drvstats() */
static int32_t
{
uint32_t i;
"%s: Null buffer1 found.",
return (DFC_ARG_NULL);
}
"%s: Buffer1 too small. (size=%d)",
return (DFC_ARG_TOOSMALL);
}
/* Wait if adapter is in transition */
i = 0;
if (i++ > 30) {
break;
}
}
switch (flag) {
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 */
(void) emlxs_hba_reset(hba, 0, 0);
/* Reset with no restart */
(void) emlxs_hba_reset(hba, 0, 0);
}
break;
/* Killed */
case DDI_DIAGDI:
(void) emlxs_offline(hba);
(void) emlxs_interlock(hba);
}
break;
default:
"%s: Invalid flag. flag=%x",
}
/* Wait if adapter is in transition */
i = 0;
if (i++ > 30) {
break;
}
}
/* Return current state */
flag = DDI_DIAGDI;
flag = DDI_WARMDI;
} else {
}
"%s: ddi_copyout failed.",
return (DFC_COPYOUT_ERROR);
}
return (rval);
} /* emlxs_dfc_set_diag() */
static int32_t
{
"%s: Null buffer1 found.",
return (DFC_ARG_NULL);
}
"%s: Null buffer2 found.",
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);
}
"%s: Unable to allocate mailbox"
" extension buffer.",
return (DFC_SYSRES_ERROR);
}
"%s: ddi_copyin mbox extension"
" data failed.",
goto done;
}
}
}
#endif /* MBOX_EXT_SUPPORT */
"%s: Unable to allocate mailbox buffer.",
goto done;
}
"%s: ddi_copyin failed.",
goto done;
}
#ifdef _LP64
"%s: Invalid mailbox command."
" Must use 64bit version. cmd = %x",
/* 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 */
"%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 */
"%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 */
"%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 */
"%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 */
"%s: ddi_copyin failed. cmd=%x",
goto done;
}
/* Initialize the receive buffer */
"%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;
}
"%s: Invalid BDE. cmd=%x",
goto done;
}
/* Allocate xmit buffer */
"%s: Unable to allocate xmit buffer. cmd=%x",
goto done;
}
/* Initialize the xmit buffer */
"%s: Unable to allocate xmit buffer. cmd=%x",
goto done;
}
break;
case MBX_READ_LA: /* 0x15 */
case MBX_READ_LA64: /* 0x95 */
"%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 */
"%s: %s sent. (%x %x %x %x)",
/* issue the mbox cmd to the sli */
if (mbxstatus) {
"%s: %s failed. mbxstatus=0x%x",
}
"%s: ddi_copyout failed. cmd=%x",
goto done;
}
if (rx_mp) {
"%s: ddi_copyout failed for receive buffer."
" cmd = %x",
mb->mbxCommand);
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;
"%s: offset=%x count=%d",
"%s: Null buffer1 found.",
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);
}
}
"%s: ddi_copyout failed.",
return (DFC_COPYOUT_ERROR);
}
return (0);
} /* emlxs_dfc_read_pci() */
static int32_t
{
/* uint32_t outsz; */
uint32_t i;
"%s: offset = %x count = %d",
"%s: Null buffer1 found.",
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);
}
"%s: ddi_copyin failed.",
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;
"%s: Null buffer1 found.",
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 {
}
}
"%s: ddi_copyout failed.",
}
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];
}
"%s: csize=%d rsize=%d",
"%s: Null buffer1 found.",
rval = DFC_ARG_NULL;
goto done;
}
"%s: Null buffer2 found.",
rval = DFC_ARG_NULL;
goto done;
}
"%s: Null buffer3 found.",
rval = DFC_ARG_NULL;
goto done;
}
"%s: Null buffer4 found.",
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 */
"%s: Unable to read command buffer.",
goto done;
}
"%s: Unable to send packet.",
rval = DFC_IO_ERROR;
goto done;
}
"Pkt Transport error. Pkt Timeout.");
rval = DFC_TIMEOUT;
} else {
"Pkt Transport error. state=%x",
rval = DFC_IO_ERROR;
}
goto done;
}
"%s: Unable to read response.",
goto done;
}
"%s: Unable to write response.",
goto done;
}
rval = 0;
done:
if (pkt) {
}
return (rval);
} /* emlxs_dfc_send_ct() */
static int32_t
{
/* dfc_destid_t destid; */
"%s: csize=%d",
"%s: Null buffer1 found.",
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 */
"%s: Unable to read command buffer.",
goto done;
}
"%s: Unable to send packet.",
rval = DFC_IO_ERROR;
goto done;
}
"Pkt Transport error. Pkt Timeout.");
rval = DFC_TIMEOUT;
} else {
"Pkt Transport error. state=%x",
rval = DFC_IO_ERROR;
}
goto done;
}
rval = 0;
done:
if (pkt) {
}
return (rval);
} /* emlxs_dfc_send_ct_rsp() */
#ifdef MENLO_SUPPORT
static int32_t
{
/* uint32_t did; */
/* char buffer[128]; */
data_size = 0;
mm_mode = 0;
"%s: csize=%d rsize=%d",
"%s: Menlo device not present. device=%x,%x",
goto done;
}
"%s: Null buffer1 found.",
rval = DFC_ARG_NULL;
goto done;
}
"%s: Null buffer2 found.",
rval = DFC_ARG_NULL;
goto done;
}
"%s: Null buffer3 found.",
rval = DFC_ARG_NULL;
goto done;
}
"%s: Buffer3 too small. %d < %d",
sizeof (uint32_t));
goto done;
}
/* Read the command code first */
"%s: Unable to read command code.",
goto done;
}
/* Look for Zephyr specific commands */
if (cmd_code & 0x80000000) {
/* Validate response buffer */
"%s: 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)) {
"%s: Invalid command size. %d < %d",
sizeof (menlo_reset_cmd_t));
goto done;
}
cmd_size = sizeof (menlo_reset_cmd_t);
/* Read the command buffer */
"%s: Unable to read command buffer.",
goto done;
}
/* MENLO_FW_GOLDEN */
value = 1;
"%s: Reset with Golden"
" firmware requested.",
} else {
/* MENLO_FW_OPERATIONAL */
value = 0;
"%s: Reset with Operational"
" firmware requested.",
}
addr = 0x103007;
break;
case MENLO_CMD_SET_MODE:
if (cmd_size < sizeof (menlo_set_cmd_t)) {
"%s: Invalid command size. %d < %d",
sizeof (menlo_set_cmd_t));
goto done;
}
cmd_size = sizeof (menlo_set_cmd_t);
/* Read the command buffer */
"%s: Unable to read command buffer.",
goto done;
}
"%s: Maintenance mode"
" enable requested.",
/* Make sure the mode flag is cleared */
}
mm_mode = 1;
} else {
"%s: Maintenance mode"
" disable requested.",
}
addr = 0x103107;
break;
default:
"%s: Invalid command. cmd=%x",
goto done;
}
"%s: Unable to allocate mailbox buffer.",
goto done;
}
/* Create the set_variable mailbox request */
/* issue the mbox cmd to the sli */
if (mbxstatus) {
"%s: %s failed. mbxstatus=0x%x",
if (mbxstatus == MBX_TIMEOUT) {
rval = DFC_TIMEOUT;
} else {
rval = DFC_IO_ERROR;
}
goto done;
}
"%s: Unable to write response.",
goto done;
}
"%s: Unable to write response size.",
goto done;
}
/* Check if we need to wait for maintenance mode */
/* Wait for link to come up in maintenance mode */
rval = 0;
}
if (rval == -1) {
"%s: Menlo maintenance mode"
" error. Timeout.",
rval = DFC_TIMEOUT;
goto done;
}
}
} else { /* Standard commands */
"%s: 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
*/
"%s: Invalid command size. %d < %d",
(12 + 4));
goto done;
}
/* Extract data buffer from command buffer */
cmd_size = 12;
}
rsp_size, 0, KM_NOSLEEP))) {
"%s: Unable to allocate packet.",
goto done;
}
/* Make this a polled IO */
/* Build the fc header */
/* Copy in the command buffer */
"%s: Unable to read command buffer.",
goto done;
}
"%s: Unable to send packet.",
rval = DFC_IO_ERROR;
goto done;
}
"%s: Pkt Transport error. Pkt Timeout.",
rval = DFC_TIMEOUT;
"%s: Pkt Transport error."
" Response overrun.",
} else {
"%s: 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))) {
"%s: Unable to allocate"
" data packet.",
goto done;
}
/* Make this a polled IO */
/* Build the fc header */
/* Copy in the data buffer */
if (ddi_copyin((void *)data_buf,
mode) != 0) {
"%s: Unable to read data buffer.",
goto done;
}
"%s: Unable to send data packet.",
rval = DFC_IO_ERROR;
goto done;
}
"%s: Data Pkt Transport"
" error. Pkt Timeout.",
rval = DFC_TIMEOUT;
FC_PKT_LOCAL_RJT) &&
(pkt->pkt_reason ==
"%s: Data Pkt Transport "
"error. Response overrun.",
} else {
"%s: Data Pkt Transport "
"error. state=%x",
rval = DFC_IO_ERROR;
}
goto done;
}
}
}
"%s: Unable to write response.",
goto done;
}
"%s: Unable to write response size.",
goto done;
}
}
rval = 0;
done:
if (pkt) {
}
if (mbq) {
}
return (rval);
} /* emlxs_dfc_send_menlo() */
extern void
emlxs_fcoe_attention_thread(void *arg)
{
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 */
"FCoE attention: FCOE Response error =%x",
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);
}
"%s: Adapter not offline.",
return (DFC_ONLINE_ERROR);
}
"%s: Null buffer1 found.",
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);
}
"%s: ddi_copyin failed.",
return (DFC_COPYIN_ERROR);
}
for (i = 0; i < cnt; i++) {
}
return (0);
} /* emlxs_dfc_write_flash() */
static int32_t
{
uint32_t i;
"%s: Invalid bus_type. (bus_type=%x)",
return (DFC_ARG_INVALID);
}
"%s: Adapter not offline.",
return (DFC_ONLINE_ERROR);
}
"%s: Null buffer1 found.",
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++) {
}
"%s: ddi_copyout failed.",
return (DFC_COPYOUT_ERROR);
}
return (0);
} /* emlxs_dfc_read_flash() */
static int32_t
{
char buffer[128];
"%s: Null buffer1 found.",
rval = DFC_ARG_NULL;
goto done;
}
"%s: Null buffer2 found.",
rval = DFC_ARG_NULL;
goto done;
}
"%s: Null buffer3 found.",
rval = DFC_ARG_NULL;
goto done;
}
"%s: Buffer3 too small. (size=%d)",
goto done;
}
"%s: Null buffer4 found.",
rval = DFC_ARG_NULL;
goto done;
}
"%s: Buffer4 too small. (size=%d)",
goto done;
}
sizeof (dfc_destid_t), mode) != 0) {
"%s: ddi_copyin failed.",
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 */
"%s: ddi_copyin failed.",
goto done;
}
rval = DFC_IO_ERROR;
goto done;
}
"Pkt Transport error. Pkt Timeout.");
rval = DFC_TIMEOUT;
} else {
"Pkt Transport error. state=%x",
rval = DFC_IO_ERROR;
}
goto done;
}
"%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;
"%s: Null buffer1 found.",
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) {
"%s: ddi_copyout failed.",
return (DFC_COPYOUT_ERROR);
}
return (0);
} /* emlxs_dfc_get_ioinfo() */
static int32_t
{
"%s: Null buffer1 found.",
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) {
"%s: ddi_copyout failed.",
return (DFC_COPYOUT_ERROR);
}
return (0);
} /* emlxs_dfc_get_linkinfo() */
#ifdef SFCT_SUPPORT
static int32_t
{
"%s: Null buffer1 found.",
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) {
"%s: ddi_copyout failed.",
return (DFC_COPYOUT_ERROR);
}
return (0);
} /* emlxs_dfc_get_fctstat() */
#endif /* SFCT_SUPPORT */
static int32_t
{
uint32_t i;
"%s requested.",
"%s: NULL buffer1 found.",
return (DFC_ARG_NULL);
}
"%s: Buffer1 too small. (size=%d)",
return (DFC_ARG_TOOSMALL);
}
"%s: NULL buffer2 found.",
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++;
}
}
"%s: ddi_copyout failed.",
return (DFC_COPYOUT_ERROR);
}
"%s: ddi_copyout failed.",
return (DFC_COPYOUT_ERROR);
}
return (0);
} /* emlxs_dfc_get_nodeinfo() */
static int32_t
{
"%s: Null buffer1 found.",
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 {
}
"%s: ddi_copyout failed.",
return (DFC_COPYOUT_ERROR);
}
return (0);
} /* emlxs_dfc_read_mem() */
static int32_t
{
"%s: Null buffer1 found.",
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);
}
"%s: ddi_copyin failed.",
return (DFC_COPYIN_ERROR);
}
size);
} else {
(size / 4));
}
return (0);
} /* emlxs_dfc_write_mem() */
/*ARGSUSED*/
static int32_t
{
"%s: Adapter not offline.",
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);
}
"%s: Null buffer1 found.",
return (DFC_ARG_NULL);
}
"%s: Buffer1 too small. (size=%d)",
return (DFC_ARG_TOOSMALL);
}
"%s: ddi_copyout failed.",
return (DFC_COPYOUT_ERROR);
}
return (0);
} /* emlxs_dfc_read_ctlreg() */
static int32_t
{
uint32_t i;
"%s: %s. pid=%d enable=%d",
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_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",
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 i; */
uint32_t event_count = 0;
"%s: Null buffer1 buffer.",
return (DFC_ARG_NULL);
}
if (!event_count) {
"%s: Buffer1 too small. (size=%d)",
return (DFC_ARG_TOOSMALL);
}
"%s: Null buffer2 buffer.",
return (DFC_ARG_NULL);
}
"%s: Buffer2 too small. (size=%d)",
return (DFC_ARG_TOOSMALL);
}
"%s: Null buffer3 found.",
return (DFC_ARG_NULL);
}
"%s: Buffer3 too small. (size=%d)",
return (DFC_ARG_TOOSMALL);
}
"%s called. max=%d",
"%s: Unable to allocate buffer. size=%d",
return (DFC_SYSRES_ERROR);
}
&event_count, &missed) != 0) {
"%s: emlxs_get_dfc_eventinfo failed.",
goto done;
}
if (event_count) {
"%s: ddi_copyout failed.",
goto done;
}
}
"%s: ddi_copyout failed.",
goto done;
}
"%s: ddi_copyout failed.",
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;
/* char *bp; */
}
}
}
"%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",
return (DFC_ARG_INVALID);
}
"%s: %s. Event not registered. pid=%d",
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() */
static int32_t
{
"%s: region=%d size=%d",
size_only = 1;
} else {
size_only = 0;
}
"%s: Null buffer2 found.",
return (DFC_ARG_NULL);
}
"%s: Buffer2 too small. (size=%d)",
return (DFC_ARG_TOOSMALL);
}
case 0: /* SLI Registers */
"%s: Buffer1 too small. (size=%d)",
goto done;
}
if (size_only) {
break;
}
"%s: Unable to allocate buffer. size=%d",
goto done;
}
break;
case 1: /* SLIM */
} else {
}
if (size_only) {
break;
}
"%s: Unable to allocate buffer. size=%d",
goto done;
}
} else {
}
break;
case 2: /* Port Control Block */
"%s: Buffer1 too small. (size=%d)",
goto done;
}
if (size_only) {
break;
}
"%s: Unable to allocate buffer. size=%d",
goto done;
}
break;
case 3: /* MailBox */
if (size < MAILBOX_CMD_BSIZE) {
"%s: Buffer1 too small. (size=%d)",
goto done;
}
if (size_only) {
break;
}
"%s: Unable to allocate buffer. size=%d",
goto done;
}
} else {
}
break;
"%s: Buffer1 too small. (size=%d)",
goto done;
}
if (size_only) {
break;
}
"%s: Unable to allocate buffer. size=%d",
goto done;
} {
}
break;
"%s: Buffer1 too small. (size=%d)",
goto done;
}
if (size_only) {
break;
}
"%s: Unable to allocate buffer. size=%d",
goto done;
}
break;
if (size < SLI_IOCB_MAX_SIZE) {
"%s: Buffer1 too small. (size=%d)",
goto done;
}
if (size_only) {
break;
}
"%s: Unable to allocate buffer. size=%d",
goto done;
}
break;
case 7: /* All driver specific structures */
if (size < sizeof (emlxs_hba_t)) {
"%s: Buffer1 too small. (size=%d)",
goto done;
}
size = sizeof (emlxs_hba_t);
if (size_only) {
break;
}
"%s: Unable to allocate buffer. size=%d",
goto done;
}
break;
default:
"%s: Invalid id. id=%d",
}
if (rval == 0) {
if (buffer) {
"%s: ddi_copyout failed.",
goto done;
}
}
"%s: ddi_copyout failed.",
goto done;
}
}
done:
if (buffer) {
}
return (rval);
} /* emlxs_dfc_get_dump_region() */
/*ARGSUSED*/
static int32_t
{
uint32_t i;
/* Reinitialize the link */
case 0: /* Disable */
"%s: Disabling Loopback.",
"%s: Loopback already disabled.",
return (0);
}
return (0);
case 1: /* Internal loopback */
"%s: Enabling ILB.",
/* Check if mode already set */
"%s: ILB mode already enabled.",
return (0);
}
break;
case 2: /* External loopback */
"%s: Enabling ELB.",
/* Check if mode already set */
"%s: ELB mode already enabled.",
return (0);
}
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);
}
"%s: Unable to allocate mailbox buffer.",
return (DFC_SYSRES_ERROR);
}
/* Take the link down */
if (rval == MBX_TIMEOUT) {
"%s: Mailbox timed out. cmd=%x",
rval = DFC_TIMEOUT;
goto done;
}
if (rval) {
"%s: %s failed. status=%x",
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) {
"%s: %s failed. status=%x",
rval = DFC_IO_ERROR;
goto done;
}
/* Wait for adapter to come online */
if (!timeout) {
timeout = 60;
}
i = 0;
i++;
if (i == timeout) {
rval = DFC_TIMEOUT;
"%s: Linkup 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;
}
"%s: Node created. node=%p",
/* Create host XRI */
i = 0;
do {
if (i++ > 300) {
break;
}
"%s: Unable to create XRI.",
goto done;
}
"%s: XRI created. xri=%x",
done:
/* Free allocated mbox memory */
if (mbq) {
}
if (rval) {
/* Reset the adapter */
}
return (rval);
} /* emlxs_dfc_loopback_mode() */
static int32_t
{
/* uint32_t i; */
/* uint32_t tics_timeout; */
"%s: Adapter not in loopback mode.",
goto done;
}
"%s: Adapter offline.",
goto done;
}
"%s: Link not up.",
goto done;
}
"%s: NULL buffer1 found.",
rval = DFC_ARG_NULL;
goto done;
}
"%s: NULL buffer2 found.",
rval = DFC_ARG_NULL;
goto done;
}
"%s: Buffer1 too large. (size=%d)",
goto done;
}
/* Check if we have a node for ourselves */
if (!ndlp) {
"%s: Host node not found.",
goto done;
}
"%s: Host XRI not found.",
goto done;
}
"%s: Unable to allocate pkt.",
goto done;
}
"%s: ddi_copyin failed.",
goto done;
}
if (hba->loopback_pkt) {
rval = 0;
timeout);
}
if (rval == -1) {
"Loopback busy timeout.");
rval = DFC_TIMEOUT;
goto done;
}
}
/* Send polled command */
"Pkt Transport error. ret=%x state=%x",
rval = DFC_IO_ERROR;
goto done;
}
"Pkt Transport error. Pkt Timeout.");
rval = DFC_TIMEOUT;
} else {
"Pkt Transport error. state=%x",
rval = DFC_IO_ERROR;
}
goto done;
}
/* Wait for sequence completion */
rval = 0;
}
if (rval == -1) {
"Loopback sequence timeout.");
rval = DFC_TIMEOUT;
goto done;
}
"%s: ddi_copyout failed.",
goto done;
}
rval = 0;
"%s: Test completed.",
done:
if (rval) {
}
/* Reset the adapter */
}
if (pkt) {
}
return (rval);
} /* emlxs_dfc_loopback_test() */
extern int32_t
{
/* NODELIST *ndlp; */
if (!sbp) {
"Stray interrupt. cmd=0x%x iotag=0x%x"
" status=0x%x perr=0x%x",
return (DFC_ARG_INVALID);
}
"CT Event: Invalid ring: ring=%d iocbq=%p",
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:
"Invalid iocb: cmd=0x%x",
cmd->ulpCommand);
break;
} /* switch(cmd->ulpCommand) */
return (0);
} /* emlxs_dfc_handle_event() */
/*ARGSUSED*/
extern int
{
/* dfc_t *dfc; */
"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
{
/*
* dfc.cmd = EMLXS_INIT_AUTH; dfc.buf1_size = 8; dfc.buf1
* = lwwpn; dfc.buf2_size = 8; dfc.buf2 = rwwpn;
*/
"%s requested.",
"%s: Null buffer1 found.",
return (DFC_ARG_NULL);
}
"%s: Buffer1 too small. (size=%d)",
return (DFC_ARG_TOOSMALL);
}
"%s: Null buffer2 found.",
return (DFC_ARG_NULL);
}
"%s: Buffer2 too small. (size=%d)",
return (DFC_ARG_TOOSMALL);
}
/* Read the lwwpn */
8, mode) != 0) {
"%s: ddi_copyin failed.",
return (DFC_COPYIN_ERROR);
}
/* Read the rwwpn */
8, mode) != 0) {
"%s: ddi_copyin failed.",
return (DFC_COPYIN_ERROR);
}
/* Initiate authentication here */
return (rval);
} /* emlxs_dfc_init_auth() */
static int32_t
{
/*
* dfc.cmd = EMLXS_GET_AUTH_CFG; dfc.buf1_size =
* sizeof(dfc_fcsp_config_t); dfc.buf1 = config;
*/
"%s requested.",
"%s: Null buffer1 found.",
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) {
"%s: ddi_copyin failed.",
return (DFC_COPYIN_ERROR);
}
return (rval);
}
sizeof (dfc_fcsp_config_t), mode) != 0) {
"%s: ddi_copyout failed.",
}
return (0);
} /* emlxs_dfc_get_auth_cfg() */
static int32_t
{
/*
* dfc.cmd = EMLXS_SET_AUTH_CFG; dfc.flag =
* EMLXS_AUTH_CFG_ADD; dfc.buf1_size = sizeof(dfc_fcsp_config_t);
* dfc.buf1 = config; dfc.buf2_size = sizeof(dfc_password_t);
* dfc.buf2 = password;
*/
"%s requested.",
"%s: Null buffer1 found.",
return (DFC_ARG_NULL);
}
"%s: Buffer1 too small. (size=%d)",
return (DFC_ARG_TOOSMALL);
}
"%s: Null buffer2 found.",
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) {
"%s: ddi_copyin failed.",
return (DFC_COPYIN_ERROR);
}
/* Read the password */
sizeof (dfc_password_t), mode) != 0) {
"%s: ddi_copyin failed.",
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) {
"%s: ddi_copyout failed.",
return (DFC_COPYOUT_ERROR);
}
return (0);
} /* emlxs_dfc_set_auth_cfg() */
static int32_t
{
/*
* dfc.cmd = EMLXS_GET_AUTH_PASSWORD; dfc.buf1_size =
* sizeof(dfc_auth_password_t); dfc.buf1 = auth_password;
*/
"%s requested.",
"%s: Null buffer1 found.",
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) {
"%s: ddi_copyin failed.",
return (DFC_COPYIN_ERROR);
}
return (rval);
}
sizeof (dfc_auth_password_t), mode) != 0) {
"%s: ddi_copyout failed.",
return (DFC_COPYOUT_ERROR);
}
return (0);
} /* emlxs_dfc_get_auth_pwd() */
static int32_t
{
/*
* dfc.cmd = EMLXS_SET_AUTH_PASSWORD; dfc.buf1_size =
* sizeof(dfc_auth_password_t); dfc.buf1 = auth_password;
*/
"%s requested.",
"%s: Null buffer1 found.",
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) {
"%s: ddi_copyin failed.",
return (DFC_COPYIN_ERROR);
}
return (rval);
}
sizeof (dfc_auth_password_t), mode) != 0) {
"%s: ddi_copyout failed.",
return (DFC_COPYOUT_ERROR);
}
return (0);
} /* emlxs_dfc_set_auth_pwd() */
static int32_t
{
/*
* dfc.cmd = EMLXS_GET_AUTH_STATUS; dfc.buf1_size =
* sizeof(dfc_auth_status_t); dfc.buf1 = status;
*/
"%s requested.",
"%s: Null buffer1 found.",
return (DFC_ARG_NULL);
}
"%s: Buffer too small. (size=%d)",
return (DFC_ARG_TOOSMALL);
}
/* Read the fcsp_config */
sizeof (dfc_auth_status_t), mode) != 0) {
"%s: ddi_copyin failed.",
return (DFC_COPYIN_ERROR);
}
return (rval);
}
sizeof (dfc_auth_status_t), mode) != 0) {
"%s: ddi_copyout failed.",
return (DFC_COPYOUT_ERROR);
}
return (0);
} /* emlxs_dfc_get_auth_status() */
static int32_t
{
/* uint32_t count_sent = 0; */
/*
* dfc.cmd = EMLXS_GET_AUTH_CFG_TABLE; dfc.buf1_size = size;
* dfc.buf1 = fcsp_cfg; dfc.buf2_size = sizeof(uint32_t);
* dfc.buf2 = &count;
*/
"%s requested.",
/* Lock cfg table while we do this */
/* This prevents the table from changing while we get a copy */
"%s: Null buffer2 found.",
return (DFC_ARG_NULL);
}
"%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 */
"%s: Buffer1 too small. (%d < %d)",
return (DFC_ARG_TOOSMALL);
}
"%s: Unable to allocate table buffer.",
return (DFC_SYSRES_ERROR);
}
return (rval);
}
"%s: ddi_copyout failed.",
return (DFC_COPYOUT_ERROR);
}
return (0);
} /* emlxs_dfc_get_auth_cfg_table() */
static int32_t
{
/* uint32_t count_sent = 0; */
/*
* dfc.cmd = EMLXS_GET_AUTH_KEY_TABLE; dfc.buf1_size = size;
* dfc.buf1 = auth_pwd; dfc.buf2_size = sizeof(uint32_t);
* dfc.buf2 = &count;
*/
"%s requested.",
/* Lock cfg table while we do this */
/* This prevents the table from changing while we get a copy */
"%s: Null buffer2 found.",
return (DFC_ARG_NULL);
}
"%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 */
"%s: Buffer1 too small. (%d < %d)",
return (DFC_ARG_TOOSMALL);
}
"%s: Unable to allocate table buffer.",
return (DFC_SYSRES_ERROR);
}
return (rval);
}
"%s: ddi_copyout failed.",
return (DFC_COPYOUT_ERROR);
}
return (0);
} /* emlxs_dfc_get_auth_key_table() */
#endif /* DHCHAP_SUPPORT */
static int32_t
{
/* emlxs_xlat_err_t *entry; */
void *ptr;
char buffer[64];
/* cmd info */
"%s: Null buffer1 found.",
rval = DFC_ARG_NULL;
goto done;
}
/* reqBuffer info */
"%s: Null buffer2 found.",
rval = DFC_ARG_NULL;
goto done;
}
/* rspBuffer info, could be 0 for SCSI commands like TUR */
"%s: Null buffer3 found.",
rval = DFC_ARG_NULL;
goto done;
}
/* senseBuffer info */
"%s: Null buffer4 found.",
rval = DFC_ARG_NULL;
goto done;
}
sizeof (dfc_send_scsi_fcp_cmd_info_t), mode) != 0) {
"%s: ddi_copyin failed.",
goto done;
}
"%s: WWPN does not exists. %s",
goto done;
}
}
"%s: WWPN does not exists. %s",
goto done;
}
"%s: Unable to allocate packet.",
goto done;
}
/* Copy in the command buffer */
"%s: ddi_copyin failed.",
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 {
"Pkt Transport error. state=%x",
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)) {
"%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 */