1 /*********************************************************************
3 * Filename: ircomm_param.h
5 * Description: Parameter handling for the IrCOMM protocol
6 * Status: Experimental.
7 * Author: Dag Brattli <dagb@cs.uit.no>
8 * Created at: Mon Jun 7 08:47:28 1999
9 * Modified at: Wed Aug 25 13:46:33 1999
10 * Modified by: Dag Brattli <dagb@cs.uit.no>
12 * Copyright (c) 1999 Dag Brattli, 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 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see <http://www.gnu.org/licenses/>.
27 ********************************************************************/
29 #ifndef IRCOMM_PARAMS_H
30 #define IRCOMM_PARAMS_H
32 #include <net/irda/parameters.h>
34 /* Parameters common to all service types */
35 #define IRCOMM_SERVICE_TYPE 0x00
36 #define IRCOMM_PORT_TYPE 0x01 /* Only used in LM-IAS */
37 #define IRCOMM_PORT_NAME 0x02 /* Only used in LM-IAS */
39 /* Parameters for both 3 wire and 9 wire */
40 #define IRCOMM_DATA_RATE 0x10
41 #define IRCOMM_DATA_FORMAT 0x11
42 #define IRCOMM_FLOW_CONTROL 0x12
43 #define IRCOMM_XON_XOFF 0x13
44 #define IRCOMM_ENQ_ACK 0x14
45 #define IRCOMM_LINE_STATUS 0x15
46 #define IRCOMM_BREAK 0x16
48 /* Parameters for 9 wire */
49 #define IRCOMM_DTE 0x20
50 #define IRCOMM_DCE 0x21
51 #define IRCOMM_POLL 0x22
53 /* Service type (details) */
54 #define IRCOMM_3_WIRE_RAW 0x01
55 #define IRCOMM_3_WIRE 0x02
56 #define IRCOMM_9_WIRE 0x04
57 #define IRCOMM_CENTRONICS 0x08
59 /* Port type (details) */
60 #define IRCOMM_SERIAL 0x00
61 #define IRCOMM_PARALLEL 0x01
63 /* Data format (details) */
64 #define IRCOMM_WSIZE_5 0x00
65 #define IRCOMM_WSIZE_6 0x01
66 #define IRCOMM_WSIZE_7 0x02
67 #define IRCOMM_WSIZE_8 0x03
69 #define IRCOMM_1_STOP_BIT 0x00
70 #define IRCOMM_2_STOP_BIT 0x04 /* 1.5 if char len 5 */
72 #define IRCOMM_PARITY_DISABLE 0x00
73 #define IRCOMM_PARITY_ENABLE 0x08
75 #define IRCOMM_PARITY_ODD 0x00
76 #define IRCOMM_PARITY_EVEN 0x10
77 #define IRCOMM_PARITY_MARK 0x20
78 #define IRCOMM_PARITY_SPACE 0x30
81 #define IRCOMM_XON_XOFF_IN 0x01
82 #define IRCOMM_XON_XOFF_OUT 0x02
83 #define IRCOMM_RTS_CTS_IN 0x04
84 #define IRCOMM_RTS_CTS_OUT 0x08
85 #define IRCOMM_DSR_DTR_IN 0x10
86 #define IRCOMM_DSR_DTR_OUT 0x20
87 #define IRCOMM_ENQ_ACK_IN 0x40
88 #define IRCOMM_ENQ_ACK_OUT 0x80
91 #define IRCOMM_OVERRUN_ERROR 0x02
92 #define IRCOMM_PARITY_ERROR 0x04
93 #define IRCOMM_FRAMING_ERROR 0x08
95 /* DTE (Data terminal equipment) line settings */
96 #define IRCOMM_DELTA_DTR 0x01
97 #define IRCOMM_DELTA_RTS 0x02
98 #define IRCOMM_DTR 0x04
99 #define IRCOMM_RTS 0x08
101 /* DCE (Data communications equipment) line settings */
102 #define IRCOMM_DELTA_CTS 0x01 /* Clear to send has changed */
103 #define IRCOMM_DELTA_DSR 0x02 /* Data set ready has changed */
104 #define IRCOMM_DELTA_RI 0x04 /* Ring indicator has changed */
105 #define IRCOMM_DELTA_CD 0x08 /* Carrier detect has changed */
106 #define IRCOMM_CTS 0x10 /* Clear to send is high */
107 #define IRCOMM_DSR 0x20 /* Data set ready is high */
108 #define IRCOMM_RI 0x40 /* Ring indicator is high */
109 #define IRCOMM_CD 0x80 /* Carrier detect is high */
110 #define IRCOMM_DCE_DELTA_ANY 0x0f
115 struct ircomm_params {
116 /* General control params */
121 /* Control params for 3- and 9-wire service type */
122 __u32 data_rate; /* Data rate in bps */
132 /* Control params for 9-wire service type */
137 /* Control params for Centronics service type */
140 struct ircomm_tty_cb; /* Forward decl. */
142 int ircomm_param_request(struct ircomm_tty_cb *self, __u8 pi, int flush);
144 extern pi_param_info_t ircomm_param_info;
146 #endif /* IRCOMM_PARAMS_H */