patch-2.2.17 linux/drivers/char/rio/rioboot.c

Next file: linux/drivers/char/rio/riocmd.c
Previous file: linux/drivers/char/rio/rio_linux.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.16/drivers/char/rio/rioboot.c linux/drivers/char/rio/rioboot.c
@@ -35,7 +35,6 @@
 #endif
 
 #define __NO_VERSION__
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/malloc.h>
 #include <linux/errno.h>
@@ -82,7 +81,6 @@
 #include "cmdblk.h"
 #include "route.h"
 
-
 static uchar
 RIOAtVec2Ctrl[] =
 {
@@ -114,26 +112,30 @@
 {
 	int offset;
 
+	func_enter ();
+
 	/* Linux doesn't allow you to disable interrupts during a
 	   "copyin". (Crash when a pagefault occurs). */
 	/* disable(oldspl); */
 	
-	rio_dprint(RIO_DEBUG_BOOT, ("Data at user address 0x%x\n",(int)rbp->DataP));
+	rio_dprintk (RIO_DEBUG_BOOT, "Data at user address 0x%x\n",(int)rbp->DataP);
 
 	/*
 	** Check that we have set asside enough memory for this
 	*/
 	if ( rbp->Count > SIXTY_FOUR_K ) {
-		rio_dprint(RIO_DEBUG_BOOT, ("RTA Boot Code Too Large!\n"));
+		rio_dprintk (RIO_DEBUG_BOOT, "RTA Boot Code Too Large!\n");
 		p->RIOError.Error = HOST_FILE_TOO_LARGE;
 		/* restore(oldspl); */
+		func_exit ();
 		return ENOMEM;
 	}
 
 	if ( p->RIOBooting ) {
-		rio_dprint(RIO_DEBUG_BOOT, ("RTA Boot Code : BUSY BUSY BUSY!\n"));
+		rio_dprintk (RIO_DEBUG_BOOT, "RTA Boot Code : BUSY BUSY BUSY!\n");
 		p->RIOError.Error = BOOT_IN_PROGRESS;
 		/* restore(oldspl); */
+		func_exit ();
 		return EBUSY;
 	}
 
@@ -158,9 +160,10 @@
 
 	if ( copyin((int)rbp->DataP,((caddr_t)(p->RIOBootPackets))+offset,
 				rbp->Count) ==COPYFAIL ) {
-		rio_dprint(RIO_DEBUG_BOOT, ("Bad data copy from user space\n"));
+		rio_dprintk (RIO_DEBUG_BOOT, "Bad data copy from user space\n");
 		p->RIOError.Error = COPYIN_FAILED;
 		/* restore(oldspl); */
+		func_exit ();
 		return EFAULT;
 	}
 
@@ -172,9 +175,61 @@
 	p->RIOBootCount   = rbp->Count;
 
 	/* restore(oldspl); */
+	func_exit();
 	return 0;
 }
 
+void rio_start_card_running (struct Host * HostP)
+{
+	func_enter ();
+
+	switch ( HostP->Type ) {
+	case RIO_AT:
+		rio_dprintk (RIO_DEBUG_BOOT, "Start ISA card running\n");
+		WBYTE(HostP->Control, 
+		      BOOT_FROM_RAM | EXTERNAL_BUS_ON
+		      | HostP->Mode
+		      | RIOAtVec2Ctrl[HostP->Ivec & 0xF] );
+		break;
+		
+#ifdef FUTURE_RELEASE
+	case RIO_MCA:
+				/*
+				** MCA handles IRQ vectors differently, so we don't write 
+				** them to this register.
+				*/
+		rio_dprintk (RIO_DEBUG_BOOT, "Start MCA card running\n");
+		WBYTE(HostP->Control, McaTpBootFromRam | McaTpBusEnable | HostP->Mode);
+		break;
+
+	case RIO_EISA:
+				/*
+				** EISA is totally different and expects OUTBZs to turn it on.
+				*/
+		rio_dprintk (RIO_DEBUG_BOOT, "Start EISA card running\n");
+		OUTBZ( HostP->Slot, EISA_CONTROL_PORT, HostP->Mode | RIOEisaVec2Ctrl[HostP->Ivec] | EISA_TP_RUN | EISA_TP_BUS_ENABLE | EISA_TP_BOOT_FROM_RAM );
+		break;
+#endif
+
+	case RIO_PCI:
+				/*
+				** PCI is much the same as MCA. Everything is once again memory
+				** mapped, so we are writing to memory registers instead of io
+				** ports.
+				*/
+		rio_dprintk (RIO_DEBUG_BOOT, "Start PCI card running\n");
+		WBYTE(HostP->Control, PCITpBootFromRam | PCITpBusEnable | HostP->Mode);
+		break;
+	default:
+		rio_dprintk (RIO_DEBUG_BOOT, "Unknown host type %d\n", HostP->Type);
+		break;
+	}
+/* 
+	printk (KERN_INFO "Done with starting the card\n");
+	func_exit ();
+*/
+	return;
+}
 
 /*
 ** Load in the host boot code - load it directly onto all halted hosts
@@ -205,11 +260,15 @@
 
 	HostP = NULL; /* Assure the compiler we've initialized it */
 	for ( host=0; host<p->RIONumHosts; host++ ) {
-		rio_dprint(RIO_DEBUG_BOOT, ("Attempt to boot host %d\n",host));
+		rio_dprintk (RIO_DEBUG_BOOT, "Attempt to boot host %d\n",host);
 		HostP = &p->RIOHosts[host];
+		
+		rio_dprintk (RIO_DEBUG_BOOT,  "Host Type = 0x%x, Mode = 0x%x, IVec = 0x%x\n",
+		    HostP->Type, HostP->Mode, HostP->Ivec);
+
 
 		if ( (HostP->Flags & RUN_STATE) != RC_WAITING ) {
-			rio_dprint(RIO_DEBUG_BOOT, ("%s %d already running\n","Host",host));
+			rio_dprintk (RIO_DEBUG_BOOT, "%s %d already running\n","Host",host);
 			continue;
 		}
 
@@ -226,14 +285,15 @@
 		*/
 		StartP = (caddr_t)&Cad[p->RIOConf.HostLoadBase-rbp->Count];
 
-		rio_dprint(RIO_DEBUG_BOOT,  ("kernel virtual address for host is 0x%x\n", (int)Cad ) );
-		rio_dprint(RIO_DEBUG_BOOT,  ("kernel virtual address for download is 0x%x\n", (int)StartP ) );
-		rio_dprint(RIO_DEBUG_BOOT, ("host loadbase is 0x%x\n",p->RIOConf.HostLoadBase));
-		rio_dprint(RIO_DEBUG_BOOT,  ("size of download is 0x%x\n", rbp->Count ) );
+		rio_dprintk (RIO_DEBUG_BOOT, "kernel virtual address for host is 0x%x\n", (int)Cad );
+		rio_dprintk (RIO_DEBUG_BOOT, "kernel virtual address for download is 0x%x\n", (int)StartP);
+		rio_dprintk (RIO_DEBUG_BOOT, "host loadbase is 0x%x\n",p->RIOConf.HostLoadBase);
+		rio_dprintk (RIO_DEBUG_BOOT, "size of download is 0x%x\n", rbp->Count);
 
 		if ( p->RIOConf.HostLoadBase < rbp->Count ) {
-			rio_dprint(RIO_DEBUG_BOOT, ("Bin too large\n"));
+			rio_dprintk (RIO_DEBUG_BOOT, "Bin too large\n");
 			p->RIOError.Error = HOST_FILE_TOO_LARGE;
+			func_exit ();
 			return EFBIG;
 		}
 		/*
@@ -247,7 +307,7 @@
 		** This ain't going to be none too clever if the download
 		** code is bigger than this segment.
 		*/
-		rio_dprint(RIO_DEBUG_BOOT, ("Copy in code\n"));
+		rio_dprintk (RIO_DEBUG_BOOT, "Copy in code\n");
 
 		/*
 		** PCI hostcard can't cope with 32 bit accesses and so need to copy 
@@ -258,15 +318,17 @@
 
 			DownCode = sysbrk(rbp->Count);
 			if ( !DownCode ) {
-				rio_dprint(RIO_DEBUG_BOOT, ("No system memory available\n"));
+				rio_dprintk (RIO_DEBUG_BOOT, "No system memory available\n");
 				p->RIOError.Error = NOT_ENOUGH_CORE_FOR_PCI_COPY;
+				func_exit ();
 				return ENOMEM;
 			}
 			bzero(DownCode, rbp->Count);
 
 			if ( copyin((int)rbp->DataP,DownCode,rbp->Count)==COPYFAIL ) {
-				rio_dprint(RIO_DEBUG_BOOT, ("Bad copyin of host data\n"));
+				rio_dprintk (RIO_DEBUG_BOOT, "Bad copyin of host data\n");
 				p->RIOError.Error = COPYIN_FAILED;
+				func_exit ();
 				return EFAULT;
 			}
 
@@ -275,12 +337,13 @@
 			sysfree( DownCode, rbp->Count );
 		}
 		else if ( copyin((int)rbp->DataP,StartP,rbp->Count)==COPYFAIL ) {
-			rio_dprint(RIO_DEBUG_BOOT, ("Bad copyin of host data\n"));
+			rio_dprintk (RIO_DEBUG_BOOT, "Bad copyin of host data\n");
 			p->RIOError.Error = COPYIN_FAILED;
+			func_exit ();
 			return EFAULT;
 		}
 
-		rio_dprint(RIO_DEBUG_BOOT, ("Copy completed\n"));
+		rio_dprintk (RIO_DEBUG_BOOT, "Copy completed\n");
 
 		/*
 		**			S T O P !
@@ -381,8 +444,8 @@
 		WBYTE( DestP[6] , NFIX(0) );
 		WBYTE( DestP[7] , JUMP(8) );
 
-		rio_dprint(RIO_DEBUG_BOOT, ("host loadbase is 0x%x\n",p->RIOConf.HostLoadBase));
-		rio_dprint(RIO_DEBUG_BOOT, ("startup offset is 0x%x\n",offset));
+		rio_dprintk (RIO_DEBUG_BOOT, "host loadbase is 0x%x\n",p->RIOConf.HostLoadBase);
+		rio_dprintk (RIO_DEBUG_BOOT, "startup offset is 0x%x\n",offset);
 
 		/*
 		** Flag what is going on
@@ -396,67 +459,29 @@
 		*/
 		OldParmMap = RWORD(HostP->__ParmMapR);
 
-		rio_dprint(RIO_DEBUG_BOOT, ("Original parmmap is 0x%x\n",OldParmMap));
+		rio_dprintk (RIO_DEBUG_BOOT, "Original parmmap is 0x%x\n",OldParmMap);
 
 		/*
 		** And start it running (I hope).
 		** As there is nothing dodgy or obscure about the
 		** above code, this is guaranteed to work every time.
 		*/
-		rio_dprint(RIO_DEBUG_BOOT,  ("Host Type = 0x%x, Mode = 0x%x, IVec = 0x%x\n",
-		    HostP->Type, HostP->Mode, HostP->Ivec ) );
-
-		switch ( HostP->Type ) {
-			case RIO_AT:
-				rio_dprint(RIO_DEBUG_BOOT, ("Start ISA card running\n"));
-				WBYTE(HostP->Control, 
-					BOOT_FROM_RAM | EXTERNAL_BUS_ON
-					| HostP->Mode
-					| RIOAtVec2Ctrl[HostP->Ivec & 0xF] );
-				break;
-
-#ifdef FUTURE_RELEASE
-			case RIO_MCA:
-				/*
-				** MCA handles IRQ vectors differently, so we don't write 
-				** them to this register.
-				*/
-				rio_dprint(RIO_DEBUG_BOOT, ("Start MCA card running\n"));
-				WBYTE(HostP->Control, McaTpBootFromRam | McaTpBusEnable | HostP->Mode);
-				break;
+		rio_dprintk (RIO_DEBUG_BOOT,  "Host Type = 0x%x, Mode = 0x%x, IVec = 0x%x\n",
+		    HostP->Type, HostP->Mode, HostP->Ivec);
 
-			case RIO_EISA:
-				/*
-				** EISA is totally different and expects OUTBZs to turn it on.
-				*/
-				rio_dprint(RIO_DEBUG_BOOT, NULL,DBG_DAEMON,"Start EISA card running\n");
-				OUTBZ( HostP->Slot, EISA_CONTROL_PORT, HostP->Mode | RIOEisaVec2Ctrl[HostP->Ivec] | EISA_TP_RUN | EISA_TP_BUS_ENABLE | EISA_TP_BOOT_FROM_RAM );
-				break;
-#endif
+		rio_start_card_running(HostP);
 
-			case RIO_PCI:
-				/*
-				** PCI is much the same as MCA. Everything is once again memory
-				** mapped, so we are writing to memory registers instead of io
-				** ports.
-				*/
-				rio_dprint(RIO_DEBUG_BOOT, ("Start PCI card running\n"));
-				WBYTE(HostP->Control, PCITpBootFromRam | PCITpBusEnable | HostP->Mode);
-				break;
-			default:
-				rio_dprint(RIO_DEBUG_BOOT, ("Unknown host type %d\n",HostP->Type));
-				break;
-		}
-		rio_dprint(RIO_DEBUG_BOOT, ("Set control port\n"));
+		rio_dprintk (RIO_DEBUG_BOOT, "Set control port\n");
 
 		/*
 		** Now, wait for upto five seconds for the Tp to setup the parmmap
 		** pointer:
 		*/
 		for ( wait_count=0; (wait_count<p->RIOConf.StartupTime)&&
-				(RWORD(HostP->__ParmMapR)==OldParmMap); wait_count++ ) {
-			rio_dprint(RIO_DEBUG_BOOT, ("Checkout %d, 0x%x\n",wait_count,RWORD(HostP->__ParmMapR)));
+			(RWORD(HostP->__ParmMapR)==OldParmMap); wait_count++ ) {
+			rio_dprintk (RIO_DEBUG_BOOT, "Checkout %d, 0x%x\n",wait_count,RWORD(HostP->__ParmMapR));
 			delay(HostP, HUNDRED_MS);
+
 		}
 
 		/*
@@ -464,8 +489,8 @@
 		** has crashed & burned in a really spectacular way
 		*/
 		if ( RWORD(HostP->__ParmMapR) == OldParmMap ) {
-			rio_dprint(RIO_DEBUG_BOOT, ("parmmap 0x%x\n", RWORD(HostP->__ParmMapR)));
-			rio_dprint(RIO_DEBUG_BOOT, ("RIO Mesg Run Fail\n"));
+			rio_dprintk (RIO_DEBUG_BOOT, "parmmap 0x%x\n", RWORD(HostP->__ParmMapR));
+			rio_dprintk (RIO_DEBUG_BOOT, "RIO Mesg Run Fail\n");
 
 #define	HOST_DISABLE \
 		HostP->Flags &= ~RUN_STATE; \
@@ -476,7 +501,7 @@
 			HOST_DISABLE;
 		}
 
-		rio_dprint(RIO_DEBUG_BOOT, ("Running 0x%x\n",RWORD(HostP->__ParmMapR)));
+		rio_dprintk (RIO_DEBUG_BOOT, "Running 0x%x\n", RWORD(HostP->__ParmMapR));
 
 		/*
 		** Well, the board thought it was OK, and setup its parmmap
@@ -488,10 +513,10 @@
 		** Grab a 32 bit pointer to the parmmap structure
 		*/
 		ParmMapP = (PARM_MAP *)RIO_PTR(Cad,RWORD(HostP->__ParmMapR));
-		rio_dprint(RIO_DEBUG_BOOT, ("ParmMapP : %x\n", (int)ParmMapP));
+		rio_dprintk (RIO_DEBUG_BOOT, "ParmMapP : %x\n", (int)ParmMapP);
 		ParmMapP = (PARM_MAP *)((unsigned long)Cad + 
 						(unsigned long)((RWORD((HostP->__ParmMapR))) & 0xFFFF)); 
-		rio_dprint(RIO_DEBUG_BOOT, ("ParmMapP : %x\n", (int)ParmMapP));
+		rio_dprintk (RIO_DEBUG_BOOT, "ParmMapP : %x\n", (int)ParmMapP);
 
 		/*
 		** The links entry should be 0xFFFF; we set it up
@@ -499,8 +524,8 @@
 		** which links to use.
 		*/
 		if ( (RWORD(ParmMapP->links) & 0xFFFF) != 0xFFFF ) {
-			rio_dprint(RIO_DEBUG_BOOT, ("RIO Mesg Run Fail %s\n", HostP->Name));
-			rio_dprint(RIO_DEBUG_BOOT, ("Links = 0x%x\n",RWORD(ParmMapP->links)));
+			rio_dprintk (RIO_DEBUG_BOOT, "RIO Mesg Run Fail %s\n", HostP->Name);
+			rio_dprintk (RIO_DEBUG_BOOT, "Links = 0x%x\n",RWORD(ParmMapP->links));
 			HOST_DISABLE;
 		}
 
@@ -510,28 +535,28 @@
 		** now wait for the card to set all the parmmap->XXX stuff
 		** this is a wait of upto two seconds....
 		*/
-		rio_dprint(RIO_DEBUG_BOOT, ("Looking for init_done - %d ticks\n",p->RIOConf.StartupTime));
+		rio_dprintk (RIO_DEBUG_BOOT, "Looking for init_done - %d ticks\n",p->RIOConf.StartupTime);
 		HostP->timeout_id = 0;
 		for ( wait_count=0; (wait_count<p->RIOConf.StartupTime) && 
 						!RWORD(ParmMapP->init_done); wait_count++ ) {
-			rio_dprint(RIO_DEBUG_BOOT, ("Waiting for init_done\n"));
+			rio_dprintk (RIO_DEBUG_BOOT, "Waiting for init_done\n");
 			delay(HostP, HUNDRED_MS);
 		}
-		rio_dprint(RIO_DEBUG_BOOT, ("OK! init_done!\n"));
+		rio_dprintk (RIO_DEBUG_BOOT, "OK! init_done!\n");
 
 		if (RWORD(ParmMapP->error) != E_NO_ERROR || 
 							!RWORD(ParmMapP->init_done) ) {
-			rio_dprint(RIO_DEBUG_BOOT, ("RIO Mesg Run Fail %s\n", HostP->Name));
-			rio_dprint(RIO_DEBUG_BOOT, ("Timedout waiting for init_done\n"));
+			rio_dprintk (RIO_DEBUG_BOOT, "RIO Mesg Run Fail %s\n", HostP->Name);
+			rio_dprintk (RIO_DEBUG_BOOT, "Timedout waiting for init_done\n");
 			HOST_DISABLE;
 		}
 
-		rio_dprint(RIO_DEBUG_BOOT, ("Got init_done\n"));
+		rio_dprintk (RIO_DEBUG_BOOT, "Got init_done\n");
 
 		/*
 		** It runs! It runs!
 		*/
-		rio_dprint(RIO_DEBUG_BOOT, ("Host ID %x Running\n",HostP->UniqueNum));
+		rio_dprintk (RIO_DEBUG_BOOT, "Host ID %x Running\n",HostP->UniqueNum);
 
 		/*
 		** set the time period between interrupts.
@@ -555,12 +580,14 @@
 			HostP->UnixRups[RupN].RupP		= &HostP->RupP[RupN];
 			HostP->UnixRups[RupN].Id		  = RupN+1;
 			HostP->UnixRups[RupN].BaseSysPort = NO_PORT;
+			HostP->UnixRups[RupN].RupLock = SPIN_LOCK_UNLOCKED;
 		}
 
 		for ( RupN = 0; RupN<LINKS_PER_UNIT; RupN++ ) {
 			HostP->UnixRups[RupN+MAX_RUP].RupP	= &HostP->LinkStrP[RupN].rup;
 			HostP->UnixRups[RupN+MAX_RUP].Id  = 0;
 			HostP->UnixRups[RupN+MAX_RUP].BaseSysPort = NO_PORT;
+			HostP->UnixRups[RupN+MAX_RUP].RupLock = SPIN_LOCK_UNLOCKED;
 		}
 
 		/*
@@ -597,7 +624,7 @@
 			}
 		}
 
-		rio_dprint(RIO_DEBUG_BOOT, ("Set the card running... \n"));
+		rio_dprintk (RIO_DEBUG_BOOT, "Set the card running... \n");
 		/*
 		** last thing - show the world that everything is in place
 		*/
@@ -613,7 +640,8 @@
 
 	p->RIOSystemUp++;
 	
-	rio_dprint(RIO_DEBUG_BOOT, ("Done everything %x\n", HostP->Ivec));
+	rio_dprintk (RIO_DEBUG_BOOT, "Done everything %x\n", HostP->Ivec);
+	func_exit ();
 	return 0;
 }
 
@@ -646,7 +674,7 @@
 	** If we haven't been told what to boot, we can't boot it.
 	*/
 	if ( p->RIONumBootPkts == 0 ) {
-		rio_dprint(RIO_DEBUG_BOOT, ("No RTA code to download yet\n"));
+		rio_dprintk (RIO_DEBUG_BOOT, "No RTA code to download yet\n");
 		return 0;
 	}
 
@@ -667,7 +695,7 @@
 	** try to unhook a command block from the command free list.
 	*/
 	if ( !(CmdBlkP = RIOGetCmdBlk()) ) {
-		rio_dprint(RIO_DEBUG_BOOT, ("No command blocks to boot RTA! come back later.\n"));
+		rio_dprintk (RIO_DEBUG_BOOT, "No command blocks to boot RTA! come back later.\n");
 		return 0;
 	}
 
@@ -690,8 +718,8 @@
 		** We only expect one type of command - a BOOT_REQUEST!
 		*/
 		if ( RBYTE(PktCmdP->Command) != BOOT_REQUEST ) {
-			rio_dprint(RIO_DEBUG_BOOT, ("Unexpected command %d on BOOT RUP %d of host %d\n", 
-						PktCmdP->Command,Rup,HostP-p->RIOHosts));
+			rio_dprintk (RIO_DEBUG_BOOT, "Unexpected command %d on BOOT RUP %d of host %d\n", 
+						PktCmdP->Command,Rup,HostP-p->RIOHosts);
 			ShowPacket( DBG_BOOT, PacketP );
 			RIOFreeCmdBlk( CmdBlkP );
 			return 1;
@@ -728,9 +756,9 @@
 
 		bcopy("BOOT",(void *)&CmdBlkP->Packet.data[BOOT_SEQUENCE_LEN],4);
 
-		rio_dprint(RIO_DEBUG_BOOT, ("Boot RTA on Host %d Rup %d - %d (0x%x) packets to 0x%x\n",
+		rio_dprintk (RIO_DEBUG_BOOT, "Boot RTA on Host %d Rup %d - %d (0x%x) packets to 0x%x\n",
 			HostP-p->RIOHosts, Rup, p->RIONumBootPkts, p->RIONumBootPkts, 
-								p->RIOConf.RtaLoadBase));
+								p->RIOConf.RtaLoadBase);
 
 		/*
 		** If this host is in slave mode, send the RTA an invalid boot
@@ -749,11 +777,11 @@
 	*/
 	sequence = RWORD(PktCmdP->Sequence);
 
-	rio_dprint(RIO_DEBUG_BOOT, ("Boot block %d on Host %d Rup%d\n",sequence,HostP-p->RIOHosts,Rup));
+	rio_dprintk (RIO_DEBUG_BOOT, "Boot block %d on Host %d Rup%d\n",sequence,HostP-p->RIOHosts,Rup);
 
 	if ( sequence >= p->RIONumBootPkts ) {
-		rio_dprint(RIO_DEBUG_BOOT, ("Got a request for packet %d, max is %d\n", sequence, 
-					p->RIONumBootPkts));
+		rio_dprintk (RIO_DEBUG_BOOT, "Got a request for packet %d, max is %d\n", sequence, 
+					p->RIONumBootPkts);
 		ShowPacket( DBG_BOOT, PacketP );
 	}
 
@@ -795,26 +823,26 @@
 	   driver will never think that the RTA has booted... -- REW */
 	p->RIOBooting = 0;
 
-	rio_dprint(RIO_DEBUG_BOOT, ("RTA Boot completed - BootInProgress now %d\n", p->RIOBooting));
+	rio_dprintk (RIO_DEBUG_BOOT, "RTA Boot completed - BootInProgress now %d\n", p->RIOBooting);
 
 	/*
 	** Determine type of unit (16/8 port RTA).
 	*/
 	RtaType = GetUnitType(RtaUniq);
         if ( Rup >= (ushort)MAX_RUP ) {
-	    rio_dprint(RIO_DEBUG_BOOT, ("RIO: Host %s has booted an RTA(%d) on link %c\n",
-	     HostP->Name, 8 * RtaType, RBYTE(PktCmdP->LinkNum)+'A' ));
+	    rio_dprintk (RIO_DEBUG_BOOT, "RIO: Host %s has booted an RTA(%d) on link %c\n",
+	     HostP->Name, 8 * RtaType, RBYTE(PktCmdP->LinkNum)+'A');
 	} else {
-	    rio_dprint(RIO_DEBUG_BOOT, ("RIO: RTA %s has booted an RTA(%d) on link %c\n",
+	    rio_dprintk (RIO_DEBUG_BOOT, "RIO: RTA %s has booted an RTA(%d) on link %c\n",
 	     HostP->Mapping[Rup].Name, 8 * RtaType,
-	     RBYTE(PktCmdP->LinkNum)+'A'));
+	     RBYTE(PktCmdP->LinkNum)+'A');
 	}
 
-	rio_dprint(RIO_DEBUG_BOOT, ("UniqNum is 0x%x\n",RtaUniq));
+	rio_dprintk (RIO_DEBUG_BOOT, "UniqNum is 0x%x\n",RtaUniq);
 
         if ( ( RtaUniq == 0x00000000 ) || ( RtaUniq == 0xffffffff ) )
 	{
-	    rio_dprint(RIO_DEBUG_BOOT, ( "Illegal RTA Uniq Number\n"));
+	    rio_dprintk (RIO_DEBUG_BOOT, "Illegal RTA Uniq Number\n");
 	    return TRUE;
 	}
 
@@ -835,8 +863,8 @@
 		*/
 		if (RIOSuspendBootRta(HostP, HostP->Mapping[Rup].ID, MyLink))
 		{
-		    rio_dprint(RIO_DEBUG_BOOT, ("RTA failed to suspend booting on link %c\n",
-		     'A' + MyLink));
+		    rio_dprintk (RIO_DEBUG_BOOT, "RTA failed to suspend booting on link %c\n",
+		     'A' + MyLink);
 		}
 	    }
 	    else
@@ -848,8 +876,8 @@
 		*/
 		WWORD(HostP->LinkStrP[MyLink].WaitNoBoot, 30);
 	    }
