xref: /titanic_41/usr/src/lib/smhba/common/vendorsmhbaapi.h (revision 8f588c8376a0fa02470fc4554ec83442b305020f)
1 /*
2  * ****************************************************************************
3  *
4  * Description
5  *	vendorhbaapi.h - incombination with hbaapi.h, defines interface to
6  *		vendor specific API
7  *
8  * License:
9  *	The contents of this file are subject to the SNIA Public License
10  *	Version 1.0 (the "License"); you may not use this file except in
11  *	compliance with the License. You may obtain a copy of the License at
12  *
13  *	/http://www.snia.org/English/Resources/Code/OpenSource.html
14  *
15  *	Software distributed under the License is distributed on an "AS IS"
16  *	basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
17  *	the License for the specific language governing rights and limitations
18  *	under the License.
19  *
20  * The Original Code is  SNIA HBA API general header file
21  *
22  * The Initial Developer of the Original Code is:
23  *	Benjamin F. Kuo, Troika Networks, Inc. (benk@troikanetworks.com)
24  *
25  * Contributor(s):
26  *	Tuan Lam, QLogic Corp. (t_lam@qlc.com)
27  *	Dan Willie, Emulex Corp. (Dan.Willie@emulex.com)
28  *	Dixon Hutchinson, Legato Systems, Inc. (dhutchin@legato.com)
29  *	David Dillard, VERITAS Software Corp. (david.dillard@veritas.com)
30  *
31  * ****************************************************************************
32  *
33  *   Changes:
34  *	12/12/2001 Original revision, code split out of hbaapi.h
35  *	(for other changes... see the CVS logs)
36  * ****************************************************************************
37  */
38 /*
39  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
40  * Use is subject to license terms.
41  */
42 
43 #ifndef _VENDORSMHBAAPI_H_
44 #define	_VENDORSMHBAAPI_H_
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
50 #include <vendorhbaapi.h>
51 
52 /* SM-HBA-2 6.9.2 Function Prototypes */
53 typedef HBA_UINT32 (* SMHBAGetVersionFunc)();
54 typedef HBA_UINT32 (* SMHBAGetWrapperLibraryAttributesFunc)
55 	(HBA_UINT32, SMHBA_LIBRARYATTRIBUTES *);
56 typedef HBA_UINT32 (* SMHBAGetVendorLibraryAttributesFunc)
57 	(SMHBA_LIBRARYATTRIBUTES *);
58 typedef HBA_STATUS (* SMHBAGetAdapterAttributesFunc)
59 	(HBA_HANDLE, SMHBA_ADAPTERATTRIBUTES *);
60 typedef HBA_STATUS (* SMHBAGetNumberOfPortsFunc)
61 	(HBA_HANDLE, HBA_UINT32 *);
62 typedef HBA_STATUS (* SMHBAGetPortTypeFunc)
63 	(HBA_HANDLE, HBA_UINT32, HBA_PORTTYPE *);
64 typedef HBA_STATUS (* SMHBAGetAdapterPortAttributesFunc)
65 	(HBA_HANDLE, HBA_UINT32, SMHBA_PORTATTRIBUTES *);
66 typedef HBA_STATUS (* SMHBAGetDiscoveredPortAttributesFunc)
67 	(HBA_HANDLE, HBA_UINT32, HBA_UINT32, SMHBA_PORTATTRIBUTES *);
68 typedef HBA_STATUS (* SMHBAGetPortAttributesByWWNFunc)
69 	(HBA_HANDLE, HBA_WWN, HBA_WWN, SMHBA_PORTATTRIBUTES *);
70 typedef HBA_STATUS (* SMHBAGetFCPhyAttributesFunc)
71 	(HBA_HANDLE, HBA_UINT32, HBA_UINT32, SMHBA_FC_PHY *);
72 typedef HBA_STATUS (* SMHBAGetSASPhyAttributesFunc)
73 	(HBA_HANDLE, HBA_UINT32, HBA_UINT32, SMHBA_SAS_PHY *);
74 typedef HBA_STATUS (* SMHBAGetProtocolStatisticsFunc)
75 	(HBA_HANDLE, HBA_UINT32, HBA_UINT32, SMHBA_PROTOCOLSTATISTICS *);
76 typedef HBA_STATUS (* SMHBAGetPhyStatisticsFunc)
77 	(HBA_HANDLE, HBA_UINT32, HBA_UINT32, SMHBA_PHYSTATISTICS *);
78 typedef HBA_STATUS (* SMHBASendTESTFunc)
79 	(HBA_HANDLE, HBA_WWN, HBA_WWN, HBA_UINT32, void *, HBA_UINT32);
80 typedef HBA_STATUS (* SMHBASendECHOFunc)
81 	(HBA_HANDLE, HBA_WWN, HBA_WWN, HBA_UINT32, void *, HBA_UINT32,
82 	void *, HBA_UINT32 *);
83 typedef HBA_STATUS (* SMHBASendSMPPassThruFunc)
84 	(HBA_HANDLE, HBA_WWN, HBA_WWN, HBA_WWN, void *, HBA_UINT32, void *,
85 	HBA_UINT32 *);
86 typedef HBA_STATUS (* SMHBAGetBindingCapabilityFunc)
87 	(HBA_HANDLE, HBA_WWN, HBA_WWN, SMHBA_BIND_CAPABILITY *);
88 typedef HBA_STATUS (* SMHBAGetBindingSupportFunc)
89 	(HBA_HANDLE, HBA_WWN, HBA_WWN, SMHBA_BIND_CAPABILITY *);
90 typedef HBA_STATUS (* SMHBASetBindingSupportFunc)
91 	(HBA_HANDLE, HBA_WWN, HBA_WWN, SMHBA_BIND_CAPABILITY);
92 typedef HBA_STATUS (* SMHBAGetTargetMappingFunc)
93 	(HBA_HANDLE, HBA_WWN, HBA_WWN, SMHBA_TARGETMAPPING *);
94 typedef HBA_STATUS (* SMHBAGetPersistentBindingFunc)
95 	(HBA_HANDLE, HBA_WWN, HBA_WWN, SMHBA_BINDING *);
96 typedef HBA_STATUS (* SMHBASetPersistentBindingFunc)
97 	(HBA_HANDLE, HBA_WWN, HBA_WWN, const SMHBA_BINDING *);
98 typedef HBA_STATUS (* SMHBARemovePersistentBindingFunc)
99 	(HBA_HANDLE, HBA_WWN, HBA_WWN, const SMHBA_BINDING *);
100 typedef HBA_STATUS (* SMHBARemoveAllPersistentBindingsFunc)
101 	(HBA_HANDLE, HBA_WWN, HBA_WWN);
102 typedef HBA_STATUS (* SMHBAGetLUNStatisticsFunc)
103 	(HBA_HANDLE, const HBA_SCSIID *, SMHBA_PROTOCOLSTATISTICS *);
104 typedef HBA_STATUS (* SMHBARegisterForAdapterAddEventsFunc)
105 	(void (*)(void *, HBA_WWN, HBA_UINT32), void *, HBA_CALLBACKHANDLE *);
106 typedef HBA_STATUS (* SMHBARegisterForAdapterEventsFunc)
107 	(void (*)(void *, HBA_WWN, HBA_UINT32),
108 	void *, HBA_HANDLE, HBA_CALLBACKHANDLE *);
109 typedef HBA_STATUS    (* SMHBARegisterForAdapterPortEventsFunc)
110 	(void (*)(void *, HBA_WWN, HBA_UINT32, HBA_UINT32),
111 	void *, HBA_HANDLE, HBA_WWN, HBA_UINT32, HBA_CALLBACKHANDLE *);
112 typedef HBA_STATUS    (* SMHBARegisterForAdapterPortStatEventsFunc)
113 	(void (*)(void *, HBA_WWN, HBA_UINT32, HBA_UINT32),
114 	void *, HBA_HANDLE, HBA_WWN, HBA_UINT32, SMHBA_PROTOCOLSTATISTICS,
115 	HBA_UINT32, HBA_CALLBACKHANDLE *);
116 typedef HBA_STATUS    (* SMHBARegisterForAdapterPhyStatEventsFunc)
117 	(void (*)(void *, HBA_WWN, HBA_UINT32, HBA_UINT32),
118 	void *, HBA_HANDLE, HBA_WWN, HBA_UINT32, SMHBA_PHYSTATISTICS,
119 	HBA_UINT32, HBA_CALLBACKHANDLE *);
120 typedef HBA_STATUS    (* SMHBARegisterForTargetEventsFunc)
121 	(void (*)(void *, HBA_WWN, HBA_WWN, HBA_WWN, HBA_UINT32),
122 	void *, HBA_HANDLE, HBA_WWN, HBA_WWN, HBA_WWN,
123 	HBA_CALLBACKHANDLE *, HBA_UINT32);
124 typedef HBA_STATUS    (* SMHBAScsiInquiryFunc)
125 	(HBA_HANDLE, HBA_WWN, HBA_WWN, HBA_WWN, SMHBA_SCSILUN, HBA_UINT8,
126 	HBA_UINT8, void *, HBA_UINT32 *, HBA_UINT8 *, void *, HBA_UINT32 *);
127 typedef HBA_STATUS    (* SMHBAScsiReportLUNsFunc)
128 	(HBA_HANDLE, HBA_WWN, HBA_WWN, HBA_WWN, void *, HBA_UINT32 *,
129 	HBA_UINT8 *, void *, HBA_UINT32 *);
130 typedef HBA_STATUS    (* SMHBAScsiReadCapacityFunc)
131 	(HBA_HANDLE, HBA_WWN, HBA_WWN, HBA_WWN, SMHBA_SCSILUN, void *,
132 	HBA_UINT32 *, HBA_UINT8 *, void *, HBA_UINT32 *);
133 
134 /* SM-HBA-2 6.9.3 Entry Point Data Declarations */
135 typedef struct SMHBA_EntryPoints {
136 	SMHBAGetVersionFunc			GetVersionHandler;
137 	HBALoadLibraryFunc			LoadLibraryHandler;
138 	HBAFreeLibraryFunc			FreeLibraryHandler;
139 	HBAGetNumberOfAdaptersFunc		GetNumberOfAdaptersHandler;
140 	HBARefreshInformationFunc		RefreshInformationHandler;
141 	SMHBAGetVendorLibraryAttributesFunc
142 		GetVendorLibraryAttributesHandler;
143 	HBAGetAdapterNameFunc			GetAdapterNameHandler;
144 	HBAOpenAdapterFunc			OpenAdapterHandler;
145 	HBACloseAdapterFunc			CloseAdapterHandler;
146 	SMHBAGetAdapterAttributesFunc		GetAdapterAttributesHandler;
147 	SMHBAGetNumberOfPortsFunc		GetNumberOfPortsHandler;
148 	SMHBAGetPortTypeFunc			GetPortTypeHandler;
149 	SMHBAGetAdapterPortAttributesFunc
150 		GetAdapterPortAttributesHandler;
151 	SMHBAGetDiscoveredPortAttributesFunc
152 		GetDiscoveredPortAttributesHandler;
153 	SMHBAGetPortAttributesByWWNFunc		GetPortAttributesByWWNHandler;
154 	SMHBAGetFCPhyAttributesFunc		GetFCPhyAttributesHandler;
155 	SMHBAGetSASPhyAttributesFunc		GetSASPhyAttributesHandler;
156 	SMHBAGetProtocolStatisticsFunc		GetProtocolStatisticsHandler;
157 	SMHBAGetPhyStatisticsFunc		GetPhyStatisticsHandler;
158 	HBASendCTPassThruV2Func			SendCTPassThruV2Handler;
159 	HBASetRNIDMgmtInfoFunc			SetRNIDMgmtInfoHandler;
160 	HBAGetRNIDMgmtInfoFunc			GetRNIDMgmtInfoHandler;
161 	HBASendRNIDV2Func			SendRNIDV2Handler;
162 	HBASendRPLFunc				SendRPLHandler;
163 	HBASendRPSFunc				SendRPSHandler;
164 	HBASendSRLFunc				SendSRLHandler;
165 	HBASendLIRRFunc				SendLIRRHandler;
166 	HBASendRLSFunc				SendRLSHandler;
167 	SMHBASendTESTFunc			SendTESTHandler;
168 	SMHBASendECHOFunc			SendECHOHandler;
169 	SMHBASendSMPPassThruFunc		SendSMPPassThruHandler;
170 	SMHBAGetBindingCapabilityFunc		GetBindingCapabilityHandler;
171 	SMHBAGetBindingSupportFunc		GetBindingSupportHandler;
172 	SMHBASetBindingSupportFunc		SetBindingSupportHandler;
173 	SMHBAGetTargetMappingFunc		GetTargetMappingHandler;
174 	SMHBAGetPersistentBindingFunc		GetPersistentBindingHandler;
175 	SMHBASetPersistentBindingFunc		SetPersistentBindingHandler;
176 	SMHBARemovePersistentBindingFunc	RemovePersistentBindingHandler;
177 	SMHBARemoveAllPersistentBindingsFunc
178 		RemoveAllPersistentBindingsHandler;
179 	SMHBAGetLUNStatisticsFunc		GetLUNStatisticsHandler;
180 	SMHBAScsiInquiryFunc			ScsiInquiryHandler;
181 	SMHBAScsiReportLUNsFunc			ScsiReportLUNsHandler;
182 	SMHBAScsiReadCapacityFunc		ScsiReadCapacityHandler;
183 	SMHBARegisterForAdapterAddEventsFunc
184 		RegisterForAdapterAddEventsHandler;
185 	SMHBARegisterForAdapterEventsFunc	RegisterForAdapterEventsHandler;
186 	SMHBARegisterForAdapterPortEventsFunc
187 		RegisterForAdapterPortEventsHandler;
188 	SMHBARegisterForAdapterPortStatEventsFunc
189 		RegisterForAdapterPortStatEventsHandler;
190 	SMHBARegisterForAdapterPhyStatEventsFunc
191 		RegisterForAdapterPhyStatEventsHandler;
192 	SMHBARegisterForTargetEventsFunc	RegisterForTargetEventsHandler;
193 	HBARegisterForLinkEventsFunc		RegisterForLinkEventsHandler;
194 	HBARemoveCallbackFunc			RemoveCallbackHandler;
195 } SMHBA_ENTRYPOINTS, *PSMHBA_ENTRYPOINTS;
196 
197 typedef HBA_UINT32 (* SMHBARegisterLibraryFunc)(SMHBA_ENTRYPOINTS *);
198 
199 HBA_STATUS SMHBA_RegisterLibrary(
200 	SMHBA_ENTRYPOINTS	*functionTable
201 );
202 
203 #ifdef __cplusplus
204 }
205 #endif
206 
207 #endif /* _VENDORSMHBAAPI_H_ */
208