xref: /onnv-gate/usr/src/uts/common/sys/fibre-channel/fcio.h (revision 7836:4e95154b5b7a)
1*7836SJohn.Forte@Sun.COM /*
2*7836SJohn.Forte@Sun.COM  * CDDL HEADER START
3*7836SJohn.Forte@Sun.COM  *
4*7836SJohn.Forte@Sun.COM  * The contents of this file are subject to the terms of the
5*7836SJohn.Forte@Sun.COM  * Common Development and Distribution License (the "License").
6*7836SJohn.Forte@Sun.COM  * You may not use this file except in compliance with the License.
7*7836SJohn.Forte@Sun.COM  *
8*7836SJohn.Forte@Sun.COM  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*7836SJohn.Forte@Sun.COM  * or http://www.opensolaris.org/os/licensing.
10*7836SJohn.Forte@Sun.COM  * See the License for the specific language governing permissions
11*7836SJohn.Forte@Sun.COM  * and limitations under the License.
12*7836SJohn.Forte@Sun.COM  *
13*7836SJohn.Forte@Sun.COM  * When distributing Covered Code, include this CDDL HEADER in each
14*7836SJohn.Forte@Sun.COM  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*7836SJohn.Forte@Sun.COM  * If applicable, add the following below this CDDL HEADER, with the
16*7836SJohn.Forte@Sun.COM  * fields enclosed by brackets "[]" replaced with your own identifying
17*7836SJohn.Forte@Sun.COM  * information: Portions Copyright [yyyy] [name of copyright owner]
18*7836SJohn.Forte@Sun.COM  *
19*7836SJohn.Forte@Sun.COM  * CDDL HEADER END
20*7836SJohn.Forte@Sun.COM  */
21*7836SJohn.Forte@Sun.COM /*
22*7836SJohn.Forte@Sun.COM  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23*7836SJohn.Forte@Sun.COM  * Use is subject to license terms.
24*7836SJohn.Forte@Sun.COM  */
25*7836SJohn.Forte@Sun.COM 
26*7836SJohn.Forte@Sun.COM #ifndef	_FCIO_H
27*7836SJohn.Forte@Sun.COM #define	_FCIO_H
28*7836SJohn.Forte@Sun.COM 
29*7836SJohn.Forte@Sun.COM 
30*7836SJohn.Forte@Sun.COM #include <sys/note.h>
31*7836SJohn.Forte@Sun.COM #include <sys/fibre-channel/fc_types.h>
32*7836SJohn.Forte@Sun.COM #include <sys/fibre-channel/fc_appif.h>
33*7836SJohn.Forte@Sun.COM 
34*7836SJohn.Forte@Sun.COM #ifdef	__cplusplus
35*7836SJohn.Forte@Sun.COM extern "C" {
36*7836SJohn.Forte@Sun.COM #endif
37*7836SJohn.Forte@Sun.COM 
38*7836SJohn.Forte@Sun.COM /*
39*7836SJohn.Forte@Sun.COM  * ioctl definitions
40*7836SJohn.Forte@Sun.COM  */
41*7836SJohn.Forte@Sun.COM #define	FCTIO				('F'<< 8)
42*7836SJohn.Forte@Sun.COM 
43*7836SJohn.Forte@Sun.COM /*
44*7836SJohn.Forte@Sun.COM  * New ioctl definitions
45*7836SJohn.Forte@Sun.COM  */
46*7836SJohn.Forte@Sun.COM #define	FCIO_CMD			(FCTIO | 1998)
47*7836SJohn.Forte@Sun.COM #define	FCIO_SUB_CMD			('Z' << 8)
48*7836SJohn.Forte@Sun.COM #define	FCIO_GET_NUM_DEVS		(FCIO_SUB_CMD + 0x01)
49*7836SJohn.Forte@Sun.COM #define	FCIO_GET_DEV_LIST		(FCIO_SUB_CMD + 0x02)
50*7836SJohn.Forte@Sun.COM #define	FCIO_GET_SYM_PNAME		(FCIO_SUB_CMD + 0x03)
51*7836SJohn.Forte@Sun.COM #define	FCIO_GET_SYM_NNAME		(FCIO_SUB_CMD + 0x04)
52*7836SJohn.Forte@Sun.COM #define	FCIO_SET_SYM_PNAME		(FCIO_SUB_CMD + 0x05)
53*7836SJohn.Forte@Sun.COM #define	FCIO_SET_SYM_NNAME		(FCIO_SUB_CMD + 0x06)
54*7836SJohn.Forte@Sun.COM #define	FCIO_GET_LOGI_PARAMS		(FCIO_SUB_CMD + 0x07)
55*7836SJohn.Forte@Sun.COM #define	FCIO_DEV_LOGIN			(FCIO_SUB_CMD + 0x08)
56*7836SJohn.Forte@Sun.COM #define	FCIO_DEV_LOGOUT			(FCIO_SUB_CMD + 0x09)
57*7836SJohn.Forte@Sun.COM #define	FCIO_GET_STATE			(FCIO_SUB_CMD + 0x0A)
58*7836SJohn.Forte@Sun.COM #define	FCIO_DEV_REMOVE			(FCIO_SUB_CMD + 0x0B)
59*7836SJohn.Forte@Sun.COM #define	FCIO_GET_FCODE_REV		(FCIO_SUB_CMD + 0x0C)
60*7836SJohn.Forte@Sun.COM #define	FCIO_GET_FW_REV			(FCIO_SUB_CMD + 0x0D)
61*7836SJohn.Forte@Sun.COM #define	FCIO_GET_DUMP_SIZE		(FCIO_SUB_CMD + 0x0E)
62*7836SJohn.Forte@Sun.COM #define	FCIO_FORCE_DUMP			(FCIO_SUB_CMD + 0x0F)
63*7836SJohn.Forte@Sun.COM #define	FCIO_GET_DUMP			(FCIO_SUB_CMD + 0x10)
64*7836SJohn.Forte@Sun.COM #define	FCIO_GET_TOPOLOGY		(FCIO_SUB_CMD + 0x11)
65*7836SJohn.Forte@Sun.COM #define	FCIO_RESET_LINK			(FCIO_SUB_CMD + 0x12)
66*7836SJohn.Forte@Sun.COM #define	FCIO_RESET_HARD			(FCIO_SUB_CMD + 0x13)
67*7836SJohn.Forte@Sun.COM #define	FCIO_RESET_HARD_CORE		(FCIO_SUB_CMD + 0x14)
68*7836SJohn.Forte@Sun.COM #define	FCIO_DIAG			(FCIO_SUB_CMD + 0x15)
69*7836SJohn.Forte@Sun.COM #define	FCIO_NS				(FCIO_SUB_CMD + 0x16)
70*7836SJohn.Forte@Sun.COM #define	FCIO_DOWNLOAD_FW		(FCIO_SUB_CMD + 0x17)
71*7836SJohn.Forte@Sun.COM #define	FCIO_GET_HOST_PARAMS		(FCIO_SUB_CMD + 0x18)
72*7836SJohn.Forte@Sun.COM #define	FCIO_LINK_STATUS		(FCIO_SUB_CMD + 0x19)
73*7836SJohn.Forte@Sun.COM #define	FCIO_DOWNLOAD_FCODE		(FCIO_SUB_CMD + 0x1A)
74*7836SJohn.Forte@Sun.COM #define	FCIO_GET_NODE_ID		(FCIO_SUB_CMD + 0x1B)
75*7836SJohn.Forte@Sun.COM #define	FCIO_SET_NODE_ID		(FCIO_SUB_CMD + 0x1C)
76*7836SJohn.Forte@Sun.COM #define	FCIO_SEND_NODE_ID		(FCIO_SUB_CMD + 0x1D)
77*7836SJohn.Forte@Sun.COM 
78*7836SJohn.Forte@Sun.COM /*
79*7836SJohn.Forte@Sun.COM  * IOCTLs to handle T11's FC-HBA library
80*7836SJohn.Forte@Sun.COM  */
81*7836SJohn.Forte@Sun.COM #define	FCIO_GET_ADAPTER_ATTRIBUTES	(FCIO_SUB_CMD + 0x1E)
82*7836SJohn.Forte@Sun.COM #define	FCIO_GET_OTHER_ADAPTER_PORTS	(FCIO_SUB_CMD + 0x1F)
83*7836SJohn.Forte@Sun.COM #define	FCIO_GET_ADAPTER_PORT_ATTRIBUTES    (FCIO_SUB_CMD + 0x20)
84*7836SJohn.Forte@Sun.COM #define	FCIO_GET_DISCOVERED_PORT_ATTRIBUTES (FCIO_SUB_CMD + 0x21)
85*7836SJohn.Forte@Sun.COM #define	FCIO_GET_PORT_ATTRIBUTES	(FCIO_SUB_CMD + 0x22)
86*7836SJohn.Forte@Sun.COM #define	FCIO_GET_ADAPTER_PORT_STATS	(FCIO_SUB_CMD + 0x23)
87*7836SJohn.Forte@Sun.COM #define	FCIO_GET_ADAPTER_PORT_NPIV_ATTRIBUTES   (FCIO_SUB_CMD + 0x24)
88*7836SJohn.Forte@Sun.COM #define	FCIO_CREATE_NPIV_PORT		(FCIO_SUB_CMD + 0x25)
89*7836SJohn.Forte@Sun.COM #define	FCIO_GET_NPIV_ATTRIBUTES	(FCIO_SUB_CMD + 0x26)
90*7836SJohn.Forte@Sun.COM #define	FCIO_GET_DISCOVERED_NPIV_ATTRIBUTES	(FCIO_SUB_CMD + 0x27)
91*7836SJohn.Forte@Sun.COM #define	FCIO_GET_NPIV_PORT_LIST		(FCIO_SUB_CMD + 0x28)
92*7836SJohn.Forte@Sun.COM #define	FCIO_DELETE_NPIV_PORT		(FCIO_SUB_CMD + 0x29)
93*7836SJohn.Forte@Sun.COM #define	FCIO_NPIV_GET_ADAPTER_ATTRIBUTES	(FCIO_SUB_CMD + 0x2a)
94*7836SJohn.Forte@Sun.COM 
95*7836SJohn.Forte@Sun.COM 
96*7836SJohn.Forte@Sun.COM /*
97*7836SJohn.Forte@Sun.COM  * Fixed diag_codes for FCIO_DIAG. These is supported by all FCAs.
98*7836SJohn.Forte@Sun.COM  * No FCA should define ioctls in this range.
99*7836SJohn.Forte@Sun.COM  */
100*7836SJohn.Forte@Sun.COM #define	FCIO_DIAG_PORT_DISABLE		(FCIO_SUB_CMD + 0x80)
101*7836SJohn.Forte@Sun.COM #define	FCIO_DIAG_PORT_ENABLE		(FCIO_SUB_CMD + 0x81)
102*7836SJohn.Forte@Sun.COM 
103*7836SJohn.Forte@Sun.COM /* cmd_flags for FCIO_LINK_STATUS ioctl */
104*7836SJohn.Forte@Sun.COM #define	FCIO_CFLAGS_RLS_DEST_NPORT	0x0000
105*7836SJohn.Forte@Sun.COM #define	FCIO_CFLAGS_RLS_DEST_FPORT	0x0001
106*7836SJohn.Forte@Sun.COM 
107*7836SJohn.Forte@Sun.COM /*
108*7836SJohn.Forte@Sun.COM  * Note about fc_port_dev_t structure : The dev_did.priv_lilp_posit field will
109*7836SJohn.Forte@Sun.COM  * return the lilp map position of the port for diagnostics to use.
110*7836SJohn.Forte@Sun.COM  * It is important to note that dev_did.priv_lilp_posit field will only have
111*7836SJohn.Forte@Sun.COM  * valid loop position for Private Loop devices ONLY and the value
112*7836SJohn.Forte@Sun.COM  * contained in this field for other topologies will be undetermined.
113*7836SJohn.Forte@Sun.COM  */
114*7836SJohn.Forte@Sun.COM typedef struct fc_port_dev {
115*7836SJohn.Forte@Sun.COM 	uchar_t		dev_dtype;		/* SCSI device type */
116*7836SJohn.Forte@Sun.COM 	uint32_t	dev_type[8];		/* protocol specific */
117*7836SJohn.Forte@Sun.COM 	uint32_t	dev_state;		/* port state */
118*7836SJohn.Forte@Sun.COM 	fc_portid_t	dev_did;		/* Destination Identifier */
119*7836SJohn.Forte@Sun.COM 	fc_hardaddr_t	dev_hard_addr;		/* Hard address */
120*7836SJohn.Forte@Sun.COM 	la_wwn_t	dev_pwwn;		/* port WWN */
121*7836SJohn.Forte@Sun.COM 	la_wwn_t	dev_nwwn;		/* node WWN */
122*7836SJohn.Forte@Sun.COM } fc_port_dev_t;
123*7836SJohn.Forte@Sun.COM 
124*7836SJohn.Forte@Sun.COM #if defined(_SYSCALL32)
125*7836SJohn.Forte@Sun.COM 
126*7836SJohn.Forte@Sun.COM #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
127*7836SJohn.Forte@Sun.COM #pragma pack(4)
128*7836SJohn.Forte@Sun.COM #endif
129*7836SJohn.Forte@Sun.COM 
130*7836SJohn.Forte@Sun.COM typedef struct fc_port_dev32 {
131*7836SJohn.Forte@Sun.COM 	uchar_t		dev_dtype;		/* SCSI device type */
132*7836SJohn.Forte@Sun.COM 	uint32_t	dev_type[8];		/* protocol specific */
133*7836SJohn.Forte@Sun.COM 	uint32_t	dev_state;		/* port state */
134*7836SJohn.Forte@Sun.COM 	fc_portid_t	dev_did;		/* Destination Identifier */
135*7836SJohn.Forte@Sun.COM 	fc_hardaddr_t	dev_hard_addr;		/* Hard address */
136*7836SJohn.Forte@Sun.COM 	la_wwn_t	dev_pwwn;		/* port WWN */
137*7836SJohn.Forte@Sun.COM 	la_wwn_t	dev_nwwn;		/* node WWN */
138*7836SJohn.Forte@Sun.COM } fc_port_dev32_t;
139*7836SJohn.Forte@Sun.COM 
140*7836SJohn.Forte@Sun.COM #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
141*7836SJohn.Forte@Sun.COM #pragma pack()
142*7836SJohn.Forte@Sun.COM #endif
143*7836SJohn.Forte@Sun.COM 
144*7836SJohn.Forte@Sun.COM #endif	/* _SYSCALL32 */
145*7836SJohn.Forte@Sun.COM 
146*7836SJohn.Forte@Sun.COM typedef struct fc_port_dev fc_ns_map_entry_t;
147*7836SJohn.Forte@Sun.COM 
148*7836SJohn.Forte@Sun.COM /*
149*7836SJohn.Forte@Sun.COM  * fcio_xfer definitions
150*7836SJohn.Forte@Sun.COM  */
151*7836SJohn.Forte@Sun.COM #define	FCIO_XFER_NONE		0x00
152*7836SJohn.Forte@Sun.COM #define	FCIO_XFER_READ		0x01
153*7836SJohn.Forte@Sun.COM #define	FCIO_XFER_WRITE		0x02
154*7836SJohn.Forte@Sun.COM #define	FCIO_XFER_RW		(FCIO_XFER_READ | FCIO_XFER_WRITE)
155*7836SJohn.Forte@Sun.COM 
156*7836SJohn.Forte@Sun.COM typedef struct fcio {
157*7836SJohn.Forte@Sun.COM 	uint16_t	fcio_xfer;	/* direction */
158*7836SJohn.Forte@Sun.COM 	uint16_t	fcio_cmd;	/* sub command */
159*7836SJohn.Forte@Sun.COM 	uint16_t	fcio_flags;	/* flags */
160*7836SJohn.Forte@Sun.COM 	uint16_t	fcio_cmd_flags;	/* command specific flags */
161*7836SJohn.Forte@Sun.COM 	size_t		fcio_ilen;	/* Input buffer length */
162*7836SJohn.Forte@Sun.COM 	caddr_t		fcio_ibuf;	/* Input buffer */
163*7836SJohn.Forte@Sun.COM 	size_t		fcio_olen;	/* Output buffer length */
164*7836SJohn.Forte@Sun.COM 	caddr_t		fcio_obuf;	/* Output buffer */
165*7836SJohn.Forte@Sun.COM 	size_t		fcio_alen;	/* Auxillary buffer length */
166*7836SJohn.Forte@Sun.COM 	caddr_t		fcio_abuf;	/* Auxillary buffer */
167*7836SJohn.Forte@Sun.COM 	int		fcio_errno;	/* FC internal error code */
168*7836SJohn.Forte@Sun.COM } fcio_t;
169*7836SJohn.Forte@Sun.COM 
170*7836SJohn.Forte@Sun.COM /*
171*7836SJohn.Forte@Sun.COM  * T11 FC-HBA exchange structures
172*7836SJohn.Forte@Sun.COM  */
173*7836SJohn.Forte@Sun.COM #define	FC_HBA_LIST_VERSION		    1
174*7836SJohn.Forte@Sun.COM typedef struct fc_hba_list {
175*7836SJohn.Forte@Sun.COM 	uint32_t		version;    /* Set to FC_HBA_LIST_VERSION */
176*7836SJohn.Forte@Sun.COM 	uint32_t		numAdapters;
177*7836SJohn.Forte@Sun.COM 	uint64_t		reserved;
178*7836SJohn.Forte@Sun.COM 	char			hbaPaths[1][MAXPATHLEN]; /* numAdapters long */
179*7836SJohn.Forte@Sun.COM } fc_hba_list_t;
180*7836SJohn.Forte@Sun.COM 
181*7836SJohn.Forte@Sun.COM #define	FC_HBA_NPIV_PORT_LIST_VERSION	1
182*7836SJohn.Forte@Sun.COM typedef struct fc_hba_npiv_port_list {
183*7836SJohn.Forte@Sun.COM 	uint32_t		version;
184*7836SJohn.Forte@Sun.COM 	uint32_t		numAdapters;
185*7836SJohn.Forte@Sun.COM 	uint64_t		reserved;
186*7836SJohn.Forte@Sun.COM 	char			hbaPaths[1][MAXPATHLEN];
187*7836SJohn.Forte@Sun.COM } fc_hba_npiv_port_list_t;
188*7836SJohn.Forte@Sun.COM 
189*7836SJohn.Forte@Sun.COM #define	FC_HBA_NPIV_ATTRIBUTES_VERSION	1
190*7836SJohn.Forte@Sun.COM typedef struct fc_hba_npiv_attributes {
191*7836SJohn.Forte@Sun.COM 	uint32_t		version;
192*7836SJohn.Forte@Sun.COM 	la_wwn_t		NodeWWN;
193*7836SJohn.Forte@Sun.COM 	la_wwn_t		PortWWN;
194*7836SJohn.Forte@Sun.COM 	fc_hba_state_change_t	lastChange;
195*7836SJohn.Forte@Sun.COM } fc_hba_npiv_attributes_t;
196*7836SJohn.Forte@Sun.COM 
197*7836SJohn.Forte@Sun.COM #define	FC_HBA_PORT_NPIV_ATTRIBUTES_VERSION	1
198*7836SJohn.Forte@Sun.COM typedef struct fc_hba_port_npiv_attributes {
199*7836SJohn.Forte@Sun.COM 	uint32_t		version;
200*7836SJohn.Forte@Sun.COM 	int			npivflag;
201*7836SJohn.Forte@Sun.COM 	fc_hba_state_change_t	lastChange;
202*7836SJohn.Forte@Sun.COM 	la_wwn_t		NodeWWN;
203*7836SJohn.Forte@Sun.COM 	la_wwn_t		PortWWN;
204*7836SJohn.Forte@Sun.COM 	uint32_t		MaxNumberOfNPIVPorts;
205*7836SJohn.Forte@Sun.COM 	uint32_t		NumberOfNPIVPorts;
206*7836SJohn.Forte@Sun.COM } fc_hba_port_npiv_attributes_t;
207*7836SJohn.Forte@Sun.COM 
208*7836SJohn.Forte@Sun.COM #define	FC_HBA_SINGLE_VERSION		    1
209*7836SJohn.Forte@Sun.COM typedef struct fc_hba_single {
210*7836SJohn.Forte@Sun.COM 	uint32_t		version;    /* Set to FC_HBA_SINGLE_VERSION */
211*7836SJohn.Forte@Sun.COM 	uint64_t		reserved;
212*7836SJohn.Forte@Sun.COM 	char			hbaPath[MAXPATHLEN];
213*7836SJohn.Forte@Sun.COM } fc_hba_single_t;
214*7836SJohn.Forte@Sun.COM 
215*7836SJohn.Forte@Sun.COM #define	FC_HBA_ADAPTER_ATTRIBUTES_VERSION   1
216*7836SJohn.Forte@Sun.COM typedef struct fc_hba_adapter_attributes {
217*7836SJohn.Forte@Sun.COM 	uint32_t    version;	/* Set to FC_HBA_ADAPTER_ATTRIBUTES_VERSION */
218*7836SJohn.Forte@Sun.COM 	char	    Manufacturer[64];
219*7836SJohn.Forte@Sun.COM 	char	    SerialNumber[64];
220*7836SJohn.Forte@Sun.COM 	char	    Model[256];
221*7836SJohn.Forte@Sun.COM 	char	    ModelDescription[256];
222*7836SJohn.Forte@Sun.COM 	la_wwn_t    NodeWWN;
223*7836SJohn.Forte@Sun.COM 	char	    NodeSymbolicName[256];
224*7836SJohn.Forte@Sun.COM 	char	    HardwareVersion[256];
225*7836SJohn.Forte@Sun.COM 	char	    DriverVersion[256];
226*7836SJohn.Forte@Sun.COM 	char	    OptionROMVersion[256];
227*7836SJohn.Forte@Sun.COM 	char	    FirmwareVersion[256];
228*7836SJohn.Forte@Sun.COM 	uint32_t    VendorSpecificID;
229*7836SJohn.Forte@Sun.COM 	uint32_t    NumberOfPorts;
230*7836SJohn.Forte@Sun.COM 	char	    DriverName[256];
231*7836SJohn.Forte@Sun.COM 	uint64_t    reserved;
232*7836SJohn.Forte@Sun.COM } fc_hba_adapter_attributes_t;
233*7836SJohn.Forte@Sun.COM 
234*7836SJohn.Forte@Sun.COM #if defined(_SYSCALL32)
235*7836SJohn.Forte@Sun.COM 
236*7836SJohn.Forte@Sun.COM #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
237*7836SJohn.Forte@Sun.COM #pragma pack(4)
238*7836SJohn.Forte@Sun.COM #endif
239*7836SJohn.Forte@Sun.COM 
240*7836SJohn.Forte@Sun.COM typedef struct fc_hba_adapter_attributes32 {
241*7836SJohn.Forte@Sun.COM 	uint32_t    version;	/* Set to FC_HBA_ADAPTER_ATTRIBUTES_VERSION */
242*7836SJohn.Forte@Sun.COM 	char	    Manufacturer[64];
243*7836SJohn.Forte@Sun.COM 	char	    SerialNumber[64];
244*7836SJohn.Forte@Sun.COM 	char	    Model[256];
245*7836SJohn.Forte@Sun.COM 	char	    ModelDescription[256];
246*7836SJohn.Forte@Sun.COM 	la_wwn_t    NodeWWN;
247*7836SJohn.Forte@Sun.COM 	char	    NodeSymbolicName[256];
248*7836SJohn.Forte@Sun.COM 	char	    HardwareVersion[256];
249*7836SJohn.Forte@Sun.COM 	char	    DriverVersion[256];
250*7836SJohn.Forte@Sun.COM 	char	    OptionROMVersion[256];
251*7836SJohn.Forte@Sun.COM 	char	    FirmwareVersion[256];
252*7836SJohn.Forte@Sun.COM 	uint32_t    VendorSpecificID;
253*7836SJohn.Forte@Sun.COM 	uint32_t    NumberOfPorts;
254*7836SJohn.Forte@Sun.COM 	char	    DriverName[256];
255*7836SJohn.Forte@Sun.COM 	uint64_t    reserved;
256*7836SJohn.Forte@Sun.COM } fc_hba_adapter_attributes32_t;
257*7836SJohn.Forte@Sun.COM 
258*7836SJohn.Forte@Sun.COM #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
259*7836SJohn.Forte@Sun.COM #pragma pack()
260*7836SJohn.Forte@Sun.COM #endif
261*7836SJohn.Forte@Sun.COM 
262*7836SJohn.Forte@Sun.COM #endif	/* defined(_SYSCALL32) */
263*7836SJohn.Forte@Sun.COM 
264*7836SJohn.Forte@Sun.COM #define	FC_HBA_PORT_ATTRIBUTES_VERSION	    1
265*7836SJohn.Forte@Sun.COM typedef struct fc_hba_port_attributes {
266*7836SJohn.Forte@Sun.COM 	uint32_t		version; /* FC_HBA_PORT_ATTRIBUTES_VERSION */
267*7836SJohn.Forte@Sun.COM 	fc_hba_state_change_t	lastChange;
268*7836SJohn.Forte@Sun.COM 	minor_t			fp_minor;
269*7836SJohn.Forte@Sun.COM 	la_wwn_t		NodeWWN;
270*7836SJohn.Forte@Sun.COM 	la_wwn_t		PortWWN;
271*7836SJohn.Forte@Sun.COM 	uint32_t		PortFcId;
272*7836SJohn.Forte@Sun.COM 	uint32_t		PortType;
273*7836SJohn.Forte@Sun.COM 	uint32_t		PortState;
274*7836SJohn.Forte@Sun.COM 	uint32_t		PortSupportedClassofService;
275*7836SJohn.Forte@Sun.COM 	uint8_t			PortSupportedFc4Types[32];
276*7836SJohn.Forte@Sun.COM 	uint8_t			PortActiveFc4Types[32];
277*7836SJohn.Forte@Sun.COM 	char			PortSymbolicName[256];
278*7836SJohn.Forte@Sun.COM 	uint32_t		PortSupportedSpeed;
279*7836SJohn.Forte@Sun.COM 	uint32_t		PortSpeed;
280*7836SJohn.Forte@Sun.COM 	uint32_t		PortMaxFrameSize;
281*7836SJohn.Forte@Sun.COM 	la_wwn_t		FabricName;
282*7836SJohn.Forte@Sun.COM 	uint32_t		NumberofDiscoveredPorts;
283*7836SJohn.Forte@Sun.COM 	uint64_t		reserved;
284*7836SJohn.Forte@Sun.COM } fc_hba_port_attributes_t;
285*7836SJohn.Forte@Sun.COM 
286*7836SJohn.Forte@Sun.COM #if defined(_SYSCALL32)
287*7836SJohn.Forte@Sun.COM 
288*7836SJohn.Forte@Sun.COM #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
289*7836SJohn.Forte@Sun.COM #pragma pack(4)
290*7836SJohn.Forte@Sun.COM #endif
291*7836SJohn.Forte@Sun.COM 
292*7836SJohn.Forte@Sun.COM typedef struct fc_hba_port_attributes32 {
293*7836SJohn.Forte@Sun.COM 	uint32_t		version; /* FC_HBA_PORT_ATTRIBUTES_VERSION */
294*7836SJohn.Forte@Sun.COM 	fc_hba_state_change_t	lastChange;
295*7836SJohn.Forte@Sun.COM 	minor_t			fp_minor;
296*7836SJohn.Forte@Sun.COM 	la_wwn_t		NodeWWN;
297*7836SJohn.Forte@Sun.COM 	la_wwn_t		PortWWN;
298*7836SJohn.Forte@Sun.COM 	uint32_t		PortFcId;
299*7836SJohn.Forte@Sun.COM 	uint32_t		PortType;
300*7836SJohn.Forte@Sun.COM 	uint32_t		PortState;
301*7836SJohn.Forte@Sun.COM 	uint32_t		PortSupportedClassofService;
302*7836SJohn.Forte@Sun.COM 	uint8_t			PortSupportedFc4Types[32];
303*7836SJohn.Forte@Sun.COM 	uint8_t			PortActiveFc4Types[32];
304*7836SJohn.Forte@Sun.COM 	char			PortSymbolicName[256];
305*7836SJohn.Forte@Sun.COM 	uint32_t		PortSupportedSpeed;
306*7836SJohn.Forte@Sun.COM 	uint32_t		PortSpeed;
307*7836SJohn.Forte@Sun.COM 	uint32_t		PortMaxFrameSize;
308*7836SJohn.Forte@Sun.COM 	la_wwn_t		FabricName;
309*7836SJohn.Forte@Sun.COM 	uint32_t		NumberofDiscoveredPorts;
310*7836SJohn.Forte@Sun.COM 	uint64_t		reserved;
311*7836SJohn.Forte@Sun.COM } fc_hba_port_attributes32_t;
312*7836SJohn.Forte@Sun.COM 
313*7836SJohn.Forte@Sun.COM #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
314*7836SJohn.Forte@Sun.COM #pragma pack()
315*7836SJohn.Forte@Sun.COM #endif
316*7836SJohn.Forte@Sun.COM 
317*7836SJohn.Forte@Sun.COM #endif	/* defined(_SYSCALL32) */
318*7836SJohn.Forte@Sun.COM 
319*7836SJohn.Forte@Sun.COM #define	FC_HBA_ADAPTER_PORT_STATS_VERSION   1
320*7836SJohn.Forte@Sun.COM typedef struct fc_hba_adapter_port_stats {
321*7836SJohn.Forte@Sun.COM 	uint32_t	    version; /* FC_HBA_ADAPTER_PORT_STATS_VERSION */
322*7836SJohn.Forte@Sun.COM 	uint64_t	    SecondsSinceLastReset;
323*7836SJohn.Forte@Sun.COM 	uint64_t	    TxFrames;
324*7836SJohn.Forte@Sun.COM 	uint64_t	    TxWords;
325*7836SJohn.Forte@Sun.COM 	uint64_t	    RxFrames;
326*7836SJohn.Forte@Sun.COM 	uint64_t	    RxWords;
327*7836SJohn.Forte@Sun.COM 	uint64_t	    LIPCount;
328*7836SJohn.Forte@Sun.COM 	uint64_t	    NOSCount;
329*7836SJohn.Forte@Sun.COM 	uint64_t	    ErrorFrames;
330*7836SJohn.Forte@Sun.COM 	uint64_t	    DumpedFrames;
331*7836SJohn.Forte@Sun.COM 	uint64_t	    LinkFailureCount;
332*7836SJohn.Forte@Sun.COM 	uint64_t	    LossOfSyncCount;
333*7836SJohn.Forte@Sun.COM 	uint64_t	    LossOfSignalCount;
334*7836SJohn.Forte@Sun.COM 	uint64_t	    PrimitiveSeqProtocolErrCount;
335*7836SJohn.Forte@Sun.COM 	uint64_t	    InvalidTxWordCount;
336*7836SJohn.Forte@Sun.COM 	uint64_t	    InvalidCRCCount;
337*7836SJohn.Forte@Sun.COM 	uint64_t	    reserved;
338*7836SJohn.Forte@Sun.COM } fc_hba_adapter_port_stats_t;
339*7836SJohn.Forte@Sun.COM 
340*7836SJohn.Forte@Sun.COM 
341*7836SJohn.Forte@Sun.COM /*
342*7836SJohn.Forte@Sun.COM  * Constant values derived from T11 FC-HBA
343*7836SJohn.Forte@Sun.COM  */
344*7836SJohn.Forte@Sun.COM #define	FC_HBA_PORTTYPE_UNKNOWN		1   /* Unknown */
345*7836SJohn.Forte@Sun.COM #define	FC_HBA_PORTTYPE_OTHER		2   /* Other */
346*7836SJohn.Forte@Sun.COM #define	FC_HBA_PORTTYPE_NOTPRESENT	3   /* Not present */
347*7836SJohn.Forte@Sun.COM #define	FC_HBA_PORTTYPE_NPORT		5   /* Fabric  */
348*7836SJohn.Forte@Sun.COM #define	FC_HBA_PORTTYPE_NLPORT		6   /* Public Loop */
349*7836SJohn.Forte@Sun.COM #define	FC_HBA_PORTTYPE_FLPORT		7
350*7836SJohn.Forte@Sun.COM #define	FC_HBA_PORTTYPE_FPORT		8   /* Fabric Port */
351*7836SJohn.Forte@Sun.COM #define	FC_HBA_PORTTYPE_EPORT		9   /* Fabric expansion port */
352*7836SJohn.Forte@Sun.COM #define	FC_HBA_PORTTYPE_GPORT		10  /* Generic Fabric Port */
353*7836SJohn.Forte@Sun.COM #define	FC_HBA_PORTTYPE_LPORT		20  /* Private Loop */
354*7836SJohn.Forte@Sun.COM #define	FC_HBA_PORTTYPE_PTP		21  /* Point to Point */
355*7836SJohn.Forte@Sun.COM 
356*7836SJohn.Forte@Sun.COM #define	FC_HBA_PORTSTATE_UNKNOWN	1   /* Unknown */
357*7836SJohn.Forte@Sun.COM #define	FC_HBA_PORTSTATE_ONLINE		2   /* Operational */
358*7836SJohn.Forte@Sun.COM #define	FC_HBA_PORTSTATE_OFFLINE	3   /* User Offline */
359*7836SJohn.Forte@Sun.COM #define	FC_HBA_PORTSTATE_BYPASSED	4   /* Bypassed */
360*7836SJohn.Forte@Sun.COM #define	FC_HBA_PORTSTATE_DIAGNOSTICS	5   /* In diagnostics mode */
361*7836SJohn.Forte@Sun.COM #define	FC_HBA_PORTSTATE_LINKDOWN	6   /* Link Down */
362*7836SJohn.Forte@Sun.COM #define	FC_HBA_PORTSTATE_ERROR		7   /* Port Error */
363*7836SJohn.Forte@Sun.COM #define	FC_HBA_PORTSTATE_LOOPBACK	8   /* Loopback */
364*7836SJohn.Forte@Sun.COM 
365*7836SJohn.Forte@Sun.COM 
366*7836SJohn.Forte@Sun.COM 
367*7836SJohn.Forte@Sun.COM #if defined(_SYSCALL32)
368*7836SJohn.Forte@Sun.COM /*
369*7836SJohn.Forte@Sun.COM  * 32 bit varient of fcio_t; to be used
370*7836SJohn.Forte@Sun.COM  * only in the driver and NOT applications
371*7836SJohn.Forte@Sun.COM  */
372*7836SJohn.Forte@Sun.COM struct fcio32 {
373*7836SJohn.Forte@Sun.COM 	uint16_t	fcio_xfer;	/* direction */
374*7836SJohn.Forte@Sun.COM 	uint16_t	fcio_cmd;	/* sub command */
375*7836SJohn.Forte@Sun.COM 	uint16_t	fcio_flags;	/* flags */
376*7836SJohn.Forte@Sun.COM 	uint16_t	fcio_cmd_flags;	/* command specific flags */
377*7836SJohn.Forte@Sun.COM 	size32_t	fcio_ilen;	/* Input buffer length */
378*7836SJohn.Forte@Sun.COM 	caddr32_t	fcio_ibuf;	/* Input buffer */
379*7836SJohn.Forte@Sun.COM 	size32_t	fcio_olen;	/* Output buffer length */
380*7836SJohn.Forte@Sun.COM 	caddr32_t	fcio_obuf;	/* Output buffer */
381*7836SJohn.Forte@Sun.COM 	size32_t	fcio_alen;	/* Auxillary buffer length */
382*7836SJohn.Forte@Sun.COM 	caddr32_t	fcio_abuf;	/* Auxillary buffer */
383*7836SJohn.Forte@Sun.COM 	int		fcio_errno;	/* FC internal error code */
384*7836SJohn.Forte@Sun.COM };
385*7836SJohn.Forte@Sun.COM 
386*7836SJohn.Forte@Sun.COM #if	!defined(__lint)
387*7836SJohn.Forte@Sun.COM _NOTE(SCHEME_PROTECTS_DATA("unique per request", fcio32))
388*7836SJohn.Forte@Sun.COM #endif /* __lint */
389*7836SJohn.Forte@Sun.COM 
390*7836SJohn.Forte@Sun.COM #endif /* _SYSCALL32 */
391*7836SJohn.Forte@Sun.COM 
392*7836SJohn.Forte@Sun.COM #if	!defined(__lint)
393*7836SJohn.Forte@Sun.COM _NOTE(SCHEME_PROTECTS_DATA("unique per request", fcio fc_port_dev))
394*7836SJohn.Forte@Sun.COM #endif /* __lint */
395*7836SJohn.Forte@Sun.COM 
396*7836SJohn.Forte@Sun.COM #ifdef	__cplusplus
397*7836SJohn.Forte@Sun.COM }
398*7836SJohn.Forte@Sun.COM #endif
399*7836SJohn.Forte@Sun.COM 
400*7836SJohn.Forte@Sun.COM #endif	/* _FCIO_H */
401