-	    rio_dprint(RIO_DEBUG_BOOT, ("RTA %x not owned - suspend booting down link %c on unit %x\n",
-	      RtaUniq, 'A' + MyLink, HostP->Mapping[Rup].RtaUniqueNum));
+	    rio_dprintk (RIO_DEBUG_BOOT, "RTA %x not owned - suspend booting down link %c on unit %x\n",
+	      RtaUniq, 'A' + MyLink, HostP->Mapping[Rup].RtaUniqueNum);
 	    return TRUE;
 	}
 
@@ -899,16 +927,16 @@
 		   }
 		}
 		if (RtaType == TYPE_RTA16) {
-		   rio_dprint(RIO_DEBUG_BOOT, ("RTA will be given IDs %d+%d\n",
-		    entry+1, entry2+1));
+		   rio_dprintk (RIO_DEBUG_BOOT, "RTA will be given IDs %d+%d\n",
+		    entry+1, entry2+1);
 		} else {
-		   rio_dprint(RIO_DEBUG_BOOT, ("RTA will be given ID %d\n",entry+1));
+		   rio_dprintk (RIO_DEBUG_BOOT, "RTA will be given ID %d\n",entry+1);
 		}
 		return TRUE;
 	    }
 	}
 
-	rio_dprint(RIO_DEBUG_BOOT, ("RTA not configured for this host\n"));
+	rio_dprintk (RIO_DEBUG_BOOT, "RTA not configured for this host\n");
 
 	if ( Rup >= (ushort)MAX_RUP )
 	{
@@ -952,13 +980,13 @@
 		    entry2 = HostP->Mapping[entry].ID2 - 1;
 		    if ( (HostP->Mapping[entry2].Flags & SLOT_TENTATIVE) &&
 			 (HostP->Mapping[entry2].RtaUniqueNum == RtaUniq) )
-			rio_dprint(RIO_DEBUG_BOOT, ("Found previous tentative slots (%d+%d)\n",
-			 entry, entry2));
+			rio_dprintk (RIO_DEBUG_BOOT, "Found previous tentative slots (%d+%d)\n",
+			 entry, entry2);
 		    else
 			continue;
 		}
 		else
-			rio_dprint(RIO_DEBUG_BOOT, ("Found previous tentative slot (%d)\n",entry));
+			rio_dprintk (RIO_DEBUG_BOOT, "Found previous tentative slot (%d)\n",entry);
 		if (! p->RIONoMessage)
 		    cprintf("RTA connected to %s '%s' (%c) not configured.\n",MyType,MyName,MyLink+'A');
 		return TRUE;
@@ -987,7 +1015,7 @@
 	** + Configure RTA on host A. We now have the same RTA configured
 	**   with different ports on two different hosts.
 	*/
-	rio_dprint(RIO_DEBUG_BOOT, ("Have we seen RTA %x before?\n", RtaUniq ));
+	rio_dprintk (RIO_DEBUG_BOOT, "Have we seen RTA %x before?\n", RtaUniq );
 	found = 0;
 	Flag = 0; /* Convince the compiler this variable is initialized */
 	for ( host = 0; !found && (host < p->RIONumHosts); host++ )
@@ -1003,12 +1031,12 @@
 		    if (RtaType == TYPE_RTA16)
 		    {
 			MapP2 = &p->RIOHosts[host].Mapping[MapP->ID2 - 1];
-			rio_dprint(RIO_DEBUG_BOOT, ("This RTA is units %d+%d from host %s\n",
-			 rta+1, MapP->ID2, p->RIOHosts[host].Name ));
+			rio_dprintk (RIO_DEBUG_BOOT, "This RTA is units %d+%d from host %s\n",
+			 rta+1, MapP->ID2, p->RIOHosts[host].Name);
 		    }
 		    else
