1 /*********************************************************************
2  *
3  * Filename:      irsyms.c
4  * Version:       0.9
5  * Description:   IrDA module symbols
6  * Status:        Experimental.
7  * Author:        Dag Brattli <dagb@cs.uit.no>
8  * Created at:    Mon Dec 15 13:55:39 1997
9  * Modified at:   Wed Jan  5 15:12:41 2000
10  * Modified by:   Dag Brattli <dagb@cs.uit.no>
11  *
12  *     Copyright (c) 1997, 1999-2000 Dag Brattli, All Rights Reserved.
13  *     Copyright (c) 2000-2001 Jean Tourrilhes <jt@hpl.hp.com>
14  *
15  *     This program is free software; you can redistribute it and/or
16  *     modify it under the terms of the GNU General Public License as
17  *     published by the Free Software Foundation; either version 2 of
18  *     the License, or (at your option) any later version.
19  *
20  *     Neither Dag Brattli nor University of Troms� admit liability nor
21  *     provide warranty for any of this software. This material is
22  *     provided "AS-IS" and at no charge.
23  *
24  ********************************************************************/
25 
26 #include <linux/config.h>
27 #include <linux/module.h>
28 
29 #include <linux/init.h>
30 #include <linux/poll.h>
31 #include <linux/proc_fs.h>
32 #include <linux/smp_lock.h>
33 
34 #include <asm/segment.h>
35 
36 #include <net/irda/irda.h>
37 #include <net/irda/irmod.h>
38 #include <net/irda/irlap.h>
39 #include <net/irda/irlmp.h>
40 #include <net/irda/iriap.h>
41 #include <net/irda/irias_object.h>
42 #include <net/irda/irttp.h>
43 #include <net/irda/irda_device.h>
44 #include <net/irda/wrapper.h>
45 #include <net/irda/timer.h>
46 #include <net/irda/parameters.h>
47 #include <net/irda/crc.h>
48 
49 extern struct proc_dir_entry *proc_irda;
50 
51 extern void irda_proc_register(void);
52 extern void irda_proc_unregister(void);
53 extern int  irda_sysctl_register(void);
54 extern void irda_sysctl_unregister(void);
55 
56 extern int irda_proto_init(void);
57 extern void irda_proto_cleanup(void);
58 
59 extern int irda_device_init(void);
60 extern int irlan_init(void);
61 extern int irlan_client_init(void);
62 extern int irlan_server_init(void);
63 extern int ircomm_init(void);
64 extern int ircomm_tty_init(void);
65 extern int irlpt_client_init(void);
66 extern int irlpt_server_init(void);
67 
68 /* IrTTP */
69 EXPORT_SYMBOL(irttp_open_tsap);
70 EXPORT_SYMBOL(irttp_close_tsap);
71 EXPORT_SYMBOL(irttp_connect_response);
72 EXPORT_SYMBOL(irttp_data_request);
73 EXPORT_SYMBOL(irttp_disconnect_request);
74 EXPORT_SYMBOL(irttp_flow_request);
75 EXPORT_SYMBOL(irttp_connect_request);
76 EXPORT_SYMBOL(irttp_udata_request);
77 EXPORT_SYMBOL(irttp_dup);
78 
79 /* Main IrDA module */
80 #ifdef CONFIG_IRDA_DEBUG
81 EXPORT_SYMBOL(irda_debug);
82 #endif
83 EXPORT_SYMBOL(irda_notify_init);
84 #ifdef CONFIG_PROC_FS
85 EXPORT_SYMBOL(proc_irda);
86 #endif
87 EXPORT_SYMBOL(irda_param_insert);
88 EXPORT_SYMBOL(irda_param_extract);
89 EXPORT_SYMBOL(irda_param_extract_all);
90 EXPORT_SYMBOL(irda_param_pack);
91 EXPORT_SYMBOL(irda_param_unpack);
92 
93 /* IrIAP/IrIAS */
94 EXPORT_SYMBOL(iriap_open);
95 EXPORT_SYMBOL(iriap_close);
96 EXPORT_SYMBOL(iriap_getvaluebyclass_request);
97 EXPORT_SYMBOL(irias_object_change_attribute);
98 EXPORT_SYMBOL(irias_add_integer_attrib);
99 EXPORT_SYMBOL(irias_add_octseq_attrib);
100 EXPORT_SYMBOL(irias_add_string_attrib);
101 EXPORT_SYMBOL(irias_insert_object);
102 EXPORT_SYMBOL(irias_new_object);
103 EXPORT_SYMBOL(irias_delete_object);
104 EXPORT_SYMBOL(irias_delete_value);
105 EXPORT_SYMBOL(irias_find_object);
106 EXPORT_SYMBOL(irias_find_attrib);
107 EXPORT_SYMBOL(irias_new_integer_value);
108 EXPORT_SYMBOL(irias_new_string_value);
109 EXPORT_SYMBOL(irias_new_octseq_value);
110 
111 /* IrLMP */
112 EXPORT_SYMBOL(irlmp_discovery_request);
113 EXPORT_SYMBOL(irlmp_get_discoveries);
114 EXPORT_SYMBOL(sysctl_discovery_timeout);
115 EXPORT_SYMBOL(irlmp_register_client);
116 EXPORT_SYMBOL(irlmp_unregister_client);
117 EXPORT_SYMBOL(irlmp_update_client);
118 EXPORT_SYMBOL(irlmp_register_service);
119 EXPORT_SYMBOL(irlmp_unregister_service);
120 EXPORT_SYMBOL(irlmp_service_to_hint);
121 EXPORT_SYMBOL(irlmp_data_request);
122 EXPORT_SYMBOL(irlmp_open_lsap);
123 EXPORT_SYMBOL(irlmp_close_lsap);
124 EXPORT_SYMBOL(irlmp_connect_request);
125 EXPORT_SYMBOL(irlmp_connect_response);
126 EXPORT_SYMBOL(irlmp_disconnect_request);
127 EXPORT_SYMBOL(irlmp_get_daddr);
128 EXPORT_SYMBOL(irlmp_get_saddr);
129 EXPORT_SYMBOL(irlmp_dup);
130 EXPORT_SYMBOL(lmp_reasons);
131 
132 /* Queue */
133 EXPORT_SYMBOL(hashbin_find);
134 EXPORT_SYMBOL(hashbin_new);
135 EXPORT_SYMBOL(hashbin_insert);
136 EXPORT_SYMBOL(hashbin_delete);
137 EXPORT_SYMBOL(hashbin_remove);
138 EXPORT_SYMBOL(hashbin_remove_this);
139 EXPORT_SYMBOL(hashbin_get_next);
140 EXPORT_SYMBOL(hashbin_get_first);
141 
142 /* IrLAP */
143 EXPORT_SYMBOL(irlap_open);
144 EXPORT_SYMBOL(irlap_close);
145 EXPORT_SYMBOL(irda_init_max_qos_capabilies);
146 EXPORT_SYMBOL(irda_qos_bits_to_value);
147 EXPORT_SYMBOL(irda_device_setup);
148 EXPORT_SYMBOL(irda_device_set_media_busy);
149 EXPORT_SYMBOL(irda_device_txqueue_empty);
150 
151 EXPORT_SYMBOL(irda_device_dongle_init);
152 EXPORT_SYMBOL(irda_device_dongle_cleanup);
153 EXPORT_SYMBOL(irda_device_register_dongle);
154 EXPORT_SYMBOL(irda_device_unregister_dongle);
155 EXPORT_SYMBOL(irda_task_execute);
156 EXPORT_SYMBOL(irda_task_kick);
157 EXPORT_SYMBOL(irda_task_next_state);
158 EXPORT_SYMBOL(irda_task_delete);
159 
160 EXPORT_SYMBOL(async_wrap_skb);
161 EXPORT_SYMBOL(async_unwrap_char);
162 EXPORT_SYMBOL(irda_calc_crc16);
163 EXPORT_SYMBOL(irda_crc16_table);
164 EXPORT_SYMBOL(irda_start_timer);
165 EXPORT_SYMBOL(setup_dma);
166 EXPORT_SYMBOL(infrared_mode);
167 
168 #ifdef CONFIG_IRTTY
169 EXPORT_SYMBOL(irtty_set_dtr_rts);
170 EXPORT_SYMBOL(irtty_register_dongle);
171 EXPORT_SYMBOL(irtty_unregister_dongle);
172 EXPORT_SYMBOL(irtty_set_packet_mode);
173 #endif
174 
irda_init(void)175 int __init irda_init(void)
176 {
177 	IRDA_DEBUG(0, "%s()\n", __FUNCTION__);
178 
179  	irlmp_init();
180 	irlap_init();
181 
182 	iriap_init();
183  	irttp_init();
184 
185 #ifdef CONFIG_PROC_FS
186 	irda_proc_register();
187 #endif
188 #ifdef CONFIG_SYSCTL
189 	irda_sysctl_register();
190 #endif
191 	/*
192 	 * Initialize modules that got compiled into the kernel
193 	 */
194 #ifdef CONFIG_IRLAN
195 	irlan_init();
196 #endif
197 #ifdef CONFIG_IRCOMM
198 	ircomm_init();
199 	ircomm_tty_init();
200 #endif
201 	return 0;
202 }
203 
irda_cleanup(void)204 void __exit irda_cleanup(void)
205 {
206 #ifdef CONFIG_SYSCTL
207 	irda_sysctl_unregister();
208 #endif
209 
210 #ifdef CONFIG_PROC_FS
211 	irda_proc_unregister();
212 #endif
213 	/* Remove higher layers */
214 	irttp_cleanup();
215 	iriap_cleanup();
216 
217 	/* Remove lower layers */
218 	irda_device_cleanup();
219 	irlap_cleanup(); /* Must be done before irlmp_cleanup()! DB */
220 
221 	/* Remove middle layer */
222 	irlmp_cleanup();
223 }
224 
225 /*
226  * Function irda_notify_init (notify)
227  *
228  *    Used for initializing the notify structure
229  *
230  */
irda_notify_init(notify_t * notify)231 void irda_notify_init(notify_t *notify)
232 {
233 	notify->data_indication = NULL;
234 	notify->udata_indication = NULL;
235 	notify->connect_confirm = NULL;
236 	notify->connect_indication = NULL;
237 	notify->disconnect_indication = NULL;
238 	notify->flow_indication = NULL;
239 	notify->status_indication = NULL;
240 	notify->instance = NULL;
241 	strncpy(notify->name, "Unknown", NOTIFY_MAX_NAME);
242 }
243 
244