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

ircomm_param.h

Go to the documentation of this file.
00001 /*********************************************************************
00002  *                
00003  * Filename:      ircomm_param.h
00004  * Version:       1.0
00005  * Description:   Parameter handling for the IrCOMM protocol
00006  * Status:        Experimental.
00007  * Author:        Dag Brattli <dagb@cs.uit.no>
00008  * Created at:    Mon Jun  7 08:47:28 1999
00009  * Modified at:   Wed Aug 25 13:46:33 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_PARAMS_H
00032 #define IRCOMM_PARAMS_H
00033 
00034 #include <net/irda/parameters.h>
00035 
00036 /* Parameters common to all service types */
00037 #define IRCOMM_SERVICE_TYPE     0x00
00038 #define IRCOMM_PORT_TYPE        0x01 /* Only used in LM-IAS */
00039 #define IRCOMM_PORT_NAME        0x02 /* Only used in LM-IAS */
00040 
00041 /* Parameters for both 3 wire and 9 wire */
00042 #define IRCOMM_DATA_RATE        0x10
00043 #define IRCOMM_DATA_FORMAT      0x11
00044 #define IRCOMM_FLOW_CONTROL     0x12
00045 #define IRCOMM_XON_XOFF         0x13
00046 #define IRCOMM_ENQ_ACK          0x14
00047 #define IRCOMM_LINE_STATUS      0x15
00048 #define IRCOMM_BREAK            0x16
00049 
00050 /* Parameters for 9 wire */
00051 #define IRCOMM_DTE              0x20
00052 #define IRCOMM_DCE              0x21
00053 #define IRCOMM_POLL             0x22
00054 
00055 /* Service type (details) */
00056 #define IRCOMM_3_WIRE_RAW       0x01
00057 #define IRCOMM_3_WIRE           0x02
00058 #define IRCOMM_9_WIRE           0x04
00059 #define IRCOMM_CENTRONICS       0x08
00060 
00061 /* Port type (details) */
00062 #define IRCOMM_SERIAL           0x00
00063 #define IRCOMM_PARALLEL         0x01
00064 
00065 /* Data format (details) */
00066 #define IRCOMM_WSIZE_5          0x00
00067 #define IRCOMM_WSIZE_6          0x01
00068 #define IRCOMM_WSIZE_7          0x02
00069 #define IRCOMM_WSIZE_8          0x03
00070 
00071 #define IRCOMM_1_STOP_BIT       0x00
00072 #define IRCOMM_2_STOP_BIT       0x04 /* 1.5 if char len 5 */
00073 
00074 #define IRCOMM_PARITY_DISABLE   0x00
00075 #define IRCOMM_PARITY_ENABLE    0x08
00076 
00077 #define IRCOMM_PARITY_ODD       0x00
00078 #define IRCOMM_PARITY_EVEN      0x10
00079 #define IRCOMM_PARITY_MARK      0x20
00080 #define IRCOMM_PARITY_SPACE     0x30
00081 
00082 /* Flow control */
00083 #define IRCOMM_XON_XOFF_IN      0x01
00084 #define IRCOMM_XON_XOFF_OUT     0x02
00085 #define IRCOMM_RTS_CTS_IN       0x04
00086 #define IRCOMM_RTS_CTS_OUT      0x08
00087 #define IRCOMM_DSR_DTR_IN       0x10
00088 #define IRCOMM_DSR_DTR_OUT      0x20
00089 #define IRCOMM_ENQ_ACK_IN       0x40
00090 #define IRCOMM_ENQ_ACK_OUT      0x80
00091 
00092 /* Line status */
00093 #define IRCOMM_OVERRUN_ERROR    0x02
00094 #define IRCOMM_PARITY_ERROR     0x04
00095 #define IRCOMM_FRAMING_ERROR    0x08
00096 
00097 /* DTE (Data terminal equipment) line settings */
00098 #define IRCOMM_DELTA_DTR        0x01
00099 #define IRCOMM_DELTA_RTS        0x02
00100 #define IRCOMM_DTR              0x04
00101 #define IRCOMM_RTS              0x08
00102 
00103 /* DCE (Data communications equipment) line settings */
00104 #define IRCOMM_DELTA_CTS        0x01  /* Clear to send has changed */
00105 #define IRCOMM_DELTA_DSR        0x02  /* Data set ready has changed */
00106 #define IRCOMM_DELTA_RI         0x04  /* Ring indicator has changed */
00107 #define IRCOMM_DELTA_CD         0x08  /* Carrier detect has changed */
00108 #define IRCOMM_CTS              0x10  /* Clear to send is high */
00109 #define IRCOMM_DSR              0x20  /* Data set ready is high */
00110 #define IRCOMM_RI               0x40  /* Ring indicator is high */
00111 #define IRCOMM_CD               0x80  /* Carrier detect is high */
00112 #define IRCOMM_DCE_DELTA_ANY    0x0f
00113 
00114 /*
00115  * Parameter state
00116  */
00117 struct ircomm_params {
00118         /* General control params */
00119         __u8  service_type;
00120         __u8  port_type;
00121         char  port_name[32];
00122 
00123         /* Control params for 3- and 9-wire service type */
00124         __u32 data_rate;         /* Data rate in bps */
00125         __u8  data_format;
00126         __u8  flow_control;
00127         char  xonxoff[2];
00128         char  enqack[2];
00129         __u8  line_status;
00130         __u8  _break;
00131 
00132         __u8  null_modem;
00133 
00134         /* Control params for 9-wire service type */
00135         __u8 dte;
00136         __u8 dce;
00137         __u8 poll;
00138 
00139         /* Control params for Centronics service type */
00140 };
00141 
00142 struct ircomm_tty_cb; /* Forward decl. */
00143 
00144 int ircomm_param_flush(struct ircomm_tty_cb *self);
00145 int ircomm_param_request(struct ircomm_tty_cb *self, __u8 pi, int flush);
00146 
00147 extern pi_param_info_t ircomm_param_info;
00148 
00149 #endif /* IRCOMM_PARAMS_H */
00150