xref: /netbsd-src/sys/modules/tap/tap.c (revision 9c4fa8bcb0f6aad255cffdfb1ff64df47e659fee)
1*9c4fa8bcSpgoyette /*	$NetBSD: tap.c,v 1.1 2019/03/24 11:20:26 pgoyette Exp $ */
2*9c4fa8bcSpgoyette 
3*9c4fa8bcSpgoyette /*-
4*9c4fa8bcSpgoyette  * Copyright (c) 2016 The NetBSD Foundation, Inc.
5*9c4fa8bcSpgoyette  * All rights reserved.
6*9c4fa8bcSpgoyette  *
7*9c4fa8bcSpgoyette  * This code is derived from software contributed to The NetBSD Foundation
8*9c4fa8bcSpgoyette  * by Paul Goyette
9*9c4fa8bcSpgoyette  *
10*9c4fa8bcSpgoyette  * Redistribution and use in source and binary forms, with or without
11*9c4fa8bcSpgoyette  * modification, are permitted provided that the following conditions
12*9c4fa8bcSpgoyette  * are met:
13*9c4fa8bcSpgoyette  * 1. Redistributions of source code must retain the above copyright
14*9c4fa8bcSpgoyette  *    notice, this list of conditions and the following disclaimer.
15*9c4fa8bcSpgoyette  * 2. Redistributions in binary form must reproduce the above copyright
16*9c4fa8bcSpgoyette  *    notice, this list of conditions and the following disclaimer in the
17*9c4fa8bcSpgoyette  *    documentation and/or other materials provided with the distribution.
18*9c4fa8bcSpgoyette  *
19*9c4fa8bcSpgoyette  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20*9c4fa8bcSpgoyette  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21*9c4fa8bcSpgoyette  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22*9c4fa8bcSpgoyette  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23*9c4fa8bcSpgoyette  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24*9c4fa8bcSpgoyette  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25*9c4fa8bcSpgoyette  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26*9c4fa8bcSpgoyette  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27*9c4fa8bcSpgoyette  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28*9c4fa8bcSpgoyette  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29*9c4fa8bcSpgoyette  * POSSIBILITY OF SUCH DAMAGE.
30*9c4fa8bcSpgoyette  */
31*9c4fa8bcSpgoyette 
32*9c4fa8bcSpgoyette #include <sys/cdefs.h>
33*9c4fa8bcSpgoyette __KERNEL_RCSID(0, "$NetBSD: tap.c,v 1.1 2019/03/24 11:20:26 pgoyette Exp $");
34*9c4fa8bcSpgoyette 
35*9c4fa8bcSpgoyette #include <sys/errno.h>
36*9c4fa8bcSpgoyette #include <sys/module.h>
37*9c4fa8bcSpgoyette 
38*9c4fa8bcSpgoyette MODULE(MODULE_CLASS_DRIVER, tap, "if_tap");
39*9c4fa8bcSpgoyette 
40*9c4fa8bcSpgoyette static int
tap_modcmd(modcmd_t cmd,void * arg)41*9c4fa8bcSpgoyette tap_modcmd(modcmd_t cmd, void *arg)
42*9c4fa8bcSpgoyette {
43*9c4fa8bcSpgoyette 
44*9c4fa8bcSpgoyette 	switch (cmd) {
45*9c4fa8bcSpgoyette 	case MODULE_CMD_INIT:
46*9c4fa8bcSpgoyette 	case MODULE_CMD_FINI:
47*9c4fa8bcSpgoyette 		return 0;
48*9c4fa8bcSpgoyette 	default:
49*9c4fa8bcSpgoyette 		return ENOTTY;
50*9c4fa8bcSpgoyette 	}
51*9c4fa8bcSpgoyette }
52