Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
HBA_GetFcpTargetMapping(3) OSS Library Calls Reference Manual
NAME
HBA_GetFcpTargetMapping - Retrieves mapping between FCP targets and OS SCSI informa-
tion
LIBRARY
H-series OSS processes: /usr/lib/libcmnapi.a
SYNOPSIS
#include <snia_common.h>
HBA_STATUS HBA_GetFcpTargetMapping (
HBA_HANDLE handle,
PHBA_FCPTARGETMAPPING *mapping
);
PARAMETERS
handle Handle to an adapter opened by a call to the HBA_OpenAdapter( ) function.
The handle parameter is of type HBA_HANDLE, which is defined in Fibre
Channel - Methodologies for Interconnects (FC-MI) Revision 1.6.
mapping Contains the mapping between the FCP targets and the operating system SCSI
information.
DESCRIPTION
This function retrieves the mapping between FCP targets and the operating system SCSI infor-
mation for the adapter referred to by the handle parameter.
The mapping parameter is a pointer to an HBA_FCPTARGETMAPPING structure defined in
Fibre Channel - Methodologies for Interconnects (FC-MI) Revision 1.6. The size of this structure
is dependent on the NumberOfEntries value within the mapping structure, and can be of arbitrary
size. If the buffer is of sufficient size to store all the mappings established by the library, the
NumberOfEntries field contains the value of the actual number of mappings established and the
function returns successfully. Otherwise the NumberOfEntries field is set to the actual number of
mappings established and the function returns unsuccessfully.
An application can either allocate a sufficiently large buffer and check the NumberOfEntries
value after a read, or do a read of the NumberOfEntries value separately with a small buffer and
allocate a new buffer given the size to accommodate the entire mapping structure.
EXAMPLES
HBA_STATUS status;
HBA_HANDLE adapterhandle;
HBA_UINT32 mapsize;
HBA_FCPTARGETMAPPING map;
PHBA_FCPTARGETMAPPING maps;
memset (&map, 0, sizeof(map));
map.NumberOfEntries = 1;
if ((status = HBA_GetFcpTargetMapping(adapterhandle, &map)) == HBA_STATUS_ERROR_MORE_DATA)
{
printf ("HBA_GetFcpTargetMapping(1) returned %d targets", map.NumberOfEntries);
mapsize = map.NumberOfEntries;
if (mapsize > 0)
{
maps = (PHBA_FCPTARGETMAPPING) malloc ((mapsize) * sizeof(HBA_FCPTARGETMAPPING) );
if (maps)
{
maps->NumberOfEntries = mapsize;
3−180 Hewlett-Packard Company 527187-017