1 /*********************************************************************
2 *
3 * Filename: timer.h
4 * Version:
5 * Description:
6 * Status: Experimental.
7 * Author: Dag Brattli <dagb@cs.uit.no>
8 * Created at: Sat Aug 16 00:59:29 1997
9 * Modified at: Thu Oct 7 12:25:24 1999
10 * Modified by: Dag Brattli <dagb@cs.uit.no>
11 *
12 * Copyright (c) 1997, 1998-1999 Dag Brattli <dagb@cs.uit.no>,
13 * All Rights Reserved.
14 *
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License as
17 * published by the Free Software Foundation; either version 2 of
18 * the License, or (at your option) any later version.
19 *
20 * Neither Dag Brattli nor University of Tromsų admit liability nor
21 * provide warranty for any of this software. This material is
22 * provided "AS-IS" and at no charge.
23 *
24 ********************************************************************/
25
26 #ifndef TIMER_H
27 #define TIMER_H
28
29 #include <linux/netdevice.h>
30
31 #include <asm/param.h> /* for HZ */
32
33 #include <net/irda/irda.h>
34 #include <net/irda/irmod.h>
35 #include <net/irda/irlap.h>
36 #include <net/irda/irlmp.h>
37 #include <net/irda/irda_device.h>
38
39 /*
40 * Timeout definitions, some defined in IrLAP p. 92
41 */
42 #define POLL_TIMEOUT (450*HZ/1000) /* Must never exceed 500 ms */
43 #define FINAL_TIMEOUT (500*HZ/1000) /* Must never exceed 500 ms */
44
45 /*
46 * Normally twice of p-timer. Note 3, IrLAP p. 60 suggests at least twice
47 * duration of the P-timer.
48 */
49 #define WD_TIMEOUT (POLL_TIMEOUT*2)
50 #define MEDIABUSY_TIMEOUT (500*HZ/1000) /* 500 msec */
51
52 /*
53 * Slot timer must never exceed 85 ms, and must always be at least 25 ms,
54 * suggested to 75-85 msec by IrDA lite. This doesn't work with a lot of
55 * devices, and other stackes uses a lot more, so it's best we do it as well
56 */
57 #define SLOT_TIMEOUT (90*HZ/1000)
58
59 /*
60 * We set the query timeout to 100 ms and then expect the value to be
61 * multiplied with the number of slots to product the actual timeout value
62 */
63 #define QUERY_TIMEOUT (HZ/10)
64
65 #define WATCHDOG_TIMEOUT (20*HZ) /* 20 sec */
66
67 typedef void (*TIMER_CALLBACK)(void *);
68
69 void irda_start_timer(struct timer_list *ptimer, int timeout, void* data,
70 TIMER_CALLBACK callback);
71
72 inline void irlap_start_slot_timer(struct irlap_cb *self, int timeout);
73 inline void irlap_start_query_timer(struct irlap_cb *self, int timeout);
74 inline void irlap_start_final_timer(struct irlap_cb *self, int timeout);
75 inline void irlap_start_wd_timer(struct irlap_cb *self, int timeout);
76 inline void irlap_start_backoff_timer(struct irlap_cb *self, int timeout);
77
78 void irlap_start_mbusy_timer(struct irlap_cb *);
79 void irlap_stop_mbusy_timer(struct irlap_cb *);
80
81 struct lsap_cb;
82 struct lap_cb;
83 inline void irlmp_start_watchdog_timer(struct lsap_cb *, int timeout);
84 inline void irlmp_start_discovery_timer(struct irlmp_cb *, int timeout);
85 inline void irlmp_start_idle_timer(struct lap_cb *, int timeout);
86 inline void irlmp_stop_idle_timer(struct lap_cb *self);
87
88 #endif
89
90
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.