HBA_GetAdapterPortAttributes, HBA_GetDiscoveredPortAttributes, HBA_GetPortAttributesByWWN - retrieve Fibre Channel port attributes for a specific device
cc [ flag... ] file... -lHBAAPI [ library... ] #include <hbaapi.h> HBA_STATUS HBA_GetAdapterPortAttributes(HBA_HANDLE handle, HBA_UINT32 portindex, HBA_PORTATTRIBUTES *portattributes);
HBA_STATUS HBA_GetDiscoveredPortAttributes(HBA_HANDLE handle, HBA_UINT32 portindex, HBA_UINT32 discoveredportindex, HBA_PORTATTRIBUTES *portattributes);
HBA_STATUS HBA_GetPortAttributesByWWN(HBA_HANDLE handle, HBA_WWN PortWWN, HBA_PORTATTRIBUTES *portattributes);
handle
portindex
portattributes
discoveredportindex
PortWWN
The HBA_GetAdapterPortAttributes() function retrieves Port Attributes for a specific port on the HBA.
The HBA_GetDiscoveredPortAttributes() function retrieves Port Attributes for a specific discovered device connected to the HBA.
The HBA_GetPortAttributesByWWN() function retrieves Port Attributes for a specific device based on the PortWWN argument.
Upon successful completion, HBA_STATUS_OK is returned. Otherwise, an error value is returned from the underlying VSL and the values in hbaattributes are undefined.
See libhbaapi(3LIB) for general error status values.
Example 1 Retrieve the port attributes for each port on the HBA.
The following example retrieves the port attributes for each port on the HBA.
for (hbaPort = 0; hbaPort < hbaAttrs.NumberOfPorts; hbaPort++) { if ((status = HBA_GetAdapterPortAttributes(handle, hbaPort, &hbaPortAttrs)) != HBA_STATUS_OK) { fprintf(stderr, "Unable to get adapter port %d " "attributes for HBA %d with name \"%s\".\n", hbaPort, hbaCount, adaptername); HBA_CloseAdapter(handle); continue; } memcpy(&wwn, hbaPortAttrs.PortWWN.wwn, sizeof (wwn)); printf(" Port %d: WWN=%016llx\n", hbaPort, wwn); /* ... */ }
Example 2 Retrieve the discovered port target attributes for each discovered target port on the HBA.
The following example retrieves the discovered port target attributes for each discovered target port on the HBA.
for (discPort = 0; discPort < hbaPortAttrs.NumberofDiscoveredPorts; discPort++) { if ((status = HBA_GetDiscoveredPortAttributes( handle, hbaPort, discPort, &discPortAttrs)) != HBA_STATUS_OK) { fprintf(stderr, "Unable to get " "discovered port %d attributes for " "HBA %d with name \"%s\".\n", discPort, hbaCount, adaptername); continue; } memcpy(&wwn, discPortAttrs.PortWWN.wwn, sizeof (wwn)); printf(" Discovered Port %d: WWN=%016llx\n", discPort, wwn); /* ... */ }
See attributes(5) for descriptions of the following attributes:
|
HBA_GetAdapterPortAttributes(3HBAAPI), HBA_OpenAdapter(3HBAAPI), libhbaapi(3LIB), attributes(5)
T11 FC-MI Specification
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |