linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / drivers / char / rio / rioboot.c
index f4a5910..92df435 100644 (file)
@@ -80,6 +80,8 @@ static char *_rioboot_c_sccs_ = "@(#)rioboot.c        1.3";
 #include "cmdblk.h"
 #include "route.h"
 
+static int RIOBootComplete( struct rio_info *p, struct Host *HostP, uint Rup, struct PktCmd *PktCmdP );
+
 static uchar
 RIOAtVec2Ctrl[] =
 {
@@ -580,14 +582,14 @@ register struct DownLoad *rbp;
                        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;
+                       spin_lock_init(&HostP->UnixRups[RupN].RupLock);
                }
 
                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;
+                       spin_lock_init(&HostP->UnixRups[RupN+MAX_RUP].RupLock);
                }
 
                /*
@@ -663,13 +665,6 @@ struct PKT *PacketP;
        struct CmdBlk *CmdBlkP;
        uint sequence;
 
-#ifdef CHECK
-       CheckHost(Host);
-       CheckRup(Rup);
-       CheckHostP(HostP);
-       CheckPacketP(PacketP);
-#endif
-
        /*
        ** If we haven't been told what to boot, we can't boot it.
        */
@@ -802,7 +797,7 @@ struct PKT *PacketP;
 ** If booted by an RTA, HostP->Mapping[Rup].RtaUniqueNum is the booting RTA.
 ** RtaUniq is the booted RTA.
 */
-int RIOBootComplete( struct rio_info *p, struct Host *HostP, uint Rup, struct PktCmd *PktCmdP )
+static int RIOBootComplete( struct rio_info *p, struct Host *HostP, uint Rup, struct PktCmd *PktCmdP )
 {
        struct Map      *MapP = NULL;
        struct Map      *MapP2 = NULL;
@@ -900,7 +895,7 @@ int RIOBootComplete( struct rio_info *p, struct Host *HostP, uint Rup, struct Pk
               (HostP->Mapping[entry].RtaUniqueNum==RtaUniq))
            {
                HostP->Mapping[entry].Flags |= RTA_BOOTED|RTA_NEWBOOT;
-#if NEED_TO_FIX
+#ifdef NEED_TO_FIX
                RIO_SV_BROADCAST(HostP->svFlags[entry]);
 #endif
                if ( (sysport=HostP->Mapping[entry].SysPort) != NO_PORT )
@@ -916,7 +911,7 @@ int RIOBootComplete( struct rio_info *p, struct Host *HostP, uint Rup, struct Pk
                   {
                        entry2 = HostP->Mapping[entry].ID2 - 1;
                        HostP->Mapping[entry2].Flags |= RTA_BOOTED|RTA_NEWBOOT;
-#if NEED_TO_FIX
+#ifdef NEED_TO_FIX
                        RIO_SV_BROADCAST(HostP->svFlags[entry2]);
 #endif
                        sysport = HostP->Mapping[entry2].SysPort;
@@ -954,11 +949,6 @@ int RIOBootComplete( struct rio_info *p, struct Host *HostP, uint Rup, struct Pk
            MyType = "RTA";
            MyName = HostP->Mapping[Rup].Name;
        }
-#ifdef CHECK
-       CheckString(MyType);
-       CheckString(MyName);
-#endif
-
        MyLink = RBYTE(PktCmdP->LinkNum);
 
        /*
@@ -1141,7 +1131,7 @@ int RIOBootComplete( struct rio_info *p, struct Host *HostP, uint Rup, struct Pk
                    CCOPY( MapP->Name, HostP->Mapping[entry].Name, MAX_NAME_LEN );
                    HostP->Mapping[entry].Flags =
                     SLOT_IN_USE | RTA_BOOTED | RTA_NEWBOOT;
-#if NEED_TO_FIX
+#ifdef NEED_TO_FIX
                    RIO_SV_BROADCAST(HostP->svFlags[entry]);
 #endif
                    RIOReMapPorts( p, HostP, &HostP->Mapping[entry] );
@@ -1157,7 +1147,7 @@ int RIOBootComplete( struct rio_info *p, struct Host *HostP, uint Rup, struct Pk
    "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
+#ifdef NEED_TO_FIX
                    RIO_SV_BROADCAST(HostP->svFlags[entry]);
 #endif
                }
@@ -1167,7 +1157,7 @@ int RIOBootComplete( struct rio_info *p, struct Host *HostP, uint Rup, struct Pk
                    {
                        HostP->Mapping[entry2].Flags = SLOT_IN_USE |
                         RTA_BOOTED | RTA_NEWBOOT | RTA16_SECOND_SLOT;
-#if NEED_TO_FIX
+#ifdef NEED_TO_FIX
                        RIO_SV_BROADCAST(HostP->svFlags[entry2]);
 #endif
                        HostP->Mapping[entry2].SysPort = MapP2->SysPort;
@@ -1186,7 +1176,7 @@ int RIOBootComplete( struct rio_info *p, struct Host *HostP, uint Rup, struct Pk
                    else
                        HostP->Mapping[entry2].Flags = SLOT_TENTATIVE |
                         RTA_BOOTED | RTA_NEWBOOT | RTA16_SECOND_SLOT;
-#if NEED_TO_FIX
+#ifdef NEED_TO_FIX
                        RIO_SV_BROADCAST(HostP->svFlags[entry2]);
 #endif
                    bzero( (caddr_t)MapP2, sizeof(struct Map) );
@@ -1307,52 +1297,3 @@ struct Host *HostP;
        }
 }
 
-#if 0
-/*
-       Function:       This function is to disable the disk interrupt 
-    Returns :   Nothing
-*/
-void
-disable_interrupt(vector)
-int    vector;
-{
-       int     ps;
-       int     val;
-
-       disable(ps);
-       if (vector > 40)  {
-               val = 1 << (vector - 40);
-               __outb(S8259+1, __inb(S8259+1) | val);
-       }
-       else {
-               val = 1 << (vector - 32);
-               __outb(M8259+1, __inb(M8259+1) | val);
-       }
-       restore(ps);
-}
-
-/*
-       Function:       This function is to enable the disk interrupt 
-    Returns :   Nothing
-*/
-void
-enable_interrupt(vector)
-int    vector;
-{
-       int     ps;
-       int     val;
-
-       disable(ps);
-       if (vector > 40)  {
-               val = 1 << (vector - 40);
-               val = ~val;
-               __outb(S8259+1, __inb(S8259+1) & val);
-       }
-       else {
-               val = 1 << (vector - 32);
-               val = ~val;
-               __outb(M8259+1, __inb(M8259+1) & val);
-       }
-       restore(ps);
-}
-#endif