Import 2.3.25pre1
[davej-history.git] / net / irda / irproc.c
blobe19d1fe4c08eea982a0d587d1dee509462032804
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: Fri Oct 8 09:26:46 1999
10 * Modified by: Dag Brattli <dagb@cs.uit.no>
12 * Copyright (c) 1998-1999, Dag Brattli <dagb@cs.uit.no>
13 * Copyright (c) 1998, Thomas Davis, <ratbert@radiks.net>,
14 * All Rights Reserved.
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.
21 * I, Thomas Davis, provide no warranty for any of this software.
22 * This material is provided "AS-IS" and at no charge.
24 ********************************************************************/
26 #include <linux/miscdevice.h>
27 #include <linux/proc_fs.h>
29 #include <net/irda/irda.h>
30 #include <net/irda/irmod.h>
31 #include <net/irda/irlap.h>
32 #include <net/irda/irlmp.h>
34 extern int irlap_proc_read(char *buf, char **start, off_t offset, int len,
35 int unused);
36 extern int irlmp_proc_read(char *buf, char **start, off_t offset, int len,
37 int unused);
38 extern int irttp_proc_read(char *buf, char **start, off_t offset, int len,
39 int unused);
40 extern int irias_proc_read(char *buf, char **start, off_t offset, int len,
41 int unused);
42 extern int discovery_proc_read(char *buf, char **start, off_t offset, int len,
43 int unused);
45 struct irda_entry {
46 char *name;
47 int (*fn)(char*, char**, off_t, int, int);
50 struct proc_dir_entry *proc_irda;
52 static struct irda_entry dir[] = {
53 {"discovery", discovery_proc_read},
54 {"irttp", irttp_proc_read},
55 {"irlmp", irlmp_proc_read},
56 {"irlap", irlap_proc_read},
57 {"irias", irias_proc_read},
60 #define IRDA_ENTRIES_NUM (sizeof(dir)/sizeof(dir[0]))
63 * Function irda_proc_register (void)
65 * Register irda entry in /proc file system
68 void irda_proc_register(void)
70 int i;
72 proc_irda = create_proc_entry("net/irda", S_IFDIR, NULL);
73 #ifdef MODULE
74 proc_irda->fill_inode = &irda_proc_modcount;
75 #endif /* MODULE */
77 for (i=0;i<IRDA_ENTRIES_NUM;i++)
78 create_proc_info_entry(dir[i].name,0,proc_irda,dir[i].fn);
82 * Function irda_proc_unregister (void)
84 * Unregister irda entry in /proc file system
87 void irda_proc_unregister(void)
89 int i;
91 for (i=0;i<IRDA_ENTRIES_NUM;i++)
92 remove_proc_entry(dir[i].name, proc_irda);
94 remove_proc_entry("net/irda", NULL);