4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
27 * Common definitions for Storage Utilities libraries
40 * This header file contains the error definitions
41 * to handle the SCSI, path format, Device, Fibre Channel
42 * ioctl, Enclosure, and IB specific Errors. It also
43 * contains physical names for device paths.
47 * Define for physical name of children of fcp
49 #define FC_CTLR ":devctl"
50 #define DRV_NAME_SD "sd@"
51 #define DRV_NAME_SSD "ssd@"
52 #define DRV_NAME_ST "st@"
53 #define SLSH_DRV_NAME_SD "/sd@"
54 #define SLSH_DRV_NAME_SSD "/ssd@"
55 #define SLSH_DRV_NAME_ST "/st@"
56 #define DRV_PART_NAME ",0:c,raw"
57 #define SES_NAME "ses@"
58 #define SLSH_SES_NAME "/ses@"
59 #define SLASH_SES "/ses"
60 #define SES_DIR "/dev/es"
61 #define DEV_DSK_DIR "/dev/dsk"
62 #define DEV_RDIR "/dev/rdsk"
63 #define DEV_TAPE_DIR "/dev/rmt"
64 #define L_ARCH_4M "sun4m"
65 #define VHCI_NODE "/devices/scsi_vhci:devctl"
66 #define SCSI_VHCI "/devices/scsi_vhci/"
67 #define SLSH_VHCI_DISK "/ssd@g"
70 * controller/nexus node postfix strings
72 #define CTLR_POSTFIX ":ctlr"
73 #define DEVCTL_POSTFIX ":devctl"
76 * I18N message number ranges
77 * This file: 15500 - 15999
78 * Shared common messages: 1 - 1999
82 * All error numbers below this base value
83 * are assumed to be UNIX error codes.
86 #define L_BASE L_SCSI_ERROR
93 #define L_SCSI_ERROR 0x10000
95 /* Receive Diagnostics: Transfer length is not word aligned */
96 #define L_RD_INVLD_TRNSFR_LEN 0x11002
98 /* No disk element found in Receive diag. page */
99 #define L_RD_NO_DISK_ELEM 0x11003
101 /* Illegal mode sense page length */
102 #define L_ILLEGAL_MODE_SENSE_PAGE 0x11004
104 /* Invalid number of ENV. SENSE pages */
105 #define L_INVALID_NO_OF_ENVSEN_PAGES 0x11005
107 /* Buffer is *too* small to hold more than 8 pages */
108 #define L_INVALID_BUF_LEN 0x11006
110 /* Scsi_vhci errors */
111 #define L_SCSI_VHCI_ERROR 0x11007
112 #define L_SCSI_VHCI_ALREADY_ACTIVE 0x11008
113 #define L_SCSI_VHCI_NO_STANDBY 0x11009
114 #define L_SCSI_VHCI_FAILOVER_NOTSUP 0x1100a
115 #define L_SCSI_VHCI_FAILOVER_BUSY 0x1100b
122 #define L_INVALID_PATH 0x20200
124 /* Failed to open a given path */
125 #define L_OPEN_PATH_FAIL 0x20001
127 /* Invalid password length. */
128 #define L_INVALID_PASSWORD_LEN 0x20002
130 /* Given disk physical path is not valid. */
131 #define L_INVLD_PHYS_PATH_TO_DISK 0x20004
133 /* Invalid name id found in the physical path */
134 #define L_INVLD_ID_FOUND 0x20005
136 /* Invalid WWN format found */
137 #define L_INVLD_WWN_FORMAT 0x20006
139 /* No WWN found in the disk's physical path */
140 #define L_NO_WWN_FOUND_IN_PATH 0x20007
142 /* No Loop address found in the phys path */
143 #define L_NO_LOOP_ADDRS_FOUND 0x20008
145 /* Invalid port number found in the phys path */
146 #define L_INVLD_PORT_IN_PATH 0x20009
148 /* Invalid LED request */
149 #define L_INVALID_LED_RQST 0x20010
151 /* Invalid path format */
152 #define L_INVALID_PATH_FORMAT 0x20011
154 /* failed to get the physical path */
155 #define L_NO_PHYS_PATH 0x20012
157 /* failed to get the ses path */
158 #define L_NO_SES_PATH 0x20015
160 /* No "/" found in the physical path */
161 #define L_INVLD_PATH_NO_SLASH_FND 0x20100
163 /* No "@" found in the physical path */
164 #define L_INVLD_PATH_NO_ATSIGN_FND 0x20101
166 /* Invalid slot (slot < 0 or slot > 10). */
167 #define L_INVALID_SLOT 0x20102
169 /* No valid path to a device */
170 #define L_NO_VALID_PATH 0x20103
172 /* No disk devices found in /dev/rdsk directory */
173 #define L_NO_DISK_DEV_FOUND 0x20104
175 /* No tape devices found in /dev/rmt directory */
176 #define L_NO_TAPE_DEV_FOUND 0x20105
178 /* Device's Node WWN not found in the WWN list. */
179 #define L_NO_NODE_WWN_IN_WWNLIST 0x20106
181 /* Device's Node WWN not found in the Box list. */
182 #define L_NO_NODE_WWN_IN_BOXLIST 0x20107
184 /* Null WWN list found. */
185 #define L_NULL_WWN_LIST 0x20108
187 /* No devices found. */
188 #define L_NO_DEVICES_FOUND 0x20109
190 /* function arg error in wwn_list process */
191 #define L_PROC_WWN_ARG_ERROR 0x20110
193 /* WWN property not found */
194 #define L_NO_WWN_PROP_FOUND 0x20111
196 /* No driver nodes found for requested driver */
197 #define L_NO_DRIVER_NODES_FOUND 0x20112
199 /* ULP error on device(s) */
200 #define L_GET_DEV_LIST_ULP_FAILURE 0x20150
204 * for FC Loop (FC4 devices).
206 /* Invalid loop map found */
207 #define L_INVALID_LOOP_MAP 0x20202
209 /* SFIOCGMAP ioctl failed */
210 #define L_SFIOCGMAP_IOCTL_FAIL 0x20203
212 /* FCIO_GETMAP ioctl failed */
213 #define L_FCIO_GETMAP_IOCTL_FAIL 0x20204
215 /* FCIO_LINKSTATUS ioctl failed */
216 #define L_FCIO_LINKSTATUS_FAILED 0x20205
218 /* FCIO_GETMAP: Invalid # of entries */
219 #define L_FCIOGETMAP_INVLD_LEN 0x20206
221 /* FCIO_FORCE_LIP ioctl failed. */
222 #define L_FCIO_FORCE_LIP_FAIL 0x20207
224 /* Error definitions for FC devices */
225 /* FCIO_RESET_LINK ioctl failed */
226 #define L_FCIO_RESET_LINK_FAIL 0x20208
228 /* FCIO_GET_FCODE_REV_FAIL ioctl failed */
229 #define L_FCIO_GET_FCODE_REV_FAIL 0x20209
231 /* FCIO_GET_FW_REV_FAIL ioctl failed */
232 #define L_FCIO_GET_FW_REV_FAIL 0x20210
234 /* FCIO_GET_DEV_LIST returns invalid dev. counts */
235 #define L_INVALID_DEVICE_COUNT 0x20211
237 /* L_FCIO_GET_NUM_DEVS_FAIL ioctl failed */
238 #define L_FCIO_GET_NUM_DEVS_FAIL 0x20212
240 /* L_FCIO_GET_DEV_LIST_FAIL ioctl failed */
241 #define L_FCIO_GET_DEV_LIST_FAIL 0x20213
243 /* L_FCIO_GET_LINK_STATUS ioctl failed */
244 #define L_FCIO_GET_LINK_STATUS_FAIL 0x20214
246 /* L_FCIO_LOOPBACK_INTERNAL or FCIO_CMD/FCIO_LASER_OFF ioctl failed */
247 #define L_PORT_OFFLINE_FAIL 0x20215
249 /* Internal Loopback or laser off ioctls not supported */
250 #define L_PORT_OFFLINE_UNSUPPORTED 0x20216
252 /* L_FCIO_NO_LOOPBACK or FCIO_CMD/FCIO_LASER_ON ioctl failed */
253 #define L_PORT_ONLINE_FAIL 0x20217
255 /* No-Loopback or laser on ioctls not supported */
256 #define L_PORT_ONLINE_UNSUPPORTED 0x20218
258 /* L_FCIO_GET_HOST_PARAMS ioctl failed */
259 #define L_FCIO_GET_HOST_PARAMS_FAIL 0x20219
261 /* Loopback mode failure */
262 #define L_LOOPBACK_FAILED 0x20220
264 /* Loopback unsupported */
265 #define L_LOOPBACK_UNSUPPORTED 0x20221
267 /* FCIO_FORCE_LIP ioctl failed on one of the paths, say, of an MPXIO device */
268 #define L_FCIO_FORCE_LIP_PARTIAL_FAIL 0x20222
272 * for Fabric FC driver ioctls
274 /* FCP_TGT_INQUIRY ioctl failed */
275 #define L_FCP_TGT_INQUIRY_FAIL 0x20250
279 * for 24-bit address handling
281 /* Private loop address > 0xFF found */
282 #define L_INVALID_PRIVATE_LOOP_ADDRESS 0x20401
284 /* Encountered an unexpected fibre channel topology value */
285 #define L_UNEXPECTED_FC_TOPOLOGY 0x20402
287 /* Fabric address was not found */
288 #define L_NO_FABRIC_ADDR_FOUND 0x20403
290 /* The FCIO_GET_TOPOLOGY ioctl failed */
291 #define L_FCIO_GET_TOPOLOGY_FAIL 0x20404
293 /* Invalid fabric or public loop address */
294 #define L_INVALID_FABRIC_ADDRESS 0x20405
296 /* Point to Point fibre channel topology not supported */
297 #define L_PT_PT_FC_TOP_NOT_SUPPORTED 0x20406
300 * Error definitions for Tapestry SAN support.
302 /* The FCIO_DEV_LOGIN ioctl failed */
303 #define L_FCIO_DEV_LOGIN_FAIL 0x20407
305 /* The FCIO_DEV_LOGOUT ioctl failed */
306 #define L_FCIO_DEV_LOGOUT_FAIL 0x20408
308 /* Operation not supported on connected topology */
309 #define L_OPNOSUPP_ON_TOPOLOGY 0x20409
311 /* Operation not supported on the path */
312 #define L_INVALID_PATH_TYPE 0x20410
314 /* FCIO_GET_STATE ioctl failed */
315 #define L_FCIO_GET_STATE_FAIL 0x20411
317 /* input WWN not found in dev list */
318 #define L_WWN_NOT_FOUND_IN_DEV_LIST 0x20412
321 * Error definitions for
322 * g_dev_map_init related routines.
324 /* input addr invalid */
325 #define L_INVALID_MAP_DEV_ADDR 0x20430
327 /* input property invalid */
328 #define L_INVALID_MAP_DEV_PROP_NAME 0x20431
330 /* input property invalid */
331 #define L_INVALID_MAP_DEV_PROP_TYPE 0x20432
333 /* input property name invalid */
334 #define L_INVALID_MAP_DEV_PROP 0x20433
336 /* device not found */
337 #define L_NO_SUCH_DEV_FOUND 0x20434
340 #define L_NO_SUCH_PROP_FOUND 0x20435
342 /* invalid arg found */
343 #define L_INVALID_ARG 0x20436
347 * for Downloading IB FW.
349 /* Invalid download file checksum */
350 #define L_DWNLD_CHKSUM_FAILED 0x20301
352 /* Unable to read download exec header */
353 #define L_DWNLD_READ_HEADER_FAIL 0x20302
355 /* Number of bytes read from download file is not correct */
356 #define L_DWNLD_READ_INCORRECT_BYTES 0x20303
358 /* Wrong text segment size */
359 #define L_DWNLD_INVALID_TEXT_SIZE 0x20304
361 /* Error reading the download file */
362 #define L_DWNLD_READ_ERROR 0x20305
364 /* Bad firmware magic found in the download file */
365 #define L_DWNLD_BAD_FRMWARE 0x20306
367 /* Timeout message for the IB to be available */
368 #define L_DWNLD_TIMED_OUT 0x20307
370 /* Error with Rec Diag page 1 */
371 #define L_REC_DIAG_PG1 0x20600
373 /* Invalid transfer Length */
374 #define L_TRANSFER_LEN 0x20601
376 /* A firmware file must be specified on the command line */
377 #define L_REQUIRE_FILE 0x20602
384 #define L_MALLOC_FAILED 0x30000
386 #define L_MEMCPY_FAILED 0x30001
388 /* Cannot get status for the given path */
389 #define L_LSTAT_ERROR 0x30020
391 /* Error reading the symbolic link */
392 #define L_SYMLINK_ERROR 0x30021
394 /* Could not convert std. time to hrs/min/sec */
395 #define L_LOCALTIME_ERROR 0x30022
397 /* select() system call failed to wait for specified time */
398 #define L_SELECT_ERROR 0x30023
400 /* uname() system call failed to get the system info. */
401 #define L_UNAME_FAILED 0x30024
403 /* Cannot get status for the given path */
404 #define L_FSTAT_ERROR 0x30025
406 /* Cannot get status for the given path */
407 #define L_STAT_ERROR 0x30026
409 /* di_init() failed to return snapshot of device tree */
410 #define L_DEV_SNAPSHOT_FAILED 0x30027
412 /* di_drv_first_node() failed to find a valid driver */
413 #define L_PORT_DRIVER_NOT_FOUND 0x30029
415 /* failed to find any device paths */
416 #define L_PHYS_PATH_NOT_FOUND 0x30030
418 /* No device identifier found */
419 #define L_NO_DEVID 0x30031
421 /* Driver not supported */
422 #define L_DRIVER_NOTSUPP 0x30032
424 /* di_prom_init failure */
425 #define L_PROM_INIT_FAILED 0x30033
433 #define L_DEV_BUSY 0x40000
436 #define L_DEVICE_RESERVED 0x40001
438 /* One or more disks in enclosure are reserved */
439 #define L_DISKS_RESERVED 0x40002
441 /* Exclusive open to a device failed. May be busy */
442 #define L_EXCL_OPEN_FAILED 0x40003
444 /* Empty slot: Device not installed */
445 #define L_SLOT_EMPTY 0x40100
450 * for Devctl functions.
452 /* Devctl acquire fails */
453 #define L_ACQUIRE_FAIL 0x40200
456 /* Power off fails. Device may be busy */
457 #define L_POWER_OFF_FAIL_BUSY 0x40300
462 * specific to Enclosure.
464 /* Failed to change the enclosure name */
465 #define L_ENCL_NAME_CHANGE_FAIL 0x40400
467 /* Duplicate enclosure names found */
468 #define L_DUPLICATE_ENCLOSURES 0x40401
470 /* Invalid no. of dsks in SENA enclosure */
471 #define L_INVALID_NUM_DISKS_ENCL 0x40402
473 /* Path is not to a SENA ecnlosure. */
474 #define L_ENCL_INVALID_PATH 0x40403
476 /* Cannot get the box list */
477 #define L_NO_ENCL_LIST_FOUND 0x40404
484 /* No element returned from the enclosure */
485 #define L_IB_NO_ELEM_FOUND 0x40500
487 /* Invalid page code found in Receive Diag. page. */
488 #define L_RD_PG_INVLD_CODE 0x40501
490 /* Reading Receive Diag. page failed: small buffer. */
491 #define L_RD_PG_MIN_BUFF 0x40502
493 /* Get status failed */
494 #define L_GET_STATUS_FAILED 0x40600
496 /* Warning define. */
497 #define L_WARNING 0x90000
502 #include <nl_types.h>
503 extern nl_catd l_catd
;
504 #define L_SET1 1 /* catalog set number */
505 #define MSGSTR(Num, Str) catgets(l_catd, L_SET1, Num, Str)
512 #endif /* _STGCOM_H */