binutils/ld: Don't add /usr/lib to the library search path twice.
[dragonfly.git] / sys / net / i4b / layer4 / i4b_l4timer.c
1 /*
2  * Copyright (c) 1997, 2000 Hellmuth Michaelis. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23  * SUCH DAMAGE.
24  *
25  *---------------------------------------------------------------------------
26  *
27  *      i4b_l4timer.c - timer and timeout handling for layer 4
28  *      --------------------------------------------------------
29  *
30  *      $Id: i4b_l4timer.c,v 1.18 2000/08/24 11:48:58 hm Exp $ 
31  *
32  * $FreeBSD: src/sys/i4b/layer4/i4b_l4timer.c,v 1.6.2.1 2001/08/10 14:08:43 obrien Exp $
33  * $DragonFly: src/sys/net/i4b/layer4/i4b_l4timer.c,v 1.7 2005/06/14 21:19:19 joerg Exp $
34  *
35  *      last edit-date: [Thu Aug 24 12:50:17 2000]
36  *
37  *---------------------------------------------------------------------------*/
38
39 #include "use_i4b.h"
40
41 #if NI4B > 0
42
43 #include <sys/param.h>
44 #include <sys/kernel.h>
45 #include <sys/systm.h>
46 #include <sys/thread2.h>
47
48 #include <net/i4b/include/machine/i4b_debug.h>
49 #include <net/i4b/include/machine/i4b_ioctl.h>
50
51 #include "../include/i4b_global.h"
52 #include "../include/i4b_l3l4.h"
53
54 #include "i4b_l4.h"
55
56 /*---------------------------------------------------------------------------*
57  *      timer T400 timeout function
58  *---------------------------------------------------------------------------*/
59 static void
60 T400_timeout(call_desc_t *cd)
61 {
62         NDBGL4(L4_ERR, "cr = %d", cd->cr);
63 }
64
65 /*---------------------------------------------------------------------------*
66  *      timer T400 start
67  *---------------------------------------------------------------------------*/
68 void
69 T400_start(call_desc_t *cd)
70 {
71         if (cd->T400 == TIMER_ACTIVE)
72                 return;
73                 
74         NDBGL4(L4_MSG, "cr = %d", cd->cr);
75         cd->T400 = TIMER_ACTIVE;
76
77         callout_reset(&cd->T400_timeout, T400DEF, (void *)T400_timeout, cd);
78 }
79
80 /*---------------------------------------------------------------------------*
81  *      timer T400 stop
82  *---------------------------------------------------------------------------*/
83 void
84 T400_stop(call_desc_t *cd)
85 {
86         CRIT_VAR;
87         CRIT_BEG;
88
89         if(cd->T400 == TIMER_ACTIVE)
90         {
91                 callout_stop(&cd->T400_timeout);
92                 cd->T400 = TIMER_IDLE;
93         }
94         CRIT_END;
95         NDBGL4(L4_MSG, "cr = %d", cd->cr);
96 }
97
98 #endif /* NI4B > 0 */