1 /*********************************************************************
5 * Description: Various entries in the /proc file system
6 * Status: Experimental.
7 * Author: Thomas Davis, <ratbert@radiks.net>
8 * Created at: Sat Feb 21 21:33:24 1998
9 * Modified at: Fri Jun 4 09:39:49 1999
10 * Modified by: Dag Brattli <dagb@cs.uit.no>
12 * Copyright (c) 1998-1999, Thomas Davis, <ratbert@radiks.net>,
13 * All Rights Reserved.
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.
20 * I, Thomas Davis, provide no warranty for any of this software.
21 * This material is provided "AS-IS" and at no charge.
23 ********************************************************************/
25 #include <linux/miscdevice.h>
26 #include <linux/proc_fs.h>
28 #include <net/irda/irda.h>
29 #include <net/irda/irmod.h>
30 #include <net/irda/irlap.h>
31 #include <net/irda/irlmp.h>
33 extern int irda_device_proc_read(char *buf
, char **start
, off_t offset
,
35 extern int irlap_proc_read(char *buf
, char **start
, off_t offset
, int len
,
37 extern int irlmp_proc_read(char *buf
, char **start
, off_t offset
, int len
,
39 extern int irttp_proc_read(char *buf
, char **start
, off_t offset
, int len
,
41 extern int irias_proc_read(char *buf
, char **start
, off_t offset
, int len
,
43 extern int discovery_proc_read(char *buf
, char **start
, off_t offset
, int len
,
46 /* enum irda_directory_inos { */
47 /* PROC_IRDA_LAP = 1, */
52 /* PROC_IRDA_IRDA_DEVICE, */
58 int (*fn
)(char*, char**, off_t
, int, int);
61 struct proc_dir_entry
*proc_irda
;
63 static struct irda_entry dir
[] = {
64 {"discovery", discovery_proc_read
},
65 {"irda_device", irda_device_proc_read
},
66 {"irttp", irttp_proc_read
},
67 {"irlmp", irlmp_proc_read
},
68 {"irlap", irlap_proc_read
},
69 {"irias", irias_proc_read
},
72 #define IRDA_ENTRIES_NUM (sizeof(dir)/sizeof(dir[0]))
75 * Function irda_proc_register (void)
77 * Register irda entry in /proc file system
80 void irda_proc_register(void)
84 proc_irda
= create_proc_entry("net/irda", S_IFDIR
, NULL
);
86 proc_irda
->fill_inode
= &irda_proc_modcount
;
89 for (i
=0;i
<IRDA_ENTRIES_NUM
;i
++)
90 create_proc_entry(dir
[i
].name
,0,proc_irda
)->get_info
=dir
[i
].fn
;
94 * Function irda_proc_unregister (void)
96 * Unregister irda entry in /proc file system
99 void irda_proc_unregister(void)
103 for (i
=0;i
<IRDA_ENTRIES_NUM
;i
++)
104 remove_proc_entry(dir
[i
].name
, proc_irda
);
106 remove_proc_entry("net/irda", NULL
);