VirtualBox

Changeset 778 in vbox


Ignore:
Timestamp:
Feb 8, 2007 12:14:10 PM (18 years ago)
Author:
vboxsync
Message:

Fixed capability reporting so that it works with libhal.

File:
1 edited

Legend:

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

    r492 r778  
    19241924    Assert(s->uTxDir == PDMBLOCKTXDIR_FROM_DEVICE);
    19251925    Assert(s->cbElementaryTransfer <= 32);
    1926     /* Accept request type of 0 or 1 only, and only starting feature 0. */
    1927     if (((s->aATAPICmd[1] & 0x03) != 0 && (s->aATAPICmd[1] & 0x03) != 1) || ataBE2H_U16(&s->aATAPICmd[2]) != 0)
     1926    /* Accept valid request types only, and only starting feature 0. */
     1927    if ((s->aATAPICmd[1] & 0x03) == 3 || ataBE2H_U16(&s->aATAPICmd[2]) != 0)
    19281928    {
    19291929        atapiCmdError(s, SCSI_SENSE_ILLEGAL_REQUEST, SCSI_ASC_INV_FIELD_IN_CMD_PACKET);
     
    19311931    }
    19321932    memset(pbBuf, '\0', 32);
    1933     ataH2BE_U32(pbBuf, 12);
    1934     ataH2BE_U16(pbBuf + 6, 8); /* current profile: cd-rom read-only */
     1933    ataH2BE_U32(pbBuf, 16);
     1934    /** @todo implement switching between CD-ROM and DVD-ROM profile (the only
     1935     * way to differentiate them right now is based on the image size). Also
     1936     * implement signalling "no current profile" if no medium is loaded. */
     1937    ataH2BE_U16(pbBuf + 6, 0x08); /* current profile: read-only CD */
    19351938
    19361939    ataH2BE_U16(pbBuf + 8, 0); /* feature 0: list of profiles supported */
    19371940    pbBuf[10] = (0 << 2) | (1 << 1) | (1 || 0); /* version 0, persistent, current */
    1938     pbBuf[11] = 4; /* additional bytes for profiles */
    1939     ataH2BE_U16(pbBuf + 12, 8); /* profile: cd-rom read-only */
    1940     pbBuf[14] = (1 << 0); /* current profile */
     1941    pbBuf[11] = 8; /* additional bytes for profiles */
     1942    /* The MMC-3 spec says that DVD-ROM read capability should be reported
     1943     * before CD-ROM read capability. */
     1944    ataH2BE_U16(pbBuf + 12, 0x10); /* profile: read-only DVD */
     1945    pbBuf[14] = (0 << 0); /* NOT current profile */
     1946    ataH2BE_U16(pbBuf + 16, 0x08); /* profile: read only CD */
     1947    pbBuf[18] = (1 << 0); /* current profile */
     1948    /* Other profiles we might want to add in the future: 0x40 (BD-ROM) and 0x50 (HDDVD-ROM) */
    19411949    s->iSourceSink = ATAFN_SS_NULL;
    19421950    atapiCmdOK(s);
     
    25912599            break;
    25922600        case SCSI_GET_CONFIGURATION:
    2593             if (s->cNotifiedMediaChange > 0)
    2594             {
    2595                 s->cNotifiedMediaChange-- ;
    2596                 atapiCmdError(s, SCSI_SENSE_UNIT_ATTENTION, SCSI_ASC_MEDIUM_MAY_HAVE_CHANGED); /* media changed */
    2597                 break;
    2598             }
    2599             else if (!s->pDrvMount->pfnIsMounted(s->pDrvMount))
    2600             {
    2601                 atapiCmdError(s, SCSI_SENSE_NOT_READY, SCSI_ASC_MEDIUM_NOT_PRESENT);
    2602                 break;
    2603             }
     2601            /* No media change stuff here, it can confuse Linux guests. */
    26042602            cbMax = ataBE2H_U16(pbPacket + 7);
    26052603            ataStartTransfer(s, RT_MIN(cbMax, 32), PDMBLOCKTXDIR_FROM_DEVICE, ATAFN_BT_ATAPI_CMD, ATAFN_SS_ATAPI_GET_CONFIGURATION, true);
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