xref: /titanic_52/usr/src/lib/smhba/common/smhbaapi.h (revision 4201a95e0468170d576f82c3aa63afecf718497a)
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 
224 /* SM-HBA  6.5.5 SAS Phy Attribute */
225 typedef struct SMHBA_SAS_Phy {
226 	HBA_UINT8	    PhyIdentifier;
227 	HBA_SASPHYSPEED	    NegotiatedLinkRate;
228 	HBA_SASPHYSPEED	    ProgrammedMinLinkRate;
229 	HBA_SASPHYSPEED	    HardwareMinLinkRate;
230 	HBA_SASPHYSPEED	    ProgrammedMaxLinkRate;
231 	HBA_SASPHYSPEED	    HardwareMaxLinkRate;
232 	HBA_WWN		    domainPortWWN;
233 } SMHBA_SAS_PHY, *PSMHBA_SAS_PHY;
234 
235 /* SM-HBA 6.6.1.1 Protocol Statistics Data Declarations */
236 /* Statistical counters for FC-4, SSP, STP, SMP protocols */
237 typedef struct SMHBA_ProtocolStatistics {
238 	HBA_INT64	    SecondsSinceLastReset;
239 	HBA_INT64	    InputRequests;
240 	HBA_INT64	    OutputRequests;
241 	HBA_INT64	    ControlRequests;
242 	HBA_INT64	    InputMegabytes;
243 	HBA_INT64	    OutputMegabytes;
244 } SMHBA_PROTOCOLSTATISTICS, *PSMHBA_PROTOCOLSTATISTICS;
245 
246 /* SM-HBA 6.6.2.1 Port Statistics Data Declarations */
247 typedef struct SMHBA_PortStatistics {
248 	HBA_INT64	    SecondsSinceLastReset;
249 	HBA_INT64	    TxFrames;
250 	HBA_INT64	    TxWords;
251 	HBA_INT64	    RxFrames;
252 	HBA_INT64	    RxWords;
253 }SMHBA_PORTSTATISTICS, *PSMHBA_PORTSTATISTICS;
254 
255 /* SM-HBA 6.6.2.2 SAS Phy Statistics Data Declaration */
256 typedef struct SMHBA_SASPhyStatistics {
257 	HBA_INT64	    SecondsSinceLastReset;
258 	HBA_INT64	    TxFrames;
259 	HBA_INT64	    TxWords;
260 	HBA_INT64	    RxFrames;
261 	HBA_INT64	    RxWords;
262 	HBA_INT64	    InvalidDwordCount;
263 	HBA_INT64	    RunningDisparityErrorCount;
264 	HBA_INT64	    LossofDwordSyncCount;
265 	HBA_INT64	    PhyResetProblemCount;
266 } SMHBA_SASPHYSTATISTICS, *PSMHBA_SASPHYSTATISTICS;
267 
268 /* SM-HBA 6.6.2.4 FC Phy Statistics Data Declaration */
269 /* Statistical counters for FC-0, FC-1, and FC-2 */
270 typedef struct SMHBA_FCPhyStatistics {
271 	HBA_INT64	    SecondsSinceLastReset;
272 	HBA_INT64	    TxFrames;
273 	HBA_INT64	    TxWords;
274 	HBA_INT64	    RxFrames;
275 	HBA_INT64	    RxWords;
276 	HBA_INT64	    LIPCount;
277 	HBA_INT64	    NOSCount;
278 	HBA_INT64	    ErrorFrames;
279 	HBA_INT64	    DumpedFrames;
280 	HBA_INT64	    LinkFailureCount;
281 	HBA_INT64	    LossOfSyncCount;
282 	HBA_INT64	    LossOfSignalCount;
283 	HBA_INT64	    PrimitiveSeqProtocolErrCount;
284 	HBA_INT64	    InvalidTxWordCount;
285 	HBA_INT64	    InvalidCRCCount;
286 }SMHBA_FCPHYSTATISTICS, *PSMHBA_FCPHYSTATISTICS;
287 
288 /* SM-HBA 6.6.2.1 Phy Statistics Data Declaration */
289 typedef union SMHBA_PhyStatistics {
290 	SMHBA_SASPHYSTATISTICS	*SASPhyStatistics;
291 	SMHBA_FCPHYSTATISTICS	*FCPhyStatistics;
292 } SMHBA_PHYSTATISTICS, *PSMHBA_PHYSTATISTICS;
293 
294 /* SM-HBA 6.7.1.1 SMHBA_BIND_CAPABILITY */
295 typedef HBA_UINT32 SMHBA_BIND_CAPABILITY;
296 #define	SMHBA_CAN_BIND_TO_WWPN 0x0001
297 #define	SMHBA_CAN_BIND_TO_LUID 0x0002
298 #define	SMHBA_CAN_BIND_ANY_LUNS 0x0400
299 #define	SMHBA_CAN_BIND_AUTOMAP 0x0800
300 
301 /* SM-HBA 6.7.1.2 SMHBA_BIND_TYPE */
302 typedef HBA_UINT32 SMHBA_BIND_TYPE;
303 #define	SMHBA_BIND_TO_WWPN 0x0001
304 #define	SMHBA_BIND_TO_LUID 0x0002
305 
306 /* SM-HBA 6.7.1.3 SMHBA_ScsiId */
307 typedef struct SMHBA_ScsiId {
308 	char	    OSDeviceName[256];
309 	HBA_UINT32  ScsiBusNumber;
310 	HBA_UINT32  ScsiTargetNumber;
311 	HBA_UINT32  ScsiOSLun;
312 } SMHBA_SCSIID, *PSMHBA_SCSIID;
313 
314 /* SM-HBA 6.7.1.4 SMHBA_LUID */
315 typedef struct SMHBA_LUID {
316 	char	    buffer[256];
317 } SMHBA_LUID, *PSMHBA_LUID;
318 
319 /* SM-HBA 6.7.1.5 SMHBA_PORTLUN */
320 typedef struct SMHBA_PORTLUN {
321 	HBA_WWN		    PortWWN;
322 	HBA_WWN		    domainPortWWN;
323 	SMHBA_SCSILUN	    TargetLun;
324 } SMHBA_PORTLUN, *PSMHBA_PORTLUN;
325 
326 /* SM-HBA 6.7.1.6 Composite types */
327 typedef struct SMHBA_ScsiEntry {
328 	SMHBA_SCSIID ScsiId;
329 	SMHBA_PORTLUN PortLun;
330 	SMHBA_LUID LUID;
331 } SMHBA_SCSIENTRY, *PSMHBA_SCSIENTRY;
332 
333 typedef struct SMHBA_TargetMapping {
334 	HBA_UINT32 NumberOfEntries;
335 	SMHBA_SCSIENTRY entry[1]; /* Variable length array */
336 } SMHBA_TARGETMAPPING, *PSMHBA_TARGETMAPPING;
337 
338 typedef struct SMHBA_BindingEntry {
339 	SMHBA_BIND_TYPE	type;
340 	SMHBA_SCSIID	ScsiId;
341 	SMHBA_PORTLUN	PortLun;
342 	SMHBA_LUID	LUID;
343 	HBA_STATUS	Status;
344 } SMHBA_BINDINGENTRY, *PSMHBA_BINDINGENTRY;
345 
346 typedef struct SMHBA_Binding {
347 	HBA_UINT32	    NumberOfEntries;
348 	SMHBA_BINDINGENTRY  entry[1]; /* Variable length array */
349 } SMHBA_BINDING, *PSMHBA_BINDING;
350 
351 /* SM-HBA 6.9.5 Library Attribute Data Declarations */
352 typedef struct SMHBA_LibraryAttributes {
353 	char	    LibPath[256];
354 	char	    VName[256];
355 	char	    VVersion[256];
356 	struct {
357 		int	tm_mday;    /* day of the month - [1 - 31] */
358 		int	tm_mon;	    /* months since January - [0 - 11] */
359 		int	tm_year;    /* years since 1900 */
360 	} build_date;
361 } SMHBA_LIBRARYATTRIBUTES, *PSMHBA_LIBRARYATTRIBUTES;
362 
363 /* SM-HBA 6.8.1 Asynchronous Event Data Declarations */
364 #define	HBA_EVENT_PORT_BROADCAST_CHANGE 0x205
365 #define	HBA_EVENT_PORT_BROADCAST_SES	0x208
366 #define	HBA_EVENT_PORT_BROADCAST_D24_0  0x206
367 #define	HBA_EVENT_PORT_BROADCAST_D27_4  0x207
368 #define	HBA_EVENT_PORT_BROADCAST_D01_4  0x209
369 #define	HBA_EVENT_PORT_BROADCAST_D04_7  0x20A
370 #define	HBA_EVENT_PORT_BROADCAST_D16_7  0x20B
371 #define	HBA_EVENT_PORT_BROADCAST_D29_7  0x20C
372 #define	HBA_EVENT_PORT_ALL		0x2FF
373 
374 /* SM-HBA specific entry points. */
375 
376 HBA_UINT32 SMHBA_GetVersion();
377 
378 HBA_UINT32 SMHBA_GetWrapperLibraryAttributes(
379 	SMHBA_LIBRARYATTRIBUTES *attributes
380 );
381 
382 HBA_UINT32 SMHBA_GetVendorLibraryAttributes(
383 	HBA_UINT32		adapter_index,
384 	SMHBA_LIBRARYATTRIBUTES *attributes
385 );
386 
387 HBA_STATUS SMHBA_GetAdapterAttributes(
388 	HBA_HANDLE handle,
389 	SMHBA_ADAPTERATTRIBUTES *pAdapterAttributes
390 );
391 
392 HBA_STATUS SMHBA_GetNumberOfPorts(
393 	HBA_HANDLE handle,
394 	HBA_UINT32 *numberofports
395 );
396 
397 HBA_STATUS SMHBA_GetPortType(
398 	HBA_HANDLE handle,
399 	HBA_UINT32 portindex,
400 	HBA_PORTTYPE *porttype
401 );
402 
403 HBA_STATUS SMHBA_GetAdapterPortAttributes(
404 	HBA_HANDLE handle,
405 	HBA_UINT32 portindex,
406 	SMHBA_PORTATTRIBUTES *portattributes
407 );
408 
409 HBA_STATUS SMHBA_GetDiscoveredPortAttributes(
410 	HBA_HANDLE handle,
411 	HBA_UINT32 portindex,
412 	HBA_UINT32 discoveredportindex,
413 	SMHBA_PORTATTRIBUTES *porattributes
414 );
415 
416 HBA_STATUS SMHBA_GetPortAttributesByWWN(
417 	HBA_HANDLE handle,
418 	HBA_WWN portWWN,
419 	HBA_WWN domainPortWWN,
420 	SMHBA_PORTATTRIBUTES *portattributes
421 );
422 
423 HBA_STATUS SMHBA_GetPortAttributesByWWN(
424 	HBA_HANDLE handle,
425 	HBA_WWN portWWN,
426 	HBA_WWN domainPortWWN,
427 	SMHBA_PORTATTRIBUTES *portattributes
428 );
429 
430 HBA_STATUS SMHBA_GetFCPhyAttributes(
431 	HBA_HANDLE handle,
432 	HBA_UINT32 portindex,
433 	HBA_UINT32 phyindex,
434 	SMHBA_FC_PHY *phytype
435 );
436 
437 HBA_STATUS SMHBA_GetSASPhyAttributes(
438 	HBA_HANDLE handle,
439 	HBA_UINT32 portindex,
440 	HBA_UINT32 phyindex,
441 	SMHBA_SAS_PHY *phytype
442 );
443 
444 HBA_STATUS SMHBA_GetProtocolStatistics(
445 	HBA_HANDLE handle,
446 	HBA_UINT32 portindex,
447 	HBA_UINT32 protocoltype,
448 	SMHBA_PROTOCOLSTATISTICS *pProtocolStatistics
449 );
450 
451 HBA_STATUS SMHBA_GetPhyStatistics(
452 	HBA_HANDLE handle,
453 	HBA_UINT32 portindex,
454 	HBA_UINT32 phyindex,
455 	SMHBA_PHYSTATISTICS *pPhyStatistics
456 );
457 
458 HBA_STATUS SMHBA_SendTEST(
459 	HBA_HANDLE handle,
460 	HBA_WWN hbaPortWWN,
461 	HBA_WWN destWWN,
462 	HBA_UINT32 destFCID,
463 	void *pReqBuffer,
464 	HBA_UINT32 ReqBufferSize
465 );
466 
467 HBA_STATUS SMHBA_SendECHO(
468 	HBA_HANDLE handle,
469 	HBA_WWN hbaPortWWN,
470 	HBA_WWN destWWN,
471 	HBA_UINT32 destFCID,
472 	void *pReqBuffer,
473 	HBA_UINT32 ReqBufferSize,
474 	void *pRspBuffer,
475 	HBA_UINT32 *pRspBufferSize
476 );
477 
478 HBA_UINT32 SMHBA_SendSMPPassThru(
479 	HBA_HANDLE handle,
480 	HBA_WWN hbaportWWN,
481 	HBA_WWN destportWWN,
482 	HBA_WWN domainPortWWN,
483 	void *pReqBuffer,
484 	HBA_UINT32 ReqBufferSize,
485 	void *pRspBuffer,
486 	HBA_UINT32 *pRspBufferSize
487 );
488 
489 HBA_STATUS SMHBA_GetBindingCapability(
490 	HBA_HANDLE handle,
491 	HBA_WWN hbaPortWWN,
492 	HBA_WWN domainPortWWN,
493 	SMHBA_BIND_CAPABILITY *pFlags
494 );
495 
496 HBA_STATUS SMHBA_GetBindingSupport(
497 	HBA_HANDLE handle,
498 	HBA_WWN hbaPortWWN,
499 	HBA_WWN domainPortWWN,
500 	SMHBA_BIND_CAPABILITY *pFlags
501 );
502 
503 HBA_STATUS SMHBA_SetBindingSupport(
504 	HBA_HANDLE handle,
505 	HBA_WWN hbaPortWWN,
506 	HBA_WWN domainPortWWN,
507 	SMHBA_BIND_CAPABILITY flags
508 );
509 
510 HBA_STATUS SMHBA_GetTargetMapping(
511 	HBA_HANDLE handle,
512 	HBA_WWN hbaPortWWN,
513 	HBA_WWN domainPortWWN,
514 	SMHBA_TARGETMAPPING *pMapping
515 );
516 
517 HBA_STATUS SMHBA_GetPersistentBinding(
518 	HBA_HANDLE handle,
519 	HBA_WWN hbaPortWWN,
520 	HBA_WWN domainPortWWN,
521 	SMHBA_BINDING *binding
522 );
523 
524 HBA_STATUS SMHBA_SetPersistentBinding(
525 	HBA_HANDLE handle,
526 	HBA_WWN hbaPortWWN,
527 	HBA_WWN domainPortWWN,
528 	const SMHBA_BINDING *binding
529 );
530 
531 HBA_STATUS SMHBA_RemovePersistentBinding(
532 	HBA_HANDLE handle,
533 	HBA_WWN hbaPortWWN,
534 	HBA_WWN domainPortWWN,
535 	const SMHBA_BINDING *binding
536 );
537 
538 HBA_STATUS SMHBA_RemoveAllPersistentBindings(
539 	HBA_HANDLE handle,
540 	HBA_WWN hbaPortWWN,
541 	HBA_WWN domainPortWWN
542 );
543 
544 HBA_STATUS SMHBA_GetLUNStatistics(
545 	HBA_HANDLE handle,
546 	const HBA_SCSIID *lunit,
547 	SMHBA_PROTOCOLSTATISTICS *statistics
548 );
549 
550 HBA_STATUS SMHBA_ScsiInquiry(
551 	HBA_HANDLE handle,
552 	HBA_WWN hbaPortWWN,
553 	HBA_WWN discoveredPortWWN,
554 	HBA_WWN domainPortWWN,
555 	SMHBA_SCSILUN smhbaLUN,
556 	HBA_UINT8 CDB_Byte1,
557 	HBA_UINT8 CDB_Byte2,
558 	void *pRspBuffer,
559 	HBA_UINT32 *pRspBufferSize,
560 	HBA_UINT8 *pScsiStatus,
561 	void *pSenseBuffer,
562 	HBA_UINT32 *pSenseBufferSize
563 );
564 
565 HBA_STATUS SMHBA_ScsiReportLUNs(
566 	HBA_HANDLE handle,
567 	HBA_WWN hbaPortWWN,
568 	HBA_WWN discoveredPortWWN,
569 	HBA_WWN domainPortWWN,
570 	void *pRspBuffer,
571 	HBA_UINT32 *pRspBufferSize,
572 	HBA_UINT8 *pScsiStatus,
573 	void *pSenseBuffer,
574 	HBA_UINT32 *pSenseBufferSize
575 );
576 
577 HBA_STATUS SMHBA_ScsiReadCapacity(
578 	HBA_HANDLE handle,
579 	HBA_WWN hbaPortWWN,
580 	HBA_WWN discoveredPortWWN,
581 	HBA_WWN domainPortWWN,
582 	SMHBA_SCSILUN smhbaLUN,
583 	void *pRspBuffer,
584 	HBA_UINT32 *pRspBufferSize,
585 	HBA_UINT8 *pScsiStatus,
586 	void *pSenseBuffer,
587 	HBA_UINT32 *pSenseBufferSize
588 );
589 
590 HBA_STATUS SMHBA_RegisterForAdapterAddEvents(
591 	void (*pCallback) (
592 		void *pData,
593 		HBA_WWN portWWN,
594 		HBA_UINT32 eventType),
595 	void *pUserData,
596 	HBA_CALLBACKHANDLE *pCallbackHandle
597 );
598 
599 HBA_STATUS SMHBA_RegisterForAdapterEvents(
600 	void (*pCallback) (
601 		void *pData,
602 		HBA_WWN portWWN,
603 		HBA_UINT32 eventType),
604 	void *pUserData,
605 	HBA_HANDLE handle,
606 	HBA_CALLBACKHANDLE *pCallbackHandle
607 );
608 
609 HBA_STATUS SMHBA_RegisterForAdapterPortEvents(
610 	void (*pCallback) (
611 		void *pData,
612 		HBA_WWN portWWN,
613 		HBA_UINT32 eventType,
614 		HBA_UINT32 fabricPortID),
615 	void *pUserData,
616 	HBA_HANDLE handle,
617 	HBA_WWN portWWN,
618 	HBA_UINT32 specificEventType,
619 	HBA_CALLBACKHANDLE *pCallbackHandle
620 );
621 
622 HBA_STATUS SMHBA_RegisterForAdapterPortStatEvents(
623 	void (*pCallback) (
624 		void *pData,
625 		HBA_WWN portWWN,
626 		HBA_UINT32 protocolType,
627 		HBA_UINT32 eventType),
628 	void *pUserData,
629 	HBA_HANDLE handle,
630 	HBA_WWN portWWN,
631 	HBA_UINT32 protocolType,
632 	SMHBA_PROTOCOLSTATISTICS stats,
633 	HBA_UINT32 statType,
634 	HBA_CALLBACKHANDLE *pCallbackHandle
635 );
636 
637 HBA_STATUS SMHBA_RegisterForAdapterPhyStatEvents(
638 	void (*pCallback) (
639 		void *pData,
640 		HBA_WWN portWWN,
641 		HBA_UINT32 phyIndex,
642 		HBA_UINT32 eventType),
643 	void *pUserData,
644 	HBA_HANDLE handle,
645 	HBA_WWN portWWN,
646 	HBA_UINT32 phyIndex,
647 	SMHBA_PHYSTATISTICS stats,
648 	HBA_UINT32 statType,
649 	HBA_CALLBACKHANDLE *pCallbackHandle
650 );
651 
652 HBA_STATUS SMHBA_RegisterForTargetEvents(
653 	void (*pCallback) (
654 		void *pData,
655 		HBA_WWN hbaPortWWN,
656 		HBA_WWN discoveredPortWWN,
657 		HBA_WWN domainPortWWN,
658 		HBA_UINT32 eventType),
659 	void *pUserData,
660 	HBA_HANDLE handle,
661 	HBA_WWN hbaPortWWN,
662 	HBA_WWN discoveredPortWWN,
663 	HBA_WWN domainPortWWN,
664 	HBA_CALLBACKHANDLE *pCallbackHandle,
665 	HBA_UINT32 allTargets
666 );
667 
668 #ifdef __cplusplus
669 }
670 #endif
671 
672 #endif /* _SMHBAAPI_H_ */
673