xref: /titanic_52/usr/src/cmd/luxadm/errorcodes.h (revision 55f5292c612446ce6f93ddd248c0019b5974618b)
1 /*
2  * CDDL HEADER START
3  *
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.
7  *
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.
12  *
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]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef	_ERRORCODES_H
27 #define	_ERRORCODES_H
28 
29 
30 
31 
32 /*
33  * Include any headers you depend on.
34  */
35 
36 #ifdef	__cplusplus
37 extern "C" {
38 #endif
39 
40 
41 /* On the sparc platform, error codes come from stgcom.h */
42 #ifdef __x86
43 
44 /*
45  * All error numbers below this base value
46  * are assumed to be UNIX error codes.
47  */
48 
49 #define	L_BASE				L_SCSI_ERROR
50 
51 /*
52  * SCSI Errors
53  *
54  */
55 /* SCSI error */
56 #define	L_SCSI_ERROR			0x10000
57 
58 /* Receive Diagnostics: Transfer length is not word aligned */
59 #define	L_RD_INVLD_TRNSFR_LEN		0x11002
60 
61 /* No disk element found in Receive diag. page */
62 #define	L_RD_NO_DISK_ELEM		0x11003
63 
64 /* Illegal mode sense page length */
65 #define	L_ILLEGAL_MODE_SENSE_PAGE	0x11004
66 
67 /* Invalid number of ENV. SENSE pages */
68 #define	L_INVALID_NO_OF_ENVSEN_PAGES	0x11005
69 
70 /* Buffer is *too* small to hold more than 8 pages */
71 #define	L_INVALID_BUF_LEN		0x11006
72 
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
79 
80 
81 /*
82  * Error definitions
83  * for Format Errors.
84  */
85 #define	L_INVALID_PATH			0x20200
86 
87 /* Failed to open a given path */
88 #define	L_OPEN_PATH_FAIL		0x20001
89 
90 /* Invalid password length. */
91 #define	L_INVALID_PASSWORD_LEN		0x20002
92 
93 /* Given disk physical path is not valid. */
94 #define	L_INVLD_PHYS_PATH_TO_DISK	0x20004
95 
96 /* Invalid name id found in the physical path */
97 #define	L_INVLD_ID_FOUND		0x20005
98 
99 /* Invalid WWN format found */
100 #define	L_INVLD_WWN_FORMAT		0x20006
101 
102 /* No WWN found in the disk's physical path */
103 #define	L_NO_WWN_FOUND_IN_PATH		0x20007
104 
105 /* No Loop address found in the phys path */
106 #define	L_NO_LOOP_ADDRS_FOUND		0x20008
107 
108 /* Invalid port number found in the phys path */
109 #define	L_INVLD_PORT_IN_PATH		0x20009
110 
111 /* Invalid LED request */
112 #define	L_INVALID_LED_RQST		0x20010
113 
114 /* Invalid path format */
115 #define	L_INVALID_PATH_FORMAT		0x20011
116 
117 /* failed to get the physical path */
118 #define	L_NO_PHYS_PATH			0x20012
119 
120 /* failed to get the ses path */
121 #define	L_NO_SES_PATH			0x20015
122 
123 /* No "/" found in the physical path */
124 #define	L_INVLD_PATH_NO_SLASH_FND	0x20100
125 
126 /* No "@" found in the physical path */
127 #define	L_INVLD_PATH_NO_ATSIGN_FND	0x20101
128 
129 /* Invalid slot (slot < 0 or slot > 10). */
130 #define	L_INVALID_SLOT			0x20102
131 
132 /* No valid path to a device */
133 #define	L_NO_VALID_PATH			0x20103
134 
135 /* No disk devices found in /dev/rdsk directory */
136 #define	L_NO_DISK_DEV_FOUND		0x20104
137 
138 /* No tape devices found in /dev/rmt directory */
139 #define	L_NO_TAPE_DEV_FOUND		0x20105
140 
141 /* Device's Node WWN not found in the WWN list. */
142 #define	L_NO_NODE_WWN_IN_WWNLIST	0x20106
143 
144 /* Device's Node WWN not found in the Box list. */
145 #define	L_NO_NODE_WWN_IN_BOXLIST	0x20107
146 
147 /* Null WWN list found. */
148 #define	L_NULL_WWN_LIST			0x20108
149 
150 /* No devices found. */
151 #define	L_NO_DEVICES_FOUND		0x20109
152 
153 /* function arg error in wwn_list process */
154 #define	L_PROC_WWN_ARG_ERROR		0x20110
155 
156 /* WWN property not found */
157 #define	L_NO_WWN_PROP_FOUND		0x20111
158 
159 /* No driver nodes found for requested driver */
160 #define	L_NO_DRIVER_NODES_FOUND		0x20112
161 
162 /* ULP error on device(s) */
163 #define	L_GET_DEV_LIST_ULP_FAILURE	0x20150
164 
165 /*
166  * Error definitions
167  * for FC Loop (FC4 devices).
168  */
169 /* Invalid loop map found */
170 #define	L_INVALID_LOOP_MAP		0x20202
171 
172 /* SFIOCGMAP ioctl failed */
173 #define	L_SFIOCGMAP_IOCTL_FAIL		0x20203
174 
175 /* FCIO_GETMAP ioctl failed */
176 #define	L_FCIO_GETMAP_IOCTL_FAIL	0x20204
177 
178 /* FCIO_LINKSTATUS ioctl failed */
179 #define	L_FCIO_LINKSTATUS_FAILED	0x20205
180 
181 /* FCIO_GETMAP: Invalid # of entries */
182 #define	L_FCIOGETMAP_INVLD_LEN		0x20206
183 
184 /* FCIO_FORCE_LIP ioctl failed. */
185 #define	L_FCIO_FORCE_LIP_FAIL		0x20207
186 
187 /* Error definitions for FC devices */
188 /* FCIO_RESET_LINK ioctl failed */
189 #define	L_FCIO_RESET_LINK_FAIL		0x20208
190 
191 /* FCIO_GET_FCODE_REV_FAIL ioctl failed */
192 #define	L_FCIO_GET_FCODE_REV_FAIL	0x20209
193 
194 /* FCIO_GET_FW_REV_FAIL ioctl failed */
195 #define	L_FCIO_GET_FW_REV_FAIL		0x20210
196 
197 /* FCIO_GET_DEV_LIST returns invalid dev. counts */
198 #define	L_INVALID_DEVICE_COUNT		0x20211
199 
200 /* L_FCIO_GET_NUM_DEVS_FAIL ioctl failed */
201 #define	L_FCIO_GET_NUM_DEVS_FAIL	0x20212
202 
203 /* L_FCIO_GET_DEV_LIST_FAIL ioctl failed */
204 #define	L_FCIO_GET_DEV_LIST_FAIL	0x20213
205 
206 /* L_FCIO_GET_LINK_STATUS ioctl failed */
207 #define	L_FCIO_GET_LINK_STATUS_FAIL	0x20214
208 
209 /* L_FCIO_LOOPBACK_INTERNAL or FCIO_CMD/FCIO_LASER_OFF ioctl failed */
210 #define	L_PORT_OFFLINE_FAIL		0x20215
211 
212 /* Internal Loopback or laser off ioctls not supported */
213 #define	L_PORT_OFFLINE_UNSUPPORTED	0x20216
214 
215 /* L_FCIO_NO_LOOPBACK or FCIO_CMD/FCIO_LASER_ON ioctl failed */
216 #define	L_PORT_ONLINE_FAIL		0x20217
217 
218 /* No-Loopback or laser on ioctls not supported */
219 #define	L_PORT_ONLINE_UNSUPPORTED	0x20218
220 
221 /* L_FCIO_GET_HOST_PARAMS ioctl failed */
222 #define	L_FCIO_GET_HOST_PARAMS_FAIL	0x20219
223 
224 /* Loopback mode failure */
225 #define	L_LOOPBACK_FAILED		0x20220
226 
227 /* Loopback unsupported */
228 #define	L_LOOPBACK_UNSUPPORTED		0x20221
229 
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
232 
233 /*
234  * Error definitions
235  * for Fabric FC driver ioctls
236  */
237 /* FCP_TGT_INQUIRY ioctl failed */
238 #define	L_FCP_TGT_INQUIRY_FAIL		0x20250
239 
240 /*
241  * Error definitions
242  * for 24-bit address handling
243  */
244 /* Private loop address > 0xFF found */
245 #define	L_INVALID_PRIVATE_LOOP_ADDRESS	0x20401
246 
247 /* Encountered an unexpected fibre channel topology value */
248 #define	L_UNEXPECTED_FC_TOPOLOGY	0x20402
249 
250 /* Fabric address was not found */
251 #define	L_NO_FABRIC_ADDR_FOUND		0x20403
252 
253 /* The FCIO_GET_TOPOLOGY ioctl failed */
254 #define	L_FCIO_GET_TOPOLOGY_FAIL	0x20404
255 
256 /* Invalid fabric or public loop address */
257 #define	L_INVALID_FABRIC_ADDRESS	0x20405
258 
259 /* Point to Point fibre channel topology not supported */
260 #define	L_PT_PT_FC_TOP_NOT_SUPPORTED	0x20406
261 
262 /*
263  * Error definitions for Tapestry SAN support.
264  */
265 /* The FCIO_DEV_LOGIN ioctl failed */
266 #define	L_FCIO_DEV_LOGIN_FAIL		0x20407
267 
268 /* The FCIO_DEV_LOGOUT ioctl failed */
269 #define	L_FCIO_DEV_LOGOUT_FAIL		0x20408
270 
271 /* Operation not supported on connected topology */
272 #define	L_OPNOSUPP_ON_TOPOLOGY		0x20409
273 
274 /* Operation not supported on the path */
275 #define	L_INVALID_PATH_TYPE		0x20410
276 
277 /* FCIO_GET_STATE ioctl failed */
278 #define	L_FCIO_GET_STATE_FAIL		0x20411
279 
280 /* input WWN not found in dev list */
281 #define	L_WWN_NOT_FOUND_IN_DEV_LIST	0x20412
282 
283 /*
284  * Error definitions for
285  * g_dev_map_init related routines.
286  */
287 /* input addr invalid */
288 #define	L_INVALID_MAP_DEV_ADDR		0x20430
289 
290 /* input property invalid */
291 #define	L_INVALID_MAP_DEV_PROP_NAME	0x20431
292 
293 /* input property invalid */
294 #define	L_INVALID_MAP_DEV_PROP_TYPE	0x20432
295 
296 /* input property name invalid */
297 #define	L_INVALID_MAP_DEV_PROP		0x20433
298 
299 /* device not found */
300 #define	L_NO_SUCH_DEV_FOUND		0x20434
301 
302 /* prop not found */
303 #define	L_NO_SUCH_PROP_FOUND		0x20435
304 
305 /* invalid arg found */
306 #define	L_INVALID_ARG			0x20436
307 
308 /*
309  * Error definitions
310  * for Downloading IB FW.
311  */
312 /* Invalid download file checksum */
313 #define	L_DWNLD_CHKSUM_FAILED		0x20301
314 
315 /* Unable to read download exec header */
316 #define	L_DWNLD_READ_HEADER_FAIL	0x20302
317 
318 /* Number of bytes read from download file is not correct */
319 #define	L_DWNLD_READ_INCORRECT_BYTES	0x20303
320 
321 /* Wrong text segment size */
322 #define	L_DWNLD_INVALID_TEXT_SIZE	0x20304
323 
324 /* Error reading the download file */
325 #define	L_DWNLD_READ_ERROR		0x20305
326 
327 /* Bad firmware magic found in the download file */
328 #define	L_DWNLD_BAD_FRMWARE		0x20306
329 
330 /* Timeout message for the IB to be available */
331 #define	L_DWNLD_TIMED_OUT		0x20307
332 
333 /* Error with Rec Diag page 1 */
334 #define	L_REC_DIAG_PG1			0x20600
335 
336 /* Invalid transfer Length */
337 #define	L_TRANSFER_LEN			0x20601
338 
339 /* A firmware file must be specified on the command line */
340 #define	L_REQUIRE_FILE			0x20602
341 
342 
343 /*
344  * Error definitions
345  * for System Errors
346  */
347 #define	L_MALLOC_FAILED			0x30000
348 
349 #define	L_MEMCPY_FAILED			0x30001
350 
351 /* Cannot get status for the given path */
352 #define	L_LSTAT_ERROR			0x30020
353 
354 /* Error reading the symbolic link */
355 #define	L_SYMLINK_ERROR			0x30021
356 
357 /* Could not convert std. time to hrs/min/sec */
358 #define	L_LOCALTIME_ERROR		0x30022
359 
360 /* select() system call failed to wait for specified time */
361 #define	L_SELECT_ERROR			0x30023
362 
363 /* uname() system call failed to get the system info. */
364 #define	L_UNAME_FAILED			0x30024
365 
366 /* Cannot get status for the given path */
367 #define	L_FSTAT_ERROR			0x30025
368 
369 /* Cannot get status for the given path */
370 #define	L_STAT_ERROR			0x30026
371 
372 /* di_init() failed to return snapshot of device tree */
373 #define	L_DEV_SNAPSHOT_FAILED		0x30027
374 
375 /* di_drv_first_node() failed to find a valid driver */
376 #define	L_PORT_DRIVER_NOT_FOUND		0x30029
377 
378 /* failed to find any device paths */
379 #define	L_PHYS_PATH_NOT_FOUND		0x30030
380 
381 /* No device identifier found  */
382 #define	L_NO_DEVID			0x30031
383 
384 /* Driver not supported */
385 #define	L_DRIVER_NOTSUPP		0x30032
386 
387 /* di_prom_init failure */
388 #define	L_PROM_INIT_FAILED		0x30033
389 
390 /*
391  * Error definitions
392  * for individual
393  * devices.
394  */
395 /* Device busy */
396 #define	L_DEV_BUSY			0x40000
397 
398 /* Disk reserved */
399 #define	L_DEVICE_RESERVED		0x40001
400 
401 /* One or more disks in enclosure are reserved */
402 #define	L_DISKS_RESERVED		0x40002
403 
404 /* Exclusive open to a device failed. May be busy */
405 #define	L_EXCL_OPEN_FAILED		0x40003
406 
407 /* Empty slot: Device not installed */
408 #define	L_SLOT_EMPTY			0x40100
409 
410 
411 /*
412  * Error definitions
413  * for Devctl functions.
414  */
415 /* Devctl acquire fails */
416 #define	L_ACQUIRE_FAIL			0x40200
417 
418 
419 /* Power off fails. Device may be busy */
420 #define	L_POWER_OFF_FAIL_BUSY		0x40300
421 
422 
423 /*
424  * Error definitions
425  * specific to Enclosure.
426  */
427 /* Failed to change the enclosure name */
428 #define	L_ENCL_NAME_CHANGE_FAIL		0x40400
429 
430 /* Duplicate enclosure names found */
431 #define	L_DUPLICATE_ENCLOSURES		0x40401
432 
433 /* Invalid no. of dsks in SENA enclosure */
434 #define	L_INVALID_NUM_DISKS_ENCL	0x40402
435 
436 /* Path is not to a SENA ecnlosure. */
437 #define	L_ENCL_INVALID_PATH		0x40403
438 
439 /* Cannot get the box list */
440 #define	L_NO_ENCL_LIST_FOUND		0x40404
441 
442 
443 /*
444  * Error definitions
445  * specific to IB.
446  */
447 /* No element returned from the enclosure */
448 #define	L_IB_NO_ELEM_FOUND		0x40500
449 
450 /* Invalid page code found in Receive Diag. page.   */
451 #define	L_RD_PG_INVLD_CODE		0x40501
452 
453 /* Reading Receive Diag. page failed: small buffer. */
454 #define	L_RD_PG_MIN_BUFF		0x40502
455 
456 /* Get status failed    */
457 #define	L_GET_STATUS_FAILED		0x40600
458 
459 /* Warning define. */
460 #define	L_WARNING			0x90000
461 
462 /* Persistant Rservation: Invalid transfer length */
463 #define	L_PR_INVLD_TRNSFR_LEN		0x10001
464 
465 /*
466  * Error definitions
467  * for Format Errors.
468  */
469 /* box name conflicts with the SSA name */
470 #define	L_SSA_CONFLICT			0x20013
471 
472 
473 /*
474  * Error definitions
475  * for System Errors
476  */
477 /* drvconfig fail */
478 #define	L_DRVCONFIG_ERROR		0x31001
479 
480 /* disks program failed */
481 #define	L_DISKS_ERROR			0x31002
482 
483 /* devlinks program failed */
484 #define	L_DEVLINKS_ERROR		0x31003
485 
486 /* fail to read /dev/rdsk directory. */
487 #define	L_READ_DEV_DIR_ERROR		0x31004
488 
489 /* Failed to open /dev/es/ directory. */
490 #define	L_OPEN_ES_DIR_FAILED		0x31005
491 
492 /* fail to get status from /dev/es directory. */
493 #define	L_LSTAT_ES_DIR_ERROR		0x31006
494 
495 /* disks program failed */
496 #define	L_TAPES_ERROR			0x31007
497 
498 /* fail to get status from /dev/rmt/directory. */
499 #define	L_STAT_RMT_DIR_ERROR		0x31008
500 
501 /* fail to get status from /dev/rmt/directory. */
502 #define	L_STAT_DEV_DIR_ERROR		0x31009
503 
504 
505 /*
506  * Error definitions
507  * specific to Back plane.
508  */
509 /* Backplane: Busy or reserved disks found */
510 #define	L_BP_BUSY_RESERVED		0x50000
511 
512 /* Backplane: one or more busy disks found */
513 #define	L_BP_BUSY			0x50001
514 
515 /* Backplane: one or more reserved disks found */
516 #define	L_BP_RESERVED			0x50002
517 
518 /* No BP element found in the enclosure */
519 #define	L_NO_BP_ELEM_FOUND		0x50003
520 
521 /*
522  * Thread errors.
523  */
524 #define	L_TH_CREATE			0x60000
525 #define	L_TH_JOIN			0x60001
526 
527 
528 
529 #endif /* __x86 */
530 
531 
532 #ifdef	__cplusplus
533 }
534 #endif
535 
536 #endif	/* _ERRORCODES_H */
537