VirtualBox

Changeset 53409 in vbox for trunk/src


Ignore:
Timestamp:
Nov 28, 2014 1:33:46 PM (10 years ago)
Author:
vboxsync
Message:

Storage/ATA: Fix broken CD/DVD passthrough

File:
1 edited

Legend:

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

    r51381 r53409  
    183183    /** Maximum ATAPI elementary transfer size, PIO only. */
    184184    uint32_t cbPIOTransferLimit;
     185    /** ATAPI passthrough transfer size, shared PIO/DMA */
     186    uint32_t cbAtapiPassthroughTransfer;
    185187    /** Current read/write buffer position, shared PIO/DMA. */
    186188    uint32_t iIOBufferCur;
    187189    /** First element beyond end of valid buffer content, shared PIO/DMA. */
    188190    uint32_t iIOBufferEnd;
     191    /** Align the following fields correctly. */
     192    uint32_t Alignment0;
    189193
    190194    /** ATA/ATAPI current PIO read/write transfer position. Not shared with DMA for safety reasons. */
     
    17371741    s->cbTotalTransfer = 0;
    17381742    s->cbElementaryTransfer = 0;
     1743    s->cbAtapiPassthroughTransfer = 0;
    17391744    s->iIOBufferCur = 0;
    17401745    s->iIOBufferEnd = 0;
     
    17631768    s->fATAPITransfer = true;
    17641769    s->cbElementaryTransfer = s->cbTotalTransfer;
     1770    s->cbAtapiPassthroughTransfer = s->cbTotalTransfer;
    17651771    s->cbPIOTransferLimit = s->uATARegLCyl | (s->uATARegHCyl << 8);
    17661772    if (s->uTxDir == PDMBLOCKTXDIR_TO_DEVICE)
     
    19531959    PSTAMPROFILEADV pProf = NULL;
    19541960
    1955     cbTransfer = RT_MIN(s->cbTotalTransfer, s->cbIOBuffer);
     1961    cbTransfer = RT_MIN(s->cbAtapiPassthroughTransfer, s->cbIOBuffer);
    19561962
    19571963    if (s->uTxDir == PDMBLOCKTXDIR_TO_DEVICE)
     
    21792185        if (s->uTxDir == PDMBLOCKTXDIR_FROM_DEVICE)
    21802186        {
    2181             Assert(cbTransfer <= s->cbTotalTransfer);
     2187            Assert(cbTransfer <= s->cbAtapiPassthroughTransfer);
    21822188            /*
    21832189             * Reply with the same amount of data as the real drive
     
    22092215         * done in one transfer, so set the actual value of the buffer end. */
    22102216        s->cbElementaryTransfer = cbTransfer;
    2211         if (cbTransfer >= s->cbTotalTransfer)
     2217        if (cbTransfer >= s->cbAtapiPassthroughTransfer)
    22122218        {
    22132219            s->iSourceSink = ATAFN_SS_NULL;
     
    37513757    s->cbTotalTransfer = 0;
    37523758    s->cbElementaryTransfer = 0;
     3759    s->cbAtapiPassthroughTransfer = 0;
    37533760    atapiParseCmd(s);
    37543761    return false;
     
    38433850{
    38443851    s->cbElementaryTransfer = s->cbTotalTransfer;
     3852    s->cbAtapiPassthroughTransfer = s->cbTotalTransfer;
    38453853    s->uATARegNSector = (s->uATARegNSector & ~7) | ATAPI_INT_REASON_CD;
    38463854    Log2(("%s: interrupt reason %#04x\n", __FUNCTION__, s->uATARegNSector));
     
    38623870    s->cbTotalTransfer = 0;
    38633871    s->cbElementaryTransfer = 0;
     3872    s->cbAtapiPassthroughTransfer = 0;
    38643873    s->iIOBufferPIODataStart = 0;
    38653874    s->iIOBufferPIODataEnd = 0;
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