1 '\" te
   2 .\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved.
   3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
   4 .\"  See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with
   5 .\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
   6 .TH LIBSMHBAAPI 3LIB "Aug 19, 2019"
   7 .SH NAME
   8 libSMHBAAPI, libsmhbaapi, SMHBA_GetAdapterAttributes,
   9 SMHBA_GetAdapterPortAttributes, SMHBA_GetBindingCapability,
  10 SMHBA_GetBindingSupport, SMHBA_GetDiscoveredPortAttributes,
  11 SMHBA_GetFCPhyAttributes, SMHBA_GetLUNStatistics, SMHBA_GetNumberofPorts,
  12 SMHBA_GetPersistentBinding, SMHBA_GetPhyStatistics,
  13 SMHBA_GetPortAttributesByWWN, SMHBA_GetPortType, SMHBA_GetProtocolStatistics,
  14 SMHBA_GetSASPhyAttributes, SMHBA_GetTargetMapping,
  15 SMHBA_GetVendorLibraryAttributes, SMHBA_GetVersion,
  16 SMHBA_GetWrapperLibraryAttributes, SMHBA_RegisterForAdapterAddEvents,
  17 SMHBA_RegisterForAdapterEvents, SMHBA_RegisterForAdapterPhyStatEvents,
  18 SMHBA_RegisterForAdapterPortEvents, SMHBA_RegisterForAdapterPortStatEvents,
  19 SMHBA_RegisterForTargetEvents, SMHBA_RegisterLibrary,
  20 SMHBA_RemoveAllPersistentBindings, SMHBA_RemovePersistentBinding,
  21 SMHBA_ScsiInquiry, SMHBA_ScsiReadCapacity, SMHBA_ScsiReportLuns,
  22 SMHBA_SendECHO, SMHBA_SendSMPPassThru, SMHBA_SendTEST, SMHBA_SetBindingSupport,
  23 SMHBA_SetPersistentBinding \- Common Storage Management HBA information library
  24 .SH SYNOPSIS
  25 .nf
  26 cc [ \fIflag\fR... ] \fIfile\fR... \fB-lSMHBAAPI\fR [ \fIlibrary\fR... ]
  27 #include <smhbaapi.h>
  28 .fi
  29 
  30 .SH DESCRIPTION
  31 The functions in this library access Fibre Channel and/or Serial Attached SCSI
  32 HBA data depending on vendor provided implementation underneath.
  33 .sp
  34 .LP
  35 HBA information is provided through a standard interface in a vendor
  36 independent manner. This common interface provides access to the following
  37 information:
  38 .RS +4
  39 .TP
  40 .ie t \(bu
  41 .el o
  42 Local HBA attributes
  43 .RE
  44 .RS +4
  45 .TP
  46 .ie t \(bu
  47 .el o
  48 Local HBA port attributes and statistics
  49 .RE
  50 .RS +4
  51 .TP
  52 .ie t \(bu
  53 .el o
  54 Mapping between discovered devices and operating system SCSI information
  55 .RE
  56 .RS +4
  57 .TP
  58 .ie t \(bu
  59 .el o
  60 Discovered devices port attributes
  61 .RE
  62 .RS +4
  63 .TP
  64 .ie t \(bu
  65 .el o
  66 SCSI commands for discovered devices (Report LUNS, Read Capacity, and Inquiry)
  67 .RE
  68 .RS +4
  69 .TP
  70 .ie t \(bu
  71 .el o
  72 Storage Management Protocol commands to discover Serial Attached SCSI
  73 configuration details
  74 .RE
  75 .RS +4
  76 .TP
  77 .ie t \(bu
  78 .el o
  79 Common Transport commands to discover Fibre Channel Fabric details
  80 .RE
  81 .SH INTERFACES
  82 The shared object \fBlibSMHBAAPI.so.1\fR provides the public interfaces defined
  83 below. See \fBIntro\fR(3) for additional information on shared object
  84 interfaces.
  85 .sp
  86 
  87 .sp
  88 .TS
  89 l l
  90 l l .
  91 \fBHBA_CloseAdapter\fR  \fBHBA_FreeLibrary\fR
  92 \fBHBA_GetAdapterName\fR        \fBHBA_GetNumberOfAdapters\fR
  93 \fBHBA_GetRNIDMgmtInfo\fR       \fBHBA_LoadLibrary\fR
  94 \fBHBA_OpenAdapter\fR   \fBHBA_RefreshAdapterConfiguration\fR
  95 \fBHBA_RefreshInformation\fR    \fBHBA_RegisterForLinkEvents\fR
  96 \fBHBA_RemoveCallback\fR        \fBHBA_SendCTPassThruV2\fR
  97 \fBHBA_SendLIRR\fR      \fBHBA_SendRLS\fR
  98 \fBHBA_SendRNIDV2\fR    \fBHBA_SendRPL\fR
  99 \fBHBA_SendRPS\fR       \fBHBA_SendSRL\fR
 100 \fBHBA_SetRNIDMgmtInfo\fR       \fBSMHBA_GetAdapterAttributes\fR
 101 \fBSMHBA_GetAdapterPortAttributes\fR    \fBSMHBA_GetBindingCapability\fR
 102 \fBSMHBA_GetBindingSupport\fR   \fBSMHBA_GetDiscoveredPortAttributes\fR
 103 \fBSMHBA_GetFCPhyAttributes\fR  \fBSMHBA_GetLUNStatistics\fR
 104 \fBSMHBA_GetNumberofPorts\fR    \fBSMHBA_GetPersistentBinding\fR
 105 \fBSMHBA_GetPhyStatistics\fR    \fBSMHBA_GetPortAttributesByWWN\fR
 106 \fBSMHBA_GetPortType\fR \fBSMHBA_GetProtocolStatistics\fR
 107 \fBSMHBA_GetSASPhyAttributes\fR \fBSMHBA_GetTargetMapping\fR
 108 \fBSMHBA_GetVendorLibraryAttributes\fR  \fBSMHBA_GetVersion\fR
 109 \fBSMHBA_GetWrapperLibraryAttributes\fR \fBSMHBA_RegisterForAdapterAddEvents\fR
 110 \fBSMHBA_RegisterForAdapterEvents\fR    \fBSMHBA_RegisterForAdapterPhyStatEvents\fR
 111 \fBSMHBA_RegisterForAdapterPortEvents\fR        \fBSMHBA_RegisterForAdapterPortStatEvents\fR
 112 \fBSMHBA_RegisterForTargetEvents\fR     \fBSMHBA_RegisterLibrary\fR
 113 \fBSMHBA_RemoveAllPersistentBindings\fR \fBSMHBA_RemovePersistentBinding\fR
 114 \fBSMHBA_ScsiInquiry\fR \fBSMHBA_ScsiReadCapacity\fR
 115 \fBSMHBA_ScsiReportLuns\fR      \fBSMHBA_SendECHO\fR
 116 \fBSMHBA_SendSMPPassThru\fR     \fBSMHBA_SendTEST\fR
 117 \fBSMHBA_SetBindingSupport\fR   \fBSMHBA_SetPersistentBinding\fR
 118 .TE
 119 
 120 .SH USAGE
 121 Client applications link with the Common Library (using -\fBlSMHBAAPI\fR) to
 122 access the interfaces. The Common Library dynamically loads individual
 123 Vendor-Specific Libraries (VSL) listed in \fB/etc/smhba.conf\fR and described
 124 on \fBsmhba.conf\fR(4).
 125 .sp
 126 .LP
 127 Using the \fBlibSMHBAAPI\fR involves the following steps:
 128 .RS +4
 129 .TP
 130 1.
 131 Optionally determining the version of the library by calling
 132 \fBSMHBA_GetVersion()\fR.
 133 .RE
 134 .RS +4
 135 .TP
 136 2.
 137 Initializing the Common Library by calling \fBHBA_LoadLibrary()\fR.
 138 .RE
 139 .RS +4
 140 .TP
 141 3.
 142 Determine the number of HBAs known to the common library by calling
 143 \fBHBA_GetNumberOfAdapters()\fR.
 144 .RE
 145 .RS +4
 146 .TP
 147 4.
 148 Determine each HBA name in turn by calling \fBHBA_GetAdapterName()\fR.
 149 .RE
 150 .RS +4
 151 .TP
 152 5.
 153 Open each HBA in turn by calling \fBHBA_OpenAdapter()\fR.
 154 .RE
 155 .RS +4
 156 .TP
 157 6.
 158 Operate on a given HBA by calling the following:
 159 .RS +4
 160 .TP
 161 .ie t \(bu
 162 .el o
 163 \fBSMHBA_GetAdapterAttributes()\fR
 164 .RE
 165 .RS +4
 166 .TP
 167 .ie t \(bu
 168 .el o
 169 \fBSMHBA_GetAdapterPortAttributes()\fR
 170 .RE
 171 .RS +4
 172 .TP
 173 .ie t \(bu
 174 .el o
 175 \fBSMHBA_GetDiscoveredPortAttributes()\fR
 176 .RE
 177 .RS +4
 178 .TP
 179 .ie t \(bu
 180 .el o
 181 \fBSMHBA_GetPortAttributesByWWN()\fR
 182 .RE
 183 .RS +4
 184 .TP
 185 .ie t \(bu
 186 .el o
 187 \fBSMHBA_GetNumberofPorts()\fR
 188 .RE
 189 .RS +4
 190 .TP
 191 .ie t \(bu
 192 .el o
 193 \fBSMHBA_GetPortType()\fR
 194 .RE
 195 .RS +4
 196 .TP
 197 .ie t \(bu
 198 .el o
 199 \fBSMHBA_GetProtocolStatistics()\fR
 200 .RE
 201 .RS +4
 202 .TP
 203 .ie t \(bu
 204 .el o
 205 \fBSMHBA_GetPhyStatistics()\fR
 206 .RE
 207 .RS +4
 208 .TP
 209 .ie t \(bu
 210 .el o
 211 \fBSMHBA_GetBindingCapability()\fR
 212 .RE
 213 .RS +4
 214 .TP
 215 .ie t \(bu
 216 .el o
 217 \fBSMHBA_GetBindingSupport()\fR
 218 .RE
 219 .RS +4
 220 .TP
 221 .ie t \(bu
 222 .el o
 223 \fBSMHBA_SetBindingSupport()\fR
 224 .RE
 225 .RS +4
 226 .TP
 227 .ie t \(bu
 228 .el o
 229 \fBSMHBA_GetTargetMapping()\fR
 230 .RE
 231 .RS +4
 232 .TP
 233 .ie t \(bu
 234 .el o
 235 \fBSMHBA_GetPersistentBinding()\fR
 236 .RE
 237 .RS +4
 238 .TP
 239 .ie t \(bu
 240 .el o
 241 \fBSMHBA_SetPersistentBinding()\fR
 242 .RE
 243 .RS +4
 244 .TP
 245 .ie t \(bu
 246 .el o
 247 \fBSMHBA_RemoveAllPersistentBindings()\fR
 248 .RE
 249 .RS +4
 250 .TP
 251 .ie t \(bu
 252 .el o
 253 \fBSMHBA_GetLUNStatistics()\fR
 254 .RE
 255 .RS +4
 256 .TP
 257 .ie t \(bu
 258 .el o
 259 \fBSMHBA_SendScsiInquiry()\fR
 260 .RE
 261 .RS +4
 262 .TP
 263 .ie t \(bu
 264 .el o
 265 \fBSMHBA_SendReportLuns()\fR
 266 .RE
 267 .RS +4
 268 .TP
 269 .ie t \(bu
 270 .el o
 271 \fBSMHBA_SendReadCapacity()\fR
 272 .RE
 273 .RS +4
 274 .TP
 275 .ie t \(bu
 276 .el o
 277 \fBSMHBA_RegisterForAdapterAddEvents()\fR
 278 .RE
 279 .RS +4
 280 .TP
 281 .ie t \(bu
 282 .el o
 283 \fBSMHBA_RegisterForAdapterEvents()\fR
 284 .RE
 285 .RS +4
 286 .TP
 287 .ie t \(bu
 288 .el o
 289 \fBSMHBA_RegisterForAdapterPortEvents()\fR
 290 .RE
 291 .RS +4
 292 .TP
 293 .ie t \(bu
 294 .el o
 295 \fBSMHBA_RegisterForAdapterPortStatEvents()\fR
 296 .RE
 297 .RS +4
 298 .TP
 299 .ie t \(bu
 300 .el o
 301 \fBSMHBA_RegisterForAdapterPhyStatEvents()\fR
 302 .RE
 303 .RS +4
 304 .TP
 305 .ie t \(bu
 306 .el o
 307 \fBSMHBA_RegisterForTargetEvents()\fR
 308 .RE
 309 .RS +4
 310 .TP
 311 .ie t \(bu
 312 .el o
 313 \fBHBA_RegisterForLinkEvents()\fR
 314 .RE
 315 .RS +4
 316 .TP
 317 .ie t \(bu
 318 .el o
 319 \fBHBA_RemoveCallback()\fR
 320 .RE
 321 For Serial Attached HBA
 322 .RS +4
 323 .TP
 324 .ie t \(bu
 325 .el o
 326 \fBSMHBA_GetSASPhyAttributes()\fR
 327 .RE
 328 .RS +4
 329 .TP
 330 .ie t \(bu
 331 .el o
 332 \fBSMHBA_SendSMPPassThru()\fR
 333 .RE
 334 For Fibre Channel HBA
 335 .RS +4
 336 .TP
 337 .ie t \(bu
 338 .el o
 339 \fBSMHBA_GetFCPhyAttributes()\fR
 340 .RE
 341 .RS +4
 342 .TP
 343 .ie t \(bu
 344 .el o
 345 \fBHBA_SendCTPassThruV2()\fR
 346 .RE
 347 .RS +4
 348 .TP
 349 .ie t \(bu
 350 .el o
 351 \fBHBA_SetRNIDMgmtInfo()\fR
 352 .RE
 353 .RS +4
 354 .TP
 355 .ie t \(bu
 356 .el o
 357 \fBHBA_GetRNIDMgmtInfo()\fR
 358 .RE
 359 .RS +4
 360 .TP
 361 .ie t \(bu
 362 .el o
 363 \fBHBA_SendRNIDV2()\fR
 364 .RE
 365 .RS +4
 366 .TP
 367 .ie t \(bu
 368 .el o
 369 \fBHBA_SendRPL()\fR
 370 .RE
 371 .RS +4
 372 .TP
 373 .ie t \(bu
 374 .el o
 375 \fBHBA_SendRPS()\fR
 376 .RE
 377 .RS +4
 378 .TP
 379 .ie t \(bu
 380 .el o
 381 \fBHBA_SendSRL()\fR
 382 .RE
 383 .RS +4
 384 .TP
 385 .ie t \(bu
 386 .el o
 387 \fBHBA_SendLIRR()\fR
 388 .RE
 389 .RS +4
 390 .TP
 391 .ie t \(bu
 392 .el o
 393 \fBHBA_SendRLS()\fR
 394 .RE
 395 .RS +4
 396 .TP
 397 .ie t \(bu
 398 .el o
 399 \fBHBA_SendTEST()\fR
 400 .RE
 401 .RS +4
 402 .TP
 403 .ie t \(bu
 404 .el o
 405 \fBHBA_SendECHO()\fR
 406 .RE
 407 .RE
 408 .RS +4
 409 .TP
 410 7.
 411 Close open HBAs by calling \fBHBA_CloseAdapter()\fR.
 412 .RE
 413 .RS +4
 414 .TP
 415 8.
 416 Unload the library by calling \fBHBA_FreeLibrary()\fR.
 417 .RE
 418 .SH ATTRIBUTES
 419 See \fBattributes\fR(5) for descriptions of the following attributes:
 420 .sp
 421 
 422 .sp
 423 .TS
 424 box;
 425 c | c
 426 l | l .
 427 ATTRIBUTE TYPE  ATTRIBUTE VALUE
 428 _
 429 Interface Stability     Committed
 430 _
 431 MT-Level        MT-Safe
 432 _
 433 Standard        T{
 434 ANSI INCITS 428  Storage Management Host Bus Adapter Application Programming Interface (SM-HBA)
 435 T}
 436 .TE
 437 
 438 .SH SEE ALSO
 439 \fBsmhba.conf\fR(4), \fBattributes\fR(5)