Changeset 23356 in vbox for trunk/src/VBox
- Timestamp:
- Sep 28, 2009 7:46:48 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DrvSCSI.cpp
r22850 r23356 261 261 } 262 262 263 DECLINLINE(void) drvscsiH2BE_U64(uint8_t *pbBuf, uint64_t val) 264 { 265 pbBuf[0] = val >> 56; 266 pbBuf[1] = val >> 48; 267 pbBuf[2] = val >> 40; 268 pbBuf[3] = val >> 32; 269 pbBuf[4] = val >> 24; 270 pbBuf[5] = val >> 16; 271 pbBuf[6] = val >> 8; 272 pbBuf[7] = val; 273 } 263 274 264 275 DECLINLINE(uint16_t) drvscsiBE2H_U16(const uint8_t *pbBuf) … … 447 458 iTxDir = PDMBLOCKTXDIR_FROM_DEVICE; 448 459 *puOffset = drvscsiBE2H_U64(&pRequest->pbCDB[2]) * 512; 449 *pcbToTransfer = ((uint32_t)drvscsiBE2H_U32(&pRequest->pbCDB[ 6])) * 512;460 *pcbToTransfer = ((uint32_t)drvscsiBE2H_U32(&pRequest->pbCDB[10])) * 512; 450 461 break; 451 462 } … … 477 488 iTxDir = PDMBLOCKTXDIR_TO_DEVICE; 478 489 *puOffset = drvscsiBE2H_U64(&pRequest->pbCDB[2]) * 512; 479 *pcbToTransfer = ((uint32_t)drvscsiBE2H_U32(&pRequest->pbCDB[ 6])) * 512;490 *pcbToTransfer = ((uint32_t)drvscsiBE2H_U32(&pRequest->pbCDB[10])) * 512; 480 491 break; 481 492 } … … 548 559 default: 549 560 rc = drvscsiCmdError(pRequest, SCSI_SENSE_ILLEGAL_REQUEST, SCSI_ASC_INV_FIELD_IN_CMD_PACKET); 561 } 562 break; 563 } 564 case SCSI_SERVICE_ACTION_IN_16: 565 { 566 switch (pRequest->pbCDB[1] & 0x1f) 567 { 568 case SCSI_SVC_ACTION_IN_READ_CAPACITY_16: 569 { 570 uint8_t aReply[32]; 571 572 memset(aReply, 0, sizeof(aReply)); 573 drvscsiH2BE_U64(aReply, pThis->cSectors - 1); 574 drvscsiH2BE_U32(&aReply[8], 512); 575 /* Leave the rest 0 */ 576 577 drvscsiScatterGatherListCopyFromBuffer(pRequest, aReply, sizeof(aReply)); 578 rc = drvscsiCmdOk(pRequest); 579 break; 580 } 581 default: 582 rc = drvscsiCmdError(pRequest, SCSI_SENSE_ILLEGAL_REQUEST, SCSI_ASC_INV_FIELD_IN_CMD_PACKET); /* Don't know if this is correct */ 550 583 } 551 584 break; … … 626 659 } 627 660 AssertMsg(!cbToTransfer && !cSegmentsLeft, 628 ("Transfer incomplete cbToTransfer=%u cSegmentsLeft=%u ", cbToTransfer, cSegmentsLeft));661 ("Transfer incomplete cbToTransfer=%u cSegmentsLeft=%u\n", cbToTransfer, cSegmentsLeft)); 629 662 drvscsiCmdOk(pRequest); 630 663 }
Note:
See TracChangeset
for help on using the changeset viewer.