Import 2.3.25pre1
[davej-history.git] / include / linux / irda.h
blob712b2aa9ab039740184c041c4192b2d7ea6f51c4
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: Sun Oct 10 23:00:59 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 * 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.
23 ********************************************************************/
25 #ifndef KERNEL_IRDA_H
26 #define KERNEL_IRDA_H
28 /* Hint bit positions for first hint byte */
29 #define HINT_PNP 0x01
30 #define HINT_PDA 0x02
31 #define HINT_COMPUTER 0x04
32 #define HINT_PRINTER 0x08
33 #define HINT_MODEM 0x10
34 #define HINT_FAX 0x20
35 #define HINT_LAN 0x40
36 #define HINT_EXTENSION 0x80
38 /* Hint bit positions for second hint byte (first extension byte) */
39 #define HINT_TELEPHONY 0x01
40 #define HINT_FILE_SERVER 0x02
41 #define HINT_COMM 0x04
42 #define HINT_MESSAGE 0x08
43 #define HINT_HTTP 0x10
44 #define HINT_OBEX 0x20
46 /* IrLMP character code values */
47 #define CS_ASCII 0x00
48 #define CS_ISO_8859_1 0x01
49 #define CS_ISO_8859_2 0x02
50 #define CS_ISO_8859_3 0x03
51 #define CS_ISO_8859_4 0x04
52 #define CS_ISO_8859_5 0x05
53 #define CS_ISO_8859_6 0x06
54 #define CS_ISO_8859_7 0x07
55 #define CS_ISO_8859_8 0x08
56 #define CS_ISO_8859_9 0x09
57 #define CS_UNICODE 0xff
59 /* These are the currently known dongles */
60 typedef enum {
61 IRDA_TEKRAM_DONGLE,
62 IRDA_ESI_DONGLE,
63 IRDA_ACTISYS_DONGLE,
64 IRDA_ACTISYS_PLUS_DONGLE,
65 IRDA_GIRBIL_DONGLE,
66 IRDA_LITELINK_DONGLE,
67 IRDA_AIRPORT_DONGLE,
68 } IRDA_DONGLE;
70 #define SOL_IRLMP 266 /* Same as SOL_IRDA for now */
71 #define SOL_IRTTP 266 /* Same as SOL_IRDA for now */
73 #define IRLMP_ENUMDEVICES 1
74 #define IRLMP_IAS_SET 2
75 #define IRLMP_IAS_QUERY 3
76 #define IRLMP_DISCOVERY_MASK_SET 4
78 #define IRTTP_QOS_SET 5
79 #define IRTTP_QOS_GET 6
80 #define IRTTP_MAX_SDU_SIZE 7
82 #define IAS_MAX_STRING 256
83 #define IAS_MAX_OCTET_STRING 1024
84 #define IAS_MAX_CLASSNAME 64
85 #define IAS_MAX_ATTRIBNAME 256
87 #define LSAP_ANY 0xff
89 struct sockaddr_irda {
90 sa_family_t sir_family; /* AF_IRDA */
91 unsigned char sir_lsap_sel; /* LSAP/TSAP selector */
92 unsigned int sir_addr; /* Device address */
93 char sir_name[25]; /* Usually <service>:IrDA:TinyTP */
96 struct irda_device_info {
97 unsigned int saddr; /* Address of remote device */
98 unsigned int daddr; /* Link where it was discovered */
99 char info[22]; /* Description */
100 unsigned char charset; /* Charset used for description */
101 unsigned char hints[2]; /* Hint bits */
104 struct irda_device_list {
105 unsigned int len;
106 struct irda_device_info dev[1];
109 struct irda_ias_set {
110 char irda_class_name[IAS_MAX_CLASSNAME];
111 char irda_attrib_name[IAS_MAX_ATTRIBNAME];
112 unsigned int irda_attrib_type;
113 union {
114 unsigned int irda_attrib_int;
115 struct {
116 unsigned short len;
117 u_char OctetSeq[IAS_MAX_OCTET_STRING];
118 } irda_attrib_octet_seq;
119 struct {
120 unsigned char len;
121 unsigned char charset;
122 unsigned char string[IAS_MAX_STRING];
123 } irda_attrib_string;
124 } attribute;
127 /* Some private IOCTL's (max 16) */
128 #define SIOCSDONGLE (SIOCDEVPRIVATE + 0)
129 #define SIOCGDONGLE (SIOCDEVPRIVATE + 1)
130 #define SIOCSBANDWIDTH (SIOCDEVPRIVATE + 2)
131 #define SIOCSMEDIABUSY (SIOCDEVPRIVATE + 3)
132 #define SIOCGMEDIABUSY (SIOCDEVPRIVATE + 4)
133 #define SIOCGRECEIVING (SIOCDEVPRIVATE + 5)
134 #define SIOCSRAWMODE (SIOCDEVPRIVATE + 6)
135 #define SIOCSDTRRTS (SIOCDEVPRIVATE + 7)
136 #define SIOCGQOS (SIOCDEVPRIVATE + 8)
138 /* No reason to include <linux/if.h> just because of this one ;-) */
139 #define IRNAMSIZ 16
141 /* IrDA quality of service information (must not exceed 16 bytes) */
142 struct if_irda_qos {
143 unsigned long baudrate;
144 unsigned short data_size;
145 unsigned short window_size;
146 unsigned short min_turn_time;
147 unsigned short max_turn_time;
148 unsigned char add_bofs;
149 unsigned char link_disc;
152 /* For setting RTS and DTR lines of a dongle */
153 struct if_irda_line {
154 unsigned char dtr;
155 unsigned char rts;
158 /* IrDA interface configuration (data part must not exceed 16 bytes) */
159 struct if_irda_req {
160 union {
161 char ifrn_name[IRNAMSIZ]; /* if name, e.g. "irda0" */
162 } ifr_ifrn;
164 /* Data part */
165 union {
166 struct if_irda_line ifru_line;
167 struct if_irda_qos ifru_qos;
168 unsigned short ifru_flags;
169 unsigned int ifru_receiving;
170 unsigned int ifru_raw_mode;
171 unsigned int ifru_dongle;
172 } ifr_ifru;
175 #define ifr_baudrate ifr_ifru.ifru_qos.baudrate
176 #define ifr_receiving ifr_ifru.ifru_receiving
177 #define ifr_dongle ifr_ifru.ifru_dongle
178 #define ifr_raw_mode ifr_ifru.ifru_raw_mode
179 #define ifr_dtr ifr_ifru.ifru_line.dtr
180 #define ifr_rts ifr_ifru.ifru_line.rts
182 #endif /* KERNEL_IRDA_H */