VirtualBox

Changeset 33013 in vbox


Ignore:
Timestamp:
Oct 8, 2010 3:58:36 PM (14 years ago)
Author:
vboxsync
Message:

AHCI: Implement ATA_DEVICE_RESET for ATAPI devices (mandatory command for ATAPI)

File:
1 edited

Legend:

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

    r32957 r33013  
    26202620    d2hFis[AHCI_CMDFIS_SECTC] = 0x01;
    26212621
    2622     pAhciPort->regTFD = (1 << 8) | ATA_STAT_READY | ATA_STAT_SEEK | ATA_STAT_WRERR;
     2622    pAhciPort->regTFD = (1 << 8) | ATA_STAT_SEEK | ATA_STAT_WRERR;
     2623    if (!pAhciPort->fATAPI)
     2624        pAhciPort->regTFD |= ATA_STAT_READY;
    26232625
    26242626    ahciPostFisIntoMemory(pAhciPort, AHCI_CMDFIS_TYPE_D2H, d2hFis);
     
    45024504
    45034505/**
     4506 * Initiates a device reset caused by ATA_DEVICE_RESET (ATAPI only).
     4507 *
     4508 * @returns nothing.
     4509 * @param   pAhciPort          The device to reset.
     4510 * @param   pAhciPortTaskState The task state.
     4511 */
     4512static void ahciDeviceReset(PAHCIPort pAhciPort, PAHCIPORTTASKSTATE pAhciPortTaskState)
     4513{
     4514    ASMAtomicWriteBool(&pAhciPort->fResetDevice, true);
     4515
     4516    /*
     4517     * Because this ATAPI only and ATAPI can't have
     4518     * more than one command active at a time the task counter should be 0
     4519     * and it is possible to finish the reset now.
     4520     */
     4521    Assert(ASMAtomicReadU32(&pAhciPort->uActTasksActive) == 0);
     4522    ahciFinishStorageDeviceReset(pAhciPort, pAhciPortTaskState);
     4523}
     4524
     4525/**
    45044526 * Build a D2H FIS and post into the memory area of the guest.
    45054527 *
     
    58135835                    pAhciPortTaskState->uATARegError = ABRT_ERR;
    58145836                    pAhciPortTaskState->uATARegStatus = ATA_STAT_READY | ATA_STAT_ERR;
     5837            }
     5838            break;
     5839        }
     5840        case ATA_DEVICE_RESET:
     5841        {
     5842            if (!pAhciPort->fATAPI)
     5843            {
     5844                pAhciPortTaskState->uATARegError = ABRT_ERR;
     5845                pAhciPortTaskState->uATARegStatus = ATA_STAT_READY | ATA_STAT_ERR;
     5846            }
     5847            else
     5848            {
     5849                /* Reset the device. */
     5850                ahciDeviceReset(pAhciPort, pAhciPortTaskState);
    58155851            }
    58165852            break;
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