Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | /********************************************************************* |
2 | * | |
3 | * Filename: ircomm_param.h | |
4 | * Version: 1.0 | |
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> | |
11 | * | |
12 | * Copyright (c) 1999 Dag Brattli, All Rights Reserved. | |
13 | * | |
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. | |
18 | * | |
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. | |
23 | * | |
24 | * You should have received a copy of the GNU General Public License | |
a6227e26 | 25 | * along with this program; if not, see <http://www.gnu.org/licenses/>. |
1da177e4 LT |
26 | * |
27 | ********************************************************************/ | |
28 | ||
29 | #ifndef IRCOMM_PARAMS_H | |
30 | #define IRCOMM_PARAMS_H | |
31 | ||
32 | #include <net/irda/parameters.h> | |
33 | ||
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 */ | |
38 | ||
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 | |
47 | ||
48 | /* Parameters for 9 wire */ | |
49 | #define IRCOMM_DTE 0x20 | |
50 | #define IRCOMM_DCE 0x21 | |
51 | #define IRCOMM_POLL 0x22 | |
52 | ||
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 | |
58 | ||
59 | /* Port type (details) */ | |
60 | #define IRCOMM_SERIAL 0x00 | |
61 | #define IRCOMM_PARALLEL 0x01 | |
62 | ||
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 | |
68 | ||
69 | #define IRCOMM_1_STOP_BIT 0x00 | |
70 | #define IRCOMM_2_STOP_BIT 0x04 /* 1.5 if char len 5 */ | |
71 | ||
72 | #define IRCOMM_PARITY_DISABLE 0x00 | |
73 | #define IRCOMM_PARITY_ENABLE 0x08 | |
74 | ||
75 | #define IRCOMM_PARITY_ODD 0x00 | |
76 | #define IRCOMM_PARITY_EVEN 0x10 | |
77 | #define IRCOMM_PARITY_MARK 0x20 | |
78 | #define IRCOMM_PARITY_SPACE 0x30 | |
79 | ||
80 | /* Flow control */ | |
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 | |
89 | ||
90 | /* Line status */ | |
91 | #define IRCOMM_OVERRUN_ERROR 0x02 | |
92 | #define IRCOMM_PARITY_ERROR 0x04 | |
93 | #define IRCOMM_FRAMING_ERROR 0x08 | |
94 | ||
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 | |
100 | ||
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 | |
111 | ||
112 | /* | |
113 | * Parameter state | |
114 | */ | |
115 | struct ircomm_params { | |
116 | /* General control params */ | |
117 | __u8 service_type; | |
118 | __u8 port_type; | |
119 | char port_name[32]; | |
120 | ||
121 | /* Control params for 3- and 9-wire service type */ | |
122 | __u32 data_rate; /* Data rate in bps */ | |
123 | __u8 data_format; | |
124 | __u8 flow_control; | |
125 | char xonxoff[2]; | |
126 | char enqack[2]; | |
127 | __u8 line_status; | |
128 | __u8 _break; | |
129 | ||
130 | __u8 null_modem; | |
131 | ||
132 | /* Control params for 9-wire service type */ | |
133 | __u8 dte; | |
134 | __u8 dce; | |
135 | __u8 poll; | |
136 | ||
137 | /* Control params for Centronics service type */ | |
138 | }; | |
139 | ||
140 | struct ircomm_tty_cb; /* Forward decl. */ | |
141 | ||
142 | int ircomm_param_request(struct ircomm_tty_cb *self, __u8 pi, int flush); | |
143 | ||
144 | extern pi_param_info_t ircomm_param_info; | |
145 | ||
146 | #endif /* IRCOMM_PARAMS_H */ | |
147 |