SupportedHBAAPIs(3)
π¦ SupportedHBAAPIs(3) π¦
okay so welcome to the SupportedHBAAPIs(3) page bestie π this is the full rundown of every HBA API function this library has your back on. it's giving "reference manual but make it a group chat", so let's go β¨
πΈ NAME πΈ
SupportedHBAAPIs β Supported HBA API Functions. that's it, that's the name, no cap π
β¨ SYNOPSIS β¨
π Functions π
HBA_UINT32 HBA_GetVersion (void)β returns the version of the HBA API specification that this library is compliant with πHBA_STATUS HBA_LoadLibrary (void)β does the initialization of the library.HBA_STATUS HBA_FreeLibrary (void)β frees up the system resources that the library has used.HBA_STATUS HBA_RegisterLibrary (HBA_ENTRYPOINTS *pHBAInfo)β registers the functionality of FC-MI with the wrapper library.HBA_STATUS HBA_RegisterLibraryV2 (HBA_ENTRYPOINTSV2 *pHBAInfo)β registers the functionality of HBA API phase 2 with the wrapper library.HBA_UINT32 HBA_GetNumberOfAdapters (void)β returns the number of adapters.void HBA_RefreshInformation (HBA_HANDLE handle)β refreshes the information of one adapter.void HBA_RefreshAdapterConfiguration (void)β according to a discussion with Bob Nixon (editor of FC-HBA), this function has no effect in an HBA specific library πvoid HBA_ResetStatistics (HBA_HANDLE handle, HBA_UINT32 portindex)β according to FC-HBA, this function is obsolete πHBA_STATUS HBA_GetAdapterName (HBA_UINT32 adapterindex, char *pAdaptername)β returns the name that identifies an adapter.HBA_HANDLE HBA_OpenAdapter (char *pAdaptername)β opens an adapter.void HBA_CloseAdapter (HBA_HANDLE handle)β closes an open adapter.HBA_STATUS HBA_GetAdapterAttributes (HBA_HANDLE handle, HBA_ADAPTERATTRIBUTES *pAdapterattributes)β returns the attributes for an adapter.HBA_STATUS HBA_GetAdapterPortAttributes (HBA_HANDLE handle, HBA_UINT32 portindex, HBA_PORTATTRIBUTES *pPortattributes)β returns the attributes for an adapter port.HBA_STATUS HBA_GetDiscoveredPortAttributes (HBA_HANDLE handle, HBA_UINT32 portindex, HBA_UINT32 discoveredportindex, HBA_PORTATTRIBUTES *pPortattributes)β returns the attributes of a discovered port.HBA_STATUS HBA_GetPortStatistics (HBA_HANDLE handle, HBA_UINT32 portindex, HBA_PORTSTATISTICS *pPortstatistics)β returns the statistics of an adapter port.HBA_STATUS HBA_GetFcpTargetMapping (HBA_HANDLE handle, HBA_FCPTARGETMAPPING *pMapping)β retrieves the mappings between OS SCSI targets/units and FCP targets/units.HBA_STATUS HBA_GetFcpTargetMappingV2 (HBA_HANDLE handle, HBA_WWN hbaPortWWN, HBA_FCPTARGETMAPPINGV2 *pMappingV2)β retrieves the mappings between OS SCSI targets/units and FCP targets/units. yes, again, it's the V2 glow-up π¦HBA_STATUS HBA_SendScsiInquiry (HBA_HANDLE handle, HBA_WWN PortWWN, HBA_UINT64 fcLUN, HBA_UINT8 EVPD, HBA_UINT32 PageCode, void *pRspBuffer, HBA_UINT32 RspBufferSize, void *pSenseBuffer, HBA_UINT32 SenseBufferSize)β sends a SCSI INQUIRY command to a FCP LUN.HBA_STATUS HBA_ScsiInquiryV2 (HBA_HANDLE handle, HBA_WWN hbaPortWWN, HBA_WWN discoveredPortWWN, HBA_UINT64 fcLUN, HBA_UINT8 CDB_Byte1, HBA_UINT8 CDB_Byte2, void *pRspBuffer, HBA_UINT32 *pRspBufferSize, HBA_UINT8 *pScsiStatus, void *pSenseBuffer, HBA_UINT32 *pSenseBufferSize)β sends a SCSI INQUIRY command to a FCP LUN.HBA_STATUS HBA_SendReportLUNs (HBA_HANDLE handle, HBA_WWN portWWN, void *pRspBuffer, HBA_UINT32 RspBufferSize, void *pSenseBuffer, HBA_UINT32 SenseBufferSize)β sends a SCSI REPORT LUNS command to a target.HBA_STATUS HBA_ScsiReportLUNsV2 (HBA_HANDLE handle, HBA_WWN hbaPortWWN, HBA_WWN discoveredPortWWN, void *pRspBuffer, HBA_UINT32 *pRspBufferSize, HBA_UINT8 *pScsiStatus, void *pSenseBuffer, HBA_UINT32 *pSenseBufferSize)β sends a SCSI REPORT LUNS command to a target.HBA_STATUS HBA_SendReadCapacity (HBA_HANDLE handle, HBA_WWN portWWN, HBA_UINT64 fcLUN, void *pRspBuffer, HBA_UINT32 RspBufferSize, void *pSenseBuffer, HBA_UINT32 SenseBufferSize)β sends a SCSI READ CAPACITY command to a FCP LUN.HBA_STATUS HBA_ScsiReadCapacityV2 (HBA_HANDLE handle, HBA_WWN hbaPortWWN, HBA_WWN discoveredPortWWN, HBA_UINT64 fcLUN, void *pRspBuffer, HBA_UINT32 *pRspBufferSize, HBA_UINT8 *pScsiStatus, void *pSenseBuffer, HBA_UINT32 *pSenseBufferSize)β sends a SCSI READ CAPACITY command to a FCP LUN.HBA_STATUS HBA_SendCTPassThru (HBA_HANDLE handle, void *pReqBuffer, HBA_UINT32 ReqBufferSize, void *pRspBuffer, HBA_UINT32 RspBufferSize)β sends a CT pass thru β a CT frame constructed in userspace going directly to the HBA / SAN π₯HBA_STATUS HBA_SendCTPassThruV2 (HBA_HANDLE handle, HBA_WWN hbaPortWWN, void *pReqBuffer, HBA_UINT32 ReqBufferSize, void *pRspBuffer, HBA_UINT32 *pRspBufferSize)β sends a CT pass thru β a CT frame constructed in userspace going directly to the HBA / SAN.HBA_STATUS HBA_SendRNID (HBA_HANDLE handle, HBA_WWN wwn, HBA_WWNTYPE wwntype, void *pRspBuffer, HBA_UINT32 *pRspBufferSize)β sends a RNID ELS to a port.HBA_STATUS HBA_SendRNIDV2 (HBA_HANDLE handle, HBA_WWN hbaPortWWN, HBA_WWN destWWN, HBA_UINT32 destFCID, HBA_UINT32 NodeIdDataFormat, void *pRspBuffer, HBA_UINT32 *pRspBufferSize)β sends a RNID ELS to a port.HBA_STATUS HBA_GetEventBuffer (HBA_HANDLE handle, HBA_EVENTINFO *pEventBuffer, HBA_UINT32 *pEventCount)β returns events for an adapter, pulled out of the event queue π
π Detailed Description π
lowkey this section is completely empty on the page β no prose, nothing, it just vibes there and hands the mic straight to the Function Documentation. iconic behaviour honestly π
π Function Documentation π
π«Ά void HBA_CloseAdapter (HBA_HANDLE handle)
closes an open adapter. like, actually shuts it down.
Parameters
- handle β handle of the adapter to be closed
Locks:
lock/unlock of vlib_data.mutex
the adapter handle gets invalidated, and all the info about the ports and units of this adapter is deleted ποΈ
References doCloseAdapter(), getAdapterByHandle(), vlib_adapter::handle, vlib_data::mutex, VLIB_MUTEX_LOCK, and VLIB_MUTEX_UNLOCK.
Referenced by HBA_RegisterLibrary(), and HBA_RegisterLibraryV2().
π«Ά HBA_STATUS HBA_FreeLibrary (void )
frees the system resources that the library has used. spring cleaning bestie π§Ή
Returns
HBA_STATUS_ERROR_NOT_LOADEDifHBA_LoadLibrarywas not called before.HBA_STATUS_ERRORifHBA_FreeLibraryis already running.HBA_STATUS_OKon success.
Locks:
lock/unlock of vlib_data.mutex
Note β this function tries to close the zfcp_hbaapi char device. π
References closeAllAdapters(), vlib_data::id, vlib_data::isLoaded, vlib_data::mutex, vlib_data::unloading, VLIB_MUTEX_LOCK, and VLIB_MUTEX_UNLOCK.
Referenced by HBA_RegisterLibrary(), and HBA_RegisterLibraryV2().
π«Ά HBA_STATUS HBA_GetAdapterAttributes (HBA_HANDLE handle, HBA_ADAPTERATTRIBUTES * pAdapterattributes)
returns the attributes for an adapter. the whole personality profile, basically π
Parameters
- handle β handle of an opened adapter
- pAdapterattributes β pointer to return atributes
Returns
HBA_STATUS_NOT_LOADEDif the library is not loadedHBA_STATUS_ERROR_INVALID_HANDLEif the handle is invalidHBA_STATUS_ERROR_UNAVAILABLEif the adapter is unavailableHBA_STATUS_ERRORif any other internal error occursHBA_STATUS_OKon success
Locks:
lock/unlock of vlib_data.mutex
Note β ZFCP HBA API does not set the adapter attributesOptionROMVersionandNodeSymbolicName. so don't come for them when they're blank π
References getAdapterByHandle(), vlib_adapter::handle, vlib_data::mutex, revalidateRepository(), sysfs_getAdapterAttributes(), VLIB_MUTEX_LOCK, and VLIB_MUTEX_UNLOCK.
Referenced by HBA_RegisterLibrary(), and HBA_RegisterLibraryV2().
π«Ά HBA_STATUS HBA_GetAdapterName (HBA_UINT32 adapterindex, char * pAdaptername)
returns the name that identifies an adapter. name tag energy β¨
Parameters
- adapterindex β index of the HBA
- pAdaptername β used to return the ASCII string
Returns
HBA_STATUS_NOT_LOADEDif the library is not loadedHBA_STATUS_ERROR_ILLEGAL_INDEXif the index is invalidHBA_STATUS_ERRORif any other internal error occursHBA_STATUS_OKon success
Locks:
lock/unlock of vlib_data.mutex
See also revalidateRepository()
References getAdapterByIndex(), vlib_adapter::isInvalid, vlib_data::mutex, revalidateRepository(), VLIB_ADAPTERNAME_LEN, VLIB_ADAPTERNAME_PREFIX, VLIB_MUTEX_LOCK, and VLIB_MUTEX_UNLOCK.
Referenced by HBA_RegisterLibrary(), and HBA_RegisterLibraryV2().
π«Ά HBA_STATUS HBA_GetAdapterPortAttributes (HBA_HANDLE handle, HBA_UINT32 portindex, HBA_PORTATTRIBUTES * pPortattributes)
returns the attributes for an adapter port π¦
Parameters
- handle β handle to an opened adapter
- portindex β index of the adapter port
- pPortattributes β pointer to return atributes
Returns
HBA_STATUS_NOT_LOADEDif the library is not loadedHBA_STATUS_ERROR_INVALID_HANDLEif the handle is invalidHBA_STATUS_ERROR_UNAVAILABLEif the adapter is unavailableHBA_STATUS_ERROR_ILLEGAL_INDEXifportindexis invalidHBA_STATUS_ERRORif any other internal error occursHBA_STATUS_OKon success
Locks:
lock/unlock of vlib_data.mutex
Note β the parameterportindexmust be0, since we have only one local port on our adapters. no cap, just the one.
Additionally, this function triggers creation of port configuration for this adapter (see revalidatePorts()).
ZFCP HBA API does not set the port attributesFabricName,OSDeviceNameandPortSymbolicNamefor an adapter port.
References getAdapterByHandle(), vlib_adapter::handle, vlib_data::mutex, revalidatePorts(), revalidateRepository(), sysfs_getAdapterPortAttributes(), VLIB_MUTEX_LOCK, and VLIB_MUTEX_UNLOCK.
Referenced by HBA_RegisterLibrary(), and HBA_RegisterLibraryV2().
π«Ά HBA_STATUS HBA_GetDiscoveredPortAttributes (HBA_HANDLE handle, HBA_UINT32 portindex, HBA_UINT32 discoveredportindex, HBA_PORTATTRIBUTES * pPortattributes)
returns the attributes of a discovered port π
Parameters
- handle β handle to an opened adapter
- portindex β index of the adapter port
- discoveredportindex β index of the adapter port
- pPortattributes β pointer to return atributes
Returns
HBA_STATUS_NOT_LOADEDif the library is not loadedHBA_STATUS_ERROR_INVALID_HANDLEif the handle is invalidHBA_STATUS_ERROR_UNAVAILABLEif the adapter is unavailableHBA_STATUS_ERROR_ILLEGAL_INDEXifportindexordiscoveredindexis invalidHBA_STATUS_ERRORif any other internal error occursHBA_STATUS_OKon success
Locks:
lock/unlock of vlib_data.mutex
Note β the parameterportindexmust be0, since we have only one local port on our adapters.
For discovered ports, ZFCP HBA API does not set the port attributesOSDeviceName,PortMaxFrameSizeandPortSupportedFc4Types.PortSupportedSpeed,PortSpeed, andPortStateare set to values indicating unknwon.NumberofDiscoveredPortsis0. Most other values are determined using aGA_NXTrequest on the Name Server Directory Service. π
okay that's exactly where this part of the page runs out bestie β the discovered-port note is literally the last thing on it, and the rest of the function docs are coming right up π₯ don't go anywhere π
Okay so for PortSupportedFc4Types and PortActive Fc4Types we do not follow FC-HBA Rev 10 β we do not store them βlittle-endianβ but βbig-endianβ, exactly like Editors Note 1 suggests. Thatβs the vibe check for this one.
References: getAdapterByHandle(), getPortByIndex(), vlib_port::isInvalid, vlib_data::mutex, revalidateRepository(), sysfs_getDiscoveredPortAttributes(), VLIB_MUTEX_LOCK, and VLIB_MUTEX_UNLOCK.
Referenced by: HBA_RegisterLibrary(), and HBA_RegisterLibraryV2().
π¦ HBA_GetEventBuffer
HBA_STATUS HBA_GetEventBuffer (HBA_HANDLE handle, HBA_EVENTINFO * pEventBuffer, HBA_UINT32 * pEventCount)
Bestie, this one returns events for an adapter from the event queue.
Parameters:
handleto an opened adapter*pEventBufferpointer to return events*pEventCountpointer to size of event buffer (in event records)
Returns:
HBA_STATUS_NOT_LOADEDif library is not loadedHBA_STATUS_ERROR_INVALID_HANDLEif handle is invalidHBA_STATUS_ERROR_UNAVAILABLEif adapter is unavailableHBA_STATUS_ERRORif any other internal error occursHBA_STATUS_OKon success.
Locks: lock/unlock of vlib_data.mutex
References: getAdapterByHandle(), vlib_data::mutex, revalidateRepository(), VLIB_MUTEX_LOCK, and VLIB_MUTEX_UNLOCK.
Referenced by: HBA_RegisterLibrary(), and HBA_RegisterLibraryV2().
π HBA_GetFcpTargetMapping
HBA_STATUS HBA_GetFcpTargetMapping (HBA_HANDLE handle, HBA_FCPTARGETMAPPING * pMapping)
This is the one that retrieves mappings between OS SCSI targets/units and FCP targets/units.
Parameters:
handleto an opened adapter*pMappingpointer to return target mappings
Returns:
HBA_STATUS_NOT_LOADEDif library is not loadedHBA_STATUS_ERROR_INVALID_HANDLEif handle is invalidHBA_STATUS_ERROR_UNAVAILABLEif adapter is unavailableHBA_STATUS_ERROR_MORE_DATAif there is not enough space inpMappingto return complete mapping informationHBA_STATUS_ERRORif any other internal error occursHBA_STATUS_OKon success.
Locks: lock/unlock of vlib_data.mutex
Note: AnOSDeviceNameis not provided for target mappings. Additionally this function triggers creation of unit configuration for this adapter (seerevalidateUnits()).
References: vlib_unit::channel, vlib_port::did, vlib_unit::fcLun, getAdapterByHandle(), getPortByIndex(), getUnitByIndex(), vlib_adapter_ident::host, vlib_adapter::ident, vlib_port::isInvalid, vlib_unit::isInvalid, vlib_unit::lun, vlib_data::mutex, vlib_adapter::ports, revalidatePorts(), revalidateRepository(), revalidateUnits(), vlib_unit::target, vlib_port::units, block::used, vlib_FCID_to_hbaFCID(), VLIB_MUTEX_LOCK, VLIB_MUTEX_UNLOCK, vlib_wwn_to_HBA_WWN(), vlib_port::wwnn, and vlib_port::wwpn.
Referenced by: HBA_GetFcpTargetMappingV2(), HBA_RegisterLibrary(), and HBA_RegisterLibraryV2().
β¨ HBA_GetFcpTargetMappingV2
HBA_STATUS HBA_GetFcpTargetMappingV2 (HBA_HANDLE handle, HBA_WWN hbaPortWWN, HBA_FCPTARGETMAPPINGV2 * pMappingV2)
Same mapping energy as above β retrieve mappings between OS SCSI targets/units and FCP targets/units.
Parameters:
handleto an opened adapter*pMappingpointer to return target mappings*hbaPortWWNwwpn to identify the port on the adapter
Returns: see HBA_GetFcpTargetMapping
Locks: lock/unlock of vlib_data.mutex
Note:HBA_LUIDis not provided for target mappings. Our βadaptersβ have only one port, so the WWN parameter is superfluous. We only check if it matches to the adapter handle, if yes, we callHBA_GetFcpTargetMapping.
References: getAdapterByHandle(), vlib_adapter::handle, HBA_GetFcpTargetMapping(), vlib_adapter::ident, vlib_data::mutex, vlib_HBA_WWN_to_wwn(), VLIB_MUTEX_LOCK, VLIB_MUTEX_UNLOCK, and vlib_adapter_ident::wwpn.
Referenced by: HBA_RegisterLibraryV2().
πΈ HBA_GetNumberOfAdapters
HBA_UINT32 HBA_GetNumberOfAdapters (void )
Returns the number of adapters. Simple as that, no cap.
Returns:
0on error or if no adapters are configured- number of adapters on success
Locks: lock/unlock of vlib_data.mutex
References: vlib_data::adapters, vlib_data::mutex, revalidateRepository(), block::used, VLIB_MUTEX_LOCK, and VLIB_MUTEX_UNLOCK.
Referenced by: HBA_RegisterLibrary(), and HBA_RegisterLibraryV2().
π HBA_GetPortStatistics
HBA_STATUS HBA_GetPortStatistics (HBA_HANDLE handle, HBA_UINT32 portindex, HBA_PORTSTATISTICS * pPortstatistics)
Returns statistics of an adapter port. Itβs giving βnumbers with lore.β
Parameters:
handleto an opened adapterportindexindex of adapter portpPortstatisticspointer to return statistics
Returns:
HBA_STATUS_NOT_LOADEDif library is not loadedHBA_STATUS_ERROR_INVALID_HANDLEif handle is invalidHBA_STATUS_ERROR_UNAVAILABLEif adapter is unavailableHBA_STATUS_ERROR_ILLEGAL_INDEXifportindexis invalidHBA_STATUS_ERRORif any other internal error occursHBA_STATUS_OKon success.
Locks: lock/unlock of vlib_data.mutex
Note: Parameterportindexmust be0, since we have only one local port on our adapters.
References: getAdapterByHandle(), vlib_adapter::handle, vlib_data::mutex, revalidateRepository(), sysfs_getPortStatistics(), VLIB_MUTEX_LOCK, and VLIB_MUTEX_UNLOCK.
Referenced by: HBA_RegisterLibrary(), and HBA_RegisterLibraryV2().
β HBA_GetVersion
HBA_UINT32 HBA_GetVersion (void )
Returns the version of the HBA API specification with which this library is compliant.
Returns:
2(compliant to FC-HBA)
Note: No check if library is loaded has to be performed.
References: HBAAPI_LIBRARY_VERSION.
Referenced by: HBA_RegisterLibrary(), and HBA_RegisterLibraryV2().
π§ HBA_LoadLibrary
HBA_STATUS HBA_LoadLibrary (void )
Performs initialization of the library. The setup era, basically.
Returns:
HBA_STATUS_ERROR_ALREADY_LOADEDif this function was already called before.HBA_STATUS_ERRORif initialization fails.HBA_STATUS_OKon success.
Locks: lock/unlock of vlib_data.mutex
Note: This function tries to open the zfcp_hbaapi char device.
References: vlib_data::isLoaded, vlib_data::mutex, sysfs_createAndReadConfigAdapter(), VLIB_MUTEX_LOCK, and VLIB_MUTEX_UNLOCK.
Referenced by: HBA_RegisterLibrary(), and HBA_RegisterLibraryV2().
π«Ά HBA_OpenAdapter
HBA_HANDLE HBA_OpenAdapter (char * pAdaptername)
Opens an adapter. Main character moment for your adapter handle.
Parameters:
pAdapternamename of adapter to be opened (name was obtained by previous call toHBA_GetAdapterName())
Returns:
VLIB_INVALID_HANDLEon error- handle on success
Locks: lock/unlock of vlib_data.mutex
Note: Possible (theoretical) overflow of index values.
References: findIndexByName(), vlib_adapter::handle, vlib_data::mutex, openAdapterByIndex(), revalidateRepository(), VLIB_INVALID_HANDLE, VLIB_MUTEX_LOCK, and VLIB_MUTEX_UNLOCK.
Referenced by: HBA_RegisterLibrary(), and HBA_RegisterLibraryV2().
π HBA_RefreshInformation
void HBA_RefreshInformation (HBA_HANDLE handle)
Refresh information of an adapter. Glow-up, but for data.
Parameters:
handleof the adapter for which information should be refreshed.
Locks: lock/unlock of vlib_data.mutex
References: getAdapterByHandle(), vlib_adapter::handle, vlib_data::mutex, updateAdapter(), VLIB_LOG, VLIB_MUTEX_LOCK, and VLIB_MUTEX_UNLOCK.
Referenced by: HBA_RegisterLibrary(), and HBA_RegisterLibraryV2().
π HBA_RegisterLibrary
HBA_STATUS HBA_RegisterLibrary (HBA_ENTRYPOINTS * pHBAInfo)
Registers the functionality of FC-MI with the wrapper library. This is the phase 1 crew.
Parameters:
pHBAInfoentry points of HBA API phase 1 library functions
Returns: HBA_STATUS_OK
Note: This function is only defined if this library was built as a vendor specific library.
References: HBA_CloseAdapter(), HBA_FreeLibrary(), HBA_GetAdapterAttributes(), HBA_GetAdapterName(), HBA_GetAdapterPortAttributes(), HBA_GetDiscoveredPortAttributes(), HBA_GetEventBuffer(), HBA_GetFcpPersistentBinding(), HBA_GetFcpTargetMapping(), HBA_GetNumberOfAdapters(), HBA_GetPortAttributesByWWN(), HBA_GetPortStatistics(), HBA_GetRNIDMgmtInfo(), HBA_GetVersion(), HBA_LoadLibrary(), HBA_OpenAdapter(), HBA_RefreshInformation(), HBA_ResetStatistics(), HBA_SendCTPassThru(), HBA_SendReadCapacity(), HBA_SendReportLUNs(), HBA_SendRNID(), HBA_SendScsiInquiry(), and HBA_SetRNIDMgmtInfo().
π
HBA_RegisterLibraryV2
HBA_STATUS HBA_RegisterLibraryV2 (HBA_ENTRYPOINTSV2 * pHBAInfo)
Registers the functionality of HBA API phase 2 with the wrapper library. The V2 sequel, and yes it ate.
Parameters:
pHBAInfoentry points of HBA API phase 2 library functions
Returns: HBA_STATUS_OK on success
Note: This function is only defined if this library was built as a vendor specific library.
References: _GetVendorLibraryAttributes(), HBA_CloseAdapter(), HBA_FreeLibrary(), HBA_GetAdapterAttributes(), HBA_GetAdapterName(), HBA_GetAdapterPortAttributes(), HBA_GetBindingCapability(), HBA_GetBindingSupport(), HBA_GetDiscoveredPortAttributes(), HBA_GetEventBuffer(), HBA_GetFC4Statistics(), HBA_GetFcpPersistentBinding(), HBA_GetFCPStatistics(), HBA_GetFcpTargetMapping(), HBA_GetFcpTargetMappingV2(), HBA_GetNumberOfAdapters(), HBA_GetPersistentBindingV2(), HBA_GetPortAttributesByWWN(), HBA_GetPortStatistics(), HBA_GetRNIDMgmtInfo(), HBA_GetVersion(), HBA_LoadLibrary(), HBA_OpenAdapter(), HBA_OpenAdapterByWWN(), HBA_RefreshAdapterConfiguration(), HBA_RefreshInformation(), HBA_RegisterForAdapterAddEvents(), HBA_RegisterForAdapterEvents(), HBA_RegisterForAdapterPortEvents(), HBA_RegisterForAdapterPortStatEvents(), HBA_RegisterForLinkEvents(), HBA_RegisterForTargetEvents(), HBA_RemoveAllPersistentBindings(), HBA_RemoveCallback(), HBA_RemovePersistentBinding(), HBA_ResetStatistics(), HBA_ScsiInquiryV2(), HBA_ScsiReadCapacityV2(), HBA_ScsiReportLUNsV2(), HBA_SendCTPassThru(), HBA_SendCTPassThruV2(), HBA_SendLIRR(), HBA_SendReadCapacity(), HBA_SendReportLUNs(), HBA_SendRLS(), HBA_SendRNID(), HBA_SendRNIDV2(), HBA_SendRPL(), HBA_SendRPS(), HBA_SendScsiInquiry(), HBA_SendSRL(), HBA_SetBindingSupport(), HBA_SetPersistentBindingV2(), and HBA_SetRNIDMgmtInfo().
π HBA_ResetStatistics
void HBA_ResetStatistics (HBA_HANDLE handle, HBA_UINT32 portindex)
According to FC-HBA this function is obsolete. This function has no effect. Literally zero effect, bestie β not a single stat gets reset.
Referenced by: HBA_RegisterLibrary(), and HBA_RegisterLibraryV2().
π HBA_ScsiInquiryV2
HBA_STATUS HBA_ScsiInquiryV2 (HBA_HANDLE handle, HBA_WWN hbaPortWWN, HBA_WWN discoveredPortWWN, HBA_UINT64 fcLUN, HBA_UINT8 CDB_Byte1, HBA_UINT8 CDB_Byte2, void * pRspBuffer, HBA_UINT32 * pRspBufferSize, HBA_UINT8 * pScsiStatus, void * pSenseBuffer, HBA_UINT32 * pSenseBufferSize)
Send a SCSI INQUIRY command to a FCP LUN.
Parameters
handleβ a handle to an opened adapterhbaPortWWNβ the WWPN of the local adapter portdiscoveredPortWWNβ the WWPN of the target portfcLUNβ the FCP LUN of the unitEVPDβ Enhanced Vital Product DataPageCodeβ Vital Product Data page code, used ifEVPDis set*pRspBufferβ pointer to the return response dataRspBufferSizeβ the size of the response buffer*pSenseBufferβ pointer to return sense data on SCSICHECK_CONDITIONSenseBufferSizeβ the size of the sense buffer
Returns
HBA_STATUS_NOT_LOADEDβ if the library is not loadedHBA_STATUS_ERROR_INVALID_HANDLEβ ifhandleis invalidHBA_STATUS_ERROR_UNAVAILABLEβ if the adapter is unavailableHBA_STATUS_ERROR_INVALID_LUNβ if there's no unit configured for the the specifiedfcLUNHBA_STATUS_ERROR_MORE_DATAβ if there's not enough space inpRspBufferHBA_STATUS_ERRORβ if any other internal error occursHBA_STATUS_OKβ on success β¨
Locks: it does a lock/unlock of vlib_data.mutex π
Note
HBA_STATUS_ERROR_NOT_A_TARGETis not returned, because zfcp just deals with SCSI target ports.HBA_STATUS_ERROR_TARGET_BUSYis not returned, because zfcp cannot detect SCSI command overlap situations in general.
References _HBA_SendScsiInquiry().
Referenced by HBA_RegisterLibraryV2().
π HBA_STATUS HBA_ScsiReadCapacityV2 (HBA_HANDLE handle, HBA_WWN hbaPortWWN, HBA_WWN discoveredPortWWN, HBA_UINT64 fcLUN, void * pRspBuffer, HBA_UINT32 * pRspBufferSize, HBA_UINT8 * pScsiStatus, void * pSenseBuffer, HBA_UINT32 * pSenseBufferSize)
Okay so this one sends a SCSI READ CAPACITY command to a FCP LUN. Iconic, lowkey essential. π
Parameters
handleβ a handle to an opened adapterportWWNβ the WWPN of the target portfcLUNβ the FCP LUN of the unit*pRspBufferβ pointer to the return response dataRspBufferSizeβ the size of the response buffer*pSenseBufferβ pointer to return sense data on SCSICHECK_CONDITIONSenseBufferSizeβ the size of the sense buffer
Returns
HBA_STATUS_NOT_LOADEDβ if the library is not loadedHBA_STATUS_ERROR_INVALID_HANDLEβ ifhandleis invalidHBA_STATUS_ERROR_UNAVAILABLEβ if the adapter is unavailableHBA_STATUS_ERROR_INVALID_LUNβ if there's no unit configured for the the specifiedfcLUNHBA_STATUS_ERROR_MORE_DATAβ if there's not enough space inpRspBufferHBA_STATUS_ERRORβ if any other internal error occursHBA_STATUS_OKβ on success π
Locks: lock/unlock of vlib_data.mutex π
Note
HBA_STATUS_ERROR_NOT_A_TARGETis not returned, because zfcp just deals with SCSI target ports.HBA_STATUS_ERROR_TARGET_BUSYis not returned, because zfcp cannot detect SCSI command overlap situations in general.- ZFCP HBA API sends READ CAPACITY via libsgutils. Sense date is not supported that way, so the sensebuffer is always
NULLβ no cap, that's just how it is. π«
References _HBA_SendReadCapacity().
Referenced by HBA_RegisterLibraryV2().
π HBA_STATUS HBA_ScsiReportLUNsV2 (HBA_HANDLE handle, HBA_WWN hbaPortWWN, HBA_WWN discoveredPortWWN, void * pRspBuffer, HBA_UINT32 * pRspBufferSize, HBA_UINT8 * pScsiStatus, void * pSenseBuffer, HBA_UINT32 * pSenseBufferSize)
Sends a SCSI REPORT LUNS command to a target. Very "tell me everything you've got" energy. πββοΈ
Parameters
handleβ a handle to an opened adapterportWWNβ the WWPN of the local portdiscoveredPortWWNβ the WWPN of the target port*pRspBufferβ pointer to the return response data*RspBufferSizeβ pointer to the size of the response buffer*pSenseBufferβ pointer to return sense data on SCSICHECK_CONDITION*SenseBufferSizeβ pointer to the size of the sense buffer
Returns
HBA_STATUS_NOT_LOADEDβ if the library is not loadedHBA_STATUS_ERROR_INVALID_HANDLEβ ifhandleis invalidHBA_STATUS_ERROR_UNAVAILABLEβ if the adapter is unavailableHBA_STATUS_SCSI_CHECK_CONDITIONβ if a SCSICHECK_CONDITIONoccursHBA_STATUS_ERRORβ if any other internal error occursHBA_STATUS_OKβ on success π
Locks: lock/unlock of vlib_data.mutex π
Note
Lun Scanning only works if we have at least Lun 0 attached. In all other cases we cannot scan the Luns (yet). π In addition, no SCSI sense data will be returned. The only real difference to the V1 function is the additional parameter for the local port. Since our "adapters" have only one port, we can omit it.
References _HBA_SendReportLUNs().
Referenced by HBA_RegisterLibraryV2().
π¦ HBA_STATUS HBA_SendCTPassThru (HBA_HANDLE handle, void * pReqBuffer, HBA_UINT32 ReqBufferSize, void * pRspBuffer, HBA_UINT32 RspBufferSize)
Send a CT pass thru β a CT frame constructed in userspace directly to the HBA / SAN. Literally just yeeting your own frame straight out there. π€
Parameters
handleβ a handle to an opened adapter*pReqBufferβ pointer to the CT frameReqBufferSizeβ the size of the request buffer*pRspBufferβ pointer to the return response dataRspBufferSizeβ the size of the response buffer
Returns
HBA_STATUS_NOT_LOADEDβ if the library is not loadedHBA_STATUS_ERROR_INVALID_HANDLEβ ifhandleis invalidHBA_STATUS_ERROR_UNAVAILABLEβ if the adapter is unavailableHBA_STATUS_ERROR_MORE_DATAβ if there's not enough space inpRspBufferHBA_STATUS_ERRORβ if any other internal error occursHBA_STATUS_OKβ on success π«
Locks: lock/unlock of vlib_data.mutex π
References getAdapterByHandle(), vlib_adapter::handle, vlib_data::mutex, revalidateRepository(), VLIB_MUTEX_LOCK, and VLIB_MUTEX_UNLOCK.
Referenced by HBA_RegisterLibrary(), HBA_RegisterLibraryV2(), and HBA_SendCTPassThruV2().
πΈ HBA_STATUS HBA_SendCTPassThruV2 (HBA_HANDLE handle, HBA_WWN hbaPortWWN, void * pReqBuffer, HBA_UINT32 ReqBufferSize, void * pRspBuffer, HBA_UINT32 * pRspBufferSize)
Same CT pass thru vibe β a CT frame constructed in userspace, sent directly to the HBA / SAN. Glow-up version with a port WWN in the mix. β¨
Parameters
handleβ a handle to an opened adapterhbaPortWWNβ local port of adapter β not necessary in our case*pReqBufferβ pointer to the CT frameReqBufferSizeβ the size of the request buffer*pRspBufferβ pointer to the return response dataRspBufferSizeβ the size of the response buffer
Returns
HBA_STATUS_NOT_LOADEDβ if the library is not loadedHBA_STATUS_ERROR_INVALID_HANDLEβ ifhandleis invalidHBA_STATUS_ERROR_UNAVAILABLEβ if the adapter is unavailableHBA_STATUS_ERROR_MORE_DATAβ if there's not enough space inpRspBufferHBA_STATUS_ERRORβ if any other internal error occursHBA_STATUS_OKβ on success π
Locks: lock/unlock of vlib_data.mutex π
References vlib_adapter::handle, and HBA_SendCTPassThru().
Referenced by HBA_RegisterLibraryV2().
π§ HBA_STATUS HBA_SendReadCapacity (HBA_HANDLE handle, HBA_WWN portWWN, HBA_UINT64 fcLUN, void * pRspBuffer, HBA_UINT32 RspBufferSize, void * pSenseBuffer, HBA_UINT32 SenseBufferSize)
Sends a SCSI READ CAPACITY command to a FCP LUN. The O.G. version, no V2 energy. π
Parameters
handleβ a handle to an opened adapterportWWNβ the WWPN of the target portfcLUNβ the FCP LUN of the unit*pRspBufferβ pointer to the return response dataRspBufferSizeβ the size of the response buffer*pSenseBufferβ pointer to return sense data on SCSICHECK_CONDITIONSenseBufferSizeβ the size of the sense buffer
Returns
HBA_STATUS_NOT_LOADEDβ if the library is not loadedHBA_STATUS_ERROR_INVALID_HANDLEβ ifhandleis invalidHBA_STATUS_ERROR_UNAVAILABLEβ if the adapter is unavailableHBA_STATUS_ERROR_INVALID_LUNβ if there's no unit configured for the the specifiedfcLUNHBA_STATUS_ERROR_MORE_DATAβ if there's not enough space inpRspBufferHBA_STATUS_ERRORβ if any other internal error occursHBA_STATUS_OKβ on success π
Locks: lock/unlock of vlib_data.mutex π
Note
HBA_STATUS_ERROR_NOT_A_TARGETis not returned, because zfcp just deals with SCSI target ports.HBA_STATUS_ERROR_TARGET_BUSYis not returned, because zfcp cannot detect SCSI command overlap situations in general.- ZFCP HBA API sends READ CAPACITY via libsgutils. Sense date is not supported that way, so the sensebuffer is always
NULL. Sir, this is aNULL. π
References _HBA_SendReadCapacity().
Referenced by HBA_RegisterLibrary(), and HBA_RegisterLibraryV2().
π HBA_STATUS HBA_SendReportLUNs (HBA_HANDLE handle, HBA_WWN portWWN, void * pRspBuffer, HBA_UINT32 RspBufferSize, void * pSenseBuffer, HBA_UINT32 SenseBufferSize)
Sends a SCSI REPORT LUNS command to a target. π―ββοΈ
Parameters
handleβ a handle to an opened adapterportWWNβ the WWPN of the target port*pRspBufferβ pointer to the return response dataRspBufferSizeβ the size of the response buffer*pSenseBufferβ pointer to return sense data on SCSICHECK_CONDITIONSenseBufferSizeβ the size of the sense buffer
Returns
HBA_STATUS_NOT_LOADEDβ if the library is not loadedHBA_STATUS_ERROR_INVALID_HANDLEβ ifhandleis invalidHBA_STATUS_ERROR_UNAVAILABLEβ if the adapter is unavailableHBA_STATUS_SCSI_CHECK_CONDITIONβ if a SCSICHECK_CONDITIONoccursHBA_STATUS_ERRORβ if any other internal error occursHBA_STATUS_OKβ on success β
Locks: lock/unlock of vlib_data.mutex π
Note
Lun Scanning only works if we have at least Lun 0 attached. In all other cases we cannot scan the Luns (yet). π In addition, no SCSI sense data will be returned.
References _HBA_SendReportLUNs().
Referenced by HBA_RegisterLibrary(), and HBA_RegisterLibraryV2().
π HBA_STATUS HBA_SendRNID (HBA_HANDLE handle, HBA_WWN wwn, HBA_WWNTYPE wwntype, void * pRspBuffer, HBA_UINT32 * pRspBufferSize)
Sends a RNID ELS to a port. Little hello-how-are-you packet, bestie. π
Parameters
handleβ a handle to an opened adapterwwnβ of port to which to send RNID ELSwwntypeβ deprecated β οΈ*pRspBufferβ pointer to the return response data*pRspBufferSizeβ pointer to the size of the response buffer
Returns
HBA_STATUS_NOT_LOADEDβ if the library is not loadedHBA_STATUS_ERROR_INVALID_HANDLEβ ifhandleis invalidHBA_STATUS_ERROR_UNAVAILABLEβ if the adapter is unavailableHBA_STATUS_ERROR_MORE_DATAβ if there's not enough space inpRspBufferand response data is truncatedHBA_STATUS_ERRORβ if any other internal error occursHBA_STATUS_OKβ on success (LS_ACCorLS_RJT) π₯
Locks: lock/unlock of vlib_data.mutex π
References getAdapterByHandle(), vlib_data::mutex, revalidateRepository(), vlib_HBA_WWN_to_wwn(), VLIB_MUTEX_LOCK, and VLIB_MUTEX_UNLOCK.
Referenced by HBA_RegisterLibrary(), HBA_RegisterLibraryV2(), and HBA_SendRNIDV2().
π
HBA_SendRNIDV2 β send a RNID ELS
Okay so bestie, this one sends a RNID ELS to a port. The signature stays exactly like this:
HBA_STATUS HBA_SendRNIDV2 (HBA_HANDLE handle, HBA_WWN hbaPortWWN, HBA_WWN
destWWN, HBA_UINT32 destFCID, HBA_UINT32 NodeIdDataFormat, void *
pRspBuffer, HBA_UINT32 * pRspBufferSize)
Parameters β the original parameter blob, preserved with zero edits from me:
handleβ handle to an opened adapterhbaPortWWNβ local port of adapter - not necessary in our case- wwn of port to which to send RNID ELS
wwntypeβ deprecated*pRspBufferβ pointer to return response data*pRspBufferSizeβ pointer to size of response buffer
Returns
HBA_STATUS_NOT_LOADEDif library is not loadedHBA_STATUS_ERROR_INVALID_HANDLEif handle is invalidHBA_STATUS_ERROR_UNAVAILABLEif adapter is unavailableHBA_STATUS_ERROR_MORE_DATAif there is not enough space inpRspBufferand response data is truncatedHBA_STATUS_ERRORif any other internal error occursHBA_STATUS_OKon success (LS_ACC or LS_RJT).
Locks: lock/unlock of vlib_data.mutex
Note: this function just calls the V1 version above so the new functionality offered by V2 is not supported.
References HBA_SendRNID().
Referenced by HBA_RegisterLibraryV2().
π¦ HBA_SendScsiInquiry β send a SCSI INQUIRY command to a FCP LUN
This one is literally sending a SCSI INQUIRY command to a FCP LUN. Signature, untouched:
HBA_STATUS HBA_SendScsiInquiry (HBA_HANDLE handle, HBA_WWN PortWWN,
HBA_UINT64 fcLUN, HBA_UINT8 EVPD, HBA_UINT32 PageCode, void *
pRspBuffer, HBA_UINT32 RspBufferSize, void * pSenseBuffer, HBA_UINT32
SenseBufferSize)
Parameters
handleβ handle to an opened adapterPortWWNβ WWPN of the target portfcLUNβ FCP LUN of the unitEVPDβ Enhanced Vital Product DataPageCodeβ Vital Product Data page code ifEVPDis set*pRspBufferβ pointer to return response dataRspBufferSizeβ size of the response buffer*pSenseBufferβ pointer to return sense data on SCSICHECK_CONDITIONSenseBufferSizeβ size of the sense buffer
Returns
HBA_STATUS_NOT_LOADEDif library is not loadedHBA_STATUS_ERROR_INVALID_HANDLEif handle is invalidHBA_STATUS_ERROR_UNAVAILABLEif adapter is unavailableHBA_STATUS_ERROR_INVALID_LUNif there is no unit for the the specifiedfcLUNconfiguredHBA_STATUS_ERROR_MORE_DATAif there is not enough space inpRspBufferHBA_STATUS_SCSI_CHECK_CONDITIONif a SCSICHECK_CONDITIONoccursHBA_STATUS_ERROR_ARGifEVPDis neither0nor1HBA_STATUS_ERRORif any other internal error occursHBA_STATUS_OKon success.
Locks: lock/unlock of vlib_data.mutex
Note
HBA_STATUS_ERROR_NOT_A_TARGETis not returned because zfcp just deals with SCSI target ports.HBA_STATUS_ERROR_TARGET_BUSYis not returned because zfcp cannot detect SCSI command overlap situations in general.- ZFCP HBA API sends
INQUIRYas untagged if the unit is not previously registered at the SCSI mid layer. If the device is already registered there, untagged/tagged is chosen as indicated in the associatedScsi_Devicestructure of the unit.
And then the page says it again, slightly shorter β keeping both because details are sacred:
ZFCP HBA API sends INQUIRY as untagged if the unit is not previously registered at the mid layer. If the device is already registered there, untagged/tagged is chosen as indicated in the associated Scsi_Device structure of the unit.
References _HBA_SendScsiInquiry().
Referenced by HBA_RegisterLibrary(), and HBA_RegisterLibraryV2().
πΈ Author πΈ
Generated automatically by Doxygen for ZFCP HBA API Library from the source code. Not me, bestie β Iβm just the vibe translator. π
Source/version/date sign-off: source is ZFCP HBA API Library, version is Version 1, page is SupportedHBAAPIs(3) β and the footer doesnβt list a separate date here, so Iβm not inventing one. Periodt. π
π¦ where this page comes from
- opensuse-leap 16.0: libzfcphbaapi0 3.0.3-160000.2.2 Β· EPL-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms