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

ircomm_tty_attach.h

Go to the documentation of this file.
00001 /*********************************************************************
00002  *                
00003  * Filename:      ircomm_tty_attach.h
00004  * Version:       
00005  * Description:   
00006  * Status:        Experimental.
00007  * Author:        Dag Brattli <dagb@cs.uit.no>
00008  * Created at:    Wed Jun  9 15:55:18 1999
00009  * Modified at:   Fri Dec 10 21:04:55 1999
00010  * Modified by:   Dag Brattli <dagb@cs.uit.no>
00011  * 
00012  *     Copyright (c) 1999 Dag Brattli, All Rights Reserved.
00013  *     
00014  *     This program is free software; you can redistribute it and/or 
00015  *     modify it under the terms of the GNU General Public License as 
00016  *     published by the Free Software Foundation; either version 2 of 
00017  *     the License, or (at your option) any later version.
00018  * 
00019  *     This program is distributed in the hope that it will be useful,
00020  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
00021  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00022  *     GNU General Public License for more details.
00023  * 
00024  *     You should have received a copy of the GNU General Public License 
00025  *     along with this program; if not, write to the Free Software 
00026  *     Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
00027  *     MA 02111-1307 USA
00028  *     
00029  ********************************************************************/
00030 
00031 #ifndef IRCOMM_TTY_ATTACH_H
00032 #define IRCOMM_TTY_ATTACH_H
00033 
00034 #include <net/irda/ircomm_tty.h>
00035 
00036 typedef enum {
00037         IRCOMM_TTY_IDLE,
00038         IRCOMM_TTY_SEARCH,
00039         IRCOMM_TTY_QUERY_PARAMETERS,
00040         IRCOMM_TTY_QUERY_LSAP_SEL,
00041         IRCOMM_TTY_SETUP,
00042         IRCOMM_TTY_READY,
00043 } IRCOMM_TTY_STATE;
00044 
00045 /* IrCOMM TTY Events */
00046 typedef enum {
00047         IRCOMM_TTY_ATTACH_CABLE,
00048         IRCOMM_TTY_DETACH_CABLE,
00049         IRCOMM_TTY_DATA_REQUEST,
00050         IRCOMM_TTY_DATA_INDICATION,
00051         IRCOMM_TTY_DISCOVERY_REQUEST,
00052         IRCOMM_TTY_DISCOVERY_INDICATION,
00053         IRCOMM_TTY_CONNECT_CONFIRM,
00054         IRCOMM_TTY_CONNECT_INDICATION,
00055         IRCOMM_TTY_DISCONNECT_REQUEST,
00056         IRCOMM_TTY_DISCONNECT_INDICATION,
00057         IRCOMM_TTY_WD_TIMER_EXPIRED,
00058         IRCOMM_TTY_GOT_PARAMETERS,
00059         IRCOMM_TTY_GOT_LSAPSEL,
00060 } IRCOMM_TTY_EVENT;
00061 
00062 /* Used for passing information through the state-machine */
00063 struct ircomm_tty_info {
00064         __u32     saddr;               /* Source device address */
00065         __u32     daddr;               /* Destination device address */
00066         __u8      dlsap_sel;
00067 };
00068 
00069 extern char *ircomm_state[];
00070 extern char *ircomm_event[];
00071 extern char *ircomm_tty_state[];
00072 
00073 int ircomm_tty_do_event(struct ircomm_tty_cb *self, IRCOMM_TTY_EVENT event,
00074                         struct sk_buff *skb, struct ircomm_tty_info *info);
00075 void ircomm_tty_next_state(struct ircomm_tty_cb *self, IRCOMM_TTY_STATE state);
00076 
00077 
00078 int  ircomm_tty_attach_cable(struct ircomm_tty_cb *self);
00079 void ircomm_tty_detach_cable(struct ircomm_tty_cb *self);
00080 void ircomm_tty_connect_confirm(void *instance, void *sap, 
00081                                 struct qos_info *qos, 
00082                                 __u32 max_sdu_size, 
00083                                 __u8 max_header_size, 
00084                                 struct sk_buff *skb);
00085 void ircomm_tty_disconnect_indication(void *instance, void *sap, 
00086                                       LM_REASON reason,
00087                                       struct sk_buff *skb);
00088 void ircomm_tty_connect_indication(void *instance, void *sap, 
00089                                    struct qos_info *qos, 
00090                                    __u32 max_sdu_size,
00091                                    __u8 max_header_size, 
00092                                    struct sk_buff *skb);
00093 int ircomm_tty_send_initial_parameters(struct ircomm_tty_cb *self);
00094 void ircomm_tty_link_established(struct ircomm_tty_cb *self);
00095 
00096 #endif /* IRCOMM_TTY_ATTACH_H */