-			rio_dprint(RIO_DEBUG_BOOT, ("This RTA is unit %d from host %s\n",
-			 rta+1, p->RIOHosts[host].Name ));
+			rio_dprintk (RIO_DEBUG_BOOT, "This RTA is unit %d from host %s\n",
+			 rta+1, p->RIOHosts[host].Name);
 		    found = 1;
 		    break;
 		}
@@ -1026,12 +1054,12 @@
 	*/
 	if ( !MapP )
 	{
-	    rio_dprint(RIO_DEBUG_BOOT, ("Look for RTA %x in RIOSavedTable\n",RtaUniq));
+	    rio_dprintk (RIO_DEBUG_BOOT, "Look for RTA %x in RIOSavedTable\n",RtaUniq);
 	    for ( rta=0; rta < TOTAL_MAP_ENTRIES; rta++ )
 	    {
-		rio_dprint(RIO_DEBUG_BOOT, ("Check table entry %d (%x)",
+		rio_dprintk (RIO_DEBUG_BOOT, "Check table entry %d (%x)",
 		      rta,
-		      p->RIOSavedTable[rta].RtaUniqueNum ));
+		      p->RIOSavedTable[rta].RtaUniqueNum);
 
 		if ( (p->RIOSavedTable[rta].Flags & SLOT_IN_USE) &&
 		 (p->RIOSavedTable[rta].RtaUniqueNum == RtaUniq) )
@@ -1047,11 +1075,11 @@
                                 break;
                         }
                         MapP2 = &p->RIOSavedTable[entry2];
-                        rio_dprint(RIO_DEBUG_BOOT, ("This RTA is from table entries %d+%d\n",
-                              rta, entry2));
+                        rio_dprintk (RIO_DEBUG_BOOT, "This RTA is from table entries %d+%d\n",
+                              rta, entry2);
 		    }
 		    else
