HBA_SendScsiInquiry, HBA_ScsiInquiryV2, HBA_SendReportLUNs, HBA_ScsiReportLUNsV2, HBA_SendReadCapacity, HBA_ScsiReadCapacityV2 - gather SCSI information from discovered ports
cc [ flag... ] file... -lHBAAPI [ library... ] #include <hbaapi.h> 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);
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);
HBA_STATUS HBA_SendReportLUNs(HBA_HANDLE handle, HBA_WWN PortWWN, void *pRspBuffer, HBA_UINT32 RspBufferSize, void *pSenseBuffer, HBA_UINT32 SenseBufferSize);
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);
HBA_STATUS HBA_SendReadCapacity(HBA_HANDLE handle, HBA_WWN PortWWN, HBA_UINT64 fcLUN, void *pRspBuffer, HBA_UINT32 RspBufferSize, void *pSenseBuffer, HBA_UINT32 SenseBufferSize);
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);
handle
PortWWN
hbaPortWWN
HBA_ScsiInquiryV2()
HBA_ScsiReportLUNsV2()
HBA_ScsiReadCapacityV2()
discoveredPortWWN
HBA_ScsiInquiryV2()
HBA_ScsiReportLUNsV2()
HBA_ScsiReadCapacityV2()
fcLUN
EVPD
PageCode
CDB_Byte1
CDB_Byte2
pRspBuffer
RspBufferSize
pRspBufferSize
pScsiStatus
pSenseBuffer
SenseBufferSize
pSenseBufferSize
The HBA_SendScsiInquiry() and HBA_SendScsiInquiryV2() functions send a SCSI Inquiry command as defined in the T10 specification SPC-2 to a remote FCP port.
The HBA_SendReportLUNs() and HBA_SendReportLUNsV2() functions send a SCSI Report LUNs command as defined in the T10 specification SPC-2 to a remote FCP port.
The HBA_SendReadCapacity() and HBA_SendReadCapacityV2() functions end a SCSI Read Capacity command as defined in the T10 specification SBC-2 to a remote FCP port.
The HBA_SendScsiInquiry() function returns the following value:
HBA_STATUS_OK
The HBA_ScsiInquiryV2() function returns the following values:
HBA_STATUS_OK
HBA_STATUS_ERROR_ILLEGAL_WWN
HBA_STATUS_ERROR_NOT_A_TARGET
HBA_STATUS_ERROR_TARGET_BUSY
HBA_STATUS_ERROR
The HBA_SendReportLUNs() function returns the following values:
HBA_STATUS_OK
HBA_STATUS_SCSI_CHECK_CONDITION
Other error values indicate the content of pRspBuffer is undefined. In some cases, the pSenseBuffer can contain sense data.
The HBA_SendReportLUNsV2() function returns the following values:
HBA_STATUS_OK
HBA_STATUS_ERROR_ILLEGAL_WWN
HBA_STATUS_ERROR_NOT_A_TARGET
HBA_STATUS_ERROR_TARGET_BUSY
HBA_STATUS_ERROR
The HBA_SendReadCapacity() function returns the following values:
HBA_STATUS_OK
HBA_STATUS_SCSI_CHECK_CONDITION
Other error values indicate the content of pRspBuffer is undefined. In some cases, the pSenseBuffer can contain sense data.
The HBA_ScsiReadCapacityV2() function returns the following values:
HBA_STATUS_OK
HBA_STATUS_ERROR_ILLEGAL_WWN
HBA_STATUS_ERROR_NOT_A_TARGET
HBA_STATUS_ERROR_TARGET_BUSY
HBA_STATUS_ERROR
Other error values indicate the content of pRspBuffer is undefined. In some cases, the pSenseBuffer can contain sense data.
See libhbaapi(3LIB) for general error status values.
Example 1 Send a SCSI inquiry to the given discovered Target port WWN.
The following example sends a SCSI inquiry to the given discovered Target port WWN.
memset(&inq, 0, sizeof (inq)); memset(&sense, 0, sizeof (sense)); if ((status = HBA_SendScsiInquiry(handle, discPortAttrs.PortWWN, 0, 0, 0, &inq, sizeof (inq), &sense, sizeof (sense))) != HBA_STATUS_OK) { fprintf(stderr, "Unable to send SCSI " "inquiry, reason %d\n", status); continue; } printf(" Vendor: %.*s\n", 8, inq.inq_vid); printf(" Model: %.*s\n", 16, inq.inq_pid);
See attributes(5) for descriptions of the following attributes:
|
HBA_OpenAdapter(3HBAAPI), libhbaapi(3LIB), attributes(5)
The HBA_SendScsiInquiry(), HBA_SendReportLUNs(), and HBA_SendReadCapacity() functions do not take a portindex to define through which port of a multi-ported HBA the command should be sent. The behavior on multi-ported HBAs is vendor-specific and can result in the command being sent through the first HBA port, the first HBA port the given PortWWN is connected to, or other vendor-specific behavior. SNIA version 2 defines HBA_ScsiInquiryV2(), HBA_ScsiReportLUNs(), and HBA_ScsiReadCapacity() to take a Port WWN as an argument. This fixes the bug with multi-ported HBAs in HBA_ScsiInquiry(), HBA_SendReportLUNs(), and HBA_SendReadCapacity().
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |