xref: /illumos-gate/usr/src/lib/smhba/common/smhbaapi.h (revision 62877672)
1 /*
2  * ****************************************************************************
3  *
4  * Description
5  *	smhbaapi.h - general header file for client
6  *	and library developers
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 for  SM-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  * Adding on SM-HBA related definitions.
34  *
35  * - Includes the original HBA API header.
36  * - SMHBA_* interfaces and structures are defined.
37  *
38  * ****************************************************************************
39  */
40 /*
41  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
42  * Use is subject to license terms.
43  */
44 
45 #ifndef _SMHBAAPI_H_
46 #define	_SMHBAAPI_H_
47 
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51 
52 #include <hbaapi.h>
53 
54 /* Library version string */
55 #define	SMHBA_LIBVERSION 1
56 
57 /*
58  * A SCSI function was requested at a time when issuing the requested command
59  * would cause a SCSI overlapped command condition (see SAM-3)
60  */
61 #define	HBA_STATUS_ERROR_TARGET_BUSY	30
62 /* SM-HBA 6.2	Status Return Values */
63 /* A call was made to HBA_FreeLibrary when no library was loaded */
64 #define	HBA_STATUS_ERROR_NOT_LOADED	31
65 /* A call was made to HBA_LoadLibrary when a library was already loaded */
66 #define	HBA_STATUS_ERROR_ALREADY_LOADED 32
67 /*
68  * The Address Identifier specified in a call to HBA_SendRNIDV2
69  * violates access control rules * for that call.
70  */
71 #define	HBA_STATUS_ERROR_ILLEGAL_FCID	33
72 #define	HBA_STATUS_ERROR_NOT_ASCSIDEVICE    34
73 #define	HBA_STATUS_ERROR_INVALID_PROTOCOL_TYPE	35
74 #define	HBA_STATUS_ERROR_BAD_EVENT_TYPE	36
75 
76 
77 /* SM-HBA 6.4.1.1 Port Type */
78 #define	HBA_PORTTYPE_SASDEVICE   30 /* SAS (SSP or STP) */
79 #define	HBA_PORTTYPE_SATADEVICE  31 /* SATA Device, i.e. Direct Attach SATA */
80 #define	HBA_PORTTYPE_SASEXPANDER 32 /* SAS Expander */
81 
82 /* SM-HBA 6.4.1.2 Port State */
83 #define	HBA_PORTSTATE_DEGRADED	9 /* Degraded, but Operational mode */
84 
85 /* SM-HBA 6.11.1.3 Port Speed */
86 #define	HBA_PORTSPEED_4GBIT	8  /*  4 GBit / sec */
87 
88 /* SM-HBA 6.1	Basic Attributes Types */
89 typedef struct SMHBA_scsilun {HBA_UINT8 lun[8]; }
90     SMHBA_SCSILUN, *PSMHBA_SCSILUN;
91 			/* A byte array representation of a SCSI */
92 			/* LUN (see SAM-4). The first byte of the */
93 			/* LUN shall be in the first byte of the */
94 			/* array, and successive bytes of the SCSI */
95 			/* LUN shall be in successive bytes of the */
96 			/* array. */
97 typedef unsigned long HBA_SCSILUN;
98 			/* A 64 bit unsigned integer representation */
99 			/* of a SCSI LUN (see SAM-4); */
100 			/* may use OS-specific typedef. */
101 			/* Byte zero of a SCSI LUN shall be stored */
102 			/* in the lowest memory address */
103 			/* of the unsigned 64-bit integer value, */
104 			/* and successive bytes of the SCSI LUN */
105 			/* shall be stored in successively higher memory */
106 			/* addresses of the unsigned 64-bit intege value. */
107 			/* Note that computers often do not store */
108 			/* a byte array in memory in the same order */
109 			/* as they store an integer. */
110 			/* This standard requires storage as a byte array */
111 
112 
113 /* SM-HBA 6.3.1 Generic Adapter Attribute */
114 typedef struct SMHBA_AdapterAttributes {
115 	char			Manufacturer[64];
116 	char			SerialNumber[64];
117 	char			Model[256];
118 	char			ModelDescription[256];
119 	char			HardwareVersion[256];
120 	char			DriverVersion[256];
121 	char			OptionROMVersion[256];
122 	char			FirmwareVersion[256];
123 	HBA_UINT32		VendorSpecificID;
124 	char			DriverName[256];
125 	char			HBASymbolicName[256];
126 	char			RedundantOptionROMVersion[256];
127 	char			RedundantFirmwareVersion[256];
128 } SMHBA_ADAPTERATTRIBUTES, *PSMHBA_ADAPTERATTRIBUTES;
129 
130 /* SM-HBA 6.4.6 SMHBA FC Port Attributes */
131 typedef struct SMHBA_FC_Port {
132 	HBA_WWN			NodeWWN;
133 	HBA_WWN			PortWWN;
134 	HBA_UINT32		FcId;
135 	HBA_COS			PortSupportedClassofService;
136 	HBA_FC4TYPES		PortSupportedFc4Types;
137 	HBA_FC4TYPES		PortActiveFc4Types;
138 	HBA_WWN			FabricName;
139 	char			PortSymbolicName[256];
140 	HBA_UINT32		NumberofDiscoveredPorts;
141 	HBA_UINT8		NumberofPhys;
142 }SMHBA_FC_PORT, *PSMHBA_FC_PORT;
143 
144 /* SM-HBA 6.4.7.1 HBA_SASPortProtocol */
145 typedef HBA_UINT32	HBA_SASPORTPROTOCOL;
146 #define	HBA_SASPORTPROTOCOL_SSP	    1 /* Serial SCSI Protocol Port */
147 #define	HBA_SASPORTPROTOCOL_STP	    2 /* Serial ATA Tunneling Protocol Port */
148 #define	HBA_SASPORTPROTOCOL_SMP	    4 /* Serial Management Protocol Port */
149 /* SATA Device, Direct Attached or anywhere in the domain. */
150 #define	HBA_SASPORTPROTOCOL_SATA    8
151 
152 /* SM-HBA 6.4.8 SMHBA SAS Port Attributes */
153 typedef struct SMHBA_SAS_Port {
154 	HBA_SASPORTPROTOCOL	PortProtocol;
155 	HBA_WWN			LocalSASAddress;
156 	HBA_WWN			AttachedSASAddress;
157 	HBA_UINT32		NumberofDiscoveredPorts;
158 	HBA_UINT32		NumberofPhys;
159 } SMHBA_SAS_PORT, *PSMHBA_SAS_PORT;
160 
161 /* SM-HBA 6.4.2 Generic Port Attributes */
162 typedef union SMHBA_Port {
163 	SMHBA_FC_PORT		*FCPort;
164 	SMHBA_SAS_PORT		*SASPort;
165 } SMHBA_PORT, *PSMHBA_PORT;
166 
167 typedef struct SMHBA_PortAttributes {
168 	HBA_PORTTYPE		PortType;
169 	HBA_PORTSTATE		PortState;
170 	char			OSDeviceName[256];
171 	SMHBA_PORT		PortSpecificAttribute;
172 } SMHBA_PORTATTRIBUTES, *PSMHBA_PORTATTRIBUTES;
173 
174 /* SM-HBA 6.5.1.1 FC Phy Speed */
175 typedef HBA_UINT32 HBA_FCPHYSPEED;
176 /* Unknown transceiver incapable of reporting */
177 #define	HBA_FCSPEED_UNKNOWN		0
178 /*
179  * The following are redundantly defined in SM-HBA 6.11.1.3 Port Speed.
180  * #define  HBA_PORTSPEED_1GBIT            1       1 GBit/sec
181  * #define  HBA_PORTSPEED_2GBIT            2          2 GBit/sec
182  * #define  HBA_PORTSPEED_10GBIT           4          10 GBit/sec
183  * #define  HBA_PORTSPEED_4GBIT            8          4 GBit/sec
184  */
185 #define	HBA_FCPHYSPEED_8GBIT		16  /* 8 GBit/sec */
186 #define	HBA_FCPHYSPEED_16GBIT		32  /* 16 GBit/sec */
187 /*
188  * The following conflicts with HBA API
189  * #define  HBA_PORTSPEED_NOT_NEGOTIATED   (1<<15)  Speed not established
190  */
191 
192 /* SM-HBA 6.6.1.2 SM-HBA FC Phy Type */
193 typedef HBA_UINT8 HBA_FCPHYTYPE;
194 #define	HBA_FCPHYTYPE_UNKNOWN		    1 /* Unknown Phy type */
195 #define	HBA_FCPHYTYPE_OPTICAL		    2 /* Optical Phy */
196 #define	HBA_FCPHYTYPE_COPPER		    4 /* Copper Phy */
197 
198 /* SM-HBA 6.5.2 SM-HBA FC Phy Attributes */
199 typedef struct SMHBA_FC_Phy {
200 	HBA_FCPHYSPEED	    PhySupportedSpeed;	/* PhySupportedSpeed */
201 	HBA_FCPHYSPEED	    PhySpeed;		/* PhySpeed */
202 	HBA_FCPHYTYPE	    PhyType;
203 	HBA_UINT32	    MaxFrameSize;	/* MaxFrameSize */
204 } SMHBA_FC_PHY, *PSMHBA_FC_PHY;
205 
206 /* SM-HBA 6.5.4 SAS PHY Attribute Data Declaration */
207 typedef HBA_UINT32 HBA_SASPHYSPEED;
208 
209 #define	HBA_SASSTATE_UNKNOWN	0x00 /* Phy is enabled. Speed is unknown */
210 #define	HBA_SASSTATE_DISABLED	0x01 /* Phy is disabled. */
211 /* Phy is enabled. But failed speed negotiation. */
212 #define	HBA_SASSTATE_FAILED	0x02
213 /*
214  * Phy is enabled. Detected a SATA device and entered the SATA Spinup hold
215  * state.
216  */
217 #define	HBA_SASSTATE_SATASPINUP    0x03
218 /* The phy is attached to a Port Selector (see SATA-2.6). */
219 #define	HBA_SASSTATE_SATAPORTSEL    0x04
220 #define	HBA_SASSPEED_1_5GBIT	    0x08 /*  1.5 GBit/sec */
221 #define	HBA_SASSPEED_3GBIT	    0x09 /*  3 GBit/sec */
222 #define	HBA_SASSPEED_6GBIT	    0x0a /*  6 GBit/sec */
223 #define	HBA_SASSPEED_12GBIT	    0x0b /* 12 GBit/sec */
224 
225 /* SM-HBA  6.5.5 SAS Phy Attribute */
226 typedef struct SMHBA_SAS_Phy {
227 	HBA_UINT8	    PhyIdentifier;
228 	HBA_SASPHYSPEED	    NegotiatedLinkRate;
229 	HBA_SASPHYSPEED	    ProgrammedMinLinkRate;
230 	HBA_SASPHYSPEED	    HardwareMinLinkRate;
231 	HBA_SASPHYSPEED	    ProgrammedMaxLinkRate;
232 	HBA_SASPHYSPEED	    HardwareMaxLinkRate;
233 	HBA_WWN		    domainPortWWN;
234 } SMHBA_SAS_PHY, *PSMHBA_SAS_PHY;
235 
236 /* SM-HBA 6.6.1.1 Protocol Statistics Data Declarations */
237 /* Statistical counters for FC-4, SSP, STP, SMP protocols */
238 typedef struct SMHBA_ProtocolStatistics {
239 	HBA_INT64	    SecondsSinceLastReset;
240 	HBA_INT64	    InputRequests;
241 	HBA_INT64	    OutputRequests;
242 	HBA_INT64	    ControlRequests;
243 	HBA_INT64	    InputMegabytes;
244 	HBA_INT64	    OutputMegabytes;
245 } SMHBA_PROTOCOLSTATISTICS, *PSMHBA_PROTOCOLSTATISTICS;
246 
247 /* SM-HBA 6.6.2.1 Port Statistics Data Declarations */
248 typedef struct SMHBA_PortStatistics {
249 	HBA_INT64	    SecondsSinceLastReset;
250 	HBA_INT64	    TxFrames;
251 	HBA_INT64	    TxWords;
252 	HBA_INT64	    RxFrames;
253 	HBA_INT64	    RxWords;
254 }SMHBA_PORTSTATISTICS, *PSMHBA_PORTSTATISTICS;
255 
256 /* SM-HBA 6.6.2.2 SAS Phy Statistics Data Declaration */
257 typedef struct SMHBA_SASPhyStatistics {
258 	HBA_INT64	    SecondsSinceLastReset;
259 	HBA_INT64	    TxFrames;
260 	HBA_INT64	    TxWords;
261 	HBA_INT64	    RxFrames;
262 	HBA_INT64	    RxWords;
263 	HBA_INT64	    InvalidDwordCount;
264 	HBA_INT64	    RunningDisparityErrorCount;
265 	HBA_INT64	    LossofDwordSyncCount;
266 	HBA_INT64	    PhyResetProblemCount;
267 } SMHBA_SASPHYSTATISTICS, *PSMHBA_SASPHYSTATISTICS;
268 
269 /* SM-HBA 6.6.2.4 FC Phy Statistics Data Declaration */
270 /* Statistical counters for FC-0, FC-1, and FC-2 */
271 typedef struct SMHBA_FCPhyStatistics {
272 	HBA_INT64	    SecondsSinceLastReset;
273 	HBA_INT64	    TxFrames;
274 	HBA_INT64	    TxWords;
275 	HBA_INT64	    RxFrames;
276 	HBA_INT64	    RxWords;
277 	HBA_INT64	    LIPCount;
278 	HBA_INT64	    NOSCount;
279 	HBA_INT64	    ErrorFrames;
280 	HBA_INT64	    DumpedFrames;
281 	HBA_INT64	    LinkFailureCount;
282 	HBA_INT64	    LossOfSyncCount;
283 	HBA_INT64	    LossOfSignalCount;
284 	HBA_INT64	    PrimitiveSeqProtocolErrCount;
285 	HBA_INT64	    InvalidTxWordCount;
286 	HBA_INT64	    InvalidCRCCount;
287 }SMHBA_FCPHYSTATISTICS, *PSMHBA_FCPHYSTATISTICS;
288 
289 /* SM-HBA 6.6.2.1 Phy Statistics Data Declaration */
290 typedef union SMHBA_PhyStatistics {
291 	SMHBA_SASPHYSTATISTICS	*SASPhyStatistics;
292 	SMHBA_FCPHYSTATISTICS	*FCPhyStatistics;
293 } SMHBA_PHYSTATISTICS, *PSMHBA_PHYSTATISTICS;
294 
295 /* SM-HBA 6.7.1.1 SMHBA_BIND_CAPABILITY */
296 typedef HBA_UINT32 SMHBA_BIND_CAPABILITY;
297 #define	SMHBA_CAN_BIND_TO_WWPN 0x0001
298 #define	SMHBA_CAN_BIND_TO_LUID 0x0002
299 #define	SMHBA_CAN_BIND_ANY_LUNS 0x0400
300 #define	SMHBA_CAN_BIND_AUTOMAP 0x0800
301 
302 /* SM-HBA 6.7.1.2 SMHBA_BIND_TYPE */
303 typedef HBA_UINT32 SMHBA_BIND_TYPE;
304 #define	SMHBA_BIND_TO_WWPN 0x0001
305 #define	SMHBA_BIND_TO_LUID 0x0002
306 
307 /* SM-HBA 6.7.1.3 SMHBA_ScsiId */
308 typedef struct SMHBA_ScsiId {
309 	char	    OSDeviceName[256];
310 	HBA_UINT32  ScsiBusNumber;
311 	HBA_UINT32  ScsiTargetNumber;
312 	HBA_UINT32  ScsiOSLun;
313 } SMHBA_SCSIID, *PSMHBA_SCSIID;
314 
315 /* SM-HBA 6.7.1.4 SMHBA_LUID */
316 typedef struct SMHBA_LUID {
317 	char	    buffer[256];
318 } SMHBA_LUID, *PSMHBA_LUID;
319 
320 /* SM-HBA 6.7.1.5 SMHBA_PORTLUN */
321 typedef struct SMHBA_PORTLUN {
322 	HBA_WWN		    PortWWN;
323 	HBA_WWN		    domainPortWWN;
324 	SMHBA_SCSILUN	    TargetLun;
325 } SMHBA_PORTLUN, *PSMHBA_PORTLUN;
326 
327 /* SM-HBA 6.7.1.6 Composite types */
328 typedef struct SMHBA_ScsiEntry {
329 	SMHBA_SCSIID ScsiId;
330 	SMHBA_PORTLUN PortLun;
331 	SMHBA_LUID LUID;
332 } SMHBA_SCSIENTRY, *PSMHBA_SCSIENTRY;
333 
334 typedef struct SMHBA_TargetMapping {
335 	HBA_UINT32 NumberOfEntries;
336 	SMHBA_SCSIENTRY entry[1]; /* Variable length array */
337 } SMHBA_TARGETMAPPING, *PSMHBA_TARGETMAPPING;
338 
339 typedef struct SMHBA_BindingEntry {
340 	SMHBA_BIND_TYPE	type;
341 	SMHBA_SCSIID	ScsiId;
342 	SMHBA_PORTLUN	PortLun;
343 	SMHBA_LUID	LUID;
344 	HBA_STATUS	Status;
345 } SMHBA_BINDINGENTRY, *PSMHBA_BINDINGENTRY;
346 
347 typedef struct SMHBA_Binding {
348 	HBA_UINT32	    NumberOfEntries;
349 	SMHBA_BINDINGENTRY  entry[1]; /* Variable length array */
350 } SMHBA_BINDING, *PSMHBA_BINDING;
351 
352 /* SM-HBA 6.9.5 Library Attribute Data Declarations */
353 typedef struct SMHBA_LibraryAttributes {
354 	char	    LibPath[256];
355 	char	    VName[256];
356 	char	    VVersion[256];
357 	struct {
358 		int	tm_mday;    /* day of the month - [1 - 31] */
359 		int	tm_mon;	    /* months since January - [0 - 11] */
360 		int	tm_year;    /* years since 1900 */
361 	} build_date;
362 } SMHBA_LIBRARYATTRIBUTES, *PSMHBA_LIBRARYATTRIBUTES;
363 
364 /* SM-HBA 6.8.1 Asynchronous Event Data Declarations */
365 #define	HBA_EVENT_PORT_BROADCAST_CHANGE 0x205
366 #define	HBA_EVENT_PORT_BROADCAST_SES	0x208
367 #define	HBA_EVENT_PORT_BROADCAST_D24_0  0x206
368 #define	HBA_EVENT_PORT_BROADCAST_D27_4  0x207
369 #define	HBA_EVENT_PORT_BROADCAST_D01_4  0x209
370 #define	HBA_EVENT_PORT_BROADCAST_D04_7  0x20A
371 #define	HBA_EVENT_PORT_BROADCAST_D16_7  0x20B
372 #define	HBA_EVENT_PORT_BROADCAST_D29_7  0x20C
373 #define	HBA_EVENT_PORT_ALL		0x2FF
374 
375 /* SM-HBA specific entry points. */
376 
377 HBA_UINT32 SMHBA_GetVersion();
378 
379 HBA_UINT32 SMHBA_GetWrapperLibraryAttributes(
380 	SMHBA_LIBRARYATTRIBUTES *attributes
381 );
382 
383 HBA_UINT32 SMHBA_GetVendorLibraryAttributes(
384 	HBA_UINT32		adapter_index,
385 	SMHBA_LIBRARYATTRIBUTES *attributes
386 );
387 
388 HBA_STATUS SMHBA_GetAdapterAttributes(
389 	HBA_HANDLE handle,
390 	SMHBA_ADAPTERATTRIBUTES *pAdapterAttributes
391 );
392 
393 HBA_STATUS SMHBA_GetNumberOfPorts(
394 	HBA_HANDLE handle,
395 	HBA_UINT32 *numberofports
396 );
397 
398 HBA_STATUS SMHBA_GetPortType(
399 	HBA_HANDLE handle,
400 	HBA_UINT32 portindex,
401 	HBA_PORTTYPE *porttype
402 );
403 
404 HBA_STATUS SMHBA_GetAdapterPortAttributes(
405 	HBA_HANDLE handle,
406 	HBA_UINT32 portindex,
407 	SMHBA_PORTATTRIBUTES *portattributes
408 );
409 
410 HBA_STATUS SMHBA_GetDiscoveredPortAttributes(
411 	HBA_HANDLE handle,
412 	HBA_UINT32 portindex,
413 	HBA_UINT32 discoveredportindex,
414 	SMHBA_PORTATTRIBUTES *porattributes
415 );
416 
417 HBA_STATUS SMHBA_GetPortAttributesByWWN(
418 	HBA_HANDLE handle,
419 	HBA_WWN portWWN,
420 	HBA_WWN domainPortWWN,
421 	SMHBA_PORTATTRIBUTES *portattributes
422 );
423 
424 HBA_STATUS SMHBA_GetPortAttributesByWWN(
425 	HBA_HANDLE handle,
426 	HBA_WWN portWWN,
427 	HBA_WWN domainPortWWN,
428 	SMHBA_PORTATTRIBUTES *portattributes
429 );
430 
431 HBA_STATUS SMHBA_GetFCPhyAttributes(
432 	HBA_HANDLE handle,
433 	HBA_UINT32 portindex,
434 	HBA_UINT32 phyindex,
435 	SMHBA_FC_PHY *phytype
436 );
437 
438 HBA_STATUS SMHBA_GetSASPhyAttributes(
439 	HBA_HANDLE handle,
440 	HBA_UINT32 portindex,
441 	HBA_UINT32 phyindex,
442 	SMHBA_SAS_PHY *phytype
443 );
444 
445 HBA_STATUS SMHBA_GetProtocolStatistics(
446 	HBA_HANDLE handle,
447 	HBA_UINT32 portindex,
448 	HBA_UINT32 protocoltype,
449 	SMHBA_PROTOCOLSTATISTICS *pProtocolStatistics
450 );
451 
452 HBA_STATUS SMHBA_GetPhyStatistics(
453 	HBA_HANDLE handle,
454 	HBA_UINT32 portindex,
455 	HBA_UINT32 phyindex,
456 	SMHBA_PHYSTATISTICS *pPhyStatistics
457 );
458 
459 HBA_STATUS SMHBA_SendTEST(
460 	HBA_HANDLE handle,
461 	HBA_WWN hbaPortWWN,
462 	HBA_WWN destWWN,
463 	HBA_UINT32 destFCID,
464 	void *pReqBuffer,
465 	HBA_UINT32 ReqBufferSize
466 );
467 
468 HBA_STATUS SMHBA_SendECHO(
469 	HBA_HANDLE handle,
470 	HBA_WWN hbaPortWWN,
471 	HBA_WWN destWWN,
472 	HBA_UINT32 destFCID,
473 	void *pReqBuffer,
474 	HBA_UINT32 ReqBufferSize,
475 	void *pRspBuffer,
476 	HBA_UINT32 *pRspBufferSize
477 );
478 
479 HBA_UINT32 SMHBA_SendSMPPassThru(
480 	HBA_HANDLE handle,
481 	HBA_WWN hbaportWWN,
482 	HBA_WWN destportWWN,
483 	HBA_WWN domainPortWWN,
484 	void *pReqBuffer,
485 	HBA_UINT32 ReqBufferSize,
486 	void *pRspBuffer,
487 	HBA_UINT32 *pRspBufferSize
488 );
489 
490 HBA_STATUS SMHBA_GetBindingCapability(
491 	HBA_HANDLE handle,
492 	HBA_WWN hbaPortWWN,
493 	HBA_WWN domainPortWWN,
494 	SMHBA_BIND_CAPABILITY *pFlags
495 );
496 
497 HBA_STATUS SMHBA_GetBindingSupport(
498 	HBA_HANDLE handle,
499 	HBA_WWN hbaPortWWN,
500 	HBA_WWN domainPortWWN,
501 	SMHBA_BIND_CAPABILITY *pFlags
502 );
503 
504 HBA_STATUS SMHBA_SetBindingSupport(
505 	HBA_HANDLE handle,
506 	HBA_WWN hbaPortWWN,
507 	HBA_WWN domainPortWWN,
508 	SMHBA_BIND_CAPABILITY flags
509 );
510 
511 HBA_STATUS SMHBA_GetTargetMapping(
512 	HBA_HANDLE handle,
513 	HBA_WWN hbaPortWWN,
514 	HBA_WWN domainPortWWN,
515 	SMHBA_TARGETMAPPING *pMapping
516 );
517 
518 HBA_STATUS SMHBA_GetPersistentBinding(
519 	HBA_HANDLE handle,
520 	HBA_WWN hbaPortWWN,
521 	HBA_WWN domainPortWWN,
522 	SMHBA_BINDING *binding
523 );
524 
525 HBA_STATUS SMHBA_SetPersistentBinding(
526 	HBA_HANDLE handle,
527 	HBA_WWN hbaPortWWN,
528 	HBA_WWN domainPortWWN,
529 	const SMHBA_BINDING *binding
530 );
531 
532 HBA_STATUS SMHBA_RemovePersistentBinding(
533 	HBA_HANDLE handle,
534 	HBA_WWN hbaPortWWN,
535 	HBA_WWN domainPortWWN,
536 	const SMHBA_BINDING *binding
537 );
538 
539 HBA_STATUS SMHBA_RemoveAllPersistentBindings(
540 	HBA_HANDLE handle,
541 	HBA_WWN hbaPortWWN,
542 	HBA_WWN domainPortWWN
543 );
544 
545 HBA_STATUS SMHBA_GetLUNStatistics(
546 	HBA_HANDLE handle,
547 	const HBA_SCSIID *lunit,
548 	SMHBA_PROTOCOLSTATISTICS *statistics
549 );
550 
551 HBA_STATUS SMHBA_ScsiInquiry(
552 	HBA_HANDLE handle,
553 	HBA_WWN hbaPortWWN,
554 	HBA_WWN discoveredPortWWN,
555 	HBA_WWN domainPortWWN,
556 	SMHBA_SCSILUN smhbaLUN,
557 	HBA_UINT8 CDB_Byte1,
558 	HBA_UINT8 CDB_Byte2,
559 	void *pRspBuffer,
560 	HBA_UINT32 *pRspBufferSize,
561 	HBA_UINT8 *pScsiStatus,
562 	void *pSenseBuffer,
563 	HBA_UINT32 *pSenseBufferSize
564 );
565 
566 HBA_STATUS SMHBA_ScsiReportLUNs(
567 	HBA_HANDLE handle,
568 	HBA_WWN hbaPortWWN,
569 	HBA_WWN discoveredPortWWN,
570 	HBA_WWN domainPortWWN,
571 	void *pRspBuffer,
572 	HBA_UINT32 *pRspBufferSize,
573 	HBA_UINT8 *pScsiStatus,
574 	void *pSenseBuffer,
575 	HBA_UINT32 *pSenseBufferSize
576 );
577 
578 HBA_STATUS SMHBA_ScsiReadCapacity(
579 	HBA_HANDLE handle,
580 	HBA_WWN hbaPortWWN,
581 	HBA_WWN discoveredPortWWN,
582 	HBA_WWN domainPortWWN,
583 	SMHBA_SCSILUN smhbaLUN,
584 	void *pRspBuffer,
585 	HBA_UINT32 *pRspBufferSize,
586 	HBA_UINT8 *pScsiStatus,
587 	void *pSenseBuffer,
588 	HBA_UINT32 *pSenseBufferSize
589 );
590 
591 HBA_STATUS SMHBA_RegisterForAdapterAddEvents(
592 	void (*pCallback) (
593 		void *pData,
594 		HBA_WWN portWWN,
595 		HBA_UINT32 eventType),
596 	void *pUserData,
597 	HBA_CALLBACKHANDLE *pCallbackHandle
598 );
599 
600 HBA_STATUS SMHBA_RegisterForAdapterEvents(
601 	void (*pCallback) (
602 		void *pData,
603 		HBA_WWN portWWN,
604 		HBA_UINT32 eventType),
605 	void *pUserData,
606 	HBA_HANDLE handle,
607 	HBA_CALLBACKHANDLE *pCallbackHandle
608 );
609 
610 HBA_STATUS SMHBA_RegisterForAdapterPortEvents(
611 	void (*pCallback) (
612 		void *pData,
613 		HBA_WWN portWWN,
614 		HBA_UINT32 eventType,
615 		HBA_UINT32 fabricPortID),
616 	void *pUserData,
617 	HBA_HANDLE handle,
618 	HBA_WWN portWWN,
619 	HBA_UINT32 specificEventType,
620 	HBA_CALLBACKHANDLE *pCallbackHandle
621 );
622 
623 HBA_STATUS SMHBA_RegisterForAdapterPortStatEvents(
624 	void (*pCallback) (
625 		void *pData,
626 		HBA_WWN portWWN,
627 		HBA_UINT32 protocolType,
628 		HBA_UINT32 eventType),
629 	void *pUserData,
630 	HBA_HANDLE handle,
631 	HBA_WWN portWWN,
632 	HBA_UINT32 protocolType,
633 	SMHBA_PROTOCOLSTATISTICS stats,
634 	HBA_UINT32 statType,
635 	HBA_CALLBACKHANDLE *pCallbackHandle
636 );
637 
638 HBA_STATUS SMHBA_RegisterForAdapterPhyStatEvents(
639 	void (*pCallback) (
640 		void *pData,
641 		HBA_WWN portWWN,
642 		HBA_UINT32 phyIndex,
643 		HBA_UINT32 eventType),
644 	void *pUserData,
645 	HBA_HANDLE handle,
646 	HBA_WWN portWWN,
647 	HBA_UINT32 phyIndex,
648 	SMHBA_PHYSTATISTICS stats,
649 	HBA_UINT32 statType,
650 	HBA_CALLBACKHANDLE *pCallbackHandle
651 );
652 
653 HBA_STATUS SMHBA_RegisterForTargetEvents(
654 	void (*pCallback) (
655 		void *pData,
656 		HBA_WWN hbaPortWWN,
657 		HBA_WWN discoveredPortWWN,
658 		HBA_WWN domainPortWWN,
659 		HBA_UINT32 eventType),
660 	void *pUserData,
661 	HBA_HANDLE handle,
662 	HBA_WWN hbaPortWWN,
663 	HBA_WWN discoveredPortWWN,
664 	HBA_WWN domainPortWWN,
665 	HBA_CALLBACKHANDLE *pCallbackHandle,
666 	HBA_UINT32 allTargets
667 );
668 
669 #ifdef __cplusplus
670 }
671 #endif
672 
673 #endif /* _SMHBAAPI_H_ */
674