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

ircomm_tty.h

Go to the documentation of this file.
00001 /*********************************************************************
00002  *                
00003  * Filename:      ircomm_tty.h
00004  * Version:       
00005  * Description:   
00006  * Status:        Experimental.
00007  * Author:        Dag Brattli <dagb@cs.uit.no>
00008  * Created at:    Sun Jun  6 23:24:22 1999
00009  * Modified at:   Sun Dec 12 15:57:38 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_H
00032 #define IRCOMM_TTY_H
00033 
00034 #include <linux/serial.h>
00035 #include <linux/termios.h>
00036 #include <linux/timer.h>
00037 
00038 #include <net/irda/irias_object.h>
00039 #include <net/irda/ircomm_core.h>
00040 #include <net/irda/ircomm_param.h>
00041 
00042 #define IRCOMM_TTY_PORTS 32
00043 #define IRCOMM_TTY_MAGIC 0x3432
00044 #define IRCOMM_TTY_MAJOR 161
00045 #define IRCOMM_TTY_MINOR 0
00046 
00047 /*
00048  * IrCOMM TTY driver state
00049  */
00050 struct ircomm_tty_cb {
00051         queue_t queue;            /* Must be first */
00052         magic_t magic;
00053 
00054         int state;                /* Connect state */
00055 
00056         struct tty_struct *tty;
00057         struct ircomm_cb *ircomm; /* IrCOMM layer instance */
00058 
00059         struct sk_buff *tx_skb;   /* Transmit buffer */
00060         struct sk_buff *ctrl_skb; /* Control data buffer */
00061 
00062         /* Parameters */
00063         struct ircomm_params settings;
00064 
00065         __u8 service_type;        /* The service that we support */
00066         int client;               /* True if we are a client */
00067         LOCAL_FLOW flow;          /* IrTTP flow status */
00068 
00069         int line;
00070         __u32 flags;
00071 
00072         __u8 dlsap_sel;
00073         __u8 slsap_sel;
00074 
00075         __u32 saddr;
00076         __u32 daddr;
00077 
00078         __u32 max_data_size;   /* Max data we can transmit in one packet */
00079         __u32 max_header_size; /* The amount of header space we must reserve */
00080 
00081         struct iriap_cb *iriap; /* Instance used for querying remote IAS */
00082         struct ias_object* obj;
00083         int skey;
00084         int ckey;
00085 
00086         struct termios    normal_termios;
00087         struct termios    callout_termios;
00088 
00089         struct wait_queue *open_wait;
00090         struct wait_queue *close_wait;
00091         struct timer_list watchdog_timer;
00092         struct tq_struct  tqueue;
00093 
00094         unsigned short    close_delay;
00095         unsigned short    closing_wait; /* time to wait before closing */
00096 
00097         long session;           /* Session of opening process */
00098         long pgrp;              /* pgrp of opening process */
00099         int  open_count;
00100         int  blocked_open;      /* # of blocked opens */
00101 };
00102 
00103 void ircomm_tty_start(struct tty_struct *tty);
00104 void ircomm_tty_stop(struct tty_struct *tty);
00105 void ircomm_tty_check_modem_status(struct ircomm_tty_cb *self);
00106 
00107 extern void ircomm_tty_change_speed(struct ircomm_tty_cb *self);
00108 extern int ircomm_tty_ioctl(struct tty_struct *tty, struct file *file, 
00109                             unsigned int cmd, unsigned long arg);
00110 extern void ircomm_tty_set_termios(struct tty_struct *tty, 
00111                                    struct termios *old_termios);
00112 extern hashbin_t *ircomm_tty;
00113 
00114 #endif
00115 
00116 
00117 
00118 
00119 
00120 
00121