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#ifndef NET_IRDA_H
27#define NET_IRDA_H
28
29#include <linux/skbuff.h>
30#include <linux/kernel.h>
31#include <linux/if.h>
32#include <linux/irda.h>
33
34typedef __u32 magic_t;
35
36#ifndef TRUE
37#define TRUE 1
38#endif
39
40#ifndef FALSE
41#define FALSE 0
42#endif
43
44
45#ifndef SMALL
46#define SMALL 5
47#endif
48
49#ifndef IRDA_MIN
50#define IRDA_MIN(a, b) (((a) < (b)) ? (a) : (b))
51#endif
52
53#ifndef IRDA_ALIGN
54# define IRDA_ALIGN __attribute__((aligned))
55#endif
56#ifndef IRDA_PACK
57# define IRDA_PACK __attribute__((packed))
58#endif
59
60
61#ifdef CONFIG_IRDA_DEBUG
62
63extern unsigned int irda_debug;
64
65
66#define IRDA_DEBUG_LEVEL 0
67
68#define IRDA_DEBUG(n, args...) \
69do { if (irda_debug >= (n)) \
70 printk(KERN_DEBUG args); \
71} while (0)
72#define IRDA_ASSERT(expr, func) \
73do { if(!(expr)) { \
74 printk( "Assertion failed! %s:%s:%d %s\n", \
75 __FILE__,__func__,__LINE__,(#expr) ); \
76 func } } while (0)
77#define IRDA_ASSERT_LABEL(label) label
78#else
79#define IRDA_DEBUG(n, args...) do { } while (0)
80#define IRDA_ASSERT(expr, func) do { (void)(expr); } while (0)
81#define IRDA_ASSERT_LABEL(label)
82#endif
83
84#define IRDA_WARNING(args...) do { if (net_ratelimit()) printk(KERN_WARNING args); } while (0)
85#define IRDA_MESSAGE(args...) do { if (net_ratelimit()) printk(KERN_INFO args); } while (0)
86#define IRDA_ERROR(args...) do { if (net_ratelimit()) printk(KERN_ERR args); } while (0)
87
88
89
90
91
92
93#define IRTTY_MAGIC 0x2357
94#define LAP_MAGIC 0x1357
95#define LMP_MAGIC 0x4321
96#define LMP_LSAP_MAGIC 0x69333
97#define LMP_LAP_MAGIC 0x3432
98#define IRDA_DEVICE_MAGIC 0x63454
99#define IAS_MAGIC 0x007
100#define TTP_MAGIC 0x241169
101#define TTP_TSAP_MAGIC 0x4345
102#define IROBEX_MAGIC 0x341324
103#define HB_MAGIC 0x64534
104#define IRLAN_MAGIC 0x754
105#define IAS_OBJECT_MAGIC 0x34234
106#define IAS_ATTRIB_MAGIC 0x45232
107#define IRDA_TASK_MAGIC 0x38423
108
109#define IAS_DEVICE_ID 0x0000
110#define IAS_PNP_ID 0xd342
111#define IAS_OBEX_ID 0x34323
112#define IAS_IRLAN_ID 0x34234
113#define IAS_IRCOMM_ID 0x2343
114#define IAS_IRLPT_ID 0x9876
115
116struct net_device;
117struct packet_type;
118
119extern void irda_proc_register(void);
120extern void irda_proc_unregister(void);
121
122extern int irda_sysctl_register(void);
123extern void irda_sysctl_unregister(void);
124
125extern int irsock_init(void);
126extern void irsock_cleanup(void);
127
128extern int irda_nl_register(void);
129extern void irda_nl_unregister(void);
130
131extern int irlap_driver_rcv(struct sk_buff *skb, struct net_device *dev,
132 struct packet_type *ptype,
133 struct net_device *orig_dev);
134
135#endif
136