1291a2b48SSukumar Swaminathan /*
2291a2b48SSukumar Swaminathan  * CDDL HEADER START
3291a2b48SSukumar Swaminathan  *
4291a2b48SSukumar Swaminathan  * The contents of this file are subject to the terms of the
5291a2b48SSukumar Swaminathan  * Common Development and Distribution License (the "License").
6291a2b48SSukumar Swaminathan  * You may not use this file except in compliance with the License.
7291a2b48SSukumar Swaminathan  *
8*8f23e9faSHans Rosenfeld  * You can obtain a copy of the license at
9*8f23e9faSHans Rosenfeld  * http://www.opensource.org/licenses/cddl1.txt.
10291a2b48SSukumar Swaminathan  * See the License for the specific language governing permissions
11291a2b48SSukumar Swaminathan  * and limitations under the License.
12291a2b48SSukumar Swaminathan  *
13291a2b48SSukumar Swaminathan  * When distributing Covered Code, include this CDDL HEADER in each
14291a2b48SSukumar Swaminathan  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15291a2b48SSukumar Swaminathan  * If applicable, add the following below this CDDL HEADER, with the
16291a2b48SSukumar Swaminathan  * fields enclosed by brackets "[]" replaced with your own identifying
17291a2b48SSukumar Swaminathan  * information: Portions Copyright [yyyy] [name of copyright owner]
18291a2b48SSukumar Swaminathan  *
19291a2b48SSukumar Swaminathan  * CDDL HEADER END
20291a2b48SSukumar Swaminathan  */
21291a2b48SSukumar Swaminathan 
22291a2b48SSukumar Swaminathan /*
23*8f23e9faSHans Rosenfeld  * Copyright (c) 2004-2011 Emulex. All rights reserved.
2482527734SSukumar Swaminathan  * Use is subject to license terms.
25291a2b48SSukumar Swaminathan  */
26291a2b48SSukumar Swaminathan 
27291a2b48SSukumar Swaminathan #ifndef _EMLXS_DUMP_H
28291a2b48SSukumar Swaminathan #define	_EMLXS_DUMP_H
29291a2b48SSukumar Swaminathan 
30291a2b48SSukumar Swaminathan #ifdef	__cplusplus
31291a2b48SSukumar Swaminathan extern "C" {
32291a2b48SSukumar Swaminathan #endif
33291a2b48SSukumar Swaminathan 
34291a2b48SSukumar Swaminathan typedef struct emlxs_file
35291a2b48SSukumar Swaminathan {
36291a2b48SSukumar Swaminathan 	uint8_t *buffer;
37291a2b48SSukumar Swaminathan 	uint8_t *ptr;
38291a2b48SSukumar Swaminathan 	uint32_t size;
39291a2b48SSukumar Swaminathan 
40291a2b48SSukumar Swaminathan } emlxs_file_t;
41291a2b48SSukumar Swaminathan 
42291a2b48SSukumar Swaminathan typedef struct dump_temp_event
43291a2b48SSukumar Swaminathan {
44291a2b48SSukumar Swaminathan 	struct emlxs_hba *hba;
45291a2b48SSukumar Swaminathan 	uint32_t type;
46291a2b48SSukumar Swaminathan 	uint32_t temp;
47291a2b48SSukumar Swaminathan 
48291a2b48SSukumar Swaminathan } dump_temp_event_t;
49291a2b48SSukumar Swaminathan 
50291a2b48SSukumar Swaminathan #define	EMLXS_TXT_FILE_SIZE	(1024*1024)
5182527734SSukumar Swaminathan #define	EMLXS_DMP_FILE_SIZE	((8*1024*1024)+0x100)
5282527734SSukumar Swaminathan /* #define	EMLXS_DMP_FILE_SIZE	(4*1024*1024) */
53291a2b48SSukumar Swaminathan #define	EMLXS_CEE_FILE_SIZE	(1024*1024)
54291a2b48SSukumar Swaminathan 
55291a2b48SSukumar Swaminathan /* Maximum BC for DUMP w/o MBX Extension */
56291a2b48SSukumar Swaminathan #define	DUMP_BC_MAX		(0x18 * 4)
57291a2b48SSukumar Swaminathan 
58291a2b48SSukumar Swaminathan /* Conditional Compile Symbols */
59291a2b48SSukumar Swaminathan 
60291a2b48SSukumar Swaminathan #define	CC_DUMP_FW_BUG_1	1	/* 1 = workaround for FW Bug */
61291a2b48SSukumar Swaminathan #define	CC_DUMP_ENABLE_PAD	1	/* 1 = enable DMP File Padding */
62291a2b48SSukumar Swaminathan 
63291a2b48SSukumar Swaminathan /* The following define controls whether the Dump Routines, */
64291a2b48SSukumar Swaminathan /* in the Port Memory Dump, */
65291a2b48SSukumar Swaminathan /* use all (potentially up to 3) Dump Tables, or only Dump Table #1. */
66291a2b48SSukumar Swaminathan /* This is a diagnostic feature only, and is not compiled in releases. */
67291a2b48SSukumar Swaminathan /* If enabled, this feature provides a way to test all the FW Dump Tables, */
68291a2b48SSukumar Swaminathan /* a debugging courtesy to the FW group. */
69291a2b48SSukumar Swaminathan 
70291a2b48SSukumar Swaminathan /* 1 = all Dump Tables; 0 = Table 1 Only */
71291a2b48SSukumar Swaminathan #define	CC_DUMP_USE_ALL_TABLES	1
72291a2b48SSukumar Swaminathan 
73291a2b48SSukumar Swaminathan /* Dump Type: loaded into gDumpType; controls */
74291a2b48SSukumar Swaminathan /* operation of many dump functions */
75291a2b48SSukumar Swaminathan #define	DUMP_TYPE_USER		0	/* User-Initiated Dump */
76291a2b48SSukumar Swaminathan #define	DUMP_TYPE_DRIVER	1	/* Normal Driver-Initiated Dump */
77291a2b48SSukumar Swaminathan #define	DUMP_TYPE_TEMP		2	/* Driver-Initiated Temp Event Dump */
78291a2b48SSukumar Swaminathan 
79291a2b48SSukumar Swaminathan /* Dump Temperature  tempType Event codes (from DFC) */
80291a2b48SSukumar Swaminathan #define	TEMP_TYPE_CRITICAL	1
81291a2b48SSukumar Swaminathan #define	TEMP_TYPE_THRESHOLD	2
82291a2b48SSukumar Swaminathan #define	TEMP_TYPE_NORMAL	3
83291a2b48SSukumar Swaminathan 
84291a2b48SSukumar Swaminathan /* Misc Defines */
85291a2b48SSukumar Swaminathan 
86291a2b48SSukumar Swaminathan #define	DUMP_SEMAPHORE_RETRY	200	/* times to retry acquiring sema */
87291a2b48SSukumar Swaminathan 
88291a2b48SSukumar Swaminathan #define	DUMP_RETENTION_CNT_DEF	10	/* files to retain before purging */
89291a2b48SSukumar Swaminathan #define	DUMP_RETENTION_CNT_MAX	500	/* (Linux KW ID 122) */
90291a2b48SSukumar Swaminathan 
91291a2b48SSukumar Swaminathan #define	DUMP_TXT_FILE		0
92291a2b48SSukumar Swaminathan #define	DUMP_DMP_FILE		1
93291a2b48SSukumar Swaminathan #define	DUMP_CEE_FILE		2
94291a2b48SSukumar Swaminathan 
95291a2b48SSukumar Swaminathan /* Driver Name Strings */
96291a2b48SSukumar Swaminathan #define	DUMP_DRV_UNK		"Unknown"
97*8f23e9faSHans Rosenfeld #define	DUMP_DRV_LEADVILLE	"Solaris " DRIVER_NAME
98291a2b48SSukumar Swaminathan 
99291a2b48SSukumar Swaminathan /* SIDs (Dump File Segment Identifiers) */
100291a2b48SSukumar Swaminathan 
101291a2b48SSukumar Swaminathan /* SID Control Bits */
102291a2b48SSukumar Swaminathan #define	SID_MULT_ELEM		0x20	/* indicates structures, not bytes */
103291a2b48SSukumar Swaminathan 
104291a2b48SSukumar Swaminathan /* This set of SIDs is defined in "LightPulse Dump Facility Design Guide" */
105291a2b48SSukumar Swaminathan #define	SID_NULL		0x00	/* Null SID */
106291a2b48SSukumar Swaminathan #define	SID_ID01		0x01	/* Dump Table Identification */
107291a2b48SSukumar Swaminathan #define	SID_ID02		0x02	/* Dump Table Identification */
108291a2b48SSukumar Swaminathan #define	SID_ID03		0x03	/* Dump Table Identification */
109291a2b48SSukumar Swaminathan #define	SID_TERM		0x04	/* Dump Table Termination */
110291a2b48SSukumar Swaminathan #define	SID_SLIM		0x05	/* SLIM */
111291a2b48SSukumar Swaminathan #define	SID_05			0x06	/* reserved */
112291a2b48SSukumar Swaminathan #define	SID_PCI_CONFIG		0x07	/* PCI Cfg Registers (Direct) */
113291a2b48SSukumar Swaminathan #define	SID_SLI_REGS		0x08	/* SLI Registers (Direct) */
114291a2b48SSukumar Swaminathan #define	SID_29			0x29	/* reserved */
115291a2b48SSukumar Swaminathan #define	SID_PCI_CONFIG_I	0x47	/* PCI Cfg Registers (Indirect) */
116291a2b48SSukumar Swaminathan #define	SID_SLI_I		0x48	/* SLI Registers (Indirect) */
117291a2b48SSukumar Swaminathan #define	SID_DUMP_ID_LE		0x80	/* Dump Id, Little-endian system. */
118291a2b48SSukumar Swaminathan #define	SID_DUMP_ID_BE		0x81	/* Dump Id, Big-endian system. */
119291a2b48SSukumar Swaminathan #define	SID_DUMP_TERM		0x82	/* Dump Termination. Last byte */
120291a2b48SSukumar Swaminathan #define	SID_LEGEND		0x83	/* Legend */
121291a2b48SSukumar Swaminathan #define	SID_PCB			0x84	/* PCB */
122291a2b48SSukumar Swaminathan #define	SID_MBX			0x86	/* Mailbox */
123291a2b48SSukumar Swaminathan #define	SID_HOST_PTRS		0x87	/* Host Put/Get Pointer Array */
124291a2b48SSukumar Swaminathan #define	SID_PORT_PTRS		0x88	/* Port Get/Put Pointer Array */
125291a2b48SSukumar Swaminathan #define	SID_RINGS		0xA9	/* Command/Response Rings */
126291a2b48SSukumar Swaminathan #define	SID_PCB_A		0xC4	/* PCB */
127291a2b48SSukumar Swaminathan #define	SID_MBX_A		0xC6	/* Mailbox */
128291a2b48SSukumar Swaminathan #define	SID_HOST_PTRS_A		0xC7	/* Host Put/Get Pointer Array */
129291a2b48SSukumar Swaminathan #define	SID_PORT_PTRS_A		0xC8	/* Port Get/Put Pointer Array */
130291a2b48SSukumar Swaminathan #define	SID_BUFFER_LISTS	0xCA	/* Buffer Lists */
131291a2b48SSukumar Swaminathan #define	SID_RINGS_A		0xE9	/* Command/Response Rings */
132291a2b48SSukumar Swaminathan #define	SID_BUFFER_LISTS_A	0xEA	/* Buffer Lists */
133291a2b48SSukumar Swaminathan 
134291a2b48SSukumar Swaminathan /* This set of SIDs is defined in "HBAnyware v2.3 */
135291a2b48SSukumar Swaminathan /* Dump Feature Design Specification" */
136291a2b48SSukumar Swaminathan 
137291a2b48SSukumar Swaminathan #define	SID_HBA_MEM_DUMP	0x11	/* HBA Memory Dump */
138291a2b48SSukumar Swaminathan #define	SID_REV_INFO		0x90	/* Revision Information */
139291a2b48SSukumar Swaminathan #define	SID_HBA_INFO		0x91	/* HBA Information */
140291a2b48SSukumar Swaminathan #define	SID_DP_TABLE		0x92	/* Driver Parm Table */
141291a2b48SSukumar Swaminathan #define	SID_DP_UNIX		0x93	/* Driver Parm, config (Unix) */
142291a2b48SSukumar Swaminathan #define	SID_DP_WINDOWS		0x94	/* Driver Parm, Reg Entries (Win) */
143291a2b48SSukumar Swaminathan #define	SID_INTERNAL_MP		0x95	/* Driver-specific Intrnl, Miniport */
144291a2b48SSukumar Swaminathan #define	SID_INTERNAL_SP		0x96	/* Driver-specific Intrnl, Storport */
145291a2b48SSukumar Swaminathan #define	SID_INTERNAL_SOL	0x97	/* Driver-specific Intrnl, Solaris */
146291a2b48SSukumar Swaminathan #define	SID_INTERNAL_L7X	0x98	/* Driver-specific Intrnl, Lnx 7x */
147291a2b48SSukumar Swaminathan #define	SID_INTERNAL_L8X	0x99	/* Driver-specific Intrnl, Lnx 8x */
148291a2b48SSukumar Swaminathan #define	SID_CONFIG_REGION	0x9A	/* Config Region Data */
14982527734SSukumar Swaminathan #define	SID_NON_VOLATILE_LOG	0x9B	/* NV Log (Enterprise only) */
150291a2b48SSukumar Swaminathan 
151291a2b48SSukumar Swaminathan /* Legend Strings */
152291a2b48SSukumar Swaminathan 
153291a2b48SSukumar Swaminathan #define	LEGEND_CONFIG_REGION		"Config Region Data"
154291a2b48SSukumar Swaminathan #define	LEGEND_HBA_MEM_DUMP		"HBA Memory Dump"
155291a2b48SSukumar Swaminathan #define	LEGEND_REV_INFO			"Revision Information"
156291a2b48SSukumar Swaminathan #define	LEGEND_HBA_INFO			"HBA Information"
157291a2b48SSukumar Swaminathan #define	LEGEND_DP_TABLE			"Driver Parameters: Table"
158291a2b48SSukumar Swaminathan #define	LEGEND_DP_UNIX		"Driver Parameters: Config File Entries"
159291a2b48SSukumar Swaminathan #define	LEGEND_DP_WINDOWS	"Driver Parameters: Registry Entries"
160291a2b48SSukumar Swaminathan #define	LEGEND_INTERNAL_MP	"Driver-specific Internal Structures, Miniport"
161291a2b48SSukumar Swaminathan #define	LEGEND_INTERNAL_SP	"Driver-specific Internal Structures, Storport"
162291a2b48SSukumar Swaminathan #define	LEGEND_INTERNAL_SOL	"Driver-specific Internal Structures, Solaris"
163291a2b48SSukumar Swaminathan #define	LEGEND_INTERNAL_L7X	"Driver-specific Internal Structures, Linux 7x"
164291a2b48SSukumar Swaminathan #define	LEGEND_INTERNAL_L8X	"Driver-specific Internal Structures, Linux 8x"
165291a2b48SSukumar Swaminathan #define	LEGEND_SLI_STRUCTURES		"SLI Interface Structures"
166291a2b48SSukumar Swaminathan #define	LEGEND_MENLO_LOG_CONFIG		"Converged Enhanced Ethernet (CEE) Log"
167291a2b48SSukumar Swaminathan #define	LEGEND_MENLO_LOG_PANIC_REGS	"\n\nPanic Log Registers\n"
168291a2b48SSukumar Swaminathan #define	LEGEND_MENLO_LOG_PANIC_LOGS	"\n\nPanic Log Entries\n"
16982527734SSukumar Swaminathan #define	LEGEND_NON_VOLATILE_LOG		"Non-Volatile Log Data"
170291a2b48SSukumar Swaminathan 
171291a2b48SSukumar Swaminathan /* Sub-Legends associated with SID_HBA_MEM_DUMP // HBA Memory Dump */
172291a2b48SSukumar Swaminathan #define	LEGEND_HBA_MEM_DUMP_TABLE	"Dump Table"
173291a2b48SSukumar Swaminathan #define	LEGEND_HBA_MEM_DUMP_REGION	"Dump Region"
174291a2b48SSukumar Swaminathan 
175291a2b48SSukumar Swaminathan /* Sub-Legends associated with SID_REV_INFO // Revision Information */
176291a2b48SSukumar Swaminathan #define	LEGEND_REV_OS_VERSION		"OS Version"
177291a2b48SSukumar Swaminathan #define	LEGEND_REV_DRV_VERSION		"Driver Version"
178291a2b48SSukumar Swaminathan #define	LEGEND_REV_UTIL_VERSION		"HBAnyware Version"
179291a2b48SSukumar Swaminathan #define	LEGEND_REV_DFCLIB_VERSION	"DFC Lib Version"
180291a2b48SSukumar Swaminathan 
181291a2b48SSukumar Swaminathan /* Sub-Legends associated with SID_HBA_INFO // Adapter Information */
182291a2b48SSukumar Swaminathan #define	LEGEND_HBA_MODEL		"Adapter Model"
183291a2b48SSukumar Swaminathan #define	LEGEND_HBA_WWN			"Adapter WWN"
184291a2b48SSukumar Swaminathan #define	LEGEND_HBA_SN			"Adapter Serial Number"
185291a2b48SSukumar Swaminathan #define	LEGEND_HBA_FW_VERSION		"Firmware Version"
186291a2b48SSukumar Swaminathan #define	LEGEND_HBA_FW_OPVERSION		"Operational FW Version"
187291a2b48SSukumar Swaminathan #define	LEGEND_HBA_FW_SLI1VERSION	"SLI-1 FW Version"
188291a2b48SSukumar Swaminathan #define	LEGEND_HBA_FW_SLI2VERSION	"SLI-2 FW Version"
189291a2b48SSukumar Swaminathan #define	LEGEND_HBA_FW_SLI3VERSION	"SLI-3 FW Version"
190291a2b48SSukumar Swaminathan #define	LEGEND_HBA_FW_KERNELVERSION	"Kernel FW Version"
191291a2b48SSukumar Swaminathan #define	LEGEND_HBA_BB_STATE		"Boot Bios State"
192291a2b48SSukumar Swaminathan #define	LEGEND_HBA_BB_VERSION		"Boot Bios Version"
193291a2b48SSukumar Swaminathan #define	LEGEND_HBA_LMSD_A0		"Link Module Serial Data: Page A0"
194291a2b48SSukumar Swaminathan #define	LEGEND_HBA_LMSD_A2		"Link Module Serial Data: Page A2"
195291a2b48SSukumar Swaminathan 
196291a2b48SSukumar Swaminathan /* Sub-Legends associated with SID_CONFIG_REGION // Configuration Region */
197291a2b48SSukumar Swaminathan #define	LEGEND_CONFIG_REGION_0	"Config Region 0: Non-volatile Params"
198291a2b48SSukumar Swaminathan #define	LEGEND_CONFIG_REGION_1	"Config Region 1: reserved"
199291a2b48SSukumar Swaminathan #define	LEGEND_CONFIG_REGION_2	"Config Region 2: reserved"
200291a2b48SSukumar Swaminathan #define	LEGEND_CONFIG_REGION_3	"Config Region 3: reserved"
201291a2b48SSukumar Swaminathan #define	LEGEND_CONFIG_REGION_4	"Config Region 4: Wake-up Params"
202291a2b48SSukumar Swaminathan #define	LEGEND_CONFIG_REGION_5	"Config Region 5: PCI Config, Default"
203291a2b48SSukumar Swaminathan #define	LEGEND_CONFIG_REGION_6	"Config Region 6: PCI Config, Alternate 1"
204291a2b48SSukumar Swaminathan #define	LEGEND_CONFIG_REGION_7	"Config Region 7: PCI Config, Alternate 2"
205291a2b48SSukumar Swaminathan #define	LEGEND_CONFIG_REGION_8	"Config Region 8: Boot Params, x86, Basic"
206291a2b48SSukumar Swaminathan #define	LEGEND_CONFIG_REGION_9	"Config Region 9: Boot Params, x86, Extended"
207291a2b48SSukumar Swaminathan #define	LEGEND_CONFIG_REGION_10	"Config Region 10: Boot Params, EFI"
208291a2b48SSukumar Swaminathan #define	LEGEND_CONFIG_REGION_11	"Config Region 11: reserved"
209291a2b48SSukumar Swaminathan #define	LEGEND_CONFIG_REGION_12	"Config Region 12: reserved"
210291a2b48SSukumar Swaminathan #define	LEGEND_CONFIG_REGION_13	"Config Region 13: reserved"
211291a2b48SSukumar Swaminathan #define	LEGEND_CONFIG_REGION_14	"Config Region 14: VPD"
212291a2b48SSukumar Swaminathan #define	LEGEND_CONFIG_REGION_15	"Config Region 15: Diagnostic Trace"
213291a2b48SSukumar Swaminathan #define	LEGEND_CONFIG_REGION_16	"Config Region 16: reserved"
214291a2b48SSukumar Swaminathan #define	LEGEND_CONFIG_REGION_17	\
215291a2b48SSukumar Swaminathan 	"Config Region 17: Physical Environment NV Params"
216291a2b48SSukumar Swaminathan #define	LEGEND_CONFIG_REGION_18	"Config Region 18: reserved"
217291a2b48SSukumar Swaminathan #define	LEGEND_CONFIG_REGION_19	"Config Region 19: reserved"
218291a2b48SSukumar Swaminathan #define	LEGEND_CONFIG_REGION_20	"Config Region 20: reserved"
219291a2b48SSukumar Swaminathan #define	LEGEND_CONFIG_REGION_21	"Config Region 21: Saved Wakeup Params"
220291a2b48SSukumar Swaminathan #define	LEGEND_CONFIG_REGION_22	"Config Region 22: reserved"
221291a2b48SSukumar Swaminathan #define	LEGEND_CONFIG_REGION_23	"Config Region 23: reserved"
222291a2b48SSukumar Swaminathan #define	LEGEND_CONFIG_REGION_24	"Config Region 24: reserved"
223291a2b48SSukumar Swaminathan #define	LEGEND_CONFIG_REGION_25	"Config Region 25: reserved"
224291a2b48SSukumar Swaminathan #define	LEGEND_CONFIG_REGION_26	"Config Region 26: reserved"
225291a2b48SSukumar Swaminathan #define	LEGEND_CONFIG_REGION_27	"Config Region 27: reserved"
226291a2b48SSukumar Swaminathan #define	LEGEND_CONFIG_REGION_28	"Config Region 28: reserved"
227291a2b48SSukumar Swaminathan #define	LEGEND_CONFIG_REGION_29	"Config Region 29: reserved"
228291a2b48SSukumar Swaminathan #define	LEGEND_CONFIG_REGION_30	"Config Region 30: reserved"
229291a2b48SSukumar Swaminathan #define	LEGEND_CONFIG_REGION_31	"Config Region 31: reserved"
230291a2b48SSukumar Swaminathan #define	LEGEND_CONFIG_REGION_32	"Config Region 32: IEEE Address"
231291a2b48SSukumar Swaminathan 
232291a2b48SSukumar Swaminathan /* Additional Sub-Legends for Region 4 */
233291a2b48SSukumar Swaminathan #define	LEGEND_CR4_INITIAL_LOAD		"Initial Load"
234291a2b48SSukumar Swaminathan #define	LEGEND_CR4_FLAGS		"Flags       "
235291a2b48SSukumar Swaminathan #define	LEGEND_CR4_BOOT_BIOS_ID		"Boot Bios ID"
236291a2b48SSukumar Swaminathan #define	LEGEND_CR4_SLI1_ID		"SLI-1 ID    "
237291a2b48SSukumar Swaminathan #define	LEGEND_CR4_SLI2_ID		"SLI-2 ID    "
238291a2b48SSukumar Swaminathan #define	LEGEND_CR4_SLI3_ID		"SLI-3 ID    "
239291a2b48SSukumar Swaminathan #define	LEGEND_CR4_SLI4_ID		"SLI-4 ID    "
240291a2b48SSukumar Swaminathan #define	LEGEND_CR4_EROM_ID		"E-Rom ID    "
241291a2b48SSukumar Swaminathan 
242291a2b48SSukumar Swaminathan /* Sub-Legends associated with SLI Interface Structures */
243291a2b48SSukumar Swaminathan #define	LEGEND_SLI_REGS		"SLI Registers"
244291a2b48SSukumar Swaminathan #define	LEGEND_SLIM		"SLIM"
245291a2b48SSukumar Swaminathan #define	LEGEND_PCB		"PCB"
246291a2b48SSukumar Swaminathan #define	LEGEND_MBX		"Mailbox"
247291a2b48SSukumar Swaminathan #define	LEGEND_HOST_PTRS	"Host Pointers"
248291a2b48SSukumar Swaminathan #define	LEGEND_PORT_PTRS	"Port Pointers"
249291a2b48SSukumar Swaminathan #define	LEGEND_RINGS		"Cmd/Rsp Rings"
250291a2b48SSukumar Swaminathan #define	LEGEND_DRIVER_SPEC	"Driver-Specific Internal Structures"
251291a2b48SSukumar Swaminathan 
25282527734SSukumar Swaminathan /* Misc Legend Data */
253291a2b48SSukumar Swaminathan #define	LEGEND_NULL	""
254291a2b48SSukumar Swaminathan #define	LEGEND_NV_LOG_DRIVER_NOT_SUPPORTED \
255291a2b48SSukumar Swaminathan 	"NV Log not supported by the driver"
256291a2b48SSukumar Swaminathan #define	LEGEND_NV_LOG_STATUS_ERROR \
257291a2b48SSukumar Swaminathan 	"Error in getting NV Log status"
258291a2b48SSukumar Swaminathan #define	LEGEND_NV_LOG_ERROR \
259291a2b48SSukumar Swaminathan 	"Error in getting NV Log"
260291a2b48SSukumar Swaminathan 
26182527734SSukumar Swaminathan #define	NV_LOG_NOT_INCLUDED_IN_DMP \
26282527734SSukumar Swaminathan 	"Non-Volatile Log Dump is not included in the DMP file"
26382527734SSukumar Swaminathan #define	NV_LOG_INCLUDED_IN_DMP \
26482527734SSukumar Swaminathan 	"Non-Volatile Log Dump is included in the DMP file"
26582527734SSukumar Swaminathan 
26682527734SSukumar Swaminathan #define	NV_LOG_NOT_INCLUDED_IN_FAT \
26782527734SSukumar Swaminathan 	"Non-Volatile Log Dump is not included in the FAT file"
26882527734SSukumar Swaminathan #define	NV_LOG_INCLUDED_IN_FAT \
26982527734SSukumar Swaminathan 	"Non-Volatile Log Dump is included in the FAT file"
27082527734SSukumar Swaminathan 
271291a2b48SSukumar Swaminathan /* Dump Regions Definitions */
272291a2b48SSukumar Swaminathan #define	DR_SLI_REGS	0x0000
273291a2b48SSukumar Swaminathan #define	DR_SLIM		0x0001
274291a2b48SSukumar Swaminathan #define	DR_PCB		0x0002
275291a2b48SSukumar Swaminathan #define	DR_MBX		0x0003
276291a2b48SSukumar Swaminathan #define	DR_HOST_PTRS	0x0004
277291a2b48SSukumar Swaminathan #define	DR_PORT_PTRS	0x0005
278291a2b48SSukumar Swaminathan #define	DR_RINGS	0x0006
279291a2b48SSukumar Swaminathan #define	DR_INTERNAL	0x0007
280291a2b48SSukumar Swaminathan 
281291a2b48SSukumar Swaminathan /* DFC_GetDriverDumpRegions Status */
282291a2b48SSukumar Swaminathan #define	GDDR_ST_SUCCESS		0
283291a2b48SSukumar Swaminathan #define	GDDR_ST_ERROR		1	/* General Error */
284291a2b48SSukumar Swaminathan #define	GDDR_ST_BAD_ID		2	/* Bad Region Identifier */
285291a2b48SSukumar Swaminathan #define	GDDR_ST_BUF_OVERFLOW	3	/* Buffer Overflow */
286291a2b48SSukumar Swaminathan #define	GDDR_ST_ID_NA		4	/* Region Identifier Not Applicable */
287291a2b48SSukumar Swaminathan 
288291a2b48SSukumar Swaminathan /* Max size supported by dump Config Region routines */
289291a2b48SSukumar Swaminathan #define	DUMP_MAX_CONFIG_REGION_LENGTH   1000
290291a2b48SSukumar Swaminathan 
291291a2b48SSukumar Swaminathan 
292291a2b48SSukumar Swaminathan /* This is a simplified form of the wakeup params structure, */
293291a2b48SSukumar Swaminathan /* w/o all the bit fields, */
294291a2b48SSukumar Swaminathan /* for ease of displaying in the Dump File. */
295291a2b48SSukumar Swaminathan typedef struct _DUMP_WAKE_UP_PARAMS
296291a2b48SSukumar Swaminathan {
297291a2b48SSukumar Swaminathan 	uint32_t InitialId[2];
298291a2b48SSukumar Swaminathan 	uint32_t Flags;
299291a2b48SSukumar Swaminathan 	uint32_t BootBiosId[2];
300291a2b48SSukumar Swaminathan 	uint32_t Sli1Id[2];
301291a2b48SSukumar Swaminathan 	uint32_t Sli2Id[2];
302291a2b48SSukumar Swaminathan 	uint32_t Sli3Id[2];
303291a2b48SSukumar Swaminathan 	uint32_t Sli4Id[2];
304291a2b48SSukumar Swaminathan 	uint32_t EromId[2];
305291a2b48SSukumar Swaminathan } DUMP_WAKE_UP_PARAMS;
306291a2b48SSukumar Swaminathan 
307291a2b48SSukumar Swaminathan 
308291a2b48SSukumar Swaminathan typedef struct _DUMP_TABLE_ENTRY_PORT_STRUCT
309291a2b48SSukumar Swaminathan {
310291a2b48SSukumar Swaminathan 	union
311291a2b48SSukumar Swaminathan 	{
312291a2b48SSukumar Swaminathan 		uint32_t w[2];
313291a2b48SSukumar Swaminathan 		struct
314291a2b48SSukumar Swaminathan 		{
315291a2b48SSukumar Swaminathan #ifdef EMLXS_LITTLE_ENDIAN
316291a2b48SSukumar Swaminathan 			uint32_t count:16;	/* structure repeat count */
317291a2b48SSukumar Swaminathan 			uint32_t length:8;	/* structure length */
318291a2b48SSukumar Swaminathan 			uint32_t sid:8;	/* SID */
319291a2b48SSukumar Swaminathan #else
320291a2b48SSukumar Swaminathan 			uint32_t sid:8;	/* SID */
321291a2b48SSukumar Swaminathan 			uint32_t length:8;	/* structure length */
322291a2b48SSukumar Swaminathan 			uint32_t count:16;	/* structure repeat count */
323291a2b48SSukumar Swaminathan #endif
324291a2b48SSukumar Swaminathan 			uint32_t addr;	/* address */
325291a2b48SSukumar Swaminathan 		} s;
326291a2b48SSukumar Swaminathan 
327291a2b48SSukumar Swaminathan 	} un;
328291a2b48SSukumar Swaminathan 
329291a2b48SSukumar Swaminathan } DUMP_TABLE_ENTRY_PORT_STRUCT;
330291a2b48SSukumar Swaminathan 
331291a2b48SSukumar Swaminathan 
332291a2b48SSukumar Swaminathan /* This is a simplified form of the Dump Table Entry structures. */
333291a2b48SSukumar Swaminathan typedef struct _DUMP_TABLE_ENTRY_PORT_BLK
334291a2b48SSukumar Swaminathan {
335291a2b48SSukumar Swaminathan 	union
336291a2b48SSukumar Swaminathan 	{
337291a2b48SSukumar Swaminathan 		uint32_t w[2];
338291a2b48SSukumar Swaminathan 		struct
339291a2b48SSukumar Swaminathan 		{
340291a2b48SSukumar Swaminathan 
341291a2b48SSukumar Swaminathan #ifdef EMLXS_LITTLE_ENDIAN
342291a2b48SSukumar Swaminathan 			uint32_t bc:24;	/* byte count */
343291a2b48SSukumar Swaminathan 			uint32_t sid:8;	/* SID */
344291a2b48SSukumar Swaminathan #else
345291a2b48SSukumar Swaminathan 			uint32_t sid:8;	/* SID */
346291a2b48SSukumar Swaminathan 			uint32_t bc:24;	/* byte count */
347291a2b48SSukumar Swaminathan #endif
348291a2b48SSukumar Swaminathan 			uint32_t addr;	/* address */
349291a2b48SSukumar Swaminathan 		} s;
350291a2b48SSukumar Swaminathan 
351291a2b48SSukumar Swaminathan 	} un;
352291a2b48SSukumar Swaminathan 
353291a2b48SSukumar Swaminathan } DUMP_TABLE_ENTRY_PORT_BLK;
354291a2b48SSukumar Swaminathan 
355291a2b48SSukumar Swaminathan 
356291a2b48SSukumar Swaminathan typedef struct _DUMP_TABLE_ENTRY
357291a2b48SSukumar Swaminathan {
358291a2b48SSukumar Swaminathan 	union
359291a2b48SSukumar Swaminathan 	{
360291a2b48SSukumar Swaminathan 		DUMP_TABLE_ENTRY_PORT_BLK PortBlock;
361291a2b48SSukumar Swaminathan 		DUMP_TABLE_ENTRY_PORT_STRUCT PortStruct;
362291a2b48SSukumar Swaminathan 
363291a2b48SSukumar Swaminathan 	} un;
364291a2b48SSukumar Swaminathan 
365291a2b48SSukumar Swaminathan } DUMP_TABLE_ENTRY;
366291a2b48SSukumar Swaminathan 
367291a2b48SSukumar Swaminathan /* VPD Data Defines */
368291a2b48SSukumar Swaminathan 
369291a2b48SSukumar Swaminathan #define	VPD_TAG_82  0x82	/* start of VPD Data: Device Name */
370291a2b48SSukumar Swaminathan #define	VPD_TAG_90  0x90	/* start of Read-Only Area */
371291a2b48SSukumar Swaminathan #define	VPD_TAG_FF  0x0F	/* end tag */
372291a2b48SSukumar Swaminathan 
373291a2b48SSukumar Swaminathan #ifdef	__cplusplus
374291a2b48SSukumar Swaminathan }
375291a2b48SSukumar Swaminathan #endif
376291a2b48SSukumar Swaminathan 
377291a2b48SSukumar Swaminathan #endif	/* _EMLXS_DUMP_H */