xref: /illumos-gate/usr/src/uts/common/sys/fibre-channel/fca/qlc/exioct.h (revision 6e375c8351497b82ffa4f33cbf61d712999b4605)
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 QLogic Corporation */
23 
24 /*
25  * File Name: exioct.h
26  *
27  * San/Device Management Ioctl Header
28  * File is created to adhere to Solaris requirement using 8-space tabs.
29  *
30  * !!!!! PLEASE DO NOT REMOVE THE TABS !!!!!
31  * !!!!! PLEASE NO SINGLE LINE COMMENTS: // !!!!!
32  * !!!!! PLEASE NO MORE THAN 80 CHARS PER LINE !!!!!
33  *
34  * ***********************************************************************
35  * *                                                                    **
36  * *                            NOTICE                                  **
37  * *            COPYRIGHT (C) 2000-2008 QLOGIC CORPORATION              **
38  * *                    ALL RIGHTS RESERVED                             **
39  * *                                                                    **
40  * ***********************************************************************
41  */
42 
43 #ifndef	_EXIOCT_H
44 #define	_EXIOCT_H
45 
46 
47 #ifdef	__cplusplus
48 extern "C" {
49 #endif
50 
51 #include <exioctso.h>
52 
53 /*
54  * NOTE: the following version defines must be updated each time the
55  *	 changes made may affect the backward compatibility of the
56  *	 input/output relations of the SDM IOCTL functions.
57  */
58 #define	EXT_VERSION				5
59 
60 /*
61  * OS independent General definitions
62  */
63 #define	EXT_DEF_SIGNATURE_SIZE			8
64 #define	EXT_DEF_WWN_NAME_SIZE			8
65 #define	EXT_DEF_WWP_NAME_SIZE			8
66 #define	EXT_DEF_SERIAL_NUM_SIZE			4
67 #define	EXT_DEF_PORTID_SIZE			4
68 #define	EXT_DEF_PORTID_SIZE_ACTUAL		3
69 #define	EXT_DEF_MAX_STR_SIZE			128
70 #define	EXT_DEF_SCSI_PASSTHRU_CDB_LENGTH	12
71 
72 #define	EXT_DEF_ADDR_MODE_32			1
73 #define	EXT_DEF_ADDR_MODE_64			2
74 
75 /*
76  * ***********************************************************************
77  * OS dependent General configuration defines
78  * ***********************************************************************
79  */
80 #define	EXT_DEF_MAX_HBA		EXT_DEF_MAX_HBA_OS
81 #define	EXT_DEF_MAX_BUS		EXT_DEF_MAX_BUS_OS
82 #define	EXT_DEF_MAX_TARGET	EXT_DEF_MAX_TARGET_OS
83 #define	EXT_DEF_MAX_LUN		EXT_DEF_MAX_LUN_OS
84 
85 /*
86  * ***********************************************************************
87  * Common header struct definitions for San/Device Mgmt
88  * ***********************************************************************
89  */
90 typedef struct {
91 	UINT64	Signature;			/* 8 chars string */
92 	UINT64	RequestAdr;			/* 8  */
93 	UINT64	ResponseAdr;			/* 8  */
94 	UINT64	VendorSpecificData;		/* 8 chars string */
95 	UINT32	Status;				/* 4  */
96 	UINT32	DetailStatus;			/* 4  */
97 	UINT32	Reserved1;			/* 4  */
98 	UINT32	RequestLen;			/* 4  */
99 	UINT32	ResponseLen;			/* 4  */
100 	UINT16	AddrMode;			/* 2  */
101 	UINT16	Version;			/* 2  */
102 	UINT16	SubCode;			/* 2  */
103 	UINT16	Instance;			/* 2  */
104 	UINT16	HbaSelect;			/* 2  */
105 	UINT16	VendorSpecificStatus[11];	/* 22 */
106 } EXT_IOCTL, *PEXT_IOCTL;			/* size = 84 / 0x54 */
107 
108 typedef union _ext_signature {
109 	UINT64	Signature;
110 	char	bytes[EXT_DEF_SIGNATURE_SIZE];
111 } ext_sig_t;
112 
113 /*
114  * Addressing mode used by the user application
115  */
116 #define	EXT_ADDR_MODE	EXT_ADDR_MODE_OS
117 
118 /*
119  * Status.  These macros are being used for setting Status field in
120  * EXT_IOCTL structure.
121  */
122 #define	EXT_STATUS_OK			0
123 #define	EXT_STATUS_ERR			1
124 #define	EXT_STATUS_BUSY			2
125 #define	EXT_STATUS_PENDING		3
126 #define	EXT_STATUS_SUSPENDED		4
127 #define	EXT_STATUS_RETRY_PENDING	5
128 #define	EXT_STATUS_INVALID_PARAM	6
129 #define	EXT_STATUS_DATA_OVERRUN		7
130 #define	EXT_STATUS_DATA_UNDERRUN	8
131 #define	EXT_STATUS_DEV_NOT_FOUND	9
132 #define	EXT_STATUS_COPY_ERR		10
133 #define	EXT_STATUS_MAILBOX		11
134 #define	EXT_STATUS_UNSUPPORTED_SUBCODE	12
135 #define	EXT_STATUS_UNSUPPORTED_VERSION	13
136 #define	EXT_STATUS_MS_NO_RESPONSE	14
137 #define	EXT_STATUS_SCSI_STATUS		15
138 #define	EXT_STATUS_BUFFER_TOO_SMALL	16
139 #define	EXT_STATUS_NO_MEMORY		17
140 #define	EXT_STATUS_UNKNOWN		18
141 #define	EXT_STATUS_UNKNOWN_DSTATUS	19
142 #define	EXT_STATUS_INVALID_REQUEST	20
143 #define	EXT_STATUS_DEVICE_NOT_READY	21
144 #define	EXT_STATUS_DEVICE_OFFLINE	22
145 #define	EXT_STATUS_HBA_NOT_READY	23
146 #define	EXT_STATUS_HBA_QUEUE_FULL	24
147 #define	EXT_STATUS_INVALID_VPINDEX	25
148 
149 /*
150  * Detail Status contains the SCSI bus status codes.
151  */
152 
153 #define	EXT_DSTATUS_GOOD			0x00
154 #define	EXT_DSTATUS_CHECK_CONDITION		0x02
155 #define	EXT_DSTATUS_CONDITION_MET		0x04
156 #define	EXT_DSTATUS_BUSY			0x08
157 #define	EXT_DSTATUS_INTERMEDIATE		0x10
158 #define	EXT_DSTATUS_INTERMEDIATE_COND_MET	0x14
159 #define	EXT_DSTATUS_RESERVATION_CONFLICT	0x18
160 #define	EXT_DSTATUS_COMMAND_TERMINATED		0x22
161 #define	EXT_DSTATUS_QUEUE_FULL			0x28
162 
163 /*
164  * Detail Status contains the needed Response buffer space(bytes)
165  * when Status = EXT_STATUS_BUFFER_TOO_SMALL
166  */
167 
168 
169 /*
170  * Detail Status contains one of the following codes
171  * when Status = EXT_STATUS_INVALID_PARAM or
172  *             = EXT_STATUS_DEV_NOT_FOUND
173  */
174 #define	EXT_DSTATUS_NOADNL_INFO			0x00
175 #define	EXT_DSTATUS_HBA_INST			0x01
176 #define	EXT_DSTATUS_TARGET			0x02
177 #define	EXT_DSTATUS_LUN				0x03
178 #define	EXT_DSTATUS_REQUEST_LEN			0x04
179 #define	EXT_DSTATUS_PATH_INDEX			0x05
180 
181 /*
182  * Currently supported DeviceControl / ioctl command codes
183  */
184 #define	EXT_CC_QUERY			EXT_CC_QUERY_OS
185 #define	EXT_CC_SEND_FCCT_PASSTHRU	EXT_CC_SEND_FCCT_PASSTHRU_OS
186 #define	EXT_CC_REG_AEN			EXT_CC_REG_AEN_OS
187 #define	EXT_CC_GET_AEN			EXT_CC_GET_AEN_OS
188 #define	EXT_CC_SEND_ELS_RNID		EXT_CC_SEND_ELS_RNID_OS
189 #define	EXT_CC_SEND_SCSI_PASSTHRU	EXT_CC_SCSI_PASSTHRU_OS
190 #define	EXT_CC_READ_HOST_PARAMS		EXT_CC_READ_HOST_PARAMS_OS
191 #define	EXT_CC_READ_RISC_PARAMS		EXT_CC_READ_RISC_PARAMS_OS
192 #define	EXT_CC_UPDATE_HOST_PARAMS	EXT_CC_UPDATE_HOST_PARAMS_OS
193 #define	EXT_CC_UPDATE_RISC_PARAMS	EXT_CC_UPDATE_RISC_PARAMS_OS
194 #define	EXT_CC_READ_NVRAM		EXT_CC_READ_NVRAM_OS
195 #define	EXT_CC_UPDATE_NVRAM		EXT_CC_UPDATE_NVRAM_OS
196 #define	EXT_CC_HOST_IDX			EXT_CC_HOST_IDX_OS
197 #define	EXT_CC_LOOPBACK			EXT_CC_LOOPBACK_OS
198 #define	EXT_CC_READ_OPTION_ROM		EXT_CC_READ_OPTION_ROM_OS
199 #define	EXT_CC_READ_OPTION_ROM_EX	EXT_CC_READ_OPTION_ROM_EX_OS
200 #define	EXT_CC_UPDATE_OPTION_ROM	EXT_CC_UPDATE_OPTION_ROM_OS
201 #define	EXT_CC_UPDATE_OPTION_ROM_EX	EXT_CC_UPDATE_OPTION_ROM_EX_OS
202 #define	EXT_CC_GET_VPD			EXT_CC_GET_VPD_OS
203 #define	EXT_CC_SET_VPD			EXT_CC_SET_VPD_OS
204 #define	EXT_CC_GET_FCACHE		EXT_CC_GET_FCACHE_OS
205 #define	EXT_CC_GET_FCACHE_EX		EXT_CC_GET_FCACHE_EX_OS
206 #define	EXT_CC_HOST_DRVNAME		EXT_CC_HOST_DRVNAME_OS
207 #define	EXT_CC_GET_SFP_DATA		EXT_CC_GET_SFP_DATA_OS
208 #define	EXT_CC_WWPN_TO_SCSIADDR		EXT_CC_WWPN_TO_SCSIADDR_OS
209 #define	EXT_CC_PORT_PARAM		EXT_CC_PORT_PARAM_OS
210 #define	EXT_CC_GET_PCI_DATA		EXT_CC_GET_PCI_DATA_OS
211 #define	EXT_CC_GET_FWEXTTRACE		EXT_CC_GET_FWEXTTRACE_OS
212 #define	EXT_CC_GET_FWFCETRACE		EXT_CC_GET_FWFCETRACE_OS
213 #define	EXT_CC_GET_VP_CNT_ID		EXT_CC_GET_VP_CNT_ID_OS
214 #define	EXT_CC_VPORT_CMD		EXT_CC_VPORT_CMD_OS
215 
216 /*
217  * HBA port operations
218  */
219 #define	EXT_CC_GET_DATA		EXT_CC_GET_DATA_OS
220 #define	EXT_CC_SET_DATA		EXT_CC_SET_DATA_OS
221 
222 /*
223  * The following DeviceControl / ioctl command codes currently are not
224  * supported.
225  */
226 #define	EXT_CC_SEND_ELS_RTIN	EXT_CC_SEND_ELS_RTIN_OS
227 
228 
229 /*
230  * ***********************************************************************
231  * EXT_IOCTL SubCode definition.
232  * These macros are being used for setting SubCode field in EXT_IOCTL
233  * structure.
234  * ***********************************************************************
235  */
236 
237 /*
238  * Query.
239  * Uses with EXT_QUERY as the ioctl code.
240  */
241 #define	EXT_SC_QUERY_HBA_NODE	1
242 #define	EXT_SC_QUERY_HBA_PORT	2
243 #define	EXT_SC_QUERY_DISC_PORT	3
244 #define	EXT_SC_QUERY_DISC_TGT	4
245 #define	EXT_SC_QUERY_DISC_LUN	5	/* Currently Not Supported */
246 #define	EXT_SC_QUERY_DRIVER	6
247 #define	EXT_SC_QUERY_FW		7
248 #define	EXT_SC_QUERY_CHIP	8
249 
250 /*
251  * Get.
252  * Uses with EXT_GET_DATA as the ioctl code
253  */
254 /* 1 - 99 Common */
255 #define	EXT_SC_GET_SCSI_ADDR		1	/* Currently Not Supported */
256 #define	EXT_SC_GET_ERR_DETECTIONS	2	/* Currently Not Supported */
257 #define	EXT_SC_GET_STATISTICS		3
258 #define	EXT_SC_GET_BUS_MODE		4	/* Currently Not Supported */
259 #define	EXT_SC_GET_DR_DUMP_BUF		5	/* Currently Not Supported */
260 #define	EXT_SC_GET_RISC_CODE		6
261 #define	EXT_SC_GET_FLASH_RAM		7
262 #define	EXT_SC_GET_BEACON_STATE		8
263 
264 /* 100 - 199 FC_INTF_TYPE */
265 #define	EXT_SC_GET_LINK_STATUS		101	/* Currently Not Supported */
266 #define	EXT_SC_GET_LOOP_ID		102	/* Currently Not Supported */
267 #define	EXT_SC_GET_LUN_BITMASK		103
268 #define	EXT_SC_GET_PORT_DATABASE	104	/* Currently Not Supported */
269 #define	EXT_SC_GET_PORT_DATABASE_MEM	105	/* Currently Not Supported */
270 #define	EXT_SC_GET_PORT_SUMMARY		106
271 #define	EXT_SC_GET_POSITION_MAP		107
272 #define	EXT_SC_GET_RETRY_CNT		108	/* Currently Not Supported */
273 #define	EXT_SC_GET_RNID			109
274 #define	EXT_SC_GET_RTIN			110	/* Currently Not Supported */
275 #define	EXT_SC_GET_FC_LUN_BITMASK	111
276 #define	EXT_SC_GET_FC_STATISTICS	112
277 #define	EXT_SC_GET_FC4_STATISTICS	113
278 #define	EXT_SC_GET_TARGET_ID		114
279 
280 
281 /* 200 - 299 SCSI_INTF_TYPE */
282 #define	EXT_SC_GET_SEL_TIMEOUT		201	/* Currently Not Supported */
283 
284 
285 /*
286  * Set.
287  * Uses with EXT_SET_DATA as the ioctl code
288  */
289 /* 1 - 99 Common */
290 #define	EXT_SC_RST_STATISTICS		3
291 #define	EXT_SC_SET_BUS_MODE		4	/* Currently Not Supported */
292 #define	EXT_SC_SET_DR_DUMP_BUF		5	/* Currently Not Supported */
293 #define	EXT_SC_SET_RISC_CODE		6
294 #define	EXT_SC_SET_FLASH_RAM		7
295 #define	EXT_SC_SET_BEACON_STATE		8
296 
297 /* special types (non snia) */
298 #define	EXT_SC_SET_PARMS		99	/* dpb */
299 
300 /* 100 - 199 FC_INTF_TYPE */
301 #define	EXT_SC_SET_LUN_BITMASK		103
302 #define	EXT_SC_SET_RETRY_CNT		108	/* Currently Not Supported */
303 #define	EXT_SC_SET_RNID			109
304 #define	EXT_SC_SET_RTIN			110	/* Currently Not Supported */
305 #define	EXT_SC_SET_FC_LUN_BITMASK	111
306 #define	EXT_SC_ADD_TARGET_DEVICE	112
307 #define	EXT_SC_SWAP_TARGET_DEVICE	113
308 
309 /* 200 - 299 SCSI_INTF_TYPE */
310 #define	EXT_SC_SET_SEL_TIMEOUT		201	/* Currently Not Supported */
311 
312 /* SCSI passthrough */
313 #define	EXT_SC_SEND_SCSI_PASSTHRU	0
314 #define	EXT_SC_SEND_FC_SCSI_PASSTHRU	1
315 
316 /* NVRAM */
317 #define	EXT_SC_NVRAM_HARDWARE		0	/* Save */
318 #define	EXT_SC_NVRAM_DRIVER		1	/* Driver (Apply) */
319 #define	EXT_SC_NVRAM_ALL		2	/* NVRAM/Driver (Save+Apply) */
320 
321 /*
322  * Vport functions
323  * Used with EXT_CC_VPORT_CMD as the ioctl code.
324  */
325 #define	EXT_VF_SC_VPORT_GETINFO		1
326 
327 /* Read */
328 
329 /* Write */
330 
331 /* Reset */
332 
333 /* Request struct */
334 
335 
336 /*
337  * Response struct
338  */
339 typedef struct _EXT_HBA_NODE {
340 	UINT32	DriverAttr;				/* 4 */
341 	UINT32	FWAttr;					/* 4 */
342 	UINT16	PortCount;				/* 2; 1 */
343 	UINT16	InterfaceType;				/* 2; FC/SCSI */
344 	UINT8	WWNN[EXT_DEF_WWN_NAME_SIZE];		/* 8 */
345 	UINT8	Manufacturer[EXT_DEF_MAX_STR_SIZE];	/* 128; "QLOGIC" */
346 	UINT8	Model[EXT_DEF_MAX_STR_SIZE];		/* 128; "QLA2200" */
347 	UINT8	SerialNum[EXT_DEF_SERIAL_NUM_SIZE];	/* 4;  123  */
348 	UINT8	DriverVersion[EXT_DEF_MAX_STR_SIZE];	/* 128; "7.4.3" */
349 	UINT8	FWVersion[EXT_DEF_MAX_STR_SIZE];	/* 128; "2.1.6" */
350 	UINT8	OptRomVersion[EXT_DEF_MAX_STR_SIZE];	/* 128; "1.44" */
351 	UINT8	Reserved[32];				/* 32 */
352 } EXT_HBA_NODE, *PEXT_HBA_NODE;				/* 696 */
353 
354 /* HBA node query interface type */
355 #define	EXT_DEF_FC_INTF_TYPE			1
356 #define	EXT_DEF_SCSI_INTF_TYPE			2
357 #define	EXT_DEF_VIRTUAL_FC_INTF_TYPE		3
358 
359 typedef struct _EXT_HBA_PORT {
360 	UINT64	Target;				/* 8 */
361 	UINT32	PortSupportedSpeed;		/* 4 */
362 	UINT32	PortSpeed;			/* 4 */
363 	UINT16	Type;				/* 2; Port Type */
364 	UINT16	State;				/* 2; Port State */
365 	UINT16	Mode;				/* 2 */
366 	UINT16	DiscPortCount;			/* 2 */
367 	UINT16	DiscPortNameType;		/* 2; USE_NODE_NAME or */
368 						/* USE_PORT_NAME */
369 	UINT16	DiscTargetCount;		/* 2 */
370 	UINT16	Bus;				/* 2 */
371 	UINT16	Lun;				/* 2 */
372 	UINT8	WWPN[EXT_DEF_WWN_NAME_SIZE];	/* 8 */
373 	UINT8	Id  [EXT_DEF_PORTID_SIZE];	/* 4; 3 bytes valid Port Id. */
374 	UINT8	PortSupportedFC4Types;		/* 1 */
375 	UINT8	PortActiveFC4Types;		/* 1 */
376 	UINT8	FabricName[EXT_DEF_WWN_NAME_SIZE];	/* 8 */
377 	UINT8	sfp_status;			/* 1 */
378 	UINT8	Reserved[9];			/* 9 */
379 } EXT_HBA_PORT, *PEXT_HBA_PORT;			/* 62 */
380 
381 /* FC-4 Instrumentation */
382 typedef struct _EXT_HBA_FC4Statistics {
383 	INT64	InputRequests;			/* 8  */
384 	INT64	OutputRequests;			/* 8  */
385 	INT64	ControlRequests;		/* 8  */
386 	INT64	InputMegabytes;			/* 8  */
387 	INT64	OutputMegabytes;		/* 8  */
388 	UINT64	Reserved[6];			/* 48 */
389 } EXT_HBA_FC4STATISTICS, *PEXT_HBA_FC4STATISTICS;	/* 88 */
390 
391 typedef struct _EXT_LOOPBACK_REQ {
392 	UINT32	TransferCount;
393 	UINT32	IterationCount;
394 	UINT32	BufferAddress;
395 	UINT32	BufferLength;
396 	UINT16	Options;
397 	UINT8	Reserved[18];
398 } EXT_LOOPBACK_REQ, *PEXT_LOOPBACK_REQ;
399 
400 typedef struct _EXT_LOOPBACK_RSP {
401 	UINT64	BufferAddress;
402 	UINT32	BufferLength;
403 	UINT32	IterationCountLastError;
404 	UINT16	CompletionStatus;
405 	UINT16	CrcErrorCount;
406 	UINT16	DisparityErrorCount;
407 	UINT16	FrameLengthErrorCount;
408 	UINT8	CommandSent;
409 	UINT8	Reserved[15];
410 } EXT_LOOPBACK_RSP, *PEXT_LOOPBACK_RSP;
411 
412 /* used with loopback response CommandSent */
413 #define	INT_DEF_LB_LOOPBACK_CMD		0
414 #define	INT_DEF_LB_ECHO_CMD		1
415 
416 /* definition for interpreting CompletionStatus values */
417 #define	EXT_DEF_LB_COMPLETE	0x4000
418 #define	EXT_DEF_LB_PARAM_ERR	0x4006
419 #define	EXT_DEF_LB_LOOP_DOWN	0x400b
420 #define	EXT_DEF_LB_CMD_ERROR	0x400c
421 
422 /* port type */
423 #define	EXT_DEF_INITIATOR_DEV	0x1
424 #define	EXT_DEF_TARGET_DEV	0x2
425 #define	EXT_DEF_TAPE_DEV	0x4
426 #define	EXT_DEF_FABRIC_DEV	0x8
427 
428 
429 /* HBA port state */
430 #define	EXT_DEF_HBA_OK		0
431 #define	EXT_DEF_HBA_SUSPENDED	1
432 #define	EXT_DEF_HBA_LOOP_DOWN	2
433 
434 /* Connection mode */
435 #define	EXT_DEF_UNKNOWN_MODE	0
436 #define	EXT_DEF_P2P_MODE	1
437 #define	EXT_DEF_LOOP_MODE	2
438 #define	EXT_DEF_FL_MODE		3
439 #define	EXT_DEF_N_MODE		4
440 
441 /* Valid name type for Disc. port/target */
442 #define	EXT_DEF_USE_NODE_NAME	1
443 #define	EXT_DEF_USE_PORT_NAME	2
444 
445 /* FC4 type values */
446 #define	EXT_DEF_FC4_TYPE_SCSI	0x1
447 #define	EXT_DEF_FC4_TYPE_IP	0x2
448 #define	EXT_DEF_FC4_TYPE_SCTP	0x4
449 #define	EXT_DEF_FC4_TYPE_VI	0x8
450 
451 /* Port Speed values */
452 #define	EXT_DEF_PORTSPEED_UNKNOWN 	0x0
453 #define	EXT_DEF_PORTSPEED_1GBIT		0x1
454 #define	EXT_DEF_PORTSPEED_2GBIT		0x2
455 #define	EXT_DEF_PORTSPEED_4GBIT		0x4
456 #define	EXT_DEF_PORTSPEED_8GBIT		0x8
457 #define	EXT_DEF_PORTSPEED_10GBIT	0x10
458 #define	EXT_PORTSPEED_NOT_NEGOTIATED	(1<<15)	/* Speed not established */
459 
460 typedef struct _EXT_DISC_PORT {
461 	UINT64	TargetId;		/* 8 */
462 	UINT16	Type;			/* 2; Port Type */
463 	UINT16	Status;			/* 2; Port Status */
464 	UINT16	Bus;			/* 2; n/a for Solaris */
465 	UINT16	LoopID;			/* 2; Loop ID */
466 	UINT8	WWNN[EXT_DEF_WWN_NAME_SIZE];	/* 8 */
467 	UINT8	WWPN[EXT_DEF_WWN_NAME_SIZE];	/* 8 */
468 	UINT8	Id[EXT_DEF_PORTID_SIZE];	/* 4; 3 bytes used big endian */
469 	UINT8	Local;			/* 1; Local or Remote */
470 	UINT8	Reserved[27];		/* 27 */
471 } EXT_DISC_PORT, *PEXT_DISC_PORT;	/* 64 */
472 
473 typedef struct _EXT_DISC_TARGET {
474 	UINT64	TargetId;		/* 8 */
475 	UINT16	Type;			/* 2; Target Type */
476 	UINT16	Status;			/* 2; Target Status */
477 	UINT16	Bus;			/* 2; n/a for Solaris */
478 	UINT16	LunCount;		/* 2; n/a for nt */
479 	UINT16	LoopID;			/* 2; Loop ID */
480 	UINT8	WWNN[EXT_DEF_WWN_NAME_SIZE];	/* 8 */
481 	UINT8	WWPN[EXT_DEF_WWN_NAME_SIZE];	/* 8 */
482 	UINT8	Id  [EXT_DEF_PORTID_SIZE];	/* 4; 3 bytes used big endian */
483 	UINT8	Local;			/* 1; Local or Remote */
484 	UINT8	Reserved[25];		/* 25 */
485 } EXT_DISC_TARGET, *PEXT_DISC_TARGET;	/* 64 */
486 
487 /* The following command is not supported */
488 typedef struct _EXT_DISC_LUN {	/* n/a for nt */
489 	UINT16	Id;		/* 2 */
490 	UINT16	State;		/* 2 */
491 	UINT16	IoCount;	/* 2 */
492 	UINT8	Reserved[30];	/* 30 */
493 } EXT_DISC_LUN, *PEXT_DISC_LUN;	/* 36 */
494 
495 
496 /* SCSI address */
497 typedef struct _EXT_SCSI_ADDR {
498 	UINT64	Target;			/* 8 */
499 	UINT16	Bus;			/* 2 */
500 	UINT16	Lun;			/* 2 */
501 	UINT8	Padding[12];		/* 12 */
502 } EXT_SCSI_ADDR, *PEXT_SCSI_ADDR;	/* 24 */
503 
504 
505 /* Fibre Channel address */
506 typedef struct _EXT_FC_ADDR {
507 	UINT16	Type;					/* 2 */
508 	union {
509 		UINT8	WWNN[EXT_DEF_WWN_NAME_SIZE];	/* 8 */
510 		UINT8	WWPN[EXT_DEF_WWN_NAME_SIZE];	/* 8 */
511 		UINT8	Id[EXT_DEF_PORTID_SIZE];	/* 4 */
512 	} FcAddr;
513 	UINT8	Padding[4];				/* 4 */
514 } EXT_FC_ADDR, *PEXT_FC_ADDR;				/* 14 */
515 
516 #define	EXT_DEF_TYPE_WWNN	1
517 #define	EXT_DEF_TYPE_WWPN	2
518 #define	EXT_DEF_TYPE_PORTID	3
519 #define	EXT_DEF_TYPE_FABRIC	4
520 
521 /* Destination address */
522 typedef struct _EXT_DEST_ADDR {
523 	union {
524 		struct {
525 			UINT64	Target;			/* 8 */
526 			UINT16	Bus;			/* 2 */
527 			UINT8	pad[6];			/* 6 */
528 		} ScsiAddr;
529 		UINT8	WWNN[EXT_DEF_WWN_NAME_SIZE];	/* 8 */
530 		UINT8	WWPN[EXT_DEF_WWN_NAME_SIZE];	/* 8 */
531 		UINT8	Id[EXT_DEF_PORTID_SIZE];	/* 4 */
532 	} DestAddr;
533 	UINT16	DestType;				/* 2 */
534 	UINT16	Lun;					/* 2 */
535 	UINT8	Padding[4];				/* 4 */
536 } EXT_DEST_ADDR, *PEXT_DEST_ADDR;			/* 24 */
537 
538 
539 #define	EXT_DEF_DESTTYPE_WWNN		1
540 #define	EXT_DEF_DESTTYPE_WWPN		2
541 #define	EXT_DEF_DESTTYPE_PORTID		3
542 #define	EXT_DEF_DESTTYPE_FABRIC		4
543 #define	EXT_DEF_DESTTYPE_SCSI		5
544 
545 /* Statistic */
546 typedef struct _EXT_HBA_PORT_STAT {
547 	UINT32	ControllerErrorCount;		/* 4 */
548 	UINT32	DeviceErrorCount;		/* 4 */
549 	UINT32	IoCount;			/* 4 */
550 	UINT32	MBytesCount;			/* 4; MB of data processed */
551 	UINT32	LipResetCount;			/* 4; Total no. of LIP Reset */
552 	UINT32	InterruptCount;			/* 4; Total no. of Interrupts */
553 	UINT32	LinkFailureCount;		/* 4 */
554 	UINT32	LossOfSyncCount;		/* 4 */
555 	UINT32	LossOfSignalsCount;		/* 4 */
556 	UINT32	PrimitiveSeqProtocolErrorCount;	/* 4 */
557 	UINT32	InvalidTransmissionWordCount;	/* 4 */
558 	UINT32	InvalidCRCCount;		/* 4 */
559 	UINT8	Reserved[64];			/* 64 */
560 } EXT_HBA_PORT_STAT, *PEXT_HBA_PORT_STAT;	/* 112 */
561 
562 
563 /* Driver property */
564 typedef struct _EXT_DRIVER {
565 	UINT32	MaxTransferLen;			/* 4 */
566 	UINT32	MaxDataSegments;		/* 4 */
567 	UINT32	Attrib;				/* 4 */
568 	UINT32	InternalFlags[4];		/* 16 */
569 	UINT16	NumOfBus;			/* 2; Port Type */
570 	UINT16	TargetsPerBus;			/* 2; Port Status */
571 	UINT16	LunsPerTarget;			/* 2 */
572 	UINT16	DmaBitAddresses;		/* 2 */
573 	UINT16	IoMapType;			/* 2 */
574 	UINT8	Version[EXT_DEF_MAX_STR_SIZE];	/* 128 */
575 	UINT8	Reserved[32];			/* 32 */
576 } EXT_DRIVER, *PEXT_DRIVER;			/* 198 */
577 
578 
579 /* Firmware property */
580 typedef struct _EXT_FW {
581 	UINT32	Attrib;				/* 4 */
582 	UINT8	Version[EXT_DEF_MAX_STR_SIZE];	/* 128 */
583 	UINT8	Reserved[66];			/* 66 */
584 } EXT_FW, *PEXT_FW;				/* 198 */
585 
586 
587 /* ISP/Chip property */
588 typedef struct _EXT_CHIP {
589 	UINT32	IoAddr;		/* 4 */
590 	UINT32	IoAddrLen;	/* 4 */
591 	UINT32	MemAddr;	/* 4 */
592 	UINT32	MemAddrLen;	/* 4 */
593 	UINT16	VendorId;	/* 2 */
594 	UINT16	DeviceId;	/* 2 */
595 	UINT16	SubVendorId;	/* 2 */
596 	UINT16	SubSystemId;	/* 2 */
597 	UINT16	PciBusNumber;	/* 2 */
598 	UINT16	PciSlotNumber;	/* 2 */
599 	UINT16	ChipType;	/* 2 */
600 	UINT16	InterruptLevel;	/* 2 */
601 	UINT16	OutMbx[8];	/* 16 */
602 	UINT8	Reserved[31];	/* 31 */
603 	UINT8	ChipRevID;	/* 1 */
604 } EXT_CHIP, *PEXT_CHIP;		/* 80 */
605 
606 
607 /* Request Buffer for RNID */
608 typedef struct _EXT_RNID_REQ {
609 	EXT_FC_ADDR	Addr;				/* 14 */
610 	UINT8		DataFormat;			/* 1 */
611 	UINT8		Pad;				/* 1 */
612 	UINT8		OptWWN[EXT_DEF_WWN_NAME_SIZE];	/* 8 */
613 	UINT8		OptPortId[EXT_DEF_PORTID_SIZE];	/* 4 */
614 	UINT8		Reserved[51];			/* 51 */
615 } EXT_RNID_REQ, *PEXT_RNID_REQ;				/* 79 */
616 
617 #define	EXT_DEF_RNID_DFORMAT_NONE	0
618 #define	EXT_DEF_RNID_DFORMAT_TOPO_DISC	0xDF
619 
620 /* Request Buffer for Set RNID */
621 typedef struct _EXT_SET_RNID_REQ {
622 	UINT8	IPVersion[2];		/*  2 */
623 	UINT8	UDPPortNumber[2];	/*  2 */
624 	UINT8	IPAddress[16];		/* 16 */
625 	UINT8	Reserved[64];		/* 64 */
626 } EXT_SET_RNID_REQ, *PEXT_SET_RNID_REQ; /* 84 */
627 
628 /* RNID definition and data struct */
629 #define	SEND_RNID_RSP_SIZE  72
630 
631 typedef struct _RNID_DATA
632 {
633 	UINT32	UnitType;		/* 4 */
634 	UINT32	NumOfAttachedNodes;	/* 4 */
635 	UINT16	TopoDiscFlags;		/* 2 */
636 	UINT16	Reserved;		/* 2 */
637 	UINT8	WWN[16];		/* 16 */
638 	UINT8	PortId[4];		/* 4 */
639 	UINT8	IPVersion[2];		/* 2 */
640 	UINT8	UDPPortNumber[2];	/* 2 */
641 	UINT8	IPAddress[16];		/* 16 */
642 } EXT_RNID_DATA, *PEXT_RNID_DATA;	/* 52 */
643 
644 
645 /* SCSI pass-through */
646 typedef struct _EXT_SCSI_PASSTHRU {
647 	EXT_SCSI_ADDR	TargetAddr;
648 	UINT8		Direction;
649 	UINT8		CdbLength;
650 	UINT8		Cdb[EXT_DEF_SCSI_PASSTHRU_CDB_LENGTH];
651 	UINT8		Reserved[66];
652 	UINT8		SenseData[256];
653 } EXT_SCSI_PASSTHRU, *PEXT_SCSI_PASSTHRU;
654 
655 /* FC SCSI pass-through */
656 typedef struct _EXT_FC_SCSI_PASSTHRU {
657 	EXT_DEST_ADDR	FCScsiAddr;
658 	UINT8		Direction;
659 	UINT8		CdbLength;
660 	UINT8		Cdb[EXT_DEF_SCSI_PASSTHRU_CDB_LENGTH];
661 	UINT8		Reserved[64];
662 	UINT8		SenseData[256];
663 } EXT_FC_SCSI_PASSTHRU, *PEXT_FC_SCSI_PASSTHRU;
664 
665 /* SCSI pass-through direction */
666 #define	EXT_DEF_SCSI_PASSTHRU_DATA_IN		1
667 #define	EXT_DEF_SCSI_PASSTHRU_DATA_OUT		2
668 
669 
670 /* EXT_REG_AEN Request struct */
671 typedef struct _EXT_REG_AEN {
672 	UINT32	Enable;		/* 4; non-0 to enable, 0 to disable. */
673 	UINT8	Reserved[4];	/* 4 */
674 } EXT_REG_AEN, *PEXT_REG_AEN;	/* 8 */
675 
676 /* EXT_GET_AEN Response struct */
677 typedef struct _EXT_ASYNC_EVENT {
678 	UINT32	AsyncEventCode;		/* 4 */
679 	union {
680 		struct {
681 			UINT8 RSCNInfo[EXT_DEF_PORTID_SIZE_ACTUAL]; /* 3 BE */
682 			UINT8 AddrFormat;			/* 1 */
683 			UINT8 Rsvd_1[8];			/* 8 */
684 		} RSCN;
685 
686 		UINT8	Reserved[12];	/* 12 */
687 	} Payload;
688 } EXT_ASYNC_EVENT, *PEXT_ASYNC_EVENT;	/* 16 */
689 
690 
691 /* Asynchronous Event Codes */
692 #define	EXT_DEF_LIP_OCCURRED	0x8010
693 #define	EXT_DEF_LINK_UP		0x8011
694 #define	EXT_DEF_LINK_DOWN	0x8012
695 #define	EXT_DEF_LIP_RESET	0x8013
696 #define	EXT_DEF_RSCN		0x8015
697 #define	EXT_DEF_DEVICE_UPDATE	0x8014
698 
699 /* LED state information */
700 #define	EXT_DEF_GRN_BLINK_OFF	0x00
701 #define	EXT_DEF_GRN_BLINK_ON	0x01
702 
703 typedef struct _EXT_BEACON_CONTROL {
704 	UINT32	State;				/* 4  */
705 	UINT8	Reserved[12];			/* 12 */
706 } EXT_BEACON_CONTROL, *PEXT_BEACON_CONTROL;	/* 16 */
707 
708 /* Required # of entries in the queue buffer allocated. */
709 #define	EXT_DEF_MAX_AEN_QUEUE	EXT_DEF_MAX_AEN_QUEUE_OS
710 
711 /*
712  * LUN BitMask structure definition, array of 8bit bytes,
713  * 1 bit per lun.  When bit == 1, the lun is masked.
714  * Most significant bit of mask[0] is lun 0.
715  * Least significant bit of mask[0] is lun 7.
716  */
717 typedef struct _EXT_LUN_BIT_MASK {
718 #if ((EXT_DEF_MAX_LUN & 0x7) == 0)
719 	UINT8	mask[EXT_DEF_MAX_LUN >> 3];
720 #else
721 	UINT8	mask[(EXT_DEF_MAX_LUN + 8) >> 3 ];
722 #endif
723 } EXT_LUN_BIT_MASK, *PEXT_LUN_BIT_MASK;
724 
725 /* Device type to get for EXT_SC_GET_PORT_SUMMARY */
726 #define	EXT_DEF_GET_KNOWN_DEVICE	0x1
727 #define	EXT_DEF_GET_VISIBLE_DEVICE	0x2
728 #define	EXT_DEF_GET_HIDDEN_DEVICE	0x4
729 #define	EXT_DEF_GET_FABRIC_DEVICE	0x8
730 #define	EXT_DEF_GET_LOOP_DEVICE		0x10
731 
732 /* Each entry in device database */
733 typedef struct _EXT_DEVICEDATAENTRY
734 {
735 	EXT_SCSI_ADDR	TargetAddress;	/* scsi address */
736 	UINT32		DeviceFlags;	/* Flags for device */
737 	UINT16		LoopID;		/* Loop ID */
738 	UINT16		BaseLunNumber;
739 	UINT8		NodeWWN[8];	/* Node World Wide Name for device */
740 	UINT8		PortWWN[8];	/* Port World Wide Name for device */
741 	UINT8		PortID[3];	/* Current PortId for device */
742 	UINT8		ControlFlags;	/* Control flag */
743 	UINT8		Reserved[132];
744 } EXT_DEVICEDATAENTRY, *PEXT_DEVICEDATAENTRY;
745 
746 #define	EXT_DEF_EXTERNAL_LUN_COUNT		2048
747 #define	EXT_DEF_EXTERNAL_LUN_BITMASK_BYTES	(EXT_DEF_EXTERNAL_LUN_COUNT / 8)
748 
749 /* Structure as used in the IOCTL. */
750 
751 typedef struct _EXT_EXTERNAL_LUN_BITMASK_ENTRY
752 {
753 	UINT8	NodeName[EXT_DEF_WWN_NAME_SIZE];
754 	UINT8	PortName[EXT_DEF_WWN_NAME_SIZE];
755 	UINT8	Reserved1[16];		/* Pad to 32-byte header */
756 	UINT8	Bitmask[EXT_DEF_EXTERNAL_LUN_BITMASK_BYTES];
757 } EXT_EXTERNAL_LUN_BITMASK_ENTRY, *PEXT_EXTERNAL_LUN_BITMASK_ENTRY;
758 
759 
760 /* Structure as it is stored in the NT registry */
761 
762 typedef struct _LUN_BITMASK_LIST
763 {
764 	UINT16	Version;	/* Should be LUN_BITMASK_REGISTRY_VERSION */
765 	UINT16	EntryCount;	/* Count of variable entries following */
766 	UINT8	Reserved[28];	/* Pad to 32-byte header */
767 
768 	EXT_EXTERNAL_LUN_BITMASK_ENTRY
769 		BitmaskEntry[1]; /* Var-length data */
770 } EXT_LUN_BITMASK_LIST, *PEXT_LUN_BITMASK_LIST;
771 
772 
773 /* Device database information */
774 typedef struct _EXT_DEVICEDATA
775 {
776 	UINT32	TotalDevices;		/* Set to total number of device */
777 	UINT32	ReturnListEntryCount;	/* Set to number of device entries */
778 					/* returned in list. */
779 
780 	EXT_DEVICEDATAENTRY  EntryList[1]; /* Variable length */
781 } EXT_DEVICEDATA, *PEXT_DEVICEDATA;
782 
783 
784 /* Swap Target Device Data structure */
785 typedef struct _EXT_SWAPTARGETDEVICE
786 {
787 	EXT_DEVICEDATAENTRY	CurrentExistDevice;
788 	EXT_DEVICEDATAENTRY	NewDevice;
789 } EXT_SWAPTARGETDEVICE, *PEXT_SWAPTARGETDEVICE;
790 
791 #define	EXT_DEF_LUN_BITMASK_LIST_MIN_ENTRIES	1
792 #define	EXT_DEF_LUN_BITMASK_LIST_MAX_ENTRIES	256
793 
794 #ifdef _WIN64
795 #define	EXT_DEF_LUN_BITMASK_LIST_HEADER_SIZE	32
796 #else
797 #define	EXT_DEF_LUN_BITMASK_LIST_HEADER_SIZE \
798     offsetof(LUN_BITMASK_LIST_BUFFER, asBitmaskEntry)
799 #endif
800 
801 #define	EXT_DEF_LUN_BITMASK_LIST_MIN_SIZE   \
802 	(EXT_DEF_LUN_BITMASK_LIST_HEADER_SIZE + \
803 	(sizeof (EXT_EXTERNAL_LUN_BITMASK_ENTRY) * \
804 	EXT_DEF_LUN_BITMASK_LIST_MIN_ENTRIES))
805 #define	EXT_DEF_LUN_BITMASK_LIST_MAX_SIZE   \
806 	(EXT_DEF_LUN_BITMASK_LIST_HEADER_SIZE + \
807 	(sizeof (EXT_EXTERNAL_LUN_BITMASK_ENTRY) * \
808 	EXT_DEF_LUN_BITMASK_LIST_MAX_ENTRIES))
809 /*
810  * LUN mask bit manipulation macros
811  *
812  *   P = Pointer to an EXT_LUN_BIT_MASK union.
813  *   L = LUN number.
814  */
815 #define	EXT_IS_LUN_BIT_SET(P, L) \
816 	(((P)->mask[L / 8] & (0x80 >> (L % 8))) ? 1 : 0)
817 
818 #define	EXT_SET_LUN_BIT(P, L) \
819 	((P)->mask[L / 8] |= (0x80 >> (L % 8)))
820 
821 #define	EXT_CLR_LUN_BIT(P, L) \
822 	((P)->mask[L / 8] &= ~(0x80 >> (L % 8)))
823 
824 typedef struct _EXT_PORT_PARAM {
825 	EXT_DEST_ADDR	FCScsiAddr;
826 	UINT16		Mode;
827 	UINT16		Speed;
828 } EXT_PORT_PARAM, *PEXT_PORT_PARAM;
829 
830 #define	EXT_IIDMA_MODE_GET	0
831 #define	EXT_IIDMA_MODE_SET	1
832 
833 /*
834  * Mercury/Menlo
835  */
836 
837 #define	MENLO_RESET_FLAG_ENABLE_DIAG_FW	1
838 
839 typedef struct _MENLO_RESET {
840 	UINT16 Flags;
841 	UINT16 Reserved;
842 } MENLO_RESET, *PMENLO_RESET;
843 
844 typedef struct _MENLO_GET_FW_VERSION {
845 	UINT32 FwVersion;
846 } MENLO_GET_FW_VERSION, *PMENLO_GET_FW_VERSION;
847 
848 #define	MENLO_UPDATE_FW_FLAG_DIAG_FW	0x0008  /* if flag is cleared then */
849 						/* it must be an fw op */
850 typedef struct _MENLO_UPDATE_FW {
851 	unsigned char *pFwDataBytes;
852 	UINT32 TotalByteCount;
853 	UINT16 Flags;
854 	UINT16 Reserved;
855 } MENLO_UPDATE_FW, *PMENLO_UPDATE_FW;
856 
857 #define	CONFIG_PARAM_ID_RESERVED	1
858 #define	CONFIG_PARAM_ID_UIF		2
859 #define	CONFIG_PARAM_ID_FCOE_COS	3
860 #define	CONFIG_PARAM_ID_PAUSE_TYPE	4
861 #define	CONFIG_PARAM_ID_TIMEOUTS	5
862 
863 #define	INFO_DATA_TYPE_CONFIG_LOG_DATA	1	/* Fetch Config Log Data */
864 #define	INFO_DATA_TYPE_LOG_DATA		2	/* Fetch Log Data */
865 #define	INFO_DATA_TYPE_PORT_STATISTICS	3	/* Fetch Port Statistics */
866 #define	INFO_DATA_TYPE_LIF_STATISTICS	4	/* Fetch LIF Statistics */
867 #define	INFO_DATA_TYPE_ASIC_STATISTICS	5	/* Fetch ASIC Statistics */
868 #define	INFO_DATA_TYPE_CONFIG_PARAMETERS 6	/* Fetch Config Parameters */
869 #define	INFO_DATA_TYPE_PANIC_LOG	7	/* Fetch Panic Log */
870 
871 /*
872  * InfoContext defines for INFO_DATA_TYPE_LOG_DATA
873  */
874 #define	IC_LOG_DATA_LOG_ID_DEBUG_LOG			0
875 #define	IC_LOG_DATA_LOG_ID_LEARN_LOG			1
876 #define	IC_LOG_DATA_LOG_ID_FC_ACL_INGRESS_LOG		2
877 #define	IC_LOG_DATA_LOG_ID_FC_ACL_EGRESS_LOG		3
878 #define	IC_LOG_DATA_LOG_ID_ETHERNET_ACL_INGRESS_LOG	4
879 #define	IC_LOG_DATA_LOG_ID_ETHERNET_ACL_EGRESS_LOG	5
880 #define	IC_LOG_DATA_LOG_ID_MESSAGE_TRANSMIT_LOG		6
881 #define	IC_LOG_DATA_LOG_ID_MESSAGE_RECEIVE_LOG		7
882 #define	IC_LOG_DATA_LOG_ID_LINK_EVENT_LOG		8
883 #define	IC_LOG_DATA_LOG_ID_DCX_LOG			9
884 
885 /*
886  * InfoContext defines for INFO_DATA_TYPE_PORT_STATISTICS
887  */
888 #define	IC_PORT_STATISTICS_PORT_NUMBER_ETHERNET_PORT0	0
889 #define	IC_PORT_STATISTICS_PORT_NUMBER_ETHERNET_PORT1	1
890 #define	IC_PORT_STATISTICS_PORT_NUMBER_NSL_PORT0	2
891 #define	IC_PORT_STATISTICS_PORT_NUMBER_NSL_PORT1	3
892 #define	IC_PORT_STATISTICS_PORT_NUMBER_FC_PORT0		4
893 #define	IC_PORT_STATISTICS_PORT_NUMBER_FC_PORT1		5
894 
895 /*
896  * InfoContext defines for INFO_DATA_TYPE_LIF_STATISTICS
897  */
898 #define	IC_LIF_STATISTICS_LIF_NUMBER_ETHERNET_PORT0	0
899 #define	IC_LIF_STATISTICS_LIF_NUMBER_ETHERNET_PORT1	1
900 #define	IC_LIF_STATISTICS_LIF_NUMBER_FC_PORT0		2
901 #define	IC_LIF_STATISTICS_LIF_NUMBER_FC_PORT1		3
902 #define	IC_LIF_STATISTICS_LIF_NUMBER_CPU		6
903 
904 typedef struct _MENLO_ACCESS_PARAMETERS {
905 	union {
906 		struct {
907 			UINT32 StartingAddr;
908 			UINT32 Reserved2;
909 			UINT32 Reserved3;
910 		} MenloMemory;		/* For Read & Write Menlo Memory */
911 
912 		struct {
913 			UINT32 ConfigParamID;
914 			UINT32 ConfigParamData0;
915 			UINT32 ConfigParamData1;
916 		} MenloConfig;		/* For change Configuration */
917 
918 		struct {
919 			UINT32 InfoDataType;
920 			UINT32 InfoContext;
921 			UINT32 Reserved;
922 		} MenloInfo;		/* For fetch Menlo Info */
923 	} ap;
924 } MENLO_ACCESS_PARAMETERS, *PMENLO_ACCESS_PARAMETERS;
925 
926 #define	INFO_DATA_TYPE_LOG_CONFIG_TBC		((10*7)+1)*4
927 #define	INFO_DATA_TYPE_PORT_STAT_ETH_TBC	0x194
928 #define	INFO_DATA_TYPE_PORT_STAT_FC_TBC		0xC0
929 #define	INFO_DATA_TYPE_LIF_STAT_TBC		0x40
930 #define	INFO_DATA_TYPE_ASIC_STAT_TBC		0x5F8
931 #define	INFO_DATA_TYPE_CONFIG_TBC		0x140
932 
933 #define	MENLO_OP_READ_MEM	0	/* Read Menlo Memory */
934 #define	MENLO_OP_WRITE_MEM	1	/* Write Menlo Memory */
935 #define	MENLO_OP_CHANGE_CONFIG	2	/* Change Configuration */
936 #define	MENLO_OP_GET_INFO	3	/* Fetch Menlo Info (Logs, & */
937 					/* Statistics, Configuration) */
938 
939 typedef struct _MENLO_MANAGE_INFO {
940 	unsigned char *pDataBytes;
941 	MENLO_ACCESS_PARAMETERS Parameters;
942 	UINT32 TotalByteCount;
943 	UINT16 Operation;
944 	UINT16 Reserved;
945 } MENLO_MANAGE_INFO, *PMENLO_MANAGE_INFO;
946 
947 #define	MENLO_FC_CHECKSUM_FAILURE	0x01
948 #define	MENLO_FC_INVALID_LENGTH		0x02
949 #define	MENLO_FC_INVALID_ADDRESS	0x04
950 #define	MENLO_FC_INVALID_CONFIG_ID_TYPE	0x05
951 #define	MENLO_FC_INVALID_CONFIG_DATA	0x06
952 #define	MENLO_FC_INVALID_INFO_CONTEXT	0x07
953 
954 typedef struct _SD_MENLO_MGT {
955 	union {
956 		MENLO_RESET		MenloReset;
957 		MENLO_GET_FW_VERSION	MenloGetFwVer;
958 		MENLO_UPDATE_FW		MenloUpdateFw;
959 		MENLO_MANAGE_INFO	MenloManageInfo;
960 	} sp;
961 } SD_MENLO_MGT, *PSD_MENLO_MGT;
962 
963 /*
964  * vport struct definations
965  */
966 typedef struct _EXT_VPORT_ID_CNT {
967 	UINT32		VpCnt;
968 	UINT8		VpId[256];
969 } EXT_VPORT_ID_CNT, *PEXT_VPORT_ID_CNT;
970 
971 typedef struct _EXT_VPORT_INFO {
972 	UINT32		free;
973 	UINT32		used;
974 	UINT32		id;
975 	UINT32		state;
976 	UINT32		bound;
977 	UINT8		wwnn[EXT_DEF_WWN_NAME_SIZE];
978 	UINT8		wwpn[EXT_DEF_WWN_NAME_SIZE];
979 	UINT8		reserved[220];
980 } EXT_VPORT_INFO, *PEXT_VPORT_INFO;
981 
982 #ifdef	__cplusplus
983 }
984 #endif
985 
986 #endif /* _EXIOCT_H */
987