src/dev/arm/ufs_device.cc
/**
 * Obtain LUN and put it in the right LUN queue. Each LUN has its own queue
 * of commands that need to be executed. This is the first instance where it
 * can be determined which Logic unit should handle the transfer. Then check
 * wether it should wait and queue or if it can continue.
 */
Obtain LUN and put it in the right LUN queue. Each LUN has its own queue
of commands that need to be executed. This is the first instance where it
can be determined which Logic unit should handle the transfer. Then check
wether it should wait and queue or if it can continue.
Obtain LUN and put it in the right LUN queue . Each LUN has its own queue of commands that need to be executed . This is the first instance where it can be determined which Logic unit should handle the transfer . Then check wether it should wait and queue or if it can continue .
void
UFSHostDevice::SCSIStart()
{
    DPRINTF(UFSHostDevice, "SCSI message on hold until ready\n");
    uint32_t LUN = SCSIInfo.destination[2];
    UFSDevice[LUN]->SCSIInfoQueue.push_back(SCSIInfo);
    DPRINTF(UFSHostDevice, "SCSI queue %d has %d elements\n", LUN,
            UFSDevice[LUN]->SCSIInfoQueue.size());
    if (UFSDevice[LUN]->SCSIInfoQueue.size() < 2) 
        SCSIResume(LUN);
    else if (UFSDevice[LUN]->SCSIInfoQueue.size() > 32)
        panic("SCSI queue is getting too big %d\n", UFSDevice[LUN]->
              SCSIInfoQueue.size());
    if (!transferEventQueue.empty()) {
        writeDevice(&transferEventQueue.front(), false,
                    transferStartInfo.front().address,
                    transferStartInfo.front().size, reinterpret_cast<uint8_t*>
                    (transferStartInfo.front().destination), 0, 0);
        DPRINTF(UFSHostDevice, "Transfer scheduled");
    }
}
void UFSHostDevice :: SCSIStart ( ) { DPRINTF ( UFSHostDevice , " \n " ) ; uint32_t LUN = SCSIInfo . destination [ 2 ] ; UFSDevice [ LUN ] -> SCSIInfoQueue . push_back ( SCSIInfo ) ; DPRINTF ( UFSHostDevice , " \n " , LUN , UFSDevice [ LUN ] -> SCSIInfoQueue . size ( ) ) ; if ( UFSDevice [ LUN ] -> SCSIInfoQueue . size ( ) < 2 ) SCSIResume ( LUN ) ; else if ( UFSDevice [ LUN ] -> SCSIInfoQueue . size ( ) > 32 ) panic ( " \n " , UFSDevice [ LUN ] -> SCSIInfoQueue . size ( ) ) ; if ( ! transferEventQueue . empty ( ) ) { writeDevice ( & transferEventQueue . front ( ) , false , transferStartInfo . front ( ) . address , transferStartInfo . front ( ) . size , reinterpret_cast < uint8_t * > ( transferStartInfo . front ( ) . destination ) , 0 , 0 ) ; DPRINTF ( UFSHostDevice , " " ) ; } }
Obtain LUN and put it in the right LUN queue.
Obtain LUN and put it in the right LUN queue .
/**There are 32 doorbells, so at max there can be 32 transactions*/ //LUN is available /**
     * First transfer is done, fetch the next;
     * At this point, the device is busy, not the HC
     */ /**
         * loading next data packet in case Another LUN
         * is approached in the mean time
         */