summaryrefslogtreecommitdiffstats
path: root/net/netlink
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-02-24 00:12:35 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-02-24 00:12:35 +0000
commit482368b1a8e45430672c58c9a42e7d2004367126 (patch)
treece2a1a567d4d62dee7c2e71a46a99cf72cf1d606 /net/netlink
parente4d0251c6f56ab2e191afb70f80f382793e23f74 (diff)
Merge with 2.3.47. Guys, this is buggy as shit. You've been warned.
Diffstat (limited to 'net/netlink')
-rw-r--r--net/netlink/netlink_dev.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/net/netlink/netlink_dev.c b/net/netlink/netlink_dev.c
index 31b0bd890..d63e1f678 100644
--- a/net/netlink/netlink_dev.c
+++ b/net/netlink/netlink_dev.c
@@ -25,6 +25,7 @@
#include <linux/netlink.h>
#include <linux/poll.h>
#include <linux/init.h>
+#include <linux/devfs_fs_kernel.h>
#include <asm/system.h>
#include <asm/uaccess.h>
@@ -175,12 +176,35 @@ static struct file_operations netlink_fops = {
release: netlink_release,
};
+static devfs_handle_t devfs_handle = NULL;
+
+static void __init make_devfs_entries (const char *name, int minor)
+{
+ devfs_register (devfs_handle, name, 0, DEVFS_FL_DEFAULT,
+ NETLINK_MAJOR, minor,
+ S_IFCHR | S_IRUSR | S_IWUSR, 0, 0,
+ &netlink_fops, NULL);
+}
+
int __init init_netlink(void)
{
- if (register_chrdev(NETLINK_MAJOR,"netlink", &netlink_fops)) {
+ if (devfs_register_chrdev(NETLINK_MAJOR,"netlink", &netlink_fops)) {
printk(KERN_ERR "netlink: unable to get major %d\n", NETLINK_MAJOR);
return -EIO;
}
+ devfs_handle = devfs_mk_dir (NULL, "netlink", 7, NULL);
+ /* Someone tell me the official names for the uppercase ones */
+ make_devfs_entries ("route", 0);
+ make_devfs_entries ("skip", 1);
+ make_devfs_entries ("USERSOCK", 2);
+ make_devfs_entries ("fwmonitor", 3);
+ make_devfs_entries ("ARPD", 8);
+ make_devfs_entries ("ROUTE6", 11);
+ make_devfs_entries ("IP6_FW", 13);
+ devfs_register_series (devfs_handle, "tap%u", 16, DEVFS_FL_DEFAULT,
+ NETLINK_MAJOR, 16,
+ S_IFCHR | S_IRUSR | S_IWUSR, 0, 0,
+ &netlink_fops, NULL);
return 0;
}
@@ -194,7 +218,8 @@ int init_module(void)
void cleanup_module(void)
{
- unregister_chrdev(NET_MAJOR,"netlink");
+ devfs_unregister (devfs_handle);
+ devfs_unregister_chrdev(NETLINK_MAJOR, "netlink");
}
#endif