xref: /illumos-gate/usr/src/uts/common/sys/fibre-channel/fca/emlxs/emlxs_fcio.h (revision fe199829b492e6b3aa36dd76af597360bb4af121)
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 2009 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 
67 #define	EMLXS_LOG_GET			(EMLXS_DIAG | 300)
68 
69 
70 /* DUMP file ids */
71 #define	EMLXS_TXT_FILE_ID			1
72 #define	EMLXS_DMP_FILE_ID			2
73 #define	EMLXS_CEE_FILE_ID			3
74 #define	EMLXS_FAT_FILE_ID			4
75 
76 
77 /* Emulex specific error codes */
78 #define	EMLXS_ERRNO_START		0x100
79 #define	EMLXS_TEST_FAILED		(EMLXS_ERRNO_START + 0)	/* Diagnostic */
80 								/* test fail */
81 #define	EMLXS_IMAGE_BAD			(EMLXS_ERRNO_START + 1)	/* Image has */
82 								/* bad data */
83 #define	EMLXS_IMAGE_INCOMPATIBLE	(EMLXS_ERRNO_START + 2)	/* Image not */
84 								/* compatible */
85 								/* with H/W */
86 #define	EMLXS_IMAGE_FAILED		(EMLXS_ERRNO_START + 3)	/* Image */
87 								/* download */
88 								/* failed */
89 #define	EMLXS_OFFLINE_FAILED		(EMLXS_ERRNO_START + 4)	/* Unable to */
90 								/* take HBA */
91 								/* offline */
92 #define	EMLXS_NO_BOOT_CODE		(EMLXS_ERRNO_START + 5)	/* No boot */
93 								/* code image */
94 #define	EMLXS_OP_NOT_SUP		(EMLXS_ERRNO_START + 6)	/* Operation */
95 								/* not supp */
96 #define	EMLXS_ERRNO_END			(EMLXS_ERRNO_START + 6)
97 
98 
99 typedef struct emlxs_parm
100 {
101 	char		label[32];
102 	uint32_t	min;
103 	uint32_t	max;
104 	uint32_t	def;
105 	uint32_t	current;
106 	uint32_t	flags;
107 	char		help[128];
108 } emlxs_parm_t;
109 
110 /* emlxs_parm_t flags */
111 #define	PARM_DYNAMIC	0x00000001	/* Reboot not required */
112 #define	PARM_BOOLEAN	0x00000002
113 #define	PARM_HEX	0x00000004
114 
115 /* PARM_DYNAMIC subtypes */
116 #define	PARM_DYNAMIC_RESET	(PARM_DYNAMIC | 0x00000010)	/* Hard reset */
117 								/* required */
118 #define	PARM_DYNAMIC_LINK	(PARM_DYNAMIC | 0x00000020)	/* Link reset */
119 								/* required */
120 
121 typedef struct emlxs_vpd_desc
122 {
123 	char	id[80];
124 	char	part_num[32];
125 	char	eng_change[32];
126 	char	manufacturer[80];
127 	char	serial_num[32];
128 	char	model[32];
129 	char	model_desc[80];
130 	char	port_num[4];
131 	char	prog_types[80];
132 } emlxs_vpd_desc_t;
133 
134 typedef struct emlxs_log_req
135 {
136 	uint32_t	first;	/* First msg id requested */
137 	uint32_t	count;	/* Maximum number of messages */
138 				/* capable of receiving */
139 				/* This value can be set to zero */
140 				/* to receive just log stats */
141 } emlxs_log_req_t;
142 
143 
144 typedef struct emlxs_log_resp
145 {
146 	uint32_t	first;	/* Actual starting msg id in resp buffer */
147 				/* This represents the first available */
148 				/* msg id >= first id requested */
149 	uint32_t	last;	/* Current last msg id in log file */
150 	uint32_t	count;	/* Total number of messages in resp buffer */
151 				/* This value will be <= the max count */
152 				/* requested */
153 
154 				/* If count > 0, then the response buffer */
155 				/* will immediately follow this structure */
156 				/* The response buffer will be an array of */
157 				/* string buffers MAX_MSG_LENGTH in size */
158 #define	MAX_LOG_MSG_LENGTH	160
159 } emlxs_log_resp_t;
160 
161 #ifdef	__cplusplus
162 }
163 #endif
164 
165 #endif	/* _EMLXS_FCIO_H */
166