Import 2.2.6pre3
[davej-history.git] / include / net / irda / irlmp_event.h
blobb836279835ad8575901e112f6173eb7e6a053cdf
1 /*********************************************************************
2 *
3 * Filename: irlmp_event.h
4 * Version: 0.1
5 * Description: IrDA-LMP event handling
6 * Status: Experimental.
7 * Author: Dag Brattli <dagb@cs.uit.no>
8 * Created at: Mon Aug 4 20:40:53 1997
9 * Modified at: Thu Feb 25 20:49:16 1999
10 * Modified by: Dag Brattli <dagb@cs.uit.no>
12 * Copyright (c) 1997 Dag Brattli <dagb@cs.uit.no>, All Rights Reserved.
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 2 of
17 * the License, or (at your option) any later version.
19 * Neither Dag Brattli nor University of Tromsø admit liability nor
20 * provide warranty for any of this software. This material is
21 * provided "AS-IS" and at no charge.
23 ********************************************************************/
25 #ifndef IRLMP_EVENT_H
26 #define IRLMP_EVENT_H
28 struct irlmp_cb;
29 struct lsap_cb;
30 struct lap_cb;
32 /* LAP states */
33 typedef enum {
34 /* IrLAP connection control states */
35 LAP_STANDBY, /* No LAP connection */
36 LAP_U_CONNECT, /* Starting LAP connection */
37 LAP_ACTIVE, /* LAP connection is active */
38 } IRLMP_STATE;
40 /* LSAP connection control states */
41 typedef enum {
42 LSAP_DISCONNECTED, /* No LSAP connection */
43 LSAP_CONNECT, /* Connect indication from peer */
44 LSAP_CONNECT_PEND, /* Connect request from service user */
45 LSAP_DATA_TRANSFER_READY, /* LSAP connection established */
46 LSAP_SETUP, /* Trying to set up LSAP connection */
47 LSAP_SETUP_PEND, /* Request to start LAP connection */
48 } LSAP_STATE;
50 typedef enum {
51 /* LSAP events */
52 LM_CONNECT_REQUEST,
53 LM_CONNECT_CONFIRM,
54 LM_CONNECT_RESPONSE,
55 LM_CONNECT_INDICATION,
57 LM_DISCONNECT_INDICATION,
58 LM_DISCONNECT_REQUEST,
60 LM_DATA_REQUEST,
61 LM_UDATA_REQUEST,
62 LM_DATA_INDICATION,
63 LM_UDATA_INDICATION,
65 LM_WATCHDOG_TIMEOUT,
67 /* IrLAP events */
68 LM_LAP_CONNECT_REQUEST,
69 LM_LAP_CONNECT_INDICATION,
70 LM_LAP_CONNECT_CONFIRM,
71 LM_LAP_DISCONNECT_INDICATION,
72 LM_LAP_DISCONNECT_REQUEST,
73 LM_LAP_DISCOVERY_REQUEST,
74 LM_LAP_DISCOVERY_CONFIRM,
75 LM_LAP_IDLE_TIMEOUT,
76 } IRLMP_EVENT;
79 * Information which is used by the current thread, when executing in the
80 * state machine.
82 struct irlmp_event {
83 IRLMP_EVENT *event;
84 struct sk_buff *skb;
86 __u8 hint;
87 __u32 daddr;
88 __u32 saddr;
90 __u8 slsap;
91 __u8 dlsap;
93 int reason;
95 discovery_t *discovery;
98 extern const char *irlmp_state[];
99 extern const char *irlsap_state[];
101 void irlmp_watchdog_timer_expired( unsigned long data);
102 void irlmp_discovery_timer_expired( unsigned long data);
103 void irlmp_idle_timer_expired( unsigned long data);
105 void irlmp_next_station_state( IRLMP_STATE state);
106 void irlmp_next_lsap_state( struct lsap_cb *self, LSAP_STATE state);
107 void irlmp_next_lap_state( struct lap_cb *self, IRLMP_STATE state);
109 void irlmp_do_lap_event( struct lap_cb *self, IRLMP_EVENT event,
110 struct sk_buff *skb);
111 void irlmp_do_lsap_event( struct lsap_cb *self, IRLMP_EVENT event,
112 struct sk_buff *skb);
114 #endif