xref: /titanic_51/usr/src/lib/mpapi/libmpapi/common/mpapi-plugin.h (revision 613a2f6ba31e891e3d947a356daf5e563d43c1ce)
1 /******************************************************************************
2  *
3  * Description
4  *  mpapi-plugin.h - interfaces for the MP API Version 1.0 plugin library.
5  *  A compliant plugin library should implement interfaces with name without Fn
6  *  suffix from function definitions below.
7  *
8  * License:
9  *  The contents of this file are subject to the SNIA Public License
10  *  Version 1.1 (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  *  TBD
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 iSCSI Management API and Multipath Management API
21  * 	plugin header file
22  *
23  * The Initial Developer of the Original Code is:
24  *	Benjamin F. Kuo Troika Networks, Inc. (benk@troikanetworks.com)
25  *	David Dillard	VERITAS Software(david.dillard@veritas.com)
26  *	Jeff Ding	Adaptec, Inc. (jding@corp.adaptec.com)
27  *      Hyon Kim       	Sun Microsystems(hyon.kim@sun.com)
28  *
29  * Contributor(s):
30  *	Paul von Behren	Sun Microsystems(paul.vonbehren@sun.com)
31  *
32  ******************************************************************************
33  *
34  *   Changes:
35  *  1/15/2005 Implemented SNIA MP API specification 1.0
36  *****************************************************************************/
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 
43 #ifndef MPPLUGIN_H
44 #define MPPLUGIN_H
45 
46 /*
47  * MP API common library calls InitaizeFn as part of dynamically loading
48  * the plugins.  For this version of implementation the common library
49  * passes the sequence number of the plugin oid through InitializeFn.  The
50  * sequnece number will be used as the ownerId for the plugin generated OIDs.
51  */
52 typedef MP_STATUS (* InitializeFn)  (
53         MP_UINT32   pluginOwnerID
54     );
55 
56 /*
57  * MP API common library calls TerminateFn as part of dynamically unloading
58  * the plugins.
59  */
60 typedef MP_STATUS (* TerminateFn) (void);
61 
62 /**
63  ******************************************************************************
64  *
65  * Function table for OID and properties discovery API
66  *
67  ******************************************************************************
68  */
69 
70 typedef MP_STATUS (* MP_GetPluginPropertiesPluginFn)(
71         MP_PLUGIN_PROPERTIES *pProps
72 );
73 
74 typedef MP_STATUS (* MP_GetDeviceProductOidListPluginFn)(
75         MP_OID_LIST **ppList
76 );
77 
78 typedef MP_STATUS (* MP_GetDeviceProductPropertiesFn)(
79 	MP_OID 				oid,
80         MP_DEVICE_PRODUCT_PROPERTIES *pProps
81 );
82 
83 typedef MP_STATUS (* MP_GetInitiatorPortOidListPluginFn)(
84         MP_OID_LIST **ppList
85 );
86 
87 typedef MP_STATUS (* MP_GetInitiatorPortPropertiesFn)(
88         MP_OID                        oid,
89         MP_INITIATOR_PORT_PROPERTIES *pProps
90 );
91 
92 typedef MP_STATUS (* MP_GetMultipathLusPluginFn)(
93         MP_OID_LIST **ppList
94 );
95 
96 typedef MP_STATUS (* MP_GetMultipathLusDevProdFn)(
97 	MP_OID	oid,
98         MP_OID_LIST **ppList
99 );
100 
101 typedef MP_STATUS (* MP_GetMPLogicalUnitPropertiesFn)(
102         MP_OID                                oid,
103         MP_MULTIPATH_LOGICAL_UNIT_PROPERTIES *pProps
104 );
105 
106 typedef MP_STATUS (* MP_GetAssociatedPathOidListFn)(
107         MP_OID        oid,
108         MP_OID_LIST **ppList
109 );
110 
111 typedef MP_STATUS (* MP_GetPathLogicalUnitPropertiesFn)(
112         MP_OID                           oid,
113         MP_PATH_LOGICAL_UNIT_PROPERTIES *pProps
114 );
115 
116 typedef MP_STATUS (* MP_GetAssociatedTPGOidListFn)(
117         MP_OID        oid,
118         MP_OID_LIST **ppList
119 );
120 
121 typedef MP_STATUS (* MP_GetTargetPortGroupPropertiesFn)(
122         MP_OID                           oid,
123         MP_TARGET_PORT_GROUP_PROPERTIES *pProps
124 );
125 
126 typedef MP_STATUS (* MP_GetMPLuOidListFromTPGFn)(
127         MP_OID        oid,
128         MP_OID_LIST **ppList
129 );
130 
131 typedef MP_STATUS (* MP_GetProprietaryLoadBalanceOidListPluginFn)(
132         MP_OID_LIST **ppList
133 );
134 
135 typedef MP_STATUS (* MP_GetProprietaryLoadBalancePropertiesFn)(
136         MP_OID        oid,
137 	MP_PROPRIETARY_LOAD_BALANCE_PROPERTIES *pProps
138 );
139 
140 typedef MP_STATUS (* MP_GetTargetPortOidListFn)(
141         MP_OID        oid,
142         MP_OID_LIST **ppList
143 );
144 
145 typedef MP_STATUS (* MP_GetTargetPortPropertiesFn)(
146         MP_OID                     oid,
147         MP_TARGET_PORT_PROPERTIES *pProps
148 );
149 
150 /**
151  ******************************************************************************
152  *
153  * Function table for path management API
154  *
155  ******************************************************************************
156  */
157 
158 typedef MP_STATUS (* MP_AssignLogicalUnitToTPGFn)(
159         MP_OID tpgOid,
160         MP_OID luOid
161 );
162 
163 typedef MP_STATUS (* MP_SetOverridePathFn)(
164     MP_OID logicalUnitOid,
165     MP_OID pathOid
166 );
167 
168 typedef MP_STATUS (* MP_CancelOverridePathFn)(
169         MP_OID luOid
170 );
171 
172 typedef MP_STATUS (* MP_EnableAutoFailbackPluginFn)(
173 );
174 
175 typedef MP_STATUS (* MP_EnableAutoFailbackLuFn)(
176     MP_OID oid
177 );
178 
179 typedef MP_STATUS (* MP_EnableAutoProbingPluginFn)(
180 );
181 
182 typedef MP_STATUS (* MP_EnableAutoProbingLuFn)(
183     MP_OID oid
184 );
185 
186 typedef MP_STATUS (* MP_DisableAutoFailbackPluginFn)(
187 );
188 
189 typedef MP_STATUS (* MP_DisableAutoFailbackLuFn)(
190     MP_OID oid
191 );
192 
193 typedef MP_STATUS (* MP_DisableAutoProbingPluginFn)(
194 );
195 
196 typedef MP_STATUS (* MP_DisableAutoProbingLuFn)(
197     MP_OID oid
198 );
199 
200 typedef MP_STATUS (* MP_EnablePathFn)(
201     MP_OID oid
202 );
203 
204 typedef MP_STATUS (* MP_DisablePathFn)(
205     MP_OID oid
206 );
207 
208 typedef MP_STATUS (* MP_SetLogicalUnitLoadBalanceTypeFn)(
209     MP_OID               logicalUnitoid,
210     MP_LOAD_BALANCE_TYPE loadBalance
211 );
212 
213 typedef MP_STATUS (* MP_SetPathWeightFn)(
214     MP_OID    pathOid,
215     MP_UINT32 weight
216 );
217 
218 typedef MP_STATUS (* MP_SetPluginLoadBalanceTypePluginFn)(
219     MP_LOAD_BALANCE_TYPE loadBalance
220 );
221 
222 typedef MP_STATUS (* MP_SetFailbackPollingRatePluginFn)(
223     MP_UINT32 pollingRate
224 );
225 
226 typedef MP_STATUS (* MP_SetFailbackPollingRateLuFn)(
227     MP_OID	oid,
228     MP_UINT32	pollingRate
229 );
230 
231 typedef MP_STATUS (* MP_SetProbingPollingRatePluginFn)(
232     MP_UINT32 pollingRate
233 );
234 
235 typedef MP_STATUS (* MP_SetProbingPollingRateLuFn)(
236     MP_OID	oid,
237     MP_UINT32	pollingRate
238 );
239 
240 typedef MP_STATUS (* MP_SetProprietaryPropertiesFn)(
241     MP_OID             oid,
242     MP_UINT32          count,
243     MP_PROPRIETARY_PROPERTY *pPropertyList
244 );
245 
246 typedef MP_STATUS (* MP_SetTPGAccessFn)(
247     MP_OID             luOid,
248     MP_UINT32          count,
249     MP_TPG_STATE_PAIR *pTpgStateList
250 );
251 
252 /**
253  ******************************************************************************
254  *
255  * Function table for event support API
256  *
257  ******************************************************************************
258  */
259 
260 typedef MP_STATUS (* MP_RegisterForObjectPropertyChangesPluginFn)(
261     MP_OBJECT_PROPERTY_FN   pClientFn,
262     MP_OBJECT_TYPE	    objectType,
263     void		    *pCallerData
264 );
265 
266 typedef MP_STATUS (* MP_DeregisterForObjectPropertyChangesPluginFn)(
267     MP_OBJECT_PROPERTY_FN   pClientFn,
268     MP_OBJECT_TYPE	    objectType
269 );
270 
271 typedef MP_STATUS (* MP_RegisterForObjectVisibilityChangesPluginFn)(
272     MP_OBJECT_VISIBILITY_FN pClientFn,
273     MP_OBJECT_TYPE	    objectType,
274     void		    *pCallerData
275 );
276 
277 typedef MP_STATUS (* MP_DeregisterForObjectVisibilityChangesPluginFn)(
278     MP_OBJECT_VISIBILITY_FN pClientFn,
279     MP_OBJECT_TYPE          objectType
280 );
281 
282 typedef MP_STATUS (* Sun_MP_SendScsiCmdFn)(
283     MP_OID oid, struct uscsi_cmd *cmd
284 );
285 
286 #endif
287 
288 #ifdef __cplusplus
289 };
290 #endif
291 
292