HBA_GetFcpTargetMappingV2 Subroutine

Purpose

Returns the mapping between OS targets or logical units and FCP targets or logical units offered by the specified HBA end port at the time the function call is processed.

Syntax

HBA_STATUS HBA_GetFcpTargetMappingV2(
		HBA_HANDLE handle,
		HBA_WWN hbaPortWWN,
		HBA_FCPTARGETMAPPINGV2 *pMapping
);

Description

The HBA_GetFcpTargetMappingV2 function returns the mapping between OS identification of SCSI targets or logical units and FCP identification of targets or logical units offered by the specified HBA end port at the time the function call is processed. Space in the pMapping structure permitting, one mapping entry is returned for each FCP logical unit represented in the OS and one mapping entry is returned for each FCP target that is represented in the OS but for which no logical units are represented in the OS. No target mapping entries are returned to represent FCP objects that are not represented in the OS (that is, objects that are unmapped).

The mappings returned include a Logical Unit Unique Device Identifier (LUID) for each logical unit that provides one. For logical units that provide more than one LUID, the LUID returned is the type 3 (FC Name_Identifier) LUID with the smallest identifier value if any LUID of type 3 is provided; otherwise, the type 2 (IEEE EUI-64) LUID with the smallest identifier value if any LUID of type 2 is provided; otherwise, the type 1 (T10 vendor identification) LUID with the smallest identifier value if any LUID of type 1 is provided; otherwise, the type 0 (vendor specific) LUID with the smallest identifier value. If the logical unit provides no LUID, the value of the first four bytes of the LUID field are 0.

Parameters

Item Description
handle A handle to an open HBA containing the end port for which target mappings are requested.
hbaPortWWN Port Name of the local HBA end port for which target mappings are requested.
pMapping Pointer to an HBA_FCPTARGETMAPPINGV2 structure. The size of this structure shall be limited by the NumberOfEntries value within the structure.

Return Values

The value of the HBA_GetFcpTargetMappingV2 function is a valid status return value that indicates the reason for completion of the requested function. HBA_STATUS_OK is returned to indicate that all mapping entries have been returned for the specified end port. A valid status return value that most closely describes the result of the function should be returned to indicate a reason with no required value.

The return value for the following parameter is as follows:

Item Description
pMapping Remains unchanged. The structure to which it points contains mapping information from OS identifications of SCSI logical units to FCP identifications of logical units for the specified local HBA end port. The number of entries in the structure is the minimum of the number of entries specified at function call or the full mapping. The value of the NumberOfEntries field of the returned structure is the total number of mappings the end port has established. This is true even when the function returns an error stating that the buffer is too small to return all of the established mappings. An upper-level application can either allocate a sufficiently large buffer and check this value after a read, or do a read of the NumberOfEntries value separately and allocate a new buffer given the size to accommodate the entire mapping structure.

Error Codes

Item Description
HBA_STATUS_ERROR_MORE_DATA More space in the buffer is required to contain mapping information.
HBA_STATUS_ERROR_ILLEGAL_WWN The HBA referenced by handle does not contain an end port with Port Name hbaPortWWN.
HBA_STATUS_ERROR_NOT_SUPPORTED The HBA referenced by handle does not support target mapping.
HBA_STATUS_ERROR Returned to indicate any problem with no required value.