diff options
author | Kazuya Goda <goda@cvs.openbsd.org> | 2016-09-02 17:06:15 +0000 |
---|---|---|
committer | Kazuya Goda <goda@cvs.openbsd.org> | 2016-09-02 17:06:15 +0000 |
commit | bde26d8769313496a8220d5c07b5d624af1f29bf (patch) | |
tree | 13b302e43e0d777562e3d182416e80bb7a1adab2 | |
parent | 06977ccc557d20e79ca68325775662be832962ec (diff) |
Add switch(4) cdev entry
ok deraadt@ yasuoka@ reyk@
29 files changed, 94 insertions, 29 deletions
diff --git a/etc/MAKEDEV.common b/etc/MAKEDEV.common index 56d0572d63e..c5f82ce54f5 100644 --- a/etc/MAKEDEV.common +++ b/etc/MAKEDEV.common @@ -1,4 +1,4 @@ -vers(a, {-$OpenBSD: MAKEDEV.common,v 1.89 2016/05/26 16:29:51 deraadt Exp $-})dnl +vers(a, {-$OpenBSD: MAKEDEV.common,v 1.90 2016/09/02 17:06:13 goda Exp $-})dnl dnl dnl Copyright (c) 2001-2006 Todd T. Fries <todd@OpenBSD.org> dnl @@ -452,10 +452,12 @@ _mkdev(bpf, bpf, {-M bpf c major_bpf_c 0 600 M bpf0 c major_bpf_c 0 600-})dnl _mkdev(tun, {-tun*-}, {-M tun$U c major_tun_c $U 600-}, 600)dnl _mkdev(tap, {-tap*-}, {-M tap$U c major_tap_c $U 600-}, 600)dnl +_mkdev(switch, {-switch*-}, {-M switch$U c major_switch_c $U 600-}, 600)dnl __devitem(speak, speaker, PC speaker,spkr)dnl _mkdev(speak, speaker, {-M speaker c major_speak_c 0 600-})dnl __devitem(tun, tun*, Network tunnel driver)dnl __devitem(tap, tap*, Ethernet tunnel driver)dnl +__devitem(switch, switch*, Switch driver)dnl __devitem(rnd, *random, In-kernel random data source,random)dnl _mkdev(rnd, *random, {-n=0 for pre in " " s u a diff --git a/etc/etc.alpha/MAKEDEV.md b/etc/etc.alpha/MAKEDEV.md index f1f32e851f4..ab95c3f2328 100644 --- a/etc/etc.alpha/MAKEDEV.md +++ b/etc/etc.alpha/MAKEDEV.md @@ -1,6 +1,6 @@ define(MACHINE,alpha)dnl vers(__file__, - {-$OpenBSD: MAKEDEV.md,v 1.67 2016/04/28 18:17:30 natano Exp $-}, + {-$OpenBSD: MAKEDEV.md,v 1.68 2016/09/02 17:06:13 goda Exp $-}, etc.MACHINE)dnl dnl dnl Copyright (c) 2001-2006 Todd T. Fries <todd@OpenBSD.org> @@ -80,6 +80,7 @@ _DEV(tuner, 58) _DEV(uk, 33) _DEV(vi, 44) _DEV(vscsi, 61) +_DEV(switch, 69) dnl divert(__mddivert)dnl dnl @@ -119,4 +120,5 @@ target(all, rd, 0)dnl target(all, cd, 0, 1)dnl target(all, sd, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9)dnl target(all, vnd, 0, 1, 2, 3)dnl +target(all, switch, 0, 1, 2, 3)dnl target(ramd, ttyB, 0, 1)dnl diff --git a/etc/etc.amd64/MAKEDEV.md b/etc/etc.amd64/MAKEDEV.md index 6f624ac0f7f..07f24afb5e1 100644 --- a/etc/etc.amd64/MAKEDEV.md +++ b/etc/etc.amd64/MAKEDEV.md @@ -1,6 +1,6 @@ define(MACHINE,amd64)dnl vers(__file__, - {-$OpenBSD: MAKEDEV.md,v 1.66 2016/04/28 18:17:30 natano Exp $-}, + {-$OpenBSD: MAKEDEV.md,v 1.67 2016/09/02 17:06:13 goda Exp $-}, etc.MACHINE)dnl dnl dnl Copyright (c) 2001-2006 Todd T. Fries <todd@OpenBSD.org> @@ -93,6 +93,7 @@ _DEV(vi, 44) _DEV(vmm, 10) _DEV(vscsi, 89) _DEV(pvbus, 95) +_DEV(switch, 97) dnl divert(__mddivert)dnl dnl @@ -133,5 +134,6 @@ target(all, nvram)dnl target(all, drm, 0, 1, 2, 3)dnl target(all, ttyVI, 00, 10, 20, 30, 40)dnl target(all, ipmi, 0)dnl +target(all, switch, 0, 1, 2, 3)dnl twrget(ramd, wsdisp, ttyC, 0)dnl target(ramd, fd, 0)dnl diff --git a/etc/etc.armv7/MAKEDEV.md b/etc/etc.armv7/MAKEDEV.md index 3316b914cc3..dfe3145b247 100644 --- a/etc/etc.armv7/MAKEDEV.md +++ b/etc/etc.armv7/MAKEDEV.md @@ -1,6 +1,6 @@ define(MACHINE,armv7)dnl vers(__file__, - {-$OpenBSD: MAKEDEV.md,v 1.12 2016/05/21 21:30:22 kettenis Exp $-}, + {-$OpenBSD: MAKEDEV.md,v 1.13 2016/09/02 17:06:13 goda Exp $-}, etc.MACHINE)dnl dnl dnl Copyright (c) 2001-2004 Todd T. Fries <todd@OpenBSD.org> @@ -85,6 +85,7 @@ _DEV(uk, 28) _DEV(tuner, 75) _DEV(vi, 38) _DEV(vscsi, 100) +_DEV(switch, 105) dnl divert(__mddivert)dnl dnl @@ -113,4 +114,5 @@ target(all, rd, 0)dnl target(all, cd, 0, 1)dnl target(all, sd, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9)dnl target(all, vnd, 0, 1, 2, 3)dnl +target(all, switch, 0, 1, 2, 3)dnl target(all, gpio, 0, 1, 2, 3, 4, 5, 6, 7, 8)dnl diff --git a/etc/etc.hppa/MAKEDEV.md b/etc/etc.hppa/MAKEDEV.md index db2bb1969f6..998c4593233 100644 --- a/etc/etc.hppa/MAKEDEV.md +++ b/etc/etc.hppa/MAKEDEV.md @@ -1,6 +1,6 @@ define(MACHINE,hppa)dnl vers(__file__, - {-$OpenBSD: MAKEDEV.md,v 1.58 2016/04/28 18:17:31 natano Exp $-}, + {-$OpenBSD: MAKEDEV.md,v 1.59 2016/09/02 17:06:13 goda Exp $-}, etc.MACHINE)dnl dnl dnl Copyright (c) 2001-2006 Todd T. Fries <todd@OpenBSD.org> @@ -74,6 +74,7 @@ _DEV(tap, 59) _DEV(uk, 15) _DEV(vi, 33) _DEV(vscsi, 54) +_DEV(switch, 60) dnl divert(__mddivert)dnl dnl @@ -103,5 +104,6 @@ target(all, rd, 0)dnl target(all, cd, 0, 1)dnl target(all, sd, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9)dnl target(all, vnd, 0, 1, 2, 3)dnl +target(all, switch, 0, 1, 2, 3)dnl target(ramd, pty, 0)dnl target(ramd, hil)dnl diff --git a/etc/etc.i386/MAKEDEV.md b/etc/etc.i386/MAKEDEV.md index e71049c734e..97c73eb6fad 100644 --- a/etc/etc.i386/MAKEDEV.md +++ b/etc/etc.i386/MAKEDEV.md @@ -1,6 +1,6 @@ define(MACHINE,i386)dnl vers(__file__, - {-$OpenBSD: MAKEDEV.md,v 1.80 2016/04/28 18:17:31 natano Exp $-}, + {-$OpenBSD: MAKEDEV.md,v 1.81 2016/09/02 17:06:13 goda Exp $-}, etc.MACHINE)dnl dnl dnl Copyright (c) 2001-2006 Todd T. Fries <todd@OpenBSD.org> @@ -95,6 +95,7 @@ _DEV(vi, 44) _DEV(vmm, 10) _DEV(vscsi, 90) _DEV(pvbus, 95) +_DEV(switch, 97) dnl divert(__mddivert)dnl dnl @@ -135,4 +136,5 @@ target(all, nvram)dnl target(all, drm, 0, 1, 2, 3)dnl target(all, amdmsr)dnl target(all, ipmi, 0)dnl +target(all, switch, 0, 1, 2, 3)dnl twrget(ramd, wsdisp, ttyC, 0)dnl diff --git a/etc/etc.landisk/MAKEDEV.md b/etc/etc.landisk/MAKEDEV.md index 8fe6fe530cf..b3ef8675245 100644 --- a/etc/etc.landisk/MAKEDEV.md +++ b/etc/etc.landisk/MAKEDEV.md @@ -1,6 +1,6 @@ define(MACHINE,landisk)dnl vers(__file__, - {-$OpenBSD: MAKEDEV.md,v 1.40 2016/04/28 18:17:31 natano Exp $-}, + {-$OpenBSD: MAKEDEV.md,v 1.41 2016/09/02 17:06:13 goda Exp $-}, etc.MACHINE)dnl dnl dnl Copyright (c) 2001-2004 Todd T. Fries <todd@OpenBSD.org> @@ -88,6 +88,7 @@ dnl _DEV(tuner, 75) _DEV(uk, 28) _DEV(vi, 77) _DEV(vscsi, 99) +_DEV(switch, 105) dnl divert(__mddivert)dnl dnl @@ -116,4 +117,5 @@ target(all, xy, 0, 1, 2, 3)dnl target(all, rd, 0)dnl target(all, cd, 0, 1)dnl target(all, sd, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9)dnl +target(all, switch, 0, 1, 2, 3)dnl target(all, vnd, 0, 1, 2, 3)dnl diff --git a/etc/etc.loongson/MAKEDEV.md b/etc/etc.loongson/MAKEDEV.md index 270af57d496..7bdc1b1aba4 100644 --- a/etc/etc.loongson/MAKEDEV.md +++ b/etc/etc.loongson/MAKEDEV.md @@ -1,6 +1,6 @@ define(MACHINE,loongson)dnl vers(__file__, - {-$OpenBSD: MAKEDEV.md,v 1.24 2016/04/28 18:17:31 natano Exp $-}, + {-$OpenBSD: MAKEDEV.md,v 1.25 2016/09/02 17:06:13 goda Exp $-}, etc.MACHINE)dnl dnl dnl Copyright (c) 2001-2006 Todd T. Fries <todd@OpenBSD.org> @@ -79,6 +79,7 @@ _DEV(tap, 74) _DEV(uk, 32) _DEV(vi, 45) _DEV(vscsi, 69) +_DEV(switch, 75) dnl divert(__mddivert)dnl dnl @@ -102,6 +103,7 @@ target(all, rd, 0)dnl target(all, cd, 0, 1)dnl target(all, sd, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9)dnl target(all, vnd, 0, 1, 2, 3)dnl +target(all, switch, 0, 1, 2, 3)dnl target(ramd, pty, 0)dnl target(ramd, bio)dnl target(ramd, diskmap)dnl diff --git a/etc/etc.luna88k/MAKEDEV.md b/etc/etc.luna88k/MAKEDEV.md index 0a03a3301f7..cb051c22e80 100644 --- a/etc/etc.luna88k/MAKEDEV.md +++ b/etc/etc.luna88k/MAKEDEV.md @@ -1,6 +1,6 @@ define(MACHINE,luna88k)dnl vers(__file__, - {-$OpenBSD: MAKEDEV.md,v 1.28 2016/04/28 18:17:31 natano Exp $-}, + {-$OpenBSD: MAKEDEV.md,v 1.29 2016/09/02 17:06:13 goda Exp $-}, etc.MACHINE)dnl dnl dnl Copyright (c) 2001-2006 Todd T. Fries <todd@OpenBSD.org> @@ -51,6 +51,7 @@ target(all, cd, 0, 1)dnl target(all, sd, 0, 1, 2, 3, 4)dnl target(all, uk, 0)dnl target(all, vnd, 0, 1, 2, 3)dnl +target(all, switch, 0, 1, 2, 3)dnl twrget(all, sio, tty, a)dnl twrget(all, lcd, lcd)dnl twrget(all, au, audio, 0)dnl @@ -108,6 +109,7 @@ _DEV(tun, 23) _DEV(tap, 56) _DEV(uk, 41) _DEV(vscsi, 53) +_DEV(switch, 57) dnl divert(__mddivert)dnl dnl diff --git a/etc/etc.macppc/MAKEDEV.md b/etc/etc.macppc/MAKEDEV.md index 44c195db2ad..d6ad75e0fd1 100644 --- a/etc/etc.macppc/MAKEDEV.md +++ b/etc/etc.macppc/MAKEDEV.md @@ -1,6 +1,6 @@ define(MACHINE,macppc)dnl vers(__file__, - {-$OpenBSD: MAKEDEV.md,v 1.67 2016/04/28 18:17:31 natano Exp $-}, + {-$OpenBSD: MAKEDEV.md,v 1.68 2016/09/02 17:06:13 goda Exp $-}, etc.MACHINE)dnl dnl dnl Copyright (c) 2001-2006 Todd T. Fries <todd@OpenBSD.org> @@ -95,6 +95,7 @@ _DEV(tuner, 75) _DEV(uk, 41) _DEV(vi, 45) _DEV(vscsi, 83) +_DEV(switch, 89) dnl divert(__mddivert)dnl dnl @@ -125,6 +126,7 @@ target(all, vnd, 0, 1, 2, 3)dnl target(all, gpio, 0, 1, 2)dnl target(all, bio)dnl target(all, drm, 0, 1, 2, 3)dnl +target(all, switch, 0, 1, 2, 3)dnl target(ramd, ttya, 0, 1)dnl target(ramd, ttyb, 0, 1)dnl target(ramd, pty, 0)dnl diff --git a/etc/etc.octeon/MAKEDEV.md b/etc/etc.octeon/MAKEDEV.md index 0c1a0cc8031..b761da48416 100644 --- a/etc/etc.octeon/MAKEDEV.md +++ b/etc/etc.octeon/MAKEDEV.md @@ -1,6 +1,6 @@ define(MACHINE,octeon)dnl vers(__file__, - {-$OpenBSD: MAKEDEV.md,v 1.11 2016/07/05 12:55:32 visa Exp $-}, + {-$OpenBSD: MAKEDEV.md,v 1.12 2016/09/02 17:06:14 goda Exp $-}, etc.MACHINE)dnl dnl dnl Copyright (c) 2001-2006 Todd T. Fries <todd@OpenBSD.org> @@ -82,6 +82,7 @@ _DEV(tap, 74) _DEV(uk, 32) _DEV(vi, 45) _DEV(vscsi, 69) +_DEV(switch, 75) dnl divert(__mddivert)dnl dnl @@ -104,6 +105,7 @@ target(all, cd, 0, 1)dnl target(all, sd, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9)dnl target(all, vnd, 0, 1, 2, 3)dnl target(all, octcf, 0)dnl +target(all, switch, 0, 1, 2, 3)dnl target(ramd, pty, 0)dnl target(ramd, bio)dnl target(ramd, diskmap)dnl diff --git a/etc/etc.sgi/MAKEDEV.md b/etc/etc.sgi/MAKEDEV.md index d96a33839c7..886e487d1a6 100644 --- a/etc/etc.sgi/MAKEDEV.md +++ b/etc/etc.sgi/MAKEDEV.md @@ -1,6 +1,6 @@ define(MACHINE,sgi)dnl vers(__file__, - {-$OpenBSD: MAKEDEV.md,v 1.46 2016/04/28 18:17:31 natano Exp $-}, + {-$OpenBSD: MAKEDEV.md,v 1.47 2016/09/02 17:06:14 goda Exp $-}, etc.MACHINE)dnl dnl dnl Copyright (c) 2001-2006 Todd T. Fries <todd@OpenBSD.org> @@ -87,6 +87,7 @@ _DEV(tap, 74) _DEV(uk, 32) _DEV(vi, 45) _DEV(vscsi, 68) +_DEV(switch, 75) dnl divert(__mddivert)dnl dnl @@ -107,6 +108,7 @@ target(all, rd, 0)dnl target(all, cd, 0, 1)dnl target(all, sd, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9)dnl target(all, vnd, 0, 1, 2, 3)dnl +target(all, switch, 0, 1, 2, 3)dnl twrget(all, zs, tty, a, b)dnl twrget(wscons, wscons, ttyD, cfg, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b)dnl twrget(wscons, wscons, ttyE, cfg, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b)dnl diff --git a/etc/etc.socppc/MAKEDEV.md b/etc/etc.socppc/MAKEDEV.md index e932754a70d..92c5f34d0ce 100644 --- a/etc/etc.socppc/MAKEDEV.md +++ b/etc/etc.socppc/MAKEDEV.md @@ -1,6 +1,6 @@ define(MACHINE,socppc)dnl vers(__file__, - {-$OpenBSD: MAKEDEV.md,v 1.29 2016/04/28 18:17:31 natano Exp $-}, + {-$OpenBSD: MAKEDEV.md,v 1.30 2016/09/02 17:06:14 goda Exp $-}, etc.MACHINE)dnl dnl dnl Copyright (c) 2001-2006 Todd T. Fries <todd@OpenBSD.org> @@ -75,6 +75,7 @@ dnl _DEV(tuner, 75) dnl _DEV(uk, 41) _DEV(vi, 44) _DEV(vscsi, 78) +_DEV(switch, 87) dnl divert(__mddivert)dnl dnl @@ -95,6 +96,7 @@ target(all, rd, 0)dnl target(all, cd, 0, 1)dnl target(all, sd, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9)dnl target(all, vnd, 0, 1, 2, 3)dnl +target(all, switch, 0, 1, 2, 3)dnl dnl target(all, gpio, 0, 1, 2)dnl dnl target(all, bio)dnl target(ramd, diskmap)dnl diff --git a/etc/etc.sparc64/MAKEDEV.md b/etc/etc.sparc64/MAKEDEV.md index d66153c7fe6..6fcdb20c33c 100644 --- a/etc/etc.sparc64/MAKEDEV.md +++ b/etc/etc.sparc64/MAKEDEV.md @@ -1,6 +1,6 @@ define(MACHINE,sparc64)dnl vers(__file__, - {-$OpenBSD: MAKEDEV.md,v 1.84 2016/04/28 18:17:31 natano Exp $-}, + {-$OpenBSD: MAKEDEV.md,v 1.85 2016/09/02 17:06:14 goda Exp $-}, etc.MACHINE)dnl dnl dnl Copyright (c) 2001-2006 Todd T. Fries <todd@OpenBSD.org> @@ -130,6 +130,7 @@ _DEV(vldc_hvctl, 132) _DEV(vldc_spds, 132) _DEV(vldc_ldom, 132) _DEV(vdsp, 133) +_DEV(switch, 136) dnl divert(__mddivert)dnl dnl @@ -169,6 +170,7 @@ target(all, sd, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9)dnl target(all, vnd, 0, 1, 2, 3)dnl target(all, bpp, 0)dnl target(all, drm, 0, 1, 2, 3)dnl +target(all, switch, 0, 1, 2, 3)dnl twrget(all, s64_tzs, tty, a, b, c, d)dnl twrget(all, s64_czs, cua, a, b, c, d)dnl twrget(all, vcc, ttyV, 0, 1, 2, 3, 4, 5, 6, 7)dnl diff --git a/etc/etc.zaurus/MAKEDEV.md b/etc/etc.zaurus/MAKEDEV.md index 6c5f9bd6bb9..78470387b07 100644 --- a/etc/etc.zaurus/MAKEDEV.md +++ b/etc/etc.zaurus/MAKEDEV.md @@ -1,6 +1,6 @@ define(MACHINE,zaurus)dnl vers(__file__, - {-$OpenBSD: MAKEDEV.md,v 1.43 2016/04/28 18:17:31 natano Exp $-}, + {-$OpenBSD: MAKEDEV.md,v 1.44 2016/09/02 17:06:14 goda Exp $-}, etc.MACHINE)dnl dnl dnl Copyright (c) 2001-2004 Todd T. Fries <todd@OpenBSD.org> @@ -83,6 +83,7 @@ _DEV(tuner, 75) _DEV(uk, 28) _DEV(vi, 38) _DEV(vscsi, 100) +_DEV(switch, 105) dnl divert(__mddivert)dnl dnl @@ -111,4 +112,5 @@ target(all, rd, 0)dnl target(all, cd, 0, 1)dnl target(all, sd, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9)dnl target(all, vnd, 0, 1, 2, 3)dnl +target(all, switch, 0, 1, 2, 3)dnl target(all, ttyC, 0, 1)dnl diff --git a/sys/arch/alpha/alpha/conf.c b/sys/arch/alpha/alpha/conf.c index dbdd31fcd54..625ba1a4819 100644 --- a/sys/arch/alpha/alpha/conf.c +++ b/sys/arch/alpha/alpha/conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.c,v 1.81 2016/04/25 20:09:14 tedu Exp $ */ +/* $OpenBSD: conf.c,v 1.82 2016/09/02 17:06:12 goda Exp $ */ /* $NetBSD: conf.c,v 1.16 1996/10/18 21:26:57 cgd Exp $ */ /*- @@ -124,6 +124,7 @@ cdev_decl(pci); #include "vscsi.h" #include "pppx.h" #include "fuse.h" +#include "switch.h" struct cdevsw cdevsw[] = { @@ -200,6 +201,7 @@ struct cdevsw cdevsw[] = cdev_notdef(), /* 66: was USB scanners */ cdev_fuse_init(NFUSE,fuse), /* 67: fuse */ cdev_tun_init(NTUN,tap), /* 68: Ethernet network tunnel */ + cdev_switch_init(NSWITCH,switch), /* 69: switch(4) control interface */ }; int nchrdev = nitems(cdevsw); diff --git a/sys/arch/amd64/amd64/conf.c b/sys/arch/amd64/amd64/conf.c index 10091446bbd..57e2e2c93b8 100644 --- a/sys/arch/amd64/amd64/conf.c +++ b/sys/arch/amd64/amd64/conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.c,v 1.58 2016/04/25 20:09:14 tedu Exp $ */ +/* $OpenBSD: conf.c,v 1.59 2016/09/02 17:06:12 goda Exp $ */ /* * Copyright (c) 1994, 1995 Charles M. Hannum. All rights reserved. @@ -183,6 +183,7 @@ cdev_decl(pci); #include "fuse.h" #include "pvbus.h" #include "ipmi.h" +#include "switch.h" struct cdevsw cdevsw[] = { @@ -295,6 +296,7 @@ struct cdevsw cdevsw[] = cdev_tty_init(NVIOCON,viocon), /* 94: virtio console */ cdev_pvbus_init(NPVBUS,pvbus), /* 95: pvbus(4) control interface */ cdev_ipmi_init(NIPMI,ipmi), /* 96: ipmi */ + cdev_switch_init(NSWITCH,switch), /* 97: switch(4) control interface */ }; int nchrdev = nitems(cdevsw); diff --git a/sys/arch/arm/arm/conf.c b/sys/arch/arm/arm/conf.c index db2eb8a8f38..1beeb40ee0b 100644 --- a/sys/arch/arm/arm/conf.c +++ b/sys/arch/arm/arm/conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.c,v 1.47 2016/07/31 09:18:01 jsg Exp $ */ +/* $OpenBSD: conf.c,v 1.48 2016/09/02 17:06:12 goda Exp $ */ /* $NetBSD: conf.c,v 1.10 2002/04/19 01:04:38 wiz Exp $ */ /* @@ -271,6 +271,8 @@ struct bdevsw bdevsw[] = { #define NSPKR 0 #endif +#include "switch.h" + struct cdevsw cdevsw[] = { cdev_cn_init(1,cn), /* 0: virtual console */ cdev_ctty_init(1,ctty), /* 1: controlling terminal */ @@ -381,6 +383,7 @@ struct cdevsw cdevsw[] = { cdev_disk_init(1,diskmap), /* 102: disk mapper */ cdev_pppx_init(NPPPX,pppx), /* 103: pppx */ cdev_tun_init(NTUN,tap), /* 104: Ethernet tap */ + cdev_switch_init(NSWITCH,switch), /* 105: switch(4) control interface */ }; int nblkdev = nitems(bdevsw); diff --git a/sys/arch/hppa/hppa/conf.c b/sys/arch/hppa/hppa/conf.c index 9ef0253bc00..4f8e4b132c6 100644 --- a/sys/arch/hppa/hppa/conf.c +++ b/sys/arch/hppa/hppa/conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.c,v 1.64 2016/04/25 20:09:14 tedu Exp $ */ +/* $OpenBSD: conf.c,v 1.65 2016/09/02 17:06:12 goda Exp $ */ /*- * Copyright (c) 1991 The Regents of the University of California. @@ -116,6 +116,7 @@ cdev_decl(pci); #include "ucom.h" #include "fuse.h" +#include "switch.h" struct cdevsw cdevsw[] = { @@ -184,6 +185,7 @@ struct cdevsw cdevsw[] = cdev_pppx_init(NPPPX,pppx), /* 57: pppx */ cdev_fuse_init(NFUSE,fuse), /* 58: fuse */ cdev_tun_init(NTUN,tap), /* 59: Ethernet network tunnel */ + cdev_switch_init(NSWITCH,switch), /* 60: switch(4) control interface */ }; int nchrdev = nitems(cdevsw); diff --git a/sys/arch/i386/i386/conf.c b/sys/arch/i386/i386/conf.c index 6f7b31f99fe..63c6499fc50 100644 --- a/sys/arch/i386/i386/conf.c +++ b/sys/arch/i386/i386/conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.c,v 1.155 2016/04/25 20:09:14 tedu Exp $ */ +/* $OpenBSD: conf.c,v 1.156 2016/09/02 17:06:12 goda Exp $ */ /* $NetBSD: conf.c,v 1.75 1996/05/03 19:40:20 christos Exp $ */ /* @@ -177,6 +177,7 @@ cdev_decl(pci); #include "fuse.h" #include "pvbus.h" #include "ipmi.h" +#include "switch.h" struct cdevsw cdevsw[] = { @@ -289,6 +290,7 @@ struct cdevsw cdevsw[] = cdev_tun_init(NTUN,tap), /* 94: Ethernet network tunnel */ cdev_pvbus_init(NPVBUS,pvbus), /* 95: pvbus(4) control interface */ cdev_ipmi_init(NIPMI,ipmi), /* 96: ipmi */ + cdev_switch_init(NSWITCH,switch), /* 97: switch(4) control interface */ }; int nchrdev = nitems(cdevsw); diff --git a/sys/arch/landisk/landisk/conf.c b/sys/arch/landisk/landisk/conf.c index 48ea972a282..181e9b72763 100644 --- a/sys/arch/landisk/landisk/conf.c +++ b/sys/arch/landisk/landisk/conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.c,v 1.35 2016/04/25 20:09:14 tedu Exp $ */ +/* $OpenBSD: conf.c,v 1.36 2016/09/02 17:06:12 goda Exp $ */ /* * Copyright (c) 1994-1998 Mark Brinicombe. @@ -245,6 +245,7 @@ struct bdevsw bdevsw[] = { #include "vscsi.h" #include "pppx.h" #include "fuse.h" +#include "switch.h" struct cdevsw cdevsw[] = { cdev_cn_init(1,cn), /* 0: virtual console */ @@ -356,6 +357,7 @@ struct cdevsw cdevsw[] = { cdev_pppx_init(NPPPX,pppx), /* 102: pppx */ cdev_fuse_init(NFUSE,fuse), /* 103: fuse */ cdev_tun_init(NTUN,tap), /* 104: Ethernet network tap */ + cdev_switch_init(NSWITCH,switch), /* 105: switch(4) control interface */ }; int nblkdev = nitems(bdevsw); diff --git a/sys/arch/loongson/loongson/conf.c b/sys/arch/loongson/loongson/conf.c index 87bce553d57..d54f0c3242e 100644 --- a/sys/arch/loongson/loongson/conf.c +++ b/sys/arch/loongson/loongson/conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.c,v 1.21 2016/04/25 20:09:14 tedu Exp $ */ +/* $OpenBSD: conf.c,v 1.22 2016/09/02 17:06:12 goda Exp $ */ /* * Copyright (c) 1992, 1993 @@ -125,6 +125,7 @@ cdev_decl(pci); #include "vscsi.h" #include "pppx.h" #include "fuse.h" +#include "switch.h" struct cdevsw cdevsw[] = { @@ -207,6 +208,7 @@ struct cdevsw cdevsw[] = cdev_notdef(), /* 72: was USB scanners */ cdev_fuse_init(NFUSE,fuse), /* 73: fuse */ cdev_tun_init(NTUN,tap), /* 74: Ethernet network tunnel */ + cdev_switch_init(NSWITCH,switch), /* 75: switch(4) control interface */ }; int nchrdev = nitems(cdevsw); diff --git a/sys/arch/luna88k/luna88k/conf.c b/sys/arch/luna88k/luna88k/conf.c index b5e90357fa2..022e489f07e 100644 --- a/sys/arch/luna88k/luna88k/conf.c +++ b/sys/arch/luna88k/luna88k/conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.c,v 1.28 2016/04/25 20:09:14 tedu Exp $ */ +/* $OpenBSD: conf.c,v 1.29 2016/09/02 17:06:12 goda Exp $ */ /*- * Copyright (c) 1991 The Regents of the University of California. @@ -70,6 +70,7 @@ #include "vscsi.h" #include "pppx.h" #include "fuse.h" +#include "switch.h" struct bdevsw bdevsw[] = { @@ -156,6 +157,7 @@ struct cdevsw cdevsw[] = cdev_disk_init(1,diskmap), /* 54: disk mapper */ cdev_pppx_init(NPPPX,pppx), /* 55: pppx */ cdev_tun_init(NTUN,tap), /* 56: Ethernet network tunnel */ + cdev_switch_init(NSWITCH,switch), /* 57: switch(4) control interface */ }; int nchrdev = nitems(cdevsw); diff --git a/sys/arch/macppc/macppc/conf.c b/sys/arch/macppc/macppc/conf.c index ebd45e0c206..a77bccdf813 100644 --- a/sys/arch/macppc/macppc/conf.c +++ b/sys/arch/macppc/macppc/conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.c,v 1.65 2016/04/25 20:09:14 tedu Exp $ */ +/* $OpenBSD: conf.c,v 1.66 2016/09/02 17:06:12 goda Exp $ */ /* * Copyright (c) 1997 Per Fogelstrom @@ -125,6 +125,7 @@ cdev_decl(pci); #include "vscsi.h" #include "pppx.h" #include "fuse.h" +#include "switch.h" struct cdevsw cdevsw[] = { cdev_cn_init(1,cn), /* 0: virtual console */ @@ -224,6 +225,7 @@ struct cdevsw cdevsw[] = { cdev_tun_init(NTUN,tap), /* 86: Ethernet network tunnel */ cdev_drm_init(NDRM,drm), /* 87: drm */ cdev_fuse_init(NFUSE,fuse), /* 88: fuse */ + cdev_switch_init(NSWITCH,switch), /* 89: switch(4) control interface */ }; int nchrdev = nitems(cdevsw); diff --git a/sys/arch/octeon/octeon/conf.c b/sys/arch/octeon/octeon/conf.c index 50e1d874442..46c1f0d1326 100644 --- a/sys/arch/octeon/octeon/conf.c +++ b/sys/arch/octeon/octeon/conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.c,v 1.18 2016/07/05 12:53:40 visa Exp $ */ +/* $OpenBSD: conf.c,v 1.19 2016/09/02 17:06:12 goda Exp $ */ /* * Copyright (c) 1992, 1993 @@ -141,6 +141,7 @@ cdev_decl(pci); #include "pppx.h" #include "fuse.h" #include "openprom.h" +#include "switch.h" struct cdevsw cdevsw[] = { @@ -227,6 +228,7 @@ struct cdevsw cdevsw[] = cdev_notdef(), /* 72: was USB scanners */ cdev_notdef(), /* 73: fuse on other mips64 */ cdev_tun_init(NTUN,tap), /* 74: Ethernet network tunnel */ + cdev_switch_init(NSWITCH,switch), /* 75: switch(4) control interface */ }; int nchrdev = nitems(cdevsw); diff --git a/sys/arch/sgi/sgi/conf.c b/sys/arch/sgi/sgi/conf.c index 891253c2d0e..21508bc135a 100644 --- a/sys/arch/sgi/sgi/conf.c +++ b/sys/arch/sgi/sgi/conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.c,v 1.37 2016/04/25 20:09:14 tedu Exp $ */ +/* $OpenBSD: conf.c,v 1.38 2016/09/02 17:06:13 goda Exp $ */ /* * Copyright (c) 1992, 1993 @@ -126,6 +126,7 @@ cdev_decl(pci); #include "vscsi.h" #include "pppx.h" #include "fuse.h" +#include "switch.h" struct cdevsw cdevsw[] = { @@ -208,6 +209,7 @@ struct cdevsw cdevsw[] = cdev_notdef(), /* 72: was USB scanners */ cdev_fuse_init(NFUSE,fuse), /* 73: fuse */ cdev_tun_init(NTUN,tap), /* 74: Ethernet network tunnel */ + cdev_switch_init(NSWITCH,switch), /* 75: switch(4) control interface */ }; int nchrdev = nitems(cdevsw); diff --git a/sys/arch/socppc/socppc/conf.c b/sys/arch/socppc/socppc/conf.c index aee8351b3bb..c567012ad02 100644 --- a/sys/arch/socppc/socppc/conf.c +++ b/sys/arch/socppc/socppc/conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.c,v 1.26 2016/04/25 20:09:14 tedu Exp $ */ +/* $OpenBSD: conf.c,v 1.27 2016/09/02 17:06:13 goda Exp $ */ /* * Copyright (c) 1997 Per Fogelstrom @@ -107,6 +107,7 @@ cdev_decl(pci); #include "pppx.h" #include "hotplug.h" #include "fuse.h" +#include "switch.h" struct cdevsw cdevsw[] = { cdev_cn_init(1,cn), /* 0: virtual console */ @@ -202,6 +203,7 @@ struct cdevsw cdevsw[] = { cdev_hotplug_init(NHOTPLUG,hotplug), /* 84: devices hot plugging */ cdev_fuse_init(NFUSE,fuse), /* 85: fuse */ cdev_tun_init(NTUN,tap), /* 86: Ethernet network tunnel */ + cdev_switch_init(NSWITCH,switch), /* 87: switch(4) control interface */ }; int nchrdev = nitems(cdevsw); diff --git a/sys/arch/sparc64/sparc64/conf.c b/sys/arch/sparc64/sparc64/conf.c index b05cec2a8ec..211598eefe4 100644 --- a/sys/arch/sparc64/sparc64/conf.c +++ b/sys/arch/sparc64/sparc64/conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.c,v 1.77 2016/04/25 20:09:14 tedu Exp $ */ +/* $OpenBSD: conf.c,v 1.78 2016/09/02 17:06:13 goda Exp $ */ /* $NetBSD: conf.c,v 1.17 2001/03/26 12:33:26 lukem Exp $ */ /* @@ -115,6 +115,7 @@ cdev_decl(pci); #include "vscsi.h" #include "pppx.h" #include "fuse.h" +#include "switch.h" struct bdevsw bdevsw[] = { @@ -290,6 +291,7 @@ struct cdevsw cdevsw[] = cdev_vdsp_init(NVDSP,vdsp), /* 133: vdsp */ cdev_fuse_init(NFUSE,fuse), /* 134: fuse */ cdev_tun_init(NTUN,tap), /* 135: Ethernet network tunnel */ + cdev_switch_init(NSWITCH,switch), /* 136: switch(4) control interface */ }; int nchrdev = nitems(cdevsw); diff --git a/sys/sys/conf.h b/sys/sys/conf.h index 874171b83a5..fb6e452e9a0 100644 --- a/sys/sys/conf.h +++ b/sys/sys/conf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.h,v 1.141 2016/04/26 07:08:20 deraadt Exp $ */ +/* $OpenBSD: conf.h,v 1.142 2016/09/02 17:06:13 goda Exp $ */ /* $NetBSD: conf.h,v 1.33 1996/05/03 20:03:32 christos Exp $ */ /*- @@ -270,6 +270,13 @@ extern struct cdevsw cdevsw[]; 0, dev_init(c,n,poll), (dev_type_mmap((*))) enodev, \ 0, 0, dev_init(c,n,kqfilter) } +/* open, close, read, write, ioctl, poll, kqfilter -- XXX should be generic device */ +#define cdev_switch_init(c,n) { \ + dev_init(c,n,open), dev_init(c,n,close), dev_init(c,n,read), \ + dev_init(c,n,write), dev_init(c,n,ioctl), (dev_type_stop((*))) enodev, \ + 0, dev_init(c,n,poll), (dev_type_mmap((*))) enodev, \ + 0, 0, dev_init(c,n,kqfilter) } + /* open, close, ioctl, poll, kqfilter -- XXX should be generic device */ #define cdev_vscsi_init(c,n) { \ dev_init(c,n,open), dev_init(c,n,close), \ @@ -576,6 +583,7 @@ cdev_decl(pf); cdev_decl(tun); cdev_decl(tap); +cdev_decl(switch); cdev_decl(pppx); cdev_decl(random); |