HBA_GetFcpTargetMapping, HBA_GetFcpTargetMappingV2 - retrieve mapping between FCP-2 discovered devices and operating system SCSI information
cc [ flag... ] file... -lHBAAPI [ library... ] #include <hbaapi.h> HBA_STATUS HBA_GetFcpTargetMapping(HBA_HANDLE handle, HBA_FCPTARGETMAPPING *mapping);
HBA_STATUS HBA_GetFcpTargetMappingV2(HBA_HANDLE handle, HBA_WWN hbaPortWWN, HBA_FCPTARGETMAPPINGV2 *mapping);
handle
mapping
hbaPortWWN
The HBA_GetFcpTargetMapping() function retrieves the current set of mappings between FCP LUNs and SCSI LUNs for a given HBA port.
The HBA_GetFcpTargetMappingV2() function retrieves the current set of mappings between FCP LUNs and SCSI LUNs for a given HBA. The mapping also includes a Logical Unit Unique Identifier for each logical unit.
The HBA_GetFcpTargetMappingV2() function returns the following values:
HBA_STATUS_ERROR_ILLEGAL_WWN
HBA_STATUS_ERROR_NOT_SUPPORTED
HBA_STATUS_ERROR
The HBA_GetFcpTargetMapping() and HBA_GetFcpTargetMappingV2() functions return the following values:
HBA_STATUS_OK
HBA_STATUS_ERROR_MORE_DATA
In the event that other error values are returned, the value of mapping->NumberOfEntries after the call should be checked, and if greater than the value before the call, a larger buffer should be allocated for a retry of the routine.
See libhbaapi(3LIB) for general error status values.
Example 1 Return target mapping data.
The following example returns target mapping data. It initially allocates space for one target mapping. If the number of entries returned is greater than the allocated space, a new buffer with sufficient space is allocated and HBA_GetFcpTargetMapping() is called again.
map = (HBA_FCPTARGETMAPPING *)calloc(1, sizeof (HBA_FCPTARGETMAPPING)); status = HBA_GetFcpTargetMapping(handle, map); if (map->NumberOfEntries > 0) { HBA_UINT32 noe = map->NumberOfEntries; free(map); map = (HBA_FCPTARGETMAPPING *)calloc (1, sizeof (HBA_FCPTARGETMAPPING) + (sizeof (HBA_FCPSCSIENTRY)*(noe - 1))); map->NumberOfEntries = noe; if ((status = HBA_GetFcpTargetMapping(handle, map)) != HBA_STATUS_OK) { fprintf(stderr, " Failed to get target " "mappings %d", status); free(map); } else { printf(" FCP Mapping entries: \n"); for (cntr = 0; cntr < map->NumberOfEntries; cntr ++) { printf(" Path(%d): \"%s\"\n", cntr, map->entry[cntr].ScsiId.OSDeviceName); } } }
See attributes(5) for descriptions of the following attributes:
|
HBA_OpenAdapter(3HBAAPI), libhbaapi(3LIB), attributes(5)
The HBA_GetFcpTargetMapping() routine does not take a portindex to define which port of a multi-ported HBA the command should apply to. The behavior on multi-ported HBAs is vendor specific, and may result in mappings or bindings for all ports being intermixed in the response buffer. SNIA version 2 defines a HBA_GetFcpTargetMappingV2() which takes a Port WWN as an argument. This fixes the bug with multi-ported HBAs in HBA_GetFcpTargetMapping().
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |