Module Name:src
Committed By: pgoyette
Date: Mon Aug 8 09:29:45 UTC 2016
Modified Files:
src/sys/rump/net/lib/libtap: tap_component.c
Log Message:
Part 2 of fixing if_tap module.
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/rump/net/lib/libtap/tap_component.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/rump/net/lib/libtap/tap_component.c
diff -u src/sys/rump/net/lib/libtap/tap_component.c:1.3 src/sys/rump/net/lib/libtap/tap_component.c:1.4
--- src/sys/rump/net/lib/libtap/tap_component.c:1.3 Tue Jan 26 23:12:19 2016
+++ src/sys/rump/net/lib/libtap/tap_component.c Mon Aug 8 09:29:45 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: tap_component.c,v 1.3 2016/01/26 23:12:19 pooka Exp $ */
+/* $NetBSD: tap_component.c,v 1.4 2016/08/08 09:29:45 pgoyette Exp $ */
/*
* Copyright (c) 2015 Wei Liu. All Rights Reserved.
@@ -26,7 +26,7 @@
*/
#include
-__KERNEL_RCSID(0, "$NetBSD: tap_component.c,v 1.3 2016/01/26 23:12:19 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tap_component.c,v 1.4 2016/08/08 09:29:45 pgoyette Exp $");
#include
#include
@@ -37,27 +37,26 @@ __KERNEL_RCSID(0, "$NetBSD: tap_componen
#include "ioconf.h"
-CFDRIVER_DECL(tap, DV_IFNET, NULL);
-
RUMP_COMPONENT(RUMP_COMPONENT_NET_IF)
{
extern const struct cdevsw tap_cdevsw;
- devmajor_t bmaj, cmaj;
+ extern devmajor_t tap_bmajor, tap_cmajor;
int error;
- config_cfdriver_attach(_cd);
- tapattach(0);
-
- bmaj = cmaj = NODEVMAJOR;
- error = devsw_attach("tap", NULL, , _cdevsw, );
+ error = devsw_attach("tap", NULL, _bmajor,
+ _cdevsw, _cmajor);
if (error != 0)
panic("tap devsw attach failed: %d", error);
- error = rump_vfs_makeonedevnode(S_IFCHR, "/dev/tap", cmaj, 0xf);
+ error = rump_vfs_makeonedevnode(S_IFCHR, "/dev/tap", tap_cmajor,
+ 0xf);
if (error != 0)
panic("cannot create tap device node: %d", error);
- error = rump_vfs_makedevnodes(S_IFCHR, "/dev/tap", '0', cmaj, 0, 4);
+ error = rump_vfs_makedevnodes(S_IFCHR, "/dev/tap", '0', tap_cmajor,
+ 0, 4);
if (error != 0)
panic("cannot create tap[0-4] device node: %d", error);
+
+ devsw_detach(NULL, _cdevsw);
}