File:  [NeXTSTEP 3.3 examples] / Examples / DriverKit / Adaptec1542B / Adaptec1542B_reloc.tproj / AHAController.h
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:49:02 2018 UTC (8 years, 1 month ago) by root
Branches: NeXT, MAIN
CVS tags: NeXTSTEP33, HEAD
Sample Programs from NeXSTEP 3.3

/*
 * Copyright (c) 1993 NeXT Computer, Inc.
 *
 * AHAController.h. - class definition for Adaptec 1542 driver.
 *
 * HISTORY
 *
 * 13 Apr 1993	Doug Mitchell at NeXT
 *	Created from Brian Pinkerton's Adaptec driver. 
 */
 

#import <driverkit/IODevice.h>
#import <driverkit/IODeviceDescription.h>
#import <driverkit/return.h>
#import <driverkit/scsiTypes.h>
#import <driverkit/IOSCSIController.h>
#import <driverkit/i386/directDevice.h>
#import "AHAControllerPrivate.h"
#import "AHATypes.h"


@interface AHAController : IOSCSIController 
{
	/*
	 * Hardware info.
	 */
	struct aha_config 	config;		/* config info from device */
	IOEISAPortAddress 	ioBase;		/* base IO port addr */
	unsigned char 		ahaBoardId;
	BOOL			ioThreadRunning;
	
	/*
	 * mailbox and CCB areas. Dynamically allocated from low 
	 * 16 MB of memory.
	 */  
	struct aha_mb_area	*ahaMbArea;
	struct ccb		*ahaCcb;
	int			numFreeCcbs;	/* number of free CCBs */

	/*
	 * Three queues:
	 * 
	 * commandQ:	 contains AHACommandBuf's to be executed by the 
	 *		 I/O thread. Enqueued by exported methods (via
	 *		 -executeCmdBuf); dequeued by the I/O thread in
	 *		 -commandRequestOccurred.
	 *
	 * outstandingQ: contains ccb's on which the controller is
	 * 		 currently operating. The number of ccb's in
	 *		 outstandingQ is outstandingCount. Ccb's are 
	 *		 enqueued here by -runPendingCommands. 
	 *
	 * pendingQ:	 contains ccb's which the I/O thread is holding
	 *		 on to because outstandingCount == AHA_QUEUE_SIZE.
	 *		 Ccb's are enqueued here by -threadExecuteRequest:.
	 *
	 */
	queue_head_t	commandQ;		/* list of waiting
						 * AHACommandBuf's */
	id		commandLock;		/* NXLock; protects commandQ */
	queue_head_t	outstandingQ;		/* list of running cmds */
	unsigned int	outstandingCount;	/* length of outstandingQ */
	queue_head_t	pendingQ;
	
	/*
	 * Local reference count for reserveDMALock.
	 */ 
	unsigned	dmaLockCount;		
	
	/*
	 * Statistics counters.
	 */ 
	unsigned int	maxQueueLen;
	unsigned int	queueLenTotal;
	unsigned int	totalCommands;
	
	port_t		interruptPortKern;	/* kernel version of 
						 * interruptPort */
}

/*
 * Standard IODirectDevice methods overridden here.
 */
+ (BOOL)probe:deviceDescription;
- initFromDeviceDescription	: deviceDescription;
- (unsigned)maxTransfer;
- free;
- (void)interruptOccurred;	
- (void)interruptOccurredAt:(int)localNum;
- (void)otherOccurred:(int)id;
- (void)receiveMsg;
- (void)timeoutOccurred;
- (void)commandRequestOccurred;

/*
 * IOSCSIControllerExported methods implemented here.
 */
- (sc_status_t) executeRequest 	: (IOSCSIRequest *)scsiReq 
		         buffer : (void *)buffer 
		         client : (vm_task_t)client;
- (sc_status_t)resetSCSIBus;

@end



unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.