Linux-2.6.12-rc2
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / include / linux / irda.h
1 /*********************************************************************
2 *
3 * Filename: irda.h
4 * Version:
5 * Description:
6 * Status: Experimental.
7 * Author: Dag Brattli <dagb@cs.uit.no>
8 * Created at: Mon Mar 8 14:06:12 1999
9 * Modified at: Sat Dec 25 16:06:42 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 * Neither Dag Brattli nor University of Tromsø admit liability nor
20 * provide warranty for any of this software. This material is
21 * provided "AS-IS" and at no charge.
22 *
23 ********************************************************************/
24
25 #ifndef KERNEL_IRDA_H
26 #define KERNEL_IRDA_H
27
28 /* Please do *not* add any #include in this file, this file is
29 * included as-is in user space.
30 * Please fix the calling file to properly included needed files before
31 * this one, or preferably to include <net/irda/irda.h> instead.
32 * Jean II */
33
34 /* Hint bit positions for first hint byte */
35 #define HINT_PNP 0x01
36 #define HINT_PDA 0x02
37 #define HINT_COMPUTER 0x04
38 #define HINT_PRINTER 0x08
39 #define HINT_MODEM 0x10
40 #define HINT_FAX 0x20
41 #define HINT_LAN 0x40
42 #define HINT_EXTENSION 0x80
43
44 /* Hint bit positions for second hint byte (first extension byte) */
45 #define HINT_TELEPHONY 0x01
46 #define HINT_FILE_SERVER 0x02
47 #define HINT_COMM 0x04
48 #define HINT_MESSAGE 0x08
49 #define HINT_HTTP 0x10
50 #define HINT_OBEX 0x20
51
52 /* IrLMP character code values */
53 #define CS_ASCII 0x00
54 #define CS_ISO_8859_1 0x01
55 #define CS_ISO_8859_2 0x02
56 #define CS_ISO_8859_3 0x03
57 #define CS_ISO_8859_4 0x04
58 #define CS_ISO_8859_5 0x05
59 #define CS_ISO_8859_6 0x06
60 #define CS_ISO_8859_7 0x07
61 #define CS_ISO_8859_8 0x08
62 #define CS_ISO_8859_9 0x09
63 #define CS_UNICODE 0xff
64
65 /* These are the currently known dongles */
66 typedef enum {
67 IRDA_TEKRAM_DONGLE = 0,
68 IRDA_ESI_DONGLE = 1,
69 IRDA_ACTISYS_DONGLE = 2,
70 IRDA_ACTISYS_PLUS_DONGLE = 3,
71 IRDA_GIRBIL_DONGLE = 4,
72 IRDA_LITELINK_DONGLE = 5,
73 IRDA_AIRPORT_DONGLE = 6,
74 IRDA_OLD_BELKIN_DONGLE = 7,
75 IRDA_EP7211_IR = 8,
76 IRDA_MCP2120_DONGLE = 9,
77 IRDA_ACT200L_DONGLE = 10,
78 IRDA_MA600_DONGLE = 11,
79 } IRDA_DONGLE;
80
81 /* Protocol types to be used for SOCK_DGRAM */
82 enum {
83 IRDAPROTO_UNITDATA = 0,
84 IRDAPROTO_ULTRA = 1,
85 IRDAPROTO_MAX
86 };
87
88 #define SOL_IRLMP 266 /* Same as SOL_IRDA for now */
89 #define SOL_IRTTP 266 /* Same as SOL_IRDA for now */
90
91 #define IRLMP_ENUMDEVICES 1 /* Return discovery log */
92 #define IRLMP_IAS_SET 2 /* Set an attribute in local IAS */
93 #define IRLMP_IAS_QUERY 3 /* Query remote IAS for attribute */
94 #define IRLMP_HINTS_SET 4 /* Set hint bits advertised */
95 #define IRLMP_QOS_SET 5
96 #define IRLMP_QOS_GET 6
97 #define IRLMP_MAX_SDU_SIZE 7
98 #define IRLMP_IAS_GET 8 /* Get an attribute from local IAS */
99 #define IRLMP_IAS_DEL 9 /* Remove attribute from local IAS */
100 #define IRLMP_HINT_MASK_SET 10 /* Set discovery filter */
101 #define IRLMP_WAITDEVICE 11 /* Wait for a new discovery */
102
103 #define IRTTP_MAX_SDU_SIZE IRLMP_MAX_SDU_SIZE /* Compatibility */
104
105 #define IAS_MAX_STRING 256 /* See IrLMP 1.1, 4.3.3.2 */
106 #define IAS_MAX_OCTET_STRING 1024 /* See IrLMP 1.1, 4.3.3.2 */
107 #define IAS_MAX_CLASSNAME 60 /* See IrLMP 1.1, 4.3.1 */
108 #define IAS_MAX_ATTRIBNAME 60 /* See IrLMP 1.1, 4.3.3.1 */
109 #define IAS_MAX_ATTRIBNUMBER 256 /* See IrLMP 1.1, 4.3.3.1 */
110 /* For user space backward compatibility - may be fixed in kernel 2.5.X
111 * Note : need 60+1 ('\0'), make it 64 for alignement - Jean II */
112 #define IAS_EXPORT_CLASSNAME 64
113 #define IAS_EXPORT_ATTRIBNAME 256
114
115 /* Attribute type needed for struct irda_ias_set */
116 #define IAS_MISSING 0
117 #define IAS_INTEGER 1
118 #define IAS_OCT_SEQ 2
119 #define IAS_STRING 3
120
121 #define LSAP_ANY 0xff
122
123 struct sockaddr_irda {
124 sa_family_t sir_family; /* AF_IRDA */
125 __u8 sir_lsap_sel; /* LSAP selector */
126 __u32 sir_addr; /* Device address */
127 char sir_name[25]; /* Usually <service>:IrDA:TinyTP */
128 };
129
130 struct irda_device_info {
131 __u32 saddr; /* Address of local interface */
132 __u32 daddr; /* Address of remote device */
133 char info[22]; /* Description */
134 __u8 charset; /* Charset used for description */
135 __u8 hints[2]; /* Hint bits */
136 };
137
138 struct irda_device_list {
139 __u32 len;
140 struct irda_device_info dev[1];
141 };
142
143 struct irda_ias_set {
144 char irda_class_name[IAS_EXPORT_CLASSNAME];
145 char irda_attrib_name[IAS_EXPORT_ATTRIBNAME];
146 unsigned int irda_attrib_type;
147 union {
148 unsigned int irda_attrib_int;
149 struct {
150 unsigned short len;
151 __u8 octet_seq[IAS_MAX_OCTET_STRING];
152 } irda_attrib_octet_seq;
153 struct {
154 __u8 len;
155 __u8 charset;
156 __u8 string[IAS_MAX_STRING];
157 } irda_attrib_string;
158 } attribute;
159 __u32 daddr; /* Address of device (for some queries only) */
160 };
161
162 /* Some private IOCTL's (max 16) */
163 #define SIOCSDONGLE (SIOCDEVPRIVATE + 0)
164 #define SIOCGDONGLE (SIOCDEVPRIVATE + 1)
165 #define SIOCSBANDWIDTH (SIOCDEVPRIVATE + 2)
166 #define SIOCSMEDIABUSY (SIOCDEVPRIVATE + 3)
167 #define SIOCGMEDIABUSY (SIOCDEVPRIVATE + 4)
168 #define SIOCGRECEIVING (SIOCDEVPRIVATE + 5)
169 #define SIOCSMODE (SIOCDEVPRIVATE + 6)
170 #define SIOCGMODE (SIOCDEVPRIVATE + 7)
171 #define SIOCSDTRRTS (SIOCDEVPRIVATE + 8)
172 #define SIOCGQOS (SIOCDEVPRIVATE + 9)
173
174 /* No reason to include <linux/if.h> just because of this one ;-) */
175 #define IRNAMSIZ 16
176
177 /* IrDA quality of service information (must not exceed 16 bytes) */
178 struct if_irda_qos {
179 unsigned long baudrate;
180 unsigned short data_size;
181 unsigned short window_size;
182 unsigned short min_turn_time;
183 unsigned short max_turn_time;
184 unsigned char add_bofs;
185 unsigned char link_disc;
186 };
187
188 /* For setting RTS and DTR lines of a dongle */
189 struct if_irda_line {
190 __u8 dtr;
191 __u8 rts;
192 };
193
194 /* IrDA interface configuration (data part must not exceed 16 bytes) */
195 struct if_irda_req {
196 union {
197 char ifrn_name[IRNAMSIZ]; /* if name, e.g. "irda0" */
198 } ifr_ifrn;
199
200 /* Data part */
201 union {
202 struct if_irda_line ifru_line;
203 struct if_irda_qos ifru_qos;
204 unsigned short ifru_flags;
205 unsigned int ifru_receiving;
206 unsigned int ifru_mode;
207 unsigned int ifru_dongle;
208 } ifr_ifru;
209 };
210
211 #define ifr_baudrate ifr_ifru.ifru_qos.baudrate
212 #define ifr_receiving ifr_ifru.ifru_receiving
213 #define ifr_dongle ifr_ifru.ifru_dongle
214 #define ifr_mode ifr_ifru.ifru_mode
215 #define ifr_dtr ifr_ifru.ifru_line.dtr
216 #define ifr_rts ifr_ifru.ifru_line.rts
217
218 #endif /* KERNEL_IRDA_H */
219
220
221
222