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