src/dev/arm/ufs_device.cc
/**
 * finalUTP. Second part of the transfer done event.
 * this sends the final response: the UTP response. After this transaction
 * the doorbell shall be cleared, and the interupt shall be set.
 */
finalUTP. Second part of the transfer done event.
this sends the final response: the UTP response. After this transaction
the doorbell shall be cleared, and the interupt shall be set.
finalUTP . Second part of the transfer done event . this sends the final response : the UTP response . After this transaction the doorbell shall be cleared and the interupt shall be set .
void
UFSHostDevice::finalUTP()
{
    uint32_t lun_id = transferEnd.front().lun_id;
    UFSDevice[lun_id]->SCSIInfoQueue.pop_front();
    DPRINTF(UFSHostDevice, "SCSIInfoQueue size: %d, lun: %d\n",
            UFSDevice[lun_id]->SCSIInfoQueue.size(), lun_id);
    if (UFSHCIMem.TRUTRLDBR & transferEnd.front().mask) {
        uint8_t count = 0;
        while (!(transferEnd.front().mask & (0x1 << count)))
            ++count;
        stats.transactionLatency.sample(curTick() -
                                        transactionStart[count]);
    }
    readDevice(true, transferEnd.front().address,
               transferEnd.front().size, reinterpret_cast<uint8_t*>
               (transferEnd.front().destination), true, NULL);
    transferTrack &= ~(transferEnd.front().mask);
    --activeDoorbells;
    ++pendingDoorbells;
    garbage.push_back(transferEnd.front().destination);
    transferEnd.pop_front();
    DPRINTF(UFSHostDevice, "UTP handled\n");
    stats.averageDoorbell = stats.maxDoorbell.value();
    DPRINTF(UFSHostDevice, "activeDoorbells: %d, pendingDoorbells: %d,"
            " garbage: %d, TransferEvent: %d\n", activeDoorbells,
            pendingDoorbells, garbage.size(), transferEventQueue.size());
    if (!UFSDevice[lun_id]->SCSIInfoQueue.empty())
        SCSIResume(lun_id);
}
void UFSHostDevice :: finalUTP ( ) { uint32_t lun_id = transferEnd . front ( ) . lun_id ; UFSDevice [ lun_id ] -> SCSIInfoQueue . pop_front ( ) ; DPRINTF ( UFSHostDevice , " \n " , UFSDevice [ lun_id ] -> SCSIInfoQueue . size ( ) , lun_id ) ; if ( UFSHCIMem . TRUTRLDBR & transferEnd . front ( ) . mask ) { uint8_t count = 0 ; while ( ! ( transferEnd . front ( ) . mask & ( 0x1 << count ) ) ) ++ count ; stats . transactionLatency . sample ( curTick ( ) - transactionStart [ count ] ) ; } readDevice ( true , transferEnd . front ( ) . address , transferEnd . front ( ) . size , reinterpret_cast < uint8_t * > ( transferEnd . front ( ) . destination ) , true , NULL ) ; transferTrack &= ~ ( transferEnd . front ( ) . mask ) ; -- activeDoorbells ; ++ pendingDoorbells ; garbage . push_back ( transferEnd . front ( ) . destination ) ; transferEnd . pop_front ( ) ; DPRINTF ( UFSHostDevice , " \n " ) ; stats . averageDoorbell = stats . maxDoorbell . value ( ) ; DPRINTF ( UFSHostDevice , " " " \n " , activeDoorbells , pendingDoorbells , garbage . size ( ) , transferEventQueue . size ( ) ) ; if ( ! UFSDevice [ lun_id ] -> SCSIInfoQueue . empty ( ) ) SCSIResume ( lun_id ) ; }
finalUTP.
finalUTP .
/**stats**/ /**Last message that will be transfered*/ /**clean and ensure that the tracker is updated*/ /**stats**/ /**This is the moment that the device is available again*/