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