comm: add -Wall
[unleashed.git] / usr / src / cmd / luxadm / errorcodes.h
blob09f80696e055ae3f8d6e353682414f65ab6d4237
1 /*
2 * CDDL HEADER START
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]
19 * CDDL HEADER END
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #ifndef _ERRORCODES_H
27 #define _ERRORCODES_H
33 * Include any headers you depend on.
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
41 /* On the sparc platform, error codes come from stgcom.h */
42 #ifdef __x86
45 * All error numbers below this base value
46 * are assumed to be UNIX error codes.
49 #define L_BASE L_SCSI_ERROR
52 * SCSI Errors
55 /* SCSI error */
56 #define L_SCSI_ERROR 0x10000
58 /* Receive Diagnostics: Transfer length is not word aligned */
59 #define L_RD_INVLD_TRNSFR_LEN 0x11002
61 /* No disk element found in Receive diag. page */
62 #define L_RD_NO_DISK_ELEM 0x11003
64 /* Illegal mode sense page length */
65 #define L_ILLEGAL_MODE_SENSE_PAGE 0x11004
67 /* Invalid number of ENV. SENSE pages */
68 #define L_INVALID_NO_OF_ENVSEN_PAGES 0x11005
70 /* Buffer is *too* small to hold more than 8 pages */
71 #define L_INVALID_BUF_LEN 0x11006
73 /* Scsi_vhci errors */
74 #define L_SCSI_VHCI_ERROR 0x11007
75 #define L_SCSI_VHCI_ALREADY_ACTIVE 0x11008
76 #define L_SCSI_VHCI_NO_STANDBY 0x11009
77 #define L_SCSI_VHCI_FAILOVER_NOTSUP 0x1100a
78 #define L_SCSI_VHCI_FAILOVER_BUSY 0x1100b
82 * Error definitions
83 * for Format Errors.
85 #define L_INVALID_PATH 0x20200
87 /* Failed to open a given path */
88 #define L_OPEN_PATH_FAIL 0x20001
90 /* Invalid password length. */
91 #define L_INVALID_PASSWORD_LEN 0x20002
93 /* Given disk physical path is not valid. */
94 #define L_INVLD_PHYS_PATH_TO_DISK 0x20004
96 /* Invalid name id found in the physical path */
97 #define L_INVLD_ID_FOUND 0x20005
99 /* Invalid WWN format found */
100 #define L_INVLD_WWN_FORMAT 0x20006
102 /* No WWN found in the disk's physical path */
103 #define L_NO_WWN_FOUND_IN_PATH 0x20007
105 /* No Loop address found in the phys path */
106 #define L_NO_LOOP_ADDRS_FOUND 0x20008
108 /* Invalid port number found in the phys path */
109 #define L_INVLD_PORT_IN_PATH 0x20009
111 /* Invalid LED request */
112 #define L_INVALID_LED_RQST 0x20010
114 /* Invalid path format */
115 #define L_INVALID_PATH_FORMAT 0x20011
117 /* failed to get the physical path */
118 #define L_NO_PHYS_PATH 0x20012
120 /* failed to get the ses path */
121 #define L_NO_SES_PATH 0x20015
123 /* No "/" found in the physical path */
124 #define L_INVLD_PATH_NO_SLASH_FND 0x20100
126 /* No "@" found in the physical path */
127 #define L_INVLD_PATH_NO_ATSIGN_FND 0x20101
129 /* Invalid slot (slot < 0 or slot > 10). */
130 #define L_INVALID_SLOT 0x20102
132 /* No valid path to a device */
133 #define L_NO_VALID_PATH 0x20103
135 /* No disk devices found in /dev/rdsk directory */
136 #define L_NO_DISK_DEV_FOUND 0x20104
138 /* No tape devices found in /dev/rmt directory */
139 #define L_NO_TAPE_DEV_FOUND 0x20105
141 /* Device's Node WWN not found in the WWN list. */
142 #define L_NO_NODE_WWN_IN_WWNLIST 0x20106
144 /* Device's Node WWN not found in the Box list. */
145 #define L_NO_NODE_WWN_IN_BOXLIST 0x20107
147 /* Null WWN list found. */
148 #define L_NULL_WWN_LIST 0x20108
150 /* No devices found. */
151 #define L_NO_DEVICES_FOUND 0x20109
153 /* function arg error in wwn_list process */
154 #define L_PROC_WWN_ARG_ERROR 0x20110
156 /* WWN property not found */
157 #define L_NO_WWN_PROP_FOUND 0x20111
159 /* No driver nodes found for requested driver */
160 #define L_NO_DRIVER_NODES_FOUND 0x20112
162 /* ULP error on device(s) */
163 #define L_GET_DEV_LIST_ULP_FAILURE 0x20150
166 * Error definitions
167 * for FC Loop (FC4 devices).
169 /* Invalid loop map found */
170 #define L_INVALID_LOOP_MAP 0x20202
172 /* SFIOCGMAP ioctl failed */
173 #define L_SFIOCGMAP_IOCTL_FAIL 0x20203
175 /* FCIO_GETMAP ioctl failed */
176 #define L_FCIO_GETMAP_IOCTL_FAIL 0x20204
178 /* FCIO_LINKSTATUS ioctl failed */
179 #define L_FCIO_LINKSTATUS_FAILED 0x20205
181 /* FCIO_GETMAP: Invalid # of entries */
182 #define L_FCIOGETMAP_INVLD_LEN 0x20206
184 /* FCIO_FORCE_LIP ioctl failed. */
185 #define L_FCIO_FORCE_LIP_FAIL 0x20207
187 /* Error definitions for FC devices */
188 /* FCIO_RESET_LINK ioctl failed */
189 #define L_FCIO_RESET_LINK_FAIL 0x20208
191 /* FCIO_GET_FCODE_REV_FAIL ioctl failed */
192 #define L_FCIO_GET_FCODE_REV_FAIL 0x20209
194 /* FCIO_GET_FW_REV_FAIL ioctl failed */
195 #define L_FCIO_GET_FW_REV_FAIL 0x20210
197 /* FCIO_GET_DEV_LIST returns invalid dev. counts */
198 #define L_INVALID_DEVICE_COUNT 0x20211
200 /* L_FCIO_GET_NUM_DEVS_FAIL ioctl failed */
201 #define L_FCIO_GET_NUM_DEVS_FAIL 0x20212
203 /* L_FCIO_GET_DEV_LIST_FAIL ioctl failed */
204 #define L_FCIO_GET_DEV_LIST_FAIL 0x20213
206 /* L_FCIO_GET_LINK_STATUS ioctl failed */
207 #define L_FCIO_GET_LINK_STATUS_FAIL 0x20214
209 /* L_FCIO_LOOPBACK_INTERNAL or FCIO_CMD/FCIO_LASER_OFF ioctl failed */
210 #define L_PORT_OFFLINE_FAIL 0x20215
212 /* Internal Loopback or laser off ioctls not supported */
213 #define L_PORT_OFFLINE_UNSUPPORTED 0x20216
215 /* L_FCIO_NO_LOOPBACK or FCIO_CMD/FCIO_LASER_ON ioctl failed */
216 #define L_PORT_ONLINE_FAIL 0x20217
218 /* No-Loopback or laser on ioctls not supported */
219 #define L_PORT_ONLINE_UNSUPPORTED 0x20218
221 /* L_FCIO_GET_HOST_PARAMS ioctl failed */
222 #define L_FCIO_GET_HOST_PARAMS_FAIL 0x20219
224 /* Loopback mode failure */
225 #define L_LOOPBACK_FAILED 0x20220
227 /* Loopback unsupported */
228 #define L_LOOPBACK_UNSUPPORTED 0x20221
230 /* FCIO_FORCE_LIP ioctl failed on one of the paths, say, of an MPXIO device */
231 #define L_FCIO_FORCE_LIP_PARTIAL_FAIL 0x20222
234 * Error definitions
235 * for Fabric FC driver ioctls
237 /* FCP_TGT_INQUIRY ioctl failed */
238 #define L_FCP_TGT_INQUIRY_FAIL 0x20250
241 * Error definitions
242 * for 24-bit address handling
244 /* Private loop address > 0xFF found */
245 #define L_INVALID_PRIVATE_LOOP_ADDRESS 0x20401
247 /* Encountered an unexpected fibre channel topology value */
248 #define L_UNEXPECTED_FC_TOPOLOGY 0x20402
250 /* Fabric address was not found */
251 #define L_NO_FABRIC_ADDR_FOUND 0x20403
253 /* The FCIO_GET_TOPOLOGY ioctl failed */
254 #define L_FCIO_GET_TOPOLOGY_FAIL 0x20404
256 /* Invalid fabric or public loop address */
257 #define L_INVALID_FABRIC_ADDRESS 0x20405
259 /* Point to Point fibre channel topology not supported */
260 #define L_PT_PT_FC_TOP_NOT_SUPPORTED 0x20406
263 * Error definitions for Tapestry SAN support.
265 /* The FCIO_DEV_LOGIN ioctl failed */
266 #define L_FCIO_DEV_LOGIN_FAIL 0x20407
268 /* The FCIO_DEV_LOGOUT ioctl failed */
269 #define L_FCIO_DEV_LOGOUT_FAIL 0x20408
271 /* Operation not supported on connected topology */
272 #define L_OPNOSUPP_ON_TOPOLOGY 0x20409
274 /* Operation not supported on the path */
275 #define L_INVALID_PATH_TYPE 0x20410
277 /* FCIO_GET_STATE ioctl failed */
278 #define L_FCIO_GET_STATE_FAIL 0x20411
280 /* input WWN not found in dev list */
281 #define L_WWN_NOT_FOUND_IN_DEV_LIST 0x20412
284 * Error definitions for
285 * g_dev_map_init related routines.
287 /* input addr invalid */
288 #define L_INVALID_MAP_DEV_ADDR 0x20430
290 /* input property invalid */
291 #define L_INVALID_MAP_DEV_PROP_NAME 0x20431
293 /* input property invalid */
294 #define L_INVALID_MAP_DEV_PROP_TYPE 0x20432
296 /* input property name invalid */
297 #define L_INVALID_MAP_DEV_PROP 0x20433
299 /* device not found */
300 #define L_NO_SUCH_DEV_FOUND 0x20434
302 /* prop not found */
303 #define L_NO_SUCH_PROP_FOUND 0x20435
305 /* invalid arg found */
306 #define L_INVALID_ARG 0x20436
309 * Error definitions
310 * for Downloading IB FW.
312 /* Invalid download file checksum */
313 #define L_DWNLD_CHKSUM_FAILED 0x20301
315 /* Unable to read download exec header */
316 #define L_DWNLD_READ_HEADER_FAIL 0x20302
318 /* Number of bytes read from download file is not correct */
319 #define L_DWNLD_READ_INCORRECT_BYTES 0x20303
321 /* Wrong text segment size */
322 #define L_DWNLD_INVALID_TEXT_SIZE 0x20304
324 /* Error reading the download file */
325 #define L_DWNLD_READ_ERROR 0x20305
327 /* Bad firmware magic found in the download file */
328 #define L_DWNLD_BAD_FRMWARE 0x20306
330 /* Timeout message for the IB to be available */
331 #define L_DWNLD_TIMED_OUT 0x20307
333 /* Error with Rec Diag page 1 */
334 #define L_REC_DIAG_PG1 0x20600
336 /* Invalid transfer Length */
337 #define L_TRANSFER_LEN 0x20601
339 /* A firmware file must be specified on the command line */
340 #define L_REQUIRE_FILE 0x20602
344 * Error definitions
345 * for System Errors
347 #define L_MALLOC_FAILED 0x30000
349 #define L_MEMCPY_FAILED 0x30001
351 /* Cannot get status for the given path */
352 #define L_LSTAT_ERROR 0x30020
354 /* Error reading the symbolic link */
355 #define L_SYMLINK_ERROR 0x30021
357 /* Could not convert std. time to hrs/min/sec */
358 #define L_LOCALTIME_ERROR 0x30022
360 /* select() system call failed to wait for specified time */
361 #define L_SELECT_ERROR 0x30023
363 /* uname() system call failed to get the system info. */
364 #define L_UNAME_FAILED 0x30024
366 /* Cannot get status for the given path */
367 #define L_FSTAT_ERROR 0x30025
369 /* Cannot get status for the given path */
370 #define L_STAT_ERROR 0x30026
372 /* di_init() failed to return snapshot of device tree */
373 #define L_DEV_SNAPSHOT_FAILED 0x30027
375 /* di_drv_first_node() failed to find a valid driver */
376 #define L_PORT_DRIVER_NOT_FOUND 0x30029
378 /* failed to find any device paths */
379 #define L_PHYS_PATH_NOT_FOUND 0x30030
381 /* No device identifier found */
382 #define L_NO_DEVID 0x30031
384 /* Driver not supported */
385 #define L_DRIVER_NOTSUPP 0x30032
387 /* di_prom_init failure */
388 #define L_PROM_INIT_FAILED 0x30033
391 * Error definitions
392 * for individual
393 * devices.
395 /* Device busy */
396 #define L_DEV_BUSY 0x40000
398 /* Disk reserved */
399 #define L_DEVICE_RESERVED 0x40001
401 /* One or more disks in enclosure are reserved */
402 #define L_DISKS_RESERVED 0x40002
404 /* Exclusive open to a device failed. May be busy */
405 #define L_EXCL_OPEN_FAILED 0x40003
407 /* Empty slot: Device not installed */
408 #define L_SLOT_EMPTY 0x40100
412 * Error definitions
413 * for Devctl functions.
415 /* Devctl acquire fails */
416 #define L_ACQUIRE_FAIL 0x40200
419 /* Power off fails. Device may be busy */
420 #define L_POWER_OFF_FAIL_BUSY 0x40300
424 * Error definitions
425 * specific to Enclosure.
427 /* Failed to change the enclosure name */
428 #define L_ENCL_NAME_CHANGE_FAIL 0x40400
430 /* Duplicate enclosure names found */
431 #define L_DUPLICATE_ENCLOSURES 0x40401
433 /* Invalid no. of dsks in SENA enclosure */
434 #define L_INVALID_NUM_DISKS_ENCL 0x40402
436 /* Path is not to a SENA ecnlosure. */
437 #define L_ENCL_INVALID_PATH 0x40403
439 /* Cannot get the box list */
440 #define L_NO_ENCL_LIST_FOUND 0x40404
444 * Error definitions
445 * specific to IB.
447 /* No element returned from the enclosure */
448 #define L_IB_NO_ELEM_FOUND 0x40500
450 /* Invalid page code found in Receive Diag. page. */
451 #define L_RD_PG_INVLD_CODE 0x40501
453 /* Reading Receive Diag. page failed: small buffer. */
454 #define L_RD_PG_MIN_BUFF 0x40502
456 /* Get status failed */
457 #define L_GET_STATUS_FAILED 0x40600
459 /* Warning define. */
460 #define L_WARNING 0x90000
462 /* Persistant Rservation: Invalid transfer length */
463 #define L_PR_INVLD_TRNSFR_LEN 0x10001
466 * Error definitions
467 * for Format Errors.
469 /* box name conflicts with the SSA name */
470 #define L_SSA_CONFLICT 0x20013
474 * Error definitions
475 * for System Errors
477 /* drvconfig fail */
478 #define L_DRVCONFIG_ERROR 0x31001
480 /* disks program failed */
481 #define L_DISKS_ERROR 0x31002
483 /* devlinks program failed */
484 #define L_DEVLINKS_ERROR 0x31003
486 /* fail to read /dev/rdsk directory. */
487 #define L_READ_DEV_DIR_ERROR 0x31004
489 /* Failed to open /dev/es/ directory. */
490 #define L_OPEN_ES_DIR_FAILED 0x31005
492 /* fail to get status from /dev/es directory. */
493 #define L_LSTAT_ES_DIR_ERROR 0x31006
495 /* disks program failed */
496 #define L_TAPES_ERROR 0x31007
498 /* fail to get status from /dev/rmt/directory. */
499 #define L_STAT_RMT_DIR_ERROR 0x31008
501 /* fail to get status from /dev/rmt/directory. */
502 #define L_STAT_DEV_DIR_ERROR 0x31009
506 * Error definitions
507 * specific to Back plane.
509 /* Backplane: Busy or reserved disks found */
510 #define L_BP_BUSY_RESERVED 0x50000
512 /* Backplane: one or more busy disks found */
513 #define L_BP_BUSY 0x50001
515 /* Backplane: one or more reserved disks found */
516 #define L_BP_RESERVED 0x50002
518 /* No BP element found in the enclosure */
519 #define L_NO_BP_ELEM_FOUND 0x50003
522 * Thread errors.
524 #define L_TH_CREATE 0x60000
525 #define L_TH_JOIN 0x60001
529 #endif /* __x86 */
532 #ifdef __cplusplus
534 #endif
536 #endif /* _ERRORCODES_H */