Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/net Add the devsw_attach stuff, since the tap device can...



details:   https://anonhg.NetBSD.org/src/rev/954eaa60ea4a
branches:  trunk
changeset: 817102:954eaa60ea4a
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Mon Aug 08 09:23:13 2016 +0000

description:
Add the devsw_attach stuff, since the tap device can be accessed via
/dev/tap

This is a partial fix for the build.  The rump tap component will be
fixed shortly.

diffstat:

 sys/net/if_tap.c |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (46 lines):

diff -r 02a716029149 -r 954eaa60ea4a sys/net/if_tap.c
--- a/sys/net/if_tap.c  Mon Aug 08 07:35:12 2016 +0000
+++ b/sys/net/if_tap.c  Mon Aug 08 09:23:13 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_tap.c,v 1.86 2016/08/08 07:35:12 pgoyette Exp $     */
+/*     $NetBSD: if_tap.c,v 1.87 2016/08/08 09:23:13 pgoyette Exp $     */
 
 /*
  *  Copyright (c) 2003, 2004, 2008, 2009 The NetBSD Foundation.
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_tap.c,v 1.86 2016/08/08 07:35:12 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_tap.c,v 1.87 2016/08/08 09:23:13 pgoyette Exp $");
 
 #if defined(_KERNEL_OPT)
 
@@ -239,6 +239,9 @@
 
 #ifdef _MODULE
 static struct sysctllog *tap_sysctl_clog;
+
+devmajor_t tap_bmajor = -1, tap_cmajor = -1;
+
 #endif
 
 static u_int tap_count;
@@ -259,6 +262,7 @@
        if_clone_attach(&tap_cloners);
 #ifdef _MODULE
        sysctl_tap_setup(&tap_sysctl_clog);
+       devsw_attach("tap", NULL, &tap_bmajor, tap_cdevsw, &tap_cmajor);
 #endif
 }
 
@@ -271,6 +275,9 @@
                error = EBUSY;
 
        if (error == 0)
+               devsw_detach(NULL, &tap_cdevsw);
+
+       if (error == 0)
                if_clone_detach(&tap_cloners);
 
 #ifdef _MODULE



Home | Main Index | Thread Index | Old Index