VirtualBox

Changeset 44888 in vbox for trunk/src/VBox/Devices/Storage


Ignore:
Timestamp:
Mar 1, 2013 3:42:23 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
84056
Message:

BusLogic: Ignore mailbox commands if mailbox not set up.

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

Legend:

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

    r44719 r44888  
    376376    bool                            fISAEnabled;    /**< @todo unused, to be removed */
    377377    /** Flag whether 24-bit mailboxes are in use (default is 32-bit). */
    378     bool                            fMbxIs24Bit;    /**< @todo save? */
     378    bool                            fMbxIs24Bit;
    379379    /** ISA I/O port base (encoded in FW-compatible format). */
    380380    uint8_t                         uISABaseCode;
     
    21612161            if ((uVal == BUSLOGICCOMMAND_EXECUTE_MAILBOX_COMMAND) && (pBusLogic->uOperationCode == 0xff))
    21622162            {
    2163                 ASMAtomicIncU32(&pBusLogic->cMailboxesReady);
    2164                 if (!ASMAtomicXchgBool(&pBusLogic->fNotificationSend, true))
    2165                 {
    2166                     /* Send new notification to the queue. */
    2167                     PPDMQUEUEITEMCORE pItem = PDMQueueAlloc(pBusLogic->CTX_SUFF(pNotifierQueue));
    2168                     AssertMsg(pItem, ("Allocating item for queue failed\n"));
    2169                     PDMQueueInsert(pBusLogic->CTX_SUFF(pNotifierQueue), (PPDMQUEUEITEMCORE)pItem);
     2163                /* If there are no mailboxes configured, don't even try to do anything. */
     2164                if (pBusLogic->cMailbox) {
     2165                    ASMAtomicIncU32(&pBusLogic->cMailboxesReady);
     2166                    if (!ASMAtomicXchgBool(&pBusLogic->fNotificationSend, true))
     2167                    {
     2168                        /* Send new notification to the queue. */
     2169                        PPDMQUEUEITEMCORE pItem = PDMQueueAlloc(pBusLogic->CTX_SUFF(pNotifierQueue));
     2170                        AssertMsg(pItem, ("Allocating item for queue failed\n"));
     2171                        PDMQueueInsert(pBusLogic->CTX_SUFF(pNotifierQueue), (PPDMQUEUEITEMCORE)pItem);
     2172                    }
    21702173                }
    21712174
  • trunk/src/VBox/Devices/Storage/DrvSCSI.cpp

    r44528 r44888  
    258258}
    259259
     260static DECLCALLBACK(int) drvscsiEject(VSCSILUN hVScsiLun, void *pvScsiLunUser)
     261{
     262    PDRVSCSI    pThis = (PDRVSCSI)pvScsiLunUser;
     263    int         rc;
     264
     265#if 0
     266    /* This must be done from EMT. */
     267    PPDMDEVINS pDevIns = NULL; //ATADEVSTATE_2_DEVINS(s);
     268   
     269    rc = VMR3ReqPriorityCallWait(PDMDevHlpGetVM(pDevIns), VMCPUID_ANY,
     270                                 (PFNRT)pThis->pDrvMount->pfnUnmount, 3,
     271                                 pThis->pDrvMount, false /*=fForce*/, true /*=fEject*/);
     272    Assert(RT_SUCCESS(rc) || (rc == VERR_PDM_MEDIA_LOCKED) || (rc = VERR_PDM_MEDIA_NOT_MOUNTED));
     273    if (RT_SUCCESS(rc) && pThis->pMediaNotify)
     274    {
     275        rc = VMR3ReqCallNoWait(PDMDevHlpGetVM(pDevIns), VMCPUID_ANY,
     276                               (PFNRT)pThis->pMediaNotify->pfnEjected, 2,
     277                               pThis->pMediaNotify, s->iLUN);
     278        AssertRC(rc);
     279    }
     280#endif
     281    return VINF_SUCCESS;
     282}
     283
    260284static int drvscsiTransferCompleteNotify(PPDMIBLOCKASYNCPORT pInterface, void *pvUser, int rc)
    261285{
     
    974998    pThis->VScsiIoCallbacks.pfnVScsiLunGetFeatureFlags    = drvscsiGetFeatureFlags;
    975999    pThis->VScsiIoCallbacks.pfnVScsiLunMediumSetLock      = drvscsiSetLock;
     1000    pThis->VScsiIoCallbacks.pfnVScsiLunMediumEject        = drvscsiEject;
    9761001
    9771002    rc = VSCSIDeviceCreate(&pThis->hVScsiDevice, drvscsiVScsiReqCompleted, pThis);
  • trunk/src/VBox/Devices/Storage/VSCSI/VSCSIInternal.h

    r44528 r44888  
    364364
    365365/**
    366  * Wrapper for the get medium lock/unlock I/O callback.
     366 * Wrapper for the medium lock/unlock I/O callback.
    367367 *
    368368 * @returns VBox status code.
     
    378378
    379379/**
     380 * Wrapper for the medium eject I/O callback.
     381 *
     382 * @returns VBox status code.
     383 * @param   pVScsiLun   The LUN.
     384 */
     385DECLINLINE(int) vscsiLunMediumEject(PVSCSILUNINT pVScsiLun)
     386{
     387    return pVScsiLun->pVScsiLunIoCallbacks->pfnVScsiLunMediumEject(pVScsiLun,
     388                                                                   pVScsiLun->pvVScsiLunUser);
     389}
     390
     391/**
    380392 * Wrapper for the I/O request enqueue I/O callback.
    381393 *
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