VirtualBox

Changeset 36990 in vbox for trunk


Ignore:
Timestamp:
May 6, 2011 7:10:27 PM (14 years ago)
Author:
vboxsync
Message:

AHCI: Controller part for device hotplug

File:
1 edited

Legend:

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

    r36972 r36990  
    19051905    pAhciPort->regIE   = 0;
    19061906    pAhciPort->regCMD  = AHCI_PORT_CMD_CPD  | /* Cold presence detection */
     1907                         AHCI_PORT_CMD_HPCP | /* Hotplugging supported. */
    19071908                         AHCI_PORT_CMD_SUD  | /* Device has spun up. */
    19081909                         AHCI_PORT_CMD_POD;   /* Port is powered on. */
     
    79257926        ahciMediumRemoved(pAhciPort);
    79267927
     7928    if (!(fFlags & PDM_TACH_FLAGS_NOT_HOT_PLUG))
     7929    {
     7930        /*
     7931         * Inform the guest about the removed device.
     7932         */
     7933        pAhciPort->regSSTS = 0;
     7934        ASMAtomicAndU32(&pAhciPort->regCMD, ~AHCI_PORT_CMD_CPS);
     7935        ASMAtomicOrU32(&pAhciPort->regIS, AHCI_PORT_IS_CPDS | AHCI_PORT_IS_PRCS);
     7936        ASMAtomicOrU32(&pAhciPort->regSERR, AHCI_PORT_SERR_N);
     7937        if (   (pAhciPort->regIE & AHCI_PORT_IE_CPDE)
     7938            || (pAhciPort->regIE & AHCI_PORT_IE_PCE)
     7939            || (pAhciPort->regIE & AHCI_PORT_IE_PRCE))
     7940            ahciHbaSetInterrupt(pAhciPort->CTX_SUFF(pAhci), pAhciPort->iLUN, VERR_IGNORED);
     7941    }
     7942
    79277943    /*
    79287944     * Zero some important members.
     
    80308046            if (RT_SUCCESS(rc) && pAhciPort->fATAPI)
    80318047                ahciMediumInserted(pAhciPort);
     8048
     8049            /* Inform the guest about the added device in case of hotplugging. */
     8050            if (   RT_SUCCESS(rc)
     8051                && !(fFlags & PDM_TACH_FLAGS_NOT_HOT_PLUG))
     8052            {
     8053                /*
     8054                 * Initialize registers
     8055                 */
     8056                ASMAtomicOrU32(&pAhciPort->regCMD, AHCI_PORT_CMD_CPS);
     8057                ASMAtomicOrU32(&pAhciPort->regIS, AHCI_PORT_IS_CPDS | AHCI_PORT_IS_PRCS | AHCI_PORT_IS_PCS);
     8058                ASMAtomicOrU32(&pAhciPort->regSERR, AHCI_PORT_SERR_X | AHCI_PORT_SERR_N);
     8059                if (   (pAhciPort->regIE & AHCI_PORT_IE_CPDE)
     8060                    || (pAhciPort->regIE & AHCI_PORT_IE_PCE)
     8061                    || (pAhciPort->regIE & AHCI_PORT_IE_PRCE))
     8062                    ahciHbaSetInterrupt(pAhciPort->CTX_SUFF(pAhci), pAhciPort->iLUN, VERR_IGNORED);
     8063            }
    80328064        }
    80338065    }
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