Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/wsconscfg Make it possible to add a mux.



details:   https://anonhg.NetBSD.org/src/rev/cc763c694855
branches:  trunk
changeset: 475019:cc763c694855
user:      augustss <augustss%NetBSD.org@localhost>
date:      Thu Jul 29 18:24:09 1999 +0000

description:
Make it possible to add a mux.

diffstat:

 usr.sbin/wsconscfg/wsconscfg.8 |  14 +++++++++++---
 usr.sbin/wsconscfg/wsconscfg.c |  36 +++++++++++++++++++++++++-----------
 2 files changed, 36 insertions(+), 14 deletions(-)

diffs (123 lines):

diff -r 981fa7279568 -r cc763c694855 usr.sbin/wsconscfg/wsconscfg.8
--- a/usr.sbin/wsconscfg/wsconscfg.8    Thu Jul 29 18:20:02 1999 +0000
+++ b/usr.sbin/wsconscfg/wsconscfg.8    Thu Jul 29 18:24:09 1999 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: wsconscfg.8,v 1.5 1999/05/15 14:45:06 drochner Exp $
+.\"    $NetBSD: wsconscfg.8,v 1.6 1999/07/29 18:24:09 augustss Exp $
 .\"
 .Dd January 12, 1999
 .Os
@@ -11,6 +11,7 @@
 .Op Fl f Ar <ctldev>
 .Op Fl d Op Fl F
 .Op Fl k
+.Op Fl m
 .Op Fl t Ar <type>
 .Op Fl e Ar <emul>
 .Ar index
@@ -48,8 +49,12 @@
 .Fl k
 flag, the keyboard specified by
 .Dq index
-(or the currently connected one, if none is given) will be detached from
-the wscons display.
+will be detached from the wscons display.
+With the
+.Fl m
+flag, the multiplexor specified by
+.Dq index
+will be detached from the wscons display.
 .It Fl F
 Force deleting of a terminal even if it is in use by a user space program.
 .It Fl k
@@ -57,6 +62,9 @@
 Without other flags, a keyboard will be attached to the display device. The
 .Dq index
 argument can be omitted, in this case the first free keyboard will be used.
+.It Fl m
+Do multiplexor related operations instead of virtual screen configuration.
+Without other flags, a multiplexor will be attached to the display device.
 .It Fl t Ar type
 Specify a screen type to use. Screen types refer to display format, colour
 depth and other low-level display properties. Valid
diff -r 981fa7279568 -r cc763c694855 usr.sbin/wsconscfg/wsconscfg.c
--- a/usr.sbin/wsconscfg/wsconscfg.c    Thu Jul 29 18:20:02 1999 +0000
+++ b/usr.sbin/wsconscfg/wsconscfg.c    Thu Jul 29 18:24:09 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wsconscfg.c,v 1.3 1999/05/15 14:24:45 drochner Exp $ */
+/* $NetBSD: wsconscfg.c,v 1.4 1999/07/29 18:24:10 augustss Exp $ */
 
 /*
  * Copyright (c) 1999
@@ -52,8 +52,8 @@
        extern char *__progname;
 
        (void)fprintf(stderr,
-                     "Usage: %s [-f wsdev] [-d [-F]] [-k] [-t type] [-e emul]"
-                     " {vt | [kbd]}\n", __progname);
+                     "Usage: %s [-f wsdev] [-d [-F]] [-k] [-m] [-t type]"
+                     "[-e emul] {vt | [kbd] | [mux]}\n", __progname);
        exit(1);
 }
 
@@ -63,19 +63,20 @@
        char **argv;
 {
        char *wsdev;
-       int c, delete, kbd, idx, wsfd, res;
+       int c, delete, kbd, idx, wsfd, res, mux;
        struct wsdisplay_addscreendata asd;
        struct wsdisplay_delscreendata dsd;
-       struct wsdisplay_kbddata kd;
+       struct wsmux_device wmd;
 
        wsdev = DEFDEV;
        delete = 0;
        kbd = 0;
+       mux = 0;
        asd.screentype = 0;
        asd.emul = 0;
        dsd.flags = 0;
 
-       while ((c = getopt(argc, argv, "f:dkt:e:F")) != -1) {
+       while ((c = getopt(argc, argv, "f:dkmt:e:F")) != -1) {
                switch (c) {
                case 'f':
                        wsdev = optarg;
@@ -86,6 +87,10 @@
                case 'k':
                        kbd++;
                        break;
+               case 'm':
+                       mux++;
+                       kbd++;
+                       break;
                case 't':
                        asd.screentype = optarg;
                        break;
@@ -116,11 +121,20 @@
                err(2, wsdev);
 
        if (kbd) {
-               kd.op = delete ? WSDISPLAY_KBD_DEL : WSDISPLAY_KBD_ADD;
-               kd.idx = idx;
-               res = ioctl(wsfd, WSDISPLAYIO_SETKEYBOARD, &kd);
-               if (res < 0)
-                       err(3, "WSDISPLAYIO_SETKEYBOARD");
+               if (mux)
+                       wmd.type = WSMUX_MUX;
+               else
+                       wmd.type = WSMUX_KBD;
+               wmd.idx = idx;
+               if (delete) {
+                       res = ioctl(wsfd, WSMUX_REMOVE_DEVICE, &wmd);
+                       if (res < 0)
+                               err(3, "WSMUX_REMOVE_DEVICE");
+               } else {
+                       res = ioctl(wsfd, WSMUX_ADD_DEVICE, &wmd);
+                       if (res < 0)
+                               err(3, "WSMUX_ADD_DEVICE");
+               }
        } else if (delete) {
                dsd.idx = idx;
                res = ioctl(wsfd, WSDISPLAYIO_DELSCREEN, &dsd);



Home | Main Index | Thread Index | Old Index