VirtualBox

Changeset 32104 in vbox


Ignore:
Timestamp:
Aug 30, 2010 3:07:36 PM (14 years ago)
Author:
vboxsync
Message:

ATA/Passthrough: Determine the correct sector size for the READ CD MSF command too

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/DevATA.cpp

    r32088 r32104  
    32063206            cSectors = ataBE2H_U16(pbPacket + 7);
    32073207            Log2(("ATAPI PT: lba %d sectors %d\n", iATAPILBA, cSectors));
    3208             s->cbATAPISector = 2048; /**< @todo this size is not always correct */
     3208            s->cbATAPISector = 2048;
    32093209            cbTransfer = cSectors * s->cbATAPISector;
    32103210            uTxDir = PDMBLOCKTXDIR_FROM_DEVICE;
     
    32143214            cSectors = ataBE2H_U32(pbPacket + 6);
    32153215            Log2(("ATAPI PT: lba %d sectors %d\n", iATAPILBA, cSectors));
    3216             s->cbATAPISector = 2048; /**< @todo this size is not always correct */
     3216            s->cbATAPISector = 2048;
    32173217            cbTransfer = cSectors * s->cbATAPISector;
    32183218            uTxDir = PDMBLOCKTXDIR_FROM_DEVICE;
     
    32313231            goto sendcmd;
    32323232        case SCSI_READ_CD:
     3233        case SCSI_READ_CD_MSF:
    32333234        {
    32343235            /* Get sector size based on the expected sector type field. */
     
    32613262            }
    32623263
    3263             cbTransfer = ataBE2H_U24(pbPacket + 6) * s->cbATAPISector;
     3264            if (pbPacket[0] == SCSI_READ_CD)
     3265                cbTransfer = ataBE2H_U24(pbPacket + 6) * s->cbATAPISector;
     3266            else /* SCSI_READ_MSF */
     3267            {
     3268                cSectors = ataMSF2LBA(pbPacket + 6) - ataMSF2LBA(pbPacket + 3);
     3269                if (cSectors > 32)
     3270                    cSectors = 32; /* Limit transfer size to 64~74K. Safety first. In any case this can only harm software doing CDDA extraction. */
     3271                cbTransfer = cSectors * s->cbATAPISector;
     3272            }
    32643273            uTxDir = PDMBLOCKTXDIR_FROM_DEVICE;
    32653274            goto sendcmd;
    32663275        }
    3267         case SCSI_READ_CD_MSF:
    3268             cSectors = ataMSF2LBA(pbPacket + 6) - ataMSF2LBA(pbPacket + 3);
    3269             if (cSectors > 32)
    3270                 cSectors = 32; /* Limit transfer size to 64~74K. Safety first. In any case this can only harm software doing CDDA extraction. */
    3271             s->cbATAPISector = 2048; /**< @todo this size is not always correct */
    3272             cbTransfer = cSectors * s->cbATAPISector;
    3273             uTxDir = PDMBLOCKTXDIR_FROM_DEVICE;
    3274             goto sendcmd;
    32753276        case SCSI_READ_DISC_INFORMATION:
    32763277            cbTransfer = ataBE2H_U16(pbPacket + 7);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette