VirtualBox

Changeset 92550 in vbox for trunk/src/VBox/Devices/Storage


Ignore:
Timestamp:
Nov 22, 2021 1:49:30 PM (3 years ago)
Author:
vboxsync
Message:

DevATA: Reduced the size of MODE_SENSE_CD_STATUS response to match ATAPI 2.6; works around a bug in some old guest drivers (see bugref:5869).

File:
1 edited

Legend:

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

    r92548 r92550  
    31443144    RT_NOREF(pDevIns);
    31453145
     3146    /* 28 bytes of total returned data corresponds to ATAPI 2.6. Note that at least some versions
     3147     * of NEC_IDE.SYS DOS driver (possibly other Oak Technology OTI-011 drivers) do not correctly
     3148     * handle cases where more than 28 bytes are returned due to bugs. See @bugref{5869}.
     3149     */
    31463150    Assert(s->uTxDir == PDMMEDIATXDIR_FROM_DEVICE);
    3147     Assert(s->cbElementaryTransfer <= 40);
    3148     scsiH2BE_U16(&pbBuf[0], 38);
     3151    Assert(s->cbElementaryTransfer <= 28);
     3152    scsiH2BE_U16(&pbBuf[0], 26);
    31493153    pbBuf[2] = (uint8_t)s->MediaTrackType;
    31503154    pbBuf[3] = 0;
     
    31553159
    31563160    pbBuf[8] = 0x2a;
    3157     pbBuf[9] = 30; /* page length */
     3161    pbBuf[9] = 18; /* page length */
    31583162    pbBuf[10] = 0x08; /* DVD-ROM read support */
    31593163    pbBuf[11] = 0x00; /* no write support */
     
    31733177    pbBuf[24] = 0; /* reserved */
    31743178    pbBuf[25] = 0; /* reserved for digital audio (see idx 15) */
    3175     scsiH2BE_U16(&pbBuf[26], 0); /* (obsolete) maximum write speed */
    3176     scsiH2BE_U16(&pbBuf[28], 0); /* (obsolete) current write speed */
    3177     scsiH2BE_U16(&pbBuf[30], 0); /* copy management revision supported 0=no CSS */
    3178     pbBuf[32] = 0; /* reserved */
    3179     pbBuf[33] = 0; /* reserved */
    3180     pbBuf[34] = 0; /* reserved */
    3181     pbBuf[35] = 1; /* rotation control CAV */
    3182     scsiH2BE_U16(&pbBuf[36], 0); /* current write speed */
    3183     scsiH2BE_U16(&pbBuf[38], 0); /* number of write speed performance descriptors */
     3179    pbBuf[26] = 0; /* reserved */
     3180    pbBuf[27] = 0; /* reserved */
    31843181    s->iSourceSink = ATAFN_SS_NULL;
    31853182    atapiR3CmdOK(pCtl, s);
     
    32423239
    32433240    /* Track fields are 8-bit and 1-based, so cut the track count at 255,
    3244        avoiding any potentially buffer overflow issues below. */
     3241       avoiding any potential buffer overflow issues below. */
    32453242    uint32_t cTracks = pDevR3->pDrvMedia->pfnGetRegionCount(pDevR3->pDrvMedia);
    32463243    AssertStmt(cTracks <= UINT8_MAX, cTracks = UINT8_MAX);
     
    35083505                            break;
    35093506                        case SCSI_MODEPAGE_CD_STATUS:
    3510                             ataR3StartTransfer(pDevIns, pCtl, s, RT_MIN(cbMax, 40), PDMMEDIATXDIR_FROM_DEVICE, ATAFN_BT_ATAPI_CMD, ATAFN_SS_ATAPI_MODE_SENSE_CD_STATUS, true);
     3507                            ataR3StartTransfer(pDevIns, pCtl, s, RT_MIN(cbMax, 28), PDMMEDIATXDIR_FROM_DEVICE, ATAFN_BT_ATAPI_CMD, ATAFN_SS_ATAPI_MODE_SENSE_CD_STATUS, true);
    35113508                            break;
    35123509                        default:
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