|
|
1.1 ! root 1: /* ! 2: * Copyright (c) 1993 NeXT Computer, Inc. ! 3: * ! 4: * AHAController.h. - class definition for Adaptec 1542 driver. ! 5: * ! 6: * HISTORY ! 7: * ! 8: * 13 Apr 1993 Doug Mitchell at NeXT ! 9: * Created from Brian Pinkerton's Adaptec driver. ! 10: */ ! 11: ! 12: ! 13: #import <driverkit/IODevice.h> ! 14: #import <driverkit/IODeviceDescription.h> ! 15: #import <driverkit/return.h> ! 16: #import <driverkit/scsiTypes.h> ! 17: #import <driverkit/IOSCSIController.h> ! 18: #import <driverkit/i386/directDevice.h> ! 19: #import "AHAControllerPrivate.h" ! 20: #import "AHATypes.h" ! 21: ! 22: ! 23: @interface AHAController : IOSCSIController ! 24: { ! 25: /* ! 26: * Hardware info. ! 27: */ ! 28: struct aha_config config; /* config info from device */ ! 29: IOEISAPortAddress ioBase; /* base IO port addr */ ! 30: unsigned char ahaBoardId; ! 31: BOOL ioThreadRunning; ! 32: ! 33: /* ! 34: * mailbox and CCB areas. Dynamically allocated from low ! 35: * 16 MB of memory. ! 36: */ ! 37: struct aha_mb_area *ahaMbArea; ! 38: struct ccb *ahaCcb; ! 39: int numFreeCcbs; /* number of free CCBs */ ! 40: ! 41: /* ! 42: * Three queues: ! 43: * ! 44: * commandQ: contains AHACommandBuf's to be executed by the ! 45: * I/O thread. Enqueued by exported methods (via ! 46: * -executeCmdBuf); dequeued by the I/O thread in ! 47: * -commandRequestOccurred. ! 48: * ! 49: * outstandingQ: contains ccb's on which the controller is ! 50: * currently operating. The number of ccb's in ! 51: * outstandingQ is outstandingCount. Ccb's are ! 52: * enqueued here by -runPendingCommands. ! 53: * ! 54: * pendingQ: contains ccb's which the I/O thread is holding ! 55: * on to because outstandingCount == AHA_QUEUE_SIZE. ! 56: * Ccb's are enqueued here by -threadExecuteRequest:. ! 57: * ! 58: */ ! 59: queue_head_t commandQ; /* list of waiting ! 60: * AHACommandBuf's */ ! 61: id commandLock; /* NXLock; protects commandQ */ ! 62: queue_head_t outstandingQ; /* list of running cmds */ ! 63: unsigned int outstandingCount; /* length of outstandingQ */ ! 64: queue_head_t pendingQ; ! 65: ! 66: /* ! 67: * Local reference count for reserveDMALock. ! 68: */ ! 69: unsigned dmaLockCount; ! 70: ! 71: /* ! 72: * Statistics counters. ! 73: */ ! 74: unsigned int maxQueueLen; ! 75: unsigned int queueLenTotal; ! 76: unsigned int totalCommands; ! 77: ! 78: port_t interruptPortKern; /* kernel version of ! 79: * interruptPort */ ! 80: } ! 81: ! 82: /* ! 83: * Standard IODirectDevice methods overridden here. ! 84: */ ! 85: + (BOOL)probe:deviceDescription; ! 86: - initFromDeviceDescription : deviceDescription; ! 87: - (unsigned)maxTransfer; ! 88: - free; ! 89: - (void)interruptOccurred; ! 90: - (void)interruptOccurredAt:(int)localNum; ! 91: - (void)otherOccurred:(int)id; ! 92: - (void)receiveMsg; ! 93: - (void)timeoutOccurred; ! 94: - (void)commandRequestOccurred; ! 95: ! 96: /* ! 97: * IOSCSIControllerExported methods implemented here. ! 98: */ ! 99: - (sc_status_t) executeRequest : (IOSCSIRequest *)scsiReq ! 100: buffer : (void *)buffer ! 101: client : (vm_task_t)client; ! 102: - (sc_status_t)resetSCSIBus; ! 103: ! 104: @end ! 105: ! 106:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.