xref: /titanic_41/usr/src/lib/hbaapi/common/hbaapi-sun.h (revision fcf3ce441efd61da9bb2884968af01cb7c1452cc)
1*fcf3ce44SJohn Forte /*
2*fcf3ce44SJohn Forte  * *****************************************************************************
3*fcf3ce44SJohn Forte  *
4*fcf3ce44SJohn Forte  * Description
5*fcf3ce44SJohn Forte  *	hbaapi.h - header file for Sun extension for target mode adaptor
6*fcf3ce44SJohn Forte  * 		 support.
7*fcf3ce44SJohn Forte  *
8*fcf3ce44SJohn Forte  * License:
9*fcf3ce44SJohn Forte  *	The contents of this file are subject to the SNIA Public License
10*fcf3ce44SJohn Forte  *	Version 1.0 (the "License"); you may not use this file except in
11*fcf3ce44SJohn Forte  *	compliance with the License. You may obtain a copy of the License at
12*fcf3ce44SJohn Forte  *
13*fcf3ce44SJohn Forte  *	/http://www.snia.org/English/Resources/Code/OpenSource.html
14*fcf3ce44SJohn Forte  *
15*fcf3ce44SJohn Forte  *	Software distributed under the License is distributed on an "AS IS"
16*fcf3ce44SJohn Forte  *	basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
17*fcf3ce44SJohn Forte  *	the License for the specific language governing rights and limitations
18*fcf3ce44SJohn Forte  *	under the License.
19*fcf3ce44SJohn Forte  *
20*fcf3ce44SJohn Forte  *******************************************************************************
21*fcf3ce44SJohn Forte  */
22*fcf3ce44SJohn Forte 
23*fcf3ce44SJohn Forte #ifdef __cplusplus
24*fcf3ce44SJohn Forte extern "C" {
25*fcf3ce44SJohn Forte #endif
26*fcf3ce44SJohn Forte 
27*fcf3ce44SJohn Forte 
28*fcf3ce44SJohn Forte #ifndef _HBA_API_SUN_H
29*fcf3ce44SJohn Forte #define _HBA_API_SUN_H
30*fcf3ce44SJohn Forte 
31*fcf3ce44SJohn Forte #include    <hbaapi.h>
32*fcf3ce44SJohn Forte 
33*fcf3ce44SJohn Forte #define	HBA_CREATE_WWN_RANDOM		1
34*fcf3ce44SJohn Forte #define	HBA_CREATE_WWN_FACTORY		2
35*fcf3ce44SJohn Forte 
36*fcf3ce44SJohn Forte typedef struct HBA_NPIVPortList {
37*fcf3ce44SJohn Forte 	uint32_t	numPorts;
38*fcf3ce44SJohn Forte 	char		hbaPaths[1][1024];
39*fcf3ce44SJohn Forte } HBA_NPIVPORTLIST, *PHBA_NPIVPORTLIST;
40*fcf3ce44SJohn Forte 
41*fcf3ce44SJohn Forte typedef struct HBA_PortNPIVAttributes {
42*fcf3ce44SJohn Forte 	HBA_INT32	npivflag;
43*fcf3ce44SJohn Forte 	HBA_WWN		NodeWWN;
44*fcf3ce44SJohn Forte 	HBA_WWN		PortWWN;
45*fcf3ce44SJohn Forte 	HBA_UINT32	MaxNumberOfNPIVPorts;
46*fcf3ce44SJohn Forte 	HBA_UINT32	NumberOfNPIVPorts;
47*fcf3ce44SJohn Forte } HBA_PORTNPIVATTRIBUTES, *PHBA_PORTNPIVATTRIBUTES;
48*fcf3ce44SJohn Forte 
49*fcf3ce44SJohn Forte typedef struct HBA_NPIVAttributes {
50*fcf3ce44SJohn Forte 	HBA_WWN		NodeWWN;
51*fcf3ce44SJohn Forte 	HBA_WWN		PortWWN;
52*fcf3ce44SJohn Forte } HBA_NPIVATTRIBUTES, *PHBA_NPIVATTRIBUTES;
53*fcf3ce44SJohn Forte 
54*fcf3ce44SJohn Forte typedef struct HBA_NPIVCreateEntry {
55*fcf3ce44SJohn Forte 	HBA_WWN		VNodeWWN;
56*fcf3ce44SJohn Forte 	HBA_WWN		VPortWWN;
57*fcf3ce44SJohn Forte 	uint32_t	vindex;
58*fcf3ce44SJohn Forte } HBA_NPIVCREATEENTRY, *PHBA_NPIVCREATEENTRY;
59*fcf3ce44SJohn Forte 
60*fcf3ce44SJohn Forte /* Device Level Events */
61*fcf3ce44SJohn Forte #define	HBA_EVENT_DEVICE_UNKNOWN	0x600
62*fcf3ce44SJohn Forte #define	HBA_EVENT_DEVICE_OFFLINE	0x601
63*fcf3ce44SJohn Forte #define	HBA_EVENT_DEVICE_ONLINE		0x602
64*fcf3ce44SJohn Forte 
65*fcf3ce44SJohn Forte HBA_API HBA_UINT32 Sun_HBA_GetNumberOfTgtAdapters();
66*fcf3ce44SJohn Forte 
67*fcf3ce44SJohn Forte HBA_API HBA_STATUS Sun_HBA_GetTgtAdapterName(
68*fcf3ce44SJohn Forte     HBA_UINT32		adapterindex,
69*fcf3ce44SJohn Forte     char		*adaptername
70*fcf3ce44SJohn Forte     );
71*fcf3ce44SJohn Forte 
72*fcf3ce44SJohn Forte HBA_API HBA_HANDLE Sun_HBA_OpenTgtAdapter(
73*fcf3ce44SJohn Forte     char*		adaptername
74*fcf3ce44SJohn Forte     );
75*fcf3ce44SJohn Forte 
76*fcf3ce44SJohn Forte HBA_API HBA_STATUS Sun_HBA_OpenTgtAdapterByWWN(
77*fcf3ce44SJohn Forte     HBA_HANDLE		*handle,
78*fcf3ce44SJohn Forte     HBA_WWN		wwn
79*fcf3ce44SJohn Forte     );
80*fcf3ce44SJohn Forte 
81*fcf3ce44SJohn Forte HBA_API HBA_STATUS Sun_HBA_NPIVGetAdapterAttributes(
82*fcf3ce44SJohn Forte     HBA_HANDLE		handle,
83*fcf3ce44SJohn Forte     HBA_ADAPTERATTRIBUTES
84*fcf3ce44SJohn Forte 			*hbaattributes
85*fcf3ce44SJohn Forte     );
86*fcf3ce44SJohn Forte HBA_API HBA_STATUS Sun_HBA_GetNPIVPortInfo(
87*fcf3ce44SJohn Forte     HBA_HANDLE		handle,
88*fcf3ce44SJohn Forte     HBA_UINT32		portindex,
89*fcf3ce44SJohn Forte     HBA_UINT32		vportindex,
90*fcf3ce44SJohn Forte     HBA_NPIVATTRIBUTES	*attributes
91*fcf3ce44SJohn Forte     );
92*fcf3ce44SJohn Forte HBA_API HBA_STATUS Sun_HBA_DeleteNPIVPort(
93*fcf3ce44SJohn Forte     HBA_HANDLE		handle,
94*fcf3ce44SJohn Forte     HBA_UINT32		portindex,
95*fcf3ce44SJohn Forte     HBA_WWN		vportWWN
96*fcf3ce44SJohn Forte     );
97*fcf3ce44SJohn Forte HBA_API HBA_STATUS Sun_HBA_CreateNPIVPort(
98*fcf3ce44SJohn Forte     HBA_HANDLE		handle,
99*fcf3ce44SJohn Forte     HBA_UINT32		portindex,
100*fcf3ce44SJohn Forte     HBA_WWN		vnodeWWN,
101*fcf3ce44SJohn Forte     HBA_WWN		vportWWN,
102*fcf3ce44SJohn Forte     HBA_UINT32		*npivportindex
103*fcf3ce44SJohn Forte     );
104*fcf3ce44SJohn Forte HBA_API HBA_STATUS Sun_HBA_GetPortNPIVAttributes(
105*fcf3ce44SJohn Forte     HBA_HANDLE		handle,
106*fcf3ce44SJohn Forte     HBA_UINT32		portindex,
107*fcf3ce44SJohn Forte     HBA_PORTNPIVATTRIBUTES	*portnpivattributes
108*fcf3ce44SJohn Forte     );
109*fcf3ce44SJohn Forte 
110*fcf3ce44SJohn Forte HBA_STATUS Sun_HBA_AdapterCreateWWN(
111*fcf3ce44SJohn Forte     HBA_HANDLE		handle,
112*fcf3ce44SJohn Forte     HBA_UINT32		portindex,
113*fcf3ce44SJohn Forte     HBA_WWN		*nwwn,
114*fcf3ce44SJohn Forte     HBA_WWN		*pwwn,
115*fcf3ce44SJohn Forte     HBA_WWN		*OUI,
116*fcf3ce44SJohn Forte     HBA_INT32		method
117*fcf3ce44SJohn Forte );
118*fcf3ce44SJohn Forte 
119*fcf3ce44SJohn Forte HBA_STATUS Sun_HBA_AdapterReturnWWN(
120*fcf3ce44SJohn Forte     HBA_HANDLE		handle,
121*fcf3ce44SJohn Forte     HBA_UINT32		portindex,
122*fcf3ce44SJohn Forte     HBA_WWN		*nwwn,
123*fcf3ce44SJohn Forte     HBA_WWN		*pwwn
124*fcf3ce44SJohn Forte );
125*fcf3ce44SJohn Forte 
126*fcf3ce44SJohn Forte HBA_API HBA_STATUS Sun_HBA_RegisterForAdapterDeviceEvents(
127*fcf3ce44SJohn Forte     void		(*callback)(
128*fcf3ce44SJohn Forte 	void		*data,
129*fcf3ce44SJohn Forte 	HBA_WWN		PortWWN,
130*fcf3ce44SJohn Forte 	HBA_UINT32	eventType,
131*fcf3ce44SJohn Forte 	HBA_UINT32	fabricPortID
132*fcf3ce44SJohn Forte 	),
133*fcf3ce44SJohn Forte     void		*userData,
134*fcf3ce44SJohn Forte     HBA_HANDLE		handle,
135*fcf3ce44SJohn Forte     HBA_WWN		PortWWN,
136*fcf3ce44SJohn Forte     HBA_CALLBACKHANDLE	*callbackHandle
137*fcf3ce44SJohn Forte     );
138*fcf3ce44SJohn Forte 
139*fcf3ce44SJohn Forte 
140*fcf3ce44SJohn Forte #endif /* HBA_API_SUN_H */
141*fcf3ce44SJohn Forte 
142*fcf3ce44SJohn Forte #ifdef __cplusplus
143*fcf3ce44SJohn Forte }
144*fcf3ce44SJohn Forte #endif /* _HBA_API_SUN_H */
145