xref: /illumos-gate/usr/src/uts/common/sys/fibre-channel/fca/emlxs/emlxs_fcio.h (revision a9800beb32c1006bb21c8da39e0180ea440b7bad)
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 /*
23  * Copyright 2010 Emulex.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef _EMLXS_FCIO_H
28 #define	_EMLXS_FCIO_H
29 
30 #ifdef	__cplusplus
31 extern "C" {
32 #endif
33 
34 /*
35  * FCIO_REV: 1 - Initial implementation 2 - Added EMLXS_GET_FCIO_REV support
36  */
37 #define	FCIO_REV	2
38 
39 
40 /* Emulex ULP Diag Codes */
41 #define	EMLXS_DIAG			('E'<< 8)
42 
43 #define	EMLXS_DIAG_BIU			(EMLXS_DIAG | 100)
44 #define	EMLXS_DIAG_POST			(EMLXS_DIAG | 101)
45 #define	EMLXS_DIAG_ECHO			(EMLXS_DIAG | 102)
46 
47 #define	EMLXS_PARM_GET_NUM		(EMLXS_DIAG | 200)
48 #define	EMLXS_PARM_GET_LIST		(EMLXS_DIAG | 201)
49 #define	EMLXS_PARM_GET			(EMLXS_DIAG | 202)
50 #define	EMLXS_PARM_SET			(EMLXS_DIAG | 203)
51 #define	EMLXS_GET_BOOT_REV		(EMLXS_DIAG | 204)
52 #define	EMLXS_DOWNLOAD_BOOT		(EMLXS_DIAG | 205)
53 #define	EMLXS_DOWNLOAD_CFL		(EMLXS_DIAG | 206)
54 #define	EMLXS_VPD_GET   		(EMLXS_DIAG | 207)
55 #define	EMLXS_GET_FCIO_REV   		(EMLXS_DIAG | 208)
56 #define	EMLXS_SET_BOOT_STATE_old	(EMLXS_DIAG | 209)
57 #define	EMLXS_GET_BOOT_STATE_old	(EMLXS_DIAG | 210)
58 #define	EMLXS_DFC_COMMAND		(EMLXS_DIAG | 211)
59 #define	EMLXS_SET_BOOT_STATE		(EMLXS_DIAG | 212)
60 #define	EMLXS_GET_BOOT_STATE		(EMLXS_DIAG | 213)
61 #define	EMLXS_GET_DFC_REV   		(EMLXS_DIAG | 214)
62 
63 #define	EMLXS_BAR_IO			(EMLXS_DIAG | 253)
64 #define	EMLXS_TEST_CODE   		(EMLXS_DIAG | 254)
65 #define	EMLXS_HW_ERROR_TEST   		(EMLXS_DIAG | 255)
66 #define	EMLXS_MB_TIMEOUT_TEST		(EMLXS_DIAG | 256)
67 
68 #define	EMLXS_LOG_GET			(EMLXS_DIAG | 300)
69 
70 
71 /* DUMP file ids */
72 #define	EMLXS_TXT_FILE_ID			1
73 #define	EMLXS_DMP_FILE_ID			2
74 #define	EMLXS_CEE_FILE_ID			3
75 #define	EMLXS_FAT_FILE_ID			4
76 
77 
78 /* Emulex specific error codes */
79 #define	EMLXS_ERRNO_START		0x100
80 #define	EMLXS_TEST_FAILED		(EMLXS_ERRNO_START + 0)	/* Diagnostic */
81 								/* test fail */
82 #define	EMLXS_IMAGE_BAD			(EMLXS_ERRNO_START + 1)	/* Image has */
83 								/* bad data */
84 #define	EMLXS_IMAGE_INCOMPATIBLE	(EMLXS_ERRNO_START + 2)	/* Image not */
85 								/* compatible */
86 								/* with H/W */
87 #define	EMLXS_IMAGE_FAILED		(EMLXS_ERRNO_START + 3)	/* Image */
88 								/* download */
89 								/* failed */
90 #define	EMLXS_OFFLINE_FAILED		(EMLXS_ERRNO_START + 4)	/* Unable to */
91 								/* take HBA */
92 								/* offline */
93 #define	EMLXS_NO_BOOT_CODE		(EMLXS_ERRNO_START + 5)	/* No boot */
94 								/* code image */
95 #define	EMLXS_OP_NOT_SUP		(EMLXS_ERRNO_START + 6)	/* Operation */
96 								/* not supp */
97 #define	EMLXS_ERRNO_END			(EMLXS_ERRNO_START + 6)
98 
99 
100 typedef struct emlxs_parm
101 {
102 	char		label[32];
103 	uint32_t	min;
104 	uint32_t	max;
105 	uint32_t	def;
106 	uint32_t	current;
107 	uint32_t	flags;
108 	char		help[128];
109 } emlxs_parm_t;
110 
111 /* emlxs_parm_t flags */
112 #define	PARM_DYNAMIC	0x00000001	/* Reboot not required */
113 #define	PARM_BOOLEAN	0x00000002
114 #define	PARM_HEX	0x00000004
115 
116 /* PARM_DYNAMIC subtypes */
117 #define	PARM_DYNAMIC_RESET	(PARM_DYNAMIC | 0x00000010)	/* Hard reset */
118 								/* required */
119 #define	PARM_DYNAMIC_LINK	(PARM_DYNAMIC | 0x00000020)	/* Link reset */
120 								/* required */
121 
122 typedef struct emlxs_vpd_desc
123 {
124 	char	id[80];
125 	char	part_num[32];
126 	char	eng_change[32];
127 	char	manufacturer[80];
128 	char	serial_num[32];
129 	char	model[32];
130 	char	model_desc[80];
131 	char	port_num[4];
132 	char	prog_types[80];
133 } emlxs_vpd_desc_t;
134 
135 typedef struct emlxs_log_req
136 {
137 	uint32_t	first;	/* First msg id requested */
138 	uint32_t	count;	/* Maximum number of messages */
139 				/* capable of receiving */
140 				/* This value can be set to zero */
141 				/* to receive just log stats */
142 } emlxs_log_req_t;
143 
144 
145 typedef struct emlxs_log_resp
146 {
147 	uint32_t	first;	/* Actual starting msg id in resp buffer */
148 				/* This represents the first available */
149 				/* msg id >= first id requested */
150 	uint32_t	last;	/* Current last msg id in log file */
151 	uint32_t	count;	/* Total number of messages in resp buffer */
152 				/* This value will be <= the max count */
153 				/* requested */
154 
155 				/* If count > 0, then the response buffer */
156 				/* will immediately follow this structure */
157 				/* The response buffer will be an array of */
158 				/* string buffers MAX_MSG_LENGTH in size */
159 #define	MAX_LOG_MSG_LENGTH	160
160 } emlxs_log_resp_t;
161 
162 #ifdef	__cplusplus
163 }
164 #endif
165 
166 #endif	/* _EMLXS_FCIO_H */
167