]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/netat/adsp_Timer.c
xnu-1228.15.4.tar.gz
[apple/xnu.git] / bsd / netat / adsp_Timer.c
index f849093606253729785a172caf8b79a4ad3bf407..455ab5e33c52424333fd9da0999e816e051c89de 100644 (file)
@@ -1,16 +1,19 @@
 /*
  * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
  *
- * @APPLE_LICENSE_HEADER_START@
- * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this
- * file.
+ * compliance with the License. The rights granted to you under the License
+ * may not be used to create, or enable the creation or redistribution of,
+ * unlawful or unlicensed copies of an Apple operating system, or to
+ * circumvent, violate, or enable the circumvention or violation of, any
+ * terms of an Apple operating system software license agreement.
+ * 
+ * Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
  * 
  * The Original Code and all software distributed under the License are
  * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
@@ -20,7 +23,7 @@
  * Please see the License for the specific language governing rights and
  * limitations under the License.
  * 
- * @APPLE_LICENSE_HEADER_END@
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
  */
 /*
  *     Copyright (c) 1990, 1996-1998 Apple Computer, Inc.
 #include <sys/socket.h>
 #include <sys/time.h>
 
+#include <net/if.h>
+
 #include <netat/sysglue.h>
 #include <netat/appletalk.h>
 #include <netat/at_pcb.h>
+#include <netat/at_var.h>
 #include <netat/debug.h>
 #include <netat/adsp.h>
 #include <netat/adsp_internal.h>
 
+
 /*
  * TrashSession
  * 
  * OUTPUTS:
  *             none
  */
+void TrashSession(CCBPtr);
+
 void TrashSession(sp)          /* (CCBPtr sp) */
     CCBPtr sp;
 {
-    int s;
 
-    ATDISABLE(s, sp->lock);
     sp->userFlags |= eTearDown;
     sp->removing = 1;
     sp->state = sClosed;
-    ATENABLE(s, sp->lock);
 
     DoClose(sp, errAborted, 1);
 }
@@ -91,14 +97,14 @@ void TrashSession(sp)               /* (CCBPtr sp) */
  * OUTPUTS:
  *     
  */
+void DoTimerElem(TimerElemPtr);
+
 void DoTimerElem(t) /* (TimerElemPtr t) */
     TimerElemPtr t;
 {
     CCBPtr sp;
-    int        s;
 
     sp = (CCBPtr)((Ptr)t - t->type); /* Recover stream pointer for this guy */
-    ATDISABLE(s, sp->lock);
        
     if (t->type == kFlushTimerType) { /* flush write data time just fired */
        if (sp->sData) {        /* If there's any data, flush it. */
@@ -137,7 +143,6 @@ void DoTimerElem(t) /* (TimerElemPtr t) */
     } else if (t->type == kProbeTimerType) {
        if (sp->state == sOpen || sp->state == sClosing) {
            if (--sp->probeCntr == 0) { /* Connection died */
-               ATENABLE(s, sp->lock);
                TrashSession(sp);
                return;
            } else {
@@ -152,7 +157,6 @@ void DoTimerElem(t) /* (TimerElemPtr t) */
            {
                if (--sp->openRetrys == 0) { /* Oops, didn't open */
                    sp->state = sClosed;
-                   ATENABLE(s, sp->lock);
                    DoClose(sp, errOpening, 1);
                    return;
                }               /* open failed */
@@ -170,22 +174,22 @@ void DoTimerElem(t) /* (TimerElemPtr t) */
        dPrintf(D_M_ADSP, D_L_ERROR, ("DoTimerElem:Unknown timer type!\n"));
     }
 
-    ATENABLE(s, sp->lock);
        return;
        
 send:
-    ATENABLE(s, sp->lock);
     CheckSend(sp);
 }
 
-void TimerTick_funnel()
+void TimerTick_funnel(void *arg);
+
+void TimerTick_funnel(__unused void *arg)
 {
-        thread_funnel_set(network_flock, TRUE);
+       atalk_lock();
        TimerTick();
-        thread_funnel_set(network_flock, FALSE);
+       atalk_unlock();
 }
 
-static StopTimer;
+static int StopTimer;
 
 /*
  * TimerTick