]> 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 fe092e0b1052837d957739efa99df33fb3f4c170..455ab5e33c52424333fd9da0999e816e051c89de 100644 (file)
@@ -1,23 +1,29 @@
 /*
  * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
  *
- * @APPLE_LICENSE_HEADER_START@
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  * 
- * The contents of this file constitute Original Code as defined in and
- * are subject to the Apple Public Source License Version 1.1 (the
- * "License").  You may not use this file except in compliance with the
- * License.  Please obtain a copy of the License at
- * http://www.apple.com/publicsource and read it before using this file.
+ * 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. 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.
  * 
- * This Original Code and all software distributed under the License are
- * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * 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
  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
- * License for the specific language governing rights and limitations
- * under the License.
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * 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);
 }
@@ -88,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. */
@@ -134,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 {
@@ -149,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 */
@@ -167,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