|
|
1.1 ! root 1: /* Copyright (c) 1994 NeXT Computer, Inc. All rights reserved. ! 2: * ! 3: * AMD_SCSI.h - hardware-independent methods for AMD PCI SCSI driver. ! 4: * ! 5: * These methods are implemented in AMD_SCSI.m. ! 6: * ! 7: * HISTORY ! 8: * 21 Oct 94 Doug Mitchell at NeXT ! 9: * Created. ! 10: */ ! 11: ! 12: #import "AMD_SCSI.h" ! 13: #import "AMD_Types.h" ! 14: ! 15: @interface AMD_SCSI(Private) ! 16: ! 17: /* ! 18: * Send a command to the controller thread, and wait for its completion. ! 19: * Only invoked by publicly exported methods in SCSIController.m. ! 20: */ ! 21: - (IOReturn)executeCmdBuf : (commandBuf *)cmdBuf; ! 22: ! 23: /* ! 24: * Abort all active and disconnected commands with specified status. No ! 25: * hardware action. Currently used by threadResetBus and during processing ! 26: * of a CO_Abort command. ! 27: */ ! 28: - (void)swAbort : (sc_status_t)status; ! 29: ! 30: /* ! 31: * I/O thread version of resetSCSIBus and executeRequest. ! 32: */ ! 33: - (void)threadResetBus : (const char *)reason; ! 34: - (void)threadExecuteRequest : (commandBuf *)cmdBuf; ! 35: ! 36: /* ! 37: * Methods called by other modules in this driver. ! 38: */ ! 39: ! 40: /* ! 41: * Called when a transaction associated with cmdBuf is complete. Notify ! 42: * waiting thread. If cmdBuf->scsiReq exists (i.e., this is not a reset ! 43: * or an abort), scsiReq->driverStatus must be valid. If cmdBuf is activeCmd, ! 44: * caller must remove from activeCmd. ! 45: */ ! 46: - (void)ioComplete : (commandBuf *)cmdBuf; ! 47: ! 48: /* ! 49: * Generate autosense request for specified cmdBuf, place it ! 50: * at head of pendingQ. ! 51: */ ! 52: - (void)generateAutoSense : (commandBuf *)cmdBuf; ! 53: ! 54: /* ! 55: * I/O associated with activeCmd has disconnected. Place it on disconnectQ ! 56: * and enable another transaction. ! 57: */ ! 58: - (void)disconnect; ! 59: ! 60: /* ! 61: * Specified target, lun, and queueTag is trying to reselect. If we have ! 62: * a commandBuf for this TLQ nexus on disconnectQ, remove it, make it the ! 63: * current activeCmd, and return YES. Else return NO. ! 64: * A value of zero for queueTag indicates a nontagged command (zero is never ! 65: * used as the queue tag value for a tagged command). ! 66: */ ! 67: - (BOOL)reselect : (unsigned char)target_id ! 68: lun : (unsigned char)lun ! 69: queueTag : (unsigned char)queueTag; ! 70: ! 71: /* ! 72: * Determine if activeArray[][], maxQueue[][], cmdQueueEnable, and a ! 73: * command's target and lun show that it's OK to start processing cmdBuf. ! 74: * Returns YES if copacetic. ! 75: */ ! 76: - (BOOL)cmdBufOK : (commandBuf *)cmdBuf; ! 77: ! 78: /* ! 79: * The bus has gone free. Start up commands in pendingQ, if any. ! 80: */ ! 81: - (void)busFree; ! 82: ! 83: /* ! 84: * Abort activeCmd (if any) and any disconnected I/Os (if any) and reset ! 85: * the bus due to gross hardware failure. ! 86: * If activeCmd is valid, its scsiReq->driverStatus will be set to 'status'. ! 87: */ ! 88: - (void)hwAbort : (sc_status_t)status ! 89: reason : (const char *)reason; ! 90: ! 91: /* ! 92: * Called by chip level to indicate that a command has gone out to the ! 93: * hardware. ! 94: */ ! 95: - (void)activateCommand : (commandBuf *)cmdBuf; ! 96: ! 97: /* ! 98: * Remove specified cmdBuf from "active" status. Update activeArray, ! 99: * activeCount, and unschedule pending timer. ! 100: */ ! 101: - (void)deactivateCmd : (commandBuf *)cmdBuf; ! 102: ! 103: @end ! 104:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.