aboutsummaryrefslogtreecommitdiffstats
path: root/net/irda/irproc.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /net/irda/irproc.c
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'net/irda/irproc.c')
-rw-r--r--net/irda/irproc.c100
1 files changed, 100 insertions, 0 deletions
diff --git a/net/irda/irproc.c b/net/irda/irproc.c
new file mode 100644
index 000000000000..88b9c43f6370
--- /dev/null
+++ b/net/irda/irproc.c
@@ -0,0 +1,100 @@
1/*********************************************************************
2 *
3 * Filename: irproc.c
4 * Version: 1.0
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: Sun Nov 14 08:54:54 1999
10 * Modified by: Dag Brattli <dagb@cs.uit.no>
11 *
12 * Copyright (c) 1998-1999, Dag Brattli <dagb@cs.uit.no>
13 * Copyright (c) 1998, Thomas Davis, <ratbert@radiks.net>,
14 * All Rights Reserved.
15 *
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License as
18 * published by the Free Software Foundation; either version 2 of
19 * the License, or (at your option) any later version.
20 *
21 * I, Thomas Davis, provide no warranty for any of this software.
22 * This material is provided "AS-IS" and at no charge.
23 *
24 ********************************************************************/
25
26#include <linux/miscdevice.h>
27#include <linux/proc_fs.h>
28#include <linux/seq_file.h>
29#include <linux/module.h>
30#include <linux/init.h>
31
32#include <net/irda/irda.h>
33#include <net/irda/irlap.h>
34#include <net/irda/irlmp.h>
35
36extern struct file_operations discovery_seq_fops;
37extern struct file_operations irlap_seq_fops;
38extern struct file_operations irlmp_seq_fops;
39extern struct file_operations irttp_seq_fops;
40extern struct file_operations irias_seq_fops;
41
42struct irda_entry {
43 const char *name;
44 struct file_operations *fops;
45};
46
47struct proc_dir_entry *proc_irda;
48EXPORT_SYMBOL(proc_irda);
49
50static struct irda_entry irda_dirs[] = {
51 {"discovery", &discovery_seq_fops},
52 {"irttp", &irttp_seq_fops},
53 {"irlmp", &irlmp_seq_fops},
54 {"irlap", &irlap_seq_fops},
55 {"irias", &irias_seq_fops},
56};
57
58/*
59 * Function irda_proc_register (void)
60 *
61 * Register irda entry in /proc file system
62 *
63 */
64void __init irda_proc_register(void)
65{
66 int i;
67 struct proc_dir_entry *d;
68
69 proc_irda = proc_mkdir("irda", proc_net);
70 if (proc_irda == NULL)
71 return;
72 proc_irda->owner = THIS_MODULE;
73
74 for (i=0; i<ARRAY_SIZE(irda_dirs); i++) {
75 d = create_proc_entry(irda_dirs[i].name, 0, proc_irda);
76 if (d)
77 d->proc_fops = irda_dirs[i].fops;
78 }
79}
80
81/*
82 * Function irda_proc_unregister (void)
83 *
84 * Unregister irda entry in /proc file system
85 *
86 */
87void __exit irda_proc_unregister(void)
88{
89 int i;
90
91 if (proc_irda) {
92 for (i=0; i<ARRAY_SIZE(irda_dirs); i++)
93 remove_proc_entry(irda_dirs[i].name, proc_irda);
94
95 remove_proc_entry("irda", proc_net);
96 proc_irda = NULL;
97 }
98}
99
100