src/dev/arm/ufs_device.cc
/**
 * Obtains the SCSI command (if any)
 * Two possibilities: if it contains a SCSI command, then it is a usable
 * message; if it doesnt contain a SCSI message, then it can't be handeld
 * by this code.
 * This is the second stage of the transfer. We have the information about
 * where the next command can be found and what the type of command is. The
 * actions that are needed from the device its side are: get the information
 * and store the information such that we can reply.
 */
Obtains the SCSI command (if any)
Two possibilities: if it contains a SCSI command, then it is a usable
message; if it doesnt contain a SCSI message, then it can't be handeld
by this code.
This is the second stage of the transfer. We have the information about
where the next command can be found and what the type of command is. The
actions that are needed from the device its side are: get the information
and store the information such that we can reply.
Obtains the SCSI command ( if any ) Two possibilities : if it contains a SCSI command then it is a usable message ; if it doesnt contain a SCSI message then it can ' t be handeld by this code . This is the second stage of the transfer . We have the information about where the next command can be found and what the type of command is . The actions that are needed from the device its side are : get the information and store the information such that we can reply .
void
UFSHostDevice::transferHandler(struct UTPTransferReqDesc* request_in,
                               int req_pos, Addr finaladdress, uint32_t
                               finalsize, uint32_t done)
{
    Addr cmd_desc_addr = 0x00;
    DPRINTF(UFSHostDevice, "SCSI message detected\n");
    request_in->header.dWord2 &= 0xffffff00;
    SCSIInfo.RequestIn = request_in;
    SCSIInfo.reqPos = req_pos;
    SCSIInfo.finalAddress = finaladdress;
    SCSIInfo.finalSize = finalsize;
    SCSIInfo.destination.resize(request_in->PRDTableOffset * 4
        + request_in->PRDTableLength * sizeof(UFSHCDSGEntry));
    SCSIInfo.done = done;
    assert(!SCSIResumeEvent.scheduled());
    cmd_desc_addr = request_in->commandDescBaseAddrHi;
    cmd_desc_addr = (cmd_desc_addr << 32) |
        (request_in->commandDescBaseAddrLo & 0xffffffff);
    writeDevice(&SCSIResumeEvent, false, cmd_desc_addr,
                SCSIInfo.destination.size(), &SCSIInfo.destination[0],0, 0);
    DPRINTF(UFSHostDevice, "SCSI scheduled\n");
    transferEventQueue.pop_front();
}
void UFSHostDevice :: transferHandler ( struct UTPTransferReqDesc * request_in , int req_pos , Addr finaladdress , uint32_t finalsize , uint32_t done ) { Addr cmd_desc_addr = 0x00 ; DPRINTF ( UFSHostDevice , " \n " ) ; request_in -> header . dWord2 &= 0xffffff00 ; SCSIInfo . RequestIn = request_in ; SCSIInfo . reqPos = req_pos ; SCSIInfo . finalAddress = finaladdress ; SCSIInfo . finalSize = finalsize ; SCSIInfo . destination . resize ( request_in -> PRDTableOffset * 4 + request_in -> PRDTableLength * sizeof ( UFSHCDSGEntry ) ) ; SCSIInfo . done = done ; assert ( ! SCSIResumeEvent . scheduled ( ) ) ; cmd_desc_addr = request_in -> commandDescBaseAddrHi ; cmd_desc_addr = ( cmd_desc_addr << 32 ) | ( request_in -> commandDescBaseAddrLo & 0xffffffff ) ; writeDevice ( & SCSIResumeEvent , false , cmd_desc_addr , SCSIInfo . destination . size ( ) , & SCSIInfo . destination [ 0 ] , 0 , 0 ) ; DPRINTF ( UFSHostDevice , " \n " ) ; transferEventQueue . pop_front ( ) ; }
Obtains the SCSI command (if any)
 Two possibilities: if it contains a SCSI command, then it is a usable
 message; if it doesnt contain a SCSI message, then it can't be handeld
 by this code.
Obtains the SCSI command ( if any ) Two possibilities : if it contains a SCSI command then it is a usable message ; if it doesnt contain a SCSI message then it can ' t be handeld by this code .
//acknowledge handling of the message /**
     *Get the UTP command that has the SCSI command
     */