Changeset 104580 in vbox
- Timestamp:
- May 13, 2024 8:48:29 AM (7 months ago)
- Location:
- trunk/src/VBox/Devices/Storage/VSCSI
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/VSCSI/VSCSIDevice.cpp
r104221 r104580 83 83 if (!vscsiDeviceLunIsPresent(pVScsiDevice, pVScsiReq->iLun)) 84 84 { 85 size_t cbData;86 85 SCSIINQUIRYDATA ScsiInquiryReply; 87 86 87 uint16_t cbDataReq = scsiBE2H_U16(&pVScsiReq->pbCDB[3]); 88 88 vscsiReqSetXferDir(pVScsiReq, VSCSIXFERDIR_T2I); 89 vscsiReqSetXferSize(pVScsiReq, RT_MIN(sizeof(SCSIINQUIRYDATA), scsiBE2H_U16(&pVScsiReq->pbCDB[3])));89 vscsiReqSetXferSize(pVScsiReq, RT_MIN(sizeof(SCSIINQUIRYDATA), cbDataReq)); 90 90 memset(&ScsiInquiryReply, 0, sizeof(ScsiInquiryReply)); 91 91 ScsiInquiryReply.cbAdditional = 31; 92 92 ScsiInquiryReply.u5PeripheralDeviceType = SCSI_INQUIRY_DATA_PERIPHERAL_DEVICE_TYPE_UNKNOWN; 93 93 ScsiInquiryReply.u3PeripheralQualifier = SCSI_INQUIRY_DATA_PERIPHERAL_QUALIFIER_NOT_CONNECTED_NOT_SUPPORTED; 94 cbData =RTSgBufCopyFromBuf(&pVScsiReq->SgBuf, (uint8_t *)&ScsiInquiryReply, sizeof(SCSIINQUIRYDATA));94 RTSgBufCopyFromBuf(&pVScsiReq->SgBuf, (uint8_t *)&ScsiInquiryReply, sizeof(SCSIINQUIRYDATA)); 95 95 *prcReq = vscsiReqSenseOkSet(&pVScsiDevice->VScsiSense, pVScsiReq); 96 96 } -
trunk/src/VBox/Devices/Storage/VSCSI/VSCSILunMmc.cpp
r104222 r104580 1104 1104 SCSIINQUIRYDATA ScsiInquiryReply; 1105 1105 1106 uint16_t cbDataReq = scsiBE2H_U16(&pVScsiReq->pbCDB[3]); 1106 1107 vscsiReqSetXferDir(pVScsiReq, VSCSIXFERDIR_T2I); 1107 vscsiReqSetXferSize(pVScsiReq, RT_MIN(sizeof(SCSIINQUIRYDATA), scsiBE2H_U16(&pVScsiReq->pbCDB[3])));1108 vscsiReqSetXferSize(pVScsiReq, RT_MIN(sizeof(SCSIINQUIRYDATA), cbDataReq)); 1108 1109 memset(&ScsiInquiryReply, 0, sizeof(ScsiInquiryReply)); 1109 1110 -
trunk/src/VBox/Devices/Storage/VSCSI/VSCSILunSbc.cpp
r104222 r104580 235 235 SCSIINQUIRYDATA ScsiInquiryReply; 236 236 237 vscsiReqSetXferSize(pVScsiReq, RT_MIN(sizeof(SCSIINQUIRYDATA), scsiBE2H_U16(&pVScsiReq->pbCDB[3]))); 237 uint16_t cbDataReq = scsiBE2H_U16(&pVScsiReq->pbCDB[3]); 238 vscsiReqSetXferSize(pVScsiReq, RT_MIN(sizeof(SCSIINQUIRYDATA), cbDataReq)); 238 239 memset(&ScsiInquiryReply, 0, sizeof(ScsiInquiryReply)); 239 240 … … 558 559 559 560 paRanges[i].offStart = scsiBE2H_U64(&abBlkDesc[0]) * 512; 560 paRanges[i].cbRange = scsiBE2H_U32(&abBlkDesc[8]) * 512;561 paRanges[i].cbRange = (size_t)scsiBE2H_U32(&abBlkDesc[8]) * 512; 561 562 } 562 563 … … 613 614 || enmTxDir == VSCSIIOREQTXDIR_FLUSH) 614 615 && (pVScsiLun->fFeatures & VSCSI_LUN_FEATURE_READONLY)) 616 { 615 617 rcReq = vscsiLunReqSenseErrorSet(pVScsiLun, pVScsiReq, SCSI_SENSE_DATA_PROTECT, SCSI_ASC_WRITE_PROTECTED, 0x00); 618 vscsiDeviceReqComplete(pVScsiLun->pVScsiDevice, pVScsiReq, rcReq, false, VINF_SUCCESS); 619 } 616 620 else 617 621 {
Note:
See TracChangeset
for help on using the changeset viewer.