int sInitController(CONTROLLER_T * CtlP, int CtlNum, ByteIO_t MudbacIO, ByteIO_t * AiopIOList, int AiopIOListSize, int IRQNum, Byte_t Frequency, int PeriodicOnly) 
static int sInitController(CONTROLLER_T * CtlP, int CtlNum, ByteIO_t MudbacIO, ByteIO_t * AiopIOList, int AiopIOListSize, int IRQNum, Byte_t Frequency, int PeriodicOnly) 
int sInitController(CONTROLLER_T * CtlP, int CtlNum, ByteIO_t MudbacIO,		    ByteIO_t * AiopIOList, int AiopIOListSize, int IRQNum,		    Byte_t Frequency, int PeriodicOnly){	int i;	ByteIO_t io;	int done;	CtlP->AiopIntrBits = aiop_intr_bits;	CtlP->AltChanRingIndicator = 0;	CtlP->CtlNum = CtlNum;	CtlP->CtlID = CTLID_0001;	/* controller release 1 */	CtlP->BusType = isISA;	CtlP->MBaseIO = MudbacIO;	CtlP->MReg1IO = MudbacIO + 1;	CtlP->MReg2IO = MudbacIO + 2;	CtlP->MReg3IO = MudbacIO + 3;#if 1	CtlP->MReg2 = 0;	/* interrupt disable */	CtlP->MReg3 = 0;	/* no periodic interrupts */#else	if (sIRQMap[IRQNum] == 0) {	/* interrupts globally disabled */		CtlP->MReg2 = 0;	/* interrupt disable */		CtlP->MReg3 = 0;	/* no periodic interrupts */	} else {		CtlP->MReg2 = sIRQMap[IRQNum];	/* set IRQ number */		CtlP->MReg3 = Frequency;	/* set frequency */		if (PeriodicOnly) {	/* periodic interrupt only */			CtlP->MReg3 |= PERIODIC_ONLY;		}	}#endif	sOutB(CtlP->MReg2IO, CtlP->MReg2);	sOutB(CtlP->MReg3IO, CtlP->MReg3);	sControllerEOI(CtlP);	/* clear EOI if warm init */	/* Init AIOPs */	CtlP->NumAiop = 0;	for (i = done = 0; i < AiopIOListSize; i++) {		io = AiopIOList[i];		CtlP->AiopIO[i] = (WordIO_t) io;		CtlP->AiopIntChanIO[i] = io + _INT_CHAN;		sOutB(CtlP->MReg2IO, CtlP->MReg2 | (i & 0x03));	/* AIOP index */		sOutB(MudbacIO, (Byte_t) (io >> 6));	/* set up AIOP I/O in MUDBAC */		if (done)			continue;		sEnAiop(CtlP, i);	/* enable the AIOP */		CtlP->AiopID[i] = sReadAiopID(io);	/* read AIOP ID */		if (CtlP->AiopID[i] == AIOPID_NULL)	/* if AIOP does not exist */			done = 1;	/* done looking for AIOPs */		else {			CtlP->AiopNumChan[i] = sReadAiopNumChan((WordIO_t) io);	/* num channels in AIOP */			sOutW((WordIO_t) io + _INDX_ADDR, _CLK_PRE);	/* clock prescaler */			sOutB(io + _INDX_DATA, sClockPrescale);			CtlP->NumAiop++;	/* bump count of AIOPs */		}		sDisAiop(CtlP, i);	/* disable AIOP */	}	if (CtlP->NumAiop == 0)		return (-1);	else		return (CtlP->NumAiop);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/f15313bf42337ade55376303932d8b6a62e6be43/rocket.c/buggy/drivers/char/rocket.c