Ejemplo n.º 1
0
/*-----------------------------------------------------------------------------*
 *
 *
 *
 *
 *-----------------------------------------------------------------------------*/
void Sym8xxSCSIController::Sym8xxAbortCommand( IOSCSIParallelCommand *scsiCommand )
{
    SRB				*srb;
    SCSICDBInfo                 scsiCDB;
    SCSITargetLun		targetLun;


    scsiCommand->getTargetLun( &targetLun );

    switch ( scsiCommand->getCmdType() )
    {
        case kSCSICommandAbort:
            srb = (SRB *)scsiCommand->getOriginalCmd()->getCommandData();
            Sym8xxCancelMailBox( &srb->srbPhys->nexus );
            break;

        case kSCSICommandAbortAll:
            Sym8xxCancelMailBox( targetLun.target, targetLun.lun, false );
            break;
      
        case kSCSICommandDeviceReset:
            Sym8xxCancelMailBox( targetLun.target, (UInt32) -1, false );
            break;

        default:
            ;
    }

    if ( abortSRB )
    {
        abortReqPending = true;
        
        rescheduleCommand( scsiCommand );
        disableCommands();
        return;
    }

    scsiCommand->getCDB( &scsiCDB );

    srb = (SRB *) scsiCommand->getCommandData();
    
    srb->nexus.msgData[0] = srb->lun | ((srb->srbCDBFlags & kCDBFlagsNoDisconnect ) ? 0x80 : 0xC0);
        
    if ( scsiCDB.cdbTagMsg != 0 )
    {
        srb->nexus.tag        = scsiCDB.cdbTag + 128;
        srb->nexus.msgData[1] = srb->nexus.tag;
    }
    else
    {    
        srb->nexus.tag        = ((UInt32)srb->target << 3) | srb->lun;
        srb->nexus.msgData[1] = 0;
    }       
    srb->tag = srb->nexus.tag;

    srb->nexus.msgData[2] = scsiCDB.cdbAbortMsg;
    
    Sym8xxAbortBdr( srb );
}    
void TEditor::setCmdState( ushort command, Boolean enable )
{
    TCommandSet s;
    s += command;
    if( enable == True && (state & sfActive) != 0 )
        enableCommands(s);
    else
        disableCommands(s);
}
Ejemplo n.º 3
0
void TWindow::setState(ushort aState, Boolean enable) {
   TCommandSet windowCommands;

   TGroup::setState(aState, enable);
   if ((aState & sfSelected) != 0) {
      setState(sfActive, enable);
      if (frame != 0)
         frame->setState(sfActive,enable);
      windowCommands += cmNext;
      windowCommands += cmPrev;
      if ((flags & (wfGrow | wfMove)) != 0)
         windowCommands += cmResize;
      if ((flags & wfClose) != 0)
         windowCommands += cmClose;
      if ((flags & wfZoom) != 0)
         windowCommands += cmZoom;
      if (enable != False)
         enableCommands(windowCommands);
      else
         disableCommands(windowCommands);
   }
}