VirtualBox

Changeset 43662 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Oct 16, 2012 8:18:09 PM (12 years ago)
Author:
vboxsync
Message:

VSCSI: Fabricate session information (Vista and later insists on it).

File:
1 edited

Legend:

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

    r43640 r43662  
    6060
    6161
    62 /* Fabricate TOC information. */
     62/* Fabricate normal TOC information. */
    6363static int mmcReadTOCNormal(PVSCSILUNINT pVScsiLun, PVSCSIREQINT pVScsiReq, uint16_t cbMaxTransfer, bool fMSF)
    6464{
     
    120120
    121121    RTSgBufCopyFromBuf(&pVScsiReq->SgBuf, aReply, cbMaxTransfer);
     122
     123    return vscsiLunReqSenseOkSet(pVScsiLun, pVScsiReq);
     124}
     125
     126/* Fabricate session information. */
     127static int mmcReadTOCMulti(PVSCSILUNINT pVScsiLun, PVSCSIREQINT pVScsiReq, uint16_t cbMaxTransfer, bool fMSF)
     128{
     129    PVSCSILUNMMC    pVScsiLunMmc = (PVSCSILUNMMC)pVScsiLun;
     130    uint8_t         aReply[32];
     131    uint8_t         *pbBuf = aReply;
     132
     133    /* multi session: only a single session defined */
     134    memset(pbBuf, 0, 12);
     135    pbBuf[1] = 0x0a;
     136    pbBuf[2] = 0x01;    /* first complete session number */
     137    pbBuf[3] = 0x01;    /* last complete session number */
     138    pbBuf[5] = 0x14;    /* ADR, CONTROL */
     139    pbBuf[6] = 1;       /* first track in last complete session */
     140
     141    if (fMSF)
     142    {
     143        pbBuf[8] = 0;   /* reserved */
     144        mmcLBA2MSF(pbBuf + 8, 0);
     145    }
     146    else
     147    {
     148        /* sector 0 */
     149        vscsiH2BEU32(pbBuf + 8, 0);
     150    }
     151
     152    RTSgBufCopyFromBuf(&pVScsiReq->SgBuf, aReply, 12);
    122153
    123154    return vscsiLunReqSenseOkSet(pVScsiLun, pVScsiReq);
     
    394425                case 0x00:
    395426                    mmcReadTOCNormal(pVScsiLun, pVScsiReq, cbMax, fMSF);
     427                    break;
     428                case 0x01:
     429                    mmcReadTOCMulti(pVScsiLun, pVScsiReq, cbMax, fMSF);
    396430                    break;
    397431                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