/*
* 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 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* I18N message number ranges
* This file: 10000 - 10499
* Shared common messages: 1 - 1999
*/
/* #define _POSIX_SOURCE 1 */
/* Includes */
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
#include <nl_types.h>
#include <string.h>
#include <errno.h>
#include "common.h"
#include "errorcodes.h"
/* Defines */
/*
* Allocate space for and return a pointer to a string
* on the stack. If the string is null, create
* an empty string.
*/
char *
alloc_string(char *s)
{
char *ns;
if (s == (char *)NULL) {
} else {
}
}
return (ns);
}
/*
* Decodes the SCSI sense byte to a string.
*
* RETURNS:
* character string
*/
static char *
{
switch (status & STATUS_MASK) {
case STATUS_GOOD:
case STATUS_CHECK:
case STATUS_MET:
case STATUS_BUSY:
case STATUS_INTERMEDIATE:
case STATUS_INTERMEDIATE_MET:
case STATUS_TERMINATED:
case STATUS_QFULL:
default:
}
}
/*
* This function finds a predefined error string to a given
* error number (errornum), allocates memory for the string
* and returns the corresponding error message to the caller.
*
* RETURNS
* error string if O.K.
* NULL otherwise
*/
char
{
/* Some sort of random system error most likely */
} else { /* Something's _really_ messed up */
MSGSTR(10081,
" Error: could not decode the"
" error message.\n"
" The given error message is not"
" defined in the library.\n"
" Message number: %d.\n"), errornum);
}
/* Make sure ALL CASES set err_msg to something */
} else switch (errornum) {
case L_SCSI_ERROR:
MSGSTR(10096,
" Error: SCSI failure."));
break;
case L_PR_INVLD_TRNSFR_LEN:
MSGSTR(10005,
" Error: Persistant Reserve command"
" transfer length not word aligned."));
break;
case L_RD_NO_DISK_ELEM:
MSGSTR(10006,
" Error: Could not find the disk elements"
" in the Receive Diagnostic pages."));
break;
case L_RD_INVLD_TRNSFR_LEN:
MSGSTR(10007,
" Error: Receive Diagnostic command"
" transfer length not word aligned."));
break;
MSGSTR(10008,
" Error: Programming error - "
"illegal Mode Sense parameter."));
break;
MSGSTR(10009,
" Error: Invalid no. of sense pages.\n"
" Could not get valid sense page"
" information from the device."));
break;
case L_INVALID_BUF_LEN:
MSGSTR(10010,
" Error: Invalid buffer length.\n"
" Could not get diagnostic "
" information from the device."));
break;
case L_INVALID_PATH:
MSGSTR(113,
" Error: Invalid pathname"));
break;
case L_NO_PHYS_PATH:
MSGSTR(10011,
" Error: Could not get"
" physical path to the device."));
break;
case L_NO_SES_PATH:
MSGSTR(10098,
" Error: No SES found"
" for the device path."));
break;
MSGSTR(10012,
"Error in the device physical path."));
break;
MSGSTR(10013,
" Error in the device physical path:"
" no @ found."));
break;
case L_INVALID_SLOT:
MSGSTR(10014,
" Error: Invalid path format."
" Invalid slot."));
break;
case L_INVALID_LED_RQST:
MSGSTR(10015,
" Error: Invalid LED request."));
break;
case L_INVALID_PATH_FORMAT:
MSGSTR(10016,
" Error: Invalid path format."));
break;
case L_OPEN_PATH_FAIL:
MSGSTR(10017,
" Error opening the path."));
break;
case L_INVALID_PASSWORD_LEN:
MSGSTR(10018,
"Error: Invalid password length."));
break;
MSGSTR(10019,
" Error: Physical path not of a disk."));
break;
case L_INVLD_ID_FOUND:
MSGSTR(10020,
" Error in the device physical path:"
" Invalid ID found in the path."));
break;
case L_INVLD_WWN_FORMAT:
MSGSTR(10021,
" Error in the device physical path:"
" Invalid wwn format."));
break;
case L_NO_VALID_PATH:
MSGSTR(10022,
" Error: Could not find valid path to"
" the device."));
break;
case L_NO_WWN_FOUND_IN_PATH:
MSGSTR(10023,
" Error in the device physical path:"
" No WWN found."));
break;
case L_NO_NODE_WWN_IN_WWNLIST:
MSGSTR(10024,
" Error: Device's Node WWN is not"
" found in the WWN list.\n"));
break;
case L_NO_NODE_WWN_IN_BOXLIST:
MSGSTR(10025,
" Error: Device's Node WWN is not"
" found in the Box list.\n"));
break;
case L_NULL_WWN_LIST:
MSGSTR(10026,
" Error: Null WWN list found."));
break;
case L_NO_LOOP_ADDRS_FOUND:
MSGSTR(10027,
" Error: Could not find the loop address for "
" the device at physical path."));
break;
case L_INVLD_PORT_IN_PATH:
MSGSTR(10028,
"Error in the device physical path:"
" Invalid port number found."
" (Should be 0 or 1)."));
break;
case L_INVALID_LOOP_MAP:
MSGSTR(10029,
"Error: Invalid loop map found."));
break;
case L_SFIOCGMAP_IOCTL_FAIL:
MSGSTR(10030,
" Error: SFIOCGMAP ioctl failed."
" Cannot read loop map."));
break;
case L_FCIO_GETMAP_IOCTL_FAIL:
MSGSTR(10031,
" Error: FCIO_GETMAP ioctl failed."
" Cannot read loop map."));
break;
case L_FCIO_LINKSTATUS_FAILED:
MSGSTR(10032,
" Error: FCIO_LINKSTATUS ioctl failed."
" Cannot read loop map."));
break;
case L_FCIOGETMAP_INVLD_LEN:
MSGSTR(10033,
" Error: FCIO_GETMAP ioctl returned"
" an invalid parameter:"
" # entries to large."));
break;
case L_FCIO_FORCE_LIP_FAIL:
MSGSTR(10034,
" Error: FCIO_FORCE_LIP ioctl failed."));
break;
MSGSTR(10115,
" Error: FCIO_FORCE_LIP ioctl failed on one"
" or more (but not all) of the paths."));
break;
case L_DWNLD_CHKSUM_FAILED:
MSGSTR(10035,
"Error: Download file checksum failed."));
break;
case L_DWNLD_READ_HEADER_FAIL:
MSGSTR(10036,
" Error: Reading download file exec"
" header failed."));
break;
MSGSTR(10037,
" Error: Incorrect number of bytes read."));
break;
MSGSTR(10038,
" Error: Reading text segment: "
" Found wrong size."));
break;
case L_DWNLD_READ_ERROR:
MSGSTR(10039,
" Error: Failed to read download file."));
break;
case L_DWNLD_BAD_FRMWARE:
MSGSTR(10040,
" Error: Bad Firmware MAGIC."));
break;
case L_DWNLD_TIMED_OUT:
MSGSTR(10041,
" Error: Timed out in 5 minutes"
" waiting for the"
" IB to become available."));
break;
case L_REC_DIAG_PG1:
MSGSTR(10042,
" Error parsing the Receive"
" diagnostic page."));
break;
case L_TRANSFER_LEN:
break;
case L_REQUIRE_FILE:
MSGSTR(10109,
" Error: No default file. You must specify"
" the filename path."));
break;
case L_MALLOC_FAILED:
MSGSTR(10,
" Error: Unable to allocate memory."));
break;
case L_LOCALTIME_ERROR:
MSGSTR(10044,
" Error: Could not convert time"
break;
case L_SELECT_ERROR:
MSGSTR(10045,
" select() error during retry:"
" Could not wait for"
" specified time."));
break;
case L_NO_DISK_DEV_FOUND:
MSGSTR(10046,
" Error: No disk devices found"
" directory."));
break;
case L_NO_TAPE_DEV_FOUND:
MSGSTR(10047,
" Error: No tape devices found"
" directory."));
break;
case L_LSTAT_ERROR:
MSGSTR(10048,
" lstat() error: Cannot obtain status"
" for the device."));
break;
case L_SYMLINK_ERROR:
MSGSTR(10049,
" Error: Could not read the symbolic link."));
break;
case L_UNAME_FAILED:
MSGSTR(10050,
" uname() error: Could not obtain the"
" architeture of the host machine."));
break;
case L_DRVCONFIG_ERROR:
MSGSTR(10051,
" Error: Could not run drvconfig."));
break;
case L_DISKS_ERROR:
MSGSTR(10052,
" Error: Could not run disks."));
break;
case L_DEVLINKS_ERROR:
MSGSTR(10053,
" Error: Could not run devlinks."));
break;
case L_READ_DEV_DIR_ERROR:
MSGSTR(10054,
" directory."));
break;
case L_OPEN_ES_DIR_FAILED:
MSGSTR(10055,
" directory."));
break;
case L_LSTAT_ES_DIR_ERROR:
MSGSTR(10056,
" lstat() error: Could not get status"
break;
case L_DEV_BUSY:
MSGSTR(10057,
" Error: Could not offline the device\n"
" May be Busy."));
break;
case L_EXCL_OPEN_FAILED:
MSGSTR(10058,
" Error: Could not open device in"
" exclusive mode."
" May already be open."));
break;
case L_DEVICE_RESERVED:
MSGSTR(10059,
" Error: Disk is reserved."));
break;
case L_DISKS_RESERVED:
MSGSTR(10060,
" Error: One or more disks in"
" SENA are reserved."));
break;
case L_SLOT_EMPTY:
MSGSTR(10061,
" Error: Slot is empty."));
break;
case L_ACQUIRE_FAIL:
MSGSTR(10062,
" Error: Could not acquire"
" the device."));
break;
case L_POWER_OFF_FAIL_BUSY:
MSGSTR(10063,
" Error: Could not power off the device.\n"
" May be Busy."));
break;
case L_ENCL_NAME_CHANGE_FAIL:
MSGSTR(10064,
" Error: The Enclosure name change failed."));
break;
case L_DUPLICATE_ENCLOSURES:
MSGSTR(10065,
" Error: There are two or more enclosures"
" with the same name."
" Please use a logical or physical"
" pathname."));
break;
case L_INVALID_NUM_DISKS_ENCL:
MSGSTR(10066,
" Error: The number of disks in the"
" front & rear of the enclosure are"
" different."
" This is not a supported configuration."));
break;
case L_ENCL_INVALID_PATH:
MSGSTR(10067,
" Error: Invalid path."
" Device is not a SENA subsystem."));
break;
case L_NO_ENCL_LIST_FOUND:
MSGSTR(10068,
" Error: Cannot get the Box list."));
break;
case L_IB_NO_ELEM_FOUND:
MSGSTR(10069,
" Error: No elements returned from"
" enclosure (IB)."));
break;
case L_GET_STATUS_FAILED:
MSGSTR(10070,
" Error: Get status failed."));
break;
case L_RD_PG_MIN_BUFF:
MSGSTR(10071,
" Error: Reading page from IB.\n"
" Buffer size too small."));
break;
case L_RD_PG_INVLD_CODE:
MSGSTR(10072,
" Error: Reading page from IB\n"
" Invalid page code or page len found."));
break;
case L_BP_BUSY_RESERVED:
MSGSTR(10073,
" Error: There is a busy or reserved disk"
" attached to this backplane.\n"
" You must close the disk,\n"
" or release the disk,\n"
" or resubmit the command using"
" the Force option."));
break;
case L_BP_BUSY:
MSGSTR(10074,
" Error: There is a busy disk"
" attached to this backplane.\n"
" You must close the disk,\n"
" or resubmit the command using"
" the Force option."));
break;
case L_BP_RESERVED:
MSGSTR(10075,
" Error: There is a reserved disk"
" attached to this backplane.\n"
" You must release the disk,\n"
" or resubmit the subcommand using"
" the Force option."));
break;
case L_NO_BP_ELEM_FOUND:
MSGSTR(10076,
" Error: No Back plane elements found"
" in the enclosure."));
break;
case L_SSA_CONFLICT:
MSGSTR(10077,
" There is a conflict between the "
"enclosure name and an SSA name of "
"same form, cN.\n"
" Please use a logical or physical "
"pathname."));
break;
case L_WARNING:
break;
case L_TH_JOIN:
MSGSTR(10079,
" Error: Thread join failed."));
break;
case L_FCIO_RESET_LINK_FAIL:
MSGSTR(10082,
" Error: FCIO_RESET_LINK ioctl failed.\n"
" Could not reset the loop."));
break;
MSGSTR(10083,
" Error: FCIO_GET_FCODE_REV ioctl failed.\n"
" Could not get the fcode version."));
break;
case L_FCIO_GET_FW_REV_FAIL:
MSGSTR(10084,
" Error: FCIO_GET_FW_REV ioctl failed.\n"
" Could not get the firmware revision."));
break;
case L_NO_DEVICES_FOUND:
MSGSTR(10085,
" No FC devices found."));
break;
case L_INVALID_DEVICE_COUNT:
MSGSTR(10086,
" Error: FCIO_GET_DEV_LIST ioctl returned"
" an invalid device count."));
break;
case L_FCIO_GET_NUM_DEVS_FAIL:
MSGSTR(10087,
" Error: FCIO_GET_NUM_DEVS ioctl failed.\n"
" Could not get the number of devices."));
break;
case L_FCIO_GET_DEV_LIST_FAIL:
MSGSTR(10088,
" Error: FCIO_GET_DEV_LIST ioctl failed.\n"
" Could not get the device list."));
break;
MSGSTR(10089,
" Error: FCIO_GET_LINK_STATUS ioctl failed.\n"
" Could not get the link status."));
break;
case L_PORT_OFFLINE_FAIL:
MSGSTR(10090,
" Error: ioctl to offline the port failed."));
break;
MSGSTR(10091,
" Error: The driver does not support ioctl to"
" disable the FCA port."));
break;
case L_PORT_ONLINE_FAIL:
MSGSTR(10092,
" Error: ioctl to online the port failed."));
break;
MSGSTR(10093,
" Error: The driver does not support ioctl to"
" enable the FCA port."));
break;
case L_FCP_TGT_INQUIRY_FAIL:
MSGSTR(10094,
" Error: FCP_TGT_INQUIRY ioctl failed.\n"
" Could not get the target inquiry data"
" from FCP."));
break;
case L_FSTAT_ERROR:
MSGSTR(10095,
" fstat() error: Cannot obtain status"
" for the device."));
break;
MSGSTR(10097,
" Error: FCIO_GET_HOST_PARAMS ioctl failed.\n"
" Could not get the host parameters."));
break;
case L_STAT_ERROR:
MSGSTR(10099,
" stat() error: Cannot obtain status"
" for the device."));
break;
case L_DEV_SNAPSHOT_FAILED:
MSGSTR(10100,
" Error: Could not retrieve device tree"
" snapshot."));
break;
case L_LOOPBACK_UNSUPPORTED:
MSGSTR(10101,
" Error: Loopback mode is unsupported for this"
" device."));
break;
case L_LOOPBACK_FAILED:
MSGSTR(10102,
" Error: Error occurred during loopback mode"
" set."));
break;
case L_FCIO_GET_TOPOLOGY_FAIL:
MSGSTR(10103,
" Error: FCIO_GET_TOPOLOGY ioctl failed.\n"
" Could not get the fca port topology."));
break;
case L_UNEXPECTED_FC_TOPOLOGY:
MSGSTR(10104,
" Error: Unexpected Fibre Channel topology"
" found."));
break;
MSGSTR(10105,
" Error: AL_PA is not a valid private loop"
" address."));
break;
case L_NO_FABRIC_ADDR_FOUND:
MSGSTR(10106,
" Error: Could not find the fabric address"
" for the device at physical path."));
break;
case L_INVALID_FABRIC_ADDRESS:
MSGSTR(10107,
" Error: Device port address on the Fabric"
" topology is not valid."));
break;
MSGSTR(10108,
" Error: Point to Point Fibre Channel "
"topology is currently not supported."));
break;
case L_FCIO_DEV_LOGIN_FAIL:
MSGSTR(10310,
" Error: FCIO_DEV_LOGIN ioctl failed."));
break;
case L_FCIO_DEV_LOGOUT_FAIL:
MSGSTR(10311,
" Error: FCIO_DEV_LOGOUT ioctl failed."));
break;
case L_OPNOSUPP_ON_TOPOLOGY:
MSGSTR(10312,
" Error: operation not supported "
"on connected topology."));
break;
case L_INVALID_PATH_TYPE:
MSGSTR(10313,
" Error: operation not supported "
"on the path."));
break;
case L_FCIO_GET_STATE_FAIL:
MSGSTR(10314,
" Error: FCIO_GET_STATE ioctl failed."));
break;
MSGSTR(10315,
" Error: device WWN not found in "
"device list."));
break;
case L_STAT_RMT_DIR_ERROR:
MSGSTR(10110,
" stat() error: Could not get status"
break;
case L_STAT_DEV_DIR_ERROR:
MSGSTR(10111,
" stat() error: Could not get status"
break;
case L_PROM_INIT_FAILED:
MSGSTR(10234,
" Error: di_prom_init failure"));
break;
case L_PORT_DRIVER_NOT_FOUND:
MSGSTR(10113,
" Error: requested port driver"
" does not exist"));
break;
case L_PHYS_PATH_NOT_FOUND:
MSGSTR(10114,
" Error: requested phys path does not exist"));
break;
MSGSTR(10150,
" Error: g_get_dev_list failed on ULP "
"processing of target device(s)"));
break;
case L_SCSI_VHCI_ERROR:
MSGSTR(10230,
" Error: Unable to perform failover"));
break;
MSGSTR(10231,
" Error: Pathclass already active"));
break;
case L_NO_DEVID:
MSGSTR(10232,
" Error: No device identifier found"));
break;
case L_DRIVER_NOTSUPP:
MSGSTR(10233,
" Error: Driver not supported"));
break;
case L_PROC_WWN_ARG_ERROR:
MSGSTR(10235,
" Error: process WWN argument"));
break;
case L_NO_WWN_PROP_FOUND:
MSGSTR(10236,
" Error: WWN prop not found"));
break;
case L_NO_DRIVER_NODES_FOUND:
MSGSTR(10237,
" Error: Requested driver nodes not found"));
break;
case L_INVALID_MAP_DEV_ADDR:
MSGSTR(10330,
" Error: Invalid map device handle found"));
break;
MSGSTR(10331,
" Error: Invalid device property type found"));
break;
MSGSTR(10332,
" Error: Invalid device property name found"));
break;
case L_INVALID_MAP_DEV_PROP:
MSGSTR(10333,
" Error: Invalid device property handle "
"found"));
break;
case L_SCSI_VHCI_NO_STANDBY:
MSGSTR(10334,
" Error: Unable to perform failover, "
"standby path unavailable"));
break;
MSGSTR(10335,
" Error: Device does not support failover"));
break;
MSGSTR(10336,
" Error: Failover currently in progress"));
break;
case L_NO_SUCH_DEV_FOUND:
MSGSTR(10337,
" Error: No such device found"));
break;
case L_NO_SUCH_PROP_FOUND:
MSGSTR(10338,
" Error: No such property found"));
break;
case L_INVALID_ARG:
MSGSTR(10339,
" Error: Invalid argument found"));
break;
default:
MSGSTR(10080,
" SCSI Error - Sense Byte:(0x%x) %s \n"
" Error: Retry failed."),
} else {
MSGSTR(10081,
" Error: could not decode the"
" error message.\n"
" The given error message is not"
" defined in the library.\n"
" Message number: %d.\n"), errornum);
}
} /* end of switch */
return (errStrg);
}