Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

linux/irda.h

Go to the documentation of this file.
00001 /*********************************************************************
00002  *                
00003  * Filename:      irda.h
00004  * Version:       
00005  * Description:   
00006  * Status:        Experimental.
00007  * Author:        Dag Brattli <dagb@cs.uit.no>
00008  * Created at:    Mon Mar  8 14:06:12 1999
00009  * Modified at:   Sat Dec 25 16:06:42 1999
00010  * Modified by:   Dag Brattli <dagb@cs.uit.no>
00011  * 
00012  *     Copyright (c) 1999 Dag Brattli, All Rights Reserved.
00013  *      
00014  *     This program is free software; you can redistribute it and/or 
00015  *     modify it under the terms of the GNU General Public License as 
00016  *     published by the Free Software Foundation; either version 2 of 
00017  *     the License, or (at your option) any later version.
00018  *  
00019  *     Neither Dag Brattli nor University of Tromsų admit liability nor
00020  *     provide warranty for any of this software. This material is 
00021  *     provided "AS-IS" and at no charge.
00022  *
00023  ********************************************************************/
00024 
00025 #ifndef KERNEL_IRDA_H
00026 #define KERNEL_IRDA_H
00027 
00028 /* Hint bit positions for first hint byte */
00029 #define HINT_PNP         0x01
00030 #define HINT_PDA         0x02
00031 #define HINT_COMPUTER    0x04
00032 #define HINT_PRINTER     0x08
00033 #define HINT_MODEM       0x10
00034 #define HINT_FAX         0x20
00035 #define HINT_LAN         0x40
00036 #define HINT_EXTENSION   0x80
00037 
00038 /* Hint bit positions for second hint byte (first extension byte) */
00039 #define HINT_TELEPHONY   0x01
00040 #define HINT_FILE_SERVER 0x02
00041 #define HINT_COMM        0x04
00042 #define HINT_MESSAGE     0x08
00043 #define HINT_HTTP        0x10
00044 #define HINT_OBEX        0x20
00045 
00046 /* IrLMP character code values */
00047 #define CS_ASCII         0x00
00048 #define CS_ISO_8859_1    0x01
00049 #define CS_ISO_8859_2    0x02
00050 #define CS_ISO_8859_3    0x03
00051 #define CS_ISO_8859_4    0x04
00052 #define CS_ISO_8859_5    0x05
00053 #define CS_ISO_8859_6    0x06
00054 #define CS_ISO_8859_7    0x07
00055 #define CS_ISO_8859_8    0x08
00056 #define CS_ISO_8859_9    0x09
00057 #define CS_UNICODE       0xff
00058 
00059 /* These are the currently known dongles */
00060 typedef enum {
00061         IRDA_TEKRAM_DONGLE       = 0,
00062         IRDA_ESI_DONGLE          = 1,
00063         IRDA_ACTISYS_DONGLE      = 2,
00064         IRDA_ACTISYS_PLUS_DONGLE = 3,
00065         IRDA_GIRBIL_DONGLE       = 4,
00066         IRDA_LITELINK_DONGLE     = 5,
00067         IRDA_AIRPORT_DONGLE      = 6,
00068         IRDA_OLD_BELKIN_DONGLE   = 7,
00069 } IRDA_DONGLE;
00070 
00071 /* Protocol types to be used for SOCK_DGRAM */
00072 enum {
00073         IRDAPROTO_UNITDATA = 0,
00074         IRDAPROTO_ULTRA    = 1,
00075         IRDAPROTO_MAX
00076 };
00077 
00078 #define SOL_IRLMP      266 /* Same as SOL_IRDA for now */
00079 #define SOL_IRTTP      266 /* Same as SOL_IRDA for now */
00080 
00081 #define IRLMP_ENUMDEVICES        1
00082 #define IRLMP_IAS_SET            2
00083 #define IRLMP_IAS_QUERY          3
00084 #define IRLMP_HINTS_SET          4
00085 #define IRLMP_QOS_SET            5
00086 #define IRLMP_QOS_GET            6
00087 #define IRLMP_MAX_SDU_SIZE       7
00088 #define IRLMP_IAS_GET            8
00089 
00090 #define IRTTP_MAX_SDU_SIZE IRLMP_MAX_SDU_SIZE /* Compatibility */
00091 
00092 #define IAS_MAX_STRING         256
00093 #define IAS_MAX_OCTET_STRING  1024
00094 #define IAS_MAX_CLASSNAME       64
00095 #define IAS_MAX_ATTRIBNAME     256
00096 
00097 #define LSAP_ANY              0xff
00098 
00099 struct sockaddr_irda {
00100         sa_family_t sir_family;   /* AF_IRDA */
00101         __u8        sir_lsap_sel; /* LSAP selector */
00102         __u32       sir_addr;     /* Device address */
00103         char        sir_name[25]; /* Usually <service>:IrDA:TinyTP */
00104 };
00105 
00106 struct irda_device_info {
00107         __u32       saddr;    /* Address of local interface */
00108         __u32       daddr;    /* Address of remote device */
00109         char        info[22]; /* Description */
00110         __u8        charset;  /* Charset used for description */
00111         __u8        hints[2]; /* Hint bits */
00112 };
00113 
00114 struct irda_device_list {
00115        __u32 len;
00116        struct irda_device_info dev[1];
00117 };
00118 
00119 struct irda_ias_set {
00120         char irda_class_name[IAS_MAX_CLASSNAME];
00121         char irda_attrib_name[IAS_MAX_ATTRIBNAME];
00122         unsigned int irda_attrib_type;
00123         union {
00124                 unsigned int irda_attrib_int;
00125                 struct {
00126                         unsigned short len;
00127                         __u8 octet_seq[IAS_MAX_OCTET_STRING];
00128                 } irda_attrib_octet_seq;
00129                 struct {
00130                         __u8 len;
00131                         __u8 charset;
00132                         __u8 string[IAS_MAX_STRING];
00133                 } irda_attrib_string;
00134         } attribute;
00135 };
00136 
00137 /* Some private IOCTL's (max 16) */
00138 #define SIOCSDONGLE    (SIOCDEVPRIVATE + 0)
00139 #define SIOCGDONGLE    (SIOCDEVPRIVATE + 1)
00140 #define SIOCSBANDWIDTH (SIOCDEVPRIVATE + 2)
00141 #define SIOCSMEDIABUSY (SIOCDEVPRIVATE + 3)
00142 #define SIOCGMEDIABUSY (SIOCDEVPRIVATE + 4)
00143 #define SIOCGRECEIVING (SIOCDEVPRIVATE + 5)
00144 #define SIOCSMODE      (SIOCDEVPRIVATE + 6)
00145 #define SIOCGMODE      (SIOCDEVPRIVATE + 7)
00146 #define SIOCSDTRRTS    (SIOCDEVPRIVATE + 8)
00147 #define SIOCGQOS       (SIOCDEVPRIVATE + 9)
00148 
00149 /* No reason to include <linux/if.h> just because of this one ;-) */
00150 #define IRNAMSIZ 16 
00151 
00152 /* IrDA quality of service information (must not exceed 16 bytes) */
00153 struct if_irda_qos {
00154         unsigned long  baudrate;
00155         unsigned short data_size;
00156         unsigned short window_size;
00157         unsigned short min_turn_time;
00158         unsigned short max_turn_time;
00159         unsigned char  add_bofs;
00160         unsigned char  link_disc;
00161 };
00162 
00163 /* For setting RTS and DTR lines of a dongle */
00164 struct if_irda_line {
00165         __u8 dtr;
00166         __u8 rts;
00167 };
00168 
00169 /* IrDA interface configuration (data part must not exceed 16 bytes) */
00170 struct if_irda_req {
00171         union {
00172                 char ifrn_name[IRNAMSIZ];  /* if name, e.g. "irda0" */
00173         } ifr_ifrn;
00174         
00175         /* Data part */
00176         union {
00177                 struct if_irda_line ifru_line;
00178                 struct if_irda_qos  ifru_qos;
00179                 unsigned short      ifru_flags;
00180                 unsigned int        ifru_receiving;
00181                 unsigned int        ifru_mode;
00182                 unsigned int        ifru_dongle;
00183         } ifr_ifru;
00184 };
00185 
00186 #define ifr_baudrate  ifr_ifru.ifru_qos.baudrate
00187 #define ifr_receiving ifr_ifru.ifru_receiving 
00188 #define ifr_dongle    ifr_ifru.ifru_dongle
00189 #define ifr_mode      ifr_ifru.ifru_mode
00190 #define ifr_dtr       ifr_ifru.ifru_line.dtr
00191 #define ifr_rts       ifr_ifru.ifru_line.rts
00192 
00193 #endif /* KERNEL_IRDA_H */
00194 
00195 
00196 
00197