VirtualBox

Ignore:
Timestamp:
Jan 3, 2017 1:24:58 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
112580
Message:

Devices/Storage/DrvHost*: Avoid using SCSI_MAX_BUFFER_SIZE (will be removed in the future) but query the maximum supported buffer size through a dedicated method from the platform specific code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/DrvHostBase-freebsd.cpp

    r64316 r65078  
    2727#include <iprt/log.h>
    2828
     29/** Maximum buffer size supported by the CAM subsystem. */
     30#define FBSD_SCSI_MAX_BUFFER_SIZE (64 * _1K)
     31
    2932/**
    3033 * Host backend specific data.
     
    149152
    150153
     154DECLHIDDEN(size_t) drvHostBaseScsiCmdGetBufLimitOs(PDRVHOSTBASE pThis)
     155{
     156    RT_NOREF(pThis);
     157
     158    return FBSD_SCSI_MAX_BUFFER_SIZE;
     159}
     160
     161
    151162DECLHIDDEN(int) drvHostBaseGetMediaSizeOs(PDRVHOSTBASE pThis, uint64_t *pcb)
    152163{
     
    194205            const uint32_t  LBA       = off / pThis->Os.cbBlock;
    195206            AssertReturn(!(off % pThis->Os.cbBlock), VERR_INVALID_PARAMETER);
    196             uint32_t        cbRead32  =   cbRead > SCSI_MAX_BUFFER_SIZE
    197                                         ? SCSI_MAX_BUFFER_SIZE
     207            uint32_t        cbRead32  =   cbRead > FBSD_SCSI_MAX_BUFFER_SIZE
     208                                        ? FBSD_SCSI_MAX_BUFFER_SIZE
    198209                                        : (uint32_t)cbRead;
    199210            const uint32_t  cBlocks   = cbRead32 / pThis->Os.cbBlock;
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette