/** @copydoc PDMISCSICONNECTOR::pfnSCSIRequestSend. */ static DECLCALLBACK(int) drvscsiRequestSend(PPDMISCSICONNECTOR pInterface, PPDMSCSIREQUEST pSCSIRequest) { int rc; PDRVSCSI pThis = PDMISCSICONNECTOR_2_DRVSCSI(pInterface); VSCSIREQ hVScsiReq; #ifdef DEBUG drvscsiDumpScsiRequest(pSCSIRequest); #endif rc = VSCSIDeviceReqCreate(pThis->hVScsiDevice, &hVScsiReq, pSCSIRequest->uLogicalUnit, pSCSIRequest->pbCDB, pSCSIRequest->cbCDB, pSCSIRequest->cbScatterGather, pSCSIRequest->cScatterGatherEntries, pSCSIRequest->paScatterGatherHead, pSCSIRequest->pbSenseBuffer, pSCSIRequest->cbSenseBuffer, pSCSIRequest); if (RT_FAILURE(rc)) return rc; ASMAtomicIncU32(&pThis->StatIoDepth); rc = VSCSIDeviceReqEnqueue(pThis->hVScsiDevice, hVScsiReq); return rc; }
/** @interface_method_impl{PDMISCSICONNECTOR,pfnQueryLUNType} */ static DECLCALLBACK(int) drvscsiQueryLUNType(PPDMISCSICONNECTOR pInterface, uint32_t iLun, PPDMSCSILUNTYPE pLunType) { int rc; PDRVSCSI pThis = PDMISCSICONNECTOR_2_DRVSCSI(pInterface); VSCSILUNTYPE enmLunType; rc = VSCSIDeviceLunQueryType(pThis->hVScsiDevice, iLun, &enmLunType); if (RT_FAILURE(rc)) return rc; switch (enmLunType) { case VSCSILUNTYPE_SBC: *pLunType = PDMSCSILUNTYPE_SBC; break; case VSCSILUNTYPE_MMC: *pLunType = PDMSCSILUNTYPE_MMC; break; case VSCSILUNTYPE_SSC: *pLunType = PDMSCSILUNTYPE_SSC; break; default: *pLunType = PDMSCSILUNTYPE_INVALID; } return rc; }