patch-2.1.132 linux/net/irda/irsysctl.c
Next file: linux/net/irda/irttp.c
Previous file: linux/net/irda/irqueue.c
Back to the patch index
Back to the overall index
- Lines: 89
- Date:
Thu Dec 17 09:01:03 1998
- Orig file:
v2.1.131/linux/net/irda/irsysctl.c
- Orig date:
Wed Dec 31 16:00:00 1969
diff -u --recursive --new-file v2.1.131/linux/net/irda/irsysctl.c linux/net/irda/irsysctl.c
@@ -0,0 +1,88 @@
+/*********************************************************************
+ *
+ * Filename: irsysctl.c
+ * Version:
+ * Description:
+ * Status: Experimental.
+ * Author: Dag Brattli <dagb@cs.uit.no>
+ * Created at: Sun May 24 22:12:06 1998
+ * Modified at: Wed Dec 9 01:29:22 1998
+ * Modified by: Dag Brattli <dagb@cs.uit.no>
+ *
+ * Copyright (c) 1997 Dag Brattli, All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * Neither Dag Brattli nor University of Tromsų admit liability nor
+ * provide warranty for any of this software. This material is
+ * provided "AS-IS" and at no charge.
+ *
+ ********************************************************************/
+
+#include <linux/mm.h>
+#include <linux/ctype.h>
+#include <linux/sysctl.h>
+#include <asm/segment.h>
+
+#define NET_IRDA 412 /* Random number */
+enum { DISCOVERY=1, DEVNAME, COMPRESSION };
+
+extern int sysctl_discovery;
+int sysctl_compression = 0;
+extern char sysctl_devname[];
+
+/* One file */
+static ctl_table irda_table[] = {
+ { DISCOVERY, "discovery", &sysctl_discovery,
+ sizeof(int), 0644, NULL, &proc_dointvec },
+ { DEVNAME, "devname", sysctl_devname,
+ 65, 0644, NULL, &proc_dostring, &sysctl_string},
+ { COMPRESSION, "compression", &sysctl_compression,
+ sizeof(int), 0644, NULL, &proc_dointvec },
+ { 0 }
+};
+
+/* One directory */
+static ctl_table irda_net_table[] = {
+ { NET_IRDA, "irda", NULL, 0, 0555, irda_table },
+ { 0 }
+};
+
+/* The parent directory */
+static ctl_table irda_root_table[] = {
+ { CTL_NET, "net", NULL, 0, 0555, irda_net_table },
+ { 0 }
+};
+
+static struct ctl_table_header *irda_table_header;
+
+/*
+ * Function irda_sysctl_register (void)
+ *
+ * Register our sysctl interface
+ *
+ */
+int irda_sysctl_register(void)
+{
+ irda_table_header = register_sysctl_table( irda_root_table, 0);
+ if ( !irda_table_header)
+ return -ENOMEM;
+ return 0;
+}
+
+/*
+ * Function irda_sysctl_unregister (void)
+ *
+ * Unregister our sysctl interface
+ *
+ */
+void irda_sysctl_unregister(void)
+{
+ unregister_sysctl_table( irda_table_header);
+}
+
+
+
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov