Dr Andrew Scott G7VAV

My photo
 
June 2025
Mo Tu We Th Fr Sa Su
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 1 2 3 4 5 6


irda.h
001: /*********************************************************************
002:  *                
003:  * Filename:      irda.h
004:  * Version:       
005:  * Description:   
006:  * Status:        Experimental.
007:  * Author:        Dag Brattli <dagb@cs.uit.no>
008:  * Created at:    Mon Mar  8 14:06:12 1999
009:  * Modified at:   Sat Dec 25 16:06:42 1999
010:  * Modified by:   Dag Brattli <dagb@cs.uit.no>
011:  * 
012:  *     Copyright (c) 1999 Dag Brattli, All Rights Reserved.
013:  *      
014:  *     This program is free software; you can redistribute it and/or 
015:  *     modify it under the terms of the GNU General Public License as 
016:  *     published by the Free Software Foundation; either version 2 of 
017:  *     the License, or (at your option) any later version.
018:  *  
019:  *     Neither Dag Brattli nor University of Tromsø admit liability nor
020:  *     provide warranty for any of this software. This material is 
021:  *     provided "AS-IS" and at no charge.
022:  *
023:  ********************************************************************/
024: 
025: #ifndef KERNEL_IRDA_H
026: #define KERNEL_IRDA_H
027: 
028: #include <linux/types.h>
029: #include <linux/socket.h>
030: 
031: /* Note that this file is shared with user space. */
032: 
033: /* Hint bit positions for first hint byte */
034: #define HINT_PNP         0x01
035: #define HINT_PDA         0x02
036: #define HINT_COMPUTER    0x04
037: #define HINT_PRINTER     0x08
038: #define HINT_MODEM       0x10
039: #define HINT_FAX         0x20
040: #define HINT_LAN         0x40
041: #define HINT_EXTENSION   0x80
042: 
043: /* Hint bit positions for second hint byte (first extension byte) */
044: #define HINT_TELEPHONY   0x01
045: #define HINT_FILE_SERVER 0x02
046: #define HINT_COMM        0x04
047: #define HINT_MESSAGE     0x08
048: #define HINT_HTTP        0x10
049: #define HINT_OBEX        0x20
050: 
051: /* IrLMP character code values */
052: #define CS_ASCII         0x00
053: #define CS_ISO_8859_1    0x01
054: #define CS_ISO_8859_2    0x02
055: #define CS_ISO_8859_3    0x03
056: #define CS_ISO_8859_4    0x04
057: #define CS_ISO_8859_5    0x05
058: #define CS_ISO_8859_6    0x06
059: #define CS_ISO_8859_7    0x07
060: #define CS_ISO_8859_8    0x08
061: #define CS_ISO_8859_9    0x09
062: #define CS_UNICODE       0xff
063: 
064: /* These are the currently known dongles */
065: typedef enum {
066:         IRDA_TEKRAM_DONGLE       = 0,
067:         IRDA_ESI_DONGLE          = 1,
068:         IRDA_ACTISYS_DONGLE      = 2,
069:         IRDA_ACTISYS_PLUS_DONGLE = 3,
070:         IRDA_GIRBIL_DONGLE       = 4,
071:         IRDA_LITELINK_DONGLE     = 5,
072:         IRDA_AIRPORT_DONGLE      = 6,
073:         IRDA_OLD_BELKIN_DONGLE   = 7,
074:         IRDA_EP7211_IR           = 8,
075:         IRDA_MCP2120_DONGLE      = 9,
076:         IRDA_ACT200L_DONGLE      = 10,
077:         IRDA_MA600_DONGLE        = 11,
078:         IRDA_TOIM3232_DONGLE     = 12,
079:         IRDA_EP7211_DONGLE       = 13,
080: } IRDA_DONGLE;
081: 
082: /* Protocol types to be used for SOCK_DGRAM */
083: enum {
084:         IRDAPROTO_UNITDATA = 0,
085:         IRDAPROTO_ULTRA    = 1,
086:         IRDAPROTO_MAX
087: };
088: 
089: #define SOL_IRLMP      266 /* Same as SOL_IRDA for now */
090: #define SOL_IRTTP      266 /* Same as SOL_IRDA for now */
091: 
092: #define IRLMP_ENUMDEVICES        1      /* Return discovery log */
093: #define IRLMP_IAS_SET            2      /* Set an attribute in local IAS */
094: #define IRLMP_IAS_QUERY          3      /* Query remote IAS for attribute */
095: #define IRLMP_HINTS_SET          4      /* Set hint bits advertised */
096: #define IRLMP_QOS_SET            5
097: #define IRLMP_QOS_GET            6
098: #define IRLMP_MAX_SDU_SIZE       7
099: #define IRLMP_IAS_GET            8      /* Get an attribute from local IAS */
100: #define IRLMP_IAS_DEL            9      /* Remove attribute from local IAS */
101: #define IRLMP_HINT_MASK_SET     10      /* Set discovery filter */
102: #define IRLMP_WAITDEVICE        11      /* Wait for a new discovery */
103: 
104: #define IRTTP_MAX_SDU_SIZE IRLMP_MAX_SDU_SIZE /* Compatibility */
105: 
106: #define IAS_MAX_STRING         256      /* See IrLMP 1.1, 4.3.3.2 */
107: #define IAS_MAX_OCTET_STRING  1024      /* See IrLMP 1.1, 4.3.3.2 */
108: #define IAS_MAX_CLASSNAME       60      /* See IrLMP 1.1, 4.3.1 */
109: #define IAS_MAX_ATTRIBNAME      60      /* See IrLMP 1.1, 4.3.3.1 */
110: #define IAS_MAX_ATTRIBNUMBER   256      /* See IrLMP 1.1, 4.3.3.1 */
111: /* For user space backward compatibility - may be fixed in kernel 2.5.X
112:  * Note : need 60+1 ('\0'), make it 64 for alignement - Jean II */
113: #define IAS_EXPORT_CLASSNAME       64
114: #define IAS_EXPORT_ATTRIBNAME     256
115: 
116: /* Attribute type needed for struct irda_ias_set */
117: #define IAS_MISSING 0
118: #define IAS_INTEGER 1
119: #define IAS_OCT_SEQ 2
120: #define IAS_STRING  3
121: 
122: #define LSAP_ANY              0xff
123: 
124: struct sockaddr_irda {
125:         __kernel_sa_family_t sir_family; /* AF_IRDA */
126:         __u8        sir_lsap_sel; /* LSAP selector */
127:         __u32       sir_addr;     /* Device address */
128:         char        sir_name[25]; /* Usually <service>:IrDA:TinyTP */
129: };
130: 
131: struct irda_device_info {
132:         __u32       saddr;    /* Address of local interface */
133:         __u32       daddr;    /* Address of remote device */
134:         char        info[22]; /* Description */
135:         __u8        charset;  /* Charset used for description */
136:         __u8        hints[2]; /* Hint bits */
137: };
138: 
139: struct irda_device_list {
140:        __u32 len;
141:        struct irda_device_info dev[1];
142: };
143: 
144: struct irda_ias_set {
145:         char irda_class_name[IAS_EXPORT_CLASSNAME];
146:         char irda_attrib_name[IAS_EXPORT_ATTRIBNAME];
147:         unsigned int irda_attrib_type;
148:         union {
149:                 unsigned int irda_attrib_int;
150:                 struct {
151:                         unsigned short len;
152:                         __u8 octet_seq[IAS_MAX_OCTET_STRING];
153:                 } irda_attrib_octet_seq;
154:                 struct {
155:                         __u8 len;
156:                         __u8 charset;
157:                         __u8 string[IAS_MAX_STRING];
158:                 } irda_attrib_string;
159:         } attribute;
160:         __u32       daddr;    /* Address of device (for some queries only) */
161: };
162: 
163: /* Some private IOCTL's (max 16) */
164: #define SIOCSDONGLE    (SIOCDEVPRIVATE + 0)
165: #define SIOCGDONGLE    (SIOCDEVPRIVATE + 1)
166: #define SIOCSBANDWIDTH (SIOCDEVPRIVATE + 2)
167: #define SIOCSMEDIABUSY (SIOCDEVPRIVATE + 3)
168: #define SIOCGMEDIABUSY (SIOCDEVPRIVATE + 4)
169: #define SIOCGRECEIVING (SIOCDEVPRIVATE + 5)
170: #define SIOCSMODE      (SIOCDEVPRIVATE + 6)
171: #define SIOCGMODE      (SIOCDEVPRIVATE + 7)
172: #define SIOCSDTRRTS    (SIOCDEVPRIVATE + 8)
173: #define SIOCGQOS       (SIOCDEVPRIVATE + 9)
174: 
175: /* No reason to include <linux/if.h> just because of this one ;-) */
176: #define IRNAMSIZ 16 
177: 
178: /* IrDA quality of service information (must not exceed 16 bytes) */
179: struct if_irda_qos {
180:         unsigned long  baudrate;
181:         unsigned short data_size;
182:         unsigned short window_size;
183:         unsigned short min_turn_time;
184:         unsigned short max_turn_time;
185:         unsigned char  add_bofs;
186:         unsigned char  link_disc;
187: };
188: 
189: /* For setting RTS and DTR lines of a dongle */
190: struct if_irda_line {
191:         __u8 dtr;
192:         __u8 rts;
193: };
194: 
195: /* IrDA interface configuration (data part must not exceed 16 bytes) */
196: struct if_irda_req {
197:         union {
198:                 char ifrn_name[IRNAMSIZ];  /* if name, e.g. "irda0" */
199:         } ifr_ifrn;
200:         
201:         /* Data part */
202:         union {
203:                 struct if_irda_line ifru_line;
204:                 struct if_irda_qos  ifru_qos;
205:                 unsigned short      ifru_flags;
206:                 unsigned int        ifru_receiving;
207:                 unsigned int        ifru_mode;
208:                 unsigned int        ifru_dongle;
209:         } ifr_ifru;
210: };
211: 
212: #define ifr_baudrate  ifr_ifru.ifru_qos.baudrate
213: #define ifr_receiving ifr_ifru.ifru_receiving 
214: #define ifr_dongle    ifr_ifru.ifru_dongle
215: #define ifr_mode      ifr_ifru.ifru_mode
216: #define ifr_dtr       ifr_ifru.ifru_line.dtr
217: #define ifr_rts       ifr_ifru.ifru_line.rts
218: 
219: 
220: /* IrDA netlink definitions */
221: #define IRDA_NL_NAME "irda"
222: #define IRDA_NL_VERSION 1
223: 
224: enum irda_nl_commands {
225:         IRDA_NL_CMD_UNSPEC,
226:         IRDA_NL_CMD_SET_MODE,
227:         IRDA_NL_CMD_GET_MODE,
228: 
229:         __IRDA_NL_CMD_AFTER_LAST
230: };
231: #define IRDA_NL_CMD_MAX (__IRDA_NL_CMD_AFTER_LAST - 1)
232: 
233: enum nl80211_attrs {
234:         IRDA_NL_ATTR_UNSPEC,
235:         IRDA_NL_ATTR_IFNAME,
236:         IRDA_NL_ATTR_MODE,
237: 
238:         __IRDA_NL_ATTR_AFTER_LAST
239: };
240: #define IRDA_NL_ATTR_MAX (__IRDA_NL_ATTR_AFTER_LAST - 1)
241: 
242: /* IrDA modes */
243: #define IRDA_MODE_PRIMARY   0x1
244: #define IRDA_MODE_SECONDARY 0x2
245: #define IRDA_MODE_MONITOR   0x4
246: 
247: #endif /* KERNEL_IRDA_H */
248: 
249: 
250: 
251: 
252: 


for client (none)
© Andrew Scott 2006 - 2025,
All Rights Reserved
http://www.andrew-scott.uk/
Andrew Scott
http://www.andrew-scott.co.uk/