VirtualBox

Changeset 65061 in vbox for trunk/src


Ignore:
Timestamp:
Jan 3, 2017 10:55:26 AM (8 years ago)
Author:
vboxsync
Message:

pdmstorageifs.h: Pass the CDB length in PDMIMEDIA::pfnSendCmd to not being bound to guessing it in the host DVD access driver

Location:
trunk/src/VBox/Devices/Storage
Files:
2 edited

Legend:

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

    r65060 r65061  
    20512051                    break;
    20522052            }
    2053             rc = s->pDrvMedia->pfnSendCmd(s->pDrvMedia, aATAPICmd, (PDMMEDIATXDIR)s->uTxDir, pbBuf, &cbCurrTX, abATAPISense, sizeof(abATAPISense), 30000 /**< @todo timeout */);
     2053            rc = s->pDrvMedia->pfnSendCmd(s->pDrvMedia, aATAPICmd, ATAPI_PACKET_SIZE, (PDMMEDIATXDIR)s->uTxDir,
     2054                                          pbBuf, &cbCurrTX, abATAPISense, sizeof(abATAPISense), 30000 /**< @todo timeout */);
    20542055            if (rc != VINF_SUCCESS)
    20552056                break;
     
    20922093    }
    20932094    else
    2094         rc = s->pDrvMedia->pfnSendCmd(s->pDrvMedia, s->aATAPICmd, (PDMMEDIATXDIR)s->uTxDir, s->CTX_SUFF(pbIOBuffer), &cbTransfer, abATAPISense, sizeof(abATAPISense), 30000 /**< @todo timeout */);
     2095        rc = s->pDrvMedia->pfnSendCmd(s->pDrvMedia, s->aATAPICmd, ATAPI_PACKET_SIZE, (PDMMEDIATXDIR)s->uTxDir,
     2096                                      s->CTX_SUFF(pbIOBuffer), &cbTransfer, abATAPISense, sizeof(abATAPISense), 30000 /**< @todo timeout */);
    20952097    if (pProf) { STAM_PROFILE_ADV_STOP(pProf, b); }
    20962098
  • trunk/src/VBox/Devices/Storage/DrvHostDVD.cpp

    r64413 r65061  
    500500
    501501/** @interface_method_impl{PDMIMEDIA,pfnSendCmd} */
    502 static DECLCALLBACK(int) drvHostDvdSendCmd(PPDMIMEDIA pInterface, const uint8_t *pbCmd,
     502static DECLCALLBACK(int) drvHostDvdSendCmd(PPDMIMEDIA pInterface, const uint8_t *pbCdb, size_t cbCdb,
    503503                                           PDMMEDIATXDIR enmTxDir, void *pvBuf, uint32_t *pcbBuf,
    504504                                           uint8_t *pabSense, size_t cbSense, uint32_t cTimeoutMillies)
     
    506506    PDRVHOSTBASE pThis = RT_FROM_MEMBER(pInterface, DRVHOSTBASE, IMedia);
    507507    int rc;
    508     LogFlow(("%s: cmd[0]=%#04x txdir=%d pcbBuf=%d timeout=%d\n", __FUNCTION__, pbCmd[0], enmTxDir, *pcbBuf, cTimeoutMillies));
     508    LogFlow(("%s: cmd[0]=%#04x txdir=%d pcbBuf=%d timeout=%d\n", __FUNCTION__, pbCdb[0], enmTxDir, *pcbBuf, cTimeoutMillies));
    509509
    510510    RTCritSectEnter(&pThis->CritSect);
    511     /*
    512      * Pass the request on to the internal scsi command interface.
    513      * The command seems to be 12 bytes long, the docs a bit copy&pasty on the command length point...
    514      */
     511    /* Pass the request on to the internal scsi command interface. */
    515512    if (enmTxDir == PDMMEDIATXDIR_FROM_DEVICE)
    516513        memset(pvBuf, '\0', *pcbBuf); /* we got read size, but zero it anyway. */
    517     rc = drvHostBaseScsiCmdOs(pThis, pbCmd, 12, enmTxDir, pvBuf, pcbBuf, pabSense, cbSense, cTimeoutMillies);
     514    rc = drvHostBaseScsiCmdOs(pThis, pbCdb, cbCdb, enmTxDir, pvBuf, pcbBuf, pabSense, cbSense, cTimeoutMillies);
    518515    if (rc == VERR_UNRESOLVED_ERROR)
    519516        /* sense information set */
    520517        rc = VERR_DEV_IO_ERROR;
    521518
    522     if (pbCmd[0] == SCSI_GET_EVENT_STATUS_NOTIFICATION)
     519    if (pbCdb[0] == SCSI_GET_EVENT_STATUS_NOTIFICATION)
    523520    {
    524521        uint8_t *pbBuf = (uint8_t*)pvBuf;
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