patch-2.3.4 linux/net/irda/irproc.c
Next file: linux/net/irda/irsysctl.c
Previous file: linux/net/irda/irmod.c
Back to the patch index
Back to the overall index
- Lines: 105
- Date:
Sun May 30 10:27:04 1999
- Orig file:
v2.3.3/linux/net/irda/irproc.c
- Orig date:
Mon May 10 13:01:21 1999
diff -u --recursive --new-file v2.3.3/linux/net/irda/irproc.c linux/net/irda/irproc.c
@@ -6,10 +6,10 @@
* Status: Experimental.
* Author: Thomas Davis, <ratbert@radiks.net>
* Created at: Sat Feb 21 21:33:24 1998
- * Modified at: Tue Apr 6 19:07:06 1999
+ * Modified at: Fri May 7 08:06:49 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
- * Copyright (c) 1998, Thomas Davis, <ratbert@radiks.net>,
+ * Copyright (c) 1998-1999, Thomas Davis, <ratbert@radiks.net>,
* All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
@@ -20,8 +20,6 @@
* I, Thomas Davis, provide no warranty for any of this software.
* This material is provided "AS-IS" and at no charge.
*
- * Portions lifted from the linux/fs/procfs/ files.
- *
********************************************************************/
#include <linux/miscdevice.h>
@@ -44,28 +42,27 @@
int unused);
extern int discovery_proc_read(char *buf, char **start, off_t offset, int len,
int unused);
+static int proc_discovery_read(char *buf, char **start, off_t offset, int len,
+ int unused);
-enum irda_directory_inos {
- PROC_IRDA_LAP = 1,
- PROC_IRDA_LMP,
- PROC_IRDA_TTP,
- PROC_IRDA_LPT,
- PROC_IRDA_COMM,
- PROC_IRDA_IRDA_DEVICE,
- PROC_IRDA_IRIAS
-};
+/* enum irda_directory_inos { */
+/* PROC_IRDA_LAP = 1, */
+/* PROC_IRDA_LMP, */
+/* PROC_IRDA_TTP, */
+/* PROC_IRDA_LPT, */
+/* PROC_IRDA_COMM, */
+/* PROC_IRDA_IRDA_DEVICE, */
+/* PROC_IRDA_IRIAS */
+/* }; */
struct irda_entry {
char *name;
- int (*fn)(char*,char**,off_t,int,int);
+ int (*fn)(char*, char**, off_t, int, int);
};
struct proc_dir_entry *proc_irda;
-
+
static struct irda_entry dir[] = {
-#if 0
- {"lpt", irlpt_proc_read},
-#endif
{"discovery", discovery_proc_read},
{"irda_device", irda_device_proc_read},
{"irttp", irttp_proc_read},
@@ -75,19 +72,22 @@
};
#define IRDA_ENTRIES_NUM (sizeof(dir)/sizeof(dir[0]))
-
+
/*
* Function irda_proc_register (void)
*
* Register irda entry in /proc file system
*
*/
-void irda_proc_register(void) {
+void irda_proc_register(void)
+{
int i;
+
proc_irda = create_proc_entry("net/irda", S_IFDIR, NULL);
#ifdef MODULE
proc_irda->fill_inode = &irda_proc_modcount;
#endif /* MODULE */
+
for (i=0;i<IRDA_ENTRIES_NUM;i++)
create_proc_entry(dir[i].name,0,proc_irda)->get_info=dir[i].fn;
}
@@ -98,9 +98,14 @@
* Unregister irda entry in /proc file system
*
*/
-void irda_proc_unregister(void) {
+void irda_proc_unregister(void)
+{
int i;
+
for (i=0;i<IRDA_ENTRIES_NUM;i++)
remove_proc_entry(dir[i].name, proc_irda);
+
remove_proc_entry("net/irda", NULL);
}
+
+
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)