VirtualBox

Changeset 64150 in vbox for trunk/src


Ignore:
Timestamp:
Oct 5, 2016 9:26:33 AM (8 years ago)
Author:
vboxsync
Message:

DrvSCSI: Forward a few selected methods from the exposed media interface down to the underlying driver, required for the BIOS code to determine the geometry

File:
1 edited

Legend:

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

    r64136 r64150  
    695695/* -=-=-=-=- IMedia -=-=-=-=- */
    696696
     697/** @interface_method_impl{PDMIMEDIA,pfnGetSize} */
     698static DECLCALLBACK(uint64_t) drvscsiGetSize(PPDMIMEDIA pInterface)
     699{
     700    PDRVSCSI pThis = RT_FROM_MEMBER(pInterface, DRVSCSI, IMedia);
     701    return pThis->pDrvMedia->pfnGetSize(pThis->pDrvMedia);
     702}
     703
     704/** @interface_method_impl{PDMIMEDIA,pfnGetSectorSize} */
     705static DECLCALLBACK(uint32_t) drvscsiGetSectorSize(PPDMIMEDIA pInterface)
     706{
     707    PDRVSCSI pThis = RT_FROM_MEMBER(pInterface, DRVSCSI, IMedia);
     708    return pThis->pDrvMedia->pfnGetSectorSize(pThis->pDrvMedia);
     709}
     710
     711/** @interface_method_impl{PDMIMEDIA,pfnIsReadOnly} */
     712static DECLCALLBACK(bool) drvscsiIsReadOnly(PPDMIMEDIA pInterface)
     713{
     714    PDRVSCSI pThis = RT_FROM_MEMBER(pInterface, DRVSCSI, IMedia);
     715    return pThis->pDrvMedia->pfnIsReadOnly(pThis->pDrvMedia);
     716}
     717
     718/** @interface_method_impl{PDMIMEDIA,pfnIsNonRotational} */
     719static DECLCALLBACK(bool) drvscsiIsNonRotational(PPDMIMEDIA pInterface)
     720{
     721    PDRVSCSI pThis = RT_FROM_MEMBER(pInterface, DRVSCSI, IMedia);
     722    return pThis->pDrvMedia->pfnIsNonRotational(pThis->pDrvMedia);
     723}
     724
     725/** @interface_method_impl{PDMIMEDIA,pfnBiosGetPCHSGeometry} */
     726static DECLCALLBACK(int) drvscsiBiosGetPCHSGeometry(PPDMIMEDIA pInterface,
     727                                                  PPDMMEDIAGEOMETRY pPCHSGeometry)
     728{
     729    PDRVSCSI pThis = RT_FROM_MEMBER(pInterface, DRVSCSI, IMedia);
     730    return pThis->pDrvMedia->pfnBiosGetPCHSGeometry(pThis->pDrvMedia, pPCHSGeometry);
     731}
     732
     733/** @interface_method_impl{PDMIMEDIA,pfnBiosSetPCHSGeometry} */
     734static DECLCALLBACK(int) drvscsiBiosSetPCHSGeometry(PPDMIMEDIA pInterface,
     735                                                  PCPDMMEDIAGEOMETRY pPCHSGeometry)
     736{
     737    PDRVSCSI pThis = RT_FROM_MEMBER(pInterface, DRVSCSI, IMedia);
     738    return pThis->pDrvMedia->pfnBiosSetPCHSGeometry(pThis->pDrvMedia, pPCHSGeometry);
     739}
     740
     741/** @interface_method_impl{PDMIMEDIA,pfnBiosGetLCHSGeometry} */
     742static DECLCALLBACK(int) drvscsiBiosGetLCHSGeometry(PPDMIMEDIA pInterface,
     743                                                  PPDMMEDIAGEOMETRY pLCHSGeometry)
     744{
     745    PDRVSCSI pThis = RT_FROM_MEMBER(pInterface, DRVSCSI, IMedia);
     746    return pThis->pDrvMedia->pfnBiosGetLCHSGeometry(pThis->pDrvMedia, pLCHSGeometry);
     747}
     748
     749/** @interface_method_impl{PDMIMEDIA,pfnBiosSetLCHSGeometry} */
     750static DECLCALLBACK(int) drvscsiBiosSetLCHSGeometry(PPDMIMEDIA pInterface,
     751                                                  PCPDMMEDIAGEOMETRY pLCHSGeometry)
     752{
     753    PDRVSCSI pThis = RT_FROM_MEMBER(pInterface, DRVSCSI, IMedia);
     754    return pThis->pDrvMedia->pfnBiosSetLCHSGeometry(pThis->pDrvMedia, pLCHSGeometry);
     755}
     756
     757/** @interface_method_impl{PDMIMEDIA,pfnBiosIsVisible} */
     758static DECLCALLBACK(bool) drvscsiBiosIsVisible(PPDMIMEDIA pInterface)
     759{
     760    PDRVSCSI pThis = RT_FROM_MEMBER(pInterface, DRVSCSI, IMedia);
     761    return pThis->pDrvMedia->pfnBiosIsVisible(pThis->pDrvMedia);
     762}
     763
    697764/** @interface_method_impl{PDMIMEDIA,pfnGetType} */
    698765static DECLCALLBACK(PDMMEDIATYPE) drvscsiGetType(PPDMIMEDIA pInterface)
     
    12811348    pThis->IMedia.pfnMerge                      = NULL;
    12821349    pThis->IMedia.pfnSetSecKeyIf                = NULL;
    1283     pThis->IMedia.pfnGetSize                    = NULL;
    1284     pThis->IMedia.pfnGetSectorSize              = NULL;
    1285     pThis->IMedia.pfnIsReadOnly                 = NULL;
    1286     pThis->IMedia.pfnBiosGetPCHSGeometry        = NULL;
    1287     pThis->IMedia.pfnBiosSetPCHSGeometry        = NULL;
    1288     pThis->IMedia.pfnBiosGetLCHSGeometry        = NULL;
    1289     pThis->IMedia.pfnBiosSetLCHSGeometry        = NULL;
    1290     pThis->IMedia.pfnBiosIsVisible              = NULL;
     1350    pThis->IMedia.pfnGetSize                    = drvscsiGetSize;
     1351    pThis->IMedia.pfnGetSectorSize              = drvscsiGetSectorSize;
     1352    pThis->IMedia.pfnIsReadOnly                 = drvscsiIsReadOnly;
     1353    pThis->IMedia.pfnIsNonRotational            = drvscsiIsNonRotational;
     1354    pThis->IMedia.pfnBiosGetPCHSGeometry        = drvscsiBiosGetPCHSGeometry;
     1355    pThis->IMedia.pfnBiosSetPCHSGeometry        = drvscsiBiosSetPCHSGeometry;
     1356    pThis->IMedia.pfnBiosGetLCHSGeometry        = drvscsiBiosGetLCHSGeometry;
     1357    pThis->IMedia.pfnBiosSetLCHSGeometry        = drvscsiBiosSetLCHSGeometry;
     1358    pThis->IMedia.pfnBiosIsVisible              = drvscsiBiosIsVisible;
    12911359    pThis->IMedia.pfnGetType                    = drvscsiGetType;
    12921360    pThis->IMedia.pfnGetUuid                    = drvscsiGetUuid;
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