-			rio_dprint(RIO_DEBUG_BOOT, ("This RTA is from table entry %d\n", rta));
+			rio_dprintk (RIO_DEBUG_BOOT, "This RTA is from table entry %d\n", rta);
 		    break;
 		}
 	    }
@@ -1107,8 +1135,8 @@
 	    {
 		if (Flag & SLOT_IN_USE)
 		{
-		    rio_dprint(RIO_DEBUG_BOOT, (
-    "This RTA configured on another host - move entry to current host (1)\n"));
+		    rio_dprintk (RIO_DEBUG_BOOT, 
+    "This RTA configured on another host - move entry to current host (1)\n");
 		    HostP->Mapping[entry].SysPort = MapP->SysPort;
 		    CCOPY( MapP->Name, HostP->Mapping[entry].Name, MAX_NAME_LEN );
 		    HostP->Mapping[entry].Flags =
@@ -1121,12 +1149,12 @@
 			p->RIOFirstPortsBooted = HostP->Mapping[entry].SysPort;
 		    if ( HostP->Mapping[entry].SysPort > p->RIOLastPortsBooted )
 			p->RIOLastPortsBooted = HostP->Mapping[entry].SysPort;
-		    rio_dprint(RIO_DEBUG_BOOT, ("SysPort %d, Name %s\n",(int)MapP->SysPort,MapP->Name));
+		    rio_dprintk (RIO_DEBUG_BOOT, "SysPort %d, Name %s\n",(int)MapP->SysPort,MapP->Name);
 		}
 		else
 		{
-		    rio_dprint(RIO_DEBUG_BOOT, (
-   "This RTA has a tentative entry on another host - delete that entry (1)\n"));
+		    rio_dprintk (RIO_DEBUG_BOOT, 
+   "This RTA has a tentative entry on another host - delete that entry (1)\n");
 		    HostP->Mapping[entry].Flags =
 		     SLOT_TENTATIVE | RTA_BOOTED | RTA_NEWBOOT;
 #if NEED_TO_FIX
@@ -1151,9 +1179,9 @@
 			 p->RIOFirstPortsBooted = HostP->Mapping[entry2].SysPort;
 		       if (HostP->Mapping[entry2].SysPort > p->RIOLastPortsBooted)
 			 p->RIOLastPortsBooted = HostP->Mapping[entry2].SysPort;
-			rio_dprint(RIO_DEBUG_BOOT, ("SysPort %d, Name %s\n",
+			rio_dprintk (RIO_DEBUG_BOOT, "SysPort %d, Name %s\n",
 			       (int)HostP->Mapping[entry2].SysPort,
-			       HostP->Mapping[entry].Name));
+			       HostP->Mapping[entry].Name);
 		    }
 		    else
 			HostP->Mapping[entry2].Flags = SLOT_TENTATIVE |
@@ -1246,7 +1274,7 @@
 {
 	int		link;
 
-	rio_dprint(RIO_DEBUG_BOOT, ("FillSlot(%d, %d, 0x%x...)\n", entry, entry2, RtaUniq));
+	rio_dprintk (RIO_DEBUG_BOOT, "FillSlot(%d, %d, 0x%x...)\n", entry, entry2, RtaUniq);
 
 	HostP->Mapping[entry].Flags = (RTA_BOOTED | RTA_NEWBOOT | SLOT_TENTATIVE);
 	HostP->Mapping[entry].SysPort = NO_PORT;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)