1 /*********************************************************************
5 * Description: IrDA header file to be used by IrDA applications
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:07:54 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 ********************************************************************/
33 #include <sys/types.h>
36 /* Hint bit positions for first hint byte */
39 #define HINT_COMPUTER 0x04
40 #define HINT_PRINTER 0x08
41 #define HINT_MODEM 0x10
44 #define HINT_EXTENSION 0x80
46 /* Hint bit positions for second hint byte (first extension byte) */
47 #define HINT_TELEPHONY 0x01
48 #define HINT_FILE_SERVER 0x02
49 #define HINT_COMM 0x04
50 #define HINT_MESSAGE 0x08
51 #define HINT_HTTP 0x10
52 #define HINT_OBEX 0x20
54 /* IrLMP character code values */
56 #define CS_ISO_8859_1 0x01
57 #define CS_ISO_8859_2 0x02
58 #define CS_ISO_8859_3 0x03
59 #define CS_ISO_8859_4 0x04
60 #define CS_ISO_8859_5 0x05
61 #define CS_ISO_8859_6 0x06
62 #define CS_ISO_8859_7 0x07
63 #define CS_ISO_8859_8 0x08
64 #define CS_ISO_8859_9 0x09
65 #define CS_UNICODE 0xff
67 /* These are the currently known dongles */
69 IRDA_TEKRAM_DONGLE = 0,
71 IRDA_ACTISYS_DONGLE = 2,
72 IRDA_ACTISYS_PLUS_DONGLE = 3,
73 IRDA_GIRBIL_DONGLE = 4,
74 IRDA_LITELINK_DONGLE = 5,
75 IRDA_AIRPORT_DONGLE = 6,
76 IRDA_OLD_BELKIN_DONGLE = 7,
79 /* Protocol types to be used for SOCK_DGRAM */
81 IRDAPROTO_UNITDATA = 0,
86 #define SOL_IRLMP 266 /* Same as SOL_IRDA for now */
87 #define SOL_IRTTP 266 /* Same as SOL_IRDA for now */
89 #define IRLMP_ENUMDEVICES 1
90 #define IRLMP_IAS_SET 2
91 #define IRLMP_IAS_QUERY 3
92 #define IRLMP_HINTS_SET 4
93 #define IRLMP_QOS_SET 5
94 #define IRLMP_QOS_GET 6
95 #define IRLMP_MAX_SDU_SIZE 7
96 #define IRLMP_IAS_GET 8
98 #define IRTTP_MAX_SDU_SIZE IRLMP_MAX_SDU_SIZE /* Compatibility */
101 #define IAS_MAX_STRING 256
102 #define IAS_MAX_OCTET_STRING 1024
103 #define IAS_MAX_CLASSNAME 64
104 #define IAS_MAX_ATTRIBNAME 256
106 /* LM-IAS Attribute types */
107 #define IAS_MISSING 0
108 #define IAS_INTEGER 1
109 #define IAS_OCT_SEQ 2
112 #define LSAP_ANY 0xff
113 #define DEV_ADDR_ANY 0xffffffff
115 struct sockaddr_irda {
116 sa_family_t sir_family; /* AF_IRDA */
117 uint8_t sir_lsap_sel; /* LSAP selector */
118 uint32_t sir_addr; /* Device address */
119 char sir_name[25]; /* Usually <service>:IrDA:TinyTP */
122 struct irda_device_info {
123 uint32_t saddr; /* Address of local interface */
124 uint32_t daddr; /* Address of remote device */
125 char info[22]; /* Description */
126 uint8_t charset; /* Charset used for description */
127 uint8_t hints[2]; /* Hint bits */
130 struct irda_device_list {
132 struct irda_device_info dev[1];
135 struct irda_ias_set {
136 char irda_class_name[IAS_MAX_CLASSNAME];
137 char irda_attrib_name[IAS_MAX_ATTRIBNAME];
138 unsigned int irda_attrib_type;
140 unsigned int irda_attrib_int;
143 u_char octet_seq[IAS_MAX_OCTET_STRING];
144 } irda_attrib_octet_seq;
147 unsigned char charset;
148 unsigned char string[IAS_MAX_STRING];
149 } irda_attrib_string;
155 /* Some private IOCTL's (max 16) */
156 #define SIOCSDONGLE (SIOCDEVPRIVATE + 0)
157 #define SIOCGDONGLE (SIOCDEVPRIVATE + 1)
158 #define SIOCSBANDWIDTH (SIOCDEVPRIVATE + 2)
159 #define SIOCSMEDIABUSY (SIOCDEVPRIVATE + 3)
160 #define SIOCGMEDIABUSY (SIOCDEVPRIVATE + 4)
161 #define SIOCGRECEIVING (SIOCDEVPRIVATE + 5)
162 #define SIOCSMODE (SIOCDEVPRIVATE + 6)
163 #define SIOCGMODE (SIOCDEVPRIVATE + 7)
164 #define SIOCSDTRRTS (SIOCDEVPRIVATE + 8)
165 #define SIOCGQOS (SIOCDEVPRIVATE + 9)
167 /* No reason to include <linux/if.h> just because of this one ;-) */
170 /* IrDA quality of service information (must not exceed 16 bytes) */
174 uint16_t window_size;
175 uint16_t min_turn_time;
176 uint16_t max_turn_time;
181 /* For setting RTS and DTR lines of a dongle */
182 struct if_irda_line {
187 /* IrDA interface configuration (data part must not exceed 16 bytes) */
190 char ifrn_name[IRNAMSIZ]; /* if name, e.g. "irda0" */
195 struct if_irda_line ifru_line;
196 struct if_irda_qos ifru_qos;
197 unsigned short ifru_flags;
198 unsigned int ifru_receiving;
199 unsigned int ifru_mode;
200 unsigned int ifru_dongle;
204 #define ifr_baudrate ifr_ifru.ifru_qos.baudrate
205 #define ifr_receiving ifr_ifru.ifru_receiving
206 #define ifr_dongle ifr_ifru.ifru_dongle
207 #define ifr_mode ifr_ifru.ifru_mode
208 #define ifr_dtr ifr_ifru.ifru_line.dtr
209 #define ifr_rts ifr_ifru.ifru_line.rts