~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/net/irda/irsyms.c

Version: ~ [ linux-5.1-rc1 ] ~ [ linux-5.0.3 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.30 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.107 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.164 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.176 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.136 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.63 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.39.4 ] ~ [ linux-2.6.38.8 ] ~ [ linux-2.6.37.6 ] ~ [ linux-2.6.36.4 ] ~ [ linux-2.6.35.14 ] ~ [ linux-2.6.34.15 ] ~ [ linux-2.6.33.20 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  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 #include <linux/if_arp.h>               /* ARPHRD_IRDA */
 34 
 35 #include <net/irda/irda.h>
 36 #include <net/irda/irlap.h>
 37 #include <net/irda/irlmp.h>
 38 #include <net/irda/iriap.h>
 39 #include <net/irda/irias_object.h>
 40 #include <net/irda/irttp.h>
 41 #include <net/irda/irda_device.h>
 42 #include <net/irda/wrapper.h>
 43 #include <net/irda/timer.h>
 44 #include <net/irda/parameters.h>
 45 #include <net/irda/crc.h>
 46 
 47 extern struct proc_dir_entry *proc_irda;
 48 
 49 extern void irda_proc_register(void);
 50 extern void irda_proc_unregister(void);
 51 extern int  irda_sysctl_register(void);
 52 extern void irda_sysctl_unregister(void);
 53 
 54 extern int irda_proto_init(void);
 55 extern void irda_proto_cleanup(void);
 56 
 57 extern int irda_device_init(void);
 58 extern int irlan_init(void);
 59 extern int irlan_client_init(void);
 60 extern int irlan_server_init(void);
 61 extern int ircomm_init(void);
 62 extern int ircomm_tty_init(void);
 63 extern int irlpt_client_init(void);
 64 extern int irlpt_server_init(void);
 65 
 66 extern int  irsock_init(void);
 67 extern void irsock_cleanup(void);
 68 extern int  irlap_driver_rcv(struct sk_buff *, struct net_device *, 
 69                              struct packet_type *);
 70 
 71 /* IrTTP */
 72 EXPORT_SYMBOL(irttp_open_tsap);
 73 EXPORT_SYMBOL(irttp_close_tsap);
 74 EXPORT_SYMBOL(irttp_connect_response);
 75 EXPORT_SYMBOL(irttp_data_request);
 76 EXPORT_SYMBOL(irttp_disconnect_request);
 77 EXPORT_SYMBOL(irttp_flow_request);
 78 EXPORT_SYMBOL(irttp_connect_request);
 79 EXPORT_SYMBOL(irttp_udata_request);
 80 EXPORT_SYMBOL(irttp_dup);
 81 
 82 /* Main IrDA module */
 83 #ifdef CONFIG_IRDA_DEBUG
 84 EXPORT_SYMBOL(irda_debug);
 85 #endif
 86 EXPORT_SYMBOL(irda_notify_init);
 87 #ifdef CONFIG_PROC_FS
 88 EXPORT_SYMBOL(proc_irda);
 89 #endif
 90 EXPORT_SYMBOL(irda_param_insert);
 91 EXPORT_SYMBOL(irda_param_extract);
 92 EXPORT_SYMBOL(irda_param_extract_all);
 93 EXPORT_SYMBOL(irda_param_pack);
 94 EXPORT_SYMBOL(irda_param_unpack);
 95 
 96 /* IrIAP/IrIAS */
 97 EXPORT_SYMBOL(iriap_open);
 98 EXPORT_SYMBOL(iriap_close);
 99 EXPORT_SYMBOL(iriap_getvaluebyclass_request);
100 EXPORT_SYMBOL(irias_object_change_attribute);
101 EXPORT_SYMBOL(irias_add_integer_attrib);
102 EXPORT_SYMBOL(irias_add_octseq_attrib);
103 EXPORT_SYMBOL(irias_add_string_attrib);
104 EXPORT_SYMBOL(irias_insert_object);
105 EXPORT_SYMBOL(irias_new_object);
106 EXPORT_SYMBOL(irias_delete_object);
107 EXPORT_SYMBOL(irias_delete_value);
108 EXPORT_SYMBOL(irias_find_object);
109 EXPORT_SYMBOL(irias_find_attrib);
110 EXPORT_SYMBOL(irias_new_integer_value);
111 EXPORT_SYMBOL(irias_new_string_value);
112 EXPORT_SYMBOL(irias_new_octseq_value);
113 
114 /* IrLMP */
115 EXPORT_SYMBOL(irlmp_discovery_request);
116 EXPORT_SYMBOL(irlmp_get_discoveries);
117 EXPORT_SYMBOL(sysctl_discovery_timeout);
118 EXPORT_SYMBOL(irlmp_register_client);
119 EXPORT_SYMBOL(irlmp_unregister_client);
120 EXPORT_SYMBOL(irlmp_update_client);
121 EXPORT_SYMBOL(irlmp_register_service);
122 EXPORT_SYMBOL(irlmp_unregister_service);
123 EXPORT_SYMBOL(irlmp_service_to_hint);
124 EXPORT_SYMBOL(irlmp_data_request);
125 EXPORT_SYMBOL(irlmp_open_lsap);
126 EXPORT_SYMBOL(irlmp_close_lsap);
127 EXPORT_SYMBOL(irlmp_connect_request);
128 EXPORT_SYMBOL(irlmp_connect_response);
129 EXPORT_SYMBOL(irlmp_disconnect_request);
130 EXPORT_SYMBOL(irlmp_get_daddr);
131 EXPORT_SYMBOL(irlmp_get_saddr);
132 EXPORT_SYMBOL(irlmp_dup);
133 EXPORT_SYMBOL(lmp_reasons);
134 
135 /* Queue */
136 EXPORT_SYMBOL(hashbin_new);
137 EXPORT_SYMBOL(hashbin_insert);
138 EXPORT_SYMBOL(hashbin_delete);
139 EXPORT_SYMBOL(hashbin_remove);
140 EXPORT_SYMBOL(hashbin_remove_this);
141 EXPORT_SYMBOL(hashbin_find);
142 EXPORT_SYMBOL(hashbin_lock_find);
143 EXPORT_SYMBOL(hashbin_find_next);
144 EXPORT_SYMBOL(hashbin_get_next);
145 EXPORT_SYMBOL(hashbin_get_first);
146 
147 /* IrLAP */
148 EXPORT_SYMBOL(irlap_open);
149 EXPORT_SYMBOL(irlap_close);
150 EXPORT_SYMBOL(irda_init_max_qos_capabilies);
151 EXPORT_SYMBOL(irda_qos_bits_to_value);
152 EXPORT_SYMBOL(irda_device_setup);
153 EXPORT_SYMBOL(alloc_irdadev);
154 EXPORT_SYMBOL(irda_device_set_media_busy);
155 EXPORT_SYMBOL(irda_device_txqueue_empty);
156 
157 EXPORT_SYMBOL(irda_device_dongle_init);
158 EXPORT_SYMBOL(irda_device_dongle_cleanup);
159 EXPORT_SYMBOL(irda_device_register_dongle);
160 EXPORT_SYMBOL(irda_device_unregister_dongle);
161 EXPORT_SYMBOL(irda_task_execute);
162 EXPORT_SYMBOL(irda_task_kick);
163 EXPORT_SYMBOL(irda_task_next_state);
164 EXPORT_SYMBOL(irda_task_delete);
165 
166 EXPORT_SYMBOL(async_wrap_skb);
167 EXPORT_SYMBOL(async_unwrap_char);
168 EXPORT_SYMBOL(irda_calc_crc16);
169 EXPORT_SYMBOL(irda_crc16_table);
170 EXPORT_SYMBOL(irda_start_timer);
171 #ifdef CONFIG_ISA
172 EXPORT_SYMBOL(setup_dma);
173 #endif
174 EXPORT_SYMBOL(infrared_mode);
175 
176 #ifdef CONFIG_IRTTY
177 EXPORT_SYMBOL(irtty_set_dtr_rts);
178 EXPORT_SYMBOL(irtty_register_dongle);
179 EXPORT_SYMBOL(irtty_unregister_dongle);
180 EXPORT_SYMBOL(irtty_set_packet_mode);
181 #endif
182 
183 #ifdef CONFIG_IRDA_DEBUG
184 __u32 irda_debug = IRDA_DEBUG_LEVEL;
185 #endif
186 
187 /* Packet type handler.
188  * Tell the kernel how IrDA packets should be handled.
189  */
190 static struct packet_type irda_packet_type = {
191         .type   = __constant_htons(ETH_P_IRDA),
192         .func   = irlap_driver_rcv,     /* Packet type handler irlap_frame.c */
193 };
194 
195 /*
196  * Function irda_device_event (this, event, ptr)
197  *
198  *    Called when a device is taken up or down
199  *
200  */
201 static int irda_device_event(struct notifier_block *this, unsigned long event,
202                              void *ptr)
203 {
204         struct net_device *dev = (struct net_device *) ptr;
205         
206         /* Reject non IrDA devices */
207         if (dev->type != ARPHRD_IRDA) 
208                 return NOTIFY_DONE;
209         
210         switch (event) {
211         case NETDEV_UP:
212                 IRDA_DEBUG(3, "%s(), NETDEV_UP\n", __FUNCTION__);
213                 /* irda_dev_device_up(dev); */
214                 break;
215         case NETDEV_DOWN:
216                 IRDA_DEBUG(3, "%s(), NETDEV_DOWN\n", __FUNCTION__);
217                 /* irda_kill_by_device(dev); */
218                 /* irda_rt_device_down(dev); */
219                 /* irda_dev_device_down(dev); */
220                 break;
221         default:
222                 break;
223         }
224 
225         return NOTIFY_DONE;
226 }
227 
228 static struct notifier_block irda_dev_notifier = {
229         irda_device_event,
230         NULL,
231         0
232 };
233 
234 /*
235  * Function irda_notify_init (notify)
236  *
237  *    Used for initializing the notify structure
238  *
239  */
240 void irda_notify_init(notify_t *notify)
241 {
242         notify->data_indication = NULL;
243         notify->udata_indication = NULL;
244         notify->connect_confirm = NULL;
245         notify->connect_indication = NULL;
246         notify->disconnect_indication = NULL;
247         notify->flow_indication = NULL;
248         notify->status_indication = NULL;
249         notify->instance = NULL;
250         strlcpy(notify->name, "Unknown", sizeof(notify->name));
251 }
252 
253 /*
254  * Function irda_init (void)
255  *
256  *  Protocol stack initialisation entry point.
257  *  Initialise the various components of the IrDA stack
258  */
259 int __init irda_init(void)
260 {
261         IRDA_DEBUG(0, "%s()\n", __FUNCTION__);
262 
263         /* Lower layer of the stack */
264         irlmp_init();
265         irlap_init();
266         
267         /* Higher layers of the stack */
268         iriap_init();
269         irttp_init();
270         irsock_init();
271         
272         /* Add IrDA packet type (Start receiving packets) */
273         dev_add_pack(&irda_packet_type);
274 
275         /* Notifier for Interface changes */
276         register_netdevice_notifier(&irda_dev_notifier);
277 
278         /* External APIs */
279 #ifdef CONFIG_PROC_FS
280         irda_proc_register();
281 #endif
282 #ifdef CONFIG_SYSCTL
283         irda_sysctl_register();
284 #endif
285 
286         /* Driver/dongle support */
287         irda_device_init();
288 
289         return 0;
290 }
291 
292 /*
293  * Function irda_cleanup (void)
294  *
295  *  Protocol stack cleanup/removal entry point.
296  *  Cleanup the various components of the IrDA stack
297  */
298 void __exit irda_cleanup(void)
299 {
300         /* Remove External APIs */
301 #ifdef CONFIG_SYSCTL
302         irda_sysctl_unregister();
303 #endif  
304 #ifdef CONFIG_PROC_FS
305         irda_proc_unregister();
306 #endif
307 
308         /* Remove IrDA packet type (stop receiving packets) */
309         dev_remove_pack(&irda_packet_type);
310         
311         /* Stop receiving interfaces notifications */
312         unregister_netdevice_notifier(&irda_dev_notifier);
313         
314         /* Remove higher layers */
315         irsock_cleanup();
316         irttp_cleanup();
317         iriap_cleanup();
318 
319         /* Remove lower layers */
320         irda_device_cleanup();
321         irlap_cleanup(); /* Must be done before irlmp_cleanup()! DB */
322 
323         /* Remove middle layer */
324         irlmp_cleanup();
325 }
326 
327 /*
328  * The IrDA stack must be initialised *before* drivers get initialised,
329  * and *before* higher protocols (IrLAN/IrCOMM/IrNET) get initialised,
330  * otherwise bad things will happen (hashbins will be NULL for example).
331  * Those modules are at module_init()/device_initcall() level.
332  *
333  * On the other hand, it needs to be initialised *after* the basic
334  * networking, the /proc/net filesystem and sysctl module. Those are
335  * currently initialised in .../init/main.c (before initcalls).
336  * Also, IrDA drivers needs to be initialised *after* the random number
337  * generator (main stack and higher layer init don't need it anymore).
338  *
339  * Jean II
340  */
341 subsys_initcall(irda_init);
342 module_exit(irda_cleanup);
343  
344 MODULE_AUTHOR("Dag Brattli <dagb@cs.uit.no> & Jean Tourrilhes <jt@hpl.hp.com>");
345 MODULE_DESCRIPTION("The Linux IrDA Protocol Stack"); 
346 MODULE_LICENSE("GPL");
347 #ifdef CONFIG_IRDA_DEBUG
348 MODULE_PARM(irda_debug, "1l");
349 #endif
350 MODULE_ALIAS_NETPROTO(PF_IRDA);
351 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp