static void In1_atnhi(int tr) { if (par_status & 0xff) { ResetBus(); Go(WaitATN); } else { if (isListening()) { Go(In1); } else { if (isTalking()) { ResetBus(); if (!parallel_ndac) { /* old pet... */ Go(OldPet); } else { State[OldPet].m[NDAClo](tr); return; } } else { #ifdef PARALLEL_DEBUG if (parallel_debug) log_warning(LOG_DEFAULT, "IEEE488: Ouch, something weird happened: %s got %s", State[In1].name, Trans[tr]); #endif ResetBus(); Go(WaitATN); } } } }
static void Out2_ndachi(int tr) { static BYTE b; parallel_emu_set_dav(0); parallel_emu_set_eoi(0); parallel_emu_set_bus(0xff); par_status = parallel_trap_receivebyte(&b, 0); if (par_status & 0xff) { ResetBus(); Go(WaitATN); } else Go(Out1); }
BOOLEAN StartIO (IN PVOID HAObject, IN PSCSI_REQUEST_BLOCK Req) { ADAPTER_PTR HA = HAObject; DEVICE_PTR DevP; int i; TRACE(2, ("StartIO(): Req @%x, Function = 0x%x, Req->SrbExtension @%x\n", Req, Req->Function, Req->SrbExtension)); switch (Req->Function) { case SRB_FUNCTION_EXECUTE_SCSI: ReqNext(Req) = (IO_REQ_PTR)NILL; ReqAdapterPtr(Req) = HA; for (i=0; i < sizeof(ReqState(Req)); i++) ((U8 *)&ReqState(Req))[i] = 0; ReqState(Req).ReqType = RTNormalReq; if ( (DevP = ScsiPortGetLogicalUnit(HA, Req->PathId, ReqTargetID(Req), ReqTargetLUN(Req))) == NILL) { TRACE(3, ("ExecuteReq(): Unable to get device info\n")); Req->SrbStatus = SRB_STATUS_NO_DEVICE; return FALSE; } ReqDevP(Req) = DevP; if (!DevP->Flags.Initialized) QueueInternalRequest(HA, Req, RTGetInfoReq); else IExecuteReq(HA, DevP, Req, NORMAL_REQ); break; case SRB_FUNCTION_RESET_BUS: TRACE(3, ("StartIO(): RESET_BUS command\n")); ResetBus(HAObject, Req->PathId); break; case SRB_FUNCTION_RESET_DEVICE: case SRB_FUNCTION_TERMINATE_IO: case SRB_FUNCTION_FLUSH: case SRB_FUNCTION_SHUTDOWN: Req->SrbStatus = SRB_STATUS_SUCCESS; ScsiPortNotification(RequestComplete, HA, Req); break; case SRB_FUNCTION_ABORT_COMMAND: TRACE(0, ("StartIO(): Request at %x to abort request %x\n", Req, Req->NextSrb)); if ((DevP = ScsiPortGetLogicalUnit(HA, Req->PathId, ReqTargetID(Req), ReqTargetLUN(Req))) == NILL || (DevP->Flags.Initialized == 0) || !AbortRequest(HA, DevP, Req->NextSrb) ) { TRACE(0, ("StartIO(): Abort operation failed\n")); Req->SrbStatus = SRB_STATUS_ABORT_FAILED; } else { TRACE(0, ("StartIO(): Abort operation success\n")); Req->SrbStatus = SRB_STATUS_SUCCESS; } ScsiPortNotification(RequestComplete, HA, Req); break; case SRB_FUNCTION_RELEASE_RECOVERY: case SRB_FUNCTION_RECEIVE_EVENT: case SRB_FUNCTION_IO_CONTROL: default: TRACE(0, ("StartIO(): Unsupported command: 0x%x\n", Req->Function)); APISetStatus(Req, S_REQ_OPCODE, Terminal, NotSenseable); return FALSE; break; } ScsiPortNotification(NextLuRequest, HA, Req->PathId, Req->TargetId, Req->Lun); return TRUE; }
static void Out1a_ndachi(int tr) { ResetBus(); Go(WaitATN); }
static void In2_atnhi(int a) { /* atn data transfer interrupted */ ResetBus(); Go(WaitATN); /* ??? */ }