Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

irlmp_event.h

Go to the documentation of this file.
00001 /*********************************************************************
00002  *                
00003  * Filename:      irlmp_event.h
00004  * Version:       0.1
00005  * Description:   IrDA-LMP event handling
00006  * Status:        Experimental.
00007  * Author:        Dag Brattli <dagb@cs.uit.no>
00008  * Created at:    Mon Aug  4 20:40:53 1997
00009  * Modified at:   Thu Jul  8 12:18:54 1999
00010  * Modified by:   Dag Brattli <dagb@cs.uit.no>
00011  * 
00012  *     Copyright (c) 1997, 1999 Dag Brattli <dagb@cs.uit.no>, 
00013  *     All Rights Reserved.
00014  *     
00015  *     This program is free software; you can redistribute it and/or 
00016  *     modify it under the terms of the GNU General Public License as 
00017  *     published by the Free Software Foundation; either version 2 of 
00018  *     the License, or (at your option) any later version.
00019  *
00020  *     Neither Dag Brattli nor University of Tromsų admit liability nor
00021  *     provide warranty for any of this software. This material is 
00022  *     provided "AS-IS" and at no charge.
00023  *
00024  ********************************************************************/
00025 
00026 #ifndef IRLMP_EVENT_H
00027 #define IRLMP_EVENT_H
00028 
00029 struct irlmp_cb;
00030 struct lsap_cb;
00031 struct lap_cb;
00032 
00033 /* LAP states */
00034 typedef enum {
00035         /* IrLAP connection control states */
00036         LAP_STANDBY,             /* No LAP connection */
00037         LAP_U_CONNECT,           /* Starting LAP connection */
00038         LAP_ACTIVE,              /* LAP connection is active */
00039 } IRLMP_STATE;
00040 
00041 /* LSAP connection control states */
00042 typedef enum {
00043         LSAP_DISCONNECTED,        /* No LSAP connection */
00044         LSAP_CONNECT,             /* Connect indication from peer */
00045         LSAP_CONNECT_PEND,        /* Connect request from service user */
00046         LSAP_DATA_TRANSFER_READY, /* LSAP connection established */          
00047         LSAP_SETUP,               /* Trying to set up LSAP connection */
00048         LSAP_SETUP_PEND,          /* Request to start LAP connection */
00049 } LSAP_STATE;
00050 
00051 typedef enum {
00052         /* LSAP events */
00053         LM_CONNECT_REQUEST,
00054         LM_CONNECT_CONFIRM,
00055         LM_CONNECT_RESPONSE,
00056         LM_CONNECT_INDICATION,  
00057         
00058         LM_DISCONNECT_INDICATION,
00059         LM_DISCONNECT_REQUEST,
00060 
00061         LM_DATA_REQUEST,
00062         LM_UDATA_REQUEST,
00063         LM_DATA_INDICATION,
00064         LM_UDATA_INDICATION,
00065 
00066         LM_WATCHDOG_TIMEOUT,
00067 
00068         /* IrLAP events */
00069         LM_LAP_CONNECT_REQUEST,
00070         LM_LAP_CONNECT_INDICATION, 
00071         LM_LAP_CONNECT_CONFIRM,
00072         LM_LAP_DISCONNECT_INDICATION, 
00073         LM_LAP_DISCONNECT_REQUEST,
00074         LM_LAP_DISCOVERY_REQUEST,
00075         LM_LAP_DISCOVERY_CONFIRM,
00076         LM_LAP_IDLE_TIMEOUT,
00077 } IRLMP_EVENT;
00078 
00079 /*
00080  *  Information which is used by the current thread, when executing in the
00081  *  state machine.
00082  */
00083 struct irlmp_event {
00084         IRLMP_EVENT *event;
00085         struct sk_buff *skb;
00086 
00087         __u8 hint;
00088         __u32 daddr;
00089         __u32 saddr;
00090 
00091         __u8 slsap;
00092         __u8 dlsap;
00093 
00094         int reason;
00095 
00096         discovery_t *discovery;
00097 };
00098 
00099 extern const char *irlmp_state[];
00100 extern const char *irlsap_state[];
00101 
00102 void irlmp_watchdog_timer_expired(void *data);
00103 void irlmp_discovery_timer_expired(void *data);
00104 void irlmp_idle_timer_expired(void *data);
00105 
00106 void irlmp_next_station_state(IRLMP_STATE state);
00107 void irlmp_next_lsap_state(struct lsap_cb *self, LSAP_STATE state);
00108 void irlmp_next_lap_state(struct lap_cb *self, IRLMP_STATE state);
00109 
00110 void irlmp_do_lap_event(struct lap_cb *self, IRLMP_EVENT event, 
00111                         struct sk_buff *skb);
00112 int irlmp_do_lsap_event(struct lsap_cb *self, IRLMP_EVENT event, 
00113                         struct sk_buff *skb);
00114 
00115 #endif /* IRLMP_EVENT_H */
00116 
00117 
00118 
00119